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 namespace content { | 7 namespace content { |
8 | 8 |
9 MainThreadEventQueue::MainThreadEventQueue(int routing_id, | 9 MainThreadEventQueue::MainThreadEventQueue(int routing_id, |
10 MainThreadEventQueueClient* client) | 10 MainThreadEventQueueClient* client) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 original_dispatch_type); | 70 original_dispatch_type); |
71 } | 71 } |
72 | 72 |
73 // send an ack when we are non-blocking. | 73 // send an ack when we are non-blocking. |
74 return non_blocking; | 74 return non_blocking; |
75 } | 75 } |
76 | 76 |
77 void MainThreadEventQueue::EventHandled(blink::WebInputEvent::Type type) { | 77 void MainThreadEventQueue::EventHandled(blink::WebInputEvent::Type type) { |
78 if (type == blink::WebInputEvent::MouseWheel) { | 78 if (type == blink::WebInputEvent::MouseWheel) { |
79 if (!wheel_events_.empty()) { | 79 if (!wheel_events_.empty()) { |
80 scoped_ptr<PendingMouseWheelEvent> event = wheel_events_.Pop(); | 80 std::unique_ptr<PendingMouseWheelEvent> event = wheel_events_.Pop(); |
81 client_->SendEventToMainThread(routing_id_, &event->event, event->latency, | 81 client_->SendEventToMainThread(routing_id_, &event->event, event->latency, |
82 event->type); | 82 event->type); |
83 } else { | 83 } else { |
84 wheel_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING); | 84 wheel_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING); |
85 } | 85 } |
86 } else if (blink::WebInputEvent::isTouchEventType(type)) { | 86 } else if (blink::WebInputEvent::isTouchEventType(type)) { |
87 if (!touch_events_.empty()) { | 87 if (!touch_events_.empty()) { |
88 scoped_ptr<PendingTouchEvent> event = touch_events_.Pop(); | 88 std::unique_ptr<PendingTouchEvent> event = touch_events_.Pop(); |
89 client_->SendEventToMainThread(routing_id_, &event->event, event->latency, | 89 client_->SendEventToMainThread(routing_id_, &event->event, event->latency, |
90 event->type); | 90 event->type); |
91 } else { | 91 } else { |
92 touch_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING); | 92 touch_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING); |
93 } | 93 } |
94 } else { | 94 } else { |
95 NOTREACHED() << "Invalid passive event type"; | 95 NOTREACHED() << "Invalid passive event type"; |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |