| 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 #include "content/renderer/input/main_thread_event_queue.h" | 5 #include "content/renderer/input/main_thread_event_queue.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "content/common/input/event_with_latency_info.h" | 8 #include "content/common/input/event_with_latency_info.h" |
| 9 #include "content/common/input_messages.h" | 9 #include "content/common/input_messages.h" |
| 10 | 10 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 if (shared_state_.events_.empty()) | 224 if (shared_state_.events_.empty()) |
| 225 return; | 225 return; |
| 226 | 226 |
| 227 in_flight_event_ = shared_state_.events_.Pop(); | 227 in_flight_event_ = shared_state_.events_.Pop(); |
| 228 } | 228 } |
| 229 DispatchInFlightEvent(); | 229 DispatchInFlightEvent(); |
| 230 PossiblyScheduleMainFrame(); | 230 PossiblyScheduleMainFrame(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void MainThreadEventQueue::EventHandled(blink::WebInputEvent::Type type, | 233 void MainThreadEventQueue::EventHandled(blink::WebInputEvent::Type type, |
| 234 blink::WebInputEventResult result, |
| 234 InputEventAckState ack_result) { | 235 InputEventAckState ack_result) { |
| 235 if (in_flight_event_) { | 236 if (in_flight_event_) { |
| 236 for (const auto id : in_flight_event_->blockingCoalescedEventIds()) { | 237 for (const auto id : in_flight_event_->blockingCoalescedEventIds()) { |
| 237 client_->SendInputEventAck(routing_id_, type, ack_result, id); | 238 client_->SendInputEventAck(routing_id_, type, ack_result, id); |
| 238 if (renderer_scheduler_) { | 239 if (renderer_scheduler_) { |
| 239 renderer_scheduler_->DidHandleInputEventOnMainThread( | 240 renderer_scheduler_->DidHandleInputEventOnMainThread( |
| 240 in_flight_event_->event()); | 241 in_flight_event_->event(), result); |
| 241 } | 242 } |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 } | 245 } |
| 245 | 246 |
| 246 void MainThreadEventQueue::DispatchRafAlignedInput() { | 247 void MainThreadEventQueue::DispatchRafAlignedInput() { |
| 247 if (IsRafAlignedInputDisabled()) | 248 if (IsRafAlignedInputDisabled()) |
| 248 return; | 249 return; |
| 249 | 250 |
| 250 std::deque<std::unique_ptr<EventWithDispatchType>> events_to_process; | 251 std::deque<std::unique_ptr<EventWithDispatchType>> events_to_process; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 case blink::WebInputEvent::MouseWheel: | 336 case blink::WebInputEvent::MouseWheel: |
| 336 return handle_raf_aligned_mouse_input_; | 337 return handle_raf_aligned_mouse_input_; |
| 337 case blink::WebInputEvent::TouchMove: | 338 case blink::WebInputEvent::TouchMove: |
| 338 return handle_raf_aligned_touch_input_; | 339 return handle_raf_aligned_touch_input_; |
| 339 default: | 340 default: |
| 340 return false; | 341 return false; |
| 341 } | 342 } |
| 342 } | 343 } |
| 343 | 344 |
| 344 } // namespace content | 345 } // namespace content |
| OLD | NEW |