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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 613 |
614 // Runs the task if, or defers the task until, the full cookie database is | 614 // Runs the task if, or defers the task until, the full cookie database is |
615 // loaded. | 615 // loaded. |
616 void DoCookieTask(const scoped_refptr<CookieMonsterTask>& task_item); | 616 void DoCookieTask(const scoped_refptr<CookieMonsterTask>& task_item); |
617 | 617 |
618 // Runs the task if, or defers the task until, the cookies for the given URL | 618 // Runs the task if, or defers the task until, the cookies for the given URL |
619 // are loaded. | 619 // are loaded. |
620 void DoCookieTaskForURL(const scoped_refptr<CookieMonsterTask>& task_item, | 620 void DoCookieTaskForURL(const scoped_refptr<CookieMonsterTask>& task_item, |
621 const GURL& url); | 621 const GURL& url); |
622 | 622 |
| 623 // Run all cookie changed callbacks that are monitoring |cookie|. |
| 624 // |removed| is true if the cookie was deleted. |
| 625 void RunCallbacks(const CanonicalCookie& cookie, bool removed); |
| 626 |
623 // Histogram variables; see CookieMonster::InitializeHistograms() in | 627 // Histogram variables; see CookieMonster::InitializeHistograms() in |
624 // cookie_monster.cc for details. | 628 // cookie_monster.cc for details. |
625 base::HistogramBase* histogram_expiration_duration_minutes_; | 629 base::HistogramBase* histogram_expiration_duration_minutes_; |
626 base::HistogramBase* histogram_between_access_interval_minutes_; | 630 base::HistogramBase* histogram_between_access_interval_minutes_; |
627 base::HistogramBase* histogram_evicted_last_access_minutes_; | 631 base::HistogramBase* histogram_evicted_last_access_minutes_; |
628 base::HistogramBase* histogram_count_; | 632 base::HistogramBase* histogram_count_; |
629 base::HistogramBase* histogram_domain_count_; | 633 base::HistogramBase* histogram_domain_count_; |
630 base::HistogramBase* histogram_etldp1_count_; | 634 base::HistogramBase* histogram_etldp1_count_; |
631 base::HistogramBase* histogram_domain_per_etldp1_count_; | 635 base::HistogramBase* histogram_domain_per_etldp1_count_; |
632 base::HistogramBase* histogram_number_duplicate_db_cookies_; | 636 base::HistogramBase* histogram_number_duplicate_db_cookies_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 701 |
698 // Static setting for whether or not file scheme cookies are allows when | 702 // Static setting for whether or not file scheme cookies are allows when |
699 // a new CookieMonster is created, or the accepted schemes on a CookieMonster | 703 // a new CookieMonster is created, or the accepted schemes on a CookieMonster |
700 // instance are reset back to defaults. | 704 // instance are reset back to defaults. |
701 static bool default_enable_file_scheme_; | 705 static bool default_enable_file_scheme_; |
702 | 706 |
703 typedef std::map<std::pair<GURL, std::string>, | 707 typedef std::map<std::pair<GURL, std::string>, |
704 linked_ptr<CookieChangedCallbackList>> CookieChangedHookMap; | 708 linked_ptr<CookieChangedCallbackList>> CookieChangedHookMap; |
705 CookieChangedHookMap hook_map_; | 709 CookieChangedHookMap hook_map_; |
706 | 710 |
707 void RunCallbacks(const CanonicalCookie& cookie); | |
708 | |
709 DISALLOW_COPY_AND_ASSIGN(CookieMonster); | 711 DISALLOW_COPY_AND_ASSIGN(CookieMonster); |
710 }; | 712 }; |
711 | 713 |
712 class NET_EXPORT CookieMonsterDelegate | 714 class NET_EXPORT CookieMonsterDelegate |
713 : public base::RefCountedThreadSafe<CookieMonsterDelegate> { | 715 : public base::RefCountedThreadSafe<CookieMonsterDelegate> { |
714 public: | 716 public: |
715 // The publicly relevant reasons a cookie might be changed. | 717 // The publicly relevant reasons a cookie might be changed. |
716 enum ChangeCause { | 718 enum ChangeCause { |
717 // The cookie was changed directly by a consumer's action. | 719 // The cookie was changed directly by a consumer's action. |
718 CHANGE_COOKIE_EXPLICIT, | 720 CHANGE_COOKIE_EXPLICIT, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 virtual ~PersistentCookieStore() {} | 788 virtual ~PersistentCookieStore() {} |
787 | 789 |
788 private: | 790 private: |
789 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 791 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
790 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 792 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
791 }; | 793 }; |
792 | 794 |
793 } // namespace net | 795 } // namespace net |
794 | 796 |
795 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 797 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
OLD | NEW |