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

Unified Diff: webkit/plugins/ppapi/quota_file_io.cc

Issue 8231004: Remaining cleanup (base::Bind): Replacing FileUtilProxy calls with new callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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
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);

Powered by Google App Engine
This is Rietveld 408576698