Bug 735894 - Fire the discard timeout twice as often, so images are discarded after between 1 and 1.5 discard timeout intervals, instead of between 1 and 2 intervals. r=joe
authorJustin Lebar <justin.lebar@gmail.com>
Thu, 15 Mar 2012 16:30:41 -0400
changeset 93272 803853bf2a55d1b6422d4efe3da7d78631d84477
parent 93271 e7d417980de6ebfe55f17ca6a1998dfecc462971
child 93273 36fd3090b006063201a8b3f98f54e57db42e02a6
push id160
push userlsblakk@mozilla.com
push dateFri, 13 Jul 2012 18:18:57 +0000
treeherdermozilla-release@228ba1a111fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs735894
milestone14.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 735894 - Fire the discard timeout twice as often, so images are discarded after between 1 and 1.5 discard timeout intervals, instead of between 1 and 2 intervals. r=joe
image/src/DiscardTracker.cpp
js/src/jsfun.cpp
--- a/image/src/DiscardTracker.cpp
+++ b/image/src/DiscardTracker.cpp
@@ -194,20 +194,22 @@ DiscardTracker::ReloadTimeout()
 nsresult
 DiscardTracker::EnableTimer()
 {
   // Nothing to do if the timer's already on.
   if (sTimerOn)
     return NS_OK;
   sTimerOn = true;
 
-  // Activate
+  // Activate the timer.  Have it call us back in (sMinDiscardTimeoutMs / 2)
+  // ms, so that an image is discarded between sMinDiscardTimeoutMs and
+  // (3/2 * sMinDiscardTimeoutMs) ms after it's unlocked.
   return sTimer->InitWithFuncCallback(TimerCallback,
                                       nsnull,
-                                      sMinDiscardTimeoutMs,
+                                      sMinDiscardTimeoutMs / 2,
                                       nsITimer::TYPE_REPEATING_SLACK);
 }
 
 /*
  * Disables the timer. No-op if the timer isn't running.
  */
 void
 DiscardTracker::DisableTimer()