| 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 "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 void PossiblyScheduleMainFrame(); | 142 void PossiblyScheduleMainFrame(); |
| 143 | 143 |
| 144 void SendEventToMainThread(const blink::WebInputEvent* event, | 144 void SendEventToMainThread(const blink::WebInputEvent* event, |
| 145 const ui::LatencyInfo& latency, | 145 const ui::LatencyInfo& latency, |
| 146 InputEventDispatchType original_dispatch_type); | 146 InputEventDispatchType original_dispatch_type); |
| 147 | 147 |
| 148 bool IsRafAlignedInputDisabled(); | 148 bool IsRafAlignedInputDisabled(); |
| 149 bool IsRafAlignedEvent(const blink::WebInputEvent& event); | 149 bool IsRafAlignedEvent(const blink::WebInputEvent& event); |
| 150 | 150 |
| 151 friend class MainThreadEventQueueTest; | 151 friend class MainThreadEventQueueTest; |
| 152 friend class MainThreadEventQueueInitializationTest; |
| 152 int routing_id_; | 153 int routing_id_; |
| 153 MainThreadEventQueueClient* client_; | 154 MainThreadEventQueueClient* client_; |
| 154 std::unique_ptr<EventWithDispatchType> in_flight_event_; | 155 std::unique_ptr<EventWithDispatchType> in_flight_event_; |
| 155 bool last_touch_start_forced_nonblocking_due_to_fling_; | 156 bool last_touch_start_forced_nonblocking_due_to_fling_; |
| 156 bool enable_fling_passive_listener_flag_; | 157 bool enable_fling_passive_listener_flag_; |
| 157 bool enable_non_blocking_due_to_main_thread_responsiveness_flag_; | 158 bool enable_non_blocking_due_to_main_thread_responsiveness_flag_; |
| 159 base::TimeDelta main_thread_responsiveness_threshold_; |
| 158 bool handle_raf_aligned_touch_input_; | 160 bool handle_raf_aligned_touch_input_; |
| 159 bool handle_raf_aligned_mouse_input_; | 161 bool handle_raf_aligned_mouse_input_; |
| 160 | 162 |
| 161 // Contains data to be shared between main thread and compositor thread. | 163 // Contains data to be shared between main thread and compositor thread. |
| 162 struct SharedState { | 164 struct SharedState { |
| 163 SharedState(); | 165 SharedState(); |
| 164 ~SharedState(); | 166 ~SharedState(); |
| 165 | 167 |
| 166 WebInputEventQueue<EventWithDispatchType> events_; | 168 WebInputEventQueue<EventWithDispatchType> events_; |
| 167 bool sent_main_frame_request_; | 169 bool sent_main_frame_request_; |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 // Lock used to serialize |shared_state_|. | 172 // Lock used to serialize |shared_state_|. |
| 171 base::Lock shared_state_lock_; | 173 base::Lock shared_state_lock_; |
| 172 SharedState shared_state_; | 174 SharedState shared_state_; |
| 173 | 175 |
| 174 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 176 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 175 blink::scheduler::RendererScheduler* renderer_scheduler_; | 177 blink::scheduler::RendererScheduler* renderer_scheduler_; |
| 176 | 178 |
| 177 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); | 179 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); |
| 178 }; | 180 }; |
| 179 | 181 |
| 180 } // namespace content | 182 } // namespace content |
| 181 | 183 |
| 182 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ | 184 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ |
| OLD | NEW |