Bug 1336598 P2 Avoid underflow in timeout CancelOrUpdateBackpressure(). r=smaug
authorBen Kelly <ben@wanderview.com>
Sun, 05 Feb 2017 21:50:09 -0500
changeset 340861 79f1f1073258c46ff20721551ce4b604312f2571
parent 340860 901008a059b6affadd2af3be09ada6596e918889
child 340862 ca7ec2dd740d65b6f65a7f9d3802c2494871833a
push id86571
push userbkelly@mozilla.com
push dateMon, 06 Feb 2017 02:50:17 +0000
treeherdermozilla-inbound@ca7ec2dd740d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1336598
milestone54.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 1336598 P2 Avoid underflow in timeout CancelOrUpdateBackpressure(). r=smaug
dom/base/TimeoutManager.cpp
--- a/dom/base/TimeoutManager.cpp
+++ b/dom/base/TimeoutManager.cpp
@@ -707,18 +707,18 @@ TimeoutManager::CancelOrUpdateBackPressu
 
   // If the delay has decreased, though, we only apply the new value if it has
   // reduced significantly.  This hysteresis avoids thrashing the back pressure
   // value back and forth rapidly.  This is important because reducing the
   // backpressure delay requires calling ResetTimerForThrottleReduction() which
   // can be quite expensive.  We only want to call that method if the back log
   // is really clearing.
   else if (newBackPressureDelayMS == 0 ||
-           (newBackPressureDelayMS <=
-           (mBackPressureDelayMS - kBackPressureDelayReductionThresholdMS))) {
+           (mBackPressureDelayMS >
+           (newBackPressureDelayMS + kBackPressureDelayReductionThresholdMS))) {
     int32_t oldBackPressureDelayMS = mBackPressureDelayMS;
     mBackPressureDelayMS = newBackPressureDelayMS;
 
     // If the back pressure delay has gone down we must reset any existing
     // timers to use the new value.  Otherwise we run the risk of executing
     // timer callbacks out-of-order.
     ResetTimersForThrottleReduction(oldBackPressureDelayMS);
   }