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

Unified Diff: net/cookies/cookie_monster_store_test.cc

Issue 2633663003: Implements strict secure cookies as the default behavior in //net (Closed)
Patch Set: Rebase on ToT Created 3 years, 11 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.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster_store_test.cc
diff --git a/net/cookies/cookie_monster_store_test.cc b/net/cookies/cookie_monster_store_test.cc
index 1375134a16c0e581c1007e8ce96b22788809da00..558d4bc02c3dd500a2c6b47037fb9bd2b04c2106 100644
--- a/net/cookies/cookie_monster_store_test.cc
+++ b/net/cookies/cookie_monster_store_test.cc
@@ -133,7 +133,7 @@ std::unique_ptr<CanonicalCookie> BuildCanonicalCookie(
return CanonicalCookie::Create(url, pc.Name(), pc.Value(), url.host(),
cookie_path, creation_time, cookie_expires,
pc.IsSecure(), pc.IsHttpOnly(), pc.SameSite(),
- false, pc.Priority());
+ pc.Priority());
}
void AddCookieToList(const GURL& url,
@@ -235,10 +235,13 @@ std::unique_ptr<CookieMonster> CreateMonsterFromStoreForGC(
? current - base::TimeDelta::FromDays(days_old)
: current;
+ // The URL must be HTTPS since |secure| can be true or false, and because
+ // strict secure cookies are enforced, the cookie will fail to be created if
+ // |secure| is true but the URL is an insecure scheme.
std::unique_ptr<CanonicalCookie> cc(CanonicalCookie::Create(
- GURL(base::StringPrintf("http://h%05d.izzle/", i)), "a", "1",
+ GURL(base::StringPrintf("https://h%05d.izzle/", i)), "a", "1",
std::string(), "/path", creation_time, expiration_time, secure, false,
- CookieSameSite::DEFAULT_MODE, false, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT));
cc->SetLastAccessDate(last_access_time);
store->AddCookie(*cc);
}
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698