| Index: content/browser/renderer_host/input/immediate_input_router.cc
|
| diff --git a/content/browser/renderer_host/input/immediate_input_router.cc b/content/browser/renderer_host/input/immediate_input_router.cc
|
| index a4c69054fd16cb8838053438b95b287a81ae904c..68435c70788d0cd999da27719025fdfaec7898ce 100644
|
| --- a/content/browser/renderer_host/input/immediate_input_router.cc
|
| +++ b/content/browser/renderer_host/input/immediate_input_router.cc
|
| @@ -481,11 +481,11 @@ void ImmediateInputRouter::ProcessInputEventAck(
|
| } else if (WebInputEvent::isKeyboardEventType(type)) {
|
| ProcessKeyboardAck(type, ack_result);
|
| } else if (type == WebInputEvent::MouseWheel) {
|
| - ProcessWheelAck(ack_result);
|
| + ProcessWheelAck(ack_result, latency_info);
|
| } else if (WebInputEvent::isTouchEventType(type)) {
|
| ProcessTouchAck(ack_result, latency_info);
|
| } else if (WebInputEvent::isGestureEventType(type)) {
|
| - ProcessGestureAck(type, ack_result);
|
| + ProcessGestureAck(type, ack_result, latency_info);
|
| }
|
|
|
| // WARNING: |this| may be deleted at this point.
|
| @@ -524,13 +524,16 @@ void ImmediateInputRouter::ProcessKeyboardAck(
|
| }
|
| }
|
|
|
| -void ImmediateInputRouter::ProcessWheelAck(InputEventAckState ack_result) {
|
| - mouse_wheel_pending_ = false;
|
| -
|
| +void ImmediateInputRouter::ProcessWheelAck(InputEventAckState ack_result,
|
| + const ui::LatencyInfo& latency) {
|
| + // TODO(miletus): Add renderer side latency to each uncoalesced mouse
|
| + // wheel event and add terminal component to each of them.
|
| + current_wheel_event_.latency.AddNewLatencyFrom(latency);
|
| // Process the unhandled wheel event here before calling
|
| // ForwardWheelEventWithLatencyInfo() since it will mutate
|
| // current_wheel_event_.
|
| - ack_handler_->OnWheelEventAck(current_wheel_event_.event, ack_result);
|
| + ack_handler_->OnWheelEventAck(current_wheel_event_, ack_result);
|
| + mouse_wheel_pending_ = false;
|
|
|
| // Now send the next (coalesced) mouse wheel event.
|
| if (!coalesced_mouse_wheel_events_.empty()) {
|
| @@ -542,18 +545,22 @@ void ImmediateInputRouter::ProcessWheelAck(InputEventAckState ack_result) {
|
| }
|
|
|
| void ImmediateInputRouter::ProcessGestureAck(int type,
|
| - InputEventAckState ack_result) {
|
| + InputEventAckState ack_result,
|
| + const ui::LatencyInfo& latency) {
|
| const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result);
|
| - ack_handler_->OnGestureEventAck(
|
| - gesture_event_filter_->GetGestureEventAwaitingAck(), ack_result);
|
| + // TODO(miletus): Add renderer side latency to each uncoalesced gesture
|
| + // event event and add terminal component to each of them.
|
| + GestureEventWithLatencyInfo event(
|
| + gesture_event_filter_->GetGestureEventAwaitingAck(), latency);
|
| + ack_handler_->OnGestureEventAck(event, ack_result);
|
| gesture_event_filter_->ProcessGestureAck(processed, type);
|
| }
|
|
|
| void ImmediateInputRouter::ProcessTouchAck(
|
| InputEventAckState ack_result,
|
| - const ui::LatencyInfo& latency_info) {
|
| + const ui::LatencyInfo& latency) {
|
| // |touch_event_queue_| will forward to OnTouchEventAck when appropriate.
|
| - touch_event_queue_->ProcessTouchAck(ack_result, latency_info);
|
| + touch_event_queue_->ProcessTouchAck(ack_result, latency);
|
| }
|
|
|
| void ImmediateInputRouter::HandleGestureScroll(
|
|
|