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

Unified Diff: net/cookies/cookie_monster.h

Issue 1767513004: Clean up cookie eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke@ Created 4 years, 9 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') | no next file with comments »
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 8ad739532b68d0e4d7ebc98ba48dc080f683d989..421e7d0c60548dd150911412e6baf708a0a95379 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -541,6 +541,21 @@ class NET_EXPORT CookieMonster : public CookieStore {
const std::string& key,
bool enforce_strict_secure);
+ // Helper for GarbageCollect(). Deletes up to |purge_goal| cookies with a
+ // priority less than or equal to |priority| from |cookies|, while ensuring
+ // that at least the |to_protect| most-recent cookies are retained.
+ //
+ // |cookies| must be sorted from least-recent to most-recent.
+ //
+ // |safe_date| is only used to determine the deletion cause for histograms.
+ //
+ // Returns the number of cookies deleted.
+ size_t PurgeLeastRecentMatches(CookieItVector* cookies,
+ CookiePriority priority,
+ size_t to_protect,
+ size_t purge_goal,
+ const base::Time& safe_date);
+
// Helper for GarbageCollect(); can be called directly as well. Deletes all
// expired cookies in |itpair|. If |cookie_its| is non-NULL, all the
// non-expired cookies from |itpair| are appended to |cookie_its|.
« no previous file with comments | « no previous file | net/cookies/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698