Delete Alloy bootstrap (fixes #3685)

This commit is contained in:
Marshall Greenblatt
2024-06-25 20:12:37 -04:00
parent b95b3e6fd5
commit a461a89728
282 changed files with 360 additions and 22399 deletions

View File

@ -1,5 +1,5 @@
diff --git base/task/thread_pool/thread_pool_impl.cc base/task/thread_pool/thread_pool_impl.cc
index 4ac5cea5f6c08..559593f1564c9 100644
index 4ac5cea5f6c08..a9c1c152568f3 100644
--- base/task/thread_pool/thread_pool_impl.cc
+++ base/task/thread_pool/thread_pool_impl.cc
@@ -105,6 +105,10 @@ ThreadPoolImpl::ThreadPoolImpl(std::string_view histogram_label,

View File

@ -1,60 +1,3 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index a344dc5c74ce3..548e6218b0e82 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -9,6 +9,7 @@
#include "base/feature_list.h"
#include "build/build_config.h"
#include "build/buildflag.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/one_time_permission_provider.h"
#include "chrome/browser/permissions/one_time_permissions_tracker_factory.h"
#include "chrome/browser/profiles/off_the_record_profile_impl.h"
@@ -27,6 +28,10 @@
#include "extensions/buildflags/buildflags.h"
#include "ui/webui/webui_allowlist_provider.h"
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/trace_event/trace_event.h"
#include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h"
@@ -60,7 +65,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
#endif
DependsOn(OneTimePermissionsTrackerFactory::GetInstance());
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled()) {
+#endif
DependsOn(extensions::ContentSettingsService::GetFactoryInstance());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif
// Used by way of ShouldRestoreOldSessionCookies().
#if BUILDFLAG(ENABLE_SESSION_SERVICE)
@@ -113,6 +124,9 @@ scoped_refptr<RefcountedKeyedService>
std::move(allowlist_provider));
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled()) {
+#endif
// These must be registered before before the HostSettings are passed over to
// the IOThread. Simplest to do this on construction.
settings_map->RegisterProvider(
@@ -125,6 +139,9 @@ scoped_refptr<RefcountedKeyedService>
// the case where profile->IsOffTheRecord() is true? And what is the
// interaction with profile->IsGuestSession()?
false));
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
supervised_user::SupervisedUserSettingsService* supervised_service =
SupervisedUserSettingsServiceFactory::GetForKey(profile->GetProfileKey());
diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc
index 0cc2bfa06245f..86655f6746459 100644
--- components/content_settings/renderer/content_settings_agent_impl.cc

View File

@ -1,26 +1,14 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index b6e26d1d2e082..90aec2642adfe 100644
index b6e26d1d2e082..c84b890fa8a62 100644
--- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc
@@ -20,6 +20,7 @@
#include "base/threading/hang_watcher.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h"
@@ -245,6 +246,17 @@ void FileSelectHelper::OnListFile(
@@ -245,6 +245,13 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) {
+ if (
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ cef::IsAlloyRuntimeEnabled() ||
+#endif
+ run_from_cef_) {
+ // Don't show the upload confirmation dialog with the Alloy runtime, or
+ // when triggered via CEF (initially or recursively).
+ if (run_from_cef_) {
+ // Don't show the upload confirmation dialog when triggered via CEF
+ // (initially or recursively).
+ ConvertToFileChooserFileInfoList(selected_files);
+ return;
+ }
@ -28,22 +16,7 @@ index b6e26d1d2e082..90aec2642adfe 100644
ShowFolderUploadConfirmationDialog(
path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -329,6 +341,14 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
if (AbortIfWebContentsDestroyed())
return;
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ // Don't trigger creation of a AccountConsistencyModeManager (see issue #3401)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ NotifyListenerAndEnd(std::move(list));
+ return;
+ }
+#endif
+
#if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS)
enterprise_connectors::ContentAnalysisDelegate::Data data;
if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
@@ -472,31 +492,51 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -472,31 +479,51 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back();
@ -99,7 +72,7 @@ index b6e26d1d2e082..90aec2642adfe 100644
if (extensions->size() > old_extension_size)
valid_type_count++;
}
@@ -513,12 +553,28 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -513,12 +540,28 @@ FileSelectHelper::GetFileTypesFromAcceptType(
// dialog uses the first extension in the list to form the description,
// like "EHTML Files". This is not what we want.
if (valid_type_count > 1 ||
@ -132,7 +105,7 @@ index b6e26d1d2e082..90aec2642adfe 100644
}
return file_type;
@@ -528,7 +584,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -528,7 +571,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@ -142,7 +115,7 @@ index b6e26d1d2e082..90aec2642adfe 100644
Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext());
@@ -547,6 +604,7 @@ void FileSelectHelper::RunFileChooser(
@@ -547,6 +591,7 @@ void FileSelectHelper::RunFileChooser(
// message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile));

View File

@ -84,38 +84,3 @@ index af7f1d5fac12b..1cb1d01464c11 100644
base::WeakPtrFactory<ChromeDownloadManagerDelegate> weak_ptr_factory_{this};
};
diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc
index 4ffbb8f5630d4..da0d2975b13d5 100644
--- chrome/browser/download/download_prefs.cc
+++ chrome/browser/download/download_prefs.cc
@@ -23,6 +23,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_core_service_factory.h"
#include "chrome/browser/download/download_core_service_impl.h"
@@ -64,6 +65,10 @@
#include "chrome/browser/flags/android/chrome_feature_list.h"
#endif
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/browser/alloy/alloy_download_util.h"
+#endif
+
using content::BrowserContext;
using content::BrowserThread;
using content::DownloadManager;
@@ -351,6 +356,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager(
// static
DownloadPrefs* DownloadPrefs::FromBrowserContext(
content::BrowserContext* context) {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ return alloy::GetDownloadPrefsFromBrowserContext(context);
+ }
+#endif
return FromDownloadManager(context->GetDownloadManager());
}

View File

@ -1,33 +0,0 @@
diff --git chrome/browser/net/proxy_config_monitor.cc chrome/browser/net/proxy_config_monitor.cc
index c2adfa2bd0f79..ccb076655002c 100644
--- chrome/browser/net/proxy_config_monitor.cc
+++ chrome/browser/net/proxy_config_monitor.cc
@@ -9,6 +9,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -21,6 +22,10 @@
#include "chrome/browser/ash/profiles/profile_helper.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/proxy/proxy_api.h"
#endif
@@ -92,6 +97,9 @@ void ProxyConfigMonitor::AddToNetworkContextParams(
}
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled())
+#endif
error_receiver_set_.Add(this, network_context_params->proxy_error_client
.InitWithNewPipeAndPassReceiver());
#endif

View File

@ -1,147 +1,3 @@
diff --git chrome/browser/background_fetch/background_fetch_permission_context.cc chrome/browser/background_fetch/background_fetch_permission_context.cc
index fbc2dccbeb46d..9eea3a3c5c64c 100644
--- chrome/browser/background_fetch/background_fetch_permission_context.cc
+++ chrome/browser/background_fetch/background_fetch_permission_context.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/background_fetch/background_fetch_permission_context.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/download/download_request_limiter.h"
@@ -25,7 +26,11 @@ ContentSetting BackgroundFetchPermissionContext::GetPermissionStatusInternal(
const GURL& embedding_origin) const {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (render_frame_host && !render_frame_host->GetParent()) {
+ if (
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ !cef::IsAlloyRuntimeEnabled() &&
+#endif
+ render_frame_host && !render_frame_host->GetParent()) {
DownloadRequestLimiter* limiter =
g_browser_process->download_request_limiter();
DCHECK(limiter);
diff --git chrome/browser/background_sync/periodic_background_sync_permission_context.cc chrome/browser/background_sync/periodic_background_sync_permission_context.cc
index c45e337c0c746..948cbbc9e3d7a 100644
--- chrome/browser/background_sync/periodic_background_sync_permission_context.cc
+++ chrome/browser/background_sync/periodic_background_sync_permission_context.cc
@@ -6,6 +6,7 @@
#include "base/feature_list.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -89,6 +90,12 @@ PeriodicBackgroundSyncPermissionContext::GetPermissionStatusInternal(
return CONTENT_SETTING_ALLOW;
#endif
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ return CONTENT_SETTING_BLOCK;
+ }
+#endif
+
bool can_bypass_install_requirement =
base::FeatureList::IsEnabled(
features::kPeriodicSyncPermissionForDefaultSearchEngine) &&
diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc
index 1123ef8c5aa52..51f42541b3d7b 100644
--- chrome/browser/permissions/chrome_permissions_client.cc
+++ chrome/browser/permissions/chrome_permissions_client.cc
@@ -15,6 +15,7 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/ash/shimless_rma/chrome_shimless_rma_delegate.h"
#include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h"
#include "chrome/browser/browser_process.h"
@@ -199,6 +200,11 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker(
double ChromePermissionsClient::GetSiteEngagementScore(
content::BrowserContext* browser_context,
const GURL& origin) {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ // No SiteEngagementService with the Alloy runtime.
+ if (cef::IsAlloyRuntimeEnabled())
+ return 0.0;
+#endif
return site_engagement::SiteEngagementService::Get(
Profile::FromBrowserContext(browser_context))
->GetScore(origin);
@@ -369,8 +375,14 @@ ChromePermissionsClient::CreatePermissionUiSelectors(
std::make_unique<ContextualNotificationPermissionUiSelector>());
selectors.emplace_back(std::make_unique<PrefBasedQuietPermissionUiSelector>(
Profile::FromBrowserContext(browser_context)));
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
selectors.emplace_back(std::make_unique<PredictionBasedPermissionUiSelector>(
Profile::FromBrowserContext(browser_context)));
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
return selectors;
}
diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc
index 8cadbddb47767..879ed1cab0558 100644
--- chrome/browser/permissions/permission_manager_factory.cc
+++ chrome/browser/permissions/permission_manager_factory.cc
@@ -6,6 +6,7 @@
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/background_fetch/background_fetch_permission_context.h"
#include "chrome/browser/background_sync/periodic_background_sync_permission_context.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -68,9 +69,15 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
std::make_unique<GeolocationPermissionContextDelegate>(profile);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
delegates.geolocation_system_permission_manager =
device::GeolocationSystemPermissionManager::GetInstance();
DCHECK(delegates.geolocation_system_permission_manager);
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif
delegates.media_stream_device_enumerator =
MediaCaptureDevicesDispatcher::GetInstance();
diff --git chrome/browser/storage/durable_storage_permission_context.cc chrome/browser/storage/durable_storage_permission_context.cc
index 9934727f31a59..9ab13938d39c2 100644
--- chrome/browser/storage/durable_storage_permission_context.cc
+++ chrome/browser/storage/durable_storage_permission_context.cc
@@ -8,6 +8,7 @@
#include "base/check_op.h"
#include "base/containers/contains.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -56,7 +57,13 @@ void DurableStoragePermissionContext::DecidePermission(
// Durable is only allowed to be granted to the top-level origin. Embedding
// origin is the last committed navigation origin to the web contents.
- if (request_data.requesting_origin != request_data.embedding_origin) {
+ // Permission depends on PWA and site engagement subsystems which are not
+ // supported by the Alloy runtime (see issue #3379).
+ if (
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ cef::IsAlloyRuntimeEnabled() ||
+#endif
+ request_data.requesting_origin != request_data.embedding_origin) {
NotifyPermissionSet(request_data.id, request_data.requesting_origin,
request_data.embedding_origin, std::move(callback),
/*persist=*/false, CONTENT_SETTING_DEFAULT,
diff --git chrome/browser/ui/permission_bubble/permission_prompt.h chrome/browser/ui/permission_bubble/permission_prompt.h
index fbce13c16ad10..0512b2f09937e 100644
--- chrome/browser/ui/permission_bubble/permission_prompt.h
@ -193,37 +49,3 @@ index 7f976b5bc5c44..ee2faa5c297a7 100644
Browser* browser = chrome::FindBrowserWithTab(web_contents);
if (!browser) {
DLOG(WARNING) << "Permission prompt suppressed because the WebContents is "
diff --git components/embedder_support/permission_context_utils.cc components/embedder_support/permission_context_utils.cc
index 063b8e6c0747d..0b7deda8a97b3 100644
--- components/embedder_support/permission_context_utils.cc
+++ components/embedder_support/permission_context_utils.cc
@@ -5,6 +5,7 @@
#include "components/embedder_support/permission_context_utils.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "components/background_sync/background_sync_permission_context.h"
#include "components/permissions/contexts/accessibility_permission_context.h"
#include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h"
@@ -79,10 +80,21 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context,
std::move(delegates.geolocation_permission_context_delegate),
is_regular_profile);
#elif BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ permission_contexts[ContentSettingsType::GEOLOCATION] =
+ std::make_unique<permissions::GeolocationPermissionContext>(
+ browser_context,
+ std::move(delegates.geolocation_permission_context_delegate));
+ } else {
+#endif
permission_contexts[ContentSettingsType::GEOLOCATION] =
std::make_unique<permissions::GeolocationPermissionContextSystem>(
browser_context,
std::move(delegates.geolocation_permission_context_delegate));
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#else
permission_contexts[ContentSettingsType::GEOLOCATION] =
std::make_unique<permissions::GeolocationPermissionContext>(

View File

@ -99,86 +99,3 @@ index 0909a332a46bf..163de8ef6a878 100644
return raw_otr_profile;
}
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 35ed366d5e749..da51d2e0081f5 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -437,7 +437,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
profile_manager_android_ = std::make_unique<ProfileManagerAndroid>(this);
#endif
- if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty())
+ if (!user_data_dir_.empty() && ProfileShortcutManager::IsFeatureEnabled())
profile_shortcut_manager_ = ProfileShortcutManager::Create(this);
zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this,
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 3d5fd0d5ca858..965ab69b3fe8f 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -134,7 +134,7 @@ class ProfileManager : public Profile::Delegate {
// acceptable. Returns nullptr if loading the new profile fails.
// TODO(bauerb): Migrate calls from other code to `GetProfileByPath()`, then
// make this method private.
- Profile* GetProfile(const base::FilePath& profile_dir);
+ virtual Profile* GetProfile(const base::FilePath& profile_dir);
// Returns regular or off-the-record profile given its profile key.
static Profile* GetProfileFromProfileKey(ProfileKey* profile_key);
@@ -175,7 +175,7 @@ class ProfileManager : public Profile::Delegate {
// Returns true if the profile pointer is known to point to an existing
// profile.
- bool IsValidProfile(const void* profile);
+ virtual bool IsValidProfile(const void* profile);
// Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use.
diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc
index 1154f4f02cc16..4c9e5128cd177 100644
--- chrome/browser/profiles/renderer_updater.cc
+++ chrome/browser/profiles/renderer_updater.cc
@@ -10,6 +10,7 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/content_settings_manager_delegate.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -46,6 +47,9 @@ RendererUpdater::RendererUpdater(Profile* profile)
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
,
bound_session_cookie_refresh_service_(
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ cef::IsAlloyRuntimeEnabled() ? nullptr :
+#endif
BoundSessionCookieRefreshServiceFactory::GetForProfile(profile))
#endif
{
diff --git chrome/browser/profiles/renderer_updater_factory.cc chrome/browser/profiles/renderer_updater_factory.cc
index a836288d08abc..26219d19f0973 100644
--- chrome/browser/profiles/renderer_updater_factory.cc
+++ chrome/browser/profiles/renderer_updater_factory.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/profiles/renderer_updater_factory.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/renderer_updater.h"
@@ -25,7 +26,13 @@ RendererUpdaterFactory::RendererUpdaterFactory()
DependsOn(IdentityManagerFactory::GetInstance());
DependsOn(HostContentSettingsMapFactory::GetInstance());
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
DependsOn(BoundSessionCookieRefreshServiceFactory::GetInstance());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif // BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
}

View File

@ -1,82 +0,0 @@
diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc
index 354965a6332b3..6843e6d123cc8 100644
--- chrome/browser/themes/theme_service.cc
+++ chrome/browser/themes/theme_service.cc
@@ -30,6 +30,7 @@
#include "base/task/thread_pool.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
#include "chrome/browser/new_tab_page/chrome_colors/chrome_colors_util.h"
@@ -65,6 +66,10 @@
#include "ui/color/color_provider_manager.h"
#include "ui/native_theme/native_theme.h"
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/scoped_observation.h"
#include "extensions/browser/extension_registry_observer.h"
@@ -266,11 +271,19 @@ void ThemeService::Init() {
// OnExtensionServiceReady. Otherwise, the ThemeObserver won't be
// constructed in time to observe the corresponding events.
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
+ !extensions::ExtensionsEnabled();
+#else
+ const bool extensions_disabled = false;
+#endif
+ if (!extensions_disabled) {
theme_observer_ = std::make_unique<ThemeObserver>(this);
extensions::ExtensionSystem::Get(profile_)->ready().Post(
FROM_HERE, base::BindOnce(&ThemeService::OnExtensionServiceReady,
weak_ptr_factory_.GetWeakPtr()));
+ }
#endif
theme_syncable_service_ =
std::make_unique<ThemeSyncableService>(profile_, this);
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
index 49fd0b0f7a21c..dc4258f7143d1 100644
--- chrome/browser/themes/theme_service_factory.cc
+++ chrome/browser/themes/theme_service_factory.cc
@@ -9,6 +9,7 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_service.h"
@@ -35,6 +36,10 @@
#include "ui/linux/linux_ui_factory.h"
#endif
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
namespace {
const ThemeHelper& GetThemeHelper() {
@@ -96,7 +101,15 @@ ThemeServiceFactory::ThemeServiceFactory()
.Build()) {
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
+ !extensions::ExtensionsEnabled();
+#else
+ const bool extensions_disabled = false;
+#endif
+ if (!extensions_disabled) {
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
+ }
}
ThemeServiceFactory::~ThemeServiceFactory() = default;

View File

@ -1,110 +1,3 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index 0ca794a57bed3..ce171b7a01a8c 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -16,6 +16,7 @@
#include "base/memory/singleton.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
@@ -140,6 +141,12 @@ bool IsPluginLoadingAccessibleResourceInWebView(
extensions::ExtensionRegistry* extension_registry,
int process_id,
const GURL& resource) {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ // May be nullptr if using CEF Alloy with extensions disabled.
+ if (!extension_registry)
+ return false;
+#endif
+
extensions::WebViewRendererState* renderer_state =
extensions::WebViewRendererState::GetInstance();
std::string partition_id;
diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc
index 00dd9a34cd3fb..89d4588bdbe4e 100644
--- chrome/browser/plugins/plugin_utils.cc
+++ chrome/browser/plugins/plugin_utils.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/plugins/plugin_utils.h"
#include "base/values.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/profiles/profile.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
@@ -69,6 +70,15 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
content::BrowserContext* browser_context) {
base::flat_map<std::string, std::string> mime_type_to_extension_id_map;
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ // May be nullptr if using CEF Alloy with extensions disabled.
+ extensions::ExtensionRegistry* registry =
+ extensions::ExtensionRegistry::Get(browser_context);
+ if (!registry) {
+ return mime_type_to_extension_id_map;
+ }
+#endif
+
Profile* profile = Profile::FromBrowserContext(browser_context);
if (extensions::ChromeContentBrowserClientExtensionsPart::
AreExtensionsDisabledForProfile(profile)) {
@@ -79,9 +89,11 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
MimeTypesHandler::GetMIMETypeAllowlist();
// Go through the allowed extensions and try to use them to intercept
// the URL request.
+#if !BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(browser_context);
DCHECK(registry);
+#endif
for (const std::string& extension_id : allowlist) {
const extensions::Extension* extension =
registry->enabled_extensions().GetByID(extension_id);
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 120ec8af72623..012f7b602cf40 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -996,6 +996,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
+ content_settings_agent_delegate &&
content_settings_agent_delegate->IsPluginTemporarilyAllowed(
identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
@@ -1156,7 +1157,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
- content_settings_agent->DidBlockContentType(content_type);
+ if (content_settings_agent)
+ content_settings_agent->DidBlockContentType(content_type);
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -1165,7 +1167,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
- content_settings_agent->DidBlockContentType(content_type);
+ if (content_settings_agent)
+ content_settings_agent->DidBlockContentType(content_type);
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1175,7 +1178,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
- content_settings_agent->DidBlockContentType(content_type);
+ if (content_settings_agent)
+ content_settings_agent->DidBlockContentType(content_type);
break;
}
}
diff --git content/browser/browser_plugin/browser_plugin_embedder.h content/browser/browser_plugin/browser_plugin_embedder.h
index ea2891a279371..595e5b8eb2cb6 100644
--- content/browser/browser_plugin/browser_plugin_embedder.h

View File

@ -1,16 +0,0 @@
diff --git chrome/browser/ui/prefs/pref_watcher.h chrome/browser/ui/prefs/pref_watcher.h
index 79ce1590df640..6b57feb48aad6 100644
--- chrome/browser/ui/prefs/pref_watcher.h
+++ chrome/browser/ui/prefs/pref_watcher.h
@@ -36,10 +36,10 @@ class PrefWatcher : public KeyedService,
void RegisterRendererPreferenceWatcher(
mojo::PendingRemote<blink::mojom::RendererPreferenceWatcher> watcher);
- private:
// KeyedService overrides:
void Shutdown() override;
+ private:
// ui::NativeThemeObserver:
void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;

View File

@ -1,25 +0,0 @@
diff --git chrome/utility/chrome_content_utility_client.cc chrome/utility/chrome_content_utility_client.cc
index 8a498ddd2c563..1a96939d54079 100644
--- chrome/utility/chrome_content_utility_client.cc
+++ chrome/utility/chrome_content_utility_client.cc
@@ -14,6 +14,7 @@
#include "base/path_service.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/profiler/thread_profiler.h"
#include "chrome/common/profiler/thread_profiler_configuration.h"
@@ -55,7 +56,11 @@ void ChromeContentUtilityClient::UtilityThreadStarted() {
command_line->GetSwitchValueASCII(switches::kProcessType);
// An in-process utility thread may run in other processes, only set up
// collector in a utility process.
- if (process_type == switches::kUtilityProcess) {
+ if (process_type == switches::kUtilityProcess
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ && !cef::IsAlloyRuntimeEnabled()
+#endif
+ ) {
const auto* heap_profiler_controller =
heap_profiling::HeapProfilerController::GetInstance();
// The HeapProfilerController should have been created in

View File

@ -1,14 +0,0 @@
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index 32454297cb12b..1f0b5d5d6a5e4 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -1639,7 +1639,8 @@ bool RenderProcessHostImpl::Init() {
// initialized because in tests the factory may never have been initialized.
if (!GetBrowserContext()->IsOffTheRecord() &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableGpuShaderDiskCache)) {
+ switches::kDisableGpuShaderDiskCache) &&
+ !storage_partition_impl_->GetPath().empty()) {
if (auto* cache_factory = GetGpuDiskCacheFactorySingleton()) {
for (const gpu::GpuDiskCacheType type : gpu::kGpuDiskCacheTypes) {
auto handle = cache_factory->GetCacheHandle(

View File

@ -1,285 +0,0 @@
diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc
index b9b147c8c11df..1e3acf4e679ae 100644
--- chrome/browser/extensions/api/streams_private/streams_private_api.cc
+++ chrome/browser/extensions/api/streams_private/streams_private_api.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_contents.h"
@@ -26,6 +27,10 @@
#include "pdf/pdf_features.h"
#endif // BUILDFLAG(ENABLE_PDF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/browser/extensions/alloy_extensions_util.h"
+#endif
+
namespace extensions {
void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
@@ -43,6 +48,9 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
if (!web_contents)
return;
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
// If the request was for NoStatePrefetch, abort the prefetcher and do not
// continue. This is because plugins cancel NoStatePrefetch, see
// http://crbug.com/343590.
@@ -53,6 +61,9 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
no_state_prefetch_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD);
return;
}
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
auto* browser_context = web_contents->GetBrowserContext();
@@ -79,9 +90,18 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
// forms of zooming won't work).
// TODO(crbug.com/40114809): Present a coherent representation of a tab id for
// portal contents.
- int tab_id = web_contents->GetOuterWebContents()
- ? SessionID::InvalidValue().id()
- : ExtensionTabUtil::GetTabId(web_contents);
+ int tab_id;
+ if (web_contents->GetOuterWebContents()) {
+ tab_id = SessionID::InvalidValue().id();
+ } else
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ tab_id = alloy::GetTabIdForWebContents(web_contents);
+ } else
+#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ {
+ tab_id = ExtensionTabUtil::GetTabId(web_contents);
+ }
std::unique_ptr<StreamContainer> stream_container(
new StreamContainer(tab_id, embedded, handler_url, extension_id,
diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc
index 55b798350ae8d..e4f7f261efcb3 100644
--- extensions/browser/extension_host.cc
+++ extensions/browser/extension_host.cc
@@ -142,12 +142,13 @@ ExtensionHost::ExtensionHost(const Extension* extension,
host_type == mojom::ViewType::kOffscreenDocument ||
host_type == mojom::ViewType::kExtensionPopup ||
host_type == mojom::ViewType::kExtensionSidePanel);
- host_contents_ = WebContents::Create(
+ host_contents_owned_ = WebContents::Create(
WebContents::CreateParams(browser_context_, site_instance));
+ host_contents_ = host_contents_owned_.get();
host_contents_->SetOwnerLocationForDebug(FROM_HERE);
- content::WebContentsObserver::Observe(host_contents_.get());
+ content::WebContentsObserver::Observe(host_contents_);
host_contents_->SetDelegate(this);
- SetViewType(host_contents_.get(), host_type);
+ SetViewType(host_contents_, host_type);
main_frame_host_ = host_contents_->GetPrimaryMainFrame();
if (host_type == mojom::ViewType::kExtensionBackgroundPage) {
@@ -167,11 +168,49 @@ ExtensionHost::ExtensionHost(const Extension* extension,
// Create password reuse detection manager when new extension web contents are
// created.
ExtensionsBrowserClient::Get()->CreatePasswordReuseDetectionManager(
- host_contents_.get());
+ host_contents_);
ExtensionHostRegistry::Get(browser_context_)->ExtensionHostCreated(this);
}
+ExtensionHost::ExtensionHost(ExtensionHostDelegate* delegate,
+ const Extension* extension,
+ content::BrowserContext* browser_context,
+ content::WebContents* host_contents,
+ const GURL& url,
+ mojom::ViewType host_type)
+ : delegate_(delegate),
+ extension_(extension),
+ extension_id_(extension->id()),
+ browser_context_(browser_context),
+ host_contents_(host_contents),
+ initial_url_(url),
+ extension_host_type_(host_type) {
+ DCHECK(delegate);
+ DCHECK(browser_context);
+ DCHECK(host_contents);
+
+ DCHECK(host_type == mojom::ViewType::kExtensionBackgroundPage ||
+ host_type == mojom::ViewType::kOffscreenDocument ||
+ host_type == mojom::ViewType::kExtensionPopup ||
+ host_type == mojom::ViewType::kExtensionSidePanel);
+
+ content::WebContentsObserver::Observe(host_contents_);
+ SetViewType(host_contents_, host_type);
+
+ main_frame_host_ = host_contents_->GetPrimaryMainFrame();
+
+ // Listen for when an extension is unloaded from the same profile, as it may
+ // be the same extension that this points to.
+ ExtensionRegistry::Get(browser_context_)->AddObserver(this);
+
+ // Set up web contents observers and pref observers.
+ delegate_->OnExtensionHostCreated(host_contents_);
+
+ ExtensionWebContentsObserver::GetForWebContents(host_contents_)->
+ dispatcher()->set_delegate(this);
+}
+
ExtensionHost::~ExtensionHost() {
ExtensionRegistry::Get(browser_context_)->RemoveObserver(this);
diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h
index 28ba09319b047..92a52d2056b73 100644
--- extensions/browser/extension_host.h
+++ extensions/browser/extension_host.h
@@ -62,6 +62,12 @@ class ExtensionHost : public DeferredStartRenderHost,
content::SiteInstance* site_instance,
const GURL& url,
mojom::ViewType host_type);
+ ExtensionHost(ExtensionHostDelegate* delegate,
+ const Extension* extension,
+ content::BrowserContext* browser_context,
+ content::WebContents* host_contents,
+ const GURL& url,
+ mojom::ViewType host_type);
ExtensionHost(const ExtensionHost&) = delete;
ExtensionHost& operator=(const ExtensionHost&) = delete;
@@ -72,7 +78,7 @@ class ExtensionHost : public DeferredStartRenderHost,
const Extension* extension() const { return extension_; }
const ExtensionId& extension_id() const { return extension_id_; }
- content::WebContents* host_contents() const { return host_contents_.get(); }
+ content::WebContents* host_contents() const { return host_contents_; }
content::RenderFrameHost* main_frame_host() const { return main_frame_host_; }
content::RenderProcessHost* render_process_host() const;
bool has_loaded_once() const { return has_loaded_once_; }
@@ -244,7 +250,8 @@ class ExtensionHost : public DeferredStartRenderHost,
raw_ptr<content::BrowserContext> browser_context_;
// The host for our HTML content.
- std::unique_ptr<content::WebContents> host_contents_;
+ std::unique_ptr<content::WebContents> host_contents_owned_;
+ raw_ptr<content::WebContents> host_contents_;
// A pointer to the current or speculative main frame in `host_contents_`. We
// can't access this frame through the `host_contents_` directly as it does
diff --git extensions/browser/extension_registry.cc extensions/browser/extension_registry.cc
index c3197eb4790fa..f558ff72bdbac 100644
--- extensions/browser/extension_registry.cc
+++ extensions/browser/extension_registry.cc
@@ -6,9 +6,14 @@
#include "base/observer_list.h"
#include "base/strings/string_util.h"
+#include "cef/libcef/features/runtime.h"
#include "extensions/browser/extension_registry_factory.h"
#include "extensions/browser/extension_registry_observer.h"
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
namespace extensions {
ExtensionRegistry::ExtensionRegistry(content::BrowserContext* browser_context)
@@ -17,6 +22,11 @@ ExtensionRegistry::~ExtensionRegistry() = default;
// static
ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled() && !extensions::ExtensionsEnabled()) {
+ return nullptr;
+ }
+#endif
return ExtensionRegistryFactory::GetForBrowserContext(context);
}
diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h
index 8b515b7b8c353..f8e4106ac26d4 100644
--- extensions/browser/extensions_browser_client.h
+++ extensions/browser/extensions_browser_client.h
@@ -33,6 +33,7 @@
#include "url/gurl.h"
class ExtensionFunctionRegistry;
+class GURL;
class PrefService;
namespace base {
@@ -81,6 +82,7 @@ class ComponentExtensionResourceManager;
class Extension;
class ExtensionCache;
class ExtensionError;
+class ExtensionHost;
class ExtensionHostDelegate;
class ExtensionSet;
class ExtensionSystem;
@@ -272,6 +274,14 @@ class ExtensionsBrowserClient {
virtual std::unique_ptr<ExtensionHostDelegate>
CreateExtensionHostDelegate() = 0;
+ // CEF creates a custom ExtensionHost for background pages. If the return
+ // value is true and |host| is NULL then fail the background host creation.
+ virtual bool CreateBackgroundExtensionHost(
+ const Extension* extension,
+ content::BrowserContext* browser_context,
+ const GURL& url,
+ ExtensionHost** host) { return false; }
+
// Returns true if the client version has updated since the last run. Called
// once each time the extensions system is loaded per browser_context. The
// implementation may wish to use the BrowserContext to record the current
diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc
index 8e512cd3c826e..0cfda0e69be23 100644
--- extensions/browser/process_manager.cc
+++ extensions/browser/process_manager.cc
@@ -353,9 +353,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
return true; // TODO(kalman): return false here? It might break things...
DVLOG(1) << "CreateBackgroundHost " << extension->id();
- ExtensionHost* host =
+ ExtensionHost* host = nullptr;
+ if (ExtensionsBrowserClient::Get()->CreateBackgroundExtensionHost(
+ extension, browser_context_, url, &host) && !host) {
+ // Explicitly fail if the client can't create the host.
+ return false;
+ }
+ if (!host) {
+ host =
new ExtensionHost(extension, GetSiteInstanceForURL(url).get(), url,
mojom::ViewType::kExtensionBackgroundPage);
+ }
host->SetCloseHandler(
base::BindOnce(&ProcessManager::HandleCloseExtensionHost,
weak_ptr_factory_.GetWeakPtr()));
diff --git extensions/common/extensions_client.cc extensions/common/extensions_client.cc
index c313f6f98cabc..d49f624cce881 100644
--- extensions/common/extensions_client.cc
+++ extensions/common/extensions_client.cc
@@ -8,6 +8,7 @@
#include "base/check.h"
#include "base/notreached.h"
+#include "cef/libcef/features/features.h"
#include "extensions/common/extensions_api_provider.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/features/json_feature_provider_source.h"
@@ -25,7 +26,10 @@ ExtensionsClient* g_client = nullptr;
} // namespace
ExtensionsClient* ExtensionsClient::Get() {
+#if !BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ // May be nullptr if using CEF Alloy with extensions disabled.
DCHECK(g_client);
+#endif
return g_client;
}

View File

@ -1,13 +0,0 @@
diff --git chrome/browser/font_family_cache.h chrome/browser/font_family_cache.h
index d4a32438bd20d..7e1d40e973333 100644
--- chrome/browser/font_family_cache.h
+++ chrome/browser/font_family_cache.h
@@ -19,6 +19,8 @@ class Profile;
FORWARD_DECLARE_TEST(FontFamilyCacheTest, Caching);
+extern const char kFontFamilyCacheKey[];
+
// Caches font family preferences associated with a PrefService. This class
// relies on the assumption that each concatenation of map_name + '.' + script
// is a unique string. It also relies on the assumption that the (const char*)

View File

@ -1,91 +0,0 @@
diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc
index c312526970cf7..330b8f38616ae 100644
--- chrome/browser/printing/print_preview_dialog_controller.cc
+++ chrome/browser/printing/print_preview_dialog_controller.cc
@@ -16,6 +16,7 @@
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/print_view_manager_base.h"
diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html
index 5d1658999d5bb..d1b7b7288c946 100644
--- chrome/browser/resources/print_preview/ui/destination_dialog.html
+++ chrome/browser/resources/print_preview/ui/destination_dialog.html
@@ -15,10 +15,7 @@
</print-preview-destination-list>
</div>
<div slot="button-container">
- <cr-button on-click="onManageButtonClick_">
- $i18n{manage}
- <iron-icon icon="cr:open-in-new" id="manageIcon"></iron-icon>
- </cr-button>
+ <div></div>
<cr-button class="cancel-button" on-click="onCancelButtonClick_">
$i18n{cancel}
</cr-button>
diff --git chrome/browser/ui/webui/constrained_web_dialog_ui.cc chrome/browser/ui/webui/constrained_web_dialog_ui.cc
index 44ef8eb632c99..5b10ce9a9caad 100644
--- chrome/browser/ui/webui/constrained_web_dialog_ui.cc
+++ chrome/browser/ui/webui/constrained_web_dialog_ui.cc
@@ -13,6 +13,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/values.h"
+#include "cef/libcef/features/runtime.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
@@ -56,7 +57,13 @@ class ConstrainedWebDialogDelegateUserData
ConstrainedWebDialogUI::ConstrainedWebDialogUI(content::WebUI* web_ui)
: WebUIController(web_ui) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
extensions::TabHelper::CreateForWebContents(web_ui->GetWebContents());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif
}
diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc
index 5f1daafe9c815..20511d2af7af4 100644
--- chrome/browser/ui/webui/print_preview/print_preview_ui.cc
+++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -25,6 +25,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "chrome/browser/pdf/pdf_extension_util.h"
@@ -109,6 +110,15 @@ const char16_t kBasicPrintShortcut[] = u"(⌥⌘P)";
const char16_t kBasicPrintShortcut[] = u"(Ctrl+Shift+P)";
#endif
+const char16_t* GetBasicPrintShortcut() {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ return u"";
+ }
+#endif
+ return kBasicPrintShortcut;
+}
+
constexpr char kInvalidArgsForDidStartPreview[] =
"Invalid arguments for DidStartPreview";
constexpr char kInvalidPageIndexForDidPreviewPage[] =
@@ -310,7 +320,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
source->AddLocalizedStrings(kLocalizedStrings);
#if !BUILDFLAG(IS_CHROMEOS)
- const std::u16string shortcut_text(kBasicPrintShortcut);
+ const std::u16string shortcut_text(GetBasicPrintShortcut());
source->AddString("systemDialogOption",
l10n_util::GetStringFUTF16(
IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, shortcut_text));

View File

@ -1,182 +1,3 @@
diff --git chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
index 504a8473a7511..6c6aa2d9c4541 100644
--- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
+++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
@@ -23,6 +23,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/analysis/analysis_settings.h"
#include "chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h"
@@ -367,6 +368,11 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile,
GURL url,
Data* data,
AnalysisConnector connector) {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled())
+ return false;
+#endif
+
auto* service = ConnectorsServiceFactory::GetForBrowserContext(profile);
// If the corresponding Connector policy isn't set, don't perform scans.
if (!service || !service->IsConnectorEnabled(connector))
diff --git chrome/browser/first_party_sets/first_party_sets_policy_service.cc chrome/browser/first_party_sets/first_party_sets_policy_service.cc
index a3c34a9922d2e..38c982442bc80 100644
--- chrome/browser/first_party_sets/first_party_sets_policy_service.cc
+++ chrome/browser/first_party_sets/first_party_sets_policy_service.cc
@@ -282,6 +282,12 @@ void FirstPartySetsPolicyService::OnProfileConfigReady(
// Representation of the current profile to be persisted on disk.
const std::string browser_context_id = profile->GetBaseName().AsUTF8Unsafe();
+ if (browser_context_id.empty()) {
+ // CEF/Alloy incognito profiles have empty cache path.
+ OnReadyToNotifyDelegates(std::move(config),
+ net::FirstPartySetsCacheFilter());
+ return;
+ }
base::RepeatingCallback<content::BrowserContext*()> browser_context_getter =
base::BindRepeating(
diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc
index 6a0d1c78df0df..b38785be13813 100644
--- chrome/browser/net/profile_network_context_service.cc
+++ chrome/browser/net/profile_network_context_service.cc
@@ -25,6 +25,7 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
@@ -241,9 +242,16 @@ void UpdateCookieSettings(Profile* profile, ContentSettingsType type) {
// occurs in this class is unsynchronized, so it would be racy to rely on
// this update finishing before calling the context's callback.) This
// unfortunately triggers a double-update here.
- if (FederatedIdentityPermissionContext* fedcm_context =
- FederatedIdentityPermissionContextFactory::GetForProfile(profile);
- fedcm_context) {
+ FederatedIdentityPermissionContext* fedcm_context = nullptr;
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+ #endif
+ fedcm_context =
+ FederatedIdentityPermissionContextFactory::GetForProfile(profile);
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
+ if (fedcm_context) {
settings = fedcm_context->GetSharingPermissionGrantsAsContentSettings();
}
} else {
@@ -819,9 +827,16 @@ ProfileNetworkContextService::CreateCookieManagerParams(
continue;
}
if (type == ContentSettingsType::FEDERATED_IDENTITY_SHARING) {
- if (FederatedIdentityPermissionContext* fedcm_context =
- FederatedIdentityPermissionContextFactory::GetForProfile(profile);
- fedcm_context) {
+ FederatedIdentityPermissionContext* fedcm_context = nullptr;
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
+ fedcm_context =
+ FederatedIdentityPermissionContextFactory::GetForProfile(profile);
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
+ if (fedcm_context) {
out->content_settings[type] =
fedcm_context->GetSharingPermissionGrantsAsContentSettings();
} else {
@@ -1054,9 +1069,32 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
network_context_params->cookie_manager_params =
CreateCookieManagerParams(profile_, *cookie_settings_);
+ if (!in_memory) {
+ network_context_params->file_paths =
+ ::network::mojom::NetworkContextFilePaths::New();
+ }
+
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
// Configure on-disk storage for non-OTR profiles. OTR profiles just use
// default behavior (in memory storage, default sizes).
- if (!in_memory) {
+ if (!in_memory && cef::IsAlloyRuntimeEnabled()) {
+ PrefService* prefs = profile_->GetPrefs();
+ // Configure the HTTP cache path and size.
+ const base::FilePath& base_cache_path =
+ prefs->GetFilePath(prefs::kDiskCacheDir);
+ DCHECK(!base_cache_path.empty());
+ network_context_params->file_paths->http_cache_directory =
+ base_cache_path.Append(chrome::kCacheDirname);
+ network_context_params->http_cache_max_size =
+ prefs->GetInteger(prefs::kDiskCacheSize);
+ }
+#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+
+ if (!in_memory
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ && !cef::IsAlloyRuntimeEnabled()
+#endif
+ ) {
PrefService* local_state = g_browser_process->local_state();
// Configure the HTTP cache path and size.
base::FilePath base_cache_path;
@@ -1065,15 +1103,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
local_state->GetFilePath(prefs::kDiskCacheDir);
if (!disk_cache_dir.empty())
base_cache_path = disk_cache_dir.Append(base_cache_path.BaseName());
+ network_context_params->file_paths->http_cache_directory =
+ base_cache_path.Append(chrome::kCacheDirname);
const int disk_cache_size = local_state->GetInteger(prefs::kDiskCacheSize);
network_context_params->http_cache_max_size = disk_cache_size;
network_context_params->shared_dictionary_cache_max_size = disk_cache_size;
+ }
- network_context_params->file_paths =
- ::network::mojom::NetworkContextFilePaths::New();
-
- network_context_params->file_paths->http_cache_directory =
- base_cache_path.Append(chrome::kCacheDirname);
+ if (!in_memory) {
network_context_params->file_paths->data_directory =
path.Append(chrome::kNetworkDataDirname);
network_context_params->file_paths->unsandboxed_data_path = path;
@@ -1264,6 +1301,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
network_context_params->first_party_sets_access_delegate_params =
network::mojom::FirstPartySetsAccessDelegateParams::New();
network_context_params->first_party_sets_access_delegate_params->enabled =
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ cef::IsAlloyRuntimeEnabled() ? false :
+#endif
PrivacySandboxSettingsFactory::GetForProfile(profile_)
->AreRelatedWebsiteSetsEnabled();
diff --git chrome/browser/signin/identity_manager_factory.cc chrome/browser/signin/identity_manager_factory.cc
index 58750a47240e5..2894f323c26bb 100644
--- chrome/browser/signin/identity_manager_factory.cc
+++ chrome/browser/signin/identity_manager_factory.cc
@@ -11,6 +11,7 @@
#include "base/observer_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/image_fetcher/image_decoder_impl.h"
#include "chrome/browser/profiles/profile.h"
@@ -97,6 +98,9 @@ IdentityManagerFactory::~IdentityManagerFactory() {
// static
signin::IdentityManager* IdentityManagerFactory::GetForProfile(
Profile* profile) {
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ DCHECK(!cef::IsAlloyRuntimeEnabled());
+#endif
return static_cast<signin::IdentityManager*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc
index 8e1134654e2b1..d0f578b5f9976 100644
--- net/cookies/cookie_monster.cc

View File

@ -1,22 +1,8 @@
diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc
index 8b04f2afe863e..effc59857dfd4 100644
index 8b04f2afe863e..ad04e519ca2df 100644
--- content/browser/storage_partition_impl.cc
+++ content/browser/storage_partition_impl.cc
@@ -3353,8 +3353,12 @@ void StoragePartitionImpl::GetQuotaSettings(
return;
}
+ // CEF always returns false for IsOffTheRecord(), so also check the path.
+ const bool is_incognito = browser_context_->IsOffTheRecord() ||
+ browser_context_->GetPath().empty();
+
storage::GetNominalDynamicSettings(
- GetPath(), browser_context_->IsOffTheRecord(),
+ GetPath(), is_incognito,
storage::GetDefaultDeviceInfoHelper(), std::move(callback));
}
@@ -3364,9 +3368,12 @@ void StoragePartitionImpl::InitNetworkContext() {
@@ -3364,9 +3364,12 @@ void StoragePartitionImpl::InitNetworkContext() {
cert_verifier::mojom::CertVerifierCreationParamsPtr
cert_verifier_creation_params =
cert_verifier::mojom::CertVerifierCreationParams::New();

View File

@ -1,72 +0,0 @@
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
index 01d2a426e2c17..c239a2f6fc786 100644
--- content/browser/blob_storage/chrome_blob_storage_context.cc
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -125,7 +125,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
// If we're not incognito mode, schedule all of our file tasks to enable
// disk on the storage context.
- if (!context->IsOffTheRecord() && io_thread_valid) {
+ if (!context->GetPath().empty() && !context->IsOffTheRecord() &&
+ io_thread_valid) {
file_task_runner = base::ThreadPool::CreateTaskRunner(
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index 9d073f96177d3..7aaf858bf315c 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -129,7 +129,7 @@ StoragePartition* BrowserContext::GetStoragePartition(
StoragePartition* BrowserContext::GetStoragePartition(
const StoragePartitionConfig& storage_partition_config,
bool can_create) {
- if (IsOffTheRecord()) {
+ if (IsOffTheRecord() || GetPath().empty()) {
// An off the record profile MUST only use in memory storage partitions.
CHECK(storage_partition_config.in_memory());
}
@@ -355,7 +355,8 @@ BrowserContext::CreateVideoDecodePerfHistory() {
const bool kUseInMemoryDBDefault = false;
bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool(
media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName,
- kUseInMemoryDBDefault);
+ kUseInMemoryDBDefault) ||
+ GetPath().empty();
std::unique_ptr<media::VideoDecodeStatsDB> stats_db;
if (use_in_memory_db) {
diff --git content/public/browser/storage_partition_config.cc content/public/browser/storage_partition_config.cc
index e82cdd66a2d5c..1816b2fe54ff5 100644
--- content/public/browser/storage_partition_config.cc
+++ content/public/browser/storage_partition_config.cc
@@ -7,6 +7,7 @@
#include <sstream>
#include "base/check.h"
+#include "base/files/file_path.h"
#include "base/strings/string_number_conversions.h"
#include "content/public/browser/browser_context.h"
#include "url/gurl.h"
@@ -22,7 +23,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=(
// static
StoragePartitionConfig StoragePartitionConfig::CreateDefault(
BrowserContext* browser_context) {
- return StoragePartitionConfig("", "", browser_context->IsOffTheRecord());
+ return StoragePartitionConfig("", "", browser_context->IsOffTheRecord() ||
+ browser_context->GetPath().empty());
}
// static
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
index 3d98c6095ef27..a84c84d580d84 100644
--- storage/browser/database/database_tracker.cc
+++ storage/browser/database/database_tracker.cc
@@ -559,7 +559,7 @@ bool DatabaseTracker::LazyInit() {
databases_table_ = std::make_unique<DatabasesTable>(db_.get());
meta_table_ = std::make_unique<sql::MetaTable>();
- is_initialized_ = base::CreateDirectory(db_dir_) &&
+ is_initialized_ = (is_incognito_ ? true : base::CreateDirectory(db_dir_)) &&
(db_->is_open() ||
(is_incognito_ ? db_->OpenInMemory()
: db_->Open(kTrackerDatabaseFullPath))) &&

View File

@ -1,21 +0,0 @@
diff --git third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl
index 56abb01572e0e..0fd747f75f7cf 100644
--- third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl
+++ third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl
@@ -13,6 +13,8 @@
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
+class AlloyContentRendererClient;
+
#define ASSERT_ORIGIN_TRIAL(feature) \
static_assert(std::is_same<decltype(::blink::RuntimeEnabledFeatures:: \
feature##EnabledByRuntimeFlag()), \
@@ -125,6 +127,7 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures : public RuntimeEnabledFeaturesBase
// protected section of RuntimeEnabledFeaturesBase. Normally, unit tests
// should use the ScopedFeatureNameForTest classes defined in
// platform/testing/runtime_enabled_features_test_helpers.h.
+ friend class ::AlloyContentRendererClient;
friend class DevToolsEmulator;
friend class InternalRuntimeFlags;
friend class V8ContextSnapshotImpl;

View File

@ -1,95 +0,0 @@
diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
index 49a9705d3310a..f87fae993baf9 100644
--- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
+++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
@@ -20,10 +20,12 @@
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "base/task/thread_pool.h"
+#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/google/google_brand.h"
@@ -420,7 +422,15 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
response->emplace(kOsVersionTag, os_version);
#endif
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
+ // Avoid loading ProfileSyncServiceFactory which depends on a lot of
+ // unnecessary Chrome-specific factories.
PopulateSyncLogs(response.get());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
PopulateExtensionInfoLogs(response.get());
PopulatePowerApiLogs(response.get());
#if BUILDFLAG(IS_WIN)
@@ -508,8 +518,14 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs(
if (!profile)
return;
+ // May be nullptr if using CEF Alloy with extensions disabled.
extensions::ExtensionRegistry* extension_registry =
extensions::ExtensionRegistry::Get(profile);
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!extension_registry)
+ return;
+#endif
+
std::string extensions_list;
for (const scoped_refptr<const extensions::Extension>& extension :
extension_registry->enabled_extensions()) {
@@ -610,6 +626,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime(
#if BUILDFLAG(IS_WIN)
void ChromeInternalLogSource::PopulateUsbKeyboardDetected(
SystemLogsResponse* response) {
+ // The below call may result in some DLLs being loaded.
+ base::ScopedAllowBlockingForTesting allow_blocking;
std::string reason;
bool result =
base::win::IsKeyboardPresentOnSlate(ui::GetHiddenWindow(), &reason);
diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc
index 3ba0a09109a8b..db64d5cffc02e 100644
--- chrome/browser/memory_details.cc
+++ chrome/browser/memory_details.cc
@@ -17,6 +17,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/profiles/profile.h"
#include "components/nacl/common/nacl_process_type.h"
#include "components/strings/grit/components_strings.h"
@@ -298,9 +299,15 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
render_process_host->GetBrowserContext())) {
content::BrowserContext* context =
render_process_host->GetBrowserContext();
+
+ // May be nullptr if using CEF Alloy with extensions disabled.
extensions::ExtensionRegistry* extension_registry =
extensions::ExtensionRegistry::Get(context);
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (extension_registry) {
+#else
DCHECK(extension_registry);
+#endif
extension_set = &extension_registry->enabled_extensions();
extensions::ProcessMap* process_map =
extensions::ProcessMap::Get(context);
@@ -316,6 +323,9 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
process.renderer_type = ProcessMemoryInformation::RENDERER_EXTENSION;
}
}
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
}
#endif