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

Unified Diff: net/base/cookie_monster_store_test.cc

Issue 7833042: Finalize a CL originally by departed intern ycxiao@ that detaches the loading of cookies from the... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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: net/base/cookie_monster_store_test.cc
===================================================================
--- net/base/cookie_monster_store_test.cc (revision 99705)
+++ net/base/cookie_monster_store_test.cc (working copy)
@@ -25,11 +25,13 @@
load_result_ = result;
}
-bool MockPersistentCookieStore::Load(
- std::vector<CookieMonster::CanonicalCookie*>* out_cookies) {
+bool MockPersistentCookieStore::Load(const LoadedCallback& loaded_callback) {
bool ok = load_return_value_;
- if (ok)
- *out_cookies = load_result_;
+ std::vector<CookieMonster::CanonicalCookie*> out_cookies;
+ if (ok) {
+ out_cookies = load_result_;
+ }
+ loaded_callback.Run(out_cookies);
return ok;
}
@@ -108,11 +110,13 @@
MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() {}
bool MockSimplePersistentCookieStore::Load(
- std::vector<CookieMonster::CanonicalCookie*>* out_cookies) {
+ const LoadedCallback& loaded_callback) {
+ std::vector<CookieMonster::CanonicalCookie*> out_cookies;
for (CanonicalCookieMap::const_iterator it = cookies_.begin();
it != cookies_.end(); it++)
- out_cookies->push_back(
+ out_cookies.push_back(
new CookieMonster::CanonicalCookie(it->second));
+ loaded_callback.Run(out_cookies);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698