diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-07 05:15:44 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-07 05:15:44 +0000 |
commit | df16ed24d3cdb487fa37b7b8cb5d6c74926a95dd (patch) | |
tree | 8ee7f6e768e9b4a4ae1aaf2233c03ea6d96c38a7 /webkit/blob/view_blob_internals_job.cc | |
parent | ad25e60d2adfd1eab3d6a56cba82ec864d6db1fc (diff) | |
download | chromium_src-df16ed24d3cdb487fa37b7b8cb5d6c74926a95dd.zip chromium_src-df16ed24d3cdb487fa37b7b8cb5d6c74926a95dd.tar.gz chromium_src-df16ed24d3cdb487fa37b7b8cb5d6c74926a95dd.tar.bz2 |
Fix webkit URLRequestJob subtypes to handle Kill() correctly.
Kill() should prevent calling back into the delegate. So we cancel pending callbacks.
BUG=63692
TEST=existing
Review URL: http://codereview.chromium.org/5545003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob/view_blob_internals_job.cc')
-rw-r--r-- | webkit/blob/view_blob_internals_job.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/webkit/blob/view_blob_internals_job.cc b/webkit/blob/view_blob_internals_job.cc index 6d6955b..49798b4 100644 --- a/webkit/blob/view_blob_internals_job.cc +++ b/webkit/blob/view_blob_internals_job.cc @@ -4,6 +4,7 @@ #include "webkit/blob/view_blob_internals_job.h" +#include "base/compiler_specific.h" #include "base/logging.h" #include "base/format_macros.h" #include "base/i18n/number_formatting.h" @@ -102,15 +103,17 @@ namespace webkit_blob { ViewBlobInternalsJob::ViewBlobInternalsJob( net::URLRequest* request, BlobStorageController* blob_storage_controller) : URLRequestSimpleJob(request), - blob_storage_controller_(blob_storage_controller) { + blob_storage_controller_(blob_storage_controller), + ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { } ViewBlobInternalsJob::~ViewBlobInternalsJob() { } void ViewBlobInternalsJob::Start() { - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( - this, &ViewBlobInternalsJob::DoWorkAsync)); + MessageLoop::current()->PostTask( + FROM_HERE, + method_factory_.NewRunnableMethod(&ViewBlobInternalsJob::DoWorkAsync)); } bool ViewBlobInternalsJob::IsRedirectResponse(GURL* location, @@ -126,6 +129,11 @@ bool ViewBlobInternalsJob::IsRedirectResponse(GURL* location, return false; } +void ViewBlobInternalsJob::Kill() { + URLRequestSimpleJob::Kill(); + method_factory_.RevokeAll(); +} + void ViewBlobInternalsJob::DoWorkAsync() { if (request_->url().has_query() && StartsWithASCII(request_->url().query(), "remove=", true)) { |