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 number 42. | 5 // Brought to you by number 42. |
6 | 6 |
7 #ifndef NET_COOKIES_COOKIE_STORE_H_ | 7 #ifndef NET_COOKIES_COOKIE_STORE_H_ |
8 #define NET_COOKIES_COOKIE_STORE_H_ | 8 #define NET_COOKIES_COOKIE_STORE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 // An interface for storing and retrieving cookies. Implementations are not | 27 // An interface for storing and retrieving cookies. Implementations are not |
28 // thread safe, as with most other net classes. All methods must be invoked on | 28 // thread safe, as with most other net classes. All methods must be invoked on |
29 // the network thread, and all callbacks will be calle there. | 29 // the network thread, and all callbacks will be calle there. |
30 // | 30 // |
31 // All async functions may either invoke the callback asynchronously, or they | 31 // All async functions may either invoke the callback asynchronously, or they |
32 // may be invoked immediately (prior to return of the asynchronous function). | 32 // may be invoked immediately (prior to return of the asynchronous function). |
33 // Destroying the CookieStore will cancel pending async callbacks. | 33 // Destroying the CookieStore will cancel pending async callbacks. |
34 class NET_EXPORT CookieStore { | 34 class NET_EXPORT CookieStore { |
35 public: | 35 public: |
36 // In a CookieChangedCallback, this indicates why a cookie was removed if it | |
37 // was removed. This roughly mirrors CookieMonster::DeletionCause and | |
38 // CookieMonsterDelegate::ChangeCause. | |
39 enum class RemovalCause { | |
40 NOT_REMOVED, | |
Roger Tawa OOO till Jul 10th
2016/09/19 20:23:02
If I have a value set for a cookie, and I browse t
nharper
2016/09/19 21:34:30
It looks like you'll first get a (removed=true) OV
| |
41 UNKNOWN, | |
42 EXPLICIT, | |
43 OVERWRITE, | |
44 EXPIRED, | |
45 EVICTED, | |
46 EXPIRED_OVERWRITE, | |
47 }; | |
Roger Tawa OOO till Jul 10th
2016/09/19 20:23:02
Wondering why you didn't define as ChangeCause ins
nharper
2016/09/19 21:34:30
I'm thinking combining the bool with the enum woul
| |
48 | |
36 // Callback definitions. | 49 // Callback definitions. |
37 typedef base::Callback<void(const CookieList& cookies)> GetCookieListCallback; | 50 typedef base::Callback<void(const CookieList& cookies)> GetCookieListCallback; |
38 typedef base::Callback<void(const std::string& cookie)> GetCookiesCallback; | 51 typedef base::Callback<void(const std::string& cookie)> GetCookiesCallback; |
39 typedef base::Callback<void(bool success)> SetCookiesCallback; | 52 typedef base::Callback<void(bool success)> SetCookiesCallback; |
40 typedef base::Callback<void(int num_deleted)> DeleteCallback; | 53 typedef base::Callback<void(int num_deleted)> DeleteCallback; |
41 typedef base::Callback<void(const CanonicalCookie& cookie, bool removed)> | 54 typedef base::Callback< |
55 void(const CanonicalCookie& cookie, bool removed, RemovalCause cause)> | |
42 CookieChangedCallback; | 56 CookieChangedCallback; |
43 typedef base::CallbackList<void(const CanonicalCookie& cookie, bool removed)> | 57 typedef base::CallbackList< |
58 void(const CanonicalCookie& cookie, bool removed, RemovalCause cause)> | |
44 CookieChangedCallbackList; | 59 CookieChangedCallbackList; |
45 typedef CookieChangedCallbackList::Subscription CookieChangedSubscription; | 60 typedef CookieChangedCallbackList::Subscription CookieChangedSubscription; |
46 typedef base::Callback<bool(const CanonicalCookie& cookie)> CookiePredicate; | 61 typedef base::Callback<bool(const CanonicalCookie& cookie)> CookiePredicate; |
47 | 62 |
48 virtual ~CookieStore(); | 63 virtual ~CookieStore(); |
49 | 64 |
50 // Returns the cookie line (e.g. "cookie1=value1; cookie2=value2") represented | 65 // Returns the cookie line (e.g. "cookie1=value1; cookie2=value2") represented |
51 // by |cookies|. The string is built in the same order as the given list. | 66 // by |cookies|. The string is built in the same order as the given list. |
52 // | 67 // |
53 // TODO(mkwst): We really should standardize on either | 68 // TODO(mkwst): We really should standardize on either |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 int GetChannelIDServiceID(); | 226 int GetChannelIDServiceID(); |
212 | 227 |
213 protected: | 228 protected: |
214 CookieStore(); | 229 CookieStore(); |
215 int channel_id_service_id_; | 230 int channel_id_service_id_; |
216 }; | 231 }; |
217 | 232 |
218 } // namespace net | 233 } // namespace net |
219 | 234 |
220 #endif // NET_COOKIES_COOKIE_STORE_H_ | 235 #endif // NET_COOKIES_COOKIE_STORE_H_ |
OLD | NEW |