Index: content/browser/net/sqlite_persistent_cookie_store.cc |
diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc |
index eaf793047a9b0b8cf28803ef9d84c69d418d74dd..40a763368897b0bd6bf1e0c4c9c20efaff53c75c 100644 |
--- a/content/browser/net/sqlite_persistent_cookie_store.cc |
+++ b/content/browser/net/sqlite_persistent_cookie_store.cc |
@@ -431,8 +431,6 @@ bool InitTable(sql::Connection* db) { |
void SQLitePersistentCookieStore::Backend::Load( |
const LoadedCallback& loaded_callback) { |
- // This function should be called only once per instance. |
- DCHECK(!db_.get()); |
PostBackgroundTask(FROM_HERE, base::Bind( |
&Backend::LoadAndNotifyInBackground, this, |
loaded_callback, base::Time::Now())); |
@@ -469,6 +467,8 @@ void SQLitePersistentCookieStore::Backend::LoadAndNotifyInBackground( |
PostClientTask(FROM_HERE, base::Bind( |
&Backend::CompleteLoadInForeground, this, loaded_callback, false)); |
} else { |
+ if (!restore_old_session_cookies_) |
+ DeleteSessionCookiesOnStartup(); |
erikwright (departed)
2015/04/07 22:37:09
Isn't this ineffective here? I would think it shou
|
ChainLoadCookies(loaded_callback); |
} |
} |
@@ -488,6 +488,8 @@ void SQLitePersistentCookieStore::Backend::LoadKeyAndNotifyInBackground( |
bool success = false; |
if (InitializeDatabase()) { |
+ if (!restore_old_session_cookies_) |
+ DeleteSessionCookiesOnStartup(); |
erikwright (departed)
2015/04/07 22:37:09
This makes me think that, in fact, we have a bug a
erikchen
2015/04/08 17:44:26
I agree that the previous behavior was incorrect.
|
std::map<std::string, std::set<std::string> >::iterator |
it = keys_to_load_.find(key); |
if (it != keys_to_load_.end()) { |
@@ -1268,8 +1270,6 @@ void SQLitePersistentCookieStore::Backend::FinishedLoadingCookies( |
bool success) { |
PostClientTask(FROM_HERE, base::Bind(&Backend::CompleteLoadInForeground, this, |
loaded_callback, success)); |
- if (success && !restore_old_session_cookies_) |
- DeleteSessionCookiesOnStartup(); |
} |
SQLitePersistentCookieStore::SQLitePersistentCookieStore( |