Bug 792065 - Uninitialised value use in nsIdleServiceDaily::DailyCallback. r=roc a=gavin
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Mon, 24 Sep 2012 23:04:32 +0200
changeset 106939 d54dcbfd09ee78f0492ee89336fffdcb5689d646
parent 106938 3227b2f0e9ef3c797d93673bf20db0926bc1f0ab
child 106940 20a6963e30186d3def7b84d95d48c13d6a879eb4
push id2149
push usergpascutto@mozilla.com
push dateMon, 24 Sep 2012 21:04:50 +0000
treeherdermozilla-aurora@d54dcbfd09ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, gavin
bugs792065
milestone17.0a2
Bug 792065 - Uninitialised value use in nsIdleServiceDaily::DailyCallback. r=roc a=gavin
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