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

Side by Side Diff: net/url_request/url_request_context_builder.cc

Issue 1356933002: make ProxyService::CreateSystemProxyConfigService return scoped_ptrs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small ios fix Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_context_builder.h" 5 #include "net/url_request/url_request_context_builder.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 if (!host_resolver_) { 290 if (!host_resolver_) {
291 host_resolver_ = HostResolver::CreateDefaultResolver(context->net_log()); 291 host_resolver_ = HostResolver::CreateDefaultResolver(context->net_log());
292 } 292 }
293 storage->set_host_resolver(host_resolver_.Pass()); 293 storage->set_host_resolver(host_resolver_.Pass());
294 294
295 if (!proxy_service_) { 295 if (!proxy_service_) {
296 // TODO(willchan): Switch to using this code when 296 // TODO(willchan): Switch to using this code when
297 // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck. 297 // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck.
298 #if defined(OS_LINUX) || defined(OS_ANDROID) 298 #if defined(OS_LINUX) || defined(OS_ANDROID)
299 ProxyConfigService* proxy_config_service = proxy_config_service_.release(); 299 scoped_ptr<ProxyConfigService> proxy_config_service(
300 proxy_config_service_.release());
mmenke 2015/09/18 18:58:54 = *.Pass()
Charlie Harrison 2015/09/18 19:56:06 Done.
300 #else 301 #else
301 ProxyConfigService* proxy_config_service = NULL; 302 scoped_ptr<ProxyConfigService> proxy_config_service;
302 if (proxy_config_service_) { 303 if (proxy_config_service_) {
303 proxy_config_service = proxy_config_service_.release(); 304 proxy_config_service.reset(proxy_config_service_.release());
mmenke 2015/09/18 18:58:54 = *.Pass()
Charlie Harrison 2015/09/18 19:56:06 Done.
304 } else { 305 } else {
305 proxy_config_service = ProxyService::CreateSystemProxyConfigService( 306 proxy_config_service = ProxyService::CreateSystemProxyConfigService(
306 base::ThreadTaskRunnerHandle::Get().get(), 307 base::ThreadTaskRunnerHandle::Get().get(),
307 context->GetFileTaskRunner()); 308 context->GetFileTaskRunner());
308 } 309 }
309 #endif // defined(OS_LINUX) || defined(OS_ANDROID) 310 #endif // defined(OS_LINUX) || defined(OS_ANDROID)
310 proxy_service_ = ProxyService::CreateUsingSystemProxyResolver( 311 proxy_service_ = ProxyService::CreateUsingSystemProxyResolver(
311 proxy_config_service, 312 proxy_config_service.Pass(),
312 0, // This results in using the default value. 313 0, // This results in using the default value.
313 context->net_log()); 314 context->net_log());
314 } 315 }
315 storage->set_proxy_service(proxy_service_.Pass()); 316 storage->set_proxy_service(proxy_service_.Pass());
316 317
317 storage->set_ssl_config_service(new SSLConfigServiceDefaults); 318 storage->set_ssl_config_service(new SSLConfigServiceDefaults);
318 scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_registry_factory( 319 scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_registry_factory(
319 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver())); 320 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver()));
320 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) { 321 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) {
321 http_auth_handler_registry_factory->RegisterSchemeFactory( 322 http_auth_handler_registry_factory->RegisterSchemeFactory(
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 451 }
451 url_request_interceptors_.weak_clear(); 452 url_request_interceptors_.weak_clear();
452 } 453 }
453 storage->set_job_factory(top_job_factory.Pass()); 454 storage->set_job_factory(top_job_factory.Pass());
454 // TODO(willchan): Support sdch. 455 // TODO(willchan): Support sdch.
455 456
456 return context.Pass(); 457 return context.Pass();
457 } 458 }
458 459
459 } // namespace net 460 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698