| 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 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 15 #include "chrome/common/chrome_version_info.h" | 15 #include "chrome/common/chrome_version_info.h" |
| 16 #include "chrome/service/service_process.h" | 16 #include "chrome/service/service_process.h" |
| 17 #include "net/cert/cert_verifier.h" | 17 #include "net/cert/cert_verifier.h" |
| 18 #include "net/cookies/cookie_monster.h" | 18 #include "net/cookies/cookie_monster.h" |
| 19 #include "net/dns/host_resolver.h" | 19 #include "net/dns/host_resolver.h" |
| 20 #include "net/ftp/ftp_network_layer.h" | |
| 21 #include "net/http/http_auth_handler_factory.h" | 20 #include "net/http/http_auth_handler_factory.h" |
| 22 #include "net/http/http_cache.h" | 21 #include "net/http/http_cache.h" |
| 23 #include "net/http/http_network_session.h" | 22 #include "net/http/http_network_session.h" |
| 24 #include "net/http/http_server_properties_impl.h" | 23 #include "net/http/http_server_properties_impl.h" |
| 25 #include "net/proxy/proxy_config_service.h" | 24 #include "net/proxy/proxy_config_service.h" |
| 26 #include "net/proxy/proxy_service.h" | 25 #include "net/proxy/proxy_service.h" |
| 27 #include "net/ssl/ssl_config_service_defaults.h" | 26 #include "net/ssl/ssl_config_service_defaults.h" |
| 28 #include "net/url_request/static_http_user_agent_settings.h" | 27 #include "net/url_request/static_http_user_agent_settings.h" |
| 29 #include "net/url_request/url_request_throttler_manager.h" | 28 #include "net/url_request/url_request_throttler_manager.h" |
| 30 | 29 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } // namespace | 106 } // namespace |
| 108 | 107 |
| 109 ServiceURLRequestContext::ServiceURLRequestContext( | 108 ServiceURLRequestContext::ServiceURLRequestContext( |
| 110 const std::string& user_agent, | 109 const std::string& user_agent, |
| 111 net::ProxyConfigService* net_proxy_config_service) | 110 net::ProxyConfigService* net_proxy_config_service) |
| 112 : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { | 111 : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { |
| 113 storage_.set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); | 112 storage_.set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); |
| 114 storage_.set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver( | 113 storage_.set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver( |
| 115 net_proxy_config_service, 0u, NULL)); | 114 net_proxy_config_service, 0u, NULL)); |
| 116 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); | 115 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); |
| 117 storage_.set_ftp_transaction_factory( | |
| 118 new net::FtpNetworkLayer(host_resolver())); | |
| 119 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); | 116 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); |
| 120 storage_.set_http_auth_handler_factory( | 117 storage_.set_http_auth_handler_factory( |
| 121 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 118 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
| 122 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); | 119 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); |
| 123 storage_.set_transport_security_state(new net::TransportSecurityState); | 120 storage_.set_transport_security_state(new net::TransportSecurityState); |
| 124 storage_.set_throttler_manager(new net::URLRequestThrottlerManager); | 121 storage_.set_throttler_manager(new net::URLRequestThrottlerManager); |
| 125 | 122 |
| 126 net::HttpNetworkSession::Params session_params; | 123 net::HttpNetworkSession::Params session_params; |
| 127 session_params.host_resolver = host_resolver(); | 124 session_params.host_resolver = host_resolver(); |
| 128 session_params.cert_verifier = cert_verifier(); | 125 session_params.cert_verifier = cert_verifier(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 proxy_config_service_.release())); | 165 proxy_config_service_.release())); |
| 169 return url_request_context_.get(); | 166 return url_request_context_.get(); |
| 170 } | 167 } |
| 171 | 168 |
| 172 scoped_refptr<base::SingleThreadTaskRunner> | 169 scoped_refptr<base::SingleThreadTaskRunner> |
| 173 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { | 170 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 174 return network_task_runner_; | 171 return network_task_runner_; |
| 175 } | 172 } |
| 176 | 173 |
| 177 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} | 174 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
| OLD | NEW |