Index: tools/android/forwarder2/host_controller.h |
diff --git a/tools/android/forwarder2/host_controller.h b/tools/android/forwarder2/host_controller.h |
index 484adacd031bbfeda4c411a212a4fda30baa041e..73282451aea841e46dfadf0717662e769ad5308a 100644 |
--- a/tools/android/forwarder2/host_controller.h |
+++ b/tools/android/forwarder2/host_controller.h |
@@ -5,12 +5,12 @@ |
#ifndef TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ |
#define TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ |
+#include <memory> |
#include <string> |
#include "base/callback.h" |
#include "base/compiler_specific.h" |
#include "base/macros.h" |
-#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "base/threading/thread.h" |
#include "tools/android/forwarder2/forwarders_manager.h" |
@@ -34,15 +34,16 @@ class HostController { |
public: |
// Callback used for self-deletion when an error happens so that the client |
// can perform some cleanup work before deleting the HostController instance. |
- typedef base::Callback<void (scoped_ptr<HostController>)> ErrorCallback; |
+ typedef base::Callback<void(std::unique_ptr<HostController>)> ErrorCallback; |
// If |device_port| is zero then a dynamic port is allocated (and retrievable |
// through device_port() below). |
- static scoped_ptr<HostController> Create(int device_port, |
- int host_port, |
- int adb_port, |
- int exit_notifier_fd, |
- const ErrorCallback& error_callback); |
+ static std::unique_ptr<HostController> Create( |
+ int device_port, |
+ int host_port, |
+ int adb_port, |
+ int exit_notifier_fd, |
+ const ErrorCallback& error_callback); |
~HostController(); |
@@ -59,13 +60,13 @@ class 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); |
void ReadNextCommandSoon(); |
void ReadCommandOnInternalThread(); |
- void StartForwarder(scoped_ptr<Socket> host_server_data_socket); |
+ void StartForwarder(std::unique_ptr<Socket> host_server_data_socket); |
// Note that this gets also called when ~HostController() is invoked. |
void OnInternalThreadError(); |
@@ -78,10 +79,10 @@ class HostController { |
const int adb_port_; |
// Used to notify the controller when the process is killed. |
const int global_exit_notifier_fd_; |
- scoped_ptr<Socket> adb_control_socket_; |
+ std::unique_ptr<Socket> adb_control_socket_; |
// Used to cancel the pending blocking IO operations when the host controller |
// instance is deleted. |
- scoped_ptr<PipeNotifier> delete_controller_notifier_; |
+ std::unique_ptr<PipeNotifier> delete_controller_notifier_; |
// Task runner used for deletion set at deletion time (i.e. the object is |
// deleted on the same thread it is created on). |
const scoped_refptr<base::SingleThreadTaskRunner> deletion_task_runner_; |