Bug 1543943 - Follow-up: Remove needless null checks as suggested by :bz. r=me
authorJorg K <jorgk@jorgk.com>
Fri, 12 Apr 2019 22:32:01 +0200
changeset 26329 e1c03b7fdd86d87f5396bd0cf3cba39bc22b9690
parent 26328 bc622f0bd3ece71ed2395eb869682322a7ceac2f
child 26330 e614af52388152d486513d7ff5b511c2a69fcb2e
push id15788
push usermozilla@jorgk.com
push dateFri, 12 Apr 2019 22:02:02 +0000
treeherdercomm-central@826410daf770 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1543943
Bug 1543943 - Follow-up: Remove needless null checks as suggested by :bz. r=me
mailnews/addrbook/src/nsAbContentHandler.cpp
mailnews/base/src/nsMsgProgress.cpp
mailnews/news/src/nsNNTPNewsgroupList.cpp
--- a/mailnews/addrbook/src/nsAbContentHandler.cpp
+++ b/mailnews/addrbook/src/nsAbContentHandler.cpp
@@ -67,17 +67,16 @@ nsAbContentHandler::HandleContent(const 
                                                  0, unescapedData);
 
             if (!aWindowContext)
                 return NS_ERROR_FAILURE;
 
             nsCOMPtr<mozIDOMWindowProxy> domWindow = do_GetInterface(aWindowContext);
             NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
             nsCOMPtr<nsPIDOMWindowOuter> parentWindow = nsPIDOMWindowOuter::From(domWindow);
-            NS_ENSURE_ARG_POINTER(parentWindow);
 
             nsCOMPtr<nsIAbManager> ab =
               do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
             NS_ENSURE_SUCCESS(rv, rv);
 
             nsCOMPtr <nsIAbCard> cardFromVCard;
             rv = ab->EscapedVCardToAbCard(unescapedData.get(),
                                           getter_AddRefs(cardFromVCard));
@@ -169,17 +168,16 @@ nsAbContentHandler::OnStreamComplete(nsI
       nsCOMPtr <nsIAbCard> cardFromVCard;
       rv = ab->EscapedVCardToAbCard(vCard.get(),
                                     getter_AddRefs(cardFromVCard));
       NS_ENSURE_SUCCESS(rv, rv);
 
       nsCOMPtr<mozIDOMWindowProxy> domWindow = do_GetInterface(aContext);
       NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
       nsCOMPtr<nsPIDOMWindowOuter> parentWindow = nsPIDOMWindowOuter::From(domWindow);
-      NS_ENSURE_ARG_POINTER(parentWindow);
 
       nsCOMPtr<nsPIDOMWindowOuter> dialogWindow;
       rv = parentWindow->OpenDialog(
            NS_LITERAL_STRING("chrome://messenger/content/addressbook/abNewCardDialog.xul"),
            EmptyString(),
            NS_LITERAL_STRING("chrome,resizable=no,titlebar,modal,centerscreen"),
            cardFromVCard, getter_AddRefs(dialogWindow));
     }
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -48,17 +48,16 @@ NS_IMETHODIMP nsMsgProgress::OpenProgres
   {
     SetMsgWindow(aMsgWindow);
     aMsgWindow->SetStatusFeedback(this);
   }
 
   NS_ENSURE_ARG_POINTER(dialogURL);
   NS_ENSURE_ARG_POINTER(parentDOMWindow);
   nsCOMPtr<nsPIDOMWindowOuter> parent = nsPIDOMWindowOuter::From(parentDOMWindow);
-  NS_ENSURE_ARG_POINTER(parent);
 
   // Set up window.arguments[0]...
   nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsInterfacePointer> ifptr =
     do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/news/src/nsNNTPNewsgroupList.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp
@@ -222,17 +222,16 @@ openWindow(nsIMsgWindow *aMsgWindow, con
   nsCOMPtr<nsIDocShell> docShell;
   rv = aMsgWindow->GetRootDocShell(getter_AddRefs(docShell));
   if (NS_FAILED(rv))
       return rv;
 
   nsCOMPtr<mozIDOMWindowProxy> domWindow(do_GetInterface(docShell));
   NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
   nsCOMPtr<nsPIDOMWindowOuter> parentWindow = nsPIDOMWindowOuter::From(domWindow);
-  NS_ENSURE_ARG_POINTER(parentWindow);
 
   nsCOMPtr<nsISupportsInterfacePointer> ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   ifptr->SetData(param);
   ifptr->SetDataIID(&NS_GET_IID(nsINewsDownloadDialogArgs));
 
   nsCOMPtr<nsPIDOMWindowOuter> dialogWindow;