| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 CookieMonster(PersistentCookieStore* store, Delegate* delegate); | 139 CookieMonster(PersistentCookieStore* store, Delegate* delegate); |
| 140 | 140 |
| 141 // Only used during unit testing. | 141 // Only used during unit testing. |
| 142 CookieMonster(PersistentCookieStore* store, | 142 CookieMonster(PersistentCookieStore* store, |
| 143 Delegate* delegate, | 143 Delegate* delegate, |
| 144 int last_access_threshold_milliseconds); | 144 int last_access_threshold_milliseconds); |
| 145 | 145 |
| 146 // Parses the string with the cookie time (very forgivingly). | 146 // Parses the string with the cookie time (very forgivingly). |
| 147 static base::Time ParseCookieTime(const std::string& time_string); | 147 static base::Time ParseCookieTime(const std::string& time_string); |
| 148 | 148 |
| 149 // Returns true if a domain string represents a host-only cookie, | |
| 150 // i.e. it doesn't begin with a leading '.' character. | |
| 151 static bool DomainIsHostOnly(const std::string& domain_string); | |
| 152 | |
| 153 // Helper function that adds all cookies from |list| into this instance. | 149 // Helper function that adds all cookies from |list| into this instance. |
| 154 bool InitializeFrom(const CookieList& list); | 150 bool InitializeFrom(const CookieList& list); |
| 155 | 151 |
| 156 typedef base::Callback<void(const CookieList& cookies)> GetCookieListCallback; | 152 typedef base::Callback<void(const CookieList& cookies)> GetCookieListCallback; |
| 157 typedef base::Callback<void(int num_deleted)> DeleteCallback; | 153 typedef base::Callback<void(int num_deleted)> DeleteCallback; |
| 158 typedef base::Callback<void(bool success)> DeleteCookieCallback; | 154 typedef base::Callback<void(bool success)> DeleteCookieCallback; |
| 159 | 155 |
| 160 // Sets a cookie given explicit user-provided cookie attributes. The cookie | 156 // Sets a cookie given explicit user-provided cookie attributes. The cookie |
| 161 // name, value, domain, etc. are each provided as separate strings. This | 157 // name, value, domain, etc. are each provided as separate strings. This |
| 162 // function expects each attribute to be well-formed. It will check for | 158 // function expects each attribute to be well-formed. It will check for |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 private: | 984 private: |
| 989 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 985 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
| 990 }; | 986 }; |
| 991 | 987 |
| 992 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { | 988 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { |
| 993 }; | 989 }; |
| 994 | 990 |
| 995 } // namespace net | 991 } // namespace net |
| 996 | 992 |
| 997 #endif // NET_BASE_COOKIE_MONSTER_H_ | 993 #endif // NET_BASE_COOKIE_MONSTER_H_ |
| OLD | NEW |