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

Unified Diff: webkit/appcache/appcache_response.cc

Issue 8399019: base::Bind usage (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months 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_response.h ('k') | webkit/appcache/appcache_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_response.cc
===================================================================
--- webkit/appcache/appcache_response.cc (revision 107404)
+++ webkit/appcache/appcache_response.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/appcache/appcache_response.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/pickle.h"
@@ -75,7 +76,7 @@
int64 response_id, int64 group_id, AppCacheDiskCacheInterface* disk_cache)
: response_id_(response_id), group_id_(group_id), disk_cache_(disk_cache),
entry_(NULL), buffer_len_(0), user_callback_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(raw_callback_(
new net::CancelableOldCompletionCallback<AppCacheResponseIO>(
this, &AppCacheResponseIO::OnRawIOComplete))) {
@@ -88,9 +89,9 @@
}
void AppCacheResponseIO::ScheduleIOOldCompletionCallback(int result) {
- MessageLoop::current()->PostTask(FROM_HERE,
- method_factory_.NewRunnableMethod(
- &AppCacheResponseIO::OnIOComplete, result));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&AppCacheResponseIO::OnIOComplete,
+ weak_factory_.GetWeakPtr(), result));
}
void AppCacheResponseIO::InvokeUserOldCompletionCallback(int result) {
« no previous file with comments | « webkit/appcache/appcache_response.h ('k') | webkit/appcache/appcache_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698