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 ac54788539cb062da639e4338fe7b430c85b4449..3d401bda259ce415ec35ecea5ff6480c5ea2775a 100644 |
| --- a/base/message_loop/message_pump_win.cc |
| +++ b/base/message_loop/message_pump_win.cc |
| @@ -449,6 +449,10 @@ void MessagePumpForGpu::ScheduleWork() { |
| if (InterlockedExchange(&work_state_, HAVE_WORK) != READY) |
| return; // Someone else continued the pumping. |
| + // TODO(stanisc): crbug.com/596190: Preserve for crash dump analysis. |
| + // Remove this when the bug is fixes. |
|
brucedawson
2016/06/03 23:36:15
fixes -> fixed
|
| + last_set_event_timeticks_ = TimeTicks::Now(); |
| + |
| // Make sure the MessagePump does some work for us. |
| SetEvent(event_); |
| } |
| @@ -520,19 +524,19 @@ void MessagePumpForGpu::WaitForWork() { |
| if (delay < 0) // Negative value means no timers waiting. |
| delay = INFINITE; |
| + // TODO(stanisc): crbug.com/596190: Preserve for crash dump analysis. |
| + // Remove this when the bug is fixes. |
|
brucedawson
2016/06/03 23:36:15
fixes -> fixed
|
| + TimeTicks wait_for_work_timeticks = TimeTicks::Now(); |
| + debug::Alias(&wait_for_work_timeticks); |
| + debug::Alias(&delay); |
| + |
| DWORD result = |
| MsgWaitForMultipleObjectsEx(1, &event_, delay, QS_ALLINPUT, 0); |
| - if (result == WAIT_OBJECT_0) { |
| - // Work available. |
| + DCHECK_NE(WAIT_FAILED, result) << GetLastError(); |
| + if (result != WAIT_TIMEOUT) { |
| + // Either work or message available. |
| return; |
| - } else if (result == WAIT_OBJECT_0 + 1) { |
| - // Message available. Keep waiting if this message isn't for this thread. |
| - MSG msg; |
| - if (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) |
| - return; |
| } |
| - |
| - DCHECK_NE(WAIT_FAILED, result) << GetLastError(); |
| } |
| } |