| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_url_request_context_getter.h" | 5 #include "content/shell/browser/shell_url_request_context_getter.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "net/cert/cert_verifier.h" | 21 #include "net/cert/cert_verifier.h" |
| 22 #include "net/cookies/cookie_monster.h" | 22 #include "net/cookies/cookie_monster.h" |
| 23 #include "net/dns/host_resolver.h" | 23 #include "net/dns/host_resolver.h" |
| 24 #include "net/dns/mapped_host_resolver.h" | 24 #include "net/dns/mapped_host_resolver.h" |
| 25 #include "net/http/http_auth_handler_factory.h" | 25 #include "net/http/http_auth_handler_factory.h" |
| 26 #include "net/http/http_cache.h" | 26 #include "net/http/http_cache.h" |
| 27 #include "net/http/http_network_session.h" | 27 #include "net/http/http_network_session.h" |
| 28 #include "net/http/http_server_properties_impl.h" | 28 #include "net/http/http_server_properties_impl.h" |
| 29 #include "net/http/transport_security_state.h" | 29 #include "net/http/transport_security_state.h" |
| 30 #include "net/proxy/proxy_service.h" | 30 #include "net/proxy/proxy_service.h" |
| 31 #include "net/ssl/default_server_bound_cert_store.h" | 31 #include "net/ssl/channel_id_service.h" |
| 32 #include "net/ssl/server_bound_cert_service.h" | 32 #include "net/ssl/default_channel_id_store.h" |
| 33 #include "net/ssl/ssl_config_service_defaults.h" | 33 #include "net/ssl/ssl_config_service_defaults.h" |
| 34 #include "net/url_request/data_protocol_handler.h" | 34 #include "net/url_request/data_protocol_handler.h" |
| 35 #include "net/url_request/file_protocol_handler.h" | 35 #include "net/url_request/file_protocol_handler.h" |
| 36 #include "net/url_request/static_http_user_agent_settings.h" | 36 #include "net/url_request/static_http_user_agent_settings.h" |
| 37 #include "net/url_request/url_request_context.h" | 37 #include "net/url_request/url_request_context.h" |
| 38 #include "net/url_request/url_request_context_storage.h" | 38 #include "net/url_request/url_request_context_storage.h" |
| 39 #include "net/url_request/url_request_intercepting_job_factory.h" | 39 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 40 #include "net/url_request/url_request_job_factory_impl.h" | 40 #include "net/url_request/url_request_job_factory_impl.h" |
| 41 #include "url/url_constants.h" | 41 #include "url/url_constants.h" |
| 42 | 42 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 url_request_context_.reset(new net::URLRequestContext()); | 100 url_request_context_.reset(new net::URLRequestContext()); |
| 101 url_request_context_->set_net_log(net_log_); | 101 url_request_context_->set_net_log(net_log_); |
| 102 network_delegate_.reset(new ShellNetworkDelegate); | 102 network_delegate_.reset(new ShellNetworkDelegate); |
| 103 if (command_line.HasSwitch(switches::kDumpRenderTree)) | 103 if (command_line.HasSwitch(switches::kDumpRenderTree)) |
| 104 ShellNetworkDelegate::SetAcceptAllCookies(false); | 104 ShellNetworkDelegate::SetAcceptAllCookies(false); |
| 105 url_request_context_->set_network_delegate(network_delegate_.get()); | 105 url_request_context_->set_network_delegate(network_delegate_.get()); |
| 106 storage_.reset( | 106 storage_.reset( |
| 107 new net::URLRequestContextStorage(url_request_context_.get())); | 107 new net::URLRequestContextStorage(url_request_context_.get())); |
| 108 storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig())); | 108 storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig())); |
| 109 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( | 109 storage_->set_channel_id_service(new net::ChannelIDService( |
| 110 new net::DefaultServerBoundCertStore(NULL), | 110 new net::DefaultChannelIDStore(NULL), |
| 111 base::WorkerPool::GetTaskRunner(true))); | 111 base::WorkerPool::GetTaskRunner(true))); |
| 112 storage_->set_http_user_agent_settings( | 112 storage_->set_http_user_agent_settings( |
| 113 new net::StaticHttpUserAgentSettings( | 113 new net::StaticHttpUserAgentSettings( |
| 114 "en-us,en", GetShellUserAgent())); | 114 "en-us,en", GetShellUserAgent())); |
| 115 | 115 |
| 116 scoped_ptr<net::HostResolver> host_resolver( | 116 scoped_ptr<net::HostResolver> host_resolver( |
| 117 net::HostResolver::CreateDefaultResolver( | 117 net::HostResolver::CreateDefaultResolver( |
| 118 url_request_context_->net_log())); | 118 url_request_context_->net_log())); |
| 119 | 119 |
| 120 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); | 120 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 150 cache_path, | 150 cache_path, |
| 151 0, | 151 0, |
| 152 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) | 152 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) |
| 153 .get()); | 153 .get()); |
| 154 | 154 |
| 155 net::HttpNetworkSession::Params network_session_params; | 155 net::HttpNetworkSession::Params network_session_params; |
| 156 network_session_params.cert_verifier = | 156 network_session_params.cert_verifier = |
| 157 url_request_context_->cert_verifier(); | 157 url_request_context_->cert_verifier(); |
| 158 network_session_params.transport_security_state = | 158 network_session_params.transport_security_state = |
| 159 url_request_context_->transport_security_state(); | 159 url_request_context_->transport_security_state(); |
| 160 network_session_params.server_bound_cert_service = | 160 network_session_params.channel_id_service = |
| 161 url_request_context_->server_bound_cert_service(); | 161 url_request_context_->channel_id_service(); |
| 162 network_session_params.proxy_service = | 162 network_session_params.proxy_service = |
| 163 url_request_context_->proxy_service(); | 163 url_request_context_->proxy_service(); |
| 164 network_session_params.ssl_config_service = | 164 network_session_params.ssl_config_service = |
| 165 url_request_context_->ssl_config_service(); | 165 url_request_context_->ssl_config_service(); |
| 166 network_session_params.http_auth_handler_factory = | 166 network_session_params.http_auth_handler_factory = |
| 167 url_request_context_->http_auth_handler_factory(); | 167 url_request_context_->http_auth_handler_factory(); |
| 168 network_session_params.network_delegate = | 168 network_session_params.network_delegate = |
| 169 network_delegate_.get(); | 169 network_delegate_.get(); |
| 170 network_session_params.http_server_properties = | 170 network_session_params.http_server_properties = |
| 171 url_request_context_->http_server_properties(); | 171 url_request_context_->http_server_properties(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 scoped_refptr<base::SingleThreadTaskRunner> | 238 scoped_refptr<base::SingleThreadTaskRunner> |
| 239 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 239 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 240 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 240 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 241 } | 241 } |
| 242 | 242 |
| 243 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 243 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
| 244 return url_request_context_->host_resolver(); | 244 return url_request_context_->host_resolver(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace content | 247 } // namespace content |
| OLD | NEW |