| Index: net/base/cookie_monster.h
|
| ===================================================================
|
| --- net/base/cookie_monster.h (revision 23545)
|
| +++ net/base/cookie_monster.h (working copy)
|
| @@ -185,16 +185,16 @@
|
| // Returns the number of cookies deleted (useful for debugging).
|
| int GarbageCollect(const base::Time& current, const std::string& key);
|
|
|
| - // Deletes all expired cookies in |itpair|;
|
| - // then, if the number of remaining cookies is greater than |num_max|,
|
| - // collects the least recently accessed cookies until
|
| - // (|num_max| - |num_purge|) cookies remain.
|
| + // Deletes all expired cookies in |itpair|; then, if the number of remaining
|
| + // cookies is greater than |max_cookies|, collects the least recently accessed
|
| + // cookies until that many cookies remain. If |purge_age| is non-zero, only
|
| + // cookies accessed longer ago than |purge_age| are collected.
|
| //
|
| // Returns the number of cookies deleted.
|
| int GarbageCollectRange(const base::Time& current,
|
| const CookieMapItPair& itpair,
|
| - size_t num_max,
|
| - size_t num_purge);
|
| + size_t max_cookies,
|
| + const base::TimeDelta& purge_age);
|
|
|
| // Helper for GarbageCollectRange(); can be called directly as well. Deletes
|
| // all expired cookies in |itpair|. If |cookie_its| is non-NULL, it is
|
| @@ -209,6 +209,9 @@
|
|
|
| CookieMap cookies_;
|
|
|
| + // The last-accessed time of the oldest (LRU) cookie in the DB.
|
| + base::Time least_recent_access_;
|
| +
|
| // Indicates whether the cookie store has been initialized. This happens
|
| // lazily in InitStoreIfNecessary().
|
| bool initialized_;
|
| @@ -373,7 +376,9 @@
|
|
|
| // Initializes the store and retrieves the existing cookies. This will be
|
| // called only once at startup.
|
| - virtual bool Load(std::vector<CookieMonster::KeyedCanonicalCookie>*) = 0;
|
| + // The second argument will be set to the oldest last-accessed date seen.
|
| + virtual bool Load(std::vector<CookieMonster::KeyedCanonicalCookie>*,
|
| + base::Time*) = 0;
|
|
|
| virtual void AddCookie(const std::string&, const CanonicalCookie&) = 0;
|
| virtual void UpdateCookieAccessTime(const CanonicalCookie&) = 0;
|
|
|