| 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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 } | 1298 } |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 void SQLitePersistentCookieStore::Backend::SetForceKeepSessionState() { | 1301 void SQLitePersistentCookieStore::Backend::SetForceKeepSessionState() { |
| 1302 base::AutoLock locked(lock_); | 1302 base::AutoLock locked(lock_); |
| 1303 force_keep_session_state_ = true; | 1303 force_keep_session_state_ = true; |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 void SQLitePersistentCookieStore::Backend::DeleteSessionCookiesOnStartup() { | 1306 void SQLitePersistentCookieStore::Backend::DeleteSessionCookiesOnStartup() { |
| 1307 DCHECK(background_task_runner_->RunsTasksOnCurrentThread()); | 1307 DCHECK(background_task_runner_->RunsTasksOnCurrentThread()); |
| 1308 base::Time start_time = base::Time::Now(); |
| 1308 if (!db_->Execute("DELETE FROM cookies WHERE persistent != 1")) | 1309 if (!db_->Execute("DELETE FROM cookies WHERE persistent != 1")) |
| 1309 LOG(WARNING) << "Unable to delete session cookies."; | 1310 LOG(WARNING) << "Unable to delete session cookies."; |
| 1311 |
| 1312 UMA_HISTOGRAM_TIMES("Cookie.Startup.TimeSpentDeletingCookies", |
| 1313 base::Time::Now() - start_time); |
| 1314 UMA_HISTOGRAM_COUNTS("Cookie.Startup.NumberOfCookiesDeleted", |
| 1315 db_->GetLastChangeCount()); |
| 1310 } | 1316 } |
| 1311 | 1317 |
| 1312 void SQLitePersistentCookieStore::Backend::PostBackgroundTask( | 1318 void SQLitePersistentCookieStore::Backend::PostBackgroundTask( |
| 1313 const tracked_objects::Location& origin, const base::Closure& task) { | 1319 const tracked_objects::Location& origin, const base::Closure& task) { |
| 1314 if (!background_task_runner_->PostTask(origin, task)) { | 1320 if (!background_task_runner_->PostTask(origin, task)) { |
| 1315 LOG(WARNING) << "Failed to post task from " << origin.ToString() | 1321 LOG(WARNING) << "Failed to post task from " << origin.ToString() |
| 1316 << " to background_task_runner_."; | 1322 << " to background_task_runner_."; |
| 1317 } | 1323 } |
| 1318 } | 1324 } |
| 1319 | 1325 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 (config.session_cookie_mode == | 1456 (config.session_cookie_mode == |
| 1451 CookieStoreConfig::RESTORED_SESSION_COOKIES)) { | 1457 CookieStoreConfig::RESTORED_SESSION_COOKIES)) { |
| 1452 cookie_monster->SetPersistSessionCookies(true); | 1458 cookie_monster->SetPersistSessionCookies(true); |
| 1453 } | 1459 } |
| 1454 } | 1460 } |
| 1455 | 1461 |
| 1456 return cookie_monster; | 1462 return cookie_monster; |
| 1457 } | 1463 } |
| 1458 | 1464 |
| 1459 } // namespace content | 1465 } // namespace content |
| OLD | NEW |