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

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

Issue 1868493002: Ignore cookies with invalid 'SameSite' attribute values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef NET_COOKIES_COOKIE_CONSTANTS_H_ 5 #ifndef NET_COOKIES_COOKIE_CONSTANTS_H_
6 #define NET_COOKIES_COOKIE_CONSTANTS_H_ 6 #define NET_COOKIES_COOKIE_CONSTANTS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 enum CookiePriority { 14 enum CookiePriority {
15 COOKIE_PRIORITY_LOW = 0, 15 COOKIE_PRIORITY_LOW = 0,
16 COOKIE_PRIORITY_MEDIUM = 1, 16 COOKIE_PRIORITY_MEDIUM = 1,
17 COOKIE_PRIORITY_HIGH = 2, 17 COOKIE_PRIORITY_HIGH = 2,
18 COOKIE_PRIORITY_DEFAULT = COOKIE_PRIORITY_MEDIUM 18 COOKIE_PRIORITY_DEFAULT = COOKIE_PRIORITY_MEDIUM
19 }; 19 };
20 20
21 enum class CookieSameSite { 21 enum class CookieSameSite {
22 NO_RESTRICTION = 0, 22 NO_RESTRICTION = 0,
23 LAX_MODE = 1, 23 LAX_MODE = 1,
24 STRICT_MODE = 2, 24 STRICT_MODE = 2,
25 INVALID_MODE = 3,
25 DEFAULT_MODE = NO_RESTRICTION 26 DEFAULT_MODE = NO_RESTRICTION
26 }; 27 };
27 28
28 // Returns the Set-Cookie header priority token corresponding to |priority|. 29 // Returns the Set-Cookie header priority token corresponding to |priority|.
29 // 30 //
30 // TODO(mkwst): Remove this once its callsites are refactored. 31 // TODO(mkwst): Remove this once its callsites are refactored.
31 NET_EXPORT std::string CookiePriorityToString(CookiePriority priority); 32 NET_EXPORT std::string CookiePriorityToString(CookiePriority priority);
32 33
33 // Converts the Set-Cookie header priority token |priority| to a CookiePriority. 34 // Converts the Set-Cookie header priority token |priority| to a CookiePriority.
34 // Defaults to COOKIE_PRIORITY_DEFAULT for empty or unrecognized strings. 35 // Defaults to COOKIE_PRIORITY_DEFAULT for empty or unrecognized strings.
35 NET_EXPORT CookiePriority StringToCookiePriority(const std::string& priority); 36 NET_EXPORT CookiePriority StringToCookiePriority(const std::string& priority);
36 37
37 // Converst the Set-Cookie header SameSite token |same_site| to a 38 // Converst the Set-Cookie header SameSite token |same_site| to a
38 // CookieSameSite. Defaults to CookieSameSite::DEFAULT_MODE for empty or 39 // CookieSameSite. Defaults to CookieSameSite::DEFAULT_MODE for empty or
39 // unrecognized strings. 40 // unrecognized strings.
40 NET_EXPORT CookieSameSite StringToCookieSameSite(const std::string& same_site); 41 NET_EXPORT CookieSameSite StringToCookieSameSite(const std::string& same_site);
41 42
42 } // namespace net 43 } // namespace net
43 44
44 #endif // NET_COOKIES_COOKIE_CONSTANTS_H_ 45 #endif // NET_COOKIES_COOKIE_CONSTANTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698