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

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: Moar. 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_options.h
diff --git a/net/cookies/cookie_options.h b/net/cookies/cookie_options.h
index 801e958e268fac854f9bf784823704227e06ab4f..5689f6e078eeb5cedf49317b3001cf7c6160dde8 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 SameSiteMode {
+ INCLUDE_STRICT_AND_LAX,
+ INCLUDE_LAX,
+ DO_NOT_INCLUDE
mmenke 2016/03/17 19:15:56 SameSiteMode::DO_NOT_INCLUDE seems weird...Maybe S
Mike West 2016/03/17 19:57:12 I come from Blink. I was born in verbosity. :)
Mike West 2016/03/18 14:27:17 Done.
+ };
+
// Creates a CookieOptions object which:
//
// * Excludes HttpOnly cookies
@@ -25,7 +32,7 @@ class NET_EXPORT CookieOptions {
// These settings can be altered by calling:
//
// * |set_{include,exclude}_httponly()|
- // * |set_include_same_site()|
+ // * |set_same_site_mode(CookieOptions::SameSiteMode::INCLUDE_STRICT_AND_LAX)|
// * |set_enforce_prefixes()|
// * |set_do_not_update_access_time()|
CookieOptions();
@@ -35,8 +42,8 @@ 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_mode(SameSiteMode mode) { same_site_mode_ = mode; }
+ SameSiteMode same_site_mode() const { return same_site_mode_; }
// TODO(jww): Remove once we decide whether to ship modifying 'secure' cookies
// only from secure schemes. https://crbug.com/546820
@@ -57,7 +64,7 @@ class NET_EXPORT CookieOptions {
private:
bool exclude_httponly_;
- bool include_same_site_;
+ SameSiteMode same_site_mode_;
bool enforce_strict_secure_;
bool update_access_time_;
base::Time server_time_;

Powered by Google App Engine
This is Rietveld 408576698