Bug 1334954 - Eliminate nullptr in out parameter for nsIURI calling StreamMessage(). r=jorgk a=jorgk
authorR Kent James <rkent@caspia.com>
Sun, 29 Jan 2017 22:24:00 +0100
changeset 27372 9fc7e7325d3d36466608af568746cd6d785a55a0
parent 27371 d1ad7b83b1fea4570710b9efbff8fa6397b40a5f
child 27373 487b7acf7c872e9a1fad5c9acd705aab86900341
push id1878
push userclokep@gmail.com
push dateTue, 07 Mar 2017 14:18:40 +0000
treeherdercomm-beta@ab59ffd05575 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, jorgk
bugs1334954
Bug 1334954 - Eliminate nullptr in out parameter for nsIURI calling StreamMessage(). r=jorgk a=jorgk
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMsgFolderCompactor.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -2892,19 +2892,20 @@ nsDelAttachListener::StartProcessing(nsM
   // stream this message to our listener converting it via the attachment mime
   // converter. The listener will just write the converted message straight to disk.
   nsCOMPtr<nsISupports> listenerSupports;
   rv = this->QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(listenerSupports));
   NS_ENSURE_SUCCESS(rv,rv);
   nsCOMPtr<nsIUrlListener> listenerUrlListener = do_QueryInterface(listenerSupports, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
+  nsCOMPtr<nsIURI> dummyNull;
   rv = mMessageService->StreamMessage(messageUri, listenerSupports, mMsgWindow,
                                       listenerUrlListener, true, sHeader,
-                                      false, nullptr);
+                                      false, getter_AddRefs(dummyNull));
   NS_ENSURE_SUCCESS(rv,rv);
 
   return NS_OK;
 }
 
 // ------------------------------------
 
 NS_IMETHODIMP
--- a/mailnews/base/src/nsMsgFolderCompactor.cpp
+++ b/mailnews/base/src/nsMsgFolderCompactor.cpp
@@ -1027,18 +1027,19 @@ nsresult nsOfflineStoreCompactState::Cop
     }
     m_messageUri.Truncate(); // clear the previous message uri
     rv = BuildMessageURI(m_baseMessageUri.get(), m_keyArray->m_keys[m_curIndex],
                                   m_messageUri);
     NS_ENSURE_SUCCESS(rv, rv);
     m_startOfMsg = true;
     nsCOMPtr<nsISupports> thisSupports;
     QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(thisSupports));
+    nsCOMPtr<nsIURI> dummyNull;
     rv = m_messageService->StreamMessage(m_messageUri.get(), thisSupports, m_window, nullptr,
-                                    false, EmptyCString(), true, nullptr);
+                                    false, EmptyCString(), true, getter_AddRefs(dummyNull));
     // if copy fails, we clear the offline flag on the source message.
     if (NS_FAILED(rv))
     {
       nsCOMPtr<nsIMsgDBHdr> hdr;
       GetMessage(getter_AddRefs(hdr));
       if (hdr)
       {
         uint32_t resultFlags;
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -958,20 +958,21 @@ NS_IMETHODIMP nsMsgComposeService::Reply
   // <folder uri>?messageId=<messageId>&subject=<subject>
   nsCOMPtr <nsIMsgMessageService> msgService;
   rv = GetMessageServiceFromURI(templateMsgHdrUri, getter_AddRefs(msgService));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupports> listenerSupports;
   helper->QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(listenerSupports));
 
+  nsCOMPtr<nsIURI> dummyNull;
   rv = msgService->StreamMessage(templateMsgHdrUri.get(), listenerSupports,
                                  aMsgWindow, helper,
                                  false, // convert data
-                                 EmptyCString(), false, nullptr);
+                                 EmptyCString(), false, getter_AddRefs(dummyNull));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgFolder> folder;
   aMsgHdr->GetFolder(getter_AddRefs(folder));
   if (!folder)
     return NS_ERROR_NULL_POINTER;
 
   // We're sending a new message. Conceptually it's a reply though, so mark the
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -1312,19 +1312,20 @@ nsresult nsBayesianFilter::tokenizeMessa
 {
     NS_ENSURE_ARG_POINTER(aMessageURI);
 
     nsCOMPtr <nsIMsgMessageService> msgService;
     nsresult rv = GetMessageServiceFromURI(nsDependentCString(aMessageURI), getter_AddRefs(msgService));
     NS_ENSURE_SUCCESS(rv, rv);
 
     aAnalyzer->setSource(aMessageURI);
+    nsCOMPtr<nsIURI> dummyNull;
     return msgService->StreamMessage(aMessageURI, aAnalyzer->mTokenListener,
                                      aMsgWindow, nullptr, true /* convert data */,
-                                     NS_LITERAL_CSTRING("filter"), false, nullptr);
+                                     NS_LITERAL_CSTRING("filter"), false, getter_AddRefs(dummyNull));
 }
 
 // a TraitAnalysis is the per-token representation of the statistical
 // calculations, basically created to group information that is then
 // sorted by mDistance
 struct TraitAnalysis
 {
   uint32_t mTokenIndex;