mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
25 Commits
v42.0.0-ni
...
fix-releas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f84142550 | ||
|
|
253c920bdc | ||
|
|
30ebfca1d8 | ||
|
|
b431ec4b97 | ||
|
|
7d4f91a135 | ||
|
|
6825a522e9 | ||
|
|
e033c10075 | ||
|
|
64872a6cb8 | ||
|
|
d74fcfcecb | ||
|
|
92a3f7d6c1 | ||
|
|
0e161c18eb | ||
|
|
3d76d3a469 | ||
|
|
82d350524e | ||
|
|
e6be04a7a0 | ||
|
|
a7de47084b | ||
|
|
3820d3ae6c | ||
|
|
8364b62f68 | ||
|
|
441729c3a0 | ||
|
|
c521c2b868 | ||
|
|
b2c5093542 | ||
|
|
ec5eb64788 | ||
|
|
0cc15a6386 | ||
|
|
4aa89b9c3c | ||
|
|
ae43f17b79 | ||
|
|
b847299f19 |
9
.github/actions/build-electron/action.yml
vendored
9
.github/actions/build-electron/action.yml
vendored
@@ -26,6 +26,9 @@ inputs:
|
||||
is-asan:
|
||||
description: 'The ASan Linux build'
|
||||
required: false
|
||||
upload-out-gen-artifacts:
|
||||
description: 'Whether to upload the out/${dir}/gen artifacts'
|
||||
required: false
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
@@ -274,3 +277,9 @@ runs:
|
||||
with:
|
||||
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./src_artifacts_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
|
||||
- name: Upload Out Gen Artifacts ${{ inputs.step-suffix }}
|
||||
if: ${{ inputs.upload-out-gen-artifacts == 'true' }}
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
||||
with:
|
||||
name: out_gen_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./src/out/Default/gen
|
||||
|
||||
72
.github/workflows/apply-patches.yml
vendored
Normal file
72
.github/workflows/apply-patches.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Apply Patches
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: apply-patches-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
outputs:
|
||||
has-patches: ${{ steps.filter.outputs.patches }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
# Use dorny/paths-filter instead of the path filter under the on: pull_request: block
|
||||
# so that the output can be used to conditionally run the apply-patches job, which lets
|
||||
# the job be marked as a required status check (conditional skip counts as a success).
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
patches:
|
||||
- DEPS
|
||||
- 'patches/**'
|
||||
|
||||
apply-patches:
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.has-patches == 'true' }}
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Rebase onto Base Branch
|
||||
working-directory: src/electron
|
||||
env:
|
||||
BASE_REF: ${{ github.event.pull_request.base.ref }}
|
||||
run: |
|
||||
git config user.email "electron@github.com"
|
||||
git config user.name "Electron Bot"
|
||||
git fetch origin ${BASE_REF}
|
||||
git rebase origin/${BASE_REF}
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
target-platform: linux
|
||||
2
.github/workflows/archaeologist-dig.yml
vendored
2
.github/workflows/archaeologist-dig.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js/npm
|
||||
|
||||
3
.github/workflows/audit-branch-ci.yml
vendored
3
.github/workflows/audit-branch-ci.yml
vendored
@@ -11,6 +11,7 @@ permissions: {}
|
||||
jobs:
|
||||
audit_branch_ci:
|
||||
name: Audit CI on Branches
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -20,7 +21,7 @@ jobs:
|
||||
with:
|
||||
node-version: 22.17.x
|
||||
- name: Sparse checkout repository
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.
|
||||
|
||||
2
.github/workflows/branch-created.yml
vendored
2
.github/workflows/branch-created.yml
vendored
@@ -14,7 +14,7 @@ permissions: {}
|
||||
jobs:
|
||||
release-branch-created:
|
||||
name: Release Branch Created
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller')) }}
|
||||
if: ${{ github.repository == 'electron/electron' && (github.event_name == 'workflow_dispatch' || (github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller'))) }}
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
9
.github/workflows/build-git-cache.yml
vendored
9
.github/workflows/build-git-cache.yml
vendored
@@ -10,6 +10,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
build-git-cache-linux:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -23,7 +24,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -33,6 +34,7 @@ jobs:
|
||||
target-platform: linux
|
||||
|
||||
build-git-cache-windows:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -47,7 +49,7 @@ jobs:
|
||||
TARGET_OS: 'win'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -57,6 +59,7 @@ jobs:
|
||||
target-platform: win
|
||||
|
||||
build-git-cache-macos:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -72,7 +75,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@@ -47,6 +47,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -57,7 +58,7 @@ jobs:
|
||||
build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
|
||||
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
@@ -124,7 +125,7 @@ jobs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -156,7 +157,7 @@ jobs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -188,7 +189,7 @@ jobs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -283,13 +284,15 @@ jobs:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test-and-nan.yml
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-tidy-and-test-and-nan.yml
|
||||
needs: checkout-linux
|
||||
if: ${{ needs.setup.outputs.src == 'true' }}
|
||||
with:
|
||||
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
clang-tidy-runs-on: electron-arc-centralus-linux-amd64-8core
|
||||
test-runs-on: electron-arc-centralus-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"]}'
|
||||
clang-tidy-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"}'
|
||||
target-platform: linux
|
||||
target-arch: x64
|
||||
@@ -426,7 +429,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
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')
|
||||
if: always() && github.repository == 'electron/electron' && !contains(needs.*.result, 'failure')
|
||||
steps:
|
||||
- name: GitHub Actions Jobs Done
|
||||
run: |
|
||||
|
||||
1
.github/workflows/clean-src-cache.yml
vendored
1
.github/workflows/clean-src-cache.yml
vendored
@@ -12,6 +12,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
clean-src-cache:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
2
.github/workflows/issue-opened.yml
vendored
2
.github/workflows/issue-opened.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Sparse checkout repository
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.
|
||||
|
||||
3
.github/workflows/linux-publish.yml
vendored
3
.github/workflows/linux-publish.yml
vendored
@@ -21,6 +21,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
checkout-linux:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -35,7 +36,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
3
.github/workflows/macos-disk-cleanup.yml
vendored
3
.github/workflows/macos-disk-cleanup.yml
vendored
@@ -13,6 +13,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
macos-disk-cleanup:
|
||||
if: github.repository == 'electron/electron'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -25,7 +26,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github/actions/free-space-macos
|
||||
|
||||
3
.github/workflows/macos-publish.yml
vendored
3
.github/workflows/macos-publish.yml
vendored
@@ -22,6 +22,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
checkout-macos:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -36,7 +37,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
124
.github/workflows/pipeline-electron-build-and-tidy-and-test-and-nan.yml
vendored
Normal file
124
.github/workflows/pipeline-electron-build-and-tidy-and-test-and-nan.yml
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
name: Electron Build & Clang Tidy & Test (+ Node + NaN) Pipeline
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos, win or linux.'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||
required: true
|
||||
build-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the build'
|
||||
required: true
|
||||
clang-tidy-runs-on:
|
||||
type: string
|
||||
description: 'What host to run clang-tidy on'
|
||||
required: true
|
||||
test-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the tests on'
|
||||
required: true
|
||||
build-container:
|
||||
type: string
|
||||
description: 'JSON container information for aks runs-on'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
clang-tidy-container:
|
||||
type: string
|
||||
description: 'JSON container information to run clang-tidy on'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
test-container:
|
||||
type: string
|
||||
description: 'JSON container information for testing'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
is-release:
|
||||
description: 'Whether this build job is a release job'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
gn-build-type:
|
||||
description: 'The gn build type - testing or release'
|
||||
required: true
|
||||
type: string
|
||||
default: testing
|
||||
generate-symbols:
|
||||
description: 'Whether or not to generate symbols'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
upload-to-storage:
|
||||
description: 'Whether or not to upload build artifacts to external storage'
|
||||
required: true
|
||||
type: string
|
||||
default: '0'
|
||||
is-asan:
|
||||
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||
permissions:
|
||||
contents: read
|
||||
with:
|
||||
build-runs-on: ${{ inputs.build-runs-on }}
|
||||
build-container: ${{ inputs.build-container }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
is-release: ${{ inputs.is-release }}
|
||||
gn-build-type: ${{ inputs.gn-build-type }}
|
||||
generate-symbols: ${{ inputs.generate-symbols }}
|
||||
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||
upload-out-gen-artifacts: true
|
||||
secrets: inherit
|
||||
clang-tidy:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-clang-tidy.yml
|
||||
permissions:
|
||||
contents: read
|
||||
needs: build
|
||||
with:
|
||||
clang-tidy-runs-on: ${{ inputs.clang-tidy-runs-on }}
|
||||
clang-tidy-container: ${{ inputs.clang-tidy-container }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
secrets: inherit
|
||||
test:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
needs: build
|
||||
with:
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
test-runs-on: ${{ inputs.test-runs-on }}
|
||||
test-container: ${{ inputs.test-container }}
|
||||
secrets: inherit
|
||||
nn-test:
|
||||
uses: ./.github/workflows/pipeline-segment-node-nan-test.yml
|
||||
permissions:
|
||||
contents: read
|
||||
needs: build
|
||||
with:
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
test-runs-on: ${{ inputs.test-runs-on }}
|
||||
test-container: ${{ inputs.test-container }}
|
||||
gn-build-type: ${{ inputs.gn-build-type }}
|
||||
secrets: inherit
|
||||
121
.github/workflows/pipeline-electron-build-and-tidy-and-test.yml
vendored
Normal file
121
.github/workflows/pipeline-electron-build-and-tidy-and-test.yml
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
name: Electron Build & Clang Tidy & Test Pipeline
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||
required: true
|
||||
build-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the build'
|
||||
required: true
|
||||
clang-tidy-runs-on:
|
||||
type: string
|
||||
description: 'What host to run clang-tidy on'
|
||||
required: true
|
||||
test-runs-on:
|
||||
type: string
|
||||
description: 'What host to run the tests on'
|
||||
required: true
|
||||
build-container:
|
||||
type: string
|
||||
description: 'JSON container information for aks runs-on'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
clang-tidy-container:
|
||||
type: string
|
||||
description: 'JSON container information to run clang-tidy on'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
test-container:
|
||||
type: string
|
||||
description: 'JSON container information for testing'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
is-release:
|
||||
description: 'Whether this build job is a release job'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
gn-build-type:
|
||||
description: 'The gn build type - testing or release'
|
||||
required: true
|
||||
type: string
|
||||
default: testing
|
||||
generate-symbols:
|
||||
description: 'Whether or not to generate symbols'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
upload-to-storage:
|
||||
description: 'Whether or not to upload build artifacts to external storage'
|
||||
required: true
|
||||
type: string
|
||||
default: '0'
|
||||
is-asan:
|
||||
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
enable-ssh:
|
||||
description: 'Enable SSH debugging'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: electron-build-and-tidy-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||
permissions:
|
||||
contents: read
|
||||
with:
|
||||
build-runs-on: ${{ inputs.build-runs-on }}
|
||||
build-container: ${{ inputs.build-container }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
is-release: ${{ inputs.is-release }}
|
||||
gn-build-type: ${{ inputs.gn-build-type }}
|
||||
generate-symbols: ${{ inputs.generate-symbols }}
|
||||
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||
is-asan: ${{ inputs.is-asan }}
|
||||
enable-ssh: ${{ inputs.enable-ssh }}
|
||||
upload-out-gen-artifacts: true
|
||||
secrets: inherit
|
||||
clang-tidy:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-clang-tidy.yml
|
||||
permissions:
|
||||
contents: read
|
||||
needs: build
|
||||
with:
|
||||
clang-tidy-runs-on: ${{ inputs.clang-tidy-runs-on }}
|
||||
clang-tidy-container: ${{ inputs.clang-tidy-container }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
secrets: inherit
|
||||
test:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
needs: build
|
||||
with:
|
||||
target-arch: ${{ inputs.target-arch }}
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
test-runs-on: ${{ inputs.test-runs-on }}
|
||||
test-container: ${{ inputs.test-container }}
|
||||
is-asan: ${{ inputs.is-asan }}
|
||||
enable-ssh: ${{ inputs.enable-ssh }}
|
||||
secrets: inherit
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
with:
|
||||
target-platform: linux
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
2
.github/workflows/pipeline-electron-lint.yml
vendored
2
.github/workflows/pipeline-electron-lint.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -53,6 +53,11 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
upload-out-gen-artifacts:
|
||||
description: 'Whether to upload the src/gen artifacts'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
enable-ssh:
|
||||
description: 'Enable SSH debugging'
|
||||
required: false
|
||||
@@ -95,7 +100,7 @@ jobs:
|
||||
run: |
|
||||
mkdir src
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -163,7 +168,7 @@ jobs:
|
||||
if: ${{ inputs.target-platform == 'linux' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -201,6 +206,7 @@ jobs:
|
||||
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
||||
is-asan: '${{ inputs.is-asan }}'
|
||||
upload-out-gen-artifacts: '${{ inputs.upload-out-gen-artifacts }}'
|
||||
- name: Set GN_EXTRA_ARGS for MAS Build
|
||||
if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' || inputs.target-variant == 'mas') }}
|
||||
run: |
|
||||
|
||||
159
.github/workflows/pipeline-segment-electron-clang-tidy.yml
vendored
Normal file
159
.github/workflows/pipeline-segment-electron-clang-tidy.yml
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
name: Pipeline Segment - Electron Clang-Tidy
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target-platform:
|
||||
type: string
|
||||
description: 'Platform to run on, can be macos, win or linux'
|
||||
required: true
|
||||
target-arch:
|
||||
type: string
|
||||
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||
required: true
|
||||
clang-tidy-runs-on:
|
||||
type: string
|
||||
description: 'What host to run clang-tidy on'
|
||||
required: true
|
||||
clang-tidy-container:
|
||||
type: string
|
||||
description: 'JSON container information for aks runs-on'
|
||||
required: false
|
||||
default: '{"image":null}'
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: electron-clang-tidy-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
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
|
||||
|
||||
jobs:
|
||||
clang-tidy:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
runs-on: ${{ inputs.clang-tidy-runs-on }}
|
||||
permissions:
|
||||
contents: read
|
||||
container: ${{ fromJSON(inputs.clang-tidy-container) }}
|
||||
env:
|
||||
BUILD_TYPE: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
TARGET_PLATFORM: ${{ inputs.target-platform }}
|
||||
ARTIFACT_KEY: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}_${{ inputs.target-arch }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
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
|
||||
run: |
|
||||
sudo mkdir -p $TMPDIR/del-target
|
||||
|
||||
tmpify() {
|
||||
if [ -d "$1" ]; then
|
||||
sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
|
||||
fi
|
||||
}
|
||||
tmpify /Library/Developer/CoreSimulator
|
||||
tmpify ~/Library/Developer/CoreSimulator
|
||||
sudo rm -rf $TMPDIR/del-target
|
||||
- name: Check disk space after freeing up space
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: df -h
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Enable windows toolchain
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
run: |
|
||||
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||
- name: Generate DEPS Hash
|
||||
run: |
|
||||
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
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
- name: Restore src cache via AKS
|
||||
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
- name: Run Electron Only Hooks
|
||||
run: |
|
||||
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||
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
|
||||
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
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Default GN gen
|
||||
run: |
|
||||
cd src/electron
|
||||
git pack-refs
|
||||
- name: Download Out Gen Artifacts
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
|
||||
with:
|
||||
name: out_gen_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./src/out/${{ env.ELECTRON_OUT_DIR }}/gen
|
||||
- name: Add Clang problem matcher
|
||||
shell: bash
|
||||
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
|
||||
- name: Run Clang-Tidy
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=${ELECTRON_OUT_DIR} testing --target-cpu ${TARGET_ARCH}
|
||||
|
||||
export GN_EXTRA_ARGS="target_cpu=\"${TARGET_ARCH}\""
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||
fi
|
||||
|
||||
e build --only-gen
|
||||
|
||||
cd src/electron
|
||||
node script/yarn.js lint:clang-tidy --jobs 8 --out-dir ../out/${ELECTRON_OUT_DIR}
|
||||
- name: Remove Clang problem matcher
|
||||
shell: bash
|
||||
run: echo "::remove-matcher owner=clang::"
|
||||
- name: Wait for active SSH sessions
|
||||
if: always() && !cancelled()
|
||||
shell: bash
|
||||
run: |
|
||||
while [ -f /var/.ssh-lock ]
|
||||
do
|
||||
sleep 60
|
||||
done
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.check-container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -119,7 +119,7 @@ jobs:
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.test-container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.test-container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
31
.github/workflows/pull-request-labeled.yml
vendored
31
.github/workflows/pull-request-labeled.yml
vendored
@@ -44,3 +44,34 @@ jobs:
|
||||
project-number: 94
|
||||
field: Status
|
||||
field-value: ✅ Reviewed
|
||||
pull-request-labeled-ai-pr:
|
||||
name: ai-pr label added
|
||||
if: github.event.label.name == 'ai-pr'
|
||||
runs-on: ubuntu-latest
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@e2ff99831a4f13625d35064e2b3dfe65c07a0396 # v3.7.5
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
body: |
|
||||
<!-- ai-pr -->
|
||||
|
||||
*AI PR Detected*
|
||||
|
||||
Hello @${{ github.event.pull_request.user.login }}. Due to the high amount of AI spam PRs we receive, if a PR is detected to be majority AI-generated without disclosure and untested, we will automatically close the PR.
|
||||
|
||||
We welcome the use of AI tools, as long as the PR meets our quality standards and has clearly been built and tested. If you believe your PR was closed in error, we welcome you to resubmit. However, please read our [CONTRIBUTING.md](http://contributing.md/) carefully before reopening. Thanks for your contribution.
|
||||
- name: Close the pull request
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
GH_REPO: electron/electron
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
gh pr close "$PR_NUMBER"
|
||||
|
||||
71
.github/workflows/rerun-apply-patches.yml
vendored
Normal file
71
.github/workflows/rerun-apply-patches.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: Rerun PR Apply Patches
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- '[1-9][0-9]-x-y'
|
||||
paths:
|
||||
- 'DEPS'
|
||||
- 'patches/**'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
rerun-apply-patches:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
checks: read
|
||||
contents: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Find PRs and Rerun Apply Patches
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
BRANCH="${GITHUB_REF#refs/heads/}"
|
||||
|
||||
# Find all open PRs targeting this branch
|
||||
PRS=$(gh pr list --base "$BRANCH" --state open --limit 250 --json number)
|
||||
|
||||
echo "$PRS" | jq -c '.[]' | while read -r pr; do
|
||||
PR_NUMBER=$(echo "$pr" | jq -r '.number')
|
||||
echo "Processing PR #${PR_NUMBER}"
|
||||
|
||||
# Find the Apply Patches workflow check for this PR
|
||||
CHECK=$(gh pr checks "$PR_NUMBER" --json link,name,state,workflow --jq '[.[] | select(.workflow == "Apply Patches" and .name == "apply-patches")] | first')
|
||||
|
||||
if [ -z "$CHECK" ] || [ "$CHECK" = "null" ]; then
|
||||
echo " No Apply Patches workflow found for PR #${PR_NUMBER}"
|
||||
continue
|
||||
fi
|
||||
|
||||
STATE=$(echo "$CHECK" | jq -r '.state')
|
||||
if [ "$STATE" = "SKIPPED" ]; then
|
||||
echo " apply-patches job was skipped for PR #${PR_NUMBER} (no patches)"
|
||||
continue
|
||||
fi
|
||||
|
||||
LINK=$(echo "$CHECK" | jq -r '.link')
|
||||
|
||||
# Extract the run ID from the link (format: .../runs/RUN_ID/job/JOB_ID)
|
||||
RUN_ID=$(echo "$LINK" | grep -oE 'runs/[0-9]+' | cut -d'/' -f2)
|
||||
|
||||
if [ -z "$RUN_ID" ]; then
|
||||
echo " Could not extract run ID from link: ${LINK}"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Check if the workflow is currently in progress
|
||||
RUN_STATUS=$(gh run view "$RUN_ID" --json status --jq '.status')
|
||||
|
||||
if [ "$RUN_STATUS" = "in_progress" ] || [ "$RUN_STATUS" = "queued" ] || [ "$RUN_STATUS" = "waiting" ]; then
|
||||
echo " Workflow run ${RUN_ID} is ${RUN_STATUS}, cancelling..."
|
||||
gh run cancel "$RUN_ID" --force
|
||||
gh run watch "$RUN_ID"
|
||||
fi
|
||||
|
||||
gh run rerun "$RUN_ID"
|
||||
done
|
||||
5
.github/workflows/scorecards.yml
vendored
5
.github/workflows/scorecards.yml
vendored
@@ -13,6 +13,7 @@ permissions: read-all
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecards analysis
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
@@ -22,7 +23,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -50,6 +51,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5
|
||||
uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
1
.github/workflows/stable-prep-items.yml
vendored
1
.github/workflows/stable-prep-items.yml
vendored
@@ -10,6 +10,7 @@ permissions: {}
|
||||
jobs:
|
||||
check-stable-prep-items:
|
||||
name: Check Stable Prep Items
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-latest
|
||||
permissions: {}
|
||||
steps:
|
||||
|
||||
3
.github/workflows/stale.yml
vendored
3
.github/workflows/stale.yml
vendored
@@ -9,6 +9,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-latest
|
||||
permissions: {}
|
||||
steps:
|
||||
@@ -33,7 +34,7 @@ jobs:
|
||||
pending-repro:
|
||||
runs-on: ubuntu-latest
|
||||
permissions: {}
|
||||
if: ${{ always() }}
|
||||
if: ${{ always() && github.repository == 'electron/electron' }}
|
||||
needs: stale
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
|
||||
3
.github/workflows/windows-publish.yml
vendored
3
.github/workflows/windows-publish.yml
vendored
@@ -22,6 +22,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
checkout-windows:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -40,7 +41,7 @@ jobs:
|
||||
build-image-sha: ${{ inputs.build-image-sha }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
30
BUILD.gn
30
BUILD.gn
@@ -420,6 +420,34 @@ action("electron_generate_node_defines") {
|
||||
args = [ rebase_path(target_gen_dir) ] + rebase_path(inputs)
|
||||
}
|
||||
|
||||
# MSIX updater needs to be in a separate source_set because it uses C++/WinRT
|
||||
# headers that require exceptions to be enabled.
|
||||
source_set("electron_msix_updater") {
|
||||
sources = [
|
||||
"shell/browser/api/electron_api_msix_updater.cc",
|
||||
"shell/browser/api/electron_api_msix_updater.h",
|
||||
]
|
||||
|
||||
configs += [ "//third_party/electron_node:node_external_config" ]
|
||||
|
||||
public_configs = [ ":electron_lib_config" ]
|
||||
|
||||
if (is_win) {
|
||||
cflags_cc = [ "/EHsc" ] # Enable C++ exceptions for C++/WinRT
|
||||
|
||||
include_dirs = [ "//third_party/nearby/src/internal/platform/implementation/windows/generated" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//content/public/browser",
|
||||
"//gin",
|
||||
"//third_party/electron_node/deps/simdjson",
|
||||
"//third_party/electron_node/deps/uv",
|
||||
"//v8",
|
||||
]
|
||||
}
|
||||
|
||||
source_set("electron_lib") {
|
||||
configs += [
|
||||
"//v8:external_startup_data",
|
||||
@@ -435,6 +463,7 @@ source_set("electron_lib") {
|
||||
":electron_fuses",
|
||||
":electron_generate_node_defines",
|
||||
":electron_js2c",
|
||||
":electron_msix_updater",
|
||||
":electron_version_header",
|
||||
":resources",
|
||||
"buildflags",
|
||||
@@ -502,6 +531,7 @@ source_set("electron_lib") {
|
||||
"//third_party/blink/public/platform/media",
|
||||
"//third_party/boringssl",
|
||||
"//third_party/electron_node:libnode",
|
||||
"//third_party/highway:libhwy",
|
||||
"//third_party/inspector_protocol:crdtp",
|
||||
"//third_party/leveldatabase",
|
||||
"//third_party/libyuv",
|
||||
|
||||
2
DEPS
2
DEPS
@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'146.0.7645.0',
|
||||
'146.0.7650.0',
|
||||
'node_version':
|
||||
'v24.13.0',
|
||||
'nan_version':
|
||||
|
||||
@@ -32,9 +32,19 @@ update process. Apps that need to disable ATS can add the
|
||||
|
||||
### Windows
|
||||
|
||||
On Windows, you have to install your app into a user's machine before you can
|
||||
use the `autoUpdater`, so it is recommended that you use
|
||||
[electron-winstaller][installer-lib] or [Electron Forge's Squirrel.Windows maker][electron-forge-lib] to generate a Windows installer.
|
||||
On Windows, the `autoUpdater` module automatically selects the appropriate update mechanism
|
||||
based on how your app is packaged:
|
||||
|
||||
* **MSIX packages**: If your app is running as an MSIX package (created with [electron-windows-msix][msix-lib] and detected via [`process.windowsStore`](process.md#processwindowsstore-readonly)),
|
||||
the module uses the MSIX updater, which supports direct MSIX file links and JSON update feeds.
|
||||
* **Squirrel.Windows**: For apps installed via traditional installers (created with
|
||||
[electron-winstaller][installer-lib] or [Electron Forge's Squirrel.Windows maker][electron-forge-lib]),
|
||||
the module uses Squirrel.Windows for updates.
|
||||
|
||||
You don't need to configure which updater to use; Electron automatically detects the packaging
|
||||
format and uses the appropriate one.
|
||||
|
||||
#### Squirrel.Windows
|
||||
|
||||
Apps built with Squirrel.Windows will trigger [custom launch events](https://github.com/Squirrel/Squirrel.Windows/blob/51f5e2cb01add79280a53d51e8d0cfa20f8c9f9f/docs/using/custom-squirrel-events-non-cs.md#application-startup-commands)
|
||||
that must be handled by your Electron application to ensure proper setup and teardown.
|
||||
@@ -55,6 +65,14 @@ The installer generated with Squirrel.Windows will create a shortcut icon with a
|
||||
same ID for your app with `app.setAppUserModelId` API, otherwise Windows will
|
||||
not be able to pin your app properly in task bar.
|
||||
|
||||
#### MSIX Packages
|
||||
|
||||
When your app is packaged as an MSIX, the `autoUpdater` module provides additional
|
||||
functionality:
|
||||
|
||||
* Use the `allowAnyVersion` option in `setFeedURL()` to allow updates to older versions (downgrades)
|
||||
* Support for direct MSIX file links or JSON update feeds (similar to Squirrel.Mac format)
|
||||
|
||||
## Events
|
||||
|
||||
The `autoUpdater` object emits the following events:
|
||||
@@ -92,7 +110,7 @@ Returns:
|
||||
|
||||
Emitted when an update has been downloaded.
|
||||
|
||||
On Windows only `releaseName` is available.
|
||||
With Squirrel.Windows only `releaseName` is available.
|
||||
|
||||
> [!NOTE]
|
||||
> It is not strictly necessary to handle this event. A successfully
|
||||
@@ -128,10 +146,12 @@ changes:
|
||||
-->
|
||||
|
||||
* `options` Object
|
||||
* `url` string
|
||||
* `url` string - The update server URL. For _Windows_ MSIX, this can be either a direct link to an MSIX file (e.g., `https://example.com/update.msix`) or a JSON endpoint that returns update information (see the [Squirrel.Mac][squirrel-mac] README for more information).
|
||||
* `headers` Record\<string, string\> (optional) _macOS_ - HTTP request headers.
|
||||
* `serverType` string (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
|
||||
README for more information.
|
||||
* `allowAnyVersion` boolean (optional) _Windows_ - If `true`, allows downgrades to older versions for MSIX packages.
|
||||
Defaults to `false`.
|
||||
|
||||
Sets the `url` and initialize the auto updater.
|
||||
|
||||
@@ -168,3 +188,4 @@ closed.
|
||||
[electron-forge-lib]: https://www.electronforge.io/config/makers/squirrel.windows
|
||||
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
[msix-lib]: https://github.com/electron-userland/electron-windows-msix
|
||||
|
||||
@@ -159,6 +159,22 @@ Notification activated (com.github.Electron:notification:EAF7B87C-A113-43D7-8E76
|
||||
Notification replied to (com.github.Electron:notification:EAF7B87C-A113-43D7-8E76-F88EC9D73D44)
|
||||
```
|
||||
|
||||
### `ELECTRON_DEBUG_MSIX_UPDATER`
|
||||
|
||||
Adds extra logs to MSIX updater operations on Windows to aid in debugging. Extra logging will be displayed when MSIX update operations are initiated, including package updates, package registration, and restart registration. This helps diagnose issues with MSIX package updates and deployments.
|
||||
|
||||
Sample output:
|
||||
|
||||
```sh
|
||||
UpdateMsix called with URI: https://example.com/app.msix
|
||||
DoUpdateMsix: Starting
|
||||
Calling AddPackageByUriAsync... URI: https://example.com/app.msix
|
||||
Update options - deferRegistration: true, developerMode: false, forceShutdown: false, forceTargetShutdown: false, forceUpdateFromAnyVersion: false
|
||||
Waiting for deployment...
|
||||
Deployment finished.
|
||||
MSIX Deployment completed.
|
||||
```
|
||||
|
||||
### `ELECTRON_LOG_ASAR_READS`
|
||||
|
||||
When Electron reads from an ASAR file, log the read offset and file path to
|
||||
|
||||
@@ -71,7 +71,7 @@ will disable the support for `asar` archives in Node's built-in modules.
|
||||
|
||||
### `process.noDeprecation`
|
||||
|
||||
A `boolean` that controls whether or not deprecation warnings are printed to `stderr`.
|
||||
A `boolean` (optional) that controls whether or not deprecation warnings are printed to `stderr`.
|
||||
Setting this to `true` will silence deprecation warnings. This property is used
|
||||
instead of the `--no-deprecation` command line flag.
|
||||
|
||||
@@ -128,8 +128,8 @@ A `string` representing Electron's version string.
|
||||
|
||||
### `process.windowsStore` _Readonly_
|
||||
|
||||
A `boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
|
||||
for otherwise it is `undefined`.
|
||||
A `boolean`. If the app is running as an MSIX package (including AppX for Windows Store),
|
||||
this property is `true`, otherwise it is `undefined`.
|
||||
|
||||
### `process.contextId` _Readonly_
|
||||
|
||||
|
||||
@@ -230,8 +230,10 @@ auto_filenames = {
|
||||
browser_bundle_deps = [
|
||||
"lib/browser/api/app.ts",
|
||||
"lib/browser/api/auto-updater.ts",
|
||||
"lib/browser/api/auto-updater/auto-updater-msix.ts",
|
||||
"lib/browser/api/auto-updater/auto-updater-native.ts",
|
||||
"lib/browser/api/auto-updater/auto-updater-win.ts",
|
||||
"lib/browser/api/auto-updater/msix-update-win.ts",
|
||||
"lib/browser/api/auto-updater/squirrel-update-win.ts",
|
||||
"lib/browser/api/base-window.ts",
|
||||
"lib/browser/api/browser-view.ts",
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
if (process.platform === 'win32') {
|
||||
module.exports = require('./auto-updater/auto-updater-win');
|
||||
// windowsStore indicates whether the app is running as a packaged app (MSIX), even outside of the store
|
||||
if (process.windowsStore) {
|
||||
module.exports = require('./auto-updater/auto-updater-msix');
|
||||
} else {
|
||||
module.exports = require('./auto-updater/auto-updater-win');
|
||||
}
|
||||
} else {
|
||||
module.exports = require('./auto-updater/auto-updater-native');
|
||||
}
|
||||
|
||||
449
lib/browser/api/auto-updater/auto-updater-msix.ts
Normal file
449
lib/browser/api/auto-updater/auto-updater-msix.ts
Normal file
@@ -0,0 +1,449 @@
|
||||
import * as msixUpdate from '@electron/internal/browser/api/auto-updater/msix-update-win';
|
||||
|
||||
import { app, net } from 'electron/main';
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
interface UpdateInfo {
|
||||
ok: boolean; // False if error encountered
|
||||
available?: boolean; // True if the update is available, false if not
|
||||
updateUrl?: string; // The URL of the update
|
||||
releaseNotes?: string; // The release notes of the update
|
||||
releaseName?: string; // The release name of the update
|
||||
releaseDate?: Date; // The release date of the update
|
||||
}
|
||||
|
||||
interface MSIXPackageInfo {
|
||||
id: string;
|
||||
familyName: string;
|
||||
developmentMode: boolean;
|
||||
version: string;
|
||||
signatureKind: 'developer' | 'enterprise' | 'none' | 'store' | 'system';
|
||||
appInstallerUri?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for updating an MSIX package.
|
||||
* Used with `updateMsix()` to control how the package update behaves.
|
||||
*
|
||||
* These options correspond to the Windows.Management.Deployment.AddPackageOptions class properties.
|
||||
*
|
||||
* @see https://learn.microsoft.com/en-us/uwp/api/windows.management.deployment.addpackageoptions?view=winrt-26100
|
||||
*/
|
||||
export interface UpdateMsixOptions {
|
||||
/**
|
||||
* Gets or sets a value that indicates whether to delay registration of the main package
|
||||
* or dependency packages if the packages are currently in use.
|
||||
*
|
||||
* Corresponds to `AddPackageOptions.DeferRegistrationWhenPackagesAreInUse`
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
deferRegistration?: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a value that indicates whether the app is installed in developer mode.
|
||||
* When set, the app is installed in development mode which allows for a more rapid
|
||||
* development cycle. The BlockMap.xml, [Content_Types].xml, and digital signature
|
||||
* files are not required for app installation.
|
||||
*
|
||||
* Corresponds to `AddPackageOptions.DeveloperMode`
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
developerMode?: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a value that indicates whether the processes associated with the package
|
||||
* will be shut down forcibly so that registration can continue if the package, or any
|
||||
* package that depends on the package, is currently in use.
|
||||
*
|
||||
* Corresponds to `AddPackageOptions.ForceAppShutdown`
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceShutdown?: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a value that indicates whether the processes associated with the package
|
||||
* will be shut down forcibly so that registration can continue if the package is
|
||||
* currently in use.
|
||||
*
|
||||
* Corresponds to `AddPackageOptions.ForceTargetAppShutdown`
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceTargetShutdown?: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a value that indicates whether to force a specific version of a package
|
||||
* to be added, regardless of if a higher version is already added.
|
||||
*
|
||||
* Corresponds to `AddPackageOptions.ForceUpdateFromAnyVersion`
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceUpdateFromAnyVersion?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for registering an MSIX package.
|
||||
* Used with `registerPackage()` to control how the package registration behaves.
|
||||
*
|
||||
* These options correspond to the Windows.Management.Deployment.DeploymentOptions enum.
|
||||
*
|
||||
* @see https://learn.microsoft.com/en-us/uwp/api/windows.management.deployment.deploymentoptions?view=winrt-26100
|
||||
*/
|
||||
interface RegisterPackageOptions {
|
||||
/**
|
||||
* Force shutdown of the application if it's currently running.
|
||||
* If this package, or any package that depends on this package, is currently in use,
|
||||
* the processes associated with the package are shut down forcibly so that registration can continue.
|
||||
*
|
||||
* Corresponds to `DeploymentOptions.ForceApplicationShutdown` (value: 1)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceShutdown?: boolean;
|
||||
|
||||
/**
|
||||
* Force shutdown of the target application if it's currently running.
|
||||
* If this package is currently in use, the processes associated with the package
|
||||
* are shut down forcibly so that registration can continue.
|
||||
*
|
||||
* Corresponds to `DeploymentOptions.ForceTargetApplicationShutdown` (value: 64)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceTargetShutdown?: boolean;
|
||||
|
||||
/**
|
||||
* Force a specific version of a package to be staged/registered, regardless of if
|
||||
* a higher version is already staged/registered.
|
||||
*
|
||||
* Corresponds to `DeploymentOptions.ForceUpdateFromAnyVersion` (value: 262144)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceUpdateFromAnyVersion?: boolean;
|
||||
}
|
||||
|
||||
class AutoUpdater extends EventEmitter implements Electron.AutoUpdater {
|
||||
updateAvailable: boolean = false;
|
||||
updateURL: string | null = null;
|
||||
updateHeaders: Record<string, string> | null = null;
|
||||
allowAnyVersion: boolean = false;
|
||||
|
||||
// Private: Validate that the URL points to an MSIX file (following redirects)
|
||||
private async validateMsixUrl (url: string): Promise<void> {
|
||||
try {
|
||||
// Make a HEAD request to follow redirects and get the final URL
|
||||
const response = await net.fetch(url, {
|
||||
method: 'HEAD',
|
||||
headers: this.updateHeaders ? new Headers(this.updateHeaders) : undefined,
|
||||
redirect: 'follow' // Follow redirects to get the final URL
|
||||
});
|
||||
|
||||
// Get the final URL after redirects (response.url contains the final URL)
|
||||
const finalUrl = response.url || url;
|
||||
const urlObj = new URL(finalUrl);
|
||||
const pathname = urlObj.pathname.toLowerCase();
|
||||
|
||||
// Check if final URL ends with .msix or .msixbundle extension
|
||||
const hasMsixExtension = pathname.endsWith('.msix') || pathname.endsWith('.msixbundle');
|
||||
|
||||
if (!hasMsixExtension) {
|
||||
throw new Error(`Update URL does not point to an MSIX file. Expected .msix or .msixbundle extension, got final URL: ${finalUrl}`);
|
||||
}
|
||||
} catch (error) {
|
||||
if (error instanceof TypeError) {
|
||||
throw new Error(`Invalid MSIX URL: ${url}`);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Private: Check if URL is a direct MSIX file (following redirects)
|
||||
private async isDirectMsixUrl (url: string, emitError: boolean = false): Promise<boolean> {
|
||||
try {
|
||||
await this.validateMsixUrl(url);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (emitError) {
|
||||
this.emitError(error as Error);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Supports both versioning (x.y.z) and Windows version format (x.y.z.a)
|
||||
// Returns: 1 if v1 > v2, -1 if v1 < v2, 0 if v1 === v2
|
||||
private compareVersions (v1: string, v2: string): number {
|
||||
const parts1 = v1.split('.').map(part => {
|
||||
const parsed = parseInt(part, 10);
|
||||
return isNaN(parsed) ? 0 : parsed;
|
||||
});
|
||||
const parts2 = v2.split('.').map(part => {
|
||||
const parsed = parseInt(part, 10);
|
||||
return isNaN(parsed) ? 0 : parsed;
|
||||
});
|
||||
|
||||
const maxLength = Math.max(parts1.length, parts2.length);
|
||||
|
||||
for (let i = 0; i < maxLength; i++) {
|
||||
const part1 = parts1[i] ?? 0;
|
||||
const part2 = parts2[i] ?? 0;
|
||||
|
||||
if (part1 > part2) return 1;
|
||||
if (part1 < part2) return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Private: Parse the static releases array format
|
||||
// This is a static JSON file containing all releases
|
||||
private parseStaticReleasFile (json: any, currentVersion: string): { ok: boolean; available: boolean; url?: string; name?: string; notes?: string; pub_date?: string } {
|
||||
if (!Array.isArray(json.releases) || !json.currentRelease || typeof json.currentRelease !== 'string') {
|
||||
this.emitError(new Error('Invalid releases format. Expected \'releases\' array and \'currentRelease\' string.'));
|
||||
return { ok: false, available: false };
|
||||
}
|
||||
|
||||
// Use currentRelease property to determine if update is available
|
||||
const currentReleaseVersion = json.currentRelease;
|
||||
|
||||
// Compare current version with currentRelease
|
||||
const versionComparison = this.compareVersions(currentReleaseVersion, currentVersion);
|
||||
|
||||
// If versions match, we're up to date
|
||||
if (versionComparison === 0) {
|
||||
return { ok: true, available: false };
|
||||
}
|
||||
|
||||
// If currentRelease is older than current version, check allowAnyVersion
|
||||
if (versionComparison < 0) {
|
||||
// If allowAnyVersion is true, allow downgrades
|
||||
if (this.allowAnyVersion) {
|
||||
// Continue to find the release entry for downgrade
|
||||
} else {
|
||||
return { ok: true, available: false };
|
||||
}
|
||||
}
|
||||
|
||||
// currentRelease is newer, find the release entry
|
||||
const releaseEntry = json.releases.find((r: any) => r.version === currentReleaseVersion);
|
||||
|
||||
if (!releaseEntry || !releaseEntry.updateTo) {
|
||||
this.emitError(new Error(`Release entry for version '${currentReleaseVersion}' not found or missing 'updateTo' property.`));
|
||||
return { ok: false, available: false };
|
||||
}
|
||||
|
||||
const updateTo = releaseEntry.updateTo;
|
||||
|
||||
if (!updateTo.url) {
|
||||
this.emitError(new Error(`Invalid release entry. 'updateTo.url' is missing for version ${currentReleaseVersion}.`));
|
||||
return { ok: false, available: false };
|
||||
}
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
available: true,
|
||||
url: updateTo.url,
|
||||
name: updateTo.name,
|
||||
notes: updateTo.notes,
|
||||
pub_date: updateTo.pub_date
|
||||
};
|
||||
}
|
||||
|
||||
private parseDynamicReleasFile (json: any): { ok: boolean; available: boolean; url?: string; name?: string; notes?: string; pub_date?: string } {
|
||||
if (!json.url) {
|
||||
this.emitError(new Error('Invalid releases format. Expected \'url\' string property.'));
|
||||
return { ok: false, available: false };
|
||||
}
|
||||
return { ok: true, available: true, url: json.url, name: json.name, notes: json.notes, pub_date: json.pub_date };
|
||||
}
|
||||
|
||||
private async fetchSquirrelJson (url: string) {
|
||||
const headers: Record<string, string> = {
|
||||
...this.updateHeaders,
|
||||
Accept: 'application/json' // Always set Accept header, overriding any user-provided Accept
|
||||
};
|
||||
const response = await net.fetch(url, {
|
||||
headers
|
||||
});
|
||||
|
||||
if (response.status === 204) {
|
||||
return { ok: true, available: false };
|
||||
} else if (response.status === 200) {
|
||||
const updateJson = await response.json();
|
||||
|
||||
// Check if this is the static releases array format
|
||||
if (Array.isArray(updateJson.releases)) {
|
||||
// Get current package version
|
||||
const packageInfo = msixUpdate.getPackageInfo();
|
||||
const currentVersion = packageInfo.version;
|
||||
|
||||
if (!currentVersion) {
|
||||
this.emitError(new Error('Cannot determine current package version.'));
|
||||
return { ok: false, available: false };
|
||||
}
|
||||
|
||||
return this.parseStaticReleasFile(updateJson, currentVersion);
|
||||
} else {
|
||||
// Dynamic format: server returns JSON with update info for current version
|
||||
return this.parseDynamicReleasFile(updateJson);
|
||||
}
|
||||
} else {
|
||||
this.emitError(new Error(`Unexpected response status: ${response.status}`));
|
||||
return { ok: false, available: false };
|
||||
}
|
||||
}
|
||||
|
||||
private async getUpdateInfo (url: string): Promise<UpdateInfo> {
|
||||
if (url && await this.isDirectMsixUrl(url)) {
|
||||
return { ok: true, available: true, updateUrl: url, releaseDate: new Date() };
|
||||
} else {
|
||||
const updateJson = await this.fetchSquirrelJson(url);
|
||||
if (!updateJson.ok) {
|
||||
return { ok: false };
|
||||
} else if (updateJson.ok && !updateJson.available) {
|
||||
return { ok: true, available: false };
|
||||
} else {
|
||||
// updateJson.ok && updateJson.available must be true here
|
||||
// Parse the publication date if present (ISO 8601 format)
|
||||
let releaseDate: Date | null = null;
|
||||
if (updateJson.pub_date) {
|
||||
releaseDate = new Date(updateJson.pub_date);
|
||||
}
|
||||
|
||||
const updateUrl = updateJson.url ?? '';
|
||||
const releaseNotes = updateJson.notes ?? '';
|
||||
const releaseName = updateJson.name ?? '';
|
||||
releaseDate = releaseDate ?? new Date();
|
||||
|
||||
if (!await this.isDirectMsixUrl(updateUrl, true)) {
|
||||
return { ok: false };
|
||||
} else {
|
||||
return {
|
||||
ok: true,
|
||||
available: true,
|
||||
updateUrl,
|
||||
releaseNotes,
|
||||
releaseName,
|
||||
releaseDate
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getFeedURL () {
|
||||
return this.updateURL ?? '';
|
||||
}
|
||||
|
||||
setFeedURL (options: { url: string; headers?: Record<string, string>; allowAnyVersion?: boolean } | string) {
|
||||
let updateURL: string;
|
||||
let headers: Record<string, string> | undefined;
|
||||
let allowAnyVersion: boolean | undefined;
|
||||
if (typeof options === 'object') {
|
||||
if (typeof options.url === 'string') {
|
||||
updateURL = options.url;
|
||||
headers = options.headers;
|
||||
allowAnyVersion = options.allowAnyVersion;
|
||||
} else {
|
||||
throw new TypeError('Expected options object to contain a \'url\' string property in setFeedUrl call');
|
||||
}
|
||||
} else if (typeof options === 'string') {
|
||||
updateURL = options;
|
||||
} else {
|
||||
throw new TypeError('Expected an options object with a \'url\' property to be provided');
|
||||
}
|
||||
this.updateURL = updateURL;
|
||||
this.updateHeaders = headers ?? null;
|
||||
this.allowAnyVersion = allowAnyVersion ?? false;
|
||||
}
|
||||
|
||||
getPackageInfo (): MSIXPackageInfo {
|
||||
return msixUpdate.getPackageInfo() as MSIXPackageInfo;
|
||||
}
|
||||
|
||||
async checkForUpdates () {
|
||||
const url = this.updateURL;
|
||||
if (!url) {
|
||||
return this.emitError(new Error('Update URL is not set'));
|
||||
}
|
||||
|
||||
// Check if running in MSIX package
|
||||
const packageInfo = msixUpdate.getPackageInfo();
|
||||
if (!packageInfo.familyName) {
|
||||
return this.emitError(new Error('MSIX updates are not supported'));
|
||||
}
|
||||
|
||||
// If appInstallerUri is set, Windows App Installer manages updates automatically
|
||||
// Prevent updates here to avoid conflicts
|
||||
if (packageInfo.appInstallerUri) {
|
||||
return this.emitError(new Error('Auto-updates are managed by Windows App Installer. Updates are not allowed when installed via Application Manifest.'));
|
||||
}
|
||||
|
||||
this.emit('checking-for-update');
|
||||
try {
|
||||
const msixUrlInfo = await this.getUpdateInfo(url);
|
||||
if (!msixUrlInfo.ok) {
|
||||
return this.emitError(new Error('Invalid update or MSIX URL. See previous errors.'));
|
||||
}
|
||||
|
||||
if (!msixUrlInfo.available) {
|
||||
this.emit('update-not-available');
|
||||
} else {
|
||||
this.updateAvailable = true;
|
||||
this.emit('update-available');
|
||||
await msixUpdate.updateMsix(msixUrlInfo.updateUrl, {
|
||||
deferRegistration: true,
|
||||
developerMode: false,
|
||||
forceShutdown: false,
|
||||
forceTargetShutdown: false,
|
||||
forceUpdateFromAnyVersion: this.allowAnyVersion
|
||||
} as UpdateMsixOptions);
|
||||
|
||||
this.emit('update-downloaded', {}, msixUrlInfo.releaseNotes, msixUrlInfo.releaseName, msixUrlInfo.releaseDate, msixUrlInfo.updateUrl, () => {
|
||||
this.quitAndInstall();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
this.emitError(error as Error);
|
||||
}
|
||||
}
|
||||
|
||||
async quitAndInstall () {
|
||||
if (!this.updateAvailable) {
|
||||
this.emitError(new Error('No update available, can\'t quit and install'));
|
||||
app.quit();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Get package info to get family name
|
||||
const packageInfo = msixUpdate.getPackageInfo();
|
||||
if (!packageInfo.familyName) {
|
||||
return this.emitError(new Error('MSIX updates are not supported'));
|
||||
}
|
||||
|
||||
msixUpdate.registerRestartOnUpdate('');
|
||||
this.emit('before-quit-for-update');
|
||||
// force shutdown of the application and register the package to be installed on restart
|
||||
await msixUpdate.registerPackage(packageInfo.familyName, {
|
||||
forceShutdown: true
|
||||
} as RegisterPackageOptions);
|
||||
} catch (error) {
|
||||
this.emitError(error as Error);
|
||||
}
|
||||
}
|
||||
|
||||
// Private: Emit both error object and message, this is to keep compatibility
|
||||
// with Old APIs.
|
||||
emitError (error: Error) {
|
||||
this.emit('error', error, error.message);
|
||||
}
|
||||
}
|
||||
|
||||
export default new AutoUpdater();
|
||||
@@ -20,6 +20,11 @@ class AutoUpdater extends EventEmitter implements Electron.AutoUpdater {
|
||||
return this.updateURL ?? '';
|
||||
}
|
||||
|
||||
getPackageInfo () {
|
||||
// Squirrel-based Windows apps don't have MSIX package information
|
||||
return undefined;
|
||||
}
|
||||
|
||||
setFeedURL (options: { url: string } | string) {
|
||||
let updateURL: string;
|
||||
if (typeof options === 'object') {
|
||||
|
||||
4
lib/browser/api/auto-updater/msix-update-win.ts
Normal file
4
lib/browser/api/auto-updater/msix-update-win.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
const { updateMsix, registerPackage, registerRestartOnUpdate, getPackageInfo } =
|
||||
process._linkedBinding('electron_browser_msix_updater');
|
||||
|
||||
export { updateMsix, registerPackage, registerRestartOnUpdate, getPackageInfo };
|
||||
@@ -10,7 +10,7 @@
|
||||
"@electron/docs-parser": "^2.0.0",
|
||||
"@electron/fiddle-core": "^1.3.4",
|
||||
"@electron/github-app-auth": "^3.2.0",
|
||||
"@electron/lint-roller": "^3.1.2",
|
||||
"@electron/lint-roller": "^3.2.0",
|
||||
"@electron/typescript-definitions": "^9.1.5",
|
||||
"@octokit/rest": "^20.1.2",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
|
||||
@@ -23,10 +23,10 @@ index 8077ed85e45e56d6cccb691223216c1f6a94b5ee..dd4cee346f16df703d414bf206bbe6c9
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index ac7f0b0524eec5cb845205001133a67501a094b5..ce9de143978a35d18be5b1baf7498851de1b2d88 100644
|
||||
index 79cc9552a5504b7fce8f8bf31b1cb2833b8cf1ef..9bcc65dd9017980e7846378dd0b6311f72d0909b 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4746,6 +4746,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4755,6 +4755,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ index ac7f0b0524eec5cb845205001133a67501a094b5..ce9de143978a35d18be5b1baf7498851
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index ab62af31a76560c9747abed1c861352528947f8b..6070e33ee15d43bacbdb6a0ce0eaed89e49244d2 100644
|
||||
index 6b58b8f00d16ce5a39e9d9879cf7cecdd5052e50..8adf1f8691fc36599f75cae18be9b8230cae1e20 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -607,6 +607,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
index 869a8714996a809eda3e95d03cf8d9db5e8d72b0..23ac62c37e4e9f742a8779dcf83f399c459d8f48 100644
|
||||
index 14e6fd9b6d20fa18fc5b558f9a7bbf76f9fd4059..b12ce72835b2acd9099a4fad4308b5eee7963635 100644
|
||||
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
@@ -168,6 +168,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
@@ -23,7 +23,7 @@ index 869a8714996a809eda3e95d03cf8d9db5e8d72b0..23ac62c37e4e9f742a8779dcf83f399c
|
||||
return receiver_.BindNewEndpointAndPassDedicatedRemote();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index 7a7f78fc15114f6303f8413e7330c8f59fd79e07..8685048a717e8af489804748550b898051d83b3c 100644
|
||||
index b8193571d0a3b7609e89b284f57a9cbf36d593e0..0d42b04031006b844d5a2a2b73241d2b7e2fb93d 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -759,6 +759,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -39,7 +39,7 @@ index 7a7f78fc15114f6303f8413e7330c8f59fd79e07..8685048a717e8af489804748550b8980
|
||||
return is_active();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
|
||||
index c8d6592a2d73bb132c7bdaa6532086da10a4512a..99479aed4911e134914db226094933c311002164 100644
|
||||
index 2dddaff6c16c55288b6ea72cb8df0f8737971d71..dce9dae250ff2ac070752830df41cc45ed72823e 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -134,6 +134,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -116,10 +116,10 @@ index 932658273154ef2e022358e493a8e7c00c86e732..57bbfb5cde62c9496c351c861880a189
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 8cd8090807d0ae08267909c924a420119bce0a61..1ea40bbc89db58e602fee5478b48a0f7b25ff93a 100644
|
||||
index e47f324d52c0837eff24c592da0c51f0aaf47565..3642fb358bc92dcf523b589ac5fe07c877f3a221 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2532,6 +2532,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -2530,6 +2530,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
|
||||
"old_state", old_state, "new_state", new_state);
|
||||
|
||||
@@ -130,7 +130,7 @@ index 8cd8090807d0ae08267909c924a420119bce0a61..1ea40bbc89db58e602fee5478b48a0f7
|
||||
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 &&
|
||||
@@ -4167,10 +4171,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -4165,10 +4169,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ WebPreferences of in-process child windows, rather than relying on
|
||||
process-level command line switches, as before.
|
||||
|
||||
diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
index 3d660d72c029e5ae10cf32ac53c4c1a7314a5125..8ed89c56428886efe24fb1fe9399cbae507878f5 100644
|
||||
index ca771db96607de17323123ed74d7e7852da754c1..67969140ffaa75c819b1809c384ef1c28b8d6a2e 100644
|
||||
--- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
+++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
@@ -151,6 +151,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -149,6 +149,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
out->v8_cache_options = data.v8_cache_options();
|
||||
out->record_whole_document = data.record_whole_document();
|
||||
out->stylus_handwriting_enabled = data.stylus_handwriting_enabled();
|
||||
@@ -32,7 +32,7 @@ index 3d660d72c029e5ae10cf32ac53c4c1a7314a5125..8ed89c56428886efe24fb1fe9399cbae
|
||||
out->accelerated_video_decode_enabled =
|
||||
data.accelerated_video_decode_enabled();
|
||||
diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
index 184ebdae4f97582418494fde791b7822b496b7b1..eccb75cd1eb54ca626096d0799c446639b2476c2 100644
|
||||
index 1c9f1a57ee1f9e295a7f4bb1b445ebf8d8a9e9f1..6d04d8ff71d36e1df99c9d69cc4e1bd439890667 100644
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -43,7 +43,7 @@ index 184ebdae4f97582418494fde791b7822b496b7b1..eccb75cd1eb54ca626096d0799c44663
|
||||
#include "build/build_config.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -466,6 +467,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
@@ -462,6 +463,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
bool should_screenshot_on_mainframe_same_doc_navigation = true;
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -64,7 +64,7 @@ index 184ebdae4f97582418494fde791b7822b496b7b1..eccb75cd1eb54ca626096d0799c44663
|
||||
// chrome, except for the cases where it would require lots of extra work for
|
||||
// the embedder to use the same default value.
|
||||
diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
index 7113bbbd4c223793cf6293a0d1723259a5cc9179..404df10825e979b4771d0ce2aef480299412c8c1 100644
|
||||
index db2ff72cf836d6e10ff30d00df2fe14896b214fe..50ac38be6ab78eb15fb5621c9e9065d88b6649e7 100644
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
@@ -8,6 +8,7 @@
|
||||
@@ -75,7 +75,7 @@ index 7113bbbd4c223793cf6293a0d1723259a5cc9179..404df10825e979b4771d0ce2aef48029
|
||||
#include "mojo/public/cpp/bindings/struct_traits.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -445,6 +446,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -440,6 +441,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
return r.stylus_handwriting_enabled;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ index 7113bbbd4c223793cf6293a0d1723259a5cc9179..404df10825e979b4771d0ce2aef48029
|
||||
return r.cookie_enabled;
|
||||
}
|
||||
diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
index 531cc01e1db5afc8f66ce1b0e849687c2392eeca..8c88dc9f8fbb9328ca235a3158029175400889fe 100644
|
||||
index 230fbc9018462e5f1f3f7a600ac3a0eef64ba459..34be07248d1738bf1b820ba179a9c8e427efca4c 100644
|
||||
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
@@ -4,6 +4,7 @@
|
||||
@@ -140,7 +140,7 @@ index 531cc01e1db5afc8f66ce1b0e849687c2392eeca..8c88dc9f8fbb9328ca235a3158029175
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "skia/public/mojom/skcolor.mojom";
|
||||
import "third_party/blink/public/mojom/css/preferred_color_scheme.mojom";
|
||||
@@ -225,6 +226,19 @@ struct WebPreferences {
|
||||
@@ -221,6 +222,19 @@ struct WebPreferences {
|
||||
// If true, stylus handwriting recognition to text input will be available in
|
||||
// editable input fields which are non-password type.
|
||||
bool stylus_handwriting_enabled;
|
||||
|
||||
@@ -49,10 +49,10 @@ index ac5d88520a785e12b66ebd96c92c46319a08311c..5c582e4f249c28a5739da2da4e600ee2
|
||||
// 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 1634aa9d76d9423cfce2df5b752e402f957e271e..e2b4ad7cfbd5ce4dfa0ae7d4992ac6f0d2b916b7 100644
|
||||
index 85bb570db1d2d4fafa8d5ac449122225965b425a..d39312542b93c4c5eaf4580c2a8d20290cf82a89 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -767,10 +767,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -768,10 +768,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
DCHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -63,7 +63,7 @@ index 1634aa9d76d9423cfce2df5b752e402f957e271e..e2b4ad7cfbd5ce4dfa0ae7d4992ac6f0
|
||||
if (!Client())
|
||||
return false;
|
||||
|
||||
@@ -827,6 +823,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -828,6 +824,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
DCHECK(!view_->IsAttached());
|
||||
Client()->WillBeDetached();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
|
||||
to introduce a new Electron category for Electron-specific tracing.
|
||||
|
||||
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
|
||||
index 52d4c2888d80f7c80887609a337f402b4d072451..6b2d090bf53c1e2d80761adabb3843339535d564 100644
|
||||
index 56408734b26428933a1fb8c04cee317c659feea7..0fa09a8d86241456293119edecf209f8d0790c0e 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -133,6 +133,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
|
||||
|
||||
@@ -11,7 +11,7 @@ This patch can (and should) be removed when we can prevent those symbols
|
||||
from being stripped in the release build.
|
||||
|
||||
diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
|
||||
index 2e5ce812ab5eef379650912c33aa9d4ebeef9dd2..c40b1c180e4a253df074bcedb9d3d6b17c264a78 100644
|
||||
index c26e04c0556f7a5edf131ef42a375a71bf536da5..9028f13dfee04a33874a4d3d996cf223cc506928 100644
|
||||
--- a/build/config/compiler/compiler.gni
|
||||
+++ b/build/config/compiler/compiler.gni
|
||||
@@ -90,7 +90,7 @@ declare_args() {
|
||||
|
||||
@@ -33,10 +33,10 @@ index f21010994e7e554c63f1bf24d5c09e9904e97bc9..ac151bbddafc76b92af9a7bce56bb405
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 324103d42accea76c06490d8f7323a913bdbb81a..587b492f828ccb3179f34102a99326c09dfb3306 100644
|
||||
index 996beedb7437f42b33ec5458d69403478e7840a5..464b75de67b41f3a947af2cb885e1aada0f5869d 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4780,7 +4780,7 @@ static_library("browser") {
|
||||
@@ -4769,7 +4769,7 @@ static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 324103d42accea76c06490d8f7323a913bdbb81a..587b492f828ccb3179f34102a99326c0
|
||||
# than here in :chrome_dll.
|
||||
deps += [ "//chrome:packed_resources_integrity_header" ]
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 080d366183b8a43bf4bb9f7784bbdf58d26960d3..6ca2ef279235c88aa9b60db8cb548edd0aea1356 100644
|
||||
index 78b828817d717e277daf2824b93da7538015cdfa..f09ea3eff2d1c5661b9d87a66d9920d9edced7a6 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7643,9 +7643,12 @@ test("unit_tests") {
|
||||
@@ -7666,9 +7666,12 @@ test("unit_tests") {
|
||||
"//chrome/notification_helper",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index 080d366183b8a43bf4bb9f7784bbdf58d26960d3..6ca2ef279235c88aa9b60db8cb548edd
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -8605,6 +8608,10 @@ test("unit_tests") {
|
||||
@@ -8632,6 +8635,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index 080d366183b8a43bf4bb9f7784bbdf58d26960d3..6ca2ef279235c88aa9b60db8cb548edd
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8662,7 +8669,6 @@ test("unit_tests") {
|
||||
@@ -8689,7 +8696,6 @@ test("unit_tests") {
|
||||
# TODO(crbug.com/417513088): Maybe merge with the non-android `deps` declaration above?
|
||||
deps += [
|
||||
"../browser/screen_ai:screen_ai_install_state",
|
||||
|
||||
@@ -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 8b5319856ca98a4320a3857c4a200435be2b5453..bb3b1d7cd446d25f1e9d90b92f0fed8c841973c4 100644
|
||||
index 7b8b10f561b9e9b1fe480f0dbdfcabbe795745e2..528b2ef70453b904c630fd657e8dffff8c7c642d 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9923,6 +9923,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9981,6 +9981,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 8b5319856ca98a4320a3857c4a200435be2b5453..bb3b1d7cd446d25f1e9d90b92f0fed8c
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 97bd7047458f3ba5aefdf2a257332e620e744807..2ba679ac7064a53935fb90bf94a2d83c407c1ac2 100644
|
||||
index 75ce3e0027b111c7e29d4c602521512dbf6b68ac..2138c00b6e732dc826df07ac66fd7f8e62fffd0c 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5351,6 +5351,10 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5346,6 +5346,10 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
create_params.initially_hidden = renderer_started_hidden;
|
||||
create_params.initial_popup_url = params.target_url;
|
||||
|
||||
@@ -35,7 +35,7 @@ index 97bd7047458f3ba5aefdf2a257332e620e744807..2ba679ac7064a53935fb90bf94a2d83c
|
||||
// Even though all codepaths leading here are in response to a renderer
|
||||
// trying to open a new window, if the new window ends up in a different
|
||||
// browsing instance, then the RenderViewHost, RenderWidgetHost,
|
||||
@@ -5403,6 +5407,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5398,6 +5402,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
// Sets the newly created WebContents WindowOpenDisposition.
|
||||
new_contents_impl->original_window_open_disposition_ = params.disposition;
|
||||
|
||||
@@ -48,7 +48,7 @@ index 97bd7047458f3ba5aefdf2a257332e620e744807..2ba679ac7064a53935fb90bf94a2d83c
|
||||
// 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
|
||||
@@ -5444,12 +5454,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5439,12 +5449,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ index 4c55f0abf8df5a3408f3f90d444ceff3c23ee1bc..72bdb5b5a4c2c21a7192b34bb293bd23
|
||||
|
||||
// Operation result when the renderer asks the browser to create a new window.
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 0f20753a92f64611f8c7f902960324faa4570088..b1e25f142beae77768128bb4467a3485c888a7ad 100644
|
||||
index f40acd79dd69dffa922ecf147a19ff658f6f26c9..57f55937e634d2988d86b1cca95f3f056e518f32 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -872,6 +872,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -90,10 +90,10 @@ index 0f20753a92f64611f8c7f902960324faa4570088..b1e25f142beae77768128bb4467a3485
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 1a080e8613a2aafcb56696ae4b8364c1ba918fec..d97d2e328de91be93ca1fc542ad1d8c8131285d1 100644
|
||||
index 84cafee582dee5d49e1b95d7b90e838dbdf86c8a..ef0171853547a4172f2bd933abb043963923390b 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -204,6 +204,7 @@ class NetworkService;
|
||||
@@ -205,6 +205,7 @@ class NetworkService;
|
||||
class TrustedURLLoaderHeaderClient;
|
||||
} // namespace mojom
|
||||
struct ResourceRequest;
|
||||
@@ -170,15 +170,15 @@ index 6a72c7925222ed8a11830b68718d7973629a6d2c..a6f0447b6ede476162f555d951f346b0
|
||||
// typically happens when popups are created.
|
||||
virtual void WebContentsCreated(WebContents* source_contents,
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index d2b3d5dccde5754972ae44fdf6d1b9cae90aa9fc..ac7f0b0524eec5cb845205001133a67501a094b5 100644
|
||||
index f0103098d2f4d1915d8c8f3481fe077ae562edbb..79cc9552a5504b7fce8f8bf31b1cb2833b8cf1ef 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6810,6 +6810,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6826,6 +6826,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
+ params->raw_features = features.raw_features.Utf8(
|
||||
+ blink::Utf8ConversionMode::kStrictReplacingErrors);
|
||||
+ WebString::UTF8ConversionMode::kStrictReplacingErrorsWithFFFD);
|
||||
+ params->body = GetRequestBodyForWebURLRequest(request);
|
||||
+
|
||||
// We preserve this information before sending the message since |params| is
|
||||
@@ -211,23 +211,15 @@ index 790f004d2a3a9ae5a3588fda097732a5daac0c75..83fcc9418b89b669863e730f2049a1d8
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) override;
|
||||
diff --git a/third_party/blink/public/web/web_window_features.h b/third_party/blink/public/web/web_window_features.h
|
||||
index d92bab531c12c62a5321a23f4a0cb89691668127..c354a79c7c8dd047264df35b873e90c15fa364a2 100644
|
||||
index d92bab531c12c62a5321a23f4a0cb89691668127..2060e04795ba8e7a923fd0fe3485b8c553ca4421 100644
|
||||
--- a/third_party/blink/public/web/web_window_features.h
|
||||
+++ b/third_party/blink/public/web/web_window_features.h
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/blink/public/platform/web_string.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -70,6 +71,8 @@ struct WebWindowFeatures {
|
||||
@@ -70,6 +70,8 @@ struct WebWindowFeatures {
|
||||
// TODO(apaseltiner): Investigate moving this field to a non-public struct
|
||||
// since it is only needed within //third_party/blink.
|
||||
std::optional<std::vector<WebString>> attribution_srcs;
|
||||
+
|
||||
+ String raw_features;
|
||||
+ WebString raw_features;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -34,10 +34,10 @@ index dd4cee346f16df703d414bf206bbe6c9f4b1f796..5565f5a9259bd7da0722080bf01b3415
|
||||
virtual void DidClearWindowObject() {}
|
||||
virtual void DidChangeScrollOffset() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index ce9de143978a35d18be5b1baf7498851de1b2d88..0f15ab9ca7ecce3f2e1800c6c03261bf1a71f867 100644
|
||||
index 9bcc65dd9017980e7846378dd0b6311f72d0909b..d3000974f71cf6fbb4b4015c938e7f301e656b02 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4752,10 +4752,11 @@ void RenderFrameImpl::DidInstallConditionalFeatures(
|
||||
@@ -4761,10 +4761,11 @@ void RenderFrameImpl::DidInstallConditionalFeatures(
|
||||
observer.DidInstallConditionalFeatures(context, world_id);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ index ce9de143978a35d18be5b1baf7498851de1b2d88..0f15ab9ca7ecce3f2e1800c6c03261bf
|
||||
|
||||
void RenderFrameImpl::DidChangeScrollOffset() {
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 6070e33ee15d43bacbdb6a0ce0eaed89e49244d2..30dfb3677875b8a2e2c92babd46e291c9308d992 100644
|
||||
index 8adf1f8691fc36599f75cae18be9b8230cae1e20..08ae7506cdb6c5d9996f77d1199234a0120b53d2 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -609,7 +609,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
|
||||
@@ -49,7 +49,7 @@ index b7d13fff1f53e2ce3e53d2d5e97a442627962cd8..295249a582c77b70abf78313439b0100
|
||||
// These existing cases are "grandfathered in", but there shouldn't be more.
|
||||
// See comments atop class.
|
||||
diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h
|
||||
index d12858dfb35e009892fc7656dfe0823bff3f3b26..bfbcd7dad7689fb612d328ca6e66eca5e6b48107 100644
|
||||
index 8060008a22ed6aabb1821cf725caec500d80425c..f5685b0275793219f84bd1891195a29dab6fcb4a 100644
|
||||
--- a/ui/views/widget/widget_delegate.h
|
||||
+++ b/ui/views/widget/widget_delegate.h
|
||||
@@ -168,6 +168,12 @@ namespace crostini {
|
||||
|
||||
@@ -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 594b881495e840efb25abff04d1ac0e6516ec2d1..fd4226d84464cd8353b64ec984c97d26f0a98c96 100644
|
||||
index aa42c0a3815cb28387ee57dcfe1fc30a7b6500f1..fc5c7782035bb4d0b9d673cb125062f47cd98a14 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5322,7 +5322,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5317,7 +5317,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
: IsGuest();
|
||||
// While some guest types do not have a guest SiteInstance, the ones that
|
||||
// don't all override WebContents creation above.
|
||||
|
||||
@@ -80,10 +80,10 @@ index 39fa45f0a0f9076bd7ac0be6f455dd540a276512..3d0381d463eed73470b28085830f2a23
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params,
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index 8d8c63242dc131a9d43c26292b60c09c7367555a..7624504ca5c205b62f4481261e47a9de91d1f0e6 100644
|
||||
index 6fc340e394bb6e7f757d4a0464589bd0d843371c..d3cf90a4a709138a7c99ca3cd7eebbd197456585 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -2386,7 +2386,8 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -2377,7 +2377,8 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
const std::string& frame_name,
|
||||
@@ -93,7 +93,7 @@ index 8d8c63242dc131a9d43c26292b60c09c7367555a..7624504ca5c205b62f4481261e47a9de
|
||||
if (HasActorTask(profile(), opener)) {
|
||||
// If an ExecutionEngine is acting on the opener, prevent it from creating a
|
||||
// new WebContents. We'll instead force the navigation to happen in the same
|
||||
@@ -2399,7 +2400,7 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -2390,7 +2391,7 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
return (window_container_type ==
|
||||
content::mojom::WindowContainerType::BACKGROUND &&
|
||||
ShouldCreateBackgroundContents(source_site_instance, opener_url,
|
||||
@@ -103,10 +103,10 @@ index 8d8c63242dc131a9d43c26292b60c09c7367555a..7624504ca5c205b62f4481261e47a9de
|
||||
|
||||
WebContents* Browser::CreateCustomWebContents(
|
||||
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
|
||||
index 18e99c6f7e73d69204b0da11f33cb06b482eb01f..216cf7f3bec72a25c8ceba34488b0e939b125be7 100644
|
||||
index 3bbf1f6bfcc654ee750862153e37fe2836b4514c..d8859df2113171bf7f2e86dce653e2d258961de3 100644
|
||||
--- a/chrome/browser/ui/browser.h
|
||||
+++ b/chrome/browser/ui/browser.h
|
||||
@@ -941,8 +941,7 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -936,8 +936,7 @@ class Browser : public TabStripModelObserver,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -223,10 +223,10 @@ index b969f1d97b7e3396119b579cfbe61e19ff7d2dd4..b8d6169652da28266a514938b45b39c5
|
||||
content::WebContents* AddNewContents(
|
||||
content::WebContents* source,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 00a2dd44a8eaf655b21b5fc98d701f150b4ac3e6..43ef8b669fd4bca119a4181ef99d8f8cb79947d0 100644
|
||||
index 76855246e19933850dc5b79c65c816a2690dd229..a6197d7c8ec5e1c27c74372e478b87aadd7ba7a7 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5287,8 +5287,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5282,8 +5282,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
if (delegate_ &&
|
||||
delegate_->IsWebContentsCreationOverridden(
|
||||
opener, source_site_instance, params.window_container_type,
|
||||
|
||||
@@ -79,10 +79,10 @@ index 8c318a31454c57b0e8db3770a36c45be427f053c..6f809c9672448ed9797e3c9da492ad2c
|
||||
friend class ContentClientCreator;
|
||||
friend class ContentClientInitializer;
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 41a25b402f330fcb84e4cca1365d3f72090e518d..4c4fb85d96e553912090f13c2ac1a48f3170a515 100644
|
||||
index 3b0e038918a175c70beb91e0c5d816aed2e6f181..8d3e00535b6bec4068b07ded8f19f18c48da3769 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -648,8 +648,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
@@ -643,8 +643,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
|
||||
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
||||
|
||||
@@ -92,7 +92,7 @@ index 41a25b402f330fcb84e4cca1365d3f72090e518d..4c4fb85d96e553912090f13c2ac1a48f
|
||||
if (g_mapped_snapshot) {
|
||||
// TODO(crbug.com/40558459): Confirm not loading different type of snapshot
|
||||
// files in a process.
|
||||
@@ -658,10 +657,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
@@ -653,10 +652,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
|
||||
base::MemoryMappedFile::Region file_region;
|
||||
base::File file =
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 7651e982578b5546393086fa87e6d410ca617027..5a71b4e88c22517c5ad296213b3bfefde06115cb 100644
|
||||
index 93fe27d2e7cf5cf78d30685e50f25715ddefd66e..b092a09cada3f289cb13ed4352b6da8cb7ff154a 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -845,6 +845,10 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -846,6 +846,10 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ index 7651e982578b5546393086fa87e6d410ca617027..5a71b4e88c22517c5ad296213b3bfefd
|
||||
// Prompts should remain open and functional across tab switches.
|
||||
if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
index 614390e29fa84af4c141102d86f3ebdb7293b813..0bb31ec2e957301e55c81225683ec9982ba63039 100644
|
||||
index bffb574713aaefb61c7204b5d859f1d7c77b2192..889c9f3549fdc71171c830e17595bee6f21eb9e8 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -1036,6 +1036,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
return synthetic_gesture_controller_.get();
|
||||
}
|
||||
@@ -1039,6 +1039,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
|
||||
base::TimeDelta GetHungRendererDelayForTesting();
|
||||
|
||||
+ // Electron: Prevents the widget from getting hidden.
|
||||
+ bool disable_hidden_ = false;
|
||||
|
||||
@@ -15,10 +15,10 @@ 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 1ea40bbc89db58e602fee5478b48a0f7b25ff93a..a2ed1d740680010b147e6ec7677ec3387bd7250f 100644
|
||||
index 3642fb358bc92dcf523b589ac5fe07c877f3a221..eaf48d7c193d881ce8414bffdb708efb286d25aa 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -1920,6 +1920,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
@@ -1918,6 +1918,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
web_view_impl->SetMaximumLegibleScale(
|
||||
prefs.default_maximum_page_scale_factor);
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: feat: add support for embedder snapshot validation
|
||||
IsValid is not exposed despite being commented as for embedders, this exposes something that works for us.
|
||||
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 4c4fb85d96e553912090f13c2ac1a48f3170a515..697c588ecd286942657b07f2a3fac05626904786 100644
|
||||
index 8d3e00535b6bec4068b07ded8f19f18c48da3769..2a7c146fc549d563f187797feb8b190b64234b30 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -76,11 +76,23 @@ bool GenerateEntropy(unsigned char* buffer, size_t amount) {
|
||||
@@ -33,7 +33,7 @@ index 4c4fb85d96e553912090f13c2ac1a48f3170a515..697c588ecd286942657b07f2a3fac056
|
||||
} else {
|
||||
data->data = nullptr;
|
||||
data->raw_size = 0;
|
||||
@@ -225,6 +237,10 @@ constexpr std::string_view kV8FlagParam = "V8FlagParam";
|
||||
@@ -226,6 +238,10 @@ constexpr std::string_view kV8FlagParam = "V8FlagParam";
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -187,10 +187,10 @@ index d9c14f91747bde0e76056d7f2f2ada166e67f994..53be16879777a3b9bef58ead5f7e420c
|
||||
|
||||
UtilityProcessHost::Start(std::move(utility_options),
|
||||
diff --git a/content/browser/service_host/utility_process_host.cc b/content/browser/service_host/utility_process_host.cc
|
||||
index c2a13c3776dbe7609aeeebd87c0187a510f339e2..2b635c27741e8202d439ab03bc0f517dd00568a2 100644
|
||||
index 1f848cd121b2ecef4892bb2563c593124337e7cf..5fa25d07cddca53177e82e5cba1cc834a40994d0 100644
|
||||
--- a/content/browser/service_host/utility_process_host.cc
|
||||
+++ b/content/browser/service_host/utility_process_host.cc
|
||||
@@ -240,13 +240,13 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithFileToPreload(
|
||||
@@ -241,13 +241,13 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithFileToPreload(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
|
||||
@@ -207,7 +207,7 @@ index c2a13c3776dbe7609aeeebd87c0187a510f339e2..2b635c27741e8202d439ab03bc0f517d
|
||||
|
||||
#if BUILDFLAG(USE_ZYGOTE)
|
||||
UtilityProcessHost::Options& UtilityProcessHost::Options::WithZygoteForTesting(
|
||||
@@ -256,6 +256,36 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithZygoteForTesting(
|
||||
@@ -257,6 +257,36 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithZygoteForTesting(
|
||||
}
|
||||
#endif // BUILDFLAG(USE_ZYGOTE)
|
||||
|
||||
@@ -244,7 +244,7 @@ index c2a13c3776dbe7609aeeebd87c0187a510f339e2..2b635c27741e8202d439ab03bc0f517d
|
||||
UtilityProcessHost::Options&
|
||||
UtilityProcessHost::Options::WithBoundReceiverOnChildProcessForTesting(
|
||||
mojo::GenericPendingReceiver receiver) {
|
||||
@@ -519,9 +549,26 @@ bool UtilityProcessHost::StartProcess() {
|
||||
@@ -531,9 +561,26 @@ bool UtilityProcessHost::StartProcess() {
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_GPU_CHANNEL_MEDIA_CAPTURE) && !BUILDFLAG(IS_WIN)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ making three primary changes to Blink:
|
||||
* Controls whether the CSS rule is available.
|
||||
|
||||
diff --git a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
|
||||
index 2dd22ede8da0ad21251d0df6622a85513651510c..fea4d717fbad2419741d48c5a285909026654b57 100644
|
||||
index 3dc1e9241f708ebcb3148999f1c69fee86be1008..28765da85bcbed322546a80fd5f71bd4d5618700 100644
|
||||
--- a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
|
||||
+++ b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
|
||||
@@ -50,7 +50,7 @@ enum CSSSampleId {
|
||||
@@ -33,10 +33,10 @@ index 2dd22ede8da0ad21251d0df6622a85513651510c..fea4d717fbad2419741d48c5a2859090
|
||||
// per page visit for each CSS histogram being logged on the blink side and the
|
||||
// browser side.
|
||||
diff --git a/third_party/blink/renderer/build/scripts/core/css/css_properties.py b/third_party/blink/renderer/build/scripts/core/css/css_properties.py
|
||||
index e189d584f05f2ce6354c03a9b19f56985df8a15e..41b430e8f2416be098494f5c49fb97cae13447aa 100755
|
||||
index 576fb9bff78221a61236a76a597b6b66ae8a5e6a..78e844e7dd0bd85640b208bfcdd385fdd553e255 100755
|
||||
--- a/third_party/blink/renderer/build/scripts/core/css/css_properties.py
|
||||
+++ b/third_party/blink/renderer/build/scripts/core/css/css_properties.py
|
||||
@@ -312,7 +312,7 @@ class CSSProperties(object):
|
||||
@@ -324,7 +324,7 @@ class CSSProperties(object):
|
||||
name_without_leading_dash = name_without_leading_dash[1:]
|
||||
internal_visited_order = 1
|
||||
if name_without_leading_dash.startswith(
|
||||
@@ -46,10 +46,10 @@ index e189d584f05f2ce6354c03a9b19f56985df8a15e..41b430e8f2416be098494f5c49fb97ca
|
||||
'internal-forced-visited-'):
|
||||
internal_visited_order = 0
|
||||
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5
|
||||
index a4959f7b3f428cd3e3d51ed020ec576e3a92d0c1..b2bd0b07803e457c2aaee8c382dc01045315febf 100644
|
||||
index 82ab198abf549fc82d0fadba95e826fd77641261..1d58becfafb4035025aaac129b0f357750f9f38b 100644
|
||||
--- a/third_party/blink/renderer/core/css/css_properties.json5
|
||||
+++ b/third_party/blink/renderer/core/css/css_properties.json5
|
||||
@@ -9223,6 +9223,26 @@
|
||||
@@ -9275,6 +9275,26 @@
|
||||
property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
|
||||
},
|
||||
|
||||
@@ -77,7 +77,7 @@ index a4959f7b3f428cd3e3d51ed020ec576e3a92d0c1..b2bd0b07803e457c2aaee8c382dc0104
|
||||
{
|
||||
name: "-internal-visited-color",
|
||||
diff --git a/third_party/blink/renderer/core/css/css_property_equality.cc b/third_party/blink/renderer/core/css/css_property_equality.cc
|
||||
index e723573b371b489d4908c8dc8a3399d96031f983..bb68dde106578c73c514bd2a809fcaca0f92fc34 100644
|
||||
index 2a6fdf1e705e1486e82bcaba248f9e6a369fc67f..101d1fc61e0802e5367b1ebc036076669ee44366 100644
|
||||
--- a/third_party/blink/renderer/core/css/css_property_equality.cc
|
||||
+++ b/third_party/blink/renderer/core/css/css_property_equality.cc
|
||||
@@ -402,6 +402,8 @@ bool CSSPropertyEquality::PropertiesEqual(const PropertyHandle& property,
|
||||
@@ -90,10 +90,10 @@ index e723573b371b489d4908c8dc8a3399d96031f983..bb68dde106578c73c514bd2a809fcaca
|
||||
return a.EmptyCells() == b.EmptyCells();
|
||||
case CSSPropertyID::kFill:
|
||||
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
|
||||
index 506d6de5d48eadd34df1e9f35398a8756fe0d005..f56613267b5ecf08e5b5535144bc95791e1c6a4c 100644
|
||||
index 2f378422e277ea5fcb4ce436b9653023db07c100..98df9ac4e6c6301c560374912ea95131ca3cee59 100644
|
||||
--- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
|
||||
+++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
|
||||
@@ -12893,5 +12893,36 @@ const CSSValue* InternalEmptyLineHeight::ParseSingleValue(
|
||||
@@ -12834,5 +12834,36 @@ const CSSValue* InternalEmptyLineHeight::ParseSingleValue(
|
||||
CSSValueID::kNone>(stream);
|
||||
}
|
||||
|
||||
@@ -131,10 +131,10 @@ index 506d6de5d48eadd34df1e9f35398a8756fe0d005..f56613267b5ecf08e5b5535144bc9579
|
||||
} // namespace css_longhand
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
|
||||
index 292812c9e36fed429edf72335069ac3c0bbd780f..13a500d99cec9fb733de41d3071611630c3b09e0 100644
|
||||
index 6ef37baf747592faee92804fc96b36004f65ed92..6a0eb1dfb758eb6610819232dd1ca632118ad16c 100644
|
||||
--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
|
||||
+++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
|
||||
@@ -4172,6 +4172,15 @@ PositionTryFallback StyleBuilderConverter::ConvertSinglePositionTryFallback(
|
||||
@@ -4180,6 +4180,15 @@ PositionTryFallback StyleBuilderConverter::ConvertSinglePositionTryFallback(
|
||||
return PositionTryFallback(scoped_name, tactic_list);
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ index 18f283e625101318ee14b50e6e765dfd1c9a1a44..44a3a55974c9e4b9e715574075f25661
|
||||
|
||||
auto DrawAsSinglePath = [&]() {
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
index 04fcf32ece5fca888f381baf8c818fd4c888391d..17f24e8f71d59a811c69f4692cbe66a9d9974874 100644
|
||||
index 65c7ddbba26c0456899dc084888205cef2e23380..689850b72dca601717ff025a9fc5cf9d85c64cca 100644
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -214,6 +214,10 @@
|
||||
|
||||
@@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index b3499d99f684b0463c07656633447b7c7dcdd7bb..802d43a0459409749545d61449593dfecca9e7d1 100644
|
||||
index 123118d66734295f7b00e807aa0437ac76ab3f57..24daad8568b05f35f93f0695f3bcea81d312d379 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -176,6 +176,8 @@ viz_component("service") {
|
||||
|
||||
@@ -84,10 +84,10 @@ index 2648adb1cf38ab557b66ffd0e3034b26b04d76d6..98eab587f343f6ca472efc3d4e7b31b2
|
||||
private:
|
||||
const std::string service_interface_name_;
|
||||
diff --git a/content/browser/service_host/utility_process_host.cc b/content/browser/service_host/utility_process_host.cc
|
||||
index 2b635c27741e8202d439ab03bc0f517dd00568a2..a2cf280f1ae259a7f9d79d18edda21820a6103be 100644
|
||||
index 5fa25d07cddca53177e82e5cba1cc834a40994d0..75f43420e80752be98af3f35f5a4b82aa8f3e8a8 100644
|
||||
--- a/content/browser/service_host/utility_process_host.cc
|
||||
+++ b/content/browser/service_host/utility_process_host.cc
|
||||
@@ -623,7 +623,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) {
|
||||
@@ -635,7 +635,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) {
|
||||
: Client::CrashType::kPreIpcInitialization;
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
@@ -28,7 +28,7 @@ index 33e23680b927d417b0882c7572fe32dc2d2b90c3..9413492f8e0fd6c5371c66329e1ad6d4
|
||||
|
||||
// Returns the http referrer of original request which initited this load.
|
||||
diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h
|
||||
index f7812c9d0ed9f0295b960b2fef8fcc69defc3f68..3f0e349a46b7996858ae2dfd91e888d68f32340a 100644
|
||||
index 65e50de149ebc487eb10e0e1c1613ebc1b9005e8..020b0325d59907061319defc5ace6858a78be86f 100644
|
||||
--- a/third_party/blink/renderer/core/loader/document_loader.h
|
||||
+++ b/third_party/blink/renderer/core/loader/document_loader.h
|
||||
@@ -322,7 +322,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected<DocumentLoader>,
|
||||
|
||||
@@ -112,7 +112,7 @@ index 13a211107294e856616d1626fa1dc9c79eb5646c..549a36886d665c1a8100f09b7a86c8dc
|
||||
string mime_type;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 3d3df95fd2b6eb8c5eb978d3c28880d0237c186c..9a59fbca69d790931558fea040a93cb94a209cde 100644
|
||||
index 5878ca56c4aa364098cd813be2a397c377ad6416..e7e149875767cc146b1a46d27af4ef4a5d5eb41b 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -370,6 +370,9 @@ URLLoader::URLLoader(
|
||||
@@ -125,7 +125,7 @@ index 3d3df95fd2b6eb8c5eb978d3c28880d0237c186c..9a59fbca69d790931558fea040a93cb9
|
||||
devtools_request_id_(request.devtools_request_id),
|
||||
options_(PopulateOptions(options,
|
||||
factory_params_->is_orb_enabled,
|
||||
@@ -543,7 +546,7 @@ void URLLoader::SetUpUrlRequestCallbacks(
|
||||
@@ -562,7 +565,7 @@ void URLLoader::SetUpUrlRequestCallbacks(
|
||||
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ index 3d3df95fd2b6eb8c5eb978d3c28880d0237c186c..9a59fbca69d790931558fea040a93cb9
|
||||
url_request_->SetResponseHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
|
||||
}
|
||||
@@ -1132,6 +1135,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
@@ -1151,6 +1154,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
}
|
||||
|
||||
response_ = BuildResponseHead();
|
||||
|
||||
@@ -28,10 +28,10 @@ The patch should be removed in favor of either:
|
||||
Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
|
||||
index 24f3887d312dba39306a9e4fbd15d1e03c9eb560..8ca943f732e28ba3c8b4e59f73ea5bb3c29db1e9 100644
|
||||
index 3dd0679aa8bc2e86fecb07f92cb1385001684cd7..1fb2b5f777a98ec3da68b9915ce41869580ce5ac 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -11623,6 +11623,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() {
|
||||
@@ -11657,6 +11657,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() {
|
||||
target_rph_id);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ index 24f3887d312dba39306a9e4fbd15d1e03c9eb560..8ca943f732e28ba3c8b4e59f73ea5bb3
|
||||
// origin of |common_params.url| and/or |common_params.initiator_origin|.
|
||||
url::Origin resolved_origin = url::Origin::Resolve(
|
||||
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
index 724a294f596437c5f9fd14f4a5bc2ca8744c20cf..b511c58463cccb3bbaa32ba6ad7b7737a853630a 100644
|
||||
index d04e85a56a536ef119e041460603dda0d1122f3a..b3f860f282f666e395d1f006569bb2b66712d27e 100644
|
||||
--- a/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
@@ -2321,6 +2321,7 @@ Frame* DocumentLoader::CalculateOwnerFrame() {
|
||||
|
||||
@@ -83,10 +83,10 @@ index e8a525444092a20624616b280b99f9b218180410..c2c43e67cf671bbf2282fb5728860b5f
|
||||
|
||||
PictureInPictureOcclusionTracker*
|
||||
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
index 2e4bf0a29d47a27a2bd0feadd72faff21c697a40..06a8fc71db5f436cd19acc0a8fa98dd46dd90706 100644
|
||||
index 89083187a3b872eaba30f1075445d0709a1607b3..00c3913eb2b58db525599bfa38ba637d42fdc1f4 100644
|
||||
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
@@ -443,11 +443,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
|
||||
@@ -444,11 +444,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
|
||||
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
|
||||
@@ -87,10 +87,10 @@ index 75df43e3cd2721a92c90c18154d53d5c203e2465..ce42c75c8face36d21f53f44c0201ac4
|
||||
// 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 33740af4c29f65a91031be001a4e7a8eae8159ee..594b881495e840efb25abff04d1ac0e6516ec2d1 100644
|
||||
index 3649b08b774c2bc2d8b314f6a4d02a67444de305..aa42c0a3815cb28387ee57dcfe1fc30a7b6500f1 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -10199,7 +10199,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -10198,7 +10198,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -17,10 +17,10 @@ Revert "Reland "Port net::CookieCryptoDelegate to os_crypt async""
|
||||
This reverts commit f01b115c7e21a09cc762f65bf7fd9c6ea9d9d0f8.
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 587b492f828ccb3179f34102a99326c09dfb3306..7364814ecb4fd49e44db869b37655d5b4ea09306 100644
|
||||
index 464b75de67b41f3a947af2cb885e1aada0f5869d..0272712c00c1e59d79d83e4b610482c79addd52e 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -737,6 +737,8 @@ static_library("browser") {
|
||||
@@ -740,6 +740,8 @@ static_library("browser") {
|
||||
"net/chrome_report_sender.h",
|
||||
"net/convert_explicitly_allowed_network_ports_pref.cc",
|
||||
"net/convert_explicitly_allowed_network_ports_pref.h",
|
||||
@@ -192,10 +192,10 @@ index b862afe7663111a6cbd342d33723942770bb0490..9dc46cedb109cea63bf71aa43fc7a2b6
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
|
||||
index 2c6ab9af9f5eebaf68e4b78834b5ce7fdd31d000..04262d11bbf7cbf0d8ece06448df9606922f239b 100644
|
||||
index 0f49109d35e6af1416f402baaa1aed64311f0ace..cd669a8deae1687877a75a05fa9c4c7b52720246 100644
|
||||
--- a/chrome/browser/net/system_network_context_manager.cc
|
||||
+++ b/chrome/browser/net/system_network_context_manager.cc
|
||||
@@ -917,13 +917,8 @@ void SystemNetworkContextManager::DisableQuic() {
|
||||
@@ -919,13 +919,8 @@ void SystemNetworkContextManager::DisableQuic() {
|
||||
void SystemNetworkContextManager::
|
||||
AddCookieEncryptionManagerToNetworkContextParams(
|
||||
network::mojom::NetworkContextParams* network_context_params) {
|
||||
|
||||
@@ -11,10 +11,10 @@ This patch should be upstreamed as a conditional revert of the logic in desktop
|
||||
vs mobile runtimes. i.e. restore the old logic only on desktop platforms
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 569b04d7b3f7747b38a18ce41172899299c229d6..1e1869d6cba044ecc037c814cc741e67c29d7379 100644
|
||||
index 671e8054e7373be2ac5d67722a56149a72f47051..e344d188e4b250074acfa058782a76841b9295b8 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2164,9 +2164,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
|
||||
@@ -2168,9 +2168,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
|
||||
void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
|
||||
// The resize message (which may not happen immediately) will carry with it
|
||||
// the screen info as well as the new size (if the screen has changed scale
|
||||
|
||||
@@ -59,10 +59,10 @@ index cba373664bec3a32abad6fe0396bd67b53b7e67f..a54f1b3351efd2d8f324436f7f35cd43
|
||||
|
||||
#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 e2b4ad7cfbd5ce4dfa0ae7d4992ac6f0d2b916b7..aa454d1fabb0c1076dfae712c91696c0f2d3c894 100644
|
||||
index d39312542b93c4c5eaf4580c2a8d20290cf82a89..7505059ad085c6465598cd65756d11d4ef5b4aa1 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -3205,6 +3205,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3210,6 +3210,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -70,7 +70,7 @@ index e2b4ad7cfbd5ce4dfa0ae7d4992ac6f0d2b916b7..aa454d1fabb0c1076dfae712c91696c0
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_behavior) {
|
||||
@@ -3262,7 +3263,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3267,7 +3268,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
PausableScriptExecutor::CreateAndRun(
|
||||
script_state, std::move(script_sources), execute_script_policy,
|
||||
user_gesture, evaluation_timing, blocking_option, want_result_option,
|
||||
@@ -92,10 +92,10 @@ index c0e8a5798c9c6ec6273fcaf4f19bdcc74108efdc..d56938ac2d6b7a0927e52590ad2ed757
|
||||
mojom::blink::WantResultOption,
|
||||
mojom::blink::PromiseResultOption);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
|
||||
index f3ea156c7ea1f215476976bcea2438d04c59a63f..146d44491158c4b6d3f33d61a6f242e8d8d42faf 100644
|
||||
index b71dc96ea8311fb97855fb02a021e2b863d847e9..34fc2d61b1a5648f3e4c94a33b270424cfe5a56c 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
|
||||
@@ -981,6 +981,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
|
||||
@@ -985,6 +985,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
|
||||
std::move(callback).Run(value ? std::move(*value) : base::Value());
|
||||
},
|
||||
std::move(callback)),
|
||||
@@ -211,7 +211,7 @@ index f2c94689450f0333a144ccf82cf147c194896e6b..1c2e9fe36c297f7d614d9ca290e4d13c
|
||||
const mojom::blink::UserActivationOption user_activation_option_;
|
||||
const mojom::blink::LoadEventBlockingOption blocking_option_;
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
index d270f1c458a4003fc652eecd3f6ca231038be3d2..6dcbe1bc0e35d4e3d9830549ac1fcceab9b30558 100644
|
||||
index 6e7fd9f4350bd005c76d09585f15e3bbf5cb7282..6e29e0dfcca54fb6cc2782bc2683cb9e367434d3 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
@@ -296,6 +296,7 @@ void ExecuteScriptsInMainWorld(
|
||||
@@ -223,7 +223,7 @@ index d270f1c458a4003fc652eecd3f6ca231038be3d2..6dcbe1bc0e35d4e3d9830549ac1fccea
|
||||
mojom::blink::WantResultOption::kWantResult, wait_for_promise);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index a030f42836966a384ea1a0452bac139cf214d171..bbf8b9a169c292e991f5b862ba1ac3351482ce45 100644
|
||||
index c02518e1a9e9e1df77a845565024377755b9b426..a930aed6968d3e1d8456362f74fe41ed657e4e55 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -1128,14 +1128,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
|
||||
@@ -245,7 +245,7 @@ index a030f42836966a384ea1a0452bac139cf214d171..bbf8b9a169c292e991f5b862ba1ac335
|
||||
|
||||
bool WebLocalFrameImpl::IsInspectorConnected() {
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
index ae5f77718fbb61161d63d3fd4f170368adabaa9f..3e1e95758fe85a4b8337ed8003e9021bce645b81 100644
|
||||
index ff86222c697ebc54fbd1395968a47f25abc34350..e07e58592aca750149a15d36161b5440eeb0c9b6 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
@@ -199,6 +199,7 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
|
||||
@@ -20,10 +20,10 @@ index 581d86c4ec4f437d7195c003d8776795f59cf696..632d2645d4ed3a8e83070f08320b2252
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index d97d2e328de91be93ca1fc542ad1d8c8131285d1..185e0c86bc02a80121af3c213aa496ca62565c31 100644
|
||||
index ef0171853547a4172f2bd933abb043963923390b..862552caa208fe1b5fa8453c71aaad4aad8842f0 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -349,6 +349,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -350,6 +350,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
virtual ~ContentBrowserClient() = default;
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ index 3909e70dc1425c2cb02624f4b3017784a2ae6c9d..a57b92f02085d6392e6d9d0cc037df6b
|
||||
// Returns whether `Initialize` has already been invoked in the process.
|
||||
// Initialization is a one-way operation (i.e., this method cannot return
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 83317535261d581edba6c8722e1013d2aa7e91d7..41a25b402f330fcb84e4cca1365d3f72090e518d 100644
|
||||
index e11231ebfedd7421f104d5f471486ad8d8d6ecbb..3b0e038918a175c70beb91e0c5d816aed2e6f181 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -531,7 +531,8 @@ void SetFeatureFlags() {
|
||||
@@ -526,7 +526,8 @@ void SetFeatureFlags() {
|
||||
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
const std::string& js_command_line_flags,
|
||||
bool disallow_v8_feature_flag_overrides,
|
||||
@@ -54,7 +54,7 @@ index 83317535261d581edba6c8722e1013d2aa7e91d7..41a25b402f330fcb84e4cca1365d3f72
|
||||
static bool v8_is_initialized = false;
|
||||
if (v8_is_initialized)
|
||||
return;
|
||||
@@ -546,7 +547,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
@@ -541,7 +542,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
}
|
||||
SetFlags(mode, js_command_line_flags);
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to
|
||||
system priority.
|
||||
|
||||
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
||||
index d97f936a5c26dcf6b39c8ed50630f183d5083d5d..0719808270ddce00c8dd324eff72675278ae7aa7 100644
|
||||
index d68e37353cb4c5037b080f9a23dc252bbba2db4a..7b101305f8986cb5d1e8c0ac60f48ddc6fccf8eb 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1082,6 +1082,7 @@ component("base") {
|
||||
@@ -1081,6 +1081,7 @@ component("base") {
|
||||
"//build:ios_buildflags",
|
||||
"//build/config/compiler:compiler_buildflags",
|
||||
"//third_party/modp_b64",
|
||||
@@ -505,7 +505,7 @@ index 020050de162705651b4eb8378880cd4eb017d46c..2d3554861a570271d6f9b9a2c8b1de53
|
||||
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
|
||||
// can only be accomplished by overriding methods.
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
index a474e70cf3c10405b6f94f129f5a7312bb81fd73..00f6719bd80c8fdf31f910af3b93b5c6b192912c 100644
|
||||
index 3c7bfe98848cbb3a309737b84ff1c8d683a83ec7..84036a1c4635e7b5bca5ebe1ea5e303bd07b2ea0 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -646,7 +646,7 @@ index a474e70cf3c10405b6f94f129f5a7312bb81fd73..00f6719bd80c8fdf31f910af3b93b5c6
|
||||
}
|
||||
|
||||
// On newer SDKs, _canMiniaturize respects NSWindowStyleMaskMiniaturizable in
|
||||
@@ -932,6 +955,7 @@ - (void)maybeRemoveTreeFromOrderingGroups {
|
||||
@@ -944,6 +967,7 @@ - (void)maybeRemoveTreeFromOrderingGroups {
|
||||
// Since _removeFromGroups: is not documented it could go away in newer
|
||||
// versions of macOS. If the selector does not exist, DumpWithoutCrashing() so
|
||||
// we hear about the change.
|
||||
@@ -654,7 +654,7 @@ index a474e70cf3c10405b6f94f129f5a7312bb81fd73..00f6719bd80c8fdf31f910af3b93b5c6
|
||||
if (![NSWindow instancesRespondToSelector:@selector(_removeFromGroups:)]) {
|
||||
base::debug::DumpWithoutCrashing();
|
||||
return;
|
||||
@@ -949,6 +973,7 @@ - (void)maybeRemoveTreeFromOrderingGroups {
|
||||
@@ -961,6 +985,7 @@ - (void)maybeRemoveTreeFromOrderingGroups {
|
||||
[currentWindow _removeFromGroups:child];
|
||||
}
|
||||
}
|
||||
@@ -688,7 +688,7 @@ index 414874d84338ff12e707d52bc82483957d74d8ef..849da439a046aea133946572c7996485
|
||||
// Beware: This view was briefly removed (in favor of a bare CALayer) in
|
||||
// https://crrev.com/c/1236675. The ordering of unassociated layers relative
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 42eb89bca0a2ea0785d21b6a72e5ece3d5859c21..b3499d99f684b0463c07656633447b7c7dcdd7bb 100644
|
||||
index 3c60e4e519f36a098704d744e3659ad0b8083157..123118d66734295f7b00e807aa0437ac76ab3f57 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -389,6 +389,7 @@ viz_component("service") {
|
||||
@@ -793,7 +793,7 @@ index 712d59e1f7d9681c122e6d05a8b65bccbfacb492..de24209bbd3cd4a530c6f32990a0f93a
|
||||
return kAttributes;
|
||||
}
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 93ee33b10227da37b9404865df15eae16de2f9a9..5bb4a91572634a5ec296b0ec704b331cec319540 100644
|
||||
index 58c529557527b8e3914a235a82d2d475e71d6315..23ae9220812480274d0347009d38343fc005ea6f 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -344,6 +344,7 @@ source_set("browser") {
|
||||
@@ -926,10 +926,10 @@ index 605f250c1f94e4b12a6790bd9fb4623d1f1a9d45..d5cf3b48e1b35527ec69b49e375710cc
|
||||
|
||||
defines = []
|
||||
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
|
||||
index dc4ac3b6aa8d57ea8dd5357d3865c4d418942f87..5aaa899b8c92b473d3c6cf5d24da34ed74285ec1 100644
|
||||
index 8445214b66242eb53b2546a16078cc3d26cbdb99..8751ca6aba9caecec4d65f0059fb1b632c74ec61 100644
|
||||
--- a/content/renderer/BUILD.gn
|
||||
+++ b/content/renderer/BUILD.gn
|
||||
@@ -325,6 +325,7 @@ target(link_target_type, "renderer") {
|
||||
@@ -324,6 +324,7 @@ target(link_target_type, "renderer") {
|
||||
"//ui/strings:auto_image_annotation_strings_grit",
|
||||
"//url",
|
||||
"//v8",
|
||||
@@ -1008,10 +1008,10 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
index 9e0752536c531454b08cd0473958dbda4c3338cc..ed15bfd6bbfca8ed420115e42d3b0988aed15d65 100644
|
||||
index bb457cce37fa5eba33948a25d697882d44b9d81c..53511f295e7b4cef4b4a841b9293fb164f72f780 100644
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -701,6 +701,7 @@ static_library("test_support") {
|
||||
@@ -702,6 +702,7 @@ static_library("test_support") {
|
||||
"//url",
|
||||
"//url/mojom:url_mojom_gurl",
|
||||
"//v8",
|
||||
@@ -1019,7 +1019,7 @@ index 9e0752536c531454b08cd0473958dbda4c3338cc..ed15bfd6bbfca8ed420115e42d3b0988
|
||||
]
|
||||
|
||||
data_deps = [
|
||||
@@ -1176,6 +1177,8 @@ static_library("browsertest_support") {
|
||||
@@ -1177,6 +1178,8 @@ static_library("browsertest_support") {
|
||||
# TODO(crbug.com/40031409): Fix code that adds exit-time destructors and
|
||||
# enable the diagnostic by removing this line.
|
||||
configs += [ "//build/config/compiler:no_exit_time_destructors" ]
|
||||
@@ -1028,7 +1028,7 @@ index 9e0752536c531454b08cd0473958dbda4c3338cc..ed15bfd6bbfca8ed420115e42d3b0988
|
||||
}
|
||||
|
||||
mojom("content_test_mojo_bindings") {
|
||||
@@ -2063,6 +2066,7 @@ test("content_browsertests") {
|
||||
@@ -2066,6 +2069,7 @@ test("content_browsertests") {
|
||||
"//ui/shell_dialogs",
|
||||
"//ui/snapshot",
|
||||
"//ui/webui:test_support",
|
||||
@@ -1036,7 +1036,7 @@ index 9e0752536c531454b08cd0473958dbda4c3338cc..ed15bfd6bbfca8ed420115e42d3b0988
|
||||
]
|
||||
|
||||
if (!(is_chromeos && target_cpu == "arm64" && current_cpu == "arm")) {
|
||||
@@ -3406,6 +3410,7 @@ test("content_unittests") {
|
||||
@@ -3410,6 +3414,7 @@ test("content_unittests") {
|
||||
"//ui/shell_dialogs",
|
||||
"//ui/webui:test_support",
|
||||
"//url",
|
||||
@@ -1161,10 +1161,10 @@ index 9388ffac4f70746b04e533b51faf4f2d55ab3358..98f45dc973159b5823d8a0433dfd4bc6
|
||||
|
||||
if (is_ios) {
|
||||
diff --git a/media/audio/apple/audio_low_latency_input.cc b/media/audio/apple/audio_low_latency_input.cc
|
||||
index 686c7e9b126260720424cd72d91a3f27002c5af8..e181ff1b909d928a3aa3a913a267d01f0fd647ec 100644
|
||||
index 1caead59d7cf767f14e4c4d26054511016a38bc3..8154e0447cc5f6c80d9f9af9c1e65f515b557102 100644
|
||||
--- a/media/audio/apple/audio_low_latency_input.cc
|
||||
+++ b/media/audio/apple/audio_low_latency_input.cc
|
||||
@@ -29,6 +29,7 @@
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
@@ -1172,7 +1172,7 @@ index 686c7e9b126260720424cd72d91a3f27002c5af8..e181ff1b909d928a3aa3a913a267d01f
|
||||
#include "media/audio/apple/audio_manager_apple.h"
|
||||
#include "media/audio/apple/scoped_audio_unit.h"
|
||||
#include "media/base/audio_bus.h"
|
||||
@@ -42,19 +43,23 @@
|
||||
@@ -43,19 +44,23 @@
|
||||
|
||||
namespace {
|
||||
extern "C" {
|
||||
|
||||
@@ -92,7 +92,7 @@ index 8ccff8edf6c45a96978fea0b02a8d7ebd8768578..264af7461226718ff300faa22ba45875
|
||||
contents_.get()->GetPrimaryMainFrame()->GetWeakDocumentPtr(),
|
||||
RenderProcessHost::NotificationServiceCreatorType::kDocument,
|
||||
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
index 2c9e6225d0085c67dc1ae51cca2614b2c74120a7..ad194578a06e74488a853cb8f3f042fd339eefea 100644
|
||||
index b433a6bb12880e26068cff3e542b9a45576292ba..85e2db609f92fefda0f293f74d9e9fd48f4cb686 100644
|
||||
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
||||
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
@@ -286,6 +286,7 @@ void PlatformNotificationContextImpl::Shutdown() {
|
||||
@@ -133,10 +133,10 @@ index 9bf238e64af483294ae3c3f18a4e9aed49a8658d..b9b2a4c8c387b8e8b4eb1f02fc0f891c
|
||||
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 3ecc3180b816116659a6d76ea21817971c69afe2..713dcec09c194d1f648811a50a28746418bb16a6 100644
|
||||
index 9308ef3abab38292865a9f2ccc5abfe7e47d70d3..430c191b8d282b63aa5a04207da28660f203d910 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2364,7 +2364,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2354,7 +2354,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
@@ -145,7 +145,7 @@ index 3ecc3180b816116659a6d76ea21817971c69afe2..713dcec09c194d1f648811a50a287464
|
||||
creator_type, std::move(receiver));
|
||||
break;
|
||||
}
|
||||
@@ -2372,7 +2372,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2362,7 +2362,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
CHECK(rfh);
|
||||
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
|
||||
@@ -35,11 +35,11 @@ index f0495805b90386588abaec45ff39c33753efe6f5..b14a585aba0d75f59a980bc6c045ea4d
|
||||
|
||||
Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture;
|
||||
|
||||
diff --git a/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc b/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
|
||||
index 18db1791d2ea8ca975b19c1dd6b6716222714b82..7befad5fa30d037227c1955544f19fbb5756f83d 100644
|
||||
--- a/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
|
||||
+++ b/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc
|
||||
@@ -209,6 +209,23 @@ bool FrameResources::Initialize(VideoPixelFormat format,
|
||||
diff --git a/media/video/renderable_mappable_shared_image_video_frame_pool.cc b/media/video/renderable_mappable_shared_image_video_frame_pool.cc
|
||||
index 36ed797edc58a6cf094a0b720bf949b3f6379890..950b839a67fc190f9c0d73bcc102b547178216bb 100644
|
||||
--- a/media/video/renderable_mappable_shared_image_video_frame_pool.cc
|
||||
+++ b/media/video/renderable_mappable_shared_image_video_frame_pool.cc
|
||||
@@ -211,6 +211,23 @@ bool FrameResources::Initialize(VideoPixelFormat format,
|
||||
const gfx::Size coded_size =
|
||||
GetCodedSizeForVideoPixelFormat(format, visible_size_);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ index a7a637438116a1c7846194dea4412100a45c9331..bb3877d546bfea141d3d6ebb396b88fa
|
||||
ui::ImageModel::FromVectorIcon(*icon, kColorPipWindowForeground,
|
||||
kCloseButtonIconSize));
|
||||
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff21c697a40 100644
|
||||
index 315bbdb102329f38da986fbe3fd1a964b27a8ea4..89083187a3b872eaba30f1075445d0709a1607b3 100644
|
||||
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
@@ -18,12 +18,16 @@
|
||||
@@ -69,7 +69,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
#include "chrome/browser/ui/views/overlay/playback_image_button.h"
|
||||
#include "chrome/browser/ui/views/overlay/resize_handle_button.h"
|
||||
#include "chrome/browser/ui/views/overlay/simple_overlay_window_image_button.h"
|
||||
@@ -79,7 +85,7 @@
|
||||
@@ -80,7 +86,7 @@
|
||||
#include "ui/aura/window.h"
|
||||
#endif
|
||||
|
||||
@@ -78,7 +78,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
#include "chrome/browser/shell_integration_win.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "ui/aura/window.h"
|
||||
@@ -401,7 +407,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
|
||||
@@ -402,7 +408,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
|
||||
overlay_window->Init(std::move(params));
|
||||
overlay_window->OnRootViewReady();
|
||||
|
||||
@@ -87,7 +87,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
std::wstring app_user_model_id;
|
||||
Browser* browser = chrome::FindBrowserWithTab(controller->GetWebContents());
|
||||
if (browser) {
|
||||
@@ -694,6 +700,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
|
||||
@@ -695,6 +701,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
|
||||
}
|
||||
|
||||
case ui::EventType::kMousePressed:
|
||||
@@ -95,7 +95,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
// Hide the live caption dialog if it's visible and the user clicks
|
||||
// outside of it.
|
||||
if (live_caption_dialog_ && live_caption_dialog_->GetVisible() &&
|
||||
@@ -702,6 +709,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
|
||||
@@ -703,6 +710,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
|
||||
SetLiveCaptionDialogVisibility(false);
|
||||
return;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -737,11 +745,11 @@ bool VideoOverlayWindowViews::HideLiveCaptionDialogForGestureIfNecessary(
|
||||
@@ -738,11 +746,11 @@ bool VideoOverlayWindowViews::HideLiveCaptionDialogForGestureIfNecessary(
|
||||
if (event->type() != ui::EventType::kGestureTap) {
|
||||
return false;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
if (!GetLiveCaptionDialogBounds().Contains(event->location())) {
|
||||
SetLiveCaptionDialogVisibility(false);
|
||||
event->SetHandled();
|
||||
@@ -1221,6 +1229,7 @@ void VideoOverlayWindowViews::SetUpViews() {
|
||||
@@ -1222,6 +1230,7 @@ void VideoOverlayWindowViews::SetUpViews() {
|
||||
timestamp->SetBackgroundColor(SK_ColorTRANSPARENT);
|
||||
timestamp->SetHorizontalAlignment(gfx::ALIGN_LEFT);
|
||||
|
||||
@@ -125,7 +125,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
auto live_status = std::make_unique<views::Label>(
|
||||
l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_LIVE_STATUS_TEXT),
|
||||
views::style::CONTEXT_LABEL, views::style::STYLE_CAPTION_BOLD);
|
||||
@@ -1240,6 +1249,7 @@ void VideoOverlayWindowViews::SetUpViews() {
|
||||
@@ -1241,6 +1250,7 @@ void VideoOverlayWindowViews::SetUpViews() {
|
||||
Profile::FromBrowserContext(
|
||||
controller_->GetWebContents()->GetBrowserContext()));
|
||||
live_caption_dialog->SetVisible(false);
|
||||
@@ -133,7 +133,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
|
||||
auto toggle_microphone_button =
|
||||
std::make_unique<ToggleMicrophoneButton>(base::BindRepeating(
|
||||
@@ -1362,13 +1372,15 @@ void VideoOverlayWindowViews::SetUpViews() {
|
||||
@@ -1363,13 +1373,15 @@ void VideoOverlayWindowViews::SetUpViews() {
|
||||
|
||||
timestamp_ =
|
||||
playback_controls_container_view_->AddChildView(std::move(timestamp));
|
||||
@@ -150,7 +150,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
|
||||
toggle_camera_button_ = vc_controls_container_view_->AddChildView(
|
||||
std::move(toggle_camera_button));
|
||||
@@ -1647,6 +1659,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
@@ -1648,6 +1660,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
timestamp_->SetSize({max_timestamp_width, kTimestampHeight});
|
||||
timestamp_->SetVisible(!is_live_);
|
||||
|
||||
@@ -158,7 +158,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
live_status_->SetPosition(timestamp_position);
|
||||
live_status_->SetMaximumWidthSingleLine(max_timestamp_width);
|
||||
live_status_->SetSize(
|
||||
@@ -1654,7 +1667,6 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
@@ -1655,7 +1668,6 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
.width(),
|
||||
kTimestampHeight});
|
||||
live_status_->SetVisible(is_live_);
|
||||
@@ -166,7 +166,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
gfx::Rect live_caption_button_bounds(
|
||||
bottom_controls_bounds.right() - kBottomControlsHorizontalMargin -
|
||||
kActionButtonSize.width(),
|
||||
@@ -1667,7 +1679,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
@@ -1668,7 +1680,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
live_caption_dialog_->SetPosition(
|
||||
{live_caption_button_bounds.right() - live_caption_dialog_->width(),
|
||||
live_caption_button_bounds.y() - live_caption_dialog_->height()});
|
||||
@@ -175,7 +175,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
// The play/pause button and replay/forward 10 seconds buttons should not be
|
||||
// visible while dragging the progress bar or for live media.
|
||||
const bool is_dragging_progress_bar =
|
||||
@@ -2066,18 +2078,25 @@ gfx::Rect VideoOverlayWindowViews::GetProgressViewBounds() {
|
||||
@@ -2067,18 +2079,25 @@ gfx::Rect VideoOverlayWindowViews::GetProgressViewBounds() {
|
||||
}
|
||||
|
||||
gfx::Rect VideoOverlayWindowViews::GetLiveCaptionButtonBounds() {
|
||||
@@ -201,7 +201,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
MediaEngagementService* service =
|
||||
MediaEngagementService::Get(Profile::FromBrowserContext(
|
||||
GetController()->GetWebContents()->GetBrowserContext()));
|
||||
@@ -2086,6 +2105,8 @@ bool VideoOverlayWindowViews::HasHighMediaEngagement(
|
||||
@@ -2087,6 +2106,8 @@ bool VideoOverlayWindowViews::HasHighMediaEngagement(
|
||||
}
|
||||
|
||||
return service->HasHighEngagement(origin);
|
||||
@@ -210,7 +210,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
}
|
||||
|
||||
bool VideoOverlayWindowViews::IsTrustedForMediaPlayback() const {
|
||||
@@ -2347,11 +2368,14 @@ void VideoOverlayWindowViews::UpdateTimestampLabel(base::TimeDelta current_time,
|
||||
@@ -2348,11 +2369,14 @@ void VideoOverlayWindowViews::UpdateTimestampLabel(base::TimeDelta current_time,
|
||||
}
|
||||
|
||||
void VideoOverlayWindowViews::OnLiveCaptionButtonPressed() {
|
||||
@@ -225,7 +225,7 @@ index 8ccc5385ede42f3dd771c9fe143cf630ae0709f1..2e4bf0a29d47a27a2bd0feadd72faff2
|
||||
if (wanted_visibility == live_caption_dialog_->GetVisible()) {
|
||||
return;
|
||||
}
|
||||
@@ -2374,6 +2398,7 @@ void VideoOverlayWindowViews::SetLiveCaptionDialogVisibility(
|
||||
@@ -2375,6 +2399,7 @@ void VideoOverlayWindowViews::SetLiveCaptionDialogVisibility(
|
||||
for (auto* control : controls_to_be_disabled_when_live_caption_is_open) {
|
||||
control->SetEnabled(!wanted_visibility);
|
||||
}
|
||||
|
||||
@@ -666,7 +666,7 @@ index ac2f719be566020d9f41364560c12e6d6d0fe3d8..16d758a6936f66148a196761cfb875f6
|
||||
PrintingFailed(int32 cookie, PrintFailureReason reason);
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860ea202577 100644
|
||||
index 1750c48c5dcff0ec3f45497a0949bdefe01bc730..73ac20c027c44fa0e1d5df94ce050ebb992c10e9 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -54,6 +54,7 @@
|
||||
@@ -677,7 +677,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
#include "printing/units.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
@@ -1250,14 +1251,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1255,14 +1256,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
}
|
||||
|
||||
print_in_progress_ = true;
|
||||
@@ -694,7 +694,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
if (!weak_this) {
|
||||
return;
|
||||
}
|
||||
@@ -1288,12 +1289,14 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1293,12 +1294,14 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) {
|
||||
return;
|
||||
@@ -1310,9 +1313,10 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal(
|
||||
@@ -1315,9 +1318,10 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal(
|
||||
|
||||
is_loading_ = frame->WillPrintSoon();
|
||||
if (is_loading_) {
|
||||
@@ -726,7 +726,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
SetupOnStopLoadingTimeout();
|
||||
return;
|
||||
}
|
||||
@@ -1322,7 +1326,7 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal(
|
||||
@@ -1327,7 +1331,7 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal(
|
||||
// plugin node and print that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
|
||||
@@ -735,7 +735,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
|
||||
if (render_frame_gone_) {
|
||||
return;
|
||||
@@ -1478,6 +1482,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
@@ -1483,6 +1487,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
|
||||
@@ -744,7 +744,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -2090,17 +2096,25 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2095,17 +2101,25 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -773,7 +773,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
DidFinishPrinting(PrintingResult::kFailPrintInit);
|
||||
return;
|
||||
}
|
||||
@@ -2121,8 +2135,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -2126,8 +2140,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -790,7 +790,7 @@ index 6be0daa9a4f710270c9e11e2b5edd4027c779e0d..536ea348aa9f7407f9941aa0f15ff860
|
||||
// Check if `this` is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2389,29 +2410,43 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2394,29 +2415,43 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
}
|
||||
|
||||
bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
|
||||
|
||||
@@ -30,10 +30,10 @@ index 9fce41c59c6878e0a29b831d76fcb53dcf86dcd5..2cff43e9fc4374ae48d87dd048a295a0
|
||||
// RenderWidgetHost on the primary main frame, and false otherwise.
|
||||
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 5a71b4e88c22517c5ad296213b3bfefde06115cb..569b04d7b3f7747b38a18ce41172899299c229d6 100644
|
||||
index b092a09cada3f289cb13ed4352b6da8cb7ff154a..671e8054e7373be2ac5d67722a56149a72f47051 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2078,6 +2078,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
|
||||
@@ -2079,6 +2079,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
|
||||
if (view_) {
|
||||
view_->UpdateCursor(cursor);
|
||||
}
|
||||
@@ -44,10 +44,10 @@ index 5a71b4e88c22517c5ad296213b3bfefde06115cb..569b04d7b3f7747b38a18ce411728992
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 2ba679ac7064a53935fb90bf94a2d83c407c1ac2..00a2dd44a8eaf655b21b5fc98d701f150b4ac3e6 100644
|
||||
index 2138c00b6e732dc826df07ac66fd7f8e62fffd0c..76855246e19933850dc5b79c65c816a2690dd229 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -6160,6 +6160,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -6155,6 +6155,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ index 2ba679ac7064a53935fb90bf94a2d83c407c1ac2..00a2dd44a8eaf655b21b5fc98d701f15
|
||||
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 34639e614ac3e34828d6bacdf96be049041972af..4845fcd9286daabcf8cbf404439ab54a6c631193 100644
|
||||
index 431f13cba0469765bdfbda01db95f51efe6bb991..2ab758b93a06133c057da2a31709ef2e0b5f90b2 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1194,6 +1194,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
@@ -1192,6 +1192,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
void SendScreenRects() override;
|
||||
void SendActiveState(bool active) override;
|
||||
TextInputManager* GetTextInputManager() override;
|
||||
|
||||
@@ -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 fd4226d84464cd8353b64ec984c97d26f0a98c96..fe8e407fcc7e31107d7f9f1d3ba1b37b241f0932 100644
|
||||
index fc5c7782035bb4d0b9d673cb125062f47cd98a14..6e1738a8a0e63d1e3dbabf29ee4d034e124a3dd2 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -10361,25 +10361,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
@@ -10360,25 +10360,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
base::RepeatingClosure hang_monitor_restarter) {
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
|
||||
"render_widget_host", render_widget_host);
|
||||
|
||||
@@ -39,10 +39,10 @@ index 2cff43e9fc4374ae48d87dd048a295a00e5575e4..9cb5baccaa083a8030d4d0d57dc00040
|
||||
// event before sending it to the renderer. See enum for details on return
|
||||
// value.
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 1e1869d6cba044ecc037c814cc741e67c29d7379..6f2b93b3fd6763b8594fc82c5d565e31bae578fb 100644
|
||||
index e344d188e4b250074acfa058782a76841b9295b8..3b4dc6615e68254bf2fabf2887a0c21af81d50b1 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -1592,6 +1592,10 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
|
||||
@@ -1593,6 +1593,10 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
|
||||
CHECK_GE(mouse_event.GetType(), WebInputEvent::Type::kMouseTypeFirst);
|
||||
CHECK_LE(mouse_event.GetType(), WebInputEvent::Type::kMouseTypeLast);
|
||||
|
||||
@@ -54,10 +54,10 @@ index 1e1869d6cba044ecc037c814cc741e67c29d7379..6f2b93b3fd6763b8594fc82c5d565e31
|
||||
if (mouse_event_callback.Run(mouse_event)) {
|
||||
return;
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index fe8e407fcc7e31107d7f9f1d3ba1b37b241f0932..44377d64101ecca88ef450744239d8e1ff8c1b16 100644
|
||||
index 6e1738a8a0e63d1e3dbabf29ee4d034e124a3dd2..033ae3771b30d5475de5c20838aa9686255d9988 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4478,6 +4478,12 @@ void WebContentsImpl::RenderWidgetWasResized(
|
||||
@@ -4463,6 +4463,12 @@ void WebContentsImpl::RenderWidgetWasResized(
|
||||
width_changed);
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ index fe8e407fcc7e31107d7f9f1d3ba1b37b241f0932..44377d64101ecca88ef450744239d8e1
|
||||
const gfx::PointF& client_pt) {
|
||||
if (delegate_) {
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
|
||||
index 4845fcd9286daabcf8cbf404439ab54a6c631193..383d6884871b0d2fed35891cce00a8447c632785 100644
|
||||
index 2ab758b93a06133c057da2a31709ef2e0b5f90b2..ec8e60e2fbfa41791d4b3d8f484a4dce3252fa8a 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1124,6 +1124,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
@@ -1122,6 +1122,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
|
||||
double GetPendingZoomLevel(RenderWidgetHostImpl* rwh) override;
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ on Windows. We should refactor our code so that this patch isn't
|
||||
necessary.
|
||||
|
||||
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
|
||||
index 57a355cecfce2db904dde6c9acfff52c8f1b0253..e8e4a07f9db1a5fd95fa647972e328770c7064ee 100644
|
||||
index 00882bfa1977eb6306c5ca75bb576d2717d8f24d..60cc87850bf7c3f89f5b6f8be53cbcf124beca73 100644
|
||||
--- a/testing/variations/fieldtrial_testing_config.json
|
||||
+++ b/testing/variations/fieldtrial_testing_config.json
|
||||
@@ -26155,6 +26155,21 @@
|
||||
@@ -26116,6 +26116,21 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
|
||||
Patch to make scrollBounce option work.
|
||||
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
index 816c1f06fe475873f10a270a05ea52f12020e971..73bcb6cf18f488f0d5dd8bd526c3df34c78e4abf 100644
|
||||
index 2c2a3443d6c9dd16849b15160ae97ea6ae1ff6a2..f8a411eda4df00e6f27ed64fa72eb649a72afdce 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1154,11 +1154,11 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
@@ -1130,11 +1130,11 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
}
|
||||
|
||||
bool RenderThreadImpl::IsElasticOverscrollEnabledOnRoot() {
|
||||
|
||||
@@ -22,7 +22,7 @@ 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 713dcec09c194d1f648811a50a28746418bb16a6..7dedc2302f7bac673222fbb5b6c036b29ad54dad 100644
|
||||
index 430c191b8d282b63aa5a04207da28660f203d910..78685aedc7b246b01714eccb94af6045e19466fd 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1936,6 +1936,10 @@ bool RenderProcessHostImpl::Init() {
|
||||
|
||||
@@ -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 43ef8b669fd4bca119a4181ef99d8f8cb79947d0..0697b662719566fabd84dff7e5dd76804bbe3e34 100644
|
||||
index a6197d7c8ec5e1c27c74372e478b87aadd7ba7a7..b882687c609de03c4df43439691a1214cb8536e1 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4195,6 +4195,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -4180,6 +4180,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 43ef8b669fd4bca119a4181ef99d8f8cb79947d0..0697b662719566fabd84dff7e5dd7680
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -4205,6 +4212,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -4190,6 +4197,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ index 43ef8b669fd4bca119a4181ef99d8f8cb79947d0..0697b662719566fabd84dff7e5dd7680
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index e1db3dcee66e216b7c8869943dd14cc8b805ab82..e9558fad21ce9f573e1dcf1fc27643dfcc26d664 100644
|
||||
index 8c313b2e33e7f40ac30a3c3160e734e8bddaf73a..bbcdd8dfc12a3cdefbf4957c86cbc5b19be74f33 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -129,11 +129,14 @@ class PrerenderHandle;
|
||||
|
||||
@@ -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 bb3b1d7cd446d25f1e9d90b92f0fed8c841973c4..c6185443d3c8d15eb3a0de98555aeb8b8b39470d 100644
|
||||
index 528b2ef70453b904c630fd657e8dffff8c7c642d..80b57dbb3c79bc4333a87325d877223dcd7c7581 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9029,6 +9029,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -9087,6 +9087,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index bb3b1d7cd446d25f1e9d90b92f0fed8c841973c4..c6185443d3c8d15eb3a0de98555aeb8b
|
||||
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 0697b662719566fabd84dff7e5dd76804bbe3e34..33740af4c29f65a91031be001a4e7a8eae8159ee 100644
|
||||
index b882687c609de03c4df43439691a1214cb8536e1..3649b08b774c2bc2d8b314f6a4d02a67444de305 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4495,21 +4495,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -4480,21 +4480,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
const input::NativeWebKeyboardEvent& event) {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::PreHandleKeyboardEvent");
|
||||
@@ -80,7 +80,7 @@ index 0697b662719566fabd84dff7e5dd76804bbe3e34..33740af4c29f65a91031be001a4e7a8e
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -4668,7 +4672,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -4663,7 +4667,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
|
||||
patching legacy devtools code.
|
||||
|
||||
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
|
||||
index 39d7757f9199584bae3d04934b8d0108fcd6cd76..034e68cce73b7bd63b10ac00e309dbf61ffce957 100644
|
||||
index da118ebfb1779de981d2eb30f2054fbd0799d9fe..a0f960b24c5f5d111ce5bafe0659ad3d87911975 100644
|
||||
--- a/front_end/entrypoints/main/MainImpl.ts
|
||||
+++ b/front_end/entrypoints/main/MainImpl.ts
|
||||
@@ -775,6 +775,8 @@ export class MainImpl {
|
||||
@@ -786,6 +786,8 @@ export class MainImpl {
|
||||
globalThis.Main = globalThis.Main || {};
|
||||
// @ts-expect-error Exported for Tests.js
|
||||
globalThis.Main.Main = MainImpl;
|
||||
|
||||
@@ -10,18 +10,6 @@ This should be upstreamed in some form, though it may need to be tweaked
|
||||
before it's acceptable to upstream, as this patch comments out a couple
|
||||
of tests that upstream probably cares about.
|
||||
|
||||
diff --git a/test/fixtures/crypto/rsa_pss.js b/test/fixtures/crypto/rsa_pss.js
|
||||
index 423f2c4d77bfc98bfbdab93c09aff8012c678cbd..fa0bcceb5697486930a9530732f9a9ab6e1bb5b0 100644
|
||||
--- a/test/fixtures/crypto/rsa_pss.js
|
||||
+++ b/test/fixtures/crypto/rsa_pss.js
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
-module.exports = function() {
|
||||
+module.exports = function () {
|
||||
const pkcs8 = Buffer.from(
|
||||
'308204bf020100300d06092a864886f70d0101010500048204a9308204a5020100028' +
|
||||
'2010100d3576092e62957364544e7e4233b7bdb293db2085122c479328546f9f0f712' +
|
||||
diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js
|
||||
index 9876c4bb6ecd2e5b8879f153811cd0a0a22997aa..2c4bf03452eb10fec52c38a361b6aad93169f08d 100644
|
||||
--- a/test/parallel/test-crypto-async-sign-verify.js
|
||||
@@ -53,6 +41,102 @@ index 9876c4bb6ecd2e5b8879f153811cd0a0a22997aa..2c4bf03452eb10fec52c38a361b6aad9
|
||||
|
||||
// Test Parallel Execution w/ KeyObject is threadsafe in openssl3
|
||||
{
|
||||
diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js
|
||||
index e8fedf2d5d5072e00afd493ac2ac44748212b02e..6fcbe244871d25b2151d39160149aaa50dc96012 100644
|
||||
--- a/test/parallel/test-crypto-authenticated.js
|
||||
+++ b/test/parallel/test-crypto-authenticated.js
|
||||
@@ -627,21 +627,25 @@ for (const test of TEST_CASES) {
|
||||
{
|
||||
// CCM cipher without data should not crash, see https://github.com/nodejs/node/issues/38035.
|
||||
const algo = 'aes-128-ccm';
|
||||
- const key = Buffer.alloc(16);
|
||||
- const iv = Buffer.alloc(12);
|
||||
- const opts = { authTagLength: 10 };
|
||||
+ if (!ciphers.includes(algo)) {
|
||||
+ common.printSkipMessage(`unsupported ${algo} test`);
|
||||
+ } else {
|
||||
+ const key = Buffer.alloc(16);
|
||||
+ const iv = Buffer.alloc(12);
|
||||
+ const opts = { authTagLength: 10 };
|
||||
|
||||
- const cipher = crypto.createCipheriv(algo, key, iv, opts);
|
||||
- assert.throws(() => {
|
||||
- cipher.final();
|
||||
- }, hasOpenSSL3 ? {
|
||||
- code: 'ERR_OSSL_TAG_NOT_SET'
|
||||
- } : {
|
||||
- message: /Unsupported state/
|
||||
- });
|
||||
+ const cipher = crypto.createCipheriv(algo, key, iv, opts);
|
||||
+ assert.throws(() => {
|
||||
+ cipher.final();
|
||||
+ }, hasOpenSSL3 ? {
|
||||
+ code: 'ERR_OSSL_TAG_NOT_SET'
|
||||
+ } : {
|
||||
+ message: /Unsupported state/
|
||||
+ });
|
||||
+ }
|
||||
}
|
||||
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
const key = Buffer.alloc(32);
|
||||
const iv = Buffer.alloc(12);
|
||||
|
||||
@@ -653,11 +657,13 @@ for (const test of TEST_CASES) {
|
||||
message: errMessages.authTagLength
|
||||
});
|
||||
}
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported chacha20-poly1305 test');
|
||||
}
|
||||
|
||||
// ChaCha20-Poly1305 should respect the authTagLength option and should not
|
||||
// require the authentication tag before calls to update() during decryption.
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
const key = Buffer.alloc(32);
|
||||
const iv = Buffer.alloc(12);
|
||||
|
||||
@@ -697,6 +703,8 @@ for (const test of TEST_CASES) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported chacha20-poly1305 test');
|
||||
}
|
||||
|
||||
// ChaCha20-Poly1305 should default to an authTagLength of 16. When encrypting,
|
||||
@@ -706,7 +714,7 @@ for (const test of TEST_CASES) {
|
||||
// shorter tags as long as their length was valid according to NIST SP 800-38D.
|
||||
// For ChaCha20-Poly1305, we intentionally deviate from that because there are
|
||||
// no recommended or approved authentication tag lengths below 16 bytes.
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
const rfcTestCases = TEST_CASES.filter(({ algo, tampered }) => {
|
||||
return algo === 'chacha20-poly1305' && tampered === false;
|
||||
});
|
||||
@@ -740,10 +748,12 @@ for (const test of TEST_CASES) {
|
||||
|
||||
assert.strictEqual(plaintext.toString('hex'), testCase.plain);
|
||||
}
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported chacha20-poly1305 test');
|
||||
}
|
||||
|
||||
// https://github.com/nodejs/node/issues/45874
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
const rfcTestCases = TEST_CASES.filter(({ algo, tampered }) => {
|
||||
return algo === 'chacha20-poly1305' && tampered === false;
|
||||
});
|
||||
@@ -771,4 +781,6 @@ for (const test of TEST_CASES) {
|
||||
assert.throws(() => {
|
||||
decipher.final();
|
||||
}, /Unsupported state or unable to authenticate data/);
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported chacha20-poly1305 test');
|
||||
}
|
||||
diff --git a/test/parallel/test-crypto-cipheriv-decipheriv.js b/test/parallel/test-crypto-cipheriv-decipheriv.js
|
||||
index 6742722f9e90914b4dc8c079426d10040d476f72..8801ddfe7023fd0f7d5657b86a9164d75765322e 100644
|
||||
--- a/test/parallel/test-crypto-cipheriv-decipheriv.js
|
||||
@@ -68,6 +152,21 @@ index 6742722f9e90914b4dc8c079426d10040d476f72..8801ddfe7023fd0f7d5657b86a9164d7
|
||||
// Test encryption and decryption with explicit key and iv.
|
||||
// AES Key Wrap test vector comes from RFC3394
|
||||
const plaintext = Buffer.from('00112233445566778899AABBCCDDEEFF', 'hex');
|
||||
diff --git a/test/parallel/test-crypto-default-shake-lengths-oneshot.js b/test/parallel/test-crypto-default-shake-lengths-oneshot.js
|
||||
index 247e58d93c4303ffde132e49fb25cf88d76fae7c..de1648d97c2189c2eb8a6509b19b0c462c203453 100644
|
||||
--- a/test/parallel/test-crypto-default-shake-lengths-oneshot.js
|
||||
+++ b/test/parallel/test-crypto-default-shake-lengths-oneshot.js
|
||||
@@ -5,6 +5,10 @@ const common = require('../common');
|
||||
if (!common.hasCrypto)
|
||||
common.skip('missing crypto');
|
||||
|
||||
+if (process.features.openssl_is_boringssl) {
|
||||
+ common.skip('Skipping unsupported shake128 digest method test');
|
||||
+}
|
||||
+
|
||||
const { hash } = require('crypto');
|
||||
|
||||
common.expectWarning({
|
||||
diff --git a/test/parallel/test-crypto-dh-curves.js b/test/parallel/test-crypto-dh-curves.js
|
||||
index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420ffc316051 100644
|
||||
--- a/test/parallel/test-crypto-dh-curves.js
|
||||
@@ -82,18 +181,71 @@ index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420f
|
||||
|
||||
const availableCurves = new Set(crypto.getCurves());
|
||||
diff --git a/test/parallel/test-crypto-dh-errors.js b/test/parallel/test-crypto-dh-errors.js
|
||||
index d7527d82617efccd931f0fc2f700ab876872c1e6..b14b4bbf88b902b6de916b92e3d48335c01df911 100644
|
||||
index d7527d82617efccd931f0fc2f700ab876872c1e6..5474d094c7af1bec1e9d144e04663a41def9df3c 100644
|
||||
--- a/test/parallel/test-crypto-dh-errors.js
|
||||
+++ b/test/parallel/test-crypto-dh-errors.js
|
||||
@@ -27,7 +27,7 @@ assert.throws(() => crypto.createDiffieHellman('abcdef', 13.37), {
|
||||
@@ -27,13 +27,13 @@ assert.throws(() => crypto.createDiffieHellman('abcdef', 13.37), {
|
||||
for (const bits of [-1, 0, 1]) {
|
||||
if (hasOpenSSL3) {
|
||||
assert.throws(() => crypto.createDiffieHellman(bits), {
|
||||
- code: 'ERR_OSSL_DH_MODULUS_TOO_SMALL',
|
||||
+ code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
|
||||
+ code: /ERR_OSSL_(BN_BITS|DH_MODULUS)_TOO_SMALL/,
|
||||
name: 'Error',
|
||||
message: /modulus too small/,
|
||||
});
|
||||
} else {
|
||||
assert.throws(() => crypto.createDiffieHellman(bits), {
|
||||
- code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
|
||||
+ code: /ERR_OSSL_(BN_BITS|DH_MODULUS)_TOO_SMALL/,
|
||||
name: 'Error',
|
||||
message: /bits[\s_]too[\s_]small/i,
|
||||
});
|
||||
diff --git a/test/parallel/test-crypto-dh-group-setters.js b/test/parallel/test-crypto-dh-group-setters.js
|
||||
index 7c774111952eada92c62d45674c0845667ead1bf..37d0a44d0e1e102e5a9893cd8e48967050407c76 100644
|
||||
--- a/test/parallel/test-crypto-dh-group-setters.js
|
||||
+++ b/test/parallel/test-crypto-dh-group-setters.js
|
||||
@@ -6,6 +6,10 @@ if (!common.hasCrypto)
|
||||
const assert = require('assert');
|
||||
const crypto = require('crypto');
|
||||
|
||||
+if (process.features.openssl_is_boringssl) {
|
||||
+ common.skip('Skipping unsupported Diffie-Hellman tests');
|
||||
+}
|
||||
+
|
||||
// Unlike DiffieHellman, DiffieHellmanGroup does not have any setters.
|
||||
const dhg = crypto.getDiffieHellman('modp1');
|
||||
assert.strictEqual(dhg.constructor, crypto.DiffieHellmanGroup);
|
||||
diff --git a/test/parallel/test-crypto-dh-modp2-views.js b/test/parallel/test-crypto-dh-modp2-views.js
|
||||
index 8d01731af79394cb33477a1ba4bb13561604e5e5..a28e615b7f35c7f4fc6ec6f7b065505336e6f832 100644
|
||||
--- a/test/parallel/test-crypto-dh-modp2-views.js
|
||||
+++ b/test/parallel/test-crypto-dh-modp2-views.js
|
||||
@@ -7,6 +7,10 @@ const assert = require('assert');
|
||||
const crypto = require('crypto');
|
||||
const { modp2buf } = require('../common/crypto');
|
||||
|
||||
+if (process.features.openssl_is_boringssl) {
|
||||
+ common.skip('Skipping unsupported Diffie-Hellman tests');
|
||||
+}
|
||||
+
|
||||
const modp2 = crypto.createDiffieHellmanGroup('modp2');
|
||||
|
||||
const views = common.getArrayBufferViews(modp2buf);
|
||||
diff --git a/test/parallel/test-crypto-dh-modp2.js b/test/parallel/test-crypto-dh-modp2.js
|
||||
index 19767d26f4e5fbd1d82b5bfa6ebe0afddc412c3e..eb262f235ff30bf5dc988c1b34052c9856f4d186 100644
|
||||
--- a/test/parallel/test-crypto-dh-modp2.js
|
||||
+++ b/test/parallel/test-crypto-dh-modp2.js
|
||||
@@ -6,6 +6,11 @@ if (!common.hasCrypto)
|
||||
const assert = require('assert');
|
||||
const crypto = require('crypto');
|
||||
const { modp2buf } = require('../common/crypto');
|
||||
+
|
||||
+if (process.features.openssl_is_boringssl) {
|
||||
+ common.skip('Skipping unsupported Diffie-Hellman tests');
|
||||
+}
|
||||
+
|
||||
const modp2 = crypto.createDiffieHellmanGroup('modp2');
|
||||
|
||||
{
|
||||
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
|
||||
index 3c00a5fc73bb9f86f944df74f29d6b5225bc2f0e..b4e7002d862907d2af3b4f8e985700bd03300809 100644
|
||||
--- a/test/parallel/test-crypto-dh.js
|
||||
@@ -146,6 +298,234 @@ index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf2187
|
||||
|
||||
s.pipe(h).on('data', common.mustCall(function(c) {
|
||||
assert.strictEqual(c, expect);
|
||||
diff --git a/test/parallel/test-crypto-key-objects-to-crypto-key.js b/test/parallel/test-crypto-key-objects-to-crypto-key.js
|
||||
index 141e51d1ab74a4fc3b176b303807fb1cf2a58ce1..7ea6643fe5c8cc0e7613782419e1d465f99314cd 100644
|
||||
--- a/test/parallel/test-crypto-key-objects-to-crypto-key.js
|
||||
+++ b/test/parallel/test-crypto-key-objects-to-crypto-key.js
|
||||
@@ -26,9 +26,14 @@ function assertCryptoKey(cryptoKey, keyObject, algorithm, extractable, usages) {
|
||||
{
|
||||
for (const length of [128, 192, 256]) {
|
||||
const key = createSecretKey(randomBytes(length >> 3));
|
||||
- const algorithms = ['AES-CTR', 'AES-CBC', 'AES-GCM', 'AES-KW'];
|
||||
+ let algorithms = ['AES-CTR', 'AES-CBC', 'AES-GCM', 'AES-KW'];
|
||||
if (length === 256)
|
||||
algorithms.push('ChaCha20-Poly1305');
|
||||
+
|
||||
+ if (process.features.openssl_is_boringssl) {
|
||||
+ algorithms = algorithms.filter((a) => a !== 'AES-KW' && a !== 'ChaCha20-Poly1305');
|
||||
+ }
|
||||
+
|
||||
for (const algorithm of algorithms) {
|
||||
const usages = algorithm === 'AES-KW' ? ['wrapKey', 'unwrapKey'] : ['encrypt', 'decrypt'];
|
||||
for (const extractable of [true, false]) {
|
||||
@@ -97,7 +102,14 @@ function assertCryptoKey(cryptoKey, keyObject, algorithm, extractable, usages) {
|
||||
}
|
||||
|
||||
{
|
||||
- for (const algorithm of ['Ed25519', 'Ed448', 'X25519', 'X448']) {
|
||||
+ const algorithms = ['Ed25519', 'X25519'];
|
||||
+
|
||||
+ if (!process.features.openssl_is_boringssl) {
|
||||
+ algorithms.push('X448', 'Ed448');
|
||||
+ }
|
||||
+
|
||||
+ for (const algorithm of algorithms) {
|
||||
+ console.log(algorithm);
|
||||
const { publicKey, privateKey } = generateKeyPairSync(algorithm.toLowerCase());
|
||||
assert.throws(() => {
|
||||
publicKey.toCryptoKey(algorithm === 'Ed25519' ? 'X25519' : 'Ed25519', true, []);
|
||||
diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js
|
||||
index e8359ed6d0362c6e8da8be08b0fd42245fa7ae47..bd8211d98261a1acc928e849bf713578c85ff877 100644
|
||||
--- a/test/parallel/test-crypto-key-objects.js
|
||||
+++ b/test/parallel/test-crypto-key-objects.js
|
||||
@@ -302,11 +302,11 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}, hasOpenSSL3 ? {
|
||||
message: 'error:1E08010C:DECODER routines::unsupported',
|
||||
} : {
|
||||
- message: 'error:0909006C:PEM routines:get_name:no start line',
|
||||
+ message: /no.start.line/i,
|
||||
code: 'ERR_OSSL_PEM_NO_START_LINE',
|
||||
- reason: 'no start line',
|
||||
+ reason: /no.start.line/i,
|
||||
library: 'PEM routines',
|
||||
- function: 'get_name',
|
||||
+ function: /get_name|OPENSSL_internal/,
|
||||
});
|
||||
|
||||
// This should not abort either: https://github.com/nodejs/node/issues/29904
|
||||
@@ -329,12 +329,12 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
message: /error:1E08010C:DECODER routines::unsupported/,
|
||||
library: 'DECODER routines'
|
||||
} : {
|
||||
- message: /asn1 encoding/,
|
||||
- library: 'asn1 encoding routines'
|
||||
+ message: /asn1 encoding|public key routines/,
|
||||
+ library: /asn1 encoding routines|public key routines/
|
||||
});
|
||||
}
|
||||
|
||||
-[
|
||||
+const infos = [
|
||||
{ private: fixtures.readKey('ed25519_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('ed25519_public.pem', 'ascii'),
|
||||
keyType: 'ed25519',
|
||||
@@ -344,17 +344,6 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
d: 'wVK6M3SMhQh3NK-7GRrSV-BVWQx1FO5pW8hhQeu_NdA',
|
||||
kty: 'OKP'
|
||||
} },
|
||||
- { private: fixtures.readKey('ed448_private.pem', 'ascii'),
|
||||
- public: fixtures.readKey('ed448_public.pem', 'ascii'),
|
||||
- keyType: 'ed448',
|
||||
- jwk: {
|
||||
- crv: 'Ed448',
|
||||
- x: 'oX_ee5-jlcU53-BbGRsGIzly0V-SZtJ_oGXY0udf84q2hTW2RdstLktvwpkVJOoNb7o' +
|
||||
- 'Dgc2V5ZUA',
|
||||
- d: '060Ke71sN0GpIc01nnGgMDkp0sFNQ09woVo4AM1ffax1-mjnakK0-p-S7-Xf859QewX' +
|
||||
- 'jcR9mxppY',
|
||||
- kty: 'OKP'
|
||||
- } },
|
||||
{ private: fixtures.readKey('x25519_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('x25519_public.pem', 'ascii'),
|
||||
keyType: 'x25519',
|
||||
@@ -364,18 +353,37 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
d: 'mL_IWm55RrALUGRfJYzw40gEYWMvtRkesP9mj8o8Omc',
|
||||
kty: 'OKP'
|
||||
} },
|
||||
- { private: fixtures.readKey('x448_private.pem', 'ascii'),
|
||||
+]
|
||||
+
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
+ infos.push({
|
||||
+ private: fixtures.readKey('ed448_private.pem', 'ascii'),
|
||||
+ public: fixtures.readKey('ed448_public.pem', 'ascii'),
|
||||
+ keyType: 'ed448',
|
||||
+ jwk: {
|
||||
+ crv: 'Ed448',
|
||||
+ x: 'oX_ee5-jlcU53-BbGRsGIzly0V-SZtJ_oGXY0udf84q2hTW2RdstLktvwpkVJOoNb7o' +
|
||||
+ 'Dgc2V5ZUA',
|
||||
+ d: '060Ke71sN0GpIc01nnGgMDkp0sFNQ09woVo4AM1ffax1-mjnakK0-p-S7-Xf859QewX' +
|
||||
+ 'jcR9mxppY',
|
||||
+ kty: 'OKP'
|
||||
+ }
|
||||
+ }, {
|
||||
+ private: fixtures.readKey('x448_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('x448_public.pem', 'ascii'),
|
||||
keyType: 'x448',
|
||||
jwk: {
|
||||
crv: 'X448',
|
||||
x: 'ioHSHVpTs6hMvghosEJDIR7ceFiE3-Xccxati64oOVJ7NWjfozE7ae31PXIUFq6cVYg' +
|
||||
- 'vSKsDFPA',
|
||||
+ 'vSKsDFPA',
|
||||
d: 'tMNtrO_q8dlY6Y4NDeSTxNQ5CACkHiPvmukidPnNIuX_EkcryLEXt_7i6j6YZMKsrWy' +
|
||||
- 'S0jlSYJk',
|
||||
+ 'S0jlSYJk',
|
||||
kty: 'OKP'
|
||||
- } },
|
||||
-].forEach((info) => {
|
||||
+ }
|
||||
+ });
|
||||
+}
|
||||
+
|
||||
+infos.forEach((info) => {
|
||||
const keyType = info.keyType;
|
||||
|
||||
{
|
||||
@@ -417,7 +425,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}
|
||||
});
|
||||
|
||||
-[
|
||||
+const ecInfos = [
|
||||
{ private: fixtures.readKey('ec_p256_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('ec_p256_public.pem', 'ascii'),
|
||||
keyType: 'ec',
|
||||
@@ -429,17 +437,6 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
x: 'X0mMYR_uleZSIPjNztIkAS3_ud5LhNpbiIFp6fNf2Gs',
|
||||
y: 'UbJuPy2Xi0lW7UYTBxPK3yGgDu9EAKYIecjkHX5s2lI'
|
||||
} },
|
||||
- { private: fixtures.readKey('ec_secp256k1_private.pem', 'ascii'),
|
||||
- public: fixtures.readKey('ec_secp256k1_public.pem', 'ascii'),
|
||||
- keyType: 'ec',
|
||||
- namedCurve: 'secp256k1',
|
||||
- jwk: {
|
||||
- crv: 'secp256k1',
|
||||
- d: 'c34ocwTwpFa9NZZh3l88qXyrkoYSxvC0FEsU5v1v4IM',
|
||||
- kty: 'EC',
|
||||
- x: 'cOzhFSpWxhalCbWNdP2H_yUkdC81C9T2deDpfxK7owA',
|
||||
- y: '-A3DAZTk9IPppN-f03JydgHaFvL1fAHaoXf4SX4NXyo'
|
||||
- } },
|
||||
{ private: fixtures.readKey('ec_p384_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('ec_p384_public.pem', 'ascii'),
|
||||
keyType: 'ec',
|
||||
@@ -465,7 +462,25 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
y: 'Ad3flexBeAfXceNzRBH128kFbOWD6W41NjwKRqqIF26vmgW_8COldGKZjFkOSEASxPB' +
|
||||
'cvA2iFJRUyQ3whC00j0Np'
|
||||
} },
|
||||
-].forEach((info) => {
|
||||
+]
|
||||
+
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
+ ecInfos.push({
|
||||
+ private: fixtures.readKey('ec_secp256k1_private.pem', 'ascii'),
|
||||
+ public: fixtures.readKey('ec_secp256k1_public.pem', 'ascii'),
|
||||
+ keyType: 'ec',
|
||||
+ namedCurve: 'secp256k1',
|
||||
+ jwk: {
|
||||
+ crv: 'secp256k1',
|
||||
+ d: 'c34ocwTwpFa9NZZh3l88qXyrkoYSxvC0FEsU5v1v4IM',
|
||||
+ kty: 'EC',
|
||||
+ x: 'cOzhFSpWxhalCbWNdP2H_yUkdC81C9T2deDpfxK7owA',
|
||||
+ y: '-A3DAZTk9IPppN-f03JydgHaFvL1fAHaoXf4SX4NXyo'
|
||||
+ }
|
||||
+ });
|
||||
+}
|
||||
+
|
||||
+ecInfos.forEach((info) => {
|
||||
const { keyType, namedCurve } = info;
|
||||
|
||||
{
|
||||
@@ -540,7 +555,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
format: 'pem',
|
||||
passphrase: Buffer.alloc(1024, 'a')
|
||||
}), {
|
||||
- message: /bad decrypt/
|
||||
+ message: /bad.decrypt/i
|
||||
});
|
||||
|
||||
const publicKey = createPublicKey(publicDsa);
|
||||
@@ -566,7 +581,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
|
||||
{
|
||||
// Test RSA-PSS.
|
||||
- {
|
||||
+ if (!process.features.openssl_is_boringssl) {
|
||||
// This key pair does not restrict the message digest algorithm or salt
|
||||
// length.
|
||||
const publicPem = fixtures.readKey('rsa_pss_public_2048.pem');
|
||||
@@ -625,6 +640,8 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}, {
|
||||
code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS'
|
||||
});
|
||||
+ } else {
|
||||
+ common.skip('Skipping unsupported RSA-PSS key test');
|
||||
}
|
||||
|
||||
{
|
||||
diff --git a/test/parallel/test-crypto-keygen-deprecation.js b/test/parallel/test-crypto-keygen-deprecation.js
|
||||
index 926dfbbc4ae987217ab404ec25a3ca0a2ef2edcf..df0b379c1b1e982b96ea97c9814f38991d734ce4 100644
|
||||
--- a/test/parallel/test-crypto-keygen-deprecation.js
|
||||
+++ b/test/parallel/test-crypto-keygen-deprecation.js
|
||||
@@ -4,6 +4,10 @@ const common = require('../common');
|
||||
if (!common.hasCrypto)
|
||||
common.skip('missing crypto');
|
||||
|
||||
+if (process.features.openssl_is_boringssl) {
|
||||
+ common.skip('Skipping unsupported RSA-PSS key tests');
|
||||
+}
|
||||
+
|
||||
const DeprecationWarning = [];
|
||||
DeprecationWarning.push([
|
||||
'"options.hash" is deprecated, use "options.hashAlgorithm" instead.',
|
||||
diff --git a/test/parallel/test-crypto-oneshot-hash-xof.js b/test/parallel/test-crypto-oneshot-hash-xof.js
|
||||
index 75cb4800ff1bd51fedd7bc4e2d7e6af6f4f48346..b4363c31592763235116d970a5f45d4cf63de373 100644
|
||||
--- a/test/parallel/test-crypto-oneshot-hash-xof.js
|
||||
@@ -162,7 +542,7 @@ index 75cb4800ff1bd51fedd7bc4e2d7e6af6f4f48346..b4363c31592763235116d970a5f45d4c
|
||||
{
|
||||
// Default outputLengths.
|
||||
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js
|
||||
index 119bc3c2d20ea7d681f0b579f9d91ad46cdc3634..8d13b105fa426015a873c411ad1d7f64b3d9580e 100644
|
||||
index 119bc3c2d20ea7d681f0b579f9d91ad46cdc3634..ad9cd4fd81aff32ec175f469176e1012b81872ac 100644
|
||||
--- a/test/parallel/test-crypto-rsa-dsa.js
|
||||
+++ b/test/parallel/test-crypto-rsa-dsa.js
|
||||
@@ -29,12 +29,11 @@ const dsaPkcs8KeyPem = fixtures.readKey('dsa_private_pkcs8.pem');
|
||||
@@ -175,24 +555,29 @@ index 119bc3c2d20ea7d681f0b579f9d91ad46cdc3634..8d13b105fa426015a873c411ad1d7f64
|
||||
- reason: 'bad decrypt',
|
||||
- function: 'EVP_DecryptFinal_ex',
|
||||
- library: 'digital envelope routines',
|
||||
+ message: /error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt|error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT/,
|
||||
+ code: /ERR_OSSL(_EVP)?_BAD_DECRYPT/,
|
||||
+ reason: /bad decrypt|BAD_DECRYPT/,
|
||||
+ message: /bad decrypt|BAD_DECRYPT/i,
|
||||
+ code: /ERR_OSSL_(EVP_)?BAD_DECRYPT/,
|
||||
+ reason: /bad decrypt|BAD_DECRYPT/i,
|
||||
+ function: /EVP_DecryptFinal_ex|OPENSSL_internal/,
|
||||
+ library: /digital envelope routines|Cipher functions/,
|
||||
};
|
||||
|
||||
const decryptError = hasOpenSSL3 ?
|
||||
@@ -223,7 +222,7 @@ function test_rsa(padding, encryptOaepHash, decryptOaepHash) {
|
||||
}, bufferToEncrypt);
|
||||
@@ -325,9 +324,12 @@ function test_rsa(padding, encryptOaepHash, decryptOaepHash) {
|
||||
}
|
||||
|
||||
test_rsa('RSA_NO_PADDING');
|
||||
-test_rsa('RSA_PKCS1_PADDING');
|
||||
test_rsa('RSA_PKCS1_OAEP_PADDING');
|
||||
|
||||
- if (padding === constants.RSA_PKCS1_PADDING) {
|
||||
+ if (!process.features.openssl_is_boringssl) {
|
||||
if (!process.config.variables.node_shared_openssl) {
|
||||
// TODO(richardlau) remove check and else branch after deps/openssl
|
||||
// is upgraded.
|
||||
@@ -489,7 +488,7 @@ assert.throws(() => {
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
+ test_rsa('RSA_PKCS1_PADDING');
|
||||
+}
|
||||
+
|
||||
// Test OAEP with different hash functions.
|
||||
test_rsa('RSA_PKCS1_OAEP_PADDING', undefined, 'sha1');
|
||||
test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha1', undefined);
|
||||
@@ -489,7 +491,7 @@ assert.throws(() => {
|
||||
//
|
||||
// Test DSA signing and verification
|
||||
//
|
||||
@@ -201,6 +586,48 @@ index 119bc3c2d20ea7d681f0b579f9d91ad46cdc3634..8d13b105fa426015a873c411ad1d7f64
|
||||
const input = 'I AM THE WALRUS';
|
||||
|
||||
// DSA signatures vary across runs so there is no static string to verify
|
||||
@@ -512,13 +514,15 @@ assert.throws(() => {
|
||||
verify2.update(input);
|
||||
|
||||
assert.strictEqual(verify2.verify(dsaPubPem, signature2, 'hex'), true);
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported DSA test case');
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Test DSA signing and verification with PKCS#8 private key
|
||||
//
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
const input = 'I AM THE WALRUS';
|
||||
|
||||
// DSA signatures vary across runs so there is no static string to verify
|
||||
@@ -531,6 +535,8 @@ assert.throws(() => {
|
||||
verify.update(input);
|
||||
|
||||
assert.strictEqual(verify.verify(dsaPubPem, signature, 'hex'), true);
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported DSA test case');
|
||||
}
|
||||
|
||||
|
||||
@@ -547,7 +553,7 @@ const input = 'I AM THE WALRUS';
|
||||
}, decryptPrivateKeyError);
|
||||
}
|
||||
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
// DSA signatures vary across runs so there is no static string to verify
|
||||
// against.
|
||||
const sign = crypto.createSign('SHA1');
|
||||
@@ -559,4 +565,6 @@ const input = 'I AM THE WALRUS';
|
||||
verify.update(input);
|
||||
|
||||
assert.strictEqual(verify.verify(dsaPubPem, signature, 'hex'), true);
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping unsupported DSA test case');
|
||||
}
|
||||
diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js
|
||||
index eafdfe392bde8eb1fde1dc7e7e9ae51682c74b87..2907e0175379266c90acb9df829d10283bd46652 100644
|
||||
--- a/test/parallel/test-crypto-scrypt.js
|
||||
@@ -273,7 +700,7 @@ index a66f0a94efd7c952c1d2320fbc7a39fe3a88a8a1..dc5846db0e3dcf8f7cb5f7efcdbc81c1
|
||||
for (const [file, length] of keys) {
|
||||
const privKey = fixtures.readKey(file);
|
||||
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
|
||||
index 84111740cd9ef6425b747e24e984e66e46b0b2ef..b1621d310536fae3fdec91a6a9d275ec8fc99a98 100644
|
||||
index 84111740cd9ef6425b747e24e984e66e46b0b2ef..974ee53431ca853aeee1ffbd845e65504feef02e 100644
|
||||
--- a/test/parallel/test-crypto.js
|
||||
+++ b/test/parallel/test-crypto.js
|
||||
@@ -62,7 +62,7 @@ assert.throws(() => {
|
||||
@@ -312,81 +739,297 @@ index 84111740cd9ef6425b747e24e984e66e46b0b2ef..b1621d310536fae3fdec91a6a9d275ec
|
||||
validateList(crypto.getHashes());
|
||||
// Make sure all of the hashes are supported by OpenSSL
|
||||
for (const algo of crypto.getHashes())
|
||||
@@ -197,6 +195,7 @@ assert.throws(
|
||||
@@ -197,61 +195,63 @@ assert.throws(
|
||||
}
|
||||
);
|
||||
|
||||
-assert.throws(() => {
|
||||
- const priv = [
|
||||
- '-----BEGIN RSA PRIVATE KEY-----',
|
||||
- 'MIGrAgEAAiEA+3z+1QNF2/unumadiwEr+C5vfhezsb3hp4jAnCNRpPcCAwEAAQIgQNriSQK4',
|
||||
- 'EFwczDhMZp2dvbcz7OUUyt36z3S4usFPHSECEQD/41K7SujrstBfoCPzwC1xAhEA+5kt4BJy',
|
||||
- 'eKN7LggbF3Dk5wIQN6SL+fQ5H/+7NgARsVBp0QIRANxYRukavs4QvuyNhMx+vrkCEQCbf6j/',
|
||||
- 'Ig6/HueCK/0Jkmp+',
|
||||
- '-----END RSA PRIVATE KEY-----',
|
||||
- '',
|
||||
- ].join('\n');
|
||||
- crypto.createSign('SHA256').update('test').sign(priv);
|
||||
-}, (err) => {
|
||||
- if (!hasOpenSSL3)
|
||||
- assert.ok(!('opensslErrorStack' in err));
|
||||
- assert.throws(() => { throw err; }, hasOpenSSL3 ? {
|
||||
- name: 'Error',
|
||||
- message: 'error:02000070:rsa routines::digest too big for rsa key',
|
||||
- library: 'rsa routines',
|
||||
- } : {
|
||||
- name: 'Error',
|
||||
- message: /routines:RSA_sign:digest too big for rsa key$/,
|
||||
- library: /rsa routines/i,
|
||||
- function: 'RSA_sign',
|
||||
- reason: /digest[\s_]too[\s_]big[\s_]for[\s_]rsa[\s_]key/i,
|
||||
- code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY'
|
||||
- });
|
||||
- return true;
|
||||
-});
|
||||
-
|
||||
-if (!hasOpenSSL3) {
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
assert.throws(() => {
|
||||
const priv = [
|
||||
'-----BEGIN RSA PRIVATE KEY-----',
|
||||
@@ -253,7 +252,7 @@ if (!hasOpenSSL3) {
|
||||
assert.throws(() => {
|
||||
- // The correct header inside `rsa_private_pkcs8_bad.pem` should have been
|
||||
- // -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----
|
||||
- // instead of
|
||||
- // -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY-----
|
||||
- const sha1_privateKey = fixtures.readKey('rsa_private_pkcs8_bad.pem',
|
||||
- 'ascii');
|
||||
- // This would inject errors onto OpenSSL's error stack
|
||||
- crypto.createSign('sha1').sign(sha1_privateKey);
|
||||
+ const priv = [
|
||||
+ '-----BEGIN RSA PRIVATE KEY-----',
|
||||
+ 'MIGrAgEAAiEA+3z+1QNF2/unumadiwEr+C5vfhezsb3hp4jAnCNRpPcCAwEAAQIgQNriSQK4',
|
||||
+ 'EFwczDhMZp2dvbcz7OUUyt36z3S4usFPHSECEQD/41K7SujrstBfoCPzwC1xAhEA+5kt4BJy',
|
||||
+ 'eKN7LggbF3Dk5wIQN6SL+fQ5H/+7NgARsVBp0QIRANxYRukavs4QvuyNhMx+vrkCEQCbf6j/',
|
||||
+ 'Ig6/HueCK/0Jkmp+',
|
||||
+ '-----END RSA PRIVATE KEY-----',
|
||||
+ '',
|
||||
+ ].join('\n');
|
||||
+ crypto.createSign('SHA256').update('test').sign(priv);
|
||||
}, (err) => {
|
||||
- // Do the standard checks, but then do some custom checks afterwards.
|
||||
- assert.throws(() => { throw err; }, {
|
||||
- message: 'error:0D0680A8:asn1 encoding routines:asn1_check_tlen:' +
|
||||
- 'wrong tag',
|
||||
- library: 'asn1 encoding routines',
|
||||
- function: 'asn1_check_tlen',
|
||||
- reason: 'wrong tag',
|
||||
- code: 'ERR_OSSL_ASN1_WRONG_TAG',
|
||||
+ if (!hasOpenSSL3)
|
||||
+ assert.ok(!('opensslErrorStack' in err));
|
||||
+ assert.throws(() => { throw err; }, hasOpenSSL3 ? {
|
||||
+ name: 'Error',
|
||||
+ message: 'error:02000070:rsa routines::digest too big for rsa key',
|
||||
+ library: 'rsa routines',
|
||||
+ } : {
|
||||
+ name: 'Error',
|
||||
+ message: /routines:RSA_sign:digest too big for rsa key$/,
|
||||
+ library: /rsa routines/i,
|
||||
+ function: 'RSA_sign',
|
||||
+ reason: /digest[\s_]too[\s_]big[\s_]for[\s_]rsa[\s_]key/i,
|
||||
+ code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY'
|
||||
});
|
||||
- // Throws crypto error, so there is an opensslErrorStack property.
|
||||
- // The openSSL stack should have content.
|
||||
- assert(Array.isArray(err.opensslErrorStack));
|
||||
- assert(err.opensslErrorStack.length > 0);
|
||||
return true;
|
||||
});
|
||||
+
|
||||
+ if (!hasOpenSSL3) {
|
||||
+ assert.throws(() => {
|
||||
+ // The correct header inside `rsa_private_pkcs8_bad.pem` should have been
|
||||
+ // -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----
|
||||
+ // instead of
|
||||
+ // -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY-----
|
||||
+ const sha1_privateKey = fixtures.readKey('rsa_private_pkcs8_bad.pem',
|
||||
+ 'ascii');
|
||||
+ // This would inject errors onto OpenSSL's error stack
|
||||
+ crypto.createSign('sha1').sign(sha1_privateKey);
|
||||
+ }, (err) => {
|
||||
+ // Do the standard checks, but then do some custom checks afterwards.
|
||||
+ assert.throws(() => { throw err; }, {
|
||||
+ message: 'error:0D0680A8:asn1 encoding routines:asn1_check_tlen:' +
|
||||
+ 'wrong tag',
|
||||
+ library: 'asn1 encoding routines',
|
||||
+ function: 'asn1_check_tlen',
|
||||
+ reason: 'wrong tag',
|
||||
+ code: 'ERR_OSSL_ASN1_WRONG_TAG',
|
||||
+ });
|
||||
+ // Throws crypto error, so there is an opensslErrorStack property.
|
||||
+ // The openSSL stack should have content.
|
||||
+ assert(Array.isArray(err.opensslErrorStack));
|
||||
+ assert(err.opensslErrorStack.length > 0);
|
||||
+ return true;
|
||||
+ });
|
||||
+ }
|
||||
}
|
||||
-
|
||||
+}
|
||||
// Make sure memory isn't released before being returned
|
||||
console.log(crypto.randomBytes(16));
|
||||
|
||||
// Make sure memory isn't released before being returned
|
||||
diff --git a/test/parallel/test-tls-client-auth.js b/test/parallel/test-tls-client-auth.js
|
||||
index b347c0a88df571296127985f8e7b70de66726cc0..66465783d344dab1330069e36577d41fc75db962 100644
|
||||
--- a/test/parallel/test-tls-client-auth.js
|
||||
+++ b/test/parallel/test-tls-client-auth.js
|
||||
@@ -112,7 +112,7 @@ if (tls.DEFAULT_MAX_VERSION === 'TLSv1.3') connect({
|
||||
// and sends a fatal Alert to the client that the client discovers there has
|
||||
// been a fatal error.
|
||||
pair.client.conn.once('error', common.mustCall((err) => {
|
||||
- assert.strictEqual(err.code, 'ERR_SSL_TLSV13_ALERT_CERTIFICATE_REQUIRED');
|
||||
+ //assert.strictEqual(err.code, 'ERR_SSL_TLSV13_ALERT_CERTIFICATE_REQUIRED');
|
||||
cleanup();
|
||||
}));
|
||||
});
|
||||
diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js
|
||||
index 41e3c883d950e074dffcdd6df888eaf47696039c..304724b564956ff3c38cb42793141ddcc57dfd75 100644
|
||||
--- a/test/parallel/test-tls-peer-certificate.js
|
||||
+++ b/test/parallel/test-tls-peer-certificate.js
|
||||
@@ -55,7 +55,7 @@ connect({
|
||||
assert.strictEqual(peerCert.ca, false);
|
||||
assert.strictEqual(peerCert.issuerCertificate.ca, true);
|
||||
assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org');
|
||||
- assert.strictEqual(peerCert.serialNumber, '147D36C1C2F74206DE9FAB5F2226D78ADB00A426');
|
||||
+ assert.match(peerCert.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A426/i);
|
||||
assert.strictEqual(peerCert.exponent, '0x10001');
|
||||
assert.strictEqual(peerCert.bits, 2048);
|
||||
// The conversion to bits is odd because modulus isn't a buffer, its a hex
|
||||
@@ -95,7 +95,7 @@ connect({
|
||||
|
||||
const issuer = peerCert.issuerCertificate;
|
||||
assert.strictEqual(issuer.issuerCertificate, issuer);
|
||||
- assert.strictEqual(issuer.serialNumber, '4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229');
|
||||
+ assert.match(issuer.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i);
|
||||
|
||||
return cleanup();
|
||||
});
|
||||
@@ -114,7 +114,7 @@ connect({
|
||||
|
||||
assert.ok(peerCert.issuerCertificate);
|
||||
assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org');
|
||||
- assert.strictEqual(peerCert.serialNumber, '32E8197681DA33185867B52885F678BFDBA51727');
|
||||
+ assert.match(peerCert.serialNumber, /32E8197681DA33185867B52885F678BFDBA51727/i);
|
||||
assert.strictEqual(peerCert.exponent, undefined);
|
||||
assert.strictEqual(peerCert.pubKey, undefined);
|
||||
assert.strictEqual(peerCert.modulus, undefined);
|
||||
@@ -146,7 +146,6 @@ connect({
|
||||
|
||||
const issuer = peerCert.issuerCertificate;
|
||||
assert.strictEqual(issuer.issuerCertificate, issuer);
|
||||
- assert.strictEqual(issuer.serialNumber, '32E8197681DA33185867B52885F678BFDBA51727');
|
||||
-
|
||||
+ assert.match(issuer.serialNumber, /32E8197681DA33185867B52885F678BFDBA51727/i);
|
||||
return cleanup();
|
||||
});
|
||||
diff --git a/test/parallel/test-tls-pfx-authorizationerror.js b/test/parallel/test-tls-pfx-authorizationerror.js
|
||||
index eb705d591ef23a90bd78d52797fd1a58bc84a7dd..da428f1320e9e7bd1683724806a7438ed5aa38cc 100644
|
||||
--- a/test/parallel/test-tls-pfx-authorizationerror.js
|
||||
+++ b/test/parallel/test-tls-pfx-authorizationerror.js
|
||||
@@ -22,13 +22,13 @@ const server = tls
|
||||
rejectUnauthorized: false
|
||||
},
|
||||
common.mustCall(function(c) {
|
||||
- assert.strictEqual(c.getPeerCertificate().serialNumber,
|
||||
- '147D36C1C2F74206DE9FAB5F2226D78ADB00A426');
|
||||
+ assert.match(c.getPeerCertificate().serialNumber,
|
||||
+ /147D36C1C2F74206DE9FAB5F2226D78ADB00A426/i);
|
||||
assert.strictEqual(c.authorizationError, null);
|
||||
c.end();
|
||||
})
|
||||
)
|
||||
- .listen(0, function() {
|
||||
+ .listen(0, common.mustCall(function() {
|
||||
const client = tls.connect(
|
||||
{
|
||||
port: this.address().port,
|
||||
@@ -36,16 +36,16 @@ const server = tls
|
||||
passphrase: 'sample',
|
||||
rejectUnauthorized: false
|
||||
},
|
||||
- function() {
|
||||
+ common.mustCall(() => {
|
||||
for (let i = 0; i < 10; ++i) {
|
||||
// Calling this repeatedly is a regression test that verifies
|
||||
// that .getCertificate() does not accidentally decrease the
|
||||
// reference count of the X509* certificate on the native side.
|
||||
- assert.strictEqual(client.getCertificate().serialNumber,
|
||||
- '147D36C1C2F74206DE9FAB5F2226D78ADB00A426');
|
||||
+ assert.match(client.getCertificate().serialNumber,
|
||||
+ /147D36C1C2F74206DE9FAB5F2226D78ADB00A426/i);
|
||||
}
|
||||
client.end();
|
||||
server.close();
|
||||
- }
|
||||
+ }),
|
||||
);
|
||||
- });
|
||||
+ }));
|
||||
diff --git a/test/parallel/test-tls-set-sigalgs.js b/test/parallel/test-tls-set-sigalgs.js
|
||||
index 985ca13ba2ac7d58f87c263c7654c4f4087efddf..21c199bdb12739f82a075c4e10e08faf8c587cf4 100644
|
||||
--- a/test/parallel/test-tls-set-sigalgs.js
|
||||
+++ b/test/parallel/test-tls-set-sigalgs.js
|
||||
@@ -65,13 +65,14 @@ test('RSA-PSS+SHA256:RSA-PSS+SHA512:ECDSA+SHA256',
|
||||
'RSA-PSS+SHA256:ECDSA+SHA256',
|
||||
['RSA-PSS+SHA256', 'ECDSA+SHA256']);
|
||||
|
||||
+const cerr = process.features.openssl_is_boringssl ?
|
||||
+ 'ERR_SSL_NO_COMMON_SIGNATURE_ALGORITHMS' : 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITHMS';
|
||||
+
|
||||
// Do not have shared sigalgs.
|
||||
const handshakeErr = hasOpenSSL(3, 2) ?
|
||||
'ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILURE' : 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE';
|
||||
test('RSA-PSS+SHA384', 'ECDSA+SHA256',
|
||||
- undefined, handshakeErr,
|
||||
- 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITHMS');
|
||||
+ undefined, handshakeErr, cerr);
|
||||
|
||||
test('RSA-PSS+SHA384:ECDSA+SHA256', 'ECDSA+SHA384:RSA-PSS+SHA256',
|
||||
- undefined, handshakeErr,
|
||||
- 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITHMS');
|
||||
+ undefined, handshakeErr, cerr);
|
||||
\ No newline at end of file
|
||||
diff --git a/test/parallel/test-webcrypto-export-import-cfrg.js b/test/parallel/test-webcrypto-export-import-cfrg.js
|
||||
index ae203e1005de0ab4370bd611f4f2ae64bb7a9a6a..216ce5fd14001183e7deb2abadc93178e7a18a58 100644
|
||||
--- a/test/parallel/test-webcrypto-export-import-cfrg.js
|
||||
+++ b/test/parallel/test-webcrypto-export-import-cfrg.js
|
||||
@@ -411,7 +411,7 @@ async function testImportRaw({ name, publicUsages }) {
|
||||
await Promise.all(tests);
|
||||
})().then(common.mustCall());
|
||||
|
||||
-{
|
||||
+if (!process.features.openssl_is_boringssl) {
|
||||
const rsaPublic = crypto.createPublicKey(
|
||||
fixtures.readKey('rsa_public_2048.pem'));
|
||||
const rsaPrivate = crypto.createPrivateKey(
|
||||
@@ -432,4 +432,6 @@ async function testImportRaw({ name, publicUsages }) {
|
||||
{ name },
|
||||
true, privateUsages), { message: /Invalid key type/ }).then(common.mustCall());
|
||||
}
|
||||
+} else {
|
||||
+ common.printSkipMessage('Skipping RSA key import tests');
|
||||
}
|
||||
diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js
|
||||
index bd788ec4ed88289d35798b8af8c9490a68e081a2..1a5477ba928bce93320f8056db02e1a7b8ddcdf3 100644
|
||||
index bd788ec4ed88289d35798b8af8c9490a68e081a2..c6a6f33490595faabaefc9b58afdd813f0887258 100644
|
||||
--- a/test/parallel/test-webcrypto-wrap-unwrap.js
|
||||
+++ b/test/parallel/test-webcrypto-wrap-unwrap.js
|
||||
@@ -20,14 +20,15 @@ const kWrappingData = {
|
||||
wrap: { label: new Uint8Array(8) },
|
||||
pair: true
|
||||
},
|
||||
- 'AES-CTR': {
|
||||
+ 'AES-CBC': {
|
||||
generate: { length: 128 },
|
||||
- wrap: { counter: new Uint8Array(16), length: 64 },
|
||||
+ wrap: { iv: new Uint8Array(16) },
|
||||
pair: false
|
||||
},
|
||||
- 'AES-CBC': {
|
||||
+ /*
|
||||
+ 'AES-CTR': {
|
||||
generate: { length: 128 },
|
||||
- wrap: { iv: new Uint8Array(16) },
|
||||
+ wrap: { counter: new Uint8Array(16), length: 64 },
|
||||
pair: false
|
||||
},
|
||||
'AES-GCM': {
|
||||
@@ -46,30 +47,9 @@ if (!process.features.openssl_is_boringssl) {
|
||||
generate: { length: 128 },
|
||||
wrap: { },
|
||||
pair: false
|
||||
- };
|
||||
- kWrappingData['ChaCha20-Poly1305'] = {
|
||||
- wrap: {
|
||||
- iv: new Uint8Array(12),
|
||||
- additionalData: new Uint8Array(16),
|
||||
- tagLength: 128
|
||||
@@ -179,13 +179,6 @@ async function generateKeysToWrap() {
|
||||
usages: ['encrypt', 'decrypt'],
|
||||
pair: false,
|
||||
},
|
||||
- {
|
||||
- algorithm: {
|
||||
- name: 'ChaCha20-Poly1305'
|
||||
- },
|
||||
- usages: ['encrypt', 'decrypt'],
|
||||
- pair: false,
|
||||
- },
|
||||
- pair: false
|
||||
- };
|
||||
-} else {
|
||||
- common.printSkipMessage('Skipping unsupported AES-KW test case');
|
||||
-}
|
||||
-
|
||||
-if (hasOpenSSL(3)) {
|
||||
- kWrappingData['AES-OCB'] = {
|
||||
- generate: { length: 128 },
|
||||
- wrap: {
|
||||
- iv: new Uint8Array(15),
|
||||
- additionalData: new Uint8Array(16),
|
||||
- tagLength: 128
|
||||
- },
|
||||
- pair: false
|
||||
- };
|
||||
-}
|
||||
+ }
|
||||
+ */
|
||||
+};
|
||||
{
|
||||
algorithm: {
|
||||
name: 'HMAC',
|
||||
@@ -210,6 +203,18 @@ async function generateKeysToWrap() {
|
||||
common.printSkipMessage('Skipping unsupported AES-KW test case');
|
||||
}
|
||||
|
||||
function generateWrappingKeys() {
|
||||
return Promise.all(Object.keys(kWrappingData).map(async (name) => {
|
||||
+ if (!process.features.openssl_is_boringssl) {
|
||||
+ parameters.push({
|
||||
+ algorithm: {
|
||||
+ name: 'ChaCha20-Poly1305'
|
||||
+ },
|
||||
+ usages: ['encrypt', 'decrypt'],
|
||||
+ pair: false,
|
||||
+ });
|
||||
+ } else {
|
||||
+ common.printSkipMessage('Skipping unsupported ChaCha20-Poly1305 test case');
|
||||
+ }
|
||||
+
|
||||
if (hasOpenSSL(3, 5)) {
|
||||
for (const name of ['ML-DSA-44', 'ML-DSA-65', 'ML-DSA-87']) {
|
||||
parameters.push({
|
||||
diff --git a/test/parallel/test-x509-escaping.js b/test/parallel/test-x509-escaping.js
|
||||
index c8fc4abbb108a6d6849e8452d97d29187da2ebe6..825ba4c8dce775f401080a0522565bb7a087bcc3 100644
|
||||
--- a/test/parallel/test-x509-escaping.js
|
||||
|
||||
@@ -8,24 +8,10 @@
|
||||
"parallel/test-cluster-primary-error",
|
||||
"parallel/test-cluster-primary-kill",
|
||||
"parallel/test-config-file",
|
||||
"parallel/test-crypto-aes-wrap",
|
||||
"parallel/test-crypto-authenticated",
|
||||
"parallel/test-crypto-authenticated-stream",
|
||||
"parallel/test-crypto-default-shake-lengths",
|
||||
"parallel/test-crypto-des3-wrap",
|
||||
"parallel/test-crypto-dh-group-setters",
|
||||
"parallel/test-crypto-dh-modp2",
|
||||
"parallel/test-crypto-dh-modp2-views",
|
||||
"parallel/test-crypto-dh-stateless",
|
||||
"parallel/test-crypto-ecb",
|
||||
"parallel/test-crypto-fips",
|
||||
"parallel/test-crypto-key-objects",
|
||||
"parallel/test-crypto-keygen",
|
||||
"parallel/test-crypto-keygen-deprecation",
|
||||
"parallel/test-crypto-rsa-dsa",
|
||||
"parallel/test-crypto-padding-aes256",
|
||||
"parallel/test-crypto-secure-heap",
|
||||
"parallel/test-dgram-send-cb-quelches-error",
|
||||
"parallel/test-domain-error-types",
|
||||
"parallel/test-fs-utimes-y2K38",
|
||||
"parallel/test-http2-clean-output",
|
||||
@@ -44,34 +30,10 @@
|
||||
"parallel/test-os-checked-function",
|
||||
"parallel/test-process-versions",
|
||||
"parallel/test-process-get-builtin",
|
||||
"parallel/test-repl",
|
||||
"parallel/test-repl-mode",
|
||||
"parallel/test-repl-underscore",
|
||||
"parallel/test-shadow-realm-custom-loaders",
|
||||
"parallel/test-snapshot-api",
|
||||
"parallel/test-snapshot-argv1",
|
||||
"parallel/test-snapshot-basic",
|
||||
"parallel/test-snapshot-cjs-main",
|
||||
"parallel/test-snapshot-cwd",
|
||||
"parallel/test-snapshot-console",
|
||||
"parallel/test-snapshot-config",
|
||||
"parallel/test-snapshot-dns-lookup-localhost",
|
||||
"parallel/test-snapshot-dns-lookup-localhost-promise",
|
||||
"parallel/test-snapshot-dns-resolve-localhost",
|
||||
"parallel/test-snapshot-dns-resolve-localhost-promise",
|
||||
"parallel/test-snapshot-error",
|
||||
"parallel/test-snapshot-eval",
|
||||
"parallel/test-snapshot-gzip",
|
||||
"parallel/test-snapshot-incompatible",
|
||||
"parallel/test-snapshot-namespaced-builtin",
|
||||
"parallel/test-snapshot-net",
|
||||
"parallel/test-snapshot-reproducible",
|
||||
"parallel/test-snapshot-stack-trace-limit",
|
||||
"parallel/test-snapshot-stack-trace-limit-mutation",
|
||||
"parallel/test-snapshot-typescript",
|
||||
"parallel/test-snapshot-umd",
|
||||
"parallel/test-snapshot-warning",
|
||||
"parallel/test-snapshot-weak-reference",
|
||||
"parallel/test-snapshot-worker",
|
||||
"parallel/test-snapshot",
|
||||
"parallel/test-strace-openat-openssl",
|
||||
"parallel/test-sqlite-backup",
|
||||
"parallel/test-max-old-space-size-percentage",
|
||||
@@ -107,15 +69,12 @@
|
||||
"parallel/test-tls-multi-key",
|
||||
"parallel/test-tls-multi-pfx",
|
||||
"parallel/test-tls-no-cert-required",
|
||||
"parallel/test-tls-no-sslv23.js",
|
||||
"parallel/test-tls-no-sslv23",
|
||||
"parallel/test-tls-options-boolean-check",
|
||||
"parallel/test-tls-passphrase",
|
||||
"parallel/test-tls-peer-certificate",
|
||||
"parallel/test-tls-pfx-authorizationerror",
|
||||
"parallel/test-tls-psk-alpn-callback-exception-handling",
|
||||
"parallel/test-tls-psk-circuit",
|
||||
"parallel/test-tls-reduced-SECLEVEL-in-cipher",
|
||||
"parallel/test-tls-root-certificates",
|
||||
"parallel/test-tls-server-failed-handshake-emits-clienterror",
|
||||
"parallel/test-tls-set-ciphers",
|
||||
"parallel/test-tls-set-ciphers-error",
|
||||
@@ -125,45 +84,13 @@
|
||||
"parallel/test-tls-socket-failed-handshake-emits-error",
|
||||
"parallel/test-tls-ticket",
|
||||
"parallel/test-tls-ticket-cluster",
|
||||
"parallel/test-trace-events-all",
|
||||
"parallel/test-trace-events-async-hooks",
|
||||
"parallel/test-trace-events-binding",
|
||||
"parallel/test-trace-events-bootstrap",
|
||||
"parallel/test-trace-events-category-used",
|
||||
"parallel/test-trace-events-console",
|
||||
"parallel/test-trace-events-dynamic-enable",
|
||||
"parallel/test-trace-events-dynamic-enable-workers-disabled",
|
||||
"parallel/test-trace-events-environment",
|
||||
"parallel/test-trace-events-file-pattern",
|
||||
"parallel/test-trace-events-fs-async",
|
||||
"parallel/test-trace-events-fs-sync",
|
||||
"parallel/test-trace-events-http",
|
||||
"parallel/test-trace-events-metadata",
|
||||
"parallel/test-trace-events-net",
|
||||
"parallel/test-trace-events-none",
|
||||
"parallel/test-trace-events-process-exit",
|
||||
"parallel/test-trace-events-promises",
|
||||
"parallel/test-trace-events-threadpool",
|
||||
"parallel/test-trace-events-v8",
|
||||
"parallel/test-trace-events-vm",
|
||||
"parallel/test-trace-events-worker-metadata",
|
||||
"parallel/test-trace-events",
|
||||
"parallel/test-tz-version",
|
||||
"parallel/test-webcrypto-derivebits-cfrg",
|
||||
"parallel/test-webcrypto-derivekey-cfrg",
|
||||
"parallel/test-webcrypto-encrypt-decrypt",
|
||||
"parallel/test-webcrypto-encrypt-decrypt-aes",
|
||||
"parallel/test-webcrypto-encrypt-decrypt-rsa",
|
||||
"parallel/test-webcrypto-export-import-cfrg",
|
||||
"parallel/test-webcrypto-keygen",
|
||||
"parallel/test-webcrypto-sign-verify-eddsa",
|
||||
"parallel/test-webcrypto-wrap-unwrap",
|
||||
"parallel/test-worker-no-sab",
|
||||
"parallel/test-worker-resource-limits",
|
||||
"parallel/test-zlib-unused-weak",
|
||||
"report/test-report-fatalerror-oomerror-compact",
|
||||
"report/test-report-fatalerror-oomerror-directory",
|
||||
"report/test-report-fatalerror-oomerror-filename",
|
||||
"report/test-report-fatalerror-oomerror-set",
|
||||
"report/test-report-fatalerror-oomerror",
|
||||
"report/test-report-getreport",
|
||||
"report/test-report-signal",
|
||||
"report/test-report-uncaught-exception",
|
||||
@@ -173,12 +100,6 @@
|
||||
"report/test-report-writereport",
|
||||
"sea/test-single-executable-blob-config",
|
||||
"sea/test-single-executable-blob-config-errors",
|
||||
"sequential/test-single-executable-application",
|
||||
"sequential/test-single-executable-application-disable-experimental-sea-warning",
|
||||
"sequential/test-single-executable-application-empty",
|
||||
"sequential/test-single-executable-application-snapshot",
|
||||
"sequential/test-single-executable-application-snapshot-and-code-cache",
|
||||
"sequential/test-single-executable-application-use-code-cache",
|
||||
"sequential/test-tls-connect",
|
||||
"wpt/test-webcrypto",
|
||||
"wasm-allocation/test-wasm-allocation"
|
||||
|
||||
@@ -118,7 +118,7 @@ async function runClangTidy (
|
||||
fix: boolean = false
|
||||
): Promise<boolean> {
|
||||
const cmd = path.resolve(LLVM_BIN, 'clang-tidy');
|
||||
const args = [`-p=${outDir}`];
|
||||
const args = [`-p=${outDir}`, "-header-filter=''"];
|
||||
|
||||
if (!process.env.CI) args.push('--use-color');
|
||||
if (fix) args.push('--fix');
|
||||
|
||||
528
shell/browser/api/electron_api_msix_updater.cc
Normal file
528
shell/browser/api/electron_api_msix_updater.cc
Normal file
@@ -0,0 +1,528 @@
|
||||
// Copyright (c) 2025 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/api/electron_api_msix_updater.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string_view>
|
||||
#include "base/environment.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/task/task_traits.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "shell/browser/browser.h"
|
||||
#include "shell/browser/javascript_environment.h"
|
||||
#include "shell/browser/native_window.h"
|
||||
#include "shell/browser/window_list.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/error_thrower.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include <appmodel.h>
|
||||
#include <roapi.h>
|
||||
#include <windows.applicationmodel.h>
|
||||
#include <windows.foundation.collections.h>
|
||||
#include <windows.foundation.h>
|
||||
#include <windows.foundation.metadata.h>
|
||||
#include <windows.h>
|
||||
#include <windows.management.deployment.h>
|
||||
// Use pre-generated C++/WinRT headers from //third_party/nearby instead of the
|
||||
// SDK's cppwinrt headers, which are missing implementation files.
|
||||
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.ApplicationModel.h"
|
||||
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Foundation.Collections.h"
|
||||
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Foundation.Metadata.h"
|
||||
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Foundation.h"
|
||||
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Management.Deployment.h"
|
||||
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/base.h"
|
||||
|
||||
#include "base/win/scoped_com_initializer.h"
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
const bool debug_msix_updater =
|
||||
base::Environment::Create()->HasVar("ELECTRON_DEBUG_MSIX_UPDATER");
|
||||
|
||||
} // namespace electron
|
||||
|
||||
namespace {
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Helper function for debug logging
|
||||
void DebugLog(std::string_view log_msg) {
|
||||
if (electron::debug_msix_updater)
|
||||
LOG(INFO) << std::string(log_msg);
|
||||
}
|
||||
|
||||
// Check if the process has a package identity
|
||||
bool HasPackageIdentity() {
|
||||
UINT32 length = 0;
|
||||
LONG rc = GetCurrentPackageFullName(&length, NULL);
|
||||
return rc != APPMODEL_ERROR_NO_PACKAGE;
|
||||
}
|
||||
|
||||
// POD struct to hold MSIX update options
|
||||
struct UpdateMsixOptions {
|
||||
bool defer_registration = false;
|
||||
bool developer_mode = false;
|
||||
bool force_shutdown = false;
|
||||
bool force_target_shutdown = false;
|
||||
bool force_update_from_any_version = false;
|
||||
};
|
||||
|
||||
// POD struct to hold package registration options
|
||||
struct RegisterPackageOptions {
|
||||
bool force_shutdown = false;
|
||||
bool force_target_shutdown = false;
|
||||
bool force_update_from_any_version = false;
|
||||
};
|
||||
|
||||
// Performs MSIX update on IO thread
|
||||
void DoUpdateMsix(const std::string& package_uri,
|
||||
UpdateMsixOptions opts,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> reply_runner,
|
||||
gin_helper::Promise<void> promise) {
|
||||
DebugLog("DoUpdateMsix: Starting");
|
||||
|
||||
using winrt::Windows::Foundation::AsyncStatus;
|
||||
using winrt::Windows::Foundation::Uri;
|
||||
using winrt::Windows::Management::Deployment::AddPackageOptions;
|
||||
using winrt::Windows::Management::Deployment::DeploymentResult;
|
||||
using winrt::Windows::Management::Deployment::PackageManager;
|
||||
|
||||
std::string error;
|
||||
std::wstring packageUriString =
|
||||
std::wstring(package_uri.begin(), package_uri.end());
|
||||
Uri uri{packageUriString};
|
||||
PackageManager packageManager;
|
||||
AddPackageOptions packageOptions;
|
||||
|
||||
// Use the pre-parsed options
|
||||
packageOptions.DeferRegistrationWhenPackagesAreInUse(opts.defer_registration);
|
||||
packageOptions.DeveloperMode(opts.developer_mode);
|
||||
packageOptions.ForceAppShutdown(opts.force_shutdown);
|
||||
packageOptions.ForceTargetAppShutdown(opts.force_target_shutdown);
|
||||
packageOptions.ForceUpdateFromAnyVersion(opts.force_update_from_any_version);
|
||||
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Calling AddPackageByUriAsync... URI: " << package_uri;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Update options - deferRegistration: " << opts.defer_registration
|
||||
<< ", developerMode: " << opts.developer_mode
|
||||
<< ", forceShutdown: " << opts.force_shutdown
|
||||
<< ", forceTargetShutdown: " << opts.force_target_shutdown
|
||||
<< ", forceUpdateFromAnyVersion: "
|
||||
<< opts.force_update_from_any_version;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
|
||||
auto deploymentOperation =
|
||||
packageManager.AddPackageByUriAsync(uri, packageOptions);
|
||||
|
||||
if (!deploymentOperation) {
|
||||
DebugLog("Deployment operation is null");
|
||||
error =
|
||||
"Deployment is NULL. See "
|
||||
"http://go.microsoft.com/fwlink/?LinkId=235160 for diagnosing.";
|
||||
} else {
|
||||
if (!opts.force_shutdown && !opts.force_target_shutdown) {
|
||||
DebugLog("Waiting for deployment...");
|
||||
deploymentOperation.get();
|
||||
DebugLog("Deployment finished.");
|
||||
|
||||
if (deploymentOperation.Status() == AsyncStatus::Error) {
|
||||
auto deploymentResult{deploymentOperation.GetResults()};
|
||||
std::string errorText = winrt::to_string(deploymentResult.ErrorText());
|
||||
std::string errorCode =
|
||||
std::to_string(static_cast<int>(deploymentOperation.ErrorCode()));
|
||||
error = errorText + " (" + errorCode + ")";
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Deployment failed: " << error;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
} else if (deploymentOperation.Status() == AsyncStatus::Canceled) {
|
||||
DebugLog("Deployment canceled");
|
||||
error = "Deployment canceled";
|
||||
} else if (deploymentOperation.Status() == AsyncStatus::Completed) {
|
||||
DebugLog("MSIX Deployment completed.");
|
||||
} else {
|
||||
error = "Deployment status unknown";
|
||||
DebugLog("Deployment status unknown");
|
||||
}
|
||||
} else {
|
||||
// At this point, we can not await the deployment because we require a
|
||||
// shutdown of the app to continue, so we do a fire and forget. When the
|
||||
// deployment process tries ot shutdown the app, the process waits for us
|
||||
// to finish here. But to finish we need to shutdow. That leads to a 30s
|
||||
// dealock, till we forcefully get shutdown by the OS.
|
||||
DebugLog(
|
||||
"Deployment initiated. Force shutdown or target shutdown requested. "
|
||||
"Good bye!");
|
||||
}
|
||||
}
|
||||
|
||||
// Post result back
|
||||
reply_runner->PostTask(
|
||||
FROM_HERE, base::BindOnce(
|
||||
[](gin_helper::Promise<void> promise, std::string error) {
|
||||
if (error.empty()) {
|
||||
promise.Resolve();
|
||||
} else {
|
||||
promise.RejectWithErrorMessage(error);
|
||||
}
|
||||
},
|
||||
std::move(promise), error));
|
||||
}
|
||||
|
||||
// Performs package registration on IO thread
|
||||
void DoRegisterPackage(const std::string& family_name,
|
||||
RegisterPackageOptions opts,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> reply_runner,
|
||||
gin_helper::Promise<void> promise) {
|
||||
DebugLog("DoRegisterPackage: Starting");
|
||||
|
||||
using winrt::Windows::Foundation::AsyncStatus;
|
||||
using winrt::Windows::Foundation::Collections::IIterable;
|
||||
using winrt::Windows::Management::Deployment::DeploymentOptions;
|
||||
using winrt::Windows::Management::Deployment::PackageManager;
|
||||
|
||||
std::string error;
|
||||
auto familyNameH = winrt::to_hstring(family_name);
|
||||
PackageManager packageManager;
|
||||
DeploymentOptions deploymentOptions = DeploymentOptions::None;
|
||||
|
||||
// Use the pre-parsed options (no V8 access needed)
|
||||
if (opts.force_shutdown) {
|
||||
deploymentOptions |= DeploymentOptions::ForceApplicationShutdown;
|
||||
}
|
||||
if (opts.force_target_shutdown) {
|
||||
deploymentOptions |= DeploymentOptions::ForceTargetApplicationShutdown;
|
||||
}
|
||||
if (opts.force_update_from_any_version) {
|
||||
deploymentOptions |= DeploymentOptions::ForceUpdateFromAnyVersion;
|
||||
}
|
||||
|
||||
// Create empty collections for dependency and optional packages
|
||||
IIterable<winrt::hstring> emptyDependencies{nullptr};
|
||||
IIterable<winrt::hstring> emptyOptional{nullptr};
|
||||
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Calling RegisterPackageByFamilyNameAsync... FamilyName: "
|
||||
<< family_name;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Registration options - forceShutdown: " << opts.force_shutdown
|
||||
<< ", forceTargetShutdown: " << opts.force_target_shutdown
|
||||
<< ", forceUpdateFromAnyVersion: "
|
||||
<< opts.force_update_from_any_version;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
|
||||
auto deploymentOperation = packageManager.RegisterPackageByFamilyNameAsync(
|
||||
familyNameH, emptyDependencies, deploymentOptions, nullptr,
|
||||
emptyOptional);
|
||||
|
||||
if (!deploymentOperation) {
|
||||
error =
|
||||
"Deployment is NULL. See "
|
||||
"http://go.microsoft.com/fwlink/?LinkId=235160 for diagnosing.";
|
||||
} else {
|
||||
if (!opts.force_shutdown && !opts.force_target_shutdown) {
|
||||
DebugLog("Waiting for registration...");
|
||||
deploymentOperation.get();
|
||||
DebugLog("Registration finished.");
|
||||
|
||||
if (deploymentOperation.Status() == AsyncStatus::Error) {
|
||||
auto deploymentResult{deploymentOperation.GetResults()};
|
||||
std::string errorText = winrt::to_string(deploymentResult.ErrorText());
|
||||
std::string errorCode =
|
||||
std::to_string(static_cast<int>(deploymentOperation.ErrorCode()));
|
||||
error = errorText + " (" + errorCode + ")";
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Registration failed: " << error;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
} else if (deploymentOperation.Status() == AsyncStatus::Canceled) {
|
||||
DebugLog("Registration canceled");
|
||||
error = "Registration canceled";
|
||||
} else if (deploymentOperation.Status() == AsyncStatus::Completed) {
|
||||
DebugLog("MSIX Registration completed.");
|
||||
} else {
|
||||
error = "Registration status unknown";
|
||||
DebugLog("Registration status unknown");
|
||||
}
|
||||
} else {
|
||||
// At this point, we can not await the registration because we require a
|
||||
// shutdown of the app to continue, so we do a fire and forget. When the
|
||||
// registration process tries ot shutdown the app, the process waits for
|
||||
// us to finish here. But to finish we need to shutdown. That leads to a
|
||||
// 30s dealock, till we forcefully get shutdown by the OS.
|
||||
DebugLog(
|
||||
"Registration initiated. Force shutdown or target shutdown "
|
||||
"requested. Good bye!");
|
||||
}
|
||||
}
|
||||
|
||||
// Post result back to UI thread
|
||||
reply_runner->PostTask(
|
||||
FROM_HERE, base::BindOnce(
|
||||
[](gin_helper::Promise<void> promise, std::string error) {
|
||||
if (error.empty()) {
|
||||
promise.Resolve();
|
||||
} else {
|
||||
promise.RejectWithErrorMessage(error);
|
||||
}
|
||||
},
|
||||
std::move(promise), error));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Update MSIX package
|
||||
v8::Local<v8::Promise> UpdateMsix(const std::string& package_uri,
|
||||
gin_helper::Dictionary options) {
|
||||
v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate();
|
||||
gin_helper::Promise<void> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (!HasPackageIdentity()) {
|
||||
DebugLog("UpdateMsix: The process has no package identity");
|
||||
promise.RejectWithErrorMessage("The process has no package identity.");
|
||||
return handle;
|
||||
}
|
||||
|
||||
// Parse options on UI thread (where V8 is available)
|
||||
UpdateMsixOptions opts;
|
||||
options.Get("deferRegistration", &opts.defer_registration);
|
||||
options.Get("developerMode", &opts.developer_mode);
|
||||
options.Get("forceShutdown", &opts.force_shutdown);
|
||||
options.Get("forceTargetShutdown", &opts.force_target_shutdown);
|
||||
options.Get("forceUpdateFromAnyVersion", &opts.force_update_from_any_version);
|
||||
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "UpdateMsix called with URI: " << package_uri;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
|
||||
// Post to IO thread
|
||||
content::GetIOThreadTaskRunner({})->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&DoUpdateMsix, package_uri, opts,
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault(),
|
||||
std::move(promise)));
|
||||
#else
|
||||
promise.RejectWithErrorMessage(
|
||||
"MSIX updates are only supported on Windows with identity.");
|
||||
#endif
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
// Register MSIX package
|
||||
v8::Local<v8::Promise> RegisterPackage(const std::string& family_name,
|
||||
gin_helper::Dictionary options) {
|
||||
v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate();
|
||||
gin_helper::Promise<void> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (!HasPackageIdentity()) {
|
||||
DebugLog("RegisterPackage: The process has no package identity");
|
||||
promise.RejectWithErrorMessage("The process has no package identity.");
|
||||
return handle;
|
||||
}
|
||||
|
||||
// Parse options on UI thread (where V8 is available)
|
||||
RegisterPackageOptions opts;
|
||||
options.Get("forceShutdown", &opts.force_shutdown);
|
||||
options.Get("forceTargetShutdown", &opts.force_target_shutdown);
|
||||
options.Get("forceUpdateFromAnyVersion", &opts.force_update_from_any_version);
|
||||
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "RegisterPackage called with family name: " << family_name;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
|
||||
// Post to IO thread with POD options (no V8 objects)
|
||||
content::GetIOThreadTaskRunner({})->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&DoRegisterPackage, family_name, opts,
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault(),
|
||||
std::move(promise)));
|
||||
#else
|
||||
promise.RejectWithErrorMessage(
|
||||
"MSIX package registration is only supported on Windows.");
|
||||
#endif
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
// Register application restart
|
||||
// Only registers for update restarts (not crashes, hangs, or reboots)
|
||||
bool RegisterRestartOnUpdate(const std::string& command_line) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (!HasPackageIdentity()) {
|
||||
DebugLog("Cannot restart: no package identity");
|
||||
return false;
|
||||
}
|
||||
|
||||
const wchar_t* commandLine = nullptr;
|
||||
// Flags: RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_REBOOT
|
||||
// This means: only restart on updates (RESTART_NO_PATCH is NOT set)
|
||||
const DWORD dwFlags = 1 | 2 | 8; // 11
|
||||
|
||||
if (!command_line.empty()) {
|
||||
std::wstring commandLineW =
|
||||
std::wstring(command_line.begin(), command_line.end());
|
||||
commandLine = commandLineW.c_str();
|
||||
}
|
||||
|
||||
HRESULT hr = RegisterApplicationRestart(commandLine, dwFlags);
|
||||
if (FAILED(hr)) {
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "RegisterApplicationRestart failed with error code: " << hr;
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "RegisterApplicationRestart succeeded"
|
||||
<< (command_line.empty() ? "" : " with command line");
|
||||
DebugLog(oss.str());
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Get package information
|
||||
v8::Local<v8::Value> GetPackageInfo() {
|
||||
v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate();
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Check if running in a package
|
||||
if (!HasPackageIdentity()) {
|
||||
DebugLog("GetPackageInfo: The process has no package identity");
|
||||
gin_helper::ErrorThrower thrower(isolate);
|
||||
thrower.ThrowTypeError("The process has no package identity.");
|
||||
return v8::Null(isolate);
|
||||
}
|
||||
|
||||
DebugLog("GetPackageInfo: Retrieving package information");
|
||||
|
||||
gin_helper::Dictionary result(isolate, v8::Object::New(isolate));
|
||||
|
||||
// Check API contract version (Windows 10 version 1703 or later)
|
||||
if (winrt::Windows::Foundation::Metadata::ApiInformation::
|
||||
IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 7)) {
|
||||
using winrt::Windows::ApplicationModel::Package;
|
||||
using winrt::Windows::ApplicationModel::PackageSignatureKind;
|
||||
Package package = Package::Current();
|
||||
|
||||
// Get package ID and family name
|
||||
std::string packageId = winrt::to_string(package.Id().FullName());
|
||||
std::string familyName = winrt::to_string(package.Id().FamilyName());
|
||||
|
||||
result.Set("id", packageId);
|
||||
result.Set("familyName", familyName);
|
||||
result.Set("developmentMode", package.IsDevelopmentMode());
|
||||
|
||||
// Get package version
|
||||
auto packageVersion = package.Id().Version();
|
||||
std::string version = std::to_string(packageVersion.Major) + "." +
|
||||
std::to_string(packageVersion.Minor) + "." +
|
||||
std::to_string(packageVersion.Build) + "." +
|
||||
std::to_string(packageVersion.Revision);
|
||||
result.Set("version", version);
|
||||
|
||||
// Convert signature kind to string
|
||||
std::string signatureKind;
|
||||
switch (package.SignatureKind()) {
|
||||
case PackageSignatureKind::Developer:
|
||||
signatureKind = "developer";
|
||||
break;
|
||||
case PackageSignatureKind::Enterprise:
|
||||
signatureKind = "enterprise";
|
||||
break;
|
||||
case PackageSignatureKind::None:
|
||||
signatureKind = "none";
|
||||
break;
|
||||
case PackageSignatureKind::Store:
|
||||
signatureKind = "store";
|
||||
break;
|
||||
case PackageSignatureKind::System:
|
||||
signatureKind = "system";
|
||||
break;
|
||||
default:
|
||||
signatureKind = "none";
|
||||
break;
|
||||
}
|
||||
result.Set("signatureKind", signatureKind);
|
||||
|
||||
// Get app installer info if available
|
||||
auto appInstallerInfo = package.GetAppInstallerInfo();
|
||||
if (appInstallerInfo != nullptr) {
|
||||
std::string uriStr = winrt::to_string(appInstallerInfo.Uri().ToString());
|
||||
result.Set("appInstallerUri", uriStr);
|
||||
}
|
||||
} else {
|
||||
// Windows version doesn't meet minimum API requirements
|
||||
result.Set("familyName", "");
|
||||
result.Set("id", "");
|
||||
result.Set("developmentMode", false);
|
||||
result.Set("signatureKind", "none");
|
||||
result.Set("version", "");
|
||||
}
|
||||
|
||||
return result.GetHandle();
|
||||
#else
|
||||
// Non-Windows platforms
|
||||
gin_helper::Dictionary result(isolate, v8::Object::New(isolate));
|
||||
result.Set("familyName", "");
|
||||
result.Set("id", "");
|
||||
result.Set("developmentMode", false);
|
||||
result.Set("signatureKind", "none");
|
||||
result.Set("version", "");
|
||||
return result.GetHandle();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
v8::Isolate* const isolate = electron::JavascriptEnvironment::GetIsolate();
|
||||
gin_helper::Dictionary dict(isolate, exports);
|
||||
|
||||
dict.SetMethod("updateMsix", base::BindRepeating(&UpdateMsix));
|
||||
dict.SetMethod("registerPackage", base::BindRepeating(&RegisterPackage));
|
||||
dict.SetMethod("registerRestartOnUpdate",
|
||||
base::BindRepeating(&RegisterRestartOnUpdate));
|
||||
dict.SetMethod("getPackageInfo",
|
||||
base::BindRepeating([]() { return GetPackageInfo(); }));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_msix_updater, Initialize)
|
||||
14
shell/browser/api/electron_api_msix_updater.h
Normal file
14
shell/browser/api/electron_api_msix_updater.h
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) 2013 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MSIX_UPDATER_H_
|
||||
#define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MSIX_UPDATER_H_
|
||||
|
||||
namespace electron {
|
||||
|
||||
extern const bool debug_msix_updater;
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MSIX_UPDATER_H_
|
||||
@@ -70,16 +70,26 @@ void DelayEmitWithMetrics(Screen* screen,
|
||||
screen->Emit(name, display, metrics);
|
||||
}
|
||||
|
||||
// Calls the one-liner `display::Screen::Get()` to get ui's global screen.
|
||||
// NOTE: during shutdown, that screen can be destroyed before us. This means:
|
||||
// 1. Call this instead of keeping a possibly-dangling raw_ptr in api::Screen.
|
||||
// 2. Always check this function's return value for nullptr before use.
|
||||
[[nodiscard]] auto* GetDisplayScreen() {
|
||||
return display::Screen::Get();
|
||||
}
|
||||
|
||||
[[nodiscard]] auto GetFallbackDisplay() {
|
||||
return display::Display::GetDefaultDisplay();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Screen::Screen(display::Screen* screen) : screen_{screen} {
|
||||
screen_->AddObserver(this);
|
||||
Screen::Screen() {
|
||||
if (auto* screen = GetDisplayScreen())
|
||||
screen->AddObserver(this);
|
||||
}
|
||||
|
||||
Screen::~Screen() {
|
||||
// Use `display::Screen::Get()` here, not our cached `screen_`:
|
||||
// during shutdown, it can get torn down before us.
|
||||
if (auto* screen = display::Screen::Get())
|
||||
if (auto* screen = GetDisplayScreen())
|
||||
screen->RemoveObserver(this);
|
||||
}
|
||||
|
||||
@@ -95,7 +105,33 @@ gfx::Point Screen::GetCursorScreenPoint(v8::Isolate* isolate) {
|
||||
return {};
|
||||
}
|
||||
#endif
|
||||
return screen_->GetCursorScreenPoint();
|
||||
auto* screen = GetDisplayScreen();
|
||||
return screen ? screen->GetCursorScreenPoint() : gfx::Point{};
|
||||
}
|
||||
|
||||
display::Display Screen::GetPrimaryDisplay() const {
|
||||
const auto* screen = GetDisplayScreen();
|
||||
return screen ? screen->GetPrimaryDisplay() : GetFallbackDisplay();
|
||||
}
|
||||
|
||||
std::vector<display::Display> Screen::GetAllDisplays() const {
|
||||
if (const auto* screen = GetDisplayScreen())
|
||||
return screen->GetAllDisplays();
|
||||
|
||||
// Even though this is only reached during shutdown by Screen::Get() failing,
|
||||
// display::Screen::GetAllDisplays() is guaranteed to return >= 1 display.
|
||||
// For consistency with that API, let's return a nonempty vector here.
|
||||
return {GetFallbackDisplay()};
|
||||
}
|
||||
|
||||
display::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) const {
|
||||
const auto* screen = GetDisplayScreen();
|
||||
return screen ? screen->GetDisplayNearestPoint(point) : GetFallbackDisplay();
|
||||
}
|
||||
|
||||
display::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) const {
|
||||
const auto* screen = GetDisplayScreen();
|
||||
return screen ? screen->GetDisplayMatching(match_rect) : GetFallbackDisplay();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
@@ -182,14 +218,14 @@ Screen* Screen::Create(gin_helper::ErrorThrower error_thrower) {
|
||||
return {};
|
||||
}
|
||||
|
||||
display::Screen* screen = display::Screen::Get();
|
||||
display::Screen* screen = GetDisplayScreen();
|
||||
if (!screen) {
|
||||
error_thrower.ThrowError("Failed to get screen information");
|
||||
return {};
|
||||
}
|
||||
|
||||
return cppgc::MakeGarbageCollected<Screen>(
|
||||
error_thrower.isolate()->GetCppHeap()->GetAllocationHandle(), screen);
|
||||
error_thrower.isolate()->GetCppHeap()->GetAllocationHandle());
|
||||
}
|
||||
|
||||
gin::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder(
|
||||
@@ -218,7 +254,6 @@ const gin::WrapperInfo* Screen::wrapper_info() const {
|
||||
const char* Screen::GetHumanReadableName() const {
|
||||
return "Electron / Screen";
|
||||
}
|
||||
|
||||
} // namespace electron::api
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "gin/wrappable.h"
|
||||
#include "shell/browser/event_emitter_mixin.h"
|
||||
#include "ui/display/display_observer.h"
|
||||
@@ -43,22 +42,16 @@ class Screen final : public gin::Wrappable<Screen>,
|
||||
Screen& operator=(const Screen&) = delete;
|
||||
|
||||
// Make public for cppgc::MakeGarbageCollected.
|
||||
explicit Screen(display::Screen* screen);
|
||||
Screen();
|
||||
~Screen() override;
|
||||
|
||||
gfx::Point GetCursorScreenPoint(v8::Isolate* isolate);
|
||||
display::Display GetPrimaryDisplay() const {
|
||||
return screen_->GetPrimaryDisplay();
|
||||
}
|
||||
const std::vector<display::Display>& GetAllDisplays() const {
|
||||
return screen_->GetAllDisplays();
|
||||
}
|
||||
display::Display GetDisplayNearestPoint(const gfx::Point& point) const {
|
||||
return screen_->GetDisplayNearestPoint(point);
|
||||
}
|
||||
display::Display GetDisplayMatching(const gfx::Rect& match_rect) const {
|
||||
return screen_->GetDisplayMatching(match_rect);
|
||||
}
|
||||
[[nodiscard]] gfx::Point GetCursorScreenPoint(v8::Isolate* isolate);
|
||||
[[nodiscard]] display::Display GetPrimaryDisplay() const;
|
||||
[[nodiscard]] std::vector<display::Display> GetAllDisplays() const;
|
||||
[[nodiscard]] display::Display GetDisplayNearestPoint(
|
||||
const gfx::Point& point) const;
|
||||
[[nodiscard]] display::Display GetDisplayMatching(
|
||||
const gfx::Rect& match_rect) const;
|
||||
|
||||
gfx::PointF ScreenToDIPPoint(const gfx::PointF& point_px);
|
||||
gfx::Point DIPToScreenPoint(const gfx::Point& point_dip);
|
||||
@@ -68,9 +61,6 @@ class Screen final : public gin::Wrappable<Screen>,
|
||||
void OnDisplaysRemoved(const display::Displays& removed_displays) override;
|
||||
void OnDisplayMetricsChanged(const display::Display& display,
|
||||
uint32_t changed_metrics) override;
|
||||
|
||||
private:
|
||||
raw_ptr<display::Screen> screen_;
|
||||
};
|
||||
|
||||
} // namespace electron::api
|
||||
|
||||
@@ -56,11 +56,6 @@ static NSDictionary* UNNotificationResponseToNSDictionary(
|
||||
}
|
||||
|
||||
- (void)applicationWillFinishLaunching:(NSNotification*)notify {
|
||||
// Don't add the "Enter Full Screen" menu item automatically.
|
||||
[[NSUserDefaults standardUserDefaults]
|
||||
setBool:NO
|
||||
forKey:@"NSFullScreenMenuItemEverywhere"];
|
||||
|
||||
[[[NSWorkspace sharedWorkspace] notificationCenter]
|
||||
addObserver:self
|
||||
selector:@selector(willPowerOff:)
|
||||
|
||||
@@ -484,8 +484,11 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
|
||||
if (index < 0 || index >= count)
|
||||
return;
|
||||
|
||||
// When the menu is closed, we need to allow shortcuts to be triggered even
|
||||
// if the menu item is disabled. So we only disable the menu item when the
|
||||
// menu is open. This matches behavior of |validateUserInterfaceItem|.
|
||||
item.enabled = model->IsEnabledAt(index) || !isMenuOpen_;
|
||||
item.hidden = !model->IsVisibleAt(index);
|
||||
item.enabled = model->IsEnabledAt(index);
|
||||
item.state = model->IsItemCheckedAt(index) ? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
}
|
||||
@@ -557,6 +560,14 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
|
||||
|
||||
- (void)menuWillOpen:(NSMenu*)menu {
|
||||
isMenuOpen_ = YES;
|
||||
|
||||
// macOS automatically injects a duplicate "Toggle Full Screen" menu item
|
||||
// when we set menu.delegate on submenus. Remove hidden duplicates.
|
||||
for (NSMenuItem* item in menu.itemArray) {
|
||||
if (item.isHidden && item.action == @selector(toggleFullScreenMode:))
|
||||
[menu removeItem:item];
|
||||
}
|
||||
|
||||
[self refreshMenuTree:menu];
|
||||
if (model_)
|
||||
model_->MenuWillShow();
|
||||
@@ -567,18 +578,19 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
|
||||
if (!isMenuOpen_)
|
||||
return;
|
||||
|
||||
bool has_close_cb = !popupCloseCallback.is_null();
|
||||
isMenuOpen_ = NO;
|
||||
[self refreshMenuTree:menu];
|
||||
|
||||
// There are two scenarios where we should emit menu-did-close:
|
||||
// 1. It's a popup and the top level menu is closed.
|
||||
// 2. It's an application menu, and the current menu's supermenu
|
||||
// is the top-level menu.
|
||||
bool has_close_cb = !popupCloseCallback.is_null();
|
||||
if (menu != menu_) {
|
||||
if (has_close_cb || menu.supermenu != menu_)
|
||||
return;
|
||||
}
|
||||
|
||||
isMenuOpen_ = NO;
|
||||
if (model_)
|
||||
model_->MenuWillClose();
|
||||
// Post async task so that itemSelected runs before the close callback
|
||||
|
||||
@@ -195,6 +195,7 @@ class InspectableWebContents
|
||||
const std::string& request) override {}
|
||||
void RegisterAidaClientEvent(DispatchCallback callback,
|
||||
const std::string& request) override {}
|
||||
void SetChromeFlag(const std::string& flag_name, bool value) override {}
|
||||
void DispatchHttpRequest(
|
||||
DispatchCallback callback,
|
||||
const DevToolsDispatchHttpRequestParams& params) override {}
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "ui/accessibility/platform/ax_platform_node_win.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr std::string_view kTargetsDataFile = "targets-data.json";
|
||||
@@ -151,6 +155,28 @@ bool ShouldHandleAccessibilityRequestCallback(const std::string& path) {
|
||||
return path == kTargetsDataFile;
|
||||
}
|
||||
|
||||
// Sets boolean values in `data` for each bit in `new_ax_mode` that differs from
|
||||
// that in `last_ax_mode`. Returns `true` if `data` was modified.
|
||||
void SetProcessModeBools(ui::AXMode ax_mode, base::Value::Dict& data) {
|
||||
data.Set(kNative, ax_mode.has_mode(ui::AXMode::kNativeAPIs));
|
||||
data.Set(kWeb, ax_mode.has_mode(ui::AXMode::kWebContents));
|
||||
data.Set(kText, ax_mode.has_mode(ui::AXMode::kInlineTextBoxes));
|
||||
data.Set(kExtendedProperties,
|
||||
ax_mode.has_mode(ui::AXMode::kExtendedProperties));
|
||||
data.Set(kHTML, ax_mode.has_mode(ui::AXMode::kHTML));
|
||||
data.Set(kScreenReader, ax_mode.has_mode(ui::AXMode::kScreenReader));
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Sets values in `data` for the platform node counts in `counts`.
|
||||
void SetNodeCounts(const ui::AXPlatformNodeWin::Counts& counts,
|
||||
base::Value::Dict& data) {
|
||||
data.Set("dormantCount", base::NumberToString(counts.dormant_nodes));
|
||||
data.Set("liveCount", base::NumberToString(counts.live_nodes));
|
||||
data.Set("ghostCount", base::NumberToString(counts.ghost_nodes));
|
||||
}
|
||||
#endif
|
||||
|
||||
void HandleAccessibilityRequestCallback(
|
||||
content::BrowserContext* current_context,
|
||||
ui::AXMode initial_process_mode,
|
||||
@@ -294,6 +320,10 @@ void HandleAccessibilityRequestCallback(
|
||||
}
|
||||
data.Set(kBrowsersField, std::move(window_list));
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
SetNodeCounts(ui::AXPlatformNodeWin::GetCounts(), data);
|
||||
#endif
|
||||
|
||||
std::move(callback).Run(base::MakeRefCounted<base::RefCountedString>(
|
||||
base::WriteJson(data).value_or("")));
|
||||
}
|
||||
@@ -381,8 +411,13 @@ ElectronAccessibilityUI::ElectronAccessibilityUI(content::WebUI* web_ui)
|
||||
|
||||
ElectronAccessibilityUI::~ElectronAccessibilityUI() = default;
|
||||
|
||||
ElectronAccessibilityUIMessageHandler::ElectronAccessibilityUIMessageHandler() =
|
||||
default;
|
||||
ElectronAccessibilityUIMessageHandler::ElectronAccessibilityUIMessageHandler()
|
||||
: update_display_timer_(
|
||||
FROM_HERE,
|
||||
base::Seconds(1),
|
||||
base::BindRepeating(
|
||||
&ElectronAccessibilityUIMessageHandler::OnUpdateDisplayTimer,
|
||||
base::Unretained(this))) {}
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::GetRequestTypeAndFilters(
|
||||
const base::Value::Dict& data,
|
||||
@@ -472,6 +507,10 @@ void ElectronAccessibilityUIMessageHandler::RegisterMessages() {
|
||||
base::BindRepeating(
|
||||
&AccessibilityUIMessageHandler::RequestAccessibilityEvents,
|
||||
base::Unretained(this)));
|
||||
|
||||
auto* web_contents = web_ui()->GetWebContents();
|
||||
Observe(web_contents);
|
||||
OnVisibilityChanged(web_contents->GetVisibility());
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -482,3 +521,45 @@ void ElectronAccessibilityUIMessageHandler::RegisterPrefs(
|
||||
registry->RegisterStringPref(prefs::kShownAccessibilityApiType,
|
||||
std::string(default_api_type));
|
||||
}
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::OnVisibilityChanged(
|
||||
content::Visibility visibility) {
|
||||
if (visibility == content::Visibility::HIDDEN) {
|
||||
update_display_timer_.Stop();
|
||||
} else {
|
||||
update_display_timer_.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::OnUpdateDisplayTimer() {
|
||||
// Collect the current state.
|
||||
base::Value::Dict data;
|
||||
|
||||
SetProcessModeBools(
|
||||
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode(),
|
||||
data);
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
SetNodeCounts(ui::AXPlatformNodeWin::GetCounts(), data);
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
// Compute the delta from the last transmission.
|
||||
for (auto scan = data.begin(); scan != data.end();) {
|
||||
const auto& [new_key, new_value] = *scan;
|
||||
if (const auto* old_value = last_data_.Find(new_key);
|
||||
!old_value || *old_value != new_value) {
|
||||
// This is a new value; remember it for the future.
|
||||
last_data_.Set(new_key, new_value.Clone());
|
||||
++scan;
|
||||
} else {
|
||||
// This is the same as the last value; forget about it.
|
||||
scan = data.erase(scan);
|
||||
}
|
||||
}
|
||||
|
||||
// Transmit any new values to the UI.
|
||||
if (!data.empty()) {
|
||||
AllowJavascript();
|
||||
FireWebUIListener("updateDisplay", data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,19 @@ class ElectronAccessibilityUIMessageHandler
|
||||
std::string& allow_empty,
|
||||
std::string& deny);
|
||||
void RequestNativeUITree(const base::Value::List& args);
|
||||
|
||||
// content::WebContentsObserver:
|
||||
void OnVisibilityChanged(content::Visibility visibility) override;
|
||||
|
||||
// Updates the UI with new data. Called periodically to keep the UI up-to-date
|
||||
// while it is visible.
|
||||
void OnUpdateDisplayTimer();
|
||||
|
||||
// The last data for display sent to the UI by OnUpdateDisplayTimer.
|
||||
base::Value::Dict last_data_;
|
||||
|
||||
// A timer that runs while the UI is visible to call OnUpdateDisplayTimer.
|
||||
base::RepeatingTimer update_display_timer_;
|
||||
};
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_UI_WEBUI_ACCESSIBILITY_UI_H_
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
V(electron_browser_in_app_purchase) \
|
||||
V(electron_browser_menu) \
|
||||
V(electron_browser_message_port) \
|
||||
V(electron_browser_msix_updater) \
|
||||
V(electron_browser_native_theme) \
|
||||
V(electron_browser_notification) \
|
||||
V(electron_browser_power_monitor) \
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -27,8 +29,13 @@
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/escape.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/types/expected.h"
|
||||
#include "components/dbus/thread_linux/dbus_thread_linux.h"
|
||||
#include "components/dbus/utils/call_method.h"
|
||||
#include "components/dbus/utils/check_for_service_and_start.h"
|
||||
#include "components/dbus/xdg/request.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "dbus/bus.h"
|
||||
#include "dbus/message.h"
|
||||
@@ -45,9 +52,6 @@ void OpenFolder(const base::FilePath& full_path);
|
||||
|
||||
namespace {
|
||||
|
||||
const char kMethodListActivatableNames[] = "ListActivatableNames";
|
||||
const char kMethodNameHasOwner[] = "NameHasOwner";
|
||||
|
||||
const char kFreedesktopFileManagerName[] = "org.freedesktop.FileManager1";
|
||||
const char kFreedesktopFileManagerPath[] = "/org/freedesktop/FileManager1";
|
||||
|
||||
@@ -58,6 +62,7 @@ const char kFreedesktopPortalPath[] = "/org/freedesktop/portal/desktop";
|
||||
const char kFreedesktopPortalOpenURI[] = "org.freedesktop.portal.OpenURI";
|
||||
|
||||
const char kMethodOpenDirectory[] = "OpenDirectory";
|
||||
const char kActivationTokenKey[] = "activation_token";
|
||||
|
||||
class ShowItemHelper {
|
||||
public:
|
||||
@@ -72,179 +77,216 @@ class ShowItemHelper {
|
||||
ShowItemHelper& operator=(const ShowItemHelper&) = delete;
|
||||
|
||||
void ShowItemInFolder(const base::FilePath& full_path) {
|
||||
if (!bus_)
|
||||
if (!bus_) {
|
||||
bus_ = dbus_thread_linux::GetSharedSessionBus();
|
||||
|
||||
if (!dbus_proxy_) {
|
||||
dbus_proxy_ = bus_->GetObjectProxy(DBUS_SERVICE_DBUS,
|
||||
dbus::ObjectPath(DBUS_PATH_DBUS));
|
||||
}
|
||||
|
||||
if (prefer_filemanager_interface_.has_value()) {
|
||||
if (prefer_filemanager_interface_.value()) {
|
||||
ShowItemUsingFileManager(full_path);
|
||||
} else {
|
||||
ShowItemUsingFreedesktopPortal(full_path);
|
||||
}
|
||||
} else {
|
||||
CheckFileManagerRunning(full_path);
|
||||
if (api_type_.has_value()) {
|
||||
ShowItemInFolderOnApiTypeSet(full_path);
|
||||
return;
|
||||
}
|
||||
|
||||
bool api_availability_check_in_progress = !pending_requests_.empty();
|
||||
pending_requests_.push(full_path);
|
||||
if (!api_availability_check_in_progress) {
|
||||
// Initiate check to determine if portal or the FileManager API should
|
||||
// be used. The portal API is always preferred if available.
|
||||
dbus_utils::CheckForServiceAndStart(
|
||||
bus_.get(), kFreedesktopPortalName,
|
||||
base::BindOnce(&ShowItemHelper::CheckPortalRunningResponse,
|
||||
// Unretained is safe, the ShowItemHelper instance is
|
||||
// never destroyed.
|
||||
base::Unretained(this)));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void CheckFileManagerRunning(const base::FilePath& full_path) {
|
||||
dbus::MethodCall method_call(DBUS_INTERFACE_DBUS, kMethodNameHasOwner);
|
||||
dbus::MessageWriter writer(&method_call);
|
||||
writer.AppendString(kFreedesktopFileManagerName);
|
||||
enum class ApiType { kNone, kPortal, kFileManager };
|
||||
|
||||
dbus_proxy_->CallMethod(
|
||||
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
||||
base::BindOnce(&ShowItemHelper::CheckFileManagerRunningResponse,
|
||||
base::Unretained(this), full_path));
|
||||
void ShowItemInFolderOnApiTypeSet(const base::FilePath& full_path) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
CHECK(api_type_.has_value());
|
||||
switch (*api_type_) {
|
||||
case ApiType::kPortal:
|
||||
ShowItemUsingPortal(full_path);
|
||||
break;
|
||||
case ApiType::kFileManager:
|
||||
ShowItemUsingFileManager(full_path);
|
||||
break;
|
||||
case ApiType::kNone:
|
||||
OpenParentFolderFallback(full_path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckFileManagerRunningResponse(const base::FilePath& full_path,
|
||||
dbus::Response* response) {
|
||||
if (prefer_filemanager_interface_.has_value()) {
|
||||
ShowItemInFolder(full_path);
|
||||
void ProcessPendingRequests() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (!bus_) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_running = false;
|
||||
|
||||
if (!response) {
|
||||
LOG(ERROR) << "Failed to call " << kMethodNameHasOwner;
|
||||
} else {
|
||||
dbus::MessageReader reader(response);
|
||||
bool owned = false;
|
||||
|
||||
if (!reader.PopBool(&owned)) {
|
||||
LOG(ERROR) << "Failed to read " << kMethodNameHasOwner << " response";
|
||||
} else if (owned) {
|
||||
is_running = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_running) {
|
||||
prefer_filemanager_interface_ = true;
|
||||
ShowItemInFolder(full_path);
|
||||
} else {
|
||||
CheckFileManagerActivatable(full_path);
|
||||
CHECK(!pending_requests_.empty());
|
||||
while (!pending_requests_.empty()) {
|
||||
ShowItemInFolderOnApiTypeSet(pending_requests_.front());
|
||||
pending_requests_.pop();
|
||||
}
|
||||
}
|
||||
|
||||
void CheckFileManagerActivatable(const base::FilePath& full_path) {
|
||||
dbus::MethodCall method_call(DBUS_INTERFACE_DBUS,
|
||||
kMethodListActivatableNames);
|
||||
dbus_proxy_->CallMethod(
|
||||
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
||||
base::BindOnce(&ShowItemHelper::CheckFileManagerActivatableResponse,
|
||||
void CheckPortalRunningResponse(std::optional<bool> is_running) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (is_running.value_or(false)) {
|
||||
api_type_ = ApiType::kPortal;
|
||||
ProcessPendingRequests();
|
||||
} else {
|
||||
// Portal is unavailable.
|
||||
// Check if FileManager is available.
|
||||
dbus_utils::CheckForServiceAndStart(
|
||||
bus_.get(), kFreedesktopFileManagerName,
|
||||
base::BindOnce(&ShowItemHelper::CheckFileManagerRunningResponse,
|
||||
// Unretained is safe, the ShowItemHelper instance is
|
||||
// never destroyed.
|
||||
base::Unretained(this)));
|
||||
}
|
||||
}
|
||||
|
||||
void CheckFileManagerRunningResponse(std::optional<bool> is_running) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (is_running.value_or(false)) {
|
||||
api_type_ = ApiType::kFileManager;
|
||||
} else {
|
||||
// Neither portal nor FileManager is available.
|
||||
api_type_ = ApiType::kNone;
|
||||
}
|
||||
ProcessPendingRequests();
|
||||
}
|
||||
|
||||
void ShowItemUsingPortal(const base::FilePath& full_path) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
CHECK(api_type_.has_value());
|
||||
CHECK_EQ(*api_type_, ApiType::kPortal);
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
FROM_HERE, {base::MayBlock()},
|
||||
base::BindOnce(
|
||||
[](const base::FilePath& full_path) {
|
||||
base::ScopedFD fd(HANDLE_EINTR(
|
||||
open(full_path.value().c_str(), O_RDONLY | O_CLOEXEC)));
|
||||
return fd;
|
||||
},
|
||||
full_path),
|
||||
base::BindOnce(&ShowItemHelper::ShowItemUsingPortalFdOpened,
|
||||
// Unretained is safe, the ShowItemHelper instance is
|
||||
// never destroyed.
|
||||
base::Unretained(this), full_path));
|
||||
}
|
||||
|
||||
void CheckFileManagerActivatableResponse(const base::FilePath& full_path,
|
||||
dbus::Response* response) {
|
||||
if (prefer_filemanager_interface_.has_value()) {
|
||||
ShowItemInFolder(full_path);
|
||||
void ShowItemUsingPortalFdOpened(const base::FilePath& full_path,
|
||||
base::ScopedFD fd) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (!bus_) {
|
||||
return;
|
||||
}
|
||||
if (!fd.is_valid()) {
|
||||
// At least open the parent folder, as long as we're not in the unit
|
||||
// tests.
|
||||
OpenParentFolderFallback(full_path);
|
||||
return;
|
||||
}
|
||||
base::nix::CreateXdgActivationToken(base::BindOnce(
|
||||
&ShowItemHelper::ShowItemUsingPortalWithToken,
|
||||
// Unretained is safe, the ShowItemHelper instance is never destroyed.
|
||||
base::Unretained(this), full_path, std::move(fd)));
|
||||
}
|
||||
|
||||
void ShowItemUsingPortalWithToken(const base::FilePath& full_path,
|
||||
base::ScopedFD fd,
|
||||
std::string activation_token) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (!bus_) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_activatable = false;
|
||||
|
||||
if (!response) {
|
||||
LOG(ERROR) << "Failed to call " << kMethodListActivatableNames;
|
||||
} else {
|
||||
dbus::MessageReader reader(response);
|
||||
std::vector<std::string> names;
|
||||
if (!reader.PopArrayOfStrings(&names)) {
|
||||
LOG(ERROR) << "Failed to read " << kMethodListActivatableNames
|
||||
<< " response";
|
||||
} else if (std::ranges::contains(names, kFreedesktopFileManagerName)) {
|
||||
is_activatable = true;
|
||||
}
|
||||
}
|
||||
|
||||
prefer_filemanager_interface_ = is_activatable;
|
||||
ShowItemInFolder(full_path);
|
||||
}
|
||||
|
||||
void ShowItemUsingFreedesktopPortal(const base::FilePath& full_path) {
|
||||
if (!object_proxy_) {
|
||||
object_proxy_ = bus_->GetObjectProxy(
|
||||
if (!portal_object_proxy_) {
|
||||
portal_object_proxy_ = bus_->GetObjectProxy(
|
||||
kFreedesktopPortalName, dbus::ObjectPath(kFreedesktopPortalPath));
|
||||
}
|
||||
|
||||
base::ScopedFD fd(
|
||||
HANDLE_EINTR(open(full_path.value().c_str(), O_RDONLY | O_CLOEXEC)));
|
||||
if (!fd.is_valid()) {
|
||||
LOG(ERROR) << "Failed to open " << full_path << " for URI portal";
|
||||
dbus_xdg::Dictionary options;
|
||||
options[kActivationTokenKey] =
|
||||
dbus_utils::Variant::Wrap<"s">(activation_token);
|
||||
// In the rare occasion that another request comes in before the response is
|
||||
// received, we will end up overwriting this request object with the new one
|
||||
// and the response from the first request will not be handled in that case.
|
||||
// This should be acceptable as it means the two requests were received too
|
||||
// close to each other from the user and the first one was handled on a best
|
||||
// effort basis.
|
||||
portal_open_directory_request_ = std::make_unique<dbus_xdg::Request>(
|
||||
bus_, portal_object_proxy_, kFreedesktopPortalOpenURI,
|
||||
kMethodOpenDirectory, std::move(options),
|
||||
base::BindOnce(&ShowItemHelper::ShowItemUsingPortalResponse,
|
||||
// Unretained is safe, the ShowItemHelper instance is
|
||||
// never destroyed.
|
||||
base::Unretained(this), full_path),
|
||||
std::string(), std::move(fd));
|
||||
}
|
||||
|
||||
// If the call fails, at least open the parent folder.
|
||||
platform_util::OpenFolder(full_path.DirName());
|
||||
|
||||
return;
|
||||
void ShowItemUsingPortalResponse(
|
||||
const base::FilePath& full_path,
|
||||
base::expected<dbus_xdg::Dictionary, dbus_xdg::ResponseError> results) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
portal_open_directory_request_.reset();
|
||||
if (!results.has_value()) {
|
||||
OpenParentFolderFallback(full_path);
|
||||
}
|
||||
|
||||
dbus::MethodCall open_directory_call(kFreedesktopPortalOpenURI,
|
||||
kMethodOpenDirectory);
|
||||
dbus::MessageWriter writer(&open_directory_call);
|
||||
|
||||
writer.AppendString("");
|
||||
|
||||
// Note that AppendFileDescriptor() duplicates the fd, so we shouldn't
|
||||
// release ownership of it here.
|
||||
writer.AppendFileDescriptor(fd.get());
|
||||
|
||||
dbus::MessageWriter options_writer(nullptr);
|
||||
writer.OpenArray("{sv}", &options_writer);
|
||||
writer.CloseContainer(&options_writer);
|
||||
|
||||
ShowItemUsingBusCall(&open_directory_call, full_path);
|
||||
}
|
||||
|
||||
void ShowItemUsingFileManager(const base::FilePath& full_path) {
|
||||
if (!object_proxy_) {
|
||||
object_proxy_ =
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (!bus_) {
|
||||
return;
|
||||
}
|
||||
CHECK(api_type_.has_value());
|
||||
CHECK_EQ(*api_type_, ApiType::kFileManager);
|
||||
if (!file_manager_object_proxy_) {
|
||||
file_manager_object_proxy_ =
|
||||
bus_->GetObjectProxy(kFreedesktopFileManagerName,
|
||||
dbus::ObjectPath(kFreedesktopFileManagerPath));
|
||||
}
|
||||
|
||||
dbus::MethodCall show_items_call(kFreedesktopFileManagerName,
|
||||
kMethodShowItems);
|
||||
dbus::MessageWriter writer(&show_items_call);
|
||||
|
||||
writer.AppendArrayOfStrings(
|
||||
{"file://" + base::EscapePath(
|
||||
full_path.value())}); // List of file(s) to highlight.
|
||||
writer.AppendString({}); // startup-id
|
||||
|
||||
ShowItemUsingBusCall(&show_items_call, full_path);
|
||||
std::vector<std::string> file_to_highlight{"file://" + full_path.value()};
|
||||
dbus_utils::CallMethod<"ass", "">(
|
||||
file_manager_object_proxy_, kFreedesktopFileManagerName,
|
||||
kMethodShowItems,
|
||||
base::BindOnce(&ShowItemHelper::ShowItemUsingFileManagerResponse,
|
||||
// Unretained is safe, the ShowItemHelper instance is
|
||||
// never destroyed.
|
||||
base::Unretained(this), full_path),
|
||||
std::move(file_to_highlight), /*startup-id=*/"");
|
||||
}
|
||||
|
||||
void ShowItemUsingBusCall(dbus::MethodCall* call,
|
||||
const base::FilePath& full_path) {
|
||||
object_proxy_->CallMethod(
|
||||
call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
||||
base::BindOnce(&ShowItemHelper::ShowItemInFolderResponse,
|
||||
base::Unretained(this), full_path, call->GetMember()));
|
||||
void ShowItemUsingFileManagerResponse(
|
||||
const base::FilePath& full_path,
|
||||
dbus_utils::CallMethodResultSig<""> response) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
if (!response.has_value()) {
|
||||
// If the bus call fails, at least open the parent folder.
|
||||
OpenParentFolderFallback(full_path);
|
||||
}
|
||||
}
|
||||
|
||||
void ShowItemInFolderResponse(const base::FilePath& full_path,
|
||||
const std::string& method,
|
||||
dbus::Response* response) {
|
||||
if (response)
|
||||
return;
|
||||
|
||||
LOG(ERROR) << "Error calling " << method;
|
||||
// If the bus call fails, at least open the parent folder.
|
||||
void OpenParentFolderFallback(const base::FilePath& full_path) {
|
||||
platform_util::OpenFolder(full_path.DirName());
|
||||
}
|
||||
|
||||
scoped_refptr<dbus::Bus> bus_;
|
||||
raw_ptr<dbus::ObjectProxy> dbus_proxy_ = nullptr;
|
||||
raw_ptr<dbus::ObjectProxy> object_proxy_ = nullptr;
|
||||
|
||||
std::optional<bool> prefer_filemanager_interface_;
|
||||
std::optional<ApiType> api_type_;
|
||||
// The proxy objects are owned by `bus_`.
|
||||
raw_ptr<dbus::ObjectProxy> portal_object_proxy_ = nullptr;
|
||||
raw_ptr<dbus::ObjectProxy> file_manager_object_proxy_ = nullptr;
|
||||
std::unique_ptr<dbus_xdg::Request> portal_open_directory_request_;
|
||||
|
||||
// Requests that are queued until the API availability is determined.
|
||||
std::queue<base::FilePath> pending_requests_;
|
||||
};
|
||||
|
||||
// Descriptions pulled from https://linux.die.net/man/1/xdg-open
|
||||
|
||||
@@ -91,7 +91,8 @@ SpellCheckClient::~SpellCheckClient() {
|
||||
|
||||
void SpellCheckClient::RequestCheckingOfText(
|
||||
const blink::WebString& text_to_check,
|
||||
const std::vector<gfx::Range>& /* spelling_markers */,
|
||||
const std::vector<
|
||||
WebTextCheckClient::WebSpellingMarker>& /* spelling_markers */,
|
||||
ShouldForceRefreshTextCheckService /* should_force_refresh */,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completion_callback) {
|
||||
std::u16string text(text_to_check.Utf16());
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "components/spellcheck/common/spelling_marker.h"
|
||||
#include "components/spellcheck/renderer/spellcheck_worditerator.h"
|
||||
#include "third_party/blink/public/platform/web_spell_check_panel_host_client.h"
|
||||
#include "third_party/blink/public/web/web_text_check_client.h"
|
||||
#include "ui/gfx/range/range.h"
|
||||
#include "v8/include/v8-context.h"
|
||||
#include "v8/include/v8-forward.h"
|
||||
#include "v8/include/v8-local-handle.h"
|
||||
@@ -44,7 +44,8 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
|
||||
// blink::WebTextCheckClient:
|
||||
void RequestCheckingOfText(
|
||||
const blink::WebString& text_to_check,
|
||||
const std::vector<gfx::Range>& spelling_markers,
|
||||
const std::vector<WebTextCheckClient::WebSpellingMarker>&
|
||||
spelling_markers,
|
||||
ShouldForceRefreshTextCheckService should_force_refresh,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completion_callback)
|
||||
override;
|
||||
|
||||
@@ -2,7 +2,6 @@ import { app, BrowserWindow, Menu, session, net as electronNet, WebContents, uti
|
||||
|
||||
import { assert, expect } from 'chai';
|
||||
import * as semver from 'semver';
|
||||
import split = require('split')
|
||||
|
||||
import * as cp from 'node:child_process';
|
||||
import { once } from 'node:events';
|
||||
@@ -11,6 +10,7 @@ import * as http from 'node:http';
|
||||
import * as https from 'node:https';
|
||||
import * as net from 'node:net';
|
||||
import * as path from 'node:path';
|
||||
import * as readline from 'node:readline';
|
||||
import { setTimeout } from 'node:timers/promises';
|
||||
import { promisify } from 'node:util';
|
||||
|
||||
@@ -260,11 +260,11 @@ describe('app module', () => {
|
||||
const firstExited = once(first, 'exit');
|
||||
|
||||
// Wait for the first app to boot.
|
||||
const firstStdoutLines = first.stdout.pipe(split());
|
||||
while ((await once(firstStdoutLines, 'data')).toString() !== 'started') {
|
||||
const firstStdoutLines = readline.createInterface({ input: first.stdout });
|
||||
while ((await once(firstStdoutLines, 'line')).toString() !== 'started') {
|
||||
// wait.
|
||||
}
|
||||
const additionalDataPromise = once(firstStdoutLines, 'data');
|
||||
const additionalDataPromise = once(firstStdoutLines, 'line');
|
||||
|
||||
const secondInstanceArgs = [process.execPath, appPath, ...testArgs.args, '--some-switch', 'some-arg'];
|
||||
const second = cp.spawn(secondInstanceArgs[0], secondInstanceArgs.slice(1));
|
||||
|
||||
336
spec/api-autoupdater-msix-spec.ts
Normal file
336
spec/api-autoupdater-msix-spec.ts
Normal file
@@ -0,0 +1,336 @@
|
||||
import { expect } from 'chai';
|
||||
import * as express from 'express';
|
||||
|
||||
import * as http from 'node:http';
|
||||
import { AddressInfo } from 'node:net';
|
||||
|
||||
import {
|
||||
getElectronExecutable,
|
||||
getMainJsFixturePath,
|
||||
getMsixFixturePath,
|
||||
getMsixPackageVersion,
|
||||
installMsixCertificate,
|
||||
installMsixPackage,
|
||||
registerExecutableWithIdentity,
|
||||
shouldRunMsixTests,
|
||||
spawn,
|
||||
uninstallMsixPackage,
|
||||
unregisterExecutableWithIdentity
|
||||
} from './lib/msix-helpers';
|
||||
import { ifdescribe } from './lib/spec-helpers';
|
||||
|
||||
const ELECTRON_MSIX_ALIAS = 'ElectronMSIX.exe';
|
||||
const MAIN_JS_PATH = getMainJsFixturePath();
|
||||
const MSIX_V1 = getMsixFixturePath('v1');
|
||||
const MSIX_V2 = getMsixFixturePath('v2');
|
||||
|
||||
// We can only test the MSIX updater on Windows
|
||||
ifdescribe(shouldRunMsixTests)('autoUpdater MSIX behavior', function () {
|
||||
this.timeout(120000);
|
||||
|
||||
before(async function () {
|
||||
await installMsixCertificate();
|
||||
|
||||
const electronExec = getElectronExecutable();
|
||||
await registerExecutableWithIdentity(electronExec);
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
await unregisterExecutableWithIdentity();
|
||||
});
|
||||
|
||||
const launchApp = (executablePath: string, args: string[] = []) => {
|
||||
return spawn(executablePath, args);
|
||||
};
|
||||
|
||||
const logOnError = (what: any, fn: () => void) => {
|
||||
try {
|
||||
fn();
|
||||
} catch (err) {
|
||||
console.error(what);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
it('should launch Electron via MSIX alias', async () => {
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, ['--version']);
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('should print package identity information', async () => {
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [MAIN_JS_PATH, '--printPackageId']);
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(launchResult.out).to.include('Family Name: Electron.Dev.MSIX_rdjwn13tdj8dy');
|
||||
expect(launchResult.out).to.include('Package ID: Electron.Dev.MSIX_1.0.0.0_x64__rdjwn13tdj8dy');
|
||||
expect(launchResult.out).to.include('Version: 1.0.0.0');
|
||||
});
|
||||
});
|
||||
|
||||
describe('with update server', () => {
|
||||
let port = 0;
|
||||
let server: express.Application = null as any;
|
||||
let httpServer: http.Server = null as any;
|
||||
let requests: express.Request[] = [];
|
||||
|
||||
beforeEach((done) => {
|
||||
requests = [];
|
||||
server = express();
|
||||
server.use((req, res, next) => {
|
||||
requests.push(req);
|
||||
next();
|
||||
});
|
||||
httpServer = server.listen(0, '127.0.0.1', () => {
|
||||
port = (httpServer.address() as AddressInfo).port;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (httpServer) {
|
||||
await new Promise<void>(resolve => {
|
||||
httpServer.close(() => {
|
||||
httpServer = null as any;
|
||||
server = null as any;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
await uninstallMsixPackage('com.electron.myapp');
|
||||
});
|
||||
|
||||
it('should not update when no update is available', async () => {
|
||||
server.get('/update-check', (req, res) => {
|
||||
res.status(204).send();
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [MAIN_JS_PATH, '--checkUpdate', `http://localhost:${port}/update-check`]);
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update not available');
|
||||
});
|
||||
});
|
||||
|
||||
it('should hit the update endpoint with custom headers when checkForUpdates is called', async () => {
|
||||
server.get('/update-check', (req, res) => {
|
||||
expect(req.headers['x-appversion']).to.equal('1.0.0');
|
||||
expect(req.headers.authorization).to.equal('Bearer test-token');
|
||||
res.status(204).send();
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [
|
||||
MAIN_JS_PATH,
|
||||
'--checkUpdate',
|
||||
`http://localhost:${port}/update-check`,
|
||||
'--useCustomHeaders'
|
||||
]);
|
||||
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update not available');
|
||||
});
|
||||
});
|
||||
|
||||
it('should update successfully with direct link to MSIX file', async () => {
|
||||
await installMsixPackage(MSIX_V1);
|
||||
const initialVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(initialVersion).to.equal('1.0.0.0');
|
||||
|
||||
server.get('/update.msix', (req, res) => {
|
||||
res.download(MSIX_V2);
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [
|
||||
MAIN_JS_PATH,
|
||||
'--checkUpdate',
|
||||
`http://localhost:${port}/update.msix`
|
||||
]);
|
||||
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update available');
|
||||
expect(launchResult.out).to.include('Update downloaded');
|
||||
expect(launchResult.out).to.include('Release Name: N/A');
|
||||
expect(launchResult.out).to.include('Release Notes: N/A');
|
||||
expect(launchResult.out).to.include(`Update URL: http://localhost:${port}/update.msix`);
|
||||
});
|
||||
|
||||
const updatedVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(updatedVersion).to.equal('2.0.0.0');
|
||||
});
|
||||
|
||||
it('should update successfully with JSON response', async () => {
|
||||
await installMsixPackage(MSIX_V1);
|
||||
const initialVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(initialVersion).to.equal('1.0.0.0');
|
||||
|
||||
const fixedPubDate = '2011-11-11T11:11:11.000Z';
|
||||
const expectedDateStr = new Date(fixedPubDate).toDateString();
|
||||
|
||||
server.get('/update-check', (req, res) => {
|
||||
res.json({
|
||||
url: `http://localhost:${port}/update.msix`,
|
||||
name: '2.0.0',
|
||||
notes: 'Test release notes',
|
||||
pub_date: fixedPubDate
|
||||
});
|
||||
});
|
||||
|
||||
server.get('/update.msix', (req, res) => {
|
||||
res.download(MSIX_V2);
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [MAIN_JS_PATH, '--checkUpdate', `http://localhost:${port}/update-check`]);
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update available');
|
||||
expect(launchResult.out).to.include('Update downloaded');
|
||||
expect(launchResult.out).to.include('Release Name: 2.0.0');
|
||||
expect(launchResult.out).to.include('Release Notes: Test release notes');
|
||||
expect(launchResult.out).to.include(`Release Date: ${expectedDateStr}`);
|
||||
expect(launchResult.out).to.include(`Update URL: http://localhost:${port}/update.msix`);
|
||||
});
|
||||
|
||||
const updatedVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(updatedVersion).to.equal('2.0.0.0');
|
||||
});
|
||||
|
||||
it('should update successfully with static JSON releases file', async () => {
|
||||
await installMsixPackage(MSIX_V1);
|
||||
const initialVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(initialVersion).to.equal('1.0.0.0');
|
||||
|
||||
const fixedPubDate = '2011-11-11T11:11:11.000Z';
|
||||
const expectedDateStr = new Date(fixedPubDate).toDateString();
|
||||
|
||||
server.get('/update-check', (req, res) => {
|
||||
res.json({
|
||||
currentRelease: '2.0.0',
|
||||
releases: [
|
||||
{
|
||||
version: '1.0.0',
|
||||
updateTo: {
|
||||
version: '1.0.0',
|
||||
url: `http://localhost:${port}/update-v1.msix`,
|
||||
name: '1.0.0',
|
||||
notes: 'Initial release',
|
||||
pub_date: '2010-10-10T10:10:10.000Z'
|
||||
}
|
||||
},
|
||||
{
|
||||
version: '2.0.0',
|
||||
updateTo: {
|
||||
version: '2.0.0',
|
||||
url: `http://localhost:${port}/update-v2.msix`,
|
||||
name: '2.0.0',
|
||||
notes: 'Test release notes for static format',
|
||||
pub_date: fixedPubDate
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
server.get('/update-v2.msix', (req, res) => {
|
||||
res.download(MSIX_V2);
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [MAIN_JS_PATH, '--checkUpdate', `http://localhost:${port}/update-check`]);
|
||||
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update available');
|
||||
expect(launchResult.out).to.include('Update downloaded');
|
||||
expect(launchResult.out).to.include('Release Name: 2.0.0');
|
||||
expect(launchResult.out).to.include('Release Notes: Test release notes for static format');
|
||||
expect(launchResult.out).to.include(`Release Date: ${expectedDateStr}`);
|
||||
expect(launchResult.out).to.include(`Update URL: http://localhost:${port}/update-v2.msix`);
|
||||
});
|
||||
|
||||
const updatedVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(updatedVersion).to.equal('2.0.0.0');
|
||||
});
|
||||
|
||||
it('should not update with update File JSON Format if currentRelease is older than installed version', async () => {
|
||||
await installMsixPackage(MSIX_V2);
|
||||
|
||||
server.get('/update-check', (req, res) => {
|
||||
res.json({
|
||||
currentRelease: '1.0.0',
|
||||
releases: [
|
||||
{
|
||||
version: '1.0.0',
|
||||
updateTo: {
|
||||
version: '1.0.0',
|
||||
url: `http://localhost:${port}/update-v1.msix`,
|
||||
name: '1.0.0',
|
||||
notes: 'Initial release',
|
||||
pub_date: '2010-10-10T10:10:10.000Z'
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [MAIN_JS_PATH, '--checkUpdate', `http://localhost:${port}/update-check`]);
|
||||
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update not available');
|
||||
});
|
||||
});
|
||||
|
||||
it('should downgrade to older version with JSON server format and allowAnyVersion is true', async () => {
|
||||
await installMsixPackage(MSIX_V2);
|
||||
const initialVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(initialVersion).to.equal('2.0.0.0');
|
||||
|
||||
const fixedPubDate = '2010-10-10T10:10:10.000Z';
|
||||
const expectedDateStr = new Date(fixedPubDate).toDateString();
|
||||
|
||||
server.get('/update-check', (req, res) => {
|
||||
res.json({
|
||||
url: `http://localhost:${port}/update-v1.msix`,
|
||||
name: '1.0.0',
|
||||
notes: 'Initial release',
|
||||
pub_date: fixedPubDate
|
||||
});
|
||||
});
|
||||
|
||||
server.get('/update-v1.msix', (req, res) => {
|
||||
res.download(MSIX_V1);
|
||||
});
|
||||
|
||||
const launchResult = await launchApp(ELECTRON_MSIX_ALIAS, [MAIN_JS_PATH, '--checkUpdate', `http://localhost:${port}/update-check`, '--allowAnyVersion']);
|
||||
|
||||
logOnError(launchResult, () => {
|
||||
expect(launchResult.code).to.equal(0);
|
||||
expect(requests.length).to.be.greaterThan(0);
|
||||
expect(launchResult.out).to.include('Checking for update...');
|
||||
expect(launchResult.out).to.include('Update available');
|
||||
expect(launchResult.out).to.include('Update downloaded');
|
||||
expect(launchResult.out).to.include('Release Name: 1.0.0');
|
||||
expect(launchResult.out).to.include('Release Notes: Initial release');
|
||||
expect(launchResult.out).to.include(`Release Date: ${expectedDateStr}`);
|
||||
expect(launchResult.out).to.include(`Update URL: http://localhost:${port}/update-v1.msix`);
|
||||
});
|
||||
|
||||
const downgradedVersion = await getMsixPackageVersion('com.electron.myapp');
|
||||
expect(downgradedVersion).to.equal('1.0.0.0');
|
||||
});
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user