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

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

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 #include "net/cookies/cookie_constants.h" 5 #include "net/cookies/cookie_constants.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return COOKIE_PRIORITY_MEDIUM; 43 return COOKIE_PRIORITY_MEDIUM;
44 if (priority_comp == kPriorityLow) 44 if (priority_comp == kPriorityLow)
45 return COOKIE_PRIORITY_LOW; 45 return COOKIE_PRIORITY_LOW;
46 46
47 return COOKIE_PRIORITY_DEFAULT; 47 return COOKIE_PRIORITY_DEFAULT;
48 } 48 }
49 49
50 CookieSameSite StringToCookieSameSite(const std::string& same_site) { 50 CookieSameSite StringToCookieSameSite(const std::string& same_site) {
51 if (base::EqualsCaseInsensitiveASCII(same_site, kSameSiteLax)) 51 if (base::EqualsCaseInsensitiveASCII(same_site, kSameSiteLax))
52 return CookieSameSite::LAX_MODE; 52 return CookieSameSite::LAX_MODE;
53 if (base::EqualsCaseInsensitiveASCII(same_site, kSameSiteStrict)) 53 if (base::EqualsCaseInsensitiveASCII(same_site, kSameSiteStrict))
mmenke 2016/04/06 15:16:30 From spec: 1. If "cookie-av"'s "attribute-value"
54 return CookieSameSite::STRICT_MODE; 54 return CookieSameSite::STRICT_MODE;
55 return CookieSameSite::DEFAULT_MODE; 55 return CookieSameSite::INVALID_MODE;
56 } 56 }
57 57
58 } // namespace net 58 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698