mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 890362 - Delayed tasks posted to the mozilla UI message loop stop working after sleep/wake. r=bsmedberg
This commit is contained in:
parent
16a56669ce
commit
4122c73005
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user