From 7c6e53ddfb95fe2b5e9b01cd5eb1387c1ea1e93c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 29 Apr 2020 15:36:26 -0400 Subject: [PATCH] Save LocalPrefs.json in CefSettings.root_cache_path (see issue #2890) --- libcef/browser/chrome_browser_process_stub.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 70dff68fa..47b72a785 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -157,15 +157,17 @@ ProfileManager* ChromeBrowserProcessStub::profile_manager() { PrefService* ChromeBrowserProcessStub::local_state() { DCHECK(initialized_); if (!local_state_) { + // Use a location that is shared by all request contexts. const CefSettings& settings = CefContext::Get()->settings(); - const base::FilePath& cache_path = - base::FilePath(CefString(&settings.cache_path)); + const base::FilePath& root_cache_path = + base::FilePath(CefString(&settings.root_cache_path)); // Used for very early NetworkService initialization. // Always persist preferences for this PrefService if possible because it // contains the cookie encryption key on Windows. - local_state_ = browser_prefs::CreatePrefService( - nullptr /* profile */, cache_path, true /* persist_user_preferences */); + local_state_ = + browser_prefs::CreatePrefService(nullptr /* profile */, root_cache_path, + true /* persist_user_preferences */); } return local_state_.get(); }