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

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

Issue 8342004: base::Bind: Final cleanups in webkit/quota. (Closed) Base URL: svn://svn.chromium.org/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 | « no previous file | webkit/quota/mock_storage_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..73b20caa3febb71de27a36a3cdacf4a87c3d9de0 100644
--- a/webkit/plugins/ppapi/quota_file_io.cc
+++ b/webkit/plugins/ppapi/quota_file_io.cc
@@ -73,11 +73,10 @@ 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.
+ // TODO(kinuko): Check the API convention if we really need to keep a copy
+ // of the buffer during the async write operations.
buffer_.reset(new char[bytes_to_write]);
memcpy(buffer_.get(), buffer, bytes_to_write);
}
@@ -120,8 +119,8 @@ 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 +148,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 {
« no previous file with comments | « no previous file | webkit/quota/mock_storage_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698