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

Unified Diff: webkit/blob/view_blob_internals_job.cc

Issue 5545003: Fix webkit URLRequestJob subtypes to handle Kill() correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
Index: webkit/blob/view_blob_internals_job.cc
diff --git a/webkit/blob/view_blob_internals_job.cc b/webkit/blob/view_blob_internals_job.cc
index 6d6955b6461eeacda2db67445a9774226df485bb..49798b46450ceffe317334c091d4b6f5c5c32358 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)) {
« webkit/appcache/appcache_url_request_job.cc ('K') | « webkit/blob/view_blob_internals_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698