| 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 54bf892014c80b6884e624cdcdaac312c0817e46..ebe00d2cb21dd361014a5bdf07203f234d5869a7 100644
|
| --- a/content/browser/renderer_host/input/input_router_impl.cc
|
| +++ b/content/browser/renderer_host/input/input_router_impl.cc
|
| @@ -248,6 +248,8 @@ bool InputRouterImpl::OnMessageReceived(const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(InputRouterImpl, message)
|
| IPC_MESSAGE_HANDLER(InputHostMsg_HandleInputEvent_ACK, OnInputEventAck)
|
| + IPC_MESSAGE_HANDLER(InputHostMsg_HandleAsyncTouchEvent_ACK,
|
| + OnAsyncTouchEventAck)
|
| IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll)
|
| IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck)
|
| IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck)
|
| @@ -347,13 +349,19 @@ 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);
|
| + bool is_async_touch_move = false;
|
| if (WebInputEvent::isTouchEventType(input_event.type)) {
|
| const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event);
|
| - DCHECK_NE(ignores_ack, !!touch.cancelable);
|
| + if (touch.type == WebInputEvent::TouchMove && !touch.cancelable)
|
| + is_async_touch_move = true;
|
| +
|
| + if (touch.type != WebInputEvent::TouchMove)
|
| + DCHECK_NE(ignores_ack, touch.cancelable);
|
| }
|
|
|
| - // If we don't care about the ack disposition, send the ack immediately.
|
| - if (ignores_ack) {
|
| + // If we don't care about the ack disposition, or it is an async touchmove
|
| + // event, send the ack immediately.
|
| + if (ignores_ack || is_async_touch_move) {
|
| ProcessInputEventAck(input_event.type,
|
| INPUT_EVENT_ACK_STATE_IGNORED,
|
| latency_info,
|
| @@ -435,6 +443,15 @@ void InputRouterImpl::OnInputEventAck(
|
| Details<int>(&type));
|
| }
|
|
|
| +void InputRouterImpl::OnAsyncTouchEventAck(
|
| + const InputHostMsg_HandleAsyncTouchEvent_ACK_Params& ack) {
|
| + ProcessAsyncTouchAck();
|
| + int type = static_cast<int>(ack.type);
|
| + NotificationService::current()->Notify(
|
| + NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK,
|
| + Source<void>(this), Details<int>(&type));
|
| +}
|
| +
|
| void InputRouterImpl::OnDidOverscroll(const DidOverscrollParams& params) {
|
| client_->DidOverscroll(params);
|
| }
|
| @@ -597,6 +614,10 @@ void InputRouterImpl::ProcessTouchAck(
|
| touch_event_queue_.ProcessTouchAck(ack_result, latency);
|
| }
|
|
|
| +void InputRouterImpl::ProcessAsyncTouchAck() {
|
| + touch_event_queue_.ProcessAsyncTouchAck();
|
| +}
|
| +
|
| void InputRouterImpl::UpdateTouchAckTimeoutEnabled() {
|
| // Mobile sites tend to be well-behaved with respect to touch handling, so
|
| // they have less need for the touch timeout fallback.
|
|
|