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 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 const base::Closure& callback) OVERRIDE; | 239 const base::Closure& callback) OVERRIDE; |
240 | 240 |
241 // Deletes all of the cookies that have a creation_date greater than or equal | 241 // Deletes all of the cookies that have a creation_date greater than or equal |
242 // to |delete_begin| and less than |delete_end| | 242 // to |delete_begin| and less than |delete_end| |
243 // Returns the number of cookies that have been deleted. | 243 // Returns the number of cookies that have been deleted. |
244 virtual void DeleteAllCreatedBetweenAsync( | 244 virtual void DeleteAllCreatedBetweenAsync( |
245 const base::Time& delete_begin, | 245 const base::Time& delete_begin, |
246 const base::Time& delete_end, | 246 const base::Time& delete_end, |
247 const DeleteCallback& callback) OVERRIDE; | 247 const DeleteCallback& callback) OVERRIDE; |
248 | 248 |
| 249 virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE; |
| 250 |
249 virtual CookieMonster* GetCookieMonster() OVERRIDE; | 251 virtual CookieMonster* GetCookieMonster() OVERRIDE; |
250 | 252 |
251 // Enables writing session cookies into the cookie database. If this this | 253 // Enables writing session cookies into the cookie database. If this this |
252 // method is called, it must be called before first use of the instance | 254 // method is called, it must be called before first use of the instance |
253 // (i.e. as part of the instance initialization process). | 255 // (i.e. as part of the instance initialization process). |
254 void SetPersistSessionCookies(bool persist_session_cookies); | 256 void SetPersistSessionCookies(bool persist_session_cookies); |
255 | 257 |
256 // Protects session cookies from deletion on shutdown. | 258 // Protects session cookies from deletion on shutdown. |
257 void SaveSessionCookies(); | 259 void SaveSessionCookies(); |
258 | 260 |
(...skipping 15 matching lines...) Expand all Loading... |
274 class DeleteAllForHostTask; | 276 class DeleteAllForHostTask; |
275 class DeleteAllTask; | 277 class DeleteAllTask; |
276 class DeleteCookieTask; | 278 class DeleteCookieTask; |
277 class DeleteCanonicalCookieTask; | 279 class DeleteCanonicalCookieTask; |
278 class GetAllCookiesForURLWithOptionsTask; | 280 class GetAllCookiesForURLWithOptionsTask; |
279 class GetAllCookiesTask; | 281 class GetAllCookiesTask; |
280 class GetCookiesWithOptionsTask; | 282 class GetCookiesWithOptionsTask; |
281 class GetCookiesWithInfoTask; | 283 class GetCookiesWithInfoTask; |
282 class SetCookieWithDetailsTask; | 284 class SetCookieWithDetailsTask; |
283 class SetCookieWithOptionsTask; | 285 class SetCookieWithOptionsTask; |
| 286 class DeleteSessionCookiesTask; |
284 | 287 |
285 // Testing support. | 288 // Testing support. |
286 // For SetCookieWithCreationTime. | 289 // For SetCookieWithCreationTime. |
287 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, | 290 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, |
288 TestCookieDeleteAllCreatedBetweenTimestamps); | 291 TestCookieDeleteAllCreatedBetweenTimestamps); |
289 | 292 |
290 // For gargage collection constants. | 293 // For gargage collection constants. |
291 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestHostGarbageCollection); | 294 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestHostGarbageCollection); |
292 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestTotalGarbageCollection); | 295 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, TestTotalGarbageCollection); |
293 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, GarbageCollectionTriggers); | 296 FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, GarbageCollectionTriggers); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 const CookieOptions& options, | 408 const CookieOptions& options, |
406 std::string* cookie_line, | 409 std::string* cookie_line, |
407 std::vector<CookieInfo>* cookie_infos); | 410 std::vector<CookieInfo>* cookie_infos); |
408 | 411 |
409 void DeleteCookie(const GURL& url, const std::string& cookie_name); | 412 void DeleteCookie(const GURL& url, const std::string& cookie_name); |
410 | 413 |
411 bool SetCookieWithCreationTime(const GURL& url, | 414 bool SetCookieWithCreationTime(const GURL& url, |
412 const std::string& cookie_line, | 415 const std::string& cookie_line, |
413 const base::Time& creation_time); | 416 const base::Time& creation_time); |
414 | 417 |
| 418 int DeleteSessionCookies(); |
| 419 |
415 // Called by all non-static functions to ensure that the cookies store has | 420 // Called by all non-static functions to ensure that the cookies store has |
416 // been initialized. This is not done during creating so it doesn't block | 421 // been initialized. This is not done during creating so it doesn't block |
417 // the window showing. | 422 // the window showing. |
418 // Note: this method should always be called with lock_ held. | 423 // Note: this method should always be called with lock_ held. |
419 void InitIfNecessary() { | 424 void InitIfNecessary() { |
420 if (!initialized_) { | 425 if (!initialized_) { |
421 if (store_) { | 426 if (store_) { |
422 InitStore(); | 427 InitStore(); |
423 } else { | 428 } else { |
424 loaded_ = true; | 429 loaded_ = true; |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 private: | 967 private: |
963 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 968 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
964 }; | 969 }; |
965 | 970 |
966 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { | 971 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { |
967 }; | 972 }; |
968 | 973 |
969 } // namespace net | 974 } // namespace net |
970 | 975 |
971 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 976 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
OLD | NEW |