Index: webkit/plugins/ppapi/quota_file_io.cc |
diff --git a/webkit/plugins/ppapi/quota_file_io.cc b/webkit/plugins/ppapi/quota_file_io.cc |
index 09dd43e15f61be7b4154ff7e6b06e0f239e3868b..55acdfb043c543f6aa8c78da32f988a579fa330e 100644 |
--- a/webkit/plugins/ppapi/quota_file_io.cc |
+++ b/webkit/plugins/ppapi/quota_file_io.cc |
@@ -73,8 +73,7 @@ class QuotaFileIO::WriteOperation : public PendingOperationBase { |
finished_(false), |
status_(base::PLATFORM_FILE_OK), |
bytes_written_(0), |
- ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
- ALLOW_THIS_IN_INITIALIZER_LIST(runnable_factory_(this)) { |
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
if (!is_will_operation) { |
// TODO(kinuko): check the API convention if we really need to keep a |
// copy of the buffer during the async write operations. |
@@ -120,8 +119,9 @@ class QuotaFileIO::WriteOperation : public PendingOperationBase { |
virtual void WillRunCallback() { |
base::MessageLoopProxy::current()->PostTask( |
- FROM_HERE, runnable_factory_.NewRunnableMethod( |
- &WriteOperation::RunCallback)); |
+ FROM_HERE, |
+ base::Bind(&WriteOperation::RunCallback, |
+ weak_factory_.GetWeakPtr())); |
} |
private: |
@@ -149,7 +149,6 @@ class QuotaFileIO::WriteOperation : public PendingOperationBase { |
PlatformFileError status_; |
int64_t bytes_written_; |
base::WeakPtrFactory<WriteOperation> weak_factory_; |
- ScopedRunnableMethodFactory<WriteOperation> runnable_factory_; |
}; |
class QuotaFileIO::SetLengthOperation : public PendingOperationBase { |
@@ -183,8 +182,8 @@ class QuotaFileIO::SetLengthOperation : public PendingOperationBase { |
} |
if (!base::FileUtilProxy::Truncate( |
- plugin_delegate->GetFileThreadMessageLoopProxy(), quota_io_->file_, |
- length_, |
+ plugin_delegate->GetFileThreadMessageLoopProxy(), |
+ quota_io_->file_, length_, |
base::Bind(&SetLengthOperation::DidFinish, |
weak_factory_.GetWeakPtr()))) { |
DidFail(base::PLATFORM_FILE_ERROR_FAILED); |