mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
47 Commits
v34.0.0-be
...
v34.0.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
314bc3e1a1 | ||
|
|
33065a8654 | ||
|
|
52484b0ccd | ||
|
|
b5ed025267 | ||
|
|
bcbd3063a3 | ||
|
|
686bc86042 | ||
|
|
fd117af7ce | ||
|
|
40dd1b76bc | ||
|
|
521835d70b | ||
|
|
cfe549c739 | ||
|
|
2d45b7df34 | ||
|
|
9a7848ced1 | ||
|
|
c54f1f98fe | ||
|
|
a7066af0f9 | ||
|
|
7f6594654c | ||
|
|
f383391c0e | ||
|
|
ed0946c880 | ||
|
|
d1eee44b19 | ||
|
|
498a7d82cc | ||
|
|
dc53f6e73b | ||
|
|
fa98b4d542 | ||
|
|
1c2015ed1f | ||
|
|
d0668e6a3a | ||
|
|
d7284f0262 | ||
|
|
b33ea0d72d | ||
|
|
c63613f290 | ||
|
|
dc0c6c6f3f | ||
|
|
a92b3944a1 | ||
|
|
5ca3f950e9 | ||
|
|
99f2bab4a4 | ||
|
|
c0d1c3481a | ||
|
|
5a0e1ccf73 | ||
|
|
d8a7c57506 | ||
|
|
a30cf5b551 | ||
|
|
6208b61a38 | ||
|
|
73243cb9c4 | ||
|
|
5670b17b40 | ||
|
|
103a7c1838 | ||
|
|
cfdf7992d3 | ||
|
|
7d260a1305 | ||
|
|
d2bafe870e | ||
|
|
bbdce52b12 | ||
|
|
b72b661f3c | ||
|
|
b6f97b7952 | ||
|
|
787d4c3859 | ||
|
|
19e6ca921f | ||
|
|
14c705349e |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,6 +1,9 @@
|
||||
# `git apply` and friends don't understand CRLF, even on windows. Force those
|
||||
# files to be checked out with LF endings even if core.autocrlf is true.
|
||||
*.patch text eol=lf
|
||||
DEPS text eol=lf
|
||||
yarn.lock text eol=lf
|
||||
script/zip_manifests/*.manifest text eol=lf
|
||||
patches/**/.patches merge=union
|
||||
|
||||
# Source code and markdown files should always use LF as line ending.
|
||||
|
||||
18
.github/actions/build-electron/action.yml
vendored
18
.github/actions/build-electron/action.yml
vendored
@@ -5,10 +5,10 @@ inputs:
|
||||
description: 'Target arch'
|
||||
required: true
|
||||
target-platform:
|
||||
description: 'Target platform'
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
required: true
|
||||
artifact-platform:
|
||||
description: 'Artifact platform, should be linux, darwin or mas'
|
||||
description: 'Artifact platform, should be linux, win, darwin or mas'
|
||||
required: true
|
||||
step-suffix:
|
||||
description: 'Suffix for build steps'
|
||||
@@ -71,7 +71,7 @@ runs:
|
||||
cd src
|
||||
e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||
if [ "${{ inputs.is-asan }}" != "true" ]; then
|
||||
target_os=${{ inputs.target-platform == 'linux' && 'linux' || 'mac'}}
|
||||
target_os=${{ inputs.target-platform == 'macos' && 'mac' || inputs.target-platform }}
|
||||
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
||||
target_os="${target_os}_mas"
|
||||
fi
|
||||
@@ -82,7 +82,7 @@ runs:
|
||||
run: |
|
||||
cd src
|
||||
e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
|
||||
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||
ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||
# Remove unused args from mksnapshot_args
|
||||
SEDOPTION="-i"
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
@@ -91,7 +91,7 @@ runs:
|
||||
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
||||
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||
|
||||
if [ "`uname`" = "Linux" ]; then
|
||||
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
||||
@@ -105,7 +105,13 @@ runs:
|
||||
fi
|
||||
|
||||
e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
|
||||
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
|
||||
else
|
||||
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
|
||||
fi
|
||||
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
|
||||
|
||||
70
.github/actions/checkout/action.yml
vendored
70
.github/actions/checkout/action.yml
vendored
@@ -5,6 +5,10 @@ inputs:
|
||||
description: 'Whether to generate and persist a SAS token for the item in the cache'
|
||||
required: false
|
||||
default: 'false'
|
||||
use-cache:
|
||||
description: 'Whether to persist the cache to the shared drive'
|
||||
required: false
|
||||
default: 'true'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
@@ -13,31 +17,27 @@ runs:
|
||||
run: |
|
||||
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
||||
- name: Install Dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Get Depot Tools
|
||||
shell: bash
|
||||
run: |
|
||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
if [[ ! -d depot_tools ]]; then
|
||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
|
||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
|
||||
cd depot_tools
|
||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
# 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 && cat src/electron/.depshash-target
|
||||
echo "DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
echo "DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||
- name: Generate SAS Key
|
||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||
shell: bash
|
||||
@@ -54,18 +54,23 @@ runs:
|
||||
id: check-cache
|
||||
shell: bash
|
||||
run: |
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking for cache in: $cache_path"
|
||||
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
||||
if [[ "${{ inputs.use-cache }}" == "false" ]]; then
|
||||
echo "Not using cache this time..."
|
||||
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||
echo "Cache Does Not Exist for $DEPSHASH"
|
||||
else
|
||||
echo "cache_exists=true" >> $GITHUB_OUTPUT
|
||||
echo "Cache Already Exists for $DEPSHASH, Skipping.."
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking for cache in: $cache_path"
|
||||
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
||||
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||
echo "Cache Does Not Exist for $DEPSHASH"
|
||||
else
|
||||
echo "cache_exists=true" >> $GITHUB_OUTPUT
|
||||
echo "Cache Already Exists for $DEPSHASH, Skipping.."
|
||||
fi
|
||||
fi
|
||||
- name: Check cross instance cache disk space
|
||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||
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
|
||||
@@ -81,13 +86,17 @@ runs:
|
||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||
shell: bash
|
||||
run: |
|
||||
gclient config \
|
||||
e d gclient config \
|
||||
--name "src/electron" \
|
||||
--unmanaged \
|
||||
${GCLIENT_EXTRA_ARGS} \
|
||||
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
||||
|
||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags -vvvvv
|
||||
if [ "$TARGET_OS" != "" ]; then
|
||||
echo "target_os=['$TARGET_OS']" >> ./.gclient
|
||||
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
|
||||
# Re-export all the patches to check if there were changes.
|
||||
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||
@@ -128,13 +137,13 @@ runs:
|
||||
# https://dawn-review.googlesource.com/c/dawn/+/83901
|
||||
# TODO: maybe better to always leave out */.git/HEAD file for all targets ?
|
||||
- name: Delete .git directories under src to free space
|
||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd src
|
||||
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
|
||||
- name: Minimize Cache Size for Upload
|
||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf src/android_webview
|
||||
@@ -145,9 +154,12 @@ runs:
|
||||
rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
|
||||
rm -rf src/third_party/swift-toolchain
|
||||
rm -rf src/third_party/swiftshader/tests/regres/testlists
|
||||
cp src/electron/.github/actions/checkout/action.yml ./
|
||||
rm -rf src/electron
|
||||
mkdir -p src/electron/.github/actions/checkout
|
||||
mv action.yml src/electron/.github/actions/checkout
|
||||
- name: Compress Src Directory
|
||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
|
||||
@@ -155,7 +167,7 @@ runs:
|
||||
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
|
||||
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
|
||||
- name: Persist Src Cache
|
||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
|
||||
11
.github/actions/install-build-tools/action.yml
vendored
11
.github/actions/install-build-tools/action.yml
vendored
@@ -6,6 +6,15 @@ runs:
|
||||
- name: Install Build Tools
|
||||
shell: bash
|
||||
run: |
|
||||
export BUILD_TOOLS_SHA=eeb1a11392e4cec08fd926c93b31ab556dc0c23b
|
||||
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||
git config --global core.filemode false
|
||||
git config --global core.autocrlf false
|
||||
git config --global branch.autosetuprebase always
|
||||
fi
|
||||
export BUILD_TOOLS_SHA=8246e57791b0af4ae5975eb96f09855f9269b1cd
|
||||
npm i -g @electron/build-tools
|
||||
e auto-update disable
|
||||
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||
e d cipd.bat --version
|
||||
cp "C:\Python37\python.exe" "C:\Python37\python3.exe"
|
||||
fi
|
||||
|
||||
21
.github/actions/install-dependencies/action.yml
vendored
Normal file
21
.github/actions/install-dependencies/action.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: 'Install Dependencies'
|
||||
description: 'Installs yarn depdencies using cache when available'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Get yarn cache directory path
|
||||
shell: bash
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "dir=$(node src/electron/script/yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('src/electron/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install Dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile --prefer-offline
|
||||
140
.github/workflows/build.yml
vendored
140
.github/workflows/build.yml
vendored
@@ -18,6 +18,11 @@ on:
|
||||
description: 'Skip Linux builds'
|
||||
default: false
|
||||
required: false
|
||||
skip-windows:
|
||||
type: boolean
|
||||
description: 'Skip Windows builds'
|
||||
default: false
|
||||
required: false
|
||||
skip-lint:
|
||||
type: boolean
|
||||
description: 'Skip lint check'
|
||||
@@ -28,7 +33,11 @@ on:
|
||||
- main
|
||||
- '[1-9][0-9]-x-y'
|
||||
pull_request:
|
||||
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -40,7 +49,9 @@ jobs:
|
||||
build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
|
||||
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
||||
steps:
|
||||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.0.2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: filter
|
||||
with:
|
||||
@@ -98,6 +109,7 @@ jobs:
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
@@ -124,9 +136,68 @@ jobs:
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
|
||||
checkout-windows:
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
runs-on: electron-arc-linux-amd64-32core
|
||||
container:
|
||||
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
|
||||
env:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||
TARGET_OS: 'win'
|
||||
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||
outputs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
|
||||
# GN Check Jobs
|
||||
macos-gn-check:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||
needs: checkout-macos
|
||||
with:
|
||||
target-platform: macos
|
||||
target-archs: x64 arm64
|
||||
check-runs-on: macos-14
|
||||
gn-build-type: testing
|
||||
secrets: inherit
|
||||
|
||||
linux-gn-check:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||
needs: checkout-linux
|
||||
with:
|
||||
target-platform: linux
|
||||
target-archs: x64 arm arm64
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
gn-build-type: testing
|
||||
secrets: inherit
|
||||
|
||||
windows-gn-check:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||
needs: checkout-windows
|
||||
with:
|
||||
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"]}'
|
||||
gn-build-type: testing
|
||||
secrets: inherit
|
||||
|
||||
# Build Jobs - These cascade into testing jobs
|
||||
macos-x64:
|
||||
permissions:
|
||||
@@ -137,7 +208,6 @@ jobs:
|
||||
needs: checkout-macos
|
||||
with:
|
||||
build-runs-on: macos-14-xlarge
|
||||
check-runs-on: macos-14
|
||||
test-runs-on: macos-13
|
||||
target-platform: macos
|
||||
target-arch: x64
|
||||
@@ -156,7 +226,6 @@ jobs:
|
||||
needs: checkout-macos
|
||||
with:
|
||||
build-runs-on: macos-14-xlarge
|
||||
check-runs-on: macos-14
|
||||
test-runs-on: macos-14
|
||||
target-platform: macos
|
||||
target-arch: arm64
|
||||
@@ -175,7 +244,6 @@ jobs:
|
||||
needs: checkout-linux
|
||||
with:
|
||||
build-runs-on: electron-arc-linux-amd64-32core
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
test-runs-on: electron-arc-linux-amd64-4core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||
@@ -196,7 +264,6 @@ jobs:
|
||||
needs: checkout-linux
|
||||
with:
|
||||
build-runs-on: electron-arc-linux-amd64-32core
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
test-runs-on: electron-arc-linux-amd64-4core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||
@@ -218,7 +285,6 @@ jobs:
|
||||
needs: checkout-linux
|
||||
with:
|
||||
build-runs-on: electron-arc-linux-amd64-32core
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
test-runs-on: electron-arc-linux-arm64-4core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
test-container: '{"image":"ghcr.io/electron/test:arm32v7-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init","volumes":["/home/runner/externals:/mnt/runner-externals"]}'
|
||||
@@ -239,7 +305,6 @@ jobs:
|
||||
needs: checkout-linux
|
||||
with:
|
||||
build-runs-on: electron-arc-linux-amd64-32core
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
test-runs-on: electron-arc-linux-arm64-4core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
test-container: '{"image":"ghcr.io/electron/test:arm64v8-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||
@@ -251,10 +316,67 @@ jobs:
|
||||
upload-to-storage: '0'
|
||||
secrets: inherit
|
||||
|
||||
windows-x64:
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
test-runs-on: windows-latest
|
||||
target-platform: win
|
||||
target-arch: x64
|
||||
is-release: false
|
||||
gn-build-type: testing
|
||||
generate-symbols: false
|
||||
upload-to-storage: '0'
|
||||
secrets: inherit
|
||||
|
||||
windows-x86:
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
test-runs-on: windows-latest
|
||||
target-platform: win
|
||||
target-arch: x86
|
||||
is-release: false
|
||||
gn-build-type: testing
|
||||
generate-symbols: false
|
||||
upload-to-storage: '0'
|
||||
secrets: inherit
|
||||
|
||||
windows-arm64:
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
test-runs-on: electron-hosted-windows-arm64-4core
|
||||
target-platform: win
|
||||
target-arch: arm64
|
||||
is-release: false
|
||||
gn-build-type: testing
|
||||
generate-symbols: false
|
||||
upload-to-storage: '0'
|
||||
secrets: inherit
|
||||
|
||||
gha-done:
|
||||
name: GitHub Actions Completed
|
||||
runs-on: ubuntu-latest
|
||||
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64]
|
||||
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64]
|
||||
if: always() && !contains(needs.*.result, 'failure')
|
||||
steps:
|
||||
- name: GitHub Actions Jobs Done
|
||||
|
||||
14
.github/workflows/config/gclient.diff
vendored
14
.github/workflows/config/gclient.diff
vendored
@@ -1,14 +0,0 @@
|
||||
diff --git a/gclient.py b/gclient.py
|
||||
index 59e2b4c5197928bdba1ef69bdbe637d7dfe471c1..b4bae5e48c83c84bd867187afaf40eed16e69851 100755
|
||||
--- a/gclient.py
|
||||
+++ b/gclient.py
|
||||
@@ -783,7 +783,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
|
||||
not condition or "non_git_source" not in condition):
|
||||
continue
|
||||
cipd_root = self.GetCipdRoot()
|
||||
- for package in dep_value.get('packages', []):
|
||||
+ packages = dep_value.get('packages', [])
|
||||
+ for package in (x for x in packages if "infra/3pp/tools/swift-format" not in x.get('package')):
|
||||
deps_to_add.append(
|
||||
CipdDependency(parent=self,
|
||||
name=name,
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos or linux'
|
||||
description: 'Platform to run on, can be macos, win or linux.'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
@@ -15,10 +15,6 @@ on:
|
||||
type: string
|
||||
description: 'What host to run the build'
|
||||
required: true
|
||||
check-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the gn-check'
|
||||
required: true
|
||||
test-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the tests on'
|
||||
@@ -76,16 +72,6 @@ jobs:
|
||||
generate-symbols: ${{ inputs.generate-symbols }}
|
||||
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||
secrets: inherit
|
||||
gn-check:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
check-runs-on: ${{ inputs.check-runs-on }}
|
||||
check-container: ${{ inputs.build-container }}
|
||||
gn-build-type: ${{ inputs.gn-build-type }}
|
||||
is-asan: ${{ inputs.is-asan }}
|
||||
secrets: inherit
|
||||
test:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||
needs: build
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos or linux'
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
@@ -15,10 +15,6 @@ on:
|
||||
type: string
|
||||
description: 'What host to run the build'
|
||||
required: true
|
||||
check-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the gn-check'
|
||||
required: true
|
||||
test-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the tests on'
|
||||
@@ -82,16 +78,6 @@ jobs:
|
||||
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||
is-asan: ${{ inputs.is-asan}}
|
||||
secrets: inherit
|
||||
gn-check:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
check-runs-on: ${{ inputs.check-runs-on }}
|
||||
check-container: ${{ inputs.build-container }}
|
||||
gn-build-type: ${{ inputs.gn-build-type }}
|
||||
is-asan: ${{ inputs.is-asan }}
|
||||
secrets: inherit
|
||||
test:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||
needs: build
|
||||
|
||||
@@ -24,10 +24,9 @@ jobs:
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Run TS/JS compile
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
5
.github/workflows/pipeline-electron-lint.yml
vendored
5
.github/workflows/pipeline-electron-lint.yml
vendored
@@ -24,10 +24,9 @@ jobs:
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Setup third_party Depot Tools
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -9,7 +9,7 @@ on:
|
||||
type: string
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos or linux'
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
@@ -69,11 +69,14 @@ env:
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
|
||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || inputs.target-platform == 'win' && '--custom-var=checkout_win=True' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
||||
ELECTRON_OUT_DIR: Default
|
||||
|
||||
jobs:
|
||||
build:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
runs-on: ${{ inputs.build-runs-on }}
|
||||
container: ${{ fromJSON(inputs.build-container) }}
|
||||
environment: ${{ inputs.environment }}
|
||||
@@ -81,12 +84,14 @@ jobs:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
steps:
|
||||
- name: Create src dir
|
||||
run: mkdir src
|
||||
run: |
|
||||
mkdir src
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Free up space (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/free-space-macos
|
||||
@@ -101,9 +106,7 @@ jobs:
|
||||
cache: yarn
|
||||
cache-dependency-path: src/electron/yarn.lock
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Install AZCopy
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: brew install azcopy
|
||||
@@ -137,16 +140,13 @@ jobs:
|
||||
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
if [ "`uname`" = "Linux" ]; then
|
||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||
fi
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Generate DEPS Hash
|
||||
run: |
|
||||
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||
DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
|
||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||
- name: Restore src cache via AZCopy
|
||||
@@ -155,11 +155,17 @@ jobs:
|
||||
- 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: Init Build Tools
|
||||
@@ -167,11 +173,11 @@ jobs:
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- name: Run Electron Only Hooks
|
||||
run: |
|
||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
||||
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
||||
- name: Regenerate DEPS Hash
|
||||
run: |
|
||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||
echo "DEPSHASH=$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
|
||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||
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)
|
||||
@@ -179,7 +185,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/fix-sync-macos
|
||||
- name: Setup Number of Ninja Processes
|
||||
run: |
|
||||
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform == 'linux' && '300' || '200' }}" >> $GITHUB_ENV
|
||||
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
|
||||
- name: Free up space (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/free-space-macos
|
||||
@@ -189,7 +195,7 @@ jobs:
|
||||
with:
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
artifact-platform: ${{ inputs.target-platform == 'linux' && 'linux' || 'darwin' }}
|
||||
artifact-platform: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
|
||||
is-release: '${{ inputs.is-release }}'
|
||||
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||
strip-binaries: '${{ inputs.strip-binaries }}'
|
||||
|
||||
@@ -5,11 +5,11 @@ on:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos or linux'
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
target-archs:
|
||||
type: string
|
||||
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||
description: 'Archs to check for, can be x64, x86, arm64 or arm space separated'
|
||||
required: true
|
||||
check-runs-on:
|
||||
type: string
|
||||
@@ -25,35 +25,30 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
default: testing
|
||||
is-asan:
|
||||
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: electron-gn-check-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref }}
|
||||
group: electron-gn-check-${{ inputs.target-platform }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
|
||||
ELECTRON_OUT_DIR: Default
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
|
||||
jobs:
|
||||
gn-check:
|
||||
# TODO(codebytere): Change this to medium VM
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
runs-on: ${{ inputs.check-runs-on }}
|
||||
container: ${{ fromJSON(inputs.check-container) }}
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Cleanup disk space on macOS
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
@@ -73,58 +68,40 @@ jobs:
|
||||
run: df -h
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
- name: Enable windows toolchain
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- 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
|
||||
if [ "`uname`" = "Linux" ]; then
|
||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||
fi
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Set GN_EXTRA_ARGS for Linux
|
||||
if: ${{ inputs.target-platform == 'linux' }}
|
||||
run: |
|
||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||
GN_EXTRA_ARGS='build_tflite_with_xnnpack=false'
|
||||
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||
GN_EXTRA_ARGS='fatal_linker_warnings=false enable_linux_installer=false'
|
||||
fi
|
||||
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||
- name: Generate DEPS Hash
|
||||
run: |
|
||||
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||
DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
|
||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||
- name: Restore src cache via AZCopy
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||
- name: Restore src cache via AKS
|
||||
if: ${{ inputs.target-platform == 'linux' }}
|
||||
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
- name: Run Electron Only Hooks
|
||||
run: |
|
||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
||||
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
|
||||
echo "target_os=['win']" >> tmpgclient
|
||||
fi
|
||||
e d gclient runhooks --gclientfile=tmpgclient
|
||||
|
||||
# Fix VS Toolchain
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
rm -rf src/third_party/depot_tools/win_toolchain/vs_files
|
||||
e d python3 src/build/vs_toolchain.py update --force
|
||||
fi
|
||||
- name: Regenerate DEPS Hash
|
||||
run: |
|
||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||
echo "DEPSHASH=$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
|
||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||
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: Checkout Electron
|
||||
@@ -132,30 +109,46 @@ jobs:
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Default GN gen
|
||||
run: |
|
||||
cd src/electron
|
||||
git pack-refs
|
||||
cd ..
|
||||
|
||||
e build --only-gen
|
||||
- name: Run GN Check
|
||||
- name: Run GN Check for ${{ inputs.target-archs }}
|
||||
run: |
|
||||
cd src
|
||||
gn check out/Default //electron:electron_lib
|
||||
gn check out/Default //electron:electron_app
|
||||
gn check out/Default //electron/shell/common:mojo
|
||||
gn check out/Default //electron/shell/common:plugin
|
||||
for target_cpu in ${{ inputs.target-archs }}
|
||||
do
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu $target_cpu
|
||||
cd src
|
||||
export GN_EXTRA_ARGS="target_cpu=\"$target_cpu\""
|
||||
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||
if [ "$target_cpu" = "arm" ]; then
|
||||
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS build_tflite_with_xnnpack=false"
|
||||
elif [ "$target_cpu" = "arm64" ]; then
|
||||
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS fatal_linker_warnings=false enable_linux_installer=false"
|
||||
fi
|
||||
fi
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||
fi
|
||||
|
||||
# Check the hunspell filenames
|
||||
node electron/script/gen-hunspell-filenames.js --check
|
||||
node electron/script/gen-libc++-filenames.js --check
|
||||
e build --only-gen
|
||||
|
||||
e d gn check out/Default //electron:electron_lib
|
||||
e d gn check out/Default //electron:electron_app
|
||||
e d gn check out/Default //electron/shell/common:mojo
|
||||
e d gn check out/Default //electron/shell/common:plugin
|
||||
|
||||
# Check the hunspell filenames
|
||||
node electron/script/gen-hunspell-filenames.js --check
|
||||
node electron/script/gen-libc++-filenames.js --check
|
||||
cd ..
|
||||
done
|
||||
- name: Wait for active SSH sessions
|
||||
if: always() && !cancelled()
|
||||
shell: bash
|
||||
run: |
|
||||
while [ -f /var/.ssh-lock ]
|
||||
do
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos or linux'
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
@@ -41,22 +41,44 @@ env:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
runs-on: ${{ inputs.test-runs-on }}
|
||||
container: ${{ fromJSON(inputs.test-container) }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
|
||||
shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1, 2]') || fromJSON('[1, 2, 3]') }}
|
||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }}
|
||||
shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }}
|
||||
env:
|
||||
BUILD_TYPE: ${{ matrix.build-type }}
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
ARTIFACT_KEY: ${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
steps:
|
||||
- name: Fix node20 on arm32 runners
|
||||
if: ${{ inputs.target-arch == 'arm' }}
|
||||
if: ${{ inputs.target-arch == 'arm' && inputs.target-platform == 'linux' }}
|
||||
run: |
|
||||
cp $(which node) /mnt/runner-externals/node20/bin/
|
||||
- name: Install Git on Windows arm64 runners
|
||||
if: ${{ inputs.target-arch == 'arm64' && inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
choco install -y --no-progress git.install --params "'/GitAndUnixToolsOnPath'"
|
||||
choco install -y --no-progress git
|
||||
choco install -y --no-progress python --version 3.11.9
|
||||
choco install -y --no-progress visualstudio2022-workload-vctools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64"
|
||||
echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "C:\Python311" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: Setup Node.js/npm
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
|
||||
with:
|
||||
node-version: 20.11.x
|
||||
- name: Add TCC permissions on macOS
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: |
|
||||
@@ -95,24 +117,18 @@ jobs:
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git config --global core.filemode false
|
||||
git config --global core.autocrlf false
|
||||
git config --global branch.autosetuprebase always
|
||||
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
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
||||
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./autoninja
|
||||
else
|
||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./autoninja
|
||||
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
|
||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||
fi
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
@@ -134,7 +150,17 @@ jobs:
|
||||
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
- name: Restore Generated Artifacts
|
||||
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||
- name: Unzip Dist, Mksnapshot & Chromedriver
|
||||
- name: Unzip Dist, Mksnapshot & Chromedriver (win)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
cd src/out/Default
|
||||
Expand-Archive -Force dist.zip -DestinationPath ./
|
||||
Expand-Archive -Force chromedriver.zip -DestinationPath ./
|
||||
Expand-Archive -Force mksnapshot.zip -DestinationPath ./
|
||||
- name: Unzip Dist, Mksnapshot & Chromedriver (unix)
|
||||
if: ${{ inputs.target-platform != 'win' }}
|
||||
run: |
|
||||
cd src/out/Default
|
||||
unzip -:o dist.zip
|
||||
@@ -158,15 +184,24 @@ jobs:
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
||||
DISPLAY: ':99.0'
|
||||
NPM_CONFIG_MSVS_VERSION: '2022'
|
||||
run: |
|
||||
cd src/electron
|
||||
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
|
||||
# Get which tests are on this shard
|
||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 2 || 3 }})
|
||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'linux' && 3 || 2 }})
|
||||
|
||||
# Run tests
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
if [ "${{ inputs.target-platform }}" != "linux" ]; then
|
||||
echo "About to start tests"
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
if [ "${{ inputs.target-arch }}" = "x86" ]; then
|
||||
export npm_config_arch="ia32"
|
||||
fi
|
||||
if [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||
export ELECTRON_FORCE_TEST_SUITE_EXIT="true"
|
||||
fi
|
||||
fi
|
||||
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
||||
else
|
||||
chown :builduser .. && chmod g+w ..
|
||||
@@ -197,19 +232,21 @@ jobs:
|
||||
DD_CIVISIBILITY_LOGS_ENABLED: true
|
||||
DD_TAGS: "os.architecture:${{ inputs.target-arch }},os.family:${{ inputs.target-platform }},os.platform:${{ inputs.target-platform }},asan:${{ inputs.is-asan }}"
|
||||
run: |
|
||||
if ! [ -z $DD_API_KEY ]; then
|
||||
datadog-ci junit upload src/electron/junit/test-results-main.xml
|
||||
if ! [ -z $DD_API_KEY ] && [ -f src/electron/junit/test-results-main.xml ]; then
|
||||
export DATADOG_PATH=`node src/electron/script/yarn global bin`
|
||||
$DATADOG_PATH/datadog-ci junit upload src/electron/junit/test-results-main.xml
|
||||
fi
|
||||
if: always() && !cancelled()
|
||||
- name: Upload Test Artifacts
|
||||
if: always() && !cancelled()
|
||||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
|
||||
with:
|
||||
name: test_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
name: test_artifacts_${{ env.ARTIFACT_KEY }}_${{ matrix.shard }}
|
||||
path: src/electron/spec/artifacts
|
||||
if-no-files-found: ignore
|
||||
- name: Wait for active SSH sessions
|
||||
if: always() && !cancelled()
|
||||
shell: bash
|
||||
run: |
|
||||
while [ -f /var/.ssh-lock ]
|
||||
do
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos or linux'
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
@@ -49,23 +49,20 @@ jobs:
|
||||
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: 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 }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
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
|
||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
@@ -93,6 +90,7 @@ jobs:
|
||||
node electron/script/node-spec-runner.js --default --jUnitDir=junit
|
||||
- name: Wait for active SSH sessions
|
||||
if: always() && !cancelled()
|
||||
shell: bash
|
||||
run: |
|
||||
while [ -f /var/.ssh-lock ]
|
||||
do
|
||||
@@ -112,23 +110,20 @@ jobs:
|
||||
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: Init Build Tools
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
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
|
||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
@@ -155,6 +150,7 @@ jobs:
|
||||
cd src
|
||||
node electron/script/nan-spec-runner.js
|
||||
- name: Wait for active SSH sessions
|
||||
shell: bash
|
||||
if: always() && !cancelled()
|
||||
run: |
|
||||
while [ -f /var/.ssh-lock ]
|
||||
|
||||
5
.github/workflows/update_appveyor_image.yml
vendored
5
.github/workflows/update_appveyor_image.yml
vendored
@@ -23,6 +23,11 @@ jobs:
|
||||
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
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,7 +48,6 @@ ts-gen
|
||||
|
||||
# Used to accelerate CI builds
|
||||
.depshash
|
||||
.depshash-target
|
||||
|
||||
# Used to accelerate builds after sync
|
||||
patches/mtime-cache.json
|
||||
|
||||
@@ -12,7 +12,7 @@ propose changes to this document in a pull request.
|
||||
|
||||
## [Issues](https://electronjs.org/docs/development/issues)
|
||||
|
||||
Issues are created [here](https://github.com/electron/electron/issues/new).
|
||||
Issues are created [here](https://github.com/electron/electron/issues/new/choose).
|
||||
|
||||
* [How to Contribute in Issues](https://electronjs.org/docs/development/issues#how-to-contribute-in-issues)
|
||||
* [Asking for General Help](https://electronjs.org/docs/development/issues#asking-for-general-help)
|
||||
|
||||
4
DEPS
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'132.0.6834.6',
|
||||
'132.0.6834.46',
|
||||
'node_version':
|
||||
'v20.18.0',
|
||||
'v20.18.1',
|
||||
'nan_version':
|
||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -187,7 +187,12 @@ for:
|
||||
7z a pdb.zip out\Default\*.pdb
|
||||
}
|
||||
- ps: |
|
||||
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:TARGET_ARCH.manifest"
|
||||
if ($env:TARGET_ARCH -eq 'ia32') {
|
||||
$env:MANIFEST_ARCH = "x86"
|
||||
} else {
|
||||
$env:MANIFEST_ARCH = $env:TARGET_ARCH
|
||||
}
|
||||
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:MANIFEST_ARCH.manifest"
|
||||
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Zip contains files not listed in the manifest $manifest_file"
|
||||
|
||||
@@ -59,7 +59,7 @@ def skip_path(dep, dist_zip, target_cpu):
|
||||
and dep == "snapshot_blob.bin"
|
||||
)
|
||||
)
|
||||
if should_skip:
|
||||
if should_skip and os.environ.get('ELECTRON_DEBUG_ZIP_SKIP') == '1':
|
||||
print("Skipping {}".format(dep))
|
||||
return should_skip
|
||||
|
||||
|
||||
@@ -160,14 +160,12 @@ static_library("chrome") {
|
||||
"//chrome/browser/icon_loader_win.cc",
|
||||
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
|
||||
"//chrome/browser/process_singleton_win.cc",
|
||||
"//chrome/browser/ui/frame/window_frame_util.h",
|
||||
"//chrome/browser/win/chrome_process_finder.cc",
|
||||
"//chrome/browser/win/chrome_process_finder.h",
|
||||
"//chrome/browser/win/chrome_select_file_dialog_factory.cc",
|
||||
"//chrome/browser/win/chrome_select_file_dialog_factory.h",
|
||||
"//chrome/browser/win/titlebar_config.cc",
|
||||
"//chrome/browser/win/titlebar_config.h",
|
||||
"//chrome/browser/win/titlebar_config.h",
|
||||
"//chrome/browser/win/util_win_service.cc",
|
||||
"//chrome/browser/win/util_win_service.h",
|
||||
"//chrome/child/v8_crashpad_support_win.cc",
|
||||
|
||||
@@ -514,20 +514,20 @@ and `will-quit` events will not be emitted.
|
||||
* `args` string[] (optional)
|
||||
* `execPath` string (optional)
|
||||
|
||||
Relaunches the app when current instance exits.
|
||||
Relaunches the app when the current instance exits.
|
||||
|
||||
By default, the new instance will use the same working directory and command line
|
||||
arguments with current instance. When `args` is specified, the `args` will be
|
||||
passed as command line arguments instead. When `execPath` is specified, the
|
||||
`execPath` will be executed for relaunch instead of current app.
|
||||
arguments as the current instance. When `args` is specified, the `args` will be
|
||||
passed as the command line arguments instead. When `execPath` is specified, the
|
||||
`execPath` will be executed for the relaunch instead of the current app.
|
||||
|
||||
Note that this method does not quit the app when executed, you have to call
|
||||
Note that this method does not quit the app when executed. You have to call
|
||||
`app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
|
||||
|
||||
When `app.relaunch` is called for multiple times, multiple instances will be
|
||||
started after current instance exited.
|
||||
When `app.relaunch` is called multiple times, multiple instances will be
|
||||
started after the current instance exits.
|
||||
|
||||
An example of restarting current instance immediately and adding a new command
|
||||
An example of restarting the current instance immediately and adding a new command
|
||||
line argument to the new instance:
|
||||
|
||||
```js
|
||||
|
||||
@@ -72,7 +72,7 @@ The `menu` object has the following instance methods:
|
||||
#### `menu.popup([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `window` [BrowserWindow](browser-window.md) (optional) - Default is the focused window.
|
||||
* `window` [BaseWindow](base-window.md) (optional) - Default is the focused window.
|
||||
* `x` number (optional) - Default is the current mouse cursor position.
|
||||
Must be declared if `y` is declared.
|
||||
* `y` number (optional) - Default is the current mouse cursor position.
|
||||
@@ -86,13 +86,13 @@ The `menu` object has the following instance methods:
|
||||
Can be `none`, `mouse`, `keyboard`, `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`, `adjustSelection`, or `adjustSelectionReset`.
|
||||
* `callback` Function (optional) - Called when menu is closed.
|
||||
|
||||
Pops up this menu as a context menu in the [`BrowserWindow`](browser-window.md).
|
||||
Pops up this menu as a context menu in the [`BaseWindow`](base-window.md).
|
||||
|
||||
#### `menu.closePopup([browserWindow])`
|
||||
#### `menu.closePopup([window])`
|
||||
|
||||
* `browserWindow` [BrowserWindow](browser-window.md) (optional) - Default is the focused window.
|
||||
* `window` [BaseWindow](base-window.md) (optional) - Default is the focused window.
|
||||
|
||||
Closes the context menu in the `browserWindow`.
|
||||
Closes the context menu in the `window`.
|
||||
|
||||
#### `menu.append(menuItem)`
|
||||
|
||||
|
||||
@@ -1360,6 +1360,36 @@ specified when registering the protocol.
|
||||
|
||||
Returns `Promise<void>` - resolves when the code cache clear operation is complete.
|
||||
|
||||
#### `ses.getSharedDictionaryUsageInfo()`
|
||||
|
||||
Returns `Promise<SharedDictionaryUsageInfo[]>` - an array of shared dictionary information entries in Chromium's networking service's storage.
|
||||
|
||||
Shared dictionaries are used to power advanced compression of data sent over the wire, specifically with Brotli and ZStandard. You don't need to call any of the shared dictionary APIs in Electron to make use of this advanced web feature, but if you do, they allow deeper control and inspection of the shared dictionaries used during decompression.
|
||||
|
||||
To get detailed information about a specific shared dictionary entry, call `getSharedDictionaryInfo(options)`.
|
||||
|
||||
#### `ses.getSharedDictionaryInfo(options)`
|
||||
|
||||
* `options` Object
|
||||
* `frameOrigin` string - The origin of the frame where the request originates. It’s specific to the individual frame making the request and is defined by its scheme, host, and port. In practice, will look like a URL.
|
||||
* `topFrameSite` string - The site of the top-level browsing context (the main frame or tab that contains the request). It’s less granular than `frameOrigin` and focuses on the broader "site" scope. In practice, will look like a URL.
|
||||
|
||||
Returns `Promise<SharedDictionaryInfo[]>` - an array of shared dictionary information entries in Chromium's networking service's storage.
|
||||
|
||||
To get information about all present shared dictionaries, call `getSharedDictionaryUsageInfo()`.
|
||||
|
||||
#### `ses.clearSharedDictionaryCache()`
|
||||
|
||||
Returns `Promise<void>` - resolves when the dictionary cache has been cleared, both in memory and on disk.
|
||||
|
||||
#### `ses.clearSharedDictionaryCacheForIsolationKey(options)`
|
||||
|
||||
* `options` Object
|
||||
* `frameOrigin` string - The origin of the frame where the request originates. It’s specific to the individual frame making the request and is defined by its scheme, host, and port. In practice, will look like a URL.
|
||||
* `topFrameSite` string - The site of the top-level browsing context (the main frame or tab that contains the request). It’s less granular than `frameOrigin` and focuses on the broader "site" scope. In practice, will look like a URL.
|
||||
|
||||
Returns `Promise<void>` - resolves when the dictionary cache has been cleared for the specified isolation key, both in memory and on disk.
|
||||
|
||||
#### `ses.setSpellCheckerEnabled(enable)`
|
||||
|
||||
* `enable` boolean
|
||||
@@ -1509,9 +1539,11 @@ session is persisted on disk. For in memory sessions this returns `null`.
|
||||
#### `ses.clearData([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `dataTypes` String[] (optional) - The types of data to clear. By default, this will clear all types of data.
|
||||
* `dataTypes` String[] (optional) - The types of data to clear. By default, this will clear all types of data. This
|
||||
can potentially include data types not explicitly listed here. (See Chromium's
|
||||
[`BrowsingDataRemover`][browsing-data-remover] for the full list.)
|
||||
* `backgroundFetch` - Background Fetch
|
||||
* `cache` - Cache
|
||||
* `cache` - Cache (includes `cachestorage` and `shadercache`)
|
||||
* `cookies` - Cookies
|
||||
* `downloads` - Downloads
|
||||
* `fileSystems` - File Systems
|
||||
@@ -1535,7 +1567,9 @@ This method clears more types of data and is more thorough than the
|
||||
|
||||
**Note:** Cookies are stored at a broader scope than origins. When removing cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be removed at the [registrable domain](https://url.spec.whatwg.org/#host-registrable-domain) level. For example, clearing cookies for the origin `https://really.specific.origin.example.com/` will end up clearing all cookies for `example.com`. Clearing cookies for the origin `https://my.website.example.co.uk/` will end up clearing all cookies for `example.co.uk`.
|
||||
|
||||
For more information, refer to Chromium's [`BrowsingDataRemover` interface](https://source.chromium.org/chromium/chromium/src/+/main:content/public/browser/browsing_data_remover.h).
|
||||
**Note:** Clearing cache data will also clear the shared dictionary cache. This means that any dictionaries used for compression may be reloaded after clearing the cache. If you wish to clear the shared dictionary cache but leave other cached data intact, you may want to use the `clearSharedDictionaryCache` method.
|
||||
|
||||
For more information, refer to Chromium's [`BrowsingDataRemover` interface][browsing-data-remover].
|
||||
|
||||
### Instance Properties
|
||||
|
||||
@@ -1601,3 +1635,5 @@ app.whenReady().then(async () => {
|
||||
console.log('Net-logs written to', path)
|
||||
})
|
||||
```
|
||||
|
||||
[browsing-data-remover]: https://source.chromium.org/chromium/chromium/src/+/main:content/public/browser/browsing_data_remover.h
|
||||
|
||||
12
docs/api/structures/shared-dictionary-info.md
Normal file
12
docs/api/structures/shared-dictionary-info.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# SharedDictionaryInfo Object
|
||||
|
||||
* `match` string - The matching path pattern for the dictionary which was declared in 'use-as-dictionary' response header's `match` option.
|
||||
* `matchDestinations` string[] - An array of matching destinations for the dictionary which was declared in 'use-as-dictionary' response header's `match-dest` option.
|
||||
* `id` string - The Id for the dictionary which was declared in 'use-as-dictionary' response header's `id` option.
|
||||
* `dictionaryUrl` string - URL of the dictionary.
|
||||
* `lastFetchTime` Date - The time of when the dictionary was received from the network layer.
|
||||
* `responseTime` Date - The time of when the dictionary was received from the server. For cached responses, this time could be "far" in the past.
|
||||
* `expirationDuration` number - The expiration time for the dictionary which was declared in 'use-as-dictionary' response header's `expires` option in seconds.
|
||||
* `lastUsedTime` Date - The time when the dictionary was last used.
|
||||
* `size` number - The amount of bytes stored for this shared dictionary information object in Chromium's internal storage (usually Sqlite).
|
||||
* `hash` string - The sha256 hash of the dictionary binary.
|
||||
5
docs/api/structures/shared-dictionary-usage-info.md
Normal file
5
docs/api/structures/shared-dictionary-usage-info.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# SharedDictionaryUsageInfo Object
|
||||
|
||||
* `frameOrigin` string - The origin of the frame where the request originates. It’s specific to the individual frame making the request and is defined by its scheme, host, and port. In practice, will look like a URL.
|
||||
* `topFrameSite` string - The site of the top-level browsing context (the main frame or tab that contains the request). It’s less granular than `frameOrigin` and focuses on the broader "site" scope. In practice, will look like a URL.
|
||||
* `totalSizeBytes` number - The amount of bytes stored for this shared dictionary information object in Chromium's internal storage (usually Sqlite).
|
||||
@@ -37,7 +37,10 @@ Process: [Main](../glossary.md#main-process)<br />
|
||||
to load unsigned libraries. Unless you specifically need this capability, it is best to leave this disabled.
|
||||
Default is `false`.
|
||||
* `respondToAuthRequestsFromMainProcess` boolean (optional) - With this flag, all HTTP 401 and 407 network
|
||||
requests created via the [net module](net.md) will allow responding to them via the [`app#login`](app.md#event-login) event in the main process instead of the default [`login`](client-request.md#event-login) event on the [`ClientRequest`](client-request.md) object.
|
||||
requests created via the [net module](net.md) will allow responding to them via the
|
||||
[`app#login`](app.md#event-login) event in the main process instead of the default
|
||||
[`login`](client-request.md#event-login) event on the [`ClientRequest`](client-request.md) object. Default is
|
||||
`false`.
|
||||
|
||||
Returns [`UtilityProcess`](utility-process.md#class-utilityprocess)
|
||||
|
||||
|
||||
@@ -142,6 +142,29 @@ ipcRenderer.on('port', (e, msg) => {
|
||||
})
|
||||
```
|
||||
|
||||
#### `frame.collectJavaScriptCallStack()` _Experimental_
|
||||
|
||||
Returns `Promise<string> | Promise<void>` - A promise that resolves with the currently running JavaScript call
|
||||
stack. If no JavaScript runs in the frame, the promise will never resolve. In cases where the call stack is
|
||||
otherwise unable to be collected, it will return `undefined`.
|
||||
|
||||
This can be useful to determine why the frame is unresponsive in cases where there's long-running JavaScript.
|
||||
For more information, see the [proposed Crash Reporting API.](https://wicg.github.io/crash-reporting/)
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.commandLine.appendSwitch('enable-features', 'DocumentPolicyIncludeJSCallStacksInCrashReports')
|
||||
|
||||
app.on('web-contents-created', (_, webContents) => {
|
||||
webContents.on('unresponsive', async () => {
|
||||
// Interrupt execution and collect call stack from unresponsive renderer
|
||||
const callStack = await webContents.mainFrame.collectJavaScriptCallStack()
|
||||
console.log('Renderer unresponsive\n', callStack)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
### Instance Properties
|
||||
|
||||
#### `frame.ipc` _Readonly_
|
||||
|
||||
@@ -111,14 +111,14 @@ The nonstandard `path` property of the Web `File` object was added in an early v
|
||||
```js
|
||||
// Before (renderer)
|
||||
|
||||
const file = document.querySelector('input[type=file]')
|
||||
const file = document.querySelector('input[type=file]').files[0]
|
||||
alert(`Uploaded file path was: ${file.path}`)
|
||||
```
|
||||
|
||||
```js
|
||||
// After (renderer)
|
||||
|
||||
const file = document.querySelector('input[type=file]')
|
||||
const file = document.querySelector('input[type=file]').files[0]
|
||||
electron.showFilePath(file)
|
||||
|
||||
// (preload)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<button id="clickme">Test Bluetooth</button>
|
||||
<button id="cancel">Cancel Bluetooth Request</button>
|
||||
|
||||
<p>Currently selected bluetooth device: <strong id="device-name""></strong></p>
|
||||
<p>Currently selected bluetooth device: <strong id="device-name"></strong></p>
|
||||
|
||||
<script src="./renderer.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -9,10 +9,10 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
|
||||
|
||||
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
|
||||
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
|
||||
| 34.0.0 | 2024-Oct-17 | 2024-Nov-13 | 2024-Jan-07 | 2025-Jun-24 | M132 | TBD | ✅ |
|
||||
| 34.0.0 | 2024-Oct-17 | 2024-Nov-13 | 2025-Jan-14 | 2025-Jun-24 | M132 | TBD | ✅ |
|
||||
| 33.0.0 | 2024-Aug-22 | 2024-Sep-18 | 2024-Oct-15 | 2025-Apr-29 | M130 | v20.18 | ✅ |
|
||||
| 32.0.0 | 2024-Jun-14 | 2024-Jul-24 | 2024-Aug-20 | 2025-Mar-04 | M128 | v20.16 | ✅ |
|
||||
| 31.0.0 | 2024-Apr-18 | 2024-May-15 | 2024-Jun-11 | 2025-Jan-07 | M126 | v20.14 | ✅ |
|
||||
| 31.0.0 | 2024-Apr-18 | 2024-May-15 | 2024-Jun-11 | 2025-Jan-14 | M126 | v20.14 | ✅ |
|
||||
| 30.0.0 | 2024-Feb-22 | 2024-Mar-20 | 2024-Apr-16 | 2024-Oct-15 | M124 | v20.11 | 🚫 |
|
||||
| 29.0.0 | 2023-Dec-07 | 2024-Jan-24 | 2024-Feb-20 | 2024-Aug-20 | M122 | v20.9 | 🚫 |
|
||||
| 28.0.0 | 2023-Oct-11 | 2023-Nov-06 | 2023-Dec-05 | 2024-Jun-11 | M120 | v18.18 | 🚫 |
|
||||
|
||||
@@ -133,6 +133,8 @@ auto_filenames = {
|
||||
"docs/api/structures/segmented-control-segment.md",
|
||||
"docs/api/structures/serial-port.md",
|
||||
"docs/api/structures/service-worker-info.md",
|
||||
"docs/api/structures/shared-dictionary-info.md",
|
||||
"docs/api/structures/shared-dictionary-usage-info.md",
|
||||
"docs/api/structures/shared-worker-info.md",
|
||||
"docs/api/structures/sharing-item.md",
|
||||
"docs/api/structures/shortcut-details.md",
|
||||
|
||||
@@ -514,9 +514,9 @@ WebContents.prototype.canGoForward = function () {
|
||||
};
|
||||
|
||||
const canGoToOffsetDeprecated = deprecate.warnOnce('webContents.canGoToOffset', 'webContents.navigationHistory.canGoToOffset');
|
||||
WebContents.prototype.canGoToOffset = function () {
|
||||
WebContents.prototype.canGoToOffset = function (index: number) {
|
||||
canGoToOffsetDeprecated();
|
||||
return this._canGoToOffset();
|
||||
return this._canGoToOffset(index);
|
||||
};
|
||||
|
||||
const clearHistoryDeprecated = deprecate.warnOnce('webContents.clearHistory', 'webContents.navigationHistory.clear');
|
||||
|
||||
@@ -15,7 +15,7 @@ export const windowSetup = (isWebView: boolean, isHiddenPage: boolean) => {
|
||||
|
||||
// But we do not support prompt().
|
||||
window.prompt = function () {
|
||||
throw new Error('prompt() is and will not be supported.');
|
||||
throw new Error('prompt() is not supported.');
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['prompt'], window.prompt);
|
||||
|
||||
|
||||
@@ -134,3 +134,5 @@ feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch
|
||||
chore_partial_revert_of.patch
|
||||
fix_software_compositing_infinite_loop.patch
|
||||
refactor_unfilter_unresponsive_events.patch
|
||||
support_bstr_pkey_appusermodel_id_in_windows_shortcuts.patch
|
||||
cherry-pick-1282289030ab.patch
|
||||
|
||||
@@ -116,10 +116,10 @@ index 083af135d890c2837e72c314e170e81931bd2a20..5245ea88441ef84c15b8052a9011ce70
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index f5fe2e061448673c788315a167efff1fb70c3ef0..ed0c77c14e8dcf3e6d7328c8a9c640388b7be92d 100644
|
||||
index ad134361e0b9c9a9db4cec06c429102d5dbe0c4e..82aef58c0a3c00c818e0d60df9a5296162c57cc3 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2452,6 +2452,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -2456,6 +2456,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
|
||||
"old_state", old_state, "new_state", new_state);
|
||||
|
||||
@@ -130,7 +130,7 @@ index f5fe2e061448673c788315a167efff1fb70c3ef0..ed0c77c14e8dcf3e6d7328c8a9c64038
|
||||
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
|
||||
!old_state->is_in_back_forward_cache;
|
||||
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
|
||||
@@ -3984,10 +3988,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3988,10 +3992,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ index f5fe2e061448673c788315a167efff1fb70c3ef0..ed0c77c14e8dcf3e6d7328c8a9c64038
|
||||
// Do not throttle if the page should be painting.
|
||||
bool is_visible =
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index d5397c53559ba239e46c9485fb30daea89bd392b..4989d9f6a28d519098b16e832c2a36c61ab04c15 100644
|
||||
index e4784453b357e2a9c18ccf5acfde43f5afd583ae..2c5a9f08ac34ae4106f25c42dca04f78ae703618 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -448,6 +448,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -166,7 +166,7 @@ index d5397c53559ba239e46c9485fb30daea89bd392b..4989d9f6a28d519098b16e832c2a36c6
|
||||
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) override;
|
||||
mojom::blink::PageVisibilityState GetVisibilityState() override;
|
||||
@@ -933,6 +934,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -936,6 +937,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
// If true, we send IPC messages when |preferred_size_| changes.
|
||||
bool send_preferred_size_changes_ = false;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ index 2f33ec660a975522c473ecd50e633b5edaca707f..65221a51927d9f44bd6adbad88fa1144
|
||||
// its owning reference back to our owning LocalFrame.
|
||||
client_->Detached(type);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 5c8c50fc2025a160bfb0587cd46ba45f8d58a175..d918e9d165acefa8ba3a225aec261ebf028c40f7 100644
|
||||
index 6a071e614bfd44fce79bf6db80d026f24eefdd7f..1daf1d65e2e6ac494790aa9201609c9ca9af6828 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -746,10 +746,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
|
||||
@@ -33,7 +33,7 @@ index 9580623c57cb02f7e924742c6cb1638676881115..ad80d8e63dfebbbdb8eaa63bfe38a6f8
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 1a136cdeb8aea796a8b3f81e4f791c29ae02cf02..9033419bb880830076835e8400276e738b71f428 100644
|
||||
index 3914cb63eed91e0e8a6eb8b64092c5dbe5348781..a6a24986f33fb79d3226840ffaa62448026f7383 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4525,7 +4525,7 @@ static_library("browser") {
|
||||
|
||||
@@ -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 d29dac893805535bbbd9aefe096a0ca2825a01aa..4f31803e492d0d05b29659f8bf75b6fee7aff25e 100644
|
||||
index 95b2ad64c83361c452f9256cf96873f2cd82b446..53f96ccd4954972bc78ebccf4bf479ac8564a8d3 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9170,6 +9170,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9179,6 +9179,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 d29dac893805535bbbd9aefe096a0ca2825a01aa..4f31803e492d0d05b29659f8bf75b6fe
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index c93722f2fc5340edeeace5a1690d0fa7d84dffb2..e7e47a9aa5a22aea2aa0eeab7bd661b47c9cbdae 100644
|
||||
index ea5a63ce49a1eb99792be2eafc64c44ad6da0a60..a722f77502e8b896fb5d55df7cb44d45d13df04f 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4887,6 +4887,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4891,6 +4891,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params,
|
||||
opener);
|
||||
|
||||
@@ -37,7 +37,7 @@ index c93722f2fc5340edeeace5a1690d0fa7d84dffb2..e7e47a9aa5a22aea2aa0eeab7bd661b4
|
||||
// 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
|
||||
@@ -4928,12 +4934,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4932,12 +4938,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
|
||||
265
patches/chromium/cherry-pick-1282289030ab.patch
Normal file
265
patches/chromium/cherry-pick-1282289030ab.patch
Normal file
@@ -0,0 +1,265 @@
|
||||
From 1282289030ab2026a8db4fb82dc6e20d3bf028be Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Ellis <kevers@google.com>
|
||||
Date: Thu, 12 Dec 2024 06:47:30 -0800
|
||||
Subject: [PATCH] Prune superfluous calls to SetCompositorPending
|
||||
|
||||
We only need to call SetCompositorPending with the pending cancel
|
||||
reason if the animation is running on the compositor.
|
||||
|
||||
The stack trace on the bug report showed a significant time being
|
||||
spent in HasProperty. The timing was also optimized in this CL to
|
||||
prevent unnecessary duplicate calculations.
|
||||
|
||||
Bug: 382394791
|
||||
Change-Id: I03ffa1b486b267e05f63328212d192dfca26eb53
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6076354
|
||||
Reviewed-by: Robert Flack <flackr@chromium.org>
|
||||
Commit-Queue: Kevin Ellis <kevers@chromium.org>
|
||||
Reviewed-by: Claire Chambers <clchambers@microsoft.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1395390}
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/animation/animation.cc b/third_party/blink/renderer/core/animation/animation.cc
|
||||
index 9e162a6f..b58b017 100644
|
||||
--- a/third_party/blink/renderer/core/animation/animation.cc
|
||||
+++ b/third_party/blink/renderer/core/animation/animation.cc
|
||||
@@ -1271,14 +1271,7 @@
|
||||
ResolveTimelineOffsets(timeline_ ? timeline_->GetTimelineRange()
|
||||
: TimelineRange());
|
||||
|
||||
- SetOutdated();
|
||||
-
|
||||
- // 7. Run the procedure to update an animation’s finished state for animation
|
||||
- // with the did seek flag set to false (continuous), and the synchronously
|
||||
- // notify flag set to false (async).
|
||||
- UpdateFinishedState(UpdateType::kContinuous, NotificationType::kAsync);
|
||||
-
|
||||
- SetCompositorPending(CompositorPendingReason::kPendingEffectChange);
|
||||
+ EffectInvalidated();
|
||||
|
||||
// Notify of a potential state change.
|
||||
NotifyProbe();
|
||||
@@ -2375,6 +2368,26 @@
|
||||
timeline()->IsMonotonicallyIncreasing(), boundary_aligned);
|
||||
}
|
||||
|
||||
+Animation::NativePaintWorkletReasons Animation::GetNativePaintWorkletReasons() {
|
||||
+ if (native_paint_worklet_reasons_) {
|
||||
+ return native_paint_worklet_reasons_.value();
|
||||
+ }
|
||||
+ NativePaintWorkletReasons reasons = kNoPaintWorklet;
|
||||
+ if (KeyframeEffect* keyframe_effect = DynamicTo<KeyframeEffect>(effect())) {
|
||||
+ if (RuntimeEnabledFeatures::CompositeBGColorAnimationEnabled() &&
|
||||
+ keyframe_effect->Affects(
|
||||
+ PropertyHandle(GetCSSPropertyBackgroundColor()))) {
|
||||
+ reasons |= kBackgroundColorPaintWorklet;
|
||||
+ }
|
||||
+ if (RuntimeEnabledFeatures::CompositeClipPathAnimationEnabled() &&
|
||||
+ keyframe_effect->Affects(PropertyHandle(GetCSSPropertyClipPath()))) {
|
||||
+ reasons |= kClipPathPaintWorklet;
|
||||
+ }
|
||||
+ }
|
||||
+ native_paint_worklet_reasons_ = reasons;
|
||||
+ return reasons;
|
||||
+}
|
||||
+
|
||||
// TODO(crbug.com/960944): Rename to SetPendingCommit. This method handles both
|
||||
// composited and non-composited animations. The use of 'compositor' in the name
|
||||
// is confusing.
|
||||
@@ -2833,7 +2846,7 @@
|
||||
// After updating the animation time if the animation is no longer current
|
||||
// blink will no longer composite the element (see
|
||||
// CompositingReasonFinder::RequiresCompositingFor*Animation).
|
||||
- if (!content_->IsCurrent()) {
|
||||
+ if (!content_->IsCurrent() && HasActiveAnimationsOnCompositor()) {
|
||||
SetCompositorPending(CompositorPendingReason::kPendingCancel);
|
||||
}
|
||||
}
|
||||
@@ -2874,6 +2887,9 @@
|
||||
}
|
||||
|
||||
void Animation::EffectInvalidated() {
|
||||
+ prior_native_paint_worklet_reasons_ = native_paint_worklet_reasons_;
|
||||
+ native_paint_worklet_reasons_ = std::nullopt;
|
||||
+
|
||||
SetOutdated();
|
||||
UpdateFinishedState(UpdateType::kContinuous, NotificationType::kAsync);
|
||||
// FIXME: Needs to consider groups when added.
|
||||
@@ -3381,15 +3397,22 @@
|
||||
}
|
||||
|
||||
void Animation::UpdateCompositedPaintStatus() {
|
||||
- if (!NativePaintImageGenerator::NativePaintWorkletAnimationsEnabled()) {
|
||||
- return;
|
||||
+ if (GetNativePaintWorkletReasons() == Animation::kNoPaintWorklet) {
|
||||
+ if (!prior_native_paint_worklet_reasons_ ||
|
||||
+ prior_native_paint_worklet_reasons_ == Animation::kNoPaintWorklet) {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
+ prior_native_paint_worklet_reasons_ = GetNativePaintWorkletReasons();
|
||||
+
|
||||
KeyframeEffect* keyframe_effect = DynamicTo<KeyframeEffect>(content_.Get());
|
||||
if (!keyframe_effect) {
|
||||
return;
|
||||
}
|
||||
|
||||
+ // TODO(crbug.com/383562308): If the target changed since the last update, we
|
||||
+ // need to trigger an update for the previous and current target.
|
||||
Element* target = keyframe_effect->EffectTarget();
|
||||
if (!target) {
|
||||
return;
|
||||
@@ -3398,14 +3421,7 @@
|
||||
ElementAnimations* element_animations = target->GetElementAnimations();
|
||||
DCHECK(element_animations);
|
||||
|
||||
- if (RuntimeEnabledFeatures::CompositeBGColorAnimationEnabled()) {
|
||||
- element_animations->RecalcCompositedStatus(target,
|
||||
- GetCSSPropertyBackgroundColor());
|
||||
- }
|
||||
- if (RuntimeEnabledFeatures::CompositeClipPathAnimationEnabled()) {
|
||||
- element_animations->RecalcCompositedStatus(target,
|
||||
- GetCSSPropertyClipPath());
|
||||
- }
|
||||
+ element_animations->RecalcCompositedStatus(target);
|
||||
}
|
||||
|
||||
void Animation::Trace(Visitor* visitor) const {
|
||||
diff --git a/third_party/blink/renderer/core/animation/animation.h b/third_party/blink/renderer/core/animation/animation.h
|
||||
index 61007d7..bc0a891 100644
|
||||
--- a/third_party/blink/renderer/core/animation/animation.h
|
||||
+++ b/third_party/blink/renderer/core/animation/animation.h
|
||||
@@ -393,6 +393,15 @@
|
||||
start_time_ = start_time;
|
||||
}
|
||||
|
||||
+ enum NativePaintWorkletProperties {
|
||||
+ kNoPaintWorklet = 0,
|
||||
+ kBackgroundColorPaintWorklet = 1,
|
||||
+ kClipPathPaintWorklet = 2
|
||||
+ };
|
||||
+
|
||||
+ using NativePaintWorkletReasons = uint32_t;
|
||||
+ NativePaintWorkletReasons GetNativePaintWorkletReasons();
|
||||
+
|
||||
protected:
|
||||
DispatchEventResult DispatchEventInternal(Event&) override;
|
||||
void AddedEventListener(const AtomicString& event_type,
|
||||
@@ -583,6 +592,13 @@
|
||||
|
||||
Member<Event> pending_remove_event_;
|
||||
|
||||
+ // Cache whether animation can potentially have native paint worklets.
|
||||
+ // In the event of the keyframes changing, we need a new evaluation, of
|
||||
+ // the composited status for native paint worklet eligible properties.
|
||||
+ // A change in the playState can also necessitate a composited style update.
|
||||
+ std::optional<NativePaintWorkletReasons> native_paint_worklet_reasons_;
|
||||
+ std::optional<NativePaintWorkletReasons> prior_native_paint_worklet_reasons_;
|
||||
+
|
||||
// TODO(crbug.com/960944): Consider reintroducing kPause and cleanup use of
|
||||
// mutually exclusive pending_play_ and pending_pause_ flags.
|
||||
enum class CompositorAction { kNone, kStart, kCancel };
|
||||
diff --git a/third_party/blink/renderer/core/animation/element_animations.cc b/third_party/blink/renderer/core/animation/element_animations.cc
|
||||
index ca2864f..b1f3b32 100644
|
||||
--- a/third_party/blink/renderer/core/animation/element_animations.cc
|
||||
+++ b/third_party/blink/renderer/core/animation/element_animations.cc
|
||||
@@ -97,43 +97,59 @@
|
||||
Element& element,
|
||||
AnimationEffect* effect) {
|
||||
if (KeyframeEffect* keyframe_effect = DynamicTo<KeyframeEffect>(effect)) {
|
||||
- if (CompositedBackgroundColorStatus() ==
|
||||
- ElementAnimations::CompositedPaintStatus::kComposited &&
|
||||
- keyframe_effect->Affects(
|
||||
- PropertyHandle(GetCSSPropertyBackgroundColor())) &&
|
||||
- element.GetLayoutObject()) {
|
||||
- SetCompositedBackgroundColorStatus(
|
||||
- ElementAnimations::CompositedPaintStatus::kNeedsRepaint);
|
||||
- element.GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||
+ if (RuntimeEnabledFeatures::CompositeBGColorAnimationEnabled()) {
|
||||
+ if (CompositedBackgroundColorStatus() ==
|
||||
+ ElementAnimations::CompositedPaintStatus::kComposited &&
|
||||
+ keyframe_effect->Affects(
|
||||
+ PropertyHandle(GetCSSPropertyBackgroundColor())) &&
|
||||
+ element.GetLayoutObject()) {
|
||||
+ SetCompositedBackgroundColorStatus(
|
||||
+ ElementAnimations::CompositedPaintStatus::kNeedsRepaint);
|
||||
+ element.GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||
+ }
|
||||
}
|
||||
|
||||
- if (CompositedClipPathStatus() ==
|
||||
- ElementAnimations::CompositedPaintStatus::kComposited &&
|
||||
- keyframe_effect->Affects(PropertyHandle(GetCSSPropertyClipPath())) &&
|
||||
- element.GetLayoutObject()) {
|
||||
- SetCompositedClipPathStatus(
|
||||
- ElementAnimations::CompositedPaintStatus::kNeedsRepaint);
|
||||
- element.GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||
- // For clip paths, we also need to update the paint properties to switch
|
||||
- // from path based to mask based clip.
|
||||
- element.GetLayoutObject()->SetNeedsPaintPropertyUpdate();
|
||||
+ if (RuntimeEnabledFeatures::CompositeClipPathAnimationEnabled()) {
|
||||
+ if (CompositedClipPathStatus() ==
|
||||
+ ElementAnimations::CompositedPaintStatus::kComposited &&
|
||||
+ keyframe_effect->Affects(PropertyHandle(GetCSSPropertyClipPath())) &&
|
||||
+ element.GetLayoutObject()) {
|
||||
+ SetCompositedClipPathStatus(
|
||||
+ ElementAnimations::CompositedPaintStatus::kNeedsRepaint);
|
||||
+ element.GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||
+ // For clip paths, we also need to update the paint properties to switch
|
||||
+ // from path based to mask based clip.
|
||||
+ element.GetLayoutObject()->SetNeedsPaintPropertyUpdate();
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-void ElementAnimations::RecalcCompositedStatus(Element* element,
|
||||
- const CSSProperty& property) {
|
||||
- ElementAnimations::CompositedPaintStatus status =
|
||||
- HasAnimationForProperty(property)
|
||||
- ? ElementAnimations::CompositedPaintStatus::kNeedsRepaint
|
||||
- : ElementAnimations::CompositedPaintStatus::kNoAnimation;
|
||||
+void ElementAnimations::RecalcCompositedStatus(Element* element) {
|
||||
+ Animation::NativePaintWorkletReasons reasons = Animation::kNoPaintWorklet;
|
||||
+ for (auto& entry : Animations()) {
|
||||
+ if (entry.key->CalculateAnimationPlayState() ==
|
||||
+ V8AnimationPlayState::Enum::kIdle) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ reasons |= entry.key->GetNativePaintWorkletReasons();
|
||||
+ }
|
||||
|
||||
- if (property.PropertyID() == CSSPropertyID::kBackgroundColor) {
|
||||
+ if (RuntimeEnabledFeatures::CompositeBGColorAnimationEnabled()) {
|
||||
+ ElementAnimations::CompositedPaintStatus status =
|
||||
+ reasons & Animation::kBackgroundColorPaintWorklet
|
||||
+ ? ElementAnimations::CompositedPaintStatus::kNeedsRepaint
|
||||
+ : ElementAnimations::CompositedPaintStatus::kNoAnimation;
|
||||
if (SetCompositedBackgroundColorStatus(status) &&
|
||||
element->GetLayoutObject()) {
|
||||
element->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||
}
|
||||
- } else if (property.PropertyID() == CSSPropertyID::kClipPath) {
|
||||
+ }
|
||||
+ if (RuntimeEnabledFeatures::CompositeClipPathAnimationEnabled()) {
|
||||
+ ElementAnimations::CompositedPaintStatus status =
|
||||
+ reasons & Animation::kClipPathPaintWorklet
|
||||
+ ? ElementAnimations::CompositedPaintStatus::kNeedsRepaint
|
||||
+ : ElementAnimations::CompositedPaintStatus::kNoAnimation;
|
||||
if (SetCompositedClipPathStatus(status) && element->GetLayoutObject()) {
|
||||
element->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||
// For clip paths, we also need to update the paint properties to switch
|
||||
diff --git a/third_party/blink/renderer/core/animation/element_animations.h b/third_party/blink/renderer/core/animation/element_animations.h
|
||||
index 624f542..3171061 100644
|
||||
--- a/third_party/blink/renderer/core/animation/element_animations.h
|
||||
+++ b/third_party/blink/renderer/core/animation/element_animations.h
|
||||
@@ -120,7 +120,7 @@
|
||||
|
||||
void RecalcCompositedStatusForKeyframeChange(Element& element,
|
||||
AnimationEffect* effect);
|
||||
- void RecalcCompositedStatus(Element* element, const CSSProperty& property);
|
||||
+ void RecalcCompositedStatus(Element* element);
|
||||
|
||||
// TODO(crbug.com/1301961): Consider converting to an array or flat map of
|
||||
// fields for paint properties that can be composited.
|
||||
@@ -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 1b748a2e0d803217985847014855b095b53c58e5..0e742f196367bbbe8c4e147ef4db4f8dbbe4cbbe 100644
|
||||
index 5469931a7c4dc7ad8b98f5ac54c5538a7ba23a78..9bd28a4029de17833d5147986736747075ff35bc 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4813,9 +4813,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4817,9 +4817,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 de6b544df67c9702b6771b08b003805b4f5fb5a4..4de45e398ec013714302c8cbaafa3bb6aa01ef8e 100644
|
||||
index 1f0b9a602a9e6cf565818ad584688b783fe3430b..1d1d761f8c7ff09cbd2c6a567e070ac41d3a1759 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4782,8 +4782,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4786,8 +4786,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
|
||||
@@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be
|
||||
done in future work.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index ed0c77c14e8dcf3e6d7328c8a9c640388b7be92d..7bf2296e1a3b48cc3aa7f031d5b835fab8488267 100644
|
||||
index 82aef58c0a3c00c818e0d60df9a5296162c57cc3..930e6160134897a91d4ed8f1517bc90d708cfd04 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -169,6 +169,7 @@
|
||||
@@ -23,7 +23,7 @@ index ed0c77c14e8dcf3e6d7328c8a9c640388b7be92d..7bf2296e1a3b48cc3aa7f031d5b835fa
|
||||
#include "third_party/blink/renderer/platform/graphics/image.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
|
||||
@@ -1850,6 +1851,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
@@ -1854,6 +1855,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
web_view_impl->SetMaximumLegibleScale(
|
||||
prefs.default_maximum_page_scale_factor);
|
||||
|
||||
@@ -16,13 +16,13 @@ Linux or Windows to un-fullscreen in some circumstances without this
|
||||
change.
|
||||
|
||||
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588efdfb0619 100644
|
||||
index 47d494f0c3c02bc65ca18521cc1049e766e050cb..40262c3b77980be3208387d64a685beef2035619 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
@@ -21,12 +21,16 @@
|
||||
@@ -20,12 +20,16 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/history/history_service_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/ui/blocked_content/popunder_preventer.h"
|
||||
+#endif
|
||||
@@ -36,7 +36,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "components/history/core/browser/history_service.h"
|
||||
#include "components/history/core/browser/history_types.h"
|
||||
@@ -259,10 +263,12 @@ void FullscreenController::EnterFullscreenModeForTab(
|
||||
@@ -260,10 +264,12 @@ void FullscreenController::EnterFullscreenModeForTab(
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
|
||||
// Keep the current state. |SetTabWithExclusiveAccess| may change the return
|
||||
// value of |IsWindowFullscreenForTabOrPending|.
|
||||
@@ -374,12 +380,14 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
|
||||
@@ -375,12 +381,14 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
|
||||
void FullscreenController::FullscreenTabOpeningPopup(
|
||||
content::WebContents* opener,
|
||||
content::WebContents* popup) {
|
||||
@@ -64,7 +64,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
}
|
||||
|
||||
void FullscreenController::OnTabDeactivated(
|
||||
@@ -465,10 +473,12 @@ void FullscreenController::FullscreenTransitionCompleted() {
|
||||
@@ -466,10 +474,12 @@ void FullscreenController::FullscreenTransitionCompleted() {
|
||||
#endif // DCHECK_IS_ON()
|
||||
tab_fullscreen_target_display_id_ = display::kInvalidDisplayId;
|
||||
started_fullscreen_transition_ = false;
|
||||
@@ -77,7 +77,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
}
|
||||
|
||||
void FullscreenController::RunOrDeferUntilTransitionIsComplete(
|
||||
@@ -576,18 +586,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -577,18 +587,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
|
||||
// from manually entering fullscreen mode and also disables kiosk mode on
|
||||
// desktop platforms.
|
||||
@@ -101,7 +101,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
if (option == TAB) {
|
||||
url = GetRequestingOrigin();
|
||||
tab_fullscreen_ = true;
|
||||
@@ -620,6 +629,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -621,6 +630,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
if (!extension_caused_fullscreen_.is_empty())
|
||||
url = extension_caused_fullscreen_;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
|
||||
fullscreen_start_time_ = base::TimeTicks::Now();
|
||||
if (option == BROWSER)
|
||||
@@ -640,6 +650,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -641,6 +651,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
// `fullscreen_start_time_` is null if a fullscreen tab moves to a new window.
|
||||
if (fullscreen_start_time_ && exclusive_access_tab()) {
|
||||
ukm::SourceId source_id =
|
||||
@@ -651,15 +662,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -652,15 +663,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
.Record(ukm::UkmRecorder::Get());
|
||||
fullscreen_start_time_.reset();
|
||||
}
|
||||
@@ -137,7 +137,7 @@ index 176f02f0abb4220564caa1d794faabc5b22bd8bc..4b08918cef83a84076e452b41302588e
|
||||
exclusive_access_manager()->context()->ExitFullscreen();
|
||||
extension_caused_fullscreen_ = GURL();
|
||||
exclusive_access_manager()->UpdateBubble(base::NullCallback());
|
||||
@@ -721,8 +733,12 @@ GURL FullscreenController::GetEmbeddingOrigin() const {
|
||||
@@ -722,8 +734,12 @@ GURL FullscreenController::GetEmbeddingOrigin() const {
|
||||
void FullscreenController::RecordMetricsOnFullscreenApiRequested(
|
||||
content::RenderFrameHost* requesting_frame) {
|
||||
history::HistoryService* service =
|
||||
|
||||
@@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
|
||||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
|
||||
index f8e18b15a19517b28057dd007adccc0fd222e2e1..6e1656f3bd62b597952528bfee884666111277fc 100644
|
||||
index 4f76cfa33ea68a49e1c7cec096cd34a1587042a2..0ee902a2ff5f82b75f4b6cb2eb0f96209e260183 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -10802,6 +10802,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
@@ -10806,6 +10806,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
"blob");
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ This patch can be removed should we choose to support chrome.fileSystem
|
||||
or support it enough to fix the crash.
|
||||
|
||||
diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts
|
||||
index f7e98f2c94ac9802062880f9341214f88c85a669..86b0b3b7596e7da68c536c0dea3d95b22bdd9481 100644
|
||||
index a861c34084b90561beab221ac13929bef295ac6d..94ea00dba8a6bb314421e6bd0ccef32e3ac02829 100644
|
||||
--- a/chrome/browser/resources/pdf/pdf_viewer.ts
|
||||
+++ b/chrome/browser/resources/pdf/pdf_viewer.ts
|
||||
@@ -1076,28 +1076,27 @@ export class PdfViewerElement extends PdfViewerBaseElement {
|
||||
@@ -1086,28 +1086,27 @@ export class PdfViewerElement extends PdfViewerBaseElement {
|
||||
dataArray = [result.dataToSave];
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ index f7e98f2c94ac9802062880f9341214f88c85a669..86b0b3b7596e7da68c536c0dea3d95b2
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1288,36 +1287,33 @@ export class PdfViewerElement extends PdfViewerBaseElement {
|
||||
@@ -1298,36 +1297,33 @@ export class PdfViewerElement extends PdfViewerBaseElement {
|
||||
fileName = fileName + '.pdf';
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ index f7e98f2c94ac9802062880f9341214f88c85a669..86b0b3b7596e7da68c536c0dea3d95b2
|
||||
|
||||
// <if expr="enable_pdf_ink2">
|
||||
// Ink2 doesn't need to exit annotation mode after save.
|
||||
@@ -1464,6 +1460,9 @@ declare global {
|
||||
@@ -1474,6 +1470,9 @@ declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'pdf-viewer': PdfViewerElement;
|
||||
}
|
||||
|
||||
@@ -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 9b84cc06795a5bef730cd81908254cf9ad11c836..1b748a2e0d803217985847014855b095b53c58e5 100644
|
||||
index f8872945d67dacbdb9c3d610ff3719039eca7c94..5469931a7c4dc7ad8b98f5ac54c5538a7ba23a78 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9384,7 +9384,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -9393,7 +9393,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -64,10 +64,10 @@ index cba373664bec3a32abad6fe0396bd67b53b7e67f..7a985067b1371604644d48159f2f5aa7
|
||||
|
||||
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index d918e9d165acefa8ba3a225aec261ebf028c40f7..d6cbf553961137429c40fe768f28b104bda0f89b 100644
|
||||
index 1daf1d65e2e6ac494790aa9201609c9ca9af6828..a4e649e4c63160e6152d3ff0d6a414ccd4f8b4cc 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -3130,6 +3130,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3136,6 +3136,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -75,7 +75,7 @@ index d918e9d165acefa8ba3a225aec261ebf028c40f7..d6cbf553961137429c40fe768f28b104
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_behavior) {
|
||||
@@ -3162,7 +3163,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3168,7 +3169,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
PausableScriptExecutor::CreateAndRun(
|
||||
script_state, std::move(script_sources), execute_script_policy,
|
||||
user_gesture, evaluation_timing, blocking_option, want_result_option,
|
||||
@@ -85,7 +85,7 @@ index d918e9d165acefa8ba3a225aec261ebf028c40f7..d6cbf553961137429c40fe768f28b104
|
||||
|
||||
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
index 13d1bea90341efbf51c476d3eacae49c8b960537..f508e3e9df98c167740b0574ef554bd17f41447f 100644
|
||||
index 7e65f92dbeb987836be447dee2c660cdde8295ed..b5484a84fea067938a9e3d15f49f4c12c3739c20 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
@@ -824,6 +824,7 @@ class CORE_EXPORT LocalFrame final
|
||||
@@ -204,7 +204,7 @@ index fa65331f40b90d812b71a489fd560e9359152d2b..390714d631dc88ef92d59ef9618a5706
|
||||
const mojom::blink::UserActivationOption user_activation_option_;
|
||||
const mojom::blink::LoadEventBlockingOption blocking_option_;
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
index 3979c3987da3dd49218407c41977d9ce7d114edb..7e00f6bdd1d398f22d39823088caf5cde3a34dd9 100644
|
||||
index 0802173ce891bcaca8b6bba2762ad2b80d4d5c75..6d31ccae7e6a9e204999d8475808afc11a0665c8 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
@@ -291,6 +291,7 @@ void ExecuteScriptsInMainWorld(
|
||||
|
||||
@@ -133,10 +133,10 @@ index 05d3a12dd84c7005d46cc73b312f97ef418d96f5..4765de982802541b3efc7211d106acc7
|
||||
const GURL& document_url,
|
||||
const WeakDocumentPtr& weak_document_ptr,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 07907372f37d3ef5c9eaef7011ebcd4ed6a2fed6..ec5e553d93caf8a24de97465a870567d95944000 100644
|
||||
index 09b7137cd3e26a1aef2c93ff7f08641df56704c0..732978b9650cac5102007c27b9226ff053c92d4f 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2105,7 +2105,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2106,7 +2106,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
@@ -145,7 +145,7 @@ index 07907372f37d3ef5c9eaef7011ebcd4ed6a2fed6..ec5e553d93caf8a24de97465a870567d
|
||||
creator_type, std::move(receiver));
|
||||
break;
|
||||
}
|
||||
@@ -2113,7 +2113,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2114,7 +2114,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
CHECK(rfh);
|
||||
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
|
||||
@@ -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 174b6cb9531237528664bcaff06a6e8dc1677349..144490c1ad76dce306e7e4a25270456d60bbb7f5 100644
|
||||
index 7b7e21c5b4b2e6657965c4433c6f9bc064a4ef9f..5abddf5b5cf2ab5e8e03066143b1824908257e87 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 e7e47a9aa5a22aea2aa0eeab7bd661b47c9cbdae..de6b544df67c9702b6771b08b003805b4f5fb5a4 100644
|
||||
index a722f77502e8b896fb5d55df7cb44d45d13df04f..1f0b9a602a9e6cf565818ad584688b783fe3430b 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5612,6 +5612,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -5616,6 +5616,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ index e7e47a9aa5a22aea2aa0eeab7bd661b47c9cbdae..de6b544df67c9702b6771b08b003805b
|
||||
RenderWidgetHostImpl* render_widget_host) {
|
||||
return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
|
||||
index 88282f2880d2443aca30ec1754bf5e43ed67acfc..60c94fd4508e166e0dd1be9c6eb97dd45e418853 100644
|
||||
index 2a098761bc3b67af3ada46596613152c136583b0..1d0df8595a89642a0eb33cdf76fd9cafc1e4b4b0 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1128,6 +1128,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
@@ -1130,6 +1130,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
void SendScreenRects() override;
|
||||
void SendActiveState(bool active) override;
|
||||
TextInputManager* GetTextInputManager() override;
|
||||
@@ -72,7 +72,7 @@ index 88282f2880d2443aca30ec1754bf5e43ed67acfc..60c94fd4508e166e0dd1be9c6eb97dd4
|
||||
RenderWidgetHostImpl* render_widget_host) override;
|
||||
bool IsShowingContextMenuOnPage() const override;
|
||||
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
|
||||
index 0379a5ca835e3e9d1b90543bbbe5971148d6c73e..03ed25d04ff0f54d412e1a3044b7770f75384a96 100644
|
||||
index f3284b11c2a9d020e85af2fea2057926de4cdd0b..9d58a654ddbabeecef2d9f17e0229c72c0afe6fd 100644
|
||||
--- a/content/public/browser/web_contents_observer.h
|
||||
+++ b/content/public/browser/web_contents_observer.h
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
@@ -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 0e742f196367bbbe8c4e147ef4db4f8dbbe4cbbe..7026b28c4f228971f74a706b6ad99777e4ca0773 100644
|
||||
index 9bd28a4029de17833d5147986736747075ff35bc..140e94cd6dfba03260ff9e2cf4b38459cdaaf9ba 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9518,25 +9518,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
@@ -9527,25 +9527,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
base::RepeatingClosure hang_monitor_restarter) {
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
|
||||
"render_widget_host", render_widget_host);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 21 Nov 2024 14:23:17 +0100
|
||||
Subject: Support BSTR PKEY_AppUserModel_ID in Windows Shortcuts
|
||||
|
||||
It's possible for a shortcut link on Windows to be BSTR format;
|
||||
this resulted in a DCHECK previously but as of the NOTREACHED
|
||||
fatal migration now will crash a given app. This has created an
|
||||
issue for Electron, which allows providing the shortcut information
|
||||
to end users. This CL thus allows for supporting VT_BSTR variants
|
||||
for PKEY_AppUserModel_ID and mitigates a crash. One such example
|
||||
is https://github.com/wez/wezterm, which after this change
|
||||
correctly gets an appUserModelId of 'org.wezfurlong.wezterm'.
|
||||
|
||||
Bug: N/A
|
||||
Change-Id: I5ad114bc345059637465b68a53a2f3f8c42de898
|
||||
|
||||
diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc
|
||||
index d4a54d1afdc121192f9c0321c6ced584ee066486..02f3e63d16c3324f546f6155d722900f0a81131a 100644
|
||||
--- a/base/win/shortcut.cc
|
||||
+++ b/base/win/shortcut.cc
|
||||
@@ -289,14 +289,22 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
|
||||
return false;
|
||||
}
|
||||
switch (pv_app_id.get().vt) {
|
||||
- case VT_EMPTY:
|
||||
+ case VT_EMPTY: {
|
||||
properties->set_app_id(std::wstring());
|
||||
break;
|
||||
- case VT_LPWSTR:
|
||||
+ }
|
||||
+ case VT_LPWSTR: {
|
||||
properties->set_app_id(pv_app_id.get().pwszVal);
|
||||
break;
|
||||
- default:
|
||||
+ }
|
||||
+ case VT_BSTR: {
|
||||
+ BSTR bs = pv_app_id.get().bstrVal;
|
||||
+ properties->set_app_id(std::wstring(bs, ::SysStringLen(bs)));
|
||||
+ break;
|
||||
+ }
|
||||
+ default: {
|
||||
NOTREACHED() << "Unexpected variant type: " << pv_app_id.get().vt;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index ec5e553d93caf8a24de97465a870567d95944000..369b4c70bba9363ed8fac184fd843bf1aa49e59e 100644
|
||||
index 732978b9650cac5102007c27b9226ff053c92d4f..851eff886b5827e362b260f6a954a9081417b067 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1753,6 +1753,10 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1754,6 +1754,10 @@ bool RenderProcessHostImpl::Init() {
|
||||
std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
|
||||
std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
|
||||
*cmd_line, IsPdf(), IsJitDisabled());
|
||||
|
||||
@@ -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 4de45e398ec013714302c8cbaafa3bb6aa01ef8e..6d0b5e9a3350108f183e958871928623283cbe23 100644
|
||||
index 1d1d761f8c7ff09cbd2c6a567e070ac41d3a1759..50dd1fe97063a3d763461fe3ff7af340e7c4ad05 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3754,6 +3754,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3758,6 +3758,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 4de45e398ec013714302c8cbaafa3bb6aa01ef8e..6d0b5e9a3350108f183e958871928623
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3764,6 +3771,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3768,6 +3775,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ index 4de45e398ec013714302c8cbaafa3bb6aa01ef8e..6d0b5e9a3350108f183e958871928623
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 825e0d9d641bfa8fc5907a6d479d94206d432fb6..0f2ce0476e9b067ea2f678e5683040e29f10fe81 100644
|
||||
index 191a98adec4cc5eb1378be40456a11ff5c093a2e..7a3eb2028af908907bd5e72df90534c90884b34e 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -111,10 +111,13 @@ class BrowserPluginGuestDelegate;
|
||||
|
||||
@@ -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 4f31803e492d0d05b29659f8bf75b6fee7aff25e..174b6cb9531237528664bcaff06a6e8dc1677349 100644
|
||||
index 53f96ccd4954972bc78ebccf4bf479ac8564a8d3..7b7e21c5b4b2e6657965c4433c6f9bc064a4ef9f 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8277,6 +8277,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -8286,6 +8286,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index 4f31803e492d0d05b29659f8bf75b6fee7aff25e..174b6cb9531237528664bcaff06a6e8d
|
||||
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 6d0b5e9a3350108f183e958871928623283cbe23..9b84cc06795a5bef730cd81908254cf9ad11c836 100644
|
||||
index 50dd1fe97063a3d763461fe3ff7af340e7c4ad05..f8872945d67dacbdb9c3d610ff3719039eca7c94 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4011,21 +4011,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -4015,21 +4015,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
const input::NativeWebKeyboardEvent& event) {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::PreHandleKeyboardEvent");
|
||||
@@ -78,7 +78,7 @@ index 6d0b5e9a3350108f183e958871928623283cbe23..9b84cc06795a5bef730cd81908254cf9
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -4184,7 +4188,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -4188,7 +4192,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -1268,10 +1268,10 @@ index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a607bb12f
|
||||
index 0000000000000000000000000000000000000000..c429d4cbfff605ff78c7c8ee3c5ad046594163f3
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,741 @@
|
||||
@@ -0,0 +1,740 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
@@ -1550,7 +1550,6 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a
|
||||
+ "lib/internal/http2/compat.js",
|
||||
+ "lib/internal/http2/core.js",
|
||||
+ "lib/internal/http2/util.js",
|
||||
+ "lib/internal/idna.js",
|
||||
+ "lib/internal/inspector_async_hook.js",
|
||||
+ "lib/internal/inspector_network_tracking.js",
|
||||
+ "lib/internal/js_stream_socket.js",
|
||||
|
||||
@@ -40,7 +40,7 @@ index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c56
|
||||
# list in v8/BUILD.gn.
|
||||
['v8_enable_v8_checks == 1', {
|
||||
diff --git a/configure.py b/configure.py
|
||||
index a6f66c41f75bffcfaf75d4415c694300b7624136..7ca0762fe3590fef7b88ba684de44d99aaecace4 100755
|
||||
index 0d089c35d1720e05c4c61d0226a2ebc276b65d6e..cf19b9d092698e1697508e8891926947bc2f7b12 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1585,6 +1585,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
|
||||
@@ -26,7 +26,7 @@ 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 ea7afd52fab1cf3fde1674be1429a00562b714c0..02cfc8b3328fedb6306abf6c738bea772c674458 100644
|
||||
index a05d2846050c2f505eac16320f645e79182a27f6..348bb80ef7fae1e0e5f529b1313093eeadad9276 100644
|
||||
--- a/lib/internal/process/pre_execution.js
|
||||
+++ b/lib/internal/process/pre_execution.js
|
||||
@@ -247,12 +247,14 @@ function patchProcessObject(expandArgv1) {
|
||||
|
||||
@@ -9,7 +9,7 @@ This patch can be removed when Node.js upgrades to a version of V8 containing
|
||||
the above CL.
|
||||
|
||||
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
|
||||
index 74e867ace6207751a96b4da03802b50b620dbd7b..53ceabeb58f56ebd27e60fd49c362d26e361e6d8 100644
|
||||
index c028204481d44cb5f35ad98413022e7b07ce04b2..230c2378996c5d1ec18a9183ef138bbf70bba22d 100644
|
||||
--- a/lib/.eslintrc.yaml
|
||||
+++ b/lib/.eslintrc.yaml
|
||||
@@ -30,10 +30,6 @@ rules:
|
||||
@@ -24,10 +24,10 @@ index 74e867ace6207751a96b4da03802b50b620dbd7b..53ceabeb58f56ebd27e60fd49c362d26
|
||||
message: Use `const { Blob } = require('buffer');` instead of the global.
|
||||
- name: BroadcastChannel
|
||||
diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js
|
||||
index 30f7a5f79e50fdeb4e1775a0e56dafa4c6908898..f7250985277c4127425ef36dff566c1fe06603e2 100644
|
||||
index cfd1d1b6f18e2943e155cf021b566a4673f71ab0..8d1a184ad1936c0d8493d6c54c32bebcf0021d8b 100644
|
||||
--- a/lib/internal/main/worker_thread.js
|
||||
+++ b/lib/internal/main/worker_thread.js
|
||||
@@ -112,7 +112,7 @@ port.on('message', (message) => {
|
||||
@@ -113,7 +113,7 @@ port.on('message', (message) => {
|
||||
|
||||
require('internal/worker').assignEnvironmentData(environmentData);
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ index 606a6f5caa3b11b6d2a9068ed2fd65800530a5eb..080dcce21da05ccea398d8a856deb397
|
||||
typedef void (*FreeCallback)(char* data, void* hint);
|
||||
|
||||
diff --git a/src/node_errors.h b/src/node_errors.h
|
||||
index 1662491bac44311421eeb7ee35bb47c025162abf..a62b18e832986ee38d93b412b36020a2c22255a9 100644
|
||||
index ac07b96b5cad0f3502468c86745e2b341d338e1f..f51c4309ceec3f0dc5e07982fb789ff6663076ba 100644
|
||||
--- a/src/node_errors.h
|
||||
+++ b/src/node_errors.h
|
||||
@@ -230,7 +230,7 @@ inline v8::Local<v8::Object> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
|
||||
@@ -235,7 +235,7 @@ inline v8::Local<v8::Object> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
|
||||
char message[128];
|
||||
snprintf(message, sizeof(message),
|
||||
"Cannot create a Buffer larger than 0x%zx bytes",
|
||||
|
||||
@@ -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 ed0a43306e87962cf0e756d9e059ec5c08ad674b..7ada2802b2590e78fa5b9847935866b743cf94ed 100644
|
||||
index d97682ac2ebcdf145e202325a4642a1bfd3970b2..7c5c08c450b9b4774265ead6a91d3ed76693c290 100644
|
||||
--- a/doc/api/cli.md
|
||||
+++ b/doc/api/cli.md
|
||||
@@ -2868,7 +2868,6 @@ V8 options that are allowed are:
|
||||
@@ -2869,7 +2869,6 @@ V8 options that are allowed are:
|
||||
* `--disallow-code-generation-from-strings`
|
||||
* `--enable-etw-stack-walking`
|
||||
* `--expose-gc`
|
||||
@@ -30,7 +30,7 @@ index ed0a43306e87962cf0e756d9e059ec5c08ad674b..7ada2802b2590e78fa5b9847935866b7
|
||||
* `--jitless`
|
||||
* `--max-old-space-size`
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 4e3c82e9528b04fd1a0cc99d30fb885e4b224bc9..38e173f72b446aa2db07f676b6ece26247bbf56b 100644
|
||||
index 9b5f49ebb478a21acf8f0d6ed012ed6829a8a320..433c8a3c1df125e3d7df414980440c64ffca61d6 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -866,11 +866,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
|
||||
@@ -46,10 +46,10 @@ index 4e3c82e9528b04fd1a0cc99d30fb885e4b224bc9..38e173f72b446aa2db07f676b6ece262
|
||||
"disable runtime allocation of executable memory",
|
||||
V8Option{},
|
||||
diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js
|
||||
index 8d614e607177cdd922fef65a85a2ccdcf54116c0..146df3a21a0551e910c46248d2fd97dde8896164 100644
|
||||
index 9fb6d8af0691108868a3245518edc0f0057557ab..3b9409c3af778fcfe2be0fae2cbb04753dd5c8f1 100644
|
||||
--- a/test/parallel/test-cli-node-options.js
|
||||
+++ b/test/parallel/test-cli-node-options.js
|
||||
@@ -70,7 +70,6 @@ if (common.hasCrypto) {
|
||||
@@ -72,7 +72,6 @@ if (common.hasCrypto) {
|
||||
expect('--abort_on-uncaught_exception', 'B\n');
|
||||
expect('--disallow-code-generation-from-strings', 'B\n');
|
||||
expect('--expose-gc', 'B\n');
|
||||
|
||||
@@ -8,7 +8,7 @@ to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used
|
||||
by the crashpad client to connect with the handler process.
|
||||
|
||||
diff --git a/lib/child_process.js b/lib/child_process.js
|
||||
index 48870b35ad0f3411f2d509b12d92a9e0d20046f9..e7ef454d2d71207ae7b2788a437b82bf7732716e 100644
|
||||
index cc81cb373d59dbc1ab18182aa2a0c8ebe63f6245..d3871405e2ecb3917b8ec816490c575891c91d18 100644
|
||||
--- a/lib/child_process.js
|
||||
+++ b/lib/child_process.js
|
||||
@@ -61,6 +61,7 @@ let debug = require('internal/util/debuglog').debuglog(
|
||||
|
||||
@@ -58,7 +58,7 @@ index b9098d102b40adad7fafcc331ac62870617019b9..cb9269a31e073caf86164aa39c064037
|
||||
}
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 818baf611fcab7838a339f3ea137467653e270d0..4e3c82e9528b04fd1a0cc99d30fb885e4b224bc9 100644
|
||||
index efbe48e10b8408642a6b5010b1a7a3749068188a..9b5f49ebb478a21acf8f0d6ed012ed6829a8a320 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -1405,14 +1405,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
@@ -33,7 +33,7 @@ index f3dfc69cd2cdec50bc3b3f7cb2d63349812d87dd..b6f2d7194cb75ecc8c47869761c63184
|
||||
if (!loaded) {
|
||||
module = new CJSModule(filename);
|
||||
diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js
|
||||
index ca401044c0178c46db9b439b27c440a5d7924c84..dc1a682f0a3cf1ba1095c60bf6a6ca992d6043b3 100644
|
||||
index 4ad694debfc72f56dd98a4e56dd0bbc63711242e..73f0e00ad34132e7d2fd37ec321110881e89617f 100644
|
||||
--- a/lib/internal/modules/run_main.js
|
||||
+++ b/lib/internal/modules/run_main.js
|
||||
@@ -2,6 +2,7 @@
|
||||
@@ -58,7 +58,7 @@ index ca401044c0178c46db9b439b27c440a5d7924c84..dc1a682f0a3cf1ba1095c60bf6a6ca99
|
||||
const defaultType = getOptionValue('--experimental-default-type');
|
||||
/** @type {string} */
|
||||
let mainPath;
|
||||
@@ -59,6 +67,13 @@ function resolveMainPath(main) {
|
||||
@@ -58,6 +66,13 @@ function resolveMainPath(main) {
|
||||
* @param {string} mainPath - Absolute path to the main entry point
|
||||
*/
|
||||
function shouldUseESMLoader(mainPath) {
|
||||
|
||||
@@ -353,7 +353,7 @@ index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b0
|
||||
} // namespace
|
||||
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 30561ab7a24c734be71ed29d963c11e2ea2c2b22..7cb77fb4f35a60fbda5b868798321ac8b6340bfa 100644
|
||||
index 2ec0a56e05ff879df8c55bf140677e571a56fafa..a30c25a3a61dfe73944731760404c555f2782d72 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -49,7 +49,7 @@
|
||||
@@ -365,7 +365,7 @@ index 30561ab7a24c734be71ed29d963c11e2ea2c2b22..7cb77fb4f35a60fbda5b868798321ac8
|
||||
#include <openssl/evp.h>
|
||||
#endif
|
||||
|
||||
@@ -1065,7 +1065,7 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1051,7 +1051,7 @@ class Environment : public MemoryRetainer {
|
||||
kExitInfoFieldCount
|
||||
};
|
||||
|
||||
@@ -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 dba59c5560c22899bd108789360f21fd85dd41bf..818baf611fcab7838a339f3ea137467653e270d0 100644
|
||||
index e325b082dec6ae891a737a4fa7775937e4d7b7f9..efbe48e10b8408642a6b5010b1a7a3749068188a 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@@ -16,7 +16,7 @@ patch:
|
||||
(cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326)
|
||||
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index d98a32d6ec311459877bc3b0de33cca4766aeda7..9fc934975b015b97ddd84bf3eea5d53144130035 100644
|
||||
index 852c82fd7f50c01d08eeddc151b1bec6afa68028..8f4b004d6655acd1c0dac449612316a48cf885c6 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const {
|
||||
@@ -52,7 +52,7 @@ index d98a32d6ec311459877bc3b0de33cca4766aeda7..9fc934975b015b97ddd84bf3eea5d531
|
||||
return &(wrapper_data_->cppgc_id);
|
||||
}
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fdea1edde29 100644
|
||||
index ca75e0360bbf6a20ea18e67dda167d5ec523b075..158b96a9b1ea5553fa74d2429152a5c974d50c03 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -22,6 +22,7 @@
|
||||
@@ -146,7 +146,7 @@ index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fde
|
||||
|
||||
void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 7cb77fb4f35a60fbda5b868798321ac8b6340bfa..06746554e1d60a9377ff6d7d970220f3fa88e4ac 100644
|
||||
index a30c25a3a61dfe73944731760404c555f2782d72..6137551bb8168d8fa9a3e6bc79c3d1e79b306931 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -174,10 +174,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
|
||||
@@ -298,3 +298,17 @@ index 9787b14352753c5e0f8dc2b90093680e7cd10f1a..31af9e62396368af1b81f8841a705fd3
|
||||
auto ab = ArrayBuffer::New(isolate, std::move(bs));
|
||||
v8::Local<Uint8Array> u8 = v8::Uint8Array::New(ab, 0, 1);
|
||||
|
||||
diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js
|
||||
index 1167654dcf0773be953d09dfcf534e902e75595b..a769ec1fb61916d4285fa9d3559ded5df4f02e9e 100644
|
||||
--- a/test/parallel/test-buffer-tostring-range.js
|
||||
+++ b/test/parallel/test-buffer-tostring-range.js
|
||||
@@ -103,6 +103,8 @@ assert.throws(() => {
|
||||
// Cannot test on 32bit machine as we are testing the case
|
||||
// when start and end are above the threshold
|
||||
common.skipIf32Bits();
|
||||
+/* Disabled due to incompatiblity with v8 memory cage
|
||||
const threshold = 0xFFFFFFFF;
|
||||
const largeBuffer = Buffer.alloc(threshold);
|
||||
largeBuffer.toString('utf8', threshold + 0xF, threshold + 0xFF);
|
||||
+*/
|
||||
\ No newline at end of file
|
||||
|
||||
@@ -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 a539649d5537376a6a2ac9a7a46051b8648f0cb1..a03c86b752772be7ae36fab31faeccf3b0ccff64 100644
|
||||
index 073b29cce8dbca4c8d92ad666f9244ad511296db..338d20263f29a630febb96567f3cb708623bd09a 100644
|
||||
--- a/test/sequential/sequential.status
|
||||
+++ b/test/sequential/sequential.status
|
||||
@@ -7,6 +7,18 @@ prefix sequential
|
||||
|
||||
@@ -7,10 +7,10 @@ Subject: test: match wpt/streams/transferable/transform-stream-members.any.js
|
||||
All four of this calls should fail - see third_party/blink/web_tests/external/wpt/streams/transferable/transform-stream-members.any-expected.txt
|
||||
|
||||
diff --git a/test/wpt/status/streams.json b/test/wpt/status/streams.json
|
||||
index 5425c86bba85079a44745779d998337aaa063df1..775661cd59b14132c9a811e448792ea02198f949 100644
|
||||
index af3646c65ea6609e17638da925f86de8c9d6221c..f1d9e76718c264aafb9c27c516589d9874d8b73f 100644
|
||||
--- a/test/wpt/status/streams.json
|
||||
+++ b/test/wpt/status/streams.json
|
||||
@@ -60,7 +60,9 @@
|
||||
@@ -53,7 +53,9 @@
|
||||
"fail": {
|
||||
"expected": [
|
||||
"Transferring [object TransformStream],[object ReadableStream] should fail",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||
BUILD_TYPE="win"
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
if [ -z "$MAS_BUILD" ]; then
|
||||
BUILD_TYPE="darwin"
|
||||
else
|
||||
@@ -46,23 +48,47 @@ cp_if_exist() {
|
||||
move_src_dirs_if_exist() {
|
||||
mkdir src_artifacts
|
||||
|
||||
for dir in \
|
||||
src/out/Default/gen/node_headers \
|
||||
src/out/Default/overlapped-checker \
|
||||
src/out/Default/ffmpeg \
|
||||
src/out/Default/hunspell_dictionaries \
|
||||
src/third_party/electron_node \
|
||||
src/third_party/nan \
|
||||
src/cross-arch-snapshots \
|
||||
src/third_party/llvm-build \
|
||||
src/build/linux \
|
||||
src/buildtools/mac \
|
||||
src/buildtools/third_party/libc++ \
|
||||
src/buildtools/third_party/libc++abi \
|
||||
src/third_party/libc++ \
|
||||
src/third_party/libc++abi \
|
||||
src/out/Default/obj/buildtools/third_party \
|
||||
src/v8/tools/builtins-pgo
|
||||
dirs=("src/out/Default/gen/node_headers" \
|
||||
"src/out/Default/overlapped-checker" \
|
||||
"src/out/Default/ffmpeg" \
|
||||
"src/out/Default/hunspell_dictionaries" \
|
||||
"src/third_party/electron_node" \
|
||||
"src/third_party/nan" \
|
||||
"src/cross-arch-snapshots" \
|
||||
"src/buildtools/mac" \
|
||||
"src/buildtools/third_party/libc++" \
|
||||
"src/buildtools/third_party/libc++abi" \
|
||||
"src/third_party/libc++" \
|
||||
"src/third_party/libc++abi" \
|
||||
"src/out/Default/obj/buildtools/third_party" \
|
||||
"src/v8/tools/builtins-pgo")
|
||||
|
||||
# Only do this for linux build type, this folder
|
||||
# exists for windows builds on linux hosts but we do
|
||||
# not need it
|
||||
if [ "$BUILD_TYPE" == "linux" ]; then
|
||||
dirs+=('src/build/linux')
|
||||
fi
|
||||
|
||||
# llvm-build is the host toolchain, for windows we need
|
||||
# a different toolchain so no point copying this one
|
||||
if [ "$BUILD_TYPE" != "win" ]; then
|
||||
dirs+=('src/third_party/llvm-build')
|
||||
fi
|
||||
|
||||
# On windows we should clean up two symlinks that aren't
|
||||
# compatible with the windows test runner
|
||||
if [ "$BUILD_TYPE" == "win" ]; then
|
||||
rm -f src/third_party/electron_node/tools/node_modules/eslint/node_modules/eslint
|
||||
rm -f src/third_party/electron_node/tools/node_modules/eslint/node_modules/.bin/eslint
|
||||
rm -f src/third_party/electron_node/out/tools/bin/python
|
||||
|
||||
# Also need to copy electron.lib to node.lib for native module testing purposes
|
||||
mkdir -p src/out/Default/gen/node_headers/Release
|
||||
cp src/out/Default/electron.lib src/out/Default/gen/node_headers/Release/node.lib
|
||||
fi
|
||||
|
||||
for dir in "${dirs[@]}"
|
||||
do
|
||||
if [ -d "$dir" ]; then
|
||||
mkdir -p src_artifacts/$(dirname $dir)
|
||||
@@ -70,7 +96,7 @@ move_src_dirs_if_exist() {
|
||||
fi
|
||||
done
|
||||
|
||||
tar -C src_artifacts -cf src_artifacts.tar ./
|
||||
tar -C src_artifacts -cf src_artifacts.tar .
|
||||
|
||||
echo Storing src_artifacts.tar
|
||||
mv src_artifacts.tar $SRC_ARTIFACTS
|
||||
|
||||
@@ -2,21 +2,19 @@ const crypto = require('node:crypto');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
// Fallback to blow away old cache keys
|
||||
const FALLBACK_HASH_VERSION = 3;
|
||||
|
||||
// Per platform hash versions to bust the cache on different platforms
|
||||
const HASH_VERSIONS = {
|
||||
darwin: 3,
|
||||
darwin: 4,
|
||||
win32: 4,
|
||||
linux: 3
|
||||
linux: 4
|
||||
};
|
||||
|
||||
// Base files to hash
|
||||
const filesToHash = [
|
||||
path.resolve(__dirname, '../DEPS'),
|
||||
path.resolve(__dirname, '../yarn.lock'),
|
||||
path.resolve(__dirname, '../script/sysroots.json')
|
||||
path.resolve(__dirname, '../script/sysroots.json'),
|
||||
path.resolve(__dirname, '../.github/actions/checkout/action.yml')
|
||||
];
|
||||
|
||||
const addAllFiles = (dir) => {
|
||||
@@ -38,7 +36,7 @@ const hasher = crypto.createHash('SHA256');
|
||||
const addToHashAndLog = (s) => {
|
||||
return hasher.update(s);
|
||||
};
|
||||
addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`);
|
||||
addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform]}`);
|
||||
for (const file of filesToHash) {
|
||||
hasher.update(fs.readFileSync(file));
|
||||
}
|
||||
@@ -47,15 +45,5 @@ for (const file of filesToHash) {
|
||||
const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args';
|
||||
addToHashAndLog(extraArgs);
|
||||
|
||||
const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform;
|
||||
|
||||
// Write the hash to disk
|
||||
fs.writeFileSync(path.resolve(__dirname, '../.depshash'), hasher.digest('hex'));
|
||||
|
||||
let targetContent = `${effectivePlatform}\n${process.env.TARGET_ARCH}\n${process.env.GN_CONFIG}\n${undefined}\n${process.env.GN_EXTRA_ARGS}\n${process.env.GN_BUILDFLAG_ARGS}`;
|
||||
const argsDir = path.resolve(__dirname, '../build/args');
|
||||
for (const argFile of fs.readdirSync(argsDir).sort()) {
|
||||
targetContent += `\n${argFile}--${crypto.createHash('SHA1').update(fs.readFileSync(path.resolve(argsDir, argFile))).digest('hex')}`;
|
||||
}
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname, '../.depshash-target'), targetContent);
|
||||
|
||||
@@ -31,9 +31,9 @@ async function main () {
|
||||
const outDir = utils.getOutDir({ shouldLog: true });
|
||||
const nodeDir = path.resolve(BASE, 'out', outDir, 'gen', 'node_headers');
|
||||
const env = {
|
||||
npm_config_msvs_version: '2022',
|
||||
...process.env,
|
||||
npm_config_nodedir: nodeDir,
|
||||
npm_config_msvs_version: '2022',
|
||||
npm_config_arch: process.env.NPM_CONFIG_ARCH,
|
||||
npm_config_yes: 'true'
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@ const unknownFlags = [];
|
||||
const pass = chalk.green('✓');
|
||||
const fail = chalk.red('✗');
|
||||
|
||||
const FAILURE_STATUS_KEY = 'Electron_Spec_Runner_Failures';
|
||||
|
||||
const args = minimist(process.argv, {
|
||||
string: ['runners', 'target', 'electronVersion'],
|
||||
unknown: arg => unknownFlags.push(arg)
|
||||
@@ -156,6 +158,36 @@ async function runElectronTests () {
|
||||
}
|
||||
}
|
||||
|
||||
async function asyncSpawn (exe, runnerArgs) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let forceExitResult = 0;
|
||||
const child = childProcess.spawn(exe, runnerArgs, {
|
||||
cwd: path.resolve(__dirname, '../..')
|
||||
});
|
||||
child.stdout.pipe(process.stdout);
|
||||
child.stderr.pipe(process.stderr);
|
||||
if (process.env.ELECTRON_FORCE_TEST_SUITE_EXIT) {
|
||||
child.stdout.on('data', data => {
|
||||
const failureRE = RegExp(`${FAILURE_STATUS_KEY}: (\\d.*)`);
|
||||
const failures = data.toString().match(failureRE);
|
||||
if (failures) {
|
||||
forceExitResult = parseInt(failures[1], 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
child.on('error', error => reject(error));
|
||||
child.on('close', (status, signal) => {
|
||||
let returnStatus = 0;
|
||||
if (process.env.ELECTRON_FORCE_TEST_SUITE_EXIT) {
|
||||
returnStatus = forceExitResult;
|
||||
} else {
|
||||
returnStatus = status;
|
||||
}
|
||||
resolve({ status: returnStatus, signal });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function runTestUsingElectron (specDir, testName) {
|
||||
let exe;
|
||||
if (args.electronVersion) {
|
||||
@@ -169,10 +201,7 @@ async function runTestUsingElectron (specDir, testName) {
|
||||
runnerArgs.unshift(path.resolve(__dirname, 'dbus_mock.py'), exe);
|
||||
exe = 'python3';
|
||||
}
|
||||
const { status, signal } = childProcess.spawnSync(exe, runnerArgs, {
|
||||
cwd: path.resolve(__dirname, '../..'),
|
||||
stdio: 'inherit'
|
||||
});
|
||||
const { status, signal } = await asyncSpawn(exe, runnerArgs);
|
||||
if (status !== 0) {
|
||||
if (status) {
|
||||
const textStatus = process.platform === 'win32' ? `0x${status.toString(16)}` : status.toString();
|
||||
@@ -191,9 +220,9 @@ async function runMainProcessElectronTests () {
|
||||
|
||||
async function installSpecModules (dir) {
|
||||
const env = {
|
||||
npm_config_msvs_version: '2022',
|
||||
...process.env,
|
||||
CXXFLAGS: process.env.CXXFLAGS,
|
||||
npm_config_msvs_version: '2022',
|
||||
npm_config_yes: 'true'
|
||||
};
|
||||
if (args.electronVersion) {
|
||||
|
||||
0
script/zip_manifests/dist_zip.win.arm64.manifest
Executable file → Normal file
0
script/zip_manifests/dist_zip.win.arm64.manifest
Executable file → Normal file
@@ -10,6 +10,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/containers/extend.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "content/public/common/content_constants.h"
|
||||
@@ -98,21 +99,6 @@ bool IsWidevineAvailable(
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
||||
|
||||
void AppendDelimitedSwitchToVector(const std::string_view cmd_switch,
|
||||
std::vector<std::string>* append_me) {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
auto switch_value = command_line->GetSwitchValueASCII(cmd_switch);
|
||||
if (!switch_value.empty()) {
|
||||
constexpr std::string_view delimiter{",", 1};
|
||||
auto tokens =
|
||||
base::SplitString(switch_value, delimiter, base::TRIM_WHITESPACE,
|
||||
base::SPLIT_WANT_NONEMPTY);
|
||||
append_me->reserve(append_me->size() + tokens.size());
|
||||
std::move(std::begin(tokens), std::end(tokens),
|
||||
std::back_inserter(*append_me));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ElectronContentClient::ElectronContentClient() = default;
|
||||
@@ -149,16 +135,19 @@ void ElectronContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
||||
//
|
||||
// We use this for registration to network utility process
|
||||
if (IsUtilityProcess()) {
|
||||
AppendDelimitedSwitchToVector(switches::kServiceWorkerSchemes,
|
||||
&schemes->service_worker_schemes);
|
||||
AppendDelimitedSwitchToVector(switches::kStandardSchemes,
|
||||
&schemes->standard_schemes);
|
||||
AppendDelimitedSwitchToVector(switches::kSecureSchemes,
|
||||
&schemes->secure_schemes);
|
||||
AppendDelimitedSwitchToVector(switches::kBypassCSPSchemes,
|
||||
&schemes->csp_bypassing_schemes);
|
||||
AppendDelimitedSwitchToVector(switches::kCORSSchemes,
|
||||
&schemes->cors_enabled_schemes);
|
||||
const auto& cmd = *base::CommandLine::ForCurrentProcess();
|
||||
auto append_cli_schemes = [&cmd](auto& appendme, const auto key) {
|
||||
base::Extend(appendme, base::SplitString(cmd.GetSwitchValueASCII(key),
|
||||
",", base::TRIM_WHITESPACE,
|
||||
base::SPLIT_WANT_NONEMPTY));
|
||||
};
|
||||
|
||||
using namespace switches;
|
||||
append_cli_schemes(schemes->cors_enabled_schemes, kCORSSchemes);
|
||||
append_cli_schemes(schemes->csp_bypassing_schemes, kBypassCSPSchemes);
|
||||
append_cli_schemes(schemes->secure_schemes, kSecureSchemes);
|
||||
append_cli_schemes(schemes->service_worker_schemes, kServiceWorkerSchemes);
|
||||
append_cli_schemes(schemes->standard_schemes, kStandardSchemes);
|
||||
}
|
||||
|
||||
if (electron::fuses::IsGrantFileProtocolExtraPrivilegesEnabled()) {
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kRelauncherProcess[] = "relauncher";
|
||||
constexpr std::string_view kRelauncherProcess = "relauncher";
|
||||
|
||||
constexpr std::string_view kElectronDisableSandbox{"ELECTRON_DISABLE_SANDBOX"};
|
||||
constexpr std::string_view kElectronEnableStackDumping{
|
||||
|
||||
@@ -776,7 +776,7 @@ base::OnceClosure App::SelectClientCertificate(
|
||||
std::move((*shared_identities)[0]),
|
||||
base::BindRepeating(&GotPrivateKey, shared_delegate, std::move(cert)));
|
||||
}
|
||||
return base::OnceClosure();
|
||||
return {};
|
||||
}
|
||||
|
||||
void App::OnGpuInfoUpdate() {
|
||||
@@ -944,7 +944,7 @@ std::string App::GetSystemLocale(gin_helper::ErrorThrower thrower) const {
|
||||
thrower.ThrowError(
|
||||
"app.getSystemLocale() can only be called "
|
||||
"after app is ready");
|
||||
return std::string();
|
||||
return {};
|
||||
}
|
||||
return static_cast<BrowserProcessImpl*>(g_browser_process)->GetSystemLocale();
|
||||
}
|
||||
@@ -1011,8 +1011,6 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
|
||||
if (HasSingleInstanceLock())
|
||||
return true;
|
||||
|
||||
std::string program_name = electron::Browser::Get()->GetName();
|
||||
|
||||
base::FilePath user_dir;
|
||||
base::PathService::Get(chrome::DIR_USER_DATA, &user_dir);
|
||||
// The user_dir may not have been created yet.
|
||||
@@ -1023,6 +1021,7 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
|
||||
blink::CloneableMessage additional_data_message;
|
||||
args->GetNext(&additional_data_message);
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const std::string program_name = electron::Browser::Get()->GetName();
|
||||
bool app_is_sandboxed =
|
||||
IsSandboxEnabled(base::CommandLine::ForCurrentProcess());
|
||||
process_singleton_ = std::make_unique<ProcessSingleton>(
|
||||
|
||||
@@ -640,7 +640,7 @@ void BaseWindow::SetBackgroundColor(const std::string& color_name) {
|
||||
window_->SetBackgroundColor(color);
|
||||
}
|
||||
|
||||
std::string BaseWindow::GetBackgroundColor(gin_helper::Arguments* args) const {
|
||||
std::string BaseWindow::GetBackgroundColor() const {
|
||||
return ToRGBHex(window_->GetBackgroundColor());
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
bool IsKiosk() const;
|
||||
bool IsTabletMode() const;
|
||||
virtual void SetBackgroundColor(const std::string& color_name);
|
||||
std::string GetBackgroundColor(gin_helper::Arguments* args) const;
|
||||
std::string GetBackgroundColor() const;
|
||||
void InvalidateShadow();
|
||||
void SetHasShadow(bool has_shadow);
|
||||
bool HasShadow() const;
|
||||
|
||||
@@ -168,7 +168,7 @@ void FilterCookieWithStatuses(
|
||||
// Parse dictionary property to CanonicalCookie time correctly.
|
||||
base::Time ParseTimeProperty(const std::optional<double>& value) {
|
||||
if (!value) // empty time means ignoring the parameter
|
||||
return base::Time();
|
||||
return {};
|
||||
if (*value == 0) // FromSecondsSinceUnixEpoch would convert 0 to empty Time
|
||||
return base::Time::UnixEpoch();
|
||||
return base::Time::FromSecondsSinceUnixEpoch(*value);
|
||||
@@ -292,8 +292,8 @@ std::string StringToCookieSameSite(const std::string* str_ptr,
|
||||
|
||||
gin::WrapperInfo Cookies::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||
|
||||
Cookies::Cookies(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
|
||||
: browser_context_(browser_context) {
|
||||
Cookies::Cookies(ElectronBrowserContext* browser_context)
|
||||
: browser_context_{browser_context} {
|
||||
cookie_change_subscription_ =
|
||||
browser_context_->cookie_change_notifier()->RegisterCookieChangeCallback(
|
||||
base::BindRepeating(&Cookies::OnCookieChanged,
|
||||
@@ -458,7 +458,7 @@ void Cookies::OnCookieChanged(const net::CookieChangeInfo& change) {
|
||||
// static
|
||||
gin::Handle<Cookies> Cookies::Create(v8::Isolate* isolate,
|
||||
ElectronBrowserContext* browser_context) {
|
||||
return gin::CreateHandle(isolate, new Cookies(isolate, browser_context));
|
||||
return gin::CreateHandle(isolate, new Cookies{browser_context});
|
||||
}
|
||||
|
||||
gin::ObjectTemplateBuilder Cookies::GetObjectTemplateBuilder(
|
||||
|
||||
@@ -50,7 +50,7 @@ class Cookies final : public gin::Wrappable<Cookies>,
|
||||
Cookies& operator=(const Cookies&) = delete;
|
||||
|
||||
protected:
|
||||
Cookies(v8::Isolate* isolate, ElectronBrowserContext* browser_context);
|
||||
explicit Cookies(ElectronBrowserContext* browser_context);
|
||||
~Cookies() override;
|
||||
|
||||
v8::Local<v8::Promise> Get(v8::Isolate*,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/to_vector.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@@ -98,7 +99,7 @@ std::string ReadClientId() {
|
||||
if (GetClientIdPath(&client_id_path) &&
|
||||
(!base::ReadFileToStringWithMaxSize(client_id_path, &client_id, 36) ||
|
||||
client_id.size() != 36))
|
||||
return std::string();
|
||||
return {};
|
||||
return client_id;
|
||||
}
|
||||
|
||||
@@ -220,18 +221,17 @@ v8::Local<v8::Value> GetUploadedReports(v8::Isolate* isolate) {
|
||||
list->LoadSync();
|
||||
}
|
||||
|
||||
auto to_obj = [isolate](const UploadList::UploadInfo* upload) {
|
||||
return gin::DataObjectBuilder{isolate}
|
||||
.Set("date", upload->upload_time)
|
||||
.Set("id", upload->upload_id)
|
||||
.Build();
|
||||
};
|
||||
|
||||
constexpr size_t kMaxUploadReportsToList = std::numeric_limits<size_t>::max();
|
||||
const std::vector<const UploadList::UploadInfo*> uploads =
|
||||
list->GetUploads(kMaxUploadReportsToList);
|
||||
std::vector<v8::Local<v8::Object>> result;
|
||||
for (auto* const upload : uploads) {
|
||||
result.push_back(gin::DataObjectBuilder(isolate)
|
||||
.Set("date", upload->upload_time)
|
||||
.Set("id", upload->upload_id)
|
||||
.Build());
|
||||
}
|
||||
v8::Local<v8::Value> v8_result = gin::ConvertToV8(isolate, result);
|
||||
return v8_result;
|
||||
return gin::ConvertToV8(
|
||||
isolate,
|
||||
base::ToVector(list->GetUploads(kMaxUploadReportsToList), to_obj));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ gin::Handle<DataPipeHolder> DataPipeHolder::From(v8::Isolate* isolate,
|
||||
if (gin::ConvertFromV8(isolate, object.ToLocalChecked(), &handle))
|
||||
return handle;
|
||||
}
|
||||
return gin::Handle<DataPipeHolder>();
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace electron::api
|
||||
|
||||
@@ -209,7 +209,7 @@ const GURL& DownloadItem::GetURL() const {
|
||||
|
||||
v8::Local<v8::Value> DownloadItem::GetURLChain() const {
|
||||
if (!CheckAlive())
|
||||
return v8::Local<v8::Value>();
|
||||
return {};
|
||||
return gin::ConvertToV8(isolate_, download_item_->GetUrlChain());
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ Menu::~Menu() {
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
bool InvokeBoolMethod(const Menu* menu,
|
||||
const char* method,
|
||||
int command_id,
|
||||
@@ -84,6 +86,8 @@ bool InvokeBoolMethod(const Menu* menu,
|
||||
return gin::ConvertFromV8(isolate, val, &ret) ? ret : default_value;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool Menu::IsCommandIdChecked(int command_id) const {
|
||||
return InvokeBoolMethod(this, "_isCommandIdChecked", command_id);
|
||||
}
|
||||
|
||||
@@ -63,8 +63,7 @@ scoped_refptr<base::SequencedTaskRunner> CreateFileTaskRunner() {
|
||||
}
|
||||
|
||||
base::File OpenFileForWriting(base::FilePath path) {
|
||||
return base::File(path,
|
||||
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
|
||||
return {path, base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE};
|
||||
}
|
||||
|
||||
void ResolvePromiseWithNetError(gin_helper::Promise<void> promise,
|
||||
@@ -93,7 +92,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
|
||||
gin::Arguments* args) {
|
||||
if (log_path.empty()) {
|
||||
args->ThrowTypeError("The first parameter must be a valid string");
|
||||
return v8::Local<v8::Promise>();
|
||||
return {};
|
||||
}
|
||||
|
||||
net::NetLogCaptureMode capture_mode = net::NetLogCaptureMode::kDefault;
|
||||
@@ -106,7 +105,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
|
||||
if (!gin::ConvertFromV8(args->isolate(), capture_mode_v8,
|
||||
&capture_mode)) {
|
||||
args->ThrowTypeError("Invalid value for captureMode");
|
||||
return v8::Local<v8::Promise>();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
v8::Local<v8::Value> max_file_size_v8;
|
||||
@@ -114,14 +113,14 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
|
||||
if (!gin::ConvertFromV8(args->isolate(), max_file_size_v8,
|
||||
&max_file_size)) {
|
||||
args->ThrowTypeError("Invalid value for maxFileSize");
|
||||
return v8::Local<v8::Promise>();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (net_log_exporter_) {
|
||||
args->ThrowTypeError("There is already a net log running");
|
||||
return v8::Local<v8::Promise>();
|
||||
return {};
|
||||
}
|
||||
|
||||
pending_start_promise_ =
|
||||
|
||||
@@ -81,7 +81,7 @@ gin::Handle<Notification> Notification::New(gin_helper::ErrorThrower thrower,
|
||||
gin::Arguments* args) {
|
||||
if (!Browser::Get()->is_ready()) {
|
||||
thrower.ThrowError("Cannot create Notification before app is ready");
|
||||
return gin::Handle<Notification>();
|
||||
return {};
|
||||
}
|
||||
return gin::CreateHandle(thrower.isolate(), new Notification(args));
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ gin::Handle<Protocol> Protocol::Create(
|
||||
// static
|
||||
gin::Handle<Protocol> Protocol::New(gin_helper::ErrorThrower thrower) {
|
||||
thrower.ThrowError("Protocol cannot be created from JS");
|
||||
return gin::Handle<Protocol>();
|
||||
return {};
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -53,13 +53,13 @@ v8::Local<v8::Value> EncryptString(v8::Isolate* isolate,
|
||||
if (!electron::Browser::Get()->is_ready()) {
|
||||
gin_helper::ErrorThrower(isolate).ThrowError(
|
||||
"safeStorage cannot be used before app is ready");
|
||||
return v8::Local<v8::Value>();
|
||||
return {};
|
||||
}
|
||||
gin_helper::ErrorThrower(isolate).ThrowError(
|
||||
"Error while encrypting the text provided to "
|
||||
"safeStorage.encryptString. "
|
||||
"Encryption is not available.");
|
||||
return v8::Local<v8::Value>();
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string ciphertext;
|
||||
@@ -69,7 +69,7 @@ v8::Local<v8::Value> EncryptString(v8::Isolate* isolate,
|
||||
gin_helper::ErrorThrower(isolate).ThrowError(
|
||||
"Error while encrypting the text provided to "
|
||||
"safeStorage.encryptString.");
|
||||
return v8::Local<v8::Value>();
|
||||
return {};
|
||||
}
|
||||
|
||||
return node::Buffer::Copy(isolate, ciphertext.c_str(), ciphertext.size())
|
||||
|
||||
@@ -82,7 +82,7 @@ gfx::Point Screen::GetCursorScreenPoint(v8::Isolate* isolate) {
|
||||
thrower.ThrowError(
|
||||
"screen.getCursorScreenPoint() cannot be called before a window has "
|
||||
"been created.");
|
||||
return gfx::Point();
|
||||
return {};
|
||||
}
|
||||
#endif
|
||||
return screen_->GetCursorScreenPoint();
|
||||
|
||||
@@ -132,7 +132,7 @@ v8::Local<v8::Value> ServiceWorkerContext::GetWorkerInfoFromID(
|
||||
auto iter = info_map.find(version_id);
|
||||
if (iter == info_map.end()) {
|
||||
thrower.ThrowError("Could not find service worker with that version_id");
|
||||
return v8::Local<v8::Value>();
|
||||
return {};
|
||||
}
|
||||
return ServiceWorkerRunningInfoToDict(thrower.isolate(),
|
||||
std::move(iter->second));
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "net/http/http_util.h"
|
||||
#include "services/network/network_service.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/request_destination.h"
|
||||
#include "services/network/public/mojom/clear_data_filter.mojom.h"
|
||||
#include "shell/browser/api/electron_api_app.h"
|
||||
#include "shell/browser/api/electron_api_cookies.h"
|
||||
@@ -79,6 +80,7 @@
|
||||
#include "shell/common/gin_converters/gurl_converter.h"
|
||||
#include "shell/common/gin_converters/media_converter.h"
|
||||
#include "shell/common/gin_converters/net_converter.h"
|
||||
#include "shell/common/gin_converters/time_converter.h"
|
||||
#include "shell/common/gin_converters/usb_protected_classes_converter.h"
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
@@ -1074,6 +1076,178 @@ std::vector<base::FilePath> Session::GetPreloads() const {
|
||||
return prefs->preloads();
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes the network service's ClearSharedDictionaryCacheForIsolationKey
|
||||
* method, allowing clearing the Shared Dictionary cache for a given isolation
|
||||
* key. Details about the feature available at
|
||||
* https://developer.chrome.com/blog/shared-dictionary-compression
|
||||
*/
|
||||
v8::Local<v8::Promise> Session::ClearSharedDictionaryCacheForIsolationKey(
|
||||
const gin_helper::Dictionary& options) {
|
||||
gin_helper::Promise<void> promise(isolate_);
|
||||
auto handle = promise.GetHandle();
|
||||
|
||||
GURL frame_origin_url, top_frame_site_url;
|
||||
if (!options.Get("frameOrigin", &frame_origin_url) ||
|
||||
!options.Get("topFrameSite", &top_frame_site_url)) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Must provide frameOrigin and topFrameSite strings to "
|
||||
"`clearSharedDictionaryCacheForIsolationKey`");
|
||||
return handle;
|
||||
}
|
||||
|
||||
if (!frame_origin_url.is_valid() || !top_frame_site_url.is_valid()) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Invalid URLs provided for frameOrigin or topFrameSite");
|
||||
return handle;
|
||||
}
|
||||
|
||||
url::Origin frame_origin = url::Origin::Create(frame_origin_url);
|
||||
net::SchemefulSite top_frame_site(top_frame_site_url);
|
||||
net::SharedDictionaryIsolationKey isolation_key(frame_origin, top_frame_site);
|
||||
|
||||
browser_context_->GetDefaultStoragePartition()
|
||||
->GetNetworkContext()
|
||||
->ClearSharedDictionaryCacheForIsolationKey(
|
||||
isolation_key,
|
||||
base::BindOnce(gin_helper::Promise<void>::ResolvePromise,
|
||||
std::move(promise)));
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes the network service's ClearSharedDictionaryCache
|
||||
* method, allowing clearing the Shared Dictionary cache.
|
||||
* https://developer.chrome.com/blog/shared-dictionary-compression
|
||||
*/
|
||||
v8::Local<v8::Promise> Session::ClearSharedDictionaryCache() {
|
||||
gin_helper::Promise<void> promise(isolate_);
|
||||
auto handle = promise.GetHandle();
|
||||
|
||||
browser_context_->GetDefaultStoragePartition()
|
||||
->GetNetworkContext()
|
||||
->ClearSharedDictionaryCache(
|
||||
base::Time(), base::Time::Max(),
|
||||
nullptr /*mojom::ClearDataFilterPtr*/,
|
||||
base::BindOnce(gin_helper::Promise<void>::ResolvePromise,
|
||||
std::move(promise)));
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes the network service's GetSharedDictionaryInfo method, allowing
|
||||
* inspection of Shared Dictionary information. Details about the feature
|
||||
* available at https://developer.chrome.com/blog/shared-dictionary-compression
|
||||
*/
|
||||
v8::Local<v8::Promise> Session::GetSharedDictionaryInfo(
|
||||
const gin_helper::Dictionary& options) {
|
||||
gin_helper::Promise<std::vector<gin_helper::Dictionary>> promise(isolate_);
|
||||
auto handle = promise.GetHandle();
|
||||
|
||||
GURL frame_origin_url, top_frame_site_url;
|
||||
if (!options.Get("frameOrigin", &frame_origin_url) ||
|
||||
!options.Get("topFrameSite", &top_frame_site_url)) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Must provide frameOrigin and topFrameSite strings");
|
||||
return handle;
|
||||
}
|
||||
|
||||
if (!frame_origin_url.is_valid() || !top_frame_site_url.is_valid()) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Invalid URLs provided for frameOrigin or topFrameSite");
|
||||
return handle;
|
||||
}
|
||||
|
||||
url::Origin frame_origin = url::Origin::Create(frame_origin_url);
|
||||
net::SchemefulSite top_frame_site(top_frame_site_url);
|
||||
net::SharedDictionaryIsolationKey isolation_key(frame_origin, top_frame_site);
|
||||
|
||||
browser_context_->GetDefaultStoragePartition()
|
||||
->GetNetworkContext()
|
||||
->GetSharedDictionaryInfo(
|
||||
isolation_key,
|
||||
base::BindOnce(
|
||||
[](gin_helper::Promise<std::vector<gin_helper::Dictionary>>
|
||||
promise,
|
||||
std::vector<network::mojom::SharedDictionaryInfoPtr> info) {
|
||||
v8::Isolate* isolate = promise.isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
|
||||
std::vector<gin_helper::Dictionary> result;
|
||||
result.reserve(info.size());
|
||||
|
||||
for (const auto& item : info) {
|
||||
gin_helper::Dictionary dict =
|
||||
gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
dict.Set("match", item->match);
|
||||
|
||||
// Convert RequestDestination enum values to strings
|
||||
std::vector<std::string> destinations;
|
||||
for (const auto& dest : item->match_dest) {
|
||||
destinations.push_back(
|
||||
network::RequestDestinationToString(dest));
|
||||
}
|
||||
dict.Set("matchDestinations", destinations);
|
||||
dict.Set("id", item->id);
|
||||
dict.Set("dictionaryUrl", item->dictionary_url.spec());
|
||||
dict.Set("lastFetchTime", item->last_fetch_time);
|
||||
dict.Set("responseTime", item->response_time);
|
||||
dict.Set("expirationDuration",
|
||||
item->expiration.InMillisecondsF());
|
||||
dict.Set("lastUsedTime", item->last_used_time);
|
||||
dict.Set("size", item->size);
|
||||
dict.Set("hash", net::HashValue(item->hash).ToString());
|
||||
|
||||
result.push_back(dict);
|
||||
}
|
||||
|
||||
promise.Resolve(result);
|
||||
},
|
||||
std::move(promise)));
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes the network service's GetSharedDictionaryUsageInfo method, allowing
|
||||
* inspection of Shared Dictionary information. Details about the feature
|
||||
* available at https://developer.chrome.com/blog/shared-dictionary-compression
|
||||
*/
|
||||
v8::Local<v8::Promise> Session::GetSharedDictionaryUsageInfo() {
|
||||
gin_helper::Promise<std::vector<gin_helper::Dictionary>> promise(isolate_);
|
||||
auto handle = promise.GetHandle();
|
||||
|
||||
browser_context_->GetDefaultStoragePartition()
|
||||
->GetNetworkContext()
|
||||
->GetSharedDictionaryUsageInfo(base::BindOnce(
|
||||
[](gin_helper::Promise<std::vector<gin_helper::Dictionary>> promise,
|
||||
const std::vector<net::SharedDictionaryUsageInfo>& info) {
|
||||
v8::Isolate* isolate = promise.isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
|
||||
std::vector<gin_helper::Dictionary> result;
|
||||
result.reserve(info.size());
|
||||
|
||||
for (const auto& item : info) {
|
||||
gin_helper::Dictionary dict =
|
||||
gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
dict.Set("frameOrigin",
|
||||
item.isolation_key.frame_origin().Serialize());
|
||||
dict.Set("topFrameSite",
|
||||
item.isolation_key.top_frame_site().Serialize());
|
||||
dict.Set("totalSizeBytes", item.total_size_bytes);
|
||||
result.push_back(dict);
|
||||
}
|
||||
|
||||
promise.Resolve(result);
|
||||
},
|
||||
std::move(promise)));
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
v8::Local<v8::Promise> Session::LoadExtension(
|
||||
const base::FilePath& extension_path,
|
||||
@@ -1583,7 +1757,7 @@ std::optional<gin::Handle<Session>> Session::FromPath(
|
||||
gin::Handle<Session> Session::New() {
|
||||
gin_helper::ErrorThrower(JavascriptEnvironment::GetIsolate())
|
||||
.ThrowError("Session objects cannot be created with 'new'");
|
||||
return gin::Handle<Session>();
|
||||
return {};
|
||||
}
|
||||
|
||||
void Session::FillObjectTemplate(v8::Isolate* isolate,
|
||||
@@ -1627,6 +1801,13 @@ void Session::FillObjectTemplate(v8::Isolate* isolate,
|
||||
&Session::CreateInterruptedDownload)
|
||||
.SetMethod("setPreloads", &Session::SetPreloads)
|
||||
.SetMethod("getPreloads", &Session::GetPreloads)
|
||||
.SetMethod("getSharedDictionaryUsageInfo",
|
||||
&Session::GetSharedDictionaryUsageInfo)
|
||||
.SetMethod("getSharedDictionaryInfo", &Session::GetSharedDictionaryInfo)
|
||||
.SetMethod("clearSharedDictionaryCache",
|
||||
&Session::ClearSharedDictionaryCache)
|
||||
.SetMethod("clearSharedDictionaryCacheForIsolationKey",
|
||||
&Session::ClearSharedDictionaryCacheForIsolationKey)
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
.SetMethod("loadExtension", &Session::LoadExtension)
|
||||
.SetMethod("removeExtension", &Session::RemoveExtension)
|
||||
|
||||
@@ -140,6 +140,12 @@ class Session final : public gin::Wrappable<Session>,
|
||||
void CreateInterruptedDownload(const gin_helper::Dictionary& options);
|
||||
void SetPreloads(const std::vector<base::FilePath>& preloads);
|
||||
std::vector<base::FilePath> GetPreloads() const;
|
||||
v8::Local<v8::Promise> GetSharedDictionaryInfo(
|
||||
const gin_helper::Dictionary& options);
|
||||
v8::Local<v8::Promise> GetSharedDictionaryUsageInfo();
|
||||
v8::Local<v8::Promise> ClearSharedDictionaryCache();
|
||||
v8::Local<v8::Promise> ClearSharedDictionaryCacheForIsolationKey(
|
||||
const gin_helper::Dictionary& options);
|
||||
v8::Local<v8::Value> Cookies(v8::Isolate* isolate);
|
||||
v8::Local<v8::Value> Protocol(v8::Isolate* isolate);
|
||||
v8::Local<v8::Value> ServiceWorkerContext(v8::Isolate* isolate);
|
||||
|
||||
@@ -154,7 +154,7 @@ std::string SystemPreferences::GetMediaAccessStatus(
|
||||
DeviceAccessStatus::DeviceAccessStatus_Allowed);
|
||||
} else {
|
||||
thrower.ThrowError("Invalid media type");
|
||||
return std::string();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ gin::Handle<Tray> Tray::New(gin_helper::ErrorThrower thrower,
|
||||
gin::Arguments* args) {
|
||||
if (!Browser::Get()->is_ready()) {
|
||||
thrower.ThrowError("Cannot create Tray before app is ready");
|
||||
return gin::Handle<Tray>();
|
||||
return {};
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (!guid.has_value() && args->Length() > 1) {
|
||||
thrower.ThrowError("Invalid GUID format");
|
||||
return gin::Handle<Tray>();
|
||||
return {};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,7 +85,7 @@ gin::Handle<Tray> Tray::New(gin_helper::ErrorThrower thrower,
|
||||
if (try_catch.HasCaught()) {
|
||||
delete tray;
|
||||
try_catch.ReThrow();
|
||||
return gin::Handle<Tray>();
|
||||
return {};
|
||||
}
|
||||
|
||||
auto handle = gin::CreateHandle(args->isolate(), tray);
|
||||
@@ -264,7 +264,7 @@ void Tray::SetTitle(const std::string& title,
|
||||
|
||||
std::string Tray::GetTitle() {
|
||||
if (!CheckAlive())
|
||||
return std::string();
|
||||
return {};
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
return tray_icon_->GetTitle();
|
||||
#else
|
||||
@@ -388,7 +388,7 @@ void Tray::SetContextMenu(gin_helper::ErrorThrower thrower,
|
||||
|
||||
gfx::Rect Tray::GetBounds() {
|
||||
if (!CheckAlive())
|
||||
return gfx::Rect();
|
||||
return {};
|
||||
return tray_icon_->GetBounds();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
base::IDMap<api::UtilityProcessWrapper*, base::ProcessId>&
|
||||
GetAllUtilityProcessWrappers() {
|
||||
static base::NoDestructor<
|
||||
@@ -52,6 +54,8 @@ GetAllUtilityProcessWrappers() {
|
||||
return *s_all_utility_process_wrappers;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace api {
|
||||
|
||||
gin::WrapperInfo UtilityProcessWrapper::kWrapperInfo = {
|
||||
@@ -411,7 +415,7 @@ gin::Handle<UtilityProcessWrapper> UtilityProcessWrapper::Create(
|
||||
gin_helper::Dictionary dict;
|
||||
if (!args->GetNext(&dict)) {
|
||||
args->ThrowTypeError("Options must be an object.");
|
||||
return gin::Handle<UtilityProcessWrapper>();
|
||||
return {};
|
||||
}
|
||||
|
||||
std::u16string display_name;
|
||||
@@ -425,19 +429,19 @@ gin::Handle<UtilityProcessWrapper> UtilityProcessWrapper::Create(
|
||||
dict.Get("modulePath", ¶ms->script);
|
||||
if (dict.Has("args") && !dict.Get("args", ¶ms->args)) {
|
||||
args->ThrowTypeError("Invalid value for args");
|
||||
return gin::Handle<UtilityProcessWrapper>();
|
||||
return {};
|
||||
}
|
||||
|
||||
gin_helper::Dictionary opts;
|
||||
if (dict.Get("options", &opts)) {
|
||||
if (opts.Has("env") && !opts.Get("env", &env_map)) {
|
||||
args->ThrowTypeError("Invalid value for env");
|
||||
return gin::Handle<UtilityProcessWrapper>();
|
||||
return {};
|
||||
}
|
||||
|
||||
if (opts.Has("execArgv") && !opts.Get("execArgv", ¶ms->exec_args)) {
|
||||
args->ThrowTypeError("Invalid value for execArgv");
|
||||
return gin::Handle<UtilityProcessWrapper>();
|
||||
return {};
|
||||
}
|
||||
|
||||
opts.Get("serviceName", &display_name);
|
||||
|
||||
@@ -282,7 +282,7 @@ void View::SetBounds(const gfx::Rect& bounds) {
|
||||
|
||||
gfx::Rect View::GetBounds() {
|
||||
if (!view_)
|
||||
return gfx::Rect();
|
||||
return {};
|
||||
return view_->bounds();
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ gin::Handle<View> View::Create(v8::Isolate* isolate) {
|
||||
if (gin::ConvertFromV8(isolate, obj, &view))
|
||||
return view;
|
||||
}
|
||||
return gin::Handle<View>();
|
||||
return {};
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user