mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix assertion caused by PrefServiceFactory::Create
This commit is contained in:
@@ -100,14 +100,12 @@ BrowserContext::~BrowserContext() {
|
||||
}
|
||||
|
||||
void BrowserContext::InitPrefs() {
|
||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||
auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences"));
|
||||
PrefServiceFactory prefs_factory;
|
||||
scoped_refptr<JsonPrefStore> pref_store =
|
||||
base::MakeRefCounted<JsonPrefStore>(prefs_path);
|
||||
{
|
||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||
pref_store->ReadPrefs(); // Synchronous.
|
||||
}
|
||||
pref_store->ReadPrefs(); // Synchronous.
|
||||
prefs_factory.set_user_prefs(pref_store);
|
||||
|
||||
auto registry = make_scoped_refptr(new PrefRegistrySimple);
|
||||
|
||||
Reference in New Issue
Block a user