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

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: Rebase 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 a13ccbf51dfc60c013d843d4c448ec8b0b734877..b9cc039df19a5282ef8f436436ea6276e7c92afd 100644
--- a/content/browser/renderer_host/input/passthrough_touch_event_queue.cc
+++ b/content/browser/renderer_host/input/passthrough_touch_event_queue.cc
@@ -117,7 +117,8 @@ PassthroughTouchEventQueue::PassthroughTouchEventQueue(
maybe_has_handler_for_current_sequence_(false),
drop_remaining_touches_in_sequence_(false),
touchmove_slop_suppressor_(new TouchMoveSlopSuppressor),
- 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,
@@ -265,6 +266,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