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

Unified Diff: net/base/cookie_monster.cc

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: Cleanup. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/cookie_monster.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_monster.cc
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc
index 7274cec24c575acf6df5ca5f6ff6c7277c041d0d..809ebda36d3db8d2a6ad838c93de2ee3cf0229ee 100644
--- a/net/base/cookie_monster.cc
+++ b/net/base/cookie_monster.cc
@@ -1399,6 +1399,13 @@ CookieMonster* CookieMonster::GetCookieMonster() {
return this;
}
+void CookieMonster::MergeSessionCookies(CookieMonster* session_cookie_monster) {
+ // Queue all cookie requests until the cookies have been merged.
+ loaded_ = false;
erikwright (departed) 2011/11/22 18:49:39 This is not designed to work this way. I suspect i
+ session_cookie_monster->GetAllCookiesAsync(
+ base::Bind(&CookieMonster::OnGotSessionCookies, this));
+}
+
CookieMonster::~CookieMonster() {
DeleteAll(false);
}
@@ -2246,6 +2253,21 @@ Time CookieMonster::CurrentTime() {
Time::FromInternalValue(last_time_seen_.ToInternalValue() + 1));
}
+void CookieMonster::OnGotSessionCookies(
+ const net::CookieList& cookie_list) {
+ // The cookies we got are all marked as persistent; we need to make them
+ // non-persistent before merging them.
+ net::CookieList new_cookie_list;
+ net::CookieList::const_iterator it;
+ for (it = cookie_list.begin(); it != cookie_list.end(); ++it) {
+ net::CookieMonster::CanonicalCookie new_cookie(*it);
+ new_cookie.SetPersistent(false);
+ new_cookie_list.push_back(new_cookie);
+ }
+ InitializeFrom(new_cookie_list);
+ InvokeQueue();
erikwright (departed) 2011/11/22 18:49:39 This is not likely to work as expected.
+}
+
CookieMonster::ParsedCookie::ParsedCookie(const std::string& cookie_line)
: is_valid_(false),
path_index_(0),
« no previous file with comments | « net/base/cookie_monster.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698