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

Unified Diff: remoting/host/chromoting_host_context.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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 | « remoting/host/chromoting_host_context.h ('k') | remoting/host/chromoting_host_context_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host_context.cc
diff --git a/remoting/host/chromoting_host_context.cc b/remoting/host/chromoting_host_context.cc
index 00f1cf71eb332011a06b646e60daae1d325c69f0..8807af4f04d0e42d0fa19fe5b35538807ee13379 100644
--- a/remoting/host/chromoting_host_context.cc
+++ b/remoting/host/chromoting_host_context.cc
@@ -5,6 +5,7 @@
#include "remoting/host/chromoting_host_context.h"
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "remoting/base/auto_thread.h"
@@ -43,8 +44,8 @@ ChromotingHostContext::ChromotingHostContext(
ChromotingHostContext::~ChromotingHostContext() {
}
-scoped_ptr<ChromotingHostContext> ChromotingHostContext::Copy() {
- return make_scoped_ptr(new ChromotingHostContext(
+std::unique_ptr<ChromotingHostContext> ChromotingHostContext::Copy() {
+ return base::WrapUnique(new ChromotingHostContext(
ui_task_runner_, audio_task_runner_, file_task_runner_,
input_task_runner_, network_task_runner_, video_capture_task_runner_,
video_encode_task_runner_, url_request_context_getter_));
@@ -90,7 +91,7 @@ ChromotingHostContext::url_request_context_getter() const {
return url_request_context_getter_;
}
-scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create(
+std::unique_ptr<ChromotingHostContext> ChromotingHostContext::Create(
scoped_refptr<AutoThreadTaskRunner> ui_task_runner) {
#if defined(OS_WIN)
// On Windows the AudioCapturer requires COM, so we run a single-threaded
@@ -114,10 +115,8 @@ scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create(
network_task_runner->PostTask(FROM_HERE,
base::Bind(&DisallowBlockingOperations));
- return make_scoped_ptr(new ChromotingHostContext(
- ui_task_runner,
- audio_task_runner,
- file_task_runner,
+ return base::WrapUnique(new ChromotingHostContext(
+ ui_task_runner, audio_task_runner, file_task_runner,
AutoThread::CreateWithType("ChromotingInputThread", ui_task_runner,
base::MessageLoop::TYPE_IO),
network_task_runner,
@@ -130,7 +129,7 @@ scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create(
#if defined(OS_CHROMEOS)
// static
-scoped_ptr<ChromotingHostContext> ChromotingHostContext::CreateForChromeOS(
+std::unique_ptr<ChromotingHostContext> ChromotingHostContext::CreateForChromeOS(
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
@@ -153,7 +152,7 @@ scoped_ptr<ChromotingHostContext> ChromotingHostContext::CreateForChromeOS(
// Use browser's file thread as the joiner as it is the only browser-thread
// that allows blocking I/O, which is required by thread joining.
- return make_scoped_ptr(new ChromotingHostContext(
+ return base::WrapUnique(new ChromotingHostContext(
ui_auto_task_runner,
AutoThread::Create("ChromotingAudioThread", file_auto_task_runner),
file_auto_task_runner,
« no previous file with comments | « remoting/host/chromoting_host_context.h ('k') | remoting/host/chromoting_host_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698