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

Unified Diff: net/cookies/cookie_constants.h

Issue 1773133002: SameSite: Implement 'Strict'/'Lax' attribute parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ios? 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
Index: net/cookies/cookie_constants.h
diff --git a/net/cookies/cookie_constants.h b/net/cookies/cookie_constants.h
index 7e27e14657d24d44945e5d34ec57620897e7fa86..00e7202da86bd9a01ecf2dbc46bea803680bad1b 100644
--- a/net/cookies/cookie_constants.h
+++ b/net/cookies/cookie_constants.h
@@ -18,6 +18,13 @@ enum CookiePriority {
COOKIE_PRIORITY_DEFAULT = COOKIE_PRIORITY_MEDIUM
};
+enum CookieSameSite {
mmenke 2016/03/11 18:08:30 Can we make this an enum class instead? Seems sim
Mike West 2016/03/14 10:18:54 Sure.
+ COOKIE_SAME_SITE_NONE = 0,
mmenke 2016/03/11 18:08:30 SAME_SITE_NONE seems kinda weird as a property of
Mike West 2016/03/14 10:18:53 `CookieSameSite::NO_RESTRICTION`?
+ COOKIE_SAME_SITE_LAX = 1,
+ COOKIE_SAME_SITE_STRICT = 2,
+ COOKIE_SAME_SITE_DEFAULT = COOKIE_SAME_SITE_NONE
+};
+
// Returns the Set-Cookie header priority token corresponding to |priority|.
NET_EXPORT const std::string CookiePriorityToString(CookiePriority priority);
@@ -25,6 +32,13 @@ NET_EXPORT const std::string CookiePriorityToString(CookiePriority priority);
// Defaults to COOKIE_PRIORITY_DEFAULT for empty or unrecognized strings.
NET_EXPORT CookiePriority StringToCookiePriority(const std::string& priority);
+// Returns the Set-Cookie header SameSite token corresponding to |samesite|.
+NET_EXPORT const std::string CookieSameSiteToString(CookieSameSite samesite);
mmenke 2016/03/11 18:08:30 This const seems weird (As does the one in CookieP
mmenke 2016/03/11 18:08:30 same_site is what we use everywhere else (x4, for
Mike West 2016/03/14 10:18:54 Removed.
+
+// Converst the Set-Cookie header SameSite token |samesite| to a CookieSameSite.
+// Defaults to COOKIE_SAME_SITE_DEFAULT for empty or unrecognized strings.
+NET_EXPORT CookieSameSite StringToCookieSameSite(const std::string& samesite);
+
} // namespace net
#endif // NET_COOKIES_COOKIE_CONSTANTS_H_

Powered by Google App Engine
This is Rietveld 408576698