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

Unified Diff: tools/android/forwarder2/device_controller.cc

Issue 1555613002: Convert Pass()→std::move() in //tools/android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/forwarder2/daemon.cc ('k') | tools/android/forwarder2/device_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/forwarder2/device_controller.cc
diff --git a/tools/android/forwarder2/device_controller.cc b/tools/android/forwarder2/device_controller.cc
index 28a3527525e6e6e769e695c5af2870e55a7d19b7..7ad38d9bf2c300b3fd4f3e4f8c339a569d0fa636 100644
--- a/tools/android/forwarder2/device_controller.cc
+++ b/tools/android/forwarder2/device_controller.cc
@@ -28,12 +28,12 @@ scoped_ptr<DeviceController> DeviceController::Create(
if (!host_socket->BindUnix(adb_unix_socket)) {
PLOG(ERROR) << "Could not BindAndListen DeviceController socket on port "
<< adb_unix_socket << ": ";
- return device_controller.Pass();
+ return device_controller;
}
LOG(INFO) << "Listening on Unix Domain Socket " << adb_unix_socket;
device_controller.reset(
- new DeviceController(host_socket.Pass(), exit_notifier_fd));
- return device_controller.Pass();
+ new DeviceController(std::move(host_socket), exit_notifier_fd));
+ return device_controller;
}
DeviceController::~DeviceController() {
@@ -46,7 +46,7 @@ void DeviceController::Start() {
DeviceController::DeviceController(scoped_ptr<Socket> host_socket,
int exit_notifier_fd)
- : host_socket_(host_socket.Pass()),
+ : host_socket_(std::move(host_socket)),
exit_notifier_fd_(exit_notifier_fd),
construction_task_runner_(base::ThreadTaskRunnerHandle::Get()),
weak_ptr_factory_(this) {
@@ -89,11 +89,10 @@ void DeviceController::AcceptHostCommandInternal() {
<< ". Attempting to restart the listener.\n";
DeleteRefCountedValueInMapFromIterator(listener_it, &listeners_);
}
- scoped_ptr<DeviceListener> new_listener(
- DeviceListener::Create(
- socket.Pass(), port,
- base::Bind(&DeviceController::DeleteListenerOnError,
- weak_ptr_factory_.GetWeakPtr())));
+ scoped_ptr<DeviceListener> new_listener(DeviceListener::Create(
+ std::move(socket), port,
+ base::Bind(&DeviceController::DeleteListenerOnError,
+ weak_ptr_factory_.GetWeakPtr())));
if (!new_listener)
return;
new_listener->Start();
@@ -116,7 +115,7 @@ void DeviceController::AcceptHostCommandInternal() {
// sockets all the way to the host side.
break;
}
- listener->SetAdbDataSocket(socket.Pass());
+ listener->SetAdbDataSocket(std::move(socket));
break;
case command::UNLISTEN:
LOG(INFO) << "Unmapping port " << port;
« no previous file with comments | « tools/android/forwarder2/daemon.cc ('k') | tools/android/forwarder2/device_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698