Bug 1516075 - Port bug 1497995: Changed arguments of nsDocShellLoadState CTOR. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Sat, 22 Dec 2018 10:13:39 +0100
changeset 33196 c707d32abbd6
parent 33195 033ab4ab1fa4
child 33197 6ac307a0fdf9
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1516075, 1497995
Bug 1516075 - Port bug 1497995: Changed arguments of nsDocShellLoadState CTOR. rs=bustage-fix
mailnews/base/src/nsMessenger.cpp
mailnews/base/util/nsMsgMailNewsUrl.cpp
mailnews/imap/src/nsImapService.cpp
mailnews/local/src/nsMailboxService.cpp
mailnews/news/src/nsNntpService.cpp
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -584,18 +584,17 @@ nsMessenger::LoadURL(mozIDOMWindowProxy 
         }
       }
     }
   }
 
   AddMsgUrlToNavigateHistory(aURL);
   mNavigatingToUri.Truncate();
   mLastDisplayURI = aURL; // Remember the last uri we displayed.
-  RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-  loadState->SetURI(uri);
+  RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(uri);
   loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
   loadState->SetFirstParty(true);
   loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
   return mDocShell->LoadURI(loadState);
 }
 
 NS_IMETHODIMP nsMessenger::SaveAttachmentToFile(nsIFile *aFile,
                                                 const nsACString &aURL,
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -879,18 +879,17 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetMimeH
     mMimeHeaders = mimeHeaders;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::LoadURI(nsIDocShell* docShell,
                                         uint32_t aLoadFlags)
 {
   NS_ENSURE_ARG_POINTER(docShell);
-  RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-  loadState->SetURI(this);
+  RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(this);
   loadState->SetLoadFlags(aLoadFlags);
   loadState->SetLoadType(MAKE_LOAD_TYPE(LOAD_NORMAL, aLoadFlags));
   loadState->SetFirstParty(false);
   loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
   return docShell->LoadURI(loadState);
 }
 
 #define SAVE_BUF_SIZE FILE_IO_BUFFER_SIZE
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -620,18 +620,17 @@ nsresult nsImapService::FetchMimePart(ns
     // and the provided stream listener....
 
     nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
     if (NS_SUCCEEDED(rv) && docShell)
     {
       // DIRTY LITTLE HACK --> if we are opening an attachment we want the docshell to
       // treat this load as if it were a user click event. Then the dispatching stuff will be much
       // happier.
-      RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-      loadState->SetURI(url);
+      RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(url);
       loadState->SetLoadFlags(aImapAction == nsImapUrl::nsImapOpenMimePart
                                 ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
                                 : nsIWebNavigation::LOAD_FLAGS_NONE);
       if (aImapAction == nsImapUrl::nsImapOpenMimePart)
         loadState->SetLoadType(LOAD_LINK);
       loadState->SetFirstParty(false);
       loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
       rv = docShell->LoadURI(loadState);
@@ -1059,18 +1058,17 @@ nsresult nsImapService::GetMessageFromUr
         aImapServer(do_QueryInterface(aMsgIncomingServer, &rv));
       if (NS_SUCCEEDED(rv) && aImapServer)
         aImapServer->PseudoInterruptMsgLoad(aImapMailFolder, aMsgWindow, &interrupted);
     }
   }
   if (NS_SUCCEEDED(rv) && docShell)
   {
     NS_ASSERTION(!aConvertDataToText, "can't convert to text when using docshell");
-    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-    loadState->SetURI(url);
+    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(url);
     loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
     loadState->SetFirstParty(false);
     loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
     rv = docShell->LoadURI(loadState);
   }
   else
   {
     nsCOMPtr<nsIStreamListener> streamListener = do_QueryInterface(aDisplayConsumer, &rv);
--- a/mailnews/local/src/nsMailboxService.cpp
+++ b/mailnews/local/src/nsMailboxService.cpp
@@ -231,18 +231,17 @@ nsresult nsMailboxService::FetchMessage(
   // instead of running the mailbox url like we used to, let's try to run the url in the docshell...
   nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
   // if we were given a docShell, run the url in the docshell..otherwise just run it normally.
   if (NS_SUCCEEDED(rv) && docShell)
   {
     // DIRTY LITTLE HACK --> if we are opening an attachment we want the docshell to
     // treat this load as if it were a user click event. Then the dispatching stuff will be much
     // happier.
-    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-    loadState->SetURI(url);
+    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(url);
     loadState->SetLoadFlags(mailboxAction == nsIMailboxUrl::ActionFetchPart
                               ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
                               : nsIWebNavigation::LOAD_FLAGS_NONE);
     if (mailboxAction == nsIMailboxUrl::ActionFetchPart)
       loadState->SetLoadType(LOAD_LINK);
     loadState->SetFirstParty(false);
     loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
     rv = docShell->LoadURI(loadState);
@@ -364,18 +363,17 @@ NS_IMETHODIMP nsMailboxService::OpenAtta
   // try to run the url in the docshell...
   nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
   // if we were given a docShell, run the url in the docshell..otherwise just run it normally.
   if (NS_SUCCEEDED(rv) && docShell)
   {
     // DIRTY LITTLE HACK --> since we are opening an attachment we want the docshell to
     // treat this load as if it were a user click event. Then the dispatching stuff will be much
     // happier.
-    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-    loadState->SetURI(URL);
+    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(URL);
     loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
     loadState->SetLoadType(LOAD_LINK);
     loadState->SetFirstParty(false);
     loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
     return docShell->LoadURI(loadState);
   }
   return RunMailboxUrl(URL, aDisplayConsumer);
 
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -304,18 +304,17 @@ nsresult nsNntpService::GetMessageFromUr
   // in order to display it. If it isn't a docshell then just run the news url
   // like we would any other news url.
   nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
   if (NS_SUCCEEDED(rv))
   {
     // DIRTY LITTLE HACK --> if we are opening an attachment we want the docshell to
     // treat this load as if it were a user click event. Then the dispatching stuff will be much
     // happier.
-    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-    loadState->SetURI(aUrl);
+    RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(aUrl);
     loadState->SetLoadFlags(mOpenAttachmentOperation
                               ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
                               : nsIWebNavigation::LOAD_FLAGS_NONE);
     if (mOpenAttachmentOperation)
       loadState->SetLoadType(LOAD_LINK);
     loadState->SetFirstParty(false);
     loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
     rv = docShell->LoadURI(loadState);
@@ -444,18 +443,17 @@ NS_IMETHODIMP nsNntpService::OpenAttachm
 //    if (msgMessageUrl)
 //      msgMessageUrl->SetOriginalSpec(newsUrl.get());
     // set up the url listener
     if (aUrlListener)
       msgUrl->RegisterListener(aUrlListener);
 
     nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
     if (NS_SUCCEEDED(rv) && docShell) {
-      RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-      loadState->SetURI(url);
+      RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(url);
       loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
       loadState->SetLoadType(LOAD_LINK);
       loadState->SetFirstParty(false);
       loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
       return docShell->LoadURI(loadState);
     } else {
       return RunNewsUrl(url, aMsgWindow, aDisplayConsumer);
     }