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

Unified Diff: content/renderer/input/input_event_filter.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: Unit tests 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/renderer/input/input_event_filter.cc
diff --git a/content/renderer/input/input_event_filter.cc b/content/renderer/input/input_event_filter.cc
index 6c78d57b0213ecbfbc1ce152e3052783e466807c..53066160308e6c5a2d383cd2b4ed70b76b828458 100644
--- a/content/renderer/input/input_event_filter.cc
+++ b/content/renderer/input/input_event_filter.cc
@@ -21,6 +21,7 @@
#include "ui/gfx/geometry/vector2d_f.h"
using blink::WebInputEvent;
+using blink::WebTouchEvent;
#include "ipc/ipc_message_null_macros.h"
#undef IPC_MESSAGE_DECL
@@ -177,6 +178,20 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
if (!send_ack)
return;
+ // Send AsyncTouchEvent_ACK for async touch moves, and InputEvent_ACK for
+ // all other types of events.
+ if (WebInputEvent::isTouchEventType(event->type)) {
+ const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(*event);
+ if (touch.type == WebInputEvent::TouchMove && !touch.cancelable) {
tdresser 2015/03/25 14:16:18 We don't need the outer "if", do we?
lanwei 2015/03/26 11:54:38 Done.
+ InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params ack;
+ ack.type = event->type;
+ SendMessage(scoped_ptr<IPC::Message>(
+ new InputHostMsg_HandleUncancelableTouchMoveEvent_ACK(routing_id,
+ ack)));
+ return;
+ }
+ }
+
InputHostMsg_HandleInputEvent_ACK_Params ack;
ack.type = event->type;
ack.state = ack_state;

Powered by Google App Engine
This is Rietveld 408576698