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

Unified Diff: content/browser/renderer_host/input/touch_event_queue.h

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/browser/renderer_host/input/touch_event_queue.h
diff --git a/content/browser/renderer_host/input/touch_event_queue.h b/content/browser/renderer_host/input/touch_event_queue.h
index a61b90d8eca8c1707d31b3e9bfbadabb175047a0..2ba788bffd355e23caa77aea2190e9bfbbd61e9b 100644
--- a/content/browser/renderer_host/input/touch_event_queue.h
+++ b/content/browser/renderer_host/input/touch_event_queue.h
@@ -66,6 +66,8 @@ class CONTENT_EXPORT TouchEventQueue {
void ProcessTouchAck(InputEventAckState ack_result,
const ui::LatencyInfo& latency_info);
+ void ProcessUncancelableTouchMoveAck();
+
// When GestureScrollBegin is received, we send a touch cancel to renderer,
// route all the following touch events directly to client, and ignore the
// ack for the touch cancel. When Gesture{ScrollEnd,FlingStart} is received,
@@ -102,6 +104,10 @@ class CONTENT_EXPORT TouchEventQueue {
bool has_handlers() const { return has_handlers_; }
+ int SentUncancelableTouchMoveCount() const {
+ return sent_uncancelable_touch_move_count_;
+ }
+
private:
class TouchTimeoutHandler;
class TouchMoveSlopSuppressor;
@@ -202,6 +208,14 @@ class CONTENT_EXPORT TouchEventQueue {
// For details see the design doc at http://goo.gl/lVyJAa.
bool send_touch_events_async_;
scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_;
+
+ // For uncancelable touch moves, not only we send a fake ack, but also a real
+ // ack from render, which we use to decide when to send the next touch move.
tdresser 2015/03/26 15:25:29 when to send the next async touch move move.
lanwei 2015/03/27 04:39:41 Done.
+ // This can help avoid the touch event queue keep growing when render handles
+ // touchmove slow. We use sent_uncancelable_touch_move_count_ to count the
+ // number of uncancelable touch moves sent out are waiting for
+ // their acks back from render.
+ int sent_uncancelable_touch_move_count_;
tdresser 2015/03/26 15:25:29 How about uncancelable_touch_moves_pending_ack_cou
lanwei 2015/03/27 04:39:41 Done.
double last_sent_touch_timestamp_sec_;
// Event is saved to compare pointer positions for new touchmove events.

Powered by Google App Engine
This is Rietveld 408576698