Bug 1500347 - Backed out changeset 3a91ffa3617c since ported bug 1492648 was backed out. a=backout
authorJorg K <jorgk@jorgk.com>
Fri, 19 Oct 2018 15:22:10 +0200
changeset 33424 c7b5816c507193e924cbf75b26d25d062579b865
parent 33423 52e953facdcf2f57945f27550603d8b0cb72d796
child 33425 66f690f4e070f2809fa2ee855ddf70aef1a846b1
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersbackout
bugs1500347, 1492648
Bug 1500347 - Backed out changeset 3a91ffa3617c since ported bug 1492648 was backed out. a=backout
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
@@ -45,17 +45,16 @@
 #endif
 
 /* for access to docshell */
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIWebNavigation.h"
 #include "nsContentUtils.h"
-#include "nsDocShellLoadState.h"
 
 // mail
 #include "nsIMsgMailNewsUrl.h"
 #include "nsMsgBaseCID.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgMailSession.h"
 #include "nsIMailboxUrl.h"
 #include "nsIMsgFolder.h"
@@ -586,21 +585,17 @@ nsMessenger::LoadURL(mozIDOMWindowProxy 
         }
       }
     }
   }
 
   AddMsgUrlToNavigateHistory(aURL);
   mNavigatingToUri.Truncate();
   mLastDisplayURI = aURL; // Remember the last uri we displayed.
-  RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
-  loadState->SetURI(uri);
-  loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
-  loadState->SetFirstParty(true);
-  return mDocShell->LoadURI(loadState);
+  return mDocShell->LoadURI(uri, nullptr, nsIWebNavigation::LOAD_FLAGS_NONE, true);
 }
 
 NS_IMETHODIMP nsMessenger::SaveAttachmentToFile(nsIFile *aFile,
                                                 const nsACString &aURL,
                                                 const nsACString &aMessageUri,
                                                 const nsACString &aContentType,
                                                 nsIUrlListener *aListener)
 {
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -22,17 +22,16 @@
 #include "nsNetUtil.h"
 #include "nsIFile.h"
 #include "prmem.h"
 #include <time.h>
 #include "nsMsgUtils.h"
 #include "mozilla/Services.h"
 #include "nsProxyRelease.h"
 #include "mozilla/Encoding.h"
-#include "nsDocShellLoadState.h"
 
 nsMsgMailNewsUrl::nsMsgMailNewsUrl()
 {
   // nsIURI specific state
   m_runningUrl = false;
   m_updatingFolder = false;
   m_msgIsInLocalCache = false;
   m_suppressErrorMsgs = false;
@@ -790,21 +789,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);
-  loadState->SetLoadFlags(aLoadFlags);
-  loadState->SetFirstParty(false);
-  return docShell->LoadURI(loadState);
+  return docShell->LoadURI(this, nullptr, aLoadFlags, false);
 }
 
 #define SAVE_BUF_SIZE FILE_IO_BUFFER_SIZE
 class nsMsgSaveAsListener : public nsIStreamListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -58,17 +58,16 @@
 #include "nsIMsgMailSession.h"
 #include "nsIStreamConverterService.h"
 #include "nsIAutoSyncManager.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 #include "nsMsgMessageFlags.h"
 #include "nsIMsgPluggableStore.h"
 #include "../../base/src/MailnewsLoadContextInfo.h"
-#include "nsDocShellLoadState.h"
 
 #define PREF_MAIL_ROOT_IMAP "mail.root.imap"            // old - for backward compatibility only
 #define PREF_MAIL_ROOT_IMAP_REL "mail.root.imap-rel"
 
 static NS_DEFINE_CID(kImapUrlCID, NS_IMAPURL_CID);
 static NS_DEFINE_CID(kCImapMockChannel, NS_IMAPMOCKCHANNEL_CID);
 
 static const char sequenceString[] = "SEQUENCE";
@@ -619,23 +618,22 @@ 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);
-      loadState->SetLoadFlags(aImapAction == nsImapUrl::nsImapOpenMimePart
-                                ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
-                                : nsIWebNavigation::LOAD_FLAGS_NONE);
-      loadState->SetFirstParty(false);
-      rv = docShell->LoadURI(loadState);
+      rv = docShell->LoadURI(url,
+                             nullptr,
+                             aImapAction == nsImapUrl::nsImapOpenMimePart
+                               ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
+                               : nsIWebNavigation::LOAD_FLAGS_NONE,
+                             false);
     }
     else
     {
       nsCOMPtr<nsIStreamListener> aStreamListener = do_QueryInterface(aDisplayConsumer, &rv);
       if (NS_SUCCEEDED(rv) && aStreamListener)
       {
         nsCOMPtr<nsIChannel> aChannel;
         nsCOMPtr<nsILoadGroup> loadGroup;
@@ -1055,21 +1053,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);
-    loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
-    loadState->SetFirstParty(false);
-    rv = docShell->LoadURI(loadState);
+    rv = docShell->LoadURI(url, nullptr, nsIWebNavigation::LOAD_FLAGS_NONE, false);
   }
   else
   {
     nsCOMPtr<nsIStreamListener> streamListener = do_QueryInterface(aDisplayConsumer, &rv);
     nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aImapUrl, &rv);
     if (aMsgWindow && mailnewsUrl)
       mailnewsUrl->SetMsgWindow(aMsgWindow);
     if (NS_SUCCEEDED(rv) && streamListener)
--- a/mailnews/local/src/nsMailboxService.cpp
+++ b/mailnews/local/src/nsMailboxService.cpp
@@ -21,17 +21,16 @@
 #include "nsMsgUtils.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsNetUtil.h"
 #include "nsIWebNavigation.h"
 #include "prprf.h"
 #include "nsIMsgHdr.h"
 #include "nsIFileURL.h"
 #include "mozilla/RefPtr.h"
-#include "nsDocShellLoadState.h"
 #include "nsIRDFService.h"
 
 nsMailboxService::nsMailboxService()
 {
     mPrintingOperation = false;
 }
 
 nsMailboxService::~nsMailboxService()
@@ -230,23 +229,22 @@ 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);
-    loadState->SetLoadFlags(mailboxAction == nsIMailboxUrl::ActionFetchPart
-                              ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
-                              : nsIWebNavigation::LOAD_FLAGS_NONE);
-    loadState->SetFirstParty(false);
-    rv = docShell->LoadURI(loadState);
+    rv = docShell->LoadURI(url,
+                           nullptr,
+                           mailboxAction == nsIMailboxUrl::ActionFetchPart
+                             ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
+                             : nsIWebNavigation::LOAD_FLAGS_NONE,
+                           false);
   }
   else
     rv = RunMailboxUrl(url, aDisplayConsumer);
 
   if (aURL && mailboxurl)
     CallQueryInterface(mailboxurl, aURL);
 
   return rv;
@@ -360,21 +358,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);
-    loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
-    loadState->SetFirstParty(false);
-    return docShell->LoadURI(loadState);
+    return docShell->LoadURI(URL, nullptr, nsIWebNavigation::LOAD_FLAGS_IS_LINK, false);
   }
   return RunMailboxUrl(URL, aDisplayConsumer);
 
 }
 
 
 NS_IMETHODIMP
 nsMailboxService::SaveMessageToDisk(const char *aMessageURI,
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -38,17 +38,16 @@
 #include "nsIMsgMailNewsUrl.h"
 #include "nsIMsgMailSession.h"
 #include "nsISupportsPrimitives.h"
 #include "nsArrayUtils.h"
 #include "nsIStreamListener.h"
 #include "nsIInputStream.h"
 #include "nsIURIMutator.h"
 #include "nsTArray.h"
-#include "nsDocShellLoadState.h"
 
 #include "../../base/src/MailnewsLoadContextInfo.h"
 
 #undef GetPort  // XXX Windows!
 #undef SetPort  // XXX Windows!
 
 #define PREF_MAIL_ROOT_NNTP   "mail.root.nntp"        // old - for backward compatibility only
 #define PREF_MAIL_ROOT_NNTP_REL   "mail.root.nntp-rel"
@@ -303,23 +302,22 @@ 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);
-    loadState->SetLoadFlags(mOpenAttachmentOperation
-                              ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
-                              : nsIWebNavigation::LOAD_FLAGS_NONE);
-    loadState->SetFirstParty(false);
-    rv = docShell->LoadURI(loadState);
+    rv = docShell->LoadURI(aUrl,
+                           nullptr,
+                           mOpenAttachmentOperation
+                             ? nsIWebNavigation::LOAD_FLAGS_IS_LINK
+                             : nsIWebNavigation::LOAD_FLAGS_NONE,
+                           false);
   }
   else
   {
     nsCOMPtr<nsIStreamListener> aStreamListener(do_QueryInterface(aDisplayConsumer, &rv));
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIChannel> aChannel;
       nsCOMPtr<nsILoadGroup> aLoadGroup;
@@ -439,25 +437,20 @@ NS_IMETHODIMP nsNntpService::OpenAttachm
 //   nsCOMPtr<nsIMsgMessageUrl> msgMessageUrl = do_QueryInterface(url);
 //    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);
-      loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
-      loadState->SetFirstParty(false);
-      return docShell->LoadURI(loadState);
-    } else {
+    if (NS_SUCCEEDED(rv) && docShell)
+      return docShell->LoadURI(url, nullptr, nsIWebNavigation::LOAD_FLAGS_IS_LINK, false);
+    else
       return RunNewsUrl(url, aMsgWindow, aDisplayConsumer);
-    }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpService::GetUrlForUri(const char *aMessageURI, nsIURI **aURL, nsIMsgWindow *aMsgWindow)
 {
   nsresult rv = NS_OK;