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

Side by Side Diff: net/cookies/cookie_options.h

Issue 1615773005: Rename first-party-only cookies to same-site cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a few. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Brought to you by number 42. 5 // Brought to you by number 42.
6 6
7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_ 7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_
8 #define NET_COOKIES_COOKIE_OPTIONS_H_ 8 #define NET_COOKIES_COOKIE_OPTIONS_H_
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "net/base/net_export.h" 11 #include "net/base/net_export.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 class NET_EXPORT CookieOptions { 16 class NET_EXPORT CookieOptions {
17 public: 17 public:
18 // Creates a CookieOptions object which: 18 // Creates a CookieOptions object which:
19 // 19 //
20 // * Excludes HttpOnly cookies 20 // * Excludes HttpOnly cookies
21 // * Excludes First-Party-Only cookies 21 // * Excludes SameSite cookies
22 // * Does not enforce prefix restrictions (e.g. "$Secure-*") 22 // * Does not enforce prefix restrictions (e.g. "$Secure-*")
23 // 23 //
24 // These settings can be altered by calling: 24 // These settings can be altered by calling:
25 // 25 //
26 // * |set_{include,exclude}_httponly()| 26 // * |set_{include,exclude}_httponly()|
27 // * |set_include_first_party_only_cookies()| 27 // * |set_include_samesite()|
28 // * |set_enforce_prefixes()| 28 // * |set_enforce_prefixes()|
29 CookieOptions(); 29 CookieOptions();
30 30
31 void set_exclude_httponly() { exclude_httponly_ = true; } 31 void set_exclude_httponly() { exclude_httponly_ = true; }
32 void set_include_httponly() { exclude_httponly_ = false; } 32 void set_include_httponly() { exclude_httponly_ = false; }
33 bool exclude_httponly() const { return exclude_httponly_; } 33 bool exclude_httponly() const { return exclude_httponly_; }
34 34
35 // Default is to exclude 'first-party-only' cookies. 35 // Default is to exclude 'samesite' cookies.
36 void set_include_first_party_only_cookies() { 36 void set_include_samesite() { include_samesite_ = true; }
mmenke 2016/01/25 18:47:10 same_site
Mike West 2016/01/26 11:05:45 Done.
37 include_first_party_only_cookies_ = true; 37 bool include_samesite() const { return include_samesite_; }
38 }
39 bool include_first_party_only_cookies() const {
40 return include_first_party_only_cookies_;
41 }
42 38
43 // TODO(jww): Remove once we decide whether to ship modifying 'secure' cookies 39 // TODO(jww): Remove once we decide whether to ship modifying 'secure' cookies
44 // only from secure schemes. https://crbug.com/546820 40 // only from secure schemes. https://crbug.com/546820
45 void set_enforce_strict_secure() { enforce_strict_secure_ = true; } 41 void set_enforce_strict_secure() { enforce_strict_secure_ = true; }
46 bool enforce_strict_secure() const { return enforce_strict_secure_; } 42 bool enforce_strict_secure() const { return enforce_strict_secure_; }
47 43
48 // |server_time| indicates what the server sending us the Cookie thought the 44 // |server_time| indicates what the server sending us the Cookie thought the
49 // current time was when the cookie was produced. This is used to adjust for 45 // current time was when the cookie was produced. This is used to adjust for
50 // clock skew between server and host. 46 // clock skew between server and host.
51 void set_server_time(const base::Time& server_time) { 47 void set_server_time(const base::Time& server_time) {
52 server_time_ = server_time; 48 server_time_ = server_time;
53 } 49 }
54 bool has_server_time() const { return !server_time_.is_null(); } 50 bool has_server_time() const { return !server_time_.is_null(); }
55 base::Time server_time() const { return server_time_; } 51 base::Time server_time() const { return server_time_; }
56 52
57 private: 53 private:
58 bool exclude_httponly_; 54 bool exclude_httponly_;
59 bool include_first_party_only_cookies_; 55 bool include_samesite_;
60 bool enforce_strict_secure_; 56 bool enforce_strict_secure_;
61 base::Time server_time_; 57 base::Time server_time_;
62 }; 58 };
63 59
64 } // namespace net 60 } // namespace net
65 61
66 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ 62 #endif // NET_COOKIES_COOKIE_OPTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698