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

Side by Side Diff: remoting/host/input_injector_win.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: include <utility> Created 5 years 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
« no previous file with comments | « remoting/host/input_injector_mac.cc ('k') | remoting/host/input_injector_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/input_injector.h" 5 #include "remoting/host/input_injector.h"
6 6
7 #include <stdint.h>
7 #include <windows.h> 8 #include <windows.h>
8 #include <stdint.h> 9
10 #include <utility>
9 11
10 #include "base/bind.h" 12 #include "base/bind.h"
11 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
12 #include "base/location.h" 14 #include "base/location.h"
13 #include "base/macros.h" 15 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
15 #include "base/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
16 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
17 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
18 #include "remoting/base/util.h" 20 #include "remoting/base/util.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void InputInjectorWin::InjectMouseEvent(const MouseEvent& event) { 146 void InputInjectorWin::InjectMouseEvent(const MouseEvent& event) {
145 core_->InjectMouseEvent(event); 147 core_->InjectMouseEvent(event);
146 } 148 }
147 149
148 void InputInjectorWin::InjectTouchEvent(const TouchEvent& event) { 150 void InputInjectorWin::InjectTouchEvent(const TouchEvent& event) {
149 core_->InjectTouchEvent(event); 151 core_->InjectTouchEvent(event);
150 } 152 }
151 153
152 void InputInjectorWin::Start( 154 void InputInjectorWin::Start(
153 scoped_ptr<protocol::ClipboardStub> client_clipboard) { 155 scoped_ptr<protocol::ClipboardStub> client_clipboard) {
154 core_->Start(client_clipboard.Pass()); 156 core_->Start(std::move(client_clipboard));
155 } 157 }
156 158
157 InputInjectorWin::Core::Core( 159 InputInjectorWin::Core::Core(
158 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 160 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
159 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 161 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
160 : main_task_runner_(main_task_runner), 162 : main_task_runner_(main_task_runner),
161 ui_task_runner_(ui_task_runner), 163 ui_task_runner_(ui_task_runner),
162 clipboard_(Clipboard::Create()) { 164 clipboard_(Clipboard::Create()) {
163 } 165 }
164 166
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 217
216 void InputInjectorWin::Core::Start( 218 void InputInjectorWin::Core::Start(
217 scoped_ptr<protocol::ClipboardStub> client_clipboard) { 219 scoped_ptr<protocol::ClipboardStub> client_clipboard) {
218 if (!ui_task_runner_->BelongsToCurrentThread()) { 220 if (!ui_task_runner_->BelongsToCurrentThread()) {
219 ui_task_runner_->PostTask( 221 ui_task_runner_->PostTask(
220 FROM_HERE, 222 FROM_HERE,
221 base::Bind(&Core::Start, this, base::Passed(&client_clipboard))); 223 base::Bind(&Core::Start, this, base::Passed(&client_clipboard)));
222 return; 224 return;
223 } 225 }
224 226
225 clipboard_->Start(client_clipboard.Pass()); 227 clipboard_->Start(std::move(client_clipboard));
226 touch_injector_.Init(); 228 touch_injector_.Init();
227 } 229 }
228 230
229 void InputInjectorWin::Core::Stop() { 231 void InputInjectorWin::Core::Stop() {
230 if (!ui_task_runner_->BelongsToCurrentThread()) { 232 if (!ui_task_runner_->BelongsToCurrentThread()) {
231 ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::Stop, this)); 233 ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::Stop, this));
232 return; 234 return;
233 } 235 }
234 236
235 clipboard_.reset(); 237 clipboard_.reset();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 return make_scoped_ptr( 359 return make_scoped_ptr(
358 new InputInjectorWin(main_task_runner, ui_task_runner)); 360 new InputInjectorWin(main_task_runner, ui_task_runner));
359 } 361 }
360 362
361 // static 363 // static
362 bool InputInjector::SupportsTouchEvents() { 364 bool InputInjector::SupportsTouchEvents() {
363 return TouchInjectorWinDelegate::Create(); 365 return TouchInjectorWinDelegate::Create();
364 } 366 }
365 367
366 } // namespace remoting 368 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/input_injector_mac.cc ('k') | remoting/host/input_injector_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698