Chromium Code Reviews| 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))) { |
| @@ -89,8 +90,8 @@ |
| void AppCacheResponseIO::ScheduleIOOldCompletionCallback(int result) { |
| MessageLoop::current()->PostTask(FROM_HERE, |
|
James Hawkins
2011/10/27 03:30:32
nit: Parameters must start on the same column. In
michaeln
2011/10/27 19:20:02
Done.
|
| - method_factory_.NewRunnableMethod( |
| - &AppCacheResponseIO::OnIOComplete, result)); |
| + base::Bind(&AppCacheResponseIO::OnIOComplete, |
| + weak_factory_.GetWeakPtr(), result)); |
| } |
| void AppCacheResponseIO::InvokeUserOldCompletionCallback(int result) { |