Commit 039124e7 authored by marja@chromium.org's avatar marja@chromium.org

ProfileImpl fix: Don't access DOMStorageContext too early.

Accessing DOMStorageContext requires creating a StoragePartition, and that can't be done
before the preferences are loaded.

BUG=142656


Review URL: https://chromiumcodereview.appspot.com/10831349

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152006 0039d316-1c4b-4281-b951-d872f2087c98
parent 5c0f4621
...@@ -315,11 +315,6 @@ ProfileImpl::ProfileImpl(const FilePath& path, ...@@ -315,11 +315,6 @@ ProfileImpl::ProfileImpl(const FilePath& path,
} else { } else {
NOTREACHED(); NOTREACHED();
} }
if (command_line->HasSwitch(switches::kEnableRestoreSessionState)) {
content::BrowserContext::GetDefaultDOMStorageContext(this)->
SetSaveSessionStorageOnDisk();
}
} }
void ProfileImpl::DoFinalInit(bool is_new_profile) { void ProfileImpl::DoFinalInit(bool is_new_profile) {
...@@ -427,6 +422,12 @@ void ProfileImpl::DoFinalInit(bool is_new_profile) { ...@@ -427,6 +422,12 @@ void ProfileImpl::DoFinalInit(bool is_new_profile) {
base::Bind(&EnsureReadmeFile, GetPath()), base::Bind(&EnsureReadmeFile, GetPath()),
base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); base::TimeDelta::FromMilliseconds(create_readme_delay_ms));
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableRestoreSessionState)) {
content::BrowserContext::GetDefaultDOMStorageContext(this)->
SetSaveSessionStorageOnDisk();
}
// Creation has been finished. // Creation has been finished.
if (delegate_) if (delegate_)
delegate_->OnProfileCreated(this, true, is_new_profile); delegate_->OnProfileCreated(this, true, is_new_profile);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment