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

Unified Diff: ui/events/gesture_detection/touch_disposition_gesture_filter.cc

Issue 680413006: Re-enable Eager Gesture Recognition on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support interleaved sync and async acks. Created 6 years, 1 month 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: ui/events/gesture_detection/touch_disposition_gesture_filter.cc
diff --git a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
index 564d014a4c5f94c28a7bd9a72be4ec1c8c84d594..2c7f6ae24394f196997958bf06ac79f450ff559f 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
@@ -170,7 +170,8 @@ TouchDispositionGestureFilter::OnGesturePacket(
return SUCCESS;
}
-void TouchDispositionGestureFilter::OnTouchEventAck(bool event_consumed) {
+void TouchDispositionGestureFilter::OnTouchEventAckForQueueFront(
+ bool event_consumed) {
// Spurious touch acks from the renderer should not trigger a crash.
if (IsEmpty() || (Head().empty() && sequences_.size() == 1))
return;
@@ -207,6 +208,23 @@ void TouchDispositionGestureFilter::OnTouchEventAck(bool event_consumed) {
FilterAndSendPacket(packet);
}
DCHECK(touch_packet_for_current_ack_handled);
+
+ // If the next event has already been acked, process it.
+ if (!sequence.empty() &&
+ sequence.front().ack_state() !=
+ GestureEventDataPacket::AckState::PENDING) {
+ OnTouchEventAckForQueueFront(sequence.front().ack_state() ==
+ GestureEventDataPacket::AckState::CONSUMED);
+ }
+}
+
+void TouchDispositionGestureFilter::OnTouchEventAckForQueueBack(
+ bool event_consumed) {
+ DCHECK(!Tail().empty());
+ if (Tail().size() == 1)
+ OnTouchEventAckForQueueFront(event_consumed);
+ else
+ Tail().back().ack(event_consumed);
}
bool TouchDispositionGestureFilter::IsEmpty() const {

Powered by Google App Engine
This is Rietveld 408576698