| 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 <deque> | 10 #include <deque> |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 522 |
| 523 // Invokes deferred calls. | 523 // Invokes deferred calls. |
| 524 void InvokeQueue(); | 524 void InvokeQueue(); |
| 525 | 525 |
| 526 // Checks that |cookies_| matches our invariants, and tries to repair any | 526 // Checks that |cookies_| matches our invariants, and tries to repair any |
| 527 // inconsistencies. (In other words, it does not have duplicate cookies). | 527 // inconsistencies. (In other words, it does not have duplicate cookies). |
| 528 void EnsureCookiesMapIsValid(); | 528 void EnsureCookiesMapIsValid(); |
| 529 | 529 |
| 530 // Checks for any duplicate cookies for CookieMap key |key| which lie between | 530 // Checks for any duplicate cookies for CookieMap key |key| which lie between |
| 531 // |begin| and |end|. If any are found, all but the most recent are deleted. | 531 // |begin| and |end|. If any are found, all but the most recent are deleted. |
| 532 // Returns the number of duplicate cookies that were deleted. | 532 void TrimDuplicateCookiesForKey(const std::string& key, |
| 533 int TrimDuplicateCookiesForKey(const std::string& key, | 533 CookieMap::iterator begin, |
| 534 CookieMap::iterator begin, | 534 CookieMap::iterator end); |
| 535 CookieMap::iterator end); | |
| 536 | 535 |
| 537 void SetDefaultCookieableSchemes(); | 536 void SetDefaultCookieableSchemes(); |
| 538 | 537 |
| 539 void FindCookiesForHostAndDomain(const GURL& url, | 538 void FindCookiesForHostAndDomain(const GURL& url, |
| 540 const CookieOptions& options, | 539 const CookieOptions& options, |
| 541 bool update_access_time, | 540 bool update_access_time, |
| 542 std::vector<CanonicalCookie*>* cookies); | 541 std::vector<CanonicalCookie*>* cookies); |
| 543 | 542 |
| 544 void FindCookiesForKey(const std::string& key, | 543 void FindCookiesForKey(const std::string& key, |
| 545 const GURL& url, | 544 const GURL& url, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 CookieList* cookies_to_add, | 655 CookieList* cookies_to_add, |
| 657 CookieList* cookies_to_delete); | 656 CookieList* cookies_to_delete); |
| 658 | 657 |
| 659 // Run all cookie changed callbacks that are monitoring |cookie|. | 658 // Run all cookie changed callbacks that are monitoring |cookie|. |
| 660 // |removed| is true if the cookie was deleted. | 659 // |removed| is true if the cookie was deleted. |
| 661 void RunCallbacks(const CanonicalCookie& cookie, bool removed); | 660 void RunCallbacks(const CanonicalCookie& cookie, bool removed); |
| 662 | 661 |
| 663 // Histogram variables; see CookieMonster::InitializeHistograms() in | 662 // Histogram variables; see CookieMonster::InitializeHistograms() in |
| 664 // cookie_monster.cc for details. | 663 // cookie_monster.cc for details. |
| 665 base::HistogramBase* histogram_expiration_duration_minutes_; | 664 base::HistogramBase* histogram_expiration_duration_minutes_; |
| 666 base::HistogramBase* histogram_between_access_interval_minutes_; | |
| 667 base::HistogramBase* histogram_evicted_last_access_minutes_; | 665 base::HistogramBase* histogram_evicted_last_access_minutes_; |
| 668 base::HistogramBase* histogram_count_; | 666 base::HistogramBase* histogram_count_; |
| 669 base::HistogramBase* histogram_domain_count_; | |
| 670 base::HistogramBase* histogram_etldp1_count_; | |
| 671 base::HistogramBase* histogram_domain_per_etldp1_count_; | |
| 672 base::HistogramBase* histogram_number_duplicate_db_cookies_; | |
| 673 base::HistogramBase* histogram_cookie_deletion_cause_; | 667 base::HistogramBase* histogram_cookie_deletion_cause_; |
| 674 base::HistogramBase* histogram_cookie_type_; | 668 base::HistogramBase* histogram_cookie_type_; |
| 675 base::HistogramBase* histogram_time_mac_; | |
| 676 base::HistogramBase* histogram_time_blocked_on_load_; | 669 base::HistogramBase* histogram_time_blocked_on_load_; |
| 677 | 670 |
| 678 CookieMap cookies_; | 671 CookieMap cookies_; |
| 679 | 672 |
| 680 // Indicates whether the cookie store has been initialized. | 673 // Indicates whether the cookie store has been initialized. |
| 681 bool initialized_; | 674 bool initialized_; |
| 682 | 675 |
| 683 // Indicates whether the cookie store has started fetching all cookies. | 676 // Indicates whether the cookie store has started fetching all cookies. |
| 684 bool started_fetching_all_cookies_; | 677 bool started_fetching_all_cookies_; |
| 685 // Indicates whether the cookie store has finished fetching all cookies. | 678 // Indicates whether the cookie store has finished fetching all cookies. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 virtual ~PersistentCookieStore() {} | 820 virtual ~PersistentCookieStore() {} |
| 828 | 821 |
| 829 private: | 822 private: |
| 830 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 823 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
| 831 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 824 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
| 832 }; | 825 }; |
| 833 | 826 |
| 834 } // namespace net | 827 } // namespace net |
| 835 | 828 |
| 836 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 829 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
| OLD | NEW |