| Index: content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
|
| diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
|
| index 5ec74f7da9d699e76cc479034c6775d906576abe..a3ed17413621cbb7102874b139094fe157173efe 100644
|
| --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
|
| +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
|
| @@ -103,7 +103,8 @@ void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
|
| return;
|
|
|
| if (type != blink::WebInputEvent::kMouseWheel &&
|
| - !WebInputEvent::IsTouchEventType(type)) {
|
| + !WebInputEvent::IsTouchEventType(type) &&
|
| + !WebInputEvent::IsKeyboardEventType(type)) {
|
| return;
|
| }
|
|
|
| @@ -127,20 +128,28 @@ void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
|
| if (type == blink::WebInputEvent::kMouseWheel) {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.WheelUI",
|
| ui_delta.InMicroseconds(), 1, 20000, 100);
|
| - } else {
|
| - DCHECK(WebInputEvent::IsTouchEventType(type));
|
| + } else if (WebInputEvent::IsTouchEventType(type)) {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.TouchUI",
|
| ui_delta.InMicroseconds(), 1, 20000, 100);
|
| + } else if (WebInputEvent::IsKeyboardEventType(type)) {
|
| + UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.KeyUI",
|
| + ui_delta.InMicroseconds(), 1, 20000, 50);
|
| + } else {
|
| + // We should only report these histograms for wheel, touch and keyboard.
|
| + NOTREACHED();
|
| }
|
| }
|
|
|
| - // Both tap and scroll gestures depend on the disposition of the touch start
|
| - // and the current touch. For touch start, touch_start_default_prevented_ ==
|
| - // (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED).
|
| + // Touchscreen tap and scroll gestures depend on the disposition of the touch
|
| + // start and the current touch. For touch start,
|
| + // touch_start_default_prevented_ == (ack_result ==
|
| + // INPUT_EVENT_ACK_STATE_CONSUMED).
|
| bool action_prevented = touch_start_default_prevented_ ||
|
| ack_result == INPUT_EVENT_ACK_STATE_CONSUMED;
|
|
|
| std::string event_name = WebInputEvent::GetName(type);
|
| + if (WebInputEvent::IsKeyboardEventType(type))
|
| + event_name = "KeyEvent";
|
|
|
| std::string default_action_status =
|
| action_prevented ? "DefaultPrevented" : "DefaultAllowed";
|
|
|