chrome: Fix AssertBlockingAllowed() with disk-based Profile creation (see issue #2969)

This commit is contained in:
Marshall Greenblatt 2021-08-04 15:19:00 -04:00
parent ad71ec9fdf
commit eaf581e544

View File

@ -6,6 +6,7 @@
#include "libcef/browser/thread_util.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/off_the_record_profile_impl.h"
#include "chrome/browser/profiles/profile_keep_alive_types.h"
@ -105,6 +106,9 @@ void ChromeBrowserContext::ProfileCreated(Profile* profile,
CHECK(!profile);
CHECK(!profile_);
// Profile creation may access the filesystem.
base::ScopedAllowBlockingForTesting allow_blocking;
// Creation of a disk-based profile failed for some reason. Create a
// new/unique OffTheRecord profile instead.
const auto& profile_id = Profile::OTRProfileID::CreateUniqueForCEF();