Bug 792065 - Uninitialised value use in nsIdleServiceDaily::DailyCallback. r=roc
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Thu, 20 Sep 2012 11:37:56 +0200
changeset 107622 22f69ef21a70cdac569338cfa81e9737511762c2
parent 107621 0d016659bfcdb87c618c485f18dd3ac4d4d46c72
child 107623 8656e7a77c0ec61a9ca40e92929be8634bcc875c
push id23498
push userryanvm@gmail.com
push dateFri, 21 Sep 2012 01:27:06 +0000
treeherdermozilla-central@488beb32bca5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs792065
milestone18.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 792065 - Uninitialised value use in nsIdleServiceDaily::DailyCallback. r=roc
widget/xpwidgets/nsIdleService.cpp
--- a/widget/xpwidgets/nsIdleService.cpp
+++ b/widget/xpwidgets/nsIdleService.cpp
@@ -144,16 +144,20 @@ nsIdleServiceDaily::Init()
     lastDaily = 0;
   }
 
   // Check if it has been a day since the last notification.
   if (nowSec - lastDaily > SECONDS_PER_DAY) {
 #ifdef ANDROID
     __android_log_print(ANDROID_LOG_INFO, "IdleService", "DailyCallback started");
 #endif
+    // The timer would have been started after the previous idle-daily. Need to
+    // set this here so DailyCallback knows the timer didn't fire early.
+    mDailyTimerStart = lastDaily * PR_USEC_PER_SEC;
+
     // Wait for the user to become idle, so we can do todays idle tasks.
     DailyCallback(nullptr, this);
   }
   else {
 #ifdef ANDROID
     __android_log_print(ANDROID_LOG_INFO, "IdleService", "Setting timer a day from now");
 #endif