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

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

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/host_controller.h ('k') | tools/android/forwarder2/host_forwarder_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « tools/android/forwarder2/host_controller.h ('k') | tools/android/forwarder2/host_forwarder_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698