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

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: Add comments for nestable tracing and |first_original_event()| 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') | no next file with comments »
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..30b3f7eee3c535ab69fc3582fd1dd26378d07033 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,13 @@ 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 could be nested as there might be multiple events in queue.
+ // e.g. |ScrollUpdate|, |ScrollEnd|, and another scroll sequence.
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("input",
+ "CompositorThreadEventQueue::Queue",
+ new_event->first_original_event());
+ }
queue_.emplace_back(std::move(new_event));
return;
}
@@ -88,6 +96,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698