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

Unified Diff: content/renderer/render_widget.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: Made changes based on comments 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/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index e3c2602b74c8bdd7d6976db1f6e2ee47f5720cf1..4310f13d11d633c1563908da6541ec966de68707 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1225,12 +1225,30 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
bool no_ack = ignore_ack_for_mouse_move_from_debugger_ &&
input_event->type == WebInputEvent::MouseMove;
if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) {
- InputHostMsg_HandleInputEvent_ACK_Params ack;
- ack.type = input_event->type;
- ack.state = ack_result;
- ack.latency = swap_latency_info;
- scoped_ptr<IPC::Message> response(
- new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack));
+ // Send AsyncTouchEvent_ACK for async touch moves, and InputEvent_ACK for
+ // all other types of events.
+ scoped_ptr<IPC::Message> response;
+ bool is_async_touch_move = false;
+ if (input_event->type == WebInputEvent::TouchMove) {
+ const WebTouchEvent& touch =
+ static_cast<const WebTouchEvent&>(*input_event);
+ if (!touch.cancelable)
+ is_async_touch_move = true;
+ }
+ if (is_async_touch_move) {
+ InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params ack;
+ response = scoped_ptr<IPC::Message>(
+ new InputHostMsg_HandleUncancelableTouchMoveEvent_ACK(routing_id_,
+ ack));
+ } else {
+ InputHostMsg_HandleInputEvent_ACK_Params ack;
+ ack.type = input_event->type;
+ ack.state = ack_result;
+ ack.latency = swap_latency_info;
+ response = scoped_ptr<IPC::Message>(
+ new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack));
+ }
+
if (rate_limiting_wanted && frame_pending && !is_hidden_) {
// We want to rate limit the input events in this case, so we'll wait for
// painting to finish before ACKing this message.

Powered by Google App Engine
This is Rietveld 408576698