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

Unified Diff: webkit/appcache/appcache_url_request_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
« no previous file with comments | « webkit/appcache/appcache_url_request_job.h ('k') | webkit/blob/blob_url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_url_request_job.cc
diff --git a/webkit/appcache/appcache_url_request_job.cc b/webkit/appcache/appcache_url_request_job.cc
index c70cd7aa2358b8f4a1323e688d1a72bf5d01f20b..6a61674e0fd8f45d0b472abc47fb9136e6f0e55f 100644
--- a/webkit/appcache/appcache_url_request_job.cc
+++ b/webkit/appcache/appcache_url_request_job.cc
@@ -6,6 +6,7 @@
#include "webkit/appcache/appcache_url_request_job.h"
+#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
@@ -27,7 +28,8 @@ AppCacheURLRequestJob::AppCacheURLRequestJob(
cache_id_(kNoCacheId), is_fallback_(false),
cache_entry_not_found_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_(
- this, &AppCacheURLRequestJob::OnReadComplete)) {
+ this, &AppCacheURLRequestJob::OnReadComplete)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
DCHECK(storage_);
}
@@ -67,8 +69,10 @@ void AppCacheURLRequestJob::MaybeBeginDelivery() {
if (has_been_started() && has_delivery_orders()) {
// Start asynchronously so that all error reporting and data
// callbacks happen as they would for network requests.
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &AppCacheURLRequestJob::BeginDelivery));
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ method_factory_.NewRunnableMethod(
+ &AppCacheURLRequestJob::BeginDelivery));
}
}
@@ -210,6 +214,7 @@ void AppCacheURLRequestJob::Kill() {
storage_ = NULL;
}
URLRequestJob::Kill();
+ method_factory_.RevokeAll();
}
}
@@ -278,4 +283,3 @@ void AppCacheURLRequestJob::SetExtraRequestHeaders(
}
} // namespace appcache
-
« no previous file with comments | « webkit/appcache/appcache_url_request_job.h ('k') | webkit/blob/blob_url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698