Simplify PrefService initialization (issue #1947)

This commit is contained in:
Marshall Greenblatt
2017-09-25 15:11:17 +02:00
parent f372e90025
commit 3006329678
3 changed files with 22 additions and 35 deletions

View File

@@ -265,17 +265,12 @@ void CefBrowserContextImpl::Initialize() {
CefString(&CefContext::Get()->settings().accept_language_list);
}
// Initialize a temporary PrefService object that may be referenced during
// BrowserContextServices initialization.
pref_service_ =
browser_prefs::CreatePrefService(this, base::FilePath(), false, true);
// Initialize the PrefService object.
pref_service_ = browser_prefs::CreatePrefService(
this, cache_path_, !!settings_.persist_user_preferences);
CefBrowserContext::Initialize();
// Initialize the real PrefService object.
pref_service_ = browser_prefs::CreatePrefService(
this, cache_path_, !!settings_.persist_user_preferences, false);
// Initialize visited links management.
base::FilePath visited_link_path;
if (!cache_path_.empty())