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 // 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_COOKIES_COOKIE_MONSTER_H_ | 7 #ifndef NET_COOKIES_COOKIE_MONSTER_H_ |
8 #define NET_COOKIES_COOKIE_MONSTER_H_ | 8 #define NET_COOKIES_COOKIE_MONSTER_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 const GetCookieListCallback& callback) override; | 176 const GetCookieListCallback& callback) override; |
177 void GetAllCookiesAsync(const GetCookieListCallback& callback) override; | 177 void GetAllCookiesAsync(const GetCookieListCallback& callback) override; |
178 void DeleteCookieAsync(const GURL& url, | 178 void DeleteCookieAsync(const GURL& url, |
179 const std::string& cookie_name, | 179 const std::string& cookie_name, |
180 const base::Closure& callback) override; | 180 const base::Closure& callback) override; |
181 void DeleteCanonicalCookieAsync(const CanonicalCookie& cookie, | 181 void DeleteCanonicalCookieAsync(const CanonicalCookie& cookie, |
182 const DeleteCallback& callback) override; | 182 const DeleteCallback& callback) override; |
183 void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, | 183 void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, |
184 const base::Time& delete_end, | 184 const base::Time& delete_end, |
185 const DeleteCallback& callback) override; | 185 const DeleteCallback& callback) override; |
186 void DeleteAllCreatedBetweenForHostAsync( | 186 void DeleteAllCreatedBetweenWithPredicateAsync( |
187 const base::Time delete_begin, | 187 const base::Time& delete_begin, |
188 const base::Time delete_end, | 188 const base::Time& delete_end, |
189 const GURL& url, | 189 const base::Callback<bool(const CanonicalCookie&)>& predicate, |
190 const DeleteCallback& callback) override; | 190 const DeleteCallback& callback) override; |
191 void DeleteSessionCookiesAsync(const DeleteCallback&) override; | 191 void DeleteSessionCookiesAsync(const DeleteCallback&) override; |
192 void FlushStore(const base::Closure& callback) override; | 192 void FlushStore(const base::Closure& callback) override; |
193 void SetForceKeepSessionState() override; | 193 void SetForceKeepSessionState() override; |
194 | 194 |
195 // Resets the list of cookieable schemes to the supplied schemes. Does | 195 // Resets the list of cookieable schemes to the supplied schemes. Does |
196 // nothing if called after first use of the instance (i.e. after the | 196 // nothing if called after first use of the instance (i.e. after the |
197 // instance initialization process). | 197 // instance initialization process). |
198 void SetCookieableSchemes(const std::vector<std::string>& schemes); | 198 void SetCookieableSchemes(const std::vector<std::string>& schemes); |
199 | 199 |
(...skipping 16 matching lines...) Expand all Loading... |
216 const CookieChangedCallback& callback) override; | 216 const CookieChangedCallback& callback) override; |
217 | 217 |
218 bool IsEphemeral() override; | 218 bool IsEphemeral() override; |
219 | 219 |
220 private: | 220 private: |
221 // For queueing the cookie monster calls. | 221 // For queueing the cookie monster calls. |
222 class CookieMonsterTask; | 222 class CookieMonsterTask; |
223 template <typename Result> | 223 template <typename Result> |
224 class DeleteTask; | 224 class DeleteTask; |
225 class DeleteAllCreatedBetweenTask; | 225 class DeleteAllCreatedBetweenTask; |
226 class DeleteAllCreatedBetweenForHostTask; | 226 class DeleteAllCreatedBetweenWithPredicateTask; |
227 class DeleteCookieTask; | 227 class DeleteCookieTask; |
228 class DeleteCanonicalCookieTask; | 228 class DeleteCanonicalCookieTask; |
229 class GetCookieListForURLWithOptionsTask; | 229 class GetCookieListForURLWithOptionsTask; |
230 class GetAllCookiesTask; | 230 class GetAllCookiesTask; |
231 class GetCookiesWithOptionsTask; | 231 class GetCookiesWithOptionsTask; |
232 class GetCookieListWithOptionsTask; | 232 class GetCookieListWithOptionsTask; |
233 class SetAllCookiesTask; | 233 class SetAllCookiesTask; |
234 class SetCookieWithDetailsTask; | 234 class SetCookieWithDetailsTask; |
235 class SetCookieWithOptionsTask; | 235 class SetCookieWithOptionsTask; |
236 class DeleteSessionCookiesTask; | 236 class DeleteSessionCookiesTask; |
237 | 237 |
238 // Testing support. | 238 // Testing support. |
239 // For SetCookieWithCreationTime. | 239 // For SetCookieWithCreationTime. |
240 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, | 240 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, |
241 TestCookieDeleteAllCreatedBetweenTimestamps); | 241 TestCookieDeleteAllCreatedBetweenTimestamps); |
| 242 FRIEND_TEST_ALL_PREFIXES( |
| 243 CookieMonsterTest, |
| 244 TestCookieDeleteAllCreatedBetweenTimestampsWithPredicate); |
242 | 245 |
243 // For gargage collection constants. | 246 // For gargage collection constants. |
244 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestHostGarbageCollection); | 247 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestHostGarbageCollection); |
245 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestTotalGarbageCollection); | 248 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestTotalGarbageCollection); |
246 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, GarbageCollectionTriggers); | 249 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, GarbageCollectionTriggers); |
247 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestGCTimes); | 250 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestGCTimes); |
248 | 251 |
249 // For validation of key values. | 252 // For validation of key values. |
250 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestDomainTree); | 253 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestDomainTree); |
251 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestImport); | 254 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestImport); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 CookiePriority priority); | 402 CookiePriority priority); |
400 | 403 |
401 CookieList GetAllCookies(); | 404 CookieList GetAllCookies(); |
402 | 405 |
403 CookieList GetCookieListWithOptions(const GURL& url, | 406 CookieList GetCookieListWithOptions(const GURL& url, |
404 const CookieOptions& options); | 407 const CookieOptions& options); |
405 | 408 |
406 int DeleteAllCreatedBetween(const base::Time& delete_begin, | 409 int DeleteAllCreatedBetween(const base::Time& delete_begin, |
407 const base::Time& delete_end); | 410 const base::Time& delete_end); |
408 | 411 |
409 int DeleteAllCreatedBetweenForHost(const base::Time delete_begin, | 412 // Predicate will be called with the calling thread. |
410 const base::Time delete_end, | 413 int DeleteAllCreatedBetweenWithPredicate( |
411 const GURL& url); | 414 const base::Time& delete_begin, |
| 415 const base::Time& delete_end, |
| 416 const base::Callback<bool(const CanonicalCookie&)>& predicate); |
412 | 417 |
413 bool SetCookieWithOptions(const GURL& url, | 418 bool SetCookieWithOptions(const GURL& url, |
414 const std::string& cookie_line, | 419 const std::string& cookie_line, |
415 const CookieOptions& options); | 420 const CookieOptions& options); |
416 | 421 |
417 std::string GetCookiesWithOptions(const GURL& url, | 422 std::string GetCookiesWithOptions(const GURL& url, |
418 const CookieOptions& options); | 423 const CookieOptions& options); |
419 | 424 |
420 void DeleteCookie(const GURL& url, const std::string& cookie_name); | 425 void DeleteCookie(const GURL& url, const std::string& cookie_name); |
421 | 426 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 virtual ~PersistentCookieStore() {} | 807 virtual ~PersistentCookieStore() {} |
803 | 808 |
804 private: | 809 private: |
805 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 810 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
806 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 811 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
807 }; | 812 }; |
808 | 813 |
809 } // namespace net | 814 } // namespace net |
810 | 815 |
811 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 816 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
OLD | NEW |