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

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: Address jdduke's comment. 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() &&
jdduke (slow) 2014/11/25 20:26:37 If we have a a whole gesture queued that was ack'e
tdresser 2014/11/26 15:17:18 Done.
+ sequence.front().ack_state() !=
+ GestureEventDataPacket::AckState::PENDING) {
+ OnTouchEventAckForQueueFront(sequence.front().ack_state() ==
+ GestureEventDataPacket::AckState::CONSUMED);
+ }
+}
+
+void TouchDispositionGestureFilter::OnTouchEventAckForQueueBack(
+ bool event_consumed) {
jdduke (slow) 2014/11/25 16:21:35 Hmm, but |event_consumed| should always be true, n
tdresser 2014/11/25 20:07:49 How could this result in out-of-order gestures? Th
jdduke (slow) 2014/11/25 20:11:30 Nevermind, you're right, the dispatch is deferred.
+ 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