| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |