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

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

Issue 8315012: base::Bind: Convert FileUtilProxy::GetFileInfoCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pipelining. 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
« base/file_util_proxy.h ('K') | « webkit/plugins/ppapi/quota_file_io.h ('k') | no next file » | 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 4a26f676bd7a943e6655d0f53b264e486d19b1b4..c0210a36af41bdbd8316b1a95d35a7db85a29dfa 100644
--- a/webkit/plugins/ppapi/quota_file_io.cc
+++ b/webkit/plugins/ppapi/quota_file_io.cc
@@ -7,8 +7,9 @@
#include <algorithm>
#include "base/bind.h"
-#include "base/stl_util.h"
+#include "base/memory/scoped_callback_factory.h"
#include "base/message_loop_proxy.h"
+#include "base/stl_util.h"
#include "base/task.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/resource_helper.h"
@@ -224,8 +225,7 @@ QuotaFileIO::QuotaFileIO(
outstanding_errors_(0),
max_written_offset_(0),
inflight_operations_(0),
- callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
DCHECK_NE(base::kInvalidPlatformFileValue, file_);
DCHECK_NE(quota::kStorageTypeUnknown, storage_type_);
}
@@ -294,8 +294,8 @@ bool QuotaFileIO::RegisterOperationForQuotaChecks(
++outstanding_quota_queries_;
if (!base::FileUtilProxy::GetFileInfoFromPlatformFile(
plugin_delegate->GetFileThreadMessageLoopProxy(), file_,
- callback_factory_.NewCallback(
- &QuotaFileIO::DidQueryInfoForQuota))) {
+ base::Bind(&QuotaFileIO::DidQueryInfoForQuota,
+ weak_factory_.GetWeakPtr()))) {
// This makes the call fail synchronously; we do not fire the callback
// here but just delete the operation and return false.
return false;
@@ -306,7 +306,7 @@ bool QuotaFileIO::RegisterOperationForQuotaChecks(
plugin_delegate->QueryAvailableSpace(
GURL(file_url_.path()).GetOrigin(), storage_type_,
base::Bind(&QuotaFileIO::DidQueryAvailableSpace,
- weak_ptr_factory_.GetWeakPtr()));
+ weak_factory_.GetWeakPtr()));
}
pending_operations_.push_back(op.release());
return true;
« base/file_util_proxy.h ('K') | « webkit/plugins/ppapi/quota_file_io.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698