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..7410d304caeb33eedb8e2a7c16f7cf7d30a2236c 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 UncancelableTouchMovesPendingAckCount() const { |
+ return uncancelable_touch_moves_pending_ack_count_; |
+ } |
+ |
private: |
class TouchTimeoutHandler; |
class TouchMoveSlopSuppressor; |
@@ -202,6 +208,15 @@ 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 async |
+ // touchmove. This can help avoid the touch event queue keep growing when |
+ // render handles touchmove slow. We use |
+ // uncancelable_touch_moves_pending_ack_count_ to count the number of |
+ // dispatched uncancelable touchmoves which are still waiting for their acks |
+ // back from render. |
+ int uncancelable_touch_moves_pending_ack_count_; |
double last_sent_touch_timestamp_sec_; |
// Event is saved to compare pointer positions for new touchmove events. |