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

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

Issue 122453002: Allows deferral of a URLRequest just before talking to the network, at (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated content-length in test to actual length Created 6 years, 11 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
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698