Chromium Code Reviews| Index: net/base/cookie_monster.h |
| diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h |
| index 6d590921b0e4413f4260956c665334a0289d48c6..9aab85f4d7a7bd77188d6153822b1541eeafaac4 100644 |
| --- a/net/base/cookie_monster.h |
| +++ b/net/base/cookie_monster.h |
| @@ -275,6 +275,18 @@ class NET_EXPORT CookieMonster : public CookieStore { |
| virtual CookieMonster* GetCookieMonster() OVERRIDE; |
| + // Enables writing session cookies into the cookie database. |
| + void SetSyncSessionCookies(bool sync_session_cookies); |
|
jochen (gone - plz use gerrit)
2011/11/25 14:45:14
I would use a different verb, as "sync" implies it
marja
2011/11/28 15:22:01
I was using sync because CookieMonster already use
|
| + |
| + // Protects session cookies from deletion on shutdown. |
| + void SaveSessionCookies(); |
| + |
| + // Merges restored session cookies with other cookies. |
| + void RestoreOldSessionCookies(); |
| + |
| + // Discards restored session cookies. |
| + void DiscardOldSessionCookies(); |
| + |
| // Debugging method to perform various validation checks on the map. |
| // Currently just checking that there are no null CanonicalCookie pointers |
| // in the map. |
| @@ -352,6 +364,10 @@ class NET_EXPORT CookieMonster : public CookieStore { |
| // already-expired expiration date. This captures that case. |
| DELETE_COOKIE_EXPIRED_OVERWRITE, |
| + // Old session cookies can be explicitly deleted, and they also get |
| + // automatically deleted when trying to read / write them. |
| + DELETE_COOKIE_OLD_SESSION_COOKIE, |
| + |
| DELETE_COOKIE_LAST_ENTRY |
| }; |
| @@ -673,6 +689,8 @@ class NET_EXPORT CookieMonster : public CookieStore { |
| base::Time last_statistic_record_time_; |
| bool keep_expired_cookies_; |
| + bool keep_old_session_cookies_; |
| + bool sync_session_cookies_; |
| static bool enable_file_scheme_; |
| @@ -755,6 +773,14 @@ class NET_EXPORT CookieMonster::CanonicalCookie { |
| return has_expires_ && current >= expiry_date_; |
| } |
| + bool IsOldSessionCookie() const { |
| + return is_old_session_cookie_; |
| + } |
| + |
| + void SetIsOldSessionCookie(bool is_old_session_cookie) { |
| + is_old_session_cookie_ = is_old_session_cookie; |
| + } |
| + |
| // Are the cookies considered equivalent in the eyes of RFC 2965. |
| // The RFC says that name must match (case-sensitive), domain must |
| // match (case insensitive), and path must match (case sensitive). |
| @@ -809,6 +835,7 @@ class NET_EXPORT CookieMonster::CanonicalCookie { |
| bool httponly_; |
| bool has_expires_; |
| bool is_persistent_; |
| + bool is_old_session_cookie_; |
| }; |
| class CookieMonster::Delegate |
| @@ -981,6 +1008,10 @@ class CookieMonster::PersistentCookieStore |
| // must be deleted upon destruction. |
| virtual void SetClearLocalStateOnExit(bool clear_local_state) = 0; |
| + // Sets the value of the user preference whether the session cookies must |
| + // must be deleted upon destruction. |
| + virtual void SetClearSessionStateOnExit(bool clear_session_cookies) = 0; |
| + |
| // Flush the store and post the given Task when complete. |
| virtual void Flush(Task* completion_task) = 0; |