Bug 1328508 - Increase the print watchdog timer for debug builds, and add some warnings to make watchdog timeouts visible. r=bobowen, a=jcristau
authorJonathan Watt <jwatt@jwatt.org>
Mon, 09 Jan 2017 16:11:24 +0000
changeset 353443 35faa0cd51d5425962a07e3c488884223de0aed7
parent 353442 b7a454e513ffc0dc1df147a0559332cee17f2c4c
child 353444 d51decb665c07ee712aee1c4044471b1607ef84e
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen, jcristau
bugs1328508
milestone52.0a2
Bug 1328508 - Increase the print watchdog timer for debug builds, and add some warnings to make watchdog timeouts visible. r=bobowen, a=jcristau
layout/printing/nsPagePrintTimer.cpp
layout/printing/nsPagePrintTimer.h
layout/printing/nsPrintEngine.cpp
--- a/layout/printing/nsPagePrintTimer.cpp
+++ b/layout/printing/nsPagePrintTimer.cpp
@@ -204,14 +204,16 @@ nsPagePrintTimer::Stop()
     mTimer = nullptr;
   }
   StopWatchDogTimer();
 }
 
 void
 nsPagePrintTimer::Fail()
 {
+  NS_WARNING("nsPagePrintTimer::Fail called");
+
   mDone = true;
   Stop();
   if (mPrintEngine) {
     mPrintEngine->CleanupOnFailure(NS_OK, false);
   }
 }
--- a/layout/printing/nsPagePrintTimer.h
+++ b/layout/printing/nsPagePrintTimer.h
@@ -65,16 +65,23 @@ private:
   nsCOMPtr<nsITimer>         mWaitingForRemotePrint;
   uint32_t                   mDelay;
   uint32_t                   mFiringCount;
   nsPrintObject *            mPrintObj;
   uint32_t                   mWatchDogCount;
   bool                       mDone;
 
   static const uint32_t WATCH_DOG_INTERVAL  = 1000;
-  static const uint32_t WATCH_DOG_MAX_COUNT = 10;
+  static const uint32_t WATCH_DOG_MAX_COUNT =
+#ifdef DEBUG
+  // Debug builds are very slow (on Mac at least) and can need extra time
+                                              30
+#else
+                                              10
+#endif
+  ;
 };
 
 
 nsresult
 NS_NewPagePrintTimer(nsPagePrintTimer **aResult);
 
 #endif /* nsPagePrintTimer_h___ */
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -1845,16 +1845,17 @@ nsPrintEngine::AfterNetworkPrint(bool aH
   if (mIsDoingPrinting) {
     rv = DocumentReadyForPrinting();
   } else {
     rv = FinishPrintPreview();
   }
 
   /* cleaup on failure + notify user */
   if (aHandleError && NS_FAILED(rv)) {
+    NS_WARNING("nsPrintEngine::AfterNetworkPrint failed");
     CleanupOnFailure(rv, !mIsDoingPrinting);
   }
 
   return rv;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIWebProgressListener