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

Unified Diff: chrome/common/net/cookie_monster_sqlite.cc

Issue 99100: Update cookie expiry policy to attempt to avoid deleting "in-use" cookies. S... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « chrome/common/net/cookie_monster_sqlite.h ('k') | net/base/cookie_monster.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/cookie_monster_sqlite.cc
===================================================================
--- chrome/common/net/cookie_monster_sqlite.cc (revision 23545)
+++ chrome/common/net/cookie_monster_sqlite.cc (working copy)
@@ -306,7 +306,8 @@
} // namespace
bool SQLitePersistentCookieStore::Load(
- std::vector<net::CookieMonster::KeyedCanonicalCookie>* cookies) {
+ std::vector<net::CookieMonster::KeyedCanonicalCookie>* cookies,
+ base::Time* least_recent_access) {
DCHECK(!path_.empty());
sqlite3* db;
if (sqlite3_open(WideToUTF8(path_).c_str(), &db) != SQLITE_OK) {
@@ -349,6 +350,10 @@
if (!cc.get())
break;
+ const base::Time last_access = cc->LastAccessDate();
+ if (least_recent_access->is_null() || (last_access < *least_recent_access))
+ *least_recent_access = last_access;
+
DLOG_IF(WARNING,
cc->CreationDate() > Time::Now()) << L"CreationDate too recent";
cookies->push_back(
« no previous file with comments | « chrome/common/net/cookie_monster_sqlite.h ('k') | net/base/cookie_monster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698