Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: net/base/cookie_monster.h

Issue 8533013: SessionRestore: Store session cookies and restore them if chrome crashes or auto-restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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.
279 void SetPersistSessionCookies(bool persist_session_cookies);
280
281 // Protects session cookies from deletion on shutdown.
282 void SaveSessionCookies();
283
278 // Debugging method to perform various validation checks on the map. 284 // Debugging method to perform various validation checks on the map.
279 // Currently just checking that there are no null CanonicalCookie pointers 285 // Currently just checking that there are no null CanonicalCookie pointers
280 // in the map. 286 // in the map.
281 // Argument |arg| is to allow retaining of arbitrary data if the CHECKs 287 // Argument |arg| is to allow retaining of arbitrary data if the CHECKs
282 // in the function trip. TODO(rdsmith):Remove hack. 288 // in the function trip. TODO(rdsmith):Remove hack.
283 void ValidateMap(int arg); 289 void ValidateMap(int arg);
284 290
285 // The default list of schemes the cookie monster can handle. 291 // The default list of schemes the cookie monster can handle.
286 static const char* kDefaultCookieableSchemes[]; 292 static const char* kDefaultCookieableSchemes[];
287 static const int kDefaultCookieableSchemesCount; 293 static const int kDefaultCookieableSchemesCount;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 std::vector<std::string> cookieable_schemes_; 672 std::vector<std::string> cookieable_schemes_;
667 673
668 scoped_refptr<Delegate> delegate_; 674 scoped_refptr<Delegate> delegate_;
669 675
670 // Lock for thread-safety 676 // Lock for thread-safety
671 base::Lock lock_; 677 base::Lock lock_;
672 678
673 base::Time last_statistic_record_time_; 679 base::Time last_statistic_record_time_;
674 680
675 bool keep_expired_cookies_; 681 bool keep_expired_cookies_;
682 bool persist_session_cookies_;
676 683
677 static bool enable_file_scheme_; 684 static bool enable_file_scheme_;
678 685
679 DISALLOW_COPY_AND_ASSIGN(CookieMonster); 686 DISALLOW_COPY_AND_ASSIGN(CookieMonster);
680 }; 687 };
681 688
682 class NET_EXPORT CookieMonster::CanonicalCookie { 689 class NET_EXPORT CookieMonster::CanonicalCookie {
683 public: 690 public:
684 691
685 // These constructors do no validation or canonicalization of their inputs; 692 // These constructors do no validation or canonicalization of their inputs;
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 private: 997 private:
991 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); 998 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore);
992 }; 999 };
993 1000
994 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { 1001 class CookieList : public std::vector<CookieMonster::CanonicalCookie> {
995 }; 1002 };
996 1003
997 } // namespace net 1004 } // namespace net
998 1005
999 #endif // NET_BASE_COOKIE_MONSTER_H_ 1006 #endif // NET_BASE_COOKIE_MONSTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698