Index: tools/android/forwarder2/host_controller.cc |
diff --git a/tools/android/forwarder2/host_controller.cc b/tools/android/forwarder2/host_controller.cc |
index 68394df519cfa525450f3be98dc408b298fc34fa..051089031bf51d7aad9714508ac3b0fa826c4de5 100644 |
--- a/tools/android/forwarder2/host_controller.cc |
+++ b/tools/android/forwarder2/host_controller.cc |
@@ -4,13 +4,13 @@ |
#include "tools/android/forwarder2/host_controller.h" |
+#include <memory> |
#include <string> |
#include <utility> |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
#include "base/logging.h" |
-#include "base/memory/scoped_ptr.h" |
#include "base/thread_task_runner_handle.h" |
#include "tools/android/forwarder2/command.h" |
#include "tools/android/forwarder2/forwarder.h" |
@@ -19,15 +19,15 @@ |
namespace forwarder2 { |
// static |
-scoped_ptr<HostController> HostController::Create( |
+std::unique_ptr<HostController> HostController::Create( |
int device_port, |
int host_port, |
int adb_port, |
int exit_notifier_fd, |
const ErrorCallback& error_callback) { |
- scoped_ptr<HostController> host_controller; |
- scoped_ptr<PipeNotifier> delete_controller_notifier(new PipeNotifier()); |
- scoped_ptr<Socket> adb_control_socket(new Socket()); |
+ std::unique_ptr<HostController> host_controller; |
+ std::unique_ptr<PipeNotifier> delete_controller_notifier(new PipeNotifier()); |
+ std::unique_ptr<Socket> adb_control_socket(new Socket()); |
adb_control_socket->AddEventFd(exit_notifier_fd); |
adb_control_socket->AddEventFd(delete_controller_notifier->receiver_fd()); |
if (!adb_control_socket->ConnectTcp(std::string(), adb_port)) { |
@@ -70,8 +70,8 @@ HostController::HostController( |
int adb_port, |
int exit_notifier_fd, |
const ErrorCallback& error_callback, |
- scoped_ptr<Socket> adb_control_socket, |
- scoped_ptr<PipeNotifier> delete_controller_notifier) |
+ std::unique_ptr<Socket> adb_control_socket, |
+ std::unique_ptr<PipeNotifier> delete_controller_notifier) |
: self_deleter_helper_(this, error_callback), |
device_port_(device_port), |
host_port_(host_port), |
@@ -97,7 +97,7 @@ void HostController::ReadCommandOnInternalThread() { |
return; |
} |
// Try to connect to host server. |
- scoped_ptr<Socket> host_server_data_socket(new Socket()); |
+ std::unique_ptr<Socket> host_server_data_socket(new Socket()); |
if (!host_server_data_socket->ConnectTcp(std::string(), host_port_)) { |
LOG(ERROR) << "Could not Connect HostServerData socket on port: " |
<< host_port_; |
@@ -121,8 +121,8 @@ void HostController::ReadCommandOnInternalThread() { |
} |
void HostController::StartForwarder( |
- scoped_ptr<Socket> host_server_data_socket) { |
- scoped_ptr<Socket> adb_data_socket(new Socket()); |
+ std::unique_ptr<Socket> host_server_data_socket) { |
+ std::unique_ptr<Socket> adb_data_socket(new Socket()); |
if (!adb_data_socket->ConnectTcp("", adb_port_)) { |
LOG(ERROR) << "Could not connect AdbDataSocket on port: " << adb_port_; |
OnInternalThreadError(); |