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 "content/browser/net/sqlite_persistent_cookie_store.h" | 5 #include "content/browser/net/sqlite_persistent_cookie_store.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 return false; | 444 return false; |
445 } | 445 } |
446 | 446 |
447 return true; | 447 return true; |
448 } | 448 } |
449 | 449 |
450 } // namespace | 450 } // namespace |
451 | 451 |
452 void SQLitePersistentCookieStore::Backend::Load( | 452 void SQLitePersistentCookieStore::Backend::Load( |
453 const LoadedCallback& loaded_callback) { | 453 const LoadedCallback& loaded_callback) { |
454 // This function should be called only once per instance. | |
455 DCHECK(!db_.get()); | |
456 PostBackgroundTask(FROM_HERE, base::Bind( | 454 PostBackgroundTask(FROM_HERE, base::Bind( |
457 &Backend::LoadAndNotifyInBackground, this, | 455 &Backend::LoadAndNotifyInBackground, this, |
458 loaded_callback, base::Time::Now())); | 456 loaded_callback, base::Time::Now())); |
459 } | 457 } |
460 | 458 |
461 void SQLitePersistentCookieStore::Backend::LoadCookiesForKey( | 459 void SQLitePersistentCookieStore::Backend::LoadCookiesForKey( |
462 const std::string& key, | 460 const std::string& key, |
463 const LoadedCallback& loaded_callback) { | 461 const LoadedCallback& loaded_callback) { |
464 { | 462 { |
465 base::AutoLock locked(metrics_lock_); | 463 base::AutoLock locked(metrics_lock_); |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 (config.session_cookie_mode == | 1450 (config.session_cookie_mode == |
1453 CookieStoreConfig::RESTORED_SESSION_COOKIES)) { | 1451 CookieStoreConfig::RESTORED_SESSION_COOKIES)) { |
1454 cookie_monster->SetPersistSessionCookies(true); | 1452 cookie_monster->SetPersistSessionCookies(true); |
1455 } | 1453 } |
1456 } | 1454 } |
1457 | 1455 |
1458 return cookie_monster; | 1456 return cookie_monster; |
1459 } | 1457 } |
1460 | 1458 |
1461 } // namespace content | 1459 } // namespace content |
OLD | NEW |