Compare commits

..

10 Commits
7204 ... 7151

Author SHA1 Message Date
Marshall Greenblatt
7e14fe138e Fix read of crash reporting env vars 2025-06-03 16:05:06 -04:00
Marshall Greenblatt
1547f8c8ce Update to Chromium version 137.0.7151.69 2025-06-03 13:23:05 +00:00
Marshall Greenblatt
aaaa0bf625 Update to Chromium version 137.0.7151.56 2025-05-29 13:19:01 -04:00
Tom Crowley
2c2bc6e86d ceftests: Add tests for PrintToPdf 2025-05-29 13:00:58 -04:00
Pedro de Carvalho Gomes
d5187afaac linux: Fix parenting of select widget on Wayland (fixes #3937) 2025-05-29 13:00:47 -04:00
Marshall Greenblatt
24fa18a759 libcef: Fix incorrect sandbox init with --no-sandbox
Match the current logic for chrome.exe.
2025-05-29 12:59:57 -04:00
Marshall Greenblatt
8614a8dc19 bazel: Remove support for angle bracket includes
Fixes the following error:

fail: attribute includes: './' resolves to the workspace root,
which would allow this rule and all of its transitive dependents
to include any file in your workspace. Please include only what
you need.

Bazel's recommendation [1] is to use double quotes instead of
angle brackets.

[1] https://bazel.build/docs/bazel-and-cpp#include-paths
2025-05-13 18:49:03 -04:00
Marshall Greenblatt
9ff4909e86 win: Fix crash loading chrome://sandbox when sandbox is disabled 2025-05-13 17:43:54 -04:00
Marshall Greenblatt
c91f84b975 osr: linux: Fix crash with default JS modal dialogs (fixes #3921) 2025-05-07 16:11:34 -04:00
Marshall Greenblatt
9c38803a02 Update to Chromium version 137.0.7151.6 2025-05-07 13:37:14 -04:00
149 changed files with 2327 additions and 4592 deletions

340
BUILD.gn
View File

@@ -319,16 +319,6 @@ group("cef") {
":libcef_static_unittests",
]
if (is_win) {
deps += [
":bootstrap",
":bootstrapc",
":cefclient_dll",
":cefsimple_dll",
":ceftests_dll",
]
}
if (!is_linux || ozone_platform_x11) {
deps += [ ":cefclient" ]
}
@@ -383,10 +373,6 @@ if (is_win) {
# Required by content_switches.cc
"//media:media_buildflags",
# Required by crash_keys.cc
"//content/public/common:buildflags",
"//tools/v8_context_snapshot:buildflags",
# Required by crash_keys.cc (from base/stl_util.h)
"//third_party/abseil-cpp:absl",
]
@@ -562,8 +548,6 @@ source_set("libcef_static") {
"libcef/browser/context.h",
"libcef/browser/context_menu_params_impl.cc",
"libcef/browser/context_menu_params_impl.h",
"libcef/browser/crashpad_runner.cc",
"libcef/browser/crashpad_runner.h",
"libcef/browser/devtools/devtools_controller.cc",
"libcef/browser/devtools/devtools_controller.h",
"libcef/browser/devtools/devtools_protocol_manager.cc",
@@ -1008,9 +992,6 @@ source_set("libcef_static") {
"libcef/browser/native/browser_platform_delegate_native_win.h",
"libcef/browser/osr/browser_platform_delegate_osr_win.cc",
"libcef/browser/osr/browser_platform_delegate_osr_win.h",
"libcef/browser/preferred_stack_size_win.inc",
"libcef_dll/bootstrap/bootstrap_util_win.cc",
"libcef_dll/bootstrap/bootstrap_util_win.h",
]
deps += [
@@ -1175,9 +1156,6 @@ config("libcef_dll_wrapper_config") {
# Increase the initial stack size to 8MiB from the default 1MiB.
ldflags = [ "/STACK:0x800000" ]
}
# Required to support CefScopedLibraryLoader.
ldflags += [ "/DELAYLOAD:libcef.dll" ]
}
# Build using the minimum C++ version supported by the CEF binary distribution.
@@ -1213,14 +1191,6 @@ static_library("libcef_dll_wrapper") {
sources += gypi_paths2.libcef_dll_wrapper_sources_mac
}
if (is_win) {
sources += gypi_paths2.libcef_dll_wrapper_sources_win
libs = [
"crypt32.lib",
"wintrust.lib",
]
}
defines = [ "WRAPPING_CEF_SHARED" ]
configs += [ ":libcef_dll_wrapper_config" ]
@@ -1240,13 +1210,14 @@ if (is_win) {
configs += [ ":libcef_includes_config" ]
deps = [
":make_config_header",
"libcef/features:buildflags",
"//sandbox",
]
}
}
if (is_mac) {
shared_library("cef_sandbox") {
static_library("cef_sandbox") {
sources = [ "libcef_dll/sandbox/sandbox_mac.mm" ]
configs += [ ":libcef_includes_config" ]
deps = [
@@ -1257,97 +1228,6 @@ if (is_mac) {
}
}
#
# bootstrap target.
#
if (is_win) {
bootstrap_sources = includes_common +
includes_win + [
"include/wrapper/cef_certificate_util_win.h",
"include/wrapper/cef_util_win.h",
"libcef_dll/bootstrap/bootstrap_util_win.cc",
"libcef_dll/bootstrap/bootstrap_util_win.h",
"libcef_dll/bootstrap/bootstrap_win.cc",
"libcef_dll/bootstrap/win/bootstrap.rc",
"libcef_dll/bootstrap/win/resource.h",
"libcef_dll/wrapper/cef_certificate_util_win.cc",
"libcef_dll/wrapper/cef_util_win.cc",
"libcef/browser/crashpad_runner.cc",
"libcef/browser/crashpad_runner.h",
"libcef/browser/preferred_stack_size_win.inc",
"//chrome/app/delay_load_failure_hook_win.cc",
"//chrome/app/delay_load_failure_hook_win.h",
"//chrome/common/win/delay_load_failure_support.cc",
"//chrome/common/win/delay_load_failure_support.h",
"//content/app/sandbox_helper_win.cc",
"//content/public/app/sandbox_helper_win.h",
]
bootstrap_deps = [
":make_api_versions_header",
":make_config_header",
":make_version_header",
"//base",
"//build/win:default_exe_manifest",
"//chrome/install_static:secondary_module",
"//chrome/chrome_elf",
"//sandbox",
"//sandbox/policy",
"//third_party/crashpad/crashpad/handler",
]
bootstrap_libs = [
"crypt32.lib",
"wintrust.lib",
]
bootstrap_configs = [
":libcef_includes_config",
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
# Windows application that initializes the sandbox and then passes
# execution to a client-provided DLL.
executable("bootstrap") {
# Necessary because the libcef target is testonly.
testonly = true
sources = bootstrap_sources
deps = bootstrap_deps
libs = bootstrap_libs
configs += bootstrap_configs
# Set /SUBSYSTEM:WINDOWS.
configs -= [ "//build/config/win:console" ]
configs += [ "//build/config/win:windowed" ]
defines = [
"CEF_BUILD_BOOTSTRAP",
]
}
# Like "bootstrap", but as a console application.
executable("bootstrapc") {
# Necessary because the libcef target is testonly.
testonly = true
sources = bootstrap_sources
deps = bootstrap_deps
libs = bootstrap_libs
configs += bootstrap_configs
defines = [
"CEF_BUILD_BOOTSTRAP",
"CEF_BUILD_BOOTSTRAP_CONSOLE",
]
}
}
#
# Resource grit/pack targets.
#
@@ -1661,46 +1541,17 @@ if (is_mac) {
]
}
if (!use_static_angle) {
# Add the ANGLE .dylibs in the MODULE_DIR of the Framework app bundle.
bundle_data("cef_framework_angle_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libEGL.dylib",
"$root_out_dir/egl_intermediates/libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:angle_library_copy",
]
}
}
# We need to copy the CEF libraries so that the bundle_data dependencies have
# a "copy" target type. Otherwise for "shared_library" target types it will
# try to link things into the CEF Framework when we want to keep the libraries
# separate instead.
copy("cef_library_copy") {
# Add the ANGLE .dylibs in the MODULE_DIR of the Framework app bundle.
bundle_data("cef_framework_angle_binaries") {
sources = [
"$root_out_dir/libcef_sandbox.dylib",
]
outputs = [ "$root_out_dir/cef_intermediates/{{source_file_part}}" ]
deps = [
":cef_sandbox",
]
}
# Add the CEF .dylibs in the MODULE_DIR of the Framework app bundle.
bundle_data("cef_framework_cef_binaries") {
sources = [
"$root_out_dir/cef_intermediates/libcef_sandbox.dylib",
"$root_out_dir/egl_intermediates/libEGL.dylib",
"$root_out_dir/egl_intermediates/libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
":cef_library_copy",
"//ui/gl:angle_library_copy",
]
}
@@ -1733,15 +1584,11 @@ if (is_mac) {
sources = libcef_sources_common + includes_mac
deps = libcef_deps_common + [
":cef_framework_cef_binaries",
":cef_framework_angle_binaries",
":cef_framework_resources",
":cef_framework_swiftshader_binaries",
]
if (!use_static_angle) {
deps += [ ":cef_framework_angle_binaries" ]
}
configs += [
":libcef_autogen_config",
":libcef_includes_config",
@@ -1806,8 +1653,7 @@ if (is_mac) {
]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements. Don't use "delayloads_not_for_child_dll" here because
# we need some DLLs loaded in child processes before sandbox lockdown.
# improvements.
configs += [ "//build/config/win:delayloads" ]
libs = [
@@ -1903,6 +1749,7 @@ if (is_mac) {
deps = [
":cef_make_headers",
":cef_sandbox",
":libcef_dll_wrapper",
]
if (defined(invoker.helper_deps)) {
@@ -2303,7 +2150,6 @@ if (is_mac) {
if (is_win) {
sources += includes_win +
gypi_paths2.includes_wrapper_win +
gypi_paths2.shared_sources_win +
gypi_paths2.cefclient_sources_win +
gypi_paths2.cefclient_sources_resources_win_rc
@@ -2314,10 +2160,7 @@ if (is_mac) {
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
configs += [ "//build/config/win:delayloads" ]
defines += [
"CEF_USE_ATL",
@@ -2381,70 +2224,6 @@ if (is_mac) {
}
}
if (is_win) {
# Like the "cefclient" executable target, but building a DLL to be loaded by
# bootstrap.exe.
shared_library("cefclient_dll") {
# Necessary because the libcef target is testonly.
testonly = true
output_name = "cefclient"
sources = includes_common +
includes_win +
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_win +
gypi_paths2.shared_sources_browser +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_renderer +
gypi_paths2.shared_sources_win +
gypi_paths2.cefclient_sources_browser +
gypi_paths2.cefclient_sources_common +
gypi_paths2.cefclient_sources_renderer +
gypi_paths2.cefclient_sources_win +
gypi_paths2.cefclient_sources_resources_win_rc
deps = [
":bootstrap",
":libcef",
":libcef_dll_wrapper",
]
defines = [
"CEF_USE_ATL",
"CEF_USE_BOOTSTRAP",
]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
libs = [
"comctl32.lib",
"d3d11.lib",
"imm32.lib",
"oleacc.lib",
"rpcrt4.lib",
"shlwapi.lib",
]
if (target_cpu != "arm64") {
libs += [
"glu32.lib",
"opengl32.lib",
]
ldflags = [
"/DELAYLOAD:glu32.dll",
"/DELAYLOAD:oleaut32.dll",
"/DELAYLOAD:opengl32.dll",
]
}
}
}
#
# cefsimple targets.
@@ -2469,7 +2248,6 @@ if (is_mac) {
if (is_win) {
sources += includes_win +
gypi_paths2.includes_wrapper_win +
gypi_paths2.cefsimple_sources_win +
gypi_paths2.cefsimple_sources_resources_win_rc
@@ -2479,10 +2257,7 @@ if (is_mac) {
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
configs += [ "//build/config/win:delayloads" ]
deps += [
":cef_sandbox",
@@ -2513,48 +2288,6 @@ if (is_mac) {
}
}
if (is_win) {
# Like the "cefsimple" executable target, but building a DLL to be loaded by
# bootstrap.exe.
shared_library("cefsimple_dll") {
# Necessary because the libcef target is testonly.
testonly = true
output_name = "cefsimple"
sources = includes_common +
includes_win +
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_win +
gypi_paths2.cefsimple_sources_common +
gypi_paths2.cefsimple_sources_win +
gypi_paths2.cefsimple_sources_resources_win_rc
deps = [
":bootstrap",
":libcef",
":libcef_dll_wrapper",
]
defines = [
"CEF_USE_BOOTSTRAP",
]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
libs = [
"comctl32.lib",
"shlwapi.lib",
"rpcrt4.lib",
]
}
}
#
# ceftests targets.
@@ -2590,17 +2323,13 @@ if (is_mac) {
]
if (is_win) {
sources += gypi_paths2.includes_wrapper_win +
gypi_paths2.shared_sources_win +
sources += gypi_paths2.shared_sources_win +
gypi_paths2.ceftests_sources_win +
gypi_paths2.ceftests_sources_resources_win_rc
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
configs += [ "//build/config/win:delayloads" ]
deps += [
":cef_sandbox",
@@ -2632,45 +2361,4 @@ if (is_mac) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
}
if (is_win) {
# Like the "ceftests" executable target, but building a DLL to be loaded by
# bootstrapc.exe.
shared_library("ceftests_dll") {
testonly = true
output_name = "ceftests"
sources = includes_common +
gypi_paths2.includes_wrapper +
gypi_paths2.includes_wrapper_win +
gypi_paths2.shared_sources_browser +
gypi_paths2.shared_sources_common +
gypi_paths2.shared_sources_renderer +
gypi_paths2.shared_sources_win +
gypi_paths2.ceftests_sources_common +
gypi_paths2.ceftests_sources_win +
gypi_paths2.ceftests_sources_resources_win_rc
deps = [
":bootstrapc",
":libcef",
":libcef_dll_wrapper",
":gtest_teamcity",
"//testing/gtest",
]
defines = [
"CEF_USE_BOOTSTRAP",
"CEF_TESTS_IN_SRC_DIRECTORY",
]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [
"//build/config/win:delayloads",
"//build/config/win:delayloads_not_for_child_dll",
]
}
}
}

View File

@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/138.0.7204.4'
'chromium_checkout': 'refs/tags/137.0.7151.69'
}

View File

@@ -43,7 +43,9 @@ def _declare_helper_app(name, info_plist, deps, helper_base_name, helper_suffix,
bundle_id = "{}.{}.helper{}".format(MACOS_BUNDLE_ID_BASE, name.lower(), bundle_id_suffix),
infoplists = [":{}_InfoPList".format(helper_base_name)],
minimum_os_version = MACOS_DEPLOYMENT_TARGET,
deps = deps,
deps = [
"@cef//:cef_sandbox",
] + deps,
**kwargs,
)

View File

@@ -47,6 +47,7 @@ def declare_exe(name, srcs, manifest_srcs, rc_file, resources_srcs, resources_de
srcs = srcs,
deps = [
"@cef//:cef_wrapper",
"@cef//:cef_sandbox",
] + deps,
linkopts = [
"$(location @cef//:cef_lib)",

View File

@@ -32,13 +32,9 @@ DLLS_X64 = [
# processes. Conversely, some DLLs must be loaded before sandbox lockdown. In
# unsandboxed processes they will load when first needed. The linker will
# automatically ignore anything which is not linked to the binary at all (it is
# harmless to have an unmatched /delayload). Lists should be kept in sync with
# targets from Chromium's //build/config/win/BUILD.gn file.
# harmless to have an unmatched /delayload). This list should be kept in sync
# with Chromium's "delayloads" target from the //build/config/win/BUILD.gn file.
DELAYLOAD_DLLS = [
# Required to support CefScopedLibraryLoader.
"libcef.dll"
# "delayloads" target.
"api-ms-win-core-winrt-error-l1-1-0.dll",
"api-ms-win-core-winrt-l1-1-0.dll",
"api-ms-win-core-winrt-string-l1-1-0.dll",
@@ -80,36 +76,38 @@ DELAYLOAD_DLLS = [
"winusb.dll",
"wsock32.dll",
"wtsapi32.dll",
# "delayloads_not_for_child_dll" target.
"crypt32.dll",
"dbghelp.dll",
"dhcpcsvc.dll",
"dwrite.dll",
"iphlpapi.dll",
"oleaut32.dll",
"secur32.dll",
"userenv.dll",
"winhttp.dll",
"winmm.dll",
"winspool.drv",
"wintrust.dll",
"ws2_32.dll",
]
# Standard link libraries.
STANDARD_LIBS = [
"comctl32.lib",
"crypt32.lib",
"delayimp.lib",
"gdi32.lib",
"rpcrt4.lib",
"shlwapi.lib",
"user32.lib",
"wintrust.lib",
"ws2_32.lib",
]
# Sandbox link libraries.
SANDBOX_LIBS = [
"Advapi32.lib",
"dbghelp.lib",
"Delayimp.lib",
"ntdll.lib",
"OleAut32.lib",
"PowrProf.lib",
"Propsys.lib",
"psapi.lib",
"SetupAPI.lib",
"Shcore.lib",
"Shell32.lib",
"Userenv.lib",
"version.lib",
"wbemuuid.lib",
"WindowsApp.lib",
"winmm.lib",
]
COMMON_LINKOPTS_DEBUG = [
]
@@ -180,9 +178,18 @@ COMMON_DEFINES = [
"WIN32_LEAN_AND_MEAN",
# Disable exceptions
"_HAS_EXCEPTIONS=0",
# Required by cef_sandbox.lib
"PSAPI_VERSION=1",
# Used by apps to test if the sandbox is enabled
"CEF_USE_SANDBOX",
]
COMMON_DEFINES_DEBUG = [
# Required by cef_sandbox.lib
# Disable iterator debugging
"HAS_ITERATOR_DEBUGGING=0",
"_ITERATOR_DEBUG_LEVEL=0",
]
COMMON_DEFINES_RELEASE = [

View File

@@ -65,14 +65,8 @@
"linux": "e5ac12b1bd88b9ece6ceaa57848aaba61ab85242",
"mac": "9e84009c92c25aa80935727b5e4526b23439a575",
"windows": "65c7157dd3e8eba9bcc38db2bd7f26508c717f3e"
},
"13800": {
"comment": "Added June 02, 2025.",
"linux": "72c83a1455706c0f964505a6edcbf00c4a00575d",
"mac": "09110c1f3bbe0e8a8c26ddf6df3388d73a6593d1",
"windows": "1cde3ec27f93747ba42c0f2aa00467a5a16adfd4"
}
},
"last": "13800",
"last": "13700",
"min": "13300"
}

View File

@@ -17,7 +17,6 @@
'include/base/cef_cancelable_callback.h',
'include/base/cef_compiler_specific.h',
'include/base/cef_dump_without_crashing.h',
'include/base/cef_immediate_crash.h',
'include/base/cef_lock.h',
'include/base/cef_logging.h',
'include/base/cef_macros.h',
@@ -80,11 +79,6 @@
'includes_wrapper_mac': [
'include/wrapper/cef_library_loader.h',
],
'includes_wrapper_win': [
'include/wrapper/cef_certificate_util_win.h',
'include/wrapper/cef_library_loader.h',
'include/wrapper/cef_util_win.h',
],
'includes_win': [
'include/cef_sandbox_win.h',
'include/internal/cef_win.h',
@@ -171,15 +165,9 @@
'libcef_dll/wrapper/libcef_dll_wrapper2.cc',
],
'libcef_dll_wrapper_sources_mac': [
'libcef_dll/wrapper/cef_scoped_library_loader_mac.mm',
'libcef_dll/wrapper/cef_scoped_sandbox_context_mac.mm',
'libcef_dll/wrapper/cef_library_loader_mac.mm',
'libcef_dll/wrapper/libcef_dll_dylib.cc',
],
'libcef_dll_wrapper_sources_win': [
'libcef_dll/wrapper/cef_certificate_util_win.cc',
'libcef_dll/wrapper/cef_scoped_library_loader_win.cc',
'libcef_dll/wrapper/cef_util_win.cc',
],
'shared_sources_browser': [
'tests/shared/browser/client_app_browser.cc',
'tests/shared/browser/client_app_browser.h',

View File

@@ -36,7 +36,11 @@ macro(PRINT_CEF_CONFIG)
message(STATUS "CEF sandbox: ${USE_SANDBOX}")
message(STATUS "Standard libraries: ${CEF_STANDARD_LIBS}")
set(_libraries ${CEF_STANDARD_LIBS})
if(OS_WINDOWS AND USE_SANDBOX)
list(APPEND _libraries ${CEF_SANDBOX_STANDARD_LIBS})
endif()
message(STATUS "Standard libraries: ${_libraries}")
message(STATUS "Compile defines: ${CEF_COMPILER_DEFINES}")
message(STATUS "Compile defines (Debug): ${CEF_COMPILER_DEFINES_DEBUG}")

View File

@@ -326,7 +326,7 @@ if(OS_MAC)
# Find the newest available base SDK.
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
foreach(OS_VERSION 15.4 14.2 14.0 11.0)
foreach(OS_VERSION 14.2 14.0 11.0)
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
set(CMAKE_OSX_SYSROOT ${SDK})
@@ -361,6 +361,14 @@ if(OS_MAC)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
list(APPEND CEF_STANDARD_LIBS
-lsandbox
)
# CEF sandbox library paths.
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
endif()
# CEF Helper app suffixes.
@@ -388,6 +396,15 @@ if(OS_WINDOWS)
set(CMAKE_CXX_FLAGS_RELEASE "")
endif()
if(USE_SANDBOX)
# Check if the current MSVC version is compatible with the cef_sandbox.lib
# static library. We require VS2015 or newer.
if(MSVC_VERSION LESS 1900)
message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})")
set(USE_SANDBOX OFF)
endif()
endif()
# Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
@@ -432,20 +449,18 @@ if(OS_WINDOWS)
list(APPEND CEF_LINKER_FLAGS_DEBUG
/DEBUG # Generate debug information
)
list(APPEND CEF_EXE_LINKER_FLAGS
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
# Delayload most libraries as the dlls are simply not required at startup (or
# at all, depending on the process type). Some dlls open handles when they are
# loaded, and we may not want them to be loaded in renderers or other sandboxed
# processes. Conversely, some dlls must be loaded before sandbox lockdown. In
# unsandboxed processes they will load when first needed. The linker will
# automatically ignore anything which is not linked to the binary at all (it is
# harmless to have an unmatched /delayload). Lists should be kept in sync with
# targets from Chromium's //build/config/win/BUILD.gn file.
set(CEF_DELAYLOAD_FLAGS
# Required to support CefScopedLibraryLoader.
/DELAYLOAD:libcef.dll
# "delayloads" target.
# Delayload most libraries as the dlls are simply not required at startup (or
# at all, depending on the process type). Some dlls open handles when they are
# loaded, and we may not want them to be loaded in renderers or other sandboxed
# processes. Conversely, some dlls must be loaded before sandbox lockdown. In
# unsandboxed processes they will load when first needed. The linker will
# automatically ignore anything which is not linked to the binary at all (it is
# harmless to have an unmatched /delayload). This list should be kept in sync
# with Chromium's "delayloads" target from the //build/config/win/BUILD.gn file.
/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll
/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll
/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll
@@ -487,31 +502,6 @@ if(OS_WINDOWS)
/DELAYLOAD:winusb.dll
/DELAYLOAD:wsock32.dll
/DELAYLOAD:wtsapi32.dll
# "delayloads_not_for_child_dll" target.
/DELAYLOAD:crypt32.dll
/DELAYLOAD:dbghelp.dll
/DELAYLOAD:dhcpcsvc.dll
/DELAYLOAD:dwrite.dll
/DELAYLOAD:iphlpapi.dll
/DELAYLOAD:oleaut32.dll
/DELAYLOAD:secur32.dll
/DELAYLOAD:userenv.dll
/DELAYLOAD:winhttp.dll
/DELAYLOAD:winmm.dll
/DELAYLOAD:winspool.drv
/DELAYLOAD:wintrust.dll
/DELAYLOAD:ws2_32.dll
)
list(APPEND CEF_EXE_LINKER_FLAGS
# For executable targets.
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
${CEF_DELAYLOAD_FLAGS}
)
list(APPEND CEF_SHARED_LINKER_FLAGS
# For shared library targets.
${CEF_DELAYLOAD_FLAGS}
)
list(APPEND CEF_COMPILER_DEFINES
WIN32 _WIN32 _WINDOWS # Windows platform
@@ -550,12 +540,9 @@ if(OS_WINDOWS)
# Standard libraries.
set(CEF_STANDARD_LIBS
comctl32.lib
crypt32.lib
delayimp.lib
gdi32.lib
rpcrt4.lib
shlwapi.lib
wintrust.lib
ws2_32.lib
)
@@ -600,8 +587,36 @@ if(OS_WINDOWS)
if(USE_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_BOOTSTRAP # Used by apps to test if the bootstrap is enabled
PSAPI_VERSION=1 # Required by cef_sandbox.lib
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
list(APPEND CEF_COMPILER_DEFINES_DEBUG
_HAS_ITERATOR_DEBUGGING=0 # Disable iterator debugging
)
# Libraries required by cef_sandbox.lib.
set(CEF_SANDBOX_STANDARD_LIBS
Advapi32.lib
dbghelp.lib
Delayimp.lib
ntdll.lib
OleAut32.lib
PowrProf.lib
Propsys.lib
psapi.lib
SetupAPI.lib
Shell32.lib
Shcore.lib
Userenv.lib
version.lib
wbemuuid.lib
WindowsApp.lib
winmm.lib
)
# CEF sandbox library paths.
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.lib")
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.lib")
endif()
# Configure use of ATL.

View File

@@ -1,197 +0,0 @@
// Copyright (c) 2025 Marshall A. Greenblatt. Portions copyright (c) 2019
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_IMMEDIATE_CRASH_H_
#define CEF_INCLUDE_BASE_CEF_IMMEDIATE_CRASH_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/immediate_crash.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_build.h"
#if defined(OS_WIN)
#include <stdlib.h>
#endif
// Crashes in the fastest possible way with no attempt at logging.
// There are several constraints; see http://crbug.com/664209 for more context.
//
// - TRAP_SEQUENCE_() must be fatal. It should not be possible to ignore the
// resulting exception or simply hit 'continue' to skip over it in a debugger.
// - Different instances of TRAP_SEQUENCE_() must not be folded together, to
// ensure crash reports are debuggable. Unlike __builtin_trap(), asm volatile
// blocks will not be folded together.
// Note: TRAP_SEQUENCE_() previously required an instruction with a unique
// nonce since unlike clang, GCC folds together identical asm volatile
// blocks.
// - TRAP_SEQUENCE_() must produce a signal that is distinct from an invalid
// memory access.
// - TRAP_SEQUENCE_() must be treated as a set of noreturn instructions.
// __builtin_unreachable() is used to provide that hint here. clang also uses
// this as a heuristic to pack the instructions in the function epilogue to
// improve code density.
// - base::ImmediateCrash() is used in allocation hooks. To prevent recursions,
// TRAP_SEQUENCE_() must not allocate.
//
// Additional properties that are nice to have:
// - TRAP_SEQUENCE_() should be as compact as possible.
// - The first instruction of TRAP_SEQUENCE_() should not change, to avoid
// shifting crash reporting clusters. As a consequence of this, explicit
// assembly is preferred over intrinsics.
// Note: this last bullet point may no longer be true, and may be removed in
// the future.
// Note: TRAP_SEQUENCE Is currently split into two macro helpers due to the fact
// that clang emits an actual instruction for __builtin_unreachable() on certain
// platforms (see https://crbug.com/958675). In addition, the int3/bkpt/brk will
// be removed in followups, so splitting it up like this now makes it easy to
// land the followups.
#if defined(COMPILER_GCC)
#if defined(ARCH_CPU_X86_FAMILY)
// TODO(crbug.com/40625592): In theory, it should be possible to use just
// int3. However, there are a number of crashes with SIGILL as the exception
// code, so it seems likely that there's a signal handler that allows execution
// to continue after SIGTRAP.
#define TRAP_SEQUENCE1_() asm volatile("int3")
#if defined(OS_APPLE)
// Intentionally empty: __builtin_unreachable() is always part of the sequence
// (see IMMEDIATE_CRASH below) and already emits a ud2 on Mac.
#define TRAP_SEQUENCE2_() asm volatile("")
#else
#define TRAP_SEQUENCE2_() asm volatile("ud2")
#endif // defined(OS_APPLE)
#elif defined(ARCH_CPU_ARMEL)
// bkpt will generate a SIGBUS when running on armv7 and a SIGTRAP when running
// as a 32 bit userspace app on arm64. There doesn't seem to be any way to
// cause a SIGTRAP from userspace without using a syscall (which would be a
// problem for sandboxing).
// TODO(crbug.com/40625592): Remove bkpt from this sequence.
#define TRAP_SEQUENCE1_() asm volatile("bkpt #0")
#define TRAP_SEQUENCE2_() asm volatile("udf #0")
#elif defined(ARCH_CPU_ARM64)
// This will always generate a SIGTRAP on arm64.
// TODO(crbug.com/40625592): Remove brk from this sequence.
#define TRAP_SEQUENCE1_() asm volatile("brk #0")
#define TRAP_SEQUENCE2_() asm volatile("hlt #0")
#else
// Crash report accuracy will not be guaranteed on other architectures, but at
// least this will crash as expected.
#define TRAP_SEQUENCE1_() __builtin_trap()
#define TRAP_SEQUENCE2_() asm volatile("")
#endif // ARCH_CPU_*
#elif defined(COMPILER_MSVC)
#if !defined(__clang__)
// MSVC x64 doesn't support inline asm, so use the MSVC intrinsic.
#define TRAP_SEQUENCE1_() __debugbreak()
#define TRAP_SEQUENCE2_()
#elif defined(ARCH_CPU_ARM64)
// Windows ARM64 uses "BRK #F000" as its breakpoint instruction, and
// __debugbreak() generates that in both VC++ and clang.
#define TRAP_SEQUENCE1_() __debugbreak()
// Intentionally empty: __builtin_unreachable() is always part of the sequence
// (see IMMEDIATE_CRASH below) and already emits a ud2 on Win64,
// https://crbug.com/958373
#define TRAP_SEQUENCE2_() __asm volatile("")
#else
#define TRAP_SEQUENCE1_() asm volatile("int3")
#define TRAP_SEQUENCE2_() asm volatile("ud2")
#endif // __clang__
#else
#error No supported trap sequence!
#endif // COMPILER_GCC
#define TRAP_SEQUENCE_() \
do { \
TRAP_SEQUENCE1_(); \
TRAP_SEQUENCE2_(); \
} while (false)
// This version of ALWAYS_INLINE inlines even in is_debug=true.
// TODO(pbos): See if NDEBUG can be dropped from ALWAYS_INLINE as well, and if
// so merge. Otherwise document why it cannot inline in debug in
// base/compiler_specific.h.
#if defined(COMPILER_GCC)
#define IMMEDIATE_CRASH_ALWAYS_INLINE inline __attribute__((__always_inline__))
#elif defined(COMPILER_MSVC)
#define IMMEDIATE_CRASH_ALWAYS_INLINE __forceinline
#else
#define IMMEDIATE_CRASH_ALWAYS_INLINE inline
#endif
namespace base {
[[noreturn]] IMMEDIATE_CRASH_ALWAYS_INLINE void ImmediateCrash() {
#if defined(OS_WIN)
// We can't use abort() on Windows because it results in the
// abort/retry/ignore dialog which disrupts automated tests.
// TODO(crbug.com/40948553): investigate if such dialogs can
// be suppressed
TRAP_SEQUENCE_();
#if defined(__clang__) || defined(COMPILER_GCC)
__builtin_unreachable();
#endif // defined(__clang__) || defined(COMPILER_GCC)
#else // !defined(OS_WIN)
abort();
#endif // !defined(OS_WIN)
}
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_LOCK_H_

View File

@@ -189,50 +189,16 @@
namespace cef {
namespace logging {
class ScopedEarlySupport;
namespace internal {
// Structure defining the baseline logging implementation used by client
// and wrapper code that links libcef_dll_wrapper.
struct Implementation {
decltype(&cef_get_min_log_level) get_min_log_level;
decltype(&cef_get_vlog_level) get_vlog_level;
decltype(&cef_log) log;
};
// Returns the currently configured logging implementation.
const Implementation* GetImplementation();
// Change the logging implementation for the lifespan of this scoped object.
// See ScopedEarlySupport for usage.
class ScopedImplementation {
public:
ScopedImplementation(const ScopedImplementation&) = delete;
ScopedImplementation& operator=(const ScopedImplementation&) = delete;
private:
friend class logging::ScopedEarlySupport;
ScopedImplementation();
~ScopedImplementation();
void Init(const Implementation* impl);
const Implementation* previous_ = nullptr;
};
} // namespace internal
// Gets the current log level.
inline int GetMinLogLevel() {
return internal::GetImplementation()->get_min_log_level();
return cef_get_min_log_level();
}
// Gets the current vlog level for the given file (usually taken from
// __FILE__). Note that |N| is the size *with* the null terminator.
template <size_t N>
int GetVlogLevel(const char (&file)[N]) {
return internal::GetImplementation()->get_vlog_level(file, N);
return cef_get_vlog_level(file, N);
}
typedef int LogSeverity;
@@ -252,64 +218,6 @@ const LogSeverity LOG_DFATAL = LOG_ERROR;
const LogSeverity LOG_DFATAL = LOG_FATAL;
#endif
///
/// Support the use of CEF logging macros during early application startup,
/// prior to loading libcef. Not for use during or after CEF initialization.
/// Support is scoped to this object's lifespan. This implementation is not
/// thread-safe and should not be used for logging from multiple threads.
///
class ScopedEarlySupport final : public internal::ScopedImplementation {
public:
///
/// Logging configuration.
///
struct Config {
///
/// Configure logging level.
///
int min_log_level = LOG_ERROR;
int vlog_level = 0;
///
/// Configure log line formatting.
///
const char* log_prefix = nullptr;
bool log_process_id = true;
bool log_thread_id = true;
bool log_timestamp = true;
bool log_tickcount = true;
///
/// Optionally override the default handling of formatted log lines. For
/// example, this callback could be used to write |log_line| to a file.
/// Return false to proceed with the default behavior of writing to stderr
/// or debugger console. FATAL errors will still intentionally crash the
/// application.
///
bool (*formatted_log_handler)(const char* /*log_line*/) = nullptr;
};
explicit ScopedEarlySupport(const Config& config);
ScopedEarlySupport(const ScopedEarlySupport&) = delete;
ScopedEarlySupport& operator=(const ScopedEarlySupport&) = delete;
private:
static const Config& GetConfig();
static int get_min_log_level();
static int get_vlog_level(const char* file_start, size_t N);
static void log(const char* file,
int line,
int severity,
const char* message);
const struct Impl {
internal::Implementation ptrs;
Config config;
} impl_;
};
// A few definitions of macros that don't generate much code. These are used
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
// better to have compact code for these operations.

View File

@@ -48,8 +48,14 @@ extern "C" {
/// The sandbox is used to restrict sub-processes (renderer, GPU, etc) from
/// directly accessing system resources. This helps to protect the user from
/// untrusted and potentially malicious Web content. See
/// https://bitbucket.org/chromiumembedded/cef/wiki/SandboxSetup.md for usage
/// details. See include/wrapper/cef_library_loader.h for example usage.
/// http://www.chromium.org/developers/design-documents/sandbox for complete
/// details.
///
/// To enable the sandbox on macOS the following requirements must be met:
/// 1. Link the helper process executable with the cef_sandbox static library.
/// 2. Call the cef_sandbox_initialize() function at the beginning of the
/// helper executable main() function and before loading the CEF framework
/// library. See include/wrapper/cef_library_loader.h for example usage.
///
///
@@ -70,7 +76,7 @@ CEF_EXPORT void cef_sandbox_destroy(void* sandbox_context);
///
/// Scoped helper for managing the life span of a sandbox context handle.
///
class CefScopedSandboxContext final {
class CEF_EXPORT CefScopedSandboxContext {
public:
CefScopedSandboxContext();
~CefScopedSandboxContext();
@@ -81,8 +87,7 @@ class CefScopedSandboxContext final {
bool Initialize(int argc, char** argv);
private:
void* library_handle_ = nullptr;
void* sandbox_context_ = nullptr;
void* sandbox_context_;
};
#endif // __cplusplus

View File

@@ -37,12 +37,6 @@
#if defined(OS_WIN)
#include "include/cef_version_info.h"
#if !defined(GENERATING_CEF_API_HASH)
#include <windows.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -52,9 +46,17 @@ extern "C" {
/// The sandbox is used to restrict sub-processes (renderer, GPU, etc) from
/// directly accessing system resources. This helps to protect the user from
/// untrusted and potentially malicious Web content. See
/// https://bitbucket.org/chromiumembedded/cef/wiki/SandboxSetup.md for usage
/// http://www.chromium.org/developers/design-documents/sandbox for complete
/// details.
///
/// To enable the sandbox on Windows the following requirements must be met:
/// 1. Use the same executable for the browser process and all sub-processes.
/// 2. Link the executable with the cef_sandbox static library.
/// 3. Call the cef_sandbox_info_create() function from within the executable
/// (not from a separate DLL) and pass the resulting pointer into both the
/// CefExecuteProcess() and CefInitialize() functions via the
/// |windows_sandbox_info| parameter.
///
///
/// Create the sandbox information object for this process. It is safe to create
@@ -74,7 +76,7 @@ void cef_sandbox_info_destroy(void* sandbox_info);
///
/// Manages the life span of a sandbox information object.
///
class CefScopedSandboxInfo final {
class CefScopedSandboxInfo {
public:
CefScopedSandboxInfo() { sandbox_info_ = cef_sandbox_info_create(); }
~CefScopedSandboxInfo() { cef_sandbox_info_destroy(sandbox_info_); }
@@ -86,39 +88,6 @@ class CefScopedSandboxInfo final {
};
#endif // __cplusplus
#if defined(CEF_BUILD_BOOTSTRAP)
#define CEF_BOOTSTRAP_EXPORT __declspec(dllimport)
#else
#define CEF_BOOTSTRAP_EXPORT __declspec(dllexport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
///
/// Entry point to be implemented by client DLLs using bootstrap.exe for
/// windows (/SUBSYSTEM:WINDOWS) applications.
///
CEF_BOOTSTRAP_EXPORT int RunWinMain(HINSTANCE hInstance,
LPTSTR lpCmdLine,
int nCmdShow,
void* sandbox_info,
cef_version_info_t* version_info);
///
/// Entry point to be implemented by client DLLs using bootstrapc.exe for
/// console (/SUBSYSTEM:CONSOLE) applications.
///
CEF_BOOTSTRAP_EXPORT int RunConsoleMain(int argc,
char* argv[],
void* sandbox_info,
cef_version_info_t* version_info);
#ifdef __cplusplus
}
#endif
#endif // defined(OS_WIN)
#endif // CEF_INCLUDE_CEF_SANDBOX_WIN_H_

View File

@@ -30,9 +30,6 @@
#ifndef CEF_INCLUDE_CEF_VERSION_INFO_H_
#define CEF_INCLUDE_CEF_VERSION_INFO_H_
#include <stddef.h>
#include "include/cef_api_hash.h"
#include "include/internal/cef_export.h"
#if !defined(GENERATING_CEF_API_HASH)
@@ -58,66 +55,6 @@ extern "C" {
///
CEF_EXPORT int cef_version_info(int entry);
#if CEF_API_ADDED(13800)
///
/// Structure representing all CEF version information.
///
typedef struct _cef_version_info_t {
///
/// Size of this structure.
///
size_t size;
int cef_version_major;
int cef_version_minor;
int cef_version_patch;
int cef_commit_number;
int chrome_version_major;
int chrome_version_minor;
int chrome_version_build;
int chrome_version_patch;
} cef_version_info_t;
///
/// Return all CEF version information for the libcef library.
///
CEF_EXPORT void cef_version_info_all(cef_version_info_t* info);
#elif !defined(GENERATING_CEF_API_HASH)
// Unversioned definition to support use of the bootstrap and
// CefScopedLibraryLoader with older API versions.
typedef struct _cef_version_info_t {
// Size of this structure.
size_t size;
int cef_version_major;
int cef_version_minor;
int cef_version_patch;
int cef_commit_number;
int chrome_version_major;
int chrome_version_minor;
int chrome_version_build;
int chrome_version_patch;
} cef_version_info_t;
#endif // !defined(GENERATING_CEF_API_HASH)
///
/// Populate CEF version information for the client library.
///
#define CEF_POPULATE_VERSION_INFO(info) \
(info)->size = sizeof(cef_version_info_t); \
(info)->cef_version_major = CEF_VERSION_MAJOR; \
(info)->cef_version_minor = CEF_VERSION_MINOR; \
(info)->cef_version_patch = CEF_VERSION_PATCH; \
(info)->cef_commit_number = CEF_COMMIT_NUMBER; \
(info)->chrome_version_major = CHROME_VERSION_MAJOR; \
(info)->chrome_version_minor = CHROME_VERSION_MINOR; \
(info)->chrome_version_build = CHROME_VERSION_BUILD; \
(info)->chrome_version_patch = CHROME_VERSION_PATCH
#ifdef __cplusplus
}
#endif

View File

@@ -41,8 +41,6 @@
#include <windows.h>
#endif
#include "include/internal/cef_export.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -672,11 +672,7 @@ typedef struct _cef_browser_settings_t {
/// Controls whether databases can be used. Also configurable using the
/// "disable-databases" command-line switch.
///
#if CEF_API_ADDED(13800)
cef_state_t databases_deprecated;
#else
cef_state_t databases;
#endif
///
/// Controls whether WebGL can be used. Note that WebGL requires hardware
@@ -1065,11 +1061,6 @@ typedef enum {
CEF_RESULT_CODE_CHROME_FIRST,
#if CEF_API_ADDED(13800)
/// The process is of an unknown type.
CEF_RESULT_CODE_BAD_PROCESS_TYPE = 6,
#endif
/// A critical chrome file is missing.
CEF_RESULT_CODE_MISSING_DATA = 7,
@@ -1102,16 +1093,7 @@ typedef enum {
/// system state can't be recovered and will be unstable.
CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED = 37,
#if CEF_API_ADDED(13800)
/// The browser process exited because it was re-launched without elevation.
CEF_RESULT_CODE_NORMAL_EXIT_AUTO_DE_ELEVATED = 38,
#endif
#if CEF_API_ADDED(13800)
CEF_RESULT_CODE_CHROME_LAST = 39,
#else
CEF_RESULT_CODE_CHROME_LAST = 38,
#endif
// The following values should be kept in sync with Chromium's
// sandbox::TerminationCodes type.
@@ -3646,9 +3628,6 @@ typedef enum {
#endif
#if CEF_API_ADDED(13400)
CEF_CPAIT_CHANGE_PASSWORD,
#endif
#if CEF_API_ADDED(13800)
CEF_CPAIT_LENS_OVERLAY_HOMEWORK,
#endif
CEF_CPAIT_NUM_VALUES,
} cef_chrome_page_action_icon_type_t;

View File

@@ -43,12 +43,11 @@ extern "C" {
/// ContentSettingsType type.
///
typedef enum {
/// This setting governs whether cookies are enabled by the user in the
// This setting governs whether cookies are enabled by the user in the
/// provided context. However, it may be overridden by other settings. This
/// enum should NOT be read directly to determine whether cookies are enabled;
/// the client should instead rely on the CookieSettings API.
CEF_CONTENT_SETTING_TYPE_COOKIES,
CEF_CONTENT_SETTING_TYPE_IMAGES,
CEF_CONTENT_SETTING_TYPE_JAVASCRIPT,
@@ -236,15 +235,11 @@ typedef enum {
/// screens. See also: https://w3c.github.io/window-placement
CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT,
/// Stores whether to allow insecure websites to make private network
/// requests.
/// See also: https://wicg.github.io/cors-rfc1918
/// Set through enterprise policies only.
#if CEF_API_ADDED(13800)
CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK_DEPRECATED,
#else
/// Stores whether to allow insecure websites to make private network
/// requests.
/// See also: https://wicg.github.io/cors-rfc1918
/// Set through enterprise policies only.
CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK,
#endif
/// Content setting which stores whether or not a site can access low-level
/// locally installed font data using the Local Fonts Access API.
@@ -516,21 +511,6 @@ typedef enum {
CEF_CONTENT_SETTING_TYPE_LOCAL_NETWORK_ACCESS,
#endif
#if CEF_API_ADDED(13800)
/// Stores information on-device language packs for which a site has
/// installed using the Web Speech API.
CEF_CONTENT_SETTING_TYPE_ON_DEVICE_SPEECH_RECOGNITION_LANGUAGES_DOWNLOADED,
/// Stores which Translator API language packs the site has initialized.
CEF_CONTENT_SETTING_TYPE_INITIALIZED_TRANSLATIONS,
/// Stores a list of notification ids where content detection found the
/// notification to be suspicious and a warning has already been shown for the
/// site. Used for recovering notification contents from the database if the
/// user decides they would like to see all of these notifications.
CEF_CONTENT_SETTING_TYPE_SUSPICIOUS_NOTIFICATION_IDS,
#endif
CEF_CONTENT_SETTING_TYPE_NUM_VALUES,
} cef_content_setting_types_t;

View File

@@ -567,9 +567,7 @@ struct CefBrowserSettingsTraits {
target->text_area_resize = src->text_area_resize;
target->tab_to_links = src->tab_to_links;
target->local_storage = src->local_storage;
#if !CEF_API_ADDED(13800)
target->databases = src->databases;
#endif
target->webgl = src->webgl;
target->background_color = src->background_color;

View File

@@ -1,151 +0,0 @@
// Copyright (c) 2025 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file are only available to applications that link
// against the libcef_dll_wrapper target.
//
#ifndef CEF_INCLUDE_WRAPPER_CEF_CERTIFICATE_UTIL_WIN_H_
#define CEF_INCLUDE_WRAPPER_CEF_CERTIFICATE_UTIL_WIN_H_
#pragma once
#include <windows.h>
#include <string>
#include <vector>
namespace cef_certificate_util {
// SHA1 upper-case hex encoded = 40 characters.
inline constexpr size_t kThumbprintLength = 40U;
///
/// Structure populated by GetClientThumbprints().
///
struct ThumbprintsInfo {
///
/// True if one or more signatures exist and all are valid.
///
bool IsSignedAndValid() const {
return !valid_thumbprints.empty() && errors.empty();
}
///
/// True if unsigned, or if one or more signatures exist and all are valid.
///
bool IsUnsignedOrValid() const {
return !has_signature || IsSignedAndValid();
}
///
/// True if this and |other| have the same signature status. If
/// |allow_unsigned| is true then both may be unsigned. Otherwise, one or more
/// signatures must exist, all must be valid, and the primary fingerprint must
/// be the same for both.
///
bool IsSame(const ThumbprintsInfo& other, bool allow_unsigned) const {
if (allow_unsigned && !has_signature && !other.has_signature) {
return true;
}
return IsSignedAndValid() &&
other.HasPrimaryThumbprint(valid_thumbprints[0]);
}
///
/// True if a valid primary signature exists and it matches the specified
/// |thumbprint|.
///
bool HasPrimaryThumbprint(const std::string& thumbprint) const {
return IsSignedAndValid() && valid_thumbprints[0] == thumbprint;
}
///
/// True if a primary signature exists, irrespective of validity.
///
bool has_signature = false;
///
/// Thumbprints for signatures, if any, that passed verification.
///
std::vector<std::string> valid_thumbprints;
///
/// Thumbprints for signatures, if any, that failed verification. Will not be
/// populated if |verify_binary=true| was passed to GetClientThumbprints().
///
std::vector<std::string> invalid_thumbprints;
///
/// Errors (newline delimited) if any signatures failed verification.
///
std::wstring errors;
};
///
/// Process client signatures for the binary at the specified abolute
/// |binary_path| and populate |info|. If |verify_binary| is true and the
/// primary signature fails verification then no further signatures will be
/// processed. For a code signing example and usage details see
/// https://github.com/chromiumembedded/cef/issues/3824#issuecomment-2892139995
///
void GetClientThumbprints(const std::wstring& binary_path,
bool verify_binary,
ThumbprintsInfo& info);
///
/// Evaluate the binary at the specified absolute |binary_path| for common
/// requirements and populate |info|. If the binary is code signed then all
/// signatures must be valid. If |thumbprint| is a SHA1 hash (e.g. 40 character
/// upper-case hex-encoded value) then the primary signature must match that
/// thumbprint. If |allow_unsigned| is true and |thumbprint| is nullptr then the
/// binary may be unsigned, otherwise it must be validly signed. Returns true if
/// all requirements are met.
///
bool ValidateCodeSigning(const std::wstring& binary_path,
const char* thumbprint,
bool allow_unsigned,
ThumbprintsInfo& info);
///
/// Same as ValidateCodeSigning, but failures result in a FATAL error and
/// application termination. Optionally populate |info| is validation succeeds.
/// Usage must be protected by cef::logging::ScopedEarlySupport if called prior
/// to libcef loading.
///
void ValidateCodeSigningAssert(const std::wstring& binary_path,
const char* thumbprint,
bool allow_unsigned,
ThumbprintsInfo* info = nullptr);
} // namespace cef_certificate_util
#endif // CEF_INCLUDE_WRAPPER_CEF_CERTIFICATE_UTIL_WIN_H_

View File

@@ -33,11 +33,11 @@
#include "include/base/cef_build.h"
#if defined(OS_MAC)
#ifdef __cplusplus
#include <string>
extern "C" {
#endif
#endif // __cplusplus
///
/// Load the CEF library at the specified |path|. Returns true (1) on
@@ -53,12 +53,6 @@ int cef_unload_library(void);
#ifdef __cplusplus
}
#endif
#endif // defined(OS_MAC)
#ifdef __cplusplus
#include <string>
#if defined(OS_MAC)
@@ -90,8 +84,7 @@ int cef_unload_library(void);
/// #include "include/wrapper/cef_library_loader.h"
///
/// int main(int argc, char* argv[]) {
/// // Dynamically load and initialize the macOS sandbox for this helper
/// // process.
/// // Initialize the macOS sandbox for this helper process.
/// CefScopedSandboxContext sandbox_context;
/// if (!sandbox_context.Initialize(argc, argv))
/// return 1;
@@ -105,7 +98,7 @@ int cef_unload_library(void);
/// }
/// </pre>
///
class CefScopedLibraryLoader final {
class CefScopedLibraryLoader {
public:
CefScopedLibraryLoader();
@@ -131,101 +124,10 @@ class CefScopedLibraryLoader final {
private:
bool Load(bool helper);
bool loaded_ = false;
bool loaded_;
};
#elif defined(OS_WIN)
#include <windows.h>
#include "include/cef_version_info.h"
///
/// Scoped helper for loading the CEF library at runtime from a specific
/// location on disk. Can optionally be used to verify code signing status and
/// Chromium version compatibility at the same time. Binaries using this helper
/// must be built with the "/DELAYLOAD:libcef.dll" linker flag.
///
/// Example usage:
///
/// <pre>
/// #include "include/wrapper/cef_library_loader.h"
///
/// int APIENTRY wWinMain(HINSTANCE hInstance,
/// HINSTANCE hPrevInstance,
/// LPTSTR lpCmdLine,
/// int nCmdShow)
/// // Version that was used to compile the CEF client app.
/// cef_version_info_t version_info = {};
/// CEF_POPULATE_VERSION_INFO(&version_info);
///
/// // Dynamically load libcef.dll from the specified location, and verify
/// // that the Chromium version is compatible. Any failures will
/// // intentionally crash the application. All CEF distribution resources
/// // (DLLs, pak, etc) must be located in the same directory.
/// CefScopedLibraryLoader library_loader;
/// if (!library_loader.LoadInSubProcessAssert(&version_info)) {
/// // Not running as a potentially sandboxed sub-process.
/// // Choose the appropriate path for loading libcef.dll...
/// const wchar_t* path = L"c:\\path\\to\\myapp\\cef\\libcef.dll";
/// if (!library_loader.LoadInMainAssert(path, nullptr, true,
/// &version_info)) {
/// // The load failed. We'll crash before reaching this line.
/// NOTREACHED();
/// return CEF_RESULT_CODE_KILLED;
/// }
/// }
///
/// // Continue with CEF initialization...
/// }
/// </pre>
///
class CefScopedLibraryLoader final {
public:
CefScopedLibraryLoader();
CefScopedLibraryLoader(const CefScopedLibraryLoader&) = delete;
CefScopedLibraryLoader& operator=(const CefScopedLibraryLoader&) = delete;
~CefScopedLibraryLoader();
///
/// Load the CEF library (libcef.dll) in the main process from the specified
/// absolute path. If libcef.dll is code signed then all signatures must be
/// valid. If |thumbprint| is a SHA1 hash (e.g. 40 character upper-case
/// hex-encoded value) then the primary signature must match that thumbprint.
/// If |allow_unsigned| is true and |thumbprint| is nullptr then libcef.dll
/// may be unsigned, otherwise it must be validly signed. Failure of code
/// signing requirements or DLL loading will result in a FATAL error and
/// application termination. If |version_info| is specified then the
/// libcef.dll version information must also match. Returns true if the load
/// succeeds. Usage must be protected by cef::logging::ScopedEarlySupport.
///
bool LoadInMainAssert(const wchar_t* dll_path,
const char* thumbprint,
bool allow_unsigned,
cef_version_info_t* version_info);
///
/// Load the CEF library (libcef.dll) in a sub-process that may be sandboxed.
/// The path will be determined based on command-line arguments for the
/// current process. Failure of DLL loading will result in a FATAL error and
/// application termination. If |version_info| is specified then the
/// libcef.dll version information must match. Returns true if the load
/// succeeds. Usage must be protected by cef::logging::ScopedEarlySupport.
///
bool LoadInSubProcessAssert(cef_version_info_t* version_info);
private:
HMODULE handle_ = nullptr;
};
namespace switches {
// Changes to this value require rebuilding libcef.dll.
inline constexpr char kLibcefPath[] = "libcef-path";
inline constexpr wchar_t kLibcefPathW[] = L"libcef-path";
} // namespace switches
#endif // defined(OS_WIN)
#endif // defined(OS_MAC)
#endif // __cplusplus
#endif // CEF_INCLUDE_WRAPPER_CEF_LIBRARY_LOADER_H_

View File

@@ -1,65 +0,0 @@
// Copyright (c) 2025 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file are only available to applications that link
// against the libcef_dll_wrapper target.
//
#ifndef CEF_INCLUDE_WRAPPER_CEF_UTIL_WIN_H_
#define CEF_INCLUDE_WRAPPER_CEF_UTIL_WIN_H_
#pragma once
#include <windows.h>
#include <string>
#include <vector>
namespace cef_util {
// Returns the fully qualified file path for the executable module.
std::wstring GetExePath();
// Returns the fully qualified file path for |module|.
std::wstring GetModulePath(HMODULE module);
// Returns the value of GetLastError() as a string.
std::wstring GetLastErrorAsString();
// Parse command line arguments for |hInstance|.
std::vector<std::wstring> ParseCommandLineArgs(const wchar_t* str);
// Returns the value for |name| in |command_line|, if any.
std::wstring GetCommandLineValue(const std::vector<std::wstring>& command_line,
const std::wstring& name);
} // namespace cef_util
#endif // CEF_INCLUDE_WRAPPER_CEF_UTIL_WIN_H_

View File

@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "cef/include/wrapper/cef_library_loader.h"
#include "cef/libcef/browser/browser_frame.h"
#include "cef/libcef/browser/browser_host_base.h"
#include "cef/libcef/browser/browser_info_manager.h"
@@ -51,10 +50,6 @@
#include "cef/libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "cef/libcef_dll/bootstrap/bootstrap_util_win.h"
#endif
namespace {
class CefSelectClientCertificateCallbackImpl
@@ -165,18 +160,6 @@ void HandleExternalProtocolHelper(
isolation_info, nullptr);
}
#if BUILDFLAG(IS_WIN)
// Returns the module handle that contains this code (e.g. libcef.dll).
HINSTANCE GetCodeModuleHandle() {
HMODULE hModule = nullptr;
CHECK(::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCWSTR>(GetCodeModuleHandle),
&hModule));
return hModule;
}
#endif
} // namespace
ChromeContentBrowserClientCef::ChromeContentBrowserClientCef() = default;
@@ -231,23 +214,6 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
}
#if BUILDFLAG(IS_WIN)
{
const auto& exe_path = bootstrap_util::GetExePath();
const auto& module_value =
bootstrap_util::GetValidatedModuleValue(*browser_cmd, exe_path);
if (!module_value.empty()) {
command_line->AppendSwitchNative(bootstrap_util::switches::kModule,
module_value);
}
const auto& libcef_path =
bootstrap_util::GetModulePath(GetCodeModuleHandle());
if (libcef_path.DirName() != exe_path.DirName()) {
command_line->AppendSwitchPath(switches::kLibcefPath, libcef_path);
}
}
#endif
const std::string& process_type =
command_line->GetSwitchValueASCII(switches::kProcessType);
@@ -588,10 +554,13 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol(
return true;
}
void ChromeContentBrowserClientCef::CreateThrottlesForNavigation(
content::NavigationThrottleRegistry& registry) {
ChromeContentBrowserClient::CreateThrottlesForNavigation(registry);
throttle::CreateThrottlesForNavigation(registry);
std::vector<std::unique_ptr<content::NavigationThrottle>>
ChromeContentBrowserClientCef::CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) {
auto throttles = ChromeContentBrowserClient::CreateThrottlesForNavigation(
navigation_handle);
throttle::CreateThrottlesForNavigation(navigation_handle, throttles);
return throttles;
}
bool ChromeContentBrowserClientCef::ConfigureNetworkContextParams(

View File

@@ -113,8 +113,9 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
const net::IsolationInfo& isolation_info,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
void CreateThrottlesForNavigation(
content::NavigationThrottleRegistry& registry) override;
std::vector<std::unique_ptr<content::NavigationThrottle>>
CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) override;
bool ConfigureNetworkContextParams(
content::BrowserContext* context,
bool in_memory,

View File

@@ -22,9 +22,9 @@
#include "ui/base/ui_base_switches.h"
#if BUILDFLAG(IS_WIN)
#include "base/debug/alias.h"
#include "base/strings/utf_string_conversions.h"
#include "cef/include/internal/cef_win.h"
#include "cef/libcef/browser/preferred_stack_size_win.inc"
#include "chrome/chrome_elf/chrome_elf_main.h"
#include "chrome/install_static/initialize_from_primary_module.h"
#endif
@@ -185,6 +185,110 @@ base::FilePath NormalizeCachePathAndSet(cef_string_t& path_str,
return path;
}
// Based on chrome/app/chrome_exe_main_win.cc.
// In 32-bit builds, the main thread starts with the default (small) stack size.
// The ARCH_CPU_32_BITS blocks here and below are in support of moving the main
// thread to a fiber with a larger stack size.
#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_32_BITS)
// The information needed to transfer control to the large-stack fiber and later
// pass the main routine's exit code back to the small-stack fiber prior to
// termination.
struct FiberState {
FiberState(wWinMainPtr wWinMain,
HINSTANCE hInstance,
LPWSTR lpCmdLine,
int nCmdShow) {
this->wWinMain = wWinMain;
this->hInstance = hInstance;
this->lpCmdLine = lpCmdLine;
this->nCmdShow = nCmdShow;
}
FiberState(mainPtr main, int argc, char** argv) {
this->main = main;
this->argc = argc;
this->argv = argv;
}
wWinMainPtr wWinMain = nullptr;
HINSTANCE hInstance;
LPWSTR lpCmdLine;
int nCmdShow;
mainPtr main = nullptr;
int argc;
char** argv;
LPVOID original_fiber;
int fiber_result;
};
// A PFIBER_START_ROUTINE function run on a large-stack fiber that calls the
// main routine, stores its return value, and returns control to the small-stack
// fiber. |params| must be a pointer to a FiberState struct.
void WINAPI FiberBinder(void* params) {
auto* fiber_state = static_cast<FiberState*>(params);
// Call the main routine from the fiber. Reusing the entry point minimizes
// confusion when examining call stacks in crash reports - seeing wWinMain on
// the stack is a handy hint that this is the main thread of the process.
if (fiber_state->main) {
fiber_state->fiber_result =
fiber_state->main(fiber_state->argc, fiber_state->argv);
} else {
fiber_state->fiber_result =
fiber_state->wWinMain(fiber_state->hInstance, nullptr,
fiber_state->lpCmdLine, fiber_state->nCmdShow);
}
// Switch back to the main thread to exit.
::SwitchToFiber(fiber_state->original_fiber);
}
int RunMainWithPreferredStackSize(FiberState& fiber_state) {
enum class FiberStatus { kConvertFailed, kCreateFiberFailed, kSuccess };
FiberStatus fiber_status = FiberStatus::kSuccess;
// GetLastError result if fiber conversion failed.
DWORD fiber_error = ERROR_SUCCESS;
if (!::IsThreadAFiber()) {
// Make the main thread's stack size 4 MiB so that it has roughly the same
// effective size as the 64-bit build's 8 MiB stack.
constexpr size_t kStackSize = 4 * 1024 * 1024; // 4 MiB
// Leak the fiber on exit.
LPVOID original_fiber =
::ConvertThreadToFiberEx(nullptr, FIBER_FLAG_FLOAT_SWITCH);
if (original_fiber) {
fiber_state.original_fiber = original_fiber;
// Create a fiber with a bigger stack and switch to it. Leak the fiber on
// exit.
LPVOID big_stack_fiber = ::CreateFiberEx(
0, kStackSize, FIBER_FLAG_FLOAT_SWITCH, FiberBinder, &fiber_state);
if (big_stack_fiber) {
::SwitchToFiber(big_stack_fiber);
// The fibers must be cleaned up to avoid obscure TLS-related shutdown
// crashes.
::DeleteFiber(big_stack_fiber);
::ConvertFiberToThread();
// Control returns here after CEF has finished running on FiberMain.
return fiber_state.fiber_result;
}
fiber_status = FiberStatus::kCreateFiberFailed;
} else {
fiber_status = FiberStatus::kConvertFailed;
}
// If we reach here then creating and switching to a fiber has failed. This
// probably means we are low on memory and will soon crash. Try to report
// this error once crash reporting is initialized.
fiber_error = ::GetLastError();
base::debug::Alias(&fiber_error);
}
// If we are already a fiber then continue normal execution.
// Intentionally crash if converting to a fiber failed.
CHECK_EQ(fiber_status, FiberStatus::kSuccess);
return -1;
}
#endif // BUILDFLAG(IS_WIN) && defined(ARCH_CPU_32_BITS)
} // namespace
NO_STACK_PROTECTOR
@@ -314,6 +418,23 @@ void CefQuitMessageLoop() {
#if BUILDFLAG(IS_WIN)
#if defined(ARCH_CPU_32_BITS)
int CefRunWinMainWithPreferredStackSize(wWinMainPtr wWinMain,
HINSTANCE hInstance,
LPWSTR lpCmdLine,
int nCmdShow) {
CHECK(wWinMain && hInstance);
FiberState fiber_state(wWinMain, hInstance, lpCmdLine, nCmdShow);
return RunMainWithPreferredStackSize(fiber_state);
}
int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
CHECK(main);
FiberState fiber_state(main, argc, argv);
return RunMainWithPreferredStackSize(fiber_state);
}
#endif // defined(ARCH_CPU_32_BITS)
void CefSetOSModalLoop(bool osModalLoop) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {

View File

@@ -1,55 +0,0 @@
// Copyright 2020 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cef/libcef/browser/crashpad_runner.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/crashpad/crashpad/handler/handler_main.h"
namespace crashpad_runner {
// Based on components/crash/core/app/run_as_crashpad_handler_win.cc
int RunAsCrashpadHandler(const base::CommandLine& command_line) {
// Remove the "--type=crashpad-handler" command-line flag that will otherwise
// confuse the crashpad handler.
base::CommandLine::StringVector argv = command_line.argv();
const base::CommandLine::StringType process_type =
FILE_PATH_LITERAL("--type=");
argv.erase(
std::remove_if(argv.begin(), argv.end(),
[&process_type](const base::CommandLine::StringType& str) {
return base::StartsWith(str, process_type,
base::CompareCase::SENSITIVE) ||
(!str.empty() && str[0] == L'/');
}),
argv.end());
#if BUILDFLAG(IS_POSIX)
// HandlerMain on POSIX uses the system version of getopt_long which expects
// the first argument to be the program name.
argv.insert(argv.begin(), command_line.GetProgram().value());
#endif
std::unique_ptr<char*[]> argv_as_utf8(new char*[argv.size() + 1]);
std::vector<std::string> storage;
storage.reserve(argv.size());
for (size_t i = 0; i < argv.size(); ++i) {
#if BUILDFLAG(IS_WIN)
storage.push_back(base::WideToUTF8(argv[i]));
#else
storage.push_back(argv[i]);
#endif
argv_as_utf8[i] = &storage[i][0];
}
argv_as_utf8[argv.size()] = nullptr;
argv.clear();
return crashpad::HandlerMain(static_cast<int>(storage.size()),
argv_as_utf8.get(), nullptr);
}
} // namespace crashpad_runner

View File

@@ -1,22 +0,0 @@
// Copyright 2020 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_CRASHPAD_RUNNER_H_
#define CEF_LIBCEF_BROWSER_CRASHPAD_RUNNER_H_
#include "base/command_line.h"
namespace crashpad_runner {
// Chrome uses an embedded crashpad handler on Windows only and imports this
// function via the existing "run_as_crashpad_handler" target defined in
// components/crash/core/app/BUILD.gn. CEF uses an embedded handler on all
// platforms so we define the function here instead of using the existing
// target (because we can't use that target on macOS).
int RunAsCrashpadHandler(const base::CommandLine& command_line);
} // namespace crashpad_runner
#endif // CEF_LIBCEF_BROWSER_CRASHPAD_RUNNER_H_

View File

@@ -13,7 +13,6 @@
#include "base/synchronization/waitable_event.h"
#include "cef/libcef/browser/browser_message_loop.h"
#include "cef/libcef/browser/chrome/chrome_content_browser_client_cef.h"
#include "cef/libcef/browser/crashpad_runner.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/common/app_manager.h"
#include "cef/libcef/common/cef_switches.h"
@@ -29,6 +28,7 @@
#include "content/public/app/content_main.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "third_party/crashpad/crashpad/handler/handler_main.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
@@ -41,6 +41,54 @@
#include "sandbox/win/src/sandbox_types.h"
#endif
namespace {
// Based on components/crash/core/app/run_as_crashpad_handler_win.cc
// Remove the "--type=crashpad-handler" command-line flag that will otherwise
// confuse the crashpad handler.
// Chrome uses an embedded crashpad handler on Windows only and imports this
// function via the existing "run_as_crashpad_handler" target defined in
// components/crash/core/app/BUILD.gn. CEF uses an embedded handler on all
// platforms so we define the function here instead of using the existing
// target (because we can't use that target on macOS).
int RunAsCrashpadHandler(const base::CommandLine& command_line) {
base::CommandLine::StringVector argv = command_line.argv();
const base::CommandLine::StringType process_type =
FILE_PATH_LITERAL("--type=");
argv.erase(
std::remove_if(argv.begin(), argv.end(),
[&process_type](const base::CommandLine::StringType& str) {
return base::StartsWith(str, process_type,
base::CompareCase::SENSITIVE) ||
(!str.empty() && str[0] == L'/');
}),
argv.end());
#if BUILDFLAG(IS_POSIX)
// HandlerMain on POSIX uses the system version of getopt_long which expects
// the first argument to be the program name.
argv.insert(argv.begin(), command_line.GetProgram().value());
#endif
std::unique_ptr<char*[]> argv_as_utf8(new char*[argv.size() + 1]);
std::vector<std::string> storage;
storage.reserve(argv.size());
for (size_t i = 0; i < argv.size(); ++i) {
#if BUILDFLAG(IS_WIN)
storage.push_back(base::WideToUTF8(argv[i]));
#else
storage.push_back(argv[i]);
#endif
argv_as_utf8[i] = &storage[i][0];
}
argv_as_utf8[argv.size()] = nullptr;
argv.clear();
return crashpad::HandlerMain(static_cast<int>(storage.size()),
argv_as_utf8.get(), nullptr);
}
} // namespace
CefMainRunner::CefMainRunner(bool multi_threaded_message_loop,
bool external_message_pump)
: multi_threaded_message_loop_(multi_threaded_message_loop),
@@ -179,15 +227,10 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args,
// If no process type is specified then it represents the browser process and
// we do nothing.
if (!command_line.HasSwitch(switches::kProcessType)) {
return -1;
}
const std::string& process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
if (process_type.empty()) {
// Early exit on invalid process type.
return CEF_RESULT_CODE_BAD_PROCESS_TYPE;
return -1;
}
auto main_delegate = std::make_unique<ChromeMainDelegateCef>(
@@ -195,7 +238,7 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args,
BeforeMainInitialize(args);
if (process_type == crash_reporter::switches::kCrashpadHandler) {
return crashpad_runner::RunAsCrashpadHandler(command_line);
return RunAsCrashpadHandler(command_line);
}
// Execute the secondary process.

View File

@@ -92,19 +92,19 @@ void NavigationOnUIThread(
} // namespace
void CreateThrottlesForNavigation(
content::NavigationThrottleRegistry& registry) {
void CreateThrottlesForNavigation(content::NavigationHandle* navigation_handle,
NavigationThrottleList& throttles) {
CEF_REQUIRE_UIT();
// Must use SynchronyMode::kSync to ensure that OnBeforeBrowse is always
// called before OnBeforeResourceLoad.
std::unique_ptr<content::NavigationThrottle> throttle =
std::make_unique<navigation_interception::InterceptNavigationThrottle>(
registry, base::BindRepeating(&NavigationOnUIThread),
navigation_handle, base::BindRepeating(&NavigationOnUIThread),
navigation_interception::SynchronyMode::kSync, std::nullopt);
// Always execute our throttle first.
registry.AddThrottle(std::move(throttle), /*first=*/true);
throttles.emplace(throttles.begin(), std::move(throttle));
}
} // namespace throttle

View File

@@ -6,14 +6,21 @@
#define CEF_LIBCEF_BROWSER_NET_THROTTLE_HANDLER_H_
#pragma once
#include <memory>
#include <vector>
namespace content {
class NavigationThrottleRegistry;
class NavigationHandle;
class NavigationThrottle;
} // namespace content
namespace throttle {
void CreateThrottlesForNavigation(
content::NavigationThrottleRegistry& registry);
using NavigationThrottleList =
std::vector<std::unique_ptr<content::NavigationThrottle>>;
void CreateThrottlesForNavigation(content::NavigationHandle* navigation_handle,
NavigationThrottleList& throttles);
} // namespace throttle

View File

@@ -443,9 +443,7 @@ void CefRenderWidgetHostViewOSR::Hide() {
}
if (render_widget_host_) {
if (render_widget_host_->delegate()) {
render_widget_host_->WasHidden();
}
render_widget_host_->WasHidden();
auto provider = content::RenderWidgetHostImpl::From(render_widget_host_)
->render_frame_metadata_provider();

View File

@@ -187,7 +187,7 @@ void CefVideoConsumerOSR::OnFrameCaptured(
view_->OnAcceleratedPaint(damage_rect, info->coded_size, paint_info);
#elif BUILDFLAG(IS_LINUX)
auto& gmb_handle = data->get_gpu_memory_buffer_handle();
auto& native_pixmap = gmb_handle.native_pixmap_handle();
auto& native_pixmap = gmb_handle.native_pixmap_handle;
CHECK(native_pixmap.planes.size() <= kAcceleratedPaintMaxPlanes);
cef_accelerated_paint_info_t paint_info;

View File

@@ -1,129 +0,0 @@
#include "build/build_config.h"
// Based on chrome/app/chrome_exe_main_win.cc.
// In 32-bit builds, the main thread starts with the default (small) stack size.
// The ARCH_CPU_32_BITS blocks here and below are in support of moving the main
// thread to a fiber with a larger stack size.
#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_32_BITS)
#include "base/debug/alias.h"
#include "include/internal/cef_app_win.h"
namespace {
// The information needed to transfer control to the large-stack fiber and later
// pass the main routine's exit code back to the small-stack fiber prior to
// termination.
struct FiberState {
FiberState(wWinMainPtr wWinMain,
HINSTANCE hInstance,
LPWSTR lpCmdLine,
int nCmdShow) {
this->wWinMain = wWinMain;
this->hInstance = hInstance;
this->lpCmdLine = lpCmdLine;
this->nCmdShow = nCmdShow;
}
FiberState(mainPtr main, int argc, char** argv) {
this->main = main;
this->argc = argc;
this->argv = argv;
}
wWinMainPtr wWinMain = nullptr;
HINSTANCE hInstance;
LPWSTR lpCmdLine;
int nCmdShow;
mainPtr main = nullptr;
int argc;
char** argv;
LPVOID original_fiber;
int fiber_result;
};
// A PFIBER_START_ROUTINE function run on a large-stack fiber that calls the
// main routine, stores its return value, and returns control to the small-stack
// fiber. |params| must be a pointer to a FiberState struct.
void WINAPI FiberBinder(void* params) {
auto* fiber_state = static_cast<FiberState*>(params);
// Call the main routine from the fiber. Reusing the entry point minimizes
// confusion when examining call stacks in crash reports - seeing wWinMain on
// the stack is a handy hint that this is the main thread of the process.
if (fiber_state->main) {
fiber_state->fiber_result =
fiber_state->main(fiber_state->argc, fiber_state->argv);
} else {
fiber_state->fiber_result =
fiber_state->wWinMain(fiber_state->hInstance, nullptr,
fiber_state->lpCmdLine, fiber_state->nCmdShow);
}
// Switch back to the main thread to exit.
::SwitchToFiber(fiber_state->original_fiber);
}
int RunMainWithPreferredStackSize(FiberState& fiber_state) {
enum class FiberStatus { kConvertFailed, kCreateFiberFailed, kSuccess };
FiberStatus fiber_status = FiberStatus::kSuccess;
// GetLastError result if fiber conversion failed.
DWORD fiber_error = ERROR_SUCCESS;
if (!::IsThreadAFiber()) {
// Make the main thread's stack size 4 MiB so that it has roughly the same
// effective size as the 64-bit build's 8 MiB stack.
constexpr size_t kStackSize = 4 * 1024 * 1024; // 4 MiB
// Leak the fiber on exit.
LPVOID original_fiber =
::ConvertThreadToFiberEx(nullptr, FIBER_FLAG_FLOAT_SWITCH);
if (original_fiber) {
fiber_state.original_fiber = original_fiber;
// Create a fiber with a bigger stack and switch to it. Leak the fiber on
// exit.
LPVOID big_stack_fiber = ::CreateFiberEx(
0, kStackSize, FIBER_FLAG_FLOAT_SWITCH, FiberBinder, &fiber_state);
if (big_stack_fiber) {
::SwitchToFiber(big_stack_fiber);
// The fibers must be cleaned up to avoid obscure TLS-related shutdown
// crashes.
::DeleteFiber(big_stack_fiber);
::ConvertFiberToThread();
// Control returns here after CEF has finished running on FiberMain.
return fiber_state.fiber_result;
}
fiber_status = FiberStatus::kCreateFiberFailed;
} else {
fiber_status = FiberStatus::kConvertFailed;
}
// If we reach here then creating and switching to a fiber has failed. This
// probably means we are low on memory and will soon crash. Try to report
// this error once crash reporting is initialized.
fiber_error = ::GetLastError();
base::debug::Alias(&fiber_error);
}
// If we are already a fiber then continue normal execution.
// Intentionally crash if converting to a fiber failed.
CHECK_EQ(fiber_status, FiberStatus::kSuccess);
return -1;
}
} // namespace
int CefRunWinMainWithPreferredStackSize(wWinMainPtr wWinMain,
HINSTANCE hInstance,
LPWSTR lpCmdLine,
int nCmdShow) {
CHECK(wWinMain && hInstance);
FiberState fiber_state(wWinMain, hInstance, lpCmdLine, nCmdShow);
return RunMainWithPreferredStackSize(fiber_state);
}
int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
CHECK(main);
FiberState fiber_state(main, argc, argv);
return RunMainWithPreferredStackSize(fiber_state);
}
#endif // BUILDFLAG(IS_WIN) && defined(ARCH_CPU_32_BITS)

View File

@@ -93,6 +93,7 @@ void SetCefPrefs(const CefBrowserSettings& cef,
SET_STATE(cef.text_area_resize, web.text_areas_are_resizable);
SET_STATE(cef.tab_to_links, web.tabs_to_links);
SET_STATE(cef.local_storage, web.local_storage_enabled);
SET_STATE(cef.databases, web.databases_enabled);
// Never explicitly enable GPU-related functions in this method because the
// GPU blacklist is not being checked here.

View File

@@ -530,18 +530,14 @@ CefRefPtr<CefValue> CefRequestContextImpl::GetWebsiteSetting(
return nullptr;
}
const auto setting_type = setting_helper::FromCefType(content_type);
if (!setting_type) {
return nullptr;
}
// Either or both URLs may be invalid.
GURL requesting_gurl(requesting_url.ToString());
GURL top_level_gurl(top_level_url.ToString());
content_settings::SettingInfo info;
base::Value value = settings_map->GetWebsiteSetting(
requesting_gurl, top_level_gurl, *setting_type, &info);
requesting_gurl, top_level_gurl,
static_cast<ContentSettingsType>(content_type), &info);
if (value.is_none()) {
return nullptr;
}
@@ -580,22 +576,19 @@ cef_content_setting_values_t CefRequestContextImpl::GetContentSetting(
return CEF_CONTENT_SETTING_VALUE_DEFAULT;
}
const auto setting_type = setting_helper::FromCefType(content_type);
if (!setting_type) {
return CEF_CONTENT_SETTING_VALUE_DEFAULT;
}
ContentSetting value = ContentSetting::CONTENT_SETTING_DEFAULT;
if (requesting_url.empty() && top_level_url.empty()) {
value = settings_map->GetDefaultContentSetting(*setting_type,
/*provider_id=*/nullptr);
value = settings_map->GetDefaultContentSetting(
static_cast<ContentSettingsType>(content_type),
/*provider_id=*/nullptr);
} else {
GURL requesting_gurl(requesting_url.ToString());
GURL top_level_gurl(top_level_url.ToString());
if (requesting_gurl.is_valid() || top_level_gurl.is_valid()) {
value = settings_map->GetContentSetting(requesting_gurl, top_level_gurl,
*setting_type);
value = settings_map->GetContentSetting(
requesting_gurl, top_level_gurl,
static_cast<ContentSettingsType>(content_type));
}
}
@@ -908,11 +901,6 @@ void CefRequestContextImpl::SetWebsiteSettingInternal(
return;
}
const auto setting_type = setting_helper::FromCefType(content_type);
if (!setting_type) {
return;
}
// Starts as a NONE value.
base::Value new_value;
if (value && value->IsValid()) {
@@ -922,13 +910,14 @@ void CefRequestContextImpl::SetWebsiteSettingInternal(
if (requesting_url.empty() && top_level_url.empty()) {
settings_map->SetWebsiteSettingCustomScope(
ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
*setting_type, std::move(new_value));
static_cast<ContentSettingsType>(content_type), std::move(new_value));
} else {
GURL requesting_gurl(requesting_url.ToString());
GURL top_level_gurl(top_level_url.ToString());
if (requesting_gurl.is_valid() || top_level_gurl.is_valid()) {
settings_map->SetWebsiteSettingDefaultScope(
requesting_gurl, top_level_gurl, *setting_type, std::move(new_value));
requesting_gurl, top_level_gurl,
static_cast<ContentSettingsType>(content_type), std::move(new_value));
}
}
}
@@ -950,20 +939,17 @@ void CefRequestContextImpl::SetContentSettingInternal(
return;
}
const auto setting_type = setting_helper::FromCefType(content_type);
if (!setting_type) {
return;
}
if (requesting_url.empty() && top_level_url.empty()) {
settings_map->SetDefaultContentSetting(*setting_type,
static_cast<ContentSetting>(value));
settings_map->SetDefaultContentSetting(
static_cast<ContentSettingsType>(content_type),
static_cast<ContentSetting>(value));
} else {
GURL requesting_gurl(requesting_url.ToString());
GURL top_level_gurl(top_level_url.ToString());
if (requesting_gurl.is_valid() || top_level_gurl.is_valid()) {
settings_map->SetContentSettingDefaultScope(
requesting_gurl, top_level_gurl, *setting_type,
requesting_gurl, top_level_gurl,
static_cast<ContentSettingsType>(content_type),
static_cast<ContentSetting>(value));
}
}

View File

@@ -107,283 +107,12 @@ void Registrar::OnContentSettingChanged(
const CefString requesting_url(primary_pattern.ToRepresentativeUrl().spec());
const CefString top_level_url(secondary_pattern.ToRepresentativeUrl().spec());
const auto content_type = ToCefType(content_type_set.GetType());
const auto content_type =
static_cast<cef_content_setting_types_t>(content_type_set.GetType());
for (Registration& registration : observers_) {
registration.RunCallback(requesting_url, top_level_url, content_type);
}
}
#define TO_CEF_TYPE(name) \
case ContentSettingsType::name: \
return CEF_CONTENT_SETTING_TYPE_##name
cef_content_setting_types_t ToCefType(ContentSettingsType type) {
switch (type) {
TO_CEF_TYPE(COOKIES);
TO_CEF_TYPE(IMAGES);
TO_CEF_TYPE(JAVASCRIPT);
TO_CEF_TYPE(POPUPS);
TO_CEF_TYPE(GEOLOCATION);
TO_CEF_TYPE(NOTIFICATIONS);
TO_CEF_TYPE(AUTO_SELECT_CERTIFICATE);
TO_CEF_TYPE(MIXEDSCRIPT);
TO_CEF_TYPE(MEDIASTREAM_MIC);
TO_CEF_TYPE(MEDIASTREAM_CAMERA);
TO_CEF_TYPE(PROTOCOL_HANDLERS);
TO_CEF_TYPE(DEPRECATED_PPAPI_BROKER);
TO_CEF_TYPE(AUTOMATIC_DOWNLOADS);
TO_CEF_TYPE(MIDI_SYSEX);
TO_CEF_TYPE(SSL_CERT_DECISIONS);
TO_CEF_TYPE(PROTECTED_MEDIA_IDENTIFIER);
TO_CEF_TYPE(APP_BANNER);
TO_CEF_TYPE(SITE_ENGAGEMENT);
TO_CEF_TYPE(DURABLE_STORAGE);
TO_CEF_TYPE(USB_CHOOSER_DATA);
TO_CEF_TYPE(BLUETOOTH_GUARD);
TO_CEF_TYPE(BACKGROUND_SYNC);
TO_CEF_TYPE(AUTOPLAY);
TO_CEF_TYPE(IMPORTANT_SITE_INFO);
TO_CEF_TYPE(PERMISSION_AUTOBLOCKER_DATA);
TO_CEF_TYPE(ADS);
TO_CEF_TYPE(ADS_DATA);
TO_CEF_TYPE(MIDI);
TO_CEF_TYPE(PASSWORD_PROTECTION);
TO_CEF_TYPE(MEDIA_ENGAGEMENT);
TO_CEF_TYPE(SOUND);
TO_CEF_TYPE(CLIENT_HINTS);
TO_CEF_TYPE(SENSORS);
TO_CEF_TYPE(DEPRECATED_ACCESSIBILITY_EVENTS);
TO_CEF_TYPE(PAYMENT_HANDLER);
TO_CEF_TYPE(USB_GUARD);
TO_CEF_TYPE(BACKGROUND_FETCH);
TO_CEF_TYPE(INTENT_PICKER_DISPLAY);
TO_CEF_TYPE(IDLE_DETECTION);
TO_CEF_TYPE(SERIAL_GUARD);
TO_CEF_TYPE(SERIAL_CHOOSER_DATA);
TO_CEF_TYPE(PERIODIC_BACKGROUND_SYNC);
TO_CEF_TYPE(BLUETOOTH_SCANNING);
TO_CEF_TYPE(HID_GUARD);
TO_CEF_TYPE(HID_CHOOSER_DATA);
TO_CEF_TYPE(WAKE_LOCK_SCREEN);
TO_CEF_TYPE(WAKE_LOCK_SYSTEM);
TO_CEF_TYPE(LEGACY_COOKIE_ACCESS);
TO_CEF_TYPE(FILE_SYSTEM_WRITE_GUARD);
TO_CEF_TYPE(NFC);
TO_CEF_TYPE(BLUETOOTH_CHOOSER_DATA);
TO_CEF_TYPE(CLIPBOARD_READ_WRITE);
TO_CEF_TYPE(CLIPBOARD_SANITIZED_WRITE);
TO_CEF_TYPE(SAFE_BROWSING_URL_CHECK_DATA);
TO_CEF_TYPE(VR);
TO_CEF_TYPE(AR);
TO_CEF_TYPE(FILE_SYSTEM_READ_GUARD);
TO_CEF_TYPE(STORAGE_ACCESS);
TO_CEF_TYPE(CAMERA_PAN_TILT_ZOOM);
TO_CEF_TYPE(WINDOW_MANAGEMENT);
TO_CEF_TYPE(LOCAL_FONTS);
TO_CEF_TYPE(PERMISSION_AUTOREVOCATION_DATA);
TO_CEF_TYPE(FILE_SYSTEM_LAST_PICKED_DIRECTORY);
TO_CEF_TYPE(DISPLAY_CAPTURE);
TO_CEF_TYPE(FILE_SYSTEM_ACCESS_CHOOSER_DATA);
TO_CEF_TYPE(FEDERATED_IDENTITY_SHARING);
TO_CEF_TYPE(JAVASCRIPT_JIT);
TO_CEF_TYPE(HTTP_ALLOWED);
TO_CEF_TYPE(FORMFILL_METADATA);
TO_CEF_TYPE(DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION);
TO_CEF_TYPE(AUTO_DARK_WEB_CONTENT);
TO_CEF_TYPE(REQUEST_DESKTOP_SITE);
TO_CEF_TYPE(FEDERATED_IDENTITY_API);
TO_CEF_TYPE(NOTIFICATION_INTERACTIONS);
TO_CEF_TYPE(REDUCED_ACCEPT_LANGUAGE);
TO_CEF_TYPE(NOTIFICATION_PERMISSION_REVIEW);
TO_CEF_TYPE(PRIVATE_NETWORK_GUARD);
TO_CEF_TYPE(PRIVATE_NETWORK_CHOOSER_DATA);
TO_CEF_TYPE(FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS);
TO_CEF_TYPE(REVOKED_UNUSED_SITE_PERMISSIONS);
TO_CEF_TYPE(TOP_LEVEL_STORAGE_ACCESS);
TO_CEF_TYPE(FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION);
TO_CEF_TYPE(FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION);
TO_CEF_TYPE(ANTI_ABUSE);
TO_CEF_TYPE(THIRD_PARTY_STORAGE_PARTITIONING);
TO_CEF_TYPE(HTTPS_ENFORCED);
TO_CEF_TYPE(ALL_SCREEN_CAPTURE);
TO_CEF_TYPE(COOKIE_CONTROLS_METADATA);
TO_CEF_TYPE(TPCD_HEURISTICS_GRANTS);
TO_CEF_TYPE(TPCD_METADATA_GRANTS);
TO_CEF_TYPE(TPCD_TRIAL);
TO_CEF_TYPE(TOP_LEVEL_TPCD_TRIAL);
TO_CEF_TYPE(TOP_LEVEL_TPCD_ORIGIN_TRIAL);
TO_CEF_TYPE(AUTO_PICTURE_IN_PICTURE);
TO_CEF_TYPE(FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION);
TO_CEF_TYPE(FILE_SYSTEM_ACCESS_RESTORE_PERMISSION);
TO_CEF_TYPE(CAPTURED_SURFACE_CONTROL);
TO_CEF_TYPE(SMART_CARD_GUARD);
TO_CEF_TYPE(SMART_CARD_DATA);
TO_CEF_TYPE(WEB_PRINTING);
TO_CEF_TYPE(AUTOMATIC_FULLSCREEN);
TO_CEF_TYPE(SUB_APP_INSTALLATION_PROMPTS);
TO_CEF_TYPE(SPEAKER_SELECTION);
TO_CEF_TYPE(DIRECT_SOCKETS);
TO_CEF_TYPE(KEYBOARD_LOCK);
TO_CEF_TYPE(POINTER_LOCK);
TO_CEF_TYPE(REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS);
TO_CEF_TYPE(TRACKING_PROTECTION);
TO_CEF_TYPE(DISPLAY_MEDIA_SYSTEM_AUDIO);
TO_CEF_TYPE(JAVASCRIPT_OPTIMIZER);
TO_CEF_TYPE(STORAGE_ACCESS_HEADER_ORIGIN_TRIAL);
TO_CEF_TYPE(HAND_TRACKING);
TO_CEF_TYPE(WEB_APP_INSTALLATION);
TO_CEF_TYPE(DIRECT_SOCKETS_PRIVATE_NETWORK_ACCESS);
TO_CEF_TYPE(LEGACY_COOKIE_SCOPE);
TO_CEF_TYPE(ARE_SUSPICIOUS_NOTIFICATIONS_ALLOWLISTED_BY_USER);
TO_CEF_TYPE(CONTROLLED_FRAME);
TO_CEF_TYPE(REVOKED_DISRUPTIVE_NOTIFICATION_PERMISSIONS);
TO_CEF_TYPE(LOCAL_NETWORK_ACCESS);
TO_CEF_TYPE(ON_DEVICE_SPEECH_RECOGNITION_LANGUAGES_DOWNLOADED);
TO_CEF_TYPE(INITIALIZED_TRANSLATIONS);
TO_CEF_TYPE(SUSPICIOUS_NOTIFICATION_IDS);
case ContentSettingsType::DEFAULT:
break;
}
NOTREACHED();
}
#define FROM_CEF_TYPE(name) \
case CEF_CONTENT_SETTING_TYPE_##name: \
return ContentSettingsType::name
std::optional<ContentSettingsType> FromCefType(
cef_content_setting_types_t type) {
switch (type) {
FROM_CEF_TYPE(COOKIES);
FROM_CEF_TYPE(IMAGES);
FROM_CEF_TYPE(JAVASCRIPT);
FROM_CEF_TYPE(POPUPS);
FROM_CEF_TYPE(GEOLOCATION);
FROM_CEF_TYPE(NOTIFICATIONS);
FROM_CEF_TYPE(AUTO_SELECT_CERTIFICATE);
FROM_CEF_TYPE(MIXEDSCRIPT);
FROM_CEF_TYPE(MEDIASTREAM_MIC);
FROM_CEF_TYPE(MEDIASTREAM_CAMERA);
FROM_CEF_TYPE(PROTOCOL_HANDLERS);
FROM_CEF_TYPE(DEPRECATED_PPAPI_BROKER);
FROM_CEF_TYPE(AUTOMATIC_DOWNLOADS);
FROM_CEF_TYPE(MIDI_SYSEX);
FROM_CEF_TYPE(SSL_CERT_DECISIONS);
FROM_CEF_TYPE(PROTECTED_MEDIA_IDENTIFIER);
FROM_CEF_TYPE(APP_BANNER);
FROM_CEF_TYPE(SITE_ENGAGEMENT);
FROM_CEF_TYPE(DURABLE_STORAGE);
FROM_CEF_TYPE(USB_CHOOSER_DATA);
FROM_CEF_TYPE(BLUETOOTH_GUARD);
FROM_CEF_TYPE(BACKGROUND_SYNC);
FROM_CEF_TYPE(AUTOPLAY);
FROM_CEF_TYPE(IMPORTANT_SITE_INFO);
FROM_CEF_TYPE(PERMISSION_AUTOBLOCKER_DATA);
FROM_CEF_TYPE(ADS);
FROM_CEF_TYPE(ADS_DATA);
FROM_CEF_TYPE(MIDI);
FROM_CEF_TYPE(PASSWORD_PROTECTION);
FROM_CEF_TYPE(MEDIA_ENGAGEMENT);
FROM_CEF_TYPE(SOUND);
FROM_CEF_TYPE(CLIENT_HINTS);
FROM_CEF_TYPE(SENSORS);
FROM_CEF_TYPE(DEPRECATED_ACCESSIBILITY_EVENTS);
FROM_CEF_TYPE(PAYMENT_HANDLER);
FROM_CEF_TYPE(USB_GUARD);
FROM_CEF_TYPE(BACKGROUND_FETCH);
FROM_CEF_TYPE(INTENT_PICKER_DISPLAY);
FROM_CEF_TYPE(IDLE_DETECTION);
FROM_CEF_TYPE(SERIAL_GUARD);
FROM_CEF_TYPE(SERIAL_CHOOSER_DATA);
FROM_CEF_TYPE(PERIODIC_BACKGROUND_SYNC);
FROM_CEF_TYPE(BLUETOOTH_SCANNING);
FROM_CEF_TYPE(HID_GUARD);
FROM_CEF_TYPE(HID_CHOOSER_DATA);
FROM_CEF_TYPE(WAKE_LOCK_SCREEN);
FROM_CEF_TYPE(WAKE_LOCK_SYSTEM);
FROM_CEF_TYPE(LEGACY_COOKIE_ACCESS);
FROM_CEF_TYPE(FILE_SYSTEM_WRITE_GUARD);
FROM_CEF_TYPE(NFC);
FROM_CEF_TYPE(BLUETOOTH_CHOOSER_DATA);
FROM_CEF_TYPE(CLIPBOARD_READ_WRITE);
FROM_CEF_TYPE(CLIPBOARD_SANITIZED_WRITE);
FROM_CEF_TYPE(SAFE_BROWSING_URL_CHECK_DATA);
FROM_CEF_TYPE(VR);
FROM_CEF_TYPE(AR);
FROM_CEF_TYPE(FILE_SYSTEM_READ_GUARD);
FROM_CEF_TYPE(STORAGE_ACCESS);
FROM_CEF_TYPE(CAMERA_PAN_TILT_ZOOM);
FROM_CEF_TYPE(WINDOW_MANAGEMENT);
FROM_CEF_TYPE(LOCAL_FONTS);
FROM_CEF_TYPE(PERMISSION_AUTOREVOCATION_DATA);
FROM_CEF_TYPE(FILE_SYSTEM_LAST_PICKED_DIRECTORY);
FROM_CEF_TYPE(DISPLAY_CAPTURE);
FROM_CEF_TYPE(FILE_SYSTEM_ACCESS_CHOOSER_DATA);
FROM_CEF_TYPE(FEDERATED_IDENTITY_SHARING);
FROM_CEF_TYPE(JAVASCRIPT_JIT);
FROM_CEF_TYPE(HTTP_ALLOWED);
FROM_CEF_TYPE(FORMFILL_METADATA);
FROM_CEF_TYPE(DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION);
FROM_CEF_TYPE(AUTO_DARK_WEB_CONTENT);
FROM_CEF_TYPE(REQUEST_DESKTOP_SITE);
FROM_CEF_TYPE(FEDERATED_IDENTITY_API);
FROM_CEF_TYPE(NOTIFICATION_INTERACTIONS);
FROM_CEF_TYPE(REDUCED_ACCEPT_LANGUAGE);
FROM_CEF_TYPE(NOTIFICATION_PERMISSION_REVIEW);
FROM_CEF_TYPE(PRIVATE_NETWORK_GUARD);
FROM_CEF_TYPE(PRIVATE_NETWORK_CHOOSER_DATA);
FROM_CEF_TYPE(FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS);
FROM_CEF_TYPE(REVOKED_UNUSED_SITE_PERMISSIONS);
FROM_CEF_TYPE(TOP_LEVEL_STORAGE_ACCESS);
FROM_CEF_TYPE(FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION);
FROM_CEF_TYPE(FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION);
FROM_CEF_TYPE(ANTI_ABUSE);
FROM_CEF_TYPE(THIRD_PARTY_STORAGE_PARTITIONING);
FROM_CEF_TYPE(HTTPS_ENFORCED);
FROM_CEF_TYPE(ALL_SCREEN_CAPTURE);
FROM_CEF_TYPE(COOKIE_CONTROLS_METADATA);
FROM_CEF_TYPE(TPCD_HEURISTICS_GRANTS);
FROM_CEF_TYPE(TPCD_METADATA_GRANTS);
FROM_CEF_TYPE(TPCD_TRIAL);
FROM_CEF_TYPE(TOP_LEVEL_TPCD_TRIAL);
FROM_CEF_TYPE(TOP_LEVEL_TPCD_ORIGIN_TRIAL);
FROM_CEF_TYPE(AUTO_PICTURE_IN_PICTURE);
FROM_CEF_TYPE(FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION);
FROM_CEF_TYPE(FILE_SYSTEM_ACCESS_RESTORE_PERMISSION);
FROM_CEF_TYPE(CAPTURED_SURFACE_CONTROL);
FROM_CEF_TYPE(SMART_CARD_GUARD);
FROM_CEF_TYPE(SMART_CARD_DATA);
FROM_CEF_TYPE(WEB_PRINTING);
FROM_CEF_TYPE(AUTOMATIC_FULLSCREEN);
FROM_CEF_TYPE(SUB_APP_INSTALLATION_PROMPTS);
FROM_CEF_TYPE(SPEAKER_SELECTION);
FROM_CEF_TYPE(DIRECT_SOCKETS);
FROM_CEF_TYPE(KEYBOARD_LOCK);
FROM_CEF_TYPE(POINTER_LOCK);
FROM_CEF_TYPE(REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS);
FROM_CEF_TYPE(TRACKING_PROTECTION);
FROM_CEF_TYPE(DISPLAY_MEDIA_SYSTEM_AUDIO);
FROM_CEF_TYPE(JAVASCRIPT_OPTIMIZER);
FROM_CEF_TYPE(STORAGE_ACCESS_HEADER_ORIGIN_TRIAL);
FROM_CEF_TYPE(HAND_TRACKING);
FROM_CEF_TYPE(WEB_APP_INSTALLATION);
FROM_CEF_TYPE(DIRECT_SOCKETS_PRIVATE_NETWORK_ACCESS);
FROM_CEF_TYPE(LEGACY_COOKIE_SCOPE);
FROM_CEF_TYPE(ARE_SUSPICIOUS_NOTIFICATIONS_ALLOWLISTED_BY_USER);
FROM_CEF_TYPE(CONTROLLED_FRAME);
FROM_CEF_TYPE(REVOKED_DISRUPTIVE_NOTIFICATION_PERMISSIONS);
FROM_CEF_TYPE(LOCAL_NETWORK_ACCESS);
FROM_CEF_TYPE(ON_DEVICE_SPEECH_RECOGNITION_LANGUAGES_DOWNLOADED);
FROM_CEF_TYPE(INITIALIZED_TRANSLATIONS);
FROM_CEF_TYPE(SUSPICIOUS_NOTIFICATION_IDS);
case CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK_DEPRECATED:
case CEF_CONTENT_SETTING_TYPE_NUM_VALUES:
break;
}
return std::nullopt;
}
} // namespace setting_helper

View File

@@ -5,14 +5,10 @@
#ifndef CEF_LIBCEF_BROWSER_SETTING_HELPER_H_
#define CEF_LIBCEF_BROWSER_SETTING_HELPER_H_
#include <optional>
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "cef/include/cef_registration.h"
#include "cef/include/internal/cef_types_content_settings.h"
#include "components/content_settings/core/browser/content_settings_observer.h"
#include "components/content_settings/core/common/content_settings_types.h"
class CefSettingObserver;
class CefRegistration;
@@ -80,11 +76,6 @@ class Registrar final : public content_settings::Observer {
base::ObserverList<Registration> observers_;
};
// Convert between cef_content_setting_types_t and ContentSettingsType.
cef_content_setting_types_t ToCefType(ContentSettingsType type);
std::optional<ContentSettingsType> FromCefType(
cef_content_setting_types_t type);
} // namespace setting_helper
#endif // CEF_LIBCEF_BROWSER_SETTING_HELPER_H_

View File

@@ -3,6 +3,7 @@
// can be found in the LICENSE file.
#include "base/feature_list.h"
#include "base/features.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "cef/include/test/cef_test_helpers.h"
@@ -19,6 +20,7 @@ bool CefIsFeatureEnabledForTests(const CefString& feature_name) {
// Only includes values that are queried by unit tests.
const base::Feature* features[] = {
&net::features::kIgnoreHSTSForLocalhost,
&base::features::kUseRustJsonParser,
&network::features::kReduceAcceptLanguage,
};

View File

@@ -48,7 +48,7 @@ void OverrideBaseBundleID() {
std::string bundle_id = GetMainBundleID();
DCHECK(!bundle_id.empty());
base::apple::SetBaseBundleIDOverride(bundle_id);
base::apple::SetBaseBundleID(bundle_id.c_str());
}
base::FilePath GetNormalChildProcessPath() {

View File

@@ -84,6 +84,7 @@ buildflag_header("buildflags") {
flags = [
"ENABLE_CEF=$enable_cef",
"IS_CEF_SANDBOX_BUILD=$is_cef_sandbox_build",
]
}

View File

@@ -5,6 +5,13 @@
declare_args() {
enable_cef = true
# Enables base target customizations necessary for distribution of the
# cef_sandbox static library. This value will be set via gn_args.py for the
# official sandbox build configurations only. DO NOT SET THIS VALUE MANUALLY
# FOR OTHER CHROMIUM/CEF BUILD CONFIGURATIONS AS ITS USE MAY HAVE SIGNIFICANT
# PERFORMANCE AND/OR SECURITY IMPLICATIONS.
is_cef_sandbox_build = false
# Optionally configure the CEF API version. This impacts wrapper-side only.
cef_api_version = ""
}

View File

@@ -29,7 +29,6 @@ set(CEF_TARGET libcef_dll_wrapper)
'autogen_capi_includes',
'includes_wrapper',
'includes_wrapper_mac:MAC',
'includes_wrapper_win:WINDOWS',
'includes_win:WINDOWS',
'includes_win_capi:WINDOWS',
'includes_mac:MAC',
@@ -39,7 +38,6 @@ set(CEF_TARGET libcef_dll_wrapper)
'libcef_dll_wrapper_sources_base',
'libcef_dll_wrapper_sources_common',
'libcef_dll_wrapper_sources_mac:MAC',
'libcef_dll_wrapper_sources_win:WINDOWS',
'autogen_client_side',
],
}}

View File

@@ -9,26 +9,13 @@
#include <windows.h>
#include <algorithm>
#include <sstream>
#elif defined(OS_POSIX)
#include <errno.h>
#include <pthread.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#endif
#if defined(OS_APPLE)
#include <mach/mach_time.h>
#endif
#include <iomanip>
#include <iostream>
#include <sstream>
#include "include/base/cef_immediate_crash.h"
#include "include/internal/cef_string_types.h"
namespace cef {
@@ -143,254 +130,8 @@ std::string safe_strerror(int err) {
}
#endif // defined(OS_POSIX)
const internal::Implementation* g_impl_override = nullptr;
const char* const log_severity_names[] = {"INFO", "WARNING", "ERROR", "FATAL"};
static_assert(LOG_NUM_SEVERITIES == std::size(log_severity_names),
"Incorrect number of log_severity_names");
const char* log_severity_name(int severity) {
if (severity >= 0 && severity < LOG_NUM_SEVERITIES) {
return log_severity_names[severity];
}
return "UNKNOWN";
}
#if !defined(NDEBUG) && defined(OS_WIN)
bool IsUser32AndGdi32Available() {
static const bool is_user32_and_gdi32_available = [] {
// If win32k syscalls aren't disabled, then user32 and gdi32 are available.
PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY policy = {};
if (::GetProcessMitigationPolicy(GetCurrentProcess(),
ProcessSystemCallDisablePolicy, &policy,
sizeof(policy))) {
return policy.DisallowWin32kSystemCalls == 0;
}
return true;
}();
return is_user32_and_gdi32_available;
}
std::wstring UTF8ToWide(const std::string& utf8) {
if (utf8.empty()) {
return {};
}
int size = MultiByteToWideChar(CP_UTF8, 0, utf8.data(),
static_cast<int>(utf8.size()), nullptr, 0);
if (size <= 0) {
return {};
}
std::wstring utf16(size, L'\0');
if (MultiByteToWideChar(CP_UTF8, 0, utf8.data(),
static_cast<int>(utf8.size()), &utf16[0],
size) != size) {
return {};
}
return utf16;
}
// Displays a message box to the user with the error message in it. Used for
// fatal messages, where we close the app simultaneously. This is for developers
// only; we don't use this in circumstances (like release builds) where users
// could see it, since users don't understand these messages anyway.
void DisplayDebugMessageInDialog(const std::string& message) {
if (IsUser32AndGdi32Available()) {
MessageBoxW(nullptr, UTF8ToWide(message).c_str(), L"Fatal error",
MB_OK | MB_ICONHAND | MB_TOPMOST);
} else {
OutputDebugStringW(UTF8ToWide(message).c_str());
}
}
#endif // !defined(NDEBUG) && defined(OS_WIN)
[[noreturn]] void HandleFatal(const std::string& message) {
// Don't display assertions to the user in release mode. The enduser can't do
// anything with this information, and displaying message boxes when the
// application is hosed can cause additional problems. We intentionally don't
// implement a dialog on other platforms. You can just look at stderr.
#if !defined(NDEBUG) && defined(OS_WIN)
if (!::IsDebuggerPresent()) {
// Displaying a dialog is unnecessary when debugging and can complicate
// debugging.
DisplayDebugMessageInDialog(message);
}
#endif
// Crash the process to generate a dump.
base::ImmediateCrash();
}
uint64_t TickCount() {
#if defined(OS_WIN)
return ::GetTickCount();
#elif defined(OS_APPLE)
return mach_absolute_time();
#elif defined(OS_POSIX)
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
uint64_t absolute_micro = static_cast<uint64_t>(ts.tv_sec) * 1000000 +
static_cast<uint64_t>(ts.tv_nsec) / 1000;
return absolute_micro;
#else
#error Unsupported platform
#endif
}
} // namespace
namespace internal {
const Implementation* GetImplementation() {
if (g_impl_override) {
return g_impl_override;
}
static constexpr Implementation default_impl = {
&cef_get_min_log_level, &cef_get_vlog_level, &cef_log};
return &default_impl;
}
ScopedImplementation::~ScopedImplementation() {
g_impl_override = previous_;
}
ScopedImplementation::ScopedImplementation() = default;
void ScopedImplementation::Init(const Implementation* impl) {
previous_ = g_impl_override;
g_impl_override = impl;
}
} // namespace internal
ScopedEarlySupport::ScopedEarlySupport(const Config& config)
: impl_{{&ScopedEarlySupport::get_min_log_level,
&ScopedEarlySupport::get_vlog_level, &ScopedEarlySupport::log},
config} {
Init(&impl_.ptrs);
}
// static
const ScopedEarlySupport::Config& ScopedEarlySupport::GetConfig() {
return reinterpret_cast<const ScopedEarlySupport::Impl*>(g_impl_override)
->config;
}
// static
int ScopedEarlySupport::get_min_log_level() {
return GetConfig().min_log_level;
}
// static
int ScopedEarlySupport::get_vlog_level(const char* file_start, size_t N) {
return GetConfig().vlog_level;
}
// static
void ScopedEarlySupport::log(const char* file,
int line,
int severity,
const char* message) {
const Config& config = GetConfig();
// Most logging initializes `file` from __FILE__. Unfortunately, because we
// build from out/Foo we get a `../../` (or \) prefix for all of our
// __FILE__s. This isn't true for base::Location::Current() which already does
// the stripping (and is used for some logging, especially CHECKs).
//
// Here we strip the first 6 (../../ or ..\..\) characters if `file` starts
// with `.` but defensively clamp to strlen(file) just in case.
const std::string_view filename =
file[0] == '.' ? std::string_view(file).substr(
std::min(std::size_t{6}, strlen(file)))
: file;
std::stringstream stream;
stream << '[';
if (config.log_prefix) {
stream << config.log_prefix << ':';
}
if (config.log_process_id) {
#if defined(OS_WIN)
stream << ::GetCurrentProcessId() << ':';
#elif defined(OS_POSIX)
stream << getpid() << ':';
#else
#error Unsupported platform
#endif
}
if (config.log_thread_id) {
#if defined(OS_WIN)
stream << ::GetCurrentThreadId() << ':';
#elif defined(OS_APPLE)
uint64_t tid;
if (pthread_threadid_np(nullptr, &tid) == 0) {
stream << tid << ':';
}
#elif defined(OS_POSIX)
stream << pthread_self() << ':';
#else
#error Unsupported platform
#endif
}
if (config.log_timestamp) {
#if defined(OS_WIN)
SYSTEMTIME local_time;
GetLocalTime(&local_time);
stream << std::setfill('0') << std::setw(2) << local_time.wMonth
<< std::setw(2) << local_time.wDay << '/' << std::setw(2)
<< local_time.wHour << std::setw(2) << local_time.wMinute
<< std::setw(2) << local_time.wSecond << '.' << std::setw(3)
<< local_time.wMilliseconds << ':';
#elif defined(OS_POSIX)
timeval tv;
gettimeofday(&tv, nullptr);
time_t t = tv.tv_sec;
struct tm local_time;
localtime_r(&t, &local_time);
struct tm* tm_time = &local_time;
stream << std::setfill('0') << std::setw(2) << 1 + tm_time->tm_mon
<< std::setw(2) << tm_time->tm_mday << '/' << std::setw(2)
<< tm_time->tm_hour << std::setw(2) << tm_time->tm_min
<< std::setw(2) << tm_time->tm_sec << '.' << std::setw(6)
<< tv.tv_usec << ':';
#else
#error Unsupported platform
#endif
}
if (config.log_tickcount) {
stream << TickCount() << ':';
}
if (severity >= 0) {
stream << log_severity_name(severity);
} else {
stream << "VERBOSE" << -severity;
}
stream << ":" << filename << ":" << line << "] " << message;
const std::string& log_line = stream.str();
if (!config.formatted_log_handler ||
!config.formatted_log_handler(log_line.c_str())) {
// Log to stderr.
std::cerr << log_line << std::endl;
#if !defined(NDEBUG) && defined(OS_WIN)
if (severity < LOG_FATAL) {
// Log to the debugger console in debug builds.
OutputDebugStringW(UTF8ToWide(log_line).c_str());
}
#endif
}
if (severity == LOG_FATAL) {
HandleFatal(log_line);
}
}
// MSVC doesn't like complex extern templates and DLLs.
#if !defined(COMPILER_MSVC)
// Explicit instantiations for commonly used comparisons.
@@ -443,8 +184,7 @@ LogMessage::LogMessage(const char* file,
LogMessage::~LogMessage() {
std::string str_newline(stream_.str());
internal::GetImplementation()->log(file_, line_, severity_,
str_newline.c_str());
cef_log(file_, line_, severity_, str_newline.c_str());
}
#if defined(OS_WIN)

View File

@@ -1,82 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "cef/libcef_dll/bootstrap/bootstrap_util_win.h"
#include "base/check_op.h"
#include "base/command_line.h"
namespace bootstrap_util {
namespace {
// Changes to these values require rebuilding libcef.dll.
constexpr wchar_t kWindowsSelfName[] = TEXT("bootstrap");
constexpr wchar_t kConsoleSelfName[] = TEXT("bootstrapc");
// Returns the file name only without extension, if any.
inline std::wstring NamePart(const base::FilePath& path) {
return path.BaseName().RemoveExtension().value();
}
} // namespace
bool IsDefaultExeName(const std::wstring& name) {
return base::FilePath::CompareEqualIgnoreCase(name, kWindowsSelfName) ||
base::FilePath::CompareEqualIgnoreCase(name, kConsoleSelfName);
}
std::wstring GetModuleValue(const base::CommandLine& command_line) {
if (command_line.HasSwitch(switches::kModule)) {
const auto& value = command_line.GetSwitchValuePath(switches::kModule);
if (!value.empty()) {
return NamePart(value);
}
}
return std::wstring();
}
base::FilePath GetExePath() {
HMODULE hModule = ::GetModuleHandle(nullptr);
CHECK(hModule);
return GetModulePath(hModule);
}
base::FilePath GetModulePath(HMODULE module) {
wchar_t buffer[MAX_PATH];
DWORD length = ::GetModuleFileName(module, buffer, MAX_PATH);
CHECK_NE(length, 0U);
CHECK_LT(length, static_cast<DWORD>(MAX_PATH));
return base::FilePath(buffer);
}
std::wstring GetValidatedModuleValue(const base::CommandLine& command_line,
const base::FilePath& exe_path) {
// Allow module value configuration if the bootstrap executable has the
// default name.
const auto& value = GetModuleValue(command_line);
if (!value.empty() && IsDefaultExeName(NamePart(exe_path))) {
return value;
}
return std::wstring();
}
std::wstring GetDefaultModuleValue(const base::FilePath& exe_path) {
return NamePart(exe_path);
}
bool IsModulePathAllowed(const base::FilePath& module_path,
const base::FilePath& exe_path) {
// Allow any module path if the bootstrap executable has the default name.
if (IsDefaultExeName(NamePart(exe_path))) {
return true;
}
// Module must be at the same path as the executable.
return module_path.DirName() == exe_path.DirName();
}
} // namespace bootstrap_util

View File

@@ -1,53 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_LIBCEF_DLL_BOOTSTRAP_BOOTSTRAP_UTIL_WIN_H_
#define CEF_LIBCEF_DLL_BOOTSTRAP_BOOTSTRAP_UTIL_WIN_H_
#pragma once
#include <windows.h>
#include <string>
#include "base/files/file_path.h"
namespace base {
class CommandLine;
}
namespace bootstrap_util {
namespace switches {
// Changes to this value require rebuilding libcef.dll.
inline constexpr char kModule[] = "module";
} // namespace switches
// Returns true if |name| is one of the default bootstrap executable names.
bool IsDefaultExeName(const std::wstring& name);
// Returns the command-line configured module value without validation.
std::wstring GetModuleValue(const base::CommandLine& command_line);
// The following functions can only be called in unsandboxed processes.
// Returns the fully qualified file path for the executable module.
base::FilePath GetExePath();
// Returns the fully qualified file path for |module|.
base::FilePath GetModulePath(HMODULE module);
// Returns the command-line configured module value if it passes validation.
std::wstring GetValidatedModuleValue(const base::CommandLine& command_line,
const base::FilePath& exe_path);
// Returns the default module name (executable name without extension).
std::wstring GetDefaultModuleValue(const base::FilePath& exe_path);
// Returns true if loading |module_path| is allowed.
bool IsModulePathAllowed(const base::FilePath& module_path,
const base::FilePath& exe_path);
} // namespace bootstrap_util
#endif // CEF_LIBCEF_DLL_BOOTSTRAP_BOOTSTRAP_UTIL_WIN_H_

View File

@@ -1,391 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include <windows.h>
#include <iostream>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/process/memory.h"
#include "base/process/process_info.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "cef/include/cef_sandbox_win.h"
#include "cef/include/cef_version.h"
#include "cef/include/cef_version_info.h"
#include "cef/include/internal/cef_types.h"
#include "cef/include/wrapper/cef_certificate_util_win.h"
#include "cef/include/wrapper/cef_util_win.h"
#include "cef/libcef/browser/crashpad_runner.h"
#include "cef/libcef/browser/preferred_stack_size_win.inc"
#include "cef/libcef_dll/bootstrap/bootstrap_util_win.h"
#include "cef/libcef_dll/bootstrap/win/resource.h"
#include "chrome/app/delay_load_failure_hook_win.h"
#include "chrome/chrome_elf/chrome_elf_main.h"
#include "chrome/install_static/initialize_from_primary_module.h"
#include "content/public/app/sandbox_helper_win.h"
#include "sandbox/policy/mojom/sandbox.mojom.h"
#include "sandbox/policy/sandbox_type.h"
#include "sandbox/win/src/sandbox.h"
namespace {
// Sets the current working directory for the process to the directory holding
// the executable if this is the browser process. This avoids leaking a handle
// to an arbitrary directory to child processes (e.g., the crashpad handler
// process).
void SetCwdForBrowserProcess() {
if (!::IsBrowserProcess()) {
return;
}
std::array<wchar_t, MAX_PATH + 1> buffer;
buffer[0] = L'\0';
DWORD length = ::GetModuleFileName(nullptr, &buffer[0], buffer.size());
if (!length || length >= buffer.size()) {
return;
}
base::SetCurrentDirectory(
base::FilePath(base::FilePath::StringViewType(&buffer[0], length))
.DirName());
}
#if DCHECK_IS_ON()
// Displays a message to the user with the error message. Used for fatal
// messages, where we close the app simultaneously. This is for developers only;
// we don't use this in circumstances (like release builds) where users could
// see it, since users don't understand these messages anyway.
// Load a string from the string table in bootstrap.rc.
std::wstring LoadString(int string_id) {
const int kMaxSize = 100;
TCHAR buff[kMaxSize] = {0};
::LoadString(::GetModuleHandle(nullptr), string_id, buff, kMaxSize);
return buff;
}
// Replace $1-$2-$3..$9 in the format string with values from |subst|.
// Additionally, any number of consecutive '$' characters is replaced by that
// number less one. Eg $$->$, $$$->$$, etc. Supports up to 9 replacements.
std::wstring FormatErrorString(int string_id,
base::span<const std::u16string> subst) {
return base::UTF16ToWide(base::ReplaceStringPlaceholders(
base::WideToUTF16(LoadString(string_id)), subst, nullptr));
}
void ShowError(const std::wstring& error) {
const auto subst = std::to_array<std::u16string>(
{base::WideToUTF16(bootstrap_util::GetExePath().BaseName().value())});
const auto& title = FormatErrorString(IDS_ERROR_TITLE, subst);
const auto& extra_info = LoadString(IDS_ERROR_EXTRA_INFO);
#if defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
std::wcerr << title.c_str() << ": " << error << extra_info;
#else
if (!::IsDebuggerPresent()) {
// Displaying a dialog is unnecessary when debugging and can complicate
// debugging.
const std::wstring& msg = error + extra_info;
::MessageBox(nullptr, msg.c_str(), title.c_str(), MB_ICONERROR | MB_OK);
}
#endif
}
#endif // DCHECK_IS_ON()
std::wstring NormalizeError(const std::wstring& err) {
std::wstring str = err;
// Replace newlines.
std::replace(str.begin(), str.end(), L'\n', L' ');
return str;
}
// Verify DLL code signing requirements.
void CheckDllCodeSigning(
const base::FilePath& dll_path,
const cef_certificate_util::ThumbprintsInfo& exe_thumbprints) {
cef_certificate_util::ThumbprintsInfo dll_thumbprints;
cef_certificate_util::GetClientThumbprints(
dll_path.value(), /*verify_binary=*/true, dll_thumbprints);
// The DLL and EXE must either both be unsigned or both have all valid
// signatures and the same primary thumbprint.
if (!dll_thumbprints.IsSame(exe_thumbprints, /*allow_unsigned=*/true)) {
// Some part of the certificate validation process failed.
#if DCHECK_IS_ON()
const auto subst = std::to_array<std::u16string>(
{base::WideToUTF16(dll_path.BaseName().value()),
base::WideToUTF16(dll_thumbprints.errors)});
ShowError(FormatErrorString(IDS_ERROR_INVALID_CERT, subst));
#endif
if (dll_thumbprints.errors.empty()) {
LOG(FATAL) << "Failed " << dll_path.value()
<< " certificate requirements";
} else {
LOG(FATAL) << "Failed " << dll_path.value() << " certificate checks: "
<< NormalizeError(dll_thumbprints.errors);
}
}
}
} // namespace
#if defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
int main(int argc, char* argv[]) {
#else // !defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
// Entry point function for all processes.
int APIENTRY wWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow) {
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
#endif // !defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
#if defined(ARCH_CPU_32_BITS)
// Run the main thread on 32-bit Windows using a fiber with the preferred 4MiB
// stack size. This function must be called at the top of the executable entry
// point function (`main()` or `wWinMain()`). It is used in combination with
// the initial stack size of 0.5MiB configured via the `/STACK:0x80000` linker
// flag on executable targets. This saves significant memory on threads (like
// those in the Windows thread pool, and others) whose stack size can only be
// controlled via the linker flag.
#if defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
int exit_code = CefRunMainWithPreferredStackSize(main, argc, argv);
#else
int exit_code = CefRunWinMainWithPreferredStackSize(wWinMain, hInstance,
lpCmdLine, nCmdShow);
#endif
if (exit_code >= 0) {
// The fiber has completed so return here.
return exit_code;
}
#endif
SetCwdForBrowserProcess();
install_static::InitializeFromPrimaryModule();
SignalInitializeCrashReporting();
if (IsBrowserProcess()) {
chrome::DisableDelayLoadFailureHooksForMainExecutable();
}
// Done here to ensure that OOMs that happen early in process initialization
// are correctly signaled to the OS.
base::EnableTerminationOnOutOfMemory();
logging::RegisterAbslAbortHook();
// Parse command-line arguments.
const base::CommandLine command_line =
base::CommandLine::FromString(::GetCommandLineW());
constexpr char kProcessType[] = "type";
const bool is_subprocess = command_line.HasSwitch(kProcessType);
const std::string& process_type =
command_line.GetSwitchValueASCII(kProcessType);
if (is_subprocess && process_type.empty()) {
// Early exit on invalid process type.
return CEF_RESULT_CODE_BAD_PROCESS_TYPE;
}
// Run the crashpad handler now instead of waiting for libcef to load.
constexpr char kCrashpadHandler[] = "crashpad-handler";
if (process_type == kCrashpadHandler) {
return crashpad_runner::RunAsCrashpadHandler(command_line);
}
// IsUnsandboxedSandboxType() can't be used here because its result can be
// gated behind a feature flag, which are not yet initialized.
// Match the logic in MainDllLoader::Launch.
const bool is_sandboxed =
sandbox::policy::SandboxTypeFromCommandLine(command_line) !=
sandbox::mojom::Sandbox::kNoSandbox;
std::wstring dll_name;
base::FilePath exe_path;
cef_certificate_util::ThumbprintsInfo exe_thumbprints;
if (is_sandboxed) {
// Running as a sandboxed sub-process. May already be locked down, so we
// can't call WinAPI functions. The command-line will already have been
// validated in ChromeContentBrowserClientCef::
// AppendExtraCommandLineSwitches. Retrieve the module value without
// additional validation.
dll_name = bootstrap_util::GetModuleValue(command_line);
if (dll_name.empty()) {
// Default to the command-line program name without extension.
dll_name = command_line.GetProgram().BaseName().RemoveExtension().value();
}
} else {
// Running as the main process or unsandboxed sub-process.
exe_path = bootstrap_util::GetExePath();
// Retrieve the module name with validation.
dll_name = bootstrap_util::GetValidatedModuleValue(command_line, exe_path);
if (dll_name.empty()) {
// Default to the executable module file name without extension. This is
// safer than relying on the command-line program name.
dll_name = bootstrap_util::GetDefaultModuleValue(exe_path);
}
if (bootstrap_util::IsDefaultExeName(dll_name)) {
#if DCHECK_IS_ON()
ShowError(LoadString(IDS_ERROR_NO_MODULE_NAME));
#endif
LOG(FATAL) << "Missing module name";
}
cef_certificate_util::GetClientThumbprints(
exe_path.value(), /*verify_binary=*/true, exe_thumbprints);
// The executable must either be unsigned or have all valid signatures.
if (!exe_thumbprints.IsUnsignedOrValid()) {
// Some part of the certificate validation process failed.
#if DCHECK_IS_ON()
const auto subst = std::to_array<std::u16string>(
{base::WideToUTF16(exe_path.BaseName().value()),
base::WideToUTF16(exe_thumbprints.errors)});
ShowError(FormatErrorString(IDS_ERROR_INVALID_CERT, subst));
#endif
if (exe_thumbprints.errors.empty()) {
LOG(FATAL) << "Failed " << exe_path.value()
<< " certificate requirements";
} else {
LOG(FATAL) << "Failed " << exe_path.value() << " certificate checks: "
<< NormalizeError(exe_thumbprints.errors);
}
}
}
if (!is_sandboxed) {
// Check chrome_elf.dll which should be preloaded to support crash
// reporting.
if (HMODULE hModule = ::LoadLibrary(L"chrome_elf")) {
const auto& dll_path = bootstrap_util::GetModulePath(hModule);
// Must be in the same directory as the EXE.
if (dll_path.DirName() != exe_path.DirName()) {
#if DCHECK_IS_ON()
const auto subst = std::to_array<std::u16string>({u"chrome_elf"});
ShowError(FormatErrorString(IDS_ERROR_INVALID_LOCATION, subst));
#endif
LOG(FATAL) << "Invalid location: " << dll_path.value();
}
CheckDllCodeSigning(dll_path, exe_thumbprints);
FreeLibrary(hModule);
} else {
LOG(FATAL) << "Failed to load chrome_elf.dll with error "
<< ::GetLastError();
}
// Load the client DLL as untrusted (e.g. without executing DllMain or
// loading additional modules) so that we can first check requirements.
// LoadLibrary's "default search order" is tricky and we don't want to
// guess about what DLL it will load. DONT_RESOLVE_DLL_REFERENCES is the
// only option that doesn't execute DllMain while still allowing us
// retrieve the path using GetModuleFileName. No execution of the DLL
// should be attempted while loaded in this mode.
if (HMODULE hModule = ::LoadLibraryEx(dll_name.c_str(), nullptr,
DONT_RESOLVE_DLL_REFERENCES)) {
const auto& dll_path = bootstrap_util::GetModulePath(hModule);
if (!bootstrap_util::IsModulePathAllowed(dll_path, exe_path)) {
#if DCHECK_IS_ON()
const auto subst =
std::to_array<std::u16string>({base::WideToUTF16(dll_name)});
ShowError(FormatErrorString(IDS_ERROR_INVALID_LOCATION, subst));
#endif
LOG(FATAL) << "Invalid location: " << dll_path.value();
}
CheckDllCodeSigning(dll_path, exe_thumbprints);
FreeLibrary(hModule);
} else {
#if DCHECK_IS_ON()
const auto subst = std::to_array<std::u16string>(
{base::WideToUTF16(dll_name),
base::WideToUTF16(cef_util::GetLastErrorAsString())});
ShowError(FormatErrorString(IDS_ERROR_LOAD_FAILED, subst));
#endif
LOG(FATAL) << "Failed to load " << dll_name << ".dll with error "
<< ::GetLastError();
}
}
#if defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
constexpr char kProcName[] = "RunConsoleMain";
using kProcType = decltype(&RunConsoleMain);
#else
constexpr char kProcName[] = "RunWinMain";
using kProcType = decltype(&RunWinMain);
#endif
// Load the client DLL normally.
if (HMODULE hModule = ::LoadLibrary(dll_name.c_str())) {
if (auto* pFunc = (kProcType)::GetProcAddress(hModule, kProcName)) {
// Initialize the sandbox services.
// Match the logic in MainDllLoader::Launch.
sandbox::SandboxInterfaceInfo sandbox_info = {nullptr};
if (!is_subprocess || is_sandboxed) {
// For child processes that are running as --no-sandbox, don't
// initialize the sandbox info, otherwise they'll be treated as brokers
// (as if they were the browser).
content::InitializeSandboxInfo(
&sandbox_info, IsExtensionPointDisableSet()
? sandbox::MITIGATION_EXTENSION_POINT_DISABLE
: 0);
}
cef_version_info_t version_info = {};
CEF_POPULATE_VERSION_INFO(&version_info);
// Return immediately without calling FreeLibrary() to avoid an illegal
// access during shutdown. The sandbox broker owns objects created inside
// libcef.dll (SandboxWin::InitBrokerServices) and cleanup is triggered
// via an _onexit handler (SingletonBase::OnExit) called after wWinMain
// exits.
#if defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
return pFunc(argc, argv, &sandbox_info, &version_info);
#else
return pFunc(hInstance, lpCmdLine, nCmdShow, &sandbox_info,
&version_info);
#endif
} else {
#if DCHECK_IS_ON()
if (!is_sandboxed) {
const auto subst = std::to_array<std::u16string>(
{base::WideToUTF16(dll_name),
base::WideToUTF16(cef_util::GetLastErrorAsString()),
base::ASCIIToUTF16(std::string(kProcName))});
ShowError(FormatErrorString(IDS_ERROR_NO_PROC_EXPORT, subst));
}
#endif
LOG(FATAL) << "Failed to find " << kProcName << " in " << dll_name
<< ".dll with error " << ::GetLastError();
}
} else {
#if DCHECK_IS_ON()
if (!is_sandboxed) {
const auto subst = std::to_array<std::u16string>(
{base::WideToUTF16(dll_name),
base::WideToUTF16(cef_util::GetLastErrorAsString())});
ShowError(FormatErrorString(IDS_ERROR_LOAD_FAILED, subst));
}
#endif
LOG(FATAL) << "Failed to load " << dll_name << ".dll with error "
<< ::GetLastError();
}
// LOG(FATAL) is [[noreturn]], so we never reach this point.
NOTREACHED();
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -1,134 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "libcef_dll/bootstrap/win/resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#include "include/cef_version.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_APPLICATION ICON "bootstrap.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
PRODUCTVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "CEF Bootstrap Application"
VALUE "FileVersion", CEF_VERSION
#if defined(CEF_BUILD_BOOTSTRAP_CONSOLE)
VALUE "InternalName", "bootstrapc"
VALUE "OriginalFilename", "bootstrapc.exe"
#else
VALUE "InternalName", "bootstrap"
VALUE "OriginalFilename", "bootstrap.exe"
#endif
VALUE "LegalCopyright", "Copyright (C) " MAKE_STRING(COPYRIGHT_YEAR) " The Chromium Embedded Framework Authors"
VALUE "ProductName", "CEF Bootstrap Application"
VALUE "ProductVersion", CEF_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_ERROR_TITLE "Runtime Error: $1"
IDS_ERROR_EXTRA_INFO "\nTry reinstalling the application to fix this error."
IDS_ERROR_NO_MODULE_NAME "Missing module name"
IDS_ERROR_NO_PROC_EXPORT "Failed to find $3 in $1.dll\n$2"
IDS_ERROR_INVALID_LOCATION "Found $1.dll in an unexpected location"
IDS_ERROR_LOAD_FAILED "Failed to load $1.dll\n$2"
IDS_ERROR_INVALID_CERT "Failed certificate validation for $1\n$2"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,27 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by cefclient.rc
//
#define IDS_ERROR_TITLE 100
#define IDS_ERROR_EXTRA_INFO 101
#define IDS_ERROR_NO_MODULE_NAME 102
#define IDS_ERROR_NO_PROC_EXPORT 103
#define IDS_ERROR_INVALID_LOCATION 104
#define IDS_ERROR_LOAD_FAILED 105
#define IDS_ERROR_INVALID_CERT 106
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 32000
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 100
#endif
#endif

View File

@@ -45,17 +45,6 @@ CEF_EXPORT int cef_version_info(int entry) {
}
}
CEF_EXPORT void cef_version_info_all(cef_version_info_t* info) {
info->cef_version_major = CEF_VERSION_MAJOR;
info->cef_version_minor = CEF_VERSION_MINOR;
info->cef_version_patch = CEF_VERSION_PATCH;
info->cef_commit_number = CEF_COMMIT_NUMBER;
info->chrome_version_major = CHROME_VERSION_MAJOR;
info->chrome_version_minor = CHROME_VERSION_MINOR;
info->chrome_version_build = CHROME_VERSION_BUILD;
info->chrome_version_patch = CHROME_VERSION_PATCH;
}
#include "cef/libcef_dll/cef_api_versions.inc"
CEF_EXPORT const char* cef_api_hash(int version, int entry) {

View File

@@ -47,3 +47,19 @@ void cef_sandbox_destroy(void* sandbox_context) {
delete static_cast<sandbox::SeatbeltExecServer::CreateFromArgumentsResult*>(
sandbox_context);
}
CefScopedSandboxContext::CefScopedSandboxContext() : sandbox_context_(NULL) {}
CefScopedSandboxContext::~CefScopedSandboxContext() {
if (sandbox_context_) {
cef_sandbox_destroy(sandbox_context_);
}
}
bool CefScopedSandboxContext::Initialize(int argc, char** argv) {
if (sandbox_context_) {
return false;
}
sandbox_context_ = cef_sandbox_initialize(argc, argv);
return !!sandbox_context_;
}

View File

@@ -5,6 +5,7 @@
#include "sandbox/win/src/sandbox.h"
#include "base/notreached.h"
#include "cef/libcef/features/features.h"
#include "include/cef_sandbox_win.h"
#include "sandbox/win/src/sandbox_factory.h"
@@ -38,3 +39,19 @@ void* cef_sandbox_info_create() {
void cef_sandbox_info_destroy(void* sandbox_info) {
delete static_cast<sandbox::SandboxInterfaceInfo*>(sandbox_info);
}
#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
// Avoid bringing in partition_alloc dependencies.
namespace partition_alloc {
bool ReleaseReservation() {
DCHECK(false);
return false;
}
void TerminateBecauseOutOfMemory(size_t size) {
DCHECK(false);
}
} // namespace partition_alloc
#endif // BUILDFLAG(IS_CEF_SANDBOX_BUILD)

View File

@@ -1,243 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/wrapper/cef_certificate_util_win.h"
#include <windows.h>
#include <Softpub.h>
#include <stdio.h>
#include <wincrypt.h>
#include <wintrust.h>
#include <algorithm>
#include "include/wrapper/cef_util_win.h"
#if defined(CEF_BUILD_BOOTSTRAP)
#include "base/logging.h"
#else
#include "include/base/cef_logging.h"
#endif
namespace cef_certificate_util {
namespace {
bool InitCryptProviderStructs(WINTRUST_DATA& win_trust_data,
CRYPT_PROVIDER_DATA*& prov_data_ptr,
CRYPT_PROVIDER_SGNR*& prov_signer_ptr,
CRYPT_PROVIDER_CERT*& prov_cert_ptr) {
prov_data_ptr = WTHelperProvDataFromStateData(win_trust_data.hWVTStateData);
if (prov_data_ptr) {
prov_signer_ptr = WTHelperGetProvSignerFromChain(
(PCRYPT_PROVIDER_DATA)prov_data_ptr, 0, FALSE, 0);
if (prov_signer_ptr) {
prov_cert_ptr = WTHelperGetProvCertFromChain(prov_signer_ptr, 0);
if (prov_cert_ptr) {
return true;
}
}
}
return false;
}
// Returns bytes as an upper-case hex string.
std::string BytesToHexString(const BYTE* bytes, size_t length) {
std::string hex_string;
hex_string.resize(length * 2);
for (size_t index = 0; index < length; ++index) {
sprintf_s(&hex_string[2 * index], 3, "%02X", bytes[index]);
}
return hex_string;
}
std::wstring ErrorPrefix(DWORD i) {
return L"\nCertificate " + std::to_wstring(i) + L": ";
}
std::wstring NormalizeError(const std::wstring& err) {
std::wstring str = err;
// Replace newlines.
std::replace(str.begin(), str.end(), L'\n', L' ');
return str;
}
std::wstring GetBinaryName(const std::wstring& path) {
auto sep_pos = path.find_last_of(L"/\\");
if (sep_pos == std::wstring::npos) {
return path;
}
return path.substr(0, sep_pos);
}
} // namespace
void GetClientThumbprints(const std::wstring& binary_path,
bool verify_binary,
ThumbprintsInfo& info) {
info = {};
const HWND wvt_handle = static_cast<HWND>(INVALID_HANDLE_VALUE);
GUID wvt_policy = WINTRUST_ACTION_GENERIC_VERIFY_V2;
WINTRUST_FILE_INFO file_info = {};
file_info.cbStruct = sizeof(file_info);
file_info.pcwszFilePath = binary_path.c_str();
WINTRUST_SIGNATURE_SETTINGS sig_settings = {};
sig_settings.cbStruct = sizeof(sig_settings);
// We will verify each signature separately, but also get the number of
// secondary signatures present in the file.
sig_settings.dwFlags = WSS_GET_SECONDARY_SIG_COUNT | WSS_VERIFY_SPECIFIC;
// cSecondarySigs starts off as 0. We assume we have one primary signature.
// After the first WinVerifyTrust call succeeds, we will continue inspecting
// the rest of the signatures.
for (DWORD i = 0; i < sig_settings.cSecondarySigs + 1; ++i) {
WINTRUST_DATA win_trust_data = {0};
win_trust_data.cbStruct = sizeof(win_trust_data);
win_trust_data.dwUIChoice = WTD_UI_NONE;
// No revocation checking.
win_trust_data.fdwRevocationChecks = WTD_REVOKE_NONE;
// Prevent revocation checks over the network.
win_trust_data.dwProvFlags = WTD_CACHE_ONLY_URL_RETRIEVAL;
win_trust_data.dwUnionChoice = WTD_CHOICE_FILE;
win_trust_data.dwStateAction = WTD_STATEACTION_VERIFY;
win_trust_data.pFile = &file_info;
win_trust_data.pSignatureSettings = &sig_settings;
sig_settings.dwIndex = i;
const auto status =
WinVerifyTrust(wvt_handle, &wvt_policy, &win_trust_data);
const bool valid = status == ERROR_SUCCESS;
if (!valid) {
if (i == 0 && status == TRUST_E_NOSIGNATURE) {
const auto last_error = static_cast<HRESULT>(::GetLastError());
if (TRUST_E_NOSIGNATURE == last_error ||
TRUST_E_SUBJECT_FORM_UNKNOWN == last_error ||
TRUST_E_PROVIDER_UNKNOWN == last_error) {
// The file is not signed.
return;
}
}
info.errors += ErrorPrefix(i) + L"WinVerifyTrust failed: " +
cef_util::GetLastErrorAsString();
// WinVerifyTrust will fail if the signing certificates can't be verified,
// but it will still provide information about them in the StateData
// structure. We only continue if the method asks for this.
if (verify_binary) {
// If the primary signature fails, we will return and not inspect the
// rest of the signatures.
if (i == 0) {
info.has_signature = true;
return;
}
continue;
}
}
if (!win_trust_data.hWVTStateData) {
info.errors += ErrorPrefix(i) + L"No WinVerifyTrust data";
continue;
}
CRYPT_PROVIDER_DATA* prov_data = NULL;
CRYPT_PROVIDER_SGNR* prov_signer = NULL;
CRYPT_PROVIDER_CERT* prov_cert = NULL;
if (InitCryptProviderStructs(win_trust_data, prov_data, prov_signer,
prov_cert)) {
// Using SHA1 hash here because: (a) SHA1 is used internally by default in
// most tools that inspect certificates, (b) the SHA1 value is more likely
// to aleady be cached, (c) SHA1 is faster to compute than SHA256 if not
// already cached, and (d) SHA1 is still resistant to preimage attacks
// (e.g. trying to match specific hashes), particularly when used on DEC
// formatted certificates as in this case.
// SHA1 hash = 20 bytes.
BYTE sha1_bytes[20] = {};
DWORD sha1_bytes_count = sizeof(sha1_bytes);
// Read or compute the SHA1 hash of the certificate (thumbprint), and
// convert it to a hex string.
if (CertGetCertificateContextProperty(prov_cert->pCert,
CERT_SHA1_HASH_PROP_ID, sha1_bytes,
&sha1_bytes_count)) {
auto& thumbprints =
valid ? info.valid_thumbprints : info.invalid_thumbprints;
thumbprints.emplace_back(
BytesToHexString(sha1_bytes, sha1_bytes_count));
} else {
info.errors += ErrorPrefix(i) +
L"CertGetCertificateContextProperty failed: " +
cef_util::GetLastErrorAsString();
}
} else {
info.errors += ErrorPrefix(i) + L"Invalid WinVerifyTrust data";
}
win_trust_data.dwStateAction = WTD_STATEACTION_CLOSE;
WinVerifyTrust(wvt_handle, &wvt_policy, &win_trust_data);
}
info.has_signature = true;
}
bool ValidateCodeSigning(const std::wstring& binary_path,
const char* thumbprint,
bool allow_unsigned,
ThumbprintsInfo& info) {
GetClientThumbprints(binary_path.data(), /*verify_binary=*/true, info);
if (!info.errors.empty()) {
// The binary is signed, but one or more of the signatures failed
// validation.
return false;
}
const bool thumbprint_required =
thumbprint && std::strlen(thumbprint) == kThumbprintLength;
allow_unsigned &= !thumbprint_required;
if (thumbprint_required) {
if (!info.HasPrimaryThumbprint(thumbprint)) {
// The DLL is unsigned or the primary signature does not match the
// required thumbprint.
return false;
}
} else if (!allow_unsigned && !info.has_signature) {
// The DLL in unsigned which is not allowed.
return false;
}
return true;
}
void ValidateCodeSigningAssert(const std::wstring& binary_path,
const char* thumbprint,
bool allow_unsigned,
ThumbprintsInfo* info) {
cef_certificate_util::ThumbprintsInfo thumbprints;
bool valid = cef_certificate_util::ValidateCodeSigning(
binary_path.data(), thumbprint, allow_unsigned, thumbprints);
if (!thumbprints.errors.empty()) {
// The DLL is signed, but one or more of the signatures failed validation.
LOG(FATAL) << "Failed " << GetBinaryName(binary_path)
<< " certificate validation: "
<< NormalizeError(thumbprints.errors);
}
if (!valid) {
// Failed other requirements.
LOG(FATAL) << "Failed " << GetBinaryName(binary_path)
<< " validation requirements.";
}
if (info) {
*info = thumbprints;
}
}
} // namespace cef_certificate_util

View File

@@ -2,6 +2,8 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/wrapper/cef_library_loader.h"
#include <libgen.h>
#include <mach-o/dyld.h>
#include <stdio.h>
@@ -9,8 +11,6 @@
#include <memory>
#include <sstream>
#include "include/wrapper/cef_library_loader.h"
namespace {
const char kFrameworkPath[] =
@@ -46,7 +46,7 @@ std::string GetFrameworkPath(bool helper) {
} // namespace
CefScopedLibraryLoader::CefScopedLibraryLoader() = default;
CefScopedLibraryLoader::CefScopedLibraryLoader() : loaded_(false) {}
bool CefScopedLibraryLoader::Load(bool helper) {
if (loaded_) {

View File

@@ -1,130 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include <algorithm>
#include "include/base/cef_logging.h"
#include "include/wrapper/cef_certificate_util_win.h"
#include "include/wrapper/cef_library_loader.h"
#include "include/wrapper/cef_util_win.h"
namespace {
bool IsEqualIgnoringCase(const std::wstring& str1, const std::wstring& str2) {
return std::equal(
str1.begin(), str1.end(), str2.begin(), str2.end(),
[](wchar_t a, wchar_t b) { return std::tolower(a) == std::tolower(b); });
}
HMODULE Load(const std::wstring& dll_path,
const char* thumbprint,
bool allow_unsigned,
bool is_subprocess,
cef_version_info_t* version_info) {
if (!is_subprocess) {
// Load the client DLL as untrusted (e.g. without executing DllMain or
// loading additional modules) so that we can first check requirements.
// LoadLibrary's "default search order" is tricky and we don't want to guess
// about what DLL it will load. DONT_RESOLVE_DLL_REFERENCES is the only
// option that doesn't execute DllMain while still allowing us retrieve the
// path using GetModuleFileName. No execution of the DLL should be attempted
// while loaded in this mode.
if (HMODULE hModule = ::LoadLibraryEx(
dll_path.data(), nullptr,
DONT_RESOLVE_DLL_REFERENCES | LOAD_WITH_ALTERED_SEARCH_PATH)) {
const auto& module_path = cef_util::GetModulePath(hModule);
if (!IsEqualIgnoringCase(module_path, dll_path)) {
LOG(FATAL) << "Found libcef.dll at unexpected path";
}
// Generate a FATAL error and crash if validation fails.
cef_certificate_util::ValidateCodeSigningAssert(dll_path, thumbprint,
allow_unsigned);
FreeLibrary(hModule);
} else {
LOG(FATAL) << "Failed to load libcef.dll";
}
}
// Load normally.
if (HMODULE hModule = ::LoadLibraryEx(dll_path.data(), nullptr,
LOAD_WITH_ALTERED_SEARCH_PATH)) {
// libcef functions should now be callable via the /DELAYLOAD handler.
if (version_info) {
// Compare Chromium version for the client/bootstrap and libcef.dll. This
// strict version check is necessary because both sandbox info and
// chrome_elf introduce Chromium version dependencies, and we don't know
// which non-matching versions are compatible.
cef_version_info_t dll_info = {};
dll_info.size = sizeof(cef_version_info_t);
#if CEF_API_ADDED(13800)
cef_version_info_all(&dll_info);
#else
// Only populating the members that are used below.
dll_info.chrome_version_major = cef_version_info(4);
dll_info.chrome_version_patch = cef_version_info(7);
#endif
if (dll_info.chrome_version_major != version_info->chrome_version_major ||
dll_info.chrome_version_patch != version_info->chrome_version_patch) {
LOG(FATAL) << "Failed libcef.dll version check; expected "
<< version_info->chrome_version_major << "."
<< version_info->chrome_version_major << ", got "
<< dll_info.chrome_version_major << "."
<< dll_info.chrome_version_major;
}
}
return hModule;
}
LOG(FATAL) << "Failed to load libcef.dll";
return nullptr;
}
} // namespace
CefScopedLibraryLoader::CefScopedLibraryLoader() = default;
bool CefScopedLibraryLoader::LoadInMainAssert(
const wchar_t* dll_path,
const char* thumbprint,
bool allow_unsigned,
cef_version_info_t* version_info) {
CHECK(!handle_);
handle_ = Load(dll_path, thumbprint, allow_unsigned, false, version_info);
return handle_ != nullptr;
}
bool CefScopedLibraryLoader::LoadInSubProcessAssert(
cef_version_info_t* version_info) {
CHECK(!handle_);
constexpr wchar_t kProcessTypeW[] = L"type";
const auto& command_line =
cef_util::ParseCommandLineArgs(::GetCommandLineW());
if (command_line.size() <= 1) {
return false;
}
if (cef_util::GetCommandLineValue(command_line, kProcessTypeW).empty()) {
return false;
}
const auto& dll_path =
cef_util::GetCommandLineValue(command_line, switches::kLibcefPathW);
if (dll_path.empty()) {
// Default is libcef.dll in the same directory the executable and loaded by
// the delayload helper.
return true;
}
handle_ = Load(dll_path, nullptr, true, true, version_info);
return handle_ != nullptr;
}
CefScopedLibraryLoader::~CefScopedLibraryLoader() {
if (handle_) {
::FreeLibrary(handle_);
}
}

View File

@@ -1,113 +0,0 @@
// Copyright 2025 The Chromium Embedded Framework Authors. Portions Copyright
// 2018 the Chromium Authors. All rights reserved. Use of this source code is
// governed by a BSD-style license that can be found in the LICENSE file.
#include <dlfcn.h>
#include <libgen.h>
#include <mach-o/dyld.h>
#include <stdio.h>
#include <memory>
#include <sstream>
#include "include/cef_sandbox_mac.h"
namespace {
// Relative path to the library from the Helper executable.
constexpr char kLibraryPath[] =
"../../../Chromium Embedded Framework.framework/"
"Libraries/libcef_sandbox.dylib";
std::string GetLibraryPath() {
uint32_t exec_path_size = 0;
int rv = _NSGetExecutablePath(NULL, &exec_path_size);
if (rv != -1) {
return std::string();
}
std::unique_ptr<char[]> exec_path(new char[exec_path_size]);
rv = _NSGetExecutablePath(exec_path.get(), &exec_path_size);
if (rv != 0) {
return std::string();
}
// Get the directory path of the executable.
const char* parent_dir = dirname(exec_path.get());
if (!parent_dir) {
return std::string();
}
// Append the relative path to the library.
std::stringstream ss;
ss << parent_dir << "/" << kLibraryPath;
return ss.str();
}
void* LoadLibrary(const char* path) {
void* handle = dlopen(path, RTLD_LAZY | RTLD_LOCAL | RTLD_FIRST);
if (!handle) {
fprintf(stderr, "dlopen %s: %s\n", path, dlerror());
return nullptr;
}
return handle;
}
void UnloadLibrary(void* handle) {
// Returns 0 on success.
if (dlclose(handle)) {
fprintf(stderr, "dlclose: %s\n", dlerror());
}
}
void* GetLibraryPtr(void* handle, const char* name) {
void* ptr = dlsym(handle, name);
if (!ptr) {
fprintf(stderr, "dlsym: %s\n", dlerror());
}
return ptr;
}
void* SandboxInitialize(void* handle, int argc, char** argv) {
if (auto* ptr = (decltype(&cef_sandbox_initialize))GetLibraryPtr(
handle, "cef_sandbox_initialize")) {
return ptr(argc, argv);
}
return nullptr;
}
void SandboxDestroy(void* handle, void* sandbox_context) {
if (auto* ptr = (decltype(&cef_sandbox_destroy))GetLibraryPtr(
handle, "cef_sandbox_destroy")) {
ptr(sandbox_context);
}
}
} // namespace
CefScopedSandboxContext::CefScopedSandboxContext() = default;
CefScopedSandboxContext::~CefScopedSandboxContext() {
if (library_handle_) {
if (sandbox_context_) {
SandboxDestroy(library_handle_, sandbox_context_);
}
UnloadLibrary(library_handle_);
}
}
bool CefScopedSandboxContext::Initialize(int argc, char** argv) {
if (!library_handle_) {
const std::string& library_path = GetLibraryPath();
if (library_path.empty()) {
fprintf(stderr, "App does not have the expected bundle structure.\n");
return false;
}
library_handle_ = LoadLibrary(library_path.c_str());
}
if (!library_handle_ || sandbox_context_) {
return false;
}
sandbox_context_ = SandboxInitialize(library_handle_, argc, argv);
return !!sandbox_context_;
}

View File

@@ -1,142 +0,0 @@
// Copyright (c) 2025 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/wrapper/cef_util_win.h"
#include <shellapi.h>
#include <algorithm>
#include <cwctype>
#include <string>
#include <vector>
#if defined(CEF_BUILD_BOOTSTRAP)
#include "base/check_op.h"
#else
#include "include/base/cef_logging.h"
#endif
namespace cef_util {
namespace {
void TrimWhitespace(std::wstring& str) {
// Trim leading whitespace
str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](auto ch) {
return !std::iswspace(ch);
}));
// Trim trailing whitespace
str.erase(std::find_if(str.rbegin(), str.rend(),
[](auto ch) { return !std::iswspace(ch); })
.base(),
str.end());
}
} // namespace
std::wstring GetExePath() {
HMODULE hModule = ::GetModuleHandle(nullptr);
CHECK(hModule);
return GetModulePath(hModule);
}
std::wstring GetModulePath(HMODULE module) {
wchar_t buffer[MAX_PATH];
DWORD length = ::GetModuleFileName(module, buffer, MAX_PATH);
CHECK_NE(length, 0U);
CHECK_LT(length, static_cast<DWORD>(MAX_PATH));
return buffer;
}
std::wstring GetLastErrorAsString() {
std::wstring error_message;
DWORD error_message_id = ::GetLastError();
if (error_message_id == 0) {
return error_message;
}
LPWSTR message_buffer = NULL;
DWORD size = FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error_message_id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&message_buffer, 0, NULL);
if (message_buffer) {
error_message = std::wstring(message_buffer, size);
LocalFree(message_buffer);
}
return error_message;
}
// Implementation based on CommandLine::ParseFromString.
std::vector<std::wstring> ParseCommandLineArgs(const wchar_t* str) {
std::wstring command_line = str;
TrimWhitespace(command_line);
int num_args = 0;
wchar_t** args = NULL;
// When calling CommandLineToArgvW, use the apiset if available.
// Doing so will bypass loading shell32.dll on Windows.
HMODULE downlevel_shell32_dll =
::LoadLibraryEx(L"api-ms-win-downlevel-shell32-l1-1-0.dll", nullptr,
LOAD_LIBRARY_SEARCH_SYSTEM32);
if (downlevel_shell32_dll) {
auto command_line_to_argv_w_proc =
reinterpret_cast<decltype(::CommandLineToArgvW)*>(
::GetProcAddress(downlevel_shell32_dll, "CommandLineToArgvW"));
if (command_line_to_argv_w_proc) {
args = command_line_to_argv_w_proc(command_line.data(), &num_args);
}
} else {
// Since the apiset is not available, allow the delayload of shell32.dll
// to take place.
args = ::CommandLineToArgvW(command_line.data(), &num_args);
}
std::vector<std::wstring> result;
result.reserve(num_args);
for (int i = 0; i < num_args; ++i) {
std::wstring arg = args[i];
TrimWhitespace(arg);
if (!arg.empty()) {
result.push_back(arg);
}
}
LocalFree(args);
if (downlevel_shell32_dll) {
::FreeLibrary(downlevel_shell32_dll);
}
return result;
}
std::wstring GetCommandLineValue(const std::vector<std::wstring>& command_line,
const std::wstring& name) {
constexpr wchar_t kPrefix[] = L"--";
constexpr wchar_t kSeparator[] = L"=";
constexpr wchar_t kQuoteChar = L'"';
const std::wstring& start = kPrefix + name + kSeparator;
for (const auto& arg : command_line) {
if (arg.find(start) == 0) {
auto value = arg.substr(start.length());
if (value.length() > 2 && value[0] == kQuoteChar &&
value[arg.length() - 1] == kQuoteChar) {
value = value.substr(1, value.length() - 2);
}
return value;
}
}
return std::wstring();
}
} // namespace cef_util

View File

@@ -436,6 +436,11 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/2196
'name': 'printing_context_2196',
},
{
# Disable thin archives with cef_sandbox builds.
# https://github.com/chromiumembedded/cef/issues/3674
'name': 'build',
},
{
# macOS: Make the NativeEventProcessor protocol dependency optional.
# https://github.com/chromiumembedded/cef/issues/2539
@@ -514,6 +519,30 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/1872
'name': 'base_command_line_1872',
},
{
# Remove cef_sandbox dependency on boringssl functions.
# https://github.com/chromiumembedded/cef/issues/2743
#
# Enable the VS 2015 Update 2 fix when building with the MSVC standard
# library.
#
# Avoid usage of std::atomic_flag::test() added in C++20.
# https://github.com/llvm/llvm-project/issues/57364
#
# Avoid usage of PartitionAlloc assertions (PA_BASE_CHECK) in raw_ptr.h.
#
# win: Add SHA256 implementation for Sid::FromNamedCapability using the
# Crypto API.
# https://github.com/chromiumembedded/cef/issues/3791
#
# win: Disable use of Rust for JSON parsing with cef_sandbox.
# Enables the fallback to C++ that was removed in
# https://crrev.com/9ddc1624637c8cfa8ef50a95abd779e0ba4d67f6
#
# Avoid inclusion of undefined PartitionAlloc dependencies in Dawn after
# https://crrev.com/4dacf2b61c359950d2c2f1b5f9b9d079a01290a4
'name': 'base_sandbox_2743',
},
{
# Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling
# scrolling in OSR mode.
@@ -523,6 +552,12 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/3834
'name': 'osr_fling_2745',
},
{
# Windows: Build targets as C++17 to avoid export of std::is_integral
# templates in cef_sandbox that should be inlined.
# https://github.com/chromiumembedded/cef/issues/2819
'name': 'win_cpp17_msvc_sandbox_2819',
},
{
# libxml access is now limited to targets audited by the Security Team.
# https://chromium-review.googlesource.com/c/chromium/src/+/1884750
@@ -553,6 +588,13 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/3210
'name': 'win_sandbox_3210',
},
{
# Windows: Fix MSVC compile error with sandbox target.
# error: static assertion failed due to requirement
# '!is_const_v<const unsigned char>': The C++ Standard forbids
# containers of const elements because allocator<const T> is ill-formed.
'name': 'win_sandbox_policy',
},
{
# Windows: Always use the root window as the owner for shell dialogs.
# https://github.com/chromiumembedded/cef/issues/3294
@@ -706,6 +748,12 @@ patches = [
# https://issues.chromium.org/issues/323753235#comment11
'name': 'content_initiator_policy_323753235'
},
{
# win: Fix undefined std::_Literal_zero_is_expected() when building
# cef_sandbox with VS 17.9.2 version of MSVC STL.
# https://github.com/chromiumembedded/cef/issues/3708
'name': 'win_sandbox_op3way_3708'
},
{
# Fix ThreadPool DCHECK during startup when using multi-threaded message
# loop. Related to the following CL:
@@ -747,9 +795,5 @@ patches = [
# builds.
# https://github.com/chromiumembedded/cef/issues/3892
'name': 'config_3892'
},
{
# Add |first| parameter to NavigationThrottleRegistry::AddThrottle.
'name': 'content_throttle_registry'
}
]

View File

@@ -1,5 +1,5 @@
diff --git base/command_line.cc base/command_line.cc
index 7491285cd14c9..90044eb1dddbd 100644
index d4d3bc52426d1..69d48fac6bbf4 100644
--- base/command_line.cc
+++ base/command_line.cc
@@ -421,11 +421,10 @@ void CommandLine::AppendSwitchNative(std::string_view switch_string,

View File

@@ -0,0 +1,389 @@
diff --git base/BUILD.gn base/BUILD.gn
index 59721ed3c9e26..c0ee7567a534c 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -41,6 +41,7 @@ import("//build/rust/rust_static_library.gni")
import("//build/timestamp.gni")
import("//build/util/process_version.gni")
import("//build_overrides/build.gni")
+import("//cef/libcef/features/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -1531,7 +1532,13 @@ component("base") {
"hash/md5.h",
"hash/sha1.h",
]
- if (is_nacl) {
+
+ deps += [ "//cef/libcef/features:buildflags" ]
+ if (enable_cef) {
+ configs += [ "//cef/libcef/features:config" ]
+ }
+
+ if (is_nacl || is_cef_sandbox_build) {
sources += [
"hash/md5_nacl.cc",
"hash/md5_nacl.h",
@@ -1982,6 +1989,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}
+ if (!use_custom_libcxx) {
+ # Enable the VS 2015 Update 2 fix when building with the MSVC standard
+ # library.
+ defines += [ "_ENABLE_ATOMIC_ALIGNMENT_FIX" ]
+ }
+
libs += [
"cfgmgr32.lib",
"ntdll.lib",
diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc
index f680f63cffc5b..9cb615bbc8a5a 100644
--- base/allocator/dispatcher/dispatcher.cc
+++ base/allocator/dispatcher/dispatcher.cc
@@ -8,6 +8,7 @@
#include "base/check.h"
#include "base/dcheck_is_on.h"
#include "base/no_destructor.h"
+#include "cef/libcef/features/features.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/shim/allocator_shim.h"
@@ -33,7 +34,7 @@ struct Dispatcher::Impl {
}
void Reset() {
-#if DCHECK_IS_ON()
+#if DCHECK_IS_ON() && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
DCHECK([&] {
auto const was_set = is_initialized_check_flag_.test_and_set();
is_initialized_check_flag_.clear();
diff --git base/hash/md5.h base/hash/md5.h
index 4d358570d81c5..09bf13a965541 100644
--- base/hash/md5.h
+++ base/hash/md5.h
@@ -11,8 +11,9 @@
#include "base/base_export.h"
#include "base/containers/span.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
-#if BUILDFLAG(IS_NACL)
+#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "base/hash/md5_nacl.h"
#else
#include "base/hash/md5_boringssl.h"
diff --git base/hash/sha1.h base/hash/sha1.h
index 2158b648ca58a..8a8cb13b2fd74 100644
--- base/hash/sha1.h
+++ base/hash/sha1.h
@@ -15,7 +15,9 @@
#include "base/compiler_specific.h"
#include "base/containers/span.h"
#include "build/build_config.h"
-#if BUILDFLAG(IS_NACL)
+#include "cef/libcef/features/features.h"
+
+#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "base/hash/sha1_nacl.h"
#else
#include "base/hash/sha1_boringssl.h"
diff --git base/json/json_reader.cc base/json/json_reader.cc
index f32622d353f1d..def35a3ae1c5c 100644
--- base/json/json_reader.cc
+++ base/json/json_reader.cc
@@ -12,8 +12,9 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
-#if !BUILDFLAG(IS_NACL)
+#if !(BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD))
#include "base/strings/string_view_rust.h"
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h"
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h"
@@ -21,7 +22,7 @@
// TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just
// run in-process there. Don't compile base::JSONReader on NaCL at all.
-#if !BUILDFLAG(IS_NACL)
+#if !(BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD))
namespace {
const char kSecurityJsonParsingTime[] = "Security.JSONParser.ParsingTime";
@@ -137,7 +138,7 @@ namespace base {
std::optional<Value> JSONReader::Read(std::string_view json,
int options,
size_t max_depth) {
-#if BUILDFLAG(IS_NACL)
+#if (BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD))
internal::JSONParser parser(options, max_depth);
return parser.Parse(json);
#else // BUILDFLAG(IS_NACL)
@@ -182,7 +183,7 @@ std::optional<Value::List> JSONReader::ReadList(std::string_view json,
JSONReader::Result JSONReader::ReadAndReturnValueWithError(
std::string_view json,
int options) {
-#if BUILDFLAG(IS_NACL)
+#if (BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD))
internal::JSONParser parser(options);
auto value = parser.Parse(json);
if (!value) {
@@ -223,7 +224,7 @@ bool JSONReader::UsingRust() {
if (!base::FeatureList::GetInstance()) {
return false;
}
-#if BUILDFLAG(IS_NACL)
+#if (BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD))
return false;
#else
return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser);
diff --git base/logging.cc base/logging.cc
index 26ba1a286e451..99b2ce6feb274 100644
--- base/logging.cc
+++ base/logging.cc
@@ -51,6 +51,7 @@
#include "base/trace_event/base_tracing.h"
#include "base/vlog.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "third_party/abseil-cpp/absl/base/internal/raw_logging.h"
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
@@ -530,7 +531,7 @@ bool BaseInitLoggingImpl(const LoggingSettings& settings) {
}
#endif
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
// Connects Rust logging with the //base logging functionality.
internal::init_rust_log_crate();
#endif
diff --git base/metrics/crc32.cc base/metrics/crc32.cc
index 83e3cee2579ab..8238767ab9126 100644
--- base/metrics/crc32.cc
+++ base/metrics/crc32.cc
@@ -3,14 +3,15 @@
// found in the LICENSE file.
#include "base/metrics/crc32.h"
+#include "cef/libcef/features/features.h"
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "third_party/zlib/zlib.h"
#endif // !BUILDFLAG(IS_NACL)
namespace base {
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
uint32_t Crc32(uint32_t sum, span<const uint8_t> data) {
if (data.empty()) {
return sum;
diff --git base/process/memory.h base/process/memory.h
index 5d11d4a1560b1..242a93bcca8ed 100644
--- base/process/memory.h
+++ base/process/memory.h
@@ -29,7 +29,7 @@ BASE_EXPORT void EnableTerminationOnOutOfMemory();
#if PA_BUILDFLAG(USE_PARTITION_ALLOC)
using partition_alloc::TerminateBecauseOutOfMemory;
#else
-inline void TerminateBecauseOutOfMemory(size_t) {
+[[noreturn]] inline void TerminateBecauseOutOfMemory(size_t) {
logging::RawCheckFailure("Out of memory");
}
#endif
@@ -58,7 +58,11 @@ bool ReleaseAddressSpaceReservation();
#if BUILDFLAG(IS_WIN)
namespace win {
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC)
using partition_alloc::win::kOomExceptionCode;
+#else
+const DWORD kOomExceptionCode = 0xe0000008;
+#endif
} // namespace win
#endif
diff --git base/rand_util.h base/rand_util.h
index d650943a7b75a..abd5217f8ceed 100644
--- base/rand_util.h
+++ base/rand_util.h
@@ -23,8 +23,9 @@
#include "base/numerics/safe_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "third_party/boringssl/src/include/openssl/rand.h"
#endif
@@ -189,7 +190,7 @@ class RandomBitGenerator {
~RandomBitGenerator() = default;
};
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
class NonAllocatingRandomBitGenerator {
public:
using result_type = uint64_t;
diff --git base/rand_util_win.cc base/rand_util_win.cc
index 0b772cbae8916..b19183b34d176 100644
--- base/rand_util_win.cc
+++ base/rand_util_win.cc
@@ -15,7 +15,11 @@
#include "base/check.h"
#include "base/feature_list.h"
+#include "cef/libcef/features/features.h"
+
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "third_party/boringssl/src/include/openssl/rand.h"
+#endif
// Prototype for ProcessPrng.
// See: https://learn.microsoft.com/en-us/windows/win32/seccng/processprng
@@ -27,6 +31,7 @@ namespace base {
namespace internal {
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
namespace {
// The BoringSSl helpers are duplicated in rand_util_fuchsia.cc and
@@ -48,6 +53,10 @@ bool UseBoringSSLForRandBytes() {
return g_use_boringssl.load(std::memory_order_relaxed);
}
+#else // !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+void ConfigureBoringSSLBackedRandBytesFieldTrial() {}
+#endif
+
} // namespace internal
namespace {
@@ -65,11 +74,13 @@ decltype(&ProcessPrng) GetProcessPrng() {
}
void RandBytesInternal(span<uint8_t> output, bool avoid_allocation) {
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
if (!avoid_allocation && internal::UseBoringSSLForRandBytes()) {
// BoringSSL's RAND_bytes always returns 1. Any error aborts the program.
(void)RAND_bytes(output.data(), output.size());
return;
}
+#endif // !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
static decltype(&ProcessPrng) process_prng_fn = GetProcessPrng();
BOOL success =
diff --git base/unguessable_token.cc base/unguessable_token.cc
index ea33ca66f384c..33f4cc76f76bd 100644
--- base/unguessable_token.cc
+++ base/unguessable_token.cc
@@ -11,8 +11,9 @@
#include "base/format_macros.h"
#include "base/rand_util.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "third_party/boringssl/src/include/openssl/mem.h"
#endif
@@ -58,7 +59,7 @@ std::optional<UnguessableToken> UnguessableToken::DeserializeFromString(
}
bool operator==(const UnguessableToken& lhs, const UnguessableToken& rhs) {
-#if BUILDFLAG(IS_NACL)
+#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD)
// BoringSSL is unavailable for NaCl builds so it remains timing dependent.
return lhs.token_ == rhs.token_;
#else
diff --git base/win/sid.cc base/win/sid.cc
index 6a91e984f5161..4433591d96c99 100644
--- base/win/sid.cc
+++ base/win/sid.cc
@@ -29,12 +29,56 @@
#include "base/win/scoped_handle.h"
#include "base/win/scoped_localalloc.h"
#include "base/win/windows_version.h"
+#include "cef/libcef/features/features.h"
+
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "third_party/boringssl/src/include/openssl/sha.h"
+#else
+#include <wincrypt.h>
+#endif
namespace base::win {
namespace {
+#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+
+#define SHA256_DIGEST_LENGTH 32
+
+bool SHA256(const uint8_t* InData, size_t InDataLen, uint8_t* OutHash) {
+ HCRYPTPROV hProv = 0;
+ HCRYPTHASH hHash = 0;
+
+ if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_AES,
+ CRYPT_VERIFYCONTEXT)) {
+ return false;
+ }
+
+ if (!CryptCreateHash(hProv, CALG_SHA_256, 0, 0, &hHash)) {
+ CryptReleaseContext(hProv, 0);
+ return false;
+ }
+
+ if (!CryptHashData(hHash, InData, static_cast<DWORD>(InDataLen), 0)) {
+ CryptDestroyHash(hHash);
+ CryptReleaseContext(hProv, 0);
+ return false;
+ }
+
+ DWORD dwHashLen = SHA256_DIGEST_LENGTH;
+ if (!CryptGetHashParam(hHash, HP_HASHVAL, OutHash, &dwHashLen, 0)) {
+ CryptDestroyHash(hHash);
+ CryptReleaseContext(hProv, 0);
+ return false;
+ }
+
+ CryptDestroyHash(hHash);
+ CryptReleaseContext(hProv, 0);
+ return true;
+}
+
+#endif // BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+
template <typename Iterator>
Sid FromSubAuthorities(const SID_IDENTIFIER_AUTHORITY& identifier_authority,
size_t sub_authority_count,
diff --git build_overrides/dawn.gni build_overrides/dawn.gni
index cec3df3e50b6e..309b4e6a4fe0d 100644
--- build_overrides/dawn.gni
+++ build_overrides/dawn.gni
@@ -2,11 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//base/allocator/partition_allocator/partition_alloc.gni")
+
# The paths to Dawn's dependencies
dawn_angle_dir = "//third_party/angle"
dawn_glfw_dir = "//third_party/dawn/third_party/glfw"
dawn_googletest_dir = "//third_party/googletest/src"
-dawn_partition_alloc_dir = "//base/allocator/partition_allocator"
+if (use_partition_alloc) {
+ dawn_partition_alloc_dir = "//base/allocator/partition_allocator"
+}
dawn_jinja2_dir = "//third_party/jinja2"
dawn_jsoncpp_dir = "//third_party/jsoncpp"
dawn_spirv_tools_dir = "//third_party/spirv-tools/src"

View File

@@ -1,5 +1,5 @@
diff --git base/test/BUILD.gn base/test/BUILD.gn
index 5c286d8d8f664..1ea302897d823 100644
index e7f8b523e899a..234e5e0e3a2e3 100644
--- base/test/BUILD.gn
+++ base/test/BUILD.gn
@@ -216,11 +216,6 @@ static_library("test_support") {
@@ -14,7 +14,7 @@ index 5c286d8d8f664..1ea302897d823 100644
deps += [
":amalgamated_perfetto_sql_stdlib",
":gen_cc_chrome_track_event_descriptor",
@@ -615,7 +610,7 @@ if (enable_base_tracing) {
@@ -616,7 +611,7 @@ if (enable_base_tracing) {
# processor depends on dev_sqlite. The two share the same symbols but have
# different implementations, so we need to hide dev_sqlite in this shared
# library even in non-component builds to prevent duplicate symbols.
@@ -23,7 +23,7 @@ index 5c286d8d8f664..1ea302897d823 100644
if (is_ios) {
_target_type = "ios_framework_bundle"
}
@@ -624,6 +619,8 @@ if (enable_base_tracing) {
@@ -625,6 +620,8 @@ if (enable_base_tracing) {
defines = [ "TEST_TRACE_PROCESSOR_IMPL" ]
testonly = true
sources = [
@@ -32,7 +32,7 @@ index 5c286d8d8f664..1ea302897d823 100644
"test_trace_processor_export.h",
"test_trace_processor_impl.cc",
"test_trace_processor_impl.h",
@@ -641,33 +638,6 @@ if (enable_base_tracing) {
@@ -642,33 +639,6 @@ if (enable_base_tracing) {
output_name = "TestTraceProcessor"
bundle_deps_filter = [ "//third_party/icu:icudata" ]
}
@@ -67,7 +67,7 @@ index 5c286d8d8f664..1ea302897d823 100644
} else if (!is_component_build && is_mac) {
# Provide a dummy target in order for clients to not have to special-case
diff --git base/test/test_trace_processor_export.h base/test/test_trace_processor_export.h
index 94b5a2ab1e751..6dacffae228ef 100644
index f5191b804bc07..aadb7d66ba4c3 100644
--- base/test/test_trace_processor_export.h
+++ base/test/test_trace_processor_export.h
@@ -5,6 +5,7 @@
@@ -78,8 +78,8 @@ index 94b5a2ab1e751..6dacffae228ef 100644
#if defined(WIN32)
#if defined(TEST_TRACE_PROCESSOR_IMPL)
@@ -17,4 +18,8 @@
#define TEST_TRACE_PROCESSOR_EXPORT __attribute__((visibility("default")))
@@ -23,4 +24,8 @@
#endif // defined(WIN32)
+#else // defined(COMPONENT_BUILD)
@@ -88,10 +88,10 @@ index 94b5a2ab1e751..6dacffae228ef 100644
+
#endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
diff --git content/shell/BUILD.gn content/shell/BUILD.gn
index d257dbbb2e6f4..886c8e8bc05d7 100644
index 205af82b45ce2..5944a9aa253f2 100644
--- content/shell/BUILD.gn
+++ content/shell/BUILD.gn
@@ -934,7 +934,6 @@ if (is_mac) {
@@ -936,7 +936,6 @@ if (is_mac) {
# Specify a sensible install_name for static builds. The library is
# dlopen()ed so this is not used to resolve the module.
ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ]

View File

@@ -1,8 +1,8 @@
diff --git base/task/thread_pool/thread_pool_impl.cc base/task/thread_pool/thread_pool_impl.cc
index e3f1345ac8f1b..e38404995b8bd 100644
index d7f9c33417f64..a6561d3dad060 100644
--- base/task/thread_pool/thread_pool_impl.cc
+++ base/task/thread_pool/thread_pool_impl.cc
@@ -109,6 +109,10 @@ ThreadPoolImpl::ThreadPoolImpl(std::string_view histogram_label,
@@ -108,6 +108,10 @@ ThreadPoolImpl::ThreadPoolImpl(std::string_view histogram_label,
ThreadGroupType::BACKGROUND, task_tracker_->GetTrackedRef(),
tracked_ref_factory_.GetTrackedRef());
}

View File

@@ -1,5 +1,5 @@
diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h
index 75e28e8088848..9abea1a35f11b 100644
index 5fef13808a906..57f16de69e1c7 100644
--- third_party/blink/public/web/web_element.h
+++ third_party/blink/public/web/web_element.h
@@ -83,6 +83,9 @@ class BLINK_EXPORT WebElement : public WebNode {
@@ -13,10 +13,10 @@ index 75e28e8088848..9abea1a35f11b 100644
void Focus();
diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc
index 6859e192048d3..2b14176b6aa0d 100644
index 2ec717ac9c654..85fb4e44aa4a0 100644
--- third_party/blink/renderer/core/exported/web_element.cc
+++ third_party/blink/renderer/core/exported/web_element.cc
@@ -124,6 +124,24 @@ void WebElement::SetAttribute(const WebString& attr_name,
@@ -122,6 +122,24 @@ void WebElement::SetAttribute(const WebString& attr_name,
IGNORE_EXCEPTION_FOR_TESTING);
}

View File

@@ -1,8 +1,8 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index 4316d8b8bc09d..d6927a4e71460 100644
index 53a73d6c75b7a..05290de4c03a0 100644
--- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc
@@ -2145,6 +2145,16 @@ bool ChildProcessSecurityPolicyImpl::PerformJailAndCitadelChecks(
@@ -2146,6 +2146,16 @@ bool ChildProcessSecurityPolicyImpl::PerformJailAndCitadelChecks(
if (actual_process_lock.matches_scheme(url::kDataScheme)) {
return true;
}
@@ -20,79 +20,53 @@ index 4316d8b8bc09d..d6927a4e71460 100644
// Make an exception to allow most visited tiles to commit in third-party
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
index 32affd3a936bd..9d0723139658c 100644
index ac9fd53f8fc22..3624ea2a10a3e 100644
--- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc
@@ -8601,7 +8601,8 @@ std::optional<url::Origin> NavigationRequest::GetOriginToCommit() {
}
url::Origin NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponse(
- network::mojom::WebSandboxFlags sandbox_flags) {
+ network::mojom::WebSandboxFlags sandbox_flags,
+ bool* cef_nonstandard) {
// Calculate an approximation of the origin. The sandbox/csp are ignored.
url::Origin origin = GetOriginForURLLoaderFactoryUnchecked();
@@ -8618,6 +8619,17 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponse(
@@ -8622,10 +8622,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
bool use_opaque_origin =
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
network::mojom::WebSandboxFlags::kOrigin;
+ if (use_opaque_origin) {
+ origin_and_debug_info.second += ", sandbox_flags";
+ }
+
+ if (!origin.GetURL().IsStandard()) {
+ if (!origin_and_debug_info.first.GetURL().IsStandard()) {
+ // Always return an opaque origin for non-standard URLs. Otherwise, the
+ // CanAccessDataForOrigin() check may fail for unregistered custom
+ // scheme requests in CEF.
+ // CanAccessDataForOrigin() check may fail for unregistered custom scheme
+ // requests in CEF.
+ use_opaque_origin = true;
+ if (cef_nonstandard) {
+ *cef_nonstandard = true;
+ }
+ origin_and_debug_info.second += ", cef_nonstandard";
+ }
+
if (use_opaque_origin) {
origin = origin.DeriveNewOpaqueOrigin();
}
@@ -8677,8 +8689,9 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponse() {
return GetRenderFrameHost()->GetLastCommittedOrigin();
origin_and_debug_info =
std::pair(origin_and_debug_info.first.DeriveNewOpaqueOrigin(),
- origin_and_debug_info.second + ", sandbox_flags");
+ origin_and_debug_info.second);
}
- url::Origin origin =
- GetOriginForURLLoaderFactoryBeforeResponse(SandboxFlagsToCommit());
+ bool cef_nonstandard = false;
+ url::Origin origin = GetOriginForURLLoaderFactoryBeforeResponse(
+ SandboxFlagsToCommit(), &cef_nonstandard);
SCOPED_CRASH_KEY_BOOL("Bug1454273", "is_in_main_frame", IsInMainFrame());
SCOPED_CRASH_KEY_STRING256(
@@ -8713,10 +8726,17 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponse() {
return origin_and_debug_info;
@@ -8733,11 +8745,20 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
DetermineInitiatorRelationship(initiator_rfh,
frame_tree_node_->current_frame_host()));
+ if (origin.opaque() && cef_nonstandard) {
+ if (origin_with_debug_info.first.opaque() &&
+ origin_with_debug_info.second.find("cef_nonstandard") !=
+ std::string::npos) {
+ // Always return an opaque origin for non-standard URLs. Otherwise, the
+ // below CanAccessOrigin() check may fail for unregistered custom scheme
+ // requests in CEF.
+ return origin;
+ // below CanAccessDataForOrigin() check may fail for unregistered custom
+ // scheme requests in CEF.
+ return origin_with_debug_info;
+ }
+
// MHTML documents should commit as an opaque origin. They should not be able
// to make network request on behalf of the real origin.
// TODO(crbug.com/370979008): Migrate to CHECK.
- DUMP_WILL_BE_CHECK(!IsMhtmlOrSubframe() || origin.opaque());
+ // DUMP_WILL_BE_CHECK(!IsMhtmlOrSubframe() || origin.opaque());
- DUMP_WILL_BE_CHECK(!IsMhtmlOrSubframe() ||
- origin_with_debug_info.first.opaque());
+ // DUMP_WILL_BE_CHECK(!IsMhtmlOrSubframe() ||
+ // origin_with_debug_info.first.opaque());
// If the target of this navigation will be rendered in a RenderFrameHost,
// then verify that the chosen origin is allowed to be accessed from that
diff --git content/browser/renderer_host/navigation_request.h content/browser/renderer_host/navigation_request.h
index 70321378be68d..b60791ca6bb88 100644
--- content/browser/renderer_host/navigation_request.h
+++ content/browser/renderer_host/navigation_request.h
@@ -2311,7 +2311,8 @@ class CONTENT_EXPORT NavigationRequest
// situations where the final frame host hasn't been determined but the origin
// is needed to create URLLoaderFactory.
url::Origin GetOriginForURLLoaderFactoryBeforeResponse(
- network::mojom::WebSandboxFlags sandbox_flags);
+ network::mojom::WebSandboxFlags sandbox_flags,
+ bool* cef_nonstandard = nullptr);
// Superset of GetOriginForURLLoaderFactoryBeforeResponse(). Calculates
// the origin with information from the final frame host. Can be called only

30
patch/patches/build.patch Normal file
View File

@@ -0,0 +1,30 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index e579cc9a9d1fd..73f42525d0071 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -131,6 +131,9 @@ declare_args() {
# The cache can lead to non-determinism: https://crbug.com/1486045
thin_lto_enable_cache = true
+ # Whether to use thin archives in combination with lld.
+ use_thin_archives = use_lld
+
# Initialize all local variables with a pattern. This flag will fill
# uninitialized floating-point types (and 32-bit pointers) with 0xFF and the
# rest with 0xAA. This makes behavior of uninitialized memory bugs consistent,
@@ -2387,6 +2390,7 @@ config("export_dynamic") {
# 2. Remove the thin_archive config, so that the .a file actually contains all
# .o files, instead of just references to .o files in the build directoy
config("thin_archive") {
+ if (use_thin_archives) {
if ((is_apple && use_lld) || (is_linux && !is_clang) || current_os == "aix") {
# The macOS and iOS linker ld64.ldd doesn't support thin archive without
# symbol table, gcc on linux also throws the error `archive has no index`.
@@ -2405,6 +2409,7 @@ config("thin_archive") {
} else if (is_win && use_lld) {
arflags = [ "/llvmlibthin" ]
}
+ }
}
# exceptions -------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index d4f8a4fc16463..ae8beed827a9e 100644
index ad39862fdd9a5..c0f75004f4fc4 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@@ -9,8 +9,8 @@ index d4f8a4fc16463..ae8beed827a9e 100644
+import("//cef/libcef/features/features.gni")
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni")
@@ -1894,6 +1895,7 @@ static_library("browser") {
import("//chrome/browser/request_header_integrity/buildflags.gni")
@@ -1879,6 +1880,7 @@ static_library("browser") {
"//build/config/compiler:compiler_buildflags",
"//build/config/linux/dbus:buildflags",
"//cc",
@@ -18,7 +18,7 @@ index d4f8a4fc16463..ae8beed827a9e 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2624,6 +2626,10 @@ static_library("browser") {
@@ -2583,6 +2585,10 @@ static_library("browser") {
sources += [ "net/net_error_diagnostics_dialog_stub.cc" ]
}

View File

@@ -13,10 +13,10 @@ index 7603c2662b8dc..9a38d816bdc40 100644
return false;
}
diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc
index e8fda706fb348..c98ef9e3f6f4d 100644
index 720839ed7b796..0d14fe57d841d 100644
--- chrome/browser/devtools/devtools_window.cc
+++ chrome/browser/devtools/devtools_window.cc
@@ -38,6 +38,7 @@
@@ -39,6 +39,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/task_manager/web_contents_tags.h"
@@ -24,7 +24,7 @@ index e8fda706fb348..c98ef9e3f6f4d 100644
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/browser/ui/tabs/tab_strip_user_gesture_details.h"
@@ -1249,6 +1250,13 @@ DevToolsWindow* DevToolsWindow::Create(
@@ -1206,6 +1207,13 @@ DevToolsWindow* DevToolsWindow::Create(
if (!browser || !browser->is_type_normal()) {
can_dock = false;
}
@@ -38,7 +38,7 @@ index e8fda706fb348..c98ef9e3f6f4d 100644
}
#endif
@@ -1713,7 +1721,9 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) {
@@ -1647,7 +1655,9 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) {
/*navigation_handle_callback=*/{})) {
#if BUILDFLAG(IS_ANDROID)
NOTIMPLEMENTED();
@@ -49,7 +49,7 @@ index e8fda706fb348..c98ef9e3f6f4d 100644
chrome::ScopedTabbedBrowserDisplayer displayer(profile_);
chrome::AddSelectedTabWithURL(displayer.browser(), fixed_url,
ui::PAGE_TRANSITION_LINK);
@@ -1900,12 +1910,26 @@ void DevToolsWindow::CreateDevToolsBrowser() {
@@ -1828,12 +1838,26 @@ void DevToolsWindow::CreateDevToolsBrowser() {
Browser::CreationStatus::kOk) {
return;
}
@@ -83,7 +83,7 @@ index e8fda706fb348..c98ef9e3f6f4d 100644
OverrideAndSyncDevToolsRendererPrefs();
}
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 13941994fd5df..831c19f2fa275 100644
index 93096ad92c1a3..9f6ad01bb1cc6 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -7,6 +7,7 @@ import("//build/config/compiler/compiler.gni")
@@ -94,7 +94,7 @@ index 13941994fd5df..831c19f2fa275 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/ash/components/assistant/assistant.gni")
@@ -281,6 +282,10 @@ static_library("ui") {
@@ -303,6 +304,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@@ -105,7 +105,7 @@ index 13941994fd5df..831c19f2fa275 100644
public_deps = [
# WARNING WARNING WARNING
# New dependencies outside of //chrome/browser should be added to
@@ -308,6 +313,7 @@ static_library("ui") {
@@ -330,6 +335,7 @@ static_library("ui") {
"//build/config/chromebox_for_meetings:buildflags",
"//build/config/linux/dbus:buildflags",
"//cc/paint",
@@ -113,7 +113,7 @@ index 13941994fd5df..831c19f2fa275 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/app:chrome_dll_resources",
@@ -687,6 +693,13 @@ static_library("ui") {
@@ -707,6 +713,13 @@ static_library("ui") {
deps += [ "//components/plus_addresses/resources:vector_icons" ]
}
@@ -127,7 +127,7 @@ index 13941994fd5df..831c19f2fa275 100644
# TODO(crbug.com/41437292): Remove this circular dependency.
# Any circular includes must depend on the target "//chrome/browser:browser_public_dependencies".
# These are all-platform circular includes.
@@ -5506,6 +5519,7 @@ static_library("ui") {
@@ -5539,6 +5552,7 @@ static_library("ui") {
if (enable_printing) {
deps += [
"//components/printing/browser",
@@ -136,10 +136,10 @@ index 13941994fd5df..831c19f2fa275 100644
]
}
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index 8c5e577eb89cf..9e18f03f0c8da 100644
index 435235c067f70..63d2b0381c277 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -279,6 +279,25 @@
@@ -273,6 +273,25 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif
@@ -165,7 +165,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_browser_window_helper.h"
#endif
@@ -627,6 +646,10 @@ Browser::Browser(const CreateParams& params)
@@ -572,6 +591,10 @@ Browser::Browser(const CreateParams& params)
type_(params.type),
profile_(params.profile),
window_(nullptr),
@@ -176,7 +176,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
tab_strip_model_delegate_(
std::make_unique<chrome::BrowserTabStripModelDelegate>(this)),
tab_strip_model_(std::make_unique<TabStripModel>(
@@ -864,6 +887,12 @@ Browser::~Browser() {
@@ -819,6 +842,12 @@ Browser::~Browser() {
if (select_file_dialog_.get()) {
select_file_dialog_->ListenerDestroyed();
}
@@ -189,7 +189,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
///////////////////////////////////////////////////////////////////////////////
@@ -1336,6 +1365,10 @@ BrowserWindowInterface::Type Browser::GetType() const {
@@ -1284,6 +1313,10 @@ BrowserWindowInterface::Type Browser::GetType() const {
return type_;
}
@@ -200,7 +200,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
BrowserUserEducationInterface* Browser::GetUserEducationInterface() {
return window();
}
@@ -1522,6 +1555,8 @@ void Browser::WindowFullscreenStateChanged() {
@@ -1466,6 +1499,8 @@ void Browser::WindowFullscreenStateChanged() {
->WindowFullscreenStateChanged();
command_controller_->FullscreenStateChanged();
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
@@ -209,7 +209,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
void Browser::FullscreenTopUIStateChanged() {
@@ -1905,6 +1940,15 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
@@ -1837,6 +1872,15 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
return content::KeyboardEventProcessingResult::HANDLED;
}
@@ -225,7 +225,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
return window()->PreHandleKeyboardEvent(event);
}
@@ -1912,8 +1956,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
@@ -1844,8 +1888,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source);
@@ -246,7 +246,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
bool Browser::TabsNeedBeforeUnloadFired() const {
@@ -2008,9 +2062,14 @@ bool Browser::IsBackForwardCacheSupported(content::WebContents& web_contents) {
@@ -1940,9 +1994,14 @@ bool Browser::IsBackForwardCacheSupported(content::WebContents& web_contents) {
content::PreloadingEligibility Browser::IsPrerender2Supported(
content::WebContents& web_contents,
content::PreloadingTriggerType trigger_type) {
@@ -261,7 +261,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
bool Browser::ShouldShowStaleContentOnEviction(content::WebContents* source) {
@@ -2073,6 +2132,14 @@ WebContents* Browser::OpenURLFromTab(
@@ -2005,6 +2064,14 @@ WebContents* Browser::OpenURLFromTab(
std::move(navigation_handle_callback));
}
@@ -276,7 +276,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source;
@@ -2246,6 +2313,8 @@ void Browser::LoadingStateChanged(WebContents* source,
@@ -2178,6 +2245,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool should_show_loading_ui) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
@@ -285,7 +285,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
void Browser::CloseContents(WebContents* source) {
@@ -2255,6 +2324,13 @@ void Browser::CloseContents(WebContents* source) {
@@ -2187,6 +2256,13 @@ void Browser::CloseContents(WebContents* source) {
}
void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -299,7 +299,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
if (is_type_normal()) {
return;
}
@@ -2275,6 +2351,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -2207,6 +2283,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -308,7 +308,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
std::vector<StatusBubble*> status_bubbles = GetStatusBubbles();
for (StatusBubble* status_bubble : status_bubbles) {
StatusBubbleViews* status_bubble_views =
@@ -2288,6 +2366,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -2220,6 +2298,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
}
}
@@ -326,7 +326,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
void Browser::ContentsMouseEvent(WebContents* source, const ui::Event& event) {
const ui::EventType type = event.type();
const bool exited = type == ui::EventType::kMouseExited;
@@ -2321,9 +2410,23 @@ void Browser::ContentsZoomChange(bool zoom_in) {
@@ -2253,9 +2342,23 @@ void Browser::ContentsZoomChange(bool zoom_in) {
}
bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
@@ -350,7 +350,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
void Browser::BeforeUnloadFired(WebContents* web_contents,
bool proceed,
bool* proceed_to_fire_unload) {
@@ -2466,12 +2569,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
@@ -2372,12 +2475,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// to track `new_contents` after it is added to its TabModel this override can
// be removed.
CreateSessionServiceTabHelper(new_contents);
@@ -375,7 +375,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
// Don't show the page hung dialog when a HTML popup hangs because
// the dialog will take the focus and immediately close the popup.
RenderWidgetHostView* view = render_widget_host->GetView();
@@ -2484,6 +2599,13 @@ void Browser::RendererUnresponsive(
@@ -2390,6 +2505,13 @@ void Browser::RendererUnresponsive(
void Browser::RendererResponsive(
WebContents* source,
content::RenderWidgetHost* render_widget_host) {
@@ -389,7 +389,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
RenderWidgetHostView* view = render_widget_host->GetView();
if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) {
TabDialogs::FromWebContents(source)->HideHungRendererDialog(
@@ -2493,6 +2615,15 @@ void Browser::RendererResponsive(
@@ -2399,6 +2521,15 @@ void Browser::RendererResponsive(
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
WebContents* source) {
@@ -405,7 +405,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
return javascript_dialogs::TabModalDialogManager::FromWebContents(source);
}
@@ -2528,6 +2659,11 @@ void Browser::DraggableRegionsChanged(
@@ -2434,6 +2565,11 @@ void Browser::DraggableRegionsChanged(
if (app_controller_) {
app_controller_->DraggableRegionsChanged(regions, contents);
}
@@ -417,7 +417,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
std::vector<blink::mojom::RelatedApplicationPtr>
@@ -2642,11 +2778,15 @@ void Browser::EnterFullscreenModeForTab(
@@ -2548,11 +2684,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@@ -433,7 +433,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2857,6 +2997,16 @@ void Browser::RequestMediaAccessPermission(
@@ -2762,6 +2902,16 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) {
@@ -450,7 +450,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
const extensions::Extension* extension =
GetExtensionForOrigin(profile_, request.security_origin);
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
@@ -3447,9 +3597,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
@@ -3352,9 +3502,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
// Browser, Getters for UI (private):
std::vector<StatusBubble*> Browser::GetStatusBubbles() {
@@ -463,7 +463,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
// We hide the status bar for web apps windows as this matches native
@@ -3457,6 +3609,12 @@ std::vector<StatusBubble*> Browser::GetStatusBubbles() {
@@ -3362,6 +3514,12 @@ std::vector<StatusBubble*> Browser::GetStatusBubbles() {
// mode, as the minimal browser UI includes the status bar.
if (web_app::AppBrowserController::IsWebApp(this) &&
!app_controller()->HasMinimalUiButtons()) {
@@ -476,7 +476,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
return {};
}
@@ -3610,6 +3768,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
@@ -3515,6 +3673,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
web_contents_collection_.StopObserving(web_contents);
}
@@ -485,7 +485,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
}
void Browser::TabDetachedAtImpl(content::WebContents* contents,
@@ -3771,6 +3931,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
@@ -3676,6 +3836,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
bool check_can_support) const {
@@ -501,7 +501,7 @@ index 8c5e577eb89cf..9e18f03f0c8da 100644
case TYPE_NORMAL:
return NormalBrowserSupportsWindowFeature(feature, check_can_support);
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 1de7f9596b2f8..9dba7bad5931b 100644
index c4cea0b6e8c4c..2beda8338cb08 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -24,6 +24,7 @@
@@ -523,7 +523,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
#if BUILDFLAG(IS_ANDROID)
#error This file should only be included on desktop.
#endif
@@ -350,6 +355,15 @@ class Browser : public TabStripModelObserver,
@@ -351,6 +356,15 @@ class Browser : public TabStripModelObserver,
// Document Picture in Picture options, specific to TYPE_PICTURE_IN_PICTURE.
std::optional<blink::mojom::PictureInPictureWindowOptions> pip_options;
@@ -539,7 +539,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
private:
friend class Browser;
friend class WindowSizerChromeOSTest;
@@ -433,6 +447,13 @@ class Browser : public TabStripModelObserver,
@@ -434,6 +448,13 @@ class Browser : public TabStripModelObserver,
update_ui_immediately_for_testing_ = true;
}
@@ -553,7 +553,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
// Accessors ////////////////////////////////////////////////////////////////
const CreateParams& create_params() const { return create_params_; }
@@ -526,6 +547,12 @@ class Browser : public TabStripModelObserver,
@@ -535,6 +556,12 @@ class Browser : public TabStripModelObserver,
base::WeakPtr<Browser> AsWeakPtr();
base::WeakPtr<const Browser> AsWeakPtr() const;
@@ -566,7 +566,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
// Get the FindBarController for this browser, creating it if it does not
// yet exist.
FindBarController* GetFindBarController();
@@ -886,6 +913,7 @@ class Browser : public TabStripModelObserver,
@@ -891,6 +918,7 @@ class Browser : public TabStripModelObserver,
ImmersiveModeController* GetImmersiveModeController() override;
BrowserActions* GetActions() override;
Type GetType() const override;
@@ -574,7 +574,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
BrowserUserEducationInterface* GetUserEducationInterface() override;
web_app::AppBrowserController* GetAppBrowserController() override;
std::vector<tabs::TabInterface*> GetAllTabInterfaces() override;
@@ -1011,10 +1039,18 @@ class Browser : public TabStripModelObserver,
@@ -1012,10 +1040,18 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@@ -604,7 +604,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
std::unique_ptr<TabStripModelDelegate> const tab_strip_model_delegate_;
std::unique_ptr<TabStripModel> const tab_strip_model_;
@@ -1426,6 +1466,8 @@ class Browser : public TabStripModelObserver,
@@ -1428,6 +1468,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_;
@@ -614,7 +614,7 @@ index 1de7f9596b2f8..9dba7bad5931b 100644
UnloadController unload_controller_;
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index 5f848bb04fe2a..4bf63873097bb 100644
index 474e4ba66d7af..ca68cd989693e 100644
--- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc
@@ -255,6 +255,10 @@ std::tuple<Browser*, int> GetBrowserAndTabForDisposition(
@@ -684,10 +684,10 @@ index 83a510defbda5..f4305701c5f5a 100644
params.source_contents = source_contents;
params.url = target_url;
diff --git chrome/browser/ui/browser_window/browser_window_features.cc chrome/browser/ui/browser_window/browser_window_features.cc
index 57e4a41495830..7b8c001d4f62a 100644
index db33c12d1d71b..af0c2f5203e0d 100644
--- chrome/browser/ui/browser_window/browser_window_features.cc
+++ chrome/browser/ui/browser_window/browser_window_features.cc
@@ -105,6 +105,15 @@ BrowserWindowFeatures::CreateBrowserWindowFeatures() {
@@ -99,6 +99,15 @@ BrowserWindowFeatures::CreateBrowserWindowFeatures() {
BrowserWindowFeatures::~BrowserWindowFeatures() = default;
@@ -703,7 +703,7 @@ index 57e4a41495830..7b8c001d4f62a 100644
// static
void BrowserWindowFeatures::ReplaceBrowserWindowFeaturesForTesting(
BrowserWindowFeaturesFactory factory) {
@@ -205,10 +214,12 @@ void BrowserWindowFeatures::Init(BrowserWindowInterface* browser) {
@@ -189,10 +198,12 @@ void BrowserWindowFeatures::Init(BrowserWindowInterface* browser) {
}
void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) {
@@ -717,16 +717,16 @@ index 57e4a41495830..7b8c001d4f62a 100644
if (IsChromeLabsEnabled()) {
chrome_labs_coordinator_ =
std::make_unique<ChromeLabsCoordinator>(browser);
@@ -263,7 +274,7 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) {
@@ -234,7 +245,7 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) {
}
}
- if (browser->is_type_normal() || browser->is_type_app()) {
+ if (supports_toolbar || browser->is_type_app()) {
- if ((browser->is_type_normal() || browser->is_type_app()) &&
+ if ((supports_toolbar || browser->is_type_app()) &&
base::FeatureList::IsEnabled(toast_features::kToastFramework)) {
toast_service_ = std::make_unique<ToastService>(browser);
}
}
@@ -295,10 +306,12 @@ void BrowserWindowFeatures::InitPostBrowserViewConstruction(
@@ -267,10 +278,12 @@ void BrowserWindowFeatures::InitPostBrowserViewConstruction(
browser_view->browser(),
side_panel_coordinator_->GetWindowRegistry());
@@ -738,13 +738,13 @@ index 57e4a41495830..7b8c001d4f62a 100644
- if (browser_view->GetIsNormalType()) {
+ if (supports_toolbar) {
#if BUILDFLAG(ENABLE_GLIC)
glic::GlicKeyedService* glic_service =
glic::GlicKeyedService::Get(browser_view->GetProfile());
if (glic::GlicEnabling::IsProfileEligible(
browser_view->browser()->profile())) {
diff --git chrome/browser/ui/browser_window/public/browser_window_features.h chrome/browser/ui/browser_window/public/browser_window_features.h
index f72f8787ba80a..0d9b32b79b062 100644
index 0da8c64756ee2..2566fff471c8e 100644
--- chrome/browser/ui/browser_window/public/browser_window_features.h
+++ chrome/browser/ui/browser_window/public/browser_window_features.h
@@ -93,6 +93,8 @@ class BrowserWindowFeatures {
@@ -90,6 +90,8 @@ class BrowserWindowFeatures {
static std::unique_ptr<BrowserWindowFeatures> CreateBrowserWindowFeatures();
virtual ~BrowserWindowFeatures();
@@ -754,10 +754,10 @@ index f72f8787ba80a..0d9b32b79b062 100644
BrowserWindowFeatures& operator=(const BrowserWindowFeatures&) = delete;
diff --git chrome/browser/ui/browser_window/public/browser_window_interface.h chrome/browser/ui/browser_window/public/browser_window_interface.h
index 7e1194112343a..0a0e8c1818a3c 100644
index d1862cd7b90b2..fcaa4b4ac3ade 100644
--- chrome/browser/ui/browser_window/public/browser_window_interface.h
+++ chrome/browser/ui/browser_window/public/browser_window_interface.h
@@ -229,6 +229,10 @@ class BrowserWindowInterface : public content::PageNavigator {
@@ -211,6 +211,10 @@ class BrowserWindowInterface : public content::PageNavigator {
};
virtual Type GetType() const = 0;

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
index eaaab56c72145..6122e12186952 100644
index 49c051ea6eabc..b98a2bfc2d131 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -358,6 +358,18 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
@@ -352,6 +352,18 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get();
}
@@ -21,7 +21,7 @@ index eaaab56c72145..6122e12186952 100644
enum class UmaEnumIdLookupType {
GeneralEnumId,
ContextSpecificEnumId,
@@ -632,6 +644,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
@@ -624,6 +636,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
return 1;
}
@@ -32,7 +32,7 @@ index eaaab56c72145..6122e12186952 100644
id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id);
@@ -906,6 +922,14 @@ RenderViewContextMenu::RenderViewContextMenu(
@@ -895,6 +911,14 @@ RenderViewContextMenu::RenderViewContextMenu(
: nullptr;
#endif // BUILDFLAG(IS_CHROMEOS)
@@ -47,7 +47,7 @@ index eaaab56c72145..6122e12186952 100644
observers_.AddObserver(&autofill_context_menu_manager_);
}
@@ -1373,6 +1397,12 @@ void RenderViewContextMenu::InitMenu() {
@@ -1353,6 +1377,12 @@ void RenderViewContextMenu::InitMenu() {
autofill_client->HideAutofillSuggestions(
autofill::SuggestionHidingReason::kContextMenuOpened);
}
@@ -60,7 +60,7 @@ index eaaab56c72145..6122e12186952 100644
}
Profile* RenderViewContextMenu::GetProfile() const {
@@ -3678,6 +3708,26 @@ void RenderViewContextMenu::RemoveObserverForTesting(
@@ -3649,6 +3679,26 @@ void RenderViewContextMenu::RemoveObserverForTesting(
observers_.RemoveObserver(observer);
}
@@ -88,10 +88,10 @@ index eaaab56c72145..6122e12186952 100644
RenderViewContextMenu::GetHandlersForLinkUrl() {
custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
index 912be87540a05..ea077beb2c359 100644
index 9bf603dbf73a5..3f9b1ff9f384d 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -159,7 +159,21 @@ class RenderViewContextMenu
@@ -158,7 +158,21 @@ class RenderViewContextMenu
void AddObserverForTesting(RenderViewContextMenuObserver* observer);
void RemoveObserverForTesting(RenderViewContextMenuObserver* observer);
@@ -113,7 +113,7 @@ index 912be87540a05..ea077beb2c359 100644
Profile* GetProfile() const;
// This may return nullptr (e.g. for WebUI dialogs). Virtual to allow tests to
@@ -492,6 +506,9 @@ class RenderViewContextMenu
@@ -483,6 +497,9 @@ class RenderViewContextMenu
// built.
bool is_protocol_submenu_valid_ = false;

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/devtools/chrome_devtools_manager_delegate.cc chrome/browser/devtools/chrome_devtools_manager_delegate.cc
index 15a0b7ed9aa02..f5d9805ef1489 100644
index f61d3618965cd..7c632c85d5e48 100644
--- chrome/browser/devtools/chrome_devtools_manager_delegate.cc
+++ chrome/browser/devtools/chrome_devtools_manager_delegate.cc
@@ -13,6 +13,7 @@
@@ -14,6 +14,7 @@
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -10,7 +10,7 @@ index 15a0b7ed9aa02..f5d9805ef1489 100644
#include "chrome/browser/browser_features.h"
#include "chrome/browser/devtools/chrome_devtools_session.h"
#include "chrome/browser/devtools/device/android_device_manager.h"
@@ -64,6 +65,10 @@
@@ -65,6 +66,10 @@
#include "chromeos/constants/chromeos_features.h"
#endif
@@ -21,7 +21,7 @@ index 15a0b7ed9aa02..f5d9805ef1489 100644
using content::DevToolsAgentHost;
const char ChromeDevToolsManagerDelegate::kTypeApp[] = "app";
@@ -258,6 +263,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType(
@@ -259,6 +264,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType(
return DevToolsAgentHost::kTypePage;
}

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
index dc7205b1011d6..f3106cdd120a2 100644
index 8c06a19a64e5d..2b9429f7b2bab 100644
--- chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
+++ chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
@@ -6,6 +6,7 @@
@@ -8,8 +8,8 @@ index dc7205b1011d6..f3106cdd120a2 100644
+#include "cef/libcef/features/features.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
@@ -28,6 +29,22 @@
#include "chrome/browser/safe_browsing/user_interaction_observer.h"
#endif
@@ -33,7 +33,7 @@ index dc7205b1011d6..f3106cdd120a2 100644
JavaScriptTabModalDialogManagerDelegateDesktop::
JavaScriptTabModalDialogManagerDelegateDesktop(
content::WebContents* web_contents)
@@ -78,6 +95,9 @@ void JavaScriptTabModalDialogManagerDelegateDesktop::SetTabNeedsAttention(
@@ -77,6 +94,9 @@ void JavaScriptTabModalDialogManagerDelegateDesktop::SetTabNeedsAttention(
bool JavaScriptTabModalDialogManagerDelegateDesktop::IsWebContentsForemost() {
Browser* browser = BrowserList::GetInstance()->GetLastActive();
if (!browser) {
@@ -43,7 +43,7 @@ index dc7205b1011d6..f3106cdd120a2 100644
// It's rare, but there are crashes from where sites are trying to show
// dialogs in the split second of time between when their Browser is gone
// and they're gone. In that case, bail. https://crbug.com/1142806
@@ -96,7 +116,11 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsApp() {
@@ -92,7 +112,11 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsApp() {
}
bool JavaScriptTabModalDialogManagerDelegateDesktop::CanShowModalUI() {

View File

@@ -12,7 +12,7 @@ index cc58a303a78b6..7755e58c8651c 100644
// on the screen, we can't actually attach to it.
parent_window = nullptr;
diff --git components/constrained_window/constrained_window_views.cc components/constrained_window/constrained_window_views.cc
index 4421cf1ad1bf1..136c93d146813 100644
index 6e91ffc4b8bfe..a1616f77c87ae 100644
--- components/constrained_window/constrained_window_views.cc
+++ components/constrained_window/constrained_window_views.cc
@@ -103,10 +103,17 @@ class ModalDialogHostObserverViews : public ModalDialogHostObserver {
@@ -142,7 +142,7 @@ index 4421cf1ad1bf1..136c93d146813 100644
auto dialog = views::BubbleDialogModelHost::CreateModal(
std::move(dialog_model), ui::mojom::ModalType::kWindow,
will_use_custom_frame);
@@ -333,8 +335,12 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -326,8 +328,12 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeView parent_view =
parent ? CurrentBrowserModalClient()->GetDialogHostView(parent)
: gfx::NativeView();
@@ -156,7 +156,7 @@ index 4421cf1ad1bf1..136c93d146813 100644
widget->SetNativeWindowProperty(
views::kWidgetIdentifierKey,
const_cast<void*>(kConstrainedWindowWidgetIdentifier));
@@ -351,8 +357,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -344,8 +350,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
return widget;
ModalDialogHost* host =
@@ -195,27 +195,25 @@ index 2b495a8ab092c..01a28aca853d0 100644
OnPositionRequiresUpdate();
diff --git components/web_modal/modal_dialog_host.h components/web_modal/modal_dialog_host.h
index c618c00223779..05b2b1e5d8865 100644
index 51ed6bcf6b540..c6e1161140655 100644
--- components/web_modal/modal_dialog_host.h
+++ components/web_modal/modal_dialog_host.h
@@ -35,6 +35,12 @@ class WEB_MODAL_EXPORT ModalDialogHost {
@@ -34,6 +34,10 @@ class WEB_MODAL_EXPORT ModalDialogHost {
// Returns the view against which the dialog is positioned and parented.
virtual gfx::NativeView GetHostView() const = 0;
+ // Returns the widget against which the dialog is positioned and parented.
+ // Used with CEF windowless rendering.
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() const {
+ return gfx::kNullAcceleratedWidget;
+ }
+
+ return gfx::kNullAcceleratedWidget; }
// Gets the position for the dialog in coordinates relative to the host view.
virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
// Returns whether a dialog currently about to be shown should be activated.
diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc
index fa171a2990d47..3b170e3d6a920 100644
index 7b22be3acdb6c..5e8ac69f52691 100644
--- ui/views/window/dialog_delegate.cc
+++ ui/views/window/dialog_delegate.cc
@@ -90,10 +90,12 @@ DialogDelegate::DialogDelegate() {
@@ -89,10 +89,12 @@ DialogDelegate::DialogDelegate() {
// static
Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
gfx::NativeWindow context,
@@ -230,7 +228,7 @@ index fa171a2990d47..3b170e3d6a920 100644
widget->Init(std::move(params));
return widget;
}
@@ -102,15 +104,17 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
@@ -101,15 +103,17 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
Widget* DialogDelegate::CreateDialogWidget(
std::unique_ptr<WidgetDelegate> delegate,
gfx::NativeWindow context,
@@ -252,7 +250,7 @@ index fa171a2990d47..3b170e3d6a920 100644
#else
return true;
#endif
@@ -121,7 +125,8 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
@@ -120,7 +124,8 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
WidgetDelegate* delegate,
gfx::NativeWindow context,
gfx::NativeView parent,
@@ -262,7 +260,7 @@ index fa171a2990d47..3b170e3d6a920 100644
DialogDelegate* dialog = delegate->AsDialogDelegate();
views::Widget::InitParams params(
@@ -131,7 +136,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
@@ -130,7 +135,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
params.bounds = bounds;
if (dialog) {
@@ -271,7 +269,7 @@ index fa171a2990d47..3b170e3d6a920 100644
}
if (!dialog || dialog->use_custom_frame()) {
@@ -145,6 +150,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
@@ -144,6 +149,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
}
params.context = context;
params.parent = parent;
@@ -280,11 +278,11 @@ index fa171a2990d47..3b170e3d6a920 100644
// Web-modal (ui::mojom::ModalType::kChild) dialogs with parents are marked as
// child widgets to prevent top-level window behavior (independent movement,
diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h
index 92d4dc5da0cd6..b18c3f6178ec2 100644
index 304b4c2115b87..844fb19461ac3 100644
--- ui/views/window/dialog_delegate.h
+++ ui/views/window/dialog_delegate.h
@@ -308,13 +308,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
// WidgetDelegate::SetOwnedByWidget().
@@ -312,13 +312,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
// your use case.
static Widget* CreateDialogWidget(std::unique_ptr<WidgetDelegate> delegate,
gfx::NativeWindow context,
- gfx::NativeView parent);
@@ -305,7 +303,7 @@ index 92d4dc5da0cd6..b18c3f6178ec2 100644
// Returns the dialog widget InitParams for a given |context| or |parent|.
// If |bounds| is not empty, used to initially place the dialog, otherwise
@@ -322,7 +327,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
@@ -326,7 +331,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
static Widget::InitParams GetDialogWidgetInitParams(WidgetDelegate* delegate,
gfx::NativeWindow context,
gfx::NativeView parent,

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/download/chrome_download_manager_delegate.cc chrome/browser/download/chrome_download_manager_delegate.cc
index 7d2a74932285f..a68ff88c449c6 100644
index 2ca95e6bb673a..2207b0f637a91 100644
--- chrome/browser/download/chrome_download_manager_delegate.cc
+++ chrome/browser/download/chrome_download_manager_delegate.cc
@@ -29,6 +29,7 @@
@@ -30,6 +30,7 @@
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -10,7 +10,7 @@ index 7d2a74932285f..a68ff88c449c6 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/download/download_core_service.h"
@@ -164,6 +165,10 @@
@@ -166,6 +167,10 @@
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
#endif // BUILDFLAG(SAFE_BROWSING_DOWNLOAD_PROTECTION)
@@ -21,7 +21,7 @@ index 7d2a74932285f..a68ff88c449c6 100644
using content::BrowserThread;
using content::DownloadManager;
using download::DownloadItem;
@@ -540,6 +545,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
@@ -531,6 +536,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
download_dialog_bridge_ = std::make_unique<DownloadDialogBridge>();
download_message_bridge_ = std::make_unique<DownloadMessageBridge>();
#endif
@@ -33,7 +33,7 @@ index 7d2a74932285f..a68ff88c449c6 100644
}
ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() {
@@ -603,6 +613,9 @@ void ChromeDownloadManagerDelegate::Shutdown() {
@@ -594,6 +604,9 @@ void ChromeDownloadManagerDelegate::Shutdown() {
download_manager_->RemoveObserver(this);
download_manager_ = nullptr;
}
@@ -43,7 +43,7 @@ index 7d2a74932285f..a68ff88c449c6 100644
}
void ChromeDownloadManagerDelegate::OnDownloadCanceledAtShutdown(
@@ -671,6 +684,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
@@ -662,6 +675,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload);
}
@@ -56,7 +56,7 @@ index 7d2a74932285f..a68ff88c449c6 100644
DownloadTargetDeterminer::CompletionCallback target_determined_callback =
base::BindOnce(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined,
weak_ptr_factory_.GetWeakPtr(), download->GetId(),
@@ -1193,8 +1212,13 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
@@ -1167,8 +1186,13 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
return;
}
@@ -72,7 +72,7 @@ index 7d2a74932285f..a68ff88c449c6 100644
net::FilePathToFileURL(download->GetTargetFilePath()),
content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
diff --git chrome/browser/download/chrome_download_manager_delegate.h chrome/browser/download/chrome_download_manager_delegate.h
index c9f4aeab7ebff..84b975aab4579 100644
index b3a0d699d9d13..2f42dcf185264 100644
--- chrome/browser/download/chrome_download_manager_delegate.h
+++ chrome/browser/download/chrome_download_manager_delegate.h
@@ -19,6 +19,7 @@
@@ -96,7 +96,7 @@ index c9f4aeab7ebff..84b975aab4579 100644
// This is the Chrome side helper for the download system.
class ChromeDownloadManagerDelegate
: public content::DownloadManagerDelegate,
@@ -413,6 +420,10 @@ class ChromeDownloadManagerDelegate
@@ -405,6 +412,10 @@ class ChromeDownloadManagerDelegate
// Whether a file picker dialog is showing.
bool is_file_picker_showing_;

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/extensions/api/chrome_extensions_api_client.cc chrome/browser/extensions/api/chrome_extensions_api_client.cc
index 7101a6c177bca..852f80543db32 100644
index acd5954b3423a..215edaa4badc5 100644
--- chrome/browser/extensions/api/chrome_extensions_api_client.cc
+++ chrome/browser/extensions/api/chrome_extensions_api_client.cc
@@ -16,6 +16,7 @@
@@ -8,9 +8,9 @@ index 7101a6c177bca..852f80543db32 100644
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.h"
#include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h"
#include "chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h"
#include "chrome/browser/extensions/api/declarative_content/default_content_predicate_evaluators.h"
@@ -82,6 +83,10 @@
@@ -90,6 +91,10 @@
#include "chromeos/ash/components/settings/cros_settings.h"
#endif
@@ -21,7 +21,7 @@ index 7101a6c177bca..852f80543db32 100644
#if BUILDFLAG(ENABLE_PRINTING)
#include "chrome/browser/printing/printing_init.h"
#endif
@@ -298,7 +303,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate() const {
@@ -317,7 +322,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate() const {
std::unique_ptr<MimeHandlerViewGuestDelegate>
ChromeExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const {
@@ -34,7 +34,7 @@ index 7101a6c177bca..852f80543db32 100644
std::unique_ptr<WebViewGuestDelegate>
diff --git chrome/browser/extensions/api/tabs/tabs_api.cc chrome/browser/extensions/api/tabs/tabs_api.cc
index ad1f4b4c3e979..55657d976c405 100644
index 4ac2686025ef0..94aa0016881b6 100644
--- chrome/browser/extensions/api/tabs/tabs_api.cc
+++ chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -1714,7 +1714,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -84,10 +84,10 @@ index ad1f4b4c3e979..55657d976c405 100644
current_url, updated_url, js_callstack());
}
diff --git chrome/browser/extensions/extension_tab_util.cc chrome/browser/extensions/extension_tab_util.cc
index 959e848a6e9b4..5f73667a599e7 100644
index fc375bf87a2d1..5f32c45dc2fa6 100644
--- chrome/browser/extensions/extension_tab_util.cc
+++ chrome/browser/extensions/extension_tab_util.cc
@@ -39,6 +39,7 @@
@@ -38,6 +38,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/types/expected_macros.h"
@@ -95,7 +95,7 @@ index 959e848a6e9b4..5f73667a599e7 100644
#include "chrome/browser/browser_process.h" // nogncheck
#include "chrome/browser/extensions/browser_extension_window_controller.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
@@ -88,6 +89,10 @@
@@ -87,6 +88,10 @@
#include "url/url_constants.h"
#endif
@@ -106,9 +106,9 @@ index 959e848a6e9b4..5f73667a599e7 100644
using content::NavigationEntry;
using content::WebContents;
using extensions::mojom::APIPermissionID;
@@ -774,6 +779,14 @@ bool ExtensionTabUtil::GetTabById(int tab_id,
@@ -738,6 +743,14 @@ bool ExtensionTabUtil::GetTabById(int tab_id,
}
}
#endif // BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(ENABLE_CEF)
+ if (cef::GetAlloyTabById(tab_id, profile, include_incognito, out_contents)) {
@@ -122,7 +122,7 @@ index 959e848a6e9b4..5f73667a599e7 100644
// Prerendering tab is not visible and it cannot be in `TabStripModel`, if
// the tab id exists as a prerendering tab, and the API will returns
diff --git chrome/browser/ui/tab_helpers.h chrome/browser/ui/tab_helpers.h
index ec26ac19c0780..928536d17dbb1 100644
index 63848c93738ce..0358e098c7339 100644
--- chrome/browser/ui/tab_helpers.h
+++ chrome/browser/ui/tab_helpers.h
@@ -6,6 +6,7 @@
@@ -144,7 +144,7 @@ index ec26ac19c0780..928536d17dbb1 100644
// A "tab contents" is a WebContents that is used as a tab in a browser window
// (or the equivalent on Android). The TabHelpers class allows specific classes
// to attach the set of tab helpers that is used for tab contents.
@@ -80,6 +85,10 @@ class TabHelpers {
@@ -79,6 +84,10 @@ class TabHelpers {
// Link Preview shows a preview of a page, then promote it as a new tab.
friend class PreviewTab;

View File

@@ -17,10 +17,10 @@ index fbce13c16ad10..0512b2f09937e 100644
std::unique_ptr<permissions::PermissionPrompt> CreatePermissionPrompt(
content::WebContents* web_contents,
diff --git chrome/browser/ui/views/permissions/permission_prompt_factory.cc chrome/browser/ui/views/permissions/permission_prompt_factory.cc
index 13f978218b7a8..6bf2339ae2fd2 100644
index b939a33a372d9..11483872d8782 100644
--- chrome/browser/ui/views/permissions/permission_prompt_factory.cc
+++ chrome/browser/ui/views/permissions/permission_prompt_factory.cc
@@ -222,11 +222,28 @@ std::unique_ptr<permissions::PermissionPrompt> CreateQuietPrompt(
@@ -223,11 +223,28 @@ std::unique_ptr<permissions::PermissionPrompt> CreateQuietPrompt(
}
}

View File

@@ -390,18 +390,6 @@ index e9c18e829eff9..9ed452be61adf 100644
DIR_POLICY_FILES, // Directory for system-wide read-only
// policy files that allow sys-admins
// to set policies for chrome. This directory
diff --git components/policy/BUILD.gn components/policy/BUILD.gn
index b9d5654a206d2..5b91b567e45ff 100644
--- components/policy/BUILD.gn
+++ components/policy/BUILD.gn
@@ -263,6 +263,7 @@ static_library("generated") {
":cloud_policy_proto_generated_compile",
":policy_code_generate",
"//base",
+ "//cef/libcef/features:buildflags",
"//components/policy/core/common:common_constants",
"//components/policy/proto:policy_common_definitions_compile_proto",
"//third_party/protobuf:protobuf_lite",
diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py
index 41f2f032eeaa6..cd191b61b9c1e 100755
--- components/policy/tools/generate_policy_source.py

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/printing/print_backend_service_manager.cc chrome/browser/printing/print_backend_service_manager.cc
index 089578602393b..b4b0a7abe4822 100644
index 8e75f8b83bc77..19dec27e26680 100644
--- chrome/browser/printing/print_backend_service_manager.cc
+++ chrome/browser/printing/print_backend_service_manager.cc
@@ -75,7 +75,15 @@ PrintBackendServiceManager* g_print_backend_service_manager_singleton = nullptr;

View File

@@ -59,10 +59,10 @@ index affba30438a4a..bdf433d20b97c 100644
ax::mojom::NameFrom::kAttribute);
diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
index 81f886e9fb712..8c919733f1818 100644
index 133b80d279bf6..be46fc65f890d 100644
--- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
+++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
@@ -54,7 +54,9 @@ void ProfileMenuCoordinator::Show(
@@ -60,7 +60,9 @@ void ProfileMenuCoordinator::Show(
std::unique_ptr<ProfileMenuViewBase> bubble;
bool is_incognito = browser.profile()->IsIncognitoProfile();

View File

@@ -52,7 +52,7 @@ index 363a7c4ac583f..1c263547c8f54 100644
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
return CreateUnique(kDevToolsOTRProfileIDPrefix);
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
index 7e700d9b9ed86..99f8cb55f7c9e 100644
index c8d72ed59252f..d785187710a79 100644
--- chrome/browser/profiles/profile.h
+++ chrome/browser/profiles/profile.h
@@ -93,6 +93,10 @@ class Profile : public content::BrowserContext {
@@ -66,7 +66,7 @@ index 7e700d9b9ed86..99f8cb55f7c9e 100644
// Creates a unique OTR profile id to be used for DevTools browser contexts.
static OTRProfileID CreateUniqueForDevTools();
@@ -502,6 +506,9 @@ class Profile : public content::BrowserContext {
@@ -509,6 +513,9 @@ class Profile : public content::BrowserContext {
static Profile* FromJavaObject(const jni_zero::JavaRef<jobject>& obj);
jni_zero::ScopedJavaLocalRef<jobject> GetJavaObject() const;
#endif // BUILDFLAG(IS_ANDROID)
@@ -76,7 +76,7 @@ index 7e700d9b9ed86..99f8cb55f7c9e 100644
protected:
// Creates an OffTheRecordProfile which points to this Profile.
static std::unique_ptr<Profile> CreateOffTheRecordProfile(
@@ -513,7 +520,6 @@ class Profile : public content::BrowserContext {
@@ -520,7 +527,6 @@ class Profile : public content::BrowserContext {
static PrefStore* CreateExtensionPrefStore(Profile*,
bool incognito_pref_store);
@@ -85,10 +85,10 @@ index 7e700d9b9ed86..99f8cb55f7c9e 100644
// Returns whether the user has signed in this profile to an account.
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
index 88a274f8b05f7..7adeedad98ac2 100644
index 22445800c6ac8..bd17582782117 100644
--- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc
@@ -1022,7 +1022,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
@@ -1023,7 +1023,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
otr_profiles_[otr_profile_id] = std::move(otr_profile);

View File

@@ -1,16 +1,8 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index d92165e685f68..03d0a99b77f4d 100644
index 4e2ad1d175829..ba6a3262dade2 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -26,6 +26,7 @@ static_library("safe_browsing") {
"//chrome/browser:browser_process",
"//chrome/browser/google",
"//chrome/browser/optimization_guide",
+ "//chrome/browser/permissions:permissions_proto",
"//chrome/browser/profiles",
"//chrome/browser/profiles:profile",
"//chrome/browser/sync",
@@ -37,6 +38,7 @@ static_library("safe_browsing") {
@@ -37,6 +37,7 @@ static_library("safe_browsing") {
"//components/enterprise/buildflags",
"//components/enterprise/common:strings",
"//components/enterprise/obfuscation/core:enterprise_obfuscation",

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/ui/startup/startup_browser_creator.cc chrome/browser/ui/startup/startup_browser_creator.cc
index c46e9c7daf645..48fd182eae15e 100644
index d26f0998c81fc..098282f9ca599 100644
--- chrome/browser/ui/startup/startup_browser_creator.cc
+++ chrome/browser/ui/startup/startup_browser_creator.cc
@@ -626,6 +626,13 @@ std::optional<ash::KioskAppId> GetAppId(const base::CommandLine& command_line,
@@ -16,7 +16,7 @@ index c46e9c7daf645..48fd182eae15e 100644
} // namespace
StartupProfileMode StartupProfileModeFromReason(
@@ -1506,6 +1513,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile(
@@ -1500,6 +1507,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile(
{profile, mode}, last_opened_profiles);
}
@@ -29,7 +29,7 @@ index c46e9c7daf645..48fd182eae15e 100644
// static
void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
const base::CommandLine& command_line,
@@ -1515,6 +1528,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
@@ -1509,6 +1522,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
return;
}

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/ui/webui/about/about_ui.cc chrome/browser/ui/webui/about/about_ui.cc
index b706f12d1b945..cd7ef560047ee 100644
index 0939e62b45530..ca2ac8ce23749 100644
--- chrome/browser/ui/webui/about/about_ui.cc
+++ chrome/browser/ui/webui/about/about_ui.cc
@@ -86,6 +86,10 @@
@@ -13,7 +13,7 @@ index b706f12d1b945..cd7ef560047ee 100644
using content::BrowserThread;
namespace {
@@ -441,6 +445,11 @@ AboutUIConfigBase::AboutUIConfigBase(std::string_view host)
@@ -533,6 +537,11 @@ ChromeURLsUIConfig::CreateWebUIController(content::WebUI* web_ui,
CreditsUIConfig::CreditsUIConfig()
: AboutUIConfigBase(chrome::kChromeUICreditsHost) {}
@@ -25,7 +25,7 @@ index b706f12d1b945..cd7ef560047ee 100644
#if !BUILDFLAG(IS_ANDROID)
TermsUIConfig::TermsUIConfig()
: AboutUIConfigBase(chrome::kChromeUITermsHost) {}
@@ -540,6 +549,16 @@ void AboutUIHTMLSource::StartDataRequest(
@@ -634,6 +643,16 @@ void AboutUIHTMLSource::StartDataRequest(
IDS_TERMS_HTML);
#endif
}
@@ -43,7 +43,7 @@ index b706f12d1b945..cd7ef560047ee 100644
FinishDataRequest(response, std::move(callback));
}
diff --git chrome/browser/ui/webui/about/about_ui.h chrome/browser/ui/webui/about/about_ui.h
index f633265e3d207..7d759d8559222 100644
index 46103729d33a7..fbc400e60239b 100644
--- chrome/browser/ui/webui/about/about_ui.h
+++ chrome/browser/ui/webui/about/about_ui.h
@@ -11,6 +11,7 @@
@@ -54,7 +54,7 @@ index f633265e3d207..7d759d8559222 100644
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/webui_config.h"
@@ -35,6 +36,13 @@ class CreditsUIConfig : public AboutUIConfigBase {
@@ -47,6 +48,13 @@ class CreditsUIConfig : public AboutUIConfigBase {
CreditsUIConfig();
};
@@ -69,7 +69,7 @@ index f633265e3d207..7d759d8559222 100644
// chrome://terms
class TermsUIConfig : public AboutUIConfigBase {
diff --git chrome/browser/ui/webui/chrome_web_ui_configs.cc chrome/browser/ui/webui/chrome_web_ui_configs.cc
index f740a1880ae9f..738d461125bfc 100644
index cbcdde4afa71b..3507ff26fa3a0 100644
--- chrome/browser/ui/webui/chrome_web_ui_configs.cc
+++ chrome/browser/ui/webui/chrome_web_ui_configs.cc
@@ -6,6 +6,7 @@
@@ -80,14 +80,14 @@ index f740a1880ae9f..738d461125bfc 100644
#include "chrome/browser/optimization_guide/optimization_guide_internals_ui.h"
#include "chrome/browser/ui/webui/about/about_ui.h"
#include "chrome/browser/ui/webui/accessibility/accessibility_ui.h"
@@ -222,6 +223,9 @@ void RegisterChromeWebUIConfigs() {
@@ -214,6 +215,9 @@ void RegisterChromeWebUIConfigs() {
map.AddWebUIConfig(std::make_unique<BluetoothInternalsUIConfig>());
map.AddWebUIConfig(std::make_unique<BrowsingTopicsInternalsUIConfig>());
map.AddWebUIConfig(std::make_unique<chromeos::DeviceLogUIConfig>());
+#if BUILDFLAG(ENABLE_CEF)
+ map.AddWebUIConfig(std::make_unique<ChromeUILicenseConfig>());
+#endif
map.AddWebUIConfig(std::make_unique<chrome_urls::ChromeUrlsUIConfig>());
map.AddWebUIConfig(std::make_unique<ChromeURLsUIConfig>());
map.AddWebUIConfig(std::make_unique<CrashesUIConfig>());
map.AddWebUIConfig(std::make_unique<commerce::CommerceInternalsUIConfig>());
diff --git chrome/common/webui_url_constants.cc chrome/common/webui_url_constants.cc
@@ -105,7 +105,7 @@ index e5e724a22d015..fcb15d234483f 100644
#if !BUILDFLAG(IS_ANDROID)
kChromeUIManagementHost,
diff --git chrome/common/webui_url_constants.h chrome/common/webui_url_constants.h
index c35d5252a52ee..b505fc38a2c53 100644
index d2e895dbc4a16..abe7ba3d26f50 100644
--- chrome/common/webui_url_constants.h
+++ chrome/common/webui_url_constants.h
@@ -18,6 +18,7 @@
@@ -116,7 +116,7 @@ index c35d5252a52ee..b505fc38a2c53 100644
#include "chrome/common/buildflags.h"
#include "components/signin/public/base/signin_buildflags.h"
#include "content/public/common/url_constants.h"
@@ -162,6 +163,10 @@ inline constexpr char kChromeUIInterstitialHost[] = "interstitials";
@@ -147,6 +148,10 @@ inline constexpr char kChromeUIInterstitialHost[] = "interstitials";
inline constexpr char kChromeUIInterstitialURL[] = "chrome://interstitials/";
inline constexpr char kChromeUIKillHost[] = "kill";
inline constexpr char kChromeUILauncherInternalsHost[] = "launcher-internals";
@@ -125,5 +125,5 @@ index c35d5252a52ee..b505fc38a2c53 100644
+inline constexpr char kChromeUILicenseURL[] = "chrome://license/";
+#endif
inline constexpr char kChromeUILocalStateHost[] = "local-state";
inline constexpr char kChromeUILocalStateURL[] = "chrome://local-state";
inline constexpr char kChromeUILocationInternalsHost[] = "location-internals";
inline constexpr char kChromeUIManagementHost[] = "management";

View File

@@ -124,7 +124,7 @@ index 2f8162d7491d1..b00f0d5bf26ae 100644
// Factory for the creating refs in callbacks.
base::WeakPtrFactory<VersionHandler> weak_ptr_factory_{this};
diff --git chrome/browser/ui/webui/version/version_ui.cc chrome/browser/ui/webui/version/version_ui.cc
index c10d6937f6ef4..738ba66437829 100644
index f9c2e60204369..98026fd57457f 100644
--- chrome/browser/ui/webui/version/version_ui.cc
+++ chrome/browser/ui/webui/version/version_ui.cc
@@ -16,6 +16,7 @@
@@ -233,7 +233,7 @@ index bd41fd2492e79..04378e39332e1 100644
+ font-size: 0.8em;
+}
diff --git components/webui/version/resources/about_version.html components/webui/version/resources/about_version.html
index e4ad426e42bca..13e754cbffbf3 100644
index bd2914d8bc19a..f3176886fd96b 100644
--- components/webui/version/resources/about_version.html
+++ components/webui/version/resources/about_version.html
@@ -49,9 +49,21 @@ about:version template page
@@ -259,7 +259,7 @@ index e4ad426e42bca..13e754cbffbf3 100644
<tr><td class="label">$i18n{application_label}</td>
<td class="version" id="version">
<span id="copy-content">
@@ -155,7 +167,15 @@ about:version template page
@@ -159,7 +171,15 @@ about:version template page
<tr><td class="label">$i18n{executable_path_name}</td>
<td class="version" id="executable_path">$i18n{executable_path}</td>
</tr>
@@ -276,7 +276,7 @@ index e4ad426e42bca..13e754cbffbf3 100644
<td class="version" id="profile_path">$i18n{profile_path}</td>
</tr>
</if>
@@ -188,6 +208,17 @@ about:version template page
@@ -192,6 +212,17 @@ about:version template page
<td class="version" id="sanitizer">$i18n{sanitizer}</td>
</tr>
</table>
@@ -322,7 +322,7 @@ index ea5f11471acf2..f604065bbe8fe 100644
// <if expr="is_win">
diff --git components/webui/version/version_ui_constants.cc components/webui/version/version_ui_constants.cc
index 3828e8e25bbcd..afd115b6eb82e 100644
index 7c9bd75c4de1b..4ab5265b5f2c0 100644
--- components/webui/version/version_ui_constants.cc
+++ components/webui/version/version_ui_constants.cc
@@ -5,6 +5,7 @@
@@ -333,7 +333,7 @@ index 3828e8e25bbcd..afd115b6eb82e 100644
namespace version_ui {
@@ -90,4 +91,15 @@ const char kVersionSuffix[] = "version_suffix";
@@ -92,4 +93,15 @@ const char kVersionSuffix[] = "version_suffix";
const char kVersionModifier[] = "version_modifier";
const char kVersionProcessorVariation[] = "version_processor_variation";

View File

@@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 1471790200d19..41e5d15a024dc 100644
index 948d6c41cdede..80039133de468 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -4,6 +4,7 @@
@@ -18,8 +18,8 @@ index 1471790200d19..41e5d15a024dc 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -246,6 +248,10 @@ static_library("renderer") {
]
@@ -250,6 +252,10 @@ static_library("renderer") {
deps += [ "//chrome/renderer/actor" ]
}
+ if (enable_cef) {

View File

@@ -1,5 +1,5 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index e65fddc7cc743..6febaf75842fa 100644
index 7cc74f595ff57..4e0e494678d75 100644
--- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc
@@ -43,6 +43,7 @@
@@ -10,7 +10,7 @@ index e65fddc7cc743..6febaf75842fa 100644
#include "chrome/browser/buildflags.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h"
@@ -544,6 +545,7 @@ struct MainFunction {
@@ -545,6 +546,7 @@ struct MainFunction {
int (*function)(content::MainFunctionParams);
};
@@ -18,7 +18,7 @@ index e65fddc7cc743..6febaf75842fa 100644
// Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) {
#if BUILDFLAG(IS_WIN)
@@ -623,6 +625,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) {
@@ -624,6 +626,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) {
command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
#endif // BUILDFLAG(IS_WIN)
}
@@ -26,7 +26,7 @@ index e65fddc7cc743..6febaf75842fa 100644
#if !BUILDFLAG(IS_ANDROID)
void InitLogging(const std::string& process_type) {
@@ -742,6 +745,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
@@ -743,6 +746,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
ChromeMainDelegate::~ChromeMainDelegate() = default;
#endif // !BUILDFLAG(IS_ANDROID)
@@ -37,7 +37,7 @@ index e65fddc7cc743..6febaf75842fa 100644
std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
InvokedIn invoked_in) {
DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get());
@@ -767,7 +774,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -768,7 +775,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// future session's metrics.
DeferBrowserMetrics(user_data_dir);
@@ -46,7 +46,7 @@ index e65fddc7cc743..6febaf75842fa 100644
// In the case the process is not the singleton process, the uninstall tasks
// need to be executed here. A window will be displayed asking to close all
// running instances.
@@ -852,7 +859,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -853,7 +860,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// Initializes the resource bundle and determines the locale.
std::string actual_locale = LoadLocalState(
@@ -56,7 +56,7 @@ index e65fddc7cc743..6febaf75842fa 100644
chrome_feature_list_creator->SetApplicationLocale(actual_locale);
chrome_feature_list_creator->OverrideCachedUIStrings();
@@ -867,6 +875,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -868,6 +876,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
new net::NetworkChangeNotifierFactoryAndroid());
#endif
@@ -65,7 +65,7 @@ index e65fddc7cc743..6febaf75842fa 100644
bool record = true;
#if BUILDFLAG(IS_ANDROID)
record =
@@ -875,6 +885,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -876,6 +886,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
if (record) {
chrome_content_browser_client_->startup_data()->RecordCoreSystemProfile();
}
@@ -73,7 +73,7 @@ index e65fddc7cc743..6febaf75842fa 100644
#if BUILDFLAG(IS_ANDROID)
UmaSessionStats::OnStartup();
@@ -921,8 +932,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) {
@@ -922,8 +933,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) {
std::make_unique<ChromeThreadProfilerClient>());
// `ChromeMainDelegateAndroid::PreSandboxStartup` creates the profiler a little
@@ -84,7 +84,7 @@ index e65fddc7cc743..6febaf75842fa 100644
// Start the sampling profiler as early as possible - namely, once the thread
// pool has been created.
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
@@ -1322,6 +1333,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1323,6 +1334,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@@ -92,7 +92,7 @@ index e65fddc7cc743..6febaf75842fa 100644
crash_reporter::InitializeCrashKeys();
#if BUILDFLAG(IS_POSIX)
@@ -1337,6 +1349,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1338,6 +1350,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
if (chrome::ProcessNeedsProfileDir(process_type)) {
InitializeUserDataDir(base::CommandLine::ForCurrentProcess());
}
@@ -100,7 +100,7 @@ index e65fddc7cc743..6febaf75842fa 100644
// Register component_updater PathProvider after DIR_USER_DATA overridden by
// command line flags. Maybe move the chrome PathProvider down here also?
@@ -1429,7 +1442,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1434,7 +1447,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
#else
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocale(
@@ -110,7 +110,7 @@ index e65fddc7cc743..6febaf75842fa 100644
base::FilePath resources_pack_path;
base::PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
@@ -1439,6 +1453,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1444,6 +1458,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
}
@@ -118,7 +118,7 @@ index e65fddc7cc743..6febaf75842fa 100644
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess &&
@@ -1475,6 +1490,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1480,6 +1495,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line);
@@ -126,7 +126,7 @@ index e65fddc7cc743..6febaf75842fa 100644
#if BUILDFLAG(ENABLE_PDF)
MaybePatchGdiGetFontData();
@@ -1593,6 +1609,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1598,6 +1614,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler();
}
@@ -134,7 +134,7 @@ index e65fddc7cc743..6febaf75842fa 100644
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
// this up for the browser process in a different manner.
const base::CommandLine* command_line =
@@ -1605,6 +1622,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1610,6 +1627,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line);
@@ -142,7 +142,7 @@ index e65fddc7cc743..6febaf75842fa 100644
}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -1715,6 +1733,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -1720,6 +1738,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
: memory_system::DispatcherParameters::
AllocationTraceRecorderInclusion::kIgnore;
@@ -150,7 +150,7 @@ index e65fddc7cc743..6febaf75842fa 100644
memory_system::Initializer()
.SetGwpAsanParameters(gwp_asan_boost_sampling, process_type)
.SetProfilingClientParameters(chrome::GetChannel(),
@@ -1722,5 +1741,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -1727,5 +1746,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
.SetDispatcherParameters(memory_system::DispatcherParameters::
PoissonAllocationSamplerInclusion::kEnforce,
allocation_recorder_inclusion, process_type)
@@ -158,7 +158,7 @@ index e65fddc7cc743..6febaf75842fa 100644
+ .Initialize(*memory_system_);
}
diff --git chrome/app/chrome_main_delegate.h chrome/app/chrome_main_delegate.h
index fa692d8fbfa5a..d7745793dcf96 100644
index 18b33015ee4b6..e17447cb922e9 100644
--- chrome/app/chrome_main_delegate.h
+++ chrome/app/chrome_main_delegate.h
@@ -17,6 +17,7 @@
@@ -232,7 +232,7 @@ index 72eb096075a05..d3866aae87c60 100644
base::PathService::OverrideAndCreateIfNeeded(
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index ee9e6e9208043..05c87c3e35352 100644
index 681fd3282078c..8bca99c60d66d 100644
--- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc
@@ -28,6 +28,7 @@
@@ -252,7 +252,16 @@ index ee9e6e9208043..05c87c3e35352 100644
// The uninstall command-line switch is handled by the origin process; see
// ChromeMainDelegate::PostEarlyInitialization(...). The other process won't
// be able to become the singleton process and will display a window asking
@@ -852,7 +853,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded(
@@ -749,7 +750,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() {
return content::RESULT_CODE_NORMAL_EXIT;
}
-#if BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_WIN) && !BUILDFLAG(ENABLE_CEF)
// If we are running stale binaries then relaunch and exit immediately.
if (upgrade_util::IsRunningOldChrome()) {
if (!upgrade_util::RelaunchChromeBrowser(
@@ -867,7 +868,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded(
browser_process_->local_state());
platform_management_service->RefreshCache(base::NullCallback());
@@ -261,7 +270,7 @@ index ee9e6e9208043..05c87c3e35352 100644
if (first_run::IsChromeFirstRun()) {
bool stats_default;
if (GoogleUpdateSettings::GetCollectStatsConsentDefault(&stats_default)) {
@@ -895,6 +896,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
@@ -910,6 +911,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
master_prefs_ = std::make_unique<first_run::MasterPrefs>();
@@ -269,7 +278,7 @@ index ee9e6e9208043..05c87c3e35352 100644
std::unique_ptr<installer::InitialPreferences> installer_initial_prefs =
startup_data_->chrome_feature_list_creator()->TakeInitialPrefs();
if (!installer_initial_prefs)
@@ -928,6 +930,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
@@ -943,6 +945,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
master_prefs_->confirm_to_quit);
}
#endif
@@ -277,7 +286,7 @@ index ee9e6e9208043..05c87c3e35352 100644
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
return content::RESULT_CODE_NORMAL_EXIT;
}
@@ -997,6 +1000,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
@@ -1012,6 +1015,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
browser_process_->browser_policy_connector()->OnResourceBundleCreated();
@@ -285,7 +294,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// Android does first run in Java instead of native.
// Chrome OS has its own out-of-box-experience code.
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
@@ -1018,6 +1022,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
@@ -1033,6 +1037,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
#endif
}
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
@@ -293,7 +302,7 @@ index ee9e6e9208043..05c87c3e35352 100644
#if BUILDFLAG(IS_MAC)
#if defined(ARCH_CPU_X86_64)
@@ -1385,6 +1390,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1400,6 +1405,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
browser_process_->PreMainMessageLoopRun();
#if BUILDFLAG(IS_WIN)
@@ -301,7 +310,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// If the command line specifies 'uninstall' then we need to work here
// unless we detect another chrome browser running.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUninstall)) {
@@ -1396,6 +1402,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1411,6 +1417,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
return ChromeBrowserMainPartsWin::HandleIconsCommands(
*base::CommandLine::ForCurrentProcess());
}
@@ -309,7 +318,7 @@ index ee9e6e9208043..05c87c3e35352 100644
ui::SelectFileDialog::SetFactory(
std::make_unique<ChromeSelectFileDialogFactory>());
@@ -1418,6 +1425,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1433,6 +1440,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif
@@ -317,7 +326,7 @@ index ee9e6e9208043..05c87c3e35352 100644
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kMakeDefaultBrowser)) {
bool is_managed = g_browser_process->local_state()->IsManagedPreference(
@@ -1431,13 +1439,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1446,13 +1454,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
? static_cast<int>(content::RESULT_CODE_NORMAL_EXIT)
: static_cast<int>(CHROME_RESULT_CODE_SHELL_INTEGRATION_FAILED);
}
@@ -333,7 +342,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// We must call DoUpgradeTasks now that we own the browser singleton to
// finish upgrade tasks (swap) and relaunch if necessary.
if (upgrade_util::DoUpgradeTasks(*base::CommandLine::ForCurrentProcess()))
@@ -1481,7 +1490,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1496,7 +1505,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif
@@ -342,7 +351,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// Check if there is any machine level Chrome installed on the current
// machine. If yes and the current Chrome process is user level, we do not
// allow the user level Chrome to run. So we notify the user and uninstall
@@ -1563,7 +1572,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1578,7 +1587,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Call `PostProfileInit()`and set it up for profiles created later.
profile_init_manager_ = std::make_unique<ProfileInitManager>(this, profile);
@@ -351,7 +360,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// Execute first run specific code after the PrefService has been initialized
// and preferences have been registered since some of the import code depends
// on preferences.
@@ -1584,7 +1593,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1599,7 +1608,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif
@@ -360,7 +369,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// Registers Chrome with the Windows Restart Manager, which will restore the
// Chrome session when the computer is restarted after a system update.
// This could be run as late as WM_QUERYENDSESSION for system update reboots,
@@ -1687,6 +1696,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1702,6 +1711,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
g_browser_process->profile_manager()->GetLastOpenedProfiles();
}
#endif
@@ -372,7 +381,7 @@ index ee9e6e9208043..05c87c3e35352 100644
// This step is costly.
if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(),
base::FilePath(), profile_info,
@@ -1714,11 +1728,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1729,11 +1743,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Create the RunLoop for MainMessageLoopRun() to use and transfer
// ownership of the browser's lifetime to the BrowserProcess.
@@ -424,7 +433,7 @@ index e26e3625c99c8..c0d4a95607e37 100644
+#endif
}
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index e856d9cf62853..c6d489a87e760 100644
index 3ebb85bbe3c48..896b131108218 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -48,6 +48,7 @@
@@ -435,7 +444,7 @@ index e856d9cf62853..c6d489a87e760 100644
#include "chrome/browser/after_startup_task_utils.h"
#include "chrome/browser/ai/ai_manager.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
@@ -1344,6 +1345,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
@@ -1504,6 +1505,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
}
ChromeContentBrowserClient::ChromeContentBrowserClient() {
@@ -444,7 +453,7 @@ index e856d9cf62853..c6d489a87e760 100644
#if BUILDFLAG(ENABLE_PLUGINS)
extra_parts_.push_back(
std::make_unique<ChromeContentBrowserClientPluginsPart>());
@@ -1381,6 +1384,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
@@ -1541,6 +1544,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
}
}
@@ -456,7 +465,7 @@ index e856d9cf62853..c6d489a87e760 100644
// static
void ChromeContentBrowserClient::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
@@ -4776,9 +4784,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
@@ -4837,9 +4845,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // BUILDFLAG(IS_ANDROID)
@@ -468,7 +477,7 @@ index e856d9cf62853..c6d489a87e760 100644
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
@@ -6487,7 +6497,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
@@ -6926,7 +6936,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
}
}
@@ -477,7 +486,7 @@ index e856d9cf62853..c6d489a87e760 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -6505,6 +6515,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
@@ -6944,6 +6954,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = GetApplicationLocale();
}
@@ -486,7 +495,7 @@ index e856d9cf62853..c6d489a87e760 100644
}
std::vector<base::FilePath>
@@ -7658,11 +7670,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
@@ -8084,11 +8096,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
const auto now = base::TimeTicks::Now();
const auto timeout = GetKeepaliveTimerTimeout(context);
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
@@ -500,7 +509,7 @@ index e856d9cf62853..c6d489a87e760 100644
FROM_HERE, keepalive_deadline_ - now,
base::BindOnce(
&ChromeContentBrowserClient::OnKeepaliveTimerFired,
@@ -7684,7 +7696,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
@@ -8110,7 +8122,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
--num_keepalive_requests_;
if (num_keepalive_requests_ == 0) {
DVLOG(1) << "Stopping the keepalive timer";
@@ -510,7 +519,7 @@ index e856d9cf62853..c6d489a87e760 100644
// This deletes the keep alive handle attached to the timer function and
// unblock the shutdown sequence.
}
@@ -7862,7 +7875,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
@@ -8288,7 +8301,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
const auto now = base::TimeTicks::Now();
const auto then = keepalive_deadline_;
if (now < then) {
@@ -520,10 +529,10 @@ index e856d9cf62853..c6d489a87e760 100644
base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired,
weak_factory_.GetWeakPtr(),
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index f29c2ed251c81..4886ddac92dcd 100644
index c944bdaf9bbbe..a9e7bd1139c07 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -160,6 +160,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -159,6 +159,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
~ChromeContentBrowserClient() override;
@@ -532,7 +541,7 @@ index f29c2ed251c81..4886ddac92dcd 100644
// TODO(crbug.com/41356866): This file is about calls from content/ out
// to chrome/ to get values or notify about events, but both of these
// functions are from chrome/ to chrome/ and don't involve content/ at all.
@@ -750,7 +752,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -733,7 +735,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
@@ -541,7 +550,7 @@ index f29c2ed251c81..4886ddac92dcd 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -1388,7 +1390,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -1370,7 +1372,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
#if !BUILDFLAG(IS_ANDROID)
uint64_t num_keepalive_requests_ = 0;
@@ -551,7 +560,7 @@ index f29c2ed251c81..4886ddac92dcd 100644
#endif
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index 1ade93d9ea505..aa1360c4f31fe 100644
index 9a00400829ae1..b0007362043bc 100644
--- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc
@@ -15,6 +15,7 @@
@@ -562,7 +571,7 @@ index 1ade93d9ea505..aa1360c4f31fe 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/invert_bubble_prefs.h"
@@ -219,6 +220,10 @@
@@ -217,6 +218,10 @@
#include "extensions/browser/pref_names.h"
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
@@ -573,7 +582,7 @@ index 1ade93d9ea505..aa1360c4f31fe 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1889,6 +1894,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -1856,6 +1861,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// This is intentionally last.
RegisterLocalStatePrefsForMigration(registry);
@@ -585,7 +594,7 @@ index 1ade93d9ea505..aa1360c4f31fe 100644
}
// Register prefs applicable to all profiles.
@@ -2341,6 +2351,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
@@ -2305,6 +2315,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
const std::string& locale) {
RegisterProfilePrefs(registry, locale);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index 02a4ad250ae42..6a592da9cf571 100644
index 6f2feda3e7920..83650e01ce8a2 100644
--- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc
@@ -478,6 +478,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -458,6 +458,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
// choose to not implement CommandUpdaterDelegate inside this class and
// therefore command_updater_ doesn't have the delegate set).
if (!SupportsCommand(id) || !IsCommandEnabled(id)) {
@@ -10,7 +10,7 @@ index 02a4ad250ae42..6a592da9cf571 100644
return false;
}
@@ -495,6 +496,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -475,6 +476,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
DCHECK(command_updater_.IsCommandEnabled(id))
<< "Invalid/disabled command " << id;
@@ -24,7 +24,7 @@ index 02a4ad250ae42..6a592da9cf571 100644
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
@@ -1333,11 +1341,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
@@ -1313,11 +1321,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() {
@@ -41,7 +41,7 @@ index 02a4ad250ae42..6a592da9cf571 100644
void BrowserCommandController::InitCommandState() {
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
index 716b70869a2d0..c198cc46d0495 100644
index 0ac99f7c90ac8..41edc0a895a44 100644
--- chrome/browser/ui/toolbar/app_menu_model.cc
+++ chrome/browser/ui/toolbar/app_menu_model.cc
@@ -722,10 +722,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel(
@@ -200,10 +200,10 @@ index ec1f1a15c682e..23163078693fb 100644
// Adds actionable global error menu items to the menu.
// Examples: Extension permissions and sign in errors.
diff --git chrome/browser/ui/views/find_bar_host.cc chrome/browser/ui/views/find_bar_host.cc
index 577c01d3ddf1b..4fe3dac4545d5 100644
index 603a95238c562..dd397451bed5a 100644
--- chrome/browser/ui/views/find_bar_host.cc
+++ chrome/browser/ui/views/find_bar_host.cc
@@ -615,6 +615,14 @@ gfx::Rect FindBarHost::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
@@ -608,6 +608,14 @@ gfx::Rect FindBarHost::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
// The BrowserView does Layout for the components that we care about
// positioning relative to, so we ask it to tell us where we should go.
gfx::Rect find_bar_bounds = browser_view_->GetFindBarBoundingBox();
@@ -397,10 +397,10 @@ index 3d8a15049d4d2..66c4789581fe1 100644
// regenerated.
bool RegenerateFrameOnThemeChange(BrowserThemeChangeType theme_change_type);
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index 16ec3a1468221..bbe7465e7dadc 100644
index 3c0e53b5ade77..d7ca16e2c41cc 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -373,10 +373,6 @@ using web_modal::WebContentsModalDialogHost;
@@ -368,10 +368,6 @@ using web_modal::WebContentsModalDialogHost;
namespace {
@@ -411,7 +411,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// The visible height of the shadow above the tabs. Clicks in this area are
// treated as clicks to the frame, rather than clicks to the tab.
const int kTabShadowSize = 2;
@@ -818,6 +814,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
@@ -813,6 +809,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
return browser_view_->frame()->GetTopInset() - browser_view_->y();
}
@@ -426,7 +426,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
bool IsToolbarVisible() const override {
return browser_view_->IsToolbarVisible();
}
@@ -946,11 +950,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
@@ -937,11 +941,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
@@ -449,8 +449,8 @@ index 16ec3a1468221..bbe7465e7dadc 100644
SetShowIcon(::ShouldShowWindowIcon(
browser_.get(), AppUsesWindowControlsOverlay(), AppUsesTabbed()));
@@ -1118,8 +1132,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
new_tab_footer_web_view_));
@@ -1091,8 +1105,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
lens_overlay_view_, contents_scrim_view_, nullptr, watermark_view_));
#endif
- toolbar_ = top_container_->AddChildView(
@@ -467,7 +467,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1196,7 +1217,9 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -1158,18 +1179,22 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
}
BrowserView::~BrowserView() {
@@ -477,7 +477,20 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// Remove the layout manager to avoid dangling. This needs to be earlier than
// other cleanups that destroy views referenced in the layout manager.
@@ -1208,9 +1231,11 @@ BrowserView::~BrowserView() {
SetLayoutManager(nullptr);
+ if (browser_) {
auto* tab_search_toolbar_button_controller =
browser_->GetFeatures().tab_search_toolbar_button_controller();
if (tab_search_toolbar_button_controller) {
tab_search_bubble_host_->RemoveObserver(
tab_search_toolbar_button_controller);
}
+ }
tab_search_bubble_host_.reset();
@@ -1177,9 +1202,11 @@ BrowserView::~BrowserView() {
// tabstrip model and the browser frame.
top_controls_slide_controller_.reset();
@@ -489,7 +502,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// Stop the animation timer explicitly here to avoid running it in a nested
// message loop, which may run by Browser destructor.
@@ -1219,17 +1244,18 @@ BrowserView::~BrowserView() {
@@ -1188,17 +1215,18 @@ BrowserView::~BrowserView() {
// Immersive mode may need to reparent views before they are removed/deleted.
immersive_mode_controller_.reset();
@@ -512,7 +525,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// These are raw pointers to child views, so they need to be set to null
// before `RemoveAllChildViews()` is called to avoid dangling.
@@ -1986,6 +2012,28 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const {
@@ -1899,6 +1927,28 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const {
ThemeProperties::kFrameHeightAboveTabs - browser_view_origin.y());
}
@@ -541,7 +554,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// static:
BrowserView::DevToolsDockedPlacement BrowserView::GetDevToolsDockedPlacement(
const gfx::Rect& contents_webview_bounds,
@@ -2450,7 +2498,13 @@ void BrowserView::OnExclusiveAccessUserInput() {
@@ -2345,7 +2395,13 @@ void BrowserView::OnExclusiveAccessUserInput() {
bool BrowserView::ShouldHideUIForFullscreen() const {
// Immersive mode needs UI for the slide-down top panel.
@@ -556,17 +569,17 @@ index 16ec3a1468221..bbe7465e7dadc 100644
return false;
}
@@ -3673,6 +3727,9 @@ views::View* BrowserView::GetLensOverlayView() {
@@ -3576,6 +3632,9 @@ views::View* BrowserView::GetLensOverlayView() {
}
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
+ if (!browser_) {
+ return nullptr;
+ }
if (auto* download_controller =
browser_->GetFeatures().download_toolbar_ui_controller()) {
return download_controller->bubble_controller();
@@ -4424,7 +4481,9 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
if (auto* download_controller =
browser_->GetFeatures().download_toolbar_ui_controller()) {
return download_controller->bubble_controller();
@@ -4341,7 +4400,9 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
return;
}
@@ -576,7 +589,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -4965,11 +5024,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
@@ -4882,11 +4943,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
bool BrowserView::ShouldDescendIntoChildForEventHandling(
gfx::NativeView child,
const gfx::Point& location) {
@@ -617,7 +630,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// Draggable regions are defined relative to the web contents.
gfx::Point point_in_contents_web_view_coords(location);
views::View::ConvertPointToTarget(GetWidget()->GetRootView(),
@@ -4978,7 +5064,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
@@ -4895,7 +4983,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
// Draggable regions should be ignored for clicks into any browser view's
// owned widgets, for example alerts, permission prompts or find bar.
@@ -626,7 +639,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
point_in_contents_web_view_coords.x(),
point_in_contents_web_view_coords.y()) ||
WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords);
@@ -5210,8 +5296,11 @@ void BrowserView::Layout(PassKey) {
@@ -5127,8 +5215,11 @@ void BrowserView::Layout(PassKey) {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@@ -639,7 +652,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -5278,6 +5367,12 @@ void BrowserView::AddedToWidget() {
@@ -5195,6 +5286,12 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif
@@ -652,7 +665,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
toolbar_->Init();
if (GetIsNormalType()) {
@@ -5335,12 +5430,6 @@ void BrowserView::AddedToWidget() {
@@ -5254,12 +5351,6 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder();
@@ -665,7 +678,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
if (download::IsDownloadBubbleEnabled()) {
browser_->GetFeatures().download_toolbar_ui_controller()->Init();
}
@@ -5351,7 +5440,9 @@ void BrowserView::AddedToWidget() {
@@ -5270,7 +5361,9 @@ void BrowserView::AddedToWidget() {
}
frame_->OnBrowserViewInitViewsComplete();
@@ -675,7 +688,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
using_native_frame_ = frame_->ShouldUseNativeFrame();
MaybeInitializeWebUITabStrip();
@@ -5772,7 +5863,9 @@ void BrowserView::ProcessFullscreen(bool fullscreen, const int64_t display_id) {
@@ -5692,7 +5785,9 @@ void BrowserView::ProcessFullscreen(bool fullscreen, const int64_t display_id) {
// Undo our anti-jankiness hacks and force a re-layout.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
@@ -685,7 +698,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
}
void BrowserView::RequestFullscreen(bool fullscreen, int64_t display_id) {
@@ -6293,7 +6386,9 @@ Profile* BrowserView::GetProfile() {
@@ -6204,7 +6299,9 @@ Profile* BrowserView::GetProfile() {
}
void BrowserView::UpdateUIForTabFullscreen() {
@@ -695,7 +708,7 @@ index 16ec3a1468221..bbe7465e7dadc 100644
}
WebContents* BrowserView::GetWebContentsForExclusiveAccess() {
@@ -6322,6 +6417,9 @@ bool BrowserView::CanUserEnterFullscreen() const {
@@ -6233,6 +6330,9 @@ bool BrowserView::CanUserEnterFullscreen() const {
}
bool BrowserView::CanUserExitFullscreen() const {
@@ -706,10 +719,10 @@ index 16ec3a1468221..bbe7465e7dadc 100644
}
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index a3bad544547a4..1b4afbf714f52 100644
index 8a06d49d2abe1..7874429a9a090 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -149,11 +149,16 @@ class BrowserView : public BrowserWindow,
@@ -148,11 +148,16 @@ class BrowserView : public BrowserWindow,
METADATA_HEADER(BrowserView, views::ClientView)
public:
@@ -726,7 +739,7 @@ index a3bad544547a4..1b4afbf714f52 100644
void set_frame(BrowserFrame* frame) {
frame_ = frame;
paint_as_active_subscription_ =
@@ -943,6 +948,10 @@ class BrowserView : public BrowserWindow,
@@ -938,6 +943,10 @@ class BrowserView : public BrowserWindow,
void Copy();
void Paste();
@@ -737,7 +750,7 @@ index a3bad544547a4..1b4afbf714f52 100644
protected:
// Enumerates where the devtools are docked relative to the browser's main
// web contents.
@@ -966,6 +975,8 @@ class BrowserView : public BrowserWindow,
@@ -961,6 +970,8 @@ class BrowserView : public BrowserWindow,
const gfx::Rect& contents_webview_bounds,
const gfx::Rect& local_webview_container_bounds);
@@ -747,10 +760,10 @@ index a3bad544547a4..1b4afbf714f52 100644
// Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
// interface to keep these two classes decoupled and testable.
diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc
index 79ab40befc1c3..40ec9f8d8a0b5 100644
index 39fc0f21ff96c..4b575fd3877d5 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -52,6 +52,10 @@
@@ -53,6 +53,10 @@
#include "ui/views/window/client_view.h"
#include "ui/views/window/hit_test_utils.h"
@@ -761,7 +774,7 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
using views::View;
using web_modal::ModalDialogHostObserver;
using web_modal::WebContentsModalDialogHost;
@@ -116,6 +120,10 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
@@ -108,6 +112,10 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
observer_list_.Notify(&ModalDialogHostObserver::OnHostDestroying);
}
@@ -772,16 +785,16 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
void NotifyPositionRequiresUpdate() {
observer_list_.Notify(&ModalDialogHostObserver::OnPositionRequiresUpdate);
}
@@ -148,7 +156,7 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
const int middle_x =
leading_x + layout_result.contents_container_bounds.width() / 2;
return gfx::Point(middle_x - dialog_size.width() / 2,
- browser_view_layout_->dialog_top_y_);
+ GetDialogTopY());
@@ -117,7 +125,7 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
views::View* view = browser_view_layout_->contents_container_;
gfx::Rect rect = view->ConvertRectToWidget(view->GetLocalBounds());
const int middle_x = rect.x() + rect.width() / 2;
- const int top = browser_view_layout_->dialog_top_y_;
+ const int top = GetDialogTopY();
return gfx::Point(middle_x - size.width() / 2, top);
}
bool ShouldActivateDialog() const override {
@@ -170,7 +178,7 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
@@ -140,7 +148,7 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
// universally.
views::View* view = browser_view_layout_->contents_container_;
gfx::Rect content_area = view->ConvertRectToWidget(view->GetLocalBounds());
@@ -790,7 +803,7 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
return gfx::Size(content_area.width(), content_area.bottom() - top);
}
@@ -199,6 +207,13 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
@@ -169,6 +177,13 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
return host_widget ? host_widget->GetNativeView() : gfx::NativeView();
}
@@ -804,7 +817,7 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
// Add/remove observer.
void AddObserver(ModalDialogHostObserver* observer) override {
observer_list_.AddObserver(observer);
@@ -391,6 +406,8 @@ void BrowserViewLayout::Layout(views::View* browser_view) {
@@ -361,6 +376,8 @@ void BrowserViewLayout::Layout(views::View* browser_view) {
exclusive_access_bubble->RepositionIfVisible();
}
@@ -813,7 +826,7 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
// Adjust any hosted dialogs if the browser's dialog hosting bounds changed.
const gfx::Rect dialog_bounds(dialog_host_->GetDialogPosition(gfx::Size()),
dialog_host_->GetMaximumDialogSize());
@@ -404,6 +421,7 @@ void BrowserViewLayout::Layout(views::View* browser_view) {
@@ -374,6 +391,7 @@ void BrowserViewLayout::Layout(views::View* browser_view) {
latest_dialog_bounds_in_screen_ = dialog_bounds_in_screen;
dialog_host_->NotifyPositionRequiresUpdate();
}
@@ -821,7 +834,7 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
}
gfx::Size BrowserViewLayout::GetPreferredSize(
@@ -540,6 +558,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
@@ -510,6 +528,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
int BrowserViewLayout::LayoutToolbar(int top) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar");
@@ -836,7 +849,7 @@ index 79ab40befc1c3..40ec9f8d8a0b5 100644
bool toolbar_visible = delegate_->IsToolbarVisible();
int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0;
diff --git chrome/browser/ui/views/frame/browser_view_layout.h chrome/browser/ui/views/frame/browser_view_layout.h
index 493d444f78ae2..589c6b6f41b35 100644
index a4602bd1f5d01..1c0435c03d323 100644
--- chrome/browser/ui/views/frame/browser_view_layout.h
+++ chrome/browser/ui/views/frame/browser_view_layout.h
@@ -87,6 +87,8 @@ class BrowserViewLayout : public views::LayoutManager {
@@ -848,7 +861,7 @@ index 493d444f78ae2..589c6b6f41b35 100644
void SetUseBrowserContentMinimumSize(bool use_browser_content_minimum_size);
// Sets the bounds for the contents border.
@@ -176,7 +178,7 @@ class BrowserViewLayout : public views::LayoutManager {
@@ -174,7 +176,7 @@ class BrowserViewLayout : public views::LayoutManager {
const raw_ptr<WebAppFrameToolbarView> web_app_frame_toolbar_;
const raw_ptr<views::Label> web_app_window_title_;
const raw_ptr<TabStripRegionView> tab_strip_region_view_;
@@ -858,7 +871,7 @@ index 493d444f78ae2..589c6b6f41b35 100644
const raw_ptr<views::View> contents_container_;
const raw_ptr<views::View> left_aligned_side_panel_separator_;
diff --git chrome/browser/ui/views/frame/browser_view_layout_delegate.h chrome/browser/ui/views/frame/browser_view_layout_delegate.h
index 74ae48f94db01..e97735cbc0cea 100644
index 9f393a42d1655..8597a655c4fac 100644
--- chrome/browser/ui/views/frame/browser_view_layout_delegate.h
+++ chrome/browser/ui/views/frame/browser_view_layout_delegate.h
@@ -28,6 +28,7 @@ class BrowserViewLayoutDelegate {
@@ -870,10 +883,10 @@ index 74ae48f94db01..e97735cbc0cea 100644
virtual bool IsBookmarkBarVisible() const = 0;
virtual bool IsContentsSeparatorEnabled() const = 0;
diff --git chrome/browser/ui/views/frame/contents_web_view.cc chrome/browser/ui/views/frame/contents_web_view.cc
index 1f65552380cda..ab520daffdb11 100644
index d80ac44127421..f09f382e24344 100644
--- chrome/browser/ui/views/frame/contents_web_view.cc
+++ chrome/browser/ui/views/frame/contents_web_view.cc
@@ -34,6 +34,12 @@ ContentsWebView::ContentsWebView(content::BrowserContext* browser_context)
@@ -35,6 +35,12 @@ ContentsWebView::ContentsWebView(content::BrowserContext* browser_context)
status_bubble_ = std::make_unique<StatusBubbleViews>(this);
status_bubble_->Reposition();
web_contents_close_handler_ = std::make_unique<WebContentsCloseHandler>(this);
@@ -887,7 +900,7 @@ index 1f65552380cda..ab520daffdb11 100644
ContentsWebView::~ContentsWebView() = default;
diff --git chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
index d4d5851028548..173238782ffaf 100644
index 919f2496b089d..f541e3836f4fd 100644
--- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
+++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
@@ -605,6 +605,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView(
@@ -988,10 +1001,10 @@ index 33c6444869375..d74818698d81a 100644
LocationBarView* location_bar_view = browser_view_->GetLocationBarView();
CHECK(location_bar_view);
diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc
index 5732e0fa49448..92f02d924b63a 100644
index 20c0861c46610..8cd44c0d95a17 100644
--- chrome/browser/ui/views/page_action/page_action_icon_controller.cc
+++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc
@@ -110,6 +110,14 @@ void PageActionIconController::Init(const PageActionIconParams& params,
@@ -109,6 +109,14 @@ void PageActionIconController::Init(const PageActionIconParams& params,
if (IsPageActionMigrated(type)) {
continue;
}
@@ -1007,10 +1020,10 @@ index 5732e0fa49448..92f02d924b63a 100644
case PageActionIconType::kPaymentsOfferNotification:
add_page_action_icon(
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 60ad9ebfa2a66..112f76a4a192e 100644
index 6083cd2c41420..1da3e7881016d 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -753,29 +753,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -720,29 +720,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {
@@ -1053,10 +1066,10 @@ index 60ad9ebfa2a66..112f76a4a192e 100644
}
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index 033b8cb60378e..fe59d213ee0a2 100644
index ab1b0d88b5a37..4e776a93ee8e2 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -191,7 +191,7 @@ class TabstripLikeBackground : public views::Background {
@@ -187,7 +187,7 @@ class TabstripLikeBackground : public views::Background {
void Paint(gfx::Canvas* canvas, views::View* view) const override {
bool painted = TopContainerBackground::PaintThemeCustomImage(canvas, view,
browser_view_);
@@ -1065,7 +1078,7 @@ index 033b8cb60378e..fe59d213ee0a2 100644
SkColor frame_color =
browser_view_->frame()->GetFrameView()->GetFrameColor(
BrowserFrameActiveState::kUseCurrent);
@@ -225,12 +225,13 @@ END_METADATA
@@ -221,12 +221,13 @@ END_METADATA
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(ToolbarView, kToolbarElementId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(ToolbarView, kToolbarContainerElementId);
@@ -1081,9 +1094,9 @@ index 033b8cb60378e..fe59d213ee0a2 100644
SetID(VIEW_ID_TOOLBAR);
SetProperty(views::kElementIdentifierKey, kToolbarElementId);
@@ -265,9 +266,24 @@ ToolbarView::~ToolbarView() {
if (browser_view_->GetSupportsTabStrip()) {
browser()->GetTabStripModel()->RemoveObserver(this);
@@ -258,9 +259,24 @@ ToolbarView::~ToolbarView() {
for (const auto& view_and_command : GetViewCommandMap()) {
chrome::RemoveCommandObserver(browser_, view_and_command.second, this);
}
+
+ browser_view_->WillDestroyToolbar();
@@ -1106,7 +1119,7 @@ index 033b8cb60378e..fe59d213ee0a2 100644
#if defined(USE_AURA)
// Avoid generating too many occlusion tracking calculation events before this
// function returns. The occlusion status will be computed only once once this
@@ -290,7 +306,7 @@ void ToolbarView::Init() {
@@ -283,7 +299,7 @@ void ToolbarView::Init() {
auto location_bar = std::make_unique<LocationBarView>(
browser_, browser_->profile(), browser_->command_controller(), this,
@@ -1115,7 +1128,7 @@ index 033b8cb60378e..fe59d213ee0a2 100644
// Make sure the toolbar shows by default.
size_animation_.Reset(1);
@@ -363,7 +379,8 @@ void ToolbarView::Init() {
@@ -356,7 +372,8 @@ void ToolbarView::Init() {
}
std::unique_ptr<media_router::CastToolbarButton> cast;
if (!base::FeatureList::IsEnabled(features::kPinnedCastButton)) {
@@ -1125,7 +1138,7 @@ index 033b8cb60378e..fe59d213ee0a2 100644
cast = media_router::CastToolbarButton::Create(browser_);
}
}
@@ -839,7 +856,8 @@ void ToolbarView::Layout(PassKey) {
@@ -821,7 +838,8 @@ void ToolbarView::Layout(PassKey) {
if (display_mode_ == DisplayMode::NORMAL) {
LayoutCommon();
@@ -1136,10 +1149,10 @@ index 033b8cb60378e..fe59d213ee0a2 100644
if (toolbar_controller_) {
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
index 09a5503b64a78..b7ee6fa181994 100644
index b34fdea7f98b4..58e65bb7aff07 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.h
+++ chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -99,7 +99,8 @@ class ToolbarView : public views::AccessiblePaneView,
@@ -97,7 +97,8 @@ class ToolbarView : public views::AccessiblePaneView,
DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kToolbarElementId);
DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kToolbarContainerElementId);

View File

@@ -1,8 +1,8 @@
diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h
index 9ff15341473af..73b969cabd81e 100644
index dbd35f1300604..1c890c637d852 100644
--- content/browser/devtools/devtools_instrumentation.h
+++ content/browser/devtools/devtools_instrumentation.h
@@ -114,7 +114,7 @@ bool ApplyUserAgentMetadataOverrides(
@@ -116,7 +116,7 @@ bool ApplyUserAgentMetadataOverrides(
FrameTreeNode* frame_tree_node,
std::optional<blink::UserAgentMetadata>* override_out);

View File

@@ -22,18 +22,6 @@ index 0a360f45e89d9..c88c7ea9177e5 100644
// These are protected so they can only be accessed by the friend
// classes listed above.
diff --git components/variations/BUILD.gn components/variations/BUILD.gn
index 32ce3e7dafda1..14fec0983015d 100644
--- components/variations/BUILD.gn
+++ components/variations/BUILD.gn
@@ -131,6 +131,7 @@ component("variations") {
":buildflags",
":variations_mojom",
"proto",
+ "//cef/libcef/features:buildflags",
"//components/crash/core/common:crash_key",
"//components/prefs",
"//components/version_info",
diff --git components/variations/synthetic_trials_active_group_id_provider.cc components/variations/synthetic_trials_active_group_id_provider.cc
index bd51697297471..3e669cd080457 100644
--- components/variations/synthetic_trials_active_group_id_provider.cc

View File

@@ -1,5 +1,5 @@
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index 9bbf031144ff0..f99b7fa035187 100644
index a28237bf93ef4..9a01b185e76f4 100644
--- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc
@@ -588,7 +588,7 @@ void DevToolsHttpHandler::OnJsonRequest(
@@ -12,10 +12,10 @@ index 9bbf031144ff0..f99b7fa035187 100644
version.Set("V8-Version", V8_VERSION_STRING);
std::string host = info.GetHeaderValue("host");
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index 287d602c11e35..f755b7af6ce71 100644
index 1a800194b97da..b92a789494fea 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -982,7 +982,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
@@ -978,7 +978,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
mojo::PendingRemote<network::mojom::URLLoaderFactory>
terminal_external_protocol;
bool handled = GetContentClient()->browser()->HandleExternalProtocol(
@@ -24,7 +24,7 @@ index 287d602c11e35..f755b7af6ce71 100644
frame_tree_node->frame_tree_node_id(), navigation_ui_data,
request_info.is_primary_main_frame,
frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags,
@@ -994,6 +994,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
@@ -990,6 +990,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
*request_info.initiator_document_token)
: nullptr,
request_info.isolation_info, &terminal_external_protocol);
@@ -47,10 +47,10 @@ index 287d602c11e35..f755b7af6ce71 100644
return std::make_pair(
/*is_cacheable=*/false,
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index 4a377944faaf9..e994ae8b1e944 100644
index 9c36ad70531bd..3546f7f9faf4e 100644
--- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc
@@ -1204,7 +1204,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
@@ -1180,7 +1180,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
void ContentBrowserClient::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) {}
@@ -59,7 +59,7 @@ index 4a377944faaf9..e994ae8b1e944 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -1213,6 +1213,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
@@ -1189,6 +1189,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
cert_verifier_creation_params) {
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = "en-us,en";
@@ -68,10 +68,10 @@ index 4a377944faaf9..e994ae8b1e944 100644
std::vector<base::FilePath>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index 0d0d957b353e0..c2a6efbbb3c0d 100644
index f1fee091b84ae..8c9feee790c91 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -1413,6 +1413,12 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1381,6 +1381,12 @@ class CONTENT_EXPORT ContentBrowserClient {
bool opener_suppressed,
bool* no_javascript_access);
@@ -84,7 +84,7 @@ index 0d0d957b353e0..c2a6efbbb3c0d 100644
// Allows the embedder to return a delegate for the SpeechRecognitionManager.
// The delegate will be owned by the manager. It's valid to return nullptr.
virtual SpeechRecognitionManagerDelegate*
@@ -2258,7 +2264,7 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2226,7 +2232,7 @@ class CONTENT_EXPORT ContentBrowserClient {
//
// If |relative_partition_path| is the empty string, it means this needs to
// create the default NetworkContext for the BrowserContext.
@@ -93,7 +93,7 @@ index 0d0d957b353e0..c2a6efbbb3c0d 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -2500,6 +2506,22 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2468,6 +2474,22 @@ class CONTENT_EXPORT ContentBrowserClient {
const net::IsolationInfo& isolation_info,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@@ -116,7 +116,7 @@ index 0d0d957b353e0..c2a6efbbb3c0d 100644
// Creates an OverlayWindow to be used for video or Picture-in-Picture.
// This window will house the content shown when in Picture-in-Picture mode.
// This will return a new OverlayWindow.
@@ -2565,6 +2587,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2533,6 +2555,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct();
@@ -153,10 +153,10 @@ index 7a2d251ba2d13..68297ee6f118f 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 790bf3bdfc489..c339cbd763417 100644
index 0a5556cb6eac8..cecc0ae19bc62 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -590,6 +590,8 @@ void RenderThreadImpl::Init() {
@@ -593,6 +593,8 @@ void RenderThreadImpl::Init() {
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
blink::URLLoaderThrottleProviderType::kFrame);
@@ -166,10 +166,10 @@ index 790bf3bdfc489..c339cbd763417 100644
base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver,
base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 45cbe16e4582c..401b59c0f3490 100644
index 5747f94527887..d54aeac829007 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -1058,6 +1058,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
@@ -1049,6 +1049,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
//------------------------------------------------------------------------------
@@ -186,7 +186,7 @@ index 45cbe16e4582c..401b59c0f3490 100644
RendererBlinkPlatformImpl::CreateWebV8ValueConverter() {
return std::make_unique<V8ValueConverterImpl>();
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index 2b6f49b635456..6d1221d8663ca 100644
index 206b8df48273a..e10852779c209 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -250,6 +250,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -200,10 +200,10 @@ index 2b6f49b635456..6d1221d8663ca 100644
// plus eTLD+1, such as https://google.com), or to a more specific origin.
void SetIsLockedToSite();
diff --git content/shell/browser/shell_content_browser_client.cc content/shell/browser/shell_content_browser_client.cc
index a907bcc2eab8d..64ebf54ffd494 100644
index 3993da6d53843..78784b4dd8842 100644
--- content/shell/browser/shell_content_browser_client.cc
+++ content/shell/browser/shell_content_browser_client.cc
@@ -819,7 +819,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated(
@@ -820,7 +820,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated(
#endif
}
@@ -212,7 +212,7 @@ index a907bcc2eab8d..64ebf54ffd494 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -828,6 +828,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams(
@@ -829,6 +829,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams(
cert_verifier_creation_params) {
ConfigureNetworkContextParamsForShell(context, network_context_params,
cert_verifier_creation_params);
@@ -221,10 +221,10 @@ index a907bcc2eab8d..64ebf54ffd494 100644
std::vector<base::FilePath>
diff --git content/shell/browser/shell_content_browser_client.h content/shell/browser/shell_content_browser_client.h
index e608835c3d16f..1d767a2ee4c09 100644
index 29f0d888bcc9a..d870ed9844bb7 100644
--- content/shell/browser/shell_content_browser_client.h
+++ content/shell/browser/shell_content_browser_client.h
@@ -162,7 +162,7 @@ class ShellContentBrowserClient : public ContentBrowserClient {
@@ -161,7 +161,7 @@ class ShellContentBrowserClient : public ContentBrowserClient {
GetGeolocationSystemPermissionManager() override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
@@ -234,10 +234,10 @@ index e608835c3d16f..1d767a2ee4c09 100644
bool in_memory,
const base::FilePath& relative_partition_path,
diff --git headless/lib/browser/headless_content_browser_client.cc headless/lib/browser/headless_content_browser_client.cc
index 26f73ac1df741..13214f607471f 100644
index 3ca4381bcf4df..2ac7cea3f12bc 100644
--- headless/lib/browser/headless_content_browser_client.cc
+++ headless/lib/browser/headless_content_browser_client.cc
@@ -423,7 +423,7 @@ bool HeadlessContentBrowserClient::IsCookieDeprecationLabelAllowedForContext(
@@ -394,7 +394,7 @@ bool HeadlessContentBrowserClient::IsCookieDeprecationLabelAllowedForContext(
return true;
}
@@ -246,7 +246,7 @@ index 26f73ac1df741..13214f607471f 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -433,6 +433,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
@@ -404,6 +404,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
HeadlessBrowserContextImpl::From(context)->ConfigureNetworkContextParams(
in_memory, relative_partition_path, network_context_params,
cert_verifier_creation_params);
@@ -255,10 +255,10 @@ index 26f73ac1df741..13214f607471f 100644
std::string HeadlessContentBrowserClient::GetProduct() {
diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h
index 4234c1259f4b0..8b4e308ce94af 100644
index 30af5588cd71d..29940a43ce09f 100644
--- headless/lib/browser/headless_content_browser_client.h
+++ headless/lib/browser/headless_content_browser_client.h
@@ -114,7 +114,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient {
@@ -113,7 +113,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient {
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& context_origin) override;

View File

@@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/navigation_policy_container_builder.cc content/browser/renderer_host/navigation_policy_container_builder.cc
index a7212c57ccebf..85d0bf052b774 100644
index 100eea6a4d7f3..fecc3a95130d7 100644
--- content/browser/renderer_host/navigation_policy_container_builder.cc
+++ content/browser/renderer_host/navigation_policy_container_builder.cc
@@ -45,7 +45,6 @@ std::unique_ptr<PolicyContainerPolicies> GetInitiatorPolicies(

View File

@@ -13,10 +13,10 @@ index b6389523952a4..f9c709624cd0e 100644
setproctitle_init(main_argv);
}
diff --git content/app/content_main.cc content/app/content_main.cc
index 36248b2a3e099..4dcfe54abccef 100644
index ffc5c37742800..82e1c22b0f073 100644
--- content/app/content_main.cc
+++ content/app/content_main.cc
@@ -205,16 +205,10 @@ ContentMainParams::~ContentMainParams() = default;
@@ -199,16 +199,10 @@ ContentMainParams::~ContentMainParams() = default;
ContentMainParams::ContentMainParams(ContentMainParams&&) = default;
ContentMainParams& ContentMainParams::operator=(ContentMainParams&&) = default;
@@ -35,7 +35,7 @@ index 36248b2a3e099..4dcfe54abccef 100644
// A flag to indicate whether Main() has been called before. On Android, we
// may re-run Main() without restarting the browser process. This flag
@@ -293,7 +287,9 @@ NO_STACK_PROTECTOR int RunContentProcess(
@@ -287,7 +281,9 @@ NO_STACK_PROTECTOR int RunContentProcess(
// default, "C", locale.
setlocale(LC_NUMERIC, "C");
@@ -46,7 +46,7 @@ index 36248b2a3e099..4dcfe54abccef 100644
#endif
#if BUILDFLAG(IS_WIN)
@@ -301,14 +297,6 @@ NO_STACK_PROTECTOR int RunContentProcess(
@@ -295,14 +291,6 @@ NO_STACK_PROTECTOR int RunContentProcess(
#endif
#if BUILDFLAG(IS_MAC)
@@ -61,7 +61,7 @@ index 36248b2a3e099..4dcfe54abccef 100644
InitializeMac();
#endif
@@ -371,12 +359,44 @@ NO_STACK_PROTECTOR int RunContentProcess(
@@ -356,12 +344,44 @@ NO_STACK_PROTECTOR int RunContentProcess(
if (IsSubprocess())
CommonSubprocessInit();
@@ -108,7 +108,7 @@ index 36248b2a3e099..4dcfe54abccef 100644
}
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
index 48363b920c780..920db94bb1738 100644
index 24f6f89cfa430..da28867d34ef5 100644
--- content/app/content_main_runner_impl.cc
+++ content/app/content_main_runner_impl.cc
@@ -50,6 +50,7 @@
@@ -119,7 +119,7 @@ index 48363b920c780..920db94bb1738 100644
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/branding_buildflags.h"
@@ -1366,6 +1367,11 @@ void ContentMainRunnerImpl::Shutdown() {
@@ -1340,6 +1341,11 @@ void ContentMainRunnerImpl::Shutdown() {
is_shutdown_ = true;
}

View File

@@ -1,68 +0,0 @@
diff --git content/browser/renderer_host/navigation_throttle_runner.cc content/browser/renderer_host/navigation_throttle_runner.cc
index 58da260893bf5..f54b5d1d6dcfd 100644
--- content/browser/renderer_host/navigation_throttle_runner.cc
+++ content/browser/renderer_host/navigation_throttle_runner.cc
@@ -149,17 +149,23 @@ NavigationHandle& NavigationThrottleRunner::GetNavigationHandle() {
}
void NavigationThrottleRunner::AddThrottle(
- std::unique_ptr<NavigationThrottle> navigation_throttle) {
+ std::unique_ptr<NavigationThrottle> navigation_throttle,
+ bool first) {
CHECK(navigation_throttle);
TRACE_EVENT1("navigation", "NavigationThrottleRunner::AddThrottle",
"navigation_throttle", navigation_throttle->GetNameForLogging());
- throttles_.push_back(std::move(navigation_throttle));
+ if (first) {
+ throttles_.emplace(throttles_.begin(), std::move(navigation_throttle));
+ } else {
+ throttles_.push_back(std::move(navigation_throttle));
+ }
}
void NavigationThrottleRunner::MaybeAddThrottle(
- std::unique_ptr<NavigationThrottle> navigation_throttle) {
+ std::unique_ptr<NavigationThrottle> navigation_throttle,
+ bool first) {
if (navigation_throttle) {
- AddThrottle(std::move(navigation_throttle));
+ AddThrottle(std::move(navigation_throttle), first);
}
}
diff --git content/browser/renderer_host/navigation_throttle_runner.h content/browser/renderer_host/navigation_throttle_runner.h
index 21f7fb2b6c46b..6f369d7e3222a 100644
--- content/browser/renderer_host/navigation_throttle_runner.h
+++ content/browser/renderer_host/navigation_throttle_runner.h
@@ -75,9 +75,11 @@ class CONTENT_EXPORT NavigationThrottleRunner
// Implements NavigationThrottleRegistry:
NavigationHandle& GetNavigationHandle() override;
void AddThrottle(
- std::unique_ptr<NavigationThrottle> navigation_throttle) override;
+ std::unique_ptr<NavigationThrottle> navigation_throttle,
+ bool first = false) override;
void MaybeAddThrottle(
- std::unique_ptr<NavigationThrottle> navigation_throttle) override;
+ std::unique_ptr<NavigationThrottle> navigation_throttle,
+ bool first = false) override;
// Will call the appropriate NavigationThrottle function based on |event| on
// all NavigationThrottles owned by this NavigationThrottleRunner.
diff --git content/public/browser/navigation_throttle_registry.h content/public/browser/navigation_throttle_registry.h
index 4a212401c67a8..b77c15736b177 100644
--- content/public/browser/navigation_throttle_registry.h
+++ content/public/browser/navigation_throttle_registry.h
@@ -29,9 +29,11 @@ class CONTENT_EXPORT NavigationThrottleRegistry {
// pass a nullptr, use MaybeAddThrottle() instead. It just ignores calls with
// a nullptr.
virtual void AddThrottle(
- std::unique_ptr<NavigationThrottle> navigation_throttle) = 0;
+ std::unique_ptr<NavigationThrottle> navigation_throttle,
+ bool first = false) = 0;
virtual void MaybeAddThrottle(
- std::unique_ptr<NavigationThrottle> navigation_throttle) = 0;
+ std::unique_ptr<NavigationThrottle> navigation_throttle,
+ bool first = false) = 0;
};
} // namespace content

View File

@@ -12,7 +12,7 @@ index ae58a0b0a64ae..35e01ee64e5d7 100644
"//google_apis/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index e32e31565b7cc..464bdcf2c95e3 100644
index c0a9639d27232..e1cfab3d24c4f 100644
--- BUILD.gn
+++ BUILD.gn
@@ -19,6 +19,7 @@ import("//build/config/ui.gni")
@@ -23,7 +23,7 @@ index e32e31565b7cc..464bdcf2c95e3 100644
import("//chrome/enterprise_companion/buildflags.gni")
import("//components/enterprise/buildflags/buildflags.gni")
import("//components/nacl/features.gni")
@@ -292,6 +293,10 @@ group("gn_all") {
@@ -293,6 +294,10 @@ group("gn_all") {
deps += root_extra_deps
@@ -78,7 +78,7 @@ index bd41166938952..fba7843d79796 100644
visual_studio_version_logs = [ "windows_sdk_version=${windows_sdk_version}" ]
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index 388b83742657c..54a0bac5b6ad6 100644
index 845b473d56165..d1ffe4a9e54b1 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -5,6 +5,7 @@
@@ -89,7 +89,7 @@ index 388b83742657c..54a0bac5b6ad6 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//components/compose/features.gni")
@@ -497,6 +498,11 @@ template("chrome_extra_paks") {
@@ -479,6 +480,11 @@ template("chrome_extra_paks") {
deps += [ "//components/headless/command_handler" ]
}

View File

@@ -1,11 +1,11 @@
diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec
index 2f4ab49cbe968..5e78796e1820b 100644
index 342b54311138a..037a8da0884ec 100644
--- tools/gritsettings/resource_ids.spec
+++ tools/gritsettings/resource_ids.spec
@@ -1532,11 +1532,18 @@
"third_party/search_engines_data/resources/search_engines_scaled_resources.grd": {
"structures": [10100],
@@ -1508,11 +1508,18 @@
"<(SHARED_INTERMEDIATE_DIR)/third_party/blink/public/strings/permission_element_generated_strings.grd": {
"META": {"sizes": {"messages": [2000],}},
"messages": [10080],
- }
+ },

View File

@@ -1,8 +1,8 @@
diff --git content/browser/child_process_launcher_helper_linux.cc content/browser/child_process_launcher_helper_linux.cc
index 75cafbe0dbd7d..337a10d6a90c3 100644
index add20a2f81d66..97071092ff768 100644
--- content/browser/child_process_launcher_helper_linux.cc
+++ content/browser/child_process_launcher_helper_linux.cc
@@ -190,7 +190,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() {
@@ -191,7 +191,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() {
base::File OpenFileToShare(const base::FilePath& path,
base::MemoryMappedFile::Region* region) {
base::FilePath exe_dir;
@@ -25,11 +25,11 @@ index f3a6d25be41ed..c826aa9e9ab6c 100644
if (base::PathExists(sandbox_candidate))
sandbox_binary = sandbox_candidate;
diff --git ui/ozone/common/egl_util.cc ui/ozone/common/egl_util.cc
index 92b2a6da7828f..bf318d19255e0 100644
index c3879262996c5..955fd0a375f60 100644
--- ui/ozone/common/egl_util.cc
+++ ui/ozone/common/egl_util.cc
@@ -149,7 +149,7 @@ bool LoadDefaultEGLGLES2Bindings(
#else
@@ -135,7 +135,7 @@ bool LoadDefaultEGLGLES2Bindings(
if (implementation.gl == gl::kGLImplementationEGLANGLE) {
base::FilePath module_path;
#if !BUILDFLAG(IS_FUCHSIA)
- if (!base::PathService::Get(base::DIR_MODULE, &module_path))

View File

@@ -1,8 +1,8 @@
diff --git ui/accessibility/platform/BUILD.gn ui/accessibility/platform/BUILD.gn
index 09b5f1a0165ca..441bcedb3ac8b 100644
index 30440d1b5ba07..c16bda68afbd2 100644
--- ui/accessibility/platform/BUILD.gn
+++ ui/accessibility/platform/BUILD.gn
@@ -357,6 +357,10 @@ component("platform") {
@@ -355,6 +355,10 @@ component("platform") {
if (use_gio) {
configs += [ "//build/linux:gio_config" ]
}
@@ -14,10 +14,10 @@ index 09b5f1a0165ca..441bcedb3ac8b 100644
}
}
diff --git ui/gtk/BUILD.gn ui/gtk/BUILD.gn
index dc98ce8281066..31a1eac703aba 100644
index 539cc383b43be..574a7a48787fe 100644
--- ui/gtk/BUILD.gn
+++ ui/gtk/BUILD.gn
@@ -175,4 +175,8 @@ component("gtk") {
@@ -173,4 +173,8 @@ component("gtk") {
# TODO: This should be removed.
deps += [ "//ui/ozone" ]

View File

@@ -1,16 +1,16 @@
diff --git ui/gtk/gtk_ui.cc ui/gtk/gtk_ui.cc
index 79cdad0adc1ae..b9cb878b771b0 100644
index 95bdbe6ae04af..913719635a342 100644
--- ui/gtk/gtk_ui.cc
+++ ui/gtk/gtk_ui.cc
@@ -32,6 +32,7 @@
@@ -31,6 +31,7 @@
#include "base/numerics/safe_conversions.h"
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/themes/theme_properties.h" // nogncheck
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -254,10 +255,15 @@ bool GtkUi::Initialize() {
@@ -253,10 +254,15 @@ bool GtkUi::Initialize() {
};
GtkSettings* settings = gtk_settings_get_default();
@@ -27,7 +27,7 @@ index 79cdad0adc1ae..b9cb878b771b0 100644
&GtkUi::OnCursorThemeNameChanged);
connect(settings, "notify::gtk-cursor-theme-size",
diff --git ui/ozone/platform/x11/ozone_platform_x11.cc ui/ozone/platform/x11/ozone_platform_x11.cc
index 4f00f630665a1..0c0408838872a 100644
index 14a38b11d595c..84174ea74f7d2 100644
--- ui/ozone/platform/x11/ozone_platform_x11.cc
+++ ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -64,6 +64,8 @@ namespace ui {
@@ -39,7 +39,7 @@ index 4f00f630665a1..0c0408838872a 100644
// Singleton OzonePlatform implementation for X11 platform.
class OzonePlatformX11 : public OzonePlatform,
public OSExchangeDataProviderFactoryOzone {
@@ -266,7 +268,15 @@ class OzonePlatformX11 : public OzonePlatform,
@@ -265,7 +267,15 @@ class OzonePlatformX11 : public OzonePlatform,
TouchFactory::SetTouchDeviceListFromCommandLine();
#if BUILDFLAG(USE_GTK)
@@ -56,7 +56,7 @@ index 4f00f630665a1..0c0408838872a 100644
#endif
menu_utils_ = std::make_unique<X11MenuUtils>();
@@ -365,4 +375,8 @@ OzonePlatform* CreateOzonePlatformX11() {
@@ -364,4 +374,8 @@ OzonePlatform* CreateOzonePlatformX11() {
return new OzonePlatformX11;
}

View File

@@ -100,7 +100,7 @@ index 3ab395e3b0b45..c012641a5dc7e 100644
}
diff --git ui/linux/linux_ui.h ui/linux/linux_ui.h
index c4805571bc162..57b967a9e5962 100644
index 4ce8218e5d809..908397b968415 100644
--- ui/linux/linux_ui.h
+++ ui/linux/linux_ui.h
@@ -20,6 +20,10 @@

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/chrome_resource_bundle_helper.cc chrome/browser/chrome_resource_bundle_helper.cc
index 2c437e5229bc1..f10ddd1dca48d 100644
index d1e99bf112b20..fee8571fab728 100644
--- chrome/browser/chrome_resource_bundle_helper.cc
+++ chrome/browser/chrome_resource_bundle_helper.cc
@@ -62,8 +62,10 @@ extern void InitializeLocalState(
@@ -63,8 +63,10 @@ extern void InitializeLocalState(
// Initializes the shared instance of ResourceBundle and returns the application
// locale. An empty |actual_locale| value indicates failure.
@@ -13,10 +13,10 @@ index 2c437e5229bc1..f10ddd1dca48d 100644
+ ui::ResourceBundle::Delegate* resource_bundle_delegate,
+ bool is_running_tests) {
#if BUILDFLAG(IS_ANDROID)
// In order for DetectAndSetLoadSecondaryLocalePaks() to work ResourceBundle
// must not have been created yet.
@@ -71,23 +73,16 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
ui::DetectAndSetLoadSecondaryLocalePaks();
// In order for SetLoadSecondaryLocalePaks() to work ResourceBundle must
// not have been created yet.
@@ -77,16 +79,8 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
.empty());
#endif
- std::string preferred_locale;
@@ -31,8 +31,9 @@ index 2c437e5229bc1..f10ddd1dca48d 100644
local_state->GetString(language::prefs::kApplicationLocale);
-#endif
TRACE_EVENT0("startup",
"ChromeBrowserMainParts::InitResourceBundleAndDetermineLocale");
#if BUILDFLAG(IS_CHROMEOS)
ui::ResourceBundle::SetLottieParsingFunctions(
@@ -98,7 +92,8 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
// On a POSIX OS other than ChromeOS, the parameter that is passed to the
// method InitSharedInstance is ignored.
std::string actual_locale = ui::ResourceBundle::InitSharedInstanceWithLocale(
@@ -42,7 +43,7 @@ index 2c437e5229bc1..f10ddd1dca48d 100644
CHECK(!actual_locale.empty())
<< "Locale could not be found for " << preferred_locale;
@@ -120,6 +115,7 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
@@ -131,6 +126,7 @@ std::string InitResourceBundleAndDetermineLocale(PrefService* local_state,
std::string LoadLocalState(
ChromeFeatureListCreator* chrome_feature_list_creator,
@@ -50,7 +51,7 @@ index 2c437e5229bc1..f10ddd1dca48d 100644
bool is_running_tests) {
base::FilePath user_data_dir;
if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir))
@@ -131,5 +127,6 @@ std::string LoadLocalState(
@@ -142,5 +138,6 @@ std::string LoadLocalState(
new ChromeCommandLinePrefStore(base::CommandLine::ForCurrentProcess()));
return InitResourceBundleAndDetermineLocale(

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc
index 4210e04907540..80211a71fc5ca 100644
index 83d21fd2cf3ab..00dc68165c4ee 100644
--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc
+++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc
@@ -804,8 +804,8 @@ int ProfileMenuViewBase::GetMaxHeight() const {
@@ -745,8 +745,8 @@ int ProfileMenuViewBase::GetMaxHeight() const {
->GetDisplayNearestPoint(anchor_rect.CenterPoint())
.work_area();
int available_space = screen_space.bottom() - anchor_rect.bottom();

View File

@@ -1,8 +1,8 @@
diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index e2b524c968d67..daaf0c04c8b79 100644
index 1b458cd3bfc44..4a82829c4d0dd 100644
--- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -173,6 +173,13 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -172,6 +172,13 @@ void ExtractUnderlines(NSAttributedString* string,
// RenderWidgetHostViewCocoa ---------------------------------------------------
@@ -16,7 +16,7 @@ index e2b524c968d67..daaf0c04c8b79 100644
// Private methods:
@interface RenderWidgetHostViewCocoa ()
@@ -785,6 +792,15 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -783,6 +790,15 @@ void ExtractUnderlines(NSAttributedString* string,
}
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {

View File

@@ -12,7 +12,7 @@ index 37cb1dac49610..6e5989c73bf08 100644
virtual ~WebContentsView() = default;
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 0bba5f4b0abda..59d04826eb87d 100644
index 60de0d74ee40f..ae66707e652be 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -226,6 +226,8 @@ void MimeHandlerViewGuest::CreateInnerPage(

Some files were not shown because too many files have changed in this diff Show More