OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |