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

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

Issue 1868493002: Ignore cookies with invalid 'SameSite' attribute values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename 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
« no previous file with comments | « net/cookies/canonical_cookie_unittest.cc ('k') | net/cookies/parsed_cookie.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_COOKIES_PARSED_COOKIE_H_ 5 #ifndef NET_COOKIES_PARSED_COOKIE_H_
6 #define NET_COOKIES_PARSED_COOKIE_H_ 6 #define NET_COOKIES_PARSED_COOKIE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Helper function for SetString and SetBool handling the case that the 122 // Helper function for SetString and SetBool handling the case that the
123 // key/value pair shall not be removed. 123 // key/value pair shall not be removed.
124 bool SetAttributePair(size_t* index, 124 bool SetAttributePair(size_t* index,
125 const std::string& key, 125 const std::string& key,
126 const std::string& value); 126 const std::string& value);
127 127
128 // Removes the key/value pair from a cookie that is identified by |index|. 128 // Removes the key/value pair from a cookie that is identified by |index|.
129 // |index| refers to a position in |pairs_|. 129 // |index| refers to a position in |pairs_|.
130 void ClearAttributePair(size_t index); 130 void ClearAttributePair(size_t index);
131 131
132 // Returns false if a 'SameSite' attribute is present, but has an unrecognized
133 // value. In particular, this includes attributes with empty values.
134 bool IsSameSiteAttributeValid() const;
135
132 PairList pairs_; 136 PairList pairs_;
133 // These will default to 0, but that should never be valid since the 137 // These will default to 0, but that should never be valid since the
134 // 0th index is the user supplied token/value, not an attribute. 138 // 0th index is the user supplied token/value, not an attribute.
135 // We're really never going to have more than like 8 attributes, so we 139 // We're really never going to have more than like 8 attributes, so we
136 // could fit these into 3 bits each if we're worried about size... 140 // could fit these into 3 bits each if we're worried about size...
137 size_t path_index_; 141 size_t path_index_;
138 size_t domain_index_; 142 size_t domain_index_;
139 size_t expires_index_; 143 size_t expires_index_;
140 size_t maxage_index_; 144 size_t maxage_index_;
141 size_t secure_index_; 145 size_t secure_index_;
142 size_t httponly_index_; 146 size_t httponly_index_;
143 size_t same_site_index_; 147 size_t same_site_index_;
144 size_t priority_index_; 148 size_t priority_index_;
145 149
146 DISALLOW_COPY_AND_ASSIGN(ParsedCookie); 150 DISALLOW_COPY_AND_ASSIGN(ParsedCookie);
147 }; 151 };
148 152
149 } // namespace net 153 } // namespace net
150 154
151 #endif // NET_COOKIES_COOKIE_MONSTER_H_ 155 #endif // NET_COOKIES_COOKIE_MONSTER_H_
OLDNEW
« no previous file with comments | « net/cookies/canonical_cookie_unittest.cc ('k') | net/cookies/parsed_cookie.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698