OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ |
6 #define CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ | 6 #define CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/common/input/event_with_latency_info.h" | 10 #include "content/common/input/event_with_latency_info.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 EventWithDispatchType(const blink::WebInputEvent& event, | 22 EventWithDispatchType(const blink::WebInputEvent& event, |
23 const ui::LatencyInfo& latency, | 23 const ui::LatencyInfo& latency, |
24 InputEventDispatchType dispatch_type); | 24 InputEventDispatchType dispatch_type); |
25 ~EventWithDispatchType(); | 25 ~EventWithDispatchType(); |
26 bool CanCoalesceWith(const EventWithDispatchType& other) const | 26 bool CanCoalesceWith(const EventWithDispatchType& other) const |
27 WARN_UNUSED_RESULT; | 27 WARN_UNUSED_RESULT; |
28 void CoalesceWith(const EventWithDispatchType& other); | 28 void CoalesceWith(const EventWithDispatchType& other); |
29 | 29 |
30 const std::deque<uint32_t>& eventsToAck() const { return eventsToAck_; } | 30 const std::deque<uint32_t>& eventsToAck() const { return eventsToAck_; } |
31 InputEventDispatchType dispatchType() const { return dispatch_type_; } | 31 InputEventDispatchType dispatchType() const { return dispatch_type_; } |
| 32 void setDispatchType(InputEventDispatchType dispatch_type) { |
| 33 dispatch_type_ = dispatch_type; |
| 34 } |
32 | 35 |
33 private: | 36 private: |
34 InputEventDispatchType dispatch_type_; | 37 InputEventDispatchType dispatch_type_; |
35 | 38 |
36 // |eventsToAck_| contains the unique touch event id to be acked. If | 39 // |eventsToAck_| contains the unique touch event id to be acked. If |
37 // the events are TouchEvents the value will be 0. More importantly for | 40 // the events are TouchEvents the value will be 0. More importantly for |
38 // those cases the deque ends up containing how many additional ACKs | 41 // those cases the deque ends up containing how many additional ACKs |
39 // need to be sent. | 42 // need to be sent. |
40 std::deque<uint32_t> eventsToAck_; | 43 std::deque<uint32_t> eventsToAck_; |
41 }; | 44 }; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 130 |
128 friend class MainThreadEventQueueTest; | 131 friend class MainThreadEventQueueTest; |
129 int routing_id_; | 132 int routing_id_; |
130 MainThreadEventQueueClient* client_; | 133 MainThreadEventQueueClient* client_; |
131 WebInputEventQueue<EventWithDispatchType> events_; | 134 WebInputEventQueue<EventWithDispatchType> events_; |
132 std::unique_ptr<EventWithDispatchType> in_flight_event_; | 135 std::unique_ptr<EventWithDispatchType> in_flight_event_; |
133 bool is_flinging_; | 136 bool is_flinging_; |
134 | 137 |
135 base::Lock event_queue_lock_; | 138 base::Lock event_queue_lock_; |
136 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 139 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 140 // True if waiting on first touch move after a touch start. |
| 141 bool waiting_for_first_touch_move_; |
137 | 142 |
138 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); | 143 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); |
139 }; | 144 }; |
140 | 145 |
141 } // namespace content | 146 } // namespace content |
142 | 147 |
143 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ | 148 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ |
OLD | NEW |