| Index: ui/events/blink/input_handler_proxy.cc
|
| diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
|
| index 6b70036e9e7a645e0dfa4d39cc63c90f23bccd1d..33a3a02bef03fb573f07833aefce77da041d5aad 100644
|
| --- a/ui/events/blink/input_handler_proxy.cc
|
| +++ b/ui/events/blink/input_handler_proxy.cc
|
| @@ -232,6 +232,13 @@ cc::InputHandler::ScrollInputType GestureScrollInputType(
|
| : cc::InputHandler::TOUCHSCREEN;
|
| }
|
|
|
| +enum ScrollingThreadStatus {
|
| + SCROLLING_ON_COMPOSITOR,
|
| + SCROLLING_ON_COMPOSITOR_BLOCKED_ON_MAIN,
|
| + SCROLLING_ON_MAIN,
|
| + LAST_SCROLLING_THREAD_STATUS_VALUE = SCROLLING_ON_MAIN,
|
| +};
|
| +
|
| } // namespace
|
|
|
| namespace ui {
|
| @@ -256,6 +263,7 @@ InputHandlerProxy::InputHandlerProxy(cc::InputHandler* input_handler,
|
| uma_latency_reporting_enabled_(base::TimeTicks::IsHighResolution()),
|
| touchpad_and_wheel_scroll_latching_enabled_(false),
|
| touch_start_result_(kEventDispositionUndefined),
|
| + mouse_wheel_result_(kEventDispositionUndefined),
|
| current_overscroll_params_(nullptr),
|
| has_ongoing_compositor_scroll_pinch_(false),
|
| tick_clock_(base::MakeUnique<base::DefaultTickClock>()) {
|
| @@ -585,6 +593,54 @@ void InputHandlerProxy::RecordMainThreadScrollingReasons(
|
| }
|
| }
|
|
|
| +void InputHandlerProxy::RecordScrollingThreadStatus(
|
| + blink::WebGestureDevice device,
|
| + uint32_t reasons) {
|
| + DCHECK(device == blink::WebGestureDeviceTouchpad ||
|
| + device == blink::WebGestureDeviceTouchscreen);
|
| +
|
| + if (device != blink::WebGestureDeviceTouchpad &&
|
| + device != blink::WebGestureDeviceTouchscreen) {
|
| + return;
|
| + }
|
| +
|
| + ScrollingThreadStatus scrolling_thread_status = SCROLLING_ON_MAIN;
|
| + if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) {
|
| + int32_t event_disposition_result =
|
| + (device == blink::WebGestureDeviceTouchpad ? mouse_wheel_result_
|
| + : touch_start_result_);
|
| + switch (event_disposition_result) {
|
| + case kEventDispositionUndefined:
|
| + case DID_NOT_HANDLE_NON_BLOCKING_DUE_TO_FLING:
|
| + case DID_HANDLE_NON_BLOCKING:
|
| + case DROP_EVENT:
|
| + scrolling_thread_status = SCROLLING_ON_COMPOSITOR;
|
| + break;
|
| + case DID_NOT_HANDLE:
|
| + scrolling_thread_status = SCROLLING_ON_COMPOSITOR_BLOCKED_ON_MAIN;
|
| + break;
|
| + default:
|
| + NOTREACHED();
|
| + scrolling_thread_status = SCROLLING_ON_COMPOSITOR;
|
| + }
|
| + }
|
| +
|
| + // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly
|
| + // greater than the sample value.
|
| + const uint32_t kScrolingThreadStatusEnumMax =
|
| + ScrollingThreadStatus::LAST_SCROLLING_THREAD_STATUS_VALUE + 1;
|
| +
|
| + if (device == blink::WebGestureDeviceTouchscreen) {
|
| + UMA_HISTOGRAM_ENUMERATION("Renderer4.GestureScrollingThreadStatus",
|
| + scrolling_thread_status,
|
| + kScrolingThreadStatusEnumMax);
|
| + } else {
|
| + UMA_HISTOGRAM_ENUMERATION("Renderer4.WheelScrollingThreadStatus",
|
| + scrolling_thread_status,
|
| + kScrolingThreadStatusEnumMax);
|
| + }
|
| +}
|
| +
|
| bool InputHandlerProxy::ShouldAnimate(bool has_precise_scroll_deltas) const {
|
| #if defined(OS_MACOSX)
|
| // Mac does not smooth scroll wheel events (crbug.com/574283).
|
| @@ -601,21 +657,28 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel(
|
| if (!wheel_event.hasPreciseScrollingDeltas && fling_curve_)
|
| CancelCurrentFling();
|
|
|
| + InputHandlerProxy::EventDisposition result = DROP_EVENT;
|
| cc::EventListenerProperties properties =
|
| input_handler_->GetEventListenerProperties(
|
| cc::EventListenerClass::kMouseWheel);
|
| switch (properties) {
|
| case cc::EventListenerProperties::kPassive:
|
| - return DID_HANDLE_NON_BLOCKING;
|
| + result = DID_HANDLE_NON_BLOCKING;
|
| + break;
|
| case cc::EventListenerProperties::kBlockingAndPassive:
|
| case cc::EventListenerProperties::kBlocking:
|
| - return DID_NOT_HANDLE;
|
| + result = DID_NOT_HANDLE;
|
| + break;
|
| case cc::EventListenerProperties::kNone:
|
| - return DROP_EVENT;
|
| + result = DROP_EVENT;
|
| + break;
|
| default:
|
| NOTREACHED();
|
| - return DROP_EVENT;
|
| + result = DROP_EVENT;
|
| }
|
| +
|
| + mouse_wheel_result_ = result;
|
| + return result;
|
| }
|
|
|
| InputHandlerProxy::EventDisposition InputHandlerProxy::FlingScrollByMouseWheel(
|
| @@ -670,6 +733,13 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::FlingScrollByMouseWheel(
|
| blink::WebGestureDeviceTouchpad,
|
| scroll_status.main_thread_scrolling_reasons);
|
|
|
| + mouse_wheel_result_ =
|
| + (listener_properties == cc::EventListenerProperties::kPassive)
|
| + ? DID_HANDLE_NON_BLOCKING
|
| + : DROP_EVENT;
|
| + RecordScrollingThreadStatus(blink::WebGestureDeviceTouchpad,
|
| + scroll_status.main_thread_scrolling_reasons);
|
| +
|
| switch (scroll_status.thread) {
|
| case cc::InputHandler::SCROLL_ON_IMPL_THREAD: {
|
| TRACE_EVENT_INSTANT2("input",
|
| @@ -751,6 +821,8 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
|
|
|
| RecordMainThreadScrollingReasons(gesture_event.sourceDevice,
|
| scroll_status.main_thread_scrolling_reasons);
|
| + RecordScrollingThreadStatus(gesture_event.sourceDevice,
|
| + scroll_status.main_thread_scrolling_reasons);
|
|
|
| InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE;
|
| switch (scroll_status.thread) {
|
|
|