Add GN arg to disable Alloy bootstrap (see #3681, see #3685)

Set enable_alloy_bootstrap=false to build with Alloy bootstrap code
removed. Extension API is documented as deprecated in comments but
not compiled out with this arg.
This commit is contained in:
Marshall Greenblatt
2024-04-29 21:09:17 -04:00
parent d666ec5770
commit b5d84c254d
96 changed files with 1243 additions and 516 deletions

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index 9356bf044a318..2499576dea7f0 100644
index 9356bf044a318..883c322eef5bb 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 @@
@@ -14,7 +14,7 @@ index 9356bf044a318..2499576dea7f0 100644
#include "extensions/buildflags/buildflags.h"
#include "ui/webui/webui_allowlist_provider.h"
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
@@ -25,11 +25,11 @@ index 9356bf044a318..2499576dea7f0 100644
#endif
DependsOn(OneTimePermissionsTrackerFactory::GetInstance());
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled()) {
+#endif
DependsOn(extensions::ContentSettingsService::GetFactoryInstance());
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif
@@ -39,7 +39,7 @@ index 9356bf044a318..2499576dea7f0 100644
std::move(allowlist_provider));
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled()) {
+#endif
// These must be registered before before the HostSettings are passed over to
@@ -49,7 +49,7 @@ index 9356bf044a318..2499576dea7f0 100644
// the case where profile->IsOffTheRecord() is true? And what is the
// interaction with profile->IsGuestSession()?
false));
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
#endif // BUILDFLAG(ENABLE_EXTENSIONS)

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index 447a91b9ac380..51593091b5fa6 100644
index 447a91b9ac380..cf5ad1b907977 100644
--- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc
@@ -20,6 +20,7 @@
@@ -10,11 +10,15 @@ index 447a91b9ac380..51593091b5fa6 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h"
@@ -245,6 +246,13 @@ void FileSelectHelper::OnListFile(
@@ -245,6 +246,17 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) {
+ if (cef::IsAlloyRuntimeEnabled() || run_from_cef_) {
+ 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).
+ ConvertToFileChooserFileInfoList(selected_files);
@@ -24,20 +28,22 @@ index 447a91b9ac380..51593091b5fa6 100644
ShowFolderUploadConfirmationDialog(
path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -329,6 +337,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
@@ -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(
@@ -459,7 +473,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() {
@@ -459,7 +479,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() {
std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
FileSelectHelper::GetFileTypesFromAcceptType(
@@ -47,7 +53,7 @@ index 447a91b9ac380..51593091b5fa6 100644
auto base_file_type = std::make_unique<ui::SelectFileDialog::FileTypeInfo>();
if (accept_types.empty())
return base_file_type;
@@ -472,17 +487,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -472,17 +493,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back();
@@ -73,7 +79,7 @@ index 447a91b9ac380..51593091b5fa6 100644
} else {
if (!base::IsStringASCII(accept_type))
continue;
@@ -493,10 +515,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -493,10 +521,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
description_id = IDS_AUDIO_FILES;
else if (ascii_type == "video/*")
description_id = IDS_VIDEO_FILES;
@@ -94,7 +100,7 @@ index 447a91b9ac380..51593091b5fa6 100644
if (extensions->size() > old_extension_size)
valid_type_count++;
}
@@ -521,6 +551,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -521,6 +557,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
l10n_util::GetStringUTF16(description_id));
}
@@ -110,7 +116,7 @@ index 447a91b9ac380..51593091b5fa6 100644
return file_type;
}
@@ -528,7 +567,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -528,7 +573,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@@ -120,7 +126,7 @@ index 447a91b9ac380..51593091b5fa6 100644
Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext());
@@ -547,6 +587,7 @@ void FileSelectHelper::RunFileChooser(
@@ -547,6 +593,7 @@ void FileSelectHelper::RunFileChooser(
// message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile));
@@ -128,7 +134,7 @@ index 447a91b9ac380..51593091b5fa6 100644
file_select_helper->RunFileChooser(render_frame_host, std::move(listener),
params.Clone());
}
@@ -598,7 +639,8 @@ void FileSelectHelper::RunFileChooser(
@@ -598,7 +645,8 @@ void FileSelectHelper::RunFileChooser(
}
void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) {

View File

@@ -85,7 +85,7 @@ index e2cf12d2c8fee..376818e28798c 100644
};
diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc
index 773f72da82f90..6d0307988406f 100644
index 773f72da82f90..0043dd530934d 100644
--- chrome/browser/download/download_prefs.cc
+++ chrome/browser/download/download_prefs.cc
@@ -23,6 +23,7 @@
@@ -100,7 +100,7 @@ index 773f72da82f90..6d0307988406f 100644
#include "chrome/browser/flags/android/chrome_feature_list.h"
#endif
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/browser/alloy/alloy_download_util.h"
+#endif
+
@@ -111,7 +111,7 @@ index 773f72da82f90..6d0307988406f 100644
// static
DownloadPrefs* DownloadPrefs::FromBrowserContext(
content::BrowserContext* context) {
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ return alloy::GetDownloadPrefsFromBrowserContext(context);
+ }

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/net/proxy_config_monitor.cc chrome/browser/net/proxy_config_monitor.cc
index c9281f7abfbde..a1b7c77475b54 100644
index c9281f7abfbde..670872e610d88 100644
--- chrome/browser/net/proxy_config_monitor.cc
+++ chrome/browser/net/proxy_config_monitor.cc
@@ -9,6 +9,7 @@
@@ -14,7 +14,7 @@ index c9281f7abfbde..a1b7c77475b54 100644
#include "chrome/browser/ash/profiles/profile_helper.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
@@ -25,7 +25,7 @@ index c9281f7abfbde..a1b7c77475b54 100644
}
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled())
+#endif
error_receiver_set_.Add(this, network_context_params->proxy_error_client

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/background_fetch/background_fetch_permission_context.cc chrome/browser/background_fetch/background_fetch_permission_context.cc
index 429739d7b8dfe..0f4bff365f62b 100644
index 429739d7b8dfe..726cc7d9e9ced 100644
--- chrome/browser/background_fetch/background_fetch_permission_context.cc
+++ chrome/browser/background_fetch/background_fetch_permission_context.cc
@@ -4,6 +4,7 @@
@@ -10,18 +10,21 @@ index 429739d7b8dfe..0f4bff365f62b 100644
#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,8 @@ ContentSetting BackgroundFetchPermissionContext::GetPermissionStatusInternal(
@@ -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 (!cef::IsAlloyRuntimeEnabled() &&
+ 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 d63a055919747..8d13959217751 100644
index d63a055919747..49adba291f1bb 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 @@
@@ -32,19 +35,21 @@ index d63a055919747..8d13959217751 100644
#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,10 @@ PeriodicBackgroundSyncPermissionContext::GetPermissionStatusInternal(
@@ -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 7f14b48feedf6..cfcf4554c1d4d 100644
index 7f14b48feedf6..9679552640788 100644
--- chrome/browser/permissions/chrome_permissions_client.cc
+++ chrome/browser/permissions/chrome_permissions_client.cc
@@ -14,6 +14,7 @@
@@ -55,29 +60,35 @@ index 7f14b48feedf6..cfcf4554c1d4d 100644
#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"
@@ -190,6 +191,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker(
@@ -190,6 +191,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);
@@ -360,8 +364,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors(
@@ -360,8 +366,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 1ad4009827a9d..ca054482954f9 100644
index 1ad4009827a9d..6aba08191cf35 100644
--- chrome/browser/permissions/permission_manager_factory.cc
+++ chrome/browser/permissions/permission_manager_factory.cc
@@ -6,6 +6,7 @@
@@ -88,20 +99,24 @@ index 1ad4009827a9d..ca054482954f9 100644
#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"
@@ -64,9 +65,11 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
@@ -64,9 +65,15 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
std::make_unique<GeolocationPermissionContextDelegate>(profile);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
+#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..765b822241e4d 100644
index 9934727f31a59..9ab13938d39c2 100644
--- chrome/browser/storage/durable_storage_permission_context.cc
+++ chrome/browser/storage/durable_storage_permission_context.cc
@@ -8,6 +8,7 @@
@@ -112,14 +127,17 @@ index 9934727f31a59..765b822241e4d 100644
#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,10 @@ void DurableStoragePermissionContext::DecidePermission(
@@ -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 (cef::IsAlloyRuntimeEnabled() ||
+ 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),
@@ -176,7 +194,7 @@ index 613500ba8c3d3..36c9aa0d2ea71 100644
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 9c0ec651d494f..e5c6126adeea7 100644
index 9c0ec651d494f..8ba6512557edc 100644
--- components/embedder_support/permission_context_utils.cc
+++ components/embedder_support/permission_context_utils.cc
@@ -5,6 +5,7 @@
@@ -187,21 +205,25 @@ index 9c0ec651d494f..e5c6126adeea7 100644
#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,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context,
@@ -79,10 +80,21 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context,
std::move(delegates.geolocation_permission_context_delegate),
is_regular_profile);
#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
+#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

@@ -134,7 +134,7 @@ index 3d5fd0d5ca858..965ab69b3fe8f 100644
// 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 0d1d2e3661ff1..a97322b1d991d 100644
index 0d1d2e3661ff1..ba4b8cb233102 100644
--- chrome/browser/profiles/renderer_updater.cc
+++ chrome/browser/profiles/renderer_updater.cc
@@ -9,6 +9,7 @@
@@ -145,16 +145,18 @@ index 0d1d2e3661ff1..a97322b1d991d 100644
#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"
@@ -45,6 +46,7 @@ RendererUpdater::RendererUpdater(Profile* profile)
@@ -45,6 +46,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 ed5b366aa47ab..58ebe795e4636 100644
index ed5b366aa47ab..794cf8b3bbec1 100644
--- chrome/browser/profiles/renderer_updater_factory.cc
+++ chrome/browser/profiles/renderer_updater_factory.cc
@@ -4,6 +4,7 @@
@@ -165,13 +167,17 @@ index ed5b366aa47ab..58ebe795e4636 100644
#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,9 @@ RendererUpdaterFactory::RendererUpdaterFactory()
@@ -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,5 +1,5 @@
diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc
index 0b39e73c2a394..23b0bdcb7b7db 100644
index 0b39e73c2a394..1c42fe06479ab 100644
--- chrome/browser/themes/theme_service.cc
+++ chrome/browser/themes/theme_service.cc
@@ -30,6 +30,7 @@
@@ -25,7 +25,7 @@ index 0b39e73c2a394..23b0bdcb7b7db 100644
// OnExtensionServiceReady. Otherwise, the ThemeObserver won't be
// constructed in time to observe the corresponding events.
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
+ !extensions::ExtensionsEnabled();
+#else
@@ -42,7 +42,7 @@ index 0b39e73c2a394..23b0bdcb7b7db 100644
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 879bbeef4037b..e6cc36f388197 100644
index 879bbeef4037b..c52b9144cf966 100644
--- chrome/browser/themes/theme_service_factory.cc
+++ chrome/browser/themes/theme_service_factory.cc
@@ -9,6 +9,7 @@
@@ -68,7 +68,7 @@ index 879bbeef4037b..e6cc36f388197 100644
.Build()) {
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
+ !extensions::ExtensionsEnabled();
+#else

View File

@@ -1,43 +1,65 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index 2bb525046619c..611fa1fb57369 100644
index 2bb525046619c..200fc9c1f0067 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -140,6 +140,10 @@ bool IsPluginLoadingAccessibleResourceInWebView(
@@ -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 438276b719c2f..69635e429be78 100644
index 438276b719c2f..e97fa0eaf2d7a 100644
--- chrome/browser/plugins/plugin_utils.cc
+++ chrome/browser/plugins/plugin_utils.cc
@@ -68,6 +68,13 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
@@ -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_types.h"
@@ -68,6 +69,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)) {
@@ -78,9 +85,6 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
@@ -78,9 +88,11 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
MimeTypesHandler::GetMIMETypeAllowlist();
// Go through the allowed extensions and try to use them to intercept
// the URL request.
- extensions::ExtensionRegistry* registry =
- extensions::ExtensionRegistry::Get(browser_context);
- DCHECK(registry);
+#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);

View File

@@ -1,5 +1,5 @@
diff --git chrome/utility/chrome_content_utility_client.cc chrome/utility/chrome_content_utility_client.cc
index c15d1fa6d6e25..b89a663d2664f 100644
index c15d1fa6d6e25..f7356f7c1ef64 100644
--- chrome/utility/chrome_content_utility_client.cc
+++ chrome/utility/chrome_content_utility_client.cc
@@ -13,6 +13,7 @@
@@ -10,13 +10,16 @@ index c15d1fa6d6e25..b89a663d2664f 100644
#include "chrome/common/chrome_paths.h"
#include "chrome/common/profiler/thread_profiler.h"
#include "chrome/common/profiler/thread_profiler_configuration.h"
@@ -54,7 +55,8 @@ void ChromeContentUtilityClient::UtilityThreadStarted() {
@@ -54,7 +55,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 &&
+ !cef::IsAlloyRuntimeEnabled()) {
+ if (process_type == switches::kUtilityProcess
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ && !cef::IsAlloyRuntimeEnabled()
+#endif
+ ) {
// The HeapProfilerController should have been created in
// ChromeMainDelegate::PostEarlyInitialization.
using HeapProfilerController = heap_profiling::HeapProfilerController;

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc
index 96a290eef86ca..6513a365cddf0 100644
index 96a290eef86ca..bee0f9eaad71e 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 @@
@@ -14,30 +14,34 @@ index 96a290eef86ca..6513a365cddf0 100644
#include "pdf/pdf_features.h"
#endif // BUILDFLAG(ENABLE_PDF)
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+#include "cef/libcef/browser/extensions/alloy_extensions_util.h"
+#endif
+
namespace extensions {
void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
@@ -44,6 +49,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
@@ -44,6 +49,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.
@@ -54,6 +60,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
@@ -54,6 +62,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();
@@ -80,9 +87,18 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
@@ -80,9 +91,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.
@@ -48,11 +52,11 @@ index 96a290eef86ca..6513a365cddf0 100644
+ if (web_contents->GetOuterWebContents()) {
+ tab_id = SessionID::InvalidValue().id();
+ } else
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ tab_id = alloy::GetTabIdForWebContents(web_contents);
+ } else
+#endif // BUILDFLAG(ENABLE_CEF)
+#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ {
+ tab_id = ExtensionTabUtil::GetTabId(web_contents);
+ }
@@ -168,7 +172,7 @@ index 28ba09319b047..2a097a5ae4c16 100644
// 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..1e7ae767b0582 100644
index c3197eb4790fa..f558ff72bdbac 100644
--- extensions/browser/extension_registry.cc
+++ extensions/browser/extension_registry.cc
@@ -6,9 +6,14 @@
@@ -190,7 +194,7 @@ index c3197eb4790fa..1e7ae767b0582 100644
// static
ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) {
+#if BUILDFLAG(ENABLE_CEF)
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (cef::IsAlloyRuntimeEnabled() && !extensions::ExtensionsEnabled()) {
+ return nullptr;
+ }
@@ -257,15 +261,25 @@ index b86a71429eb33..9f7d190975605 100644
base::BindOnce(&ProcessManager::HandleCloseExtensionHost,
weak_ptr_factory_.GetWeakPtr()));
diff --git extensions/common/extensions_client.cc extensions/common/extensions_client.cc
index 5142f341b8392..d3242aae96ece 100644
index 5142f341b8392..0589a1f1466f5 100644
--- extensions/common/extensions_client.cc
+++ extensions/common/extensions_client.cc
@@ -25,7 +25,7 @@ ExtensionsClient* g_client = nullptr;
@@ -8,6 +8,7 @@
#include "base/check.h"
#include "base/notreached.h"
+#include "cef/libcef/features/features.h"
#include "extensions/common/extension_icon_set.h"
#include "extensions/common/extensions_api_provider.h"
#include "extensions/common/features/feature_provider.h"
@@ -25,7 +26,10 @@ ExtensionsClient* g_client = nullptr;
} // namespace
ExtensionsClient* ExtensionsClient::Get() {
- DCHECK(g_client);
+#if !BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ // May be nullptr if using CEF Alloy with extensions disabled.
DCHECK(g_client);
+#endif
return g_client;
}

View File

@@ -24,7 +24,7 @@ index ecabd51db586d..a7ae5e101ca02 100644
Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture;
diff --git media/video/renderable_gpu_memory_buffer_video_frame_pool.cc media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
index a7ac0f10f11e5..bb1d7dc6e9168 100644
index a7ac0f10f11e5..bbbfefd486660 100644
--- media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
+++ media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
@@ -198,7 +198,7 @@ gfx::Size GetBufferSizeInPixelsForVideoPixelFormat(

View File

@@ -27,7 +27,7 @@ index 5d1658999d5bb..d1b7b7288c946 100644
$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 c85248ab0d0a0..05b3454c0356d 100644
index c85248ab0d0a0..1595d2aa62bce 100644
--- chrome/browser/ui/webui/constrained_web_dialog_ui.cc
+++ chrome/browser/ui/webui/constrained_web_dialog_ui.cc
@@ -13,6 +13,7 @@
@@ -38,18 +38,22 @@ index c85248ab0d0a0..05b3454c0356d 100644
#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,9 @@ class ConstrainedWebDialogDelegateUserData
@@ -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 449f6f2db551e..677eecde93352 100644
index 449f6f2db551e..96cc73b2ca43b 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 @@
@@ -60,21 +64,23 @@ index 449f6f2db551e..677eecde93352 100644
#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,13 @@ const char16_t kBasicPrintShortcut[] = u"(\u2325\u2318P)";
@@ -109,6 +110,15 @@ const char16_t kBasicPrintShortcut[] = u"(\u2325\u2318P)";
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 +318,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
@@ -310,7 +320,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
source->AddLocalizedStrings(kLocalizedStrings);
#if !BUILDFLAG(IS_CHROMEOS)

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
index 3a8e63a3bcbdd..69954e151f04e 100644
index 3a8e63a3bcbdd..3fded53efc474 100644
--- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
+++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
@@ -23,6 +23,7 @@
@@ -10,12 +10,14 @@ index 3a8e63a3bcbdd..69954e151f04e 100644
#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"
@@ -357,6 +358,9 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile,
@@ -357,6 +358,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.
@@ -38,7 +40,7 @@ index e6d8a41c10f3a..18df8a6311d0a 100644
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 77d18bd28eeaf..9eab054ea3416 100644
index 77d18bd28eeaf..395c62cc348df 100644
--- chrome/browser/net/profile_network_context_service.cc
+++ chrome/browser/net/profile_network_context_service.cc
@@ -25,6 +25,7 @@
@@ -49,7 +51,7 @@ index 77d18bd28eeaf..9eab054ea3416 100644
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
@@ -266,9 +267,12 @@ void UpdateCookieSettings(Profile* profile, ContentSettingsType type) {
@@ -266,9 +267,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.
@@ -57,28 +59,36 @@ index 77d18bd28eeaf..9eab054ea3416 100644
- 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 {
@@ -323,8 +327,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
@@ -323,8 +331,14 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
base::Unretained(this)));
cookie_settings_ = CookieSettingsFactory::GetForProfile(profile);
cookie_settings_observation_.Observe(cookie_settings_.get());
- privacy_sandbox_settings_observer_.Observe(
- PrivacySandboxSettingsFactory::GetForProfile(profile));
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+#endif
+ privacy_sandbox_settings_observer_.Observe(
+ PrivacySandboxSettingsFactory::GetForProfile(profile));
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
DisableQuicIfNotAllowed();
@@ -826,9 +832,12 @@ ProfileNetworkContextService::CreateCookieManagerParams(
@@ -826,9 +840,16 @@ ProfileNetworkContextService::CreateCookieManagerParams(
continue;
}
if (type == ContentSettingsType::FEDERATED_IDENTITY_SHARING) {
@@ -86,15 +96,19 @@ index 77d18bd28eeaf..9eab054ea3416 100644
- 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 {
@@ -1082,9 +1091,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
@@ -1082,9 +1103,32 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
network_context_params->cookie_manager_params =
CreateCookieManagerParams(profile_, *cookie_settings_);
@@ -103,6 +117,7 @@ index 77d18bd28eeaf..9eab054ea3416 100644
+ ::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) {
@@ -117,12 +132,17 @@ index 77d18bd28eeaf..9eab054ea3416 100644
+ network_context_params->http_cache_max_size =
+ prefs->GetInteger(prefs::kDiskCacheSize);
+ }
+#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+
+ if (!in_memory && !cef::IsAlloyRuntimeEnabled()) {
+ 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;
@@ -1093,15 +1119,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
@@ -1093,15 +1137,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());
@@ -142,16 +162,18 @@ index 77d18bd28eeaf..9eab054ea3416 100644
network_context_params->file_paths->data_directory =
path.Append(chrome::kNetworkDataDirname);
network_context_params->file_paths->unsandboxed_data_path = path;
@@ -1276,6 +1301,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
@@ -1276,6 +1319,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/net/profile_network_context_service_factory.cc chrome/browser/net/profile_network_context_service_factory.cc
index 14ac2ce8b90c5..66431eface762 100644
index 14ac2ce8b90c5..c22f8a7a57c69 100644
--- chrome/browser/net/profile_network_context_service_factory.cc
+++ chrome/browser/net/profile_network_context_service_factory.cc
@@ -6,6 +6,7 @@
@@ -162,18 +184,23 @@ index 14ac2ce8b90c5..66431eface762 100644
#include "chrome/browser/first_party_sets/first_party_sets_policy_service_factory.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h"
@@ -53,7 +54,9 @@ ProfileNetworkContextServiceFactory::ProfileNetworkContextServiceFactory()
@@ -52,8 +53,14 @@ ProfileNetworkContextServiceFactory::ProfileNetworkContextServiceFactory()
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
DependsOn(chromeos::CertificateProviderServiceFactory::GetInstance());
#endif
+#endif
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
#endif
DependsOn(PrivacySandboxSettingsFactory::GetInstance());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
DependsOn(
first_party_sets::FirstPartySetsPolicyServiceFactory::GetInstance());
}
diff --git chrome/browser/signin/identity_manager_factory.cc chrome/browser/signin/identity_manager_factory.cc
index a635c32482ce0..77a3503cea229 100644
index a635c32482ce0..e478ee670c239 100644
--- chrome/browser/signin/identity_manager_factory.cc
+++ chrome/browser/signin/identity_manager_factory.cc
@@ -11,6 +11,7 @@
@@ -184,11 +211,13 @@ index a635c32482ce0..77a3503cea229 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/image_fetcher/image_decoder_impl.h"
#include "chrome/browser/profiles/profile.h"
@@ -97,6 +98,7 @@ IdentityManagerFactory::~IdentityManagerFactory() {
@@ -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));
}

View File

@@ -1,5 +1,5 @@
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 16c370e6d9759..1460a9c0d1f49 100644
index 16c370e6d9759..7fc6d74075dd4 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 @@
@@ -15,33 +15,38 @@ index 16c370e6d9759..1460a9c0d1f49 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/google/google_brand.h"
@@ -422,7 +424,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
@@ -422,7 +424,15 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
response->emplace(kOsVersionTag, os_version);
#endif
- PopulateSyncLogs(response.get());
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ if (!cef::IsAlloyRuntimeEnabled()) {
+ // Avoid loading ProfileSyncServiceFactory which depends on a lot of
+ // unnecessary Chrome-specific factories.
+ PopulateSyncLogs(response.get());
+#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)
@@ -510,8 +516,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs(
@@ -510,8 +520,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()) {
@@ -612,6 +622,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime(
@@ -612,6 +628,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime(
#if BUILDFLAG(IS_WIN)
void ChromeInternalLogSource::PopulateUsbKeyboardDetected(
SystemLogsResponse* response) {
@@ -51,10 +56,18 @@ index 16c370e6d9759..1460a9c0d1f49 100644
bool result =
base::win::IsKeyboardPresentOnSlate(ui::GetHiddenWindow(), &reason);
diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc
index 58fe3bd8f62ae..41b5e35b09a80 100644
index 58fe3bd8f62ae..f8a2f456bded6 100644
--- chrome/browser/memory_details.cc
+++ chrome/browser/memory_details.cc
@@ -298,9 +298,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
@@ -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();
@@ -62,16 +75,21 @@ index 58fe3bd8f62ae..41b5e35b09a80 100644
+ // May be nullptr if using CEF Alloy with extensions disabled.
extensions::ExtensionRegistry* extension_registry =
extensions::ExtensionRegistry::Get(context);
- DCHECK(extension_registry);
+#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);
@@ -317,6 +319,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
@@ -317,6 +324,9 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
break;
}
}
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
+ }
+#endif
}
#endif