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), |