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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 const std::string& domain, | 169 const std::string& domain, |
170 const std::string& path, | 170 const std::string& path, |
171 base::Time creation_time, | 171 base::Time creation_time, |
172 base::Time expiration_time, | 172 base::Time expiration_time, |
173 base::Time last_access_time, | 173 base::Time last_access_time, |
174 bool secure, | 174 bool secure, |
175 bool http_only, | 175 bool http_only, |
176 CookieSameSite same_site, | 176 CookieSameSite same_site, |
177 CookiePriority priority, | 177 CookiePriority priority, |
178 const SetCookiesCallback& callback) override; | 178 const SetCookiesCallback& callback) override; |
| 179 void SetCanonicalCookieAsync(const CanonicalCookie& cookie, |
| 180 bool secure_source, |
| 181 bool modify_http_only, |
| 182 const SetCookiesCallback& callback) override; |
179 void GetCookiesWithOptionsAsync(const GURL& url, | 183 void GetCookiesWithOptionsAsync(const GURL& url, |
180 const CookieOptions& options, | 184 const CookieOptions& options, |
181 const GetCookiesCallback& callback) override; | 185 const GetCookiesCallback& callback) override; |
182 void GetCookieListWithOptionsAsync( | 186 void GetCookieListWithOptionsAsync( |
183 const GURL& url, | 187 const GURL& url, |
184 const CookieOptions& options, | 188 const CookieOptions& options, |
185 const GetCookieListCallback& callback) override; | 189 const GetCookieListCallback& callback) override; |
186 void GetAllCookiesAsync(const GetCookieListCallback& callback) override; | 190 void GetAllCookiesAsync(const GetCookieListCallback& callback) override; |
187 void DeleteCookieAsync(const GURL& url, | 191 void DeleteCookieAsync(const GURL& url, |
188 const std::string& cookie_name, | 192 const std::string& cookie_name, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 class DeleteAllCreatedBetweenWithPredicateTask; | 244 class DeleteAllCreatedBetweenWithPredicateTask; |
241 class DeleteCookieTask; | 245 class DeleteCookieTask; |
242 class DeleteCanonicalCookieTask; | 246 class DeleteCanonicalCookieTask; |
243 class GetCookieListForURLWithOptionsTask; | 247 class GetCookieListForURLWithOptionsTask; |
244 class GetAllCookiesTask; | 248 class GetAllCookiesTask; |
245 class GetCookiesWithOptionsTask; | 249 class GetCookiesWithOptionsTask; |
246 class GetCookieListWithOptionsTask; | 250 class GetCookieListWithOptionsTask; |
247 class SetAllCookiesTask; | 251 class SetAllCookiesTask; |
248 class SetCookieWithDetailsTask; | 252 class SetCookieWithDetailsTask; |
249 class SetCookieWithOptionsTask; | 253 class SetCookieWithOptionsTask; |
| 254 class SetCanonicalCookieTask; |
250 class DeleteSessionCookiesTask; | 255 class DeleteSessionCookiesTask; |
251 | 256 |
252 // Testing support. | 257 // Testing support. |
253 // For SetCookieWithCreationTime. | 258 // For SetCookieWithCreationTime. |
254 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, | 259 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, |
255 TestCookieDeleteAllCreatedBetweenTimestamps); | 260 TestCookieDeleteAllCreatedBetweenTimestamps); |
256 FRIEND_TEST_ALL_PREFIXES( | 261 FRIEND_TEST_ALL_PREFIXES( |
257 CookieMonsterTest, | 262 CookieMonsterTest, |
258 TestCookieDeleteAllCreatedBetweenTimestampsWithPredicate); | 263 TestCookieDeleteAllCreatedBetweenTimestampsWithPredicate); |
259 | 264 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 const std::string& domain, | 425 const std::string& domain, |
421 const std::string& path, | 426 const std::string& path, |
422 base::Time creation_time, | 427 base::Time creation_time, |
423 base::Time expiration_time, | 428 base::Time expiration_time, |
424 base::Time last_access_time, | 429 base::Time last_access_time, |
425 bool secure, | 430 bool secure, |
426 bool http_only, | 431 bool http_only, |
427 CookieSameSite same_site, | 432 CookieSameSite same_site, |
428 CookiePriority priority); | 433 CookiePriority priority); |
429 | 434 |
| 435 // Sets a canonical cookie, deletes equivalents and performs garbage |
| 436 // collection. |source_secure| indicates if the cookie is being set |
| 437 // from a secure source (e.g. a cryptographic scheme). |
| 438 // |modify_http_only| indicates if this setting operation is allowed |
| 439 // to affect http_only cookies. |
| 440 bool SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cookie, |
| 441 bool secure_source, |
| 442 bool can_modify_httponly); |
| 443 |
430 CookieList GetAllCookies(); | 444 CookieList GetAllCookies(); |
431 | 445 |
432 CookieList GetCookieListWithOptions(const GURL& url, | 446 CookieList GetCookieListWithOptions(const GURL& url, |
433 const CookieOptions& options); | 447 const CookieOptions& options); |
434 | 448 |
435 int DeleteAllCreatedBetween(const base::Time& delete_begin, | 449 int DeleteAllCreatedBetween(const base::Time& delete_begin, |
436 const base::Time& delete_end); | 450 const base::Time& delete_end); |
437 | 451 |
438 // Predicate will be called with the calling thread. | 452 // Predicate will be called with the calling thread. |
439 int DeleteAllCreatedBetweenWithPredicate( | 453 int DeleteAllCreatedBetweenWithPredicate( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 bool sync_to_store); | 552 bool sync_to_store); |
539 | 553 |
540 // Helper function that sets cookies with more control. | 554 // Helper function that sets cookies with more control. |
541 // Not exposed as we don't want callers to have the ability | 555 // Not exposed as we don't want callers to have the ability |
542 // to specify (potentially duplicate) creation times. | 556 // to specify (potentially duplicate) creation times. |
543 bool SetCookieWithCreationTimeAndOptions(const GURL& url, | 557 bool SetCookieWithCreationTimeAndOptions(const GURL& url, |
544 const std::string& cookie_line, | 558 const std::string& cookie_line, |
545 const base::Time& creation_time, | 559 const base::Time& creation_time, |
546 const CookieOptions& options); | 560 const CookieOptions& options); |
547 | 561 |
548 // Sets a canonical cookie, deletes equivalents and performs garbage | |
549 // collection. |source_secure| indicates if the cookie is being set | |
550 // from a secure source (e.g. a cryptographic scheme). | |
551 // |modify_http_only| indicates if this setting operation is allowed | |
552 // to affect http_only cookies. | |
553 bool SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cookie, | |
554 bool secure_source, | |
555 bool can_modify_httponly); | |
556 | |
557 // Sets all cookies from |list| after deleting any equivalent cookie. | 562 // Sets all cookies from |list| after deleting any equivalent cookie. |
558 // For data gathering purposes, this routine is treated as if it is | 563 // For data gathering purposes, this routine is treated as if it is |
559 // restoring saved cookies; some statistics are not gathered in this case. | 564 // restoring saved cookies; some statistics are not gathered in this case. |
560 bool SetAllCookies(const CookieList& list); | 565 bool SetAllCookies(const CookieList& list); |
561 | 566 |
562 void InternalUpdateCookieAccessTime(CanonicalCookie* cc, | 567 void InternalUpdateCookieAccessTime(CanonicalCookie* cc, |
563 const base::Time& current_time); | 568 const base::Time& current_time); |
564 | 569 |
565 // |deletion_cause| argument is used for collecting statistics and choosing | 570 // |deletion_cause| argument is used for collecting statistics and choosing |
566 // the correct CookieStore::ChangeCause for OnCookieChanged | 571 // the correct CookieStore::ChangeCause for OnCookieChanged |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 virtual ~PersistentCookieStore() {} | 832 virtual ~PersistentCookieStore() {} |
828 | 833 |
829 private: | 834 private: |
830 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 835 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
831 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 836 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
832 }; | 837 }; |
833 | 838 |
834 } // namespace net | 839 } // namespace net |
835 | 840 |
836 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 841 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
OLD | NEW |