| Index: content/shell/browser/shell_url_request_context_getter.cc
|
| diff --git a/content/shell/browser/shell_url_request_context_getter.cc b/content/shell/browser/shell_url_request_context_getter.cc
|
| index 69f0116bdb75a04f5e0c9294071ea1f802952600..8808c3b108e2c4955b1ef123d9e5a436aded2cd3 100644
|
| --- a/content/shell/browser/shell_url_request_context_getter.cc
|
| +++ b/content/shell/browser/shell_url_request_context_getter.cc
|
| @@ -4,11 +4,12 @@
|
|
|
| #include "content/shell/browser/shell_url_request_context_getter.h"
|
|
|
| +#include <memory>
|
| #include <utility>
|
|
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_split.h"
|
| @@ -56,7 +57,7 @@ void InstallProtocolHandlers(net::URLRequestJobFactoryImpl* job_factory,
|
| it != protocol_handlers->end();
|
| ++it) {
|
| bool set_protocol = job_factory->SetProtocolHandler(
|
| - it->first, make_scoped_ptr(it->second.release()));
|
| + it->first, base::WrapUnique(it->second.release()));
|
| DCHECK(set_protocol);
|
| }
|
| protocol_handlers->clear();
|
| @@ -92,18 +93,19 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
|
| ShellURLRequestContextGetter::~ShellURLRequestContextGetter() {
|
| }
|
|
|
| -scoped_ptr<net::NetworkDelegate>
|
| +std::unique_ptr<net::NetworkDelegate>
|
| ShellURLRequestContextGetter::CreateNetworkDelegate() {
|
| - return make_scoped_ptr(new ShellNetworkDelegate);
|
| + return base::WrapUnique(new ShellNetworkDelegate);
|
| }
|
|
|
| -scoped_ptr<net::ProxyConfigService>
|
| +std::unique_ptr<net::ProxyConfigService>
|
| ShellURLRequestContextGetter::GetProxyConfigService() {
|
| return net::ProxyService::CreateSystemProxyConfigService(io_task_runner_,
|
| file_task_runner_);
|
| }
|
|
|
| -scoped_ptr<net::ProxyService> ShellURLRequestContextGetter::GetProxyService() {
|
| +std::unique_ptr<net::ProxyService>
|
| +ShellURLRequestContextGetter::GetProxyService() {
|
| // TODO(jam): use v8 if possible, look at chrome code.
|
| return net::ProxyService::CreateUsingSystemProxyResolver(
|
| std::move(proxy_config_service_), 0, url_request_context_->net_log());
|
| @@ -123,28 +125,28 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
|
| storage_.reset(
|
| new net::URLRequestContextStorage(url_request_context_.get()));
|
| storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig()));
|
| - storage_->set_channel_id_service(make_scoped_ptr(
|
| + storage_->set_channel_id_service(base::WrapUnique(
|
| new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
|
| base::WorkerPool::GetTaskRunner(true))));
|
| - storage_->set_http_user_agent_settings(make_scoped_ptr(
|
| + storage_->set_http_user_agent_settings(base::WrapUnique(
|
| new net::StaticHttpUserAgentSettings("en-us,en", GetShellUserAgent())));
|
|
|
| - scoped_ptr<net::HostResolver> host_resolver(
|
| + std::unique_ptr<net::HostResolver> host_resolver(
|
| net::HostResolver::CreateDefaultResolver(
|
| url_request_context_->net_log()));
|
|
|
| storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
|
| storage_->set_transport_security_state(
|
| - make_scoped_ptr(new net::TransportSecurityState));
|
| + base::WrapUnique(new net::TransportSecurityState));
|
| storage_->set_proxy_service(GetProxyService());
|
| storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
|
| storage_->set_http_auth_handler_factory(
|
| net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
|
| storage_->set_http_server_properties(
|
| - make_scoped_ptr(new net::HttpServerPropertiesImpl()));
|
| + base::WrapUnique(new net::HttpServerPropertiesImpl()));
|
|
|
| base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache"));
|
| - scoped_ptr<net::HttpCache::DefaultBackend> main_backend(
|
| + std::unique_ptr<net::HttpCache::DefaultBackend> main_backend(
|
| new net::HttpCache::DefaultBackend(
|
| net::DISK_CACHE,
|
| #if defined(OS_ANDROID)
|
| @@ -154,8 +156,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
|
| #else
|
| net::CACHE_BACKEND_DEFAULT,
|
| #endif
|
| - cache_path,
|
| - 0,
|
| + cache_path, 0,
|
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
|
|
|
| net::HttpNetworkSession::Params network_session_params;
|
| @@ -190,7 +191,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
|
| network_session_params.testing_fixed_https_port = value;
|
| }
|
| if (command_line.HasSwitch(switches::kHostResolverRules)) {
|
| - scoped_ptr<net::MappedHostResolver> mapped_host_resolver(
|
| + std::unique_ptr<net::MappedHostResolver> mapped_host_resolver(
|
| new net::MappedHostResolver(std::move(host_resolver)));
|
| mapped_host_resolver->SetRulesFromString(
|
| command_line.GetSwitchValueASCII(switches::kHostResolverRules));
|
| @@ -203,37 +204,37 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
|
| url_request_context_->host_resolver();
|
|
|
| storage_->set_http_network_session(
|
| - make_scoped_ptr(new net::HttpNetworkSession(network_session_params)));
|
| - storage_->set_http_transaction_factory(make_scoped_ptr(new net::HttpCache(
|
| + base::WrapUnique(new net::HttpNetworkSession(network_session_params)));
|
| + storage_->set_http_transaction_factory(base::WrapUnique(new net::HttpCache(
|
| storage_->http_network_session(), std::move(main_backend),
|
| true /* set_up_quic_server_info */)));
|
|
|
| - scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| + std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| new net::URLRequestJobFactoryImpl());
|
| // Keep ProtocolHandlers added in sync with
|
| // ShellContentBrowserClient::IsHandledURL().
|
| InstallProtocolHandlers(job_factory.get(), &protocol_handlers_);
|
| bool set_protocol = job_factory->SetProtocolHandler(
|
| - url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler));
|
| + url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
|
| DCHECK(set_protocol);
|
| #if !defined(DISABLE_FILE_SUPPORT)
|
| set_protocol = job_factory->SetProtocolHandler(
|
| url::kFileScheme,
|
| - make_scoped_ptr(new net::FileProtocolHandler(
|
| + base::WrapUnique(new net::FileProtocolHandler(
|
| BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
|
| base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
|
| DCHECK(set_protocol);
|
| #endif
|
|
|
| // 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 (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();
|
|
|
|
|