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

Unified Diff: chromecast/browser/url_request_context_factory.cc

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « chromecast/browser/url_request_context_factory.h ('k') | chromecast/common/cast_resource_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/url_request_context_factory.cc
diff --git a/chromecast/browser/url_request_context_factory.cc b/chromecast/browser/url_request_context_factory.cc
index 808ccba766916cb4e38c14cec2f21085a913dcf9..99013e0849096120e668ae237e9e8f94eb5f00a5 100644
--- a/chromecast/browser/url_request_context_factory.cc
+++ b/chromecast/browser/url_request_context_factory.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/threading/worker_pool.h"
#include "chromecast/base/chromecast_switches.h"
#include "chromecast/browser/cast_http_user_agent_settings.h"
@@ -85,7 +86,7 @@ class URLRequestContextFactory::URLRequestContextGetter
const bool is_media_;
URLRequestContextFactory* const factory_;
- scoped_ptr<net::URLRequestContext> request_context_;
+ std::unique_ptr<net::URLRequestContext> request_context_;
DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
};
@@ -129,7 +130,7 @@ class URLRequestContextFactory::MainURLRequestContextGetter
URLRequestContextFactory* const factory_;
content::ProtocolHandlerMap protocol_handlers_;
content::URLRequestInterceptorScopedVector request_interceptors_;
- scoped_ptr<net::URLRequestContext> request_context_;
+ std::unique_ptr<net::URLRequestContext> request_context_;
DISALLOW_COPY_AND_ASSIGN(MainURLRequestContextGetter);
};
@@ -226,7 +227,7 @@ void URLRequestContextFactory::InitializeMainContextDependencies(
return;
main_transaction_factory_.reset(transaction_factory);
- scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
+ std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
// Keep ProtocolHandlers added in sync with
// CastContentBrowserClient::IsHandledURL().
@@ -235,18 +236,18 @@ void URLRequestContextFactory::InitializeMainContextDependencies(
it != protocol_handlers->end();
++it) {
set_protocol = job_factory->SetProtocolHandler(
- it->first, make_scoped_ptr(it->second.release()));
+ it->first, base::WrapUnique(it->second.release()));
DCHECK(set_protocol);
}
set_protocol = job_factory->SetProtocolHandler(
- url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler));
+ url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
DCHECK(set_protocol);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableLocalFileAccesses)) {
set_protocol = job_factory->SetProtocolHandler(
url::kFileScheme,
- make_scoped_ptr(new net::FileProtocolHandler(
+ base::WrapUnique(new net::FileProtocolHandler(
content::BrowserThread::GetBlockingPool()
->GetTaskRunnerWithShutdownBehavior(
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
@@ -254,14 +255,14 @@ void URLRequestContextFactory::InitializeMainContextDependencies(
}
// Set up interceptors in the reverse order.
- scoped_ptr<net::URLRequestJobFactory> top_job_factory =
+ std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
std::move(job_factory);
for (content::URLRequestInterceptorScopedVector::reverse_iterator i =
request_interceptors.rbegin();
i != request_interceptors.rend();
++i) {
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
- std::move(top_job_factory), make_scoped_ptr(*i)));
+ std::move(top_job_factory), base::WrapUnique(*i)));
}
request_interceptors.weak_clear();
« no previous file with comments | « chromecast/browser/url_request_context_factory.h ('k') | chromecast/common/cast_resource_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698