OLD | NEW |
---|---|
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 #include "content/browser/renderer_host/input/touch_event_queue.h" | 5 #include "content/browser/renderer_host/input/touch_event_queue.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 void TouchEventQueue::FlushQueue() { | 197 void TouchEventQueue::FlushQueue() { |
198 DCHECK(!dispatching_touch_ack_); | 198 DCHECK(!dispatching_touch_ack_); |
199 while (!touch_queue_.empty()) | 199 while (!touch_queue_.empty()) |
200 PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, | 200 PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, |
201 ui::LatencyInfo()); | 201 ui::LatencyInfo()); |
202 } | 202 } |
203 | 203 |
204 bool TouchEventQueue::IsPendingAckTouchStart() const { | |
205 if (touch_queue_.empty()) | |
jdduke (slow)
2013/11/20 23:03:02
Nit: Could you also DCHECK(!dispatching_touch_ack)
Rick Byers
2013/11/21 02:37:36
Done.
| |
206 return false; | |
207 | |
208 const blink::WebTouchEvent& event = | |
209 touch_queue_.front()->coalesced_event().event; | |
210 return (event.type == blink::WebInputEvent::TouchStart); | |
211 } | |
212 | |
204 size_t TouchEventQueue::GetQueueSize() const { | 213 size_t TouchEventQueue::GetQueueSize() const { |
205 return touch_queue_.size(); | 214 return touch_queue_.size(); |
206 } | 215 } |
207 | 216 |
208 const TouchEventWithLatencyInfo& TouchEventQueue::GetLatestEvent() const { | 217 const TouchEventWithLatencyInfo& TouchEventQueue::GetLatestEvent() const { |
209 return touch_queue_.back()->coalesced_event(); | 218 return touch_queue_.back()->coalesced_event(); |
210 } | 219 } |
211 | 220 |
212 void TouchEventQueue::PopTouchEventToClient( | 221 void TouchEventQueue::PopTouchEventToClient( |
213 InputEventAckState ack_result, | 222 InputEventAckState ack_result, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 // If the ACK status of a point is unknown, then the event should be | 266 // If the ACK status of a point is unknown, then the event should be |
258 // forwarded to the renderer. | 267 // forwarded to the renderer. |
259 return true; | 268 return true; |
260 } | 269 } |
261 } | 270 } |
262 | 271 |
263 return false; | 272 return false; |
264 } | 273 } |
265 | 274 |
266 } // namespace content | 275 } // namespace content |
OLD | NEW |