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 <stddef.h> | 10 #include <stddef.h> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // monster's existence. If |store| is NULL, then no backing store will be | 135 // monster's existence. If |store| is NULL, then no backing store will be |
136 // updated. If |delegate| is non-NULL, it will be notified on | 136 // updated. If |delegate| is non-NULL, it will be notified on |
137 // creation/deletion of cookies. | 137 // creation/deletion of cookies. |
138 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); | 138 CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); |
139 | 139 |
140 // Only used during unit testing. | 140 // Only used during unit testing. |
141 CookieMonster(PersistentCookieStore* store, | 141 CookieMonster(PersistentCookieStore* store, |
142 CookieMonsterDelegate* delegate, | 142 CookieMonsterDelegate* delegate, |
143 int last_access_threshold_milliseconds); | 143 int last_access_threshold_milliseconds); |
144 | 144 |
| 145 ~CookieMonster() override; |
| 146 |
145 // Replaces all the cookies by |list|. This method does not flush the backend. | 147 // Replaces all the cookies by |list|. This method does not flush the backend. |
146 void SetAllCookiesAsync(const CookieList& list, | 148 void SetAllCookiesAsync(const CookieList& list, |
147 const SetCookiesCallback& callback); | 149 const SetCookiesCallback& callback); |
148 | 150 |
149 // CookieStore implementation. | 151 // CookieStore implementation. |
150 void SetCookieWithOptionsAsync(const GURL& url, | 152 void SetCookieWithOptionsAsync(const GURL& url, |
151 const std::string& cookie_line, | 153 const std::string& cookie_line, |
152 const CookieOptions& options, | 154 const CookieOptions& options, |
153 const SetCookiesCallback& callback) override; | 155 const SetCookiesCallback& callback) override; |
154 void SetCookieWithDetailsAsync(const GURL& url, | 156 void SetCookieWithDetailsAsync(const GURL& url, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 kUnknownFetch, | 372 kUnknownFetch, |
371 }; | 373 }; |
372 | 374 |
373 // The number of days since last access that cookies will not be subject | 375 // The number of days since last access that cookies will not be subject |
374 // to global garbage collection. | 376 // to global garbage collection. |
375 static const int kSafeFromGlobalPurgeDays; | 377 static const int kSafeFromGlobalPurgeDays; |
376 | 378 |
377 // Record statistics every kRecordStatisticsIntervalSeconds of uptime. | 379 // Record statistics every kRecordStatisticsIntervalSeconds of uptime. |
378 static const int kRecordStatisticsIntervalSeconds = 10 * 60; | 380 static const int kRecordStatisticsIntervalSeconds = 10 * 60; |
379 | 381 |
380 ~CookieMonster() override; | |
381 | |
382 // The following are synchronous calls to which the asynchronous methods | 382 // The following are synchronous calls to which the asynchronous methods |
383 // delegate either immediately (if the store is loaded) or through a deferred | 383 // delegate either immediately (if the store is loaded) or through a deferred |
384 // task (if the store is not yet loaded). | 384 // task (if the store is not yet loaded). |
385 bool SetCookieWithDetails(const GURL& url, | 385 bool SetCookieWithDetails(const GURL& url, |
386 const std::string& name, | 386 const std::string& name, |
387 const std::string& value, | 387 const std::string& value, |
388 const std::string& domain, | 388 const std::string& domain, |
389 const std::string& path, | 389 const std::string& path, |
390 base::Time creation_time, | 390 base::Time creation_time, |
391 base::Time expiration_time, | 391 base::Time expiration_time, |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 virtual ~PersistentCookieStore() {} | 781 virtual ~PersistentCookieStore() {} |
782 | 782 |
783 private: | 783 private: |
784 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 784 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
785 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 785 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
786 }; | 786 }; |
787 | 787 |
788 } // namespace net | 788 } // namespace net |
789 | 789 |
790 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 790 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
OLD | NEW |