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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 bool empty() const WARN_UNUSED_RESULT { 95 bool empty() const WARN_UNUSED_RESULT {
96 return touch_queue_.empty(); 96 return touch_queue_.empty();
97 } 97 }
98 98
99 size_t size() const { 99 size_t size() const {
100 return touch_queue_.size(); 100 return touch_queue_.size();
101 } 101 }
102 102
103 bool has_handlers() const { return has_handlers_; } 103 bool has_handlers() const { return has_handlers_; }
104 104
105 bool IsSendingTouchEventsAsync() const { return send_touch_events_async_; }
106
107 void ReceiveAsyncTouchMoveAck() { receiving_async_touch_move_ack_ = true; }
108
105 private: 109 private:
106 class TouchTimeoutHandler; 110 class TouchTimeoutHandler;
107 class TouchMoveSlopSuppressor; 111 class TouchMoveSlopSuppressor;
108 friend class TouchTimeoutHandler; 112 friend class TouchTimeoutHandler;
109 friend class TouchEventQueueTest; 113 friend class TouchEventQueueTest;
110 114
111 bool HasPendingAsyncTouchMoveForTesting() const; 115 bool HasPendingAsyncTouchMoveForTesting() const;
112 bool IsTimeoutRunningForTesting() const; 116 bool IsTimeoutRunningForTesting() const;
113 const TouchEventWithLatencyInfo& GetLatestEventForTesting() const; 117 const TouchEventWithLatencyInfo& GetLatestEventForTesting() const;
114 118
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // and ack'ed immediately, but remain buffered in |pending_async_touchmove_| 204 // and ack'ed immediately, but remain buffered in |pending_async_touchmove_|
201 // until a sufficient time period has elapsed since the last sent touch event. 205 // until a sufficient time period has elapsed since the last sent touch event.
202 // For details see the design doc at http://goo.gl/lVyJAa. 206 // For details see the design doc at http://goo.gl/lVyJAa.
203 bool send_touch_events_async_; 207 bool send_touch_events_async_;
204 scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_; 208 scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_;
205 double last_sent_touch_timestamp_sec_; 209 double last_sent_touch_timestamp_sec_;
206 210
207 // Event is saved to compare pointer positions for new touchmove events. 211 // Event is saved to compare pointer positions for new touchmove events.
208 scoped_ptr<blink::WebTouchEvent> last_sent_touchevent_; 212 scoped_ptr<blink::WebTouchEvent> last_sent_touchevent_;
209 213
214 // Whether received an ACK from render on async touchmove event.
215 bool receiving_async_touch_move_ack_;
216
210 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); 217 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue);
211 }; 218 };
212 219
213 } // namespace content 220 } // namespace content
214 221
215 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ 222 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698