Bug 890362 - Delayed tasks posted to the mozilla UI message loop stop working after sleep/wake. r=bsmedberg

This commit is contained in:
Brian R. Bondy 2013-07-10 12:39:09 -04:00
parent 16a56669ce
commit 4122c73005

View File

@ -164,7 +164,11 @@ MessagePump::ScheduleDelayedWork(const base::TimeTicks& aDelayedTime)
delayed_work_time_ = aDelayedTime;
base::TimeDelta delay = aDelayedTime - base::TimeTicks::Now();
// TimeDelta's constructor initializes to 0
base::TimeDelta delay;
if (aDelayedTime > base::TimeTicks::Now())
delay = aDelayedTime - base::TimeTicks::Now();
uint32_t delayMS = uint32_t(delay.InMilliseconds());
mDelayedWorkTimer->InitWithCallback(mDoWorkEvent, delayMS,
nsITimer::TYPE_ONE_SHOT);