Compare commits

..

39 Commits

Author SHA1 Message Date
John Kleinschmidt
3e7cbfee95 chore: use wine for v8_context_snapshot_generator 2026-04-07 14:15:13 -04:00
John Kleinschmidt
44b0789530 fixup after rebase 2026-04-07 13:32:52 -04:00
John Kleinschmidt
038f610ef8 Revert "try this"
This reverts commit 5a89776d813be426a8ef1103728aa32702103eef.
2026-04-07 12:34:24 -04:00
John Kleinschmidt
9f58248ac5 try this 2026-04-07 12:34:24 -04:00
John Kleinschmidt
1f6c061d0e use setarch to disable ASLR per-process 2026-04-07 12:34:24 -04:00
John Kleinschmidt
76a4adbe1c Revert "try setting values here"
This reverts commit 62d9a7e0a1a09ce6d1d193f77d251577043c99f3.
2026-04-07 12:34:24 -04:00
John Kleinschmidt
695b375cc9 try setting values here 2026-04-07 12:34:23 -04:00
John Kleinschmidt
cab27faeee try these suggestions 2026-04-07 12:34:23 -04:00
John Kleinschmidt
ed8cdca6c7 fixup for prebuilt mksnapshot 2026-04-07 12:34:23 -04:00
John Kleinschmidt
f87cbacea4 ignore unzip warnings 2026-04-07 12:34:23 -04:00
John Kleinschmidt
0e93e65759 try using prebuilt mksnapshot 2026-04-07 12:34:23 -04:00
John Kleinschmidt
aa74829cea see if this helps 2026-04-07 12:34:23 -04:00
John Kleinschmidt
d4b50302c6 change wine to not prompt for installs 2026-04-07 12:34:23 -04:00
John Kleinschmidt
44c52506b9 maybe this 2026-04-07 12:34:23 -04:00
John Kleinschmidt
4ade686dc0 debug wineboot 2026-04-07 12:34:22 -04:00
John Kleinschmidt
f7fdbbdf36 debug wineboot init 2026-04-07 12:34:22 -04:00
John Kleinschmidt
d2f0ebc159 try using winedebug 2026-04-07 12:34:22 -04:00
John Kleinschmidt
ac4307d32a Revert "try it this way"
This reverts commit f07a421c966f7f1ed8419d5cccace4a32c017686.
2026-04-07 12:34:22 -04:00
John Kleinschmidt
ef368f377f try it this way 2026-04-07 12:34:22 -04:00
John Kleinschmidt
df4a22eae4 Update wineboot command to suppress output and update
Suppress output for wineboot initialization and add update step.
2026-04-07 12:34:22 -04:00
John Kleinschmidt
34fba75af3 Update wineboot initialization in action.yml
Removed error suppression from wineboot initialization.
2026-04-07 12:34:22 -04:00
John Kleinschmidt
613434c18e fix build hang 2026-04-07 12:34:22 -04:00
John Kleinschmidt
4718534f22 try this 2026-04-07 12:34:21 -04:00
John Kleinschmidt
1fb9fd3810 fixup wine 2026-04-07 12:34:21 -04:00
John Kleinschmidt
f9f25e4d48 install newer wine 2026-04-07 12:34:21 -04:00
John Kleinschmidt
3079b0c606 Revert "Update fix_fall_back_to_rtlgenrandom_when_bcryptprimitives_dll_is.patch"
This reverts commit fb2ea1104f688fc17dd72ceb193986f9419cb7af.
2026-04-07 12:34:21 -04:00
John Kleinschmidt
25de3bb0b5 Update fix_fall_back_to_rtlgenrandom_when_bcryptprimitives_dll_is.patch
try this
2026-04-07 12:34:21 -04:00
John Kleinschmidt
400cb880aa try using mksnapshot.exe on cross compile 2026-04-07 12:34:21 -04:00
John Kleinschmidt
71f792cf35 Revert "chore: update mksnapshot to work for windows cross compile"
This reverts commit ea40af62cf7c65ef8120366c43dbdcae71dd237d.
2026-04-07 12:34:21 -04:00
John Kleinschmidt
c947680085 fixup 2026-04-07 12:34:20 -04:00
John Kleinschmidt
f1c425650a update build tools to latest 2026-04-07 12:34:20 -04:00
John Kleinschmidt
f61a5b1889 chore: update mksnapshot to work for windows cross compile 2026-04-07 12:34:20 -04:00
John Kleinschmidt
5491b80c48 Revert "chore: use v8_target_embedded_unwind = "win" to fixup mksnapshot"
This reverts commit 47893ab6f831203c8c8de7291aab04508e115f97.
2026-04-07 12:34:20 -04:00
John Kleinschmidt
165a675b8a chore: use v8_target_embedded_unwind = "win" to fixup mksnapshot 2026-04-07 12:34:20 -04:00
John Kleinschmidt
b7461579db Revert "wild guess"
This reverts commit 00b137df6f2e59b28c20038754465dee0649c843.
2026-04-07 12:34:20 -04:00
John Kleinschmidt
19816f5f3e wild guess 2026-04-07 12:34:20 -04:00
John Kleinschmidt
12f9b97955 chore: set ELECTRON_BUILD_TOOLS_MAIN_STAR
Needed for Windows cross compile
2026-04-07 12:34:20 -04:00
John Kleinschmidt
8d7db38344 add debugging to crash reporter specs.
debug crashpad failures

save source cache

Revert "save source cache"

This reverts commit 88a46191ba.

Revert "debug crashpad failures"

This reverts commit 12427135f1.

chore: temporarily remove crashpad patches to see if they are the issue

put back patch

Revert "chore: temporarily remove crashpad patches to see if they are the issue"

This reverts commit e0ffe69212.
2026-04-07 12:34:19 -04:00
John Kleinschmidt
57892e93c0 build: cross compile windows on linux 2026-04-07 12:34:19 -04:00
91 changed files with 963 additions and 814 deletions

View File

@@ -40,10 +40,113 @@ runs:
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
- name: Set GN_EXTRA_ARGS for Windows
shell: bash
if: ${{inputs.target-arch != 'x64' && inputs.target-platform == 'win' }}
if: ${{ inputs.target-platform == 'win' }}
run: |
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"${{ inputs.target-arch }}\""
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"${{ inputs.target-arch }}\" use_v8_context_snapshot=true v8_win_cross_compile_using_wine=true target_os=\"win\""
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
echo "ELECTRON_BUILD_TOOLS_MAIN_STAR=`pwd`/src/electron/build/siso/main.star" >> $GITHUB_ENV
- name: Install wine for Windows builds on non-Windows hosts
shell: bash
if: ${{ inputs.target-platform == 'win' && runner.os != 'Windows' }}
run: |
sudo mkdir -pm755 /etc/apt/keyrings
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
sudo dpkg --add-architecture i386
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo apt-get update
sudo apt install -y --install-recommends winehq-stable libgcc-s1:i386 libgcc-s1
# Increase virtual memory limits for Wine's VirtualAlloc (V8 sandbox
# reserves a very large contiguous region that fails under default limits)
sudo sysctl vm.mmap_min_addr
sudo sysctl -w vm.mmap_min_addr=65536
sudo sysctl -w vm.max_map_count=1048576
sudo sysctl -w vm.overcommit_memory=1
sudo sysctl -w kernel.randomize_va_space=0
if [ -x /usr/bin/wine ]; then
WINE_PATH=/usr/bin/wine
elif command -v wine >/dev/null 2>&1; then
WINE_PATH=$(command -v wine)
fi
if [ -z "$WINE_PATH" ] || [ ! -x "$WINE_PATH" ]; then
echo "ERROR: wine binary not found anywhere after install"
exit 1
fi
echo "Found wine at: $WINE_PATH"
export WINEPREFIX="$HOME/.wine"
mkdir -p "$WINEPREFIX"
echo "WINEPREFIX=$WINEPREFIX" >> $GITHUB_ENV
# Start a persistent Xvfb server for wine (xvfb-run per-invocation hangs
# because wineserver keeps the X connection alive)
export DISPLAY=:99.0
echo "DISPLAY=:99.0" >> $GITHUB_ENV
export XDG_RUNTIME_DIR=/tmp/runtime-$(whoami)
echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" >> $GITHUB_ENV
mkdir -p "$XDG_RUNTIME_DIR"
echo "Starting Xvfb on :99 with 1024x768x24 resolution"
Xvfb :99 -screen 0 1024x768x24 &
echo "Wait for Xvfb to be ready"
# Wait for Xvfb to be ready (up to 5 seconds)
for i in $(seq 1 10); do
if xdpyinfo -display :99 >/dev/null 2>&1; then
echo "Xvfb is running on :99"
break
fi
echo "xvfb not ready yet, waiting..."
sleep 0.5
done
if ! xdpyinfo -display :99 >/dev/null 2>&1; then
echo "ERROR: Xvfb failed to start"
exit 1
fi
echo "Xvfb is ready; about to run wineboot"
export WINEDEBUG=-all
echo "WINEDEBUG=$WINEDEBUG" >> $GITHUB_ENV
export WINEARCH=win64
echo "WINEARCH=$WINEARCH" >> $GITHUB_ENV
WINEDLLOVERRIDES="mscoree,mshtml=" wineboot --init
echo "Done running wineboot"
# Initialize wine prefix to avoid first-run delays during build
#"$WINE_PATH" wineboot --init 2>/dev/null || true
WINE_WRAPPER="/usr/local/bin/xvfb-wine"
printf '#!/bin/sh\nsetarch x86_64 -R %s "$@"\n' "$WINE_PATH" | sudo tee "$WINE_WRAPPER" > /dev/null
sudo chmod +x "$WINE_WRAPPER"
GN_APPENDED_ARGS="$GN_EXTRA_ARGS v8_wine_path=\"$WINE_WRAPPER\""
# Pass wine path to GN so siso can find it regardless of PATH
GN_APPENDED_ARGS="$GN_EXTRA_ARGS v8_wine_path=\"$WINE_PATH\""
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
echo "GN APPENDED_ARGS set with wine path: $GN_APPENDED_ARGS"
echo "Wine setup complete"
# - name: Download mksnapshot.zip
# shell: bash
# if: ${{ inputs.target-platform == 'win' }}
# run: |
# # Download mksnapshot.zip from https://electronbuildtools.blob.core.windows.net/windows-toolchains/mksnapshot.zip
# curl -L -o mksnapshot.zip https://electronbuildtools.blob.core.windows.net/windows-toolchains/mksnapshot.zip
# if [ $? -ne 0 ]; then
# echo "Failed to download mksnapshot.zip"
# exit 1
# fi
# if [ -f mksnapshot.zip ]; then
# echo "Successfully downloaded mksnapshot.zip"
# else
# echo "mksnapshot.zip not found after download"
# exit 1
# fi
# if [ -f mksnapshot.zip ]; then
# unzip mksnapshot.zip -d mksnapshot || true
# PREBUILT_MKSNAPSHOT="$(pwd)/mksnapshot/mksnapshot.exe"
# if [ -f "$PREBUILT_MKSNAPSHOT" ]; then
# GN_APPENDED_ARGS="$GN_EXTRA_ARGS v8_prebuilt_mksnapshot=\"$PREBUILT_MKSNAPSHOT\""
# echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
# echo "Using pre-built mksnapshot at $PREBUILT_MKSNAPSHOT"
# else
# echo "mksnapshot binary not found in mksnapshot.zip, will build from source"
# fi
# else
# echo "mksnapshot.zip not found, skipping unzip and PATH update"
# fi
- name: Add Clang problem matcher
shell: bash
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
@@ -58,7 +161,6 @@ runs:
OUTPUT_PATH: src/previous-object-checksums.json
run: node src/electron/.github/actions/build-electron/download-previous-object-checksums.mjs
- name: Build Electron ${{ inputs.step-suffix }}
if: ${{ inputs.target-platform != 'win' }}
shell: bash
run: |
rm -rf "src/out/Default/Electron Framework.framework"
@@ -83,7 +185,11 @@ runs:
node electron/script/check-symlinks.js
# Build stats and object checksums
BUILD_STATS_ARGS="out/Default/siso.INFO --out-dir out/Default --output-object-checksums object-checksums.${{ inputs.artifact-platform }}_${{ inputs.target-arch }}.json"
if [ "$TARGET_PLATFORM" = "win" ]; then
BUILD_STATS_ARGS="out/Default/siso.exe.INFO --out-dir out/Default --output-object-checksums object-checksums.${{ inputs.artifact-platform }}_${{ inputs.target-arch }}.json"
else
BUILD_STATS_ARGS="out/Default/siso.INFO --out-dir out/Default --output-object-checksums object-checksums.${{ inputs.artifact-platform }}_${{ inputs.target-arch }}.json"
fi
if [ -f previous-object-checksums.json ]; then
BUILD_STATS_ARGS="$BUILD_STATS_ARGS --input-object-checksums previous-object-checksums.json"
fi
@@ -93,38 +199,6 @@ runs:
echo "Skipping build-stats.mjs upload because DD_API_KEY is not set"
fi
node electron/script/build-stats.mjs $BUILD_STATS_ARGS || true
- name: Build Electron (Windows) ${{ inputs.step-suffix }}
if: ${{ inputs.target-platform == 'win' }}
shell: powershell
run: |
cd src\electron
git pack-refs
cd ..
$env:NINJA_SUMMARIZE_BUILD = 1
if ("${{ inputs.is-release }}" -eq "true") {
e build --target electron:release_build
} else {
e build --target electron:testing_build
}
Copy-Item out\Default\.ninja_log out\electron_ninja_log
node electron\script\check-symlinks.js
# Build stats and object checksums
$statsArgs = @("out\Default\siso.exe.INFO", "--out-dir", "out\Default", "--output-object-checksums", "object-checksums.${{ inputs.artifact-platform }}_${{ inputs.target-arch }}.json")
if (Test-Path previous-object-checksums.json) {
$statsArgs += @("--input-object-checksums", "previous-object-checksums.json")
}
if ($env:DD_API_KEY) {
$statsArgs += "--upload-stats"
} else {
Write-Host "Skipping build-stats.mjs upload because DD_API_KEY is not set"
}
try {
& node electron\script\build-stats.mjs @statsArgs ; $LASTEXITCODE = 0
} catch {
Write-Host "Build stats failed, continuing..."
}
- name: Verify dist.zip ${{ inputs.step-suffix }}
shell: bash
run: |
@@ -152,15 +226,7 @@ runs:
sed $SEDOPTION '/--warn-about-builtin-profile-data/d' out/Default/mksnapshot_args
sed $SEDOPTION '/--abort-on-bad-builtin-profile-data/d' out/Default/mksnapshot_args
if [ "${{ inputs.target-platform }}" = "win" ]; then
cd out/Default
powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
powershell mkdir mktmp\\gen\\v8
powershell Copy-Item gen\\v8\\embedded.S mktmp\\gen\\v8
powershell Compress-Archive -update -Path mktmp\\gen mksnapshot.zip
else
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
fi
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
shell: bash
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
@@ -194,12 +260,6 @@ runs:
fi
electron/script/zip_manifests/check-zip-manifest.py out/Default/chromedriver.zip electron/script/zip_manifests/chromedriver_zip.$target_os.${{ inputs.target-arch }}.manifest
fi
- name: Create installed_software.json ${{ inputs.step-suffix }}
shell: powershell
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
run: |
cd src
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
- name: Profile Windows Toolchain ${{ inputs.step-suffix }}
shell: bash
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
@@ -269,7 +329,7 @@ runs:
with:
subject-path: ${{ steps.github-upload.outputs.UPLOADED_PATHS }}
- name: Generate siso report
if: ${{ inputs.target-platform != 'win' && !cancelled() }}
if: ${{ !cancelled() }}
shell: bash
run: |
cd src
@@ -278,17 +338,6 @@ runs:
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH" >> $GITHUB_ENV
cat siso_report.txt
echo "SISO REPORT AT $SISO_REPORT_PATH"
- name: Generate siso report (Windows)
if: ${{ inputs.target-platform == 'win' && !cancelled() }}
shell: powershell
run: |
cd src
e d siso report -C out\Default > siso_report.txt
$SISO_REPORT_PATH = Get-Content "siso_report.txt" | Select-String "report file:\s*(.+)" | ForEach-Object {
$_.Matches.Groups[1].Value.Trim()
}
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH"
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH" >> $env:GITHUB_ENV
- name: Generate Artifact Key
if: always() && !cancelled()
shell: bash

View File

@@ -15,7 +15,7 @@ runs:
git config --global core.preloadindex true
git config --global core.longpaths true
fi
export BUILD_TOOLS_SHA=1b7bd25dae4a780bb3170fff56c9327b53aaf7eb
export BUILD_TOOLS_SHA=1aa9dce0b3fa9353c38a6c3d4aac0249f0f68973
npm i -g @electron/build-tools
# Update depot_tools to ensure python
e d update_depot_tools
@@ -29,4 +29,4 @@ runs:
else
echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH
echo "$HOME/.electron_build_tools/third_party/depot_tools/python-bin" >> $GITHUB_PATH
fi
fi

View File

@@ -11,12 +11,12 @@ on:
skip-macos:
type: boolean
description: 'Skip macOS builds'
default: false
default: true
required: false
skip-linux:
type: boolean
description: 'Skip Linux builds'
default: false
default: true
required: false
skip-windows:
type: boolean
@@ -108,7 +108,7 @@ jobs:
# Checkout Jobs
checkout-macos:
needs: setup
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-macos}}
if: ${{ needs.setup.outputs.src == 'true' && inputs.skip-macos == 'false'}}
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
@@ -138,7 +138,7 @@ jobs:
checkout-linux:
needs: setup
if: ${{ !inputs.skip-linux}}
if: ${{ inputs.skip-linux == 'false' }}
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
@@ -387,8 +387,9 @@ jobs:
needs: checkout-windows
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
with:
build-runs-on: electron-arc-centralus-windows-amd64-16core
build-runs-on: electron-arc-centralus-linux-amd64-32core
test-runs-on: windows-latest
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/win-cache:/mnt/win-cache"]}'
target-platform: win
target-arch: x64
is-release: false
@@ -406,8 +407,9 @@ jobs:
needs: checkout-windows
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
with:
build-runs-on: electron-arc-centralus-windows-amd64-16core
build-runs-on: electron-arc-centralus-linux-amd64-32core
test-runs-on: windows-latest
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/win-cache:/mnt/win-cache"]}'
target-platform: win
target-arch: x86
is-release: false
@@ -425,8 +427,9 @@ jobs:
needs: checkout-windows
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
with:
build-runs-on: electron-arc-centralus-windows-amd64-16core
build-runs-on: electron-arc-centralus-linux-amd64-32core
test-runs-on: windows-11-arm
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/win-cache:/mnt/win-cache"]}'
target-platform: win
target-arch: arm64
is-release: false

View File

@@ -134,6 +134,10 @@ jobs:
- name: Install AZCopy
if: ${{ inputs.target-platform == 'macos' }}
run: brew install azcopy
- name: Enable windows toolchain
if: ${{ inputs.target-platform == 'win' }}
run: |
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
- name: Set GN_EXTRA_ARGS for Linux
if: ${{ inputs.target-platform == 'linux' }}
run: |
@@ -160,13 +164,15 @@ jobs:
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
- name: Restore src cache via AZCopy
if: ${{ inputs.target-platform != 'linux' }}
if: ${{ inputs.target-platform == 'macos' }}
uses: ./src/electron/.github/actions/restore-cache-azcopy
with:
target-platform: ${{ inputs.target-platform }}
- name: Restore src cache via AKS
if: ${{ inputs.target-platform == 'linux' }}
if: ${{ inputs.target-platform != 'macos' }}
uses: ./src/electron/.github/actions/restore-cache-aks
with:
target-platform: ${{ inputs.target-platform }}
- name: Checkout Electron
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
@@ -174,7 +180,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Fix Sync
if: ${{ inputs.target-platform != 'linux' }}
if: ${{ inputs.target-platform == 'macos' }}
uses: ./src/electron/.github/actions/fix-sync
with:
target-platform: ${{ inputs.target-platform }}
@@ -183,9 +189,21 @@ jobs:
- name: Init Build Tools
run: |
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --remote-build siso
e sanitize-config
- name: Run Electron Only Hooks
run: |
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
if [ "${{ inputs.target-platform }}" = "win" ]; then
rm -rf src/third_party/depot_tools/win_toolchain/vs_files*
fi
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
if [ "${{ inputs.target-platform }}" = "win" ]; then
echo "target_os=['win']" >> tmpgclient
fi
gclient runhooks --gclientfile=tmpgclient
# Fix VS Toolchain
if [ "${{ inputs.target-platform }}" = "win" ]; then
e d python3 src/build/vs_toolchain.py update --force
fi
- name: Regenerate DEPS Hash
run: |
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
@@ -224,3 +242,11 @@ jobs:
generate-symbols: '${{ inputs.generate-symbols }}'
upload-to-storage: '${{ inputs.upload-to-storage }}'
step-suffix: '(mas)'
- name: Wait for active SSH sessions
shell: bash
if: always() && !cancelled()
run: |
while [ -f /var/.ssh-lock ]
do
sleep 60
done

View File

@@ -50,7 +50,7 @@ jobs:
field-value: ✅ Reviewed
pull-request-labeled-ai-pr:
name: ai-pr label added
if: github.event.label.name == 'ai-pr' && github.event.pull_request.state != 'closed'
if: github.event.label.name == 'ai-pr'
runs-on: ubuntu-latest
permissions: {}
steps:

View File

@@ -1644,7 +1644,6 @@ action("node_version_header") {
action("generate_node_headers") {
deps = [ ":generate_config_gypi" ]
script = "script/node/generate_node_headers.py"
args = [ rebase_path("$root_gen_dir") ]
outputs = [ "$root_gen_dir/node_headers.json" ]
}

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'148.0.7778.0',
'148.0.7768.0',
'node_version':
'v24.14.1',
'nan_version':

103
build/siso/main.star Normal file
View File

@@ -0,0 +1,103 @@
load("@builtin//encoding.star", "json")
load("@builtin//lib/gn.star", "gn")
load("@builtin//path.star", "path")
load("@builtin//runtime.star", "runtime")
load("@builtin//struct.star", "module")
load("@config//main.star", upstream_init = "init")
load("@config//win_sdk.star", "win_sdk")
load("@config//gn_logs.star", "gn_logs")
def init(ctx):
mod = upstream_init(ctx)
step_config = json.decode(mod.step_config)
# Buildbarn doesn't support input_root_absolute_path so disable that
for rule in step_config["rules"]:
input_root_absolute_path = rule.get("input_root_absolute_path", False)
if input_root_absolute_path:
rule.pop("input_root_absolute_path", None)
# Only wrap clang rules with a remote wrapper if not on Linux. These are currently only
# needed for X-Compile builds, which run on Windows and Mac.
if runtime.os != "linux":
for rule in step_config["rules"]:
if rule["name"].startswith("clang/") or rule["name"].startswith("clang-cl/"):
rule["remote_wrapper"] = "../../buildtools/reclient_cfgs/chromium-browser-clang/clang_remote_wrapper"
if "inputs" not in rule:
rule["inputs"] = []
rule["inputs"].append("buildtools/reclient_cfgs/chromium-browser-clang/clang_remote_wrapper")
rule["inputs"].append("third_party/llvm-build/Release+Asserts_linux/bin/clang")
if "executables" not in step_config:
step_config["executables"] = []
step_config["executables"].append("buildtools/reclient_cfgs/chromium-browser-clang/clang_remote_wrapper")
step_config["executables"].append("third_party/llvm-build/Release+Asserts_linux/bin/clang")
if runtime.os == "darwin":
# Update platforms to match our default siso config instead of reclient configs.
step_config["platforms"].update({
"clang": step_config["platforms"]["default"],
"clang_large": step_config["platforms"]["default"],
})
# Add additional Windows SDK headers needed by Electron
win_toolchain_dir = win_sdk.toolchain_dir(ctx)
if win_toolchain_dir:
sdk_version = gn_logs.read(ctx).get("windows_sdk_version")
step_config["input_deps"][win_toolchain_dir + ":headers"].extend([
# third_party/electron_node/deps/uv/include/uv/win.h includes mswsock.h
path.join(win_toolchain_dir, "Windows Kits", "10/Include", sdk_version, "um/mswsock.h"),
# third_party/electron_node/src/debug_utils.cc includes lm.h
path.join(win_toolchain_dir, "Windows Kits", "10/Include", sdk_version, "um/Lm.h"),
])
if runtime.os == "windows":
# Update platforms to match our default siso config instead of reclient configs.
step_config["platforms"].update({
"clang-cl": step_config["platforms"]["default"],
"clang-cl_large": step_config["platforms"]["default"],
"lld-link": step_config["platforms"]["default"],
})
# When cross-compiling for Windows using wine, mksnapshot.exe is run via
# wine64 on the local machine. The remote execution service cannot handle
# this, so force mksnapshot to run locally. The wine64 prefix also changes
# the command so the upstream v8/mksnapshot rule's command_prefix won't
# match — add an explicit rule for the wine-prefixed command.
if "args.gn" in ctx.metadata:
gn_args = gn.args(ctx)
if gn_args.get("v8_win_cross_compile_using_wine", "").strip('"') == "true":
# Force the existing v8/mksnapshot rule to run locally
for rule in step_config["rules"]:
if rule.get("name") == "v8/mksnapshot":
rule["remote"] = False
# Add a rule that matches the wine64-prefixed mksnapshot command.
# With wine, GN emits: python3 ../../v8/tools/run.py <wine_path> ./mksnapshot.exe
# The upstream command_prefix ("python3 ...run.py ./mksnapshot") won't
# match because wine_path appears before ./mksnapshot.exe.
wine_path = gn_args.get("v8_wine_path", "").strip('"')
if wine_path:
step_config["rules"].insert(0, {
"name": "v8/mksnapshot_wine",
"command_prefix": "python3 ../../v8/tools/run.py " + wine_path,
"remote": False,
"timeout": "2m",
"output_local": True,
})
# Same treatment for v8_context_snapshot_generator which uses
# gn_run_binary.py instead of v8/tools/run.py.
step_config["rules"].insert(0, {
"name": "v8/context_snapshot_wine",
"command_prefix": "python3 ../../build/gn_run_binary.py " + wine_path,
"remote": False,
"timeout": "2m",
"output_local": True,
})
return module(
"config",
step_config = json.encode(step_config),
filegroups = mod.filegroups,
handlers = mod.handlers,
)

View File

@@ -21,7 +21,7 @@
"@types/semver": "^7.5.8",
"@types/stream-json": "^1.7.8",
"@types/temp": "^0.9.4",
"@xmldom/xmldom": "^0.8.12",
"@xmldom/xmldom": "^0.8.11",
"buffer": "^6.0.3",
"chalk": "^4.1.0",
"check-for-leaks": "^1.2.1",

View File

@@ -10,10 +10,10 @@ this patch is required to provide ripemd160 support in the nodejs crypto
module.
diff --git a/crypto/digest/digest_extra.cc b/crypto/digest/digest_extra.cc
index d38e0c1132da60ec96c3a5c2416ff07589f03b80..cd60baaf22a8d5dc20544d861d36b7d74d986e7b 100644
index 17961ba6bd9de78b5b1b1008eb1f73babd49d0e7..6a870dce37df8f49106c24b183308a2c7a03fd7d 100644
--- a/crypto/digest/digest_extra.cc
+++ b/crypto/digest/digest_extra.cc
@@ -48,6 +48,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = {
@@ -47,6 +47,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = {
{NID_sha512, EVP_sha512, SN_sha512, LN_sha512},
{NID_sha512_256, EVP_sha512_256, SN_sha512_256, LN_sha512_256},
{NID_md5_sha1, EVP_md5_sha1, SN_md5_sha1, LN_md5_sha1},
@@ -62,10 +62,10 @@ index a246a51103701e0ac8a0722324350a462f95bcc9..ddf0a90337d4e40de09bc345cf959dff
+
#undef CHECK
diff --git a/decrepit/evp/evp_do_all.cc b/decrepit/evp/evp_do_all.cc
index 584b1390a841cc1b1dcb69e16d8242a88e4bb9cb..637aeccb8de8d793eabc38e32bef6834ac0e6ad3 100644
index feaf17c72cecb8099bc11ac10747fbad719ddca9..891a73f229e3f0838cb2fa99b8fb24fdeac1962b 100644
--- a/decrepit/evp/evp_do_all.cc
+++ b/decrepit/evp/evp_do_all.cc
@@ -82,6 +82,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *md,
@@ -79,6 +79,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
callback(EVP_sha384(), "SHA384", nullptr, arg);
callback(EVP_sha512(), "SHA512", nullptr, arg);
callback(EVP_sha512_256(), "SHA512-256", nullptr, arg);
@@ -73,16 +73,16 @@ index 584b1390a841cc1b1dcb69e16d8242a88e4bb9cb..637aeccb8de8d793eabc38e32bef6834
callback(EVP_md4(), "md4", nullptr, arg);
callback(EVP_md5(), "md5", nullptr, arg);
@@ -91,6 +92,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *md,
@@ -88,6 +89,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
callback(EVP_sha384(), "sha384", nullptr, arg);
callback(EVP_sha512(), "sha512", nullptr, arg);
callback(EVP_sha512_256(), "sha512-256", nullptr, arg);
+ callback(EVP_ripemd160(), "ripemd160", nullptr, arg);
}
void EVP_MD_do_all(void (*callback)(const EVP_MD *md, const char *name,
void EVP_MD_do_all(void (*callback)(const EVP_MD *cipher, const char *name,
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
index 62ad57368cb3059ee25df08bb07876fef499de2e..322daef194b3c7b73011419bb74bccb311eb03a5 100644
index 40670234682ac00dec268dea43f0ee1e39e8684f..293fbc9faf01ea0ca4e58b0a65b14597fe4916a6 100644
--- a/include/openssl/digest.h
+++ b/include/openssl/digest.h
@@ -48,6 +48,9 @@ OPENSSL_EXPORT const EVP_MD *EVP_blake2b256(void);

View File

@@ -64,10 +64,10 @@ index dabc54aa13745600a62e57ecbb427e48a4565282..ce213e00573102ce9405a794d3c140d9
const EVP_CIPHER *EVP_get_cipherbynid(int nid) {
diff --git a/decrepit/evp/evp_do_all.cc b/decrepit/evp/evp_do_all.cc
index 637aeccb8de8d793eabc38e32bef6834ac0e6ad3..c5dd0b18d7338457e47ae47088d9822472b24212 100644
index 891a73f229e3f0838cb2fa99b8fb24fdeac1962b..f7d0c5dc66f016eb9338c15e7f5ef59e6de2969d 100644
--- a/decrepit/evp/evp_do_all.cc
+++ b/decrepit/evp/evp_do_all.cc
@@ -23,8 +23,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
@@ -20,8 +20,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
const char *unused, void *arg),
void *arg) {
callback(EVP_aes_128_cbc(), "AES-128-CBC", nullptr, arg);
@@ -78,7 +78,7 @@ index 637aeccb8de8d793eabc38e32bef6834ac0e6ad3..c5dd0b18d7338457e47ae47088d98224
callback(EVP_aes_128_ctr(), "AES-128-CTR", nullptr, arg);
callback(EVP_aes_192_ctr(), "AES-192-CTR", nullptr, arg);
callback(EVP_aes_256_ctr(), "AES-256-CTR", nullptr, arg);
@@ -37,9 +39,13 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
@@ -34,9 +36,13 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
callback(EVP_aes_128_gcm(), "AES-128-GCM", nullptr, arg);
callback(EVP_aes_192_gcm(), "AES-192-GCM", nullptr, arg);
callback(EVP_aes_256_gcm(), "AES-256-GCM", nullptr, arg);
@@ -92,7 +92,7 @@ index 637aeccb8de8d793eabc38e32bef6834ac0e6ad3..c5dd0b18d7338457e47ae47088d98224
callback(EVP_des_ede_cbc(), "DES-EDE-CBC", nullptr, arg);
callback(EVP_des_ede3_cbc(), "DES-EDE3-CBC", nullptr, arg);
callback(EVP_rc2_cbc(), "RC2-CBC", nullptr, arg);
@@ -47,8 +53,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
@@ -44,8 +50,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
// OpenSSL returns everything twice, the second time in lower case.
callback(EVP_aes_128_cbc(), "aes-128-cbc", nullptr, arg);
@@ -103,7 +103,7 @@ index 637aeccb8de8d793eabc38e32bef6834ac0e6ad3..c5dd0b18d7338457e47ae47088d98224
callback(EVP_aes_128_ctr(), "aes-128-ctr", nullptr, arg);
callback(EVP_aes_192_ctr(), "aes-192-ctr", nullptr, arg);
callback(EVP_aes_256_ctr(), "aes-256-ctr", nullptr, arg);
@@ -61,9 +69,13 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
@@ -58,9 +66,13 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
callback(EVP_aes_128_gcm(), "aes-128-gcm", nullptr, arg);
callback(EVP_aes_192_gcm(), "aes-192-gcm", nullptr, arg);
callback(EVP_aes_256_gcm(), "aes-256-gcm", nullptr, arg);

View File

@@ -150,4 +150,4 @@ fix_use_fresh_lazynow_for_onendworkitemimpl_after_didruntask.patch
fix_pulseaudio_stream_and_icon_names.patch
fix_fire_menu_popup_start_for_dynamically_created_aria_menus.patch
feat_allow_enabling_extensions_on_custom_protocols.patch
fix_initialize_com_on_desktopmedialistcapturethread_on_windows.patch
chore_run_v8_context_snapshot_generator_through_wine_when.patch

View File

@@ -23,10 +23,10 @@ index 3f8cf4edc7448e6b584adae8fcbb872d27377126..1d03dc809d4c18f24314d94811e0bf52
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index ab959e66f8841d7367863bb13d6c7a0854d0df23..5279ba15f45bd7634b5f24553ad64c0069318cc0 100644
index bed7c59163e10f2d273a6eb07d095d3f5af97db9..9a881bb119f6f93ae86b2cc75f95a30cde91cfbc 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4733,6 +4733,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4731,6 +4731,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}

View File

@@ -6,7 +6,7 @@ Subject: allow disabling blink scheduler throttling per RenderView
This allows us to disable throttling for hidden windows.
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
index f5a6ffc61f6cdff3897a97003b74838aac27e2a1..9b10aeb457a010db0ab89211610ea97b1a364453 100644
index 29d5b174e122cbd140554687548106ead8f8e8d9..da74da96c3fe35a0f3838f04bca08846f7b41abe 100644
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -168,6 +168,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
@@ -51,7 +51,7 @@ index 89fed16c112d55c13a9f23695e2898d630f7d815..b7f486337f46daac015644525c9870f5
void SendRendererPreferencesToRenderer(
const blink::RendererPreferences& preferences);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 53ec5cd693539d74424c683f78e953e85c13c098..ccfe78580c2acb9a3afa43d246e1a83cc0e28598 100644
index 2a6ec0fbdd46427de42f880031fef19ff6269b77..cae6b1a65d0b8483f7a2bf0bd6dfc7a310216202 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -655,8 +655,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
@@ -116,7 +116,7 @@ index 932658273154ef2e022358e493a8e7c00c86e732..57bbfb5cde62c9496c351c861880a189
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index b5a7e1b177f031837f670c26bff7394315eb6ea5..ed63aa041733e2fb09d77a219c93c322985cc81e 100644
index 8646f9337065b8009a210c8878bdbb132265ab3e..1f38d76c867c5d7ee4b8584db49f5025aff6c50e 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2471,6 +2471,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
@@ -130,7 +130,7 @@ index b5a7e1b177f031837f670c26bff7394315eb6ea5..ed63aa041733e2fb09d77a219c93c322
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
!old_state->is_in_back_forward_cache;
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
@@ -4170,10 +4174,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -4163,10 +4167,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -155,7 +155,7 @@ index b5a7e1b177f031837f670c26bff7394315eb6ea5..ed63aa041733e2fb09d77a219c93c322
// Do not throttle if the page should be painting.
bool is_visible =
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index b2ad789e53146b06e0e416f2dcf384cf7e9c17ae..838c67ac5b02c427858febbfbddf25fb03632b37 100644
index 8d5c7349c360726778e37976fc54d660d7424f1f..96ee25c8ae4b50ab265bd698517efe15e2f1f44d 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -446,6 +446,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,

View File

@@ -15,7 +15,7 @@ Refs changes in:
This patch reverts the changes to fix associated crashes in Electron.
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
index 9827a89c56141596fde57b78f9c9894f273db83e..cedb4bd8217a0ad3ab07d85421e1850bc4d910f5 100644
index 3f1ccee622b92fe8004f7763d2374d02117236f7..03f53c6755d4f6f46d23f7860b19390bb77bd4de 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -135,14 +135,6 @@ bool Frame::Detach(FrameDetachType type) {

View File

@@ -28,10 +28,10 @@ index 0af4d4b75d0519fabcb5d48bd9d5bd465bc80e92..eb6b23655afaa268f25d99301a0853aa
":chrome_dll",
":chrome_exe_version",
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index e91f97276866bd500720962c74acaca2c22fff7c..22867153821d2b1e83feb1a2a7a6b8c26ba776eb 100644
index a14985635e8cb2c9e98044ece46a557ac5f36f08..8e94e37dc75ebadedece1e370538c151c31b7b35 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7737,6 +7737,10 @@ test("unit_tests") {
@@ -7720,6 +7720,10 @@ test("unit_tests") {
"//chrome/notification_helper",
]
@@ -42,7 +42,7 @@ index e91f97276866bd500720962c74acaca2c22fff7c..22867153821d2b1e83feb1a2a7a6b8c2
deps += [
"//chrome:other_version",
"//chrome//services/util_win:unit_tests",
@@ -8711,6 +8715,10 @@ test("unit_tests") {
@@ -8693,6 +8697,10 @@ test("unit_tests") {
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
]
@@ -53,7 +53,7 @@ index e91f97276866bd500720962c74acaca2c22fff7c..22867153821d2b1e83feb1a2a7a6b8c2
sources += [
# The importer code is not used on Android.
"../common/importer/firefox_importer_utils_unittest.cc",
@@ -8767,7 +8775,7 @@ test("unit_tests") {
@@ -8749,7 +8757,7 @@ test("unit_tests") {
# TODO(crbug.com/417513088): Maybe merge with the non-android `deps` declaration above?
deps += [
"../browser/screen_ai:screen_ai_install_state",

View File

@@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index ac474e220d411dec278c40448f038b25e6788d2a..e4ff8f11bed9e53f3134068492ac94b4c9bb4df2 100644
index 3f5964a623d18b59d3761d0617644fc8ccfd9eb1..b898ebdd18bfefb4c6d8fa62e3e128a5154b049c 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -10228,6 +10228,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -10217,6 +10217,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index ac474e220d411dec278c40448f038b25e6788d2a..e4ff8f11bed9e53f3134068492ac94b4
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3e0c8bd308d8a947a2bd295a2d83e385e53853fb..4e91b3aeb5630476c660e8814e2fd9d92c5a9ca1 100644
index b0f9312b11641fa4a3e0e9d87281153bbf577f0e..0088e16862b4eb08e2100f13e0d9fecfc0d8aa9d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5501,6 +5501,10 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5494,6 +5494,10 @@ FrameTree* WebContentsImpl::CreateNewWindow(
create_params.initially_hidden = renderer_started_hidden;
create_params.initial_popup_url = params.target_url;
@@ -35,7 +35,7 @@ index 3e0c8bd308d8a947a2bd295a2d83e385e53853fb..4e91b3aeb5630476c660e8814e2fd9d9
// Even though all codepaths leading here are in response to a renderer
// trying to open a new window, if the new window ends up in a different
// browsing instance, then the RenderViewHost, RenderWidgetHost,
@@ -5555,6 +5559,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5548,6 +5552,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
// Sets the newly created WebContents WindowOpenDisposition.
new_contents_impl->original_window_open_disposition_ = params.disposition;
@@ -48,7 +48,7 @@ index 3e0c8bd308d8a947a2bd295a2d83e385e53853fb..4e91b3aeb5630476c660e8814e2fd9d9
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -5596,12 +5606,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5589,12 +5599,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -77,10 +77,10 @@ index 444fa7009d0db33470cac9ab9cfdc23ceacec942..ab9aeb852e5ea89583284386d9a78a3e
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index e806de04ca92cb8351e9a242a5241c0d4286da97..d0b3e4bc348921df7e6446dbc1f14860b8a84d87 100644
index 35e40748ca10661e13f1e04d22e0867d335b46c0..8651e4d019b6dc4e94cae9706eccf8dacb5350a2 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -854,6 +854,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -862,6 +862,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -90,7 +90,7 @@ index e806de04ca92cb8351e9a242a5241c0d4286da97..d0b3e4bc348921df7e6446dbc1f14860
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 70588ccd619ac7969918771bccf5c054320e4f6f..eb684232648424fab4ba73b1fc813b0b3f8b809b 100644
index 27a2f100c949319889f791a661b6990b6d0bf97a..02321334795bb096206146caf24084c12347664e 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -205,6 +205,7 @@ class NetworkService;
@@ -101,7 +101,7 @@ index 70588ccd619ac7969918771bccf5c054320e4f6f..eb684232648424fab4ba73b1fc813b0b
} // namespace network
namespace sandbox {
@@ -1406,6 +1407,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1414,6 +1415,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -170,10 +170,10 @@ index 0650197909d484b8a0f48ab61b22471c71bce0e8..29c380d7845aab1a7b3417e0d3940ea0
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5936c5eaa081abde7f7c26cc990a122622e46908..ab959e66f8841d7367863bb13d6c7a0854d0df23 100644
index e5dae3b2c85ce3d38fdfcb64bb732f6e45e34217..bed7c59163e10f2d273a6eb07d095d3f5af97db9 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6845,6 +6845,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6842,6 +6842,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
params->started_by_ad =
GetWebFrame()->IsAdFrame() || GetWebFrame()->IsAdScriptInStack();

View File

@@ -34,10 +34,10 @@ index 1d03dc809d4c18f24314d94811e0bf527aa7b5b4..16030bcecb2e39b8870144ce7c3d11dd
virtual void DidClearWindowObject() {}
virtual void DidChangeScrollOffset() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5279ba15f45bd7634b5f24553ad64c0069318cc0..2840f22e2b8b4aae09a06774a70f2ec7340536d9 100644
index 9a881bb119f6f93ae86b2cc75f95a30cde91cfbc..540935b14c5f78b573a14414f4259db9c34d02ae 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4739,10 +4739,11 @@ void RenderFrameImpl::DidInstallConditionalFeatures(
@@ -4737,10 +4737,11 @@ void RenderFrameImpl::DidInstallConditionalFeatures(
observer.DidInstallConditionalFeatures(context, world_id);
}

View File

@@ -14,10 +14,10 @@ track down the source of this problem & figure out if we can fix it
by changing something in Electron.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index aaa2b2229dac8c5e8cf590300b436082f6c3773b..e12758010f5c243d2fb9c733b74bcb0eea89f5da 100644
index f6b48f3641674bae565ec2c6294d9f6cf1d48db4..09346abdd2df2f672b1c3cc1757fa375eb6e0c72 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5472,7 +5472,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5465,7 +5465,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
: IsGuest();
// While some guest types do not have a guest SiteInstance, the ones that
// don't all override WebContents creation above.

View File

@@ -80,10 +80,10 @@ index 39fa45f0a0f9076bd7ac0be6f455dd540a276512..3d0381d463eed73470b28085830f2a23
content::WebContents* source,
const content::OpenURLParams& params,
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 8f8852b2af1acfa4ec985fd1c8b50563b991b12a..c2f2903545b191c5ab13462bf330efce37d7d08c 100644
index c71041d2eae5ea25af82137351f12e46182e6c69..d8263194614006213e157f6b10f3facb093b2944 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2310,7 +2310,8 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -2287,7 +2287,8 @@ bool Browser::IsWebContentsCreationOverridden(
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
const std::string& frame_name,
@@ -93,7 +93,7 @@ index 8f8852b2af1acfa4ec985fd1c8b50563b991b12a..c2f2903545b191c5ab13462bf330efce
if (HasActorTaskPreventingNewWebContents(profile(), opener)) {
// If an ExecutionEngine is acting on the opener, prevent it from creating a
// new WebContents. We'll instead force the navigation to happen in the same
@@ -2323,7 +2324,7 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -2300,7 +2301,7 @@ bool Browser::IsWebContentsCreationOverridden(
return (window_container_type ==
content::mojom::WindowContainerType::BACKGROUND &&
ShouldCreateBackgroundContents(source_site_instance, opener_url,
@@ -223,10 +223,10 @@ index b969f1d97b7e3396119b579cfbe61e19ff7d2dd4..b8d6169652da28266a514938b45b39c5
content::WebContents* AddNewContents(
content::WebContents* source,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d43e75c20aca09080f4223d339c88381f030c504..8cd59445bae73ff0193e4512d7c36740cbad847f 100644
index ec75b1a31c029ff9f1d23f297be4ae40bc24af9c..1a45bab9c0e4e429bb338c757cdc49d64f337b88 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5436,8 +5436,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5429,8 +5429,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ &&
delegate_->IsWebContentsCreationOverridden(
opener, source_site_instance, params.window_container_type,
@@ -357,7 +357,7 @@ index f459dddeb3f8f3a33ffead0e96fba791d18a0108..f7a229b186774ca3a01f2d747eab139a
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
diff --git a/fuchsia_web/webengine/browser/frame_impl.cc b/fuchsia_web/webengine/browser/frame_impl.cc
index 9c1fb0b2ed4f013ef6108a9844b22f6bfe697621..ef4991adc766d53b03d280395630b83ced38c2e8 100644
index 3b50b6b3616ead57de44d309a306db09dce82c65..c709f13b7c0bac9f41cac745678aaee04c1caf46 100644
--- a/fuchsia_web/webengine/browser/frame_impl.cc
+++ b/fuchsia_web/webengine/browser/frame_impl.cc
@@ -585,8 +585,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(

View File

@@ -0,0 +1,49 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <kleinschmidtorama@gmail.com>
Date: Tue, 7 Apr 2026 14:05:09 -0400
Subject: chore: run v8_context_snapshot_generator through Wine when
cross-compiling
When cross-compiling for Windows on Linux with Wine, the
v8_context_snapshot_generator binary is a Windows PE executable (.exe)
that cannot be run directly. Prepend the wine path to args and append
.exe to the binary name, matching the approach used for mksnapshot.
diff --git a/tools/v8_context_snapshot/BUILD.gn b/tools/v8_context_snapshot/BUILD.gn
index ec2357139826613e8b295cb01be341acb03b4737..6c4171dbaf7a76cfc89d71871b73058747675811 100644
--- a/tools/v8_context_snapshot/BUILD.gn
+++ b/tools/v8_context_snapshot/BUILD.gn
@@ -50,12 +50,27 @@ if (use_v8_context_snapshot) {
output_file = "$root_build_dir/$v8_context_snapshot_filename"
output_path = rebase_path(output_file, root_build_dir)
- args = [
- "./" + rebase_path(
- get_label_info(
- ":v8_context_snapshot_generator($v8_snapshot_toolchain)",
- "root_out_dir") + "/v8_context_snapshot_generator",
- root_build_dir),
+ _generator_dir = get_label_info(
+ ":v8_context_snapshot_generator($v8_snapshot_toolchain)",
+ "root_out_dir")
+ if (v8_win_cross_compile_using_wine) {
+ _generator_bin = "./" + rebase_path(
+ _generator_dir + "/v8_context_snapshot_generator.exe",
+ root_build_dir)
+ } else {
+ _generator_bin = "./" + rebase_path(
+ _generator_dir + "/v8_context_snapshot_generator",
+ root_build_dir)
+ }
+
+ args = []
+ if (v8_win_cross_compile_using_wine) {
+ assert(v8_wine_path != "",
+ "v8_wine_path must be set when v8_win_cross_compile_using_wine is true")
+ args += [ v8_wine_path ]
+ }
+ args += [
+ _generator_bin,
"--snapshot_blob=$snapshot_blob_path",
"--output_file=$output_path",
]

View File

@@ -7,12 +7,12 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index e795339c000cf695ca05c6d3c736678fa47df21e..bbcad80a8efdac88c26ececeaf4023152631b662 100644
index b795a9dbf898570a7cd8469ee386c4edf4bfa275..449940fe1b6969576f1b2c21d7719620e578e8a8 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -261,8 +261,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
#endif
@@ -277,8 +277,13 @@ void AsanProcessInfoCB(const char* reason,
}
#endif // defined(ADDRESS_SANITIZER)
-void LoadV8SnapshotFile(const base::CommandLine& command_line) {
+void LoadV8SnapshotFile(const raw_ptr<ContentMainDelegate> delegate, const base::CommandLine& command_line) {

View File

@@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 886b3e87e9041931d3cb59ef775b5012e8e2f908..9287bde2d8c0eaa00c29fca974111b3f32b6e813 100644
index f7c3e60f748e24e51bffa2bc8914a8a7b67bd504..2324454f8a782bb4fe065b727a39b7cf523d9ce8 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -597,7 +597,11 @@
@@ -590,7 +590,11 @@
}
host()->WasHidden();

View File

@@ -6,10 +6,10 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index fe46ebe4e5bcda2eff543aa5b5a2310628a3ea5a..8df679251dc314a94079fcc9d4edd7fab12873d4 100644
index ced1f88a6ab9ad7b8e180149cbb652adb5b5b47f..1919546e9be90303d1aee29208d8227ece452827 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -818,6 +818,10 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -810,6 +810,10 @@ void RenderWidgetHostImpl::WasHidden() {
return;
}
@@ -21,10 +21,10 @@ index fe46ebe4e5bcda2eff543aa5b5a2310628a3ea5a..8df679251dc314a94079fcc9d4edd7fa
// Prompts should remain open and functional across tab switches.
if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) {
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 37b2ca1000ead76ec7e403bf1e2dc647bcee74ce..1312c87909729ac59ea661321c10862f34072f95 100644
index 0886acf77ef00ac54a33103585c4e1c022e9d5d6..71a0a74f8bc32e58f98a1841a1dd9c4b4c37118e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -1059,6 +1059,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -1055,6 +1055,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
base::TimeDelta GetHungRendererDelayForTesting();
@@ -34,10 +34,10 @@ index 37b2ca1000ead76ec7e403bf1e2dc647bcee74ce..1312c87909729ac59ea661321c10862f
// |routing_id| must not be IPC::mojom::kRoutingIdNone.
// If this object outlives |delegate|, DetachDelegate() must be called when
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 550a2090d11ea151d8003610cb39a8035c5d299c..53ec5cd693539d74424c683f78e953e85c13c098 100644
index e001bfdf97408a06bcbe7e3dbcdad743d86e57fc..2a6ec0fbdd46427de42f880031fef19ff6269b77 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -712,7 +712,7 @@ void RenderWidgetHostViewAura::HideImpl() {
@@ -717,7 +717,7 @@ void RenderWidgetHostViewAura::HideImpl() {
CHECK(visibility_ == Visibility::HIDDEN ||
visibility_ == Visibility::OCCLUDED);

View File

@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
} // namespace net
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index cf1001557f2f59747ceb394ab2c93b4bf379dafb..2e16a8d19e1ccfbfc838ed33ecac3375f1e81b17 100644
index 4efd5407479b9e5ee6af84a4cd6d26895d8b19f7..498c877f3f159729eae4857b5210b913eec962d0 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1994,6 +1994,13 @@ void NetworkContext::SetNetworkConditions(
@@ -1965,6 +1965,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index cf1001557f2f59747ceb394ab2c93b4bf379dafb..2e16a8d19e1ccfbfc838ed33ecac3375
// This may only be called on NetworkContexts created with the constructor
// that calls MakeURLRequestContext().
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 04e6e884dccbb680a39f2b9c8a54de162e056a30..672dd48040586190b761e2db554ba0767d254f62 100644
index 912e4d60647f6376dfef62d18998b556bc7efa32..53082e9f0bfb98c1267fc034fa34e157b4c04d9b 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -332,6 +332,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -331,6 +331,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void SetNetworkConditions(
const base::UnguessableToken& throttling_profile_id,
std::vector<mojom::MatchedNetworkConditionsPtr> conditions) override;
@@ -63,10 +63,10 @@ index 04e6e884dccbb680a39f2b9c8a54de162e056a30..672dd48040586190b761e2db554ba076
void SetEnableReferrers(bool enable_referrers) override;
#if BUILDFLAG(IS_CT_SUPPORTED)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 6c43c2985123525793dd6b60c9d7d7c1db7fdf04..7493bd8dd37b36a3e7a96b1373619fee0b6a9d8e 100644
index 63d410dd356594a5928ed2f84b05b403bf3367f0..ca47c9cb58d5d69faade9f85d1e63683d79cb5e3 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1299,6 +1299,9 @@ interface NetworkContext {
@@ -1291,6 +1291,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
array<MatchedNetworkConditions> conditions);
@@ -77,7 +77,7 @@ index 6c43c2985123525793dd6b60c9d7d7c1db7fdf04..7493bd8dd37b36a3e7a96b1373619fee
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index b472be0acdc0cd4971e6e0a9e623bc1c84d07a02..f328a3aa2df9f5c6163a5023a5df157350d3707f 100644
index bc26f449109b3be84490fbb3569e36aa4aca8c4b..d273faec6c235cb7d29f0f7fb90affdca7240e51 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -156,6 +156,7 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -15,7 +15,7 @@ Ideally we could add an embedder observer pattern here but that can be
done in future work.
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index ed63aa041733e2fb09d77a219c93c322985cc81e..ea23d47128d4e974353ea5a976a72d4fa0600e2b 100644
index 1f38d76c867c5d7ee4b8584db49f5025aff6c50e..00221901d054f1ed9280af17559731ef75442c5d 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -1855,6 +1855,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,

View File

@@ -17,11 +17,11 @@ which removed range-requests-supported on non-http protocols. See https://issues
for more information.
diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
index 0af2ad19954bd868f6b92616da869b350f088103..efc53247962f166f2b441f76c7a2c94d8ceb979a 100644
index d96ffd263cad628c3e12b0a39cf082161ea6bb58..b33f52a48f570c7aee1a3f55fb3f9a1ed3bd35c0 100644
--- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
+++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
@@ -12,8 +12,10 @@
#include "base/functional/callback_helpers.h"
@@ -11,8 +11,10 @@
#include "base/containers/adapters.h"
#include "base/location.h"
#include "base/memory/raw_span.h"
+#include "base/no_destructor.h"
@@ -31,7 +31,7 @@ index 0af2ad19954bd868f6b92616da869b350f088103..efc53247962f166f2b441f76c7a2c94d
#include "media/base/media_log.h"
#include "net/base/net_errors.h"
#include "third_party/blink/renderer/platform/media/buffered_data_source_host_impl.h"
@@ -70,6 +72,10 @@ constexpr base::TimeDelta kSeekDelay = base::Milliseconds(20);
@@ -69,6 +71,10 @@ constexpr base::TimeDelta kSeekDelay = base::Milliseconds(20);
} // namespace
@@ -42,7 +42,7 @@ index 0af2ad19954bd868f6b92616da869b350f088103..efc53247962f166f2b441f76c7a2c94d
class MultiBufferDataSource::ReadOperation {
public:
ReadOperation() = delete;
@@ -137,13 +143,29 @@ MultiBufferDataSource::~MultiBufferDataSource() {
@@ -136,13 +142,29 @@ MultiBufferDataSource::~MultiBufferDataSource() {
DCHECK(render_task_runner_->BelongsToCurrentThread());
}
@@ -74,18 +74,18 @@ index 0af2ad19954bd868f6b92616da869b350f088103..efc53247962f166f2b441f76c7a2c94d
void MultiBufferDataSource::SetReader(
diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
index 470b6015dad4063375175324f49afb3548cdf0dd..61b633d65eaa76f98fd0d858d490b12077646ad2 100644
index 342c690100eacf3cdde92bb60b6c08769f693e96..4980848c38703764de3c210c119f844bed508aa2 100644
--- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
+++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
@@ -19,6 +19,7 @@
@@ -18,6 +18,7 @@
#include "media/base/data_source.h"
#include "media/base/ranges.h"
#include "media/base/tuneable.h"
+#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/renderer/platform/media/buffered_data_source_host_impl.h"
#include "third_party/blink/renderer/platform/media/url_index.h"
#include "third_party/blink/renderer/platform/platform_export.h"
@@ -37,6 +38,8 @@ namespace blink {
#include "third_party/blink/renderer/platform/wtf/vector.h"
@@ -35,6 +36,8 @@ namespace blink {
class BufferedDataSourceHost;
class MultiBufferReader;
@@ -94,7 +94,7 @@ index 470b6015dad4063375175324f49afb3548cdf0dd..61b633d65eaa76f98fd0d858d490b120
// A data source capable of loading URLs and buffering the data using an
// in-memory sliding window.
//
@@ -94,6 +97,8 @@ class PLATFORM_EXPORT MultiBufferDataSource
@@ -64,6 +67,8 @@ class PLATFORM_EXPORT MultiBufferDataSource
return url_data_->mime_type();
}

View File

@@ -44,10 +44,10 @@ index 57ed3cf54b2921df09ad84906b3da7527c6080bb..ffe3a0894c612adaa429a783827c8503
class WebRequestEventRouter : public KeyedService {
public:
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index 542bc99fbaace39351a6f991a7702d0c77c891eb..9fef3d7fe3108cca843100967489f1cc1b6b4589 100644
index 731994059b8900e7cec46acfb9d17f18c3b8ed89..c32aee04fa1788ae26a0f9a0c5b9d2afb94c84c6 100644
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -223,7 +223,8 @@ const int Extension::kValidHostPermissionSchemes =
@@ -222,7 +222,8 @@ const int Extension::kValidHostPermissionSchemes =
URLPattern::SCHEME_CHROMEUI | URLPattern::SCHEME_HTTP |
URLPattern::SCHEME_HTTPS | URLPattern::SCHEME_FILE |
URLPattern::SCHEME_FTP | URLPattern::SCHEME_WS | URLPattern::SCHEME_WSS |

View File

@@ -167,7 +167,7 @@ index 34b4e7c1b449312e9cb517be192a39a6b5286e3c..4f39415717f423b9a87f83779851e08b
FinishStartSandboxedProcessOnLauncherThread,
this));
diff --git a/content/browser/service_host/service_process_host_impl.cc b/content/browser/service_host/service_process_host_impl.cc
index 4c0b23afb38066f4d29ead2d5705ae2b58ddca34..b79eb508bdfc1ae08dce254cfa57ab6c9b7bfc8a 100644
index d9c14f91747bde0e76056d7f2f2ada166e67f994..09335acac17f526fb8d8e42e4b2d993b11045786 100644
--- a/content/browser/service_host/service_process_host_impl.cc
+++ b/content/browser/service_host/service_process_host_impl.cc
@@ -69,6 +69,21 @@ void LaunchServiceProcess(mojo::GenericPendingReceiver receiver,
@@ -584,10 +584,10 @@ index 4159eef9e1f54c82ac0d8ad6437925dd3c6fa3ec..b835257f686635b91f80c2d6651fb735
#if BUILDFLAG(IS_MAC)
// Whether or not to disclaim TCC responsibility for the process, defaults to
diff --git a/content/public/browser/service_process_host.cc b/content/public/browser/service_process_host.cc
index a3970c9358d7e03b58e646c85a488d97609c44fd..1afc67fab97a3bb9515afefb8a3f051147d1d678 100644
index d1bc550a891979e2d41d8d5b18a2f9287468e460..5d255f628788bc8b40d8df0039b08c06ffec8730 100644
--- a/content/public/browser/service_process_host.cc
+++ b/content/public/browser/service_process_host.cc
@@ -53,6 +53,26 @@ ServiceProcessHost::Options::WithExtraCommandLineSwitches(
@@ -53,12 +53,62 @@ ServiceProcessHost::Options::WithExtraCommandLineSwitches(
return *this;
}
@@ -614,7 +614,6 @@ index a3970c9358d7e03b58e646c85a488d97609c44fd..1afc67fab97a3bb9515afefb8a3f0511
ServiceProcessHost::Options& ServiceProcessHost::Options::WithProcessCallback(
base::OnceCallback<void(const base::Process&)> callback) {
process_callback = std::move(callback);
@@ -68,6 +88,36 @@ ServiceProcessHost::Options& ServiceProcessHost::Options::WithObserver(
return *this;
}
@@ -652,18 +651,18 @@ index a3970c9358d7e03b58e646c85a488d97609c44fd..1afc67fab97a3bb9515afefb8a3f0511
ServiceProcessHost::Options&
ServiceProcessHost::Options::WithPreloadedLibraries(
diff --git a/content/public/browser/service_process_host.h b/content/public/browser/service_process_host.h
index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbecc5eb04ac 100644
index 0062d2cb6634b8b29977a0312516b1b13936b40a..888ff36d70c83010f1f45e9eeb2dd6b573158db5 100644
--- a/content/public/browser/service_process_host.h
+++ b/content/public/browser/service_process_host.h
@@ -15,6 +15,7 @@
@@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list_types.h"
+#include "base/process/launch.h"
#include "base/process/process_handle.h"
#include "content/common/content_export.h"
#include "content/public/browser/service_process_info.h"
@@ -29,6 +30,10 @@
@@ -28,6 +29,10 @@
#include "base/types/pass_key.h"
#endif // BUILDFLAG(IS_WIN)
@@ -674,7 +673,7 @@ index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbec
namespace base {
class Process;
} // namespace base
@@ -98,6 +103,16 @@ class CONTENT_EXPORT ServiceProcessHost {
@@ -94,11 +99,40 @@ class CONTENT_EXPORT ServiceProcessHost {
// Specifies extra command line switches to append before launch.
Options& WithExtraCommandLineSwitches(std::vector<std::string> switches);
@@ -691,10 +690,8 @@ index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbec
// Specifies a callback to be invoked with service process once it's
// launched. Will be on UI thread.
Options& WithProcessCallback(
@@ -111,6 +126,24 @@ class CONTENT_EXPORT ServiceProcessHost {
// the service process terminates, notifications are silently skipped.
// Will be called on the UI thread.
Options& WithObserver(base::WeakPtr<Observer> observer);
base::OnceCallback<void(const base::Process&)>);
+ // Specifies the working directory for the launched process.
+ Options& WithCurrentDirectory(const base::FilePath& cwd);
+
@@ -713,10 +710,11 @@ index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbec
+ // Specifies if the process should disclaim TCC responsibility.
+ Options& WithDisclaimResponsibility(bool disclaim_responsibility);
+#endif // BUILDFLAG(IS_MAC)
+
#if BUILDFLAG(IS_WIN)
// Specifies libraries to preload before the sandbox is locked down. Paths
@@ -140,12 +173,27 @@ class CONTENT_EXPORT ServiceProcessHost {
// should be absolute paths. Libraries will be preloaded before sandbox
@@ -127,11 +161,26 @@ class CONTENT_EXPORT ServiceProcessHost {
std::optional<GURL> site;
std::optional<int> child_flags;
std::vector<std::string> extra_switches;
@@ -727,7 +725,6 @@ index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbec
+ base::FileHandleMappingVector fds_to_remap;
+#endif
base::OnceCallback<void(const base::Process&)> process_callback;
base::WeakPtr<Observer> observer;
#if BUILDFLAG(IS_WIN)
std::vector<base::FilePath> preload_libraries;
#endif // BUILDFLAG(IS_WIN)
@@ -743,7 +740,7 @@ index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbec
+#endif // BUILDFLAG(IS_MAC)
};
// An interface which can be implemented and used with
// An interface which can be implemented and registered/unregistered with
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc
index 5c92eec064e36fa4be5a57a769a4091a18e3396d..b705450708560c0ae8b386d7efdb5c526964c629 100644
--- a/sandbox/policy/win/sandbox_win.cc

View File

@@ -46,7 +46,7 @@ index 6e60de1319c5506d7180719fa230ab9cf537b832..e570e335fbd413340ddedeee423eca71
'internal-forced-visited-'):
internal_visited_order = 0
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5
index f46a4e31e0ea81f362be1c06bc23f6e6cb15d967..1a7874271e123d4fadd8ae694394061fc0c73cfe 100644
index 3a14c5d0a462f0f6785bd8d711a7e70e50c05ff9..5f39e61139318294cf2ecdf2e922741740ab8ae9 100644
--- a/third_party/blink/renderer/core/css/css_properties.json5
+++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -9643,6 +9643,27 @@
@@ -91,10 +91,10 @@ index 2afe18e9e4a5404ed184aeedc1c02a313853f463..7c3b0c2da6ded539764ce59bc43f49e9
return a.EmptyCells() == b.EmptyCells();
case CSSPropertyID::kFill:
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
index 65c9b1f3a73d3822371f09b0cb764c63aaeb8a31..6e3737cf147252c6999ddcb887309682a91787d6 100644
index b73db1a68d20cca66468db23d4c8e0e49db648b3..8dc1458ab436ce8202811371ee7ce8e077d4fa7b 100644
--- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
+++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -13328,5 +13328,36 @@ const CSSValue* InternalEmptyLineHeight::ParseSingleValue(
@@ -13324,5 +13324,36 @@ const CSSValue* InternalEmptyLineHeight::ParseSingleValue(
CSSValueID::kNone>(stream);
}
@@ -203,10 +203,10 @@ index 19cda703154dab9397827ab6ea66c2ca446c644d..dd5943c511886f4e39b2e7f10e67e60f
return result;
}
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index 87f64f5c2cfd4bdc8aca697f6115effed091b86e..a11c5cb976077e53a6c3d456d2583f16fb58e415 100644
index 214c0c8bcf1033d077672b822ad53a42d0e09213..e8f9b4873defc9dea6868e8c481e4f4668a7686c 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1675,6 +1675,8 @@ component("platform") {
@@ -1673,6 +1673,8 @@ component("platform") {
"widget/widget_base.h",
"widget/widget_base_client.h",
"windows_keyboard_codes.h",
@@ -314,7 +314,7 @@ index 18f283e625101318ee14b50e6e765dfd1c9a1a44..44a3a55974c9e4b9e715574075f25661
auto DrawAsSinglePath = [&]() {
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index 89301f737c6a1f4043a47366db604967159b7cb6..0f6417f6933f3f71f39b4a06ac229efd3ac7634b 100644
index 515cbf4825600e20ab4ed9c54f2ae705eb5e8f27..4f016f7411882db169ebdff1cfc311698744e760 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -215,6 +215,10 @@

View File

@@ -8,10 +8,10 @@ rendering with the viz compositor by way of a custom HostDisplayClient
and LayeredWindowUpdater.
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
index 65df78d7f2a311633e8512f46efa005c41930873..1978ac9a080c63f8e9aa323c7215051890c55f00 100644
index b153c538488b7b77af0630a454604d9fb7eba487..1b97bfae745d3aeaa4ebd3d3a0dfc64f48da0d70 100644
--- a/components/viz/host/host_display_client.cc
+++ b/components/viz/host/host_display_client.cc
@@ -50,9 +50,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
@@ -49,9 +49,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
}
#endif
@@ -22,7 +22,7 @@ index 65df78d7f2a311633e8512f46efa005c41930873..1978ac9a080c63f8e9aa323c72150518
if (!NeedsToUseLayerWindow(widget_)) {
DLOG(ERROR) << "HWND shouldn't be using a layered window";
return;
@@ -60,7 +60,15 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
@@ -59,7 +59,15 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
layered_window_updater_ =
std::make_unique<LayeredWindowUpdaterImpl>(widget_, std::move(receiver));
@@ -508,10 +508,10 @@ index 0000000000000000000000000000000000000000..e1a22ee881c0fd679ac2d2d4d11a3c93
+
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
index 4f9e8946fa02d859e92a6896beba82721914f868..78486eaa993ee7ffd5188b31503de7dda1158297 100644
index b5154321105f08335b67ad2d552afa61337a4976..cb28230d9a8da6bd2259ef0c898013293421ac56 100644
--- a/components/viz/service/display_embedder/software_output_device_win.cc
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
@@ -158,7 +158,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
@@ -156,7 +156,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
if (!canvas_)
return;

View File

@@ -11,10 +11,10 @@ ServiceProcessHost::Observer functions, but we need to pass the exit code to
the observer.
diff --git a/content/browser/service_host/service_process_tracker.cc b/content/browser/service_host/service_process_tracker.cc
index c7b620b9dd25c7842470c4827bd55c81c5816e05..a5f72f8bd55e7a2a43e792f91878de52f09fb988 100644
index fb41c8dfd147a90d7d581b49ad7f909d947cb214..ae0dce9d1dde14f1562adac7d324635983bb4c09 100644
--- a/content/browser/service_host/service_process_tracker.cc
+++ b/content/browser/service_host/service_process_tracker.cc
@@ -67,7 +67,8 @@ void ServiceProcessTracker::NotifyTerminated(ServiceProcessId id) {
@@ -51,7 +51,8 @@ void ServiceProcessTracker::NotifyTerminated(ServiceProcessId id) {
void ServiceProcessTracker::NotifyCrashed(
ServiceProcessId id,
@@ -24,19 +24,22 @@ index c7b620b9dd25c7842470c4827bd55c81c5816e05..a5f72f8bd55e7a2a43e792f91878de52
DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto iter = processes_.find(id);
CHECK(iter != processes_.end());
@@ -82,6 +83,7 @@ void ServiceProcessTracker::NotifyCrashed(
@@ -65,7 +66,9 @@ void ServiceProcessTracker::NotifyCrashed(
break;
}
auto info_dup = iter->second.Duplicate();
+ info_dup.set_exit_code(exit_code);
for (auto& obs : observers_) {
obs.OnServiceProcessCrashed(info_dup);
for (auto& observer : observers_) {
- observer.OnServiceProcessCrashed(iter->second.Duplicate());
+ auto params = iter->second.Duplicate();
+ params.set_exit_code(exit_code);
+ observer.OnServiceProcessCrashed(params);
}
processes_.erase(iter);
}
diff --git a/content/browser/service_host/service_process_tracker.h b/content/browser/service_host/service_process_tracker.h
index 899fa2680af1c3c491b110cdd2154abe2695bebe..bfd3a4837f361b106e46849e8be2675066387448 100644
index 9a5179c4eeacf8bbfb2d831b4301836df490f3a8..511fc9b9d5ce14a1b5ef457a1047e40d3bb64273 100644
--- a/content/browser/service_host/service_process_tracker.h
+++ b/content/browser/service_host/service_process_tracker.h
@@ -40,7 +40,8 @@ class ServiceProcessTracker {
@@ -36,7 +36,8 @@ class ServiceProcessTracker {
void NotifyTerminated(ServiceProcessId id);
void NotifyCrashed(ServiceProcessId id,
@@ -47,11 +50,11 @@ index 899fa2680af1c3c491b110cdd2154abe2695bebe..bfd3a4837f361b106e46849e8be26750
void AddObserver(ServiceProcessHost::Observer* observer);
diff --git a/content/browser/service_host/utility_process_client.cc b/content/browser/service_host/utility_process_client.cc
index 6bb0ad536c4b8ddd32461e54b93471e8a055c5ea..c549032bd6ac0c161e05f6ace5ec0390fda95258 100644
index 99da7eee3cb1a09b984832211bceee385147aec2..5e4bd537d94ad26c8d309ebfb63845a8d3d11dae 100644
--- a/content/browser/service_host/utility_process_client.cc
+++ b/content/browser/service_host/utility_process_client.cc
@@ -42,7 +42,7 @@ void UtilityProcessClient::OnProcessTerminatedNormally() {
GetServiceProcessTracker().NotifyTerminated(*service_process_id_);
@@ -40,7 +40,7 @@ void UtilityProcessClient::OnProcessTerminatedNormally() {
process_info_->service_process_id());
}
-void UtilityProcessClient::OnProcessCrashed(CrashType type) {
@@ -59,19 +62,19 @@ index 6bb0ad536c4b8ddd32461e54b93471e8a055c5ea..c549032bd6ac0c161e05f6ace5ec0390
// TODO(crbug.com/40654042): It is unclear how we can observe
// |OnProcessCrashed()| without observing |OnProcessLaunched()| first, but
// it can happen on Android. Ignore the notification in this case.
@@ -50,6 +50,6 @@ void UtilityProcessClient::OnProcessCrashed(CrashType type) {
return;
@@ -49,6 +49,6 @@ void UtilityProcessClient::OnProcessCrashed(CrashType type) {
}
- GetServiceProcessTracker().NotifyCrashed(*service_process_id_, type);
+ GetServiceProcessTracker().NotifyCrashed(*service_process_id_, type, exit_code);
GetServiceProcessTracker().NotifyCrashed(process_info_->service_process_id(),
- type);
+ type, exit_code);
}
} // namespace content
diff --git a/content/browser/service_host/utility_process_client.h b/content/browser/service_host/utility_process_client.h
index 97a0f76571caf19e39d861bf188da9173fc2f8f6..e651e9b2f9a35265da00432cf2ffdc5857c1fa08 100644
index 2648adb1cf38ab557b66ffd0e3034b26b04d76d6..98eab587f343f6ca472efc3d4e7b31b2b8821417 100644
--- a/content/browser/service_host/utility_process_client.h
+++ b/content/browser/service_host/utility_process_client.h
@@ -39,7 +39,7 @@ class UtilityProcessClient : public UtilityProcessHost::Client {
@@ -36,7 +36,7 @@ class UtilityProcessClient : public UtilityProcessHost::Client {
void OnProcessTerminatedNormally() override;

View File

@@ -170,7 +170,7 @@ index 75a82bc82ebe8e7b5b51b760cf4258cfd65a2df5..4b29c955c3347e2907c0d064834d917c
if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred &&
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index 93a47570d4854a3136fc4ac7f46d2f3d5c55db6c..78b720d556fb4f3f316baedaa70e56b1a171ab6a 100644
index 9741a329a96db439d074c1d9013558a51f18ed86..c95b315a30994b539fdd2429bab53674823ff5b5 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -324,6 +324,11 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -195,7 +195,7 @@ index 93a47570d4854a3136fc4ac7f46d2f3d5c55db6c..78b720d556fb4f3f316baedaa70e56b1
// If set, the window size will follow the content preferred size.
bool autosize = false;
@@ -1285,6 +1293,11 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -1295,6 +1303,11 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// with it. TYPE_CONTROL and TYPE_TOOLTIP is not considered top level.
bool is_top_level() const { return is_top_level_; }
@@ -207,7 +207,7 @@ index 93a47570d4854a3136fc4ac7f46d2f3d5c55db6c..78b720d556fb4f3f316baedaa70e56b1
// True if the window size will follow the content preferred size.
bool is_autosized() const { return is_autosized_; }
@@ -1730,6 +1743,9 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -1743,6 +1756,9 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// If true, the mouse is currently down.
bool is_mouse_button_pressed_ = false;

View File

@@ -8,7 +8,7 @@ Check for broken links by confirming the file exists before setting its utime.
This patch should be upstreamed & removed.
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 5bce95d5ea98c9a6522905f5c237fc5934fe2800..761df90191dd6444d64caf30e2a14c54c8ab536f 100755
index 31e2b5775021564b7c80b6756020973141c08530..88446019ce1a98eab8a648220e5ed0cac623c1e9 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -201,10 +201,9 @@ def DownloadAndUnpack(url, output_dir, path_prefixes=None, is_known_zip=False):

View File

@@ -28,10 +28,10 @@ The patch should be removed in favor of either:
Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index 7532fbb742624d86c342df29a7621867fa99180b..45cbb6bcaf16307a6949473ddb62a2be95031199 100644
index c0961beb9e8ee039fce607513c81f911128a2d81..4b67c11fa1749c42e9fe04865b8d369a80c7d847 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -11915,6 +11915,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() {
@@ -11913,6 +11913,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() {
target_rph_id);
}

View File

@@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Tue, 24 Mar 2026 16:33:20 -0500
Subject: fix: initialize COM on DesktopMediaListCaptureThread on Windows
On Windows, the DesktopMediaListCaptureThread runs with a UI message
pump that doesn't initialize COM. When WebRTC's window capturer
enumerates windows, interacting with UWP/Metro windows causes twinapi.dll
to internally call ::CoCreateInstance(), which hits Chromium's
DCheckedCoCreateInstance hook and triggers a crash.
This patch fixes the crash by ensuring COM is initialized on the
capture thread by calling `init_com_with_mta(false)`.
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 9a8ebb4edfb92d9fe28ae4b87463a68547ea1ab3..13446d9849c54f1bfe515c3db4d69dd181ec6d39 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -786,6 +786,13 @@ NativeDesktopMediaList::NativeDesktopMediaList(
base::MessagePumpType thread_type = base::MessagePumpType::UI;
#else
base::MessagePumpType thread_type = base::MessagePumpType::DEFAULT;
+#endif
+#if BUILDFLAG(IS_WIN)
+ // On Windows, window enumeration via webrtc::DesktopCapturer may interact
+ // with UWP/Metro windows through twinapi.dll, which internally calls
+ // CoCreateInstance. Initialize COM on this thread to prevent crashes in
+ // Chromium's DCheckedCoCreateInstance hook.
+ thread_.init_com_with_mta(false);
#endif
thread_.StartWithOptions(base::Thread::Options(thread_type, 0));

View File

@@ -9,10 +9,10 @@ focus node change via TextInputManager.
chromium-bug: https://crbug.com/1369605
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ccfe78580c2acb9a3afa43d246e1a83cc0e28598..30218b43ce1d57e45e9c265de4edcdce496cda79 100644
index cae6b1a65d0b8483f7a2bf0bd6dfc7a310216202..6ac0fc4b5d31ff3bce6440ae418145d0dc6882ed 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -3403,6 +3403,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
@@ -3406,6 +3406,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
}
}
@@ -39,10 +39,10 @@ index 448104cb33edbf6f2c046c4adbac3185eb4c9cb1..47b2677d2878cb9d5544798ddc49b54d
// Detaches |this| from the input method object.
// is_removed flag is true if this is called while the window is
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc
index 86dff7f91f1934d699371f49ee71fea458eb9822..5eda935a18ebabc0a76f99069f6c6a754139f8cc 100644
index 705a2ee24e463a65784a48844d7c9c26ae7b48db..87bf9b64616688152bd681cb57cefbc68a46d618 100644
--- a/content/browser/renderer_host/text_input_manager.cc
+++ b/content/browser/renderer_host/text_input_manager.cc
@@ -185,6 +185,7 @@ void TextInputManager::UpdateTextInputState(
@@ -184,6 +184,7 @@ void TextInputManager::UpdateTextInputState(
if (text_input_state.type == ui::TEXT_INPUT_TYPE_NONE &&
active_view_ != view) {
@@ -50,7 +50,7 @@ index 86dff7f91f1934d699371f49ee71fea458eb9822..5eda935a18ebabc0a76f99069f6c6a75
// We reached here because an IPC is received to reset the TextInputState
// for |view|. But |view| != |active_view_|, which suggests that at least
// one other view has become active and we have received the corresponding
@@ -475,6 +476,12 @@ void TextInputManager::NotifyObserversAboutInputStateUpdate(
@@ -474,6 +475,12 @@ void TextInputManager::NotifyObserversAboutInputStateUpdate(
observer.OnUpdateTextInputStateCalled(this, updated_view, did_update_state);
}
@@ -87,10 +87,10 @@ index a4768b51dae6817c9e9a467e9b16e827e0bfebda..83c42b5062aa8193fe2f56e407abe67d
// The view with active text input state, i.e., a focused <input> element.
// It will be nullptr if no such view exists. Note that the active view
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e039e2c82ad75ca4b95763414f7aafb6d3a3dbf2..aaa2b2229dac8c5e8cf590300b436082f6c3773b 100644
index 8f98cd136d73d5ff795fd3c62a696cc7d2fd3c84..f6b48f3641674bae565ec2c6294d9f6cf1d48db4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -10437,7 +10437,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -10430,7 +10430,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View File

@@ -11,10 +11,10 @@ This patch should be upstreamed as a conditional revert of the logic in desktop
vs mobile runtimes. i.e. restore the old logic only on desktop platforms
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 06599737a290ba4c52a7d36725aef565d49800bd..fe26e2aeba6fc03201373693d4afa2b78c89e54a 100644
index 3e62cf797e2fc127c4af86a912224f6c745b87f5..903b731a9cd58e418c26099044da62f7a23bd6ea 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2155,9 +2155,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
@@ -2147,9 +2147,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
// The resize message (which may not happen immediately) will carry with it
// the screen info as well as the new size (if the screen has changed scale

View File

@@ -211,7 +211,7 @@ index f2c94689450f0333a144ccf82cf147c194896e6b..1c2e9fe36c297f7d614d9ca290e4d13c
const mojom::blink::UserActivationOption user_activation_option_;
const mojom::blink::LoadEventBlockingOption blocking_option_;
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
index 7d4039de028e6c7ef87e93792961c338032b261d..41d0a336dc4c91c74c57383f9203f7bca7675b66 100644
index dec0b09e07c568b74b5ba25e8e3cb9f5b5cf7070..f28392d50ded3bb1ecb891314a989f1c07167bf6 100644
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
@@ -300,6 +300,7 @@ void ExecuteScriptsInMainWorld(

View File

@@ -6,7 +6,7 @@ Subject: fix: select the first menu item when opened via keyboard
This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed.
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 63f140c698fb1e5ba1f93c24bfe19bc3f87cec19..ea1824d09b37f6404985ffb048ce196ad5811507 100644
index 1b779f740710a49056f8b6b88df9033dd1289c91..21339edaab1069186f904f1c64a9c66f70c42a77 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -724,6 +724,16 @@ void MenuController::Run(Widget* parent,
@@ -26,7 +26,7 @@ index 63f140c698fb1e5ba1f93c24bfe19bc3f87cec19..ea1824d09b37f6404985ffb048ce196a
if (button_controller) {
pressed_lock_ = button_controller->TakeLock(
false, ui::LocatedEvent::FromIfValid(event));
@@ -2535,18 +2545,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
@@ -2530,18 +2540,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
}
item->GetSubmenu()->ShowAt(params);

View File

@@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
Allows embedder to intercept site instances created by chromium.
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
index f9179c9f42b16b5c73b7102700410f2d1b83aeab..abce85bb4fb63d1662bbc9ad28a1047f97c6d3c4 100644
index 1e76d25ab16ec1215e4c532fd7cb73702f16ffc6..8af96cfe14c4358cb6ab09135c04b04530f6e033 100644
--- a/content/browser/renderer_host/render_frame_host_manager.cc
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -4913,6 +4913,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -4891,6 +4891,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->ResetStateForSiteInstanceChange();
}
@@ -20,7 +20,7 @@ index f9179c9f42b16b5c73b7102700410f2d1b83aeab..abce85bb4fb63d1662bbc9ad28a1047f
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index eb684232648424fab4ba73b1fc813b0b3f8b809b..42b6fe4eb2c1db7afd6379ae07c1062856ed958e 100644
index 02321334795bb096206146caf24084c12347664e..70d485a1ef60230e2bcc5e64c02f35af805c87f5 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -350,6 +350,11 @@ class CONTENT_EXPORT ContentBrowserClient {

View File

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index ffd47250ce5a6a75471bb65aaf3d65b550be3586..e75f89f05ba0e3cc29d857f76244d777efdf1b84 100644
index 98b18d9e8129f2b06c4633b4ff74320fa2dee5f6..2f9bbe7578ce8e255a4aed6dd9dacea245640795 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1678,6 +1678,11 @@
@@ -1670,6 +1670,11 @@
"includes": [12000],
},

View File

@@ -50,7 +50,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to
system priority.
diff --git a/base/BUILD.gn b/base/BUILD.gn
index aad39d792791fb1e17d7a529eb234f74fdb65b09..95262f1cb611bfa9ac61321312b0aa5a979900cd 100644
index 2fea06e3d762884df05e74c0cef98990c302f814..fbadbe444df1b58e9e9cb985d30d009b661802ec 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1086,6 +1086,7 @@ component("base") {
@@ -129,7 +129,7 @@ index 416e541436d201aabca26cdbf7e8477103bd014c..8c5f92b03d67e5f0587b0e9420969061
}
diff --git a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
index 51a9d1fef7b2dbfef69f8474d74d45b69f16219d..cd61d8ae6ac772f8b8c28157e21b439cdb87dcca 100644
index 5c058b320fb0655db4eeb807b56547de83baa59a..ac397a51a961886e374bcf732fd5731ccfaf687e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
+++ b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
@@ -978,6 +978,7 @@ if (is_clang_or_gcc) {
@@ -974,7 +974,7 @@ index 664e12c07204feeb5be16581fe51e8adc4b898dd..38159d146cdf71f84611d58e2983418a
return kAttributes;
}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 718b28f411f7c32af45dc1e1cf4b4deeba78b06b..3a2189e97b99b2b2cf0308feeeddb9a249b3edb5 100644
index 1742ffc72707b7566982e60ae4964d0da901cbfe..56a1b7fb501979812b1f2e194044667f84f2312e 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -363,6 +363,7 @@ source_set("browser") {
@@ -1020,7 +1020,7 @@ index d4320df856533ef75f943deeac82119c746f5e20..c6e9cc8fd3b3e152493086a6f401d1c6
// Used to force the NSApplication's focused accessibility element to be the
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 63041c4311293c53d370522646012cde803e0a99..886b3e87e9041931d3cb59ef775b5012e8e2f908 100644
index 0241e3d3afaf7cd70214f71c1c8f023a49669ff8..f7c3e60f748e24e51bffa2bc8914a8a7b67bd504 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -53,6 +53,7 @@
@@ -1042,7 +1042,7 @@ index 63041c4311293c53d370522646012cde803e0a99..886b3e87e9041931d3cb59ef775b5012
// Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling
// pointers. `ns_view_` gets reinitialized later in this method.
@@ -1720,10 +1723,12 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -1713,10 +1716,12 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
gfx::NativeViewAccessible
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
@@ -1055,7 +1055,7 @@ index 63041c4311293c53d370522646012cde803e0a99..886b3e87e9041931d3cb59ef775b5012
return gfx::NativeViewAccessible([GetInProcessNSView() window]);
}
@@ -1775,9 +1780,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -1768,9 +1773,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
}
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
@@ -1067,7 +1067,7 @@ index 63041c4311293c53d370522646012cde803e0a99..886b3e87e9041931d3cb59ef775b5012
}
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
@@ -2307,20 +2314,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -2300,20 +2307,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken(
GetRenderWidgetAccessibilityTokenCallback callback) {
base::ProcessId pid = getpid();
@@ -1095,10 +1095,10 @@ index 63041c4311293c53d370522646012cde803e0a99..886b3e87e9041931d3cb59ef775b5012
///////////////////////////////////////////////////////////////////////////////
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index 6294792999d1653b73c695ebfddda0f8a45d82c9..da6be02dcff5d956e69fa356ec6dea65aa9780af 100644
index c759540ec86f1eca0d5b6ef61b899eb5fcdca16f..9ea2729f7c805bea9aa417fc0371fd2240cf544a 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -282,6 +282,7 @@ source_set("common") {
@@ -280,6 +280,7 @@ source_set("common") {
"//ui/shell_dialogs",
"//url",
"//url/ipc:url_ipc",
@@ -1189,7 +1189,7 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe
} // namespace content
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index ec792aa7e050550721cd221bfe8ff335e22e90ef..4521cc9e247c44248627c12b9eda0961f837d744 100644
index 45de48909df23b461aa8924bb391f13242aacef4..da0faf5bc419a11d192487ea373cee63596c2032 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -701,6 +701,7 @@ static_library("test_support") {
@@ -1209,7 +1209,7 @@ index ec792aa7e050550721cd221bfe8ff335e22e90ef..4521cc9e247c44248627c12b9eda0961
}
mojom("content_test_mojo_bindings") {
@@ -2078,6 +2081,7 @@ test("content_browsertests") {
@@ -2077,6 +2080,7 @@ test("content_browsertests") {
"//ui/shell_dialogs",
"//ui/snapshot",
"//ui/webui:test_support",
@@ -1217,7 +1217,7 @@ index ec792aa7e050550721cd221bfe8ff335e22e90ef..4521cc9e247c44248627c12b9eda0961
]
if (!(is_chromeos && target_cpu == "arm64" && current_cpu == "arm")) {
@@ -3446,6 +3450,7 @@ test("content_unittests") {
@@ -3441,6 +3445,7 @@ test("content_unittests") {
"//ui/shell_dialogs",
"//ui/webui:test_support",
"//url",

View File

@@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement
session.setCertificateVerifyCallback.
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 68b3acc5a4e67fee975fd982f252cbf46c28ccac..cf1001557f2f59747ceb394ab2c93b4bf379dafb 100644
index 0d70e10657f5f1cc5811e56044f13d9ae6c7f2a1..4efd5407479b9e5ee6af84a4cd6d26895d8b19f7 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -173,6 +173,11 @@
@@ -172,6 +172,11 @@
#include "services/network/web_transport.h"
#include "url/gurl.h"
@@ -22,7 +22,7 @@ index 68b3acc5a4e67fee975fd982f252cbf46c28ccac..cf1001557f2f59747ceb394ab2c93b4b
#if BUILDFLAG(IS_CT_SUPPORTED)
// gn check does not account for BUILDFLAG(). So, for iOS builds, it will
// complain about a missing dependency on the target exposing this header. Add a
@@ -632,6 +637,111 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
@@ -631,6 +636,111 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
} // namespace
@@ -134,7 +134,7 @@ index 68b3acc5a4e67fee975fd982f252cbf46c28ccac..cf1001557f2f59747ceb394ab2c93b4b
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::NetworkContextHttpAuthPreferences::
@@ -1081,6 +1191,13 @@ void NetworkContext::SetClient(
@@ -1078,6 +1188,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -148,7 +148,7 @@ index 68b3acc5a4e67fee975fd982f252cbf46c28ccac..cf1001557f2f59747ceb394ab2c93b4b
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -2800,6 +2917,10 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -2767,6 +2884,10 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
cert_verifier = std::make_unique<net::CachingCertVerifier>(
std::make_unique<net::CoalescingCertVerifier>(
std::move(cert_verifier)));
@@ -160,10 +160,10 @@ index 68b3acc5a4e67fee975fd982f252cbf46c28ccac..cf1001557f2f59747ceb394ab2c93b4b
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 54a5feca1fbec658039826304f27283bd9d9c15a..04e6e884dccbb680a39f2b9c8a54de162e056a30 100644
index 80f64d8bc17c9a706dafd3e9639a6d7e62caf0d5..912e4d60647f6376dfef62d18998b556bc7efa32 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -122,6 +122,7 @@ class SimpleUrlPatternMatcher;
@@ -121,6 +121,7 @@ class SimpleUrlPatternMatcher;
}
namespace network {
@@ -171,7 +171,7 @@ index 54a5feca1fbec658039826304f27283bd9d9c15a..04e6e884dccbb680a39f2b9c8a54de16
class CookieManager;
class HostResolver;
class MdnsResponderManager;
@@ -258,6 +259,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -257,6 +258,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) override;
@@ -180,7 +180,7 @@ index 54a5feca1fbec658039826304f27283bd9d9c15a..04e6e884dccbb680a39f2b9c8a54de16
void ResetURLLoaderFactories() override;
void GetViaObliviousHttp(
mojom::ObliviousHttpRequestPtr request,
@@ -1002,6 +1005,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -982,6 +985,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::vector<base::OnceClosure> dismount_closures_;
#endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
@@ -190,7 +190,7 @@ index 54a5feca1fbec658039826304f27283bd9d9c15a..04e6e884dccbb680a39f2b9c8a54de16
std::unique_ptr<HostResolver> internal_host_resolver_;
std::set<std::unique_ptr<HostResolver>, base::UniquePtrComparator>
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 152bffb4e6565437e867b79364c594305350047f..6c43c2985123525793dd6b60c9d7d7c1db7fdf04 100644
index 47134ad9365ce50035d5a305418e36a41fc917c9..63d410dd356594a5928ed2f84b05b403bf3367f0 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -325,6 +325,17 @@ struct SocketBrokerRemotes {
@@ -211,7 +211,7 @@ index 152bffb4e6565437e867b79364c594305350047f..6c43c2985123525793dd6b60c9d7d7c1
// Parameters for constructing a network context.
struct NetworkContextParams {
// The user agent string.
@@ -981,6 +992,9 @@ interface NetworkContext {
@@ -977,6 +988,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);
@@ -222,7 +222,7 @@ index 152bffb4e6565437e867b79364c594305350047f..6c43c2985123525793dd6b60c9d7d7c1
CreateURLLoaderFactory(
pending_receiver<URLLoaderFactory> url_loader_factory,
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 8b419ec4a949551557eba8c84589a18147b78c5d..b472be0acdc0cd4971e6e0a9e623bc1c84d07a02 100644
index beb1c3dba14fcc504886f100b1568768231a4f2d..bc26f449109b3be84490fbb3569e36aa4aca8c4b 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -63,6 +63,8 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -512,10 +512,10 @@ index aa79c324af2cec50019bca3bccff5d420fb30ffd..0b85598f87673537eccdd0b310e8462e
scoped_refptr<base::RefCountedMemory> print_data,
const gfx::Size& page_size,
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f17b3e13c 100644
index db3b04ba3353831ec766f48450b6dce40909bc59..d6fd0d304dffa71be42547a3f6ee6cdb7546de8b 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -48,6 +48,8 @@ namespace printing {
@@ -46,6 +46,8 @@ namespace printing {
class PrintQueriesQueue;
class PrinterQuery;
@@ -524,7 +524,7 @@ index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f
// Base class for managing the print commands for a WebContents.
class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
public:
@@ -78,7 +80,9 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -76,7 +78,9 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Prints the current document immediately. Since the rendering is
// asynchronous, the actual printing will not be completed on the return of
// this function. Returns false if printing is impossible at the moment.
@@ -535,7 +535,7 @@ index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f
// Like PrintNow(), but for the node under the context menu, instead of the
// entire frame.
@@ -132,8 +136,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -130,8 +134,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
void ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
ScriptedPrintCallback callback) override;
@@ -546,7 +546,7 @@ index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f
// Adds and removes observers for `PrintViewManagerBase` events. The order in
// which notifications are sent to observers is undefined. Observers must be
@@ -141,6 +147,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -139,6 +145,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
void AddTestObserver(TestObserver& observer);
void RemoveTestObserver(TestObserver& observer);
@@ -561,7 +561,7 @@ index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f
protected:
#if BUILDFLAG(ENTERPRISE_CONTENT_ANALYSIS)
using PrintDocumentCallback =
@@ -220,7 +234,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -218,7 +232,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
mojom::ScriptedPrintParamsPtr params,
ScriptedPrintCallback callback);
@@ -570,7 +570,7 @@ index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f
// Helper method bound to `content_analysis_before_printing_document_` when
// content analysis should happen right before the document is to be printed.
// This method is virtual for testing purposes.
@@ -284,6 +298,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -282,6 +296,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
bool success);
#endif
void CompleteUpdatePrintSettings(
@@ -578,7 +578,7 @@ index b6bbf0f1829a6759f65535679aafb8e407242166..f355b8981e8fc672b1ad165b3b770d3f
base::DictValue job_settings,
std::unique_ptr<PrintSettings> print_settings,
UpdatePrintSettingsCallback callback);
@@ -378,8 +393,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -376,8 +391,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// The current RFH that is printing with a system printing dialog.
raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;

View File

@@ -30,10 +30,10 @@ index 4dad6bbade99a00b5ae0f45d4de34d866918545c..6c7ec195fa64e3a1a718811192c9f6fd
// RenderWidgetHost on the primary main frame, and false otherwise.
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 8df679251dc314a94079fcc9d4edd7fab12873d4..06599737a290ba4c52a7d36725aef565d49800bd 100644
index 1919546e9be90303d1aee29208d8227ece452827..3e62cf797e2fc127c4af86a912224f6c745b87f5 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2066,6 +2066,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
@@ -2058,6 +2058,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
if (view_) {
view_->UpdateCursor(cursor);
}
@@ -44,10 +44,10 @@ index 8df679251dc314a94079fcc9d4edd7fab12873d4..06599737a290ba4c52a7d36725aef565
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4e91b3aeb5630476c660e8814e2fd9d92c5a9ca1..d43e75c20aca09080f4223d339c88381f030c504 100644
index 0088e16862b4eb08e2100f13e0d9fecfc0d8aa9d..ec75b1a31c029ff9f1d23f297be4ae40bc24af9c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -6342,6 +6342,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -6335,6 +6335,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}

View File

@@ -8,7 +8,7 @@ it in Electron and prevent drift from Chrome's blocklist. We should look for a w
to upstream this change to Chrome.
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf33b7ec165 100644
index 4e769e8be28ffd18788d8786fe7341e5d5b0697c..2f447d1a3e7ab50458159bcb717220bb60f6f6ea 100644
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
@@ -83,11 +83,13 @@
@@ -25,10 +25,14 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
#include "components/tabs/public/tab_interface.h"
#if BUILDFLAG(ENABLE_PLATFORM_APPS)
#include "extensions/browser/extension_registry.h" // nogncheck
@@ -287,214 +289,10 @@ bool MaybeIsLocalUNCPath(const base::FilePath& path) {
@@ -286,190 +288,10 @@ bool MaybeIsLocalUNCPath(const base::FilePath& path) {
}
#endif
-// Sentinel used to indicate that no PathService key is specified for a path in
-// the struct below.
-constexpr const int kNoBasePathKey = -1;
-
-// A wrapper around `base::NormalizeFilePath` that returns its result instead of
-// using an out parameter.
-base::FilePath NormalizeFilePath(const base::FilePath& path) {
@@ -58,132 +62,117 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
-
-std::unique_ptr<ChromeFileSystemAccessPermissionContext::BlockPathRules>
-GenerateBlockPaths(bool should_normalize_file_path) {
- using BlockPath = ChromeFileSystemAccessPermissionContext::BlockPath;
- static constexpr BlockPath kBlockPaths[] = {
- // Don't allow users to share their entire home directory, entire desktop
- // or entire documents folder, but do allow sharing anything inside those
- // directories not otherwise blocked.
- BlockPath::CreateRelative(base::DIR_HOME, BlockType::kDontBlockChildren),
- BlockPath::CreateRelative(base::DIR_USER_DESKTOP,
- BlockType::kDontBlockChildren),
- BlockPath::CreateRelative(chrome::DIR_USER_DOCUMENTS,
- BlockType::kDontBlockChildren),
- // Similar restrictions for the downloads directory.
- BlockPath::CreateRelative(chrome::DIR_DEFAULT_DOWNLOADS,
- BlockType::kDontBlockChildren),
- BlockPath::CreateRelative(chrome::DIR_DEFAULT_DOWNLOADS_SAFE,
- BlockType::kDontBlockChildren),
- // The Chrome installation itself should not be modified by the web.
- BlockPath::CreateRelative(base::DIR_EXE, BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_MODULE, BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_ASSETS, BlockType::kBlockAllChildren),
- // And neither should the configuration of at least the currently running
- // Chrome instance (note that this does not take --user-data-dir command
- // line overrides into account).
- BlockPath::CreateRelative(chrome::DIR_USER_DATA,
- BlockType::kBlockAllChildren),
- // ~/.ssh is pretty sensitive on all platforms, so block access to that.
- BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".ssh"),
- BlockType::kBlockAllChildren),
- // And limit access to ~/.gnupg as well.
- BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".gnupg"),
- BlockType::kBlockAllChildren),
- static constexpr ChromeFileSystemAccessPermissionContext::BlockPath
- kBlockPaths[] = {
- // Don't allow users to share their entire home directory, entire
- // desktop or entire documents folder, but do allow sharing anything
- // inside those directories not otherwise blocked.
- {base::DIR_HOME, nullptr, BlockType::kDontBlockChildren},
- {base::DIR_USER_DESKTOP, nullptr, BlockType::kDontBlockChildren},
- {chrome::DIR_USER_DOCUMENTS, nullptr, BlockType::kDontBlockChildren},
- // Similar restrictions for the downloads directory.
- {chrome::DIR_DEFAULT_DOWNLOADS, nullptr,
- BlockType::kDontBlockChildren},
- {chrome::DIR_DEFAULT_DOWNLOADS_SAFE, nullptr,
- BlockType::kDontBlockChildren},
- // The Chrome installation itself should not be modified by the web.
- {base::DIR_EXE, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_MODULE, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_ASSETS, nullptr, BlockType::kBlockAllChildren},
- // And neither should the configuration of at least the currently
- // running Chrome instance (note that this does not take
- // --user-data-dir command line overrides into account).
- {chrome::DIR_USER_DATA, nullptr, BlockType::kBlockAllChildren},
- // ~/.ssh is pretty sensitive on all platforms, so block access to
- // that.
- {base::DIR_HOME, FILE_PATH_LITERAL(".ssh"),
- BlockType::kBlockAllChildren},
- // And limit access to ~/.gnupg as well.
- {base::DIR_HOME, FILE_PATH_LITERAL(".gnupg"),
- BlockType::kBlockAllChildren},
-#if BUILDFLAG(IS_WIN)
- // Some Windows specific directories to block, basically all apps, the
- // operating system itself, as well as configuration data for apps.
- BlockPath::CreateRelative(base::DIR_PROGRAM_FILES,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_PROGRAM_FILESX86,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_PROGRAM_FILES6432,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_WINDOWS,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_ROAMING_APP_DATA,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_LOCAL_APP_DATA,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_COMMON_APP_DATA,
- BlockType::kBlockAllChildren),
- // Opening a file from an MTP device, such as a smartphone or a camera, is
- // implemented by Windows as opening a file in the temporary internet
- // files directory. To support that, allow opening files in that
- // directory, but not whole directories.
- BlockPath::CreateRelative(base::DIR_IE_INTERNET_CACHE,
- BlockType::kBlockNestedDirectories),
- // Block */.git/hooks on Windows, see crbug.com/465668234.
- BlockPath::CreateSuffix(FILE_PATH_LITERAL(".git/hooks"),
- BlockType::kBlockWrite),
- // Some Windows specific directories to block, basically all apps, the
- // operating system itself, as well as configuration data for apps.
- {base::DIR_PROGRAM_FILES, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_PROGRAM_FILESX86, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_PROGRAM_FILES6432, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_WINDOWS, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_ROAMING_APP_DATA, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_LOCAL_APP_DATA, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_COMMON_APP_DATA, nullptr, BlockType::kBlockAllChildren},
- // Opening a file from an MTP device, such as a smartphone or a
- // camera, is
- // implemented by Windows as opening a file in the temporary internet
- // files directory. To support that, allow opening files in that
- // directory, but not whole directories.
- {base::DIR_IE_INTERNET_CACHE, nullptr,
- BlockType::kBlockNestedDirectories},
-#endif
-#if BUILDFLAG(IS_MAC)
- // Similar Mac specific blocks.
- BlockPath::CreateRelative(base::DIR_APP_DATA,
- BlockType::kBlockAllChildren),
- // Block access to the current bundle directory.
- BlockPath::CreateRelative(chrome::DIR_OUTER_BUNDLE,
- BlockType::kBlockAllChildren),
- // Block access to the user's Applications directory.
- BlockPath::CreateRelative(base::DIR_HOME,
- FILE_PATH_LITERAL("Applications"),
- BlockType::kBlockAllChildren),
- // Block access to the root Applications directory.
- BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/Applications"),
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL("Library"),
- BlockType::kBlockAllChildren),
- // Allow access to other cloud files, such as Google Drive.
- BlockPath::CreateRelative(base::DIR_HOME,
- FILE_PATH_LITERAL("Library/CloudStorage"),
- BlockType::kDontBlockChildren),
- // Allow the site to interact with data from its corresponding natively
- // installed (sandboxed) application. It would be nice to limit a site to
- // access only _its_ corresponding natively installed application, but
- // unfortunately there's no straightforward way to do that. See
- // https://crbug.com/40095723#c22.
- BlockPath::CreateRelative(base::DIR_HOME,
- FILE_PATH_LITERAL("Library/Containers"),
- BlockType::kDontBlockChildren),
- // Allow access to iCloud files...
- BlockPath::CreateRelative(base::DIR_HOME,
- FILE_PATH_LITERAL("Library/Mobile Documents"),
- BlockType::kDontBlockChildren),
- // ... which may also appear at this directory.
- BlockPath::CreateRelative(
- base::DIR_HOME,
- FILE_PATH_LITERAL("Library/Mobile Documents/com~apple~CloudDocs"),
- BlockType::kDontBlockChildren),
- // Similar Mac specific blocks.
- {base::DIR_APP_DATA, nullptr, BlockType::kBlockAllChildren},
- // Block access to the current bundle directory.
- {chrome::DIR_OUTER_BUNDLE, nullptr, BlockType::kBlockAllChildren},
- // Block access to the user's Applications directory.
- {base::DIR_HOME, FILE_PATH_LITERAL("Applications"),
- BlockType::kBlockAllChildren},
- // Block access to the root Applications directory.
- {kNoBasePathKey, FILE_PATH_LITERAL("/Applications"),
- BlockType::kBlockAllChildren},
- {base::DIR_HOME, FILE_PATH_LITERAL("Library"),
- BlockType::kBlockAllChildren},
- // Allow access to other cloud files, such as Google Drive.
- {base::DIR_HOME, FILE_PATH_LITERAL("Library/CloudStorage"),
- BlockType::kDontBlockChildren},
- // Allow the site to interact with data from its corresponding
- // natively
- // installed (sandboxed) application. It would be nice to limit a site
- // to
- // access only _its_ corresponding natively installed application, but
- // unfortunately there's no straightforward way to do that. See
- // https://crbug.com/40095723#c22.
- {base::DIR_HOME, FILE_PATH_LITERAL("Library/Containers"),
- BlockType::kDontBlockChildren},
- // Allow access to iCloud files...
- {base::DIR_HOME, FILE_PATH_LITERAL("Library/Mobile Documents"),
- BlockType::kDontBlockChildren},
- // ... which may also appear at this directory.
- {base::DIR_HOME,
- FILE_PATH_LITERAL("Library/Mobile Documents/com~apple~CloudDocs"),
- BlockType::kDontBlockChildren},
-#endif
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
- // On Linux also block access to devices via /dev.
- BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/dev"),
- BlockType::kBlockAllChildren),
- // And security sensitive data in /proc and /sys.
- BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/proc"),
- BlockType::kBlockAllChildren),
- BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/sys"),
- BlockType::kBlockAllChildren),
- // And system files in /boot and /etc.
- BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/boot"),
- BlockType::kBlockAllChildren),
- BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/etc"),
- BlockType::kBlockAllChildren),
- // And block all of ~/.config, matching the similar restrictions on mac
- // and windows.
- BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".config"),
- BlockType::kBlockAllChildren),
- // Block ~/.dbus as well, just in case, although there probably isn't much
- // a website can do with access to that directory and its contents.
- BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".dbus"),
- BlockType::kBlockAllChildren),
- // On Linux also block access to devices via /dev.
- {kNoBasePathKey, FILE_PATH_LITERAL("/dev"),
- BlockType::kBlockAllChildren},
- // And security sensitive data in /proc and /sys.
- {kNoBasePathKey, FILE_PATH_LITERAL("/proc"),
- BlockType::kBlockAllChildren},
- {kNoBasePathKey, FILE_PATH_LITERAL("/sys"),
- BlockType::kBlockAllChildren},
- // And system files in /boot and /etc.
- {kNoBasePathKey, FILE_PATH_LITERAL("/boot"),
- BlockType::kBlockAllChildren},
- {kNoBasePathKey, FILE_PATH_LITERAL("/etc"),
- BlockType::kBlockAllChildren},
- // And block all of ~/.config, matching the similar restrictions on
- // mac
- // and windows.
- {base::DIR_HOME, FILE_PATH_LITERAL(".config"),
- BlockType::kBlockAllChildren},
- // Block ~/.dbus as well, just in case, although there probably isn't
- // much
- // a website can do with access to that directory and its contents.
- {base::DIR_HOME, FILE_PATH_LITERAL(".dbus"),
- BlockType::kBlockAllChildren},
-#endif
-#if BUILDFLAG(IS_ANDROID)
- BlockPath::CreateRelative(base::DIR_ANDROID_APP_DATA,
- BlockType::kBlockAllChildren),
- BlockPath::CreateRelative(base::DIR_CACHE, BlockType::kBlockAllChildren),
- {base::DIR_ANDROID_APP_DATA, nullptr, BlockType::kBlockAllChildren},
- {base::DIR_CACHE, nullptr, BlockType::kBlockAllChildren},
-#endif
- // TODO(crbug.com/40095723): Refine this list, for example add
- // XDG_CONFIG_HOME when it is not set ~/.config?
- };
- // TODO(crbug.com/40095723): Refine this list, for example add
- // XDG_CONFIG_HOME when it is not set ~/.config?
- };
-
- // ChromeOS supports multi-user sign-in. base::DIR_HOME only returns the
- // profile path for the primary user, the first user to sign in. We want to
@@ -198,41 +187,28 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
-
- for (const auto& blocked_path : kBlockPaths) {
- base::FilePath path;
- switch (blocked_path.block_path_type) {
- case ChromeFileSystemAccessPermissionContext::BlockPathType::kAbsolute: {
- CHECK(blocked_path.path);
- path = base::FilePath(blocked_path.path);
- break;
- }
- case ChromeFileSystemAccessPermissionContext::BlockPathType::kRelative: {
- CHECK(blocked_path.base_path_key);
- if (kUseProfilePathForDirHome &&
- blocked_path.base_path_key == base::DIR_HOME) {
- block_path_rules->profile_based_block_path_rules_.emplace_back(
- blocked_path.path, blocked_path.block_type);
- continue;
- }
-
- if (!base::PathService::Get(blocked_path.base_path_key.value(),
- &path)) {
- continue;
- }
-
- if (blocked_path.path) {
- path = path.Append(blocked_path.path);
- }
- break;
- }
- case ChromeFileSystemAccessPermissionContext::BlockPathType::kSuffix: {
- block_path_rules->suffix_block_path_rules_.emplace_back(
- blocked_path.path, blocked_path.block_type);
- if (blocked_path.base_path_key != kNoBasePathKey) {
- if (kUseProfilePathForDirHome &&
- blocked_path.base_path_key == base::DIR_HOME) {
- block_path_rules->profile_based_block_path_rules_.emplace_back(
- blocked_path.path, blocked_path.type);
- continue;
- }
- }
-
- if (!base::PathService::Get(blocked_path.base_path_key, &path)) {
- continue;
- }
-
- if (blocked_path.path) {
- path = path.Append(blocked_path.path);
- }
- } else {
- DCHECK(blocked_path.path);
- path = base::FilePath(blocked_path.path);
- }
- block_path_rules->block_path_rules_.emplace_back(
- should_normalize_file_path ? NormalizeFilePath(path) : path,
- blocked_path.block_type);
- blocked_path.type);
- }
-
- return block_path_rules;
@@ -244,7 +220,7 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
// Checks if `path` should be blocked by the `rules`.
// The BlockType of the nearest ancestor of a path to check is what
@@ -1474,16 +1272,6 @@ struct ChromeFileSystemAccessPermissionContext::OriginState {
@@ -1404,16 +1226,6 @@ struct ChromeFileSystemAccessPermissionContext::OriginState {
std::unique_ptr<base::RetainingOneShotTimer> cleanup_timer;
};
@@ -261,7 +237,7 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
ChromeFileSystemAccessPermissionContext::
ChromeFileSystemAccessPermissionContext(content::BrowserContext* context,
const base::Clock* clock)
@@ -1502,7 +1290,7 @@ ChromeFileSystemAccessPermissionContext::
@@ -1432,7 +1244,7 @@ ChromeFileSystemAccessPermissionContext::
#if BUILDFLAG(IS_ANDROID)
one_time_permissions_tracker_.Observe(
OneTimePermissionsTrackerFactory::GetForBrowserContext(context));
@@ -270,7 +246,7 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
auto* provider = web_app::WebAppProvider::GetForWebApps(
Profile::FromBrowserContext(profile_));
if (provider) {
@@ -2885,7 +2673,7 @@ void ChromeFileSystemAccessPermissionContext::OnShutdown() {
@@ -2812,7 +2624,7 @@ void ChromeFileSystemAccessPermissionContext::OnShutdown() {
one_time_permissions_tracker_.Reset();
}
@@ -279,7 +255,7 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
void ChromeFileSystemAccessPermissionContext::OnWebAppInstalled(
const webapps::AppId& app_id) {
if (!base::FeatureList::IsEnabled(
@@ -3243,11 +3031,7 @@ bool ChromeFileSystemAccessPermissionContext::
@@ -3170,11 +2982,7 @@ bool ChromeFileSystemAccessPermissionContext::
HandleType handle_type,
UserAction user_action,
GrantType grant_type) {
@@ -292,7 +268,7 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
if (!base::FeatureList::IsEnabled(
features::kFileSystemAccessPersistentPermissions)) {
return false;
@@ -3298,6 +3082,7 @@ bool ChromeFileSystemAccessPermissionContext::
@@ -3225,6 +3033,7 @@ bool ChromeFileSystemAccessPermissionContext::
return false;
#endif // BUILDFLAG(IS_ANDROID)
@@ -301,10 +277,10 @@ index fc75611edcaffa0501d5ad171e82e42a9d48002b..087d79d3249b7589f7f4cd5f7330edf3
std::vector<FileRequestData> ChromeFileSystemAccessPermissionContext::
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
index ae026d5321cd513c188297e53fe65aaaa77d6f34..184fda7f5851a5d22957b3ebd9d47a4f635a1aff 100644
index add60ba0e2ca7be385b59d46e3bdaceb55996947..5163e7092c3016494321b4c4a5f785f37f8b9411 100644
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
@@ -10,10 +10,13 @@
@@ -9,10 +9,13 @@
#include <vector>
#include "base/auto_reset.h"
@@ -318,7 +294,7 @@ index ae026d5321cd513c188297e53fe65aaaa77d6f34..184fda7f5851a5d22957b3ebd9d47a4f
#include "base/scoped_observation.h"
#include "base/sequence_checker.h"
#include "base/time/clock.h"
@@ -23,6 +26,7 @@
@@ -22,6 +25,7 @@
#include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h"
#include "chrome/browser/permissions/one_time_permissions_tracker.h"
#include "chrome/browser/permissions/one_time_permissions_tracker_observer.h"
@@ -326,7 +302,7 @@ index ae026d5321cd513c188297e53fe65aaaa77d6f34..184fda7f5851a5d22957b3ebd9d47a4f
#include "components/enterprise/buildflags/buildflags.h"
#include "components/permissions/features.h"
#include "components/permissions/object_permission_context_base.h"
@@ -471,6 +475,219 @@ class ChromeFileSystemAccessPermissionContext
@@ -419,6 +423,191 @@ class ChromeFileSystemAccessPermissionContext
bool IsPathInDowngradedReadPathsForTesting(const url::Origin& origin,
const base::FilePath& path);
@@ -363,132 +339,117 @@ index ae026d5321cd513c188297e53fe65aaaa77d6f34..184fda7f5851a5d22957b3ebd9d47a4f
+
+ static std::unique_ptr<ChromeFileSystemAccessPermissionContext::BlockPathRules>
+ GenerateBlockPaths(bool should_normalize_file_path) {
+ using BlockPath = ChromeFileSystemAccessPermissionContext::BlockPath;
+ static constexpr BlockPath kBlockPaths[] = {
+ // Don't allow users to share their entire home directory, entire desktop
+ // or entire documents folder, but do allow sharing anything inside those
+ // directories not otherwise blocked.
+ BlockPath::CreateRelative(base::DIR_HOME, BlockType::kDontBlockChildren),
+ BlockPath::CreateRelative(base::DIR_USER_DESKTOP,
+ BlockType::kDontBlockChildren),
+ BlockPath::CreateRelative(chrome::DIR_USER_DOCUMENTS,
+ BlockType::kDontBlockChildren),
+ // Similar restrictions for the downloads directory.
+ BlockPath::CreateRelative(chrome::DIR_DEFAULT_DOWNLOADS,
+ BlockType::kDontBlockChildren),
+ BlockPath::CreateRelative(chrome::DIR_DEFAULT_DOWNLOADS_SAFE,
+ BlockType::kDontBlockChildren),
+ // The Chrome installation itself should not be modified by the web.
+ BlockPath::CreateRelative(base::DIR_EXE, BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_MODULE, BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_ASSETS, BlockType::kBlockAllChildren),
+ // And neither should the configuration of at least the currently running
+ // Chrome instance (note that this does not take --user-data-dir command
+ // line overrides into account).
+ BlockPath::CreateRelative(chrome::DIR_USER_DATA,
+ BlockType::kBlockAllChildren),
+ // ~/.ssh is pretty sensitive on all platforms, so block access to that.
+ BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".ssh"),
+ BlockType::kBlockAllChildren),
+ // And limit access to ~/.gnupg as well.
+ BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".gnupg"),
+ BlockType::kBlockAllChildren),
+ static constexpr ChromeFileSystemAccessPermissionContext::BlockPath
+ kBlockPaths[] = {
+ // Don't allow users to share their entire home directory, entire
+ // desktop or entire documents folder, but do allow sharing anything
+ // inside those directories not otherwise blocked.
+ {base::DIR_HOME, nullptr, BlockType::kDontBlockChildren},
+ {base::DIR_USER_DESKTOP, nullptr, BlockType::kDontBlockChildren},
+ {chrome::DIR_USER_DOCUMENTS, nullptr, BlockType::kDontBlockChildren},
+ // Similar restrictions for the downloads directory.
+ {chrome::DIR_DEFAULT_DOWNLOADS, nullptr,
+ BlockType::kDontBlockChildren},
+ {chrome::DIR_DEFAULT_DOWNLOADS_SAFE, nullptr,
+ BlockType::kDontBlockChildren},
+ // The Chrome installation itself should not be modified by the web.
+ {base::DIR_EXE, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_MODULE, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_ASSETS, nullptr, BlockType::kBlockAllChildren},
+ // And neither should the configuration of at least the currently
+ // running Chrome instance (note that this does not take
+ // --user-data-dir command line overrides into account).
+ {chrome::DIR_USER_DATA, nullptr, BlockType::kBlockAllChildren},
+ // ~/.ssh is pretty sensitive on all platforms, so block access to
+ // that.
+ {base::DIR_HOME, FILE_PATH_LITERAL(".ssh"),
+ BlockType::kBlockAllChildren},
+ // And limit access to ~/.gnupg as well.
+ {base::DIR_HOME, FILE_PATH_LITERAL(".gnupg"),
+ BlockType::kBlockAllChildren},
+ #if BUILDFLAG(IS_WIN)
+ // Some Windows specific directories to block, basically all apps, the
+ // operating system itself, as well as configuration data for apps.
+ BlockPath::CreateRelative(base::DIR_PROGRAM_FILES,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_PROGRAM_FILESX86,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_PROGRAM_FILES6432,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_WINDOWS,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_ROAMING_APP_DATA,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_LOCAL_APP_DATA,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_COMMON_APP_DATA,
+ BlockType::kBlockAllChildren),
+ // Opening a file from an MTP device, such as a smartphone or a camera, is
+ // implemented by Windows as opening a file in the temporary internet
+ // files directory. To support that, allow opening files in that
+ // directory, but not whole directories.
+ BlockPath::CreateRelative(base::DIR_IE_INTERNET_CACHE,
+ BlockType::kBlockNestedDirectories),
+ // Block */.git/hooks on Windows, see crbug.com/465668234.
+ BlockPath::CreateSuffix(FILE_PATH_LITERAL(".git/hooks"),
+ BlockType::kBlockWrite),
+ // Some Windows specific directories to block, basically all apps, the
+ // operating system itself, as well as configuration data for apps.
+ {base::DIR_PROGRAM_FILES, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_PROGRAM_FILESX86, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_PROGRAM_FILES6432, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_WINDOWS, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_ROAMING_APP_DATA, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_LOCAL_APP_DATA, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_COMMON_APP_DATA, nullptr, BlockType::kBlockAllChildren},
+ // Opening a file from an MTP device, such as a smartphone or a
+ // camera, is
+ // implemented by Windows as opening a file in the temporary internet
+ // files directory. To support that, allow opening files in that
+ // directory, but not whole directories.
+ {base::DIR_IE_INTERNET_CACHE, nullptr,
+ BlockType::kBlockNestedDirectories},
+ #endif
+ #if BUILDFLAG(IS_MAC)
+ // Similar Mac specific blocks.
+ BlockPath::CreateRelative(base::DIR_APP_DATA,
+ BlockType::kBlockAllChildren),
+ // Block access to the current bundle directory.
+ BlockPath::CreateRelative(chrome::DIR_OUTER_BUNDLE,
+ BlockType::kBlockAllChildren),
+ // Block access to the user's Applications directory.
+ BlockPath::CreateRelative(base::DIR_HOME,
+ FILE_PATH_LITERAL("Applications"),
+ BlockType::kBlockAllChildren),
+ // Block access to the root Applications directory.
+ BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/Applications"),
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL("Library"),
+ BlockType::kBlockAllChildren),
+ // Allow access to other cloud files, such as Google Drive.
+ BlockPath::CreateRelative(base::DIR_HOME,
+ FILE_PATH_LITERAL("Library/CloudStorage"),
+ BlockType::kDontBlockChildren),
+ // Allow the site to interact with data from its corresponding natively
+ // installed (sandboxed) application. It would be nice to limit a site to
+ // access only _its_ corresponding natively installed application, but
+ // unfortunately there's no straightforward way to do that. See
+ // https://crbug.com/40095723#c22.
+ BlockPath::CreateRelative(base::DIR_HOME,
+ FILE_PATH_LITERAL("Library/Containers"),
+ BlockType::kDontBlockChildren),
+ // Allow access to iCloud files...
+ BlockPath::CreateRelative(base::DIR_HOME,
+ FILE_PATH_LITERAL("Library/Mobile Documents"),
+ BlockType::kDontBlockChildren),
+ // ... which may also appear at this directory.
+ BlockPath::CreateRelative(
+ base::DIR_HOME,
+ // Similar Mac specific blocks.
+ {base::DIR_APP_DATA, nullptr, BlockType::kBlockAllChildren},
+ // Block access to the current bundle directory.
+ {chrome::DIR_OUTER_BUNDLE, nullptr, BlockType::kBlockAllChildren},
+ // Block access to the user's Applications directory.
+ {base::DIR_HOME, FILE_PATH_LITERAL("Applications"),
+ BlockType::kBlockAllChildren},
+ // Block access to the root Applications directory.
+ {kNoBasePathKey, FILE_PATH_LITERAL("/Applications"),
+ BlockType::kBlockAllChildren},
+ {base::DIR_HOME, FILE_PATH_LITERAL("Library"),
+ BlockType::kBlockAllChildren},
+ // Allow access to other cloud files, such as Google Drive.
+ {base::DIR_HOME, FILE_PATH_LITERAL("Library/CloudStorage"),
+ BlockType::kDontBlockChildren},
+ // Allow the site to interact with data from its corresponding
+ // natively
+ // installed (sandboxed) application. It would be nice to limit a site
+ // to
+ // access only _its_ corresponding natively installed application, but
+ // unfortunately there's no straightforward way to do that. See
+ // https://crbug.com/984641#c22.
+ {base::DIR_HOME, FILE_PATH_LITERAL("Library/Containers"),
+ BlockType::kDontBlockChildren},
+ // Allow access to iCloud files...
+ {base::DIR_HOME, FILE_PATH_LITERAL("Library/Mobile Documents"),
+ BlockType::kDontBlockChildren},
+ // ... which may also appear at this directory.
+ {base::DIR_HOME,
+ FILE_PATH_LITERAL("Library/Mobile Documents/com~apple~CloudDocs"),
+ BlockType::kDontBlockChildren),
+ BlockType::kDontBlockChildren},
+ #endif
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ // On Linux also block access to devices via /dev.
+ BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/dev"),
+ BlockType::kBlockAllChildren),
+ // And security sensitive data in /proc and /sys.
+ BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/proc"),
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/sys"),
+ BlockType::kBlockAllChildren),
+ // And system files in /boot and /etc.
+ BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/boot"),
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateAbsolute(FILE_PATH_LITERAL("/etc"),
+ BlockType::kBlockAllChildren),
+ // And block all of ~/.config, matching the similar restrictions on mac
+ // and windows.
+ BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".config"),
+ BlockType::kBlockAllChildren),
+ // Block ~/.dbus as well, just in case, although there probably isn't much
+ // a website can do with access to that directory and its contents.
+ BlockPath::CreateRelative(base::DIR_HOME, FILE_PATH_LITERAL(".dbus"),
+ BlockType::kBlockAllChildren),
+ // On Linux also block access to devices via /dev.
+ {kNoBasePathKey, FILE_PATH_LITERAL("/dev"),
+ BlockType::kBlockAllChildren},
+ // And security sensitive data in /proc and /sys.
+ {kNoBasePathKey, FILE_PATH_LITERAL("/proc"),
+ BlockType::kBlockAllChildren},
+ {kNoBasePathKey, FILE_PATH_LITERAL("/sys"),
+ BlockType::kBlockAllChildren},
+ // And system files in /boot and /etc.
+ {kNoBasePathKey, FILE_PATH_LITERAL("/boot"),
+ BlockType::kBlockAllChildren},
+ {kNoBasePathKey, FILE_PATH_LITERAL("/etc"),
+ BlockType::kBlockAllChildren},
+ // And block all of ~/.config, matching the similar restrictions on
+ // mac
+ // and windows.
+ {base::DIR_HOME, FILE_PATH_LITERAL(".config"),
+ BlockType::kBlockAllChildren},
+ // Block ~/.dbus as well, just in case, although there probably isn't
+ // much
+ // a website can do with access to that directory and its contents.
+ {base::DIR_HOME, FILE_PATH_LITERAL(".dbus"),
+ BlockType::kBlockAllChildren},
+ #endif
+ #if BUILDFLAG(IS_ANDROID)
+ BlockPath::CreateRelative(base::DIR_ANDROID_APP_DATA,
+ BlockType::kBlockAllChildren),
+ BlockPath::CreateRelative(base::DIR_CACHE, BlockType::kBlockAllChildren),
+ {base::DIR_ANDROID_APP_DATA, nullptr, BlockType::kBlockAllChildren},
+ {base::DIR_CACHE, nullptr, BlockType::kBlockAllChildren},
+ #endif
+ // TODO(crbug.com/40095723): Refine this list, for example add
+ // XDG_CONFIG_HOME when it is not set ~/.config?
+ };
+ // TODO(crbug.com/40095723): Refine this list, for example add
+ // XDG_CONFIG_HOME when it is not set ~/.config?
+ };
+
+ // ChromeOS supports multi-user sign-in. base::DIR_HOME only returns the
+ // profile path for the primary user, the first user to sign in. We want to
@@ -503,41 +464,28 @@ index ae026d5321cd513c188297e53fe65aaaa77d6f34..184fda7f5851a5d22957b3ebd9d47a4f
+
+ for (const auto& blocked_path : kBlockPaths) {
+ base::FilePath path;
+ switch (blocked_path.block_path_type) {
+ case ChromeFileSystemAccessPermissionContext::BlockPathType::kAbsolute: {
+ CHECK(blocked_path.path);
+ path = base::FilePath(blocked_path.path);
+ break;
+ }
+ case ChromeFileSystemAccessPermissionContext::BlockPathType::kRelative: {
+ CHECK(blocked_path.base_path_key);
+ if (kUseProfilePathForDirHome &&
+ blocked_path.base_path_key == base::DIR_HOME) {
+ block_path_rules->profile_based_block_path_rules_.emplace_back(
+ blocked_path.path, blocked_path.block_type);
+ continue;
+ }
+
+ if (!base::PathService::Get(blocked_path.base_path_key.value(),
+ &path)) {
+ continue;
+ }
+
+ if (blocked_path.path) {
+ path = path.Append(blocked_path.path);
+ }
+ break;
+ }
+ case ChromeFileSystemAccessPermissionContext::BlockPathType::kSuffix: {
+ block_path_rules->suffix_block_path_rules_.emplace_back(
+ blocked_path.path, blocked_path.block_type);
+ if (blocked_path.base_path_key != kNoBasePathKey) {
+ if (kUseProfilePathForDirHome &&
+ blocked_path.base_path_key == base::DIR_HOME) {
+ block_path_rules->profile_based_block_path_rules_.emplace_back(
+ blocked_path.path, blocked_path.type);
+ continue;
+ }
+ }
+
+ if (!base::PathService::Get(blocked_path.base_path_key, &path)) {
+ continue;
+ }
+
+ if (blocked_path.path) {
+ path = path.Append(blocked_path.path);
+ }
+ } else {
+ DCHECK(blocked_path.path);
+ path = base::FilePath(blocked_path.path);
+ }
+ block_path_rules->block_path_rules_.emplace_back(
+ should_normalize_file_path ? NormalizeFilePath(path) : path,
+ blocked_path.block_type);
+ blocked_path.type);
+ }
+
+ return block_path_rules;

View File

@@ -15,10 +15,10 @@ This CL removes these filters so the unresponsive event can still be
accessed from our JS event. The filtering is moved into Electron's code.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e12758010f5c243d2fb9c733b74bcb0eea89f5da..6910e1e54995027933abc5724afac9129df7519c 100644
index 09346abdd2df2f672b1c3cc1757fa375eb6e0c72..1ef2411d03c041367e59bf9b3af2b1a6cb45dcee 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -10589,25 +10589,13 @@ void WebContentsImpl::RendererUnresponsive(
@@ -10582,25 +10582,13 @@ void WebContentsImpl::RendererUnresponsive(
base::RepeatingClosure hang_monitor_restarter) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
"render_widget_host", render_widget_host);

View File

@@ -39,10 +39,10 @@ index 6c7ec195fa64e3a1a718811192c9f6fdbf9463c6..c11744d2246c3df138cdb91f1d4459c6
// event before sending it to the renderer. See enum for details on return
// value.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index fe26e2aeba6fc03201373693d4afa2b78c89e54a..ab880a04a9638b348192a4c85785bc769e7dd83b 100644
index 903b731a9cd58e418c26099044da62f7a23bd6ea..54d51fc916e1d2819d4e5dca0c5dd3d25790cd72 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1562,6 +1562,10 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
@@ -1554,6 +1554,10 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
CHECK_GE(mouse_event.GetType(), WebInputEvent::Type::kMouseTypeFirst);
CHECK_LE(mouse_event.GetType(), WebInputEvent::Type::kMouseTypeLast);
@@ -54,7 +54,7 @@ index fe26e2aeba6fc03201373693d4afa2b78c89e54a..ab880a04a9638b348192a4c85785bc76
if (mouse_event_callback.Run(mouse_event)) {
return;
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6910e1e54995027933abc5724afac9129df7519c..8011e752e23f62162cb2fff2461dfe5948af6dad 100644
index 1ef2411d03c041367e59bf9b3af2b1a6cb45dcee..bd505514fe1aa90b1f61f50c875bfe62abb9d85a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4586,6 +4586,12 @@ void WebContentsImpl::RenderWidgetWasResized(

View File

@@ -10,10 +10,10 @@ on Windows. We should refactor our code so that this patch isn't
necessary.
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index 988866d79a5d1dbd366ebdbff0e8eb2c0c498168..5761ac48be0a64618be0a94606149dd944e46e27 100644
index d40db208ccc9955d38bab1c37e1c86a55ad7acf7..51c44e48902e44e7e1d6bda134a8f90e4bea3e81 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -22626,6 +22626,21 @@
@@ -22559,6 +22559,21 @@
]
}
],
@@ -36,10 +36,10 @@ index 988866d79a5d1dbd366ebdbff0e8eb2c0c498168..5761ac48be0a64618be0a94606149dd9
{
"platforms": [
diff --git a/ui/views/views_features.cc b/ui/views/views_features.cc
index 47077e16870889ef8f8c8b2adf58015bd5aff7fa..ba59e6e1609e61579bf49aca095490b083d72051 100644
index c74cf661f64e60ad6740e011f372e53426ce0c4d..77ce34e4f47a54f7ecabbd6e6d4d19555af248ff 100644
--- a/ui/views/views_features.cc
+++ b/ui/views/views_features.cc
@@ -30,6 +30,14 @@ BASE_FEATURE(kEnableInputProtection, base::FEATURE_DISABLED_BY_DEFAULT);
@@ -34,6 +34,14 @@ BASE_FEATURE(kEnableInputProtection, base::FEATURE_DISABLED_BY_DEFAULT);
// crbug.com/370856871.
BASE_FEATURE(kEnableTouchDragCursorSync, base::FEATURE_ENABLED_BY_DEFAULT);
@@ -55,10 +55,10 @@ index 47077e16870889ef8f8c8b2adf58015bd5aff7fa..ba59e6e1609e61579bf49aca095490b0
// to kKeyboardAccessibleTooltip in //ui/base/ui_base_features.cc.
BASE_FEATURE(kKeyboardAccessibleTooltipInViews,
diff --git a/ui/views/views_features.h b/ui/views/views_features.h
index 888a16fb6213eceb131ae636dc643d7f2d5bcad9..6077412165081cd4abeaf0b061feb2f795ee8131 100644
index 092e51509d4adccb8adbe2481909068e3e6836aa..5093a4c08bf6675ed1e5cb944c1bcb8251bdb033 100644
--- a/ui/views/views_features.h
+++ b/ui/views/views_features.h
@@ -15,6 +15,7 @@ namespace views::features {
@@ -16,6 +16,7 @@ VIEWS_EXPORT BASE_DECLARE_FEATURE(kAnnounceTextAdditionalAttributes);
VIEWS_EXPORT BASE_DECLARE_FEATURE(kApplyInitialUrlToWebContents);
VIEWS_EXPORT BASE_DECLARE_FEATURE(kEnableInputProtection);
VIEWS_EXPORT BASE_DECLARE_FEATURE(kEnableTouchDragCursorSync);

View File

@@ -9,7 +9,7 @@ is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8cd59445bae73ff0193e4512d7c36740cbad847f..ba7c3966f2c079bcec329f8f4a724c561969f33f 100644
index 1a45bab9c0e4e429bb338c757cdc49d64f337b88..462a05f830906518366182140c36ae73e96d6fc0 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4305,6 +4305,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,

View File

@@ -15,10 +15,10 @@ Note that we also need to manually update embedder's
`api::WebContents::IsFullscreenForTabOrPending` value.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index e4ff8f11bed9e53f3134068492ac94b4c9bb4df2..17c3b5c78c3ef08e0b901f3ace8bb07ee78e4cab 100644
index b898ebdd18bfefb4c6d8fa62e3e128a5154b049c..7c3a56dd43cfb10986a28b5d9bedb4ed75b89ca7 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -9260,6 +9260,17 @@ void RenderFrameHostImpl::EnterFullscreen(
@@ -9259,6 +9259,17 @@ void RenderFrameHostImpl::EnterFullscreen(
}
}
@@ -37,7 +37,7 @@ index e4ff8f11bed9e53f3134068492ac94b4c9bb4df2..17c3b5c78c3ef08e0b901f3ace8bb07e
if (had_fullscreen_token && !GetView()->HasFocus()) {
GetView()->Focus();
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ba7c3966f2c079bcec329f8f4a724c561969f33f..e039e2c82ad75ca4b95763414f7aafb6d3a3dbf2 100644
index 462a05f830906518366182140c36ae73e96d6fc0..8f98cd136d73d5ff795fd3c62a696cc7d2fd3c84 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4603,21 +4603,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(

View File

@@ -26,7 +26,7 @@ index 1f6c015c361b3146db760643e3670a110634d75b..d4d9c10d3420a5ff998aeb593ea6a255
// An empty URL is returned if the URL is not overriden.
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 416d53d0cce178de992074b0c0371bca2e4ed900..cd0e4d7ea77ffe9fd09982ef2d9f5d57df8e2995 100644
index efe0b36d0ff8ff12fd39ea72c036dba42be8d0fe..8c98620a6eb83283516a3fbe186c94c0ba75aac3 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -935,6 +935,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {

View File

@@ -35,7 +35,7 @@ index d4d9c10d3420a5ff998aeb593ea6a25556d1215e..d64fef6bfc37264dcdc1bbea22eb5c4e
// from the worker thread.
virtual void WillDestroyWorkerContextOnWorkerThread(
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index cd0e4d7ea77ffe9fd09982ef2d9f5d57df8e2995..3a96f5f084061c30344552a01b3d3a7260dad65e 100644
index 8c98620a6eb83283516a3fbe186c94c0ba75aac3..cfa6fb6d66529081bb24a29bd9affa148bea3a1f 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -947,6 +947,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(

View File

@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
patching legacy devtools code.
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
index 5b82adb6600fd4ec3df1976cd6d23880c57f114c..d70f30fa82578365434d4338fb49f654858ac012 100644
index 9432286fb380145a0ef2c92f14be6083812ccd81..5929b1c30277c480886a2951a330c83ad97da6dd 100644
--- a/front_end/entrypoints/main/MainImpl.ts
+++ b/front_end/entrypoints/main/MainImpl.ts
@@ -779,6 +779,8 @@ export class MainImpl {
@@ -780,6 +780,8 @@ export class MainImpl {
globalThis.Main = globalThis.Main || {};
// @ts-expect-error Exported for Tests.js
globalThis.Main.Main = MainImpl;

View File

@@ -1,2 +1,3 @@
chore_allow_customizing_microtask_policy_per_context.patch
build_warn_instead_of_abort_on_builtin_pgo_profile_mismatch.patch
feat_support_running_mksnapshot_exe_via_wine_for_windows.patch

View File

@@ -15,7 +15,7 @@ Rather than disabling builtins PGO entirely, warn and skip mismatched
builtins so all other builtins still benefit from PGO.
diff --git a/BUILD.gn b/BUILD.gn
index 382c7d3ed44eab5df1f33082d0d0ef85121bc47c..7b6a68379b81f317b3e2da868e9665239c60ffbe 100644
index b9fd222a47342e6b0617a2d4e9d88ad25be09ed8..751265ba83c04f0c545248a71b35e46034bfc90a 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2821,9 +2821,11 @@ template("run_mksnapshot") {

View File

@@ -0,0 +1,113 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <kleinschmidtorama@gmail.com>
Date: Tue, 24 Mar 2026 16:29:55 -0400
Subject: feat: support running mksnapshot.exe via Wine for Windows
cross-compile
When v8_win_cross_compile_using_wine=true is set, mksnapshot is built as a
Windows .exe using the target toolchain and executed via Wine on the Linux
host. This avoids needing source-level cross-compile patches for the
unwinding info code paths.
diff --git a/BUILD.gn b/BUILD.gn
index 751265ba83c04f0c545248a71b35e46034bfc90a..9ca41b06b569c729496abde7cba085518a9f0d71 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2699,7 +2699,11 @@ template("run_mksnapshot") {
suffix = "_$name"
}
action("run_mksnapshot_" + name) {
- deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
+ if (v8_prebuilt_mksnapshot != "") {
+ deps = []
+ } else {
+ deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
+ }
if (v8_verify_deterministic_mksnapshot) {
# We archive the snapshot executable when verifying snapshot
# determinism to ease debugging.
@@ -2753,10 +2757,26 @@ template("run_mksnapshot") {
data += [ "$root_out_dir/mksnapshot_output${suffix}.log" ]
}
+ if (v8_prebuilt_mksnapshot != "") {
+ _mksnapshot_bin = v8_prebuilt_mksnapshot
+ } else {
+ _mksnapshot_dir =
+ get_label_info(":mksnapshot($v8_snapshot_toolchain)", "root_out_dir")
+ if (v8_win_cross_compile_using_wine) {
+ _mksnapshot_bin = _mksnapshot_dir + "/mksnapshot.exe"
+ } else {
+ _mksnapshot_bin = _mksnapshot_dir + "/mksnapshot"
+ }
+ }
+
+ if (v8_win_cross_compile_using_wine) {
+ assert(
+ v8_wine_path != "",
+ "v8_wine_path must be set when v8_win_cross_compile_using_wine is true")
+ args += [ v8_wine_path ]
+ }
args += [
- "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
- "root_out_dir") + "/mksnapshot",
- root_build_dir),
+ "./" + rebase_path(_mksnapshot_bin, root_build_dir),
"--turbo_instruction_scheduling",
"--turbo-always-optimize-spills",
diff --git a/gni/snapshot_toolchain.gni b/gni/snapshot_toolchain.gni
index 37ed262640d048a6fa5923279ae0388c1c0ae766..d9830914f0abd919143f0cf8b3069c5a3f70516e 100644
--- a/gni/snapshot_toolchain.gni
+++ b/gni/snapshot_toolchain.gni
@@ -32,6 +32,21 @@ declare_args() {
# toolchain that matches the bit-width of the target CPU, but runs on
# the host.
v8_snapshot_toolchain = ""
+
+ # When cross-compiling for Windows on a non-Windows host, build mksnapshot
+ # as a Windows .exe and run it via Wine instead of building a host-native
+ # mksnapshot with cross-compile patches.
+ v8_win_cross_compile_using_wine = false
+
+ # Absolute path to the wine64 binary. Required when
+ # v8_win_cross_compile_using_wine is true.
+ v8_wine_path = ""
+
+ # Path to a pre-built mksnapshot binary to use instead of building one from
+ # source. When set, run_mksnapshot will use this binary directly and skip
+ # building the mksnapshot target. The path should be absolute or relative
+ # to the source root.
+ v8_prebuilt_mksnapshot = ""
}
# Try to infer the appropriate snapshot toolchain for the v8_current_cpu
@@ -69,7 +84,12 @@ if (v8_snapshot_toolchain == "") {
# Cross-build from same ISA on one OS to another. For example:
# * targeting win/x64 on a linux/x64 host
# * targeting win/arm64 on a mac/arm64 host
- v8_snapshot_toolchain = host_toolchain
+ if (v8_win_cross_compile_using_wine && is_win && host_os != "win") {
+ # Build mksnapshot as a Windows .exe and run it via Wine.
+ v8_snapshot_toolchain = current_toolchain
+ } else {
+ v8_snapshot_toolchain = host_toolchain
+ }
} else if (host_cpu == "arm64" && current_cpu == "x64") {
# Cross-build from arm64 to intel (likely on an Apple Silicon mac).
v8_snapshot_toolchain =
@@ -119,7 +139,13 @@ assert(v8_snapshot_toolchain != "",
# We reuse the snapshot toolchain for building torque and other generators to
# avoid building v8_libbase on the host more than once. On mips with big endian,
# the snapshot toolchain is the target toolchain and, hence, can't be used.
-v8_generator_toolchain = v8_snapshot_toolchain
+# When using Wine for cross-compilation, mksnapshot is built as a Windows .exe
+# but other generators (torque, etc.) must still be host-native binaries.
+if (v8_win_cross_compile_using_wine && is_win && host_os != "win") {
+ v8_generator_toolchain = host_toolchain
+} else {
+ v8_generator_toolchain = v8_snapshot_toolchain
+}
if (host_cpu == "x64" && v8_current_cpu == "mips64") {
v8_generator_toolchain = "//build/toolchain/linux:clang_x64"
}

View File

@@ -9,7 +9,11 @@ elif [ "`uname`" == "Darwin" ]; then
BUILD_TYPE="mas"
fi
elif [ "`uname`" == "Linux" ]; then
BUILD_TYPE="linux"
if [ "$ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN" == "1" ]; then
BUILD_TYPE="win"
else
BUILD_TYPE="linux"
fi
else
echo "Unsupported platform"
exit 1

View File

@@ -164,10 +164,9 @@ async function main () {
const currentVersion = getChromiumVersionFromDEPS(depsContent);
// Calculate the SHA256 for each object file under `outDir`
const files = await fs.readdir(outDir, { encoding: 'utf8', recursive: true });
const objectFiles = files.filter(file => file.endsWith('.o') || file.endsWith('.obj'));
const objectFiles = await fs.readdir(outDir, { encoding: 'utf8', recursive: true });
const checksums = {};
for (const file of objectFiles) {
for (const file of objectFiles.filter(f => f.endsWith('.o'))) {
const content = await fs.readFile(resolve(outDir, file));
checksums[file] = createHash('sha256').update(content).digest('hex');
}

View File

@@ -31,6 +31,13 @@ def LoadPythonDictionary(path):
)
return file_data
def get_out_dir():
out_dir = 'Testing'
override = os.environ.get('ELECTRON_OUT_DIR')
if override is not None:
out_dir = override
return os.path.join(SRC_DIR, 'out', out_dir)
if __name__ == '__main__':
node_root_dir = os.path.join(SRC_DIR, 'third_party/electron_node')
out = {}
@@ -54,7 +61,7 @@ if __name__ == '__main__':
hs = {'files': sorted(files), 'dest_dir': dest_dir}
out['headers'].append(hs)
root_gen_dir = os.path.abspath(sys.argv[1])
root_gen_dir = os.path.join(get_out_dir(), 'gen')
config_gypi_path = os.path.join(root_gen_dir, 'config.gypi')
node_headers_dir = os.path.join(root_gen_dir, 'node_headers')

View File

@@ -77,7 +77,6 @@
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/language_util.h"
#include "shell/common/node_includes.h"
#include "shell/common/options_switches.h"

View File

@@ -8,6 +8,7 @@
#include "base/path_service.h"
#include "shell/common/electron_paths.h"
#include "shell/common/node_includes.h"
#include "shell/common/process_util.h"
#include "shell/common/thread_restrictions.h"

View File

@@ -276,7 +276,6 @@ void Menu::OnMenuWillClose() {
}
void Menu::OnMenuWillShow() {
keep_alive_ = this;
Emit("menu-will-show");
}

View File

@@ -132,7 +132,7 @@ class Menu : public gin::Wrappable<Menu>,
int GetIndexOfCommandId(int command_id) const;
int GetItemCount() const;
gin_helper::SelfKeepAlive<Menu> keep_alive_{nullptr};
gin_helper::SelfKeepAlive<Menu> keep_alive_{this};
};
} // namespace electron::api

View File

@@ -19,6 +19,7 @@
#include "shell/browser/api/electron_api_web_frame_main.h"
#include "shell/browser/native_window.h"
#include "shell/common/keyboard_util.h"
#include "shell/common/node_includes.h"
#include "ui/base/cocoa/menu_utils.h"
#include "v8/include/cppgc/allocation.h"
#include "v8/include/v8-cppgc.h"

View File

@@ -550,7 +550,8 @@ gin::WrapperInfo Session::kWrapperInfo = {{gin::kEmbedderNativeGin},
Session::Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
: isolate_(isolate),
network_emulation_token_(base::UnguessableToken::Create()),
browser_context_{browser_context} {
browser_context_{
raw_ref<ElectronBrowserContext>::from_ptr(browser_context)} {
gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
data->AddDisposeObserver(this);
// Observe DownloadManager to get download notifications.
@@ -583,21 +584,16 @@ Session::~Session() {
}
void Session::Dispose() {
if (!keep_alive_)
return;
ElectronBrowserContext* const browser_context = this->browser_context();
if (!browser_context)
return;
browser_context->GetDownloadManager()->RemoveObserver(this);
if (keep_alive_) {
browser_context()->GetDownloadManager()->RemoveObserver(this);
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
if (auto* service =
SpellcheckServiceFactory::GetForContext(browser_context)) {
service->SetHunspellObserver(nullptr);
}
if (auto* service =
SpellcheckServiceFactory::GetForContext(browser_context())) {
service->SetHunspellObserver(nullptr);
}
#endif
}
}
void Session::OnDownloadCreated(content::DownloadManager* manager,
@@ -1879,7 +1875,6 @@ void Session::OnBeforeMicrotasksRunnerDispose(v8::Isolate* isolate) {
data->RemoveDisposeObserver(this);
Dispose();
weak_factory_.Invalidate();
browser_context_ = nullptr;
keep_alive_.Clear();
}

View File

@@ -10,6 +10,7 @@
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "content/public/browser/download_manager.h"
@@ -102,8 +103,8 @@ class Session final : public gin::Wrappable<Session>,
Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context);
~Session() override;
[[nodiscard]] ElectronBrowserContext* browser_context() const {
return browser_context_;
ElectronBrowserContext* browser_context() const {
return &browser_context_.get();
}
// gin::Wrappable
@@ -224,7 +225,7 @@ class Session final : public gin::Wrappable<Session>,
// The client id to enable the network throttler.
base::UnguessableToken network_emulation_token_;
raw_ptr<ElectronBrowserContext> browser_context_;
const raw_ref<ElectronBrowserContext> browser_context_;
gin::WeakCellFactory<Session> weak_factory_{this};

View File

@@ -26,6 +26,7 @@
#include "shell/common/gin_converters/gurl_converter.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/node_includes.h"
#include "shell/common/process_util.h"
#include "skia/ext/skia_utils_mac.h"

View File

@@ -47,13 +47,11 @@
#include "content/browser/renderer_host/render_widget_host_impl.h" // nogncheck
#include "content/browser/renderer_host/render_widget_host_view_base.h" // nogncheck
#include "content/browser/web_contents/web_contents_impl.h" // nogncheck
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/desktop_streams_registry.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/file_select_listener.h"
@@ -92,11 +90,9 @@
#include "services/service_manager/public/cpp/interface_provider.h"
#include "shell/browser/api/electron_api_browser_window.h"
#include "shell/browser/api/electron_api_debugger.h"
#include "shell/browser/api/electron_api_session.h"
#include "shell/browser/api/electron_api_web_frame_main.h"
#include "shell/browser/api/frame_subscriber.h"
#include "shell/browser/api/message_port.h"
#include "shell/browser/api/save_page_handler.h"
#include "shell/browser/browser.h"
#include "shell/browser/child_web_contents_tracker.h"
#include "shell/browser/electron_autofill_driver_factory.h"
@@ -914,15 +910,14 @@ WebContents::WebContents(v8::Isolate* isolate,
session = Session::FromPartition(isolate, "");
}
session_ = session;
ElectronBrowserContext* const browser_context = session->browser_context();
DCHECK(browser_context != nullptr);
std::unique_ptr<content::WebContents> web_contents;
if (is_guest()) {
scoped_refptr<content::SiteInstance> site_instance =
content::SiteInstance::CreateForURL(browser_context,
content::SiteInstance::CreateForURL(session->browser_context(),
GURL("chrome-guest://fake-host"));
content::WebContents::CreateParams params{browser_context, site_instance};
content::WebContents::CreateParams params(session->browser_context(),
site_instance);
guest_delegate_ =
std::make_unique<WebViewGuestDelegate>(embedder_->web_contents(), this);
params.guest_delegate = guest_delegate_.get();
@@ -950,7 +945,7 @@ WebContents::WebContents(v8::Isolate* isolate,
SkColor bc = ParseCSSColor(background_color_str).value_or(SK_ColorWHITE);
bool transparent = bc == SK_ColorTRANSPARENT;
content::WebContents::CreateParams params{browser_context};
content::WebContents::CreateParams params(session->browser_context());
auto* view = new OffScreenWebContentsView(
transparent, offscreen_use_shared_texture_,
offscreen_shared_texture_pixel_format_, offscreen_device_scale_factor_,
@@ -961,13 +956,13 @@ WebContents::WebContents(v8::Isolate* isolate,
web_contents = content::WebContents::Create(params);
view->SetWebContents(web_contents.get());
} else {
content::WebContents::CreateParams params{browser_context};
content::WebContents::CreateParams params(session->browser_context());
params.initially_hidden = !initially_shown;
web_contents = content::WebContents::Create(params);
}
InitWithSessionAndOptions(isolate, std::move(web_contents), browser_context,
options);
InitWithSessionAndOptions(isolate, std::move(web_contents),
session->browser_context(), options);
}
void WebContents::InitZoomController(content::WebContents* web_contents,

View File

@@ -22,6 +22,8 @@
#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" // nogncheck
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "content/common/frame.mojom-forward.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/frame_tree_node_id.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/javascript_dialog_manager.h"
@@ -31,6 +33,9 @@
#include "content/public/common/stop_find_action.h"
#include "electron/buildflags/buildflags.h"
#include "printing/buildflags/buildflags.h"
#include "shell/browser/api/electron_api_debugger.h"
#include "shell/browser/api/electron_api_session.h"
#include "shell/browser/api/save_page_handler.h"
#include "shell/browser/background_throttling_source.h"
#include "shell/browser/event_emitter_mixin.h"
#include "shell/browser/extended_web_contents_observer.h"
@@ -38,10 +43,13 @@
#include "shell/browser/preload_script.h"
#include "shell/browser/ui/inspectable_web_contents_delegate.h"
#include "shell/browser/ui/inspectable_web_contents_view_delegate.h"
#include "shell/common/api/api.mojom.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/gin_helper/constructible.h"
#include "shell/common/gin_helper/handle.h"
#include "shell/common/gin_helper/pinnable.h"
#include "shell/common/gin_helper/wrappable.h"
#include "shell/common/web_contents_utility.mojom.h"
#include "ui/base/models/image_model.h"
#include "v8/include/cppgc/persistent.h"
@@ -58,14 +66,8 @@ struct DeviceEmulationParams;
// enum class PermissionType;
} // namespace blink
namespace base {
class FilePath;
class Value;
} // namespace base
namespace content {
enum class KeyboardEventProcessingResult;
class DevToolsAgentHost;
class WebContents;
} // namespace content
@@ -77,8 +79,6 @@ namespace gin_helper {
class Dictionary;
class ErrorThrower;
template <typename T>
class Handle;
template <typename T>
class Promise;
} // namespace gin_helper
@@ -110,9 +110,7 @@ class OffScreenWebContentsView;
namespace api {
class BaseWindow;
class Debugger;
class FrameSubscriber;
class Session;
// Wrapper around the content::WebContents.
class WebContents final : public ExclusiveAccessContext,

View File

@@ -22,7 +22,6 @@
#include "shell/browser/window_list.h"
#include "shell/common/application_info.h"
#include "shell/common/gin_converters/login_item_settings_converter.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/thread_restrictions.h"
namespace electron {

View File

@@ -15,6 +15,7 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/values.h"
#include "shell/browser/window_list_observer.h"
#include "shell/common/gin_helper/promise.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
@@ -34,17 +35,7 @@ class Arguments;
namespace gin_helper {
class Arguments;
template <typename T>
class Promise;
} // namespace gin_helper
namespace v8 {
template <typename T>
class Local;
class Isolate;
class Promise;
class Value;
} // namespace v8
}
namespace electron {

View File

@@ -42,7 +42,6 @@
#include "shell/common/gin_converters/image_converter.h"
#include "shell/common/gin_converters/login_item_settings_converter.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/skia_util.h"
#include "shell/common/thread_restrictions.h"
#include "skia/ext/font_utils.h"

View File

@@ -626,9 +626,6 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
#if BUILDFLAG(IS_LINUX)
ui::OzonePlatform::GetInstance()->PostMainMessageLoopRun();
#endif
browser_.reset();
js_env_.reset();
}
#if !BUILDFLAG(IS_MAC)

View File

@@ -116,6 +116,10 @@ class FileSystemAccessPermissionContext
content::GlobalRenderFrameHostId frame_id,
EntriesAllowedByEnterprisePolicyCallback callback) override;
enum class Access { kRead, kWrite, kReadWrite };
enum class RequestType { kNewPermission, kRestorePermissions };
void RevokeActiveGrants(const url::Origin& origin,
const base::FilePath& file_path = base::FilePath());

View File

@@ -17,15 +17,12 @@
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool/initialization_util.h"
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
#include "gin/v8_initializer.h"
#include "shell/browser/microtasks_runner.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/node_includes.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/electron_node/src/node_wasm_web_api.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-locker.h"
namespace {
v8::Isolate* g_isolate;
@@ -140,10 +137,6 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
return isolate;
}
v8::Isolate* JavascriptEnvironment::isolate() const {
return isolate_holder_->isolate();
}
// static
v8::Isolate* JavascriptEnvironment::GetIsolate() {
CHECK(g_isolate);

View File

@@ -7,22 +7,15 @@
#include <memory>
#include "gin/public/isolate_holder.h"
#include "uv.h" // NOLINT(build/include_directory)
namespace gin {
class IsolateHolder;
} // namespace gin
#include "v8/include/v8-locker.h"
namespace node {
class Environment;
class MultiIsolatePlatform;
} // namespace node
namespace v8 {
class Isolate;
class Locker;
} // namespace v8
namespace electron {
class MicrotasksRunner;
@@ -41,13 +34,14 @@ class JavascriptEnvironment {
void DestroyMicrotasksRunner();
node::MultiIsolatePlatform* platform() const { return platform_.get(); }
[[nodiscard]] v8::Isolate* isolate() const {
return isolate_holder_->isolate();
}
size_t max_young_generation_size_in_bytes() const {
return max_young_generation_size_;
}
[[nodiscard]] v8::Isolate* isolate() const;
[[nodiscard]] static v8::Isolate* GetIsolate();
static v8::Isolate* GetIsolate();
private:
v8::Isolate* Initialize(uv_loop_t* event_loop, bool setup_wasm_streaming);

View File

@@ -7,7 +7,6 @@
#include <utility>
#include "base/task/sequenced_task_runner.h"
#include "content/public/browser/browser_thread.h"
#include "gin/arguments.h"
#include "gin/dictionary.h"
#include "shell/browser/api/electron_api_app.h"

View File

@@ -402,7 +402,7 @@ void InspectableWebContents::SetDockState(const std::string& state) {
can_dock_ = false;
} else {
can_dock_ = true;
dock_state_ = (state.empty() || IsValidDockState(state)) ? state : "right";
dock_state_ = IsValidDockState(state) ? state : "right";
}
}

View File

@@ -705,10 +705,8 @@ gin_helper::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create(
else // default session
session = Session::FromPartition(args->isolate(), "");
}
if (session) {
if (session)
browser_context = session->browser_context();
DCHECK(browser_context != nullptr);
}
}
auto ret = gin_helper::CreateHandle(

View File

@@ -6,7 +6,6 @@
#include "base/i18n/rtl.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_version.h"
#include "components/embedder_support/user_agent_utils.h"

View File

@@ -13,7 +13,6 @@
#include "shell/common/gin_helper/function_template.h"
#include "shell/common/gin_helper/locker.h"
#include "v8/include/cppgc/persistent.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-function.h"
#include "v8/include/v8-microtask-queue.h"
// Implements safe conversions between JS functions and base::RepeatingCallback.

View File

@@ -16,6 +16,7 @@
#include "gin/public/gin_embedders.h"
#include "shell/common/gin_helper/destroyable.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-external.h"
#include "v8/include/v8-microtask-queue.h"
#include "v8/include/v8-template.h"

View File

@@ -10,7 +10,7 @@
#include <vector>
#include "base/containers/span.h"
#include "base/memory/memory_pressure_listener_registry.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
@@ -624,7 +624,7 @@ class WebFrameRenderer final
blink::WebFrame* web_frame = render_frame->GetWebFrame();
if (web_frame->IsWebLocalFrame()) {
web_frame->ToWebLocalFrame()->GetDocument().RemoveInsertedStyleSheet(
blink::WebString::FromUtf16(key));
blink::WebString::FromUTF16(key));
}
}
@@ -652,7 +652,7 @@ class WebFrameRenderer final
return handle;
}
const blink::WebScriptSource source{blink::WebString::FromUtf16(code)};
const blink::WebScriptSource source{blink::WebString::FromUTF16(code)};
bool has_user_gesture = false;
if (auto next = args->PeekNext(); !next.IsEmpty() && next->IsBoolean()) {
@@ -731,7 +731,7 @@ class WebFrameRenderer final
return handle;
}
sources.emplace_back(blink::WebString::FromUtf16(code),
sources.emplace_back(blink::WebString::FromUTF16(code),
blink::WebURL(GURL(url)));
}
@@ -810,7 +810,7 @@ class WebFrameRenderer final
void ClearCache(v8::Isolate* isolate) {
blink::WebCache::Clear();
base::MemoryPressureListenerRegistry::NotifyMemoryPressure(
base::MemoryPressureListener::NotifyMemoryPressure(
base::MEMORY_PRESSURE_LEVEL_CRITICAL);
}

View File

@@ -15,6 +15,7 @@
#include "shell/common/gin_converters/blink_converter.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/heap_snapshot.h"
#include "shell/common/node_includes.h"
#include "shell/common/options_switches.h"
#include "shell/common/thread_restrictions.h"
#include "shell/common/v8_util.h"
@@ -26,7 +27,6 @@
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_message_port_converter.h"
#include "v8/include/v8-context.h"
namespace electron {

View File

@@ -206,7 +206,7 @@ void AutofillAgent::AcceptDataListSuggestion(const std::u16string& suggestion) {
blink::WebInputElement input_element =
element.DynamicTo<blink::WebInputElement>();
if (!input_element.IsNull())
input_element.SetAutofillValue(blink::WebString::FromUtf16(suggestion));
input_element.SetAutofillValue(blink::WebString::FromUTF16(suggestion));
}
}

View File

@@ -59,6 +59,7 @@ const startServer = async () => {
function waitForCrash (): Promise<CrashInfo> {
return new Promise(resolve => {
emitter.once('crash', (crash) => {
console.log('crash fired', crash);
resolve(crash);
});
});
@@ -69,6 +70,7 @@ const startServer = async () => {
const fields = {} as Record<string, any>;
const files = {} as Record<string, Buffer>;
busboy.on('file', (fieldname, file) => {
console.log('Receiving file for :', fieldname);
const chunks = [] as Array<Buffer>;
file.on('data', (chunk) => {
chunks.push(chunk);
@@ -81,10 +83,12 @@ const startServer = async () => {
fields[fieldname] = val;
});
busboy.on('finish', () => {
console.log('On finish');
// breakpad id must be 16 hex digits.
const reportId = Math.random().toString(16).split('.')[1].padStart(16, '0');
res.end(reportId, async () => {
req.socket.destroy();
console.log('Emmitting crash:', fields);
emitter.emit('crash', { ...fields, ...files });
});
});
@@ -138,10 +142,15 @@ function waitForNewFileInDir (dir: string): Promise<string[]> {
ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_TESTS)('crashReporter module', function () {
describe('should send minidump', () => {
it('when renderer crashes', async () => {
console.log('starting server for renderer crash test');
const { port, waitForCrash } = await startServer();
console.log('Done starting server for renderer crash test');
runCrashApp('renderer', port);
console.log('Waiting for renderer crash');
const crash = await waitForCrash();
console.log('Renderer crash received');
checkCrash('renderer', crash);
console.log('Renderer crash checked');
expect(crash.mainProcessSpecific).to.be.undefined();
});

View File

@@ -15,7 +15,7 @@ function getSourceTypes (): ('window' | 'screen')[] {
return ['window', 'screen'];
}
describe('desktopCapturer', () => {
ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('desktopCapturer', () => {
it('should return a non-empty array of sources', async () => {
const sources = await desktopCapturer.getSources({ types: getSourceTypes() });
expect(sources).to.be.an('array').that.is.not.empty();
@@ -254,61 +254,4 @@ describe('desktopCapturer', () => {
destroyWindows();
}
});
// Linux doesn't return any window sources.
ifdescribe(process.platform !== 'linux')('fetchWindowIcons', function () {
// Tests are sequentially dependent
this.bail(true);
let w: BrowserWindow;
let testSource: Electron.DesktopCapturerSource | undefined;
let appIcon: Electron.NativeImage | undefined;
before(async () => {
w = new BrowserWindow({
width: 200,
height: 200,
show: true,
title: 'desktop-capturer-test-window'
});
await w.loadURL('about:blank');
const sources = await desktopCapturer.getSources({
types: ['window'],
fetchWindowIcons: true
});
testSource = sources.find(
s => s.name === 'desktop-capturer-test-window'
);
appIcon = testSource?.appIcon;
});
after(() => {
if (w) w.destroy();
});
it('should find the test window in the list of captured sources', () => {
expect(testSource, `The ${w.getTitle()} window was not found by desktopCapturer`).to.exist();
});
it('should return a non-null appIcon for the captured window', () => {
expect(appIcon, 'appIcon property is null or undefined').to.exist();
});
it('should return an appIcon that is not an empty image', () => {
expect(appIcon?.isEmpty()).to.be.false();
});
it('should return an appIcon that encodes to a valid PNG data URL', () => {
const url = appIcon?.toDataURL();
expect(url).to.be.a('string');
// This is header 'data:image/png;base64,' length;
expect(url?.length).to.be.greaterThan(22);
expect(url?.startsWith('data:image/png;base64,')).to.be.true();
});
it('should return an appIcon with dimensions greater than 0x0 pixels', () => {
const { width, height } = appIcon?.getSize() || { width: 0, height: 0 };
expect(width).to.be.greaterThan(0);
expect(height).to.be.greaterThan(0);
});
});
});

View File

@@ -1,6 +1,5 @@
import { expect } from 'chai';
import { once } from 'node:events';
import * as path from 'node:path';
import { ifdescribe, isTestingBindingAvailable, startRemoteControlApp } from './lib/spec-helpers';
@@ -40,33 +39,6 @@ describe('cpp heap', () => {
});
describe('session module', () => {
it('does not crash on exit with live session wrappers', async () => {
const rc = await startRemoteControlApp();
await rc.remotely(async () => {
const { app, session } = require('electron');
const sessions = [
session.defaultSession,
session.fromPartition('cppheap-exit'),
session.fromPartition('persist:cppheap-exit-persist')
];
// We want to test GC on shutdown, so add a global reference
// to these sessions to prevent pre-shutdown GC.
(globalThis as any).sessionRefs = sessions;
// We want to test CppGC-traced references during shutdown.
// The CppGC-managed cookies will do that; but since they're
// lazy-created, access them here to ensure they're live.
sessions.forEach(ses => ses.cookies);
setTimeout(() => app.quit());
});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(0);
});
it('should record as node in heap snapshot', async () => {
const { remotely } = await startRemoteControlApp(['--expose-internals']);
const result = await remotely(async (heap: string, snapshotHelper: string) => {

View File

@@ -590,7 +590,7 @@ __metadata:
"@types/semver": "npm:^7.5.8"
"@types/stream-json": "npm:^1.7.8"
"@types/temp": "npm:^0.9.4"
"@xmldom/xmldom": "npm:^0.8.12"
"@xmldom/xmldom": "npm:^0.8.11"
buffer: "npm:^6.0.3"
chalk: "npm:^4.1.0"
check-for-leaks: "npm:^1.2.1"
@@ -2503,14 +2503,7 @@ __metadata:
languageName: node
linkType: hard
"@xmldom/xmldom@npm:^0.8.12":
version: 0.8.12
resolution: "@xmldom/xmldom@npm:0.8.12"
checksum: 10c0/b733c84292d1bee32ef21a05aba8f9063456b51a54068d0b4a1abf5545156ee0b9894b7ae23775b5881b11c35a8a03871d1b514fb7e1b11654cdbee57e1c2707
languageName: node
linkType: hard
"@xmldom/xmldom@npm:^0.8.8":
"@xmldom/xmldom@npm:^0.8.11, @xmldom/xmldom@npm:^0.8.8":
version: 0.8.11
resolution: "@xmldom/xmldom@npm:0.8.11"
checksum: 10c0/e768623de72c95d3dae6b5da8e33dda0d81665047811b5498d23a328d45b13feb5536fe921d0308b96a4a8dd8addf80b1f6ef466508051c0b581e63e0dc74ed5