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

Unified Diff: webkit/appcache/appcache_storage_impl_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
« no previous file with comments | « webkit/appcache/appcache_storage_impl.cc ('k') | webkit/database/database_quota_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_storage_impl_unittest.cc
diff --git a/webkit/appcache/appcache_storage_impl_unittest.cc b/webkit/appcache/appcache_storage_impl_unittest.cc
index cb5c7d160fe659d03dc3495ce72ab6e50a3bf1a9..cc3a5ba2c86f3619b6493b7dcc1dfdee2a3210c7 100644
--- a/webkit/appcache/appcache_storage_impl_unittest.cc
+++ b/webkit/appcache/appcache_storage_impl_unittest.cc
@@ -131,21 +131,20 @@ class AppCacheStorageImplTest : public testing::Test {
virtual void GetUsageAndQuota(
const GURL& origin, quota::StorageType type,
- GetUsageAndQuotaCallback* callback) {
+ const GetUsageAndQuotaCallback& callback) OVERRIDE {
EXPECT_EQ(kOrigin, origin);
EXPECT_EQ(quota::kStorageTypeTemporary, type);
if (async_) {
MessageLoop::current()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &MockQuotaManager::CallCallbackAndDelete,
+ NewRunnableMethod(this, &MockQuotaManager::CallCallback,
callback));
return;
}
- CallCallbackAndDelete(callback);
+ CallCallback(callback);
}
- void CallCallbackAndDelete(GetUsageAndQuotaCallback* callback) {
- callback->Run(quota::kQuotaStatusOk, 0, kMockQuota);
- delete callback;
+ void CallCallback(const GetUsageAndQuotaCallback& callback) {
+ callback.Run(quota::kQuotaStatusOk, 0, kMockQuota);
}
bool async_;
@@ -164,7 +163,7 @@ class AppCacheStorageImplTest : public testing::Test {
virtual void NotifyStorageAccessed(quota::QuotaClient::ID client_id,
const GURL& origin,
- quota::StorageType type) {
+ quota::StorageType type) OVERRIDE {
EXPECT_EQ(quota::QuotaClient::kAppcache, client_id);
EXPECT_EQ(quota::kStorageTypeTemporary, type);
++notify_storage_accessed_count_;
@@ -174,7 +173,7 @@ class AppCacheStorageImplTest : public testing::Test {
virtual void NotifyStorageModified(quota::QuotaClient::ID client_id,
const GURL& origin,
quota::StorageType type,
- int64 delta) {
+ int64 delta) OVERRIDE {
EXPECT_EQ(quota::QuotaClient::kAppcache, client_id);
EXPECT_EQ(quota::kStorageTypeTemporary, type);
++notify_storage_modified_count_;
@@ -183,9 +182,9 @@ class AppCacheStorageImplTest : public testing::Test {
}
// Not needed for our tests.
- virtual void RegisterClient(quota::QuotaClient* client) {}
- virtual void NotifyOriginInUse(const GURL& origin) {}
- virtual void NotifyOriginNoLongerInUse(const GURL& origin) {}
+ virtual void RegisterClient(quota::QuotaClient* client) OVERRIDE {}
+ virtual void NotifyOriginInUse(const GURL& origin) OVERRIDE {}
+ virtual void NotifyOriginNoLongerInUse(const GURL& origin) OVERRIDE {}
int notify_storage_accessed_count_;
int notify_storage_modified_count_;
@@ -203,7 +202,7 @@ class AppCacheStorageImplTest : public testing::Test {
: test_(test), method_(method) {
}
- virtual void Run() {
+ virtual void Run() OVERRIDE {
test_->SetUpTest();
// Ensure InitTask execution prior to conducting a test.
« no previous file with comments | « webkit/appcache/appcache_storage_impl.cc ('k') | webkit/database/database_quota_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698