diff --git a/ipc/chromium/src/base/message_pump_win.cc b/ipc/chromium/src/base/message_pump_win.cc index df6a36e25ba8..07adf7f53c62 100644 --- a/ipc/chromium/src/base/message_pump_win.cc +++ b/ipc/chromium/src/base/message_pump_win.cc @@ -248,8 +248,6 @@ void MessagePumpForUI::WaitForWork() { if (delay < 0) // Negative value means no timers waiting. delay = INFINITE; - AUTO_PROFILER_THREAD_SLEEP; - mozilla::widget::WinUtils::WaitForMessage(delay); } diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index 1911f643f978..99aeea903530 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -9,6 +9,7 @@ #include #include +#include "GeckoProfiler.h" #include "gfxPlatform.h" #include "gfxUtils.h" #include "nsWindow.h" @@ -736,8 +737,12 @@ void WinUtils::WaitForMessage(DWORD aTimeoutMs) { if (elapsed >= aTimeoutMs) { break; } - DWORD result = ::MsgWaitForMultipleObjectsEx(0, NULL, aTimeoutMs - elapsed, - MOZ_QS_ALLEVENT, waitFlags); + DWORD result; + { + AUTO_PROFILER_THREAD_SLEEP; + result = ::MsgWaitForMultipleObjectsEx(0, NULL, aTimeoutMs - elapsed, + MOZ_QS_ALLEVENT, waitFlags); + } NS_WARNING_ASSERTION(result != WAIT_FAILED, "Wait failed"); if (result == WAIT_TIMEOUT) { break; diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index 374b7f1f77b4..1e051536989f 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -543,7 +543,6 @@ bool nsAppShell::ProcessNextNativeEvent(bool mayWait) { mozilla::BackgroundHangMonitor().NotifyWait(); { AUTO_PROFILER_LABEL("nsAppShell::ProcessNextNativeEvent::Wait", IDLE); - AUTO_PROFILER_THREAD_SLEEP; WinUtils::WaitForMessage(); } }