OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_COOKIE_MONSTER_H_ | 7 #ifndef NET_BASE_COOKIE_MONSTER_H_ |
8 #define NET_BASE_COOKIE_MONSTER_H_ | 8 #define NET_BASE_COOKIE_MONSTER_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 const CookieOptions& options, | 268 const CookieOptions& options, |
269 const GetCookieInfoCallback& callback) OVERRIDE; | 269 const GetCookieInfoCallback& callback) OVERRIDE; |
270 | 270 |
271 // Deletes all cookies with that might apply to |url| that has |cookie_name|. | 271 // Deletes all cookies with that might apply to |url| that has |cookie_name|. |
272 virtual void DeleteCookieAsync( | 272 virtual void DeleteCookieAsync( |
273 const GURL& url, const std::string& cookie_name, | 273 const GURL& url, const std::string& cookie_name, |
274 const base::Closure& callback) OVERRIDE; | 274 const base::Closure& callback) OVERRIDE; |
275 | 275 |
276 virtual CookieMonster* GetCookieMonster() OVERRIDE; | 276 virtual CookieMonster* GetCookieMonster() OVERRIDE; |
277 | 277 |
| 278 // Enables writing session cookies into the cookie database. If this this |
| 279 // method is called, it must be called before first use of the instance |
| 280 // (i.e. as part of the instance initialization process). |
| 281 void SetPersistSessionCookies(bool persist_session_cookies); |
| 282 |
| 283 // Protects session cookies from deletion on shutdown. |
| 284 void SaveSessionCookies(); |
| 285 |
278 // Debugging method to perform various validation checks on the map. | 286 // Debugging method to perform various validation checks on the map. |
279 // Currently just checking that there are no null CanonicalCookie pointers | 287 // Currently just checking that there are no null CanonicalCookie pointers |
280 // in the map. | 288 // in the map. |
281 // Argument |arg| is to allow retaining of arbitrary data if the CHECKs | 289 // Argument |arg| is to allow retaining of arbitrary data if the CHECKs |
282 // in the function trip. TODO(rdsmith):Remove hack. | 290 // in the function trip. TODO(rdsmith):Remove hack. |
283 void ValidateMap(int arg); | 291 void ValidateMap(int arg); |
284 | 292 |
285 // The default list of schemes the cookie monster can handle. | 293 // The default list of schemes the cookie monster can handle. |
286 static const char* kDefaultCookieableSchemes[]; | 294 static const char* kDefaultCookieableSchemes[]; |
287 static const int kDefaultCookieableSchemesCount; | 295 static const int kDefaultCookieableSchemesCount; |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 std::vector<std::string> cookieable_schemes_; | 674 std::vector<std::string> cookieable_schemes_; |
667 | 675 |
668 scoped_refptr<Delegate> delegate_; | 676 scoped_refptr<Delegate> delegate_; |
669 | 677 |
670 // Lock for thread-safety | 678 // Lock for thread-safety |
671 base::Lock lock_; | 679 base::Lock lock_; |
672 | 680 |
673 base::Time last_statistic_record_time_; | 681 base::Time last_statistic_record_time_; |
674 | 682 |
675 bool keep_expired_cookies_; | 683 bool keep_expired_cookies_; |
| 684 bool persist_session_cookies_; |
676 | 685 |
677 static bool enable_file_scheme_; | 686 static bool enable_file_scheme_; |
678 | 687 |
679 DISALLOW_COPY_AND_ASSIGN(CookieMonster); | 688 DISALLOW_COPY_AND_ASSIGN(CookieMonster); |
680 }; | 689 }; |
681 | 690 |
682 class NET_EXPORT CookieMonster::CanonicalCookie { | 691 class NET_EXPORT CookieMonster::CanonicalCookie { |
683 public: | 692 public: |
684 | 693 |
685 // These constructors do no validation or canonicalization of their inputs; | 694 // These constructors do no validation or canonicalization of their inputs; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 private: | 999 private: |
991 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 1000 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
992 }; | 1001 }; |
993 | 1002 |
994 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { | 1003 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { |
995 }; | 1004 }; |
996 | 1005 |
997 } // namespace net | 1006 } // namespace net |
998 | 1007 |
999 #endif // NET_BASE_COOKIE_MONSTER_H_ | 1008 #endif // NET_BASE_COOKIE_MONSTER_H_ |
OLD | NEW |