NS_ENSURE_SUCCESS ( nsComponentManager::CreateInstance(kXULControllersCID, nsnull, NS_GET_IID(nsIControllers), getter_AddRefs(mControllers)), NS_ERROR_FAILURE); if (!mControllers) { return NS_ERROR_NULL_POINTER; }
nsresult rv; mControllers = do_CreateInstance(kXULControllersCID, &rv); NS_ENSURE_SUCCESS(rv, rv);
nsHTMLTextAreaElement::GetControllers(nsIControllers** aResult){  NS_ENSURE_ARG_POINTER(aResult);  if (!mControllers)  {    NS_ENSURE_SUCCESS (      nsComponentManager::CreateInstance(kXULControllersCID,                                         nsnull,                                         NS_GET_IID(nsIControllers),                                         getter_AddRefs(mControllers)),      NS_ERROR_FAILURE);    if (!mControllers) { return NS_ERROR_NULL_POINTER; }    nsresult rv;    nsCOMPtr<nsIController> controller = do_CreateInstance("@mozilla.org/editor/editorcontroller;1", &rv);    if (NS_FAILED(rv))      return rv;    mControllers->AppendController(controller);  }  *aResult = mControllers;  NS_IF_ADDREF(*aResult);  return NS_OK;}