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

Unified Diff: webkit/quota/quota_temporary_storage_evictor_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/quota/quota_temporary_storage_evictor.cc ('k') | webkit/quota/quota_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/quota/quota_temporary_storage_evictor_unittest.cc
diff --git a/webkit/quota/quota_temporary_storage_evictor_unittest.cc b/webkit/quota/quota_temporary_storage_evictor_unittest.cc
index 361d4a00f441215d6cc6abd2045f8e5c59a45f57..fa4f0b261985213683b2ed25e483c0c6026cf8e3 100644
--- a/webkit/quota/quota_temporary_storage_evictor_unittest.cc
+++ b/webkit/quota/quota_temporary_storage_evictor_unittest.cc
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/gtest/include/gtest/gtest.h"
-
#include <list>
#include <map>
+#include <utility>
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "base/task.h"
+#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/quota/mock_storage_client.h"
#include "webkit/quota/quota_manager.h"
#include "webkit/quota/quota_temporary_storage_evictor.h"
@@ -24,7 +24,7 @@ namespace {
class MockQuotaEvictionHandler : public quota::QuotaEvictionHandler {
public:
- MockQuotaEvictionHandler(QuotaTemporaryStorageEvictorTest *test)
+ explicit MockQuotaEvictionHandler(QuotaTemporaryStorageEvictorTest *test)
: quota_(0),
unlimited_usage_(0),
available_space_(0),
@@ -35,17 +35,15 @@ class MockQuotaEvictionHandler : public quota::QuotaEvictionHandler {
virtual void EvictOriginData(
const GURL& origin,
StorageType type,
- EvictOriginDataCallback* callback) OVERRIDE {
+ const EvictOriginDataCallback& callback) OVERRIDE {
if (error_on_evict_origin_data_) {
- callback->Run(quota::kQuotaErrorInvalidModification);
- delete callback;
+ callback.Run(quota::kQuotaErrorInvalidModification);
return;
}
int64 origin_usage = EnsureOriginRemoved(origin);
if (origin_usage >= 0)
available_space_ += origin_usage;
- callback->Run(quota::kQuotaStatusOk);
- delete callback;
+ callback.Run(quota::kQuotaStatusOk);
}
virtual void GetUsageAndQuotaForEviction(
« no previous file with comments | « webkit/quota/quota_temporary_storage_evictor.cc ('k') | webkit/quota/quota_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698