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

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: set non_blocking to true 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 ebc894b4d2068aba2f37ca5fd5b85251c2a96468..376c3934e153d3338fcd2d3d1f8feafcf0f29c76 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
+ // 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