| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_NET_COOKIES_COOKIE_STORE_IOS_PERSISTENT_H_ |
| 6 #define IOS_NET_COOKIES_COOKIE_STORE_IOS_PERSISTENT_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/time/time.h" |
| 11 #import "ios/net/cookies/cookie_store_ios.h" |
| 12 #include "net/cookies/cookie_monster.h" |
| 13 #include "net/cookies/cookie_store.h" |
| 14 #include "url/gurl.h" |
| 15 |
| 16 @class NSHTTPCookieStorage; |
| 17 |
| 18 namespace net { |
| 19 |
| 20 // The CookieStoreIOSPersistent is an implementation of CookieStore relying on |
| 21 // on backing CookieStore. |
| 22 // CookieStoreIOSPersistent is not thread safe. |
| 23 // |
| 24 // All the changes are written back to the backing CookieStore. |
| 25 // For synchronized CookieStore, please see CookieStoreIOS. |
| 26 // |
| 27 // TODO(crbug.com/686147): evaluate if inheritance is |
| 28 // needed here. |
| 29 class CookieStoreIOSPersistent : public CookieStoreIOS { |
| 30 public: |
| 31 // Creates a CookieStoreIOS with a default value of |
| 32 // |NSHTTPCookieStorage sharedCookieStorage| as the system's cookie store. |
| 33 explicit CookieStoreIOSPersistent( |
| 34 net::CookieMonster::PersistentCookieStore* persistent_store); |
| 35 |
| 36 ~CookieStoreIOSPersistent() override; |
| 37 |
| 38 // Inherited CookieStore methods. |
| 39 void SetCookieWithOptionsAsync(const GURL& url, |
| 40 const std::string& cookie_line, |
| 41 const net::CookieOptions& options, |
| 42 const SetCookiesCallback& callback) override; |
| 43 void SetCookieWithDetailsAsync(const GURL& url, |
| 44 const std::string& name, |
| 45 const std::string& value, |
| 46 const std::string& domain, |
| 47 const std::string& path, |
| 48 base::Time creation_time, |
| 49 base::Time expiration_time, |
| 50 base::Time last_access_time, |
| 51 bool secure, |
| 52 bool http_only, |
| 53 CookieSameSite same_site, |
| 54 CookiePriority priority, |
| 55 const SetCookiesCallback& callback) override; |
| 56 void GetCookiesWithOptionsAsync(const GURL& url, |
| 57 const net::CookieOptions& options, |
| 58 const GetCookiesCallback& callback) override; |
| 59 void GetCookieListWithOptionsAsync( |
| 60 const GURL& url, |
| 61 const net::CookieOptions& options, |
| 62 const GetCookieListCallback& callback) override; |
| 63 void GetAllCookiesAsync(const GetCookieListCallback& callback) override; |
| 64 void DeleteCookieAsync(const GURL& url, |
| 65 const std::string& cookie_name, |
| 66 const base::Closure& callback) override; |
| 67 void DeleteCanonicalCookieAsync(const CanonicalCookie& cookie, |
| 68 const DeleteCallback& callback) override; |
| 69 void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, |
| 70 const base::Time& delete_end, |
| 71 const DeleteCallback& callback) override; |
| 72 void DeleteAllCreatedBetweenWithPredicateAsync( |
| 73 const base::Time& delete_begin, |
| 74 const base::Time& delete_end, |
| 75 const CookiePredicate& predicate, |
| 76 const DeleteCallback& callback) override; |
| 77 void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; |
| 78 |
| 79 private: |
| 80 // No-op functions for this class. |
| 81 void WriteToCookieMonster(NSArray* system_cookies) override; |
| 82 void OnSystemCookiesChanged() override; |
| 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(CookieStoreIOSPersistent); |
| 85 }; |
| 86 |
| 87 } // namespace net |
| 88 |
| 89 #endif // IOS_NET_COOKIES_COOKIE_STORE_IOS_PERSISTENT_H_ |
| OLD | NEW |