diff options
author | zork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-12 20:44:13 +0000 |
---|---|---|
committer | zork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-12 20:44:13 +0000 |
commit | 7520d82219786cae7484e4a9ca5e80879d56e036 (patch) | |
tree | 5103c88f52e777e0e37772e90e02e0a1509dcf0b /chrome/browser | |
parent | cccb2121a119f6d604878cf0524851bcdc9f3fff (diff) | |
download | chromium_src-7520d82219786cae7484e4a9ca5e80879d56e036.zip chromium_src-7520d82219786cae7484e4a9ca5e80879d56e036.tar.gz chromium_src-7520d82219786cae7484e4a9ca5e80879d56e036.tar.bz2 |
Fix mediator_thread_impl.cc to run timer tasks when the task runner is
otherwise idle.
BUG=19784, 26988
TEST=1. Enable sync and log in.
2. Go to about:sync
3. Check that notifications are enabled.
4. Disable all network adapters, and wait 15 seconds.
5. Refresh about:sync, and ensure that notifications are disabled.
Review URL: http://codereview.chromium.org/391027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/sync/notifier/listener/mediator_thread_impl.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc b/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc index 0934daf..62d44c0 100644 --- a/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc +++ b/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc @@ -53,19 +53,20 @@ void MediatorThreadImpl::Run() { // Since we just changed the socket server, ensure that any queued up // messages are processed. socket_server->WakeUp(); - ::MSG message; - while (::GetMessage(&message, NULL, 0, 0)) { - ::TranslateMessage(&message); - ::DispatchMessage(&message); - if (IsStopping()) { - break; - } - MessageLoop::current()->RunAllPending(); - } #endif do { +#if defined(OS_WIN) + ::MSG message; + if (::PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) { + ::TranslateMessage(&message); + ::DispatchMessage(&message); + } +#endif ProcessMessages(100); + if (pump_.get() && pump_->HasPendingTimeoutTask()) { + pump_->WakeTasks(); + } MessageLoop::current()->RunAllPending(); } while (!IsStopping()); |