Chromium Code Reviews| 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 811554176974f8afdcfe2a08b02ea5c5bb685d9b..8405e216412d0fba134318ac2317a7b2e8af5a2e 100644 |
| --- a/ui/events/blink/input_handler_proxy.cc |
| +++ b/ui/events/blink/input_handler_proxy.cc |
| @@ -276,12 +276,13 @@ InputHandlerProxy::HandleInputEventWithLatencyInfo( |
| std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = |
| input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info); |
| - InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); |
| + InputHandlerProxy::EventDisposition disposition = |
| + HandleInputEvent(event, latency_info); |
| return disposition; |
| } |
| InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( |
| - const WebInputEvent& event) { |
| + const WebInputEvent& event, ui::LatencyInfo* latency_info) { |
| DCHECK(input_handler_); |
| if (FilterInputEventForFlingBoosting(event)) |
| @@ -297,7 +298,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( |
| case WebInputEvent::GestureScrollUpdate: |
| return HandleGestureScrollUpdate( |
| - static_cast<const WebGestureEvent&>(event)); |
| + static_cast<const WebGestureEvent&>(event), latency_info); |
| case WebInputEvent::GestureScrollEnd: |
| return HandleGestureScrollEnd(static_cast<const WebGestureEvent&>(event)); |
| @@ -647,7 +648,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin( |
| InputHandlerProxy::EventDisposition |
| InputHandlerProxy::HandleGestureScrollUpdate( |
| - const WebGestureEvent& gesture_event) { |
| + const WebGestureEvent& gesture_event, ui::LatencyInfo* latency_info) { |
| #ifndef NDEBUG |
| DCHECK(expect_scroll_update_end_); |
| #endif |
| @@ -662,8 +663,20 @@ InputHandlerProxy::HandleGestureScrollUpdate( |
| if (ShouldAnimate(gesture_event.data.scrollUpdate.deltaUnits != |
| blink::WebGestureEvent::ScrollUnits::Pixels)) { |
| switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta).thread) { |
| - case cc::InputHandler::SCROLL_ON_IMPL_THREAD: |
| + case cc::InputHandler::SCROLL_ON_IMPL_THREAD: { |
| + for (const auto& lc : latency_info->latency_components()) { |
| + if (lc.first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT) { |
| + LatencyInfo::LatencyComponent o_component; |
| + if (latency_info->FindLatency( |
| + ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, &o_component)) { |
| + input_handler_->AdjustDuration( |
| + lc.second.event_time - o_component.event_time); |
|
skobes
2016/06/08 22:47:28
I don't really understand what this is doing, is i
|
| + } |
| + break; |
| + } |
| + } |
| return DID_HANDLE; |
| + } |
| case cc::InputHandler::SCROLL_IGNORED: |
| return DROP_EVENT; |
| default: |