| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // Called when using SSL and the server responds with a certificate with | 181 // Called when using SSL and the server responds with a certificate with |
| 182 // an error, for example, whose common name does not match the common name | 182 // an error, for example, whose common name does not match the common name |
| 183 // we were expecting for that host. The delegate should either do the | 183 // we were expecting for that host. The delegate should either do the |
| 184 // safe thing and Cancel() the request or decide to proceed by calling | 184 // safe thing and Cancel() the request or decide to proceed by calling |
| 185 // ContinueDespiteLastError(). cert_error is a ERR_* error code | 185 // ContinueDespiteLastError(). cert_error is a ERR_* error code |
| 186 // indicating what's wrong with the certificate. | 186 // indicating what's wrong with the certificate. |
| 187 virtual void OnSSLCertificateError(URLRequest* request, | 187 virtual void OnSSLCertificateError(URLRequest* request, |
| 188 int cert_error, | 188 int cert_error, |
| 189 X509Certificate* cert); | 189 X509Certificate* cert); |
| 190 | 190 |
| 191 // Called when reading cookies. |blocked_by_policy| is true if access to | 191 // Called when reading cookies to allow the delegate to block access to the |
| 192 // cookies was denied due to content settings. This method will never be | 192 // cookie. This method will never be invoked when LOAD_DO_NOT_SEND_COOKIES |
| 193 // invoked when LOAD_DO_NOT_SEND_COOKIES is specified. | 193 // is specified. |
| 194 virtual void OnGetCookies(URLRequest* request, bool blocked_by_policy); | 194 virtual bool CanGetCookies(URLRequest* request); |
| 195 | 195 |
| 196 // Called when a cookie is set. |blocked_by_policy| is true if the cookie | 196 // Called when a cookie is set to allow the delegate to block access to the |
| 197 // was rejected due to content settings. This method will never be invoked | 197 // cookie. This method will never be invoked when LOAD_DO_NOT_SAVE_COOKIES |
| 198 // when LOAD_DO_NOT_SAVE_COOKIES is specified. | 198 // is specified. |
| 199 virtual void OnSetCookie(URLRequest* request, | 199 virtual bool CanSetCookie(URLRequest* request, |
| 200 const std::string& cookie_line, | 200 const std::string& cookie_line, |
| 201 const CookieOptions& options, | 201 CookieOptions* options); |
| 202 bool blocked_by_policy); | |
| 203 | 202 |
| 204 // After calling Start(), the delegate will receive an OnResponseStarted | 203 // After calling Start(), the delegate will receive an OnResponseStarted |
| 205 // callback when the request has completed. If an error occurred, the | 204 // callback when the request has completed. If an error occurred, the |
| 206 // request->status() will be set. On success, all redirects have been | 205 // request->status() will be set. On success, all redirects have been |
| 207 // followed and the final response is beginning to arrive. At this point, | 206 // followed and the final response is beginning to arrive. At this point, |
| 208 // meta data about the response is available, including for example HTTP | 207 // meta data about the response is available, including for example HTTP |
| 209 // response headers if this is a request for a HTTP resource. | 208 // response headers if this is a request for a HTTP resource. |
| 210 virtual void OnResponseStarted(URLRequest* request) = 0; | 209 virtual void OnResponseStarted(URLRequest* request) = 0; |
| 211 | 210 |
| 212 // Called when the a Read of the response body is completed after an | 211 // Called when the a Read of the response body is completed after an |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 // Callback passed to the network delegate to notify us when a blocked request | 670 // Callback passed to the network delegate to notify us when a blocked request |
| 672 // is ready to be resumed or canceled. | 671 // is ready to be resumed or canceled. |
| 673 CompletionCallbackImpl<URLRequest> before_request_callback_; | 672 CompletionCallbackImpl<URLRequest> before_request_callback_; |
| 674 | 673 |
| 675 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 674 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 676 }; | 675 }; |
| 677 | 676 |
| 678 } // namespace net | 677 } // namespace net |
| 679 | 678 |
| 680 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 679 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |