| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 class SQLitePersistentCookieStore::Backend | 69 class SQLitePersistentCookieStore::Backend |
| 70 : public base::RefCountedThreadSafe<SQLitePersistentCookieStore::Backend> { | 70 : public base::RefCountedThreadSafe<SQLitePersistentCookieStore::Backend> { |
| 71 public: | 71 public: |
| 72 Backend( | 72 Backend( |
| 73 const base::FilePath& path, | 73 const base::FilePath& path, |
| 74 const scoped_refptr<base::SequencedTaskRunner>& client_task_runner, | 74 const scoped_refptr<base::SequencedTaskRunner>& client_task_runner, |
| 75 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 75 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
| 76 bool restore_old_session_cookies, | 76 bool restore_old_session_cookies, |
| 77 quota::SpecialStoragePolicy* special_storage_policy) | 77 quota::SpecialStoragePolicy* special_storage_policy) |
| 78 : path_(path), | 78 : path_(path), |
| 79 db_(NULL), | |
| 80 num_pending_(0), | 79 num_pending_(0), |
| 81 force_keep_session_state_(false), | 80 force_keep_session_state_(false), |
| 82 initialized_(false), | 81 initialized_(false), |
| 83 corruption_detected_(false), | 82 corruption_detected_(false), |
| 84 restore_old_session_cookies_(restore_old_session_cookies), | 83 restore_old_session_cookies_(restore_old_session_cookies), |
| 85 special_storage_policy_(special_storage_policy), | 84 special_storage_policy_(special_storage_policy), |
| 86 num_cookies_read_(0), | 85 num_cookies_read_(0), |
| 87 client_task_runner_(client_task_runner), | 86 client_task_runner_(client_task_runner), |
| 88 background_task_runner_(background_task_runner), | 87 background_task_runner_(background_task_runner), |
| 89 num_priority_waiting_(0), | 88 num_priority_waiting_(0), |
| 90 total_priority_requests_(0) { | 89 total_priority_requests_(0) {} |
| 91 } | |
| 92 | 90 |
| 93 // Creates or loads the SQLite database. | 91 // Creates or loads the SQLite database. |
| 94 void Load(const LoadedCallback& loaded_callback); | 92 void Load(const LoadedCallback& loaded_callback); |
| 95 | 93 |
| 96 // Loads cookies for the domain key (eTLD+1). | 94 // Loads cookies for the domain key (eTLD+1). |
| 97 void LoadCookiesForKey(const std::string& domain, | 95 void LoadCookiesForKey(const std::string& domain, |
| 98 const LoadedCallback& loaded_callback); | 96 const LoadedCallback& loaded_callback); |
| 99 | 97 |
| 100 // Batch a cookie addition. | 98 // Batch a cookie addition. |
| 101 void AddCookie(const net::CanonicalCookie& cc); | 99 void AddCookie(const net::CanonicalCookie& cc); |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 | 1199 |
| 1202 const std::string cookie_priority_experiment_group = | 1200 const std::string cookie_priority_experiment_group = |
| 1203 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); | 1201 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); |
| 1204 cookie_monster->SetPriorityAwareGarbageCollection( | 1202 cookie_monster->SetPriorityAwareGarbageCollection( |
| 1205 cookie_priority_experiment_group == "ExperimentOn"); | 1203 cookie_priority_experiment_group == "ExperimentOn"); |
| 1206 | 1204 |
| 1207 return cookie_monster; | 1205 return cookie_monster; |
| 1208 } | 1206 } |
| 1209 | 1207 |
| 1210 } // namespace content | 1208 } // namespace content |
| OLD | NEW |