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_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 virtual void SetAuth(const AuthCredentials& credentials); | 172 virtual void SetAuth(const AuthCredentials& credentials); |
173 | 173 |
174 // Display the error page without asking for credentials again. | 174 // Display the error page without asking for credentials again. |
175 virtual void CancelAuth(); | 175 virtual void CancelAuth(); |
176 | 176 |
177 virtual void ContinueWithCertificate(X509Certificate* client_cert); | 177 virtual void ContinueWithCertificate(X509Certificate* client_cert); |
178 | 178 |
179 // Continue processing the request ignoring the last error. | 179 // Continue processing the request ignoring the last error. |
180 virtual void ContinueDespiteLastError(); | 180 virtual void ContinueDespiteLastError(); |
181 | 181 |
| 182 // Continue with the network request. |
| 183 virtual void ResumeNetworkStart(); |
| 184 |
182 void FollowDeferredRedirect(); | 185 void FollowDeferredRedirect(); |
183 | 186 |
184 // Returns true if the Job is done producing response data and has called | 187 // Returns true if the Job is done producing response data and has called |
185 // NotifyDone on the request. | 188 // NotifyDone on the request. |
186 bool is_done() const { return done_; } | 189 bool is_done() const { return done_; } |
187 | 190 |
188 // Get/Set expected content size | 191 // Get/Set expected content size |
189 int64 expected_content_size() const { return expected_content_size_; } | 192 int64 expected_content_size() const { return expected_content_size_; } |
190 void set_expected_content_size(const int64& size) { | 193 void set_expected_content_size(const int64& size) { |
191 expected_content_size_ = size; | 194 expected_content_size_ = size; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Delegates to URLRequest::Delegate. | 228 // Delegates to URLRequest::Delegate. |
226 bool CanGetCookies(const CookieList& cookie_list) const; | 229 bool CanGetCookies(const CookieList& cookie_list) const; |
227 | 230 |
228 // Delegates to URLRequest::Delegate. | 231 // Delegates to URLRequest::Delegate. |
229 bool CanSetCookie(const std::string& cookie_line, | 232 bool CanSetCookie(const std::string& cookie_line, |
230 CookieOptions* options) const; | 233 CookieOptions* options) const; |
231 | 234 |
232 // Delegates to URLRequest::Delegate. | 235 // Delegates to URLRequest::Delegate. |
233 bool CanEnablePrivacyMode() const; | 236 bool CanEnablePrivacyMode() const; |
234 | 237 |
| 238 // Notifies the job that the network is about to be used. |
| 239 void NotifyBeforeNetworkStart(bool* defer); |
| 240 |
235 // Notifies the job that headers have been received. | 241 // Notifies the job that headers have been received. |
236 void NotifyHeadersComplete(); | 242 void NotifyHeadersComplete(); |
237 | 243 |
238 // Notifies the request that the job has completed a Read operation. | 244 // Notifies the request that the job has completed a Read operation. |
239 void NotifyReadComplete(int bytes_read); | 245 void NotifyReadComplete(int bytes_read); |
240 | 246 |
241 // Notifies the request that a start error has occurred. | 247 // Notifies the request that a start error has occurred. |
242 void NotifyStartError(const URLRequestStatus& status); | 248 void NotifyStartError(const URLRequestStatus& status); |
243 | 249 |
244 // NotifyDone marks when we are done with a request. It is really | 250 // NotifyDone marks when we are done with a request. It is really |
245 // a glorified set_status, but also does internal state checking and | 251 // a glorified set_status, but also does internal state checking and |
246 // job tracking. It should be called once per request, when the job is | 252 // job tracking. It should be called once per request, when the job is |
247 // finished doing all IO. | 253 // finished doing all IO. |
248 void NotifyDone(const URLRequestStatus& status); | 254 void NotifyDone(const URLRequestStatus& status); |
249 | 255 |
250 // Some work performed by NotifyDone must be completed on a separate task | 256 // Some work performed by NotifyDone must be completed on a separate task |
251 // so as to avoid re-entering the delegate. This method exists to perform | 257 // so as to avoid re-entering the delegate. This method exists to perform |
252 // that work. | 258 // that work. |
253 void CompleteNotifyDone(); | 259 void CompleteNotifyDone(); |
254 | 260 |
255 // Used as an asynchronous callback for Kill to notify the URLRequest | 261 // Used as an asynchronous callback for Kill to notify the URLRequest |
256 // that we were canceled. | 262 // that we were canceled. |
257 void NotifyCanceled(); | 263 void NotifyCanceled(); |
258 | 264 |
259 // Notifies the job the request should be restarted. | 265 // Notifies the job the request should be restarted. |
260 // Should only be called if the job has not started a resposne. | 266 // Should only be called if the job has not started a response. |
261 void NotifyRestartRequired(); | 267 void NotifyRestartRequired(); |
262 | 268 |
263 // See corresponding functions in url_request.h. | 269 // See corresponding functions in url_request.h. |
264 void OnCallToDelegate(); | 270 void OnCallToDelegate(); |
265 void OnCallToDelegateComplete(); | 271 void OnCallToDelegateComplete(); |
266 | 272 |
267 // Called to read raw (pre-filtered) data from this Job. | 273 // Called to read raw (pre-filtered) data from this Job. |
268 // If returning true, data was read from the job. buf will contain | 274 // If returning true, data was read from the job. buf will contain |
269 // the data, and bytes_read will receive the number of bytes read. | 275 // the data, and bytes_read will receive the number of bytes read. |
270 // If returning true, and bytes_read is returned as 0, there is no | 276 // If returning true, and bytes_read is returned as 0, there is no |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 NetworkDelegate* network_delegate_; | 404 NetworkDelegate* network_delegate_; |
399 | 405 |
400 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 406 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
401 | 407 |
402 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 408 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
403 }; | 409 }; |
404 | 410 |
405 } // namespace net | 411 } // namespace net |
406 | 412 |
407 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 413 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |