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 18 matching lines...) Expand all Loading... | |
| 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; | 37 class Histogram; |
| 38 class HistogramBase; | 38 class HistogramBase; |
| 39 class TimeTicks; | 39 class TimeTicks; |
|
Scott Hess - ex-Googler
2016/05/18 23:14:29
In verifying that a straight base::TimeDelta shoul
| |
| 40 } // namespace base | 40 } // namespace base |
| 41 | 41 |
| 42 namespace net { | 42 namespace net { |
| 43 | 43 |
| 44 class CookieMonsterDelegate; | 44 class CookieMonsterDelegate; |
| 45 class ParsedCookie; | 45 class ParsedCookie; |
|
Scott Hess - ex-Googler
2016/05/18 23:14:29
Once looking, you notice other things which aren't
| |
| 46 | 46 |
| 47 // The cookie monster is the system for storing and retrieving cookies. It has | 47 // 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 | 48 // an in-memory list of all cookies, and synchronizes non-session cookies to an |
| 49 // optional permanent storage that implements the PersistentCookieStore | 49 // optional permanent storage that implements the PersistentCookieStore |
| 50 // interface. | 50 // interface. |
| 51 // | 51 // |
| 52 // Tasks may be deferred if all affected cookies are not yet loaded from the | 52 // Tasks may be deferred if all affected cookies are not yet loaded from the |
| 53 // backing store. Otherwise, callbacks may be invoked immediately. | 53 // backing store. Otherwise, callbacks may be invoked immediately. |
| 54 // | 54 // |
| 55 // A cookie task is either pending loading of the entire cookie store, or | 55 // 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 | 133 // 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 | 134 // 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 | 135 // 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 | 136 // updated. If |delegate| is non-NULL, it will be notified on |
| 137 // creation/deletion of cookies. | 137 // creation/deletion of cookies. |
| 138 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); | 138 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); |
| 139 | 139 |
| 140 // Only used during unit testing. | 140 // Only used during unit testing. |
| 141 CookieMonster(PersistentCookieStore* store, | 141 CookieMonster(PersistentCookieStore* store, |
| 142 CookieMonsterDelegate* delegate, | 142 CookieMonsterDelegate* delegate, |
| 143 int last_access_threshold_milliseconds); | 143 const base::TimeDelta& last_access_threshold); |
|
Ryan Hamilton
2016/05/18 22:45:20
nit: base::TimeDelta is (under the covers) an int6
Ryan Sleevi
2016/05/18 23:07:07
The fact that it had to be clarified "(under the c
Scott Hess - ex-Googler
2016/05/18 23:14:29
Done.
Scott Hess - ex-Googler
2016/05/18 23:14:29
My of const& was _mostly_ because I assumed that t
Ryan Hamilton
2016/05/18 23:46:16
Hm. I'm surprised to hear you say this, because in
| |
| 144 | 144 |
| 145 ~CookieMonster() override; | 145 ~CookieMonster() override; |
| 146 | 146 |
| 147 // Replaces all the cookies by |list|. This method does not flush the backend. | 147 // Replaces all the cookies by |list|. This method does not flush the backend. |
| 148 void SetAllCookiesAsync(const CookieList& list, | 148 void SetAllCookiesAsync(const CookieList& list, |
| 149 const SetCookiesCallback& callback); | 149 const SetCookiesCallback& callback); |
| 150 | 150 |
| 151 // CookieStore implementation. | 151 // CookieStore implementation. |
| 152 void SetCookieWithOptionsAsync(const GURL& url, | 152 void SetCookieWithOptionsAsync(const GURL& url, |
| 153 const std::string& cookie_line, | 153 const std::string& cookie_line, |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 virtual ~PersistentCookieStore() {} | 802 virtual ~PersistentCookieStore() {} |
| 803 | 803 |
| 804 private: | 804 private: |
| 805 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 805 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
| 806 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 806 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
| 807 }; | 807 }; |
| 808 | 808 |
| 809 } // namespace net | 809 } // namespace net |
| 810 | 810 |
| 811 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 811 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
| OLD | NEW |