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 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 class BlobURLRequestJobTest; | 76 class BlobURLRequestJobTest; |
77 } | 77 } |
78 | 78 |
79 namespace net { | 79 namespace net { |
80 | 80 |
81 class CookieList; | 81 class CookieList; |
82 class CookieOptions; | 82 class CookieOptions; |
83 class HostPortPair; | 83 class HostPortPair; |
84 class IOBuffer; | 84 class IOBuffer; |
85 class SSLCertRequestInfo; | 85 class SSLCertRequestInfo; |
| 86 class SSLInfo; |
86 class UploadData; | 87 class UploadData; |
87 class URLRequestContext; | 88 class URLRequestContext; |
88 class URLRequestJob; | 89 class URLRequestJob; |
89 class X509Certificate; | 90 class X509Certificate; |
90 | 91 |
91 // This stores the values of the Set-Cookie headers received during the request. | 92 // This stores the values of the Set-Cookie headers received during the request. |
92 // Each item in the vector corresponds to a Set-Cookie: line received, | 93 // Each item in the vector corresponds to a Set-Cookie: line received, |
93 // excluding the "Set-Cookie:" part. | 94 // excluding the "Set-Cookie:" part. |
94 typedef std::vector<std::string> ResponseCookies; | 95 typedef std::vector<std::string> ResponseCookies; |
95 | 96 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 virtual void OnCertificateRequested( | 260 virtual void OnCertificateRequested( |
260 URLRequest* request, | 261 URLRequest* request, |
261 SSLCertRequestInfo* cert_request_info); | 262 SSLCertRequestInfo* cert_request_info); |
262 | 263 |
263 // Called when using SSL and the server responds with a certificate with | 264 // Called when using SSL and the server responds with a certificate with |
264 // an error, for example, whose common name does not match the common name | 265 // an error, for example, whose common name does not match the common name |
265 // we were expecting for that host. The delegate should either do the | 266 // we were expecting for that host. The delegate should either do the |
266 // safe thing and Cancel() the request or decide to proceed by calling | 267 // safe thing and Cancel() the request or decide to proceed by calling |
267 // ContinueDespiteLastError(). cert_error is a ERR_* error code | 268 // ContinueDespiteLastError(). cert_error is a ERR_* error code |
268 // indicating what's wrong with the certificate. | 269 // indicating what's wrong with the certificate. |
| 270 // If |is_hsts_host| is true then the host in question is an HSTS host |
| 271 // which demands a higher level of security. In this case, errors must not |
| 272 // be bypassable by the user. |
269 virtual void OnSSLCertificateError(URLRequest* request, | 273 virtual void OnSSLCertificateError(URLRequest* request, |
270 int cert_error, | 274 const SSLInfo& ssl_info, |
271 X509Certificate* cert); | 275 bool is_hsts_host); |
272 | 276 |
273 // Called when reading cookies to allow the delegate to block access to the | 277 // Called when reading cookies to allow the delegate to block access to the |
274 // cookie. This method will never be invoked when LOAD_DO_NOT_SEND_COOKIES | 278 // cookie. This method will never be invoked when LOAD_DO_NOT_SEND_COOKIES |
275 // is specified. | 279 // is specified. |
276 virtual bool CanGetCookies(const URLRequest* request, | 280 virtual bool CanGetCookies(const URLRequest* request, |
277 const CookieList& cookie_list) const; | 281 const CookieList& cookie_list) const; |
278 | 282 |
279 // Called when a cookie is set to allow the delegate to block access to the | 283 // Called when a cookie is set to allow the delegate to block access to the |
280 // cookie. This method will never be invoked when LOAD_DO_NOT_SAVE_COOKIES | 284 // cookie. This method will never be invoked when LOAD_DO_NOT_SAVE_COOKIES |
281 // is specified. | 285 // is specified. |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 // occurs. | 710 // occurs. |
707 void NotifyResponseStarted(); | 711 void NotifyResponseStarted(); |
708 | 712 |
709 bool has_delegate() const { return delegate_ != NULL; } | 713 bool has_delegate() const { return delegate_ != NULL; } |
710 | 714 |
711 // These functions delegate to |delegate_| and may only be used if | 715 // These functions delegate to |delegate_| and may only be used if |
712 // |delegate_| is not NULL. See URLRequest::Delegate for the meaning | 716 // |delegate_| is not NULL. See URLRequest::Delegate for the meaning |
713 // of these functions. | 717 // of these functions. |
714 void NotifyAuthRequired(AuthChallengeInfo* auth_info); | 718 void NotifyAuthRequired(AuthChallengeInfo* auth_info); |
715 void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info); | 719 void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info); |
716 void NotifySSLCertificateError(int cert_error, X509Certificate* cert); | 720 void NotifySSLCertificateError(const SSLInfo& ssl_info, |
| 721 bool is_hsts_host); |
717 bool CanGetCookies(const CookieList& cookie_list) const; | 722 bool CanGetCookies(const CookieList& cookie_list) const; |
718 bool CanSetCookie(const std::string& cookie_line, | 723 bool CanSetCookie(const std::string& cookie_line, |
719 CookieOptions* options) const; | 724 CookieOptions* options) const; |
720 void NotifyReadCompleted(int bytes_read); | 725 void NotifyReadCompleted(int bytes_read); |
721 | 726 |
722 // Called when the delegate blocks or unblocks this request when intercepting | 727 // Called when the delegate blocks or unblocks this request when intercepting |
723 // certain requests. | 728 // certain requests. |
724 void SetBlockedOnDelegate(); | 729 void SetBlockedOnDelegate(); |
725 void SetUnblockedOnDelegate(); | 730 void SetUnblockedOnDelegate(); |
726 | 731 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 // messages to network delegate. | 807 // messages to network delegate. |
803 // TODO(battre): Remove this. http://crbug.com/89049 | 808 // TODO(battre): Remove this. http://crbug.com/89049 |
804 bool has_notified_completion_; | 809 bool has_notified_completion_; |
805 | 810 |
806 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 811 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
807 }; | 812 }; |
808 | 813 |
809 } // namespace net | 814 } // namespace net |
810 | 815 |
811 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 816 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |