diff options
author | tzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 14:11:03 +0000 |
---|---|---|
committer | tzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 14:11:03 +0000 |
commit | 4d99be5a3d20c3a3654f282328065f9ff54d6f39 (patch) | |
tree | b355c0c05f4879373ab23998dfb49253ff6f9e9e /webkit/quota/mock_quota_manager_unittest.cc | |
parent | 58ae297434a9e33d1006c52b6d13d8a78e3b7e5e (diff) | |
download | chromium_src-4d99be5a3d20c3a3654f282328065f9ff54d6f39.zip chromium_src-4d99be5a3d20c3a3654f282328065f9ff54d6f39.tar.gz chromium_src-4d99be5a3d20c3a3654f282328065f9ff54d6f39.tar.bz2 |
Use base::Callback in Quota related code.
BUG=None
TEST='Compilation should finished successfull and all quota related tests should be passed.'
Review URL: http://codereview.chromium.org/8070001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/quota/mock_quota_manager_unittest.cc')
-rw-r--r-- | webkit/quota/mock_quota_manager_unittest.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/webkit/quota/mock_quota_manager_unittest.cc b/webkit/quota/mock_quota_manager_unittest.cc index 503f8aa..5f1d1b6 100644 --- a/webkit/quota/mock_quota_manager_unittest.cc +++ b/webkit/quota/mock_quota_manager_unittest.cc @@ -5,8 +5,8 @@ #include <set> +#include "base/bind.h" #include "base/file_util.h" -#include "base/memory/scoped_callback_factory.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" @@ -29,7 +29,7 @@ const GURL kOrigin3(kTestOrigin3); class MockQuotaManagerTest : public testing::Test { public: MockQuotaManagerTest() - : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), + : weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), deletion_callback_count_(0) { } @@ -51,9 +51,10 @@ class MockQuotaManagerTest : public testing::Test { } void GetModifiedOrigins(StorageType type, base::Time since) { - manager_->GetOriginsModifiedSince(type, since, - callback_factory_.NewCallback( - &MockQuotaManagerTest::GotModifiedOrigins)); + manager_->GetOriginsModifiedSince( + type, since, + base::Bind(&MockQuotaManagerTest::GotModifiedOrigins, + weak_factory_.GetWeakPtr())); } void GotModifiedOrigins(const std::set<GURL>& origins, StorageType type) { @@ -62,9 +63,10 @@ class MockQuotaManagerTest : public testing::Test { } void DeleteOriginData(const GURL& origin, StorageType type) { - manager_->DeleteOriginData(origin, type, - callback_factory_.NewCallback( - &MockQuotaManagerTest::DeletedOriginData)); + manager_->DeleteOriginData( + origin, type, + base::Bind(&MockQuotaManagerTest::DeletedOriginData, + weak_factory_.GetWeakPtr())); } void DeletedOriginData(QuotaStatusCode status) { @@ -90,7 +92,7 @@ class MockQuotaManagerTest : public testing::Test { private: ScopedTempDir data_dir_; - base::ScopedCallbackFactory<MockQuotaManagerTest> callback_factory_; + base::WeakPtrFactory<MockQuotaManagerTest> weak_factory_; scoped_refptr<MockQuotaManager> manager_; scoped_refptr<MockSpecialStoragePolicy> policy_; |