OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This class represents contextual information (cookies, cache, etc.) | 5 // This class represents contextual information (cookies, cache, etc.) |
6 // that's useful when processing resource requests. | 6 // that's useful when processing resource requests. |
7 // The class is reference-counted so that it can be cleaned up after any | 7 // The class is reference-counted so that it can be cleaned up after any |
8 // requests that are using it have been completed. | 8 // requests that are using it have been completed. |
9 | 9 |
10 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 10 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
11 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 11 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
12 #pragma once | 12 #pragma once |
13 | 13 |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
19 #include "net/base/net_log.h" | 19 #include "net/base/net_log.h" |
20 #include "net/base/ssl_config_service.h" | 20 #include "net/base/ssl_config_service.h" |
21 #include "net/base/transport_security_state.h" | 21 #include "net/base/transport_security_state.h" |
22 #include "net/http/http_server_properties.h" | 22 #include "net/http/http_server_properties.h" |
23 #include "net/ftp/ftp_auth_cache.h" | 23 #include "net/ftp/ftp_auth_cache.h" |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 class CertVerifier; | 26 class CertVerifier; |
27 class CookieStore; | 27 class CookieStore; |
28 class DnsCertProvenanceChecker; | 28 class DnsCertProvenanceChecker; |
29 class DnsRRResolver; | 29 class DnsRRResolver; |
30 class FraudulentCertificateReporter; | |
31 class FtpTransactionFactory; | 30 class FtpTransactionFactory; |
32 class HostResolver; | 31 class HostResolver; |
33 class HttpAuthHandlerFactory; | 32 class HttpAuthHandlerFactory; |
34 class HttpTransactionFactory; | 33 class HttpTransactionFactory; |
35 class NetworkDelegate; | 34 class NetworkDelegate; |
36 class OriginBoundCertService; | 35 class OriginBoundCertService; |
37 class ProxyService; | 36 class ProxyService; |
38 class URLRequest; | 37 class URLRequest; |
39 class URLRequestJobFactory; | 38 class URLRequestJobFactory; |
40 | 39 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 dnsrr_resolver_ = dnsrr_resolver; | 95 dnsrr_resolver_ = dnsrr_resolver; |
97 } | 96 } |
98 | 97 |
99 DnsCertProvenanceChecker* dns_cert_checker() const { | 98 DnsCertProvenanceChecker* dns_cert_checker() const { |
100 return dns_cert_checker_; | 99 return dns_cert_checker_; |
101 } | 100 } |
102 void set_dns_cert_checker(DnsCertProvenanceChecker* dns_cert_checker) { | 101 void set_dns_cert_checker(DnsCertProvenanceChecker* dns_cert_checker) { |
103 dns_cert_checker_ = dns_cert_checker; | 102 dns_cert_checker_ = dns_cert_checker; |
104 } | 103 } |
105 | 104 |
106 FraudulentCertificateReporter* fraudulent_certificate_reporter() const { | |
107 return fraudulent_certificate_reporter_; | |
108 } | |
109 void set_fraudulent_certificate_reporter( | |
110 FraudulentCertificateReporter* fraudulent_certificate_reporter) { | |
111 fraudulent_certificate_reporter_ = fraudulent_certificate_reporter; | |
112 } | |
113 | |
114 // Get the proxy service for this context. | 105 // Get the proxy service for this context. |
115 ProxyService* proxy_service() const { return proxy_service_; } | 106 ProxyService* proxy_service() const { return proxy_service_; } |
116 void set_proxy_service(ProxyService* proxy_service) { | 107 void set_proxy_service(ProxyService* proxy_service) { |
117 proxy_service_ = proxy_service; | 108 proxy_service_ = proxy_service; |
118 } | 109 } |
119 | 110 |
120 // Get the ssl config service for this context. | 111 // Get the ssl config service for this context. |
121 SSLConfigService* ssl_config_service() const { return ssl_config_service_; } | 112 SSLConfigService* ssl_config_service() const { return ssl_config_service_; } |
122 void set_ssl_config_service(SSLConfigService* service) { | 113 void set_ssl_config_service(SSLConfigService* service) { |
123 ssl_config_service_ = service; | 114 ssl_config_service_ = service; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // --------------------------------------------------------------------------- | 211 // --------------------------------------------------------------------------- |
221 | 212 |
222 // Ownership for these members are not defined here. Clients should either | 213 // Ownership for these members are not defined here. Clients should either |
223 // provide storage elsewhere or have a subclass take ownership. | 214 // provide storage elsewhere or have a subclass take ownership. |
224 NetLog* net_log_; | 215 NetLog* net_log_; |
225 HostResolver* host_resolver_; | 216 HostResolver* host_resolver_; |
226 CertVerifier* cert_verifier_; | 217 CertVerifier* cert_verifier_; |
227 OriginBoundCertService* origin_bound_cert_service_; | 218 OriginBoundCertService* origin_bound_cert_service_; |
228 DnsRRResolver* dnsrr_resolver_; | 219 DnsRRResolver* dnsrr_resolver_; |
229 DnsCertProvenanceChecker* dns_cert_checker_; | 220 DnsCertProvenanceChecker* dns_cert_checker_; |
230 FraudulentCertificateReporter* fraudulent_certificate_reporter_; | |
231 HttpAuthHandlerFactory* http_auth_handler_factory_; | 221 HttpAuthHandlerFactory* http_auth_handler_factory_; |
232 ProxyService* proxy_service_; | 222 ProxyService* proxy_service_; |
233 scoped_refptr<SSLConfigService> ssl_config_service_; | 223 scoped_refptr<SSLConfigService> ssl_config_service_; |
234 NetworkDelegate* network_delegate_; | 224 NetworkDelegate* network_delegate_; |
235 HttpServerProperties* http_server_properties_; | 225 HttpServerProperties* http_server_properties_; |
236 scoped_refptr<CookieStore> cookie_store_; | 226 scoped_refptr<CookieStore> cookie_store_; |
237 TransportSecurityState* transport_security_state_; | 227 TransportSecurityState* transport_security_state_; |
238 scoped_ptr<FtpAuthCache> ftp_auth_cache_; | 228 scoped_ptr<FtpAuthCache> ftp_auth_cache_; |
239 std::string accept_language_; | 229 std::string accept_language_; |
240 std::string accept_charset_; | 230 std::string accept_charset_; |
241 // The charset of the referrer where this request comes from. It's not | 231 // The charset of the referrer where this request comes from. It's not |
242 // used in communication with a server but is used to construct a suggested | 232 // used in communication with a server but is used to construct a suggested |
243 // filename for file download. | 233 // filename for file download. |
244 std::string referrer_charset_; | 234 std::string referrer_charset_; |
245 HttpTransactionFactory* http_transaction_factory_; | 235 HttpTransactionFactory* http_transaction_factory_; |
246 FtpTransactionFactory* ftp_transaction_factory_; | 236 FtpTransactionFactory* ftp_transaction_factory_; |
247 const URLRequestJobFactory* job_factory_; | 237 const URLRequestJobFactory* job_factory_; |
248 | 238 |
249 // --------------------------------------------------------------------------- | 239 // --------------------------------------------------------------------------- |
250 // Important: When adding any new members below, consider whether they need to | 240 // Important: When adding any new members below, consider whether they need to |
251 // be added to CopyFrom. | 241 // be added to CopyFrom. |
252 // --------------------------------------------------------------------------- | 242 // --------------------------------------------------------------------------- |
253 | 243 |
254 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 244 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
255 }; | 245 }; |
256 | 246 |
257 } // namespace net | 247 } // namespace net |
258 | 248 |
259 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 249 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |