Bug 1588057 - Port bug 1578624: Add 'set navigating' argument of nsIDocShell.loadURI() calls. Also hack namespace issue in nsDocShellLoadState.h. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Fri, 11 Oct 2019 13:13:59 +0200
changeset 27898 d7b26f4d5ea17e94a0faee54f64783538bd6e0da
parent 27897 69a2aa5bd636aef0d8b5ec9fa6661e1a63b92079
child 27899 6370a0f66ec1b727ecda13b86ec1d277ac03f471
push id16543
push usermozilla@jorgk.com
push dateFri, 11 Oct 2019 11:14:34 +0000
treeherdercomm-central@d7b26f4d5ea1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1588057, 1578624
Bug 1588057 - Port bug 1578624: Add 'set navigating' argument of nsIDocShell.loadURI() calls. Also hack namespace issue in nsDocShellLoadState.h. 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
@@ -41,16 +41,17 @@
 #endif
 
 /* for access to docshell */
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIWebNavigation.h"
 #include "nsContentUtils.h"
+using namespace mozilla;
 #include "nsDocShellLoadState.h"
 
 // mail
 #include "nsIMsgMailNewsUrl.h"
 #include "nsMsgBaseCID.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgMailSession.h"
 #include "nsIMailboxUrl.h"
@@ -547,17 +548,17 @@ nsMessenger::LoadURL(mozIDOMWindowProxy 
 
   AddMsgUrlToNavigateHistory(aURL);
   mNavigatingToUri.Truncate();
   mLastDisplayURI = aURL;  // Remember the last uri we displayed.
   RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(uri);
   loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
   loadState->SetFirstParty(true);
   loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
-  return mDocShell->LoadURI(loadState);
+  return mDocShell->LoadURI(loadState, false);
 }
 
 NS_IMETHODIMP nsMessenger::SaveAttachmentToFile(nsIFile *aFile,
                                                 const nsACString &aURL,
                                                 const nsACString &aMessageUri,
                                                 const nsACString &aContentType,
                                                 nsIUrlListener *aListener) {
   return SaveAttachment(aFile, aURL, aMessageUri, aContentType, nullptr,
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -23,16 +23,17 @@
 #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"
+using namespace mozilla;
 #include "nsDocShellLoadState.h"
 #include "nsContentUtils.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 
 nsMsgMailNewsUrl::nsMsgMailNewsUrl() {
   // nsIURI specific state
   m_runningUrl = false;
@@ -819,17 +820,17 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetMimeH
 NS_IMETHODIMP nsMsgMailNewsUrl::LoadURI(nsIDocShell *docShell,
                                         uint32_t aLoadFlags) {
   NS_ENSURE_ARG_POINTER(docShell);
   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);
+  return docShell->LoadURI(loadState, false);
 }
 
 #define SAVE_BUF_SIZE FILE_IO_BUFFER_SIZE
 class nsMsgSaveAsListener : public nsIStreamListener {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -56,16 +56,17 @@
 #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"
+using namespace mozilla;
 #include "nsDocShellLoadState.h"
 #include "nsContentUtils.h"
 #include "mozilla/LoadInfo.h"
 
 #define PREF_MAIL_ROOT_IMAP_REL "mail.root.imap-rel"
 // old - for backward compatibility only
 #define PREF_MAIL_ROOT_IMAP "mail.root.imap"
 
@@ -602,17 +603,17 @@ nsresult nsImapService::FetchMimePart(
       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);
+      rv = docShell->LoadURI(loadState, false);
     } else {
       nsCOMPtr<nsIStreamListener> aStreamListener =
           do_QueryInterface(aDisplayConsumer, &rv);
       if (NS_SUCCEEDED(rv) && aStreamListener) {
         nsCOMPtr<nsIChannel> aChannel;
         nsCOMPtr<nsILoadGroup> loadGroup;
         nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl =
             do_QueryInterface(aImapUrl, &rv);
@@ -1003,17 +1004,17 @@ nsresult nsImapService::GetMessageFromUr
   }
   if (NS_SUCCEEDED(rv) && docShell) {
     NS_ASSERTION(!aConvertDataToText,
                  "can't convert to text when using docshell");
     RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(url);
     loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
     loadState->SetFirstParty(false);
     loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
-    rv = docShell->LoadURI(loadState);
+    rv = docShell->LoadURI(loadState, 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) {
       nsCOMPtr<nsIChannel> channel;
       nsCOMPtr<nsILoadGroup> loadGroup;
--- a/mailnews/local/src/nsMailboxService.cpp
+++ b/mailnews/local/src/nsMailboxService.cpp
@@ -22,16 +22,17 @@
 #include "nsPop3Service.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsNetUtil.h"
 #include "nsIWebNavigation.h"
 #include "prprf.h"
 #include "nsIMsgHdr.h"
 #include "nsIFileURL.h"
 #include "mozilla/RefPtr.h"
+using namespace mozilla;
 #include "nsDocShellLoadState.h"
 #include "nsContentUtils.h"
 
 nsMailboxService::nsMailboxService() { mPrintingOperation = false; }
 
 nsMailboxService::~nsMailboxService() {}
 
 NS_IMPL_ISUPPORTS(nsMailboxService, nsIMailboxService, nsIMsgMessageService,
@@ -214,17 +215,17 @@ nsresult nsMailboxService::FetchMessage(
     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);
+    rv = docShell->LoadURI(loadState, false);
   } else
     rv = RunMailboxUrl(url, aDisplayConsumer);
 
   if (aURL && mailboxurl) CallQueryInterface(mailboxurl, aURL);
 
   return rv;
 }
 
@@ -330,17 +331,17 @@ NS_IMETHODIMP nsMailboxService::OpenAtta
     // 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(URL);
     loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
     loadState->SetLoadType(LOAD_LINK);
     loadState->SetFirstParty(false);
     loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
-    return docShell->LoadURI(loadState);
+    return docShell->LoadURI(loadState, false);
   }
   return RunMailboxUrl(URL, aDisplayConsumer);
 }
 
 NS_IMETHODIMP
 nsMailboxService::SaveMessageToDisk(const char *aMessageURI, nsIFile *aFile,
                                     bool aAddDummyEnvelope,
                                     nsIUrlListener *aUrlListener, nsIURI **aURL,
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -38,16 +38,17 @@
 #include "nsIMsgMailNewsUrl.h"
 #include "nsIMsgMailSession.h"
 #include "nsISupportsPrimitives.h"
 #include "nsArrayUtils.h"
 #include "nsIStreamListener.h"
 #include "nsIInputStream.h"
 #include "nsIURIMutator.h"
 #include "nsTArray.h"
+using namespace mozilla;
 #include "nsDocShellLoadState.h"
 #include "nsContentUtils.h"
 #include "mozilla/LoadInfo.h"
 
 #include "../../base/src/MailnewsLoadContextInfo.h"
 
 #undef GetPort  // XXX Windows!
 #undef SetPort  // XXX Windows!
@@ -300,17 +301,17 @@ nsresult nsNntpService::GetMessageFromUr
     // dispatching stuff will be much happier.
     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);
+    rv = docShell->LoadURI(loadState, false);
   } else {
     nsCOMPtr<nsIStreamListener> aStreamListener(
         do_QueryInterface(aDisplayConsumer, &rv));
     if (NS_SUCCEEDED(rv)) {
       nsCOMPtr<nsIChannel> aChannel;
       nsCOMPtr<nsILoadGroup> aLoadGroup;
       nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aUrl, &rv);
       if (NS_SUCCEEDED(rv) && mailnewsUrl) {
@@ -430,17 +431,17 @@ NS_IMETHODIMP nsNntpService::OpenAttachm
 
     nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
     if (NS_SUCCEEDED(rv) && docShell) {
       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 docShell->LoadURI(loadState, false);
     } else {
       return RunNewsUrl(url, aMsgWindow, aDisplayConsumer);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpService::GetUrlForUri(const char *aMessageURI,