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

Unified Diff: content/renderer/input/render_widget_input_handler.cc

Issue 2233543002: Make first TouchStart and first TouchMove events on a flinging layer non-blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fling intervetion Created 4 years, 4 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: content/renderer/input/render_widget_input_handler.cc
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index 55f2aefb8063b0a2623e71ee0f0e57b693fa37d3..a77f9d1ff2825dd64ab3c5dcea0b40d43cd3b85b 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -127,14 +127,14 @@ void LogPassiveEventListenersUma(WebInputEventResult result,
PASSIVE_LISTENER_UMA_ENUM_SUPPRESSED,
PASSIVE_LISTENER_UMA_ENUM_CANCELABLE,
PASSIVE_LISTENER_UMA_ENUM_CANCELABLE_AND_CANCELED,
- PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING,
+ PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING,
PASSIVE_LISTENER_UMA_ENUM_COUNT
};
int enum_value;
switch (dispatch_type) {
- case WebInputEvent::ListenersForcedNonBlockingPassive:
- enum_value = PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING;
+ case WebInputEvent::ListenersForcedNonBlockingPassiveDueToFling:
+ enum_value = PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING;
break;
case WebInputEvent::ListenersNonBlockingPassive:
enum_value = PASSIVE_LISTENER_UMA_ENUM_PASSIVE;
@@ -164,10 +164,11 @@ void LogPassiveEventListenersUma(WebInputEventResult result,
UMA_HISTOGRAM_CUSTOM_COUNTS("Event.PassiveListeners.Latency",
GetEventLatencyMicros(event_timestamp, now),
1, 10000000, 100);
- } else if (enum_value == PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING) {
+ } else if (enum_value ==
+ PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING) {
base::TimeTicks now = base::TimeTicks::Now();
UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Event.PassiveListeners.ForcedNonBlockingLatency",
+ "Event.PassiveListeners.ForcedNonBlockingLatencyDueToFling",
GetEventLatencyMicros(event_timestamp, now), 1, 10000000, 100);
}
}
@@ -334,21 +335,16 @@ void RenderWidgetInputHandler::HandleInputEvent(
LogPassiveEventListenersUma(processed, touch.dispatchType,
input_event.timeStampSeconds, latency_info);
- if (input_event.type == WebInputEvent::TouchStart &&
- touch.dispatchType == WebInputEvent::Blocking &&
+ // TODO(lanwei): May remove it when we no longer need any metric for event
tdresser 2016/08/17 14:32:28 Make it clear what "it" is here. Make this a bit m
lanwei 2016/08/18 12:31:47 Done.
+ // latency outside fling.
+ if (touch.dispatchType == WebInputEvent::Blocking &&
+ touch.touchStartOrFirstTouchMove &&
base::TimeTicks::IsHighResolution()) {
base::TimeTicks now = base::TimeTicks::Now();
- if (touch.dispatchedDuringFling) {
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Event.Touch.TouchStartLatencyDuringFling",
- GetEventLatencyMicros(input_event.timeStampSeconds, now), 1,
- 100000000, 50);
- } else {
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Event.Touch.TouchStartLatencyOutsideFling",
- GetEventLatencyMicros(input_event.timeStampSeconds, now), 1,
- 100000000, 50);
- }
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Touch.TouchLatencyOutsideFling",
+ GetEventLatencyMicros(input_event.timeStampSeconds, now), 1,
+ 100000000, 50);
}
} else if (input_event.type == WebInputEvent::MouseWheel) {
LogPassiveEventListenersUma(

Powered by Google App Engine
This is Rietveld 408576698