Chromium Code Reviews| Index: content/browser/renderer_host/input/input_router_impl.cc |
| diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc |
| index 410f686d6b00f4ab130d499ddb35ce02ad5191c8..6b86bd9664d977d560f49da256be2135d4394fc0 100644 |
| --- a/content/browser/renderer_host/input/input_router_impl.cc |
| +++ b/content/browser/renderer_host/input/input_router_impl.cc |
| @@ -364,12 +364,15 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, |
| if (OfferToClient(input_event, latency_info)) |
| return; |
| - OfferToRenderer(input_event, latency_info); |
| - |
| // Touch events should always indicate in the event whether they are |
| // cancelable (respect ACK disposition) or not except touchmove. |
| bool needs_synthetic_ack = |
| - !WebInputEventTraits::WillReceiveAckFromRenderer(input_event); |
| + !WebInputEventTraits::ShouldBlockEventOnRenderer(input_event); |
|
tdresser
2016/03/15 13:41:21
I'd consider having two bools, "should_block" and
dtapuska
2016/03/15 19:46:04
I changed it to should_block... I don't see how tw
tdresser
2016/03/16 15:34:47
Acknowledged.
|
| + |
| + OfferToRenderer(input_event, latency_info, |
| + needs_synthetic_ack |
| + ? InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING |
| + : InputEventDispatchType::DISPATCH_TYPE_BLOCKING); |
| if (WebInputEvent::isTouchEventType(input_event.type) && |
| input_event.type != WebInputEvent::TouchMove) { |
| @@ -415,7 +418,8 @@ bool InputRouterImpl::OfferToClient(const WebInputEvent& input_event, |
| } |
| bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, |
| - const ui::LatencyInfo& latency_info) { |
| + const ui::LatencyInfo& latency_info, |
| + InputEventDispatchType dispatch_type) { |
| // This conversion is temporary. WebInputEvent should be generated |
| // directly from ui::Event with the viewport coordinates. See |
| // crbug.com/563730. |
| @@ -424,13 +428,12 @@ bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, |
| const WebInputEvent* event_to_send = |
| event_in_viewport ? event_in_viewport.get() : &input_event; |
| - if (Send(new InputMsg_HandleInputEvent( |
| - routing_id(), event_to_send, latency_info, |
| - InputEventDispatchType::DISPATCH_TYPE_NORMAL))) { |
| + if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, |
| + latency_info, dispatch_type))) { |
| // Ack messages for ignored ack event types should never be sent by the |
| // renderer. Consequently, such event types should not affect event time |
| // or in-flight event count metrics. |
| - if (WebInputEventTraits::WillReceiveAckFromRenderer(*event_to_send)) { |
| + if (dispatch_type == InputEventDispatchType::DISPATCH_TYPE_BLOCKING) { |
| input_event_start_time_ = TimeTicks::Now(); |
| client_->IncrementInFlightEventCount(); |
| } |