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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { | 1191 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { |
1192 backend_->Close(); | 1192 backend_->Close(); |
1193 // We release our reference to the Backend, though it will probably still have | 1193 // We release our reference to the Backend, though it will probably still have |
1194 // a reference if the background runner has not run Close() yet. | 1194 // a reference if the background runner has not run Close() yet. |
1195 } | 1195 } |
1196 | 1196 |
1197 net::CookieStore* CreatePersistentCookieStore( | 1197 net::CookieStore* CreatePersistentCookieStore( |
1198 const base::FilePath& path, | 1198 const base::FilePath& path, |
1199 bool restore_old_session_cookies, | 1199 bool restore_old_session_cookies, |
1200 quota::SpecialStoragePolicy* storage_policy, | 1200 quota::SpecialStoragePolicy* storage_policy, |
1201 net::CookieMonster::Delegate* cookie_monster_delegate) { | 1201 net::CookieMonster::Delegate* cookie_monster_delegate, |
| 1202 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner) { |
1202 SQLitePersistentCookieStore* persistent_store = | 1203 SQLitePersistentCookieStore* persistent_store = |
1203 new SQLitePersistentCookieStore( | 1204 new SQLitePersistentCookieStore( |
1204 path, | 1205 path, |
1205 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 1206 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
1206 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 1207 background_task_runner.get() ? background_task_runner : |
1207 BrowserThread::GetBlockingPool()->GetSequenceToken()), | 1208 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
| 1209 BrowserThread::GetBlockingPool()->GetSequenceToken()), |
1208 restore_old_session_cookies, | 1210 restore_old_session_cookies, |
1209 storage_policy); | 1211 storage_policy); |
1210 net::CookieMonster* cookie_monster = | 1212 net::CookieMonster* cookie_monster = |
1211 new net::CookieMonster(persistent_store, cookie_monster_delegate); | 1213 new net::CookieMonster(persistent_store, cookie_monster_delegate); |
1212 | 1214 |
1213 const std::string cookie_priority_experiment_group = | 1215 const std::string cookie_priority_experiment_group = |
1214 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); | 1216 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); |
1215 cookie_monster->SetPriorityAwareGarbageCollection( | 1217 cookie_monster->SetPriorityAwareGarbageCollection( |
1216 cookie_priority_experiment_group == "ExperimentOn"); | 1218 cookie_priority_experiment_group == "ExperimentOn"); |
1217 | 1219 |
1218 return cookie_monster; | 1220 return cookie_monster; |
1219 } | 1221 } |
1220 | 1222 |
1221 } // namespace content | 1223 } // namespace content |
OLD | NEW |