Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: content/browser/net/sqlite_persistent_cookie_store.cc

Issue 1097593002: Delete session cookies immediately after loading the cookie DB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_to_v9
Patch Set: Fix memory leak in unit test. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/net/sqlite_persistent_cookie_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/net/sqlite_persistent_cookie_store.cc
diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc
index 60b7cff7d044b484a7e9488112bff518072d06c0..3f293f6c6b6b06095f4320a70b0c23cc3a2523bb 100644
--- a/content/browser/net/sqlite_persistent_cookie_store.cc
+++ b/content/browser/net/sqlite_persistent_cookie_store.cc
@@ -695,6 +695,9 @@ bool SQLitePersistentCookieStore::Backend::InitializeDatabase() {
50);
initialized_ = true;
+
+ if (!restore_old_session_cookies_)
+ DeleteSessionCookiesOnStartup();
return true;
}
@@ -1290,7 +1293,7 @@ void SQLitePersistentCookieStore::Backend::SetForceKeepSessionState() {
void SQLitePersistentCookieStore::Backend::DeleteSessionCookiesOnStartup() {
DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
- if (!db_->Execute("DELETE FROM cookies WHERE persistent == 0"))
+ if (!db_->Execute("DELETE FROM cookies WHERE persistent != 1"))
LOG(WARNING) << "Unable to delete session cookies.";
}
@@ -1315,8 +1318,6 @@ void SQLitePersistentCookieStore::Backend::FinishedLoadingCookies(
bool success) {
PostClientTask(FROM_HERE, base::Bind(&Backend::CompleteLoadInForeground, this,
loaded_callback, success));
- if (success && !restore_old_session_cookies_)
- DeleteSessionCookiesOnStartup();
}
SQLitePersistentCookieStore::SQLitePersistentCookieStore(
« no previous file with comments | « no previous file | content/browser/net/sqlite_persistent_cookie_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698