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

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: choke lint Created 9 years, 3 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/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..d1460a4f705e9a980995af7951f464b76c915228 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) {
+ GetUsageAndQuotaCallback callback) OVERRIDE {
awong 2011/09/29 18:05:15 const ref.
tzik 2011/10/11 04:53:57 Done.
EXPECT_EQ(kOrigin, origin);
EXPECT_EQ(quota::kStorageTypeTemporary, type);
if (async_) {
MessageLoop::current()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &MockQuotaManager::CallCallbackAndDelete,
+ NewRunnableMethod(this, &MockQuotaManager::CallCallback,
awong 2011/09/29 18:05:15 base::Bind?
tzik 2011/10/11 04:53:57 Later.
callback));
return;
}
- CallCallbackAndDelete(callback);
+ CallCallback(callback);
awong 2011/09/29 18:05:15 Maybe just do callback.Run(quota::kQuotaStatusOk,
}
- void CallCallbackAndDelete(GetUsageAndQuotaCallback* callback) {
- callback->Run(quota::kQuotaStatusOk, 0, kMockQuota);
- delete callback;
+ void CallCallback(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.

Powered by Google App Engine
This is Rietveld 408576698