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 d6fcb1c4f8be948d350401fd1e234e4bea707931..500c8eff2fd521bfa7560ac69d8819b176159f75 100644 |
--- a/content/browser/renderer_host/input/input_router_impl.cc |
+++ b/content/browser/renderer_host/input/input_router_impl.cc |
@@ -357,8 +357,11 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, |
// Touch events should always indicate in the event whether they are |
// cancelable (respect ACK disposition) or not. |
bool ignores_ack = WebInputEventTraits::IgnoresAckDisposition(input_event); |
+ uint64 unique_touch_event_id = 0; |
if (WebInputEvent::isTouchEventType(input_event.type)) { |
const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); |
+ unique_touch_event_id = touch.uniqueTouchEventId; |
+ DCHECK_NE(unique_touch_event_id, 0UL); |
DCHECK_NE(ignores_ack, !!touch.cancelable); |
} |
@@ -367,6 +370,7 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, |
ProcessInputEventAck(input_event.type, |
INPUT_EVENT_ACK_STATE_IGNORED, |
latency_info, |
+ unique_touch_event_id, |
IGNORING_DISPOSITION); |
} |
} |
@@ -374,6 +378,7 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, |
bool InputRouterImpl::OfferToClient(const WebInputEvent& input_event, |
const ui::LatencyInfo& latency_info) { |
bool consumed = false; |
+ uint64 unique_touch_event_id = 0; |
InputEventAckState filter_ack = |
client_->FilterInputEvent(input_event, latency_info); |
@@ -382,7 +387,13 @@ bool InputRouterImpl::OfferToClient(const WebInputEvent& input_event, |
case INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS: |
// Send the ACK and early exit. |
next_mouse_move_.reset(); |
- ProcessInputEventAck(input_event.type, filter_ack, latency_info, CLIENT); |
+ if (WebInputEvent::isTouchEventType(input_event.type)) { |
+ const WebTouchEvent& touch = |
+ static_cast<const WebTouchEvent&>(input_event); |
+ unique_touch_event_id = touch.uniqueTouchEventId; |
+ } |
+ ProcessInputEventAck(input_event.type, filter_ack, latency_info, |
+ unique_touch_event_id, CLIENT); |
// WARNING: |this| may be deleted at this point. |
consumed = true; |
break; |
@@ -427,8 +438,8 @@ void InputRouterImpl::OnInputEventAck( |
ack.type == WebInputEvent::GestureScrollUpdate); |
OnDidOverscroll(*ack.overscroll); |
} |
- |
- ProcessInputEventAck(ack.type, ack.state, ack.latency, RENDERER); |
+ ProcessInputEventAck(ack.type, ack.state, ack.latency, |
+ ack.unique_touch_event_id, RENDERER); |
// WARNING: |this| may be deleted at this point. |
// This is used only for testing, and the other end does not use the |
@@ -505,6 +516,7 @@ void InputRouterImpl::ProcessInputEventAck( |
WebInputEvent::Type event_type, |
InputEventAckState ack_result, |
const ui::LatencyInfo& latency_info, |
+ uint64 uniqueEventId, |
tdresser
2015/04/09 12:33:06
unique_touch_event_id
|
AckSource ack_source) { |
TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck", |
"type", WebInputEventTraits::GetName(event_type), |
@@ -527,7 +539,7 @@ void InputRouterImpl::ProcessInputEventAck( |
} else if (event_type == WebInputEvent::MouseWheel) { |
ProcessWheelAck(ack_result, latency_info); |
} else if (WebInputEvent::isTouchEventType(event_type)) { |
- ProcessTouchAck(ack_result, latency_info); |
+ ProcessTouchAck(ack_result, latency_info, uniqueEventId); |
} else if (WebInputEvent::isGestureEventType(event_type)) { |
ProcessGestureAck(event_type, ack_result, latency_info); |
} else if (event_type != WebInputEvent::Undefined) { |
@@ -608,9 +620,11 @@ void InputRouterImpl::ProcessGestureAck(WebInputEvent::Type type, |
void InputRouterImpl::ProcessTouchAck( |
InputEventAckState ack_result, |
- const ui::LatencyInfo& latency) { |
+ const ui::LatencyInfo& latency, |
+ uint64 unique_touch_event_id) { |
// |touch_event_queue_| will forward to OnTouchEventAck when appropriate. |
- touch_event_queue_.ProcessTouchAck(ack_result, latency); |
+ touch_event_queue_.ProcessTouchAck(ack_result, latency, |
+ unique_touch_event_id); |
} |
void InputRouterImpl::UpdateTouchAckTimeoutEnabled() { |