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);
nsHTMLInputElement::GetControllers(nsIControllers** aResult){  NS_ENSURE_ARG_POINTER(aResult);  PRInt32 type;  GetType(&type);  //XXX: what about type "file"?  if (NS_FORM_INPUT_TEXT == type || NS_FORM_INPUT_PASSWORD == type)  {    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;}