summaryrefslogtreecommitdiff
path: root/chromium/net/cookies/cookie_monster.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/net/cookies/cookie_monster.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/net/cookies/cookie_monster.h')
-rw-r--r--chromium/net/cookies/cookie_monster.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/chromium/net/cookies/cookie_monster.h b/chromium/net/cookies/cookie_monster.h
index 46001bd4e4e..9908e6f8e7e 100644
--- a/chromium/net/cookies/cookie_monster.h
+++ b/chromium/net/cookies/cookie_monster.h
@@ -31,6 +31,7 @@
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_access_delegate.h"
#include "net/cookies/cookie_constants.h"
+#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_monster_change_dispatcher.h"
#include "net/cookies/cookie_store.h"
#include "net/log/net_log_with_source.h"
@@ -123,6 +124,9 @@ class NET_EXPORT CookieMonster : public CookieStore {
static const size_t kMaxCookies;
static const size_t kPurgeCookies;
+ // Max number of keys to store for domains that have been purged.
+ static const size_t kMaxDomainPurgedKeys;
+
// Quota for cookies with {low, medium, high} priorities within a domain.
static const size_t kDomainCookiesQuotaLow;
static const size_t kDomainCookiesQuotaMedium;
@@ -203,6 +207,10 @@ class NET_EXPORT CookieMonster : public CookieStore {
// before the CookieMap typedef.
static std::string GetKey(base::StringPiece domain);
+ // Triggers immediate recording of stats that are typically reported
+ // periodically.
+ bool DoRecordPeriodicStatsForTesting() { return DoRecordPeriodicStats(); }
+
private:
// For garbage collection constants.
FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestHostGarbageCollection);
@@ -394,8 +402,8 @@ class NET_EXPORT CookieMonster : public CookieStore {
void FilterCookiesWithOptions(const GURL url,
const CookieOptions options,
std::vector<CanonicalCookie*>* cookie_ptrs,
- CookieStatusList* included_cookies,
- CookieStatusList* excluded_cookies);
+ CookieAccessResultList* included_cookies,
+ CookieAccessResultList* excluded_cookies);
// Possibly delete an existing cookie equivalent to |cookie_being_set| (same
// path, domain, and name).
@@ -428,7 +436,7 @@ class NET_EXPORT CookieMonster : public CookieStore {
bool skip_httponly,
bool already_expired,
base::Time* creation_date_to_inherit,
- CanonicalCookie::CookieInclusionStatus* status);
+ CookieInclusionStatus* status);
// This is only used if the RecentCreationTimeGrantsLegacyCookieSemantics
// feature is enabled. It finds an equivalent cookie (based on name, domain,
@@ -562,7 +570,11 @@ class NET_EXPORT CookieMonster : public CookieStore {
// statistics if a sufficient time period has passed.
void RecordPeriodicStats(const base::Time& current_time);
- // Initialize the above variables; should only be called from
+ // Records the aforementioned stats if we have already finished loading all
+ // cookies. Returns whether stats were recorded.
+ bool DoRecordPeriodicStats();
+
+ // Initialize the histogram_* variables below; should only be called from
// the constructor.
void InitializeHistograms();
@@ -588,6 +600,15 @@ class NET_EXPORT CookieMonster : public CookieStore {
base::HistogramBase* histogram_cookie_source_scheme_;
base::HistogramBase* histogram_time_blocked_on_load_;
+ // Set of keys (eTLD+1's) for which non-expired cookies have
+ // been evicted for hitting the per-domain max. The size of this set is
+ // histogrammed periodically. The size is limited to |kMaxDomainPurgedKeys|.
+ std::set<std::string> domain_purged_keys_;
+
+ // The number of distinct keys (eTLD+1's) currently present in the |cookies_|
+ // multimap. This is histogrammed periodically.
+ size_t num_keys_;
+
CookieMap cookies_;
CookieMonsterChangeDispatcher change_dispatcher_;