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

Unified Diff: ui/events/gestures/gesture_sequence.cc

Issue 25022003: Report LatencyInfo through trace buffer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix typo Created 7 years, 2 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
Index: ui/events/gestures/gesture_sequence.cc
diff --git a/ui/events/gestures/gesture_sequence.cc b/ui/events/gestures/gesture_sequence.cc
index 83266856e8cecac1dbb3ebdb944a575ea2d684df..c0c8171b58479cc554bd2c803f3e88ba259aed55 100644
--- a/ui/events/gestures/gesture_sequence.cc
+++ b/ui/events/gestures/gesture_sequence.cc
@@ -596,10 +596,26 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture(
}
}
- const ui::LatencyInfo* touch_latency = event.latency();
- Gestures::iterator it = gestures->begin();
- for (; it != gestures->end(); it++) {
- (*it)->latency()->MergeWith(*touch_latency);
+ // If the touch event does not cause any rendering scheduled, then
+ // 1) If the touch event does not generate any gesture event, its
+ // LatencyInfo ends here.
+ // 2) If the touch event generates gesture events, its latencyinfo
+ // is copied into the gesture events.
+ if (!event.latency()->FindLatency(
+ ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) {
+ if (gestures->empty()) {
+ ui::LatencyInfo* touch_latency =
+ const_cast<ui::LatencyInfo*>(event.latency());
+ touch_latency->AddLatencyNumber(
+ ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, 0);
+ } else {
+ Gestures::iterator it = gestures->begin();
+ for (; it != gestures->end(); it++) {
+ (*it)->latency()->MergeWith(*event.latency());
+ // Inheriting the trace_id from the touch event's LatencyInfo
+ (*it)->latency()->trace_id = event.latency()->trace_id;
+ }
+ }
sadrul 2013/10/09 19:23:27 Please move this block of code into a separate ind
Yufeng Shen (Slow to review) 2013/10/09 20:53:50 Done.
}
return gestures.release();

Powered by Google App Engine
This is Rietveld 408576698