Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/renderer/input/main_thread_event_queue.cc

Issue 1873783003: Convert //content/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/renderer/input/input_handler_manager.cc ('k') | content/renderer/input/render_widget_input_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698