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

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

Issue 628763003: Support InputRouter recycling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 2 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.cc
diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc
index fa109dedddf9bd87868d6edbe6a7a7fc1cbe9351..2bc48a09b8e4bcc046d677117bcb6f19801fd927 100644
--- a/content/browser/renderer_host/input/touch_event_queue.cc
+++ b/content/browser/renderer_host/input/touch_event_queue.cc
@@ -157,7 +157,7 @@ class TouchEventQueue::TouchTimeoutHandler {
void OnTimeOut() {
SetPendingAckState(PENDING_ACK_ORIGINAL_EVENT);
- touch_queue_->FlushQueue();
+ touch_queue_->Flush(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
}
// Skip a cancel event if the timed-out event had no consumer and was the
@@ -629,6 +629,15 @@ void TouchEventQueue::OnHasTouchEventHandlers(bool has_handlers) {
has_handlers_ = has_handlers;
}
+void TouchEventQueue::Flush(InputEventAckState flush_ack) {
+ DCHECK(!dispatching_touch_ack_);
+ DCHECK(!dispatching_touch_);
+ pending_async_touchmove_.reset();
+ drop_remaining_touches_in_sequence_ = true;
+ while (!touch_queue_.empty())
+ PopTouchEventToClient(flush_ack);
+}
+
bool TouchEventQueue::IsPendingAckTouchStart() const {
DCHECK(!dispatching_touch_ack_);
if (touch_queue_.empty())
@@ -661,15 +670,6 @@ TouchEventQueue::GetLatestEventForTesting() const {
return touch_queue_.back()->coalesced_event();
}
-void TouchEventQueue::FlushQueue() {
- DCHECK(!dispatching_touch_ack_);
- DCHECK(!dispatching_touch_);
- pending_async_touchmove_.reset();
- drop_remaining_touches_in_sequence_ = true;
- while (!touch_queue_.empty())
- PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
-}
-
void TouchEventQueue::PopTouchEventToClient(InputEventAckState ack_result) {
AckTouchEventToClient(ack_result, PopTouchEvent(), NULL);
}

Powered by Google App Engine
This is Rietveld 408576698