OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/non_thread_safe.h" | 14 #include "base/non_thread_safe.h" |
15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
16 #include "net/base/net_log.h" | 16 #include "net/base/net_log.h" |
17 #include "net/base/ssl_config_service.h" | 17 #include "net/base/ssl_config_service.h" |
18 #include "net/base/transport_security_state.h" | 18 #include "net/base/transport_security_state.h" |
19 #include "net/ftp/ftp_auth_cache.h" | 19 #include "net/ftp/ftp_auth_cache.h" |
20 #include "net/proxy/proxy_service.h" | 20 #include "net/proxy/proxy_service.h" |
21 #include "net/socket/dns_cert_provenance_checker.h" | 21 #include "net/socket/dns_cert_provenance_checker.h" |
22 | 22 |
23 namespace net { | 23 namespace net { |
| 24 class CertVerifier; |
24 class CookiePolicy; | 25 class CookiePolicy; |
25 class CookieStore; | 26 class CookieStore; |
26 class DnsCertProvenanceChecker; | 27 class DnsCertProvenanceChecker; |
27 class DnsRRResolver; | 28 class DnsRRResolver; |
28 class FtpTransactionFactory; | 29 class FtpTransactionFactory; |
29 class HostResolver; | 30 class HostResolver; |
30 class HttpAuthHandlerFactory; | 31 class HttpAuthHandlerFactory; |
31 class HttpNetworkDelegate; | 32 class HttpNetworkDelegate; |
32 class HttpTransactionFactory; | 33 class HttpTransactionFactory; |
33 class SSLConfigService; | 34 class SSLConfigService; |
34 class URLRequest; | 35 class URLRequest; |
35 } // namespace net | 36 } // namespace net |
36 | 37 |
37 // Subclass to provide application-specific context for net::URLRequest | 38 // Subclass to provide application-specific context for net::URLRequest |
38 // instances. | 39 // instances. |
39 class URLRequestContext | 40 class URLRequestContext |
40 : public base::RefCountedThreadSafe<URLRequestContext>, | 41 : public base::RefCountedThreadSafe<URLRequestContext>, |
41 public NonThreadSafe { | 42 public NonThreadSafe { |
42 public: | 43 public: |
43 URLRequestContext(); | 44 URLRequestContext(); |
44 | 45 |
45 net::NetLog* net_log() const { | 46 net::NetLog* net_log() const { |
46 return net_log_; | 47 return net_log_; |
47 } | 48 } |
48 | 49 |
49 net::HostResolver* host_resolver() const { | 50 net::HostResolver* host_resolver() const { |
50 return host_resolver_; | 51 return host_resolver_; |
51 } | 52 } |
52 | 53 |
| 54 net::CertVerifier* cert_verifier() const { |
| 55 return cert_verifier_; |
| 56 } |
| 57 |
53 net::DnsRRResolver* dnsrr_resolver() const { | 58 net::DnsRRResolver* dnsrr_resolver() const { |
54 return dnsrr_resolver_; | 59 return dnsrr_resolver_; |
55 } | 60 } |
56 | 61 |
57 net::DnsCertProvenanceChecker* dns_cert_checker() const { | 62 net::DnsCertProvenanceChecker* dns_cert_checker() const { |
58 return dns_cert_checker_.get(); | 63 return dns_cert_checker_.get(); |
59 } | 64 } |
60 | 65 |
61 // Get the proxy service for this context. | 66 // Get the proxy service for this context. |
62 net::ProxyService* proxy_service() const { | 67 net::ProxyService* proxy_service() const { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 128 |
124 protected: | 129 protected: |
125 friend class base::RefCountedThreadSafe<URLRequestContext>; | 130 friend class base::RefCountedThreadSafe<URLRequestContext>; |
126 | 131 |
127 virtual ~URLRequestContext(); | 132 virtual ~URLRequestContext(); |
128 | 133 |
129 // The following members are expected to be initialized and owned by | 134 // The following members are expected to be initialized and owned by |
130 // subclasses. | 135 // subclasses. |
131 net::NetLog* net_log_; | 136 net::NetLog* net_log_; |
132 net::HostResolver* host_resolver_; | 137 net::HostResolver* host_resolver_; |
| 138 net::CertVerifier* cert_verifier_; |
133 net::DnsRRResolver* dnsrr_resolver_; | 139 net::DnsRRResolver* dnsrr_resolver_; |
134 scoped_ptr<net::DnsCertProvenanceChecker> dns_cert_checker_; | 140 scoped_ptr<net::DnsCertProvenanceChecker> dns_cert_checker_; |
135 scoped_refptr<net::ProxyService> proxy_service_; | 141 scoped_refptr<net::ProxyService> proxy_service_; |
136 scoped_refptr<net::SSLConfigService> ssl_config_service_; | 142 scoped_refptr<net::SSLConfigService> ssl_config_service_; |
137 net::HttpTransactionFactory* http_transaction_factory_; | 143 net::HttpTransactionFactory* http_transaction_factory_; |
138 net::FtpTransactionFactory* ftp_transaction_factory_; | 144 net::FtpTransactionFactory* ftp_transaction_factory_; |
139 net::HttpAuthHandlerFactory* http_auth_handler_factory_; | 145 net::HttpAuthHandlerFactory* http_auth_handler_factory_; |
140 net::HttpNetworkDelegate* network_delegate_; | 146 net::HttpNetworkDelegate* network_delegate_; |
141 scoped_refptr<net::CookieStore> cookie_store_; | 147 scoped_refptr<net::CookieStore> cookie_store_; |
142 net::CookiePolicy* cookie_policy_; | 148 net::CookiePolicy* cookie_policy_; |
143 scoped_refptr<net::TransportSecurityState> transport_security_state_; | 149 scoped_refptr<net::TransportSecurityState> transport_security_state_; |
144 net::FtpAuthCache ftp_auth_cache_; | 150 net::FtpAuthCache ftp_auth_cache_; |
145 std::string accept_language_; | 151 std::string accept_language_; |
146 std::string accept_charset_; | 152 std::string accept_charset_; |
147 // The charset of the referrer where this request comes from. It's not | 153 // The charset of the referrer where this request comes from. It's not |
148 // used in communication with a server but is used to construct a suggested | 154 // used in communication with a server but is used to construct a suggested |
149 // filename for file download. | 155 // filename for file download. |
150 std::string referrer_charset_; | 156 std::string referrer_charset_; |
151 | 157 |
152 private: | 158 private: |
153 // Indicates whether or not this is the main URLRequestContext. | 159 // Indicates whether or not this is the main URLRequestContext. |
154 bool is_main_; | 160 bool is_main_; |
155 | 161 |
156 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 162 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
157 }; | 163 }; |
158 | 164 |
159 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 165 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |