Bug 1287446 - Check and add nsIPrintProgressParams and print progress listener separately in nsPrintEngine::ShowPrintProgress. r=tnikkel, a=gchang
authorBob Owen <bobowencode@gmail.com>
Wed, 03 Aug 2016 09:50:24 +0100
changeset 342244 0306e27329db648bb267724637738630040ad42d
parent 342243 cab91bc0d96039e9c6c2bbb77c2532dfbea8e17c
child 342245 bfd404d86a623f35e4f8bcfd639b84b8c958a535
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, gchang
bugs1287446
milestone49.0
Bug 1287446 - Check and add nsIPrintProgressParams and print progress listener separately in nsPrintEngine::ShowPrintProgress. r=tnikkel, a=gchang MozReview-Commit-ID: GngheT4Mizd
layout/printing/nsPrintEngine.cpp
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -1067,18 +1067,21 @@ nsPrintEngine::ShowPrintProgress(bool aI
       nsCOMPtr<nsIWebProgressListener> printProgressListener;
 
       nsCOMPtr<nsIWebBrowserPrint> wbp(do_QueryInterface(mDocViewerPrint));
       nsresult rv = printPromptService->ShowProgress(domWin, wbp, mPrt->mPrintSettings, this, aIsForPrinting,
                                                      getter_AddRefs(printProgressListener), 
                                                      getter_AddRefs(mPrt->mPrintProgressParams), 
                                                      &aDoNotify);
       if (NS_SUCCEEDED(rv)) {
-        if (printProgressListener && mPrt->mPrintProgressParams) {
+        if (printProgressListener) {
           mPrt->mPrintProgressListeners.AppendObject(printProgressListener);
+        }
+
+        if (mPrt->mPrintProgressParams) {
           SetDocAndURLIntoProgress(mPrt->mPrintObject, mPrt->mPrintProgressParams);
         }
       }
     }
   }
 }
 
 //---------------------------------------------------------------------