| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 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 if (!proxy_config_service_) { |
| 300 #else | 300 proxy_config_service_ = ProxyService::CreateSystemProxyConfigService( |
| 301 ProxyConfigService* proxy_config_service = NULL; | |
| 302 if (proxy_config_service_) { | |
| 303 proxy_config_service = proxy_config_service_.release(); | |
| 304 } else { | |
| 305 proxy_config_service = ProxyService::CreateSystemProxyConfigService( | |
| 306 base::ThreadTaskRunnerHandle::Get().get(), | 301 base::ThreadTaskRunnerHandle::Get().get(), |
| 307 context->GetFileTaskRunner()); | 302 context->GetFileTaskRunner()); |
| 308 } | 303 } |
| 309 #endif // defined(OS_LINUX) || defined(OS_ANDROID) | 304 #endif // !defined(OS_LINUX) && !defined(OS_ANDROID) |
| 310 proxy_service_ = ProxyService::CreateUsingSystemProxyResolver( | 305 proxy_service_ = ProxyService::CreateUsingSystemProxyResolver( |
| 311 proxy_config_service, | 306 proxy_config_service_.Pass(), |
| 312 0, // This results in using the default value. | 307 0, // This results in using the default value. |
| 313 context->net_log()); | 308 context->net_log()); |
| 314 } | 309 } |
| 315 storage->set_proxy_service(proxy_service_.Pass()); | 310 storage->set_proxy_service(proxy_service_.Pass()); |
| 316 | 311 |
| 317 storage->set_ssl_config_service(new SSLConfigServiceDefaults); | 312 storage->set_ssl_config_service(new SSLConfigServiceDefaults); |
| 318 scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_registry_factory( | 313 scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_registry_factory( |
| 319 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver())); | 314 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver())); |
| 320 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) { | 315 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) { |
| 321 http_auth_handler_registry_factory->RegisterSchemeFactory( | 316 http_auth_handler_registry_factory->RegisterSchemeFactory( |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 445 } |
| 451 url_request_interceptors_.weak_clear(); | 446 url_request_interceptors_.weak_clear(); |
| 452 } | 447 } |
| 453 storage->set_job_factory(top_job_factory.Pass()); | 448 storage->set_job_factory(top_job_factory.Pass()); |
| 454 // TODO(willchan): Support sdch. | 449 // TODO(willchan): Support sdch. |
| 455 | 450 |
| 456 return context.Pass(); | 451 return context.Pass(); |
| 457 } | 452 } |
| 458 | 453 |
| 459 } // namespace net | 454 } // namespace net |
| OLD | NEW |