| 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 "chrome/service/net/service_url_request_context.h" | 5 #include "chrome/service/net/service_url_request_context.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 8 #include <sys/utsname.h> | 8 #include <sys/utsname.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return user_agent; | 103 return user_agent; |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace | 106 } // namespace |
| 107 | 107 |
| 108 ServiceURLRequestContext::ServiceURLRequestContext( | 108 ServiceURLRequestContext::ServiceURLRequestContext( |
| 109 const std::string& user_agent, | 109 const std::string& user_agent, |
| 110 net::ProxyConfigService* net_proxy_config_service) | 110 net::ProxyConfigService* net_proxy_config_service) |
| 111 : user_agent_(user_agent), | 111 : user_agent_(user_agent), |
| 112 ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { | 112 ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { |
| 113 storage_.set_host_resolver( | 113 storage_.set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); |
| 114 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | |
| 115 net::HostResolver::kDefaultRetryAttempts, | |
| 116 NULL)); | |
| 117 storage_.set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver( | 114 storage_.set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver( |
| 118 net_proxy_config_service, 0u, NULL)); | 115 net_proxy_config_service, 0u, NULL)); |
| 119 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); | 116 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); |
| 120 storage_.set_ftp_transaction_factory( | 117 storage_.set_ftp_transaction_factory( |
| 121 new net::FtpNetworkLayer(host_resolver())); | 118 new net::FtpNetworkLayer(host_resolver())); |
| 122 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); | 119 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); |
| 123 storage_.set_http_auth_handler_factory( | 120 storage_.set_http_auth_handler_factory( |
| 124 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 121 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
| 125 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); | 122 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); |
| 126 storage_.set_transport_security_state(new net::TransportSecurityState); | 123 storage_.set_transport_security_state(new net::TransportSecurityState); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 proxy_config_service_.release())); | 176 proxy_config_service_.release())); |
| 180 return url_request_context_.get(); | 177 return url_request_context_.get(); |
| 181 } | 178 } |
| 182 | 179 |
| 183 scoped_refptr<base::SingleThreadTaskRunner> | 180 scoped_refptr<base::SingleThreadTaskRunner> |
| 184 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { | 181 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 185 return network_task_runner_; | 182 return network_task_runner_; |
| 186 } | 183 } |
| 187 | 184 |
| 188 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} | 185 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
| OLD | NEW |