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

Unified Diff: net/cookies/cookie_monster.h

Issue 2924933002: Fix CookieMonster garbage collection when no insecure cookies. (Closed)
Patch Set: Created 3 years, 6 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 | net/cookies/cookie_monster.cc » ('j') | net/cookies/cookie_monster.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster.h
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 1ddbccc16270d77c15132f5c3703d56cc2f564bb..f82f18f641346b26bea2aaa8fef9b7f667cf55aa 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -257,8 +257,9 @@ class NET_EXPORT CookieMonster : public CookieStore {
// For garbage collection constants.
FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestHostGarbageCollection);
- FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestTotalGarbageCollection);
FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, GarbageCollectionTriggers);
+ FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest,
+ GarbageCollectWithSecureCookiesOnly);
FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestGCTimes);
// For validation of key values.
@@ -605,10 +606,14 @@ class NET_EXPORT CookieMonster : public CookieStore {
// Helper for GarbageCollect(). Deletes cookies in |cookie_its| from least to
// most recently used, but only before |safe_date|. Also will stop deleting
// when the number of remaining cookies hits |purge_goal|.
+ //
+ // Sets |earliest_time| to be the earliest last access time of a cookie that
+ // was not deleted, or base::Time() if no such cookie exists.
size_t GarbageCollectLeastRecentlyAccessed(const base::Time& current,
const base::Time& safe_date,
size_t purge_goal,
- CookieItVector cookie_its);
+ CookieItVector cookie_its,
+ base::Time* earliest_time);
// Find the key (for lookup in cookies_) based on the given domain.
// See comment on keys before the CookieMap typedef.
« no previous file with comments | « no previous file | net/cookies/cookie_monster.cc » ('j') | net/cookies/cookie_monster.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698