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

Unified Diff: tools/android/forwarder2/host_controller.h

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/forwarder2/forwarders_manager.cc ('k') | tools/android/forwarder2/host_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « tools/android/forwarder2/forwarders_manager.cc ('k') | tools/android/forwarder2/host_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698