Chromium Code Reviews| Index: base/message_loop/message_pump_win.cc |
| diff --git a/base/message_loop/message_pump_win.cc b/base/message_loop/message_pump_win.cc |
| index a84e04e93a5ef90d1b03fce2afd0545f897333b7..273efdafdf89fe63ae47060374738dc24e91202f 100644 |
| --- a/base/message_loop/message_pump_win.cc |
| +++ b/base/message_loop/message_pump_win.cc |
| @@ -93,7 +93,8 @@ int MessagePumpWin::GetCurrentDelay() const { |
| // MessagePumpForUI public: |
| MessagePumpForUI::MessagePumpForUI() |
| - : atom_(0) { |
| + : atom_(0), |
| + force_fallback_timer_for_tasks_(0) { |
| InitMessageWnd(); |
| ui_worker_thread_timer_.Set(::CreateWaitableTimer(NULL, FALSE, NULL)); |
| @@ -125,6 +126,8 @@ void MessagePumpForUI::ScheduleWork() { |
| PostWorkMessage(); |
| return; |
| } |
| + |
| + ::InterlockedExchange(&force_fallback_timer_for_tasks_, 1); |
| // Set a one shot timer to fire after 3 milliseconds. The actual resolution |
| // of the timer is dependent on timeBeginPeriod being called. |
| SetWakeupTimer(kDefaultUIWorkerThreadWakeupTimerMs); |
| @@ -425,6 +428,7 @@ bool MessagePumpForUI::ProcessPumpReplacementMessage() { |
| void MessagePumpForUI::DoWorkerThreadRunLoop() { |
| DCHECK(ui_worker_thread_timer_.Get()); |
| + |
| while (TRUE) { |
| DWORD ret = WaitForSingleObjectEx( |
| ui_worker_thread_timer_.Get(), INFINITE, TRUE); |
| @@ -438,7 +442,8 @@ void MessagePumpForUI::DoWorkerThreadRunLoop() { |
| // Set a one shot timer to process pending delayed tasks if any in the |
| // queue. The actual resolution of the timer is dependent on the |
| // timeBeginPeriod API being called. |
|
brucedawson
2015/06/19 21:09:01
"is dependent on the current global timer precisio
ananta
2015/06/19 22:19:10
Done.
|
| - SetWakeupTimer(kDefaultUIWorkerThreadWakeupTimerMs); |
| + if (::InterlockedExchange(&force_fallback_timer_for_tasks_, 0)) |
| + SetWakeupTimer(kDefaultUIWorkerThreadWakeupTimerMs); |
| } |
| } |