diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 09:14:13 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 09:14:13 +0000 |
commit | b87f4ef74c6b953a1fdb05850791ee32b567af9e (patch) | |
tree | 23efff54db7ea1f5f8fa11d8e59eb4d8de3c431f /net/url_request | |
parent | cb97074ea5afc99060aaa30e76a061e25ae1c6b2 (diff) | |
download | chromium_src-b87f4ef74c6b953a1fdb05850791ee32b567af9e.zip chromium_src-b87f4ef74c6b953a1fdb05850791ee32b567af9e.tar.gz chromium_src-b87f4ef74c6b953a1fdb05850791ee32b567af9e.tar.bz2 |
Fix the comment for URLRequest::Cancel().
Its original comment says it will never call any methods of the
delegate after Cancel() is made, including during the call to
Cancel itself, but the actual code eventually calls delegate's
OnReadCompleted if 1) the response has been handled, 2) the
request is still alive, 3) the request has not been marked success
and 4) it has a live delegate.
(It looks like we could set the delegate to null somewhere in the Cancel(),
but changing the code is scary and I'm not 100% sure if it's the right
behavior.)
The call path:
URLRequest::Cancel()
-> URLRequest::DoCancel()
-> URLRequestJob::Kill()
-> URLRequestJob::NotifyCanceled()
-> URLRequestJob::CompleteNotifyDone()
-> request_->delegate()->OnReadCompleted()
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6732017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index f42e60b..5cf3427 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -471,7 +471,8 @@ class URLRequest : public base::NonThreadSafe { // cancel the request. This method may be called many times, and it has // no effect once the response has completed. It is guaranteed that no // methods of the delegate will be called after the request has been - // cancelled, including during the call to Cancel itself. + // cancelled, except that this may call the delegate's OnReadCompleted() + // during the call to Cancel itself. void Cancel(); // Cancels the request and sets the error to |os_error| (see net_error_list.h |