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

Side by Side Diff: net/cookies/cookie_monster_store_test.cc

Issue 2937963003: Shift cookie system callbacks to OnceCallback to impedance match mojo. (Closed)
Patch Set: Finish Merge Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/cookies/cookie_monster_store_test.h" 5 #include "net/cookies/cookie_monster_store_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 void MockPersistentCookieStore::UpdateCookieAccessTime( 82 void MockPersistentCookieStore::UpdateCookieAccessTime(
83 const CanonicalCookie& cookie) { 83 const CanonicalCookie& cookie) {
84 } 84 }
85 85
86 void MockPersistentCookieStore::DeleteCookie(const CanonicalCookie& cookie) { 86 void MockPersistentCookieStore::DeleteCookie(const CanonicalCookie& cookie) {
87 commands_.push_back(CookieStoreCommand(CookieStoreCommand::REMOVE, cookie)); 87 commands_.push_back(CookieStoreCommand(CookieStoreCommand::REMOVE, cookie));
88 } 88 }
89 89
90 void MockPersistentCookieStore::Flush(const base::Closure& callback) { 90 void MockPersistentCookieStore::Flush(base::OnceClosure callback) {
91 if (!callback.is_null()) 91 if (!callback.is_null())
92 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); 92 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
93 std::move(callback));
93 } 94 }
94 95
95 void MockPersistentCookieStore::SetForceKeepSessionState() { 96 void MockPersistentCookieStore::SetForceKeepSessionState() {
96 } 97 }
97 98
98 MockPersistentCookieStore::~MockPersistentCookieStore() { 99 MockPersistentCookieStore::~MockPersistentCookieStore() {
99 } 100 }
100 101
101 MockCookieMonsterDelegate::MockCookieMonsterDelegate() { 102 MockCookieMonsterDelegate::MockCookieMonsterDelegate() {
102 } 103 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 189 }
189 190
190 void MockSimplePersistentCookieStore::DeleteCookie( 191 void MockSimplePersistentCookieStore::DeleteCookie(
191 const CanonicalCookie& cookie) { 192 const CanonicalCookie& cookie) {
192 int64_t creation_time = cookie.CreationDate().ToInternalValue(); 193 int64_t creation_time = cookie.CreationDate().ToInternalValue();
193 CanonicalCookieMap::iterator it = cookies_.find(creation_time); 194 CanonicalCookieMap::iterator it = cookies_.find(creation_time);
194 ASSERT_TRUE(it != cookies_.end()); 195 ASSERT_TRUE(it != cookies_.end());
195 cookies_.erase(it); 196 cookies_.erase(it);
196 } 197 }
197 198
198 void MockSimplePersistentCookieStore::Flush(const base::Closure& callback) { 199 void MockSimplePersistentCookieStore::Flush(base::OnceClosure callback) {
199 if (!callback.is_null()) 200 if (!callback.is_null())
200 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); 201 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
202 std::move(callback));
201 } 203 }
202 204
203 void MockSimplePersistentCookieStore::SetForceKeepSessionState() { 205 void MockSimplePersistentCookieStore::SetForceKeepSessionState() {
204 } 206 }
205 207
206 std::unique_ptr<CookieMonster> CreateMonsterFromStoreForGC( 208 std::unique_ptr<CookieMonster> CreateMonsterFromStoreForGC(
207 int num_secure_cookies, 209 int num_secure_cookies,
208 int num_old_secure_cookies, 210 int num_old_secure_cookies,
209 int num_non_secure_cookies, 211 int num_non_secure_cookies,
210 int num_old_non_secure_cookies, 212 int num_old_non_secure_cookies,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 store->AddCookie(*cc); 248 store->AddCookie(*cc);
247 } 249 }
248 250
249 return base::MakeUnique<CookieMonster>(store.get(), nullptr); 251 return base::MakeUnique<CookieMonster>(store.get(), nullptr);
250 } 252 }
251 253
252 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() { 254 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() {
253 } 255 }
254 256
255 } // namespace net 257 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698