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

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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8b2456c4f8b532525d6cac4347c5ba2a786e356e 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -347,13 +347,17 @@ 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 touch_move_aysnc = false;
if (WebInputEvent::isTouchEventType(input_event.type)) {
const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event);
- DCHECK_NE(ignores_ack, !!touch.cancelable);
+ touch_move_aysnc = !touch.cancelable;
+ 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 || touch_move_aysnc) {
ProcessInputEventAck(input_event.type,
INPUT_EVENT_ACK_STATE_IGNORED,
latency_info,
@@ -418,6 +422,14 @@ void InputRouterImpl::OnInputEventAck(
OnDidOverscroll(*ack.overscroll);
}
+ // When we receive ACK from render for async touchmove events, we tell
+ // touch_event_queue right away so it will send out the next touch move in
+ // the queue.
+ if (ack.type == WebInputEvent::TouchMove &&
jdduke (slow) 2015/03/11 22:37:10 This seems like it could be racy. When a scroll se
+ touch_event_queue_.IsSendingTouchEventsAsync()) {
+ touch_event_queue_.ReceiveAsyncTouchMoveAck();
jdduke (slow) 2015/03/11 22:37:10 I'm a little concerned about the special interacti
+ }
+
ProcessInputEventAck(ack.type, ack.state, ack.latency, RENDERER);
// WARNING: |this| may be deleted at this point.
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698