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) { |