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

Unified Diff: chrome/browser/browsing_data_database_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
Index: chrome/browser/browsing_data_database_helper_unittest.cc
diff --git a/chrome/browser/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data_database_helper_unittest.cc
index b5368c46a9234d7a8edae4c608e7824cf76540d5..051738af74d02b7a0dad79d9a6615cd56dc1b091 100644
--- a/chrome/browser/browsing_data_database_helper_unittest.cc
+++ b/chrome/browser/browsing_data_database_helper_unittest.cc
@@ -8,9 +8,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace {
-class TestCompletionCallback
- : public CallbackRunner<Tuple1<
- const std::vector<BrowsingDataDatabaseHelper::DatabaseInfo>& > > {
+class TestCompletionCallback {
public:
TestCompletionCallback()
: have_result_(false) {
@@ -22,11 +20,10 @@ class TestCompletionCallback
return result_;
}
- virtual void RunWithParams(
- const Tuple1<const std::vector<
- BrowsingDataDatabaseHelper::DatabaseInfo>& >& params) {
+ void callback(const std::vector<
+ BrowsingDataDatabaseHelper::DatabaseInfo>& info) {
have_result_ = true;
- result_ = params.a;
+ result_ = info;
}
private:
@@ -55,7 +52,8 @@ TEST(CannedBrowsingDataDatabaseTest, AddDatabase) {
helper->AddDatabase(origin2, db3, "");
TestCompletionCallback callback;
- helper->StartFetching(&callback);
+ helper->StartFetching(
+ NewCallback(&callback, &TestCompletionCallback::callback));
ASSERT_TRUE(callback.have_result());
std::vector<BrowsingDataDatabaseHelper::DatabaseInfo> result =
@@ -83,7 +81,8 @@ TEST(CannedBrowsingDataDatabaseTest, Unique) {
helper->AddDatabase(origin, db, "");
TestCompletionCallback callback;
- helper->StartFetching(&callback);
+ helper->StartFetching(
+ NewCallback(&callback, &TestCompletionCallback::callback));
ASSERT_TRUE(callback.have_result());
std::vector<BrowsingDataDatabaseHelper::DatabaseInfo> result =
« no previous file with comments | « chrome/browser/browsing_data_database_helper.cc ('k') | chrome/browser/browsing_data_local_storage_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698