diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-09 02:33:15 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-09 02:33:15 +0000 |
commit | 4aa89e8ece48729ea064568b673ff43d19a1b40d (patch) | |
tree | f959786d66def8e80548b1393ea502291b25376b /net/base/cookie_monster_store_test.cc | |
parent | 8ce1f6165f0ffc1564b25dc9fef90d05816ae634 (diff) | |
download | chromium_src-4aa89e8ece48729ea064568b673ff43d19a1b40d.zip chromium_src-4aa89e8ece48729ea064568b673ff43d19a1b40d.tar.gz chromium_src-4aa89e8ece48729ea064568b673ff43d19a1b40d.tar.bz2 |
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
Diffstat (limited to 'net/base/cookie_monster_store_test.cc')
-rw-r--r-- | net/base/cookie_monster_store_test.cc | 16 |
1 files changed, 6 insertions, 10 deletions
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<CookieMonster::CanonicalCookie*>* out_cookies) { bool ok = load_return_value_; - std::vector<CookieMonster::CanonicalCookie*> 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<CookieMonster::CanonicalCookie*> out_cookies; + 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; } |