diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-20 06:30:58 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-20 06:30:58 +0000 |
commit | b24250fc9857d219ad617e2a14e145b65724cb61 (patch) | |
tree | 858c55a80b23d0e8e62d1f9d4c4b724c6c924860 /base/message_loop.cc | |
parent | 099cec761ad00232f5ce8483a163356b06065980 (diff) | |
download | chromium_src-b24250fc9857d219ad617e2a14e145b65724cb61.zip chromium_src-b24250fc9857d219ad617e2a14e145b65724cb61.tar.gz chromium_src-b24250fc9857d219ad617e2a14e145b65724cb61.tar.bz2 |
reland r1075 w/ tweak to fix test failures
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r-- | base/message_loop.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index 4964dfe..eb10ca7 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -386,16 +386,16 @@ void MessageLoop::DeletePendingTasks() { } void MessageLoop::DidChangeNextTimerExpiry() { - int delay = timer_manager_.GetCurrentDelay(); - if (delay == -1) + Time next_delayed_work_time = timer_manager_.GetNextFireTime(); + if (next_delayed_work_time.is_null()) return; // Simulates malfunctioning, early firing timers. Pending tasks should only // be invoked when the delay they specify has elapsed. if (timer_manager_.use_broken_delay()) - delay = 10; + next_delayed_work_time = Time::Now() + TimeDelta::FromMilliseconds(10); - pump_->ScheduleDelayedWork(TimeDelta::FromMilliseconds(delay)); + pump_->ScheduleDelayedWork(next_delayed_work_time); } bool MessageLoop::DoWork() { @@ -403,12 +403,12 @@ bool MessageLoop::DoWork() { return QueueOrRunTask(NULL); } -bool MessageLoop::DoDelayedWork(TimeDelta* next_delay) { +bool MessageLoop::DoDelayedWork(Time* next_delayed_work_time) { bool did_work = timer_manager_.RunSomePendingTimers(); // We may not have run any timers, but we may still have future timers to // run, so we need to inform the pump again of pending timers. - *next_delay = TimeDelta::FromMilliseconds(timer_manager_.GetCurrentDelay()); + *next_delayed_work_time = timer_manager_.GetNextFireTime(); return did_work; } |