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

Unified Diff: chrome/browser/browsing_data_appcache_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_appcache_helper.cc ('k') | chrome/browser/browsing_data_database_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data_appcache_helper_unittest.cc
diff --git a/chrome/browser/browsing_data_appcache_helper_unittest.cc b/chrome/browser/browsing_data_appcache_helper_unittest.cc
index e5631b112d18e59a71b948c5e030c7efd89c7fdd..f66e8d3e07aae848b8354605d30fc6788154afe7 100644
--- a/chrome/browser/browsing_data_appcache_helper_unittest.cc
+++ b/chrome/browser/browsing_data_appcache_helper_unittest.cc
@@ -9,7 +9,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace {
-class TestCompletionCallback : public CallbackRunner<Tuple0> {
+class TestCompletionCallback {
public:
TestCompletionCallback()
: have_result_(false) {
@@ -17,9 +17,10 @@ class TestCompletionCallback : public CallbackRunner<Tuple0> {
bool have_result() const { return have_result_; }
- virtual void RunWithParams(const Tuple0& params) {
+ void callback() {
have_result_ = true;
}
+
private:
bool have_result_;
};
@@ -40,7 +41,8 @@ TEST(CannedBrowsingDataAppCacheHelperTest, SetInfo) {
helper->AddAppCache(manifest3);
TestCompletionCallback callback;
- helper->StartFetching(&callback);
+ helper->StartFetching(
+ NewCallback(&callback, &TestCompletionCallback::callback));
ASSERT_TRUE(callback.have_result());
std::map<GURL, appcache::AppCacheInfoVector>& collection =
@@ -71,7 +73,8 @@ TEST(CannedBrowsingDataAppCacheHelperTest, Unique) {
helper->AddAppCache(manifest);
TestCompletionCallback callback;
- helper->StartFetching(&callback);
+ helper->StartFetching(
+ NewCallback(&callback, &TestCompletionCallback::callback));
ASSERT_TRUE(callback.have_result());
std::map<GURL, appcache::AppCacheInfoVector>& collection =
« no previous file with comments | « chrome/browser/browsing_data_appcache_helper.cc ('k') | chrome/browser/browsing_data_database_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698