diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 23:15:53 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 23:15:53 +0000 |
commit | b689eb4590b72175a73736d90989009a1f4e6fbc (patch) | |
tree | f7d6c7d7e396f36ac5b72b4ca6d8179018dbbca2 /content/browser/cancelable_request.h | |
parent | 16c306a456907d56beccb10c6c7116d83da3e8fd (diff) | |
download | chromium_src-b689eb4590b72175a73736d90989009a1f4e6fbc.zip chromium_src-b689eb4590b72175a73736d90989009a1f4e6fbc.tar.gz chromium_src-b689eb4590b72175a73736d90989009a1f4e6fbc.tar.bz2 |
Let CancelableRequest Execute callbacks which do delete this.
By checking canceled() again before calling NotifyCompleted, we avoid
assumptions that we're not canceled from the callback. This solves 2 issues:
1) The NOTREACHED in the provider which tries to remove the pending_request.
2) Trying to call DidExecute on a deleted consumer_.
BUG=77777, 82156
R=sky@chromium.org
TEST=python chrome/test/functional/imports.py imports.ImportsTest.testImportFirefoxDataTwice
Review URL: http://codereview.chromium.org/7001015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/cancelable_request.h')
-rw-r--r-- | content/browser/cancelable_request.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/content/browser/cancelable_request.h b/content/browser/cancelable_request.h index 009ca98..769439f 100644 --- a/content/browser/cancelable_request.h +++ b/content/browser/cancelable_request.h @@ -659,11 +659,13 @@ class CancelableRequest : public CancelableRequestBase { // Execute the callback. callback_->RunWithParams(param); + } - // Notify the provider that the request is complete. The provider will - // notify the consumer for us. + // Notify the provider that the request is complete. The provider will + // notify the consumer for us. Note that it is possible for the callback to + // cancel this request; we must check canceled again. + if (!canceled_.IsSet()) NotifyCompleted(); - } } // This should only be executed if !canceled_.IsSet(), |