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

Unified Diff: chrome/browser/browsing_data_local_storage_helper_unittest.cc

Issue 3178001: Delete callbacks after use in canned browsing data helpers. (Closed)
Patch Set: Created 10 years, 4 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 | « chrome/browser/browsing_data_local_storage_helper.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data_local_storage_helper_unittest.cc
diff --git a/chrome/browser/browsing_data_local_storage_helper_unittest.cc b/chrome/browser/browsing_data_local_storage_helper_unittest.cc
index 37c3555996e1f34f9b25a04b4afcc527ec8ed78f..8f3a9c66df9a27b913c576811fff1429b0a6e69d 100644
--- a/chrome/browser/browsing_data_local_storage_helper_unittest.cc
+++ b/chrome/browser/browsing_data_local_storage_helper_unittest.cc
@@ -8,9 +8,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace {
-class TestCompletionCallback
- : public CallbackRunner<Tuple1<const std::vector<
- BrowsingDataLocalStorageHelper::LocalStorageInfo>& > > {
+class TestCompletionCallback {
public:
TestCompletionCallback()
: have_result_(false) {
@@ -23,11 +21,10 @@ class TestCompletionCallback
return result_;
}
- virtual void RunWithParams(
- const Tuple1<const std::vector<
- BrowsingDataLocalStorageHelper::LocalStorageInfo>& >& params) {
+ void callback(const std::vector<
+ BrowsingDataLocalStorageHelper::LocalStorageInfo>& info) {
have_result_ = true;
- result_ = params.a;
+ result_ = info;
}
private:
@@ -54,7 +51,8 @@ TEST(CannedBrowsingDataLocalStorageTest, AddLocalStorage) {
helper->AddLocalStorage(origin2);
TestCompletionCallback callback;
- helper->StartFetching(&callback);
+ helper->StartFetching(
+ NewCallback(&callback, &TestCompletionCallback::callback));
ASSERT_TRUE(callback.have_result());
std::vector<BrowsingDataLocalStorageHelper::LocalStorageInfo> result =
@@ -78,7 +76,8 @@ TEST(CannedBrowsingDataLocalStorageTest, Unique) {
helper->AddLocalStorage(origin);
TestCompletionCallback callback;
- helper->StartFetching(&callback);
+ helper->StartFetching(
+ NewCallback(&callback, &TestCompletionCallback::callback));
ASSERT_TRUE(callback.have_result());
std::vector<BrowsingDataLocalStorageHelper::LocalStorageInfo> result =
« no previous file with comments | « chrome/browser/browsing_data_local_storage_helper.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698