Bug 1364858 - Make sure throttle timer isn't recreated. r=smaug
authorAndreas Farre <farre@mozilla.com>
Mon, 15 May 2017 13:06:28 +0200
changeset 359361 095aca8a91e68b8b4a723dc016becb37b9c5d1ff
parent 359360 dfdebc342d2e519761cec89c60bc16a9404ca9b3
child 359362 5888ef3abc41bc463350ca8235f5c7f8b0cf3564
push id31853
push userkwierso@gmail.com
push dateFri, 19 May 2017 22:14:28 +0000
treeherdermozilla-central@8d60d0f82511 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1364858
milestone55.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 1364858 - Make sure throttle timer isn't recreated. r=smaug MozReview-Commit-ID: DU8ukd9JqI6
dom/base/TimeoutManager.cpp
--- a/dom/base/TimeoutManager.cpp
+++ b/dom/base/TimeoutManager.cpp
@@ -251,16 +251,17 @@ TimeoutManager::TimeoutManager(nsGlobalW
 
   MOZ_LOG(gLog, LogLevel::Debug,
           ("TimeoutManager %p created, tracking bucketing %s\n",
            this, gAnnotateTrackingChannels ? "enabled" : "disabled"));
 }
 
 TimeoutManager::~TimeoutManager()
 {
+  MOZ_DIAGNOSTIC_ASSERT(mWindow.AsInner()->InnerObjectsFreed());
   MOZ_DIAGNOSTIC_ASSERT(!mThrottleTrackingTimeoutsTimer);
 
   MOZ_LOG(gLog, LogLevel::Debug,
           ("TimeoutManager %p destroyed\n", this));
 }
 
 /* static */
 void
@@ -1467,17 +1468,18 @@ void
 TimeoutManager::OnDocumentLoaded()
 {
   MaybeStartThrottleTrackingTimout();
 }
 
 void
 TimeoutManager::MaybeStartThrottleTrackingTimout()
 {
-  if (gTrackingTimeoutThrottlingDelay <= 0) {
+  if (gTrackingTimeoutThrottlingDelay <= 0 ||
+      mWindow.AsInner()->InnerObjectsFreed()) {
     return;
   }
 
   MOZ_DIAGNOSTIC_ASSERT(!mThrottleTrackingTimeouts);
 
   MOZ_LOG(gLog, LogLevel::Debug,
           ("TimeoutManager %p delaying tracking timeout throttling by %dms\n",
            this, gTrackingTimeoutThrottlingDelay));