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

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

Issue 2826673005: Fix recursion in handling touch input events acks. (Closed)
Patch Set: Fix nits Created 3 years, 8 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/passthrough_touch_event_queue.cc
diff --git a/content/browser/renderer_host/input/passthrough_touch_event_queue.cc b/content/browser/renderer_host/input/passthrough_touch_event_queue.cc
index f7883a3015a7ebb5f940b98915b8fff241c54d4d..ae2131f38b84cd2b8d4aa9db36a4c9421ef34178 100644
--- a/content/browser/renderer_host/input/passthrough_touch_event_queue.cc
+++ b/content/browser/renderer_host/input/passthrough_touch_event_queue.cc
@@ -59,7 +59,8 @@ PassthroughTouchEventQueue::PassthroughTouchEventQueue(
has_handlers_(true),
maybe_has_handler_for_current_sequence_(false),
drop_remaining_touches_in_sequence_(false),
- send_touch_events_async_(false) {
+ send_touch_events_async_(false),
+ processing_acks_(false) {
if (config.touch_ack_timeout_supported) {
timeout_handler_.reset(
new TouchTimeoutHandler(this, config.desktop_touch_ack_timeout_delay,
@@ -205,6 +206,11 @@ void PassthroughTouchEventQueue::FlushQueue() {
}
void PassthroughTouchEventQueue::AckCompletedEvents() {
+ // Don't allow re-entrancy into this method otherwise
+ // the ordering of acks won't be preserved.
+ if (processing_acks_)
+ return;
+ base::AutoReset<bool> process_acks(&processing_acks_, true);
while (!outstanding_touches_.empty()) {
auto iter = outstanding_touches_.begin();
if (iter->ack_state() == INPUT_EVENT_ACK_STATE_UNKNOWN)

Powered by Google App Engine
This is Rietveld 408576698