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

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

Issue 1301333002: make ProxyService::CreateSystemProxyConfigService return scoped_ptrs NOT FOR REVIEW (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try merging again... 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
« no previous file with comments | « net/proxy/proxy_service_v8.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 if (!host_resolver_) { 271 if (!host_resolver_) {
272 host_resolver_ = HostResolver::CreateDefaultResolver(context->net_log()); 272 host_resolver_ = HostResolver::CreateDefaultResolver(context->net_log());
273 } 273 }
274 storage->set_host_resolver(host_resolver_.Pass()); 274 storage->set_host_resolver(host_resolver_.Pass());
275 275
276 if (!proxy_service_) { 276 if (!proxy_service_) {
277 // TODO(willchan): Switch to using this code when 277 // TODO(willchan): Switch to using this code when
278 // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck. 278 // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck.
279 #if defined(OS_LINUX) || defined(OS_ANDROID) 279 #if defined(OS_LINUX) || defined(OS_ANDROID)
280 ProxyConfigService* proxy_config_service = proxy_config_service_.release(); 280 scoped_ptr<ProxyConfigService> proxy_config_service(
281 proxy_config_service_.release());
281 #else 282 #else
282 ProxyConfigService* proxy_config_service = NULL; 283 scoped_ptr<ProxyConfigService> proxy_config_service;
283 if (proxy_config_service_) { 284 if (proxy_config_service_) {
284 proxy_config_service = proxy_config_service_.release(); 285 proxy_config_service.reset(proxy_config_service_.release());
285 } else { 286 } else {
286 proxy_config_service = ProxyService::CreateSystemProxyConfigService( 287 proxy_config_service = ProxyService::CreateSystemProxyConfigService(
287 base::ThreadTaskRunnerHandle::Get().get(), 288 base::ThreadTaskRunnerHandle::Get().get(),
288 context->GetFileTaskRunner()); 289 context->GetFileTaskRunner());
289 } 290 }
290 #endif // defined(OS_LINUX) || defined(OS_ANDROID) 291 #endif // defined(OS_LINUX) || defined(OS_ANDROID)
291 proxy_service_ = ProxyService::CreateUsingSystemProxyResolver( 292 proxy_service_ = ProxyService::CreateUsingSystemProxyResolver(
292 proxy_config_service, 293 proxy_config_service.Pass(),
293 0, // This results in using the default value. 294 0, // This results in using the default value.
294 context->net_log()); 295 context->net_log());
295 } 296 }
296 storage->set_proxy_service(proxy_service_.Pass()); 297 storage->set_proxy_service(proxy_service_.Pass());
297 298
298 storage->set_ssl_config_service(new SSLConfigServiceDefaults); 299 storage->set_ssl_config_service(new SSLConfigServiceDefaults);
299 scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_registry_factory( 300 scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_registry_factory(
300 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver())); 301 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver()));
301 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) { 302 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) {
302 http_auth_handler_registry_factory->RegisterSchemeFactory( 303 http_auth_handler_registry_factory->RegisterSchemeFactory(
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 446 }
446 url_request_interceptors_.weak_clear(); 447 url_request_interceptors_.weak_clear();
447 } 448 }
448 storage->set_job_factory(top_job_factory.Pass()); 449 storage->set_job_factory(top_job_factory.Pass());
449 // TODO(willchan): Support sdch. 450 // TODO(willchan): Support sdch.
450 451
451 return context.Pass(); 452 return context.Pass();
452 } 453 }
453 454
454 } // namespace net 455 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service_v8.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698