Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: net/url_request/url_request.h

Issue 7976036: net: make HSTS hosts use the normal SSL interstitials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 |must_be_fatal| 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 int cert_error,
271 X509Certificate* cert); 275 const SSLInfo& ssl_info,
276 bool must_be_fatal);
wtc 2011/09/23 00:04:51 The cert_error argument should be removed because
272 277
273 // Called when reading cookies to allow the delegate to block access to the 278 // 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 279 // cookie. This method will never be invoked when LOAD_DO_NOT_SEND_COOKIES
275 // is specified. 280 // is specified.
276 virtual bool CanGetCookies(const URLRequest* request, 281 virtual bool CanGetCookies(const URLRequest* request,
277 const CookieList& cookie_list) const; 282 const CookieList& cookie_list) const;
278 283
279 // Called when a cookie is set to allow the delegate to block access to the 284 // 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 285 // cookie. This method will never be invoked when LOAD_DO_NOT_SAVE_COOKIES
281 // is specified. 286 // is specified.
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // occurs. 711 // occurs.
707 void NotifyResponseStarted(); 712 void NotifyResponseStarted();
708 713
709 bool has_delegate() const { return delegate_ != NULL; } 714 bool has_delegate() const { return delegate_ != NULL; }
710 715
711 // These functions delegate to |delegate_| and may only be used if 716 // These functions delegate to |delegate_| and may only be used if
712 // |delegate_| is not NULL. See URLRequest::Delegate for the meaning 717 // |delegate_| is not NULL. See URLRequest::Delegate for the meaning
713 // of these functions. 718 // of these functions.
714 void NotifyAuthRequired(AuthChallengeInfo* auth_info); 719 void NotifyAuthRequired(AuthChallengeInfo* auth_info);
715 void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info); 720 void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info);
716 void NotifySSLCertificateError(int cert_error, X509Certificate* cert); 721 void NotifySSLCertificateError(int cert_error,
722 const SSLInfo& ssl_info,
723 bool must_be_fatal);
717 bool CanGetCookies(const CookieList& cookie_list) const; 724 bool CanGetCookies(const CookieList& cookie_list) const;
718 bool CanSetCookie(const std::string& cookie_line, 725 bool CanSetCookie(const std::string& cookie_line,
719 CookieOptions* options) const; 726 CookieOptions* options) const;
720 void NotifyReadCompleted(int bytes_read); 727 void NotifyReadCompleted(int bytes_read);
721 728
722 // Called when the delegate blocks or unblocks this request when intercepting 729 // Called when the delegate blocks or unblocks this request when intercepting
723 // certain requests. 730 // certain requests.
724 void SetBlockedOnDelegate(); 731 void SetBlockedOnDelegate();
725 void SetUnblockedOnDelegate(); 732 void SetUnblockedOnDelegate();
726 733
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 // messages to network delegate. 809 // messages to network delegate.
803 // TODO(battre): Remove this. http://crbug.com/89049 810 // TODO(battre): Remove this. http://crbug.com/89049
804 bool has_notified_completion_; 811 bool has_notified_completion_;
805 812
806 DISALLOW_COPY_AND_ASSIGN(URLRequest); 813 DISALLOW_COPY_AND_ASSIGN(URLRequest);
807 }; 814 };
808 815
809 } // namespace net 816 } // namespace net
810 817
811 #endif // NET_URL_REQUEST_URL_REQUEST_H_ 818 #endif // NET_URL_REQUEST_URL_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698