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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.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: Code review. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index f0ada492a9e361e803c2377c1ce089d2a05aef91..02bb06ae059d22e2c4007e91526b35dc022f662f 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -91,7 +91,8 @@ void ProfileImplIOData::Handle::Init(
const FilePath& app_path,
chrome_browser_net::Predictor* predictor,
PrefService* local_state,
- IOThread* io_thread) {
+ IOThread* io_thread,
+ bool restore_old_session_cookies) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!io_data_->lazy_params_.get());
DCHECK(predictor);
@@ -105,6 +106,7 @@ void ProfileImplIOData::Handle::Init(
lazy_params->media_cache_path = media_cache_path;
lazy_params->media_cache_max_size = media_cache_max_size;
lazy_params->extensions_cookie_path = extensions_cookie_path;
+ lazy_params->restore_old_session_cookies = restore_old_session_cookies;
io_data_->lazy_params_.reset(lazy_params);
@@ -318,18 +320,23 @@ void ProfileImplIOData::LazyInitializeInternal(
DCHECK(!lazy_params_->cookie_path.empty());
scoped_refptr<SQLitePersistentCookieStore> cookie_db =
- new SQLitePersistentCookieStore(lazy_params_->cookie_path);
+ new SQLitePersistentCookieStore(
+ lazy_params_->cookie_path,
+ lazy_params_->restore_old_session_cookies);
cookie_db->SetClearLocalStateOnExit(
profile_params->clear_local_state_on_exit);
cookie_store =
new net::CookieMonster(cookie_db.get(),
profile_params->cookie_monster_delegate);
+ if (command_line.HasSwitch(switches::kEnableRestoreSessionState))
+ cookie_store->GetCookieMonster()->SetPersistSessionCookies(true);
}
net::CookieMonster* extensions_cookie_store =
new net::CookieMonster(
new SQLitePersistentCookieStore(
- lazy_params_->extensions_cookie_path), NULL);
+ lazy_params_->extensions_cookie_path,
+ lazy_params_->restore_old_session_cookies), NULL);
// Enable cookies for devtools and extension URLs.
const char* schemes[] = {chrome::kChromeDevToolsScheme,
chrome::kExtensionScheme};
@@ -464,7 +471,7 @@ ProfileImplIOData::InitializeAppRequestContext(
DCHECK(!cookie_path.empty());
scoped_refptr<SQLitePersistentCookieStore> cookie_db =
- new SQLitePersistentCookieStore(cookie_path);
+ new SQLitePersistentCookieStore(cookie_path, false);
cookie_db->SetClearLocalStateOnExit(clear_local_state_on_exit_);
// TODO(creis): We should have a cookie delegate for notifying the cookie
// extensions API, but we need to update it to understand isolated apps
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698