Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: ui/events/blink/compositor_thread_event_queue.cc

Issue 2695603004: [VSync Queue] Add tracing for event queuing time and coalesced count (Closed)
Patch Set: Fix unittest: Add MessageLoop attribuate Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/blink/event_with_callback.h » ('j') | ui/events/blink/event_with_callback.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/compositor_thread_event_queue.cc
diff --git a/ui/events/blink/compositor_thread_event_queue.cc b/ui/events/blink/compositor_thread_event_queue.cc
index 5083d35d1383c43cd4c818321be1a62f4cf0bcf9..113510d489a2955a0442352d8c6dfa64acd19ae9 100644
--- a/ui/events/blink/compositor_thread_event_queue.cc
+++ b/ui/events/blink/compositor_thread_event_queue.cc
@@ -5,6 +5,7 @@
#include "ui/events/blink/compositor_thread_event_queue.h"
#include "base/memory/ptr_util.h"
+#include "base/trace_event/trace_event.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/blink/web_input_event_traits.h"
@@ -20,6 +21,11 @@ void CompositorThreadEventQueue::Queue(
if (queue_.empty() || !IsContinuousGestureEvent(new_event->event().type()) ||
!IsCompatibleScrollorPinch(ToWebGestureEvent(new_event->event()),
ToWebGestureEvent(queue_.back()->event()))) {
+ if (new_event->first_original_event()) {
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("input",
tdresser 2017/02/16 13:44:18 In what case would these nest?
chongz 2017/02/16 15:08:58 Added comments. // Trace could be nested as there
+ "CompositorThreadEventQueue::Queue",
+ new_event->first_original_event());
+ }
queue_.emplace_back(std::move(new_event));
return;
}
@@ -88,6 +94,13 @@ std::unique_ptr<EventWithCallback> CompositorThreadEventQueue::Pop() {
result = std::move(queue_.front());
queue_.pop_front();
}
+
+ if (result->first_original_event()) {
+ TRACE_EVENT_NESTABLE_ASYNC_END2(
+ "input", "CompositorThreadEventQueue::Queue",
+ result->first_original_event(), "type", result->event().type(),
+ "coalesced_count", result->coalesced_count());
+ }
return result;
}
« no previous file with comments | « no previous file | ui/events/blink/event_with_callback.h » ('j') | ui/events/blink/event_with_callback.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698