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 "content/shell/shell_url_request_context_getter.h" | 5 #include "content/shell/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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "net/proxy/proxy_service.h" | 28 #include "net/proxy/proxy_service.h" |
29 #include "net/url_request/static_http_user_agent_settings.h" | 29 #include "net/url_request/static_http_user_agent_settings.h" |
30 #include "net/url_request/url_request_context.h" | 30 #include "net/url_request/url_request_context.h" |
31 #include "net/url_request/url_request_context_storage.h" | 31 #include "net/url_request/url_request_context_storage.h" |
32 #include "net/url_request/url_request_job_factory_impl.h" | 32 #include "net/url_request/url_request_job_factory_impl.h" |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 | 35 |
36 ShellURLRequestContextGetter::ShellURLRequestContextGetter( | 36 ShellURLRequestContextGetter::ShellURLRequestContextGetter( |
37 bool ignore_certificate_errors, | 37 bool ignore_certificate_errors, |
38 const FilePath& base_path, | 38 const base::FilePath& base_path, |
39 MessageLoop* io_loop, | 39 MessageLoop* io_loop, |
40 MessageLoop* file_loop) | 40 MessageLoop* file_loop) |
41 : ignore_certificate_errors_(ignore_certificate_errors), | 41 : ignore_certificate_errors_(ignore_certificate_errors), |
42 base_path_(base_path), | 42 base_path_(base_path), |
43 io_loop_(io_loop), | 43 io_loop_(io_loop), |
44 file_loop_(file_loop) { | 44 file_loop_(file_loop) { |
45 // Must first be created on the UI thread. | 45 // Must first be created on the UI thread. |
46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
47 | 47 |
48 // We must create the proxy config service on the UI loop on Linux because it | 48 // We must create the proxy config service on the UI loop on Linux because it |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 net::ProxyService::CreateUsingSystemProxyResolver( | 89 net::ProxyService::CreateUsingSystemProxyResolver( |
90 proxy_config_service_.release(), | 90 proxy_config_service_.release(), |
91 0, | 91 0, |
92 NULL)); | 92 NULL)); |
93 } | 93 } |
94 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); | 94 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); |
95 storage_->set_http_auth_handler_factory( | 95 storage_->set_http_auth_handler_factory( |
96 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); | 96 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); |
97 storage_->set_http_server_properties(new net::HttpServerPropertiesImpl); | 97 storage_->set_http_server_properties(new net::HttpServerPropertiesImpl); |
98 | 98 |
99 FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache")); | 99 base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache")); |
100 net::HttpCache::DefaultBackend* main_backend = | 100 net::HttpCache::DefaultBackend* main_backend = |
101 new net::HttpCache::DefaultBackend( | 101 new net::HttpCache::DefaultBackend( |
102 net::DISK_CACHE, | 102 net::DISK_CACHE, |
103 cache_path, | 103 cache_path, |
104 0, | 104 0, |
105 BrowserThread::GetMessageLoopProxyForThread( | 105 BrowserThread::GetMessageLoopProxyForThread( |
106 BrowserThread::CACHE)); | 106 BrowserThread::CACHE)); |
107 | 107 |
108 net::HttpNetworkSession::Params network_session_params; | 108 net::HttpNetworkSession::Params network_session_params; |
109 network_session_params.cert_verifier = | 109 network_session_params.cert_verifier = |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 scoped_refptr<base::SingleThreadTaskRunner> | 160 scoped_refptr<base::SingleThreadTaskRunner> |
161 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 161 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
162 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 162 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
163 } | 163 } |
164 | 164 |
165 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 165 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
166 return url_request_context_->host_resolver(); | 166 return url_request_context_->host_resolver(); |
167 } | 167 } |
168 | 168 |
169 } // namespace content | 169 } // namespace content |
OLD | NEW |