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

Unified Diff: webkit/fileapi/file_system_quota_unittest.cc

Issue 8070001: Use base::Callback in Quota related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/fileapi/file_system_quota_unittest.cc
diff --git a/webkit/fileapi/file_system_quota_unittest.cc b/webkit/fileapi/file_system_quota_unittest.cc
index 6eddf09bbed178aacdbf4a8eafe9c6f19c1123eb..f901d4308224efca90a3f0e48db59a98eb2ae967 100644
--- a/webkit/fileapi/file_system_quota_unittest.cc
+++ b/webkit/fileapi/file_system_quota_unittest.cc
@@ -7,6 +7,7 @@
// 2) the described size in .usage, and
// 3) the result of QuotaManager::GetUsageAndQuota.
+#include "base/bind.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_callback_factory.h"
@@ -32,7 +33,7 @@ class FileSystemQuotaTest : public testing::Test {
public:
FileSystemQuotaTest()
: local_file_util_(new LocalFileUtil(QuotaFileUtil::CreateDefault())),
- callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
status_(kFileOperationStatusNotSet),
quota_status_(quota::kQuotaStatusUnknown),
usage_(-1),
@@ -74,8 +75,8 @@ class FileSystemQuotaTest : public testing::Test {
void GetUsageAndQuotaFromQuotaManager() {
quota_manager_->GetUsageAndQuota(
test_helper_.origin(), test_helper_.storage_type(),
- callback_factory_.NewCallback(
- &FileSystemQuotaTest::OnGetUsageAndQuota));
+ base::Bind(&FileSystemQuotaTest::OnGetUsageAndQuota,
+ weak_factory_.GetWeakPtr()));
MessageLoop::current()->RunAllPending();
}
@@ -122,7 +123,7 @@ class FileSystemQuotaTest : public testing::Test {
scoped_refptr<quota::QuotaManager> quota_manager_;
scoped_ptr<LocalFileUtil> local_file_util_;
- base::ScopedCallbackFactory<FileSystemQuotaTest> callback_factory_;
+ base::WeakPtrFactory<FileSystemQuotaTest> weak_factory_;
// For post-operation status.
int status_;
« no previous file with comments | « webkit/fileapi/file_system_quota_client_unittest.cc ('k') | webkit/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698