summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2015-01-06 14:07:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-06 22:08:35 +0000
commit4949a513d841da01d66a32f54a98fec518c3fde3 (patch)
treea561e3f3a6c5f2ebb2917d789ceb3d7fac474c7f /base
parentbf879be1cda99b43f81447c9fd5077a4e2d91e15 (diff)
downloadchromium_src-4949a513d841da01d66a32f54a98fec518c3fde3.zip
chromium_src-4949a513d841da01d66a32f54a98fec518c3fde3.tar.gz
chromium_src-4949a513d841da01d66a32f54a98fec518c3fde3.tar.bz2
Further instrumentations to find jank in Windows message processing.
Based on the latest revelations: 440919 WindowImpl::WndProc2 = 90 jph. Since the internals of OnWndProc are instrumented, this strangely indicates that it's GetWindowUserData who is responsible for this jank. Instrumenting it. 440919 <<MessagePumpForUI::ProcessNextWindowsMessage>> = 46 jph and 440919 MessagePumpForUI::ProcessMessageHelper = 39 jph This means that with instrumenting MessagePumpForUI::ProcessMessageHelper, we've divided MessagePumpForUI::ProcessNextWindowsMessage into 2 roughly equal parts: everything that happens inside MessagePumpForUI::ProcessMessageHelper, and everything outside (GetQueueStatus and PeekMessage). Adding in instrumentation to separate GetQueueStatus from PeekMessage. Also instrumenting internals of MessagePumpForUI::ProcessMessageHelper. BUG=440919 Review URL: https://codereview.chromium.org/835183002 Cr-Commit-Position: refs/heads/master@{#310156}
Diffstat (limited to 'base')
-rw-r--r--base/message_loop/message_pump_win.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/base/message_loop/message_pump_win.cc b/base/message_loop/message_pump_win.cc
index 08f00f5..3e48095 100644
--- a/base/message_loop/message_pump_win.cc
+++ b/base/message_loop/message_pump_win.cc
@@ -321,9 +321,9 @@ void MessagePumpForUI::HandleTimerMessage() {
bool MessagePumpForUI::ProcessNextWindowsMessage() {
// TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
- tracked_objects::ScopedTracker tracking_profile(
+ tracked_objects::ScopedTracker tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "440919 <<MessagePumpForUI::ProcessNextWindowsMessage>>"));
+ "440919 MessagePumpForUI::ProcessNextWindowsMessage1"));
// If there are sent messages in the queue then PeekMessage internally
// dispatches the message and returns false. We return true in this
@@ -334,6 +334,11 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() {
if (HIWORD(queue_status) & QS_SENDMESSAGE)
sent_messages_in_queue = true;
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
+ tracked_objects::ScopedTracker tracking_profile2(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "440919 MessagePumpForUI::ProcessNextWindowsMessage2"));
+
MSG msg;
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != FALSE)
return ProcessMessageHelper(msg);
@@ -343,9 +348,9 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() {
bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
// TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
- tracked_objects::ScopedTracker tracking_profile(
+ tracked_objects::ScopedTracker tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "440919 MessagePumpForUI::ProcessMessageHelper"));
+ "440919 MessagePumpForUI::ProcessMessageHelper1"));
TRACE_EVENT1("base", "MessagePumpForUI::ProcessMessageHelper",
"message", msg.message);
@@ -361,9 +366,19 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
if (msg.message == kMsgHaveWork && msg.hwnd == message_hwnd_)
return ProcessPumpReplacementMessage();
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
+ tracked_objects::ScopedTracker tracking_profile2(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "440919 MessagePumpForUI::ProcessMessageHelper2"));
+
if (CallMsgFilter(const_cast<MSG*>(&msg), kMessageFilterCode))
return true;
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
+ tracked_objects::ScopedTracker tracking_profile3(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "440919 MessagePumpForUI::ProcessMessageHelper3"));
+
uint32_t action = MessagePumpDispatcher::POST_DISPATCH_PERFORM_DEFAULT;
if (state_->dispatcher)
action = state_->dispatcher->Dispatch(msg);
@@ -378,6 +393,11 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
}
bool MessagePumpForUI::ProcessPumpReplacementMessage() {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "440919 MessagePumpForUI::ProcessPumpReplacementMessage"));
+
// When we encounter a kMsgHaveWork message, this method is called to peek
// and process a replacement message, such as a WM_PAINT or WM_TIMER. The
// goal is to make the kMsgHaveWork as non-intrusive as possible, even though