Bug 1229649 - Eliminate nulls in out parameter for nsIURI, rs=jcranmer

This commit is contained in:
R Kent James 2015-12-05 01:41:11 -08:00
Родитель 35b091b05f
Коммит 976fab3715
7 изменённых файлов: 43 добавлений и 16 удалений

Просмотреть файл

@ -438,7 +438,9 @@ nsMessenger::OpenURL(const nsACString& aURL)
if (NS_SUCCEEDED(rv) && messageService)
{
messageService->DisplayMessage(PromiseFlatCString(aURL).get(), mDocShell, mMsgWindow, nullptr, nullptr, nullptr);
nsCOMPtr<nsIURI> dummyNull;
messageService->DisplayMessage(PromiseFlatCString(aURL).get(), mDocShell,
mMsgWindow, nullptr, nullptr, getter_AddRefs(dummyNull));
AddMsgUrlToNavigateHistory(aURL);
mLastDisplayURI = aURL; // remember the last uri we displayed....
return NS_OK;
@ -712,10 +714,16 @@ nsresult nsMessenger::SaveAttachment(nsIFile *aFile,
getter_AddRefs(convertedListener));
}
#endif
nsCOMPtr<nsIURI> dummyNull;
if (fetchService)
rv = fetchService->FetchMimePart(URL, fullMessageUri.get(), convertedListener, mMsgWindow, saveListener, nullptr);
rv = fetchService->FetchMimePart(URL, fullMessageUri.get(),
convertedListener, mMsgWindow,
saveListener, getter_AddRefs(dummyNull));
else
rv = messageService->DisplayMessage(fullMessageUri.get(), convertedListener, mMsgWindow, nullptr, nullptr, nullptr);
rv = messageService->DisplayMessage(fullMessageUri.get(),
convertedListener, mMsgWindow,
nullptr, nullptr,
getter_AddRefs(dummyNull));
} // if we got a message service
} // if we created a url
@ -1055,8 +1063,9 @@ nsMessenger::SaveAs(const nsACString& aURI, bool aAsFile,
if (saveAsFileType == EML_FILE_TYPE)
{
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->SaveMessageToDisk(PromiseFlatCString(aURI).get(), saveAsFile, false,
urlListener, nullptr,
urlListener, getter_AddRefs(dummyNull),
true, mMsgWindow);
}
else
@ -1120,8 +1129,9 @@ nsMessenger::SaveAs(const nsACString& aURI, bool aAsFile,
if (NS_FAILED(rv))
goto done;
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->DisplayMessage(urlString.get(), convertedListener, mMsgWindow,
nullptr, nullptr, nullptr);
nullptr, nullptr, getter_AddRefs(dummyNull));
}
}
else
@ -1160,9 +1170,10 @@ nsMessenger::SaveAs(const nsACString& aURI, bool aAsFile,
if (NS_FAILED(rv))
goto done;
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->SaveMessageToDisk(PromiseFlatCString(aURI).get(), tmpFile,
needDummyHeader,
urlListener, nullptr,
urlListener, getter_AddRefs(dummyNull),
canonicalLineEnding, mMsgWindow);
}
@ -1398,9 +1409,10 @@ nsMessenger::SaveMessages(uint32_t aCount,
}
// Ok, now save the message.
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->SaveMessageToDisk(aMessageUriArray[i],
saveToFile, false,
urlListener, nullptr,
urlListener, getter_AddRefs(dummyNull),
true, mMsgWindow);
if (NS_FAILED(rv)) {
NS_IF_RELEASE(saveListener);
@ -1594,8 +1606,9 @@ NS_IMETHODIMP nsMessenger::SetDocumentCharset(const nsACString& aCharacterSet)
if (NS_SUCCEEDED(rv) && messageService)
{
nsCOMPtr<nsIURI> dummyNull;
messageService->DisplayMessage(mLastDisplayURI.get(), mDocShell, mMsgWindow, nullptr,
PromiseFlatCString(aCharacterSet).get(), nullptr);
PromiseFlatCString(aCharacterSet).get(), getter_AddRefs(dummyNull));
}
}

Просмотреть файл

@ -479,8 +479,11 @@ nsMsgPrintEngine::FireThatLoadOperation(const nsString& uri)
rv = GetMessageServiceFromURI(uriCStr, getter_AddRefs(messageService));
}
if (NS_SUCCEEDED(rv) && messageService)
rv = messageService->DisplayMessageForPrinting(uriCStr.get(), mDocShell, nullptr, nullptr, nullptr);
if (NS_SUCCEEDED(rv) && messageService) {
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->DisplayMessageForPrinting(uriCStr.get(), mDocShell, nullptr, nullptr,
getter_AddRefs(dummyNull));
}
//If it's not something we know about, then just load try loading it directly.
else
{

Просмотреть файл

@ -582,7 +582,9 @@ nsMsgAttachmentHandler::SnarfMsgAttachment(nsMsgCompFields *compFields)
if (NS_FAILED(rv))
goto done;
rv = messageService->DisplayMessage(uri.get(), convertedListener, nullptr, nullptr, nullptr, nullptr);
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->DisplayMessage(uri.get(), convertedListener, nullptr, nullptr, nullptr,
getter_AddRefs(dummyNull));
}
}
done:

Просмотреть файл

@ -1617,8 +1617,10 @@ nsMsgComposeService::RunMessageThroughMimeDraft(
// Now, just plug the two together and get the hell out of the way!
nsCOMPtr<nsIStreamListener> streamListener = do_QueryInterface(mimeConverter);
nsCOMPtr<nsIURI> dummyNull;
return messageService->DisplayMessage(PromiseFlatCString(aMsgURI).get(), streamListener,
aMsgWindow, nullptr, mailCharset.get(), nullptr);;
aMsgWindow, nullptr, mailCharset.get(),
getter_AddRefs(dummyNull));
}
NS_IMETHODIMP

Просмотреть файл

@ -676,9 +676,11 @@ nsMsgSendLater::StartNextMailFileSend(nsresult prevStatus)
// operation
AddRef();
nsCOMPtr<nsIURI> dummyNull;
rv = messageService->DisplayMessage(messageURI.get(),
static_cast<nsIStreamListener*>(this),
nullptr, nullptr, nullptr, nullptr);
nullptr, nullptr, nullptr,
getter_AddRefs(dummyNull));
Release();

Просмотреть файл

@ -8210,8 +8210,10 @@ nsImapMailFolder::CopyStreamMessage(nsIMsgDBHdr* message,
statusFeedback->ShowProgress(percent);
}
}
nsCOMPtr<nsIURI> dummyNull;
rv = m_copyState->m_msgService->CopyMessage(uri.get(), streamListener,
isMove && !m_copyState->m_isCrossServerOp, nullptr, aMsgWindow, nullptr);
isMove && !m_copyState->m_isCrossServerOp, nullptr, aMsgWindow,
getter_AddRefs(dummyNull));
if (NS_FAILED(rv))
MOZ_LOG(IMAP, mozilla::LogLevel::Info, ("CopyMessage failed: uri %s\n", uri.get()));
}

Просмотреть файл

@ -2795,11 +2795,12 @@ nsresult nsMsgLocalMailFolder::CopyMessagesTo(nsIArray *messages, nsTArray<nsMsg
nsCOMPtr <nsIMsgLocalMailFolder> srcLocalFolder = do_QueryInterface(srcFolder);
if (srcLocalFolder)
StartMessage();
nsCOMPtr<nsIURI> dummyNull;
rv = mCopyState->m_messageService->CopyMessages(keyArray.Length(),
keyArray.Elements(),
srcFolder, streamListener,
isMove, nullptr, aMsgWindow,
nullptr);
getter_AddRefs(dummyNull));
}
return rv;
}
@ -2840,7 +2841,9 @@ nsresult nsMsgLocalMailFolder::CopyMessageTo(nsISupports *message,
{
nsCOMPtr<nsIStreamListener> streamListener(do_QueryInterface(copyStreamListener, &rv));
NS_ENSURE_SUCCESS(rv, NS_ERROR_NO_INTERFACE);
rv = mCopyState->m_messageService->CopyMessage(uri.get(), streamListener, isMove, nullptr, aMsgWindow, nullptr);
nsCOMPtr<nsIURI> dummyNull;
rv = mCopyState->m_messageService->CopyMessage(uri.get(), streamListener, isMove, nullptr, aMsgWindow,
getter_AddRefs(dummyNull));
}
return rv;
}