mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9049d01bd6 | ||
|
|
42c8938c9a | ||
|
|
b5f8c7554a | ||
|
|
0b34f5b45e | ||
|
|
2b7f32428f | ||
|
|
2d7cfd3de2 | ||
|
|
06c84f35bd | ||
|
|
cfb7237c6c | ||
|
|
fa4462341a | ||
|
|
19069ead12 | ||
|
|
6da5666aa5 | ||
|
|
fcdf08ce75 | ||
|
|
fe9e90af7b | ||
|
|
ef9cd3464d | ||
|
|
51f771224a | ||
|
|
23d574152e | ||
|
|
4bee1eaded | ||
|
|
88f4deb3a3 | ||
|
|
165ea64314 | ||
|
|
8961eb074b | ||
|
|
b194cb1486 | ||
|
|
470a82869c | ||
|
|
a19f617ab0 | ||
|
|
f008b0d0b2 | ||
|
|
ce2f471e9d | ||
|
|
5cda3d226c | ||
|
|
30358180c7 | ||
|
|
e151aae7a3 | ||
|
|
bc9b5af26e | ||
|
|
952b9c0b46 | ||
|
|
5705ce1d6e | ||
|
|
c8ac7b0efd | ||
|
|
dbeed26c0d | ||
|
|
99e589c2cf | ||
|
|
3782fe51ff | ||
|
|
be7b06108e | ||
|
|
6b956d036d | ||
|
|
370ffe0df5 | ||
|
|
14456ecfbc | ||
|
|
974c8f5150 | ||
|
|
ac5b5995e8 | ||
|
|
5ccd41cf5c | ||
|
|
060cfb94e9 | ||
|
|
587e115527 | ||
|
|
a56b2acadd | ||
|
|
58479848b2 | ||
|
|
ba2cad1670 | ||
|
|
f98501308a | ||
|
|
1d9f1a4cd4 | ||
|
|
7d01169091 | ||
|
|
ad496c9958 | ||
|
|
b04c4505c4 | ||
|
|
c3fd3afa24 | ||
|
|
4516469312 | ||
|
|
b4bb928224 | ||
|
|
4ed1ac6ab0 | ||
|
|
289a1861fc | ||
|
|
b19995e623 | ||
|
|
47ab952bb1 | ||
|
|
0c73c66438 | ||
|
|
289168a1ad | ||
|
|
9f27479a11 | ||
|
|
01b8069ada | ||
|
|
31a95f7857 | ||
|
|
70b354643e | ||
|
|
4fdfc66706 | ||
|
|
9d7c3a65fe | ||
|
|
66d1227cc4 | ||
|
|
ccb7fc05b3 | ||
|
|
d507cf63d1 | ||
|
|
95bce0bce1 | ||
|
|
727e218c47 | ||
|
|
16cb1e46c8 | ||
|
|
435facd8e4 | ||
|
|
75ce54614e | ||
|
|
de958d0dab | ||
|
|
0af85fc5f0 | ||
|
|
f927d1dd92 | ||
|
|
f2ec3763c2 | ||
|
|
c8c5f9c986 | ||
|
|
c1c9c1d001 | ||
|
|
3b89a5e183 | ||
|
|
e2042de483 | ||
|
|
dd5def7f46 | ||
|
|
6210a9e82c | ||
|
|
eb7216be1c | ||
|
|
32830de5b6 | ||
|
|
a9f3754d22 | ||
|
|
eb7a5c2548 | ||
|
|
cb1c7b447b | ||
|
|
d33905c5d9 | ||
|
|
ddc7afd3f0 | ||
|
|
d04491dff0 | ||
|
|
88286e8f16 | ||
|
|
a6eb660a3d | ||
|
|
bb6d76a07a | ||
|
|
27349fc233 | ||
|
|
c1a9e79d08 | ||
|
|
b3bb3c5be0 | ||
|
|
882bcb9435 | ||
|
|
d2fce89969 | ||
|
|
78adaed2c6 | ||
|
|
bba618f4d3 |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -6,6 +6,9 @@ yarn.lock text eol=lf
|
||||
script/zip_manifests/*.manifest text eol=lf
|
||||
patches/**/.patches merge=union
|
||||
|
||||
# Patch file line ending exceptions (patches that affect CRLF files)
|
||||
reland_lzma_sdk_update_to_24_09.patch -text
|
||||
|
||||
# Source code and markdown files should always use LF as line ending.
|
||||
*.c text eol=lf
|
||||
*.cc text eol=lf
|
||||
|
||||
4
.github/actions/build-electron/action.yml
vendored
4
.github/actions/build-electron/action.yml
vendored
@@ -108,7 +108,9 @@ runs:
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
cd out/Default
|
||||
powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
|
||||
powershell Compress-Archive -update gen/v8/embedded.S 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
|
||||
|
||||
58
.github/actions/checkout/action.yml
vendored
58
.github/actions/checkout/action.yml
vendored
@@ -9,6 +9,8 @@ inputs:
|
||||
description: 'Whether to persist the cache to the shared drive'
|
||||
required: false
|
||||
default: 'true'
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
@@ -18,38 +20,34 @@ runs:
|
||||
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Get Depot Tools
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ! -d depot_tools ]]; then
|
||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
fi
|
||||
- name: Add Depot Tools to PATH
|
||||
shell: bash
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Generate DEPS Hash
|
||||
shell: bash
|
||||
run: |
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
echo "DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||
DEPSHASH="v1-src-cache-$(cat src/electron/.depshash)"
|
||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||
echo "CACHE_FILE=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
echo "CACHE_DRIVE=/mnt/win-cache" >> $GITHUB_ENV
|
||||
else
|
||||
echo "CACHE_DRIVE=/mnt/cross-instance-cache" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: Generate SAS Key
|
||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$DEPSHASH.tar" > sas-token
|
||||
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$CACHE_FILE?platform=${{ inputs.target-platform }}" > sas-token
|
||||
- name: Save SAS Key
|
||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||
uses: actions/cache/save@v4
|
||||
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||
with:
|
||||
path: |
|
||||
sas-token
|
||||
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
path: sas-token
|
||||
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Check If Cache Exists
|
||||
id: check-cache
|
||||
shell: bash
|
||||
@@ -58,7 +56,7 @@ runs:
|
||||
echo "Not using cache this time..."
|
||||
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
cache_path=$CACHE_DRIVE/$CACHE_FILE
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking for cache in: $cache_path"
|
||||
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
||||
@@ -73,10 +71,10 @@ runs:
|
||||
if: steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
# if there is less than 20 GB free space then creating the cache might fail so exit early
|
||||
freespace=`df -m /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
||||
freespace_human=`df -h /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
||||
if [ $freespace -le 20000 ]; then
|
||||
# if there is less than 35 GB free space then creating the cache might fail so exit early
|
||||
freespace=`df -m $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
|
||||
freespace_human=`df -h $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
|
||||
if [ $freespace -le 35000 ]; then
|
||||
echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
|
||||
exit 1
|
||||
else
|
||||
@@ -97,7 +95,7 @@ runs:
|
||||
fi
|
||||
|
||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vv
|
||||
if [ "${{ inputs.is-release }}" != "true" && -n "${{ env.PATCH_UP_APP_CREDS }}" ]; then
|
||||
if [[ "${{ inputs.is-release }}" != "true" ]]; then
|
||||
# Re-export all the patches to check if there were changes.
|
||||
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||
cd src/electron
|
||||
@@ -126,6 +124,8 @@ runs:
|
||||
cat ../../patches/update-patches.patch
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "No changes to patches detected"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -163,14 +163,14 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
|
||||
tar -cf $DEPSHASH.tar src
|
||||
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
|
||||
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
|
||||
tar -cf $CACHE_FILE src
|
||||
echo "Compressed src to $(du -sh $CACHE_FILE | cut -f1 -d' ')"
|
||||
cp ./$CACHE_FILE $CACHE_DRIVE/
|
||||
- name: Persist Src Cache
|
||||
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
final_cache_path=$CACHE_DRIVE/$CACHE_FILE
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking path: $final_cache_path"
|
||||
if [ ! -f "$final_cache_path" ]; then
|
||||
|
||||
40
.github/actions/cipd-install/action.yml
vendored
Normal file
40
.github/actions/cipd-install/action.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: 'CIPD install'
|
||||
description: 'Installs the specified CIPD package'
|
||||
inputs:
|
||||
cipd-root-prefix-path:
|
||||
description: 'Path to prepend to installation directory'
|
||||
default: ''
|
||||
dependency:
|
||||
description: 'Name of dependency to install'
|
||||
deps-file:
|
||||
description: 'Location of DEPS file that defines the dependency'
|
||||
installation-dir:
|
||||
description: 'Location to install dependency'
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
package:
|
||||
description: 'Package to install'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Delete wrong ${{ inputs.dependency }}
|
||||
shell: bash
|
||||
run : |
|
||||
rm -rf ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }}
|
||||
- name: Create ensure file for ${{ inputs.dependency }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo '${{ inputs.package }}' `e d gclient getdep --deps-file=${{ inputs.deps-file }} -r '${{ inputs.installation-dir }}:${{ inputs.package }}'` > ${{ inputs.dependency }}_ensure_file
|
||||
cat ${{ inputs.dependency }}_ensure_file
|
||||
- name: CIPD installation of ${{ inputs.dependency }} (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "ensuring ${{ inputs.dependency }} on macOS"
|
||||
e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
|
||||
- name: CIPD installation of ${{ inputs.dependency }} (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
echo "ensuring ${{ inputs.dependency }} on Windows"
|
||||
e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
|
||||
61
.github/actions/fix-sync-macos/action.yml
vendored
61
.github/actions/fix-sync-macos/action.yml
vendored
@@ -1,61 +0,0 @@
|
||||
name: 'Fix Sync macOS'
|
||||
description: 'Checks out Electron and stores it in the AKS Cache'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Fix Sync
|
||||
shell: bash
|
||||
# This step is required to correct for differences between "gclient sync"
|
||||
# on Linux and the expected state on macOS. This requires:
|
||||
# 1. Fixing Clang Install (wrong binary)
|
||||
# 2. Fixing esbuild (wrong binary)
|
||||
# 3. Fixing rustc (wrong binary)
|
||||
# 4. Fixing gn (wrong binary)
|
||||
# 5. Fix reclient (wrong binary)
|
||||
# 6. Fixing dsymutil (wrong binary)
|
||||
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
||||
# 8. Fixing angle (wrong remote)
|
||||
run : |
|
||||
SEDOPTION="-i ''"
|
||||
rm -rf src/third_party/llvm-build
|
||||
python3 src/tools/clang/scripts/update.py
|
||||
|
||||
echo 'infra/3pp/tools/esbuild/${platform}' `gclient getdep --deps-file=src/third_party/devtools-frontend/src/DEPS -r 'third_party/esbuild:infra/3pp/tools/esbuild/${platform}'` > esbuild_ensure_file
|
||||
# Remove extra output from calling gclient getdep which always calls update_depot_tools
|
||||
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
|
||||
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
|
||||
|
||||
rm -rf src/third_party/rust-toolchain
|
||||
python3 src/tools/rust/update_rust.py
|
||||
|
||||
# Prevent calling gclient getdep which always calls update_depot_tools
|
||||
echo 'gn/gn/mac-${arch}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/mac:gn/gn/mac-${arch}'` > gn_ensure_file
|
||||
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
||||
cipd ensure --root src/buildtools/mac -ensure-file gn_ensure_file
|
||||
|
||||
# Prevent calling gclient getdep which always calls update_depot_tools
|
||||
echo 'infra/rbe/client/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/reclient:infra/rbe/client/${platform}'` > gn_ensure_file
|
||||
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
||||
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
|
||||
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
||||
|
||||
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
||||
else
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
||||
fi
|
||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
||||
|
||||
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
|
||||
sed $SEDOPTION "s/Updating depot_tools... //g" ninja_ensure_file
|
||||
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
|
||||
|
||||
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
||||
|
||||
cd src/third_party/angle
|
||||
rm -f .git/objects/info/alternates
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
cp .git/config .git/config.backup
|
||||
git remote remove origin
|
||||
mv .git/config.backup .git/config
|
||||
git fetch
|
||||
120
.github/actions/fix-sync/action.yml
vendored
Normal file
120
.github/actions/fix-sync/action.yml
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
name: 'Fix Sync'
|
||||
description: 'Ensures proper binaries are in place'
|
||||
# This action is required to correct for differences between "gclient sync"
|
||||
# on Linux and the expected state on macOS/windows. This requires:
|
||||
# 1. Fixing Clang Install (wrong binary)
|
||||
# 2. Fixing esbuild (wrong binary)
|
||||
# 3. Fixing rustc (wrong binary)
|
||||
# 4. Fixing gn (wrong binary)
|
||||
# 5. Fix reclient (wrong binary)
|
||||
# 6. Fixing dsymutil (wrong binary)
|
||||
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
||||
# 8. Fixing angle (wrong remote)
|
||||
# 9. Install windows toolchain on Windows
|
||||
# 10. Fix node binary on Windows
|
||||
# 11. Fix rc binary on Windows
|
||||
inputs:
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Fix clang
|
||||
shell: bash
|
||||
run : |
|
||||
rm -rf src/third_party/llvm-build
|
||||
python3 src/tools/clang/scripts/update.py
|
||||
- name: Fix esbuild
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
cipd-root-prefix-path: src/third_party/devtools-frontend/src/
|
||||
dependency: esbuild
|
||||
deps-file: src/third_party/devtools-frontend/src/DEPS
|
||||
installation-dir: third_party/esbuild
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: infra/3pp/tools/esbuild/${platform}
|
||||
- name: Fix rustc
|
||||
shell: bash
|
||||
run : |
|
||||
rm -rf src/third_party/rust-toolchain
|
||||
python3 src/tools/rust/update_rust.py
|
||||
- name: Fix gn (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: gn
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/buildtools/mac
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: gn/gn/mac-${arch}
|
||||
- name: Fix gn (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: gn
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/buildtools/win
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: gn/gn/windows-amd64
|
||||
- name: Fix reclient
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: reclient
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/buildtools/reclient
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: infra/rbe/client/${platform}
|
||||
- name: Configure reclient configs
|
||||
shell: bash
|
||||
run : |
|
||||
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
||||
- name: Fix dsymutil (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
run : |
|
||||
# Fix dsymutil
|
||||
if [ "${{ inputs.target-platform }}" = "macos" ]; then
|
||||
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
||||
else
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
||||
fi
|
||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
||||
fi
|
||||
- name: Fix ninja
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: ninja
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/third_party/ninja
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: infra/3pp/tools/ninja/${platform}
|
||||
- name: Set ninja in path
|
||||
shell: bash
|
||||
run : |
|
||||
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
||||
- name: Fixup angle git
|
||||
shell: bash
|
||||
run : |
|
||||
cd src/third_party/angle
|
||||
rm -f .git/objects/info/alternates
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
cp .git/config .git/config.backup
|
||||
git remote remove origin
|
||||
mv .git/config.backup .git/config
|
||||
git fetch
|
||||
- name: Get Windows toolchain
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: e d vpython3 src\build\vs_toolchain.py update --force
|
||||
- name: Download nodejs
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
$nodedeps = e d gclient getdep --deps-file=src/DEPS -r src/third_party/node/win | ConvertFrom-JSON
|
||||
python3 src\third_party\depot_tools\download_from_google_storage.py --no_resume --no_auth --bucket chromium-nodejs -o src\third_party\node\win\node.exe $nodedeps.object_name
|
||||
- name: Install rc
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: bash
|
||||
run: |
|
||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1
|
||||
@@ -14,7 +14,9 @@ runs:
|
||||
export BUILD_TOOLS_SHA=8246e57791b0af4ae5975eb96f09855f9269b1cd
|
||||
npm i -g @electron/build-tools
|
||||
e auto-update disable
|
||||
e d auto-update disable
|
||||
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||
e d cipd.bat --version
|
||||
cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
|
||||
fi
|
||||
echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH
|
||||
|
||||
@@ -7,7 +7,7 @@ runs:
|
||||
shell: bash
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "dir=$(node src/electron/script/yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
|
||||
10
.github/actions/restore-cache-aks/action.yml
vendored
10
.github/actions/restore-cache-aks/action.yml
vendored
@@ -1,12 +1,20 @@
|
||||
name: 'Restore Cache AKS'
|
||||
description: 'Restores Electron src cache via AKS'
|
||||
inputs:
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Restore and Ensure Src Cache
|
||||
shell: bash
|
||||
run: |
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
cache_path=/mnt/win-cache/$DEPSHASH.tar
|
||||
else
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
fi
|
||||
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking for cache in: $cache_path"
|
||||
if [ ! -f "$cache_path" ]; then
|
||||
|
||||
75
.github/actions/restore-cache-azcopy/action.yml
vendored
75
.github/actions/restore-cache-azcopy/action.yml
vendored
@@ -1,22 +1,25 @@
|
||||
name: 'Restore Cache AZCopy'
|
||||
description: 'Restores Electron src cache via AZCopy'
|
||||
inputs:
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Obtain SAS Key
|
||||
continue-on-error: true
|
||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||
with:
|
||||
path: |
|
||||
sas-token
|
||||
key: sas-key-${{ github.run_number }}-1
|
||||
path: sas-token
|
||||
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-1
|
||||
enableCrossOsArchive: true
|
||||
- name: Obtain SAS Key
|
||||
continue-on-error: true
|
||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||
with:
|
||||
path: |
|
||||
sas-token
|
||||
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
path: sas-token
|
||||
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Download Src Cache from AKS
|
||||
# The cache will always exist here as a result of the checkout job
|
||||
# Either it was uploaded to Azure in the checkout job for this commit
|
||||
@@ -26,21 +29,30 @@ runs:
|
||||
timeout_minutes: 30
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
shell: bash
|
||||
command: |
|
||||
sas_token=$(cat sas-token)
|
||||
if [ -z $sas-token ]; then
|
||||
echo "SAS Token not found; exiting src cache download early..."
|
||||
exit 1
|
||||
else
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
azcopy copy --log-level=ERROR \
|
||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_WIN_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||
else
|
||||
azcopy copy --log-level=ERROR \
|
||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||
fi
|
||||
fi
|
||||
azcopy copy --log-level=ERROR \
|
||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||
env:
|
||||
AZURE_AKS_CACHE_STORAGE_ACCOUNT: f723719aa87a34622b5f7f3
|
||||
AZURE_AKS_CACHE_SHARE_NAME: pvc-f6a4089f-b082-4bee-a3f9-c3e1c0c02d8f
|
||||
AZURE_AKS_WIN_CACHE_SHARE_NAME: pvc-71dec4f2-0d44-4fd1-a2c3-add049d70bdf
|
||||
- name: Clean SAS Key
|
||||
shell: bash
|
||||
run: rm -f sas-token
|
||||
- name: Unzip and Ensure Src Cache
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Downloaded cache is $(du -sh $DEPSHASH.tar | cut -f1)"
|
||||
@@ -68,4 +80,45 @@ runs:
|
||||
fi
|
||||
|
||||
echo "Wiping Electron Directory"
|
||||
rm -rf src/electron
|
||||
rm -rf src/electron
|
||||
|
||||
- name: Unzip and Ensure Src Cache (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
$src_cache = "$env:DEPSHASH.tar"
|
||||
$cache_size = $(Get-Item $src_cache).length
|
||||
Write-Host "Downloaded cache is $cache_size"
|
||||
if ($cache_size -eq 0) {
|
||||
Write-Host "Cache is empty - exiting"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$TEMP_DIR=New-Item -ItemType Directory -Path temp-cache
|
||||
$TEMP_DIR_PATH = $TEMP_DIR.FullName
|
||||
C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH"
|
||||
|
||||
- name: Move Src Cache (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
|
||||
with:
|
||||
timeout_minutes: 30
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
shell: powershell
|
||||
command: |
|
||||
if (Test-Path "temp-cache\src") {
|
||||
Write-Host "Relocating Cache"
|
||||
Remove-Item -Recurse -Force src
|
||||
Move-Item temp-cache\src src
|
||||
|
||||
Write-Host "Deleting zip file"
|
||||
Remove-Item -Force $src_cache
|
||||
}
|
||||
if (-Not (Test-Path "src\third_party\blink")) {
|
||||
Write-Host "Cache was not correctly restored - exiting"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Wiping Electron Directory"
|
||||
Remove-Item -Recurse -Force src\electron
|
||||
|
||||
26
.github/actions/set-chromium-cookie/action.yml
vendored
Normal file
26
.github/actions/set-chromium-cookie/action.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: 'Set Chromium Git Cookie'
|
||||
description: 'Sets an authenticated cookie from Chromium to allow for a higher request limit'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set the git cookie from chromium.googlesource.com (Unix)
|
||||
if: ${{ runner.os != 'Windows' && env.CHROMIUM_GIT_COOKIE }}
|
||||
shell: bash
|
||||
run: |
|
||||
eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null
|
||||
touch ~/.gitcookies
|
||||
chmod 0600 ~/.gitcookies
|
||||
|
||||
git config --global http.cookiefile ~/.gitcookies
|
||||
|
||||
tr , \\t <<\__END__ >>~/.gitcookies
|
||||
${{ env.CHROMIUM_GIT_COOKIE }}
|
||||
__END__
|
||||
eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null
|
||||
- name: Set the git cookie from chromium.googlesource.com (Windows)
|
||||
if: ${{ runner.os == 'Windows' && env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
shell: cmd
|
||||
run: |
|
||||
git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
|
||||
powershell -noprofile -nologo -command Write-Output "${{ env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}" >>"%USERPROFILE%\.gitcookies"
|
||||
|
||||
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@@ -100,6 +100,7 @@ jobs:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
outputs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
|
||||
@@ -114,6 +115,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: macos
|
||||
|
||||
checkout-linux:
|
||||
needs: setup
|
||||
@@ -126,6 +128,7 @@ jobs:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
PATCH_UP_APP_CREDS: ${{ secrets.PATCH_UP_APP_CREDS }}
|
||||
outputs:
|
||||
@@ -148,8 +151,11 @@ jobs:
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /mnt/win-cache:/mnt/win-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||
TARGET_OS: 'win'
|
||||
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||
@@ -164,6 +170,9 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: win
|
||||
|
||||
# GN Check Jobs
|
||||
macos-gn-check:
|
||||
@@ -194,7 +203,7 @@ jobs:
|
||||
target-platform: win
|
||||
target-archs: x64 x86 arm64
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
check-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/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
check-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"]}'
|
||||
gn-build-type: testing
|
||||
secrets: inherit
|
||||
|
||||
@@ -322,7 +331,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
needs: checkout-windows
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
@@ -341,7 +350,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
needs: checkout-windows
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
@@ -360,7 +369,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
needs: checkout-windows
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
|
||||
12
.github/workflows/clean-src-cache.yml
vendored
12
.github/workflows/clean-src-cache.yml
vendored
@@ -1,8 +1,12 @@
|
||||
name: Clean Source Cache
|
||||
|
||||
description: |
|
||||
This workflow cleans up the source cache on the cross-instance cache volume
|
||||
to free up space. It runs daily at midnight and clears files older than 15 days.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * SUN" # Run at midnight every Sunday
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
clean-src-cache:
|
||||
@@ -12,10 +16,14 @@ jobs:
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /mnt/win-cache:/mnt/win-cache
|
||||
steps:
|
||||
- name: Cleanup Source Cache
|
||||
shell: bash
|
||||
run: |
|
||||
df -h /mnt/cross-instance-cache
|
||||
find /mnt/cross-instance-cache -type f -mtime +30 -delete
|
||||
find /mnt/cross-instance-cache -type f -mtime +15 -delete
|
||||
df -h /mnt/cross-instance-cache
|
||||
df -h /mnt/win-cache
|
||||
find /mnt/win-cache -type f -mtime +15 -delete
|
||||
df -h /mnt/win-cache
|
||||
|
||||
1
.github/workflows/macos-publish.yml
vendored
1
.github/workflows/macos-publish.yml
vendored
@@ -39,6 +39,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: macos
|
||||
|
||||
publish-x64-darwin:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||
|
||||
5
.github/workflows/pipeline-electron-lint.yml
vendored
5
.github/workflows/pipeline-electron-lint.yml
vendored
@@ -12,6 +12,9 @@ concurrency:
|
||||
group: electron-lint-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
@@ -27,6 +30,8 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Setup third_party Depot Tools
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -65,6 +65,8 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||
@@ -125,24 +127,10 @@ jobs:
|
||||
GN_EXTRA_ARGS='is_asan=true'
|
||||
fi
|
||||
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
|
||||
SEDOPTION="-i"
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
SEDOPTION="-i ''"
|
||||
fi
|
||||
|
||||
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
||||
sed $SEDOPTION '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Generate DEPS Hash
|
||||
run: |
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
@@ -150,24 +138,26 @@ jobs:
|
||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||
- name: Restore src cache via AZCopy
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
if: ${{ inputs.target-platform != 'linux' }}
|
||||
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' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
- name: Checkout src via gclient sync
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
use-cache: 'false'
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Fix Sync
|
||||
if: ${{ inputs.target-platform != 'linux' }}
|
||||
uses: ./src/electron/.github/actions/fix-sync
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
env:
|
||||
ELECTRON_DEPOT_TOOLS_DISABLE_LOG: true
|
||||
- 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 }}
|
||||
@@ -180,9 +170,6 @@ jobs:
|
||||
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||
- name: Fix Sync (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/fix-sync-macos
|
||||
- name: Setup Number of Ninja Processes
|
||||
run: |
|
||||
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
|
||||
|
||||
@@ -65,7 +65,9 @@ jobs:
|
||||
sudo rm -rf $TMPDIR/del-target
|
||||
- name: Check disk space after freeing up space
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: df -h
|
||||
run: df -h
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Enable windows toolchain
|
||||
@@ -81,9 +83,13 @@ jobs:
|
||||
- name: Restore src cache via AZCopy
|
||||
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' || inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
- name: Run Electron Only Hooks
|
||||
run: |
|
||||
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||
|
||||
@@ -36,6 +36,8 @@ permissions:
|
||||
pull-requests: read
|
||||
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
ELECTRON_OUT_DIR: Default
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
|
||||
@@ -121,6 +123,8 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
|
||||
@@ -31,6 +31,7 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
ELECTRON_OUT_DIR: Default
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
|
||||
@@ -38,7 +39,7 @@ jobs:
|
||||
node-tests:
|
||||
name: Run Node.js Tests
|
||||
runs-on: electron-arc-linux-amd64-8core
|
||||
timeout-minutes: 20
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
BUILD_TYPE: linux
|
||||
@@ -50,6 +51,8 @@ jobs:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
@@ -57,15 +60,6 @@ jobs:
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
with:
|
||||
@@ -99,7 +93,7 @@ jobs:
|
||||
nan-tests:
|
||||
name: Run Nan Tests
|
||||
runs-on: electron-arc-linux-amd64-4core
|
||||
timeout-minutes: 20
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
BUILD_TYPE: linux
|
||||
@@ -111,6 +105,8 @@ jobs:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
@@ -118,15 +114,6 @@ jobs:
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
with:
|
||||
|
||||
78
.github/workflows/update_appveyor_image.yml
vendored
78
.github/workflows/update_appveyor_image.yml
vendored
@@ -1,78 +0,0 @@
|
||||
name: Update AppVeyor Image
|
||||
|
||||
# Run chron daily Mon-Fri
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
bake-appveyor-image:
|
||||
name: Bake AppVeyor Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||
with:
|
||||
node-version: 20.11.x
|
||||
- name: Yarn install
|
||||
run: |
|
||||
node script/yarn.js install --frozen-lockfile
|
||||
- name: Set Repo for Commit
|
||||
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
- name: Check AppVeyor Image
|
||||
env:
|
||||
APPVEYOR_TOKEN: ${{ secrets.APPVEYOR_TOKEN }}
|
||||
run: |
|
||||
node ./script/prepare-appveyor
|
||||
if [ -f ./image_version.txt ]; then
|
||||
echo "APPVEYOR_IMAGE_VERSION="$(cat image_version.txt)"" >> $GITHUB_ENV
|
||||
rm image_version.txt
|
||||
fi
|
||||
- name: (Optionally) Update Appveyor Image
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 # v4.44.3
|
||||
with:
|
||||
cmd: |
|
||||
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
||||
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor-woa.yml" > "appveyor-woa2.yml"
|
||||
- name: (Optionally) Generate Commit Diff
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
run: |
|
||||
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
|
||||
patch -f appveyor.yml < appveyor.diff
|
||||
rm appveyor2.yml appveyor.diff
|
||||
git add appveyor.yml
|
||||
- name: (Optionally) Generate Commit Diff for WOA
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
run: |
|
||||
diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
|
||||
patch -f appveyor-woa.yml < appveyor-woa.diff
|
||||
rm appveyor-woa2.yml appveyor-woa.diff
|
||||
git add appveyor-woa.yml
|
||||
- name: (Optionally) Commit to Branch
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
|
||||
with:
|
||||
message: 'build: update appveyor image to latest version'
|
||||
ref: bump-appveyor-image
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: (Optionally) Create Pull Request
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
run: |
|
||||
printf "This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.\n\nNotes: none" | gh pr create --head bump-appveyor-image --label no-backport --label semver/none --title 'build: update appveyor image to latest version' --body-file=-
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
6
.github/workflows/windows-publish.yml
vendored
6
.github/workflows/windows-publish.yml
vendored
@@ -25,7 +25,8 @@ jobs:
|
||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /mnt/win-cache:/mnt/win-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||
TARGET_OS: 'win'
|
||||
@@ -40,6 +41,9 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: win
|
||||
|
||||
publish-x64-win:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||
|
||||
2
BUILD.gn
2
BUILD.gn
@@ -1231,7 +1231,7 @@ if (is_mac) {
|
||||
"//components/crash/core/app:run_as_crashpad_handler",
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
ldflags = [ "/DELAYLOAD:ffmpeg.dll" ]
|
||||
|
||||
libs = [
|
||||
"comctl32.lib",
|
||||
|
||||
4
DEPS
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'132.0.6834.194',
|
||||
'132.0.6834.210',
|
||||
'node_version':
|
||||
'v20.18.1',
|
||||
'v20.18.3',
|
||||
'nan_version':
|
||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -313,6 +313,12 @@ Set the default value of the `verbatim` parameter in the Node.js [`dns.lookup()`
|
||||
|
||||
The default is `verbatim` and `dns.setDefaultResultOrder()` have higher priority than `--dns-result-order`.
|
||||
|
||||
### `--diagnostic-dir=directory`
|
||||
|
||||
Set the directory to which all Node.js diagnostic output files are written. Defaults to current working directory.
|
||||
|
||||
Affects the default output directory of [v8.setHeapSnapshotNearHeapLimit](https://nodejs.org/docs/latest/api/v8.html#v8setheapsnapshotnearheaplimitlimit).
|
||||
|
||||
[app]: app.md
|
||||
[append-switch]: command-line.md#commandlineappendswitchswitch-value
|
||||
[debugging-main-process]: ../tutorial/debugging-main-process.md
|
||||
|
||||
@@ -5,7 +5,16 @@
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
|
||||
Each navigation entry corresponds to a specific page. The indexing system follows a sequential order, where the first available navigation entry is at index 0, representing the earliest visited page, and the latest navigation entry is at index N, representing the most recent page. Maintaining this ordered list of navigation entries enables seamless navigation both backward and forward through the user's browsing history.
|
||||
Each [NavigationEntry](./structures/navigation-entry.md) corresponds to a specific visited page.
|
||||
The indexing system follows a sequential order, where the entry for the earliest visited
|
||||
page is at index 0 and the entry for the most recent visited page is at index N.
|
||||
|
||||
Some APIs in this class also accept an _offset_, which is an integer representing the relative
|
||||
position of an index from the current entry according to the above indexing system (i.e. an offset
|
||||
value of `1` would represent going forward in history by one page).
|
||||
|
||||
Maintaining this ordered list of navigation entries enables seamless navigation both backward and
|
||||
forward through the user's browsing history.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
@@ -21,7 +30,7 @@ Returns `boolean` - Whether the browser can go forward to next web page.
|
||||
|
||||
* `offset` Integer
|
||||
|
||||
Returns `boolean` - Whether the web page can go to the specified `offset` from the current entry.
|
||||
Returns `boolean` - Whether the web page can go to the specified relative `offset` from the current entry.
|
||||
|
||||
#### `navigationHistory.clear()`
|
||||
|
||||
@@ -57,7 +66,7 @@ Navigates browser to the specified absolute web page index.
|
||||
|
||||
* `offset` Integer
|
||||
|
||||
Navigates to the specified offset from the current entry.
|
||||
Navigates to the specified relative offset from the current entry.
|
||||
|
||||
#### `navigationHistory.length()`
|
||||
|
||||
@@ -74,3 +83,22 @@ Returns `boolean` - Whether the navigation entry was removed from the webContent
|
||||
#### `navigationHistory.getAllEntries()`
|
||||
|
||||
Returns [`NavigationEntry[]`](structures/navigation-entry.md) - WebContents complete history.
|
||||
|
||||
#### `navigationHistory.restore(options)`
|
||||
|
||||
Restores navigation history and loads the given entry in the in stack. Will make a best effort
|
||||
to restore not just the navigation stack but also the state of the individual pages - for instance
|
||||
including HTML form values or the scroll position. It's recommended to call this API before any
|
||||
navigation entries are created, so ideally before you call `loadURL()` or `loadFile()` on the
|
||||
`webContents` object.
|
||||
|
||||
This API allows you to create common flows that aim to restore, recreate, or clone other webContents.
|
||||
|
||||
* `options` Object
|
||||
* `entries` [NavigationEntry[]](structures/navigation-entry.md) - Result of a prior `getAllEntries()` call
|
||||
* `index` Integer (optional) - Index of the stack that should be loaded. If you set it to `0`, the webContents will load the first (oldest) entry. If you leave it undefined, Electron will automatically load the last (newest) entry.
|
||||
|
||||
Returns `Promise<void>` - the promise will resolve when the page has finished loading the selected navigation entry
|
||||
(see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects
|
||||
if the page fails to load (see
|
||||
[`did-fail-load`](web-contents.md#event-did-fail-load)). A noop rejection handler is already attached, which avoids unhandled rejection errors.
|
||||
|
||||
@@ -26,7 +26,10 @@ Emitted when system changes to battery power.
|
||||
|
||||
### Event: 'thermal-state-change' _macOS_
|
||||
|
||||
* `state` string - The system's new thermal state. Can be `unknown`, `nominal`, `fair`, `serious`, `critical`.
|
||||
Returns:
|
||||
|
||||
* `details` Event\<\>
|
||||
* `state` string - The system's new thermal state. Can be `unknown`, `nominal`, `fair`, `serious`, `critical`.
|
||||
|
||||
Emitted when the thermal state of the system changes. Notification of a change
|
||||
in the thermal status of the system, such as entering a critical temperature
|
||||
@@ -42,7 +45,8 @@ See https://developer.apple.com/library/archive/documentation/Performance/Concep
|
||||
|
||||
### Event: 'speed-limit-change' _macOS_ _Windows_
|
||||
|
||||
* `limit` number - The operating system's advertised speed limit for CPUs, in percent.
|
||||
* `details` Event\<\>
|
||||
* `limit` number - The operating system's advertised speed limit for CPUs, in percent.
|
||||
|
||||
Notification of a change in the operating system's advertised speed limit for
|
||||
CPUs, in percent. Values below 100 indicate that the system is impairing
|
||||
|
||||
@@ -46,4 +46,7 @@ See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-regi
|
||||
### `pushNotifications.unregisterForAPNSNotifications()` _macOS_
|
||||
|
||||
Unregisters the app from notifications received from APNS.
|
||||
|
||||
Apps unregistered through this method can always reregister.
|
||||
|
||||
See: https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
|
||||
|
||||
@@ -97,9 +97,10 @@
|
||||
* `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels. Default is system height.
|
||||
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
|
||||
Set a custom position for the traffic light buttons in frameless windows.
|
||||
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
|
||||
should have rounded corners on macOS. Default is `true`. Setting this property
|
||||
to `false` will prevent the window from being fullscreenable.
|
||||
* `roundedCorners` boolean (optional) _macOS_ _Windows_ - Whether frameless window
|
||||
should have rounded corners. Default is `true`. Setting this property
|
||||
to `false` will prevent the window from being fullscreenable on macOS.
|
||||
On Windows versions older than Windows 11 Build 22000 this property has no effect, and frameless windows will not have rounded corners.
|
||||
* `thickFrame` boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
|
||||
Windows, which adds standard window frame. Setting it to `false` will remove
|
||||
window shadow and window animations. Default is `true`.
|
||||
|
||||
@@ -2,3 +2,6 @@
|
||||
|
||||
* `url` string
|
||||
* `title` string
|
||||
* `pageState` string (optional) - A base64 encoded data string containing Chromium page state
|
||||
including information like the current scroll position or form values. It is committed by
|
||||
Chromium before a navigation event and on a regular interval.
|
||||
|
||||
@@ -69,8 +69,25 @@ if (navigationHistory.canGoToOffset(2)) {
|
||||
}
|
||||
```
|
||||
|
||||
## Restoring history
|
||||
|
||||
A common flow is that you want to restore the history of a webContents - for instance to implement an "undo close tab" feature. To do so, you can call `navigationHistory.restore({ index, entries })`. This will restore the webContent's navigation history and the webContents location in said history, meaning that `goBack()` and `goForward()` navigate you through the stack as expected.
|
||||
|
||||
```js @ts-type={navigationHistory:Electron.NavigationHistory}
|
||||
|
||||
const firstWindow = new BrowserWindow()
|
||||
|
||||
// Later, you want a second window to have the same history and navigation position
|
||||
async function restore () {
|
||||
const entries = firstWindow.webContents.navigationHistory.getAllEntries()
|
||||
const index = firstWindow.webContents.navigationHistory.getActiveIndex()
|
||||
|
||||
const secondWindow = new BrowserWindow()
|
||||
await secondWindow.webContents.navigationHistory.restore({ index, entries })
|
||||
}
|
||||
```
|
||||
|
||||
Here's a full example that you can open with Electron Fiddle:
|
||||
|
||||
```fiddle docs/fiddles/features/navigation-history
|
||||
|
||||
```
|
||||
|
||||
@@ -456,8 +456,6 @@ filenames = {
|
||||
"shell/browser/net/system_network_context_manager.h",
|
||||
"shell/browser/net/url_loader_network_observer.cc",
|
||||
"shell/browser/net/url_loader_network_observer.h",
|
||||
"shell/browser/net/url_pipe_loader.cc",
|
||||
"shell/browser/net/url_pipe_loader.h",
|
||||
"shell/browser/net/web_request_api_interface.h",
|
||||
"shell/browser/network_hints_handler_impl.cc",
|
||||
"shell/browser/network_hints_handler_impl.h",
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as deprecate from '@electron/internal/common/deprecate';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
import { app, ipcMain, session, webFrameMain, dialog } from 'electron/main';
|
||||
import type { BrowserWindowConstructorOptions, MessageBoxOptions } from 'electron/main';
|
||||
import type { BrowserWindowConstructorOptions, MessageBoxOptions, NavigationEntry } from 'electron/main';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
@@ -343,8 +343,8 @@ WebContents.prototype.loadFile = function (filePath, options = {}) {
|
||||
|
||||
type LoadError = { errorCode: number, errorDescription: string, url: string };
|
||||
|
||||
WebContents.prototype.loadURL = function (url, options) {
|
||||
const p = new Promise<void>((resolve, reject) => {
|
||||
function _awaitNextLoad (this: Electron.WebContents, navigationUrl: string) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const resolveAndCleanup = () => {
|
||||
removeListeners();
|
||||
resolve();
|
||||
@@ -402,7 +402,7 @@ WebContents.prototype.loadURL = function (url, options) {
|
||||
// the only one is with a bad scheme, perhaps ERR_INVALID_ARGUMENT
|
||||
// would be more appropriate.
|
||||
if (!error) {
|
||||
error = { errorCode: -2, errorDescription: 'ERR_FAILED', url };
|
||||
error = { errorCode: -2, errorDescription: 'ERR_FAILED', url: navigationUrl };
|
||||
}
|
||||
finishListener();
|
||||
};
|
||||
@@ -426,6 +426,10 @@ WebContents.prototype.loadURL = function (url, options) {
|
||||
this.on('did-stop-loading', stopLoadingListener);
|
||||
this.on('destroyed', stopLoadingListener);
|
||||
});
|
||||
};
|
||||
|
||||
WebContents.prototype.loadURL = function (url, options) {
|
||||
const p = _awaitNextLoad.call(this, url);
|
||||
// Add a no-op rejection handler to silence the unhandled rejection error.
|
||||
p.catch(() => {});
|
||||
this._loadURL(url, options ?? {});
|
||||
@@ -609,7 +613,27 @@ WebContents.prototype._init = function () {
|
||||
length: this._historyLength.bind(this),
|
||||
getEntryAtIndex: this._getNavigationEntryAtIndex.bind(this),
|
||||
removeEntryAtIndex: this._removeNavigationEntryAtIndex.bind(this),
|
||||
getAllEntries: this._getHistory.bind(this)
|
||||
getAllEntries: this._getHistory.bind(this),
|
||||
restore: ({ index, entries }: { index?: number, entries: NavigationEntry[] }) => {
|
||||
if (index === undefined) {
|
||||
index = entries.length - 1;
|
||||
}
|
||||
|
||||
if (index < 0 || !entries[index]) {
|
||||
throw new Error('Invalid index. Index must be a positive integer and within the bounds of the entries length.');
|
||||
}
|
||||
|
||||
const p = _awaitNextLoad.call(this, entries[index].url);
|
||||
p.catch(() => {});
|
||||
|
||||
try {
|
||||
this._restoreHistory(index, entries);
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
},
|
||||
writable: false,
|
||||
enumerable: true
|
||||
|
||||
@@ -84,7 +84,6 @@ feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
|
||||
disable_freezing_flags_after_init_in_node.patch
|
||||
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
|
||||
chore_add_electron_deps_to_gitignores.patch
|
||||
chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
|
||||
add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
|
||||
add_electron_deps_to_license_credits_file.patch
|
||||
fix_crash_loading_non-standard_schemes_in_iframes.patch
|
||||
@@ -141,3 +140,14 @@ ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch
|
||||
feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch
|
||||
feat_separate_content_settings_callback_for_sync_and_async_clipboard.patch
|
||||
cherry-pick-dd8e2822e507.patch
|
||||
fix_osr_stutter_in_both_cpu_and_gpu_capture_when_page_has_animation.patch
|
||||
reland_lzma_sdk_update_to_24_09.patch
|
||||
fix_drag_and_drop_icons_on_windows.patch
|
||||
cherry-pick-521faebc8a7c.patch
|
||||
cherry-pick-9dacf5694dfd.patch
|
||||
revert_blink_fix_over_invalidation_with_view_transitions.patch
|
||||
add_a_flag_to_enable_strict_js_compliance_in_audioworklet.patch
|
||||
remove_denormalenabler_from_scriptprocessornode.patch
|
||||
allow_denormal_flushing_to_outlive_scoped_object.patch
|
||||
fix_take_snapped_status_into_account_when_showing_a_window.patch
|
||||
chore_modify_chromium_handling_of_mouse_events.patch
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Wilson <mjwilson@chromium.org>
|
||||
Date: Thu, 12 Dec 2024 08:45:53 -0800
|
||||
Subject: Add a flag to enable strict JS compliance in AudioWorklet
|
||||
|
||||
AudioWorklet and ScriptProcessorNode are not strictly JavaScript spec
|
||||
compliant because we disable denormal numbers for performance reasons.
|
||||
|
||||
This CL adds a flag to allow experimenting with enabling denormal
|
||||
numbers in AudioWorklet and ScriptProcessorNode, so that we can
|
||||
quantify the actual performance impact.
|
||||
|
||||
The flag can also be used as a server-side switch.
|
||||
|
||||
Bug: 382005099
|
||||
Change-Id: Ib41253cc42dd2f16c262036817cf3db4697f986f
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6077677
|
||||
Reviewed-by: Kentaro Hara <haraken@chromium.org>
|
||||
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
|
||||
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
|
||||
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1395444}
|
||||
|
||||
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
|
||||
index e7224e03e80f8351556b3d2d43650dad7e29edef..1b2b6128e69953be7f9f96853d76c5c0e16552fe 100644
|
||||
--- a/third_party/blink/common/features.cc
|
||||
+++ b/third_party/blink/common/features.cc
|
||||
@@ -2754,6 +2754,12 @@ BASE_FEATURE(kWebAppManifestLockScreen,
|
||||
"WebAppManifestLockScreen",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
+// Allow denormals in AudioWorklet and ScriptProcessorNode, to enable strict
|
||||
+// JavaScript denormal compliance. See https://crbug.com/382005099.
|
||||
+BASE_FEATURE(kWebAudioAllowDenormalInProcessing,
|
||||
+ "WebAudioAllowDenormalInProcessing",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
// Parameters can be used to control to which latency hints the feature is
|
||||
// applied.
|
||||
BASE_FEATURE_PARAM(bool,
|
||||
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h
|
||||
index e8f79c39e03f5777c1accd4446c97f18fb3e34de..0bc9302cd8f3f291949be328aba5df88e2ab0d03 100644
|
||||
--- a/third_party/blink/public/common/features.h
|
||||
+++ b/third_party/blink/public/common/features.h
|
||||
@@ -1791,6 +1791,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppEnableScopeExtensions);
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppEnableUrlHandlers);
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppManifestLockScreen);
|
||||
|
||||
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAudioAllowDenormalInProcessing);
|
||||
// Parameters are used to control to which latency hints the feature is applied
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
|
||||
bool,
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.cc
|
||||
index 0382f578a4f98cbac422d5f927c73a6b922c01b8..9a662e7730d3e01dcf8e69f66c4eafa9dd7dd031 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.cc
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "third_party/blink/renderer/modules/webaudio/cross_thread_audio_worklet_processor_info.h"
|
||||
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
|
||||
#include "third_party/blink/renderer/platform/audio/audio_utilities.h"
|
||||
+#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/exception_messages.h"
|
||||
#include "third_party/blink/renderer/platform/heap/persistent.h"
|
||||
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
|
||||
@@ -52,7 +53,9 @@ AudioWorkletHandler::AudioWorkletHandler(
|
||||
const AudioWorkletNodeOptions* options)
|
||||
: AudioHandler(kNodeTypeAudioWorklet, node, sample_rate),
|
||||
name_(name),
|
||||
- param_handler_map_(param_handler_map) {
|
||||
+ param_handler_map_(param_handler_map),
|
||||
+ allow_denormal_in_processing_(base::FeatureList::IsEnabled(
|
||||
+ features::kWebAudioAllowDenormalInProcessing)) {
|
||||
DCHECK(IsMainThread());
|
||||
|
||||
for (const auto& param_name : param_handler_map_.Keys()) {
|
||||
@@ -112,7 +115,7 @@ scoped_refptr<AudioWorkletHandler> AudioWorkletHandler::Create(
|
||||
param_handler_map, options));
|
||||
}
|
||||
|
||||
-void AudioWorkletHandler::Process(uint32_t frames_to_process) {
|
||||
+void AudioWorkletHandler::ProcessInternal(uint32_t frames_to_process) {
|
||||
DCHECK(Context()->IsAudioThread());
|
||||
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("webaudio.audionode"),
|
||||
@@ -175,6 +178,15 @@ void AudioWorkletHandler::Process(uint32_t frames_to_process) {
|
||||
}
|
||||
}
|
||||
|
||||
+void AudioWorkletHandler::Process(uint32_t frames_to_process) {
|
||||
+ if (allow_denormal_in_processing_) {
|
||||
+ DenormalEnabler denormal_enabler;
|
||||
+ ProcessInternal(frames_to_process);
|
||||
+ } else {
|
||||
+ ProcessInternal(frames_to_process);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void AudioWorkletHandler::CheckNumberOfChannelsForInput(AudioNodeInput* input) {
|
||||
DCHECK(Context()->IsAudioThread());
|
||||
Context()->AssertGraphOwner();
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.h b/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.h
|
||||
index e6291f5e9e25433281646965f048a7f2abfc8c01..3ec80cd49a87a76ac03df105b37f1ae17437a328 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.h
|
||||
@@ -68,6 +68,10 @@ class AudioWorkletHandler final : public AudioHandler {
|
||||
HashMap<String, scoped_refptr<AudioParamHandler>> param_handler_map,
|
||||
const AudioWorkletNodeOptions*);
|
||||
|
||||
+ // Used to avoid code duplication when using scoped objects that affect
|
||||
+ // `Process`.
|
||||
+ void ProcessInternal(uint32_t frames_to_process);
|
||||
+
|
||||
String name_;
|
||||
|
||||
double tail_time_ = std::numeric_limits<double>::infinity();
|
||||
@@ -102,6 +106,9 @@ class AudioWorkletHandler final : public AudioHandler {
|
||||
// when a processor stops invoking the user-defined `process()` callback.
|
||||
bool is_processor_active_ = true;
|
||||
|
||||
+ // Cached feature flag value
|
||||
+ const bool allow_denormal_in_processing_;
|
||||
+
|
||||
base::WeakPtrFactory<AudioWorkletHandler> weak_ptr_factory_{this};
|
||||
};
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc b/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
||||
index d3d44d2a4c87bf5d4191807ec31d87c7e597fef9..ea04e2cd2bfb553a58ba6fb9c63c70c5a2690442 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/realtime_audio_destination_node.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/script_processor_node.h"
|
||||
+#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
|
||||
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
|
||||
@@ -48,7 +49,9 @@ ScriptProcessorHandler::ScriptProcessorHandler(
|
||||
internal_input_bus_(AudioBus::Create(
|
||||
number_of_input_channels,
|
||||
node.context()->GetDeferredTaskHandler().RenderQuantumFrames(),
|
||||
- false)) {
|
||||
+ false)),
|
||||
+ allow_denormal_in_processing_(base::FeatureList::IsEnabled(
|
||||
+ features::kWebAudioAllowDenormalInProcessing)) {
|
||||
DCHECK_GE(buffer_size_,
|
||||
node.context()->GetDeferredTaskHandler().RenderQuantumFrames());
|
||||
DCHECK_LE(number_of_input_channels, BaseAudioContext::MaxNumberOfChannels());
|
||||
@@ -109,7 +112,7 @@ void ScriptProcessorHandler::Initialize() {
|
||||
AudioHandler::Initialize();
|
||||
}
|
||||
|
||||
-void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
||||
+void ScriptProcessorHandler::ProcessInternal(uint32_t frames_to_process) {
|
||||
TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("webaudio.audionode"),
|
||||
"ScriptProcessorHandler::Process");
|
||||
|
||||
@@ -238,6 +241,15 @@ void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
||||
"ScriptProcessorHandler::Process");
|
||||
}
|
||||
|
||||
+void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
||||
+ if (allow_denormal_in_processing_) {
|
||||
+ DenormalEnabler denormal_enabler;
|
||||
+ ProcessInternal(frames_to_process);
|
||||
+ } else {
|
||||
+ ProcessInternal(frames_to_process);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void ScriptProcessorHandler::FireProcessEvent(uint32_t double_buffer_index) {
|
||||
DCHECK(IsMainThread());
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_handler.h b/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
||||
index 82ac7cebaefb515a04442e7a24896177d66fcb01..99103e947ade50f07a16a61bc8702d6097266296 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
||||
@@ -65,6 +65,11 @@ class ScriptProcessorHandler final : public AudioHandler {
|
||||
uint32_t number_of_output_channels,
|
||||
const HeapVector<Member<AudioBuffer>>& input_buffers,
|
||||
const HeapVector<Member<AudioBuffer>>& output_buffers);
|
||||
+
|
||||
+ // Used to avoid code duplication when using scoped objects that affect
|
||||
+ // `Process`.
|
||||
+ void ProcessInternal(uint32_t frames_to_process);
|
||||
+
|
||||
double TailTime() const override;
|
||||
double LatencyTime() const override;
|
||||
bool RequiresTailProcessing() const final;
|
||||
@@ -92,6 +97,9 @@ class ScriptProcessorHandler final : public AudioHandler {
|
||||
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
||||
|
||||
+ // Cached feature flag value
|
||||
+ const bool allow_denormal_in_processing_;
|
||||
+
|
||||
base::WeakPtrFactory<ScriptProcessorHandler> weak_ptr_factory_{this};
|
||||
|
||||
FRIEND_TEST_ALL_PREFIXES(ScriptProcessorNodeTest, BufferLifetime);
|
||||
diff --git a/third_party/blink/renderer/platform/audio/denormal_disabler.h b/third_party/blink/renderer/platform/audio/denormal_disabler.h
|
||||
index e8fadf60eea81b017dc29b39c2d1cfe8c102999b..ac1cdfa026aa1f845a892e96200fd9de46a45c92 100644
|
||||
--- a/third_party/blink/renderer/platform/audio/denormal_disabler.h
|
||||
+++ b/third_party/blink/renderer/platform/audio/denormal_disabler.h
|
||||
@@ -52,28 +52,28 @@ namespace blink {
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DENORMAL)
|
||||
-class DenormalDisabler {
|
||||
- DISALLOW_NEW();
|
||||
-
|
||||
+class DenormalModifier {
|
||||
public:
|
||||
- DenormalDisabler() { DisableDenormals(); }
|
||||
-
|
||||
- ~DenormalDisabler() { RestoreState(); }
|
||||
-
|
||||
- // This is a nop if we can flush denormals to zero in hardware.
|
||||
- static inline float FlushDenormalFloatToZero(float f) { return f; }
|
||||
+ virtual ~DenormalModifier() = default;
|
||||
|
||||
private:
|
||||
unsigned saved_csr_ = 0;
|
||||
|
||||
#if defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
|
||||
+ protected:
|
||||
inline void DisableDenormals() {
|
||||
saved_csr_ = GetCSR();
|
||||
SetCSR(saved_csr_ | 0x8040);
|
||||
}
|
||||
|
||||
+ inline void EnableDenormals() {
|
||||
+ saved_csr_ = GetCSR();
|
||||
+ SetCSR(saved_csr_ & (~0x8040));
|
||||
+ }
|
||||
+
|
||||
inline void RestoreState() { SetCSR(saved_csr_); }
|
||||
|
||||
+ private:
|
||||
inline int GetCSR() {
|
||||
int result;
|
||||
asm volatile("stmxcsr %0" : "=m"(result));
|
||||
@@ -86,6 +86,7 @@ class DenormalDisabler {
|
||||
}
|
||||
|
||||
#elif BUILDFLAG(IS_WIN) && defined(COMPILER_MSVC)
|
||||
+ protected:
|
||||
inline void DisableDenormals() {
|
||||
// Save the current state, and set mode to flush denormals.
|
||||
//
|
||||
@@ -95,11 +96,18 @@ class DenormalDisabler {
|
||||
_controlfp_s(&unused, _DN_FLUSH, _MCW_DN);
|
||||
}
|
||||
|
||||
+ inline void EnableDenormals() {
|
||||
+ _controlfp_s(&saved_csr_, 0, 0);
|
||||
+ unsigned unused;
|
||||
+ _controlfp_s(&unused, _DN_SAVE, _MCW_DN);
|
||||
+ }
|
||||
+
|
||||
inline void RestoreState() {
|
||||
unsigned unused;
|
||||
_controlfp_s(&unused, saved_csr_, _MCW_DN);
|
||||
}
|
||||
#elif defined(ARCH_CPU_ARM_FAMILY)
|
||||
+ protected:
|
||||
inline void DisableDenormals() {
|
||||
saved_csr_ = GetStatusWord();
|
||||
// Bit 24 is the flush-to-zero mode control bit. Setting it to 1 flushes
|
||||
@@ -107,8 +115,14 @@ class DenormalDisabler {
|
||||
SetStatusWord(saved_csr_ | (1 << 24));
|
||||
}
|
||||
|
||||
+ inline void EnableDenormals() {
|
||||
+ saved_csr_ = GetStatusWord();
|
||||
+ SetStatusWord(saved_csr_ & (~(1 << 24)));
|
||||
+ }
|
||||
+
|
||||
inline void RestoreState() { SetStatusWord(saved_csr_); }
|
||||
|
||||
+ private:
|
||||
inline int GetStatusWord() {
|
||||
int result;
|
||||
#if defined(ARCH_CPU_ARM64)
|
||||
@@ -130,13 +144,33 @@ class DenormalDisabler {
|
||||
#endif
|
||||
};
|
||||
|
||||
+class DenormalDisabler final : public DenormalModifier {
|
||||
+ DISALLOW_NEW();
|
||||
+
|
||||
+ public:
|
||||
+ DenormalDisabler() { DisableDenormals(); }
|
||||
+ ~DenormalDisabler() final { RestoreState(); }
|
||||
+
|
||||
+ // This is a nop if we can flush denormals to zero in hardware.
|
||||
+ static inline float FlushDenormalFloatToZero(float f) { return f; }
|
||||
+};
|
||||
+
|
||||
+class DenormalEnabler final : public DenormalModifier {
|
||||
+ DISALLOW_NEW();
|
||||
+
|
||||
+ public:
|
||||
+ DenormalEnabler() { EnableDenormals(); }
|
||||
+ ~DenormalEnabler() final { RestoreState(); }
|
||||
+};
|
||||
+
|
||||
#else
|
||||
// FIXME: add implementations for other architectures and compilers
|
||||
class DenormalDisabler {
|
||||
STACK_ALLOCATED();
|
||||
|
||||
public:
|
||||
- DenormalDisabler() {}
|
||||
+ DenormalDisabler() = default;
|
||||
+ ~DenormalDisabler() = default;
|
||||
|
||||
// Assume the worst case that other architectures and compilers
|
||||
// need to flush denormals to zero manually.
|
||||
@@ -145,6 +179,14 @@ class DenormalDisabler {
|
||||
}
|
||||
};
|
||||
|
||||
+class DenormalEnabler {
|
||||
+ STACK_ALLOCATED();
|
||||
+
|
||||
+ public:
|
||||
+ DenormalEnabler() = default;
|
||||
+ ~DenormalEnabler() = default;
|
||||
+};
|
||||
+
|
||||
#endif
|
||||
|
||||
} // namespace blink
|
||||
@@ -0,0 +1,293 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Wilson <mjwilson@chromium.org>
|
||||
Date: Fri, 7 Feb 2025 13:33:40 -0800
|
||||
Subject: Allow denormal flushing to outlive scoped object
|
||||
|
||||
After this refactor we can disable or enable denormals for longer than
|
||||
a scoped object.
|
||||
|
||||
Use this new functionality in audio_worklet_global_scope.cc.
|
||||
|
||||
(cherry picked from commit 93c4f6fb0a0f10562ef9a637449605caae9200e6)
|
||||
|
||||
Bug: 382005099
|
||||
Change-Id: I54f4810a4ec035f639d50275e14dae03b726b876
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226252
|
||||
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
|
||||
Reviewed-by: Kentaro Hara <haraken@chromium.org>
|
||||
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
|
||||
Cr-Original-Commit-Position: refs/heads/main@{#1415886}
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6242822
|
||||
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
|
||||
Cr-Commit-Position: refs/branch-heads/6998@{#221}
|
||||
Cr-Branched-From: de9c6fafd8ae5c6ea0438764076ca7d04a0b165d-refs/heads/main@{#1415337}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc
|
||||
index c9bd1e8934d7058cb4c8044aa5618033ec975cec..09de112b96b6062f702d57e6181dd39e681e99a1 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "third_party/blink/renderer/modules/webaudio/audio_worklet_processor.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/cross_thread_audio_worklet_processor_info.h"
|
||||
+#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/callback_method_retriever.h"
|
||||
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
|
||||
@@ -34,6 +35,9 @@ AudioWorkletGlobalScope::AudioWorkletGlobalScope(
|
||||
: WorkletGlobalScope(std::move(creation_params),
|
||||
thread->GetWorkerReportingProxy(),
|
||||
thread) {
|
||||
+ // Disable denormals for performance.
|
||||
+ DenormalModifier::DisableDenormals();
|
||||
+
|
||||
// Audio is prone to jank introduced by e.g. the garbage collector. Workers
|
||||
// are generally put in a background mode (as they are non-visible). Audio is
|
||||
// an exception here, requiring low-latency behavior similar to any visible
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
index ffb2cc23eb74da99ca5875293879659b4f171303..01366aa7b5b4438f9d62de4065623a1ede71cc41 100644
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -2142,6 +2142,7 @@ source_set("blink_platform_unittests_sources") {
|
||||
"animation/timing_function_test.cc",
|
||||
"audio/audio_destination_test.cc",
|
||||
"audio/audio_frame_stats_accumulator_test.cc",
|
||||
+ "audio/denormal_disabler_test.cc",
|
||||
"audio/push_pull_fifo_multithread_test.cc",
|
||||
"audio/push_pull_fifo_test.cc",
|
||||
"audio/vector_math_test.cc",
|
||||
diff --git a/third_party/blink/renderer/platform/audio/denormal_disabler.h b/third_party/blink/renderer/platform/audio/denormal_disabler.h
|
||||
index ac1cdfa026aa1f845a892e96200fd9de46a45c92..a50d7b884e8fdc65f4c1fbe6b5cab7a7801a3b62 100644
|
||||
--- a/third_party/blink/renderer/platform/audio/denormal_disabler.h
|
||||
+++ b/third_party/blink/renderer/platform/audio/denormal_disabler.h
|
||||
@@ -56,74 +56,65 @@ class DenormalModifier {
|
||||
public:
|
||||
virtual ~DenormalModifier() = default;
|
||||
|
||||
- private:
|
||||
- unsigned saved_csr_ = 0;
|
||||
-
|
||||
#if defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
|
||||
- protected:
|
||||
- inline void DisableDenormals() {
|
||||
- saved_csr_ = GetCSR();
|
||||
- SetCSR(saved_csr_ | 0x8040);
|
||||
+ public:
|
||||
+ static void DisableDenormals() {
|
||||
+ unsigned old_csr = GetCsr();
|
||||
+ SetCsr(old_csr | 0x8040);
|
||||
}
|
||||
|
||||
- inline void EnableDenormals() {
|
||||
- saved_csr_ = GetCSR();
|
||||
- SetCSR(saved_csr_ & (~0x8040));
|
||||
+ static void EnableDenormals() {
|
||||
+ unsigned old_csr = GetCsr();
|
||||
+ SetCsr(old_csr & (~0x8040));
|
||||
}
|
||||
|
||||
- inline void RestoreState() { SetCSR(saved_csr_); }
|
||||
-
|
||||
- private:
|
||||
- inline int GetCSR() {
|
||||
+ protected:
|
||||
+ static inline unsigned GetCsr() {
|
||||
int result;
|
||||
asm volatile("stmxcsr %0" : "=m"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
- inline void SetCSR(int a) {
|
||||
+ static inline void SetCsr(int a) {
|
||||
int temp = a;
|
||||
asm volatile("ldmxcsr %0" : : "m"(temp));
|
||||
}
|
||||
|
||||
#elif BUILDFLAG(IS_WIN) && defined(COMPILER_MSVC)
|
||||
+ public:
|
||||
+ static void DisableDenormals() { SetCsr(_DN_FLUSH); }
|
||||
+
|
||||
+ static void EnableDenormals() { SetCsr(_DN_SAVE); }
|
||||
+
|
||||
protected:
|
||||
- inline void DisableDenormals() {
|
||||
- // Save the current state, and set mode to flush denormals.
|
||||
- //
|
||||
- // http://stackoverflow.com/questions/637175/possible-bug-in-controlfp-s-may-not-restore-control-word-correctly
|
||||
- _controlfp_s(&saved_csr_, 0, 0);
|
||||
- unsigned unused;
|
||||
- _controlfp_s(&unused, _DN_FLUSH, _MCW_DN);
|
||||
+ static inline unsigned GetCsr() {
|
||||
+ unsigned result;
|
||||
+ _controlfp_s(&result, 0, 0);
|
||||
+ return result;
|
||||
}
|
||||
|
||||
- inline void EnableDenormals() {
|
||||
- _controlfp_s(&saved_csr_, 0, 0);
|
||||
+ static inline void SetCsr(unsigned a) {
|
||||
+ // http://stackoverflow.com/questions/637175/possible-bug-in-controlfp-s-may-not-restore-control-word-correctly
|
||||
unsigned unused;
|
||||
- _controlfp_s(&unused, _DN_SAVE, _MCW_DN);
|
||||
+ _controlfp_s(&unused, a, _MCW_DN);
|
||||
}
|
||||
|
||||
- inline void RestoreState() {
|
||||
- unsigned unused;
|
||||
- _controlfp_s(&unused, saved_csr_, _MCW_DN);
|
||||
- }
|
||||
#elif defined(ARCH_CPU_ARM_FAMILY)
|
||||
- protected:
|
||||
- inline void DisableDenormals() {
|
||||
- saved_csr_ = GetStatusWord();
|
||||
+ public:
|
||||
+ static void DisableDenormals() {
|
||||
+ unsigned old_csr = GetCsr();
|
||||
// Bit 24 is the flush-to-zero mode control bit. Setting it to 1 flushes
|
||||
// denormals to 0.
|
||||
- SetStatusWord(saved_csr_ | (1 << 24));
|
||||
+ SetCsr(old_csr | (1 << 24));
|
||||
}
|
||||
|
||||
- inline void EnableDenormals() {
|
||||
- saved_csr_ = GetStatusWord();
|
||||
- SetStatusWord(saved_csr_ & (~(1 << 24)));
|
||||
+ static void EnableDenormals() {
|
||||
+ unsigned old_csr = GetCsr();
|
||||
+ SetCsr(old_csr & (~(1 << 24)));
|
||||
}
|
||||
|
||||
- inline void RestoreState() { SetStatusWord(saved_csr_); }
|
||||
-
|
||||
- private:
|
||||
- inline int GetStatusWord() {
|
||||
+ protected:
|
||||
+ static inline unsigned GetCsr() {
|
||||
int result;
|
||||
#if defined(ARCH_CPU_ARM64)
|
||||
asm volatile("mrs %x[result], FPCR" : [result] "=r"(result));
|
||||
@@ -133,7 +124,7 @@ class DenormalModifier {
|
||||
return result;
|
||||
}
|
||||
|
||||
- inline void SetStatusWord(int a) {
|
||||
+ static inline void SetCsr(int a) {
|
||||
#if defined(ARCH_CPU_ARM64)
|
||||
asm volatile("msr FPCR, %x[src]" : : [src] "r"(a));
|
||||
#else
|
||||
@@ -148,24 +139,44 @@ class DenormalDisabler final : public DenormalModifier {
|
||||
DISALLOW_NEW();
|
||||
|
||||
public:
|
||||
- DenormalDisabler() { DisableDenormals(); }
|
||||
- ~DenormalDisabler() final { RestoreState(); }
|
||||
+ DenormalDisabler() {
|
||||
+ // Save the current state, and set mode to flush denormals.
|
||||
+ saved_csr_ = GetCsr();
|
||||
+ DisableDenormals();
|
||||
+ }
|
||||
+ ~DenormalDisabler() final { SetCsr(saved_csr_); }
|
||||
|
||||
// This is a nop if we can flush denormals to zero in hardware.
|
||||
static inline float FlushDenormalFloatToZero(float f) { return f; }
|
||||
+
|
||||
+ private:
|
||||
+ unsigned saved_csr_ = 0;
|
||||
};
|
||||
|
||||
class DenormalEnabler final : public DenormalModifier {
|
||||
DISALLOW_NEW();
|
||||
|
||||
public:
|
||||
- DenormalEnabler() { EnableDenormals(); }
|
||||
- ~DenormalEnabler() final { RestoreState(); }
|
||||
+ DenormalEnabler() {
|
||||
+ saved_csr_ = GetCsr();
|
||||
+ EnableDenormals();
|
||||
+ }
|
||||
+ ~DenormalEnabler() final { SetCsr(saved_csr_); }
|
||||
+
|
||||
+ private:
|
||||
+ unsigned saved_csr_ = 0;
|
||||
};
|
||||
|
||||
#else
|
||||
// FIXME: add implementations for other architectures and compilers
|
||||
-class DenormalDisabler {
|
||||
+class DenormalModifier final {
|
||||
+ public:
|
||||
+ virtual ~DenormalModifier() = default;
|
||||
+ static void DisableDenormals() {}
|
||||
+ static void EnableDenormals() {}
|
||||
+};
|
||||
+
|
||||
+class DenormalDisabler final {
|
||||
STACK_ALLOCATED();
|
||||
|
||||
public:
|
||||
@@ -179,7 +190,7 @@ class DenormalDisabler {
|
||||
}
|
||||
};
|
||||
|
||||
-class DenormalEnabler {
|
||||
+class DenormalEnabler final {
|
||||
STACK_ALLOCATED();
|
||||
|
||||
public:
|
||||
diff --git a/third_party/blink/renderer/platform/audio/denormal_disabler_test.cc b/third_party/blink/renderer/platform/audio/denormal_disabler_test.cc
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5083bbf2da9d4e0e12f1a4608d5e14e4ca910297
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/platform/audio/denormal_disabler_test.cc
|
||||
@@ -0,0 +1,51 @@
|
||||
+// Copyright 2025 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
|
||||
+
|
||||
+#include "testing/gtest/include/gtest/gtest.h"
|
||||
+
|
||||
+namespace blink {
|
||||
+
|
||||
+namespace {
|
||||
+
|
||||
+bool DenormalsAreFlushedToZero() {
|
||||
+ volatile double denorm = 2.225e-308;
|
||||
+ return !((denorm / 2.0) > 0.0);
|
||||
+}
|
||||
+
|
||||
+TEST(DenormalDisablerTest, DisableScoped) {
|
||||
+ const bool already_flushed = DenormalsAreFlushedToZero();
|
||||
+ if (!already_flushed) {
|
||||
+ DenormalDisabler scoped_disabler;
|
||||
+ EXPECT_TRUE(DenormalsAreFlushedToZero());
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+TEST(DenormalDisablerTest, EnableScoped) {
|
||||
+ const bool already_flushed = DenormalsAreFlushedToZero();
|
||||
+ if (!already_flushed) {
|
||||
+ DenormalDisabler scoped_disabler;
|
||||
+ EXPECT_TRUE(DenormalsAreFlushedToZero());
|
||||
+ {
|
||||
+ DenormalEnabler scoped_enabler;
|
||||
+ EXPECT_FALSE(DenormalsAreFlushedToZero());
|
||||
+ }
|
||||
+ EXPECT_TRUE(DenormalsAreFlushedToZero());
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+TEST(DenormalDisablerTest, ModifyUnscoped) {
|
||||
+ const bool already_flushed = DenormalsAreFlushedToZero();
|
||||
+ if (!already_flushed) {
|
||||
+ DenormalModifier::DisableDenormals();
|
||||
+ EXPECT_TRUE(DenormalsAreFlushedToZero());
|
||||
+ DenormalModifier::EnableDenormals();
|
||||
+ EXPECT_FALSE(DenormalsAreFlushedToZero());
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+} // namespace blink
|
||||
@@ -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 f58b9b0333e01f95ecf1b1d3fd3e273b675705cc..dae7654fc44e25ddc80dab4732b617f0784b47fc 100644
|
||||
index 469e49a552a2229e8686953d5b10b5d1ac974d4e..01367204ab9d872077547c2b2c33c58d9a1653b9 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9187,6 +9187,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9188,6 +9188,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 f58b9b0333e01f95ecf1b1d3fd3e273b675705cc..dae7654fc44e25ddc80dab4732b617f0
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 03b5291540931c40707fbd786645721336c72dae..67c946a84a6578eaf73f33c2ff42a55876b08404 100644
|
||||
index 62420958702cebe16423f0ea42ca200f5a93d45a..d35ae086793a52ea38da97b9236e073b806a67a6 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4893,6 +4893,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4895,6 +4895,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params,
|
||||
opener);
|
||||
|
||||
@@ -37,7 +37,7 @@ index 03b5291540931c40707fbd786645721336c72dae..67c946a84a6578eaf73f33c2ff42a558
|
||||
// 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
|
||||
@@ -4934,12 +4940,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4936,12 +4942,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
|
||||
32
patches/chromium/cherry-pick-521faebc8a7c.patch
Normal file
32
patches/chromium/cherry-pick-521faebc8a7c.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Geoff Lang <geofflang@chromium.org>
|
||||
Date: Thu, 6 Mar 2025 19:39:37 -0800
|
||||
Subject: Disable setting primtive restart for WebGL in the cmd decoder.
|
||||
|
||||
Until it's blocked in ANGLE for WebGL contexts, disable it in the
|
||||
command decoder on the service side.
|
||||
|
||||
Bug: 401059730
|
||||
Change-Id: Ia9c7d951cbd122454afec2f884968e0a709cee77
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6334632
|
||||
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
||||
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
||||
Commit-Queue: Kenneth Russell <kbr@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1429307}
|
||||
|
||||
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
index 54310b8878fa7aeca45e6001cb884a794272138c..2cb2a3b4913a54373b84cebf9326ee09a98f6bcc 100644
|
||||
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
@@ -2160,6 +2160,11 @@ bool GLES2DecoderPassthroughImpl::IsIgnoredCap(GLenum cap) const {
|
||||
case GL_DEBUG_OUTPUT:
|
||||
return true;
|
||||
|
||||
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
|
||||
+ // Disable setting primitive restart at the command decoder level until
|
||||
+ // it's blocked in ANGLE for WebGL contexts.
|
||||
+ return feature_info_->IsWebGLContext();
|
||||
+
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
94
patches/chromium/cherry-pick-9dacf5694dfd.patch
Normal file
94
patches/chromium/cherry-pick-9dacf5694dfd.patch
Normal file
@@ -0,0 +1,94 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Geoff Lang <geofflang@chromium.org>
|
||||
Date: Thu, 6 Mar 2025 16:02:41 -0800
|
||||
Subject: Move WebGL primitive restart state setting to the GPU process.
|
||||
|
||||
ANGLE will validate and initialize this state and errors are generated
|
||||
when the WebGL client also initializes it on startup.
|
||||
|
||||
Initialize it even in the passthrough command decoder temporarily so
|
||||
that ANGLE can roll without breaking WebGL tests.
|
||||
|
||||
Bug: 401059730
|
||||
Change-Id: I0bfee710673bbcea6f915ffc4fc9be20438a2654
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6330188
|
||||
Auto-Submit: Geoff Lang <geofflang@chromium.org>
|
||||
Commit-Queue: Kenneth Russell <kbr@chromium.org>
|
||||
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1429228}
|
||||
|
||||
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
||||
index 03a26a5f81dee1cd1bba28621c1ecd30ea709df8..60447a8e71e056db01515db8bc6c56048537870f 100644
|
||||
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
||||
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
||||
@@ -3285,6 +3285,13 @@ gpu::ContextResult GLES2DecoderImpl::Initialize(
|
||||
}
|
||||
}
|
||||
|
||||
+ if (feature_info_->context_type() == CONTEXT_TYPE_WEBGL2) {
|
||||
+ // If WebGL 2, the PRIMITIVE_RESTART_FIXED_INDEX should be always enabled.
|
||||
+ // See the section <Primitive Restart is Always Enabled> in WebGL 2 spec:
|
||||
+ // https://www.khronos.org/registry/webgl/specs/latest/2.0/#4.1.4
|
||||
+ DoEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
+ }
|
||||
+
|
||||
if (group_->gpu_preferences().enable_gpu_driver_debug_logging &&
|
||||
feature_info_->feature_flags().khr_debug) {
|
||||
InitializeGLDebugLogging(true, GLDebugMessageCallback, &logger_);
|
||||
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
index 2cb2a3b4913a54373b84cebf9326ee09a98f6bcc..ee9ad4fa2838a22bc8b24185267a29687129f721 100644
|
||||
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
@@ -1065,6 +1065,17 @@ gpu::ContextResult GLES2DecoderPassthroughImpl::Initialize(
|
||||
api()->glDisableFn(GL_TEXTURE_RECTANGLE_ANGLE);
|
||||
#endif
|
||||
|
||||
+ // TEMPORARY: Set primitive restart to enabled by default for WebGL2. Clear
|
||||
+ // errors afterwards so that when this state is initialized and validated in
|
||||
+ // ANGLE, it will not generate errors during command buffer initialization.
|
||||
+ if (feature_info_->context_type() == CONTEXT_TYPE_WEBGL2) {
|
||||
+ // If WebGL 2, the PRIMITIVE_RESTART_FIXED_INDEX should be always enabled.
|
||||
+ // See the section <Primitive Restart is Always Enabled> in WebGL 2 spec:
|
||||
+ // https://www.khronos.org/registry/webgl/specs/latest/2.0/#4.1.4
|
||||
+ api()->glEnableFn(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
+ CheckErrorCallbackState();
|
||||
+ }
|
||||
+
|
||||
// Register this object as a GPU switching observer.
|
||||
if (feature_info_->IsWebGLContext()) {
|
||||
ui::GpuSwitchingManager::GetInstance()->AddObserver(this);
|
||||
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
|
||||
index 1683b266f349d4b70ae2861cf4f05542380d8c44..0a0c1b3f6f9fe2caddf86602d2ae9978eff928f1 100644
|
||||
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
|
||||
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
|
||||
@@ -440,6 +440,13 @@ ContextResult GLES2DecoderTestBase::MaybeInitDecoderWithWorkarounds(
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (init.context_type == CONTEXT_TYPE_WEBGL2 &&
|
||||
+ group_->feature_info()->gl_version_info().is_es3) {
|
||||
+ EXPECT_CALL(*gl_, Enable(GL_PRIMITIVE_RESTART_FIXED_INDEX))
|
||||
+ .Times(1)
|
||||
+ .RetiresOnSaturation();
|
||||
+ }
|
||||
+
|
||||
if (context_->HasRobustness()) {
|
||||
EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
|
||||
.WillOnce(Return(init.lose_context_on_init ? GL_GUILTY_CONTEXT_RESET_ARB
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
index 6057cf83454f0deabc1904cb5e87b306bda4e788..304f4c7beb87212c70e91770d494254da7ed24bf 100644
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
@@ -1432,12 +1432,6 @@ void WebGLRenderingContextBase::InitializeNewContext() {
|
||||
->GetCapabilities()
|
||||
.mesa_framebuffer_flip_y;
|
||||
|
||||
- // If WebGL 2, the PRIMITIVE_RESTART_FIXED_INDEX should be always enabled.
|
||||
- // See the section <Primitive Restart is Always Enabled> in WebGL 2 spec:
|
||||
- // https://www.khronos.org/registry/webgl/specs/latest/2.0/#4.1.4
|
||||
- if (IsWebGL2())
|
||||
- ContextGL()->Enable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
-
|
||||
// This ensures that the context has a valid "lastFlushID" and won't be
|
||||
// mistakenly identified as the "least recently used" context.
|
||||
ContextGL()->Flush();
|
||||
@@ -1,7 +1,7 @@
|
||||
From dd8e2822e507a24e1dd16306dca768d29333ba02 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Meenan <pmeenan@chromium.org>
|
||||
Date: Thu, 06 Feb 2025 07:41:40 -0800
|
||||
Subject: [PATCH] Set is_web_secure_context when initializing Service Worker from disk
|
||||
Date: Thu, 6 Feb 2025 07:41:40 -0800
|
||||
Subject: Set is_web_secure_context when initializing Service Worker from disk
|
||||
|
||||
The value of is_web_secure_context is not serialized to disk when
|
||||
storing the service worker registration (only a few select policies
|
||||
@@ -23,14 +23,13 @@ Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
|
||||
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
|
||||
Commit-Queue: Patrick Meenan <pmeenan@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1416795}
|
||||
---
|
||||
|
||||
diff --git a/content/browser/renderer_host/policy_container_host.cc b/content/browser/renderer_host/policy_container_host.cc
|
||||
index 0b6509d..ad174110 100644
|
||||
index b17c33c425da7bc98a6669c6595a7e6185a96644..9630f39ee4570d084c877f69658534affef226d2 100644
|
||||
--- a/content/browser/renderer_host/policy_container_host.cc
|
||||
+++ b/content/browser/renderer_host/policy_container_host.cc
|
||||
@@ -143,9 +143,11 @@
|
||||
cross_origin_isolation_enabled_by_dip) {}
|
||||
@@ -135,9 +135,11 @@ PolicyContainerPolicies::PolicyContainerPolicies(
|
||||
allow_cross_origin_isolation(allow_cross_origin_isolation) {}
|
||||
|
||||
PolicyContainerPolicies::PolicyContainerPolicies(
|
||||
- const blink::mojom::PolicyContainerPolicies& policies)
|
||||
@@ -43,11 +42,11 @@ index 0b6509d..ad174110 100644
|
||||
mojo::Clone(policies.content_security_policies)),
|
||||
cross_origin_embedder_policy(policies.cross_origin_embedder_policy),
|
||||
diff --git a/content/browser/renderer_host/policy_container_host.h b/content/browser/renderer_host/policy_container_host.h
|
||||
index 51d05d8..fc0ae74 100644
|
||||
index 394bd53bb5c1dfea5abe24b9047eb190884c2648..7add42348ef28079196b447feda78210815d1551 100644
|
||||
--- a/content/browser/renderer_host/policy_container_host.h
|
||||
+++ b/content/browser/renderer_host/policy_container_host.h
|
||||
@@ -50,7 +50,8 @@
|
||||
bool cross_origin_isolation_enabled_by_dip);
|
||||
@@ -49,7 +49,8 @@ struct CONTENT_EXPORT PolicyContainerPolicies {
|
||||
bool allow_cross_origin_isolation);
|
||||
|
||||
explicit PolicyContainerPolicies(
|
||||
- const blink::mojom::PolicyContainerPolicies& policies);
|
||||
@@ -57,10 +56,10 @@ index 51d05d8..fc0ae74 100644
|
||||
// Used when loading workers from network schemes.
|
||||
// WARNING: This does not populate referrer policy.
|
||||
diff --git a/content/browser/service_worker/service_worker_registry.cc b/content/browser/service_worker/service_worker_registry.cc
|
||||
index aa1e8fb5..68b5c2b 100644
|
||||
index 8ce6875c21522032e8eb448338558c2a28f78613..efa037a599a38af655fd593767f35a601badd3a1 100644
|
||||
--- a/content/browser/service_worker/service_worker_registry.cc
|
||||
+++ b/content/browser/service_worker/service_worker_registry.cc
|
||||
@@ -1084,7 +1084,8 @@
|
||||
@@ -1076,7 +1076,8 @@ ServiceWorkerRegistry::GetOrCreateRegistration(
|
||||
if (data.policy_container_policies) {
|
||||
version->set_policy_container_host(
|
||||
base::MakeRefCounted<PolicyContainerHost>(
|
||||
@@ -68,5 +67,5 @@ index aa1e8fb5..68b5c2b 100644
|
||||
+ PolicyContainerPolicies(*data.policy_container_policies,
|
||||
+ /*is_web_secure_context=*/true)));
|
||||
}
|
||||
if (data.router_rules) {
|
||||
if (data.router_rules && version->IsStaticRouterEnabled()) {
|
||||
auto error = version->SetupRouterEvaluator(*data.router_rules);
|
||||
|
||||
@@ -1,11 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Fri, 29 Jul 2022 00:29:35 +0900
|
||||
Subject: chore: allow chromium to handle synthetic mouse events for touch
|
||||
Subject: chore: modify chromium handling of mouse events
|
||||
|
||||
With WCO, allow chromium to handle synthetic mouse events generated for touch
|
||||
This patch does the following:
|
||||
|
||||
1. When Windows Control Overlay is enabled, it allows chromium to handle synthetic mouse events generated for touch
|
||||
actions in the non-client caption area.
|
||||
2. It calls HandleMouseEvent on the delegate earlier in HandleMouseEventInternal, so that Electron can selectively disable
|
||||
draggable regions to allow events to propagate to the underlying renderer.
|
||||
|
||||
diff --git a/ui/events/event.h b/ui/events/event.h
|
||||
index 39b5a8fdd165efd74b00256552b51b5413107958..bfc4ef4f50efff4a77f2aef64335bb7e34c69f34 100644
|
||||
--- a/ui/events/event.h
|
||||
+++ b/ui/events/event.h
|
||||
@@ -587,6 +587,9 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
|
||||
const PointerDetails& pointer_details() const { return pointer_details_; }
|
||||
|
||||
+ bool is_system_menu() const { return is_system_menu_; }
|
||||
+ void set_is_system_menu(bool is_menu) { is_system_menu_ = is_menu; }
|
||||
+
|
||||
// Event:
|
||||
std::string ToString() const override;
|
||||
std::unique_ptr<Event> Clone() const override;
|
||||
@@ -619,6 +622,8 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
|
||||
// Structure for holding pointer details for implementing PointerEvents API.
|
||||
PointerDetails pointer_details_;
|
||||
+
|
||||
+ bool is_system_menu_ = false;
|
||||
};
|
||||
|
||||
class ScrollEvent;
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
index e2146f0a06fb70d16c48fe6e06d0615caf7d4619..f7d38f5d308eadc1dc27fd1dde706259b9197ad9 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
@@ -34,10 +61,10 @@ index 1e2c5bb35cc314d44dba85a9bafc5e55bf2b5f14..d110d0a2f005888c4450262fc1887cbf
|
||||
Widget* GetWidget();
|
||||
const Widget* GetWidget() const;
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 9ac53e223aa095acdf90b68bc1e6bc81e3021ab9..026b0f9b404267b17e1ea6b61b5ebb188b9b0bed 100644
|
||||
index b5d8f82255764a42df816e58bfcbd588534de2e4..8ad548a445ff7f66a7fe61e0f18d04d08668a69b 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3042,15 +3042,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
@@ -3063,15 +3063,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
SetMsgHandled(FALSE);
|
||||
// We must let Windows handle the caption buttons if it's drawing them, or
|
||||
// they won't work.
|
||||
@@ -59,6 +86,25 @@ index 9ac53e223aa095acdf90b68bc1e6bc81e3021ab9..026b0f9b404267b17e1ea6b61b5ebb18
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3099,7 +3103,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
w_param = static_cast<WPARAM>(SendMessage(
|
||||
hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)));
|
||||
if (w_param == HTCAPTION || w_param == HTSYSMENU) {
|
||||
- ShowSystemMenuAtScreenPixelLocation(hwnd(), gfx::Point(screen_point));
|
||||
+ LONG message_time = GetMessageTime();
|
||||
+ CHROME_MSG msg = {hwnd(),
|
||||
+ message,
|
||||
+ w_param,
|
||||
+ l_param,
|
||||
+ static_cast<DWORD>(message_time),
|
||||
+ {CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param)}};
|
||||
+ ui::MouseEvent event(msg);
|
||||
+ event.set_is_system_menu(true);
|
||||
+ if (!delegate_->HandleMouseEvent(&event))
|
||||
+ ShowSystemMenuAtScreenPixelLocation(hwnd(), gfx::Point(screen_point));
|
||||
return 0;
|
||||
}
|
||||
} else if (message == WM_NCLBUTTONDOWN &&
|
||||
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
index 04dea68d74ea4f559db60f716c919e555db9ec80..2f8bd1a3c156bb6c04663c74b7279bb59926fc3d 100644
|
||||
--- a/ui/views/win/hwnd_message_handler_delegate.h
|
||||
@@ -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 d1bfb30a063fb1be05cb7e3c888ed47d13935585..6c5a64fed98b7120ff2426066fbfadf5c2a6d9a0 100644
|
||||
index ce65cb2aec41faa58a1dfa43f5c1ac8e5bc66641..784a7536eec5a248e4725253c091b039047ff1ea 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4819,9 +4819,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4821,9 +4821,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
bool renderer_started_hidden =
|
||||
params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB;
|
||||
|
||||
|
||||
@@ -218,10 +218,10 @@ index c6838c83ef971b88769b1f3fba8095025ae25464..2da6a4e08340e72ba7de5d03444c2f17
|
||||
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 eecd6fee29f6fd45299e8f8790c65dc76b6cb93f..aed9541bc931ccbc1f8d80a6ce4dfe055db59da2 100644
|
||||
index d88c3b6a3625c2f4d0c67677777202f7db85ea88..71835a747d6732b963c5cdc289539665aa988c47 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4788,8 +4788,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4790,8 +4790,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
|
||||
@@ -25,7 +25,7 @@ Refs https://issues.chromium.org/issues/40210365 which is blocked
|
||||
on https://issues.chromium.org/issues/42203693
|
||||
|
||||
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
|
||||
index 2be37976a1305f1deed561b3b829dbb5d7ae85e7..44eb16f17d272125e2b4a590f8962eb8144d9755 100644
|
||||
index e5ee2c6b3cb787ff9f8272d4344a1e18c44971e2..22469cf0ab1025eefcf94e2cd351087e52182130 100644
|
||||
--- a/gin/isolate_holder.cc
|
||||
+++ b/gin/isolate_holder.cc
|
||||
@@ -34,6 +34,8 @@ v8::ArrayBuffer::Allocator* g_array_buffer_allocator = nullptr;
|
||||
@@ -37,7 +37,7 @@ index 2be37976a1305f1deed561b3b829dbb5d7ae85e7..44eb16f17d272125e2b4a590f8962eb8
|
||||
|
||||
std::unique_ptr<v8::Isolate::CreateParams> getModifiedIsolateParams(
|
||||
std::unique_ptr<v8::Isolate::CreateParams> params,
|
||||
@@ -198,10 +200,26 @@ IsolateHolder::getDefaultIsolateParams() {
|
||||
@@ -194,10 +196,26 @@ IsolateHolder::getDefaultIsolateParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ index 2be37976a1305f1deed561b3b829dbb5d7ae85e7..44eb16f17d272125e2b4a590f8962eb8
|
||||
+
|
||||
} // namespace gin
|
||||
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
|
||||
index 52b8c1af58678b9fee684ff75340c98fcc73b552..f79407d741a30298d09efd53589f16dc9b26107f 100644
|
||||
index c22b0a7f9af621573e888a518ccdc22293ce07ef..d3e5ced425df54f42534cec5cc0c5bbfb9d79c6c 100644
|
||||
--- a/gin/public/isolate_holder.h
|
||||
+++ b/gin/public/isolate_holder.h
|
||||
@@ -131,6 +131,8 @@ class GIN_EXPORT IsolateHolder {
|
||||
@@ -130,6 +130,8 @@ class GIN_EXPORT IsolateHolder {
|
||||
// Should only be called after v8::IsolateHolder::Initialize() is invoked.
|
||||
static std::unique_ptr<v8::Isolate::CreateParams> getDefaultIsolateParams();
|
||||
|
||||
@@ -77,7 +77,7 @@ index 52b8c1af58678b9fee684ff75340c98fcc73b552..f79407d741a30298d09efd53589f16dc
|
||||
v8::Isolate* isolate() { return isolate_; }
|
||||
|
||||
// This method returns if v8::Locker is needed to access isolate.
|
||||
@@ -144,6 +146,9 @@ class GIN_EXPORT IsolateHolder {
|
||||
@@ -143,6 +145,9 @@ class GIN_EXPORT IsolateHolder {
|
||||
|
||||
void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ This patch likely can't be upstreamed as-is, as Chromium doesn't have
|
||||
this use case in mind currently.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index fda18ecab7e982b3087c7667d36578177d370066..a949e73dabad71d2550e38b09dbcf45160b3a853 100644
|
||||
index 562532f5795ee833493614f3f16d35bda2654d8d..98a3365ce2b5ef4e34eb9edf66ef3f620af9ab1d 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -908,13 +908,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
|
||||
161
patches/chromium/fix_drag_and_drop_icons_on_windows.patch
Normal file
161
patches/chromium/fix_drag_and_drop_icons_on_windows.patch
Normal file
@@ -0,0 +1,161 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: David Sanders <dsanders11@ucsbalum.com>
|
||||
Date: Fri, 21 Feb 2025 00:46:48 -0800
|
||||
Subject: fix: drag and drop icons on Windows
|
||||
|
||||
This is a backport from Chromium of
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/6279834
|
||||
|
||||
Change-Id: Ic642228f3a0a073b9b45fbec68de37be6cfd3934
|
||||
|
||||
diff --git a/chrome/browser/ui/views/tabs/tab_close_button.cc b/chrome/browser/ui/views/tabs/tab_close_button.cc
|
||||
index 281d6c6fcccbf3bfc3396056e495ee8d19424f5a..ac335a68f3fd0e3931cb37c915de51e410734850 100644
|
||||
--- a/chrome/browser/ui/views/tabs/tab_close_button.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab_close_button.cc
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/base/pointer/touch_ui_controller.h"
|
||||
-#include "ui/compositor/layer.h"
|
||||
#include "ui/gfx/canvas.h"
|
||||
#include "ui/gfx/color_utils.h"
|
||||
#include "ui/gfx/geometry/insets.h"
|
||||
@@ -63,8 +62,6 @@ TabCloseButton::TabCloseButton(PressedCallback pressed_callback,
|
||||
views::InkDrop::Get(this)->GetInkDrop()->SetHoverHighlightFadeDuration(
|
||||
base::TimeDelta());
|
||||
|
||||
- image_container_view()->DestroyLayer();
|
||||
-
|
||||
// The ink drop highlight path is the same as the focus ring highlight path,
|
||||
// but needs to be explicitly mirrored for RTL.
|
||||
// TODO(http://crbug.com/1056490): Make ink drops in RTL work the same way as
|
||||
@@ -145,20 +142,6 @@ void TabCloseButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
event->SetHandled();
|
||||
}
|
||||
|
||||
-void TabCloseButton::AddLayerToRegion(ui::Layer* new_layer,
|
||||
- views::LayerRegion region) {
|
||||
- image_container_view()->SetPaintToLayer();
|
||||
- image_container_view()->layer()->SetFillsBoundsOpaquely(false);
|
||||
- ink_drop_container()->SetVisible(true);
|
||||
- ink_drop_container()->AddLayerToRegion(new_layer, region);
|
||||
-}
|
||||
-
|
||||
-void TabCloseButton::RemoveLayerFromRegions(ui::Layer* old_layer) {
|
||||
- ink_drop_container()->RemoveLayerFromRegions(old_layer);
|
||||
- ink_drop_container()->SetVisible(false);
|
||||
- image_container_view()->DestroyLayer();
|
||||
-}
|
||||
-
|
||||
gfx::Size TabCloseButton::CalculatePreferredSize(
|
||||
const views::SizeBounds& available_size) const {
|
||||
return kButtonSize;
|
||||
diff --git a/chrome/browser/ui/views/tabs/tab_close_button.h b/chrome/browser/ui/views/tabs/tab_close_button.h
|
||||
index f23bf862d987d8d6ba59aef781c51034e9a3debe..f688214ef883994d09b7a428b8af9b7f14c93af9 100644
|
||||
--- a/chrome/browser/ui/views/tabs/tab_close_button.h
|
||||
+++ b/chrome/browser/ui/views/tabs/tab_close_button.h
|
||||
@@ -46,9 +46,6 @@ class TabCloseButton : public views::LabelButton,
|
||||
void OnMouseReleased(const ui::MouseEvent& event) override;
|
||||
void OnMouseMoved(const ui::MouseEvent& event) override;
|
||||
void OnGestureEvent(ui::GestureEvent* event) override;
|
||||
- void AddLayerToRegion(ui::Layer* new_layer,
|
||||
- views::LayerRegion region) override;
|
||||
- void RemoveLayerFromRegions(ui::Layer* old_layer) override;
|
||||
|
||||
protected:
|
||||
// Set/reset the image models for the icon with new colors.
|
||||
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
|
||||
index 08c4a2164f25ca3b363c13558b04dc5c10855fb2..6d01c1077014bbc7d8bd6bf895825ce9be9a66ca 100644
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
|
||||
@@ -128,6 +128,12 @@ ToolbarButton::ToolbarButton(PressedCallback callback,
|
||||
if (model_) {
|
||||
GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kMenu);
|
||||
}
|
||||
+#if BUILDFLAG(IS_WIN)
|
||||
+ // Paint image(s) to a layer so that the canvas is snapped to pixel
|
||||
+ // boundaries.
|
||||
+ image_container_view()->SetPaintToLayer();
|
||||
+ image_container_view()->layer()->SetFillsBoundsOpaquely(false);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ToolbarButton::~ToolbarButton() = default;
|
||||
@@ -724,6 +730,24 @@ ToolbarButton::GetActionViewInterface() {
|
||||
return std::make_unique<ToolbarButtonActionViewInterface>(this);
|
||||
}
|
||||
|
||||
+void ToolbarButton::AddLayerToRegion(ui::Layer* new_layer,
|
||||
+ views::LayerRegion region) {
|
||||
+#if !BUILDFLAG(IS_WIN)
|
||||
+ image_container_view()->SetPaintToLayer();
|
||||
+ image_container_view()->layer()->SetFillsBoundsOpaquely(false);
|
||||
+#endif
|
||||
+ ink_drop_container()->SetVisible(true);
|
||||
+ ink_drop_container()->AddLayerToRegion(new_layer, region);
|
||||
+}
|
||||
+
|
||||
+void ToolbarButton::RemoveLayerFromRegions(ui::Layer* old_layer) {
|
||||
+ ink_drop_container()->RemoveLayerFromRegions(old_layer);
|
||||
+ ink_drop_container()->SetVisible(false);
|
||||
+#if !BUILDFLAG(IS_WIN)
|
||||
+ image_container_view()->DestroyLayer();
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
ToolbarButtonActionViewInterface::ToolbarButtonActionViewInterface(
|
||||
ToolbarButton* action_view)
|
||||
: views::LabelButtonActionViewInterface(action_view),
|
||||
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.h b/chrome/browser/ui/views/toolbar/toolbar_button.h
|
||||
index 9d46beda5f6811e728dad5c5e2ddf04fe52b24f5..602e966ec72fd026e0ab3c454e9f15c08ddf11c2 100644
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_button.h
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.h
|
||||
@@ -132,6 +132,9 @@ class ToolbarButton : public views::LabelButton,
|
||||
void OnGestureEvent(ui::GestureEvent* event) override;
|
||||
std::u16string GetTooltipText(const gfx::Point& p) const override;
|
||||
std::unique_ptr<views::ActionViewInterface> GetActionViewInterface() override;
|
||||
+ void AddLayerToRegion(ui::Layer* new_layer,
|
||||
+ views::LayerRegion region) override;
|
||||
+ void RemoveLayerFromRegions(ui::Layer* old_layer) override;
|
||||
|
||||
// views::ContextMenuController:
|
||||
void ShowContextMenuForViewImpl(
|
||||
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
|
||||
index f17cd72dbe014adc51301ef6e07d9a6ca94c5d67..5b675ae814e09eca55f9eea6772acc8f9a6b0a1e 100644
|
||||
--- a/ui/views/controls/button/label_button.cc
|
||||
+++ b/ui/views/controls/button/label_button.cc
|
||||
@@ -78,13 +78,6 @@ LabelButton::LabelButton(
|
||||
SetTextInternal(text);
|
||||
SetLayoutManager(std::make_unique<DelegatingLayoutManager>(this));
|
||||
GetViewAccessibility().SetIsDefault(is_default_);
|
||||
-
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- // Paint image(s) to a layer so that the canvas is snapped to pixel
|
||||
- // boundaries.
|
||||
- image_container_view()->SetPaintToLayer();
|
||||
- image_container_view()->layer()->SetFillsBoundsOpaquely(false);
|
||||
-#endif
|
||||
}
|
||||
|
||||
LabelButton::~LabelButton() {
|
||||
@@ -508,10 +501,8 @@ void LabelButton::UpdateImage() {
|
||||
|
||||
void LabelButton::AddLayerToRegion(ui::Layer* new_layer,
|
||||
views::LayerRegion region) {
|
||||
-#if !BUILDFLAG(IS_WIN)
|
||||
image_container_view()->SetPaintToLayer();
|
||||
image_container_view()->layer()->SetFillsBoundsOpaquely(false);
|
||||
-#endif
|
||||
ink_drop_container()->SetVisible(true);
|
||||
ink_drop_container()->AddLayerToRegion(new_layer, region);
|
||||
}
|
||||
@@ -519,9 +510,7 @@ void LabelButton::AddLayerToRegion(ui::Layer* new_layer,
|
||||
void LabelButton::RemoveLayerFromRegions(ui::Layer* old_layer) {
|
||||
ink_drop_container()->RemoveLayerFromRegions(old_layer);
|
||||
ink_drop_container()->SetVisible(false);
|
||||
-#if !BUILDFLAG(IS_WIN)
|
||||
image_container_view()->DestroyLayer();
|
||||
-#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<ActionViewInterface> LabelButton::GetActionViewInterface() {
|
||||
@@ -40,18 +40,18 @@ accessing uninitialized lower indexes can return garbage values that cannot be n
|
||||
Refer to v8::EmbedderDataSlot::store_aligned_pointer for context.
|
||||
|
||||
diff --git a/gin/public/gin_embedders.h b/gin/public/gin_embedders.h
|
||||
index 8d7c5631fd8f1499c67384286f0e3c4037673b32..99b2e2f63be8a46c5546dd53bc9b05e8c54e857c 100644
|
||||
index 8d7c5631fd8f1499c67384286f0e3c4037673b32..2b7bdfbac06a42e6bc51eb65e023c3673e6eb885 100644
|
||||
--- a/gin/public/gin_embedders.h
|
||||
+++ b/gin/public/gin_embedders.h
|
||||
@@ -18,6 +18,8 @@ namespace gin {
|
||||
enum GinEmbedder : uint16_t {
|
||||
kEmbedderNativeGin,
|
||||
@@ -20,6 +20,8 @@ enum GinEmbedder : uint16_t {
|
||||
kEmbedderBlink,
|
||||
+ kEmbedderElectron,
|
||||
+ kEmbedderBlinkTag,
|
||||
kEmbedderPDFium,
|
||||
kEmbedderFuchsia,
|
||||
+ kEmbedderElectron,
|
||||
+ kEmbedderBlinkTag,
|
||||
};
|
||||
|
||||
} // namespace gin
|
||||
diff --git a/third_party/blink/renderer/platform/bindings/script_state.cc b/third_party/blink/renderer/platform/bindings/script_state.cc
|
||||
index e4a27a24c83dd1a478b2ada8b6c8220076790791..c76dc818f38a62fff63852dbecbc85e304ac731d 100644
|
||||
--- a/third_party/blink/renderer/platform/bindings/script_state.cc
|
||||
@@ -86,7 +86,7 @@ index e4a27a24c83dd1a478b2ada8b6c8220076790791..c76dc818f38a62fff63852dbecbc85e3
|
||||
|
||||
// Cut the reference from ScriptState to V8 context.
|
||||
diff --git a/third_party/blink/renderer/platform/bindings/script_state.h b/third_party/blink/renderer/platform/bindings/script_state.h
|
||||
index b3cc8d819b06108386aed9465cab4f27a28b675f..a1757901e52360a9c2ec3c573adb20d03cd6ecae 100644
|
||||
index b3cc8d819b06108386aed9465cab4f27a28b675f..9c8818f10de59fdd2a3fd44d9cd23d40a93b53a7 100644
|
||||
--- a/third_party/blink/renderer/platform/bindings/script_state.h
|
||||
+++ b/third_party/blink/renderer/platform/bindings/script_state.h
|
||||
@@ -185,7 +185,12 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected<ScriptState> {
|
||||
@@ -112,14 +112,13 @@ index b3cc8d819b06108386aed9465cab4f27a28b675f..a1757901e52360a9c2ec3c573adb20d0
|
||||
static constexpr int kV8ContextPerContextDataIndex =
|
||||
static_cast<int>(gin::kPerContextDataStartIndex) +
|
||||
static_cast<int>(gin::kEmbedderBlink);
|
||||
@@ -271,6 +278,11 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected<ScriptState> {
|
||||
@@ -271,6 +278,10 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected<ScriptState> {
|
||||
// internals.idl.
|
||||
String last_compiled_script_file_name_;
|
||||
bool last_compiled_script_used_code_cache_ = false;
|
||||
+
|
||||
+ static constexpr int kV8ContextPerContextDataTagIndex =
|
||||
+ static_cast<int>(gin::kPerContextDataStartIndex) +
|
||||
+ static_cast<int>(gin::kEmbedderBlink) +
|
||||
+ static_cast<int>(gin::kEmbedderBlinkTag);
|
||||
};
|
||||
|
||||
|
||||
@@ -87,10 +87,10 @@ index 51522e60d6dc14f1113cc438558b6b393c3fe73a..153ed02f493a83ef9ca354cc18736f93
|
||||
// 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 53e3bc48242f07bd984308583b1f999360f4e9d2..d1bfb30a063fb1be05cb7e3c888ed47d13935585 100644
|
||||
index ec55a5a2807bb9fc328b33d18ee10444f4b98126..ce65cb2aec41faa58a1dfa43f5c1ac8e5bc66641 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9395,7 +9395,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -9397,7 +9397,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: reito <cnschwarzer@qq.com>
|
||||
Date: Wed, 12 Feb 2025 20:42:02 +0800
|
||||
Subject: fix: osr stutter in both cpu and gpu capture when page has animation.
|
||||
|
||||
https://crrev.org/c/6232721
|
||||
https://crbug.com/391118566
|
||||
There's bug in VideoCaptureOracle that cause stutter in both cpu and gpu capture when page has animation.
|
||||
The upstream has a fix, which will be available in Chromium M135.
|
||||
Backport this fix for Electron versions before that.
|
||||
|
||||
diff --git a/media/capture/content/video_capture_oracle.cc b/media/capture/content/video_capture_oracle.cc
|
||||
index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d7b454630 100644
|
||||
--- a/media/capture/content/video_capture_oracle.cc
|
||||
+++ b/media/capture/content/video_capture_oracle.cc
|
||||
@@ -118,8 +118,9 @@ void VideoCaptureOracle::SetCaptureSizeConstraints(
|
||||
void VideoCaptureOracle::SetAutoThrottlingEnabled(bool enabled) {
|
||||
const bool was_enabled =
|
||||
(capture_size_throttling_mode_ != kThrottlingDisabled);
|
||||
- if (was_enabled == enabled)
|
||||
+ if (was_enabled == enabled) {
|
||||
return;
|
||||
+ }
|
||||
capture_size_throttling_mode_ =
|
||||
enabled ? kThrottlingEnabled : kThrottlingDisabled;
|
||||
VLOG(1) << "Capture size auto-throttling is now "
|
||||
@@ -127,19 +128,22 @@ void VideoCaptureOracle::SetAutoThrottlingEnabled(bool enabled) {
|
||||
|
||||
// When not auto-throttling, have the CaptureResolutionChooser target the max
|
||||
// resolution within constraints.
|
||||
- if (!enabled)
|
||||
+ if (!enabled) {
|
||||
resolution_chooser_.SetTargetFrameArea(std::numeric_limits<int>::max());
|
||||
+ }
|
||||
|
||||
- if (next_frame_number_ > 0)
|
||||
+ if (next_frame_number_ > 0) {
|
||||
CommitCaptureSizeAndReset(GetFrameTimestamp(next_frame_number_ - 1));
|
||||
+ }
|
||||
}
|
||||
|
||||
void VideoCaptureOracle::SetSourceSize(const gfx::Size& source_size) {
|
||||
resolution_chooser_.SetSourceSize(source_size);
|
||||
// If the |resolution_chooser_| computed a new capture size, that will become
|
||||
// visible via a future call to ObserveEventAndDecideCapture().
|
||||
- source_size_change_time_ = (next_frame_number_ == 0) ?
|
||||
- base::TimeTicks() : GetFrameTimestamp(next_frame_number_ - 1);
|
||||
+ source_size_change_time_ = (next_frame_number_ == 0)
|
||||
+ ? base::TimeTicks()
|
||||
+ : GetFrameTimestamp(next_frame_number_ - 1);
|
||||
}
|
||||
|
||||
bool VideoCaptureOracle::ObserveEventAndDecideCapture(
|
||||
@@ -172,6 +176,15 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture(
|
||||
if (should_sample) {
|
||||
event_time = content_sampler_.frame_timestamp();
|
||||
duration_of_next_frame_ = content_sampler_.sampling_period();
|
||||
+ } else {
|
||||
+ // https://crbug.com/391118566
|
||||
+ // The content sampler may not sample the frame, if the
|
||||
+ // `detected_region_` does not match the `damage_rect`. In this case,
|
||||
+ // the capture may halt up to kNonAnimatingThreshold (250ms) and cause
|
||||
+ // the video stutter, until it recovers and do another animation
|
||||
+ // detection. To avoid this, we should use the smoothing sampler as a
|
||||
+ // fallback to prevent the bad output.
|
||||
+ should_sample = smoothing_sampler_.ShouldSample();
|
||||
}
|
||||
last_time_animation_was_detected_ = event_time;
|
||||
} else {
|
||||
@@ -198,8 +211,9 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture(
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
- if (!should_sample)
|
||||
+ if (!should_sample) {
|
||||
return false;
|
||||
+ }
|
||||
|
||||
// If the exact duration of the next frame has not been determined, estimate
|
||||
// it using the difference between the current and last frame.
|
||||
@@ -373,16 +387,18 @@ void VideoCaptureOracle::RecordConsumerFeedback(
|
||||
|
||||
// resource_utilization feedback.
|
||||
|
||||
- if (capture_size_throttling_mode_ == kThrottlingDisabled)
|
||||
+ if (capture_size_throttling_mode_ == kThrottlingDisabled) {
|
||||
return;
|
||||
+ }
|
||||
|
||||
if (!std::isfinite(feedback.resource_utilization)) {
|
||||
LOG(DFATAL) << "Non-finite utilization provided by consumer for frame #"
|
||||
<< frame_number << ": " << feedback.resource_utilization;
|
||||
return;
|
||||
}
|
||||
- if (feedback.resource_utilization <= 0.0)
|
||||
+ if (feedback.resource_utilization <= 0.0) {
|
||||
return; // Non-positive values are normal, meaning N/A.
|
||||
+ }
|
||||
|
||||
if (capture_size_throttling_mode_ != kThrottlingActive) {
|
||||
VLOG(1) << "Received consumer feedback at frame #" << frame_number
|
||||
@@ -553,12 +569,14 @@ int VideoCaptureOracle::AnalyzeForIncreasedArea(base::TimeTicks analyze_time) {
|
||||
const int current_area = capture_size_.GetArea();
|
||||
const int increased_area =
|
||||
resolution_chooser_.FindLargerFrameSize(current_area, 1).GetArea();
|
||||
- if (increased_area <= current_area)
|
||||
+ if (increased_area <= current_area) {
|
||||
return -1;
|
||||
+ }
|
||||
|
||||
// Determine whether the buffer pool could handle an increase in area.
|
||||
- if (!HasSufficientRecentFeedback(buffer_pool_utilization_, analyze_time))
|
||||
+ if (!HasSufficientRecentFeedback(buffer_pool_utilization_, analyze_time)) {
|
||||
return -1;
|
||||
+ }
|
||||
if (buffer_pool_utilization_.current() > 0.0) {
|
||||
const int buffer_capable_area = base::saturated_cast<int>(
|
||||
current_area / buffer_pool_utilization_.current());
|
||||
@@ -593,8 +611,9 @@ int VideoCaptureOracle::AnalyzeForIncreasedArea(base::TimeTicks analyze_time) {
|
||||
|
||||
// At this point, the system is currently under-utilized. Reset the start
|
||||
// time if the system was not under-utilized when the last analysis was made.
|
||||
- if (start_time_of_underutilization_.is_null())
|
||||
+ if (start_time_of_underutilization_.is_null()) {
|
||||
start_time_of_underutilization_ = analyze_time;
|
||||
+ }
|
||||
|
||||
// If the under-utilization started soon after the last source size change,
|
||||
// permit an immediate increase in the capture area. This allows the system
|
||||
diff --git a/media/capture/content/video_capture_oracle_unittest.cc b/media/capture/content/video_capture_oracle_unittest.cc
|
||||
index 066676fa998db6782270ddbf42fe176d88eb30d4..6cd7567e91bc8c496846a685aa1506c7548f3a21 100644
|
||||
--- a/media/capture/content/video_capture_oracle_unittest.cc
|
||||
+++ b/media/capture/content/video_capture_oracle_unittest.cc
|
||||
@@ -158,21 +158,26 @@ TEST(VideoCaptureOracleTest, TransitionsSmoothlyBetweenSamplers) {
|
||||
const bool provide_animated_content_event =
|
||||
(i % 100) >= 25 && (i % 100) < 75;
|
||||
|
||||
- // Only the few events that trigger the lock-out transition should be
|
||||
- // dropped, because the AnimatedContentSampler doesn't yet realize the
|
||||
- // animation ended. Otherwise, the oracle should always decide to sample
|
||||
- // because one of its samplers says to.
|
||||
- const bool require_oracle_says_sample = (i % 100) < 75 || (i % 100) >= 78;
|
||||
+ // https://crbug.com/391118566
|
||||
+ // Previously the AnimatedContentSampler has a bug that cause jank.
|
||||
+ // The oracle should always use SmoothEventSampler as a fallback. If
|
||||
+ // AnimatedContentSampler doesn't yet realize the animation ended or
|
||||
+ // doesn't keep up with the prediction it make, and it will wait for
|
||||
+ // kNonAnimatingThreshold before it lock-out and hand over to smooth
|
||||
+ // handler. This will cause the video to stutter and it is unacceptable.
|
||||
+ // So, when the AnimatedContentSampler goes into wrong state, we now
|
||||
+ // use SmoothEventSampler's decision as a fallback to prevent jank output
|
||||
+ // and still has a overall limit on capture frequency.
|
||||
const bool oracle_says_sample = oracle.ObserveEventAndDecideCapture(
|
||||
VideoCaptureOracle::kCompositorUpdate,
|
||||
provide_animated_content_event ? animation_damage_rect : gfx::Rect(),
|
||||
t);
|
||||
- if (require_oracle_says_sample)
|
||||
- ASSERT_TRUE(oracle_says_sample);
|
||||
- if (!oracle_says_sample) {
|
||||
- ASSERT_EQ(base::TimeDelta(), oracle.estimated_frame_duration());
|
||||
- continue;
|
||||
- }
|
||||
+
|
||||
+ // Because we now use SmoothEventSampler as a fallback, oracle should
|
||||
+ // always say sample. The previous AnimatedContentSampler lock-out
|
||||
+ // dropped frame are now revived by SmoothEventSampler, since this test's
|
||||
+ // capture frequency always meets min capture limit requirement.
|
||||
+ ASSERT_TRUE(oracle_says_sample);
|
||||
ASSERT_LT(base::TimeDelta(), oracle.estimated_frame_duration());
|
||||
|
||||
const int frame_number = oracle.next_frame_number();
|
||||
@@ -184,12 +189,9 @@ TEST(VideoCaptureOracleTest, TransitionsSmoothlyBetweenSamplers) {
|
||||
if (!last_frame_timestamp.is_null()) {
|
||||
const base::TimeDelta delta = frame_timestamp - last_frame_timestamp;
|
||||
EXPECT_LE(event_increment.InMicroseconds(), delta.InMicroseconds());
|
||||
- // Right after the AnimatedContentSampler lock-out transition, there were
|
||||
- // a few frames dropped, so allow a gap in the timestamps. Otherwise, the
|
||||
- // delta between frame timestamps should never be more than 2X the
|
||||
+ // The delta between frame timestamps should never be more than 2X the
|
||||
// |event_increment|.
|
||||
- const base::TimeDelta max_acceptable_delta =
|
||||
- (i % 100) == 78 ? event_increment * 5 : event_increment * 2;
|
||||
+ const base::TimeDelta max_acceptable_delta = event_increment * 2;
|
||||
EXPECT_GE(max_acceptable_delta.InMicroseconds(), delta.InMicroseconds());
|
||||
}
|
||||
last_frame_timestamp = frame_timestamp;
|
||||
@@ -444,9 +446,9 @@ void RunAutoThrottleTest(bool is_content_animating,
|
||||
// expect the resolution to remain constant. Repeat.
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
const gfx::Size starting_size = oracle.capture_size();
|
||||
- SCOPED_TRACE(::testing::Message() << "Stepping down from "
|
||||
- << starting_size.ToString()
|
||||
- << ", i=" << i);
|
||||
+ SCOPED_TRACE(::testing::Message()
|
||||
+ << "Stepping down from " << starting_size.ToString()
|
||||
+ << ", i=" << i);
|
||||
|
||||
gfx::Size stepped_down_size;
|
||||
end_t = t + base::Seconds(10);
|
||||
@@ -471,9 +473,10 @@ void RunAutoThrottleTest(bool is_content_animating,
|
||||
oracle.RecordCapture(with_consumer_feedback ? 0.25 : utilization);
|
||||
base::TimeTicks ignored;
|
||||
ASSERT_TRUE(oracle.CompleteCapture(frame_number, true, &ignored));
|
||||
- if (with_consumer_feedback)
|
||||
+ if (with_consumer_feedback) {
|
||||
oracle.RecordConsumerFeedback(frame_number,
|
||||
media::VideoCaptureFeedback(utilization));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,9 +485,9 @@ void RunAutoThrottleTest(bool is_content_animating,
|
||||
// utilization and expect the resolution to remain constant. Repeat.
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
const gfx::Size starting_size = oracle.capture_size();
|
||||
- SCOPED_TRACE(::testing::Message() << "Stepping up from "
|
||||
- << starting_size.ToString()
|
||||
- << ", i=" << i);
|
||||
+ SCOPED_TRACE(::testing::Message()
|
||||
+ << "Stepping up from " << starting_size.ToString()
|
||||
+ << ", i=" << i);
|
||||
|
||||
gfx::Size stepped_up_size;
|
||||
end_t = t + base::Seconds(is_content_animating ? 90 : 10);
|
||||
@@ -513,9 +516,10 @@ void RunAutoThrottleTest(bool is_content_animating,
|
||||
oracle.RecordCapture(with_consumer_feedback ? 0.25 : utilization);
|
||||
base::TimeTicks ignored;
|
||||
ASSERT_TRUE(oracle.CompleteCapture(frame_number, true, &ignored));
|
||||
- if (with_consumer_feedback)
|
||||
+ if (with_consumer_feedback) {
|
||||
oracle.RecordConsumerFeedback(frame_number,
|
||||
media::VideoCaptureFeedback(utilization));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ or resizing, but Electron does not seem to run into that issue
|
||||
for opaque frameless windows even with that block commented out.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 026b0f9b404267b17e1ea6b61b5ebb188b9b0bed..fda18ecab7e982b3087c7667d36578177d370066 100644
|
||||
index 9ac53e223aa095acdf90b68bc1e6bc81e3021ab9..562532f5795ee833493614f3f16d35bda2654d8d 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -1736,7 +1736,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 13 Mar 2025 10:47:00 +0100
|
||||
Subject: fix: take Snapped status into account when showing a window
|
||||
|
||||
Adjusts HWNDMessageHandler::Show to correctly restore windows that were
|
||||
in a snapped state prior to being hidden or maximized. From Windows
|
||||
documentation at
|
||||
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowarranged:
|
||||
|
||||
> A snapped window (see Snap your windows) is considered to be arranged.
|
||||
> You should treat arranged as a window state similar to maximized. Arranged,
|
||||
> maximized, and minimized are mutually exclusive states.
|
||||
|
||||
The logic already took into account a window being maximized and
|
||||
correctly restored it, but if the window was snapped prior to this CL it
|
||||
would be removed from its snapped state when re-shown. This fixes that.
|
||||
|
||||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/6330848.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 98a3365ce2b5ef4e34eb9edf66ef3f620af9ab1d..b5d8f82255764a42df816e58bfcbd588534de2e4 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -656,7 +656,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
SetWindowPlacement(hwnd(), &placement);
|
||||
native_show_state = SW_SHOWMAXIMIZED;
|
||||
} else {
|
||||
- const bool is_maximized = IsMaximized();
|
||||
+ const bool is_maximized_or_arranged =
|
||||
+ IsMaximized() || IsWindowArranged(hwnd());
|
||||
|
||||
// Use SW_SHOW/SW_SHOWNA instead of SW_SHOWNORMAL/SW_SHOWNOACTIVATE so that
|
||||
// the window is not restored to its original position if it is maximized.
|
||||
@@ -666,7 +667,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
// position, some do not. See crbug.com/1296710
|
||||
switch (show_state) {
|
||||
case ui::mojom::WindowShowState::kInactive:
|
||||
- native_show_state = is_maximized ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
+ native_show_state =
|
||||
+ is_maximized_or_arranged ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
break;
|
||||
case ui::mojom::WindowShowState::kMaximized:
|
||||
native_show_state = SW_SHOWMAXIMIZED;
|
||||
@@ -677,9 +679,11 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
case ui::mojom::WindowShowState::kNormal:
|
||||
if ((GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_TRANSPARENT) ||
|
||||
(GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_NOACTIVATE)) {
|
||||
- native_show_state = is_maximized ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
+ native_show_state =
|
||||
+ is_maximized_or_arranged ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
} else {
|
||||
- native_show_state = is_maximized ? SW_SHOW : SW_SHOWNORMAL;
|
||||
+ native_show_state =
|
||||
+ is_maximized_or_arranged ? SW_SHOW : SW_SHOWNORMAL;
|
||||
}
|
||||
break;
|
||||
case ui::mojom::WindowShowState::kFullscreen:
|
||||
@@ -11,10 +11,10 @@ Bug: N/A
|
||||
Change-Id: I9fc472212b2d3afac2c8e18a2159bc2d50bbdf98
|
||||
|
||||
diff --git a/AUTHORS b/AUTHORS
|
||||
index 6008db66fcb0686046a5ca40d04bb2534cb0b04a..d5079e68cef38168c4c66833a53121930fa59afd 100644
|
||||
index 897b6678b6d583f3361c41f62b960e46165d288d..13afc62098608e79faf02d504b54d9d6326b8ed3 100644
|
||||
--- a/AUTHORS
|
||||
+++ b/AUTHORS
|
||||
@@ -339,6 +339,7 @@ David Futcher <david.mike.futcher@gmail.com>
|
||||
@@ -336,6 +336,7 @@ David Futcher <david.mike.futcher@gmail.com>
|
||||
David Jin <davidjin@amazon.com>
|
||||
David Lechner <david@pybricks.com>
|
||||
David Leen <davileen@amazon.com>
|
||||
@@ -23,10 +23,10 @@ index 6008db66fcb0686046a5ca40d04bb2534cb0b04a..d5079e68cef38168c4c66833a5312193
|
||||
David McAllister <mcdavid@amazon.com>
|
||||
David Michael Barr <david.barr@samsung.com>
|
||||
diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc
|
||||
index 967e130e823f41c402411dfadb53b805e8a8c92b..3a9df7f31861ca69168fd24513ee554d0984798d 100644
|
||||
index 02f3e63d16c3324f546f6155d722900f0a81131a..1dfdb0c8dc5a7368382e73a0db1b4d135b4d2176 100644
|
||||
--- a/base/win/shortcut.cc
|
||||
+++ b/base/win/shortcut.cc
|
||||
@@ -356,8 +356,9 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
|
||||
@@ -342,8 +342,9 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
|
||||
*(pv_toast_activator_clsid.get().puuid));
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -10,7 +10,7 @@ an about:blank check to this area.
|
||||
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 8938f2b9d680c1850958b4a0a8794c351f318524..3e23e69b59be317a1a316d562a66d6a7378bf3a9 100644
|
||||
index 2d82c283867cf78fc63275bffbd9eff4d8a606e9..7222a4475e77d4f44ee155825d5cb5238d22e107 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -784,8 +784,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch(
|
||||
|
||||
@@ -44,10 +44,10 @@ index 886d70636aedfa714b29625f58420ad11ede9ffd..7906b94983733a9deb2365fb2a134619
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 67c946a84a6578eaf73f33c2ff42a55876b08404..eecd6fee29f6fd45299e8f8790c65dc76b6cb93f 100644
|
||||
index d35ae086793a52ea38da97b9236e073b806a67a6..d88c3b6a3625c2f4d0c67677777202f7db85ea88 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5618,6 +5618,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -5620,6 +5620,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 6c5a64fed98b7120ff2426066fbfadf5c2a6d9a0..d7f7bfe232d6eeca8e75d6f3ce3fafbc7515727a 100644
|
||||
index 784a7536eec5a248e4725253c091b039047ff1ea..6939dbd68fbdde3710b13a4158893d859910034a 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9529,25 +9529,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
@@ -9531,25 +9531,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
base::RepeatingClosure hang_monitor_restarter) {
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
|
||||
"render_widget_host", render_widget_host);
|
||||
|
||||
17462
patches/chromium/reland_lzma_sdk_update_to_24_09.patch
Normal file
17462
patches/chromium/reland_lzma_sdk_update_to_24_09.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Wilson <mjwilson@chromium.org>
|
||||
Date: Thu, 30 Jan 2025 14:09:57 -0800
|
||||
Subject: Remove DenormalEnabler from ScriptProcessorNode
|
||||
|
||||
This is a follow-up to https://crrev.com/c/6077677
|
||||
|
||||
After experimenting, ScriptProcessorNode JavaScript is already running
|
||||
in a complaint mode so the DenormalEnabler is not necessary.
|
||||
|
||||
Bug: 382005099
|
||||
Change-Id: If9774e60640446c567270a8f065500beecc8a40b
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219685
|
||||
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
|
||||
Reviewed-by: Alvin Ji <alvinji@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1413754}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc b/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
||||
index ea04e2cd2bfb553a58ba6fb9c63c70c5a2690442..d3d44d2a4c87bf5d4191807ec31d87c7e597fef9 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/realtime_audio_destination_node.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/script_processor_node.h"
|
||||
-#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
|
||||
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
|
||||
@@ -49,9 +48,7 @@ ScriptProcessorHandler::ScriptProcessorHandler(
|
||||
internal_input_bus_(AudioBus::Create(
|
||||
number_of_input_channels,
|
||||
node.context()->GetDeferredTaskHandler().RenderQuantumFrames(),
|
||||
- false)),
|
||||
- allow_denormal_in_processing_(base::FeatureList::IsEnabled(
|
||||
- features::kWebAudioAllowDenormalInProcessing)) {
|
||||
+ false)) {
|
||||
DCHECK_GE(buffer_size_,
|
||||
node.context()->GetDeferredTaskHandler().RenderQuantumFrames());
|
||||
DCHECK_LE(number_of_input_channels, BaseAudioContext::MaxNumberOfChannels());
|
||||
@@ -112,7 +109,7 @@ void ScriptProcessorHandler::Initialize() {
|
||||
AudioHandler::Initialize();
|
||||
}
|
||||
|
||||
-void ScriptProcessorHandler::ProcessInternal(uint32_t frames_to_process) {
|
||||
+void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
||||
TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("webaudio.audionode"),
|
||||
"ScriptProcessorHandler::Process");
|
||||
|
||||
@@ -241,15 +238,6 @@ void ScriptProcessorHandler::ProcessInternal(uint32_t frames_to_process) {
|
||||
"ScriptProcessorHandler::Process");
|
||||
}
|
||||
|
||||
-void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
||||
- if (allow_denormal_in_processing_) {
|
||||
- DenormalEnabler denormal_enabler;
|
||||
- ProcessInternal(frames_to_process);
|
||||
- } else {
|
||||
- ProcessInternal(frames_to_process);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
void ScriptProcessorHandler::FireProcessEvent(uint32_t double_buffer_index) {
|
||||
DCHECK(IsMainThread());
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_handler.h b/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
||||
index 99103e947ade50f07a16a61bc8702d6097266296..78deeb9219e3d5a98ac4d3b5cd4c98dd403407e3 100644
|
||||
--- a/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
||||
@@ -66,10 +66,6 @@ class ScriptProcessorHandler final : public AudioHandler {
|
||||
const HeapVector<Member<AudioBuffer>>& input_buffers,
|
||||
const HeapVector<Member<AudioBuffer>>& output_buffers);
|
||||
|
||||
- // Used to avoid code duplication when using scoped objects that affect
|
||||
- // `Process`.
|
||||
- void ProcessInternal(uint32_t frames_to_process);
|
||||
-
|
||||
double TailTime() const override;
|
||||
double LatencyTime() const override;
|
||||
bool RequiresTailProcessing() const final;
|
||||
@@ -97,9 +93,6 @@ class ScriptProcessorHandler final : public AudioHandler {
|
||||
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
||||
|
||||
- // Cached feature flag value
|
||||
- const bool allow_denormal_in_processing_;
|
||||
-
|
||||
base::WeakPtrFactory<ScriptProcessorHandler> weak_ptr_factory_{this};
|
||||
|
||||
FRIEND_TEST_ALL_PREFIXES(ScriptProcessorNodeTest, BufferLifetime);
|
||||
@@ -0,0 +1,390 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Xianzhu Wang <wangxianzhu@chromium.org>
|
||||
Date: Fri, 14 Feb 2025 08:58:16 -0800
|
||||
Subject: Revert "blink: Fix over invalidation with view transitions"
|
||||
|
||||
This patch can be removed when we bump Chromium to 135.0.7019.0
|
||||
|
||||
This reverts commit bde2842dd31e89215d395470964797c92773819f.
|
||||
|
||||
Reason for revert: The CL caused crbug.com/391907157.
|
||||
|
||||
Original change's description:
|
||||
> blink: Fix over invalidation with view transitions
|
||||
>
|
||||
> View Transition conditionally generates the view transition effect node
|
||||
> for the LayoutView during the transition. This results in invalidation
|
||||
> of it's scrolling background layer at the start/end of the transition.
|
||||
>
|
||||
> Avoid this by always generating this node for the LayoutView. This is
|
||||
> not necessary for the child LayoutObjects. If they are composited, they
|
||||
> already have an EffectNode which avoids invalidation from paint property
|
||||
> node changes.
|
||||
>
|
||||
> Fixed: 361370195
|
||||
> Change-Id: I1c8c309dea5bb1d2572995bbaafb2fb8003be96e
|
||||
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5996658
|
||||
> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
|
||||
> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
|
||||
> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
|
||||
> Cr-Commit-Position: refs/heads/main@{#1380843}
|
||||
|
||||
Bug: 391907157, 361370195
|
||||
Change-Id: Ifc7bb6fedb326867e5ed608b2c8152844ae2dd95
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6262017
|
||||
Auto-Submit: Xianzhu Wang <wangxianzhu@chromium.org>
|
||||
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
|
||||
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1420533}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
|
||||
index 4dd99f130cb99355e4d58766a322e8db1e69bca9..9b9851dbb92977d76a842b0a943e969493231275 100644
|
||||
--- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
|
||||
+++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
|
||||
@@ -1834,32 +1834,25 @@ void FragmentPaintPropertyTreeBuilder::UpdateViewTransitionEffect() {
|
||||
properties_->ViewTransitionEffect()
|
||||
->SelfOrAncestorParticipatesInViewTransition();
|
||||
|
||||
- const bool is_view_transition_element =
|
||||
+ const bool needs_view_transition_effect =
|
||||
full_context_.direct_compositing_reasons &
|
||||
CompositingReason::kViewTransitionElement;
|
||||
|
||||
- const bool needs_view_transition_effect =
|
||||
- is_view_transition_element ||
|
||||
- (object_.IsLayoutView() && !IsInLocalSubframe(object_) &&
|
||||
- !object_.GetDocument().IsSVGDocument());
|
||||
-
|
||||
if (needs_view_transition_effect) {
|
||||
auto* transition =
|
||||
ViewTransitionUtils::GetTransition(object_.GetDocument());
|
||||
- DCHECK(!is_view_transition_element || transition);
|
||||
+ DCHECK(transition);
|
||||
|
||||
EffectPaintPropertyNode::State state;
|
||||
+ state.direct_compositing_reasons =
|
||||
+ CompositingReason::kViewTransitionElement;
|
||||
state.local_transform_space = context_.current.transform;
|
||||
state.output_clip = context_.current.clip;
|
||||
state.compositor_element_id = CompositorElementIdFromUniqueObjectId(
|
||||
object_.UniqueId(),
|
||||
CompositorElementIdNamespace::kViewTransitionElement);
|
||||
- if (is_view_transition_element) {
|
||||
- state.direct_compositing_reasons =
|
||||
- CompositingReason::kViewTransitionElement;
|
||||
- state.view_transition_element_resource_id =
|
||||
- transition->GetSnapshotId(object_);
|
||||
- }
|
||||
+ state.view_transition_element_resource_id =
|
||||
+ transition->GetSnapshotId(object_);
|
||||
|
||||
// The value isn't set on the root, since clipping rules are different for
|
||||
// the root view transition element.
|
||||
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
|
||||
index b3da3b381113fb6ea17d3d6de7bf2cf43e175362..aa57763835d2e8dbf4d021d58c14e1dd605d5cd6 100644
|
||||
--- a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
|
||||
+++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
|
||||
@@ -77,17 +77,6 @@ const ScrollPaintPropertyNode* PaintPropertyTreeBuilderTest::DocScroll(
|
||||
return document->GetLayoutView()->FirstFragment().PaintProperties()->Scroll();
|
||||
}
|
||||
|
||||
-const EffectPaintPropertyNode* PaintPropertyTreeBuilderTest::DocEffect(
|
||||
- const Document* document) {
|
||||
- if (!document) {
|
||||
- document = &GetDocument();
|
||||
- }
|
||||
- return document->GetLayoutView()
|
||||
- ->FirstFragment()
|
||||
- .PaintProperties()
|
||||
- ->ViewTransitionEffect();
|
||||
-}
|
||||
-
|
||||
const ObjectPaintProperties*
|
||||
PaintPropertyTreeBuilderTest::PaintPropertiesForElement(const char* name) {
|
||||
return GetDocument()
|
||||
@@ -1058,7 +1047,8 @@ TEST_P(PaintPropertyTreeBuilderTest, EffectNodesInSVG) {
|
||||
PaintPropertiesForElement("groupWithOpacity");
|
||||
EXPECT_EQ(0.6f, group_with_opacity_properties->Effect()->Opacity());
|
||||
EXPECT_EQ(svg_clip, group_with_opacity_properties->Effect()->OutputClip());
|
||||
- EXPECT_EQ(DocEffect(), group_with_opacity_properties->Effect()->Parent());
|
||||
+ EXPECT_EQ(&EffectPaintPropertyNode::Root(),
|
||||
+ group_with_opacity_properties->Effect()->Parent());
|
||||
|
||||
EXPECT_EQ(nullptr, PaintPropertiesForElement("rectWithoutOpacity"));
|
||||
|
||||
@@ -4762,7 +4752,7 @@ TEST_P(PaintPropertyTreeBuilderTest, Reflection) {
|
||||
filter_properties->PaintOffsetTranslation()->Parent());
|
||||
EXPECT_EQ(gfx::Vector2dF(8, 8),
|
||||
filter_properties->PaintOffsetTranslation()->Get2dTranslation());
|
||||
- EXPECT_EQ(filter_properties->Filter()->Parent(), DocEffect());
|
||||
+ EXPECT_TRUE(filter_properties->Filter()->Parent()->IsRoot());
|
||||
EXPECT_EQ(filter_properties->PaintOffsetTranslation(),
|
||||
&filter_properties->Filter()->LocalTransformSpace());
|
||||
EXPECT_EQ(DocContentClip(), filter_properties->Filter()->OutputClip());
|
||||
@@ -4775,7 +4765,7 @@ TEST_P(PaintPropertyTreeBuilderTest, SimpleFilter) {
|
||||
const ObjectPaintProperties* filter_properties =
|
||||
GetLayoutObjectByElementId("filter")->FirstFragment().PaintProperties();
|
||||
EXPECT_FALSE(filter_properties->PaintOffsetTranslation());
|
||||
- EXPECT_EQ(filter_properties->Filter()->Parent(), DocEffect());
|
||||
+ EXPECT_TRUE(filter_properties->Filter()->Parent()->IsRoot());
|
||||
EXPECT_FALSE(filter_properties->PixelMovingFilterClipExpander());
|
||||
EXPECT_EQ(DocScrollTranslation(),
|
||||
&filter_properties->Filter()->LocalTransformSpace());
|
||||
@@ -4792,7 +4782,7 @@ TEST_P(PaintPropertyTreeBuilderTest, PixelMovingFilter) {
|
||||
|
||||
auto* filter = filter_properties->Filter();
|
||||
ASSERT_TRUE(filter);
|
||||
- EXPECT_EQ(filter->Parent(), DocEffect());
|
||||
+ EXPECT_TRUE(filter->Parent()->IsRoot());
|
||||
EXPECT_TRUE(filter->HasFilterThatMovesPixels());
|
||||
EXPECT_EQ(DocScrollTranslation(), &filter->LocalTransformSpace());
|
||||
EXPECT_EQ(DocContentClip(), filter->OutputClip());
|
||||
@@ -4847,7 +4837,7 @@ TEST_P(PaintPropertyTreeBuilderTest, FilterReparentClips) {
|
||||
GetLayoutObjectByElementId("clip")->FirstFragment().PaintProperties();
|
||||
const ObjectPaintProperties* filter_properties =
|
||||
GetLayoutObjectByElementId("filter")->FirstFragment().PaintProperties();
|
||||
- EXPECT_TRUE(DocEffect());
|
||||
+ EXPECT_TRUE(filter_properties->Filter()->Parent()->IsRoot());
|
||||
EXPECT_EQ(clip_properties->OverflowClip(),
|
||||
filter_properties->Filter()->OutputClip());
|
||||
EXPECT_EQ(DocScrollTranslation(),
|
||||
@@ -5089,7 +5079,7 @@ TEST_P(PaintPropertyTreeBuilderTest, MaskSimple) {
|
||||
|
||||
EXPECT_EQ(properties->Effect(),
|
||||
&target->FirstFragment().LocalBorderBoxProperties().Effect());
|
||||
- EXPECT_TRUE(DocEffect());
|
||||
+ EXPECT_TRUE(properties->Effect()->Parent()->IsRoot());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, properties->Effect()->BlendMode());
|
||||
EXPECT_EQ(mask_clip->Parent(), properties->Effect()->OutputClip());
|
||||
|
||||
@@ -5118,7 +5108,7 @@ TEST_P(PaintPropertyTreeBuilderTest, MaskWithOutset) {
|
||||
|
||||
EXPECT_EQ(properties->Effect(),
|
||||
&target->FirstFragment().LocalBorderBoxProperties().Effect());
|
||||
- EXPECT_TRUE(DocEffect());
|
||||
+ EXPECT_TRUE(properties->Effect()->Parent()->IsRoot());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, properties->Effect()->BlendMode());
|
||||
EXPECT_EQ(mask_clip->Parent(), properties->Effect()->OutputClip());
|
||||
|
||||
@@ -5172,7 +5162,7 @@ TEST_P(PaintPropertyTreeBuilderTest, MaskEscapeClip) {
|
||||
|
||||
EXPECT_EQ(target_properties->Effect(),
|
||||
&target->FirstFragment().LocalBorderBoxProperties().Effect());
|
||||
- EXPECT_TRUE(DocEffect());
|
||||
+ EXPECT_TRUE(target_properties->Effect()->Parent()->IsRoot());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, target_properties->Effect()->BlendMode());
|
||||
EXPECT_EQ(nullptr, target_properties->Effect()->OutputClip());
|
||||
|
||||
@@ -5215,7 +5205,7 @@ TEST_P(PaintPropertyTreeBuilderTest, MaskInline) {
|
||||
|
||||
EXPECT_EQ(properties->Effect(),
|
||||
&target->FirstFragment().LocalBorderBoxProperties().Effect());
|
||||
- EXPECT_TRUE(DocEffect());
|
||||
+ EXPECT_TRUE(properties->Effect()->Parent()->IsRoot());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, properties->Effect()->BlendMode());
|
||||
EXPECT_EQ(mask_clip->Parent(), properties->Effect()->OutputClip());
|
||||
|
||||
@@ -5316,7 +5306,8 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGBlending) {
|
||||
ASSERT_TRUE(svg_root_properties->Effect());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, svg_root_properties->Effect()->BlendMode());
|
||||
|
||||
- EXPECT_EQ(DocEffect(), svg_root_properties->Effect()->Parent());
|
||||
+ EXPECT_EQ(&EffectPaintPropertyNode::Root(),
|
||||
+ svg_root_properties->Effect()->Parent());
|
||||
EXPECT_EQ(svg_root_properties->Effect(), rect_properties->Effect()->Parent());
|
||||
}
|
||||
|
||||
@@ -5338,7 +5329,8 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGRootBlending) {
|
||||
ASSERT_TRUE(svg_root_properties->Effect());
|
||||
EXPECT_EQ(SkBlendMode::kMultiply, svg_root_properties->Effect()->BlendMode());
|
||||
|
||||
- EXPECT_EQ(DocEffect(), html_properties->Effect()->Parent());
|
||||
+ EXPECT_EQ(&EffectPaintPropertyNode::Root(),
|
||||
+ html_properties->Effect()->Parent());
|
||||
EXPECT_EQ(html_properties->Effect(), svg_root_properties->Effect()->Parent());
|
||||
}
|
||||
|
||||
@@ -6454,7 +6446,7 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGRootCompositedClipPathSimple) {
|
||||
|
||||
const auto* effect = properties->Effect();
|
||||
ASSERT_NE(nullptr, effect);
|
||||
- EXPECT_EQ(DocEffect(), effect->Parent());
|
||||
+ EXPECT_EQ(&EffectPaintPropertyNode::Root(), effect->Parent());
|
||||
EXPECT_EQ(transform, &effect->LocalTransformSpace());
|
||||
EXPECT_EQ(clip_path_clip, effect->OutputClip());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, effect->BlendMode());
|
||||
@@ -6492,7 +6484,7 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGRootCompositedClipPathComplex) {
|
||||
const auto* effect = properties->Effect();
|
||||
ASSERT_NE(nullptr, effect);
|
||||
EXPECT_TRUE(effect->HasDirectCompositingReasons());
|
||||
- EXPECT_EQ(DocEffect(), effect->Parent());
|
||||
+ EXPECT_EQ(&EffectPaintPropertyNode::Root(), effect->Parent());
|
||||
EXPECT_EQ(transform, &effect->LocalTransformSpace());
|
||||
EXPECT_EQ(clip_path_clip, effect->OutputClip());
|
||||
EXPECT_EQ(SkBlendMode::kSrcOver, effect->BlendMode());
|
||||
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.h b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.h
|
||||
index 7ab50dfc1dbfacba271f1a189f990e8dd78c4b21..252f6e568fbecb29c210e52bc8a43b34d002417d 100644
|
||||
--- a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.h
|
||||
+++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.h
|
||||
@@ -34,7 +34,6 @@ class PaintPropertyTreeBuilderTest : public PaintControllerPaintTest {
|
||||
const Document* = nullptr);
|
||||
const ClipPaintPropertyNode* DocContentClip(const Document* = nullptr);
|
||||
const ScrollPaintPropertyNode* DocScroll(const Document* = nullptr);
|
||||
- const EffectPaintPropertyNode* DocEffect(const Document* = nullptr);
|
||||
|
||||
// Return the local border box's paint offset. For more details, see
|
||||
// ObjectPaintProperties::localBorderBoxProperties().
|
||||
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_test.cc b/third_party/blink/renderer/core/view_transition/view_transition_test.cc
|
||||
index a6fa914af41568cde2fbbe59c7bbbb1de5f59d0f..bb0473719d38c049c0a92bd5f533a351e8cd8484 100644
|
||||
--- a/third_party/blink/renderer/core/view_transition/view_transition_test.cc
|
||||
+++ b/third_party/blink/renderer/core/view_transition/view_transition_test.cc
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "third_party/blink/renderer/core/dom/dom_token_list.h"
|
||||
#include "third_party/blink/renderer/core/dom/element.h"
|
||||
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
|
||||
+#include "third_party/blink/renderer/core/dom/layout_tree_builder_traversal.h"
|
||||
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
|
||||
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
|
||||
#include "third_party/blink/renderer/core/html/html_element.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
|
||||
#include "third_party/blink/renderer/core/navigation_api/navigation_api.h"
|
||||
#include "third_party/blink/renderer/core/navigation_api/navigation_history_entry.h"
|
||||
-#include "third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.h"
|
||||
#include "third_party/blink/renderer/core/paint/paint_layer.h"
|
||||
#include "third_party/blink/renderer/core/style/computed_style_constants.h"
|
||||
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
|
||||
@@ -706,100 +706,6 @@ TEST_P(ViewTransitionTest, ViewTransitionElementInvalidation) {
|
||||
UpdateAllLifecyclePhasesAndFinishDirectives();
|
||||
}
|
||||
|
||||
-namespace {
|
||||
-void AssertOnlyViewTransitionElementsInvalidated(
|
||||
- PaintArtifactCompositor* compositor) {
|
||||
- const char kViewTransition[] = "view-transition";
|
||||
- const char kLayoutViewTransition[] = "ViewTransition";
|
||||
- compositor->ForAllContentLayersForTesting(
|
||||
- [&](ContentLayerClientImpl* client) {
|
||||
- if (::testing::Matcher<std::string>(
|
||||
- ::testing::ContainsRegex(kViewTransition))
|
||||
- .Matches(client->Layer().DebugName())) {
|
||||
- return;
|
||||
- }
|
||||
- if (::testing::Matcher<std::string>(
|
||||
- ::testing::ContainsRegex(kLayoutViewTransition))
|
||||
- .Matches(client->Layer().DebugName())) {
|
||||
- return;
|
||||
- }
|
||||
- auto* tracking = client->GetRasterInvalidator().GetTracking();
|
||||
- EXPECT_FALSE(tracking->HasInvalidations())
|
||||
- << client->Layer().DebugName();
|
||||
- for (const auto& invalidation : tracking->Invalidations()) {
|
||||
- LOG(ERROR) << "Invalidation " << invalidation;
|
||||
- }
|
||||
- });
|
||||
-}
|
||||
-} // namespace
|
||||
-
|
||||
-TEST_P(ViewTransitionTest, NoInvalidationOnRoot) {
|
||||
- SetHtmlInnerHTML(R"HTML(
|
||||
- <style>
|
||||
- /* TODO(crbug.com/1336462): html.css is parsed before runtime flags are enabled */
|
||||
- html { view-transition-name: root; backgrond: grey; }
|
||||
- #element {
|
||||
- width: 100px;
|
||||
- height: 100px;
|
||||
- view-transition-name: shared;
|
||||
- will-change: transform;
|
||||
- }
|
||||
- </style>
|
||||
-
|
||||
- <div id=element></div>
|
||||
- <div>test</div>
|
||||
- )HTML");
|
||||
-
|
||||
- // Run all lifecycle phases to ensure paint is clean.
|
||||
- UpdateAllLifecyclePhasesForTest();
|
||||
-
|
||||
- GetDocument().View()->SetTracksRasterInvalidations(true);
|
||||
-
|
||||
- ScriptState* script_state = GetScriptState();
|
||||
- ScriptState::Scope scope(script_state);
|
||||
-
|
||||
- auto start_setup_lambda =
|
||||
- [](const v8::FunctionCallbackInfo<v8::Value>& info) {};
|
||||
-
|
||||
- // This callback sets the elements for the start phase of the transition.
|
||||
- auto start_setup_callback =
|
||||
- v8::Function::New(script_state->GetContext(), start_setup_lambda, {})
|
||||
- .ToLocalChecked();
|
||||
-
|
||||
- auto* compositor = GetLocalFrameView()->GetPaintArtifactCompositor();
|
||||
- auto* transition = ViewTransitionSupplement::startViewTransition(
|
||||
- script_state, GetDocument(),
|
||||
- V8ViewTransitionCallback::Create(start_setup_callback),
|
||||
- ASSERT_NO_EXCEPTION);
|
||||
-
|
||||
- UpdateAllLifecyclePhasesForTest();
|
||||
- {
|
||||
- SCOPED_TRACE("old dom capture");
|
||||
- AssertOnlyViewTransitionElementsInvalidated(compositor);
|
||||
- }
|
||||
-
|
||||
- // Finish the prepare phase, mutate the DOM and start the animation.
|
||||
- UpdateAllLifecyclePhasesAndFinishDirectives();
|
||||
- test::RunPendingTasks();
|
||||
- EXPECT_EQ(GetState(transition), State::kAnimating);
|
||||
-
|
||||
- // The start phase should generate pseudo elements for rendering new live
|
||||
- // content.
|
||||
- UpdateAllLifecyclePhasesAndFinishDirectives();
|
||||
- {
|
||||
- SCOPED_TRACE("animation started");
|
||||
- AssertOnlyViewTransitionElementsInvalidated(compositor);
|
||||
- }
|
||||
-
|
||||
- // Finish the animations which should remove the pseudo element tree.
|
||||
- FinishTransition();
|
||||
- UpdateAllLifecyclePhasesAndFinishDirectives();
|
||||
- {
|
||||
- SCOPED_TRACE("transition finished");
|
||||
- AssertOnlyViewTransitionElementsInvalidated(compositor);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
TEST_P(ViewTransitionTest, InspectorStyleResolver) {
|
||||
SetHtmlInnerHTML(R"HTML(
|
||||
<style>
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
|
||||
index 4952082b87f80611b16a0730615bc0eaabe79791..d8568a1052ec82a8d56736aee7929ca9c4a4656c 100644
|
||||
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
|
||||
@@ -1524,15 +1524,6 @@ void PaintArtifactCompositor::ShowDebugData() {
|
||||
}
|
||||
#endif
|
||||
|
||||
-void PaintArtifactCompositor::ForAllContentLayersForTesting(
|
||||
- base::FunctionRef<void(ContentLayerClientImpl*)> func) const {
|
||||
- for (auto& pending_layer : pending_layers_) {
|
||||
- if (auto* client = pending_layer.GetContentLayerClient()) {
|
||||
- func(client);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
ContentLayerClientImpl* PaintArtifactCompositor::ContentLayerClientForTesting(
|
||||
wtf_size_t i) const {
|
||||
for (auto& pending_layer : pending_layers_) {
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
|
||||
index fc4339bff1763d6dd6e99e3332e0e3bd1729e859..7d8a4526c9adcedf3ee0955aa2e7736a1d5e9e20 100644
|
||||
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
|
||||
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
|
||||
@@ -231,8 +231,6 @@ class PLATFORM_EXPORT PaintArtifactCompositor final
|
||||
void ShowDebugData();
|
||||
#endif
|
||||
|
||||
- void ForAllContentLayersForTesting(
|
||||
- base::FunctionRef<void(ContentLayerClientImpl*)> func) const;
|
||||
// Returns the ith ContentLayerClientImpl for testing.
|
||||
ContentLayerClientImpl* ContentLayerClientForTesting(wtf_size_t i) const;
|
||||
|
||||
@@ -9,10 +9,10 @@ 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 aed9541bc931ccbc1f8d80a6ce4dfe055db59da2..c4185b6238acefefc89b421a6e7fd0744f07ca17 100644
|
||||
index 71835a747d6732b963c5cdc289539665aa988c47..e290f4fc3a85f55137d055958ca9bef4987fa3a7 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3758,6 +3758,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3760,6 +3760,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
params.main_frame_name, GetOpener(), primary_main_frame_policy,
|
||||
base::UnguessableToken::Create());
|
||||
|
||||
@@ -26,7 +26,7 @@ index aed9541bc931ccbc1f8d80a6ce4dfe055db59da2..c4185b6238acefefc89b421a6e7fd074
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3768,6 +3775,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3770,6 +3777,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
|
||||
@@ -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 dae7654fc44e25ddc80dab4732b617f0784b47fc..8938f2b9d680c1850958b4a0a8794c351f318524 100644
|
||||
index 01367204ab9d872077547c2b2c33c58d9a1653b9..2d82c283867cf78fc63275bffbd9eff4d8a606e9 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8294,6 +8294,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -8295,6 +8295,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index dae7654fc44e25ddc80dab4732b617f0784b47fc..8938f2b9d680c1850958b4a0a8794c35
|
||||
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 c4185b6238acefefc89b421a6e7fd0744f07ca17..53e3bc48242f07bd984308583b1f999360f4e9d2 100644
|
||||
index e290f4fc3a85f55137d055958ca9bef4987fa3a7..ec55a5a2807bb9fc328b33d18ee10444f4b98126 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4015,21 +4015,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -4017,21 +4017,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
const input::NativeWebKeyboardEvent& event) {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::PreHandleKeyboardEvent");
|
||||
@@ -78,7 +78,7 @@ index c4185b6238acefefc89b421a6e7fd0744f07ca17..53e3bc48242f07bd984308583b1f9993
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -4188,7 +4192,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -4190,7 +4194,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
expose_get_builtin_module_function.patch
|
||||
build_add_gn_build_files.patch
|
||||
fix_add_default_values_for_variables_in_common_gypi.patch
|
||||
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
|
||||
pass_all_globals_through_require.patch
|
||||
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
|
||||
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
|
||||
@@ -48,9 +47,10 @@ src_do_not_use_soon-to-be-deprecated_v8_api.patch
|
||||
fix_add_property_query_interceptors.patch
|
||||
src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch
|
||||
src_use_supported_api_to_get_stalled_tla_messages.patch
|
||||
build_don_t_redefine_win32_lean_and_mean.patch
|
||||
build_compile_with_c_20_support.patch
|
||||
add_v8_taskpirority_to_foreground_task_runner_signature.patch
|
||||
cli_remove_deprecated_v8_flag.patch
|
||||
build_restore_clang_as_default_compiler_on_macos.patch
|
||||
esm_drop_support_for_import_assertions.patch
|
||||
build_remove_explicit_linker_call_to_libm_on_macos.patch
|
||||
build_define_nominmax_in_common_gypi.patch
|
||||
|
||||
@@ -537,17 +537,21 @@ index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c7
|
||||
cflags_c = [
|
||||
"-mavx512vl",
|
||||
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
|
||||
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..7f4885631a85a25692e8969991951be02e5d73f1 100644
|
||||
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..ef745c19f2b1cd433cc43c834a18db7eaa8e5162 100644
|
||||
--- a/deps/cares/BUILD.gn
|
||||
+++ b/deps/cares/BUILD.gn
|
||||
@@ -1,14 +1,175 @@
|
||||
@@ -1,14 +1,188 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("cares_config") {
|
||||
+ include_dirs = [ "include", "src/lib" ]
|
||||
+ include_dirs = [
|
||||
+ "include",
|
||||
+ "src/lib",
|
||||
+ "src/lib/include",
|
||||
+ ]
|
||||
+}
|
||||
+static_library("cares") {
|
||||
+ defines = [ "CARES_STATICLIB" ]
|
||||
@@ -563,20 +567,19 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..7f4885631a85a25692e8969991951be0
|
||||
+
|
||||
+ sources = [
|
||||
+ "include/ares.h",
|
||||
+ "include/ares_build.h",
|
||||
+ "include/ares_dns.h",
|
||||
+ "include/ares_dns_record.h",
|
||||
+ "include/ares_nameser.h",
|
||||
+ "include/ares_version.h",
|
||||
+ "src/lib/ares__addrinfo2hostent.c",
|
||||
+ "src/lib/ares__addrinfo_localhost.c",
|
||||
+ "src/lib/ares__close_sockets.c",
|
||||
+ "src/lib/ares__hosts_file.c",
|
||||
+ "src/lib/ares__parse_into_addrinfo.c",
|
||||
+ "src/lib/ares__socket.c",
|
||||
+ "src/lib/ares__sortaddrinfo.c",
|
||||
+ "src/lib/ares_addrinfo2hostent.c",
|
||||
+ "src/lib/ares_addrinfo_localhost.c",
|
||||
+ "src/lib/ares_android.c",
|
||||
+ "src/lib/ares_android.h",
|
||||
+ "src/lib/ares_cancel.c",
|
||||
+ "src/lib/ares_close_sockets.c",
|
||||
+ "src/lib/ares_conn.c",
|
||||
+ "src/lib/ares_conn.h",
|
||||
+ "src/lib/ares_cookie.c",
|
||||
+ "src/lib/ares_data.c",
|
||||
+ "src/lib/ares_data.h",
|
||||
@@ -590,43 +593,43 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..7f4885631a85a25692e8969991951be0
|
||||
+ "src/lib/ares_gethostbyaddr.c",
|
||||
+ "src/lib/ares_gethostbyname.c",
|
||||
+ "src/lib/ares_getnameinfo.c",
|
||||
+ "src/lib/ares_hosts_file.c",
|
||||
+ "src/lib/ares_inet_net_pton.h",
|
||||
+ "src/lib/ares_init.c",
|
||||
+ "src/lib/ares_ipv6.h",
|
||||
+ "src/lib/ares_library_init.c",
|
||||
+ "src/lib/ares_metrics.c",
|
||||
+ "src/lib/ares_options.c",
|
||||
+ "src/lib/ares_platform.c",
|
||||
+ "src/lib/ares_platform.h",
|
||||
+ "src/lib/ares_parse_into_addrinfo.c",
|
||||
+ "src/lib/ares_private.h",
|
||||
+ "src/lib/ares_process.c",
|
||||
+ "src/lib/ares_qcache.c",
|
||||
+ "src/lib/ares_query.c",
|
||||
+ "src/lib/ares_search.c",
|
||||
+ "src/lib/ares_send.c",
|
||||
+ "src/lib/ares_set_socket_functions.c",
|
||||
+ "src/lib/ares_setup.h",
|
||||
+ "src/lib/ares_socket.c",
|
||||
+ "src/lib/ares_socket.h",
|
||||
+ "src/lib/ares_sortaddrinfo.c",
|
||||
+ "src/lib/ares_strerror.c",
|
||||
+ "src/lib/ares_sysconfig.c",
|
||||
+ "src/lib/ares_sysconfig_files.c",
|
||||
+ "src/lib/ares_timeout.c",
|
||||
+ "src/lib/ares_update_servers.c",
|
||||
+ "src/lib/ares_version.c",
|
||||
+ "src/lib/dsa/ares__array.c",
|
||||
+ "src/lib/dsa/ares__array.h",
|
||||
+ "src/lib/dsa/ares__htable.c",
|
||||
+ "src/lib/dsa/ares__htable.h",
|
||||
+ "src/lib/dsa/ares__htable_asvp.c",
|
||||
+ "src/lib/dsa/ares__htable_asvp.h",
|
||||
+ "src/lib/dsa/ares__htable_strvp.c",
|
||||
+ "src/lib/dsa/ares__htable_strvp.h",
|
||||
+ "src/lib/dsa/ares__htable_szvp.c",
|
||||
+ "src/lib/dsa/ares__htable_szvp.h",
|
||||
+ "src/lib/dsa/ares__htable_vpvp.c",
|
||||
+ "src/lib/dsa/ares__htable_vpvp.h",
|
||||
+ "src/lib/dsa/ares__llist.c",
|
||||
+ "src/lib/dsa/ares__llist.h",
|
||||
+ "src/lib/dsa/ares__slist.c",
|
||||
+ "src/lib/dsa/ares__slist.h",
|
||||
+ "src/lib/dsa/ares_array.c",
|
||||
+ "src/lib/dsa/ares_htable.c",
|
||||
+ "src/lib/dsa/ares_htable.h",
|
||||
+ "src/lib/dsa/ares_htable_asvp.c",
|
||||
+ "src/lib/dsa/ares_htable_dict.c",
|
||||
+ "src/lib/dsa/ares_htable_strvp.c",
|
||||
+ "src/lib/dsa/ares_htable_szvp.c",
|
||||
+ "src/lib/dsa/ares_htable_vpstr.c",
|
||||
+ "src/lib/dsa/ares_htable_vpvp.c",
|
||||
+ "src/lib/dsa/ares_llist.c",
|
||||
+ "src/lib/dsa/ares_slist.c",
|
||||
+ "src/lib/dsa/ares_slist.h",
|
||||
+ "src/lib/event/ares_event.h",
|
||||
+ "src/lib/event/ares_event_configchg.c",
|
||||
+ "src/lib/event/ares_event_epoll.c",
|
||||
@@ -637,6 +640,17 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..7f4885631a85a25692e8969991951be0
|
||||
+ "src/lib/event/ares_event_wake_pipe.c",
|
||||
+ "src/lib/event/ares_event_win32.c",
|
||||
+ "src/lib/event/ares_event_win32.h",
|
||||
+ "src/lib/include/ares_array.h",
|
||||
+ "src/lib/include/ares_buf.h",
|
||||
+ "src/lib/include/ares_htable_asvp.h",
|
||||
+ "src/lib/include/ares_htable_dict.h",
|
||||
+ "src/lib/include/ares_htable_strvp.h",
|
||||
+ "src/lib/include/ares_htable_szvp.h",
|
||||
+ "src/lib/include/ares_htable_vpstr.h",
|
||||
+ "src/lib/include/ares_htable_vpvp.h",
|
||||
+ "src/lib/include/ares_llist.h",
|
||||
+ "src/lib/include/ares_mem.h",
|
||||
+ "src/lib/include/ares_str.h",
|
||||
+ "src/lib/inet_net_pton.c",
|
||||
+ "src/lib/inet_ntop.c",
|
||||
+ "src/lib/legacy/ares_create_query.c",
|
||||
@@ -663,23 +677,22 @@ index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..7f4885631a85a25692e8969991951be0
|
||||
+ "src/lib/record/ares_dns_private.h",
|
||||
+ "src/lib/record/ares_dns_record.c",
|
||||
+ "src/lib/record/ares_dns_write.c",
|
||||
+ "src/lib/str/ares__buf.c",
|
||||
+ "src/lib/str/ares__buf.h",
|
||||
+ "src/lib/str/ares_buf.c",
|
||||
+ "src/lib/str/ares_str.c",
|
||||
+ "src/lib/str/ares_str.h",
|
||||
+ "src/lib/str/ares_strcasecmp.c",
|
||||
+ "src/lib/str/ares_strcasecmp.h",
|
||||
+ "src/lib/str/ares_strsplit.c",
|
||||
+ "src/lib/str/ares_strsplit.h",
|
||||
+ "src/lib/util/ares__iface_ips.c",
|
||||
+ "src/lib/util/ares__iface_ips.h",
|
||||
+ "src/lib/util/ares__threads.c",
|
||||
+ "src/lib/util/ares__threads.h",
|
||||
+ "src/lib/util/ares__timeval.c",
|
||||
+ "src/lib/util/ares_iface_ips.c",
|
||||
+ "src/lib/util/ares_iface_ips.h",
|
||||
+ "src/lib/util/ares_math.c",
|
||||
+ "src/lib/util/ares_math.h",
|
||||
+ "src/lib/util/ares_rand.c",
|
||||
+ "src/tools/ares_getopt.c",
|
||||
+ "src/tools/ares_getopt.h",
|
||||
+ "src/lib/util/ares_rand.h",
|
||||
+ "src/lib/util/ares_threads.c",
|
||||
+ "src/lib/util/ares_threads.h",
|
||||
+ "src/lib/util/ares_time.h",
|
||||
+ "src/lib/util/ares_timeval.c",
|
||||
+ "src/lib/util/ares_uri.c",
|
||||
+ "src/lib/util/ares_uri.h",
|
||||
+ ]
|
||||
+
|
||||
+ if (!is_win) {
|
||||
@@ -2247,19 +2260,6 @@ index 706ea4f5cb90525c8ea56f794320a733c45a193f..c7ae7759595bfc7fdc31dab174a7514d
|
||||
}
|
||||
|
||||
} // namespace builtins
|
||||
diff --git a/src/node_builtins.h b/src/node_builtins.h
|
||||
index 1cb85b9058d06555382e565dc32192a9fa48ed9f..cec9be01abd107e8612f70daf19b4834e118ffcf 100644
|
||||
--- a/src/node_builtins.h
|
||||
+++ b/src/node_builtins.h
|
||||
@@ -74,6 +74,8 @@ using BuiltinCodeCacheMap =
|
||||
// Generated by tools/js2c.py as node_javascript.cc
|
||||
void RegisterExternalReferencesForInternalizedBuiltinCode(
|
||||
ExternalReferenceRegistry* registry);
|
||||
+void EmbedderRegisterExternalReferencesForInternalizedBuiltinCode(
|
||||
+ ExternalReferenceRegistry* registry);
|
||||
|
||||
// Handles compilation and caching of built-in JavaScript modules and
|
||||
// bootstrap scripts, whose source are bundled into the binary as static data.
|
||||
diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py
|
||||
new file mode 100755
|
||||
index 0000000000000000000000000000000000000000..37c16859003e61636fe2f1a4040b1e904c472d0b
|
||||
@@ -2408,10 +2408,10 @@ index 0000000000000000000000000000000000000000..5259e6a7a1fd6b21df69dc461dee67d9
|
||||
+ transformed_contents = contents.replace('internal/fs/', 'internal/original-fs/').replace('require(\'fs', 'require(\'original-fs')
|
||||
+ transformed_f.write(transformed_contents)
|
||||
diff --git a/tools/install.py b/tools/install.py
|
||||
index b132c7bf26c02886a7ab341a1973bf449744ba0f..757e3e60a7be01fac55c5fbb010dbbae00b1bfca 100755
|
||||
index 2dceb5c39ea4a11034ce93899fa26dc406e0b5d0..a425de8ad7833f4d39c842fd896539c1f77468bc 100755
|
||||
--- a/tools/install.py
|
||||
+++ b/tools/install.py
|
||||
@@ -264,6 +264,7 @@ def headers(options, action):
|
||||
@@ -270,6 +270,7 @@ def headers(options, action):
|
||||
'include/v8-forward.h',
|
||||
'include/v8-function-callback.h',
|
||||
'include/v8-function.h',
|
||||
@@ -2419,7 +2419,7 @@ index b132c7bf26c02886a7ab341a1973bf449744ba0f..757e3e60a7be01fac55c5fbb010dbbae
|
||||
'include/v8-initialization.h',
|
||||
'include/v8-internal.h',
|
||||
'include/v8-isolate.h',
|
||||
@@ -284,6 +285,8 @@ def headers(options, action):
|
||||
@@ -290,6 +291,8 @@ def headers(options, action):
|
||||
'include/v8-promise.h',
|
||||
'include/v8-proxy.h',
|
||||
'include/v8-regexp.h',
|
||||
@@ -2428,7 +2428,7 @@ index b132c7bf26c02886a7ab341a1973bf449744ba0f..757e3e60a7be01fac55c5fbb010dbbae
|
||||
'include/v8-script.h',
|
||||
'include/v8-snapshot.h',
|
||||
'include/v8-statistics.h',
|
||||
@@ -390,7 +393,7 @@ def parse_options(args):
|
||||
@@ -396,7 +399,7 @@ def parse_options(args):
|
||||
parser.add_argument('--build-dir', help='the location of built binaries',
|
||||
default='out/Release')
|
||||
parser.add_argument('--v8-dir', help='the location of V8',
|
||||
|
||||
@@ -10,7 +10,7 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8
|
||||
This can be removed when Electron upgrades to a version of Node.js containing the required V8 version.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index bdf1a1f33f3ea09d933757c7fee87c563cc833ab..2eb62610db2f0ebf68fa9a55ffba98291ecfe451 100644
|
||||
index 690068f093f12b6831f8ccce41289d02d7047a7a..5a3df388773ad288553bf036be42dc1a0ba75c09 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -305,7 +305,7 @@
|
||||
|
||||
49
patches/node/build_define_nominmax_in_common_gypi.patch
Normal file
49
patches/node/build_define_nominmax_in_common_gypi.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 3 Mar 2025 12:05:55 +0100
|
||||
Subject: build: define NOMINMAX in common.gypi
|
||||
|
||||
V8 and Node.js had defined NOMINMAX on Windows for a long time. In
|
||||
recent changes, V8 added std::numeric_limits::min usages in its
|
||||
header files which caused addons without NOMINMAX defines failed
|
||||
to compile.
|
||||
|
||||
Define NOMINMAX in common.gypi so that addons can be compiled with
|
||||
the latest V8 header files.
|
||||
|
||||
NAN includes uv.h before node.h, which makes
|
||||
these defines effectiveless. Nevertheless, the include order should not be
|
||||
significant.
|
||||
|
||||
PR-URL: https://github.com/nodejs/node/pull/52794
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 9bbf1b277eb17d78ca385643c3177638fd75866a..959ee74af88b44d31f2e6fa65c6f260820bd8c46 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -480,6 +480,10 @@
|
||||
'_HAS_EXCEPTIONS=0',
|
||||
'BUILDING_V8_SHARED=1',
|
||||
'BUILDING_UV_SHARED=1',
|
||||
+ # Stop <windows.h> from defining macros that conflict with
|
||||
+ # std::min() and std::max(). We don't use <windows.h> (much)
|
||||
+ # but we still inherit it from uv.h.
|
||||
+ 'NOMINMAX',
|
||||
],
|
||||
}],
|
||||
[ 'OS in "linux freebsd openbsd solaris aix os400"', {
|
||||
diff --git a/node.gypi b/node.gypi
|
||||
index 46c7c7e353f29b8b3e5937ec80a5924020548980..212750978fb5c24fffe410cbdfe8dbdfe2ea8b42 100644
|
||||
--- a/node.gypi
|
||||
+++ b/node.gypi
|
||||
@@ -63,10 +63,6 @@
|
||||
'FD_SETSIZE=1024',
|
||||
# we need to use node's preferred "win32" rather than gyp's preferred "win"
|
||||
'NODE_PLATFORM="win32"',
|
||||
- # Stop <windows.h> from defining macros that conflict with
|
||||
- # std::min() and std::max(). We don't use <windows.h> (much)
|
||||
- # but we still inherit it from uv.h.
|
||||
- 'NOMINMAX',
|
||||
'_UNICODE=1',
|
||||
],
|
||||
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
|
||||
@@ -1,36 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Fri, 23 Aug 2024 16:50:19 +0200
|
||||
Subject: build: don't redefine WIN32_LEAN_AND_MEAN
|
||||
|
||||
https://github.com/nodejs/node/pull/53722 added a new define for WIN32_LEAN_AND_MEAN
|
||||
without first checking to see if it was defined - other areas in c-ares do this so
|
||||
we should here as well. Compilation errors occur otherwise:
|
||||
|
||||
../../third_party/electron_node/deps/cares/include\ares_build.h(168,11): error: 'WIN32_LEAN_AND_MEAN' macro redefined [-Werror,-Wmacro-redefined]
|
||||
168 | # define WIN32_LEAN_AND_MEAN
|
||||
| ^
|
||||
<command line>(25,9): note: previous definition is here
|
||||
25 | #define WIN32_LEAN_AND_MEAN 1
|
||||
| ^
|
||||
1 error generated.
|
||||
[287 processes, 49437/51449 @ 48.5/s : 1018.562s] CC obj/third_party/electron_node/deps/cares/cares/ares__socket.obj
|
||||
FAILED: obj/third_party/electron_node/deps/cares/cares/ares__socket.obj
|
||||
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/deps/cares/include/ares_build.h b/deps/cares/include/ares_build.h
|
||||
index 18a92606a817145302c73b5081b4c989799bc620..bafd26d9210d2347fec41f028e9e65088b83c48c 100644
|
||||
--- a/deps/cares/include/ares_build.h
|
||||
+++ b/deps/cares/include/ares_build.h
|
||||
@@ -165,7 +165,9 @@
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
|
||||
#elif defined(_WIN32)
|
||||
-# define WIN32_LEAN_AND_MEAN
|
||||
+# ifndef WIN32_LEAN_AND_MEAN
|
||||
+# define WIN32_LEAN_AND_MEAN
|
||||
+# endif
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_HAVE_WINDOWS_H 1
|
||||
# define CARES_HAVE_SYS_TYPES_H 1
|
||||
@@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new
|
||||
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c563cc833ab 100644
|
||||
index 776a6dcf3a729a65b367fb5b4c5685f841089eea..690068f093f12b6831f8ccce41289d02d7047a7a 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -86,6 +86,8 @@
|
||||
@@ -40,10 +40,10 @@ index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c56
|
||||
# list in v8/BUILD.gn.
|
||||
['v8_enable_v8_checks == 1', {
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 0d089c35d1720e05c4c61d0226a2ebc276b65d6e..cf19b9d092698e1697508e8891926947bc2f7b12 100755
|
||||
index 0df90b176e9b5403efdb1393c0f2f37bb53dc6b2..ece665915ad4d6e02762ec3165cf7b987a87949d 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1585,6 +1585,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
@@ -1595,6 +1595,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
|
||||
|
||||
def configure_v8(o):
|
||||
@@ -52,7 +52,7 @@ index 0d089c35d1720e05c4c61d0226a2ebc276b65d6e..cf19b9d092698e1697508e8891926947
|
||||
o['variables']['v8_enable_javascript_promise_hooks'] = 1
|
||||
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 4f2eb9d0aab88b70c86339e750799080e980d7da..df3fb3372d6357b5d77b4f683e309b8483998128 100644
|
||||
index ec5f6d0d25731dfb5ceeae3cd8749630298a8ba0..30accf975d00bfda5ef0afb8d15041c7e1ba8719 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -22,6 +22,12 @@
|
||||
|
||||
@@ -46,12 +46,21 @@ index c7ae7759595bfc7fdc31dab174a7514ddd8345e7..4bf80aa6cc6385dc376fd0a3538efc27
|
||||
AddExternalizedBuiltin(
|
||||
"internal/deps/cjs-module-lexer/lexer",
|
||||
diff --git a/src/node_builtins.h b/src/node_builtins.h
|
||||
index cec9be01abd107e8612f70daf19b4834e118ffcf..3d9c6b962423555257bad4ebaad9ebd821d00042 100644
|
||||
index a73de23a1debfdac66873e0baccf882e383bfc36..c3c987d535285be84026ad0c633650bd2067d22d 100644
|
||||
--- a/src/node_builtins.h
|
||||
+++ b/src/node_builtins.h
|
||||
@@ -138,6 +138,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
|
||||
@@ -74,6 +74,8 @@ using BuiltinCodeCacheMap =
|
||||
// Generated by tools/js2c.cc as node_javascript.cc
|
||||
void RegisterExternalReferencesForInternalizedBuiltinCode(
|
||||
ExternalReferenceRegistry* registry);
|
||||
+void EmbedderRegisterExternalReferencesForInternalizedBuiltinCode(
|
||||
+ ExternalReferenceRegistry* registry);
|
||||
|
||||
// Generated by tools/js2c.py as node_javascript.cc
|
||||
// Handles compilation and caching of built-in JavaScript modules and
|
||||
// bootstrap scripts, whose source are bundled into the binary as static data.
|
||||
@@ -136,6 +138,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
|
||||
|
||||
// Generated by tools/js2c.cc as node_javascript.cc
|
||||
void LoadJavaScriptSource(); // Loads data into source_
|
||||
+ void LoadEmbedderJavaScriptSource(); // Loads embedder data into source_
|
||||
UnionBytes GetConfig(); // Return data for config.gypi
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Mon, 3 Feb 2025 21:44:36 +0900
|
||||
Subject: build: remove explicit linker call to libm on macOS
|
||||
|
||||
/usr/lib/libm.tbd is available via libSystem.*.dylib and
|
||||
reexports sanitizer symbols. When building for asan
|
||||
this becomes an issue as the linker will resolve the symbols
|
||||
from the system library rather from libclang_rt.*
|
||||
|
||||
For V8 that rely on specific version of these symbols
|
||||
that get bundled as part of clang, for ex:
|
||||
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/cppgc/platform.cc;l=93-97
|
||||
accepting nullptr for shadow_offset in `asan_get_shadow_mapping`,
|
||||
linking to system version that doesn't support this will lead to
|
||||
a crash.
|
||||
|
||||
Clang driver eventually links with `-lSystem`
|
||||
https://github.com/llvm/llvm-project/blob/e82f93890daefeb38fe2a22ee3db87a89948ec57/clang/lib/Driver/ToolChains/Darwin.cpp#L1628-L1631,
|
||||
this is done after linking the sanitizer libraries which
|
||||
ensures right order of resolution for the symbols.
|
||||
|
||||
PR-URL: https://github.com/nodejs/node/pull/56901
|
||||
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
|
||||
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
|
||||
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
|
||||
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
|
||||
diff --git a/deps/brotli/unofficial.gni b/deps/brotli/unofficial.gni
|
||||
index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb7512e34863e 100644
|
||||
--- a/deps/brotli/unofficial.gni
|
||||
+++ b/deps/brotli/unofficial.gni
|
||||
@@ -25,7 +25,7 @@ template("brotli_gn_build") {
|
||||
} else if (target_os == "freebsd") {
|
||||
defines = [ "OS_FREEBSD" ]
|
||||
}
|
||||
- if (!is_win) {
|
||||
+ if (is_linux) {
|
||||
libs = [ "m" ]
|
||||
}
|
||||
if (is_clang || !is_win) {
|
||||
diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni
|
||||
index 7a73f891e3fc3261b77af97af63fca2eade49849..bda1b5dc899558c2b4a22377dde9fb3bcce5488c 100644
|
||||
--- a/deps/uv/unofficial.gni
|
||||
+++ b/deps/uv/unofficial.gni
|
||||
@@ -82,11 +82,11 @@ template("uv_gn_build") {
|
||||
]
|
||||
}
|
||||
if (is_posix) {
|
||||
- libs = [ "m" ]
|
||||
ldflags = [ "-pthread" ]
|
||||
}
|
||||
if (is_linux) {
|
||||
- libs += [
|
||||
+ libs = [
|
||||
+ "m",
|
||||
"dl",
|
||||
"rt",
|
||||
]
|
||||
@@ -11,7 +11,7 @@ node-gyp will use the result of `process.config` that reflects the environment
|
||||
in which the binary got built.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 2eb62610db2f0ebf68fa9a55ffba98291ecfe451..3ec08ee144b586d05c4e49c2251416734cbc02c5 100644
|
||||
index 5a3df388773ad288553bf036be42dc1a0ba75c09..9bbf1b277eb17d78ca385643c3177638fd75866a 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -125,6 +125,7 @@
|
||||
|
||||
@@ -26,12 +26,12 @@ index 364469160af5e348f8890417de16a63c0d1dca67..75d5f58fe02fa8cfa7716ffaf761d567
|
||||
try {
|
||||
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
|
||||
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
|
||||
index a05d2846050c2f505eac16320f645e79182a27f6..348bb80ef7fae1e0e5f529b1313093eeadad9276 100644
|
||||
index 0bbabb80c26a1208860f6d32447c0ae53316f501..ba18bfa3cd17c2b8e977f53651ce2744b17a829f 100644
|
||||
--- a/lib/internal/process/pre_execution.js
|
||||
+++ b/lib/internal/process/pre_execution.js
|
||||
@@ -247,12 +247,14 @@ function patchProcessObject(expandArgv1) {
|
||||
if (expandArgv1 && process.argv[1] &&
|
||||
!StringPrototypeStartsWith(process.argv[1], '-')) {
|
||||
@@ -245,12 +245,14 @@ function patchProcessObject(expandArgv1) {
|
||||
// the entry point.
|
||||
if (expandArgv1 && process.argv[1] && process.argv[1][0] !== '-') {
|
||||
// Expand process.argv[1] into a full path.
|
||||
- const path = require('path');
|
||||
- try {
|
||||
|
||||
@@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
|
||||
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
|
||||
|
||||
diff --git a/doc/api/cli.md b/doc/api/cli.md
|
||||
index d97682ac2ebcdf145e202325a4642a1bfd3970b2..7c5c08c450b9b4774265ead6a91d3ed76693c290 100644
|
||||
index df7031f65d44f9abfcf43281c0d153c654269b60..d0d78beed2b02a3703bd45fdaa4291600f98d35e 100644
|
||||
--- a/doc/api/cli.md
|
||||
+++ b/doc/api/cli.md
|
||||
@@ -2869,7 +2869,6 @@ V8 options that are allowed are:
|
||||
@@ -2886,7 +2886,6 @@ V8 options that are allowed are:
|
||||
* `--disallow-code-generation-from-strings`
|
||||
* `--enable-etw-stack-walking`
|
||||
* `--expose-gc`
|
||||
@@ -30,10 +30,10 @@ index d97682ac2ebcdf145e202325a4642a1bfd3970b2..7c5c08c450b9b4774265ead6a91d3ed7
|
||||
* `--jitless`
|
||||
* `--max-old-space-size`
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 9b5f49ebb478a21acf8f0d6ed012ed6829a8a320..433c8a3c1df125e3d7df414980440c64ffca61d6 100644
|
||||
index e19b9d88a908154dbcfd0b0e3efbc7510609f810..e056e43c36de885df57fb3d9f8d76f0bdc412537 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -866,11 +866,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
|
||||
@@ -870,11 +870,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
|
||||
"disallow eval and friends",
|
||||
V8Option{},
|
||||
kAllowedInEnvvar);
|
||||
|
||||
@@ -35,10 +35,10 @@ Reviewed-By: James M Snell <jasnell@gmail.com>
|
||||
(cherry picked from commit 8fd90938f923ef2a04bb3ebb08b89568fe6fd4ee)
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 9f6f8e53abd7e447d88c187c447431a0d96cd150..4415f18ecbd84c1f41e0febbf2446fb636242d58 100644
|
||||
index 1fc236d88e53ebe2fd388b9799c0e857d8b4e88e..751d818308ee499a1201e5972ec80f12ed998114 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -778,12 +778,6 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
|
||||
@@ -782,12 +782,6 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
|
||||
return ExitCode::kInvalidCommandLineArgument2;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ common.gypi is a file that's included in the node header bundle, despite
|
||||
the fact that we do not build node with gyp.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 1ece4f5e494533ea0fa25e0d35143fe424dbf70b..697b8bba6a55358924d6986f2eb347a99ff73889 100644
|
||||
index 04852d81103ef83c5213464f543839dea6f0b181..776a6dcf3a729a65b367fb5b4c5685f841089eea 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -88,6 +88,23 @@
|
||||
|
||||
@@ -44,7 +44,7 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480
|
||||
let filename = call.getFileName();
|
||||
const line = call.getLineNumber() - 1;
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index b9098d102b40adad7fafcc331ac62870617019b9..cb9269a31e073caf86164aa39c0640370ade60fd 100644
|
||||
index 66d0a75e90dd11d5d96a738c01939dc1f5703dde..c101c0f314575b489e9ee93281a56b87118ab834 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -244,6 +244,9 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
|
||||
@@ -58,10 +58,10 @@ index b9098d102b40adad7fafcc331ac62870617019b9..cb9269a31e073caf86164aa39c064037
|
||||
}
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index efbe48e10b8408642a6b5010b1a7a3749068188a..9b5f49ebb478a21acf8f0d6ed012ed6829a8a320 100644
|
||||
index b7ef44b018c7aec59d8311642a811d1280247689..e19b9d88a908154dbcfd0b0e3efbc7510609f810 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -1405,14 +1405,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -1409,14 +1409,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420f
|
||||
|
||||
const availableCurves = new Set(crypto.getCurves());
|
||||
diff --git a/test/parallel/test-crypto-dh-errors.js b/test/parallel/test-crypto-dh-errors.js
|
||||
index fcf1922bcdba733af6c22f142db4f7b099947757..9f72ae4e41a113e752f40795103c2af514538780 100644
|
||||
index 476ca64b4425b5b8b0fa2dc8352ee6f03d563813..2250a8f24a875d6af198426891870b450078ee5f 100644
|
||||
--- a/test/parallel/test-crypto-dh-errors.js
|
||||
+++ b/test/parallel/test-crypto-dh-errors.js
|
||||
@@ -32,9 +32,9 @@ for (const bits of [-1, 0, 1]) {
|
||||
@@ -362,24 +362,6 @@ index fcf1922bcdba733af6c22f142db4f7b099947757..9f72ae4e41a113e752f40795103c2af5
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ for (const g of [-1, 1]) {
|
||||
const ex = {
|
||||
code: 'ERR_OSSL_DH_BAD_GENERATOR',
|
||||
name: 'Error',
|
||||
- message: /bad generator/,
|
||||
+ message: /bad generator|BAD_GENERATOR/,
|
||||
};
|
||||
assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex);
|
||||
assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex);
|
||||
@@ -55,7 +55,7 @@ for (const g of [Buffer.from([]),
|
||||
const ex = {
|
||||
code: 'ERR_OSSL_DH_BAD_GENERATOR',
|
||||
name: 'Error',
|
||||
- message: /bad generator/,
|
||||
+ message: /bad generator|BAD_GENERATOR/,
|
||||
};
|
||||
assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex);
|
||||
assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex);
|
||||
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
|
||||
index 8ae0a002fec0944737d2c6ae73fc8956e41beb50..5b37236a6c2f1ec1761d8143c8ea6a7e2a837a7a 100644
|
||||
--- a/test/parallel/test-crypto-dh.js
|
||||
@@ -535,19 +517,6 @@ index f1f14b472997e76bb4100edb1c6cf4fc24d1074d..5057e3f9bc5bb78aceffa5e79530f8ce
|
||||
});
|
||||
|
||||
// No-pad encrypted string should return the same:
|
||||
diff --git a/test/parallel/test-crypto-private-decrypt-gh32240.js b/test/parallel/test-crypto-private-decrypt-gh32240.js
|
||||
index 1785f5eef3d202976666081d09850ed744d83446..e88227a215ba4f7fa196f7642ae694a57d55b3ca 100644
|
||||
--- a/test/parallel/test-crypto-private-decrypt-gh32240.js
|
||||
+++ b/test/parallel/test-crypto-private-decrypt-gh32240.js
|
||||
@@ -24,7 +24,7 @@ const pkeyEncrypted =
|
||||
pair.privateKey.export({
|
||||
type: 'pkcs1',
|
||||
format: 'pem',
|
||||
- cipher: 'aes128',
|
||||
+ cipher: 'aes-128-cbc',
|
||||
passphrase: 'secret',
|
||||
});
|
||||
|
||||
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js
|
||||
index 5f4fafdfffbf726b7cb39c472baa3df25c9794cf..73bb53b0405b20f51b13326cc70e52755c674366 100644
|
||||
--- a/test/parallel/test-crypto-rsa-dsa.js
|
||||
@@ -691,86 +660,18 @@ index 008ab129f0e019c659eecf5a76b7eb412c947fe3..6688f5d916f50e1e4fcfff1619c8634a
|
||||
|
||||
cipher.end('Papaya!'); // Should not cause an unhandled exception.
|
||||
diff --git a/test/parallel/test-crypto-x509.js b/test/parallel/test-crypto-x509.js
|
||||
index 89a7521544f7051edc1779138551bbad1972b3fb..91df6acc65d4003999f29f0fa5f639056b21ee3b 100644
|
||||
index ee4d96b476864ed5ecad7e8421f41a39bb2f9268..1399d2b51d57bc793f37acdcd50fcbe640fe97d6 100644
|
||||
--- a/test/parallel/test-crypto-x509.js
|
||||
+++ b/test/parallel/test-crypto-x509.js
|
||||
@@ -111,7 +111,7 @@ const der = Buffer.from(
|
||||
'5A:42:63:E0:21:2F:D6:70:63:07:96:6F:27:A7:78:12:08:02:7A:8B'
|
||||
);
|
||||
assert.strictEqual(x509.keyUsage, undefined);
|
||||
- assert.strictEqual(x509.serialNumber, '147D36C1C2F74206DE9FAB5F2226D78ADB00A426');
|
||||
+ assert.match(x509.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A426/i);
|
||||
|
||||
assert.deepStrictEqual(x509.raw, der);
|
||||
|
||||
@@ -253,6 +253,16 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
|
||||
});
|
||||
mc.port2.postMessage(x509);
|
||||
|
||||
+ const modulusOSSL = 'D456320AFB20D3827093DC2C4284ED04DFBABD56E1DDAE529E28B790CD42' +
|
||||
+ '56DB273349F3735FFD337C7A6363ECCA5A27B7F73DC7089A96C6D886DB0C' +
|
||||
+ '62388F1CDD6A963AFCD599D5800E587A11F908960F84ED50BA25A28303EC' +
|
||||
+ 'DA6E684FBE7BAEDC9CE8801327B1697AF25097CEE3F175E400984C0DB6A8' +
|
||||
+ 'EB87BE03B4CF94774BA56FFFC8C63C68D6ADEB60ABBE69A7B14AB6A6B9E7' +
|
||||
+ 'BAA89B5ADAB8EB07897C07F6D4FA3D660DFF574107D28E8F63467A788624' +
|
||||
+ 'C574197693E959CEA1362FFAE1BBA10C8C0D88840ABFEF103631B2E8F5C3' +
|
||||
+ '9B5548A7EA57E8A39F89291813F45A76C448033A2B7ED8403F4BAA147CF3' +
|
||||
+ '5E2D2554AA65CE49695797095BF4DC6B';
|
||||
+
|
||||
// Verify that legacy encoding works
|
||||
const legacyObjectCheck = {
|
||||
subject: Object.assign({ __proto__: null }, {
|
||||
@@ -277,15 +287,7 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
|
||||
'OCSP - URI': ['http://ocsp.nodejs.org/'],
|
||||
'CA Issuers - URI': ['http://ca.nodejs.org/ca.cert']
|
||||
}),
|
||||
- modulus: 'D456320AFB20D3827093DC2C4284ED04DFBABD56E1DDAE529E28B790CD42' +
|
||||
- '56DB273349F3735FFD337C7A6363ECCA5A27B7F73DC7089A96C6D886DB0C' +
|
||||
- '62388F1CDD6A963AFCD599D5800E587A11F908960F84ED50BA25A28303EC' +
|
||||
- 'DA6E684FBE7BAEDC9CE8801327B1697AF25097CEE3F175E400984C0DB6A8' +
|
||||
- 'EB87BE03B4CF94774BA56FFFC8C63C68D6ADEB60ABBE69A7B14AB6A6B9E7' +
|
||||
- 'BAA89B5ADAB8EB07897C07F6D4FA3D660DFF574107D28E8F63467A788624' +
|
||||
- 'C574197693E959CEA1362FFAE1BBA10C8C0D88840ABFEF103631B2E8F5C3' +
|
||||
- '9B5548A7EA57E8A39F89291813F45A76C448033A2B7ED8403F4BAA147CF3' +
|
||||
- '5E2D2554AA65CE49695797095BF4DC6B',
|
||||
+ modulusPattern: new RegExp(modulusOSSL, 'i'),
|
||||
bits: 2048,
|
||||
exponent: '0x10001',
|
||||
valid_from: 'Sep 3 21:40:37 2022 GMT',
|
||||
@@ -298,7 +300,7 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
|
||||
'51:62:18:39:E2:E2:77:F5:86:11:E8:C0:CA:54:43:7C:76:83:19:05:D0:03:' +
|
||||
'24:21:B8:EB:14:61:FB:24:16:EB:BD:51:1A:17:91:04:30:03:EB:68:5F:DC:' +
|
||||
'86:E1:D1:7C:FB:AF:78:ED:63:5F:29:9C:32:AF:A1:8E:22:96:D1:02',
|
||||
- serialNumber: '147D36C1C2F74206DE9FAB5F2226D78ADB00A426'
|
||||
+ serialNumberPattern: /147D36C1C2F74206DE9FAB5F2226D78ADB00A426/i
|
||||
};
|
||||
|
||||
const legacyObject = x509.toLegacyObject();
|
||||
@@ -307,7 +309,7 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
|
||||
assert.deepStrictEqual(legacyObject.subject, legacyObjectCheck.subject);
|
||||
assert.deepStrictEqual(legacyObject.issuer, legacyObjectCheck.issuer);
|
||||
assert.deepStrictEqual(legacyObject.infoAccess, legacyObjectCheck.infoAccess);
|
||||
- assert.strictEqual(legacyObject.modulus, legacyObjectCheck.modulus);
|
||||
+ assert.match(legacyObject.modulus, legacyObjectCheck.modulusPattern);
|
||||
assert.strictEqual(legacyObject.bits, legacyObjectCheck.bits);
|
||||
assert.strictEqual(legacyObject.exponent, legacyObjectCheck.exponent);
|
||||
assert.strictEqual(legacyObject.valid_from, legacyObjectCheck.valid_from);
|
||||
@@ -316,11 +318,12 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
|
||||
assert.strictEqual(
|
||||
legacyObject.fingerprint256,
|
||||
legacyObjectCheck.fingerprint256);
|
||||
- assert.strictEqual(
|
||||
+ assert.match(
|
||||
legacyObject.serialNumber,
|
||||
- legacyObjectCheck.serialNumber);
|
||||
+ legacyObjectCheck.serialNumberPattern);
|
||||
@@ -323,6 +323,7 @@ oans248kpal88CGqsN2so/wZKxVnpiXlPHMdiNL7hRSUqlHkUi07FrP2Htg8kjI=
|
||||
legacyObjectCheck.serialNumberPattern);
|
||||
}
|
||||
|
||||
+/*
|
||||
{
|
||||
// This X.509 Certificate can be parsed by OpenSSL because it contains a
|
||||
// structurally sound TBSCertificate structure. However, the SPKI field of the
|
||||
@@ -359,3 +362,4 @@ UcXd/5qu2GhokrKU2cPttU+XAN2Om6a0
|
||||
@@ -361,3 +362,4 @@ UcXd/5qu2GhokrKU2cPttU+XAN2Om6a0
|
||||
|
||||
assert.strictEqual(cert.checkIssued(cert), false);
|
||||
}
|
||||
@@ -888,7 +789,7 @@ index 543ee176fb6af38874fee9f14be76f3fdda11060..fef9f1bc2f9fc6c220cf47847e86e038
|
||||
}
|
||||
|
||||
diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js
|
||||
index da5600710560b22049eba1ef18bbb742d447a673..8917b96f666de916616af2fb3ce3a58d00af7438 100644
|
||||
index e0986e53c1103b63cf15002a7fa4ce8bc4844d90..33c8a2aa72c56dd4a98558aab2102f03fae2b3cf 100644
|
||||
--- a/test/parallel/test-https-agent-session-eviction.js
|
||||
+++ b/test/parallel/test-https-agent-session-eviction.js
|
||||
@@ -14,7 +14,7 @@ const options = {
|
||||
@@ -900,35 +801,8 @@ index da5600710560b22049eba1ef18bbb742d447a673..8917b96f666de916616af2fb3ce3a58d
|
||||
};
|
||||
|
||||
// Create TLS1.2 server
|
||||
diff --git a/test/parallel/test-tls-getcertificate-x509.js b/test/parallel/test-tls-getcertificate-x509.js
|
||||
index aa685ca9e09cf0d17ff4d5480089e9977dd51f72..ccafa427433922155c1afd5d95ba69d8108825ef 100644
|
||||
--- a/test/parallel/test-tls-getcertificate-x509.js
|
||||
+++ b/test/parallel/test-tls-getcertificate-x509.js
|
||||
@@ -20,9 +20,7 @@ const server = tls.createServer(options, function(cleartext) {
|
||||
server.once('secureConnection', common.mustCall(function(socket) {
|
||||
const cert = socket.getX509Certificate();
|
||||
assert(cert instanceof X509Certificate);
|
||||
- assert.strictEqual(
|
||||
- cert.serialNumber,
|
||||
- '5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE');
|
||||
+ assert.match(cert.serialNumber, /5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE/i)
|
||||
}));
|
||||
|
||||
server.listen(0, common.mustCall(function() {
|
||||
@@ -33,10 +31,7 @@ server.listen(0, common.mustCall(function() {
|
||||
const peerCert = socket.getPeerX509Certificate();
|
||||
assert(peerCert.issuerCertificate instanceof X509Certificate);
|
||||
assert.strictEqual(peerCert.issuerCertificate.issuerCertificate, undefined);
|
||||
- assert.strictEqual(
|
||||
- peerCert.issuerCertificate.serialNumber,
|
||||
- '147D36C1C2F74206DE9FAB5F2226D78ADB00A425'
|
||||
- );
|
||||
+ assert.match(peerCert.issuerCertificate.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A425/i);
|
||||
server.close();
|
||||
}));
|
||||
socket.end('Hello');
|
||||
diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js
|
||||
index 571f400cea574662bda6be8eecd22ceccaf75420..2296362dc625ee663df11927297ccf124233a19b 100644
|
||||
index a9c8775e2f112f2b5e1f4e80f22264f219bf6a9d..4550d28125379e6043962826b8e97b692d63804b 100644
|
||||
--- a/test/parallel/test-tls-getprotocol.js
|
||||
+++ b/test/parallel/test-tls-getprotocol.js
|
||||
@@ -27,7 +27,7 @@ const clientConfigs = [
|
||||
|
||||
@@ -19,7 +19,7 @@ index 22248b753c14960122f1d6b9bfe6b89fdb8d2010..9d245a04fbcb98dcd1c61e60f7cfe528
|
||||
context = { __proto__: context, source };
|
||||
}
|
||||
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
|
||||
index f3dfc69cd2cdec50bc3b3f7cb2d63349812d87dd..b6f2d7194cb75ecc8c47869761c63184707ade40 100644
|
||||
index 9c9b403774e51e2f7e1201ad53e60e98fc3b26e8..477a3b2cf61fcaa154f01ac77c8047ef548ac1f8 100644
|
||||
--- a/lib/internal/modules/esm/translators.js
|
||||
+++ b/lib/internal/modules/esm/translators.js
|
||||
@@ -375,6 +375,9 @@ function cjsPreparseModuleExports(filename, source) {
|
||||
|
||||
@@ -48,10 +48,10 @@ index 7b77af35a1dfebf6ad45ace521f1a55b5fa18293..ac24cf305bd5995ad13b37ee36f9e1fe
|
||||
ArrayPrototypePush(schemes, 'https', 'http');
|
||||
}
|
||||
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
|
||||
index e73a8ad60a13925d6773c32cead8d04ec9d96ee7..52cdb7d5e14a18ed7b1b65e429729cf47dce3f98 100644
|
||||
index 93c7a040fd47f050b10b949e4f619d85660110c8..77b85490b1a65b594bb140deb07b33f3accc9736 100644
|
||||
--- a/lib/internal/modules/esm/resolve.js
|
||||
+++ b/lib/internal/modules/esm/resolve.js
|
||||
@@ -741,6 +741,8 @@ function packageImportsResolve(name, base, conditions) {
|
||||
@@ -760,6 +760,8 @@ function packageImportsResolve(name, base, conditions) {
|
||||
throw importNotDefined(name, packageJSONUrl, base);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ index e73a8ad60a13925d6773c32cead8d04ec9d96ee7..52cdb7d5e14a18ed7b1b65e429729cf4
|
||||
/**
|
||||
* Returns the package type for a given URL.
|
||||
* @param {URL} url - The URL to get the package type for.
|
||||
@@ -801,6 +803,11 @@ function packageResolve(specifier, base, conditions) {
|
||||
@@ -820,6 +822,11 @@ function packageResolve(specifier, base, conditions) {
|
||||
return new URL('node:' + specifier);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ index e73a8ad60a13925d6773c32cead8d04ec9d96ee7..52cdb7d5e14a18ed7b1b65e429729cf4
|
||||
parsePackageName(specifier, base);
|
||||
|
||||
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
|
||||
index 8f4b6b25d8889686d00613fd9821b0aa822a946a..89ca269294ee1afa7f5aeb0ac6b8958f7a8b49d0 100644
|
||||
index 044d820161a5f9809dd042be7e53b717de8678ab..5281d7c220c8adee0f3d7269a0116d082726ec91 100644
|
||||
--- a/lib/internal/modules/esm/translators.js
|
||||
+++ b/lib/internal/modules/esm/translators.js
|
||||
@@ -272,7 +272,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
|
||||
@@ -108,7 +108,7 @@ index 8f4b6b25d8889686d00613fd9821b0aa822a946a..89ca269294ee1afa7f5aeb0ac6b8958f
|
||||
// or as the initial entry point when the ESM loader handles a CommonJS entry.
|
||||
translators.set('commonjs', async function commonjsStrategy(url, source,
|
||||
diff --git a/lib/internal/url.js b/lib/internal/url.js
|
||||
index e6ed5466b8807a52633d8406824058bdc8c2ce13..e055facddf086eb8fb456b865ce006cdb7602b0a 100644
|
||||
index 42debfc20005b0d293e5507546dcd8caec2b6a4e..4b6d07b14bd92ac527b7f4bd55ff7005967cee7d 100644
|
||||
--- a/lib/internal/url.js
|
||||
+++ b/lib/internal/url.js
|
||||
@@ -1485,6 +1485,8 @@ function fileURLToPath(path, options = kEmptyObject) {
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@atlassian.com>
|
||||
Date: Fri, 26 Oct 2018 15:35:13 +1100
|
||||
Subject: fix: expose tracing::Agent and use tracing::TracingController instead
|
||||
of v8::TracingController
|
||||
|
||||
This API is used by Electron to create Node's tracing controller.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 46106fa94b3055648e4f01cd28860d427268a253..e0bf37f09dceb93af58990438ab577a9d4b843e8 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -557,6 +557,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
|
||||
return env->platform();
|
||||
}
|
||||
|
||||
+node::tracing::Agent* CreateAgent() {
|
||||
+ return new node::tracing::Agent();
|
||||
+}
|
||||
+
|
||||
MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
node::tracing::TracingController* tracing_controller) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 6373adacb628459a4c9d7237da2587aee318e2d8..4f2eb9d0aab88b70c86339e750799080e980d7da 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -133,6 +133,7 @@ struct SnapshotData;
|
||||
|
||||
namespace tracing {
|
||||
|
||||
+class Agent;
|
||||
class TracingController;
|
||||
|
||||
}
|
||||
@@ -832,6 +833,8 @@ NODE_EXTERN void GetNodeReport(Environment* env,
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
|
||||
|
||||
+NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
+
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
@@ -388,7 +388,7 @@ index cf051585e779e2b03bd7b95fe5008b89cc7f8162..9de49c6828468fdf846dcd4ad445390f
|
||||
#if NODE_OPENSSL_HAS_QUIC
|
||||
#include <openssl/quic.h>
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index e325b082dec6ae891a737a4fa7775937e4d7b7f9..efbe48e10b8408642a6b5010b1a7a3749068188a 100644
|
||||
index f6ff810953b224b7e343d91e1065d95bc3e78d39..b7ef44b018c7aec59d8311642a811d1280247689 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@@ -38,7 +38,7 @@ index ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7..22248b753c14960122f1d6b9bfe6b89f
|
||||
const match = RegExpPrototypeExec(DATA_URL_PATTERN, url.pathname);
|
||||
if (!match) {
|
||||
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
|
||||
index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d58434af647d 100644
|
||||
index 77b85490b1a65b594bb140deb07b33f3accc9736..da99cc2d4ca930222ca018ddf42ee2e5f898576a 100644
|
||||
--- a/lib/internal/modules/esm/resolve.js
|
||||
+++ b/lib/internal/modules/esm/resolve.js
|
||||
@@ -24,7 +24,7 @@ const {
|
||||
@@ -50,7 +50,7 @@ index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d584
|
||||
const { getOptionValue } = require('internal/options');
|
||||
// Do not eagerly grab .manifest, it may be in TDZ
|
||||
const policy = getOptionValue('--experimental-policy') ?
|
||||
@@ -251,7 +251,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
||||
@@ -257,7 +257,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d584
|
||||
StringPrototypeSlice(path, -1) : path));
|
||||
|
||||
// Check for stats.isDirectory()
|
||||
@@ -267,7 +267,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
||||
@@ -285,7 +285,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
||||
}
|
||||
|
||||
if (!preserveSymlinks) {
|
||||
@@ -68,7 +68,7 @@ index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d584
|
||||
[internalFS.realpathCacheKey]: realpathCache,
|
||||
});
|
||||
const { search, hash } = resolved;
|
||||
@@ -826,7 +826,7 @@ function packageResolve(specifier, base, conditions) {
|
||||
@@ -845,7 +845,7 @@ function packageResolve(specifier, base, conditions) {
|
||||
let packageJSONPath = fileURLToPath(packageJSONUrl);
|
||||
let lastPath;
|
||||
do {
|
||||
@@ -78,7 +78,7 @@ index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d584
|
||||
// Check for !stat.isDirectory()
|
||||
if (stat !== 1) {
|
||||
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
|
||||
index 89ca269294ee1afa7f5aeb0ac6b8958f7a8b49d0..f3dfc69cd2cdec50bc3b3f7cb2d63349812d87dd 100644
|
||||
index 5281d7c220c8adee0f3d7269a0116d082726ec91..9c9b403774e51e2f7e1201ad53e60e98fc3b26e8 100644
|
||||
--- a/lib/internal/modules/esm/translators.js
|
||||
+++ b/lib/internal/modules/esm/translators.js
|
||||
@@ -36,7 +36,7 @@ const {
|
||||
|
||||
@@ -15,7 +15,7 @@ to recognize asar files.
|
||||
This reverts commit 9cf2e1f55b8446a7cde23699d00a3be73aa0c8f1.
|
||||
|
||||
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
|
||||
index 69f73f829706deddc4f328b78af9d58434af647d..1d53a2a47423150e822bb917b2725d3a6a794814 100644
|
||||
index da99cc2d4ca930222ca018ddf42ee2e5f898576a..34631a1f4ffea33ba520874e6571054d3d9c057e 100644
|
||||
--- a/lib/internal/modules/esm/resolve.js
|
||||
+++ b/lib/internal/modules/esm/resolve.js
|
||||
@@ -36,10 +36,9 @@ const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
|
||||
|
||||
@@ -161,10 +161,10 @@ index a30c25a3a61dfe73944731760404c555f2782d72..6137551bb8168d8fa9a3e6bc79c3d1e7
|
||||
inline MultiIsolatePlatform* platform() const;
|
||||
inline const SnapshotData* snapshot_data() const;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index df3fb3372d6357b5d77b4f683e309b8483998128..01e8a4f2ed905bf5bbb803419012a014c204b460 100644
|
||||
index 30accf975d00bfda5ef0afb8d15041c7e1ba8719..232ca3a0dbdf88d03bba1da7dbed2ee5070eefa7 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -1561,24 +1561,14 @@ void RegisterSignalHandler(int signal,
|
||||
@@ -1552,24 +1552,14 @@ void RegisterSignalHandler(int signal,
|
||||
bool reset_handler = false);
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ This refactors several allocators to allocate within the V8 memory cage,
|
||||
allowing them to be compatible with the V8_SANDBOXED_POINTERS feature.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index e0bf37f09dceb93af58990438ab577a9d4b843e8..b9098d102b40adad7fafcc331ac62870617019b9 100644
|
||||
index 46106fa94b3055648e4f01cd28860d427268a253..66d0a75e90dd11d5d96a738c01939dc1f5703dde 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -101,6 +101,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
|
||||
@@ -118,10 +118,10 @@ index 4ba261014695cf1aa8eb53b21a2873f4c4ea8e43..b695d131bcdc331974f544924138bb5e
|
||||
v8::Local<v8::ArrayBuffer> ToArrayBuffer(Environment* env);
|
||||
|
||||
diff --git a/src/node_i18n.cc b/src/node_i18n.cc
|
||||
index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e8778cb98623 100644
|
||||
index 1ddae30e97257be9f8145dcd419203dcf77aadac..bebe6fd7d139bcdd71e2be35831fd8a1d89ab15f 100644
|
||||
--- a/src/node_i18n.cc
|
||||
+++ b/src/node_i18n.cc
|
||||
@@ -106,7 +106,7 @@ namespace {
|
||||
@@ -103,7 +103,7 @@ namespace {
|
||||
|
||||
template <typename T>
|
||||
MaybeLocal<Object> ToBufferEndian(Environment* env, MaybeStackBuffer<T>* buf) {
|
||||
@@ -130,7 +130,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877
|
||||
if (ret.IsEmpty())
|
||||
return ret;
|
||||
|
||||
@@ -183,7 +183,7 @@ MaybeLocal<Object> TranscodeLatin1ToUcs2(Environment* env,
|
||||
@@ -180,7 +180,7 @@ MaybeLocal<Object> TranscodeLatin1ToUcs2(Environment* env,
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877
|
||||
}
|
||||
|
||||
MaybeLocal<Object> TranscodeFromUcs2(Environment* env,
|
||||
@@ -228,7 +228,7 @@ MaybeLocal<Object> TranscodeUcs2FromUtf8(Environment* env,
|
||||
@@ -225,7 +225,7 @@ MaybeLocal<Object> TranscodeUcs2FromUtf8(Environment* env,
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877
|
||||
}
|
||||
|
||||
MaybeLocal<Object> TranscodeUtf8FromUcs2(Environment* env,
|
||||
@@ -252,7 +252,7 @@ MaybeLocal<Object> TranscodeUtf8FromUcs2(Environment* env,
|
||||
@@ -249,7 +249,7 @@ MaybeLocal<Object> TranscodeUtf8FromUcs2(Environment* env,
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Instead of disabling the tests, flag them as flaky so they still run
|
||||
but don't cause CI failures on flakes.
|
||||
|
||||
diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status
|
||||
index 79a953df7da64b7d7580e099a5cc5160e7842999..94616df356cab50c8ef4099e7863f5986deed377 100644
|
||||
index a7860449225092529e1a262aed3f30fb21212e9d..1a55ea53c602b3fede260fffc173dfabc0f594d4 100644
|
||||
--- a/test/parallel/parallel.status
|
||||
+++ b/test/parallel/parallel.status
|
||||
@@ -5,6 +5,16 @@ prefix parallel
|
||||
@@ -28,7 +28,7 @@ index 79a953df7da64b7d7580e099a5cc5160e7842999..94616df356cab50c8ef4099e7863f598
|
||||
test-net-write-fully-async-hex-string: PASS, FLAKY
|
||||
# https://github.com/nodejs/node/issues/52273
|
||||
diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status
|
||||
index 073b29cce8dbca4c8d92ad666f9244ad511296db..338d20263f29a630febb96567f3cb708623bd09a 100644
|
||||
index dd2275ddc9540464d838476f998cea683d5ceccc..796e3c56174d9cd2b9d3969150d9605b32c46f0b 100644
|
||||
--- a/test/sequential/sequential.status
|
||||
+++ b/test/sequential/sequential.status
|
||||
@@ -7,6 +7,18 @@ prefix sequential
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
chore_allow_customizing_microtask_policy_per_context.patch
|
||||
deps_add_v8_object_setinternalfieldfornodecore.patch
|
||||
revert_fastapi_promote_deprecation_of_fastapitypedarray.patch
|
||||
cherry-pick-2b4812d502b2.patch
|
||||
cherry-pick-91343bb45c78.patch
|
||||
|
||||
40
patches/v8/cherry-pick-2b4812d502b2.patch
Normal file
40
patches/v8/cherry-pick-2b4812d502b2.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Olivier=20Fl=C3=BCckiger?= <olivf@chromium.org>
|
||||
Date: Thu, 27 Feb 2025 09:19:22 +0100
|
||||
Subject: merged: [maglev] Add missing ClearAllocationBlock
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Fixed: 398065918
|
||||
(cherry picked from commit eb9b25970b0ad4a3f8ce23d8de3583c62e5d6b87)
|
||||
|
||||
Change-Id: I20f3979984c1df11509f1630cf4c4c4460d6a83a
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6304712
|
||||
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
|
||||
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
|
||||
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
|
||||
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
|
||||
Cr-Commit-Position: refs/branch-heads/13.4@{#29}
|
||||
Cr-Branched-From: 0f87a54dade4353b6ece1d7591ca8c66f90c1c93-refs/heads/13.4.114@{#1}
|
||||
Cr-Branched-From: 27af2e9363b2701abc5f3feb701b1dad7d1a9fe8-refs/heads/main@{#98459}
|
||||
|
||||
diff --git a/src/maglev/maglev-graph-builder.cc b/src/maglev/maglev-graph-builder.cc
|
||||
index 28032bb9d9202e0649adaf8d8120e76a5ac10f68..f0ea889c4ce81846ac4f44cb0f50cb65749f0fe8 100644
|
||||
--- a/src/maglev/maglev-graph-builder.cc
|
||||
+++ b/src/maglev/maglev-graph-builder.cc
|
||||
@@ -12171,7 +12171,13 @@ ValueNode* MaglevGraphBuilder::BuildInlinedAllocation(
|
||||
CreateHeapNumber(node->Cast<Float64Constant>()->value()),
|
||||
allocation_type);
|
||||
} else {
|
||||
- node = GetTaggedValue(node);
|
||||
+ ValueNode* new_node = GetTaggedValue(node);
|
||||
+ if (new_node != node && new_node->properties().can_allocate()) {
|
||||
+ // TODO(olivf): Remove this and instead always clear when we
|
||||
+ // emit an allocating instruction.
|
||||
+ ClearCurrentAllocationBlock();
|
||||
+ }
|
||||
+ node = new_node;
|
||||
}
|
||||
values[i] = node;
|
||||
}
|
||||
47
patches/v8/cherry-pick-91343bb45c78.patch
Normal file
47
patches/v8/cherry-pick-91343bb45c78.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Darius Mercadier <dmercadier@chromium.org>
|
||||
Date: Tue, 18 Feb 2025 09:32:04 +0100
|
||||
Subject: Disable escape analysis for TrustedHeapConstant
|
||||
|
||||
More precisely: prevent eliding objects that contain
|
||||
TrustedHeapConstant, because it can lead to this constant flowing into
|
||||
a Phis where other inputs are regular HeapConstant, which confuses
|
||||
decompression optimization and leads to memory corruption.
|
||||
|
||||
(cherry picked from commit b75e527fb521dca5e7621928846c0c7c6becc8dd)
|
||||
|
||||
Fixed: chromium:390743124
|
||||
Change-Id: Ic60e4d7dd156367f7d4bb385d422591384c3033c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6278358
|
||||
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
|
||||
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
|
||||
Auto-Submit: Darius Mercadier <dmercadier@chromium.org>
|
||||
Cr-Original-Commit-Position: refs/heads/main@{#98748}
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6317725
|
||||
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
|
||||
Commit-Queue: Gyuyoung Kim (xWF) <qkim@google.com>
|
||||
Cr-Commit-Position: refs/branch-heads/13.2@{#82}
|
||||
Cr-Branched-From: 24068c59cedad9ee976ddc05431f5f497b1ebd71-refs/heads/13.2.152@{#1}
|
||||
Cr-Branched-From: 6054ba94db0969220be4f94dc1677fc4696bdc4f-refs/heads/main@{#97085}
|
||||
|
||||
diff --git a/src/compiler/escape-analysis.cc b/src/compiler/escape-analysis.cc
|
||||
index eb223bc9113b0af22a61c81c879c1ef5a9ec9ba8..c9a7bc999a7163d4b034c9a3b9ab610766f39ea6 100644
|
||||
--- a/src/compiler/escape-analysis.cc
|
||||
+++ b/src/compiler/escape-analysis.cc
|
||||
@@ -622,6 +622,16 @@ void ReduceNode(const Operator* op, EscapeAnalysisTracker::Scope* current,
|
||||
Node* value = current->ValueInput(1);
|
||||
const VirtualObject* vobject = current->GetVirtualObject(object);
|
||||
Variable var;
|
||||
+ if (value->opcode() == IrOpcode::kTrustedHeapConstant) {
|
||||
+ // TODO(dmercadier): enable escaping objects containing
|
||||
+ // TrustedHeapConstants. This is currently disabled because it leads to
|
||||
+ // bugs when Trusted HeapConstant and regular HeapConstant flow into the
|
||||
+ // same Phi, which can then be marked as Compressed, messing up the
|
||||
+ // tagging of the Trusted HeapConstant.
|
||||
+ current->SetEscaped(object);
|
||||
+ current->SetEscaped(value);
|
||||
+ break;
|
||||
+ }
|
||||
// BoundedSize fields cannot currently be materialized by the deoptimizer,
|
||||
// so we must not dematerialze them.
|
||||
if (vobject && !vobject->HasEscaped() &&
|
||||
@@ -7,6 +7,7 @@ const check = process.argv.includes('--check');
|
||||
|
||||
function findAllHeaders (basePath) {
|
||||
const allFiles = fs.readdirSync(basePath);
|
||||
allFiles.sort();
|
||||
const toReturn = [];
|
||||
for (const file of allFiles) {
|
||||
const absPath = path.resolve(basePath, file);
|
||||
@@ -48,7 +49,7 @@ for (const folder of ['libc++', 'libc++abi']) {
|
||||
const libcxxIncludeDir = path.resolve(__dirname, '..', '..', 'third_party', folder, 'src', 'include');
|
||||
const gclientPath = `third_party/${folder}/src/include`;
|
||||
|
||||
const headers = findAllHeaders(libcxxIncludeDir).map(absPath => path.relative(path.resolve(__dirname, '../..', gclientPath), absPath));
|
||||
const headers = findAllHeaders(libcxxIncludeDir).map(absPath => path.relative(path.resolve(__dirname, '../..', gclientPath), absPath).replaceAll('\\', '/'));
|
||||
|
||||
const newHeaders = headers.map(f => `//${path.posix.join(gclientPath, f)}`);
|
||||
const content = `${prettyName}_headers = [
|
||||
|
||||
@@ -1,227 +0,0 @@
|
||||
const { Octokit } = require('@octokit/rest');
|
||||
const got = require('got');
|
||||
|
||||
const assert = require('node:assert');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const { handleGitCall, ELECTRON_DIR } = require('./lib/utils.js');
|
||||
|
||||
const octokit = new Octokit();
|
||||
|
||||
const APPVEYOR_IMAGES_URL = 'https://ci.appveyor.com/api/build-clouds';
|
||||
const APPVEYOR_JOB_URL = 'https://ci.appveyor.com/api/builds';
|
||||
const ROLLER_BRANCH_PATTERN = /^roller\/chromium$/;
|
||||
|
||||
const DEFAULT_BUILD_CLOUD_ID = '1598';
|
||||
const DEFAULT_BUILD_CLOUD = 'electronhq-16-core';
|
||||
const DEFAULT_BAKE_BASE_IMAGE = 'base-bake-image';
|
||||
const DEFAULT_BUILD_IMAGE = 'base-bake-image';
|
||||
|
||||
const appveyorBakeJob = 'electron-bake-image';
|
||||
const appVeyorJobs = {
|
||||
'electron-x64': 'electron-x64-testing',
|
||||
'electron-woa': 'electron-woa-testing',
|
||||
'electron-ia32': 'electron-ia32-testing'
|
||||
};
|
||||
|
||||
async function makeRequest ({ auth, username, password, url, headers, body, method }) {
|
||||
const clonedHeaders = {
|
||||
...(headers || {})
|
||||
};
|
||||
if (auth?.bearer) {
|
||||
clonedHeaders.Authorization = `Bearer ${auth.bearer}`;
|
||||
}
|
||||
|
||||
const options = {
|
||||
headers: clonedHeaders,
|
||||
body,
|
||||
method
|
||||
};
|
||||
|
||||
if (username || password) {
|
||||
options.username = username;
|
||||
options.password = password;
|
||||
}
|
||||
|
||||
const response = await got(url, options);
|
||||
|
||||
if (response.statusCode < 200 || response.statusCode >= 300) {
|
||||
console.error('Error: ', `(status ${response.statusCode})`, response.body);
|
||||
throw new Error(`Unexpected status code ${response.statusCode} from ${url}`);
|
||||
}
|
||||
return JSON.parse(response.body);
|
||||
}
|
||||
|
||||
async function checkAppVeyorImage (options) {
|
||||
const IMAGE_URL = `${APPVEYOR_IMAGES_URL}/${options.cloudId}`;
|
||||
const requestOpts = {
|
||||
url: IMAGE_URL,
|
||||
auth: {
|
||||
bearer: process.env.APPVEYOR_TOKEN
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
method: 'GET'
|
||||
};
|
||||
|
||||
try {
|
||||
const { settings } = await makeRequest(requestOpts);
|
||||
const { cloudSettings } = settings;
|
||||
return cloudSettings.images.find(image => image.name === `${options.imageVersion}`) || null;
|
||||
} catch (err) {
|
||||
if (err.response?.body) {
|
||||
console.error('Could not call AppVeyor: ', {
|
||||
statusCode: err.response.statusCode,
|
||||
body: JSON.parse(err.response.body)
|
||||
});
|
||||
} else {
|
||||
console.error('Error calling AppVeyor:', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function getPullRequestId (targetBranch) {
|
||||
const prsForBranch = await octokit.pulls.list({
|
||||
owner: 'electron',
|
||||
repo: 'electron',
|
||||
state: 'open',
|
||||
head: `electron:${targetBranch}`
|
||||
});
|
||||
if (prsForBranch.data.length === 1) {
|
||||
return prsForBranch.data[0].number;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function useAppVeyorImage (targetBranch, options) {
|
||||
const validJobs = Object.keys(appVeyorJobs);
|
||||
if (options.job) {
|
||||
assert(validJobs.includes(options.job), `Unknown AppVeyor CI job name: ${options.job}. Valid values are: ${validJobs}.`);
|
||||
callAppVeyorBuildJobs(targetBranch, options.job, options);
|
||||
} else {
|
||||
for (const job of validJobs) {
|
||||
callAppVeyorBuildJobs(targetBranch, job, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function callAppVeyorBuildJobs (targetBranch, job, options) {
|
||||
console.log(`Using AppVeyor image ${options.version} for ${job}`);
|
||||
|
||||
const pullRequestId = await getPullRequestId(targetBranch);
|
||||
const environmentVariables = {
|
||||
APPVEYOR_BUILD_WORKER_CLOUD: DEFAULT_BUILD_CLOUD,
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: options.version,
|
||||
ELECTRON_OUT_DIR: 'Default',
|
||||
ELECTRON_ENABLE_STACK_DUMPING: 1,
|
||||
ELECTRON_ALSO_LOG_TO_STDERR: 1,
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 0,
|
||||
PYTHONIOENCODING: 'UTF-8'
|
||||
};
|
||||
|
||||
const requestOpts = {
|
||||
url: APPVEYOR_JOB_URL,
|
||||
auth: {
|
||||
bearer: process.env.APPVEYOR_TOKEN
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
accountName: 'electron-bot',
|
||||
projectSlug: appVeyorJobs[job],
|
||||
branch: targetBranch,
|
||||
pullRequestId: pullRequestId || undefined,
|
||||
commitId: options.commit || undefined,
|
||||
environmentVariables
|
||||
}),
|
||||
method: 'POST'
|
||||
};
|
||||
|
||||
try {
|
||||
const { version } = await makeRequest(requestOpts);
|
||||
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${version}`;
|
||||
console.log(`AppVeyor CI request for ${job} successful. Check status at ${buildUrl}`);
|
||||
} catch (err) {
|
||||
console.log('Could not call AppVeyor: ', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function bakeAppVeyorImage (targetBranch, options) {
|
||||
console.log(`Baking a new AppVeyor image for ${options.version}, on build cloud ${options.cloudId}`);
|
||||
|
||||
const environmentVariables = {
|
||||
APPVEYOR_BUILD_WORKER_CLOUD: DEFAULT_BUILD_CLOUD,
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: DEFAULT_BAKE_BASE_IMAGE,
|
||||
APPVEYOR_BAKE_IMAGE: options.version
|
||||
};
|
||||
|
||||
const requestOpts = {
|
||||
url: APPVEYOR_JOB_URL,
|
||||
auth: {
|
||||
bearer: process.env.APPVEYOR_TOKEN
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
accountName: 'electron-bot',
|
||||
projectSlug: appveyorBakeJob,
|
||||
branch: targetBranch,
|
||||
commitId: options.commit || undefined,
|
||||
environmentVariables
|
||||
}),
|
||||
method: 'POST'
|
||||
};
|
||||
|
||||
try {
|
||||
const { version } = await makeRequest(requestOpts);
|
||||
const bakeUrl = `https://ci.appveyor.com/project/electron-bot/${appveyorBakeJob}/build/${version}`;
|
||||
console.log(`AppVeyor image bake request for ${options.version} successful. Check bake status at ${bakeUrl}`);
|
||||
} catch (err) {
|
||||
console.log('Could not call AppVeyor: ', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function prepareAppVeyorImage (opts) {
|
||||
const branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], ELECTRON_DIR);
|
||||
if (ROLLER_BRANCH_PATTERN.test(branch)) {
|
||||
useAppVeyorImage(branch, { ...opts, version: DEFAULT_BUILD_IMAGE, cloudId: DEFAULT_BUILD_CLOUD_ID });
|
||||
} else {
|
||||
const versionRegex = /chromium_version':\n +'(.+?)',/m;
|
||||
const deps = fs.readFileSync(path.resolve(__dirname, '..', 'DEPS'), 'utf8');
|
||||
const [, CHROMIUM_VERSION] = versionRegex.exec(deps);
|
||||
|
||||
const cloudId = opts.cloudId || DEFAULT_BUILD_CLOUD_ID;
|
||||
const imageVersion = opts.imageVersion || `e-${CHROMIUM_VERSION}`;
|
||||
const image = await checkAppVeyorImage({ cloudId, imageVersion });
|
||||
|
||||
if (image && image.name) {
|
||||
console.log(`Image exists for ${image.name}. Continuing AppVeyor jobs using ${cloudId}.\n`);
|
||||
} else {
|
||||
console.log(`No AppVeyor image found for ${imageVersion} in ${cloudId}.
|
||||
Creating new image for ${imageVersion}, using Chromium ${CHROMIUM_VERSION} - job will run after image is baked.`);
|
||||
await bakeAppVeyorImage(branch, { ...opts, version: imageVersion, cloudId });
|
||||
|
||||
// write image to temp file if running on CI
|
||||
if (process.env.CI) fs.writeFileSync('./image_version.txt', imageVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = prepareAppVeyorImage;
|
||||
|
||||
// Load or bake AppVeyor images for Windows CI.
|
||||
// Usage: prepare-appveyor.js [--cloudId=CLOUD_ID] [--appveyorJobId=xxx] [--imageVersion=xxx]
|
||||
// [--commit=sha] [--branch=branch_name]
|
||||
if (require.main === module) {
|
||||
const args = require('minimist')(process.argv.slice(2));
|
||||
prepareAppVeyorImage(args)
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
@@ -2,23 +2,31 @@ const { appCredentialsFromString, getTokenForRepo } = require('@electron/github-
|
||||
|
||||
const cp = require('node:child_process');
|
||||
|
||||
const { PATCH_UP_APP_CREDS } = process.env;
|
||||
|
||||
async function main () {
|
||||
if (!PATCH_UP_APP_CREDS) {
|
||||
throw new Error('PATCH_UP_APP_CREDS environment variable not set');
|
||||
}
|
||||
|
||||
const token = await getTokenForRepo(
|
||||
{
|
||||
name: 'electron',
|
||||
owner: 'electron'
|
||||
},
|
||||
appCredentialsFromString(process.env.PATCH_UP_APP_CREDS)
|
||||
appCredentialsFromString(PATCH_UP_APP_CREDS)
|
||||
);
|
||||
|
||||
const remoteURL = `https://x-access-token:${token}@github.com/electron/electron.git`;
|
||||
|
||||
// NEVER LOG THE OUTPUT OF THIS COMMAND
|
||||
// GIT LEAKS THE ACCESS CREDENTIALS IN CONSOLE LOGS
|
||||
const { status } = cp.spawnSync('git', ['push', '--set-upstream', remoteURL], {
|
||||
stdio: 'ignore'
|
||||
});
|
||||
|
||||
if (status !== 0) {
|
||||
console.error('Failed to push to target branch');
|
||||
process.exit(1);
|
||||
throw new Error('Failed to push to target branch');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"bullseye_amd64": {
|
||||
"Key": "20230611T210420Z-2",
|
||||
"Sha256Sum": "7c93e71bf9c4cd0825aa59fb2479054d981e36ba9be34ecf4c1d73051cae40fe",
|
||||
"Sha256Sum": "0be326b106f0df7b8547ec8d3b58ccb95435c8414a45cda675c4805821d4d860",
|
||||
"SysrootDir": "debian_bullseye_amd64-sysroot",
|
||||
"Tarball": "debian_bullseye_amd64_sysroot.tar.xz",
|
||||
"URL": "https://dev-cdn.electronjs.org/linux-sysroots"
|
||||
},
|
||||
"bullseye_arm64": {
|
||||
"Key": "20230611T210420Z-2",
|
||||
"Sha256Sum": "d649177e37aef2c043e54e670e42934f18558c0e730c1b854719ca7463e2b1eb",
|
||||
"Sha256Sum": "1225cd518c1609e54033bb6a1c687875d4f4c21b2dbd5d5d81c4b5927d0fc0f1",
|
||||
"SysrootDir": "debian_bullseye_arm64-sysroot",
|
||||
"Tarball": "debian_bullseye_arm64_sysroot.tar.xz",
|
||||
"URL": "https://dev-cdn.electronjs.org/linux-sysroots"
|
||||
@@ -22,28 +22,28 @@
|
||||
},
|
||||
"bullseye_armhf": {
|
||||
"Key": "20230611T210420Z-2",
|
||||
"Sha256Sum": "fe3b9203e30e70f533776d565501bc1e3d4ebf6eeb909b2c2bfca0df807e1be0",
|
||||
"Sha256Sum": "ed5a71ce5fc6d1691817c3b203139328ee88395c9e54ff726f67c84ee1561e65",
|
||||
"SysrootDir": "debian_bullseye_armhf-sysroot",
|
||||
"Tarball": "debian_bullseye_armhf_sysroot.tar.xz",
|
||||
"URL": "https://dev-cdn.electronjs.org/linux-sysroots"
|
||||
},
|
||||
"bullseye_i386": {
|
||||
"Key": "20230611T210420Z-2",
|
||||
"Sha256Sum": "4efcb1870129da1ad5c3b634903a4efcc0ca9abd67dd5a993cca144ea9b5d31f",
|
||||
"Sha256Sum": "57f800042b0c4bd00a8755da165823cc70decc0481b78d751924db7470af6b5e",
|
||||
"SysrootDir": "debian_bullseye_i386-sysroot",
|
||||
"Tarball": "debian_bullseye_i386_sysroot.tar.xz",
|
||||
"URL": "https://dev-cdn.electronjs.org/linux-sysroots"
|
||||
},
|
||||
"bullseye_mips64el": {
|
||||
"Key": "20230611T210420Z-2",
|
||||
"Sha256Sum": "c3a3bf3b0aa40ec90747c951942d40077ff6796b336818eaba6fa21564249a00",
|
||||
"Sha256Sum": "187b8644a949d0124cb00fa099a8a5842e9a88bb48d8d1c682604ebf546796b7",
|
||||
"SysrootDir": "debian_bullseye_mips64el-sysroot",
|
||||
"Tarball": "debian_bullseye_mips64el_sysroot.tar.xz",
|
||||
"URL": "https://dev-cdn.electronjs.org/linux-sysroots"
|
||||
},
|
||||
"bullseye_mipsel": {
|
||||
"Key": "20230611T210420Z-2",
|
||||
"Sha256Sum": "564de884ed1810e1cf3a20d94edfa21972ac2be9568bf1526d093c31f15ef225",
|
||||
"Sha256Sum": "f08771dc7a813e7f0fd540b49a1b611416979630b0009e9ecc51f999a7543081",
|
||||
"SysrootDir": "debian_bullseye_mipsel-sysroot",
|
||||
"Tarball": "debian_bullseye_mipsel_sysroot.tar.xz",
|
||||
"URL": "https://dev-cdn.electronjs.org/linux-sysroots"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/command_line.h"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/debug/alias.h"
|
||||
|
||||
@@ -90,7 +90,10 @@
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include "base/no_destructor.h"
|
||||
#include "content/browser/mac_helpers.h"
|
||||
#include "shell/browser/ui/cocoa/electron_bundle_mover.h"
|
||||
#include "shell/common/process_util.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
@@ -898,6 +901,21 @@ bool App::IsPackaged() {
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return base_name != FILE_PATH_LITERAL("electron.exe");
|
||||
#elif BUILDFLAG(IS_MAC)
|
||||
static const base::NoDestructor<std::string> default_helper(
|
||||
"electron helper" +
|
||||
base::ToLowerASCII(content::kMacHelperSuffix_default));
|
||||
static const base::NoDestructor<std::string> renderer_helper(
|
||||
"electron helper" +
|
||||
base::ToLowerASCII(content::kMacHelperSuffix_renderer));
|
||||
static const base::NoDestructor<std::string> plugin_helper(
|
||||
"electron helper" + base::ToLowerASCII(content::kMacHelperSuffix_plugin));
|
||||
if (IsRendererProcess()) {
|
||||
return base_name != *renderer_helper;
|
||||
} else if (IsUtilityProcess()) {
|
||||
return base_name != *default_helper && base_name != *plugin_helper;
|
||||
}
|
||||
return base_name != FILE_PATH_LITERAL("electron");
|
||||
#else
|
||||
return base_name != FILE_PATH_LITERAL("electron");
|
||||
#endif
|
||||
|
||||
@@ -47,8 +47,8 @@ void AutoUpdater::OnError(const std::string& message) {
|
||||
};
|
||||
|
||||
gin_helper::MicrotasksScope microtasks_scope{
|
||||
isolate, wrapper->GetCreationContextChecked()->GetMicrotaskQueue(),
|
||||
true, v8::MicrotasksScope::kRunMicrotasks};
|
||||
wrapper->GetCreationContextChecked(), true,
|
||||
v8::MicrotasksScope::kRunMicrotasks};
|
||||
|
||||
node::MakeCallback(isolate, wrapper, "emit", args.size(), args.data(),
|
||||
{0, 0});
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "content/public/common/color_parser.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
@@ -696,6 +695,10 @@ void BaseWindow::SetContentProtection(bool enable) {
|
||||
return window_->SetContentProtection(enable);
|
||||
}
|
||||
|
||||
bool BaseWindow::IsContentProtected() const {
|
||||
return window_->IsContentProtected();
|
||||
}
|
||||
|
||||
void BaseWindow::SetFocusable(bool focusable) {
|
||||
return window_->SetFocusable(focusable);
|
||||
}
|
||||
@@ -1014,7 +1017,7 @@ void BaseWindow::UnhookWindowMessage(UINT message) {
|
||||
}
|
||||
|
||||
bool BaseWindow::IsWindowMessageHooked(UINT message) {
|
||||
return base::Contains(messages_callback_map_, message);
|
||||
return messages_callback_map_.contains(message);
|
||||
}
|
||||
|
||||
void BaseWindow::UnhookAllWindowMessages() {
|
||||
@@ -1224,6 +1227,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("isDocumentEdited", &BaseWindow::IsDocumentEdited)
|
||||
.SetMethod("setIgnoreMouseEvents", &BaseWindow::SetIgnoreMouseEvents)
|
||||
.SetMethod("setContentProtection", &BaseWindow::SetContentProtection)
|
||||
.SetMethod("_isContentProtected", &BaseWindow::IsContentProtected)
|
||||
.SetMethod("setFocusable", &BaseWindow::SetFocusable)
|
||||
.SetMethod("isFocusable", &BaseWindow::IsFocusable)
|
||||
.SetMethod("setMenu", &BaseWindow::SetMenu)
|
||||
|
||||
@@ -175,6 +175,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
bool IsDocumentEdited() const;
|
||||
void SetIgnoreMouseEvents(bool ignore, gin_helper::Arguments* args);
|
||||
void SetContentProtection(bool enable);
|
||||
bool IsContentProtected() const;
|
||||
void SetFocusable(bool focusable);
|
||||
bool IsFocusable() const;
|
||||
void SetMenu(v8::Isolate* isolate, v8::Local<v8::Value> menu);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include "base/containers/span.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "content/public/browser/devtools_agent_host.h"
|
||||
@@ -44,8 +45,7 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
|
||||
std::string_view message_str(reinterpret_cast<const char*>(message.data()),
|
||||
message.size());
|
||||
const std::string_view message_str = base::as_string_view(message);
|
||||
std::optional<base::Value> parsed_message = base::JSONReader::Read(
|
||||
message_str, base::JSON_REPLACE_INVALID_CHARACTERS);
|
||||
if (!parsed_message || !parsed_message->is_dict())
|
||||
|
||||
@@ -326,8 +326,9 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
||||
window_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
window_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kWindow) ? 2
|
||||
: 0;
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kWindow)
|
||||
? thumbnail_size.IsEmpty() ? 1 : 2
|
||||
: 0;
|
||||
#endif
|
||||
|
||||
OnceCallback update_callback = base::BindOnce(
|
||||
@@ -356,8 +357,9 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
||||
screen_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
screen_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kScreen) ? 2
|
||||
: 0;
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kScreen)
|
||||
? thumbnail_size.IsEmpty() ? 1 : 2
|
||||
: 0;
|
||||
#endif
|
||||
|
||||
OnceCallback update_callback = base::BindOnce(
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "extensions/common/command.h"
|
||||
#include "gin/dictionary.h"
|
||||
#include "gin/handle.h"
|
||||
@@ -46,14 +45,14 @@ namespace electron::api {
|
||||
|
||||
gin::WrapperInfo GlobalShortcut::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||
|
||||
GlobalShortcut::GlobalShortcut(v8::Isolate* isolate) {}
|
||||
GlobalShortcut::GlobalShortcut() {}
|
||||
|
||||
GlobalShortcut::~GlobalShortcut() {
|
||||
UnregisterAll();
|
||||
}
|
||||
|
||||
void GlobalShortcut::OnKeyPressed(const ui::Accelerator& accelerator) {
|
||||
if (!base::Contains(accelerator_callback_map_, accelerator)) {
|
||||
if (!accelerator_callback_map_.contains(accelerator)) {
|
||||
// This should never occur, because if it does, GlobalShortcutListener
|
||||
// notifies us with wrong accelerator.
|
||||
NOTREACHED();
|
||||
@@ -136,7 +135,7 @@ void GlobalShortcut::UnregisterSome(
|
||||
}
|
||||
|
||||
bool GlobalShortcut::IsRegistered(const ui::Accelerator& accelerator) {
|
||||
return base::Contains(accelerator_callback_map_, accelerator);
|
||||
return accelerator_callback_map_.contains(accelerator);
|
||||
}
|
||||
|
||||
void GlobalShortcut::UnregisterAll() {
|
||||
@@ -151,7 +150,7 @@ void GlobalShortcut::UnregisterAll() {
|
||||
|
||||
// static
|
||||
gin::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) {
|
||||
return gin::CreateHandle(isolate, new GlobalShortcut(isolate));
|
||||
return gin::CreateHandle(isolate, new GlobalShortcut());
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user