From 4aa89e8ece48729ea064568b673ff43d19a1b40d Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 9 Sep 2011 02:33:15 +0000 Subject: Revert 100188 - Finalize a CL originally by departed intern ycxiao@ that detaches the loading of cookies from the IO thread. They are now loaded on the DB thread. Cookie operations received in the meantime are queued and executed, on the IO thread, in the order they were received, when loading completes. A few straggler clients are updated to use the asynchronous CookieStore/CookieMonster API as part of this CL, as the synchronous API is removed. BUG=68657 TEST=net_unittests / DeferredCookieTaskTest.* and CookieMonsterTest.* Review URL: http://codereview.chromium.org/7833042 TBR=erikwright@chromium.org Review URL: http://codereview.chromium.org/7860026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100335 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/cookie_monster_store_test.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'net/base/cookie_monster_store_test.cc') diff --git a/net/base/cookie_monster_store_test.cc b/net/base/cookie_monster_store_test.cc index 717a70c..b3a6c13 100644 --- a/net/base/cookie_monster_store_test.cc +++ b/net/base/cookie_monster_store_test.cc @@ -25,13 +25,11 @@ void MockPersistentCookieStore::SetLoadExpectation( load_result_ = result; } -bool MockPersistentCookieStore::Load(const LoadedCallback& loaded_callback) { +bool MockPersistentCookieStore::Load( + std::vector* out_cookies) { bool ok = load_return_value_; - std::vector out_cookies; - if (ok) { - out_cookies = load_result_; - } - loaded_callback.Run(out_cookies); + if (ok) + *out_cookies = load_result_; return ok; } @@ -110,13 +108,11 @@ MockSimplePersistentCookieStore::MockSimplePersistentCookieStore() {} MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() {} bool MockSimplePersistentCookieStore::Load( - const LoadedCallback& loaded_callback) { - std::vector out_cookies; + std::vector* 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; } -- cgit v1.1