| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |