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 // 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_ |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "net/base/request_priority.h" | 22 #include "net/base/request_priority.h" |
23 #include "net/http/http_network_session.h" | 23 #include "net/http/http_network_session.h" |
24 #include "net/http/http_server_properties.h" | 24 #include "net/http/http_server_properties.h" |
25 #include "net/http/transport_security_state.h" | 25 #include "net/http/transport_security_state.h" |
26 #include "net/ssl/ssl_config_service.h" | 26 #include "net/ssl/ssl_config_service.h" |
27 #include "net/url_request/url_request.h" | 27 #include "net/url_request/url_request.h" |
28 | 28 |
29 namespace net { | 29 namespace net { |
30 class CertVerifier; | 30 class CertVerifier; |
31 class CookieStore; | 31 class CookieStore; |
| 32 class CTVerifier; |
32 class FraudulentCertificateReporter; | 33 class FraudulentCertificateReporter; |
33 class HostResolver; | 34 class HostResolver; |
34 class HttpAuthHandlerFactory; | 35 class HttpAuthHandlerFactory; |
35 class HttpTransactionFactory; | 36 class HttpTransactionFactory; |
36 class HttpUserAgentSettings; | 37 class HttpUserAgentSettings; |
37 class NetworkDelegate; | 38 class NetworkDelegate; |
38 class ServerBoundCertService; | 39 class ServerBoundCertService; |
39 class ProxyService; | 40 class ProxyService; |
40 class URLRequest; | 41 class URLRequest; |
41 class URLRequestJobFactory; | 42 class URLRequestJobFactory; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 base::WeakPtr<HttpServerProperties> http_server_properties() const { | 146 base::WeakPtr<HttpServerProperties> http_server_properties() const { |
146 return http_server_properties_; | 147 return http_server_properties_; |
147 } | 148 } |
148 | 149 |
149 // Gets the cookie store for this context (may be null, in which case | 150 // Gets the cookie store for this context (may be null, in which case |
150 // cookies are not stored). | 151 // cookies are not stored). |
151 CookieStore* cookie_store() const { return cookie_store_.get(); } | 152 CookieStore* cookie_store() const { return cookie_store_.get(); } |
152 void set_cookie_store(CookieStore* cookie_store); | 153 void set_cookie_store(CookieStore* cookie_store); |
153 | 154 |
154 TransportSecurityState* transport_security_state() const { | 155 TransportSecurityState* transport_security_state() const { |
155 return transport_security_state_; | 156 return transport_security_state_; |
156 } | 157 } |
157 void set_transport_security_state( | 158 void set_transport_security_state( |
158 TransportSecurityState* state) { | 159 TransportSecurityState* state) { |
159 transport_security_state_ = state; | 160 transport_security_state_ = state; |
160 } | 161 } |
161 | 162 |
| 163 CTVerifier* cert_transparency_verifier() const { |
| 164 return cert_transparency_verifier_; |
| 165 } |
| 166 void set_cert_transparency_verifier(CTVerifier* verifier) { |
| 167 cert_transparency_verifier_ = verifier; |
| 168 } |
| 169 |
162 // --------------------------------------------------------------------------- | 170 // --------------------------------------------------------------------------- |
163 // Legacy accessors that delegate to http_user_agent_settings_. | 171 // Legacy accessors that delegate to http_user_agent_settings_. |
164 // TODO(pauljensen): Remove after all clients are updated to directly access | 172 // TODO(pauljensen): Remove after all clients are updated to directly access |
165 // http_user_agent_settings_. | 173 // http_user_agent_settings_. |
166 // Gets the value of 'Accept-Language' header field. | 174 // Gets the value of 'Accept-Language' header field. |
167 std::string GetAcceptLanguage() const; | 175 std::string GetAcceptLanguage() const; |
168 // Gets the UA string to use for the given URL. Pass an invalid URL (such as | 176 // Gets the UA string to use for the given URL. Pass an invalid URL (such as |
169 // GURL()) to get the default UA string. | 177 // GURL()) to get the default UA string. |
170 std::string GetUserAgent(const GURL& url) const; | 178 std::string GetUserAgent(const GURL& url) const; |
171 // --------------------------------------------------------------------------- | 179 // --------------------------------------------------------------------------- |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 ServerBoundCertService* server_bound_cert_service_; | 223 ServerBoundCertService* server_bound_cert_service_; |
216 FraudulentCertificateReporter* fraudulent_certificate_reporter_; | 224 FraudulentCertificateReporter* fraudulent_certificate_reporter_; |
217 HttpAuthHandlerFactory* http_auth_handler_factory_; | 225 HttpAuthHandlerFactory* http_auth_handler_factory_; |
218 ProxyService* proxy_service_; | 226 ProxyService* proxy_service_; |
219 scoped_refptr<SSLConfigService> ssl_config_service_; | 227 scoped_refptr<SSLConfigService> ssl_config_service_; |
220 NetworkDelegate* network_delegate_; | 228 NetworkDelegate* network_delegate_; |
221 base::WeakPtr<HttpServerProperties> http_server_properties_; | 229 base::WeakPtr<HttpServerProperties> http_server_properties_; |
222 HttpUserAgentSettings* http_user_agent_settings_; | 230 HttpUserAgentSettings* http_user_agent_settings_; |
223 scoped_refptr<CookieStore> cookie_store_; | 231 scoped_refptr<CookieStore> cookie_store_; |
224 TransportSecurityState* transport_security_state_; | 232 TransportSecurityState* transport_security_state_; |
| 233 CTVerifier* cert_transparency_verifier_; |
225 HttpTransactionFactory* http_transaction_factory_; | 234 HttpTransactionFactory* http_transaction_factory_; |
226 const URLRequestJobFactory* job_factory_; | 235 const URLRequestJobFactory* job_factory_; |
227 URLRequestThrottlerManager* throttler_manager_; | 236 URLRequestThrottlerManager* throttler_manager_; |
228 | 237 |
229 // --------------------------------------------------------------------------- | 238 // --------------------------------------------------------------------------- |
230 // Important: When adding any new members below, consider whether they need to | 239 // Important: When adding any new members below, consider whether they need to |
231 // be added to CopyFrom. | 240 // be added to CopyFrom. |
232 // --------------------------------------------------------------------------- | 241 // --------------------------------------------------------------------------- |
233 | 242 |
234 scoped_ptr<std::set<const URLRequest*> > url_requests_; | 243 scoped_ptr<std::set<const URLRequest*> > url_requests_; |
235 | 244 |
236 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 245 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
237 }; | 246 }; |
238 | 247 |
239 } // namespace net | 248 } // namespace net |
240 | 249 |
241 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 250 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |