Chromium Code Reviews| Index: content/renderer/input/main_thread_event_queue.h |
| diff --git a/content/renderer/input/main_thread_event_queue.h b/content/renderer/input/main_thread_event_queue.h |
| index 6a99636a9a0d2f0851d7404b89778eb676a733a8..cc0c1136ae8dc91594cddedc1ffbed75db6d0fde 100644 |
| --- a/content/renderer/input/main_thread_event_queue.h |
| +++ b/content/renderer/input/main_thread_event_queue.h |
| @@ -25,6 +25,7 @@ class EventWithDispatchType : public BaseClass { |
| : BaseClass(e, l), type(t) {} |
| InputEventDispatchType type; |
| + std::deque<uint32_t> eventsToAck; |
| bool CanCoalesceWith(const EventWithDispatchType& other) const |
| WARN_UNUSED_RESULT { |
| @@ -32,6 +33,12 @@ class EventWithDispatchType : public BaseClass { |
| } |
| void CoalesceWith(const EventWithDispatchType& other) { |
| + // If we are blocking and are coalescing touch, make sure to keep |
| + // the touch ids that need to be acked. |
|
tdresser
2016/06/28 17:59:24
This comment is a bit confusing, because we'll cal
dtapuska
2016/06/28 19:51:08
Done.
|
| + if (type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) { |
| + eventsToAck.push_back( |
| + WebInputEventTraits::GetUniqueTouchEventId(other.event)); |
| + } |
| BaseClass::CoalesceWith(other); |
| } |
| }; |
| @@ -52,6 +59,11 @@ class CONTENT_EXPORT MainThreadEventQueueClient { |
| const blink::WebInputEvent* event, |
| const ui::LatencyInfo& latency, |
| InputEventDispatchType dispatch_type) = 0; |
| + |
| + virtual void SendInputEventAck(int routing_id, |
| + blink::WebInputEvent::Type type, |
| + InputEventAckState ack_result, |
| + uint32_t touch_event_id) = 0; |
| }; |
| // MainThreadEventQueue implements a series of queues (one touch |
| @@ -104,7 +116,8 @@ class CONTENT_EXPORT MainThreadEventQueue { |
| // Call once the main thread has handled an outstanding |type| event |
| // in flight. |
| - void EventHandled(blink::WebInputEvent::Type type); |
| + void EventHandled(blink::WebInputEvent::Type type, |
| + InputEventAckState ack_result); |
| void set_is_flinging(bool is_flinging) { is_flinging_ = is_flinging; } |
| @@ -116,6 +129,11 @@ class CONTENT_EXPORT MainThreadEventQueue { |
| WebInputEventQueue<PendingTouchEvent> touch_events_; |
| bool is_flinging_; |
| + // TODO(dtapuska): These can be removed when the queues are dequeued |
| + // on the main thread. See crbug.com/624021 |
| + std::unique_ptr<PendingMouseWheelEvent> in_flight_wheel_event_; |
| + std::unique_ptr<PendingTouchEvent> in_flight_touch_event_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); |
| }; |