Bug 1332776 - Ensure that the dom.min_tracking_timeout_value pref takes effect; r=bkelly
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 20 Jan 2017 19:36:56 -0500
changeset 330801 b9d812c366292690d5951d953da691df8ec42ec3
parent 330800 05a753c833288cdb2654f5fc68576471f8325254
child 330802 d245077d0c9b280efec94cf4bf9b2d41df95dc69
push id31252
push userkwierso@gmail.com
push dateWed, 25 Jan 2017 00:08:23 +0000
treeherdermozilla-central@1b3bfb999a25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1332776
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 1332776 - Ensure that the dom.min_tracking_timeout_value pref takes effect; r=bkelly Without this, we would only try to clamp the timeout for background windows and nested timeouts. We should also do this for all timeouts that are classified as tracking.
dom/base/TimeoutManager.cpp
--- a/dom/base/TimeoutManager.cpp
+++ b/dom/base/TimeoutManager.cpp
@@ -200,17 +200,18 @@ TimeoutManager::SetTimeout(nsITimeoutHan
     timeout->mIsTracking = (rand() % 2) == 0;
     break;
   }
 
   // Now clamp the actual interval we will use for the timer based on
   uint32_t nestingLevel = sNestingLevel + 1;
   uint32_t realInterval = interval;
   if (aIsInterval || nestingLevel >= DOM_CLAMP_TIMEOUT_NESTING_LEVEL ||
-      mBackPressureDelayMS > 0 || mWindow.IsBackgroundInternal()) {
+      mBackPressureDelayMS > 0 || mWindow.IsBackgroundInternal() ||
+      timeout->mIsTracking) {
     // Don't allow timeouts less than DOMMinTimeoutValue() from
     // now...
     realInterval = std::max(realInterval,
                             uint32_t(DOMMinTimeoutValue(timeout->mIsTracking)));
   }
 
   timeout->mWindow = &mWindow;