Bug 792065 - Uninitialised value use in nsIdleServiceDaily::DailyCallback. r=roc a=akeybl
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Mon, 24 Sep 2012 23:07:23 +0200
changeset 104834 54efd2cc7c855652dbbbb24715caee209d741ae5
parent 104833 07ee72f7638758df5b82cd1d28001c3e0e5608e7
child 104835 c085464581b6a4164e9d5ecea4a2819c58802da3
push id1452
push usergpascutto@mozilla.com
push dateMon, 24 Sep 2012 21:08:53 +0000
treeherdermozilla-beta@54efd2cc7c85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, akeybl
bugs792065
milestone16.0
Bug 792065 - Uninitialised value use in nsIdleServiceDaily::DailyCallback. r=roc a=akeybl
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(nsnull, this);
   }
   else {
 #ifdef ANDROID
     __android_log_print(ANDROID_LOG_INFO, "IdleService", "Setting timer a day from now");
 #endif