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) |