diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-23 19:19:20 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-23 19:19:20 +0000 |
commit | 72deacd254d62a306a79ee39f4022b567c679917 (patch) | |
tree | 64decf39083c5ec6bb9dc8545d2cba36acb8bd30 /base/message_loop.cc | |
parent | a66c1c036a94477665afc3f1d62429d6186a3240 (diff) | |
download | chromium_src-72deacd254d62a306a79ee39f4022b567c679917.zip chromium_src-72deacd254d62a306a79ee39f4022b567c679917.tar.gz chromium_src-72deacd254d62a306a79ee39f4022b567c679917.tar.bz2 |
Always use the topmost delayed task as the basis for our WM_TIMER.
R=jar
BUG=2559
Review URL: http://codereview.chromium.org/4041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r-- | base/message_loop.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index 48e05eb..ccd6d3e 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -384,9 +384,9 @@ bool MessageLoop::DoWork() { PendingTask pending_task = work_queue_.front(); work_queue_.pop(); if (!pending_task.delayed_run_time.is_null()) { - bool was_empty = delayed_work_queue_.empty(); AddToDelayedWorkQueue(pending_task); - if (was_empty) // We only schedule the next delayed work item. + // If we changed the topmost task, then it is time to re-schedule. + if (delayed_work_queue_.top().task == pending_task.task) pump_->ScheduleDelayedWork(pending_task.delayed_run_time); } else { if (DeferOrRunPendingTask(pending_task)) |