| 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 02d6fe58707c2660ee5e60850f17787d000fc5cf..f80992688f41c89539957c401763ab279dd2fcc1 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
|
| @@ -7,6 +7,7 @@
|
| #include <stddef.h>
|
|
|
| #include "base/logging.h"
|
| +#include "base/metrics/histogram_functions.h"
|
| #include "base/metrics/histogram_macros.h"
|
| #include "build/build_config.h"
|
| #include "components/rappor/public/rappor_utils.h"
|
| @@ -75,32 +76,41 @@ void UpdateLatencyCoordinates(const WebInputEvent& event,
|
| }
|
| }
|
|
|
| -// Touch to scroll latency that is mostly under 1 second.
|
| -#define UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(name, start, end) \
|
| - UMA_HISTOGRAM_CUSTOM_COUNTS( \
|
| - name, (end.event_time - start.event_time).InMicroseconds(), 1, 1000000, \
|
| - 100)
|
| -
|
| -// Long scroll latency component that is mostly under 200ms.
|
| -#define UMA_HISTOGRAM_SCROLL_LATENCY_LONG(name, start, end) \
|
| - UMA_HISTOGRAM_CUSTOM_COUNTS( \
|
| - name, \
|
| - (end.event_time - start.event_time).InMicroseconds(), \
|
| - 1000, 200000, 50)
|
| -
|
| -// Short scroll latency component that is mostly under 50ms.
|
| -#define UMA_HISTOGRAM_SCROLL_LATENCY_SHORT(name, start, end) \
|
| - UMA_HISTOGRAM_CUSTOM_COUNTS( \
|
| - name, \
|
| - (end.event_time - start.event_time).InMicroseconds(), \
|
| - 1, 50000, 50)
|
| -
|
| // Check valid timing for start and end latency components.
|
| #define CONFIRM_VALID_TIMING(start, end) \
|
| DCHECK(!start.first_event_time.is_null()); \
|
| DCHECK(!end.last_event_time.is_null()); \
|
| DCHECK_GE(end.last_event_time, start.first_event_time);
|
|
|
| +// Long scroll latency component that is mostly under 200ms.
|
| +#define UMA_HISTOGRAM_SCROLL_LATENCY_LONG(name, start, end) \
|
| + CONFIRM_VALID_TIMING(start, end); \
|
| + UMA_HISTOGRAM_CUSTOM_COUNTS( \
|
| + name, (end.event_time - start.event_time).InMicroseconds(), 1000, \
|
| + 200000, 50)
|
| +
|
| +// Short scroll latency component that is mostly under 50ms.
|
| +#define UMA_HISTOGRAM_SCROLL_LATENCY_SHORT(name, start, end) \
|
| + CONFIRM_VALID_TIMING(start, end); \
|
| + UMA_HISTOGRAM_CUSTOM_COUNTS( \
|
| + name, (end.event_time - start.event_time).InMicroseconds(), 1, 50000, \
|
| + 50)
|
| +
|
| +// Event latency that is mostly under 1 second. We should only use 100 buckets
|
| +// when needed.
|
| +#define UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(name, start, \
|
| + end) \
|
| + CONFIRM_VALID_TIMING(start, end) \
|
| + base::UmaHistogramCustomCounts( \
|
| + name, (end.last_event_time - start.first_event_time).InMicroseconds(), \
|
| + 1, 1000000, 100);
|
| +
|
| +#define UMA_HISTOGRAM_INPUT_LATENCY_MILLISECONDS(name, start, end) \
|
| + CONFIRM_VALID_TIMING(start, end) \
|
| + base::UmaHistogramCustomCounts( \
|
| + name, (end.last_event_time - start.first_event_time).InMilliseconds(), \
|
| + 1, 1000, 50);
|
| +
|
| // Touch/wheel to scroll latency using Rappor.
|
| #define RAPPOR_TOUCH_WHEEL_TO_SCROLL_LATENCY(delegate, name, start, end) \
|
| CONFIRM_VALID_TIMING(start, end) \
|
| @@ -117,13 +127,6 @@ void UpdateLatencyCoordinates(const WebInputEvent& event,
|
| rappor_service->RecordSample(name, std::move(sample)); \
|
| }
|
|
|
| -// Touch/wheel to scroll latency that is mostly under 1 second.
|
| -#define UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY(name, start, end) \
|
| - CONFIRM_VALID_TIMING(start, end) \
|
| - base::Histogram::FactoryGet(name, 1, 1000000, 100, \
|
| - base::HistogramBase::kUmaTargetedHistogramFlag) \
|
| - ->Add((end.last_event_time - start.first_event_time).InMicroseconds());
|
| -
|
| // Long touch/wheel scroll latency component that is mostly under 200ms.
|
| #define UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2(name, start, end) \
|
| CONFIRM_VALID_TIMING(start, end) \
|
| @@ -138,6 +141,31 @@ void UpdateLatencyCoordinates(const WebInputEvent& event,
|
| base::HistogramBase::kUmaTargetedHistogramFlag) \
|
| ->Add((end.last_event_time - start.first_event_time).InMicroseconds());
|
|
|
| +std::string LatencySourceEventTypeToInputModalityString(
|
| + ui::SourceEventType type) {
|
| + switch (type) {
|
| + case ui::SourceEventType::WHEEL:
|
| + return "Wheel";
|
| + case ui::SourceEventType::TOUCH:
|
| + return "Touch";
|
| + default:
|
| + return "";
|
| + }
|
| +}
|
| +
|
| +std::string WebInputEventTypeToInputModalityString(WebInputEvent::Type type) {
|
| + if (type == blink::WebInputEvent::MouseWheel) {
|
| + return "Wheel";
|
| + } else if (WebInputEvent::isKeyboardEventType(type)) {
|
| + return "Key";
|
| + } else if (WebInputEvent::isMouseEventType(type)) {
|
| + return "Mouse";
|
| + } else if (WebInputEvent::isTouchEventType(type)) {
|
| + return "Touch";
|
| + }
|
| + return "";
|
| +}
|
| +
|
| void ComputeScrollLatencyHistograms(
|
| const LatencyInfo::LatencyComponent& gpu_swap_begin_component,
|
| const LatencyInfo::LatencyComponent& gpu_swap_end_component,
|
| @@ -158,7 +186,7 @@ void ComputeScrollLatencyHistograms(
|
| // first scroll event in a sequence and the original timestamp of that
|
| // scroll event's underlying touch event.
|
| for (size_t i = 0; i < original_component.event_count; i++) {
|
| - UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| "Event.Latency.TouchToFirstScrollUpdateSwapBegin",
|
| original_component, gpu_swap_begin_component);
|
| }
|
| @@ -167,7 +195,7 @@ void ComputeScrollLatencyHistograms(
|
| // the experimentation finished (crbug.com/638827).
|
| if (is_running_navigation_hint_task) {
|
| for (size_t i = 0; i < original_component.event_count; i++) {
|
| - UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| "Event.Latency.TouchToFirstScrollUpdateSwapBegin_"
|
| "IsRunningNavigationHintTask",
|
| original_component, gpu_swap_begin_component);
|
| @@ -182,7 +210,7 @@ void ComputeScrollLatencyHistograms(
|
| // This UMA metric tracks the time from when the original touch event is
|
| // created to when the scroll gesture results in final frame swap.
|
| for (size_t i = 0; i < original_component.event_count; i++) {
|
| - UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| "Event.Latency.TouchToScrollUpdateSwapBegin", original_component,
|
| gpu_swap_begin_component);
|
| }
|
| @@ -191,7 +219,7 @@ void ComputeScrollLatencyHistograms(
|
| // the experimentation finished (crbug.com/638827).
|
| if (is_running_navigation_hint_task) {
|
| for (size_t i = 0; i < original_component.event_count; i++) {
|
| - UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| "Event.Latency.TouchToScrollUpdateSwapBegin_"
|
| "IsRunningNavigationHintTask",
|
| original_component, gpu_swap_begin_component);
|
| @@ -261,15 +289,17 @@ void ComputeTouchAndWheelScrollLatencyHistograms(
|
| const ui::LatencyInfo::LatencyComponent& gpu_swap_begin_component,
|
| const ui::LatencyInfo::LatencyComponent& gpu_swap_end_component,
|
| int64_t latency_component_id,
|
| - const ui::LatencyInfo& latency,
|
| - const std::string event_type_name) {
|
| + const ui::LatencyInfo& latency) {
|
| DCHECK(!latency.coalesced());
|
| - DCHECK(event_type_name == "Touch" || event_type_name == "Wheel");
|
| if (latency.coalesced())
|
| return;
|
|
|
| LatencyInfo::LatencyComponent original_component;
|
| std::string scroll_name = "ScrollUpdate";
|
| +
|
| + const std::string input_modality =
|
| + LatencySourceEventTypeToInputModalityString(latency.source_event_type());
|
| +
|
| if (latency.FindLatency(
|
| ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
|
| latency_component_id, &original_component)) {
|
| @@ -277,22 +307,21 @@ void ComputeTouchAndWheelScrollLatencyHistograms(
|
| // This UMA metric tracks the time between the final frame swap for the
|
| // first scroll event in a sequence and the original timestamp of that
|
| // scroll event's underlying touch/wheel event.
|
| -
|
| - UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY(
|
| - "Event.Latency.ScrollBegin." + event_type_name +
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| + "Event.Latency.ScrollBegin." + input_modality +
|
| ".TimeToScrollUpdateSwapBegin2",
|
| original_component, gpu_swap_begin_component);
|
|
|
| RAPPOR_TOUCH_WHEEL_TO_SCROLL_LATENCY(
|
| render_widget_host_delegate,
|
| - "Event.Latency.ScrollBegin." + event_type_name +
|
| + "Event.Latency.ScrollBegin." + input_modality +
|
| ".TimeToScrollUpdateSwapBegin2",
|
| original_component, gpu_swap_begin_component);
|
|
|
| // TODO(lanwei): Will remove them when M56 is stable, see
|
| // https://crbug.com/669618.
|
| - UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY(
|
| - "Event.Latency.ScrollUpdate." + event_type_name +
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| + "Event.Latency.ScrollUpdate." + input_modality +
|
| ".TimeToFirstScrollUpdateSwapBegin2",
|
| original_component, gpu_swap_begin_component);
|
| } else if (latency.FindLatency(
|
| @@ -301,10 +330,9 @@ void ComputeTouchAndWheelScrollLatencyHistograms(
|
| // This UMA metric tracks the time from when the original touch event is
|
| // created to when the scroll gesture results in final frame swap.
|
| // First scroll events are excluded from this metric.
|
| - if (event_type_name == "Touch") {
|
| - UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY(
|
| - "Event.Latency.ScrollUpdate." + event_type_name +
|
| - ".TimeToScrollUpdateSwapBegin2",
|
| + if (input_modality == "Touch") {
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| + "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2",
|
| original_component, gpu_swap_begin_component);
|
|
|
| RAPPOR_TOUCH_WHEEL_TO_SCROLL_LATENCY(
|
| @@ -331,7 +359,7 @@ void ComputeTouchAndWheelScrollLatencyHistograms(
|
| const std::string thread_name = rendering_scheduled_on_main ? "Main" : "Impl";
|
|
|
| UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2(
|
| - "Event.Latency." + scroll_name + "." + event_type_name +
|
| + "Event.Latency." + scroll_name + "." + input_modality +
|
| ".TimeToHandled2_" + thread_name,
|
| original_component, rendering_scheduled_component);
|
|
|
| @@ -341,7 +369,7 @@ void ComputeTouchAndWheelScrollLatencyHistograms(
|
| return;
|
|
|
| UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2(
|
| - "Event.Latency." + scroll_name + "." + event_type_name +
|
| + "Event.Latency." + scroll_name + "." + input_modality +
|
| ".HandledToRendererSwap2_" + thread_name,
|
| rendering_scheduled_component, renderer_swap_component);
|
|
|
| @@ -352,17 +380,17 @@ void ComputeTouchAndWheelScrollLatencyHistograms(
|
| return;
|
|
|
| UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2(
|
| - "Event.Latency." + scroll_name + "." + event_type_name +
|
| + "Event.Latency." + scroll_name + "." + input_modality +
|
| ".RendererSwapToBrowserNotified2",
|
| renderer_swap_component, browser_received_swap_component);
|
|
|
| UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2(
|
| - "Event.Latency." + scroll_name + "." + event_type_name +
|
| + "Event.Latency." + scroll_name + "." + input_modality +
|
| ".BrowserNotifiedToBeforeGpuSwap2",
|
| browser_received_swap_component, gpu_swap_begin_component);
|
|
|
| UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2(
|
| - "Event.Latency." + scroll_name + "." + event_type_name + ".GpuSwap2",
|
| + "Event.Latency." + scroll_name + "." + input_modality + ".GpuSwap2",
|
| gpu_swap_begin_component, gpu_swap_end_component);
|
| }
|
| // LatencyComponents generated in the renderer must have component IDs
|
| @@ -422,9 +450,16 @@ void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
|
| int64_t latency_component_id,
|
| const LatencyInfo& latency,
|
| InputEventAckState ack_result) {
|
| + // If this event was coalesced into another event, ignore it, as the event it
|
| + // was coalesced into will reflect the full latency.
|
| if (latency.coalesced())
|
| return;
|
|
|
| + if (type != blink::WebInputEvent::MouseWheel &&
|
| + !WebInputEvent::isTouchEventType(type)) {
|
| + return;
|
| + }
|
| +
|
| LatencyInfo::LatencyComponent rwh_component;
|
| if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
|
| latency_component_id, &rwh_component)) {
|
| @@ -437,12 +472,11 @@ void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
|
| &ui_component)) {
|
| DCHECK_EQ(ui_component.event_count, 1u);
|
| base::TimeDelta ui_delta =
|
| - rwh_component.event_time - ui_component.event_time;
|
| + rwh_component.last_event_time - ui_component.first_event_time;
|
|
|
| if (type == blink::WebInputEvent::MouseWheel) {
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.WheelUI",
|
| ui_delta.InMicroseconds(), 1, 20000, 100);
|
| -
|
| } else {
|
| DCHECK(WebInputEvent::isTouchEventType(type));
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.TouchUI",
|
| @@ -456,55 +490,19 @@ void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
|
| bool action_prevented = touch_start_default_prevented_ ||
|
| ack_result == INPUT_EVENT_ACK_STATE_CONSUMED;
|
|
|
| + std::string event_name = WebInputEvent::GetName(type);
|
| +
|
| + std::string default_action_status =
|
| + action_prevented ? "DefaultPrevented" : "DefaultAllowed";
|
| +
|
| LatencyInfo::LatencyComponent main_component;
|
| if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
|
| &main_component)) {
|
| DCHECK_EQ(main_component.event_count, 1u);
|
| - base::TimeDelta queueing_delta =
|
| - main_component.event_time - rwh_component.event_time;
|
| -
|
| if (!multi_finger_gesture_) {
|
| - if (action_prevented) {
|
| - switch (type) {
|
| - case WebInputEvent::TouchStart:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.QueueingTime.TouchStartDefaultPrevented",
|
| - queueing_delta);
|
| - break;
|
| - case WebInputEvent::TouchMove:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.QueueingTime.TouchMoveDefaultPrevented",
|
| - queueing_delta);
|
| - break;
|
| - case WebInputEvent::TouchEnd:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.QueueingTime.TouchEndDefaultPrevented",
|
| - queueing_delta);
|
| - break;
|
| - default:
|
| - break;
|
| - }
|
| - } else {
|
| - switch (type) {
|
| - case WebInputEvent::TouchStart:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.QueueingTime.TouchStartDefaultAllowed",
|
| - queueing_delta);
|
| - break;
|
| - case WebInputEvent::TouchMove:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.QueueingTime.TouchMoveDefaultAllowed",
|
| - queueing_delta);
|
| - break;
|
| - case WebInputEvent::TouchEnd:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.QueueingTime.TouchEndDefaultAllowed",
|
| - queueing_delta);
|
| - break;
|
| - default:
|
| - break;
|
| - }
|
| - }
|
| + UMA_HISTOGRAM_INPUT_LATENCY_MILLISECONDS(
|
| + "Event.Latency.QueueingTime." + event_name + default_action_status,
|
| + rwh_component, main_component);
|
| }
|
| }
|
|
|
| @@ -512,65 +510,18 @@ void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
|
| if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
|
| &acked_component)) {
|
| DCHECK_EQ(acked_component.event_count, 1u);
|
| - base::TimeDelta acked_delta =
|
| - acked_component.event_time - rwh_component.event_time;
|
| - if (type == blink::WebInputEvent::MouseWheel) {
|
| - UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.WheelAcked",
|
| - acked_delta.InMicroseconds(), 1, 1000000,
|
| - 100);
|
| - } else {
|
| - DCHECK(WebInputEvent::isTouchEventType(type));
|
| - UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.TouchAcked",
|
| - acked_delta.InMicroseconds(), 1, 1000000,
|
| - 100);
|
| - }
|
| -
|
| if (!multi_finger_gesture_ &&
|
| main_component.event_time != base::TimeTicks()) {
|
| - base::TimeDelta blocking_delta;
|
| - blocking_delta = acked_component.event_time - main_component.event_time;
|
| -
|
| - if (action_prevented) {
|
| - switch (type) {
|
| - case WebInputEvent::TouchStart:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.BlockingTime.TouchStartDefaultPrevented",
|
| - blocking_delta);
|
| - break;
|
| - case WebInputEvent::TouchMove:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.BlockingTime.TouchMoveDefaultPrevented",
|
| - blocking_delta);
|
| - break;
|
| - case WebInputEvent::TouchEnd:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.BlockingTime.TouchEndDefaultPrevented",
|
| - blocking_delta);
|
| - break;
|
| - default:
|
| - break;
|
| - }
|
| - } else {
|
| - switch (type) {
|
| - case WebInputEvent::TouchStart:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.BlockingTime.TouchStartDefaultAllowed",
|
| - blocking_delta);
|
| - break;
|
| - case WebInputEvent::TouchMove:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.BlockingTime.TouchMoveDefaultAllowed",
|
| - blocking_delta);
|
| - break;
|
| - case WebInputEvent::TouchEnd:
|
| - UMA_HISTOGRAM_TIMES(
|
| - "Event.Latency.BlockingTime.TouchEndDefaultAllowed",
|
| - blocking_delta);
|
| - break;
|
| - default:
|
| - break;
|
| - }
|
| - }
|
| + UMA_HISTOGRAM_INPUT_LATENCY_MILLISECONDS(
|
| + "Event.Latency.BlockingTime." + event_name + default_action_status,
|
| + main_component, acked_component);
|
| + }
|
| +
|
| + std::string input_modality = WebInputEventTypeToInputModalityString(type);
|
| + if (input_modality != "") {
|
| + UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
|
| + "Event.Latency.Browser." + input_modality + "Acked", rwh_component,
|
| + acked_component);
|
| }
|
| }
|
| }
|
| @@ -639,21 +590,12 @@ void RenderWidgetHostLatencyTracker::OnInputEventAck(
|
| LatencyInfo* latency, InputEventAckState ack_result) {
|
| DCHECK(latency);
|
|
|
| - // Latency ends when it is acked but does not cause render scheduling.
|
| + // Latency ends if an event is acked but does not cause render scheduling.
|
| bool rendering_scheduled = latency->FindLatency(
|
| ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, 0, nullptr);
|
| rendering_scheduled |= latency->FindLatency(
|
| ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, 0, nullptr);
|
|
|
| - if (WebInputEvent::isGestureEventType(event.type())) {
|
| - if (!rendering_scheduled) {
|
| - latency->AddLatencyNumber(
|
| - ui::INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT, 0, 0);
|
| - // TODO(jdduke): Consider exposing histograms for gesture event types.
|
| - }
|
| - return;
|
| - }
|
| -
|
| if (WebInputEvent::isTouchEventType(event.type())) {
|
| const WebTouchEvent& touch_event =
|
| *static_cast<const WebTouchEvent*>(&event);
|
| @@ -663,41 +605,18 @@ void RenderWidgetHostLatencyTracker::OnInputEventAck(
|
| touch_start_default_prevented_ =
|
| ack_result == INPUT_EVENT_ACK_STATE_CONSUMED;
|
| }
|
| -
|
| - latency->AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0);
|
| -
|
| - if (!rendering_scheduled) {
|
| - latency->AddLatencyNumber(
|
| - ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, 0);
|
| - }
|
| - ComputeInputLatencyHistograms(event.type(), latency_component_id_, *latency,
|
| - ack_result);
|
| - return;
|
| - }
|
| -
|
| - if (event.type() == WebInputEvent::MouseWheel) {
|
| - latency->AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0);
|
| - if (!rendering_scheduled) {
|
| - latency->AddLatencyNumber(
|
| - ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_WHEEL_COMPONENT, 0, 0);
|
| - }
|
| - ComputeInputLatencyHistograms(event.type(), latency_component_id_, *latency,
|
| - ack_result);
|
| - return;
|
| }
|
|
|
| - if (WebInputEvent::isMouseEventType(event.type()) && !rendering_scheduled) {
|
| + latency->AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0);
|
| + // If this event couldn't have caused a gesture event, and it didn't trigger
|
| + // rendering, we're done processing it.
|
| + if (!rendering_scheduled) {
|
| latency->AddLatencyNumber(
|
| - ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, 0, 0);
|
| - return;
|
| + ui::INPUT_EVENT_LATENCY_TERMINATED_NO_SWAP_COMPONENT, 0, 0);
|
| }
|
|
|
| - if (WebInputEvent::isKeyboardEventType(event.type()) &&
|
| - !rendering_scheduled) {
|
| - latency->AddLatencyNumber(
|
| - ui::INPUT_EVENT_LATENCY_TERMINATED_KEYBOARD_COMPONENT, 0, 0);
|
| - return;
|
| - }
|
| + ComputeInputLatencyHistograms(event.type(), latency_component_id_, *latency,
|
| + ack_result);
|
| }
|
|
|
| void RenderWidgetHostLatencyTracker::OnSwapCompositorFrame(
|
| @@ -713,7 +632,6 @@ void RenderWidgetHostLatencyTracker::OnSwapCompositorFrame(
|
| void RenderWidgetHostLatencyTracker::OnFrameSwapped(
|
| const LatencyInfo& latency,
|
| bool is_running_navigation_hint_task) {
|
| -
|
| LatencyInfo::LatencyComponent gpu_swap_end_component;
|
| if (!latency.FindLatency(
|
| ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0,
|
| @@ -747,8 +665,7 @@ void RenderWidgetHostLatencyTracker::OnFrameSwapped(
|
| source_event_type == ui::SourceEventType::TOUCH) {
|
| ComputeTouchAndWheelScrollLatencyHistograms(
|
| render_widget_host_delegate_, gpu_swap_begin_component,
|
| - gpu_swap_end_component, latency_component_id_, latency,
|
| - source_event_type == ui::SourceEventType::WHEEL ? "Wheel" : "Touch");
|
| + gpu_swap_end_component, latency_component_id_, latency);
|
| }
|
|
|
| // Compute the old scroll update latency metrics. They are exclusively
|
|
|