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

Unified Diff: net/cookies/cookie_monster.cc

Issue 1773133002: SameSite: Implement 'Strict'/'Lax' attribute parsing. (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 | « net/cookies/cookie_monster.h ('k') | net/cookies/cookie_monster_store_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster.cc
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 19a2d6ac7f81f99dca36e1ec8fc1f47e6c722b71..8a7c87e5af10e684d95ac9daf4a60f3199ac454f 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -380,7 +380,7 @@ class CookieMonster::SetCookieWithDetailsTask : public CookieMonsterTask {
base::Time last_access_time,
bool secure,
bool http_only,
- bool same_site,
+ CookieSameSite same_site,
bool enforce_strict_secure,
CookiePriority priority,
const SetCookiesCallback& callback)
@@ -417,7 +417,7 @@ class CookieMonster::SetCookieWithDetailsTask : public CookieMonsterTask {
base::Time last_access_time_;
bool secure_;
bool http_only_;
- bool same_site_;
+ CookieSameSite same_site_;
bool enforce_strict_secure_;
CookiePriority priority_;
SetCookiesCallback callback_;
@@ -824,7 +824,7 @@ void CookieMonster::SetCookieWithDetailsAsync(
Time last_access_time,
bool secure,
bool http_only,
- bool same_site,
+ CookieSameSite same_site,
bool enforce_strict_secure,
CookiePriority priority,
const SetCookiesCallback& callback) {
@@ -1014,7 +1014,7 @@ bool CookieMonster::SetCookieWithDetails(const GURL& url,
base::Time last_access_time,
bool secure,
bool http_only,
- bool same_site,
+ CookieSameSite same_site,
bool enforce_strict_secure,
CookiePriority priority) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -1677,7 +1677,9 @@ CookieMonster::CookieMap::iterator CookieMonster::InternalInsertCookie(
}
// See InitializeHistograms() for details.
- int32_t type_sample = cc->IsSameSite() ? 1 << COOKIE_TYPE_SAME_SITE : 0;
+ int32_t type_sample = cc->SameSite() != CookieSameSite::NO_RESTRICTION
+ ? 1 << COOKIE_TYPE_SAME_SITE
+ : 0;
type_sample |= cc->IsHttpOnly() ? 1 << COOKIE_TYPE_HTTPONLY : 0;
type_sample |= cc->IsSecure() ? 1 << COOKIE_TYPE_SECURE : 0;
histogram_cookie_type_->Add(type_sample);
« no previous file with comments | « net/cookies/cookie_monster.h ('k') | net/cookies/cookie_monster_store_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698