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

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

Issue 2542843006: ResourceLoader: Fix a bunch of double-cancellation/double-error notification cases. (Closed)
Patch Set: Move comment Created 4 years 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
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // Called after every raw read. If |bytes_read| is > 0, this indicates 353 // Called after every raw read. If |bytes_read| is > 0, this indicates
354 // a successful read of |bytes_read| unfiltered bytes. If |bytes_read| 354 // a successful read of |bytes_read| unfiltered bytes. If |bytes_read|
355 // is 0, this indicates that there is no additional data to read. 355 // is 0, this indicates that there is no additional data to read.
356 // If |bytes_read| is negative, no bytes were read. 356 // If |bytes_read| is negative, no bytes were read.
357 void GatherRawReadStats(int bytes_read); 357 void GatherRawReadStats(int bytes_read);
358 358
359 // Updates the profiling info and notifies observers that an additional 359 // Updates the profiling info and notifies observers that an additional
360 // |bytes_read| unfiltered bytes have been read for this job. 360 // |bytes_read| unfiltered bytes have been read for this job.
361 void RecordBytesRead(int bytes_read); 361 void RecordBytesRead(int bytes_read);
362 362
363 // NotifyDone marks that request is done. It is really a glorified 363 // OnDone marks that request is done. It is really a glorified
364 // set_status, but also does internal state checking and job tracking. It 364 // set_status, but also does internal state checking and job tracking. It
365 // should be called once per request, when the job is finished doing all IO. 365 // should be called once per request, when the job is finished doing all IO.
366 void NotifyDone(const URLRequestStatus& status); 366 //
367 // If |notify_done| is true, will notify the URLRequest of completion.
Randy Smith (Not in Mondays) 2016/12/06 23:44:43 I believe this is only done if the completion is i
mmenke 2016/12/07 16:17:15 Done.
368 // Otherwise, the caller will need to do this itself, possibly through a
369 // synchronous return value.
370 void OnDone(const URLRequestStatus& status, bool notify_done);
367 371
368 // Some work performed by NotifyDone must be completed asynchronously so 372 // Takes care of the notification initiated by OnDone() to avoid re-entering
369 // as to avoid re-entering URLRequest::Delegate. This method performs that 373 // the URLRequest::Delegate.
Randy Smith (Not in Mondays) 2016/12/06 23:44:43 I think some gesture to the PostTask or the asynch
mmenke 2016/12/07 16:17:15 Done.
370 // work. 374 void NotifyDone();
371 void CompleteNotifyDone();
372 375
373 // Subclasses may implement this method to record packet arrival times. 376 // Subclasses may implement this method to record packet arrival times.
374 // The default implementation does nothing. Only invoked when bytes have been 377 // The default implementation does nothing. Only invoked when bytes have been
375 // read since the last invocation. 378 // read since the last invocation.
376 virtual void UpdatePacketReadTimes(); 379 virtual void UpdatePacketReadTimes();
377 380
378 // Computes a new RedirectInfo based on receiving a redirect response of 381 // Computes a new RedirectInfo based on receiving a redirect response of
379 // |location| and |http_status_code|. 382 // |location| and |http_status_code|.
380 RedirectInfo ComputeRedirectInfo(const GURL& location, int http_status_code); 383 RedirectInfo ComputeRedirectInfo(const GURL& location, int http_status_code);
381 384
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 CompletionCallback read_raw_callback_; 437 CompletionCallback read_raw_callback_;
435 438
436 base::WeakPtrFactory<URLRequestJob> weak_factory_; 439 base::WeakPtrFactory<URLRequestJob> weak_factory_;
437 440
438 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); 441 DISALLOW_COPY_AND_ASSIGN(URLRequestJob);
439 }; 442 };
440 443
441 } // namespace net 444 } // namespace net
442 445
443 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ 446 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698