diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 04:05:47 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 04:05:47 +0000 |
commit | 76dab22be9e8757b38c577d256a798ce4bd67ab4 (patch) | |
tree | 682f6d806a0161a599b6704db78555cbdbe8841c | |
parent | 10f2fe77460f38cad0013337a48ce7980868c78a (diff) | |
download | chromium_src-76dab22be9e8757b38c577d256a798ce4bd67ab4.zip chromium_src-76dab22be9e8757b38c577d256a798ce4bd67ab4.tar.gz chromium_src-76dab22be9e8757b38c577d256a798ce4bd67ab4.tar.bz2 |
Merge 84889 - 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
TBR=scr@chromium.org
Review URL: http://codereview.chromium.org/7002023
git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@84925 0039d316-1c4b-4281-b951-d872f2087c98
-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(), |