mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 844958: Correctly reschedule idle-daily timer if it fires early r=mak
This commit is contained in:
parent
eb118b0c53
commit
2c660c6401
@ -274,20 +274,22 @@ nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure)
|
||||
PRTime now = PR_Now();
|
||||
if (self->mExpectedTriggerTime && now < self->mExpectedTriggerTime) {
|
||||
// Timer returned early, reschedule to the appropriate time.
|
||||
PRTime newTime = self->mExpectedTriggerTime - now;
|
||||
PRTime delayTime = self->mExpectedTriggerTime - now;
|
||||
|
||||
// Add 10 ms to ensure we don't undershoot, and never get a "0" timer.
|
||||
newTime += 10 * PR_USEC_PER_MSEC;
|
||||
delayTime += 10 * PR_USEC_PER_MSEC;
|
||||
|
||||
PR_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: DailyCallback resetting timer to %lld msec",
|
||||
delayTime / PR_USEC_PER_MSEC));
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
||||
"DailyCallback resetting timer to %lld msec",
|
||||
(newTime - now) / PR_USEC_PER_MSEC);
|
||||
delayTime / PR_USEC_PER_MSEC);
|
||||
#endif
|
||||
|
||||
(void)self->mTimer->InitWithFuncCallback(DailyCallback,
|
||||
self,
|
||||
(newTime - now) / PR_USEC_PER_MSEC,
|
||||
delayTime / PR_USEC_PER_MSEC,
|
||||
nsITimer::TYPE_ONE_SHOT);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user