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

Unified Diff: net/cookies/cookie_options.h

Issue 1783813002: SameSite: Strict/Lax behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@strict-lax
Patch Set: Comment. 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.cc ('k') | net/cookies/cookie_options.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_options.h
diff --git a/net/cookies/cookie_options.h b/net/cookies/cookie_options.h
index 801e958e268fac854f9bf784823704227e06ab4f..d1c6afc63711f445632a0b01df47f049e9f510b8 100644
--- a/net/cookies/cookie_options.h
+++ b/net/cookies/cookie_options.h
@@ -9,12 +9,19 @@
#include "base/time/time.h"
#include "net/base/net_export.h"
+#include "net/cookies/cookie_constants.h"
#include "url/gurl.h"
namespace net {
class NET_EXPORT CookieOptions {
public:
+ enum class SameSiteCookieMode {
+ INCLUDE_STRICT_AND_LAX,
+ INCLUDE_LAX,
+ DO_NOT_INCLUDE
+ };
+
// Creates a CookieOptions object which:
//
// * Excludes HttpOnly cookies
@@ -25,7 +32,8 @@ class NET_EXPORT CookieOptions {
// These settings can be altered by calling:
//
// * |set_{include,exclude}_httponly()|
- // * |set_include_same_site()|
+ // * |set_same_site_cookie_mode(
+ // CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX)|
// * |set_enforce_prefixes()|
// * |set_do_not_update_access_time()|
CookieOptions();
@@ -35,8 +43,12 @@ class NET_EXPORT CookieOptions {
bool exclude_httponly() const { return exclude_httponly_; }
// Default is to exclude 'same_site' cookies.
- void set_include_same_site() { include_same_site_ = true; }
- bool include_same_site() const { return include_same_site_; }
+ void set_same_site_cookie_mode(SameSiteCookieMode mode) {
+ same_site_cookie_mode_ = mode;
+ }
+ SameSiteCookieMode same_site_cookie_mode() const {
+ return same_site_cookie_mode_;
+ }
// TODO(jww): Remove once we decide whether to ship modifying 'secure' cookies
// only from secure schemes. https://crbug.com/546820
@@ -57,7 +69,7 @@ class NET_EXPORT CookieOptions {
private:
bool exclude_httponly_;
- bool include_same_site_;
+ SameSiteCookieMode same_site_cookie_mode_;
bool enforce_strict_secure_;
bool update_access_time_;
base::Time server_time_;
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_options.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698