Bug 1688248 - Fix message printing after tb-fission and bug 1685184. r=rnons
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 27 Jan 2021 12:49:49 +0200
changeset 31530 036520a38d2b3d46fb31cf93f89d3545242feac5
parent 31529 25e615d8cc33faaa92a61a675b13856c02eb6bdb
child 31531 ddb08c759de764865436531fae453eff49cc3a48
push id18397
push usermkmelin@iki.fi
push dateWed, 27 Jan 2021 10:51:11 +0000
treeherdercomm-central@036520a38d2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnons
bugs1688248, 1685184
Bug 1688248 - Fix message printing after tb-fission and bug 1685184. r=rnons nsMsgPrintEngine::Observe gets some notifications it never got before E10s, which causes FireThatLoadOperation to happen more than it should. This prevents the print progress dialog completing. Also a port of bug 1685184 which changed the arguments to PrintUtils.startPrintWindow. Differential Revision: https://phabricator.services.mozilla.com/D103009
mail/base/content/mailWindow.js
mailnews/base/src/nsMsgPrintEngine.cpp
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -812,17 +812,17 @@ nsBrowserAccess.prototype = {
     aTriggeringPrincipal,
     aCsp,
     aSkipLoad
   ) {
     if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_PRINT_BROWSER) {
       let browser = PrintUtils.startPrintWindow(
         "mailWindow",
         aOpenWindowInfo.parent,
-        aOpenWindowInfo
+        { openWindowInfo: aOpenWindowInfo }
       );
       return browser ? browser.browsingContext : null;
     }
 
     let isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
 
     if (aOpenWindowInfo && isExternal) {
       throw Components.Exception(
@@ -889,17 +889,17 @@ nsBrowserAccess.prototype = {
     aFlags,
     aName,
     aSkipLoad
   ) {
     if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_PRINT_BROWSER) {
       return PrintUtils.startPrintWindow(
         "mailWindow",
         aParams.openWindowInfo.parent,
-        aParams.openWindowInfo
+        { openWindowInfo: aParams.openWindowInfo }
       );
     }
 
     if (aWhere != Ci.nsIBrowserDOMWindow.OPEN_NEWTAB) {
       Services.console.logStringMessage(
         "Error: openURIInFrame can only open in new tabs or print"
       );
       return null;
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -659,10 +659,13 @@ NS_IMETHODIMP nsMsgPrintEngine::SetMsgTy
   }
   return NS_ERROR_FAILURE;
 }
 
 /*=============== nsIObserver Interface ======================*/
 NS_IMETHODIMP nsMsgPrintEngine::Observe(nsISupports* aSubject,
                                         const char* aTopic,
                                         const char16_t* aData) {
-  return FireThatLoadOperation(mLoadURI);
+  if (!aTopic) {
+    return FireThatLoadOperation(mLoadURI);
+  }
+  return NS_OK;
 }