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 69b5afab025393d06b2082b8006430a89051e0a5..6668f0d753bc3f59aa1ea4c0207fd57730e9e680 100644 |
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc |
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc |
@@ -25,11 +25,18 @@ GestureEventData CreateGesture(EventType type, |
int flags = EF_NONE; |
GestureEventDetails details(type); |
details.set_device_type(GestureDeviceType::DEVICE_TOUCHSCREEN); |
- return GestureEventData( |
- details, motion_event_id, primary_tool_type, packet.timestamp(), |
- packet.touch_location().x(), packet.touch_location().y(), |
- packet.raw_touch_location().x(), packet.raw_touch_location().y(), 1, |
- gfx::RectF(packet.touch_location(), gfx::SizeF()), flags); |
+ return GestureEventData(details, |
+ motion_event_id, |
+ primary_tool_type, |
+ packet.timestamp(), |
+ packet.touch_location().x(), |
+ packet.touch_location().y(), |
+ packet.raw_touch_location().x(), |
+ packet.raw_touch_location().y(), |
+ 1, |
+ gfx::RectF(packet.touch_location(), gfx::SizeF()), |
+ flags, |
+ packet.unique_touch_event_id()); |
} |
enum RequiredTouches { |
@@ -183,8 +190,8 @@ TouchDispositionGestureFilter::OnGesturePacket( |
return SUCCESS; |
} |
-void TouchDispositionGestureFilter::OnTouchEventAck(uint32_t unique_event_id, |
- bool event_consumed) { |
+void TouchDispositionGestureFilter::OnTouchEventAck( |
+ uint32_t unique_touch_event_id, bool event_consumed) { |
// Spurious asynchronous acks should not trigger a crash. |
if (IsEmpty() || (Head().empty() && sequences_.size() == 1)) |
return; |
@@ -193,13 +200,13 @@ void TouchDispositionGestureFilter::OnTouchEventAck(uint32_t unique_event_id, |
PopGestureSequence(); |
if (!Tail().empty() && |
- Tail().back().unique_touch_event_id() == unique_event_id) { |
+ Tail().back().unique_touch_event_id() == unique_touch_event_id) { |
Tail().back().Ack(event_consumed); |
if (sequences_.size() == 1 && Tail().size() == 1) |
SendAckedEvents(); |
} else { |
DCHECK(!Head().empty()); |
- DCHECK_EQ(Head().front().unique_touch_event_id(), unique_event_id); |
+ DCHECK_EQ(Head().front().unique_touch_event_id(), unique_touch_event_id); |
Head().front().Ack(event_consumed); |
SendAckedEvents(); |
} |
@@ -302,6 +309,9 @@ void TouchDispositionGestureFilter::FilterAndSendPacket( |
void TouchDispositionGestureFilter::SendGesture( |
const GestureEventData& event, |
const GestureEventDataPacket& packet_being_sent) { |
+ DCHECK(event.unique_touch_event_id == |
+ packet_being_sent.unique_touch_event_id()); |
+ |
// TODO(jdduke): Factor out gesture stream reparation code into a standalone |
// utility class. |
switch (event.type()) { |