| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ | 5 #ifndef IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ |
| 6 #define IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ | 6 #define IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // be synchronized with it. | 96 // be synchronized with it. |
| 97 static void SwitchSynchronizedStore(CookieStoreIOS* old_store, | 97 static void SwitchSynchronizedStore(CookieStoreIOS* old_store, |
| 98 CookieStoreIOS* new_store); | 98 CookieStoreIOS* new_store); |
| 99 | 99 |
| 100 // Must be called when the state of | 100 // Must be called when the state of |
| 101 // |NSHTTPCookieStorage sharedHTTPCookieStorage| changes. | 101 // |NSHTTPCookieStorage sharedHTTPCookieStorage| changes. |
| 102 // Affects only those CookieStoreIOS instances that are backed by | 102 // Affects only those CookieStoreIOS instances that are backed by |
| 103 // |NSHTTPCookieStorage sharedHTTPCookieStorage|. | 103 // |NSHTTPCookieStorage sharedHTTPCookieStorage|. |
| 104 static void NotifySystemCookiesChanged(); | 104 static void NotifySystemCookiesChanged(); |
| 105 | 105 |
| 106 // Saves the cookies to the cookie monster. | |
| 107 // Note: ignores the write cookie operation if |write_on_flush_| is false. | |
| 108 void Flush(const base::Closure& callback); | |
| 109 | |
| 110 // Unsynchronizes the cookie store if it is currently synchronized. | 106 // Unsynchronizes the cookie store if it is currently synchronized. |
| 111 void UnSynchronize(); | 107 void UnSynchronize(); |
| 112 | 108 |
| 113 // Only one cookie store may enable metrics. | 109 // Only one cookie store may enable metrics. |
| 114 void SetMetricsEnabled(); | 110 void SetMetricsEnabled(); |
| 115 | 111 |
| 116 // Sets the delay between flushes. Only used in tests. | 112 // Sets the delay between flushes. Only used in tests. |
| 117 void set_flush_delay_for_testing(base::TimeDelta delay) { | 113 void set_flush_delay_for_testing(base::TimeDelta delay) { |
| 118 flush_delay_ = delay; | 114 flush_delay_ = delay; |
| 119 } | 115 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 134 net::CookieMonster* GetCookieMonster() override; | 130 net::CookieMonster* GetCookieMonster() override; |
| 135 void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, | 131 void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, |
| 136 const base::Time& delete_end, | 132 const base::Time& delete_end, |
| 137 const DeleteCallback& callback) override; | 133 const DeleteCallback& callback) override; |
| 138 void DeleteAllCreatedBetweenForHostAsync( | 134 void DeleteAllCreatedBetweenForHostAsync( |
| 139 const base::Time delete_begin, | 135 const base::Time delete_begin, |
| 140 const base::Time delete_end, | 136 const base::Time delete_end, |
| 141 const GURL& url, | 137 const GURL& url, |
| 142 const DeleteCallback& callback) override; | 138 const DeleteCallback& callback) override; |
| 143 void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; | 139 void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; |
| 140 void FlushStore(const base::Closure& callback) override; |
| 144 | 141 |
| 145 scoped_ptr<CookieChangedSubscription> AddCallbackForCookie( | 142 scoped_ptr<CookieChangedSubscription> AddCallbackForCookie( |
| 146 const GURL& url, | 143 const GURL& url, |
| 147 const std::string& name, | 144 const std::string& name, |
| 148 const CookieChangedCallback& callback) override; | 145 const CookieChangedCallback& callback) override; |
| 149 | 146 |
| 150 protected: | 147 protected: |
| 151 ~CookieStoreIOS() override; | 148 ~CookieStoreIOS() override; |
| 152 | 149 |
| 153 private: | 150 private: |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 typedef std::map<std::pair<GURL, std::string>, CookieChangedCallbackList*> | 305 typedef std::map<std::pair<GURL, std::string>, CookieChangedCallbackList*> |
| 309 CookieChangedHookMap; | 306 CookieChangedHookMap; |
| 310 CookieChangedHookMap hook_map_; | 307 CookieChangedHookMap hook_map_; |
| 311 | 308 |
| 312 DISALLOW_COPY_AND_ASSIGN(CookieStoreIOS); | 309 DISALLOW_COPY_AND_ASSIGN(CookieStoreIOS); |
| 313 }; | 310 }; |
| 314 | 311 |
| 315 } // namespace net | 312 } // namespace net |
| 316 | 313 |
| 317 #endif // IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ | 314 #endif // IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ |
| OLD | NEW |