Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 #include "base/memory/weak_ptr.h" | 27 #include "base/memory/weak_ptr.h" |
| 28 #include "base/threading/thread_checker.h" | 28 #include "base/threading/thread_checker.h" |
| 29 #include "base/time/time.h" | 29 #include "base/time/time.h" |
| 30 #include "net/base/net_export.h" | 30 #include "net/base/net_export.h" |
| 31 #include "net/cookies/canonical_cookie.h" | 31 #include "net/cookies/canonical_cookie.h" |
| 32 #include "net/cookies/cookie_constants.h" | 32 #include "net/cookies/cookie_constants.h" |
| 33 #include "net/cookies/cookie_store.h" | 33 #include "net/cookies/cookie_store.h" |
| 34 #include "url/gurl.h" | 34 #include "url/gurl.h" |
| 35 | 35 |
| 36 namespace base { | 36 namespace base { |
| 37 class Histogram; | |
| 38 class HistogramBase; | 37 class HistogramBase; |
| 39 class TimeTicks; | |
| 40 } // namespace base | 38 } // namespace base |
| 41 | 39 |
| 42 namespace net { | 40 namespace net { |
| 43 | 41 |
| 44 class CookieMonsterDelegate; | 42 class CookieMonsterDelegate; |
| 45 class ParsedCookie; | |
| 46 | 43 |
| 47 // The cookie monster is the system for storing and retrieving cookies. It has | 44 // The cookie monster is the system for storing and retrieving cookies. It has |
| 48 // an in-memory list of all cookies, and synchronizes non-session cookies to an | 45 // an in-memory list of all cookies, and synchronizes non-session cookies to an |
| 49 // optional permanent storage that implements the PersistentCookieStore | 46 // optional permanent storage that implements the PersistentCookieStore |
| 50 // interface. | 47 // interface. |
| 51 // | 48 // |
| 52 // Tasks may be deferred if all affected cookies are not yet loaded from the | 49 // Tasks may be deferred if all affected cookies are not yet loaded from the |
| 53 // backing store. Otherwise, callbacks may be invoked immediately. | 50 // backing store. Otherwise, callbacks may be invoked immediately. |
| 54 // | 51 // |
| 55 // A cookie task is either pending loading of the entire cookie store, or | 52 // A cookie task is either pending loading of the entire cookie store, or |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 // class will take care of initializing it. The backing store is NOT owned by | 130 // class will take care of initializing it. The backing store is NOT owned by |
| 134 // this class, but it must remain valid for the duration of the cookie | 131 // this class, but it must remain valid for the duration of the cookie |
| 135 // monster's existence. If |store| is NULL, then no backing store will be | 132 // monster's existence. If |store| is NULL, then no backing store will be |
| 136 // updated. If |delegate| is non-NULL, it will be notified on | 133 // updated. If |delegate| is non-NULL, it will be notified on |
| 137 // creation/deletion of cookies. | 134 // creation/deletion of cookies. |
| 138 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); | 135 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); |
| 139 | 136 |
| 140 // Only used during unit testing. | 137 // Only used during unit testing. |
| 141 CookieMonster(PersistentCookieStore* store, | 138 CookieMonster(PersistentCookieStore* store, |
| 142 CookieMonsterDelegate* delegate, | 139 CookieMonsterDelegate* delegate, |
| 143 int last_access_threshold_milliseconds); | 140 const base::TimeDelta last_access_threshold); |
|
Ryan Sleevi
2016/05/19 00:10:28
nit: FWIW, you can drop the const as well, since y
| |
| 144 | 141 |
| 145 ~CookieMonster() override; | 142 ~CookieMonster() override; |
| 146 | 143 |
| 147 // Replaces all the cookies by |list|. This method does not flush the backend. | 144 // Replaces all the cookies by |list|. This method does not flush the backend. |
| 148 void SetAllCookiesAsync(const CookieList& list, | 145 void SetAllCookiesAsync(const CookieList& list, |
| 149 const SetCookiesCallback& callback); | 146 const SetCookiesCallback& callback); |
| 150 | 147 |
| 151 // CookieStore implementation. | 148 // CookieStore implementation. |
| 152 void SetCookieWithOptionsAsync(const GURL& url, | 149 void SetCookieWithOptionsAsync(const GURL& url, |
| 153 const std::string& cookie_line, | 150 const std::string& cookie_line, |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 virtual ~PersistentCookieStore() {} | 799 virtual ~PersistentCookieStore() {} |
| 803 | 800 |
| 804 private: | 801 private: |
| 805 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 802 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
| 806 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 803 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
| 807 }; | 804 }; |
| 808 | 805 |
| 809 } // namespace net | 806 } // namespace net |
| 810 | 807 |
| 811 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 808 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
| OLD | NEW |