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 <deque> | 10 #include <deque> |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 | 203 |
| 204 // Checks whether for a given ETLD+1, there currently exist any cookies. | 204 // Checks whether for a given ETLD+1, there currently exist any cookies. |
| 205 void HasCookiesForETLDP1Async(const std::string& etldp1, | 205 void HasCookiesForETLDP1Async(const std::string& etldp1, |
| 206 const HasCookiesForETLDP1Callback& callback); | 206 const HasCookiesForETLDP1Callback& callback); |
| 207 | 207 |
| 208 // Resets the list of cookieable schemes to the supplied schemes. | 208 // Resets the list of cookieable schemes to the supplied schemes. |
| 209 // If this this method is called, it must be called before first use of | 209 // If this this method is called, it must be called before first use of |
| 210 // the instance (i.e. as part of the instance initialization process). | 210 // the instance (i.e. as part of the instance initialization process). |
| 211 void SetCookieableSchemes(const char* const schemes[], size_t num_schemes); | 211 void SetCookieableSchemes(const char* const schemes[], size_t num_schemes); |
| 212 | 212 |
| 213 // Resets the list of cookieable schemes to kDefaultCookieableSchemes with or | |
| 214 // without 'file' being included. | |
| 215 // | |
| 216 // There are some unknowns about how to correctly handle file:// cookies, | |
| 217 // and our implementation for this is not robust enough. This allows you | |
| 218 // to enable support, but it should only be used for testing. Bug 1157243. | |
| 219 void SetEnableFileScheme(bool accept); | |
| 220 | |
| 221 // Instructs the cookie monster to not delete expired cookies. This is used | 213 // Instructs the cookie monster to not delete expired cookies. This is used |
| 222 // in cases where the cookie monster is used as a data structure to keep | 214 // in cases where the cookie monster is used as a data structure to keep |
| 223 // arbitrary cookies. | 215 // arbitrary cookies. |
| 224 void SetKeepExpiredCookies(); | 216 void SetKeepExpiredCookies(); |
| 225 | 217 |
| 226 // Protects session cookies from deletion on shutdown. | 218 // Protects session cookies from deletion on shutdown. |
| 227 void SetForceKeepSessionState(); | 219 void SetForceKeepSessionState(); |
| 228 | 220 |
| 229 // Flush the backing store (if any) to disk and post the given callback when | 221 // Flush the backing store (if any) to disk and post the given callback when |
| 230 // done. | 222 // done. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 | 297 |
| 306 // The default list of schemes the cookie monster can handle. | 298 // The default list of schemes the cookie monster can handle. |
| 307 static const char* const kDefaultCookieableSchemes[]; | 299 static const char* const kDefaultCookieableSchemes[]; |
| 308 static const int kDefaultCookieableSchemesCount; | 300 static const int kDefaultCookieableSchemesCount; |
| 309 | 301 |
| 310 scoped_ptr<CookieChangedSubscription> AddCallbackForCookie( | 302 scoped_ptr<CookieChangedSubscription> AddCallbackForCookie( |
| 311 const GURL& url, | 303 const GURL& url, |
| 312 const std::string& name, | 304 const std::string& name, |
| 313 const CookieChangedCallback& callback) override; | 305 const CookieChangedCallback& callback) override; |
| 314 | 306 |
| 307 #if defined(OS_ANDROID) | |
| 308 // Resets the list of cookieable schemes to kDefaultCookieableSchemes with or | |
| 309 // without 'file' being included. | |
| 310 // | |
| 311 // There are some unknowns about how to correctly handle file:// cookies, | |
| 312 // and our implementation for this is not robust enough. This allows you | |
| 313 // to enable support, but it should only be used for testing. Bug 1157243. | |
|
erikwright (departed)
2015/03/30 14:22:30
Is this still accurate? Is WebView using it for te
| |
| 314 // | |
| 315 // TODO(mkwst): This method will be removed once we can deprecate and remove | |
| 316 // the Android WebView 'CookieManager::setAcceptFileSchemeCookies' method. | |
| 317 // Until then, this method only has effect on Android, and must not be used | |
| 318 // outside a WebView context. | |
| 319 void SetEnableFileScheme(bool accept); | |
| 320 #endif | |
| 321 | |
| 315 private: | 322 private: |
| 316 // For queueing the cookie monster calls. | 323 // For queueing the cookie monster calls. |
| 317 class CookieMonsterTask; | 324 class CookieMonsterTask; |
| 318 template <typename Result> | 325 template <typename Result> |
| 319 class DeleteTask; | 326 class DeleteTask; |
| 320 class DeleteAllCreatedBetweenTask; | 327 class DeleteAllCreatedBetweenTask; |
| 321 class DeleteAllCreatedBetweenForHostTask; | 328 class DeleteAllCreatedBetweenForHostTask; |
| 322 class DeleteAllForHostTask; | 329 class DeleteAllForHostTask; |
| 323 class DeleteAllTask; | 330 class DeleteAllTask; |
| 324 class DeleteCookieTask; | 331 class DeleteCookieTask; |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 793 virtual ~PersistentCookieStore() {} | 800 virtual ~PersistentCookieStore() {} |
| 794 | 801 |
| 795 private: | 802 private: |
| 796 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 803 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
| 797 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 804 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
| 798 }; | 805 }; |
| 799 | 806 |
| 800 } // namespace net | 807 } // namespace net |
| 801 | 808 |
| 802 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 809 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
| OLD | NEW |