| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 the letter D and the number 2. | 5 // Brought to you by the letter D and the number 2. |
| 6 | 6 |
| 7 #ifndef NET_BASE_COOKIE_MONSTER_H_ | 7 #ifndef NET_BASE_COOKIE_MONSTER_H_ |
| 8 #define NET_BASE_COOKIE_MONSTER_H_ | 8 #define NET_BASE_COOKIE_MONSTER_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 const std::string& Path() const { return pairs_[path_index_].second; } | 258 const std::string& Path() const { return pairs_[path_index_].second; } |
| 259 bool HasDomain() const { return domain_index_ != 0; } | 259 bool HasDomain() const { return domain_index_ != 0; } |
| 260 const std::string& Domain() const { return pairs_[domain_index_].second; } | 260 const std::string& Domain() const { return pairs_[domain_index_].second; } |
| 261 bool HasExpires() const { return expires_index_ != 0; } | 261 bool HasExpires() const { return expires_index_ != 0; } |
| 262 const std::string& Expires() const { return pairs_[expires_index_].second; } | 262 const std::string& Expires() const { return pairs_[expires_index_].second; } |
| 263 bool HasMaxAge() const { return maxage_index_ != 0; } | 263 bool HasMaxAge() const { return maxage_index_ != 0; } |
| 264 const std::string& MaxAge() const { return pairs_[maxage_index_].second; } | 264 const std::string& MaxAge() const { return pairs_[maxage_index_].second; } |
| 265 bool IsSecure() const { return secure_index_ != 0; } | 265 bool IsSecure() const { return secure_index_ != 0; } |
| 266 bool IsHttpOnly() const { return httponly_index_ != 0; } | 266 bool IsHttpOnly() const { return httponly_index_ != 0; } |
| 267 | 267 |
| 268 // Return the number of attributes, for example, returning 2 for: |
| 269 // "BLAH=hah; path=/; domain=.google.com" |
| 270 size_t NumberOfAttributes() const { return pairs_.size() - 1; } |
| 271 |
| 268 // For debugging only! | 272 // For debugging only! |
| 269 std::string DebugString() const; | 273 std::string DebugString() const; |
| 270 | 274 |
| 271 private: | 275 private: |
| 272 void ParseTokenValuePairs(const std::string& cookie_line); | 276 void ParseTokenValuePairs(const std::string& cookie_line); |
| 273 void SetupAttributes(); | 277 void SetupAttributes(); |
| 274 | 278 |
| 275 PairList pairs_; | 279 PairList pairs_; |
| 276 bool is_valid_; | 280 bool is_valid_; |
| 277 // These will default to 0, but that should never be valid since the | 281 // These will default to 0, but that should never be valid since the |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 PersistentCookieStore() { } | 384 PersistentCookieStore() { } |
| 381 | 385 |
| 382 private: | 386 private: |
| 383 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 387 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
| 384 }; | 388 }; |
| 385 | 389 |
| 386 } // namespace net | 390 } // namespace net |
| 387 | 391 |
| 388 #endif // NET_BASE_COOKIE_MONSTER_H_ | 392 #endif // NET_BASE_COOKIE_MONSTER_H_ |
| 389 | 393 |
| OLD | NEW |