Chromium Code Reviews| 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..d706a24352d13049591e0d2b59e4d8f37182ee49 100644 |
| --- a/content/browser/renderer_host/input/immediate_input_router.cc |
| +++ b/content/browser/renderer_host/input/immediate_input_router.cc |
| @@ -358,6 +358,7 @@ void ImmediateInputRouter::FilterAndSendWebInputEvent( |
| DCHECK(!process_->IgnoreInputEvents()); |
| + ui::LatencyInfo renderer_latency; |
|
jdduke (slow)
2013/10/08 20:58:50
Why not use the original |latency_info| as before?
Yufeng Shen (Slow to review)
2013/10/08 21:35:18
right. forgot to clean this. done.
|
| // Perform optional, synchronous event handling, sending ACK messages for |
| // processed events, or proceeding as usual. |
| InputEventAckState filter_ack = client_->FilterInputEvent(input_event, |
| @@ -367,7 +368,7 @@ void ImmediateInputRouter::FilterAndSendWebInputEvent( |
| case INPUT_EVENT_ACK_STATE_CONSUMED: |
| case INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS: |
| next_mouse_move_.reset(); |
| - ProcessInputEventAck(input_event.type, filter_ack, latency_info); |
| + ProcessInputEventAck(input_event.type, filter_ack, renderer_latency); |
| // WARNING: |this| may be deleted at this point. |
| return; |
| @@ -396,7 +397,7 @@ void ImmediateInputRouter::FilterAndSendWebInputEvent( |
| // processed, to make sure that the touch-scroll gesture that initiated |
| // the overscroll is updated properly. |
| touch_event_queue_->ProcessTouchAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, |
| - latency_info); |
| + renderer_latency); |
| } |
| return; |
| } |
| @@ -481,11 +482,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 +525,20 @@ void ImmediateInputRouter::ProcessKeyboardAck( |
| } |
| } |
| -void ImmediateInputRouter::ProcessWheelAck(InputEventAckState ack_result) { |
| +void ImmediateInputRouter::ProcessWheelAck(InputEventAckState ack_result, |
| + const ui::LatencyInfo& latency) { |
| mouse_wheel_pending_ = false; |
|
jdduke (slow)
2013/10/08 20:58:50
Could you move |mouse_wheel_pending_ = false| down
Yufeng Shen (Slow to review)
2013/10/08 21:35:18
Done.
|
| + // TODO(miletus): Add renderer side latency to each uncoalesced mouse |
| + // wheel event and add terminal component to each of them. |
| + ui::LatencyInfo combined_latency = current_wheel_event_.latency; |
|
jdduke (slow)
2013/10/08 20:58:50
I don't think you need the temporary |combined_lat
Yufeng Shen (Slow to review)
2013/10/08 21:35:18
Done.
|
| + combined_latency.AddNewLatencyFrom(latency); |
| + MouseWheelEventWithLatencyInfo event( |
| + current_wheel_event_.event, combined_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(event, ack_result); |
| // Now send the next (coalesced) mouse wheel event. |
| if (!coalesced_mouse_wheel_events_.empty()) { |
| @@ -542,18 +550,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. |
|
jdduke (slow)
2013/10/08 20:58:50
You'll need to rebase to crrev.com/26376002 after
|
| + 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( |