Bug 1328508 - Increase the print watchdog timer for debug builds, and add some warnings to make watchdog timeouts visible. r=bobowen
authorJonathan Watt <jwatt@jwatt.org>
Mon, 19 Dec 2016 10:12:39 +0000
changeset 327966 56f12a46fbca0a38d6ce4ef8a33ff8f98286de06
parent 327965 769f1efe908d733509f9dd779c6e2b431e83ea8f
child 327967 358b2e64b5c1cf592607159188843c7fbbe9367c
push id31160
push userphilringnalda@gmail.com
push dateThu, 05 Jan 2017 02:33:44 +0000
treeherdermozilla-central@f13abb8ba9f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen
bugs1328508
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1328508 - Increase the print watchdog timer for debug builds, and add some warnings to make watchdog timeouts visible. r=bobowen
layout/printing/nsPagePrintTimer.cpp
layout/printing/nsPagePrintTimer.h
layout/printing/nsPrintEngine.cpp
--- a/layout/printing/nsPagePrintTimer.cpp
+++ b/layout/printing/nsPagePrintTimer.cpp
@@ -209,14 +209,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
@@ -67,16 +67,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
@@ -1826,16 +1826,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