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

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: Created 5 years, 8 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 180be389354052d41f59adf08e1000f71da72ef9..22d0fc01b7d337b1cf85c6a6c274b6ee241dc354 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
@@ -150,7 +151,7 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
bool is_keyboard_shortcut = get<2>(params);
DCHECK(event);
- const bool send_ack = !WebInputEventTraits::IgnoresAckDisposition(*event);
+ const bool send_ack = WebInputEventTraits::WillReceiveAckFromRenderer(*event);
// Intercept |DidOverscroll| notifications, bundling any triggered overscroll
// response with the input event ack.
@@ -173,16 +174,10 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
return;
}
- if (!send_ack)
- return;
-
- InputHostMsg_HandleInputEvent_ACK_Params ack;
- ack.type = event->type;
- ack.state = ack_state;
- ack.latency = latency_info;
- ack.overscroll = overscroll_params.Pass();
- SendMessage(scoped_ptr<IPC::Message>(
- new InputHostMsg_HandleInputEvent_ACK(routing_id, ack)));
+ scoped_ptr<IPC::Message> response = WebInputEventTraits::CreateAckIfNecessary(
+ *event, ack_state, latency_info, overscroll_params.Pass(), routing_id);
+ if (response)
+ SendMessage(response.Pass());
}
void InputEventFilter::SendMessage(scoped_ptr<IPC::Message> message) {

Powered by Google App Engine
This is Rietveld 408576698