OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ | 5 #ifndef CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ |
6 #define CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ | 6 #define CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 storage::SpecialStoragePolicy* special_storage_policy); | 42 storage::SpecialStoragePolicy* special_storage_policy); |
43 | 43 |
44 // net::CookieMonster::PersistentCookieStore: | 44 // net::CookieMonster::PersistentCookieStore: |
45 void Load(const LoadedCallback& loaded_callback) override; | 45 void Load(const LoadedCallback& loaded_callback) override; |
46 void LoadCookiesForKey(const std::string& key, | 46 void LoadCookiesForKey(const std::string& key, |
47 const LoadedCallback& callback) override; | 47 const LoadedCallback& callback) override; |
48 void AddCookie(const net::CanonicalCookie& cc) override; | 48 void AddCookie(const net::CanonicalCookie& cc) override; |
49 void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override; | 49 void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override; |
50 void DeleteCookie(const net::CanonicalCookie& cc) override; | 50 void DeleteCookie(const net::CanonicalCookie& cc) override; |
51 void SetForceKeepSessionState() override; | 51 void SetForceKeepSessionState() override; |
52 void Flush(const base::Closure& callback) override; | 52 void Flush(base::OnceClosure callback) override; |
53 | 53 |
54 private: | 54 private: |
55 typedef std::map<net::SQLitePersistentCookieStore::CookieOrigin, size_t> | 55 typedef std::map<net::SQLitePersistentCookieStore::CookieOrigin, size_t> |
56 CookiesPerOriginMap; | 56 CookiesPerOriginMap; |
57 | 57 |
58 ~QuotaPolicyCookieStore() override; | 58 ~QuotaPolicyCookieStore() override; |
59 | 59 |
60 // Called after cookies are loaded from the database. Calls |loaded_callback| | 60 // Called after cookies are loaded from the database. Calls |loaded_callback| |
61 // when done. | 61 // when done. |
62 void OnLoad(const LoadedCallback& loaded_callback, | 62 void OnLoad(const LoadedCallback& loaded_callback, |
63 std::vector<std::unique_ptr<net::CanonicalCookie>> cookies); | 63 std::vector<std::unique_ptr<net::CanonicalCookie>> cookies); |
64 | 64 |
65 // Map of (domain keys(eTLD+1), is secure cookie) to number of cookies in the | 65 // Map of (domain keys(eTLD+1), is secure cookie) to number of cookies in the |
66 // database. | 66 // database. |
67 CookiesPerOriginMap cookies_per_origin_; | 67 CookiesPerOriginMap cookies_per_origin_; |
68 | 68 |
69 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 69 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
70 scoped_refptr<net::SQLitePersistentCookieStore> persistent_store_; | 70 scoped_refptr<net::SQLitePersistentCookieStore> persistent_store_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(QuotaPolicyCookieStore); | 72 DISALLOW_COPY_AND_ASSIGN(QuotaPolicyCookieStore); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace content | 75 } // namespace content |
76 | 76 |
77 #endif // CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ | 77 #endif // CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ |
OLD | NEW |