Save LocalPrefs.json in CefSettings.root_cache_path (see issue #2890)

This commit is contained in:
Marshall Greenblatt 2020-04-29 15:36:26 -04:00
parent ff0c36b465
commit 7c6e53ddfb
1 changed files with 6 additions and 4 deletions

View File

@ -157,15 +157,17 @@ ProfileManager* ChromeBrowserProcessStub::profile_manager() {
PrefService* ChromeBrowserProcessStub::local_state() { PrefService* ChromeBrowserProcessStub::local_state() {
DCHECK(initialized_); DCHECK(initialized_);
if (!local_state_) { if (!local_state_) {
// Use a location that is shared by all request contexts.
const CefSettings& settings = CefContext::Get()->settings(); const CefSettings& settings = CefContext::Get()->settings();
const base::FilePath& cache_path = const base::FilePath& root_cache_path =
base::FilePath(CefString(&settings.cache_path)); base::FilePath(CefString(&settings.root_cache_path));
// Used for very early NetworkService initialization. // Used for very early NetworkService initialization.
// Always persist preferences for this PrefService if possible because it // Always persist preferences for this PrefService if possible because it
// contains the cookie encryption key on Windows. // contains the cookie encryption key on Windows.
local_state_ = browser_prefs::CreatePrefService( local_state_ =
nullptr /* profile */, cache_path, true /* persist_user_preferences */); browser_prefs::CreatePrefService(nullptr /* profile */, root_cache_path,
true /* persist_user_preferences */);
} }
return local_state_.get(); return local_state_.get();
} }