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 #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 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // true with zero bytes read, it indicates the end of the response. | 142 // true with zero bytes read, it indicates the end of the response. |
143 // | 143 // |
144 class NET_EXPORT Delegate { | 144 class NET_EXPORT Delegate { |
145 public: | 145 public: |
146 // Called upon receiving a redirect. The delegate may call the request's | 146 // Called upon receiving a redirect. The delegate may call the request's |
147 // Cancel method to prevent the redirect from being followed. Since there | 147 // Cancel method to prevent the redirect from being followed. Since there |
148 // may be multiple chained redirects, there may also be more than one | 148 // may be multiple chained redirects, there may also be more than one |
149 // redirect call. | 149 // redirect call. |
150 // | 150 // |
151 // When this function is called, the request will still contain the | 151 // When this function is called, the request will still contain the |
152 // original URL, the destination of the redirect is provided in 'new_url'. | 152 // original URL, the destination of the redirect is provided in |
153 // If the delegate does not cancel the request and |*defer_redirect| is | 153 // |redirect_info.new_url|. If the delegate does not cancel the request |
154 // false, then the redirect will be followed, and the request's URL will be | 154 // and |*defer_redirect| is false, then the redirect will be followed, and |
155 // changed to the new URL. Otherwise if the delegate does not cancel the | 155 // the request's URL will be changed to the new URL. Otherwise if the |
156 // request and |*defer_redirect| is true, then the redirect will be | 156 // delegate does not cancel the request and |*defer_redirect| is true, then |
157 // followed once FollowDeferredRedirect is called on the URLRequest. | 157 // the redirect will be followed once FollowDeferredRedirect is called |
| 158 // on the URLRequest. |
158 // | 159 // |
159 // The caller must set |*defer_redirect| to false, so that delegates do not | 160 // The caller must set |*defer_redirect| to false, so that delegates do not |
160 // need to set it if they are happy with the default behavior of not | 161 // need to set it if they are happy with the default behavior of not |
161 // deferring redirect. | 162 // deferring redirect. |
162 virtual void OnReceivedRedirect(URLRequest* request, | 163 virtual void OnReceivedRedirect(URLRequest* request, |
163 const RedirectInfo& redirect_info, | 164 const RedirectInfo& redirect_info, |
164 bool* defer_redirect); | 165 bool* defer_redirect); |
165 | 166 |
166 // Called when we receive an authentication failure. The delegate should | 167 // Called when we receive an authentication failure. The delegate should |
167 // call request->SetAuth() with the user's credentials once it obtains them, | 168 // call request->SetAuth() with the user's credentials once it obtains them, |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 HostPortPair proxy_server_; | 873 HostPortPair proxy_server_; |
873 | 874 |
874 std::unique_ptr<const base::debug::StackTrace> stack_trace_; | 875 std::unique_ptr<const base::debug::StackTrace> stack_trace_; |
875 | 876 |
876 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 877 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
877 }; | 878 }; |
878 | 879 |
879 } // namespace net | 880 } // namespace net |
880 | 881 |
881 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 882 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |