Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 997283002: Coalesce async touch move events until the ack back from render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..624110cda0fec11b242fb9ba098c551eaed5a663 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_HandleUncancelableTouchMoveEvent_ACK,
+ OnUncancelableTouchMoveAck)
IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll)
IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck)
IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck)
@@ -349,7 +351,7 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event,
bool ignores_ack = WebInputEventTraits::IgnoresAckDisposition(input_event);
if (WebInputEvent::isTouchEventType(input_event.type)) {
const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event);
- DCHECK_NE(ignores_ack, !!touch.cancelable);
+ DCHECK_NE(ignores_ack, touch.cancelable);
}
// If we don't care about the ack disposition, send the ack immediately.
@@ -435,6 +437,15 @@ void InputRouterImpl::OnInputEventAck(
Details<int>(&type));
}
+void InputRouterImpl::OnUncancelableTouchMoveAck(
+ const InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params& ack) {
+ touch_event_queue_.ProcessUncancelableTouchMoveAck();
+ int type = static_cast<int>(WebInputEvent::TouchMove);
+ NotificationService::current()->Notify(
+ NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK,
+ Source<void>(this), Details<int>(&type));
tdresser 2015/03/27 13:34:44 As far as I can tell, this notification is never u
jdduke (slow) 2015/03/30 18:04:15 Yup, agreed.
lanwei 2015/03/31 13:07:49 Done.
+}
+
void InputRouterImpl::OnDidOverscroll(const DidOverscrollParams& params) {
client_->DidOverscroll(params);
}

Powered by Google App Engine
This is Rietveld 408576698