| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/logging.h" | 18 #include "base/logging.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/metrics/field_trial.h" | |
| 22 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
| 23 #include "base/sequenced_task_runner.h" | 22 #include "base/sequenced_task_runner.h" |
| 24 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
| 25 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
| 26 #include "base/synchronization/lock.h" | 25 #include "base/synchronization/lock.h" |
| 27 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
| 28 #include "base/time/time.h" | 27 #include "base/time/time.h" |
| 29 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 30 #include "content/public/browser/cookie_store_factory.h" | 29 #include "content/public/browser/cookie_store_factory.h" |
| 31 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 30 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner) { | 1201 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner) { |
| 1203 SQLitePersistentCookieStore* persistent_store = | 1202 SQLitePersistentCookieStore* persistent_store = |
| 1204 new SQLitePersistentCookieStore( | 1203 new SQLitePersistentCookieStore( |
| 1205 path, | 1204 path, |
| 1206 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 1205 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 1207 background_task_runner.get() ? background_task_runner : | 1206 background_task_runner.get() ? background_task_runner : |
| 1208 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 1207 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
| 1209 BrowserThread::GetBlockingPool()->GetSequenceToken()), | 1208 BrowserThread::GetBlockingPool()->GetSequenceToken()), |
| 1210 restore_old_session_cookies, | 1209 restore_old_session_cookies, |
| 1211 storage_policy); | 1210 storage_policy); |
| 1212 net::CookieMonster* cookie_monster = | 1211 return new net::CookieMonster(persistent_store, cookie_monster_delegate); |
| 1213 new net::CookieMonster(persistent_store, cookie_monster_delegate); | |
| 1214 | |
| 1215 const std::string cookie_priority_experiment_group = | |
| 1216 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); | |
| 1217 cookie_monster->SetPriorityAwareGarbageCollection( | |
| 1218 cookie_priority_experiment_group == "ExperimentOn"); | |
| 1219 | |
| 1220 return cookie_monster; | |
| 1221 } | 1212 } |
| 1222 | 1213 |
| 1223 } // namespace content | 1214 } // namespace content |
| OLD | NEW |