Chromium Code Reviews| Index: ui/events/gesture_detection/gesture_event_data_packet.cc |
| diff --git a/ui/events/gesture_detection/gesture_event_data_packet.cc b/ui/events/gesture_detection/gesture_event_data_packet.cc |
| index 265300cc1fcdfb7bf0c137ce0e2d09b7790b464c..375225f42c1dd097715f2b624897eb2eaa1983c2 100644 |
| --- a/ui/events/gesture_detection/gesture_event_data_packet.cc |
| +++ b/ui/events/gesture_detection/gesture_event_data_packet.cc |
| @@ -33,7 +33,7 @@ GestureEventDataPacket::GestureSource ToGestureSource( |
| } // namespace |
| GestureEventDataPacket::GestureEventDataPacket() |
| - : gesture_source_(UNDEFINED) { |
| + : gesture_source_(UNDEFINED), ack_state_(AckState::PENDING) { |
| } |
| GestureEventDataPacket::GestureEventDataPacket( |
| @@ -44,7 +44,8 @@ GestureEventDataPacket::GestureEventDataPacket( |
| : timestamp_(timestamp), |
| touch_location_(touch_location), |
| raw_touch_location_(raw_touch_location), |
| - gesture_source_(source) { |
| + gesture_source_(source), |
| + ack_state_(AckState::PENDING) { |
| DCHECK_NE(gesture_source_, UNDEFINED); |
| } |
| @@ -54,7 +55,8 @@ GestureEventDataPacket::GestureEventDataPacket( |
| gestures_(other.gestures_), |
| touch_location_(other.touch_location_), |
| raw_touch_location_(other.raw_touch_location_), |
| - gesture_source_(other.gesture_source_) { |
| + gesture_source_(other.gesture_source_), |
| + ack_state_(AckState::PENDING) { |
| } |
| GestureEventDataPacket::~GestureEventDataPacket() { |
| @@ -67,6 +69,7 @@ GestureEventDataPacket& GestureEventDataPacket::operator=( |
| touch_location_ = other.touch_location_; |
| raw_touch_location_ = other.raw_touch_location_; |
| gestures_ = other.gestures_; |
| + ack_state_ = other.ack_state_; |
| return *this; |
| } |
| @@ -93,4 +96,8 @@ GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout( |
| return packet; |
| } |
| +void GestureEventDataPacket::ack(bool event_consumed) { |
| + ack_state_ = event_consumed ? AckState::CONSUMED : AckState::UNCONSUMED; |
|
jdduke (slow)
2014/11/26 16:07:09
maybe |DCHECK_EQ(ack_state_, AckState::PENDING)|.
tdresser
2014/11/27 18:26:24
We explicitly allow spurious acks, so to add that
jdduke (slow)
2014/12/02 16:21:59
Some kind of check would be nice, e.g., can we at
tdresser
2014/12/02 21:29:27
The renderer could send us spurious event consumed
jdduke (slow)
2014/12/02 21:34:03
Hmm, but the spurious ack from the renderer should
tdresser
2014/12/02 22:00:22
Good point.
Done.
|
| +} |
| + |
| } // namespace ui |