| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Must be called when the state of | 74 // Must be called when the state of |
| 75 // |NSHTTPCookieStorage sharedHTTPCookieStorage| changes. | 75 // |NSHTTPCookieStorage sharedHTTPCookieStorage| changes. |
| 76 // Affects only those CookieStoreIOS instances that are backed by | 76 // Affects only those CookieStoreIOS instances that are backed by |
| 77 // |NSHTTPCookieStorage sharedHTTPCookieStorage|. | 77 // |NSHTTPCookieStorage sharedHTTPCookieStorage|. |
| 78 static void NotifySystemCookiesChanged(); | 78 static void NotifySystemCookiesChanged(); |
| 79 | 79 |
| 80 // Only one cookie store may enable metrics. | 80 // Only one cookie store may enable metrics. |
| 81 void SetMetricsEnabled(); | 81 void SetMetricsEnabled(); |
| 82 | 82 |
| 83 // Sets the delay between flushes. Only used in tests. | |
| 84 void set_flush_delay_for_testing(base::TimeDelta delay) { | |
| 85 flush_delay_ = delay; | |
| 86 } | |
| 87 | |
| 88 // Inherited CookieStore methods. | 83 // Inherited CookieStore methods. |
| 89 void SetCookieWithOptionsAsync(const GURL& url, | 84 void SetCookieWithOptionsAsync(const GURL& url, |
| 90 const std::string& cookie_line, | 85 const std::string& cookie_line, |
| 91 const net::CookieOptions& options, | 86 const net::CookieOptions& options, |
| 92 const SetCookiesCallback& callback) override; | 87 const SetCookiesCallback& callback) override; |
| 93 void SetCookieWithDetailsAsync(const GURL& url, | 88 void SetCookieWithDetailsAsync(const GURL& url, |
| 94 const std::string& name, | 89 const std::string& name, |
| 95 const std::string& value, | 90 const std::string& value, |
| 96 const std::string& domain, | 91 const std::string& domain, |
| 97 const std::string& path, | 92 const std::string& path, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Inherited CookieNotificationObserver methods. | 162 // Inherited CookieNotificationObserver methods. |
| 168 void OnSystemCookiesChanged() override; | 163 void OnSystemCookiesChanged() override; |
| 169 | 164 |
| 170 void DeleteCookiesWithFilter(const CookieFilterFunction& filter, | 165 void DeleteCookiesWithFilter(const CookieFilterFunction& filter, |
| 171 const DeleteCallback& callback); | 166 const DeleteCallback& callback); |
| 172 | 167 |
| 173 std::unique_ptr<net::CookieMonster> cookie_monster_; | 168 std::unique_ptr<net::CookieMonster> cookie_monster_; |
| 174 base::scoped_nsobject<NSHTTPCookieStorage> system_store_; | 169 base::scoped_nsobject<NSHTTPCookieStorage> system_store_; |
| 175 std::unique_ptr<CookieCreationTimeManager> creation_time_manager_; | 170 std::unique_ptr<CookieCreationTimeManager> creation_time_manager_; |
| 176 bool metrics_enabled_; | 171 bool metrics_enabled_; |
| 177 base::TimeDelta flush_delay_; | |
| 178 base::CancelableClosure flush_closure_; | 172 base::CancelableClosure flush_closure_; |
| 179 | 173 |
| 180 SynchronizationState synchronization_state_; | 174 SynchronizationState synchronization_state_; |
| 181 // Tasks received when SYNCHRONIZING are queued and run when SYNCHRONIZED. | 175 // Tasks received when SYNCHRONIZING are queued and run when SYNCHRONIZED. |
| 182 std::vector<base::Closure> tasks_pending_synchronization_; | 176 std::vector<base::Closure> tasks_pending_synchronization_; |
| 183 | 177 |
| 184 base::ThreadChecker thread_checker_; | 178 base::ThreadChecker thread_checker_; |
| 185 | 179 |
| 186 // Cookie notification methods. | 180 // Cookie notification methods. |
| 187 // The cookie cache is updated from both the system store and the | 181 // The cookie cache is updated from both the system store and the |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 hook_map_; | 289 hook_map_; |
| 296 | 290 |
| 297 base::WeakPtrFactory<CookieStoreIOS> weak_factory_; | 291 base::WeakPtrFactory<CookieStoreIOS> weak_factory_; |
| 298 | 292 |
| 299 DISALLOW_COPY_AND_ASSIGN(CookieStoreIOS); | 293 DISALLOW_COPY_AND_ASSIGN(CookieStoreIOS); |
| 300 }; | 294 }; |
| 301 | 295 |
| 302 } // namespace net | 296 } // namespace net |
| 303 | 297 |
| 304 #endif // IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ | 298 #endif // IOS_NET_COOKIES_COOKIE_STORE_IOS_H_ |
| OLD | NEW |