| 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/ftp/ftp_auth_cache.h" | 22 #include "net/ftp/ftp_auth_cache.h" |
| 23 #include "net/spdy/spdy_config_service.h" |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 class CertVerifier; | 26 class CertVerifier; |
| 26 class CookieStore; | 27 class CookieStore; |
| 27 class DnsCertProvenanceChecker; | 28 class DnsCertProvenanceChecker; |
| 28 class DnsRRResolver; | 29 class DnsRRResolver; |
| 29 class FtpTransactionFactory; | 30 class FtpTransactionFactory; |
| 30 class HostResolver; | 31 class HostResolver; |
| 31 class HttpAuthHandlerFactory; | 32 class HttpAuthHandlerFactory; |
| 32 class HttpTransactionFactory; | 33 class HttpTransactionFactory; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void set_dns_cert_checker(DnsCertProvenanceChecker* dns_cert_checker) { | 101 void set_dns_cert_checker(DnsCertProvenanceChecker* dns_cert_checker) { |
| 101 dns_cert_checker_ = dns_cert_checker; | 102 dns_cert_checker_ = dns_cert_checker; |
| 102 } | 103 } |
| 103 | 104 |
| 104 // Get the proxy service for this context. | 105 // Get the proxy service for this context. |
| 105 ProxyService* proxy_service() const { return proxy_service_; } | 106 ProxyService* proxy_service() const { return proxy_service_; } |
| 106 void set_proxy_service(ProxyService* proxy_service) { | 107 void set_proxy_service(ProxyService* proxy_service) { |
| 107 proxy_service_ = proxy_service; | 108 proxy_service_ = proxy_service; |
| 108 } | 109 } |
| 109 | 110 |
| 111 // Get the spdy config service for this context. |
| 112 SpdyConfigService* spdy_config_service() const { |
| 113 return spdy_config_service_; |
| 114 } |
| 115 void set_spdy_config_service(SpdyConfigService* service) { |
| 116 spdy_config_service_ = service; |
| 117 } |
| 118 |
| 110 // Get the ssl config service for this context. | 119 // Get the ssl config service for this context. |
| 111 SSLConfigService* ssl_config_service() const { return ssl_config_service_; } | 120 SSLConfigService* ssl_config_service() const { return ssl_config_service_; } |
| 112 void set_ssl_config_service(SSLConfigService* service) { | 121 void set_ssl_config_service(SSLConfigService* service) { |
| 113 ssl_config_service_ = service; | 122 ssl_config_service_ = service; |
| 114 } | 123 } |
| 115 | 124 |
| 116 // Gets the HTTP Authentication Handler Factory for this context. | 125 // Gets the HTTP Authentication Handler Factory for this context. |
| 117 // The factory is only valid for the lifetime of this URLRequestContext | 126 // The factory is only valid for the lifetime of this URLRequestContext |
| 118 HttpAuthHandlerFactory* http_auth_handler_factory() { | 127 HttpAuthHandlerFactory* http_auth_handler_factory() { |
| 119 return http_auth_handler_factory_; | 128 return http_auth_handler_factory_; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // Ownership for these members are not defined here. Clients should either | 213 // Ownership for these members are not defined here. Clients should either |
| 205 // provide storage elsewhere or have a subclass take ownership. | 214 // provide storage elsewhere or have a subclass take ownership. |
| 206 NetLog* net_log_; | 215 NetLog* net_log_; |
| 207 HostResolver* host_resolver_; | 216 HostResolver* host_resolver_; |
| 208 CertVerifier* cert_verifier_; | 217 CertVerifier* cert_verifier_; |
| 209 OriginBoundCertService* origin_bound_cert_service_; | 218 OriginBoundCertService* origin_bound_cert_service_; |
| 210 DnsRRResolver* dnsrr_resolver_; | 219 DnsRRResolver* dnsrr_resolver_; |
| 211 DnsCertProvenanceChecker* dns_cert_checker_; | 220 DnsCertProvenanceChecker* dns_cert_checker_; |
| 212 HttpAuthHandlerFactory* http_auth_handler_factory_; | 221 HttpAuthHandlerFactory* http_auth_handler_factory_; |
| 213 ProxyService* proxy_service_; | 222 ProxyService* proxy_service_; |
| 223 scoped_refptr<SpdyConfigService> spdy_config_service_; |
| 214 scoped_refptr<SSLConfigService> ssl_config_service_; | 224 scoped_refptr<SSLConfigService> ssl_config_service_; |
| 215 NetworkDelegate* network_delegate_; | 225 NetworkDelegate* network_delegate_; |
| 216 scoped_refptr<CookieStore> cookie_store_; | 226 scoped_refptr<CookieStore> cookie_store_; |
| 217 scoped_refptr<TransportSecurityState> transport_security_state_; | 227 scoped_refptr<TransportSecurityState> transport_security_state_; |
| 218 scoped_ptr<FtpAuthCache> ftp_auth_cache_; | 228 scoped_ptr<FtpAuthCache> ftp_auth_cache_; |
| 219 std::string accept_language_; | 229 std::string accept_language_; |
| 220 std::string accept_charset_; | 230 std::string accept_charset_; |
| 221 // 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 |
| 222 // 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 |
| 223 // filename for file download. | 233 // filename for file download. |
| 224 std::string referrer_charset_; | 234 std::string referrer_charset_; |
| 225 HttpTransactionFactory* http_transaction_factory_; | 235 HttpTransactionFactory* http_transaction_factory_; |
| 226 FtpTransactionFactory* ftp_transaction_factory_; | 236 FtpTransactionFactory* ftp_transaction_factory_; |
| 227 const URLRequestJobFactory* job_factory_; | 237 const URLRequestJobFactory* job_factory_; |
| 228 | 238 |
| 229 // --------------------------------------------------------------------------- | 239 // --------------------------------------------------------------------------- |
| 230 // 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 |
| 231 // be added to CopyFrom. | 241 // be added to CopyFrom. |
| 232 // --------------------------------------------------------------------------- | 242 // --------------------------------------------------------------------------- |
| 233 | 243 |
| 234 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 244 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
| 235 }; | 245 }; |
| 236 | 246 |
| 237 } // namespace net | 247 } // namespace net |
| 238 | 248 |
| 239 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 249 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |