mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
101 Commits
clavin/rem
...
sckp-macos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e364a20ba1 | ||
|
|
6b6ef0b9ef | ||
|
|
bb092132be | ||
|
|
0cdf1012bb | ||
|
|
eaa952361c | ||
|
|
8ef66cade3 | ||
|
|
2fb1bfec42 | ||
|
|
65864f6203 | ||
|
|
75eb7aabd6 | ||
|
|
f8aae32c6c | ||
|
|
3e6834099e | ||
|
|
3d5d5f5cb0 | ||
|
|
3268c6ba76 | ||
|
|
50f96692df | ||
|
|
53a7802e95 | ||
|
|
b6c4c727d1 | ||
|
|
4aa9773388 | ||
|
|
7b6b5bf224 | ||
|
|
bd1ed17c02 | ||
|
|
813fc3af58 | ||
|
|
e7675a1a1c | ||
|
|
729ca429b8 | ||
|
|
da56809b62 | ||
|
|
12ca8b30be | ||
|
|
56d4433e46 | ||
|
|
0ee7150832 | ||
|
|
d424c3aee7 | ||
|
|
e4d660af86 | ||
|
|
2efd75e2ca | ||
|
|
b13f05e2dc | ||
|
|
dcbab692c0 | ||
|
|
71f3ff6bf2 | ||
|
|
ff0a14a7c6 | ||
|
|
4bf99c9bea | ||
|
|
9513486bf3 | ||
|
|
bea7d618f1 | ||
|
|
4ad20ccb39 | ||
|
|
73a017577e | ||
|
|
2d8a547692 | ||
|
|
5f0603ed28 | ||
|
|
afca4e271e | ||
|
|
30d2fadb28 | ||
|
|
3271b82094 | ||
|
|
c0e180758b | ||
|
|
5817d27429 | ||
|
|
4812b4e6c2 | ||
|
|
7c0b7b417b | ||
|
|
785fe5f3b6 | ||
|
|
502a6b0166 | ||
|
|
4a28e60e89 | ||
|
|
a90d50e13f | ||
|
|
962d8b325a | ||
|
|
c813bc2a92 | ||
|
|
5ce41bac8d | ||
|
|
6bc7bde229 | ||
|
|
2de8fd7d93 | ||
|
|
dcd319cfbe | ||
|
|
cd56b96544 | ||
|
|
22262c14f1 | ||
|
|
6e056709be | ||
|
|
2f63b20acf | ||
|
|
eb126eecb0 | ||
|
|
4e1a915f1a | ||
|
|
f2b09ff0bd | ||
|
|
b0c11371e0 | ||
|
|
9b2e7db469 | ||
|
|
f04c06a0db | ||
|
|
8ac061ebe7 | ||
|
|
b30f31e1f6 | ||
|
|
288ef37b1d | ||
|
|
20414f66ca | ||
|
|
458b14b8ed | ||
|
|
530ccfe350 | ||
|
|
041ada1586 | ||
|
|
d987bee007 | ||
|
|
431a791a99 | ||
|
|
9441cf4627 | ||
|
|
bb1c3dff21 | ||
|
|
49a27cba6b | ||
|
|
99c943df23 | ||
|
|
8c11764800 | ||
|
|
54136042c6 | ||
|
|
28ed8a821a | ||
|
|
ec9b589402 | ||
|
|
2a7133b7a6 | ||
|
|
64158114aa | ||
|
|
e8631b2f3a | ||
|
|
21ad7cdda5 | ||
|
|
add374ef6a | ||
|
|
eac270bea7 | ||
|
|
36ec9d7236 | ||
|
|
3041fd66cd | ||
|
|
b504f65ace | ||
|
|
5cb87b7110 | ||
|
|
d19cac6772 | ||
|
|
eac1a7ff68 | ||
|
|
00089a951b | ||
|
|
b8d0f18ff8 | ||
|
|
96c2022483 | ||
|
|
ff05d4a96c | ||
|
|
989918a59c |
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -13,7 +13,7 @@ Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.
|
||||
- [ ] PR description included and stakeholders cc'd
|
||||
- [ ] `npm test` passes
|
||||
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
|
||||
- [ ] relevant documentation, tutorials, templates and examples are changed or added
|
||||
- [ ] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
|
||||
- [ ] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).
|
||||
|
||||
#### Release Notes
|
||||
|
||||
8
.github/actions/checkout/action.yml
vendored
8
.github/actions/checkout/action.yml
vendored
@@ -18,10 +18,10 @@ runs:
|
||||
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Get Depot Tools
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -99,7 +99,7 @@ runs:
|
||||
fi
|
||||
|
||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vv
|
||||
if [ "${{ inputs.is-release }}" != "true" && -n "${{ env.PATCH_UP_APP_CREDS }}" ]; then
|
||||
if [[ "${{ inputs.is-release }}" != "true" ]]; then
|
||||
# Re-export all the patches to check if there were changes.
|
||||
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||
cd src/electron
|
||||
@@ -128,6 +128,8 @@ runs:
|
||||
cat ../../patches/update-patches.patch
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "No changes to patches detected"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
9
.github/workflows/branch-created.yml
vendored
9
.github/workflows/branch-created.yml
vendored
@@ -94,7 +94,7 @@ jobs:
|
||||
}))
|
||||
- name: Create Release Project Board
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/copy-project@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/copy-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
id: create-release-board
|
||||
with:
|
||||
drafts: true
|
||||
@@ -114,14 +114,15 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Find Previous Release Project Board
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/find-project@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/find-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
id: find-prev-release-board
|
||||
with:
|
||||
fail-if-project-not-found: false
|
||||
title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Close Previous Release Project Board
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/close-project@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
if: ${{ steps.find-prev-release-board.outputs.number }}
|
||||
uses: dsanders11/project-actions/close-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -30,7 +30,7 @@ on:
|
||||
required: false
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- sckp-macos15
|
||||
- '[1-9][0-9]-x-y'
|
||||
pull_request:
|
||||
|
||||
|
||||
2
.github/workflows/issue-commented.yml
vendored
2
.github/workflows/issue-commented.yml
vendored
@@ -10,7 +10,7 @@ permissions: {}
|
||||
jobs:
|
||||
issue-commented:
|
||||
name: Remove blocked/{need-info,need-repro} on comment
|
||||
if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
|
||||
if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
|
||||
4
.github/workflows/issue-labeled.yml
vendored
4
.github/workflows/issue-labeled.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
|
||||
2
.github/workflows/issue-opened.yml
vendored
2
.github/workflows/issue-opened.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Add to Issue Triage
|
||||
uses: dsanders11/project-actions/add-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/add-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
field: Reporter
|
||||
field-value: ${{ github.event.issue.user.login }}
|
||||
|
||||
2
.github/workflows/issue-transferred.yml
vendored
2
.github/workflows/issue-transferred.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Remove from issue triage
|
||||
uses: dsanders11/project-actions/delete-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/delete-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
|
||||
2
.github/workflows/issue-unlabeled.yml
vendored
2
.github/workflows/issue-unlabeled.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
||||
org: electron
|
||||
- name: Set status
|
||||
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
||||
uses: dsanders11/project-actions/edit-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
|
||||
@@ -147,12 +147,12 @@ jobs:
|
||||
echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
|
||||
echo "IS_ASAN=true" >> $GITHUB_ENV
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
- name: Download Src Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
|
||||
@@ -51,6 +51,8 @@ jobs:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
@@ -58,8 +60,6 @@ jobs:
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
@@ -70,12 +70,12 @@ jobs:
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
- name: Download Src Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
@@ -133,12 +133,12 @@ jobs:
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
- name: Download Src Artifacts
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
|
||||
2
.github/workflows/pull-request-labeled.yml
vendored
2
.github/workflows/pull-request-labeled.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 94
|
||||
|
||||
2
.github/workflows/scorecards.yml
vendored
2
.github/workflows/scorecards.yml
vendored
@@ -50,6 +50,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
|
||||
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
2
.github/workflows/stable-prep-items.yml
vendored
2
.github/workflows/stable-prep-items.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number')
|
||||
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
|
||||
- name: Update Completed Stable Prep Items
|
||||
uses: dsanders11/project-actions/completed-by@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
|
||||
uses: dsanders11/project-actions/completed-by@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||
with:
|
||||
field: Prep Status
|
||||
field-value: ✅ Complete
|
||||
|
||||
2
DEPS
2
DEPS
@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'135.0.7037.0',
|
||||
'136.0.7067.0',
|
||||
'node_version':
|
||||
'v22.14.0',
|
||||
'nan_version':
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
||||
node_module_version = 133
|
||||
node_module_version = 135
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_embedder_string = "-electron.0"
|
||||
@@ -73,5 +73,3 @@ enterprise_cloud_content_analysis = false
|
||||
# TODO: remove dependency on legacy ipc
|
||||
# https://issues.chromium.org/issues/40943039
|
||||
content_enable_legacy_ipc = true
|
||||
|
||||
clang_unsafe_buffers_paths = "//electron/electron_unsafe_buffers_paths.txt"
|
||||
|
||||
@@ -45,7 +45,7 @@ def windows_profile():
|
||||
win_sdk_dir = SetEnvironmentAndGetSDKDir()
|
||||
path = NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH'])
|
||||
|
||||
# since current windows executable are symbols path dependant,
|
||||
# since current windows executable are symbols path dependent,
|
||||
# profile the current directory too
|
||||
return {
|
||||
'pwd': os.getcwd(),
|
||||
|
||||
@@ -1559,8 +1559,8 @@ command line arguments that Chromium uses.
|
||||
|
||||
### `app.dock` _macOS_ _Readonly_
|
||||
|
||||
A [`Dock`](./dock.md) `| undefined` object that allows you to perform actions on your app icon in the user's
|
||||
dock on macOS.
|
||||
A `Dock | undefined` property ([`Dock`](./dock.md) on macOS, `undefined` on all other
|
||||
platforms) that allows you to perform actions on your app icon in the user's dock.
|
||||
|
||||
### `app.isPackaged` _Readonly_
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ app.whenReady().then(() => {
|
||||
|
||||
session.defaultSession.setDisplayMediaRequestHandler((request, callback) => {
|
||||
desktopCapturer.getSources({ types: ['screen'] }).then((sources) => {
|
||||
// Grant access to the first screen found.
|
||||
// Your app shows some UI, but in this example
|
||||
// grant access to the first screen found.
|
||||
callback({ video: sources[0], audio: 'loopback' })
|
||||
})
|
||||
// If true, use the system picker if available.
|
||||
@@ -42,7 +43,8 @@ startButton.addEventListener('click', () => {
|
||||
video: {
|
||||
width: 320,
|
||||
height: 240,
|
||||
frameRate: 30
|
||||
frameRate: 30,
|
||||
displaySurface: 'monitor'
|
||||
}
|
||||
}).then(stream => {
|
||||
video.srcObject = stream
|
||||
@@ -98,6 +100,16 @@ which can detected by [`systemPreferences.getMediaAccessStatus`][].
|
||||
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
|
||||
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-windows-macos
|
||||
|
||||
### `desktopCapturer.isDisplayMediaSystemPickerAvailable()` _Experimental_ _macOS_
|
||||
|
||||
Returns `Boolean`, whether or not requesting desktop content via
|
||||
the system picker is supported on this platform.
|
||||
|
||||
Currently this will only return `true` on macOS 14.4 and higher. When
|
||||
true, use the `getNativePickerSource` method to return the system picker's
|
||||
selected media stream. Not doing so may cause a warning dialog to your users
|
||||
on macOS 15 and higher.
|
||||
|
||||
## Caveats
|
||||
|
||||
`navigator.mediaDevices.getUserMedia` does not work on macOS for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a [signed kernel extension](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/KernelExtensions/KernelExtensions.html). Chromium, and by extension Electron, does not provide this.
|
||||
|
||||
@@ -228,7 +228,7 @@ The `filters` specifies an array of file types that can be displayed, see
|
||||
**Note:** On macOS, using the asynchronous version is recommended to avoid issues when
|
||||
expanding and collapsing the dialog.
|
||||
|
||||
### `dialog.showMessageBoxSync([wndow, ]options)`
|
||||
### `dialog.showMessageBoxSync([window, ]options)`
|
||||
|
||||
* `window` [BaseWindow](base-window.md) (optional)
|
||||
* `options` Object
|
||||
|
||||
@@ -46,6 +46,10 @@ An [`IpcMainServiceWorker`](ipc-main-service-worker.md) instance scoped to the s
|
||||
|
||||
A `string` representing the scope URL of the service worker.
|
||||
|
||||
#### `serviceWorker.scriptURL` _Readonly_ _Experimental_
|
||||
|
||||
A `string` representing the script URL of the service worker.
|
||||
|
||||
#### `serviceWorker.versionId` _Readonly_ _Experimental_
|
||||
|
||||
A `number` representing the ID of the specific version of the service worker script in its scope.
|
||||
|
||||
@@ -651,7 +651,7 @@ Clears the session’s HTTP cache.
|
||||
`shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not
|
||||
specified, clear all storage types.
|
||||
* `quotas` string[] (optional) - The types of quotas to clear, can be
|
||||
`temporary`, `syncable`. If not specified, clear all quotas.
|
||||
`temporary`. If not specified, clear all quotas.
|
||||
|
||||
Returns `Promise<void>` - resolves when the storage data has been cleared.
|
||||
|
||||
@@ -971,6 +971,7 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
|
||||
* `videoRequested` Boolean - true if the web content requested a video stream.
|
||||
* `audioRequested` Boolean - true if the web content requested an audio stream.
|
||||
* `userGesture` Boolean - Whether a user gesture was active when this request was triggered.
|
||||
* `preferredDisplaySurface` String - The preferred display used for sharing screen in this request.
|
||||
* `callback` Function
|
||||
* `streams` Object
|
||||
* `video` Object | [WebFrameMain](web-frame-main.md) (optional)
|
||||
|
||||
@@ -898,6 +898,8 @@ copying data between CPU and GPU memory, with Chromium's hardware acceleration s
|
||||
Only a limited number of textures can exist at the same time, so it's important that you call `texture.release()` as soon as you're done with the texture.
|
||||
By managing the texture lifecycle by yourself, you can safely pass the `texture.textureInfo` to other processes through IPC.
|
||||
|
||||
More details can be found in the [offscreen rendering tutorial](../tutorial/offscreen-rendering.md). To learn about how to handle the texture in native code, refer to [offscreen rendering's code documentation.](https://github.com/electron/electron/blob/main/shell/browser/osr/README.md).
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
@@ -909,7 +911,7 @@ win.webContents.on('paint', async (e, dirty, image) => {
|
||||
await new Promise(resolve => setTimeout(resolve, 50))
|
||||
|
||||
// You can send the native texture handle to native code for importing into your rendering pipeline.
|
||||
// For example: https://github.com/electron/electron/tree/main/spec/fixtures/native-addon/osr-gpu
|
||||
// Read more at https://github.com/electron/electron/blob/main/shell/browser/osr/README.md
|
||||
// importTextureHandle(dirty, e.texture.textureInfo)
|
||||
|
||||
// You must call `e.texture.release()` as soon as possible, before the underlying frame pool is drained.
|
||||
@@ -2389,9 +2391,14 @@ A [`WebFrameMain`](web-frame-main.md) property that represents the top frame of
|
||||
|
||||
#### `contents.opener` _Readonly_
|
||||
|
||||
A [`WebFrameMain`](web-frame-main.md) property that represents the frame that opened this WebContents, either
|
||||
A [`WebFrameMain | null`](web-frame-main.md) property that represents the frame that opened this WebContents, either
|
||||
with open(), or by navigating a link with a target attribute.
|
||||
|
||||
#### `contents.focusedFrame` _Readonly_
|
||||
|
||||
A [`WebFrameMain | null`](web-frame-main.md) property that represents the currently focused frame in this WebContents.
|
||||
Can be the top frame, an inner `<iframe>`, or `null` if nothing is focused.
|
||||
|
||||
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
||||
|
||||
@@ -14,6 +14,37 @@ This document uses the following convention to categorize breaking changes:
|
||||
|
||||
## Planned Breaking API Changes (36.0)
|
||||
|
||||
### Utility Process unhandled rejection behavior change
|
||||
|
||||
Utility Processes will now warn with an error message when an unhandled
|
||||
rejection occurs instead of crashing the process.
|
||||
|
||||
To restore the previous behavior, you can use:
|
||||
|
||||
```js
|
||||
process.on('unhandledRejection', () => {
|
||||
process.exit(1)
|
||||
})
|
||||
```
|
||||
|
||||
### Removed:`isDefault` and `status` properties on `PrinterInfo`
|
||||
|
||||
These properties have been removed from the PrinterInfo Object
|
||||
because they have been removed from upstream Chromium.
|
||||
|
||||
### Removed: `quota` type `syncable` in `Session.clearStorageData(options)`
|
||||
|
||||
When calling `Session.clearStorageData(options)`, the `options.quota` type
|
||||
`syncable` is no longer supported because it has been
|
||||
[removed](https://chromium-review.googlesource.com/c/chromium/src/+/6309405)
|
||||
from upstream Chromium.
|
||||
|
||||
### Deprecated: `quota` property in `Session.clearStorageData(options)`
|
||||
|
||||
When calling `Session.clearStorageData(options)`, the `options.quota`
|
||||
property is deprecated. Since the `syncable` type was removed, there
|
||||
is only type left -- `'temporary'` -- so specifying it is unnecessary.
|
||||
|
||||
### Deprecated: Extension methods and events on `session`
|
||||
|
||||
`session.loadExtension`, `session.removeExtension`, `session.getExtension`,
|
||||
@@ -30,10 +61,15 @@ https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw#disabling-dw
|
||||
|
||||
## Planned Breaking API Changes (35.0)
|
||||
|
||||
### Removed:`isDefault` and `status` properties on `PrinterInfo`
|
||||
### Behavior Changed: Dialog API's `defaultPath` option on Linux
|
||||
|
||||
These properties have been removed from the PrinterInfo Object
|
||||
because they have been removed from upstream Chromium.
|
||||
On Linux, the required portal version for file dialogs has been reverted
|
||||
to 3 from 4. Using the `defaultPath` option of the Dialog API is not
|
||||
supported when using portal file chooser dialogs unless the portal
|
||||
backend is version 4 or higher. The `--xdg-portal-required-version`
|
||||
[command-line switch](/api/command-line-switches.md#--xdg-portal-required-versionversion)
|
||||
can be used to force a required version for your application.
|
||||
See [#44426](https://github.com/electron/electron/pull/44426) for more details.
|
||||
|
||||
### Deprecated: `getFromVersionID` on `session.serviceWorkers`
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ Verify that the Pull Request is correct and make a corresponding entry in the
|
||||
API History:
|
||||
|
||||
> [!NOTE]
|
||||
> Refer to the [API History section of `styleguide.md`](../styleguide.md#api-history)
|
||||
> Refer to the [API History section of `style-guide.md`](./style-guide.md#api-history)
|
||||
for information on how to create API History blocks.
|
||||
|
||||
`````markdown
|
||||
|
||||
@@ -195,7 +195,7 @@ required[, optional]
|
||||
More detailed information on each of the arguments is noted in an unordered list
|
||||
below the method. The type of argument is notated by either JavaScript primitives
|
||||
(e.g. `string`, `Promise`, or `Object`), a custom API structure like Electron's
|
||||
[`Cookie`](api/structures/cookie.md), or the wildcard `any`.
|
||||
[`Cookie`](../api/structures/cookie.md), or the wildcard `any`.
|
||||
|
||||
If the argument is of type `Array`, use `[]` shorthand with the type of value
|
||||
inside the array (for example,`any[]` or `string[]`).
|
||||
@@ -290,7 +290,7 @@ The purpose of the API History block is to describe when/where/how/why an API wa
|
||||
Each API change listed in the block should include a link to the
|
||||
PR where that change was made along with an optional short description of the
|
||||
change. If applicable, include the [heading id](https://gist.github.com/asabaylus/3071099)
|
||||
for that change from the [breaking changes documentation](./breaking-changes.md).
|
||||
for that change from the [breaking changes documentation](../breaking-changes.md).
|
||||
|
||||
The [API History linting script][api-history-linting-script] (`lint:api-history`)
|
||||
validates API History blocks in the Electron documentation against the schema and
|
||||
@@ -4,7 +4,7 @@ function createWindow () {
|
||||
const win = new BrowserWindow({
|
||||
// remove the default titlebar
|
||||
titleBarStyle: 'hidden',
|
||||
// expose window controlls in Windows/Linux
|
||||
// expose window controls in Windows/Linux
|
||||
...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {})
|
||||
})
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ function createWindow () {
|
||||
const win = new BrowserWindow({
|
||||
// remove the default titlebar
|
||||
titleBarStyle: 'hidden',
|
||||
// expose window controlls in Windows/Linux
|
||||
// expose window controls in Windows/Linux
|
||||
...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {})
|
||||
})
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ function createWindow () {
|
||||
const win = new BrowserWindow({
|
||||
// remove the default titlebar
|
||||
titleBarStyle: 'hidden',
|
||||
// expose window controlls in Windows/Linux
|
||||
// expose window controls in Windows/Linux
|
||||
...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {})
|
||||
})
|
||||
win.loadURL('https://example.com')
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Application windows have a default [chrome][] applied by the OS. Not to be confused
|
||||
with the Google Chrome browser, window _chrome_ refers to the parts of the window (e.g.
|
||||
title bar, toolbars, controls) that are not a part of the main web content. While the
|
||||
default title bar provided by the OS chrome is sufficent for simple use cases, many
|
||||
default title bar provided by the OS chrome is sufficient for simple use cases, many
|
||||
applications opt to remove it. Implementing a custom title bar can help your application
|
||||
feel more modern and consistent across platforms.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ To create a frameless window, set the [`BaseWindowContructorOptions`][] `frame`
|
||||
|
||||
To create a fully transparent window, set the [`BaseWindowContructorOptions`][] `transparent` param in the `BrowserWindow` constructor to `true`.
|
||||
|
||||
The following fiddle takes advantage of a tranparent window and CSS styling to create
|
||||
The following fiddle takes advantage of a transparent window and CSS styling to create
|
||||
the illusion of a circular window.
|
||||
|
||||
```fiddle docs/fiddles/features/window-customization/custom-window-styles/transparent-windows
|
||||
|
||||
@@ -9,10 +9,11 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
|
||||
|
||||
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
|
||||
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
|
||||
| 35.0.0 | 2025-Jan-16 | 2025-Feb-05 | 2025-Mar-04 | 2025-Sep-02 | M134 | TBD | ✅ |
|
||||
| 36.0.0 | 2025-Mar-06 | 2025-Apr-02 | 2025-Apr-29 | 2025-Oct-28 | M136 | TBD | ✅ |
|
||||
| 35.0.0 | 2025-Jan-16 | 2025-Feb-05 | 2025-Mar-04 | 2025-Sep-02 | M134 | v22.14 | ✅ |
|
||||
| 34.0.0 | 2024-Oct-17 | 2024-Nov-13 | 2025-Jan-14 | 2025-Jun-24 | M132 | v20.18 | ✅ |
|
||||
| 33.0.0 | 2024-Aug-22 | 2024-Sep-18 | 2024-Oct-15 | 2025-Apr-29 | M130 | v20.18 | ✅ |
|
||||
| 32.0.0 | 2024-Jun-14 | 2024-Jul-24 | 2024-Aug-20 | 2025-Mar-04 | M128 | v20.16 | ✅ |
|
||||
| 32.0.0 | 2024-Jun-14 | 2024-Jul-24 | 2024-Aug-20 | 2025-Mar-04 | M128 | v20.16 | 🚫 |
|
||||
| 31.0.0 | 2024-Apr-18 | 2024-May-15 | 2024-Jun-11 | 2025-Jan-14 | M126 | v20.14 | 🚫 |
|
||||
| 30.0.0 | 2024-Feb-22 | 2024-Mar-20 | 2024-Apr-16 | 2024-Oct-15 | M124 | v20.11 | 🚫 |
|
||||
| 29.0.0 | 2023-Dec-07 | 2024-Jan-24 | 2024-Feb-20 | 2024-Aug-20 | M122 | v20.9 | 🚫 |
|
||||
|
||||
380
docs/tutorial/native-code-and-electron.md
Normal file
380
docs/tutorial/native-code-and-electron.md
Normal file
@@ -0,0 +1,380 @@
|
||||
# Native Code and Electron
|
||||
|
||||
One of Electron's most powerful features is the ability to combine web technologies with native code - both for compute-intensive logic as well as for the occasional native user interface, where desired.
|
||||
|
||||
Electron does so by building on top of "Native Node.js Addons". You've probably already come across a few of them - packages like the famous [sqlite](https://www.npmjs.com/package/sqlite3) use native code to combine JavaScript and native technologies. You can use this feature to extend your Electron application with anything a fully native application can do:
|
||||
|
||||
* Access native platform APIs not available in JavaScript. Any macOS, Windows, or Linux operating system API is available to you.
|
||||
* Create UI components that interact with native desktop frameworks.
|
||||
* Integrate with existing native libraries.
|
||||
* Implement performance-critical code that runs faster than JavaScript.
|
||||
|
||||
Native Node.js addons are dynamically-linked shared objects (on Unix-like systems) or DLL files (on Windows) that can be loaded into Node.js or Electron using the `require()` or `import` functions. They behave just like regular JavaScript modules but provide an interface to code written in C++, Rust, or other languages that can compile to native code.
|
||||
|
||||
# Tutorial: Creating a Native Node.js Addon for Electron
|
||||
|
||||
This tutorial will walk you through building a basic Node.js native addon that can be used in Electron applications. We'll focus on concepts common to all platforms, using C++ as the implementation language. Once you complete this tutorial common to all native Node.js addons, you can move on to one of our platform-specific tutorials.
|
||||
|
||||
## Requirements
|
||||
|
||||
This tutorial assumes you have Node.js and npm installed, as well as the basic tools necessary for compiling code on your platform (like Visual Studio on Windows, Xcode on macOS, or GCC/Clang on Linux). You can find detailed instructions in the [`node-gyp` readme](https://github.com/nodejs/node-gyp?tab=readme-ov-file).
|
||||
|
||||
### Requirements: macOS
|
||||
|
||||
To build native Node.js addons on macOS, you'll need the Xcode Command Line Tools. These provide the necessary compilers and build tools (namely, `clang`, `clang++`, and `make`). The following command will prompt you to install the Command Line Tools if they aren't already installed.
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
### Requirements: Windows
|
||||
|
||||
The official Node.js installer offers the optional installation of "Tools for Native Modules", which installs everything required for the basic compilation of C++ modules - specifically, Python 3 and the "Visual Studio Desktop development with C++" workload. Alternatively, you can use `chocolatey`, `winget`, or the Windows Store.
|
||||
|
||||
### Requirements: Linux
|
||||
|
||||
* [A supported version of Python](https://devguide.python.org/versions/)
|
||||
* `make`
|
||||
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
|
||||
|
||||
## 1) Creating a package
|
||||
|
||||
First, create a new Node.js package that will contain your native addon:
|
||||
|
||||
```sh
|
||||
mkdir my-native-addon
|
||||
cd my-native-addon
|
||||
npm init -y
|
||||
```
|
||||
|
||||
This creates a basic `package.json` file. Next, we'll install the necessary dependencies:
|
||||
|
||||
```sh
|
||||
npm install node-addon-api bindings
|
||||
```
|
||||
|
||||
* `node-addon-api`: This is a C++ wrapper for the low-level Node.js API that makes it easier to build addons. It provides a C++ object-oriented API that's more convenient and safer to use than the raw C-style API.
|
||||
* `bindings`: A helper module that simplifies the process of loading your compiled native addon. It handles finding your compiled `.node` file automatically.
|
||||
|
||||
Now, let's update our `package.json` to include the appropriate build scripts. We will explain what these specifically do further below.
|
||||
|
||||
```json title='package.json'
|
||||
{
|
||||
"name": "my-native-addon",
|
||||
"version": "1.0.0",
|
||||
"description": "A native addon for Electron",
|
||||
"main": "js/index.js",
|
||||
"scripts": {
|
||||
"clean": "node -e \"require('fs').rmSync('build', { recursive: true, force: true })\"",
|
||||
"build": "node-gyp configure && node-gyp build"
|
||||
},
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"node-addon-api": "^8.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"node-gyp": "^11.1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
These scripts will:
|
||||
|
||||
* `clean`: Remove the build directory, allowing for a fresh build
|
||||
* `build`: Run the standard node-gyp build process to compile your addon
|
||||
|
||||
## 2) Setting up the build system
|
||||
|
||||
Node.js addons use a build system called `node-gyp`, which is a cross-platform command-line tool written in Node.js. It compiles native addon modules for Node.js using platform-specific build tools behind the scenes:
|
||||
|
||||
* On Windows: Visual Studio
|
||||
* On macOS: Xcode or command-line tools
|
||||
* On Linux: GCC or similar compilers
|
||||
|
||||
### Configuring `node-gyp`
|
||||
|
||||
The `binding.gyp` file is a JSON-like configuration file that tells node-gyp how to build your native addon. It's similar to a make file or a project file but in a platform-independent format. Let's create a basic `binding.gyp` file:
|
||||
|
||||
```json title='binding.gyp'
|
||||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "my_addon",
|
||||
"sources": [
|
||||
"src/my_addon.cc",
|
||||
"src/cpp_code.cc"
|
||||
],
|
||||
"include_dirs": [
|
||||
"<!@(node -p \"require('node-addon-api').include\")",
|
||||
"include"
|
||||
],
|
||||
"dependencies": [
|
||||
"<!(node -p \"require('node-addon-api').gyp\")"
|
||||
],
|
||||
"defines": [
|
||||
"NODE_ADDON_API_CPP_EXCEPTIONS"
|
||||
],
|
||||
"cflags!": ["-fno-exceptions"],
|
||||
"cflags_cc!": ["-fno-exceptions"],
|
||||
"xcode_settings": {
|
||||
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
||||
"CLANG_CXX_LIBRARY": "libc++",
|
||||
"MACOSX_DEPLOYMENT_TARGET": "10.14"
|
||||
},
|
||||
"msvs_settings": {
|
||||
"VCCLCompilerTool": {
|
||||
"ExceptionHandling": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Let's break down this configuration:
|
||||
|
||||
* `target_name`: The name of your addon. This determines the filename of the compiled module (my_addon.node).
|
||||
* `sources`: List of source files to compile. We'll have two files: the main addon file and our actual C++ implementation.
|
||||
* `include_dirs`: Directories to search for header files. The cryptic-looking line `<!@(node -p \"require('node-addon-api').include\")` runs a Node.js command to get the path to the node-addon-api include directory.
|
||||
* `dependencies`: The `node-addon-api` dependency. Similar to the include dirs, this executes a Node.js command to get the proper configuration.
|
||||
* `defines`: Preprocessor definitions. Here we're enabling C++ exceptions for node-addon-api.
|
||||
Platform-specific settings:
|
||||
* `cflags`! and cflags_cc!: Compiler flags for Unix-like systems
|
||||
* `xcode_settings`: Settings specific to macOS/Xcode compiler
|
||||
* `msvs_settings`: Settings specific to Microsoft Visual Studio on Windows
|
||||
|
||||
Now, create the directory structure for our project:
|
||||
|
||||
```sh
|
||||
mkdir src
|
||||
mkdir include
|
||||
mkdir js
|
||||
```
|
||||
|
||||
This creates:
|
||||
|
||||
* `src/`: Where our source files will go
|
||||
* `include/`: For header files
|
||||
* `js/`: For our JavaScript wrapper
|
||||
|
||||
## 3) "Hello World" from C++
|
||||
|
||||
Let's start by defining our C++ interface in a header file. Create `include/cpp_code.h`:
|
||||
|
||||
```cpp
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
namespace cpp_code {
|
||||
// A simple function that takes a string input and returns a string
|
||||
std::string hello_world(const std::string& input);
|
||||
} // namespace cpp_code
|
||||
```
|
||||
|
||||
The `#pragma once` directive is a header guard that prevents the file from being included multiple times in the same compilation unit. The actual function declaration is inside a namespace to avoid potential name conflicts.
|
||||
|
||||
Next, let's implement the function in `src/cpp_code.cc`:
|
||||
|
||||
```cpp title='src/cpp_code.cc'
|
||||
#include <string>
|
||||
#include "../include/cpp_code.h"
|
||||
|
||||
namespace cpp_code {
|
||||
std::string hello_world(const std::string& input) {
|
||||
// Simply concatenate strings and return
|
||||
return "Hello from C++! You said: " + input;
|
||||
}
|
||||
} // namespace cpp_code
|
||||
```
|
||||
|
||||
This is a simple implementation that just adds some text to the input string and returns it.
|
||||
|
||||
Now, let's create the addon code that bridges our C++ code with the Node.js/JavaScript world. Create `src/my_addon.cc`:
|
||||
|
||||
```cpp title='src/my_addon.cc'
|
||||
#include <napi.h>
|
||||
#include <string>
|
||||
#include "../include/cpp_code.h"
|
||||
|
||||
// Create a class that will be exposed to JavaScript
|
||||
class MyAddon : public Napi::ObjectWrap<MyAddon> {
|
||||
public:
|
||||
// This static method defines the class for JavaScript
|
||||
static Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
||||
// Define the JavaScript class with method(s)
|
||||
Napi::Function func = DefineClass(env, "MyAddon", {
|
||||
InstanceMethod("helloWorld", &MyAddon::HelloWorld)
|
||||
});
|
||||
|
||||
// Create a persistent reference to the constructor
|
||||
Napi::FunctionReference* constructor = new Napi::FunctionReference();
|
||||
*constructor = Napi::Persistent(func);
|
||||
env.SetInstanceData(constructor);
|
||||
|
||||
// Set the constructor on the exports object
|
||||
exports.Set("MyAddon", func);
|
||||
return exports;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
MyAddon(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<MyAddon>(info) {}
|
||||
|
||||
private:
|
||||
// Method that will be exposed to JavaScript
|
||||
Napi::Value HelloWorld(const Napi::CallbackInfo& info) {
|
||||
Napi::Env env = info.Env();
|
||||
|
||||
// Validate arguments (expecting one string)
|
||||
if (info.Length() < 1 || !info[0].IsString()) {
|
||||
Napi::TypeError::New(env, "Expected string argument").ThrowAsJavaScriptException();
|
||||
return env.Null();
|
||||
}
|
||||
|
||||
// Convert JavaScript string to C++ string
|
||||
std::string input = info[0].As<Napi::String>();
|
||||
|
||||
// Call our C++ function
|
||||
std::string result = cpp_code::hello_world(input);
|
||||
|
||||
// Convert C++ string back to JavaScript string and return
|
||||
return Napi::String::New(env, result);
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize the addon
|
||||
Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
||||
return MyAddon::Init(env, exports);
|
||||
}
|
||||
|
||||
// Register the initialization function
|
||||
NODE_API_MODULE(my_addon, Init)
|
||||
```
|
||||
|
||||
Let's break down this code:
|
||||
|
||||
1. We define a `MyAddon` class that inherits from `Napi::ObjectWrap<MyAddon>`, which handles wrapping our C++ class for JavaScript.
|
||||
2. The `Init` static method:
|
||||
2.1 Defines a JavaScript class with a method called `helloWorld`
|
||||
2.2 Creates a persistent reference to the constructor (to prevent garbage collection)
|
||||
2.3 Exports the class constructor
|
||||
3. The constructor simply passes its arguments to the parent class.
|
||||
4. The `HelloWorld` method:
|
||||
4.1 Gets the Napi environment
|
||||
4.2 Validates input arguments (expecting a string)
|
||||
4.3 Converts the JavaScript string to a C++ string
|
||||
4.4 Calls our C++ function
|
||||
4.5 Converts the result back to a JavaScript string and returns it
|
||||
5. We define an initialization function and register it with NODE_API_MODULE macro, which makes our module loadable by Node.js.
|
||||
|
||||
Now, let's create a JavaScript wrapper to make the addon easier to use. Create `js/index.js`:
|
||||
|
||||
```js title='js/index.js' @ts-expect-error=[5]
|
||||
const EventEmitter = require('events')
|
||||
|
||||
// Load the native addon using the 'bindings' module
|
||||
// This will look for the compiled .node file in various places
|
||||
const bindings = require('bindings')
|
||||
const native = bindings('my_addon')
|
||||
|
||||
// Create a nice JavaScript wrapper
|
||||
class MyNativeAddon extends EventEmitter {
|
||||
constructor () {
|
||||
super()
|
||||
|
||||
// Create an instance of our C++ class
|
||||
this.addon = new native.MyAddon()
|
||||
}
|
||||
|
||||
// Wrap the C++ method with a nicer JavaScript API
|
||||
helloWorld (input = '') {
|
||||
if (typeof input !== 'string') {
|
||||
throw new TypeError('Input must be a string')
|
||||
}
|
||||
return this.addon.helloWorld(input)
|
||||
}
|
||||
}
|
||||
|
||||
// Export a singleton instance
|
||||
if (process.platform === 'win32' || process.platform === 'darwin' || process.platform === 'linux') {
|
||||
module.exports = new MyNativeAddon()
|
||||
} else {
|
||||
// Provide a fallback for unsupported platforms
|
||||
console.warn('Native addon not supported on this platform')
|
||||
|
||||
module.exports = {
|
||||
helloWorld: (input) => `Hello from JS! You said: ${input}`
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This JavaScript wrapper:
|
||||
|
||||
1. Uses `bindings` to load our compiled native addon
|
||||
1. Creates a class that extends EventEmitter (useful for future extensions that might emit events)
|
||||
1. Instantiates our C++ class and provides a simpler API
|
||||
1. Adds some input validation on the JavaScript side
|
||||
1. Exports a singleton instance of our wrapper
|
||||
1. Handles unsupported platforms gracefully
|
||||
|
||||
### Building and testing the addon
|
||||
|
||||
Now we can build our native addon:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
This will run `node-gyp configure` and `node-gyp build` to compile our C++ code into a `.node` file.
|
||||
Let's create a simple test script to verify everything works. Create `test.js` in the project root:
|
||||
|
||||
```js title='test.js' @ts-expect-error=[2]
|
||||
// Load our addon
|
||||
const myAddon = require('./js')
|
||||
|
||||
// Try the helloWorld function
|
||||
const result = myAddon.helloWorld('This is a test')
|
||||
|
||||
// Should print: "Hello from C++! You said: This is a test"
|
||||
console.log(result)
|
||||
```
|
||||
|
||||
Run the test:
|
||||
|
||||
```sh
|
||||
node test.js
|
||||
```
|
||||
|
||||
If everything works correctly, you should see:
|
||||
|
||||
```txt
|
||||
Hello from C++! You said: This is a test
|
||||
```
|
||||
|
||||
### Using the addon in Electron
|
||||
|
||||
To use this addon in an Electron application, you would:
|
||||
|
||||
1. Include it as a dependency in your Electron project
|
||||
1. Build it targeting your specific Electron version. `electron-forge` handles this step automatically for you - for more details, see [Native Node Modules](./using-native-node-modules.md).
|
||||
1. Import and use it just like any other module in a process that has Node.js enabled.
|
||||
|
||||
```js @ts-expect-error=[2]
|
||||
// In your main process
|
||||
const myAddon = require('my-native-addon')
|
||||
console.log(myAddon.helloWorld('Electron'))
|
||||
```
|
||||
|
||||
## References and further learning
|
||||
|
||||
Native addon development can be written in several languages beyond C++. Rust can be used with crates like [`napi-rs`](https://github.com/napi-rs/napi-rs), [`neon`](https://neon-rs.dev/), or [`node-bindgen`](https://github.com/infinyon/node-bindgen). Objective-C/Swift can be used through Objective-C++ on macOS.
|
||||
|
||||
The specific implementation details differ significantly by platform, especially when accessing platform-specific APIs or UI frameworks, like Windows' Win32 API, COM components, UWP/WinRT - or macOS's Cocoa, AppKit, or ObjectiveC runtime.
|
||||
|
||||
This means that you'll likely use two groups of references for your native code: First, on the Node.js side, use the [N-API documentation](https://nodejs.org/api/n-api.html) to learn about creating and exposing complex structures to JavaScript - like asynchronous thread-safe function calls or creating JavaScript-native objects (`error`, `promise`, etc). Secondly, on the side of the technology you're working with, you'll likely be looking at their lower-level documentation:
|
||||
|
||||
* [Microsoft C++, C, and Assembler documentation](https://learn.microsoft.com/en-us/cpp/?view=msvc-170)
|
||||
* [C++/WinRT](https://learn.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/)
|
||||
* [MSVC-170 C++ Documentation](https://learn.microsoft.com/en-us/cpp/cpp/?view=msvc-170)
|
||||
* [Apple Developer Documentation](https://developer.apple.com/documentation)
|
||||
* [Programming with Objective-C](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011210)
|
||||
@@ -36,7 +36,8 @@ setting.
|
||||
This is an advanced feature requiring a native node module to work with your own code.
|
||||
The frames are directly copied in GPU textures, thus this mode is very fast because
|
||||
there's no CPU-GPU memory copies overhead, and you can directly import the shared
|
||||
texture to your own rendering program.
|
||||
texture to your own rendering program. You can read more details at
|
||||
[here](https://github.com/electron/electron/blob/main/shell/browser/osr/README.md).
|
||||
|
||||
2. Use CPU shared memory bitmap
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Copyright 2024 The Electron Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# The set of path prefixes that should be checked for unsafe buffer usage (see
|
||||
# -Wunsafe-buffer-usage in Clang).
|
||||
#
|
||||
# ***
|
||||
# Paths should be written as relative to the root of the source tree with
|
||||
# unix-style path separators. Directory prefixes should end with `/`, such
|
||||
# as `base/`.
|
||||
# ***
|
||||
#
|
||||
# Files in this set are known to not use pointer arithmetic/subscripting, and
|
||||
# make use of constructs like base::span or containers like std::vector instead.
|
||||
#
|
||||
# See `docs/unsafe_buffers.md`.
|
||||
|
||||
# These directories are excluded because they come from outside Electron and
|
||||
# we don't have control over their contents.
|
||||
-base/
|
||||
-chrome/
|
||||
-components/
|
||||
-device/
|
||||
-extensions/
|
||||
-google_apis/
|
||||
-net/
|
||||
-services/
|
||||
-skia/
|
||||
-third_party/
|
||||
-tools/
|
||||
-ui/
|
||||
-url/
|
||||
-v8/
|
||||
@@ -594,6 +594,8 @@ filenames = {
|
||||
"shell/common/gin_converters/callback_converter.h",
|
||||
"shell/common/gin_converters/content_converter.cc",
|
||||
"shell/common/gin_converters/content_converter.h",
|
||||
"shell/common/gin_converters/display_surface_converter.cc",
|
||||
"shell/common/gin_converters/display_surface_converter.h",
|
||||
"shell/common/gin_converters/file_dialog_converter.cc",
|
||||
"shell/common/gin_converters/file_dialog_converter.h",
|
||||
"shell/common/gin_converters/file_path_converter.h",
|
||||
|
||||
@@ -16,13 +16,13 @@ function isValid (options: Electron.SourcesOptions) {
|
||||
|
||||
export { isDisplayMediaSystemPickerAvailable };
|
||||
|
||||
export async function getSources (args: Electron.SourcesOptions) {
|
||||
export async function getSources (args: Electron.SourcesOptions, useSystemPicker: boolean = false) {
|
||||
if (!isValid(args)) throw new Error('Invalid options');
|
||||
|
||||
const resizableValues = new Map();
|
||||
if (process.platform === 'darwin') {
|
||||
// Fix for bug in ScreenCaptureKit that modifies a window's styleMask the first time
|
||||
// it captures a non-resizable window. We record each non-resizable window's styleMask,
|
||||
// it captures a non-resizable window. We record each non-resizable window's styleMask
|
||||
// and we restore modified styleMasks later, after the screen capture.
|
||||
for (const win of BrowserWindow.getAllWindows()) {
|
||||
resizableValues.set([win.id], win.resizable);
|
||||
@@ -32,14 +32,15 @@ export async function getSources (args: Electron.SourcesOptions) {
|
||||
const captureWindow = args.types.includes('window');
|
||||
const captureScreen = args.types.includes('screen');
|
||||
|
||||
const { thumbnailSize = { width: 150, height: 150 } } = args;
|
||||
const { thumbnailSize = { width: 0, height: 0 } } = args;
|
||||
const { fetchWindowIcons = false } = args;
|
||||
|
||||
const options = {
|
||||
captureWindow,
|
||||
captureScreen,
|
||||
thumbnailSize,
|
||||
fetchWindowIcons
|
||||
fetchWindowIcons,
|
||||
useSystemPicker
|
||||
};
|
||||
|
||||
for (const running of currentlyRunning) {
|
||||
@@ -81,7 +82,7 @@ export async function getSources (args: Electron.SourcesOptions) {
|
||||
resolve(sources);
|
||||
};
|
||||
|
||||
capturer.startHandling(captureWindow, captureScreen, thumbnailSize, fetchWindowIcons);
|
||||
capturer.startHandling(captureWindow, captureScreen, thumbnailSize, fetchWindowIcons, useSystemPicker);
|
||||
});
|
||||
|
||||
currentlyRunning.push({
|
||||
|
||||
@@ -2,25 +2,61 @@ import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
|
||||
import { addIpcDispatchListeners } from '@electron/internal/browser/ipc-dispatch';
|
||||
import * as deprecate from '@electron/internal/common/deprecate';
|
||||
|
||||
import { net } from 'electron/main';
|
||||
import { desktopCapturer, net } from 'electron/main';
|
||||
|
||||
const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
|
||||
const { isDisplayMediaSystemPickerAvailable } = process._linkedBinding('electron_browser_desktop_capturer');
|
||||
|
||||
// Fake video window that activates the native system picker
|
||||
// This is used to get around the need for a screen/window
|
||||
// id in Chrome's desktopCapturer.
|
||||
let fakeVideoWindowId = -1;
|
||||
// See content/public/browser/desktop_media_id.h
|
||||
const kMacOsNativePickerId = -4;
|
||||
const systemPickerVideoSource = Object.create(null);
|
||||
Object.defineProperty(systemPickerVideoSource, 'id', {
|
||||
get () {
|
||||
return `window:${kMacOsNativePickerId}:${fakeVideoWindowId--}`;
|
||||
async function getNativePickerSource (preferredDisplaySurface: string) {
|
||||
console.log('SESSION.TS getNativePickerSource');
|
||||
// Fake video window that activates the native system picker
|
||||
// This is used to get around the need for a screen/window
|
||||
// id in Chrome's desktopCapturer.
|
||||
let fakeVideoWindowId = -1;
|
||||
const kMacOsNativePickerId = -4;
|
||||
|
||||
if (process.platform !== 'darwin') {
|
||||
throw new Error('Native system picker option is currently only supported on MacOS');
|
||||
}
|
||||
});
|
||||
systemPickerVideoSource.name = '';
|
||||
Object.freeze(systemPickerVideoSource);
|
||||
|
||||
if (!isDisplayMediaSystemPickerAvailable) {
|
||||
throw new Error(`Native system picker unavailable.
|
||||
Note: This is an experimental API; please check the API documentation for updated restrictions`);
|
||||
}
|
||||
|
||||
let types: Electron.SourcesOptions['types'];
|
||||
switch (preferredDisplaySurface) {
|
||||
case 'no_preference':
|
||||
types = ['screen', 'window'];
|
||||
break;
|
||||
case 'monitor':
|
||||
types = ['screen'];
|
||||
break;
|
||||
case 'window':
|
||||
types = ['window'];
|
||||
break;
|
||||
default:
|
||||
types = ['screen', 'window'];
|
||||
}
|
||||
|
||||
// Pass in the needed options for a more native experience
|
||||
// screen & windows by default, no thumbnails, since the native picker doesn't return them
|
||||
const options: Electron.SourcesOptions = {
|
||||
types,
|
||||
thumbnailSize: { width: 0, height: 0 },
|
||||
fetchWindowIcons: false
|
||||
};
|
||||
|
||||
const mediaStreams = await desktopCapturer.getSources(options);
|
||||
|
||||
if (mediaStreams.length === 0) {
|
||||
throw new Error('No media streams found');
|
||||
}
|
||||
|
||||
mediaStreams[0].id = `none:${kMacOsNativePickerId}:${fakeVideoWindowId--}`;
|
||||
console.log('SESSION.TS mediaStreams', mediaStreams);
|
||||
return mediaStreams[0];
|
||||
}
|
||||
|
||||
Session.prototype._init = function () {
|
||||
addIpcDispatchListeners(this);
|
||||
@@ -48,12 +84,12 @@ Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
|
||||
Session.prototype.setDisplayMediaRequestHandler = function (handler, opts) {
|
||||
if (!handler) return this._setDisplayMediaRequestHandler(handler, opts);
|
||||
|
||||
this._setDisplayMediaRequestHandler(async (req, callback) => {
|
||||
this._setDisplayMediaRequestHandler(async (request, callback) => {
|
||||
if (opts && opts.useSystemPicker && isDisplayMediaSystemPickerAvailable()) {
|
||||
return callback({ video: systemPickerVideoSource });
|
||||
return callback({ video: await getNativePickerSource(request.preferredDisplaySurface) });
|
||||
}
|
||||
|
||||
return handler(req, callback);
|
||||
return handler(request, callback);
|
||||
}, opts);
|
||||
};
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ index 2cdcbc346175eeee69402ecee7f169e61c655199..f7226fe711e4214b216ea2c5173a0212
|
||||
|
||||
case ssl_open_record_error:
|
||||
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
|
||||
index c859ea612ce2e6be80c6351d85fae230ca5bc2dd..5f4ffedb3b19dee4eef62e2033b0000847167111 100644
|
||||
index 10b062abf8304df32652c57f377d57209bb47ed1..4eefe928daaf959d0cb1f0820e01ee05754bb4d5 100644
|
||||
--- a/ssl/ssl_lib.cc
|
||||
+++ b/ssl/ssl_lib.cc
|
||||
@@ -1196,7 +1196,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
@@ -1206,7 +1206,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
}
|
||||
|
||||
if (ret_code == 0) {
|
||||
@@ -32,7 +32,7 @@ index c859ea612ce2e6be80c6351d85fae230ca5bc2dd..5f4ffedb3b19dee4eef62e2033b00008
|
||||
return SSL_ERROR_ZERO_RETURN;
|
||||
}
|
||||
// An EOF was observed which violates the protocol, and the underlying
|
||||
@@ -2563,13 +2563,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
@@ -2573,13 +2573,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
|
||||
disable_freezing_flags_after_init_in_node.patch
|
||||
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
|
||||
chore_add_electron_deps_to_gitignores.patch
|
||||
chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
|
||||
chore_modify_chromium_handling_of_mouse_events.patch
|
||||
add_electron_deps_to_license_credits_file.patch
|
||||
fix_crash_loading_non-standard_schemes_in_iframes.patch
|
||||
create_browser_v8_snapshot_file_name_fuse.patch
|
||||
@@ -140,4 +140,7 @@ ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch
|
||||
feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch
|
||||
feat_separate_content_settings_callback_for_sync_and_async_clipboard.patch
|
||||
fix_win32_synchronous_spellcheck.patch
|
||||
chore_remove_conflicting_allow_unsafe_libc_calls.patch
|
||||
fix_enable_wrap_iter_in_string_view_and_array.patch
|
||||
fix_linter_error.patch
|
||||
fix_take_snapped_status_into_account_when_showing_a_window.patch
|
||||
feat_make_macos_sccontentsharingpicker_work_in_electron_and_return_screen_window_or_both.patch
|
||||
|
||||
@@ -23,10 +23,10 @@ index 44da0544b778d6ff4c14b6f4e8463cb8260d2f0d..8ae8939af4141a684b7a6d50a43e1abb
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 76ab61d5d388b70a0da0999ff2d2ea97f39f6fc6..0d7e92d25f4ba3b9375b590d8f7dd2955fb1bf78 100644
|
||||
index 0fb92081a1bbfb14c0ddd74dfe91f94bb2be1d2a..886f677564084d8b6af15b03403cfa56aeddd3c9 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4786,6 +4786,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4802,6 +4802,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ index 76ab61d5d388b70a0da0999ff2d2ea97f39f6fc6..0d7e92d25f4ba3b9375b590d8f7dd295
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index add44302103a44dc5d14f79a4087a9b0a11fc239..5705d51eb4edc7a2534682dffe43ca9dc0dfe98b 100644
|
||||
index bf073c9180d47243f09fdd052a43dfe7e34aa4aa..d1642b675e474568c302553a288253b639ed1efd 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -653,6 +653,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -53,7 +53,7 @@ index add44302103a44dc5d14f79a4087a9b0a11fc239..5705d51eb4edc7a2534682dffe43ca9d
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index cfa2a64d94d5d48351ba039a9552b701702c0fec..88bf84d812eda3373c8435a714265d5099270a3f 100644
|
||||
index 038c13c1e697d4f21160e0329f659b609802ecc1..60fd9aa69a86c32abf79ef8737e810b0017e1083 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -664,6 +664,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -92,10 +92,10 @@ index 8bb6b0465069529f79aaec21792e8b159535b3e9..f9782531c639d07002dda07732750a00
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
index cfcabe9a443adae146c816419e0845cb6fc18404..717587c2cfe0b0228ae40adce04139cb54a34d0e 100644
|
||||
index 66cc44003157657c68e90d295f877789395eca8d..19cd8460711d5d5b1b76c9e4cb82ed7fc71b410c 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
@@ -296,6 +296,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -295,6 +295,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@ index 4c7375a27a22f04694e14fecc17d633734d4cccc..ea2a32b151aaf07b5704e463d01714eb
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index 6b967bd0b430732732ef30fb404e615a55c7c364..6bba885bca8f65744bcd03efcb98725649687856 100644
|
||||
index 8ca461c8fc3f2e508be5783406b570062ccf5de0..3c67d214ecd2b3b2f3e8955836e8ef7c0f0a525d 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -415,6 +415,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -416,6 +416,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -7,7 +7,7 @@ Ensure that licenses for the dependencies introduced by Electron
|
||||
are included in `LICENSES.chromium.html`
|
||||
|
||||
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
|
||||
index e2eafa2d533b9264e6452b38ef51b9363cccda31..f506aee9ac373ced20916da5013aa19137da4c5d 100755
|
||||
index 12ad657f5df3ff4af2bdbd8b9fb7959131db2970..f2b03596dd5ff96236272b6348336515df85eef0 100755
|
||||
--- a/tools/licenses/licenses.py
|
||||
+++ b/tools/licenses/licenses.py
|
||||
@@ -336,6 +336,31 @@ SPECIAL_CASES = {
|
||||
|
||||
@@ -10,7 +10,7 @@ usage of BrowserList and Browser as we subclass related methods and use our
|
||||
WindowList.
|
||||
|
||||
diff --git a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
index ff25e6eb48deb339ab92152eb09ad856068fd589..4a1f81429f0857e129e31103b026079de13fd826 100644
|
||||
index 230c9cb619498f315fc0913da54837b725fc9024..0fa1120ab952864e53085e7746608bb491ec14b2 100644
|
||||
--- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
@@ -23,7 +23,7 @@ index 6c679ef877067297ec3bf1a23af6c03a2af8dcf5..1ac93433189580c13b69cd52ce62681a
|
||||
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 a387789fe4270739408a9beb32a5ad1a8e51e5f6..43c108bd6b51d293e0f8b1b5393c76c5d167ccef 100644
|
||||
index 6c1e46e58d975137eee6c0fd7b01d2ae970a2e10..5ca29616369e76e298eb03188e18ca545c76a162 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -765,6 +765,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -39,7 +39,7 @@ index a387789fe4270739408a9beb32a5ad1a8e51e5f6..43c108bd6b51d293e0f8b1b5393c76c5
|
||||
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 5fb8a3dc69dc5fc5bfa08e01d8f03707a23c9274..41774b60b8cb7e0a22cedc597dc07ad15c96988c 100644
|
||||
index 56e52f079d1ad7c7a22764b976f0c8b2cc48dff2..1231fe522ad103e94d3c30ad7d5e5d23df9b3554 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -51,7 +51,7 @@ index 5fb8a3dc69dc5fc5bfa08e01d8f03707a23c9274..41774b60b8cb7e0a22cedc597dc07ad1
|
||||
void SendRendererPreferencesToRenderer(
|
||||
const blink::RendererPreferences& preferences);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 92085aca6bd0c95a73b98e4173c0128d596b77f4..9503beefcbcfe7d99674582ece10a7e551fae96d 100644
|
||||
index 19d2df47b0c929558ac8cfc208742dfef463a68b..7e9f2e71f08c1324a805462064d4fa485041c19f 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -579,8 +579,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
@@ -116,10 +116,10 @@ index b1689844282d6917b9750fbc6a875848ddf84b70..f1cc159b7c3448a33a6d9e213f8fbd3b
|
||||
// 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 972603d6408bd428955116db395c7577530c3bb0..20b4be1d50eb00f36c545714b9a676246682a017 100644
|
||||
index 3de7e34536eceb241de943908875a9c3e5e99f7e..10c3795839969bde6a747da67d5cc7caa44a7179 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2468,6 +2468,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -2461,6 +2461,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
|
||||
"old_state", old_state, "new_state", new_state);
|
||||
|
||||
@@ -130,7 +130,7 @@ index 972603d6408bd428955116db395c7577530c3bb0..20b4be1d50eb00f36c545714b9a67624
|
||||
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 &&
|
||||
@@ -3996,10 +4000,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3987,10 +3991,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 f17c7ae24086ab0112bd1245291f6f512a74e223..a1a23d263e4842996c0f8dde4dca8d8b35802fda 100644
|
||||
index 2494aeb1cd363c07e1b662743b1453da646fe17d..927dce4724263b45ff27b046ef024ae2a04706a9 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
|
||||
@@ -147,6 +147,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -148,6 +148,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 f17c7ae24086ab0112bd1245291f6f512a74e223..a1a23d263e4842996c0f8dde4dca8d8b
|
||||
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 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d6d962747 100644
|
||||
index b7b817c01fcec0bf60bd88544ec66b53248a1ed8..82a03a14e19840924c90cb768a3bbd715fdf82d4 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 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d
|
||||
#include "build/build_config.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -442,6 +443,20 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
@@ -447,6 +448,20 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
// when feature DynamicSafeAreaInsets is enabled.
|
||||
bool dynamic_safe_area_insets_enabled = false;
|
||||
|
||||
@@ -65,18 +65,18 @@ index 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d
|
||||
// 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 68f936bc7103accc4521da0a12e5e0fad05cc86c..24f209d5694cdf7128a8fb58af4957f0905058a0 100644
|
||||
index d686fc396ce4d53c209be5cbb4d4ddfecc4cca1b..cd1110adc4131404ba32595ea5533b220554b0c4 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
|
||||
@@ -6,6 +6,7 @@
|
||||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_WEB_PREFERENCES_WEB_PREFERENCES_MOJOM_TRAITS_H_
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#include "mojo/public/cpp/base/file_path_mojom_traits.h"
|
||||
#include "mojo/public/cpp/bindings/struct_traits.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -434,6 +435,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -437,6 +438,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
return r.stylus_handwriting_enabled;
|
||||
}
|
||||
|
||||
@@ -130,18 +130,22 @@ index 68f936bc7103accc4521da0a12e5e0fad05cc86c..24f209d5694cdf7128a8fb58af4957f0
|
||||
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 f3f00b8430d131627191e0e689ab54256600e852..c88a348b9b991081609d5085890a0c2538555569 100644
|
||||
index 6678fc10d72e6c49ba729d5f44626f9a29934a3b..57f8c71bd0e3b1e09510184888636004a949c192 100644
|
||||
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
@@ -9,6 +9,7 @@ import "third_party/blink/public/mojom/css/preferred_contrast.mojom";
|
||||
@@ -8,9 +8,11 @@ import "third_party/blink/public/mojom/css/preferred_color_scheme.mojom";
|
||||
import "third_party/blink/public/mojom/css/preferred_contrast.mojom";
|
||||
import "third_party/blink/public/mojom/v8_cache_options.mojom";
|
||||
import "url/mojom/url.mojom";
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
+import "mojo/public/mojom/base/file_path.mojom";
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "skia/public/mojom/skcolor.mojom";
|
||||
|
||||
+
|
||||
enum PointerType {
|
||||
kPointerNone = 1, // 1 << 0
|
||||
@@ -217,6 +218,19 @@ struct WebPreferences {
|
||||
kPointerFirstType = kPointerNone,
|
||||
@@ -218,6 +220,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;
|
||||
|
||||
@@ -15,7 +15,7 @@ Refs changes in:
|
||||
This patch reverts the changes to fix associated crashes in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
|
||||
index e662d4d61595735a30d5c721147a95698d4da3d9..6a0388aad469422dd1c0c2164f8aa858c55cce70 100644
|
||||
index 9dc450bc20744463c8898bc822a558be38486493..576421cb9600625ad8b9eda25cb99954092a7a37 100644
|
||||
--- a/third_party/blink/renderer/core/frame/frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/frame.cc
|
||||
@@ -134,14 +134,6 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
@@ -49,10 +49,10 @@ index e662d4d61595735a30d5c721147a95698d4da3d9..6a0388aad469422dd1c0c2164f8aa858
|
||||
// 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 401679f818e7bba02be454f9aa3424e84d36c4af..4da759d7ab6d6fb6b6d4d1648da0e62d7629ad5c 100644
|
||||
index ba6aac34b4838efa86c01926759871a31a3b2257..99ae1320be10ac19d204edfe1c1cf4f52c62eb76 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -746,10 +746,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -748,10 +748,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
DCHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -63,7 +63,7 @@ index 401679f818e7bba02be454f9aa3424e84d36c4af..4da759d7ab6d6fb6b6d4d1648da0e62d
|
||||
if (!Client())
|
||||
return false;
|
||||
|
||||
@@ -803,6 +799,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -805,6 +801,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 c428a5f8d79e826077ab05fb6c56ae8e0e4ff609..c5fd8782fc1343f04f9e2c2c0414245d20696193 100644
|
||||
index 45c518185da68419e0f482acba359f02c2152f88..a0e35f118f0b1f767b41676d651a575e8b5fddb4 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -91,6 +91,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
|
||||
|
||||
@@ -10,10 +10,10 @@ Needed for:
|
||||
2) //electron/shell/common:web_contents_utility
|
||||
|
||||
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn
|
||||
index dee8a4413f62ac5535f4bce504ff0dc934db743a..064a62b40679f05feac3c81f9d6e6c2c90972727 100644
|
||||
index 55921115094f7437ce10db1cac1debe9adc10ea9..7040d83af340f052f5cab4437433e3dd0a688390 100644
|
||||
--- a/content/public/common/BUILD.gn
|
||||
+++ b/content/public/common/BUILD.gn
|
||||
@@ -380,6 +380,8 @@ mojom("interfaces") {
|
||||
@@ -379,6 +379,8 @@ mojom("interfaces") {
|
||||
"//content/common/*",
|
||||
"//extensions/common:mojom",
|
||||
"//extensions/common:mojom_blink",
|
||||
|
||||
@@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
|
||||
patch.
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index bdf6d5865fb0069f4df368613167069d2fb50c86..93a126365406badf911d938dde2dcd8b140b7f6f 100644
|
||||
index b38442f018b218944c7b85c9f8bd8b8eb6137b9e..dd15f6cf5dc40f2d54134c833d35508f2e22967b 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -196,11 +196,16 @@ if (!is_android && !is_mac) {
|
||||
@@ -199,11 +199,16 @@ if (!is_android && !is_mac) {
|
||||
"common/crash_keys.h",
|
||||
]
|
||||
|
||||
@@ -33,10 +33,10 @@ index bdf6d5865fb0069f4df368613167069d2fb50c86..93a126365406badf911d938dde2dcd8b
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 95b6d2a684fd6cb2655f7bc3a985f113bd2b23b5..3afb802aa6563cf625709bd1ab0b0c7f86b08760 100644
|
||||
index 0ad542897fa8e45003a7945d9393f84844f993d3..0fb8770c97c2a3c2ffebb558cd81081821747b2a 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4563,7 +4563,7 @@ static_library("browser") {
|
||||
@@ -4567,7 +4567,7 @@ static_library("browser") {
|
||||
[ "//chrome/browser/ui/webui/signin:profile_impl" ]
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 95b6d2a684fd6cb2655f7bc3a985f113bd2b23b5..3afb802aa6563cf625709bd1ab0b0c7f
|
||||
# than here in :chrome_dll.
|
||||
deps += [ "//chrome:packed_resources_integrity_header" ]
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 4a1bba04faf432da83a8d563217469a861ce14a2..4ca8d943e89703e9fada09395e033b75d93d839c 100644
|
||||
index 1cc7b3905eae8d1c3025ae3454482ea8418a5217..bf71a7514f337cc6447e27a8ebd3a2c299840121 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7030,9 +7030,12 @@ test("unit_tests") {
|
||||
@@ -7031,9 +7031,12 @@ test("unit_tests") {
|
||||
"//chrome/notification_helper",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index 4a1bba04faf432da83a8d563217469a861ce14a2..4ca8d943e89703e9fada09395e033b75
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -7992,6 +7995,10 @@ test("unit_tests") {
|
||||
@@ -7996,6 +7999,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index 4a1bba04faf432da83a8d563217469a861ce14a2..4ca8d943e89703e9fada09395e033b75
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8047,7 +8054,6 @@ test("unit_tests") {
|
||||
@@ -8051,7 +8058,6 @@ test("unit_tests") {
|
||||
# Non-android deps for "unit_tests" target.
|
||||
deps += [
|
||||
"../browser/screen_ai:screen_ai_install_state",
|
||||
|
||||
@@ -7,7 +7,7 @@ These are variables we add to the root BUILDCONFIG so that they're available
|
||||
everywhere, without having to import("//electron/.../flags.gni").
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index c2212c73c1f54bdfb0510bb94ddf7a58f6e54242..c9780b914f2169488a99932073ea245311bb158c 100644
|
||||
index bdf8b13631a3cdf698078f70c435e9316cf0bfc3..53df468e94bdd2cdf049604e29e55863efdd3a8d 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
@@ -7,10 +7,10 @@ Build libc++ as static library to compile and pass
|
||||
nan tests
|
||||
|
||||
diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
|
||||
index a5471961656af134738ac7388fae70e9544dd4aa..2592fdc2e04683a6d42fa9fad87313d296199857 100644
|
||||
index 3f437d2b9c193285bdc200c2781b13de75ba993d..d9493066ddc7d7198acc76f345c726be021d8fce 100644
|
||||
--- a/buildtools/third_party/libc++/BUILD.gn
|
||||
+++ b/buildtools/third_party/libc++/BUILD.gn
|
||||
@@ -192,7 +192,11 @@ libcxx_modules("std_wctype_h") {
|
||||
@@ -204,7 +204,11 @@ libcxx_modules("std_wctype_h") {
|
||||
if (libcxx_is_shared) {
|
||||
_libcxx_target_type = "shared_library"
|
||||
} else {
|
||||
@@ -23,7 +23,7 @@ index a5471961656af134738ac7388fae70e9544dd4aa..2592fdc2e04683a6d42fa9fad87313d2
|
||||
}
|
||||
|
||||
target(_libcxx_target_type, "libc++") {
|
||||
@@ -201,6 +205,7 @@ target(_libcxx_target_type, "libc++") {
|
||||
@@ -213,6 +217,7 @@ target(_libcxx_target_type, "libc++") {
|
||||
# need to explicitly depend on libc++.
|
||||
visibility = [
|
||||
"//build/config:common_deps",
|
||||
|
||||
@@ -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 4e3b890ac33148b21d73530878e525f156a4f1fb..9f05eec5ca501d941c9f39b830c32db2d2e4db32 100644
|
||||
index 447c0ae162f45eb157008e62cbc756d6f23e4920..27db5dbfd05106788feda9daab9d1aaaf1ae920f 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9613,6 +9613,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9635,6 +9635,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 4e3b890ac33148b21d73530878e525f156a4f1fb..9f05eec5ca501d941c9f39b830c32db2
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 42d593b47bb720fc9d142876a75a0077dde71ce8..d5011ecc23eeae14f0f901867ee6e736014c5075 100644
|
||||
index c53ab4b96a16b7326dfde14452b20d2170aecf04..e500fe77f55836b3e5832536f98cf9581984b8c1 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5031,6 +5031,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5061,6 +5061,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params,
|
||||
opener);
|
||||
|
||||
@@ -37,7 +37,7 @@ index 42d593b47bb720fc9d142876a75a0077dde71ce8..d5011ecc23eeae14f0f901867ee6e736
|
||||
// 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
|
||||
@@ -5072,12 +5078,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5102,12 +5108,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ index 42d593b47bb720fc9d142876a75a0077dde71ce8..d5011ecc23eeae14f0f901867ee6e736
|
||||
new_contents_impl, opener, params.target_url,
|
||||
params.referrer.To<Referrer>(), params.disposition,
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index 91dcf6c9c4a2d840fb50cb329fe3ef1bba9103c3..cbc887a3034605a93468e73a310e9ca6838b32d8 100644
|
||||
index 8f8f79733c956fed2469e51993bad29689c11d8a..17e953f46d479f431fa06d28857901cb844ff4ea 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -621,6 +621,10 @@ struct CreateNewWindowParams {
|
||||
// The navigation initiator's user activation and ad status.
|
||||
blink.mojom.NavigationInitiatorActivationAndAdStatus
|
||||
initiator_activation_and_ad_status;
|
||||
@@ -642,6 +642,10 @@ struct CreateNewWindowParams {
|
||||
pending_associated_remote<blink.mojom.Widget> widget;
|
||||
pending_associated_receiver<blink.mojom.FrameWidgetHost> frame_widget_host;
|
||||
pending_associated_remote<blink.mojom.FrameWidget> frame_widget;
|
||||
+
|
||||
+ // Extra fields added by Electron.
|
||||
+ string raw_features;
|
||||
@@ -66,10 +66,10 @@ index 91dcf6c9c4a2d840fb50cb329fe3ef1bba9103c3..cbc887a3034605a93468e73a310e9ca6
|
||||
|
||||
// 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 8572c59e4b734f444280f247ef5b615149159dd5..f8037aa47437f03dfd0c67ff57a41f16d43da05a 100644
|
||||
index f5b028759f86f382230867e6abf72a82051c02c3..f1110385258f057be3b456198b46e4d2c54ca718 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -805,6 +805,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -815,6 +815,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -79,7 +79,7 @@ index 8572c59e4b734f444280f247ef5b615149159dd5..f8037aa47437f03dfd0c67ff57a41f16
|
||||
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 69aaf3146da25e8a30382568af5002a983de2da2..abdac7f78b24392e04c431584a0bae8fca814df6 100644
|
||||
index 1c7e6dc3b867c0e598f8517591ffb9aa8007bfea..7459b083156d1f6bc01198690c4c9ec02d88d862 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -198,6 +198,7 @@ class NetworkService;
|
||||
@@ -90,7 +90,7 @@ index 69aaf3146da25e8a30382568af5002a983de2da2..abdac7f78b24392e04c431584a0bae8f
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -1356,6 +1357,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1368,6 +1369,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -148,10 +148,10 @@ index ac2e7cdceb13ce07966a908fab3ff8feff969484..96cb58b1a88499cf8f78d748dc5a1cc1
|
||||
// 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 539a274082fda54ea6bf8ed36a1fe21bbb55d73d..76ab61d5d388b70a0da0999ff2d2ea97f39f6fc6 100644
|
||||
index 0e2524de1159d7e2628c66d188002c6a417bfa52..0fb92081a1bbfb14c0ddd74dfe91f94bb2be1d2a 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6899,6 +6899,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6924,6 +6924,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
@@ -210,7 +210,7 @@ index 82e9d3dfb5f7da76d89fe15ae61d379fa46e177d..fd035512099a54dff6cc951a2226c23a
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
index b44f0db98f89befc33430bcf275bffcfae9e7171..66f92d1e975a74720af12662447ea214ac210248 100644
|
||||
index 70d107d7c99056e790d75755855b804ed1961a90..a0ed0e7cd27532dcf2c327874ae4573c70290ecd 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
@@ -2270,6 +2270,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: chore: add electron deps to gitignores
|
||||
Makes things like "git status" quicker when developing electron locally
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index de216e464df8b332b932ce4e77f8a918ce77e9c2..bc0f7e677ca597b25e7664698117443cc78ffc38 100644
|
||||
index 375db3d02ce2837ba69e3e93c38cde7153ba079f..fc3f4f71c43facf695d326f0bc64e0ad920aa9ac 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -217,6 +217,7 @@ vs-chromium-project.txt
|
||||
|
||||
@@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
|
||||
of explicitly adding ScopedAllowBlocking calls as friends.
|
||||
|
||||
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
|
||||
index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e0f597937 100644
|
||||
index 075e8173bcf1cfe420b87afe216bb06459a0d8bc..a300ed1e8c226f43fbfe6d82f72f9fb741fa342e 100644
|
||||
--- a/base/threading/thread_restrictions.h
|
||||
+++ b/base/threading/thread_restrictions.h
|
||||
@@ -132,6 +132,7 @@ class KeyStorageLinux;
|
||||
@@ -18,7 +18,7 @@ index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e
|
||||
class Profile;
|
||||
class ProfileImpl;
|
||||
class ScopedAllowBlockingForProfile;
|
||||
@@ -278,6 +279,9 @@ class BackendImpl;
|
||||
@@ -277,6 +278,9 @@ class BackendImpl;
|
||||
class InFlightIO;
|
||||
bool CleanupDirectorySync(const base::FilePath&);
|
||||
} // namespace disk_cache
|
||||
@@ -28,7 +28,7 @@ index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e
|
||||
namespace enterprise_connectors {
|
||||
class LinuxKeyRotationCommand;
|
||||
} // namespace enterprise_connectors
|
||||
@@ -575,6 +579,7 @@ class BASE_EXPORT ScopedAllowBlocking {
|
||||
@@ -574,6 +578,7 @@ class BASE_EXPORT ScopedAllowBlocking {
|
||||
friend class ::DesktopNotificationBalloon;
|
||||
friend class ::FirefoxProfileLock;
|
||||
friend class ::GaiaConfig;
|
||||
@@ -36,7 +36,7 @@ index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e
|
||||
friend class ::ProfileImpl;
|
||||
friend class ::ScopedAllowBlockingForProfile;
|
||||
friend class ::StartupTabProviderImpl;
|
||||
@@ -615,6 +620,7 @@ class BASE_EXPORT ScopedAllowBlocking {
|
||||
@@ -613,6 +618,7 @@ class BASE_EXPORT ScopedAllowBlocking {
|
||||
friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
|
||||
friend class drive::FakeDriveService;
|
||||
friend class extensions::DesktopAndroidExtensionSystem;
|
||||
|
||||
@@ -1,16 +1,43 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Fri, 29 Jul 2022 00:29:35 +0900
|
||||
Subject: chore: allow chromium to handle synthetic mouse events for touch
|
||||
Subject: chore: modify chromium handling of mouse events
|
||||
|
||||
With WCO, allow chromium to handle synthetic mouse events generated for touch
|
||||
This patch does the following:
|
||||
|
||||
1. When Windows Control Overlay is enabled, it allows chromium to handle synthetic mouse events generated for touch
|
||||
actions in the non-client caption area.
|
||||
2. It calls HandleMouseEvent on the delegate earlier in HandleMouseEventInternal, so that Electron can selectively disable
|
||||
draggable regions to allow events to propagate to the underlying renderer.
|
||||
|
||||
diff --git a/ui/events/event.h b/ui/events/event.h
|
||||
index 39b5a8fdd165efd74b00256552b51b5413107958..bfc4ef4f50efff4a77f2aef64335bb7e34c69f34 100644
|
||||
--- a/ui/events/event.h
|
||||
+++ b/ui/events/event.h
|
||||
@@ -587,6 +587,9 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
|
||||
const PointerDetails& pointer_details() const { return pointer_details_; }
|
||||
|
||||
+ bool is_system_menu() const { return is_system_menu_; }
|
||||
+ void set_is_system_menu(bool is_menu) { is_system_menu_ = is_menu; }
|
||||
+
|
||||
// Event:
|
||||
std::string ToString() const override;
|
||||
std::unique_ptr<Event> Clone() const override;
|
||||
@@ -619,6 +622,8 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
|
||||
// Structure for holding pointer details for implementing PointerEvents API.
|
||||
PointerDetails pointer_details_;
|
||||
+
|
||||
+ bool is_system_menu_ = false;
|
||||
};
|
||||
|
||||
class ScrollEvent;
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
index 2d05856687cd9669f72553d33c8033fd9083b4f8..645b7dd2cc20ce64ffa541c74930f541f083f931 100644
|
||||
index 55c426aee12da4d4d1f62dc7d489133e8d21dc49..40c88bf14d2d4fe841e29b32414361688ae438e5 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
@@ -1357,6 +1357,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
|
||||
@@ -1362,6 +1362,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
|
||||
window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds);
|
||||
}
|
||||
|
||||
@@ -22,7 +49,7 @@ index 2d05856687cd9669f72553d33c8033fd9083b4f8..645b7dd2cc20ce64ffa541c74930f541
|
||||
DesktopWindowTreeHostWin::GetSingletonDesktopNativeCursorManager() {
|
||||
return new DesktopNativeCursorManagerWin();
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
|
||||
index 932351e288f37fd09ae1a43f44e8b51fb0caa4b8..4a0616bc210d234e51e564daabdd2ebd5ac9fc16 100644
|
||||
index 4865d79c95c34d8cead96d3bb8063a0e2bd6076b..ebfa09ed15dca98b75a013e3dcbb566ce84d7cb7 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
|
||||
@@ -267,6 +267,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin : public DesktopWindowTreeHost,
|
||||
@@ -34,10 +61,10 @@ index 932351e288f37fd09ae1a43f44e8b51fb0caa4b8..4a0616bc210d234e51e564daabdd2ebd
|
||||
// Overridden from WidgetObserver.
|
||||
void OnWidgetThemeChanged(Widget* widget) override;
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 2bd015be3178ab8dea012d6b1f71d13dd0548c14..759f00dd4e674d1dfca690b82e6e1820900ebf0c 100644
|
||||
index 3a60e310d1c4048f0e37e085c97b8dfc093aefda..8fe48c9bef144218e34434d563883b15733d03bc 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3144,15 +3144,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
@@ -3156,15 +3156,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
}
|
||||
// We must let Windows handle the caption buttons if it's drawing them, or
|
||||
// they won't work.
|
||||
@@ -59,8 +86,35 @@ index 2bd015be3178ab8dea012d6b1f71d13dd0548c14..759f00dd4e674d1dfca690b82e6e1820
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3187,6 +3191,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
// handle alt-space, or in the frame itself.
|
||||
is_right_mouse_pressed_on_caption_ = false;
|
||||
ReleaseCapture();
|
||||
+
|
||||
// |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu()
|
||||
// expect screen coordinates.
|
||||
POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
|
||||
@@ -3194,7 +3199,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
w_param = static_cast<WPARAM>(SendMessage(
|
||||
hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)));
|
||||
if (w_param == HTCAPTION || w_param == HTSYSMENU) {
|
||||
- ShowSystemMenuAtScreenPixelLocation(hwnd(), gfx::Point(screen_point));
|
||||
+ LONG message_time = GetMessageTime();
|
||||
+ CHROME_MSG msg = {hwnd(),
|
||||
+ message,
|
||||
+ w_param,
|
||||
+ l_param,
|
||||
+ static_cast<DWORD>(message_time),
|
||||
+ {CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param)}};
|
||||
+ ui::MouseEvent event(msg);
|
||||
+ event.set_is_system_menu(true);
|
||||
+ if (!delegate_->HandleMouseEvent(&event))
|
||||
+ ShowSystemMenuAtScreenPixelLocation(hwnd(), gfx::Point(screen_point));
|
||||
return 0;
|
||||
}
|
||||
} else if (message == WM_NCLBUTTONDOWN &&
|
||||
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
index 04dea68d74ea4f559db60f716c919e555db9ec80..2f8bd1a3c156bb6c04663c74b7279bb59926fc3d 100644
|
||||
index de8fd5657e6885f74a5970bdd49647a6f1616387..4af87792edc7a147468077b834582510550e35e6 100644
|
||||
--- a/ui/views/win/hwnd_message_handler_delegate.h
|
||||
+++ b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
@@ -255,6 +255,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
|
||||
@@ -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 8c805aec2042d7c02ba0a28f544feb6d976a0775..d5e8086df8b15f90acbea43f93706c2b9543a8ef 100644
|
||||
index 6010d9f9fc9bfeffb3e5a64de7352b52a202cbf7..4325cdfd256ae7a1008e073d42da995b82df5bba 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4950,7 +4950,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4980,7 +4980,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.
|
||||
|
||||
@@ -14,7 +14,7 @@ This change patches it out to prevent the DCHECK.
|
||||
It can be removed once/if we see a better solution to the problem.
|
||||
|
||||
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
||||
index d4dd73e7fa1e550d0d13b4c09da0ce6899894494..679a59db98261eca3fbbd7ddb20516ab4f618cfb 100644
|
||||
index adaa1cd426c138972b088d0d0093b0e1653af231..be4684c94ba2214255c5dbe9cdcf1ea316c60c06 100644
|
||||
--- a/content/browser/site_instance_impl.cc
|
||||
+++ b/content/browser/site_instance_impl.cc
|
||||
@@ -229,7 +229,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
|
||||
|
||||
@@ -80,10 +80,10 @@ index 4fd8dff1089cd6afa6a66dc185734d7671657281..0a1f4268ea771a3d5d4a2668928c6e5d
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params,
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index 25e6f7807ecedd9df5d1ef91733b6bf47e1ab86b..526bf242dba614faca08d6870ada49ac96d6f7f0 100644
|
||||
index 8232c0081baaeb3df9f2f6224f8fe31a2dcb1d5b..081c01bc00dfdef66c23a9ef640ed159f4f7557b 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -2221,12 +2221,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -2264,12 +2264,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -99,10 +99,10 @@ index 25e6f7807ecedd9df5d1ef91733b6bf47e1ab86b..526bf242dba614faca08d6870ada49ac
|
||||
|
||||
WebContents* Browser::CreateCustomWebContents(
|
||||
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
|
||||
index d203f5ae4c5bc7ea2e1cf45271df25223a4f7497..e074ffc6fb9b59b81f55817a80db5df4bc4569b8 100644
|
||||
index 7a61c64db93db7f3b31b8d39897257a6315383c2..7db684020fbaf7061ed61a8b1cefba8c757f2fe5 100644
|
||||
--- a/chrome/browser/ui/browser.h
|
||||
+++ b/chrome/browser/ui/browser.h
|
||||
@@ -980,8 +980,7 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -981,8 +981,7 @@ class Browser : public TabStripModelObserver,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -141,10 +141,10 @@ index ca72b324bf7c3b81ac94b53f0ff454d2df177950..d60ef3075d126e2bbd50c8469f2bf67c
|
||||
// The profile used for the presentation.
|
||||
raw_ptr<Profile, DanglingUntriaged> otr_profile_;
|
||||
diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
|
||||
index 83a0a538fef0da1d3674293d20dac7b8a252273f..155c8a0af46e20f68f8b028c056092b404062861 100644
|
||||
index 1085003ab18d471d5c018ac68041924d458fcec7..4aac70febec9f0abadd1ecb96d9066e6c270efca 100644
|
||||
--- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
|
||||
+++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
|
||||
@@ -99,8 +99,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
|
||||
@@ -100,8 +100,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -155,10 +155,10 @@ index 83a0a538fef0da1d3674293d20dac7b8a252273f..155c8a0af46e20f68f8b028c056092b4
|
||||
}
|
||||
content::WebContents* CreateCustomWebContents(
|
||||
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
index 7694765fb805b84acde96d64e561adb44cb313c9..50ac57f90736743f072c2db77b6ef1fe9ccec5dd 100644
|
||||
index e0264aff5b60bb5e76ac7687222403dfba516e66..915abd2475f6be95d973f827522f7ef12052a81c 100644
|
||||
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
@@ -188,14 +188,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
|
||||
@@ -189,14 +189,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -176,7 +176,7 @@ index 7694765fb805b84acde96d64e561adb44cb313c9..50ac57f90736743f072c2db77b6ef1fe
|
||||
java_gurl);
|
||||
}
|
||||
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.h b/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
index d3889d7c75933393be4f6e3e25b8071995b685c2..6ef2996faa67964727e72080284423f125ff7ddf 100644
|
||||
index 67a01b48ae88c7e25aeb5c5103b26afa037f4f97..0ceb539c9c3051b5521236cf866ccb107727c8a9 100644
|
||||
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
@@ -82,8 +82,7 @@ class WebContentsDelegateAndroid : public content::WebContentsDelegate {
|
||||
@@ -187,8 +187,8 @@ index d3889d7c75933393be4f6e3e25b8071995b685c2..6ef2996faa67964727e72080284423f1
|
||||
- const GURL& target_url) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
void CloseContents(content::WebContents* source) override;
|
||||
void SetContentsBounds(content::WebContents* source,
|
||||
const gfx::Rect& bounds) override;
|
||||
bool DidAddMessageToConsole(content::WebContents* source,
|
||||
blink::mojom::ConsoleMessageLevel log_level,
|
||||
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.cc b/components/offline_pages/content/background_loader/background_loader_contents.cc
|
||||
index e0e9a5a8c1d8c242d39935e2456052619af33cc6..80518793447c70e8fc1dae9b42a59d40427ae52b 100644
|
||||
--- a/components/offline_pages/content/background_loader/background_loader_contents.cc
|
||||
@@ -218,10 +218,10 @@ index c6838c83ef971b88769b1f3fba8095025ae25464..2da6a4e08340e72ba7de5d03444c2f17
|
||||
content::WebContents* AddNewContents(
|
||||
content::WebContents* source,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 690d589eed3515113ad3c40506872f98c2c44bde..d96da1eb8143a5390bdfbf6fbba82c3f8150b211 100644
|
||||
index 952fd20f71560acd89c74f08e9d8cdbf34fb5a1a..59b05937ceb1b81b69d913f587150021b9031106 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4913,8 +4913,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4943,8 +4943,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
// TODO(crbug.com/40202416): Support a way for MPArch guests to support this.
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -394,7 +394,7 @@ index 62be493c74423875af45a92c98b2ffceb928189f..ec82d8e47bf0a33f832b8ca242f395fe
|
||||
->options()
|
||||
->block_new_web_contents();
|
||||
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
|
||||
index d51816a633efee5aca5a5b7a0135bd331d604c14..0c0c937020ef486e6bfbeaa52cb2643a093d206a 100644
|
||||
index bf432db4ca8463f2451dc09d5ca484da1235634f..e144be74ce2d34f50d26d08d5bf206f7aa64c5d3 100644
|
||||
--- a/ui/views/controls/webview/web_dialog_view.cc
|
||||
+++ b/ui/views/controls/webview/web_dialog_view.cc
|
||||
@@ -487,8 +487,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Kerr <charles@charleskerr.com>
|
||||
Date: Sat, 22 Feb 2025 13:15:39 -0600
|
||||
Subject: chore: remove conflicting allow_unsafe_libc_calls
|
||||
|
||||
We want builds to fail if a buffer warning comes from Electron code but
|
||||
not from code that we don't maintain (e.g. upstream Chromium code), so
|
||||
//electron/electron_unsafe_buffer_paths.txt turns off Chromium warnings.
|
||||
|
||||
There are some upstream files that generate warnings *and* also have
|
||||
pragmas that override //electron/electron_unsafe_buffer_paths.txt,
|
||||
forcing them to be tested. This breaks our build.
|
||||
|
||||
Files can be removed from this patch when upstream either removes the
|
||||
pragma or fixes the other warnings. This patch can be removed when no
|
||||
files are left.
|
||||
|
||||
diff --git a/net/cookies/parsed_cookie.cc b/net/cookies/parsed_cookie.cc
|
||||
index 7d5d0106a3675b3fa21b0e00a755f5c0ed11c87b..d26c645d70b54b31815c8140954ee6d0a34fa8af 100644
|
||||
--- a/net/cookies/parsed_cookie.cc
|
||||
+++ b/net/cookies/parsed_cookie.cc
|
||||
@@ -2,11 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
-#ifdef UNSAFE_BUFFERS_BUILD
|
||||
-// TODO(crbug.com/390223051): Remove C-library calls to fix the errors.
|
||||
-#pragma allow_unsafe_libc_calls
|
||||
-#endif
|
||||
-
|
||||
// Portions of this code based on Mozilla:
|
||||
// (netwerk/cookie/src/nsCookieService.cpp)
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
|
||||
index 34ef2be4415825254c41d5970be33b1195a9a381..4a3462664c22f6d367e02ac03551c22c0db52a4d 100644
|
||||
--- a/net/http/http_response_headers.cc
|
||||
+++ b/net/http/http_response_headers.cc
|
||||
@@ -2,11 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
-#ifdef UNSAFE_BUFFERS_BUILD
|
||||
-// TODO(crbug.com/390223051): Remove C-library calls to fix the errors.
|
||||
-#pragma allow_unsafe_libc_calls
|
||||
-#endif
|
||||
-
|
||||
// The rules for header parsing were borrowed from Firefox:
|
||||
// http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpResponseHead.cpp
|
||||
// The rules for parsing content-types were also borrowed from Firefox:
|
||||
@@ -159,10 +159,10 @@ index a955d19eedfe56ae3a115ce4c77fea016fd66d49..ad2557495a02cae03dd2b87df8659a6f
|
||||
}
|
||||
|
||||
diff --git a/ui/base/x/x11_global_shortcut_listener.cc b/ui/base/x/x11_global_shortcut_listener.cc
|
||||
index 9e73ed854072bf3d66dbab4cfb5b0a6a9068aafa..82ca3354afc2a0c4c09c6332512902859c77f4c9 100644
|
||||
index 838b89cd8d2c1884ce253a42325faabe73ee3985..b47019cd02202b8f1ea29d45e6b1741e2a9a953e 100644
|
||||
--- a/ui/base/x/x11_global_shortcut_listener.cc
|
||||
+++ b/ui/base/x/x11_global_shortcut_listener.cc
|
||||
@@ -34,11 +34,13 @@ const auto kModifiersMasks = std::to_array<x11::ModMask>({
|
||||
@@ -34,11 +34,13 @@ constexpr auto kModifiersMasks = std::to_array<x11::ModMask>({
|
||||
|
||||
x11::ModMask GetNativeModifiers(bool is_alt_down,
|
||||
bool is_ctrl_down,
|
||||
|
||||
@@ -95,10 +95,10 @@ index 801bfd401ea4a8e72417d88efaa718cc6fb60883..663fec68d0c2855cdf83bb259b85c229
|
||||
friend class ContentClientCreator;
|
||||
friend class ContentClientInitializer;
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 7f7ea9ea6dd9b5f3af436570661fa736f912132e..1eed83656482ec330b51899bc8fbf3d5cbcf34fa 100644
|
||||
index 578e200a88d89b356e991b3317ff1e71f25ff75e..ae49b7b5e830a7127812219df1c8888b7ba4b348 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -664,8 +664,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
@@ -672,8 +672,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
|
||||
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
||||
|
||||
@@ -108,7 +108,7 @@ index 7f7ea9ea6dd9b5f3af436570661fa736f912132e..1eed83656482ec330b51899bc8fbf3d5
|
||||
if (g_mapped_snapshot) {
|
||||
// TODO(crbug.com/40558459): Confirm not loading different type of snapshot
|
||||
// files in a process.
|
||||
@@ -674,10 +673,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
@@ -682,10 +681,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
|
||||
base::MemoryMappedFile::Region file_region;
|
||||
base::File file =
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: disabling compositor recycling
|
||||
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 943e3b8875c68178e84ae79c241c7a31e9305c6c..6055992c0f61348a95823b64c73574ca6b24904b 100644
|
||||
index 71db145609652dbbe733dbc96d2630b686f6c8c9..6aa0fd5422ee0057acc3e5c423ca2847a4ebb17e 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -560,7 +560,11 @@
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 e6d739f62afc1c8fa8c19601f8bc034c5ce7edf1..99d7fe568cecce44b68dfb896f4d2560d75b5556 100644
|
||||
index 22ffafd8f5e0f49d5c9df7ecd3f61dad3dfd2814..a409c64768968c81be3b6c7e7646f8df26e2afe6 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -832,6 +832,10 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -21,10 +21,10 @@ index e6d739f62afc1c8fa8c19601f8bc034c5ce7edf1..99d7fe568cecce44b68dfb896f4d2560
|
||||
// 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 fe1fdd4d52e8671daf173dbded92af0e95812452..18087692f089fb86def2da7d5ec98acad6e0f3db 100644
|
||||
index c201cff9e5c3b286389a5eb74e1a9ebd86edfef9..949f6a7867758e35c24897add9a4d47a641357b2 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -1015,6 +1015,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
@@ -1012,6 +1012,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
// Requests a commit and forced redraw in the renderer compositor.
|
||||
void ForceRedrawForTesting();
|
||||
|
||||
@@ -35,7 +35,7 @@ index fe1fdd4d52e8671daf173dbded92af0e95812452..18087692f089fb86def2da7d5ec98aca
|
||||
// |routing_id| must not be MSG_ROUTING_NONE.
|
||||
// If this object outlives |delegate|, DetachDelegate() must be called when
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 1d08f25b91496dbafc3a164e7fb3e66d1a48557b..92085aca6bd0c95a73b98e4173c0128d596b77f4 100644
|
||||
index 70f368ab0c59e7f495cb13094160d72f601e0938..19d2df47b0c929558ac8cfc208742dfef463a68b 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -643,7 +643,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: feat: enable setting aspect ratio to 0
|
||||
Make SetAspectRatio accept 0 as valid input, which would reset to null.
|
||||
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
index 88d8d9985c6b4c7051f00cba9dfa51b3fcfa524b..2d05856687cd9669f72553d33c8033fd9083b4f8 100644
|
||||
index 24f63e82a1a170b392bdc8e868729ddd5f9238fa..55c426aee12da4d4d1f62dc7d489133e8d21dc49 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
@@ -637,7 +637,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
|
||||
@@ -19,10 +19,10 @@ index 88d8d9985c6b4c7051f00cba9dfa51b3fcfa524b..2d05856687cd9669f72553d33c8033fd
|
||||
excluded_margin);
|
||||
}
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index b3dc46c34f2aff45b3bd8ea041f2e55ba61d50f9..a802f4b710b6f8fa154d11846c061720a91e15e4 100644
|
||||
index 8d5002fab43ccfcaccdb044fc9b2a95748e71b75..adade58a533c373087d8c51a5744e8f118ba6e9d 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -988,8 +988,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
|
||||
@@ -997,8 +997,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
|
||||
|
||||
void HWNDMessageHandler::SetAspectRatio(float aspect_ratio,
|
||||
const gfx::Size& excluded_margin) {
|
||||
|
||||
@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
|
||||
|
||||
} // namespace net
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 64dede12549790b8ce9e50b3de2a62154f5acf79..5d39f64bda0a48f1e278686f3ac567fd441afce4 100644
|
||||
index b1df0a09a9bfd226ffe7b37144e6599b099e619e..f8c7bc591552fea25b4a8e0edd7a3823b00e6b06 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1810,6 +1810,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -1814,6 +1814,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index 64dede12549790b8ce9e50b3de2a62154f5acf79..5d39f64bda0a48f1e278686f3ac567fd
|
||||
// This may only be called on NetworkContexts created with the constructor
|
||||
// that calls MakeURLRequestContext().
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index fe04f634b32e503f6e93ae6f20c8c7f7c85d02be..990df479da79b513cf8797aa2fcacba10c4fbbd9 100644
|
||||
index 930e0bd987c48d111b2c8d71147c09e4418bda6c..9373a53c5cac879c689fcea77f1dbbb32cf35b9e 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -317,6 +317,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -323,6 +323,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override;
|
||||
@@ -63,10 +63,10 @@ index fe04f634b32e503f6e93ae6f20c8c7f7c85d02be..990df479da79b513cf8797aa2fcacba1
|
||||
void SetEnableReferrers(bool enable_referrers) override;
|
||||
#if BUILDFLAG(IS_CT_SUPPORTED)
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index e928d012d77ccffe16263fd0ee7c2769adfe4bac..1be1b691fa240fa3c5e2c572821977a968841211 100644
|
||||
index cf4d2dcf86b6536c37d46875f74517e478b34928..b19976926137cae56094ec6e292a5014c2fd546b 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1253,6 +1253,9 @@ interface NetworkContext {
|
||||
@@ -1267,6 +1267,9 @@ interface NetworkContext {
|
||||
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
||||
NetworkConditions? conditions);
|
||||
|
||||
@@ -77,10 +77,10 @@ index e928d012d77ccffe16263fd0ee7c2769adfe4bac..1be1b691fa240fa3c5e2c572821977a9
|
||||
SetAcceptLanguage(string new_accept_language);
|
||||
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index 97e8f9f145cecad9b0cd8b43a2de4af29cec7778..b9539a731d2252c8301d51ccb7a1bd7b1a23ca53 100644
|
||||
index da8551db16849cf82a6e3a7eaeb451cae0707f2d..6e20b8dd4f134ea7a8808223cd59064d89f5ce09 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -156,6 +156,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
@@ -158,6 +158,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override {}
|
||||
|
||||
@@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be
|
||||
done in future work.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 20b4be1d50eb00f36c545714b9a676246682a017..6852fed1b09408857d42727c5bcd422f0fe7322b 100644
|
||||
index 10c3795839969bde6a747da67d5cc7caa44a7179..9810991e0a5d8b931a70e056b6651b8e5fdb9881 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -169,6 +169,7 @@
|
||||
@@ -23,7 +23,7 @@ index 20b4be1d50eb00f36c545714b9a676246682a017..6852fed1b09408857d42727c5bcd422f
|
||||
#include "third_party/blink/renderer/platform/graphics/image.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
|
||||
@@ -1866,6 +1867,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
@@ -1859,6 +1860,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
web_view_impl->SetMaximumLegibleScale(
|
||||
prefs.default_maximum_page_scale_factor);
|
||||
|
||||
@@ -179,7 +179,7 @@ index 08cbe32a258bf478f1da0a07064d3e9ef14c44a5..b9f2a43cb90fac4b031a4b4da38d6435
|
||||
if (!WriteToSocket(socket.fd(), to_send.data(), to_send.length())) {
|
||||
// Try to kill the other process, because it might have been dead.
|
||||
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
|
||||
index d91f58ebe3a024bc41ed72121c49172f68e0d862..255160d6bd6b2ea1cd640fde8f4b4ce598148418 100644
|
||||
index d91f58ebe3a024bc41ed72121c49172f68e0d862..7b85ba5ed8d0c2a152899ad65f275e6680a93dba 100644
|
||||
--- a/chrome/browser/process_singleton_win.cc
|
||||
+++ b/chrome/browser/process_singleton_win.cc
|
||||
@@ -81,10 +81,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
|
||||
@@ -197,7 +197,7 @@ index d91f58ebe3a024bc41ed72121c49172f68e0d862..255160d6bd6b2ea1cd640fde8f4b4ce5
|
||||
static const int min_message_size = 7;
|
||||
if (cds->cbData < min_message_size * sizeof(wchar_t) ||
|
||||
cds->cbData % sizeof(wchar_t) != 0) {
|
||||
@@ -134,6 +136,37 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
|
||||
@@ -134,6 +136,23 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
|
||||
const std::wstring cmd_line =
|
||||
msg.substr(second_null + 1, third_null - second_null);
|
||||
*parsed_command_line = base::CommandLine::FromString(cmd_line);
|
||||
@@ -210,32 +210,18 @@ index d91f58ebe3a024bc41ed72121c49172f68e0d862..255160d6bd6b2ea1cd640fde8f4b4ce5
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ // Get length of the additional data.
|
||||
+ const std::wstring additional_data_length_string =
|
||||
+ msg.substr(third_null + 1, fourth_null - third_null);
|
||||
+ size_t additional_data_length;
|
||||
+ base::StringToSizeT(additional_data_length_string, &additional_data_length);
|
||||
+
|
||||
+ const std::wstring::size_type fifth_null =
|
||||
+ msg.find_first_of(L'\0', fourth_null + 1);
|
||||
+ if (fifth_null == std::wstring::npos ||
|
||||
+ fifth_null == msg.length()) {
|
||||
+ LOG(WARNING) << "Invalid format for start command, we need a string in 6 "
|
||||
+ "parts separated by NULLs";
|
||||
+ }
|
||||
+
|
||||
+ // Get the actual additional data.
|
||||
+ const std::wstring additional_data =
|
||||
+ msg.substr(fourth_null + 1, fifth_null - fourth_null);
|
||||
+ const uint8_t* additional_data_bytes =
|
||||
+ reinterpret_cast<const uint8_t*>(additional_data.c_str());
|
||||
+ *parsed_additional_data = std::vector<uint8_t>(additional_data_bytes,
|
||||
+ additional_data_bytes + additional_data_length);
|
||||
+ msg.substr(third_null + 1, fourth_null - third_null);
|
||||
+ base::span<const uint8_t> additional_data_bytes =
|
||||
+ base::as_byte_span(additional_data);
|
||||
+ *parsed_additional_data = std::vector<uint8_t>(
|
||||
+ additional_data_bytes.begin(), additional_data_bytes.end());
|
||||
+
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -155,13 +188,14 @@ bool ProcessLaunchNotification(
|
||||
@@ -155,13 +174,14 @@ bool ProcessLaunchNotification(
|
||||
|
||||
base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
|
||||
base::FilePath current_directory;
|
||||
@@ -253,7 +239,7 @@ index d91f58ebe3a024bc41ed72121c49172f68e0d862..255160d6bd6b2ea1cd640fde8f4b4ce5
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -265,9 +299,11 @@ bool ProcessSingleton::EscapeVirtualization(
|
||||
@@ -265,9 +285,11 @@ bool ProcessSingleton::EscapeVirtualization(
|
||||
ProcessSingleton::ProcessSingleton(
|
||||
const std::string& program_name,
|
||||
const base::FilePath& user_data_dir,
|
||||
@@ -265,7 +251,7 @@ index d91f58ebe3a024bc41ed72121c49172f68e0d862..255160d6bd6b2ea1cd640fde8f4b4ce5
|
||||
program_name_(program_name),
|
||||
is_app_sandboxed_(is_app_sandboxed),
|
||||
is_virtualized_(false),
|
||||
@@ -294,7 +330,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
||||
@@ -294,7 +316,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
||||
return PROCESS_NONE;
|
||||
}
|
||||
|
||||
@@ -275,7 +261,7 @@ index d91f58ebe3a024bc41ed72121c49172f68e0d862..255160d6bd6b2ea1cd640fde8f4b4ce5
|
||||
return PROCESS_NOTIFIED;
|
||||
case NotifyChromeResult::NOTIFY_FAILED:
|
||||
diff --git a/chrome/browser/win/chrome_process_finder.cc b/chrome/browser/win/chrome_process_finder.cc
|
||||
index 019ac7e93e009a713ce56ee8bcacf467b4fe769d..9417403bb9cacd0572b37493ab2d98130313db4d 100644
|
||||
index 019ac7e93e009a713ce56ee8bcacf467b4fe769d..283693966c041340983aa78a95f8a274db601fb4 100644
|
||||
--- a/chrome/browser/win/chrome_process_finder.cc
|
||||
+++ b/chrome/browser/win/chrome_process_finder.cc
|
||||
@@ -39,7 +39,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) {
|
||||
@@ -289,13 +275,13 @@ index 019ac7e93e009a713ce56ee8bcacf467b4fe769d..9417403bb9cacd0572b37493ab2d9813
|
||||
TRACE_EVENT0("startup", "AttemptToNotifyRunningChrome");
|
||||
|
||||
DCHECK(remote_window);
|
||||
@@ -68,12 +70,29 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
|
||||
@@ -68,12 +70,24 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
|
||||
new_command_line.AppendSwitchNative(switches::kSourceShortcut, si.lpTitle);
|
||||
|
||||
// Send the command line to the remote chrome window.
|
||||
- // Format is "START\0<<<current directory>>>\0<<<commandline>>>".
|
||||
+ // Format is
|
||||
+ // "START\0<current-directory>\0<command-line>\0<additional-data-length>\0<additional-data>".
|
||||
+ // "START\0<current-directory>\0<command-line>\0<additional-data>".
|
||||
std::wstring to_send = base::StrCat(
|
||||
{std::wstring_view{L"START\0", 6}, cur_dir.value(),
|
||||
std::wstring_view{L"\0", 1}, new_command_line.GetCommandLineString(),
|
||||
@@ -303,11 +289,6 @@ index 019ac7e93e009a713ce56ee8bcacf467b4fe769d..9417403bb9cacd0572b37493ab2d9813
|
||||
|
||||
+ size_t additional_data_size = additional_data.size_bytes();
|
||||
+ if (additional_data_size) {
|
||||
+ // Send over the size, because the reinterpret cast to wchar_t could
|
||||
+ // add padding.
|
||||
+ to_send.append(base::UTF8ToWide(base::NumberToString(additional_data_size)));
|
||||
+ to_send.append(L"\0", 1); // Null separator.
|
||||
+
|
||||
+ size_t padded_size = additional_data_size / sizeof(wchar_t);
|
||||
+ if (additional_data_size % sizeof(wchar_t) != 0) {
|
||||
+ padded_size++;
|
||||
|
||||
@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
|
||||
We can remove this patch once it has in some shape been upstreamed.
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
|
||||
index 95876b4040844b598ea7219732a044b4423f8d97..4e02620b7887d1b70b2a9b9e21b819d99efdca18 100644
|
||||
index 1ebd8809abb3208d402b6bd728114f7fea3ac52c..a564078fd9fe0c605a0dcb9eb21beabda389771f 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -210,6 +210,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
|
||||
@@ -26,10 +26,10 @@ index 95876b4040844b598ea7219732a044b4423f8d97..4e02620b7887d1b70b2a9b9e21b819d9
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index 4e825d649919c88aad26e4c3b2fd80575ca57db0..de1d8fea0113b55065e5229b07f95d691ccb393e 100644
|
||||
index 2e657f24bb625c7a7af14686553aebdc06ad8eda..6f2384338ac4a48a78bc8aac8b4bb9d330d686b3 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -458,6 +458,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -458,6 +458,23 @@ class COMPONENT_EXPORT(NATIVE_THEME) NativeTheme {
|
||||
scoped_refptr<ColorProviderKey::ThemeInitializerSupplier> custom_theme,
|
||||
bool use_custom_frame = true) const;
|
||||
|
||||
@@ -53,7 +53,7 @@ index 4e825d649919c88aad26e4c3b2fd80575ca57db0..de1d8fea0113b55065e5229b07f95d69
|
||||
// Returns a shared instance of the native theme that should be used for web
|
||||
// rendering. Do not use it in a normal application context (i.e. browser).
|
||||
// The returned object should not be deleted by the caller. This function is
|
||||
@@ -713,6 +730,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -713,6 +730,7 @@ class COMPONENT_EXPORT(NATIVE_THEME) NativeTheme {
|
||||
PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;
|
||||
std::optional<base::TimeDelta> caret_blink_interval_;
|
||||
bool use_overlay_scrollbars_ = false;
|
||||
@@ -62,10 +62,10 @@ index 4e825d649919c88aad26e4c3b2fd80575ca57db0..de1d8fea0113b55065e5229b07f95d69
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
};
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index 2b2a12cd9d1ac17a245f049cf0775b46c0596531..350586d35b29fb8d772ea70615768d0e62dc5474 100644
|
||||
index ff43747a45b5f508f45afb1e6304bda22ae46fbc..955c3734591f608f32b40927e53db1bf453ce907 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -688,6 +688,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
@@ -695,6 +695,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
if (InForcedColorsMode() && !IsForcedDarkMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9,18 +9,18 @@ embedders to make custom schemes allow V8 code cache.
|
||||
Chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/5019665
|
||||
|
||||
diff --git a/content/browser/code_cache/generated_code_cache.cc b/content/browser/code_cache/generated_code_cache.cc
|
||||
index bba85bb47e489b73c2341bbeb9aa04099d712889..4bd69c3c5511a4f492f78f203284c8e546c9f067 100644
|
||||
index cad3cf44df0c65067d18490ee7694fd0f82153af..0f9b64a81e0c4114bd885b24ff65c458810ceb99 100644
|
||||
--- a/content/browser/code_cache/generated_code_cache.cc
|
||||
+++ b/content/browser/code_cache/generated_code_cache.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <iostream>
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
+#include "base/containers/contains.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
@@ -36,6 +37,7 @@
|
||||
@@ -32,6 +33,7 @@
|
||||
#include "net/http/http_cache.h"
|
||||
#include "third_party/blink/public/common/scheme_registry.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -28,7 +28,7 @@ index bba85bb47e489b73c2341bbeb9aa04099d712889..4bd69c3c5511a4f492f78f203284c8e5
|
||||
|
||||
using storage::BigIOBuffer;
|
||||
|
||||
@@ -48,7 +50,7 @@ constexpr char kSeparator[] = " \n";
|
||||
@@ -44,7 +46,7 @@ constexpr char kSeparator[] = " \n";
|
||||
|
||||
// We always expect to receive valid URLs that can be used as keys to the code
|
||||
// cache. The relevant checks (for ex: resource_url is valid, origin_lock is
|
||||
@@ -37,7 +37,7 @@ index bba85bb47e489b73c2341bbeb9aa04099d712889..4bd69c3c5511a4f492f78f203284c8e5
|
||||
//
|
||||
// This function doesn't enforce anything in the production code. It is here
|
||||
// to make the assumptions explicit and to catch any errors when DCHECKs are
|
||||
@@ -58,33 +60,55 @@ void CheckValidKeys(const GURL& resource_url,
|
||||
@@ -54,33 +56,55 @@ void CheckValidKeys(const GURL& resource_url,
|
||||
GeneratedCodeCache::CodeCacheType cache_type) {
|
||||
// If the resource url is invalid don't cache the code.
|
||||
DCHECK(resource_url.is_valid());
|
||||
|
||||
@@ -7,10 +7,10 @@ Subject: feat: allow embedders to add observers on created hunspell
|
||||
This patch is used by Electron to implement spellchecker events.
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
index 5140efab98b7d8d357ea0d97ee25814ea2e1ed8f..979630ba7ffe84d78804a02b832ce7787aecf2d9 100644
|
||||
index c2dd0fdc774a939dfe489180e019718ba4b192f1..910534aac947890b16b176b10ac8eae9857bd2d7 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
@@ -478,6 +478,8 @@ void SpellcheckService::LoadDictionaries() {
|
||||
@@ -477,6 +477,8 @@ void SpellcheckService::LoadDictionaries() {
|
||||
std::make_unique<SpellcheckHunspellDictionary>(
|
||||
dictionary, platform_spellcheck_language, context_, this));
|
||||
hunspell_dictionaries_.back()->AddObserver(this);
|
||||
@@ -19,7 +19,7 @@ index 5140efab98b7d8d357ea0d97ee25814ea2e1ed8f..979630ba7ffe84d78804a02b832ce778
|
||||
hunspell_dictionaries_.back()->Load();
|
||||
}
|
||||
|
||||
@@ -532,6 +534,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
|
||||
@@ -531,6 +533,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
|
||||
(!hunspell_dictionaries_.empty() || enable_if_uninitialized);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ index afb657b7c9e1ede1273532b16428d37cc5d75c59..16707cf516cd34682c84ea2ccebddaa0
|
||||
requested_format_.pixel_format = media::PIXEL_FORMAT_NV12;
|
||||
DCHECK_GT(requested_format_.frame_size.GetArea(), 0);
|
||||
diff --git a/content/browser/media/capture/io_surface_capture_device_base_mac.cc b/content/browser/media/capture/io_surface_capture_device_base_mac.cc
|
||||
index e59ed011a70358a4ff61342e4db3e0ce4cad8ab0..e3fa18fbade4c11f5317705bc89a1e2456c924bc 100644
|
||||
index 4ec4c895423151d2c907d97de1461cbde8c8a639..0e59797833b81c07299b8c342f591e192183c6f1 100644
|
||||
--- a/content/browser/media/capture/io_surface_capture_device_base_mac.cc
|
||||
+++ b/content/browser/media/capture/io_surface_capture_device_base_mac.cc
|
||||
@@ -20,7 +20,7 @@ void IOSurfaceCaptureDeviceBase::AllocateAndStart(
|
||||
@@ -33,7 +33,7 @@ index e59ed011a70358a4ff61342e4db3e0ce4cad8ab0..e3fa18fbade4c11f5317705bc89a1e24
|
||||
|
||||
void IOSurfaceCaptureDeviceBase::StopAndDeAllocate() {
|
||||
diff --git a/content/browser/media/capture/io_surface_capture_device_base_mac.h b/content/browser/media/capture/io_surface_capture_device_base_mac.h
|
||||
index 8ac12480f663a74dfbdcf7128a582a81b4474d25..db6802a2603e1d3c3039e49737438124bf2ee1f1 100644
|
||||
index e2771b7b281274cdcb601a5bc78a948ad592087b..48d116823a28213e50775f378e6ce04ce3af5072 100644
|
||||
--- a/content/browser/media/capture/io_surface_capture_device_base_mac.h
|
||||
+++ b/content/browser/media/capture/io_surface_capture_device_base_mac.h
|
||||
@@ -25,7 +25,7 @@ class CONTENT_EXPORT IOSurfaceCaptureDeviceBase
|
||||
@@ -46,11 +46,11 @@ index 8ac12480f663a74dfbdcf7128a582a81b4474d25..db6802a2603e1d3c3039e49737438124
|
||||
// OnStop is called by StopAndDeAllocate.
|
||||
virtual void OnStop() = 0;
|
||||
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378719b14fe 100644
|
||||
index 7e17594c30ac3cf8cb484b53563b03fc75bd2e0b..0e4a68f2fd8179640f877cb258b4049610fd49da 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -26,6 +26,61 @@
|
||||
std::optional<gfx::Rect>,
|
||||
@@ -27,6 +27,61 @@
|
||||
std::optional<float>,
|
||||
bool)>;
|
||||
using ErrorCallback = base::RepeatingClosure;
|
||||
+using CancelCallback = base::RepeatingClosure;
|
||||
@@ -111,7 +111,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
|
||||
namespace {
|
||||
API_AVAILABLE(macos(12.3))
|
||||
@@ -120,18 +175,22 @@ @interface ScreenCaptureKitDeviceHelper
|
||||
@@ -123,18 +178,22 @@ @interface ScreenCaptureKitDeviceHelper
|
||||
: NSObject <SCStreamDelegate, SCStreamOutput>
|
||||
|
||||
- (instancetype)initWithSampleCallback:(SampleCallback)sampleCallback
|
||||
@@ -134,7 +134,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
_errorCallback = errorCallback;
|
||||
}
|
||||
return self;
|
||||
@@ -207,29 +266,53 @@ + (SCStreamConfiguration*)streamConfigurationWithFrameSize:(gfx::Size)frameSize
|
||||
@@ -211,29 +270,53 @@ + (SCStreamConfiguration*)streamConfigurationWithFrameSize:(gfx::Size)frameSize
|
||||
|
||||
class API_AVAILABLE(macos(12.3)) ScreenCaptureKitDeviceMac
|
||||
: public IOSurfaceCaptureDeviceBase,
|
||||
@@ -192,7 +192,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
|
||||
void OnShareableContentCreated(SCShareableContent* content) {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
@@ -297,7 +380,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
@@ -301,7 +384,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
// Update the content size. This step is neccessary when used together
|
||||
// with SCContentSharingPicker. If the Chrome picker is used, it will
|
||||
// change to retina resolution if applicable.
|
||||
@@ -306,6 +389,9 @@ void CreateStream(SCContentFilter* filter) {
|
||||
@@ -310,6 +393,9 @@ void CreateStream(SCContentFilter* filter) {
|
||||
filter.contentRect.size.height * filter.pointPixelScale);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
gfx::RectF dest_rect_in_frame;
|
||||
actual_capture_format_ = capture_params().requested_format;
|
||||
actual_capture_format_.pixel_format = media::PIXEL_FORMAT_NV12;
|
||||
@@ -319,6 +405,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
@@ -323,6 +409,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
stream_ = [[SCStream alloc] initWithFilter:filter
|
||||
configuration:config
|
||||
delegate:helper_];
|
||||
@@ -219,7 +219,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
{
|
||||
NSError* error = nil;
|
||||
bool add_stream_output_result =
|
||||
@@ -472,7 +559,7 @@ void OnStreamError() {
|
||||
@@ -480,7 +567,7 @@ void OnStreamError() {
|
||||
if (fullscreen_module_) {
|
||||
fullscreen_module_->Reset();
|
||||
}
|
||||
@@ -228,7 +228,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
} else {
|
||||
client()->OnError(media::VideoCaptureError::kScreenCaptureKitStreamError,
|
||||
FROM_HERE, "Stream delegate called didStopWithError");
|
||||
@@ -495,23 +582,41 @@ void OnUpdateConfigurationError() {
|
||||
@@ -503,23 +590,41 @@ void OnUpdateConfigurationError() {
|
||||
}
|
||||
|
||||
// IOSurfaceCaptureDeviceBase:
|
||||
@@ -285,7 +285,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
}
|
||||
void OnStop() override {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
@@ -569,8 +674,9 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
@@ -577,8 +682,9 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -296,7 +296,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
|
||||
|
||||
// The actual format of the video frames that are sent to `client`.
|
||||
@@ -586,6 +692,10 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
@@ -594,6 +700,10 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
// Helper class that acts as output and delegate for `stream_`.
|
||||
ScreenCaptureKitDeviceHelper* __strong helper_;
|
||||
|
||||
@@ -307,7 +307,7 @@ index 8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c..8749fa47bd841fd5ae57899cb3447378
|
||||
// This is used to detect when a captured presentation enters fullscreen mode.
|
||||
// If this happens, the module will call the ResetStreamTo function.
|
||||
std::unique_ptr<ScreenCaptureKitFullscreenModule> fullscreen_module_;
|
||||
@@ -598,6 +708,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
@@ -606,6 +716,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
base::WeakPtrFactory<ScreenCaptureKitDeviceMac> weak_factory_{this};
|
||||
};
|
||||
|
||||
|
||||
@@ -90,10 +90,10 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 610ed4c922705697b27af569af55064daeff5d25..9cb52cb768e648235f89f65e870d853d45268900 100644
|
||||
index 41c3a5128b9936f48587d6fc6ddd2050bffc9c36..4dbcba1150645596532c53b99e309c0e52d4759f 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -168,6 +168,8 @@ viz_component("service") {
|
||||
@@ -178,6 +178,8 @@ viz_component("service") {
|
||||
"display_embedder/skia_output_surface_impl_on_gpu_debug_capture.h",
|
||||
"display_embedder/skia_render_copy_results.cc",
|
||||
"display_embedder/skia_render_copy_results.h",
|
||||
@@ -522,7 +522,7 @@ index 4d6cc977ed5000d93918336a0dd57f60c0e95bbb..54d936e86b60f0538c70c4ee69e109cc
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
index d119eb1e217cf90c85bf752f1530345b1eec01f2..655ed4ee5525a126309f173775a28e183b4dd29a 100644
|
||||
index 8c660af0aaa1c031815082838dea1497b725e55b..852f4d9ac45aaa51f5edf0b3a5e3492eec52d743 100644
|
||||
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
@@ -112,7 +112,8 @@ RootCompositorFrameSinkImpl::Create(
|
||||
@@ -564,10 +564,10 @@ index 399fba1a3d4e601dc2cdd5f1f4def8b7fd7a3011..8bcbe0d26c80323155d536c0d3a177a1
|
||||
gpu::SyncPointManager* GetSyncPointManager() override;
|
||||
gpu::Scheduler* GetGpuScheduler() override;
|
||||
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
index 378910976c702d81c263973d29e17646c3963494..84553085b75b8cb9296c4af726f9a7bfc0318980 100644
|
||||
index 6e35e3a2e1cc10d62a487111d1e185bf900d9cfa..fe0dbc425746ec97372cade1365a5654b22881f3 100644
|
||||
--- a/content/browser/compositor/viz_process_transport_factory.cc
|
||||
+++ b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
@@ -441,8 +441,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
@@ -436,8 +436,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
mojo::AssociatedRemote<viz::mojom::DisplayPrivate> display_private;
|
||||
root_params->display_private =
|
||||
display_private.BindNewEndpointAndPassReceiver();
|
||||
@@ -585,10 +585,10 @@ index 378910976c702d81c263973d29e17646c3963494..84553085b75b8cb9296c4af726f9a7bf
|
||||
compositor_data.display_client->GetBoundRemote(resize_task_runner_);
|
||||
mojo::AssociatedRemote<viz::mojom::ExternalBeginFrameController>
|
||||
diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
index 7d19b6be8bb0e0269c381cf6efdf79eaeff1e935..b8ec06ade095df99c024396a601dbf1abb97cc00 100644
|
||||
index 3046e60995bceb1c9931038be3d309577a830a60..4476f48510f807d03f05a4afa2a648dac8720010 100644
|
||||
--- a/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
+++ b/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
@@ -117,7 +117,6 @@ interface DisplayClient {
|
||||
@@ -125,7 +125,6 @@ interface DisplayClient {
|
||||
|
||||
// Creates a LayeredWindowUpdater implementation to draw into a layered
|
||||
// window.
|
||||
@@ -620,7 +620,7 @@ index 2f462f0deb5fc8a637457243fb5d5849fc214d14..695869b83cefaa24af93a2e11b39de05
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 7f71cc6b8812cc112262d3e9153884e428a7e495..8a61b0cc5d45a55ac188babf63b59492cff428e1 100644
|
||||
index d353cd4613c734c34f5333607335cc9a434ad88e..cabb39363b30c97f63d323d7a8156774b67f6b32 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -92,6 +92,7 @@ class DisplayPrivate;
|
||||
@@ -657,7 +657,7 @@ index 7f71cc6b8812cc112262d3e9153884e428a7e495..8a61b0cc5d45a55ac188babf63b59492
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -620,6 +633,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
@@ -616,6 +629,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
simple_begin_frame_observers_;
|
||||
std::unique_ptr<ui::HostBeginFrameObserver> host_begin_frame_observer_;
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ headers, moving forward we should find a way in upstream to provide
|
||||
access to these headers for loader clients created on the browser process.
|
||||
|
||||
diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc
|
||||
index babcf42e01be00da8b853a1207e869614765b2bb..1c051a64d77e3ea8909dced73d93764d06ed7152 100644
|
||||
index b60fd23a39eb423450b57275526ac4ba36058225..deafb4cd5a55853eb11a1371ca8331ee5f6050b2 100644
|
||||
--- a/services/network/public/cpp/resource_request.cc
|
||||
+++ b/services/network/public/cpp/resource_request.cc
|
||||
@@ -177,6 +177,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
|
||||
@@ -178,6 +178,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
|
||||
allow_cookies_from_browser = other.allow_cookies_from_browser;
|
||||
include_request_cookies_with_response =
|
||||
other.include_request_cookies_with_response;
|
||||
@@ -28,7 +28,7 @@ index babcf42e01be00da8b853a1207e869614765b2bb..1c051a64d77e3ea8909dced73d93764d
|
||||
cookie_observer =
|
||||
Clone(&const_cast<mojo::PendingRemote<mojom::CookieAccessObserver>&>(
|
||||
other.cookie_observer));
|
||||
@@ -211,6 +212,7 @@ bool ResourceRequest::TrustedParams::EqualsForTesting(
|
||||
@@ -212,6 +213,7 @@ bool ResourceRequest::TrustedParams::EqualsForTesting(
|
||||
const TrustedParams& other) const {
|
||||
return isolation_info.IsEqualForTesting(other.isolation_info) &&
|
||||
disable_secure_dns == other.disable_secure_dns &&
|
||||
@@ -37,10 +37,10 @@ index babcf42e01be00da8b853a1207e869614765b2bb..1c051a64d77e3ea8909dced73d93764d
|
||||
allow_cookies_from_browser == other.allow_cookies_from_browser &&
|
||||
include_request_cookies_with_response ==
|
||||
diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h
|
||||
index 3d1e70bd812c18206846f4188b85321e931964bb..cc3aad56c873bd97adb1179b1626d14ef346378c 100644
|
||||
index b87bb47d4d51f734ee3dc1e38158726795fcd19e..dd862ff8c43ecbc08467bf2b49ed5044d92ad3f3 100644
|
||||
--- a/services/network/public/cpp/resource_request.h
|
||||
+++ b/services/network/public/cpp/resource_request.h
|
||||
@@ -76,6 +76,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
@@ -77,6 +77,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
bool has_user_activation = false;
|
||||
bool allow_cookies_from_browser = false;
|
||||
bool include_request_cookies_with_response = false;
|
||||
@@ -49,10 +49,10 @@ index 3d1e70bd812c18206846f4188b85321e931964bb..cc3aad56c873bd97adb1179b1626d14e
|
||||
mojo::PendingRemote<mojom::TrustTokenAccessObserver> trust_token_observer;
|
||||
mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver>
|
||||
diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc
|
||||
index de0780c4f29026d3cc7d2742d8e80acddc6916ad..76c724151ee12fccecd36d2e9a6b7f264a9907d7 100644
|
||||
index ae26e1cff7235ac77d4610f936cf83b01a9b429d..d45189ba3280cd6802240fc5cee25388f77bdb39 100644
|
||||
--- a/services/network/public/cpp/url_request_mojom_traits.cc
|
||||
+++ b/services/network/public/cpp/url_request_mojom_traits.cc
|
||||
@@ -48,6 +48,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
|
||||
@@ -49,6 +49,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
|
||||
out->allow_cookies_from_browser = data.allow_cookies_from_browser();
|
||||
out->include_request_cookies_with_response =
|
||||
data.include_request_cookies_with_response();
|
||||
@@ -61,10 +61,10 @@ index de0780c4f29026d3cc7d2742d8e80acddc6916ad..76c724151ee12fccecd36d2e9a6b7f26
|
||||
mojo::PendingRemote<network::mojom::CookieAccessObserver>>();
|
||||
out->trust_token_observer = data.TakeTrustTokenObserver<
|
||||
diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h
|
||||
index ebd70d33c9e7df5abd35ed3683f39d0e7fc8b34d..45dd29445589dec900221edb65f8fe566b81ca6e 100644
|
||||
index fc85f9def245d854d210b14f8190119fbd38404b..1392090ef9a1c8c0ef1a958ebeae75f24a11a6ea 100644
|
||||
--- a/services/network/public/cpp/url_request_mojom_traits.h
|
||||
+++ b/services/network/public/cpp/url_request_mojom_traits.h
|
||||
@@ -70,6 +70,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
@@ -71,6 +71,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
const network::ResourceRequest::TrustedParams& trusted_params) {
|
||||
return trusted_params.include_request_cookies_with_response;
|
||||
}
|
||||
@@ -76,10 +76,10 @@ index ebd70d33c9e7df5abd35ed3683f39d0e7fc8b34d..45dd29445589dec900221edb65f8fe56
|
||||
cookie_observer(
|
||||
const network::ResourceRequest::TrustedParams& trusted_params) {
|
||||
diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom
|
||||
index 3e5dae789846c667f7537b04252a49b28298d53d..a229e56674cc75e8dfb78c26962f108ffd59c5e9 100644
|
||||
index eb5ca6401eec0ff1d6a897ea86ca2a1a252f86ec..caedd3dfde37dd136721429f90799e0493ab0a9d 100644
|
||||
--- a/services/network/public/mojom/url_request.mojom
|
||||
+++ b/services/network/public/mojom/url_request.mojom
|
||||
@@ -73,6 +73,9 @@ struct TrustedUrlRequestParams {
|
||||
@@ -74,6 +74,9 @@ struct TrustedUrlRequestParams {
|
||||
// client which should not be able to see them.
|
||||
bool include_request_cookies_with_response = false;
|
||||
|
||||
@@ -90,7 +90,7 @@ index 3e5dae789846c667f7537b04252a49b28298d53d..a229e56674cc75e8dfb78c26962f108f
|
||||
// a cookie. If this is set to non-null, the observer passed to
|
||||
// URLLoaderFactory will be ignored.
|
||||
diff --git a/services/network/public/mojom/url_response_head.mojom b/services/network/public/mojom/url_response_head.mojom
|
||||
index 5c4b8a05034f8defacbc13671fe9bc92f76ade5a..e7390e01f113755613f42d592b36108b703960dc 100644
|
||||
index 1e5b36d0a46d9c66b7a56a6668663dd8196bd172..3431f4c3959264b64ac0f35654719ab0b45b5cb7 100644
|
||||
--- a/services/network/public/mojom/url_response_head.mojom
|
||||
+++ b/services/network/public/mojom/url_response_head.mojom
|
||||
@@ -13,6 +13,7 @@ import "services/network/public/mojom/attribution.mojom";
|
||||
@@ -101,7 +101,7 @@ index 5c4b8a05034f8defacbc13671fe9bc92f76ade5a..e7390e01f113755613f42d592b36108b
|
||||
import "services/network/public/mojom/ip_endpoint.mojom";
|
||||
import "services/network/public/mojom/load_timing_info.mojom";
|
||||
import "services/network/public/mojom/network_param.mojom";
|
||||
@@ -49,6 +50,9 @@ struct URLResponseHead {
|
||||
@@ -50,6 +51,9 @@ struct URLResponseHead {
|
||||
// The response headers or NULL if the URL type does not support headers.
|
||||
HttpResponseHeaders headers;
|
||||
|
||||
@@ -112,10 +112,10 @@ index 5c4b8a05034f8defacbc13671fe9bc92f76ade5a..e7390e01f113755613f42d592b36108b
|
||||
string mime_type;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 4a55e0381a239294a868b5aece518bed26985e83..7daf3e28f12084a3ba8ca132d846dcf333f5d799 100644
|
||||
index c5f551ca79ecfb80a3c29b901d44a83d082a6da6..bae9c2c10d240a8691787d6e52190b13575df020 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -666,6 +666,9 @@ URLLoader::URLLoader(
|
||||
@@ -669,6 +669,9 @@ URLLoader::URLLoader(
|
||||
mojo::SimpleWatcher::ArmingPolicy::MANUAL,
|
||||
base::SequencedTaskRunner::GetCurrentDefault()),
|
||||
per_factory_orb_state_(context.GetMutableOrbState()),
|
||||
@@ -125,7 +125,7 @@ index 4a55e0381a239294a868b5aece518bed26985e83..7daf3e28f12084a3ba8ca132d846dcf3
|
||||
devtools_request_id_(request.devtools_request_id),
|
||||
options_(PopulateOptions(options,
|
||||
factory_params_->is_orb_enabled,
|
||||
@@ -963,7 +966,7 @@ void URLLoader::ConfigureRequest(
|
||||
@@ -970,7 +973,7 @@ void URLLoader::ConfigureRequest(
|
||||
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ index 4a55e0381a239294a868b5aece518bed26985e83..7daf3e28f12084a3ba8ca132d846dcf3
|
||||
url_request_->SetResponseHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
|
||||
}
|
||||
@@ -2049,6 +2052,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
@@ -2062,6 +2065,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
}
|
||||
|
||||
response_ = BuildResponseHead();
|
||||
@@ -155,10 +155,10 @@ index 4a55e0381a239294a868b5aece518bed26985e83..7daf3e28f12084a3ba8ca132d846dcf3
|
||||
|
||||
// Parse and remove the Trust Tokens response headers, if any are expected,
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index 4ce74976a4902914e6f59ea943ef3b5b92d090f6..783e4bd84074530e8ded3af8a1869274bb5ebe0c 100644
|
||||
index 06b9d01648881d1b955cc6db195a658811e47e84..730fd3ef9f95ba634b43856d432c072962d6000e 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -714,6 +714,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
@@ -712,6 +712,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
|
||||
resource_scheduler_request_handle_;
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ Subject: feat: filter out non-shareable windows in the current application in
|
||||
This patch ensures that windows protected via win.setContentProtection(true) do not appear in full display captures via desktopCapturer. This patch could be upstreamed but as the check is limited to in-process windows it doesn't make a lot of sense for Chromium itself. This patch currently has a limitation that it only function for windows created / protected BEFORE the stream is started. There is theoretical future work we can do via polling / observers to automatically update the SCContentFilter when new windows are made but for now this will solve 99+% of the problem and folks can re-order their logic a bit to get it working for their use cases.
|
||||
|
||||
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
index 8e7fb47f5f28f40e8e3bd00d2bb1c928112976e4..8d5a5d16fa08b9eb4abcf167a0d5acd8351a582c 100644
|
||||
index 42705a5c59fb76ba4a6a17a060e215436307de49..7e17594c30ac3cf8cb484b53563b03fc75bd2e0b 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -250,8 +250,17 @@ void OnShareableContentCreated(SCShareableContent* content) {
|
||||
@@ -254,8 +254,17 @@ void OnShareableContentCreated(SCShareableContent* content) {
|
||||
// fallback. See https://crbug.com/325530044.
|
||||
if (source_.id == display.displayID ||
|
||||
source_.id == webrtc::kFullDesktopScreenId) {
|
||||
|
||||
@@ -0,0 +1,733 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Keeley Hammond <khammond@slack-corp.com>
|
||||
Date: Tue, 14 Jan 2025 15:50:29 -0800
|
||||
Subject: feat: allow desktop capturer to return either screen, window or both
|
||||
and make MacOS SCContentSharingPicker work in Electron
|
||||
|
||||
This patch is a work in progress that contains assorted changes to make the MacOS SCContentSharingPicker upstream implementation work within Electron. If this comment is still in this patch during PR review, it is not ready for prime time
|
||||
|
||||
This patch can be removed after our desktopCapturer is refactored.
|
||||
|
||||
diff --git a/chrome/browser/media/webrtc/capture_policy_utils.cc b/chrome/browser/media/webrtc/capture_policy_utils.cc
|
||||
index 36797f37627d534bd446e0d8270618722ed9a2fa..32222cb526dc047a02cd9382814edd71cca0a378 100644
|
||||
--- a/chrome/browser/media/webrtc/capture_policy_utils.cc
|
||||
+++ b/chrome/browser/media/webrtc/capture_policy_utils.cc
|
||||
@@ -356,7 +356,9 @@ void FilterMediaList(std::vector<DesktopMediaList::Type>& media_types,
|
||||
media_types, [capture_level](const DesktopMediaList::Type& type) {
|
||||
switch (type) {
|
||||
case DesktopMediaList::Type::kNone:
|
||||
- NOTREACHED();
|
||||
+ //TODO(review): are we able to remove this?
|
||||
+ return capture_level < AllowedScreenCaptureLevel::kDesktop;
|
||||
+ // NOTREACHED();
|
||||
// SameOrigin is more restrictive than just Tabs, so as long as
|
||||
// at least SameOrigin is allowed, these entries should stay.
|
||||
// They should be filtered later by the caller.
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
index 08400be4d1bae18502d19beed6b2d9057e55dd4f..4df1a9f44959db1f73d6a8a535d297343f7f0c00 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
@@ -12,9 +12,11 @@
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
+#include "base/logging.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/hash/hash.h"
|
||||
#include "chrome/browser/media/webrtc/desktop_media_list.h"
|
||||
+#include "chrome/browser/media/webrtc/thumbnail_capturer_mac.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
@@ -60,24 +62,34 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
|
||||
// If there is a delegated source list, it may not have been started yet.
|
||||
if (IsSourceListDelegated())
|
||||
StartDelegatedCapturer();
|
||||
+ LOG(ERROR) << "start delegated capturer";
|
||||
|
||||
// Process sources previously discovered by a call to Update().
|
||||
if (observer_) {
|
||||
for (size_t i = 0; i < sources_.size(); i++) {
|
||||
observer_->OnSourceAdded(i);
|
||||
+ LOG(ERROR) << "OnSourceAdded, i: " << i;
|
||||
}
|
||||
}
|
||||
-
|
||||
+ LOG(INFO)<< "Refresh callback_ is null: " << refresh_callback_.is_null() << ";";
|
||||
DCHECK(!refresh_callback_);
|
||||
+ LOG(INFO) << "dcheck passed";
|
||||
refresh_callback_ = base::BindOnce(&DesktopMediaListBase::ScheduleNextRefresh,
|
||||
weak_factory_.GetWeakPtr());
|
||||
Refresh(true);
|
||||
}
|
||||
|
||||
void DesktopMediaListBase::Update(UpdateCallback callback, bool refresh_thumbnails) {
|
||||
+ LOG(ERROR) << "Update";
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK(sources_.empty());
|
||||
- DCHECK(!refresh_callback_);
|
||||
+ #if BUILDFLAG(IS_MAC)
|
||||
+ if (!ShouldUseSCContentSharingPicker()) {
|
||||
+ DCHECK(!refresh_callback_);
|
||||
+ };
|
||||
+ #else
|
||||
+ DCHECK(!refresh_callback_);
|
||||
+ #endif
|
||||
refresh_callback_ = std::move(callback);
|
||||
Refresh(refresh_thumbnails);
|
||||
}
|
||||
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
index 312882d656f9f6b3d3fd98128131cea63f818e0d..f61697e1717fcfa0500974e8523438389fbab5ae 100644
|
||||
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
@@ -45,6 +45,7 @@
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
+#include "chrome/browser/media/webrtc/thumbnail_capturer_mac.h"
|
||||
#include "components/remote_cocoa/browser/scoped_cg_window_id.h"
|
||||
#endif
|
||||
|
||||
@@ -162,9 +163,10 @@ content::DesktopMediaID::Type ConvertToDesktopMediaIDType(
|
||||
return content::DesktopMediaID::Type::TYPE_SCREEN;
|
||||
case DesktopMediaList::Type::kWindow:
|
||||
return content::DesktopMediaID::Type::TYPE_WINDOW;
|
||||
+ case DesktopMediaList::Type::kNone:
|
||||
+ return content::DesktopMediaID::Type::TYPE_NONE;
|
||||
case DesktopMediaList::Type::kWebContents:
|
||||
case DesktopMediaList::Type::kCurrentTab:
|
||||
- case DesktopMediaList::Type::kNone:
|
||||
break;
|
||||
}
|
||||
NOTREACHED();
|
||||
@@ -372,7 +374,8 @@ NativeDesktopMediaList::Worker::Worker(
|
||||
nullptr) {
|
||||
DCHECK(capturer_);
|
||||
|
||||
- DCHECK(source_type_ == DesktopMediaID::Type::TYPE_WINDOW ||
|
||||
+ DCHECK(source_type_ == DesktopMediaID::Type::TYPE_WINDOW || source_type_ ==
|
||||
+ DesktopMediaID::Type::TYPE_NONE ||
|
||||
!add_current_process_windows_);
|
||||
}
|
||||
|
||||
@@ -505,11 +508,27 @@ NativeDesktopMediaList::Worker::FormatSources(
|
||||
break;
|
||||
|
||||
case DesktopMediaID::Type::TYPE_WINDOW:
|
||||
+ case DesktopMediaID::Type::TYPE_NONE:
|
||||
+ #if BUILDFLAG(IS_MAC)
|
||||
+ // If using NativeScreenCapturePickerMac,
|
||||
+ // skipping the picker will skip the first window selection.
|
||||
+ if (ShouldUseSCContentSharingPicker()) {
|
||||
+ title = base::UTF8ToUTF16(sources[i].title);
|
||||
+ LOG(ERROR) << "formatting native picker source, id: " << sources[i].id << " title: " << title;
|
||||
+ LOG(ERROR) << "sources size: " << sources.size();
|
||||
+ LOG(ERROR) << "excluded window id: " << excluded_window_id;
|
||||
+ } else if (sources[i].id == excluded_window_id) {
|
||||
+ // Skip the picker dialog window.
|
||||
+ continue;
|
||||
+ }
|
||||
+ title = base::UTF8ToUTF16(sources[i].title);
|
||||
+ #else
|
||||
// Skip the picker dialog window.
|
||||
if (sources[i].id == excluded_window_id) {
|
||||
continue;
|
||||
}
|
||||
title = base::UTF8ToUTF16(sources[i].title);
|
||||
+ #endif
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -775,14 +794,10 @@ NativeDesktopMediaList::NativeDesktopMediaList(
|
||||
is_source_list_delegated_(capturer->GetDelegatedSourceListController() !=
|
||||
nullptr) {
|
||||
type_ = type;
|
||||
-
|
||||
- DCHECK(type_ == DesktopMediaList::Type::kWindow ||
|
||||
+ DCHECK(type_ == DesktopMediaList::Type::kWindow || type_ == DesktopMediaList::Type::kNone ||
|
||||
!add_current_process_windows_);
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
- // webrtc::DesktopCapturer implementations on Windows, MacOS and Fuchsia
|
||||
- // expect to run on a thread with a UI message pump. Under Fuchsia the
|
||||
- // capturer needs an async loop to support FIDL I/O.
|
||||
base::MessagePumpType thread_type = base::MessagePumpType::UI;
|
||||
#else
|
||||
base::MessagePumpType thread_type = base::MessagePumpType::DEFAULT;
|
||||
@@ -794,8 +809,9 @@ NativeDesktopMediaList::NativeDesktopMediaList(
|
||||
std::move(capturer), add_current_process_windows_,
|
||||
auto_show_delegated_source_list);
|
||||
|
||||
- if (!is_source_list_delegated_)
|
||||
+ if (!is_source_list_delegated_) {
|
||||
StartCapturer();
|
||||
+ }
|
||||
}
|
||||
|
||||
NativeDesktopMediaList::~NativeDesktopMediaList() {
|
||||
@@ -903,7 +919,7 @@ void NativeDesktopMediaList::ShowDelegatedList() {
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::Refresh(bool update_thumbnails) {
|
||||
- DCHECK(can_refresh());
|
||||
+ DCHECK(can_refresh());
|
||||
|
||||
#if defined(USE_AURA)
|
||||
DCHECK_EQ(pending_aura_capture_requests_, 0);
|
||||
diff --git a/chrome/browser/media/webrtc/thumbnail_capturer_mac.h b/chrome/browser/media/webrtc/thumbnail_capturer_mac.h
|
||||
index 12a74f8f32cc00a7f3d7802865ae4b309961341d..acbcfb08ae8c44e24a04b326096289428bc6ff60 100644
|
||||
--- a/chrome/browser/media/webrtc/thumbnail_capturer_mac.h
|
||||
+++ b/chrome/browser/media/webrtc/thumbnail_capturer_mac.h
|
||||
@@ -8,6 +8,9 @@
|
||||
#include "chrome/browser/media/webrtc/desktop_media_list.h"
|
||||
#include "chrome/browser/media/webrtc/thumbnail_capturer.h"
|
||||
|
||||
+// Returns true if the SCK sharing picker is available and enabled.
|
||||
+bool ShouldUseSCContentSharingPicker();
|
||||
+
|
||||
// Returns true if the SCK thumbnail capturer is available and enabled.
|
||||
bool ShouldUseThumbnailCapturerMac(DesktopMediaList::Type type);
|
||||
|
||||
diff --git a/chrome/browser/media/webrtc/thumbnail_capturer_mac.mm b/chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
index 744f2447dc2d43c4f6be695bf561474993468705..bb5781b0f0df11422f8355dcc59f5f0f46ebcf89 100644
|
||||
--- a/chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
+++ b/chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
+#include "base/logging.h"
|
||||
#include "base/apple/bridging.h"
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
@@ -71,11 +72,11 @@
|
||||
return content::DesktopMediaID::Type::TYPE_SCREEN;
|
||||
case DesktopMediaList::Type::kWindow:
|
||||
return content::DesktopMediaID::Type::TYPE_WINDOW;
|
||||
+ case DesktopMediaList::Type::kNone:
|
||||
+ return content::DesktopMediaID::Type::TYPE_NONE;
|
||||
case DesktopMediaList::Type::kWebContents:
|
||||
case DesktopMediaList::Type::kCurrentTab:
|
||||
return content::DesktopMediaID::Type::TYPE_WEB_CONTENTS;
|
||||
- case DesktopMediaList::Type::kNone:
|
||||
- break;
|
||||
}
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -442,7 +443,7 @@ void OnCapturedFrame(base::apple::ScopedCFTypeRef<CGImageRef> image,
|
||||
max_frame_rate_(kThumbnailCapturerMacMaxFrameRate),
|
||||
shareable_windows_([[NSArray<SCWindow*> alloc] init]) {
|
||||
CHECK(type_ == DesktopMediaList::Type::kWindow ||
|
||||
- type_ == DesktopMediaList::Type::kScreen);
|
||||
+ type_ == DesktopMediaList::Type::kScreen || type_ == DesktopMediaList::Type::kNone);
|
||||
}
|
||||
|
||||
ThumbnailCapturerMac::~ThumbnailCapturerMac() {
|
||||
@@ -680,17 +681,15 @@ void OnCapturedFrame(base::apple::ScopedCFTypeRef<CGImageRef> image,
|
||||
source_id);
|
||||
}
|
||||
|
||||
+} // namespace
|
||||
+
|
||||
bool ShouldUseSCContentSharingPicker() {
|
||||
if (@available(macOS 15.0, *)) {
|
||||
- if (base::FeatureList::IsEnabled(media::kUseSCContentSharingPicker)) {
|
||||
- return true;
|
||||
- }
|
||||
+ return base::FeatureList::IsEnabled(media::kUseSCContentSharingPicker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
-} // namespace
|
||||
-
|
||||
bool ShouldUseThumbnailCapturerMac(DesktopMediaList::Type type) {
|
||||
// There was a bug in ScreenCaptureKit that was fixed in 14.4,
|
||||
// see b/40076027.
|
||||
@@ -704,6 +703,9 @@ bool ShouldUseThumbnailCapturerMac(DesktopMediaList::Type type) {
|
||||
return ShouldUseSCContentSharingPicker() ||
|
||||
base::FeatureList::IsEnabled(kScreenCaptureKitPickerScreen);
|
||||
case DesktopMediaList::Type::kNone:
|
||||
+ return ShouldUseSCContentSharingPicker() ||
|
||||
+ base::FeatureList::IsEnabled(kScreenCaptureKitStreamPickerSonoma) ||
|
||||
+ base::FeatureList::IsEnabled(kScreenCaptureKitPickerScreen);
|
||||
case DesktopMediaList::Type::kCurrentTab:
|
||||
case DesktopMediaList::Type::kWebContents:
|
||||
return false;
|
||||
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
|
||||
index b4b1e9ee805a8565a04737e0898ad8e46709c4d8..7b856f89028fe8f5594c1ff35900019250865ab5 100644
|
||||
--- a/content/browser/media/capture/desktop_capture_device.cc
|
||||
+++ b/content/browser/media/capture/desktop_capture_device.cc
|
||||
@@ -899,7 +899,6 @@ std::unique_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
|
||||
result.reset(new DesktopCaptureDevice(std::move(capturer), source.type));
|
||||
return result;
|
||||
}
|
||||
-
|
||||
switch (source.type) {
|
||||
case DesktopMediaID::TYPE_SCREEN: {
|
||||
std::unique_ptr<webrtc::DesktopCapturer> screen_capturer;
|
||||
@@ -920,7 +919,7 @@ std::unique_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
|
||||
}
|
||||
break;
|
||||
}
|
||||
-
|
||||
+ case DesktopMediaID::TYPE_NONE:
|
||||
case DesktopMediaID::TYPE_WINDOW: {
|
||||
std::unique_ptr<webrtc::DesktopCapturer> window_capturer;
|
||||
if (auto generic_capturer =
|
||||
diff --git a/content/browser/media/capture/native_screen_capture_picker.cc b/content/browser/media/capture/native_screen_capture_picker.cc
|
||||
index 152f3aa78032ee3f8c48fbefe052a2f1d85bed6b..d57df80dff9c6867cddf669efe3f90c43c03a0a7 100644
|
||||
--- a/content/browser/media/capture/native_screen_capture_picker.cc
|
||||
+++ b/content/browser/media/capture/native_screen_capture_picker.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
#include "content/browser/media/capture/native_screen_capture_picker_mac.h"
|
||||
#include "media/base/media_switches.h"
|
||||
+#include "base/logging.h"
|
||||
#endif
|
||||
|
||||
namespace content {
|
||||
diff --git a/content/browser/media/capture/native_screen_capture_picker_mac.mm b/content/browser/media/capture/native_screen_capture_picker_mac.mm
|
||||
index 0dbc7ebc4ba6066eb6b20f8e66f50a1dff4d94f3..17d658ee011b81208b77ee1e65925ae9ad1e68f7 100644
|
||||
--- a/content/browser/media/capture/native_screen_capture_picker_mac.mm
|
||||
+++ b/content/browser/media/capture/native_screen_capture_picker_mac.mm
|
||||
@@ -206,8 +206,12 @@ void Open(DesktopMediaID::Type type,
|
||||
base::OnceClosure cancel_callback,
|
||||
base::OnceClosure error_callback) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
+ LOG(ERROR) << "Open";
|
||||
+ // Chrome doesn't allow both screens & windows in their picker,
|
||||
+ // but Electron does - add a check for TYPE_NONE.
|
||||
CHECK(type == DesktopMediaID::Type::TYPE_SCREEN ||
|
||||
- type == DesktopMediaID::Type::TYPE_WINDOW);
|
||||
+ type == DesktopMediaID::Type::TYPE_WINDOW ||
|
||||
+ type == DesktopMediaID::Type::TYPE_NONE);
|
||||
if (@available(macOS 14.0, *)) {
|
||||
NSNumber* source_id = @(next_id_);
|
||||
PickerObserver* picker_observer = [[PickerObserver alloc]
|
||||
@@ -226,25 +230,32 @@ void Open(DesktopMediaID::Type type,
|
||||
// TODO(https://crbug.com/360781940): Add support for changing selected
|
||||
// content. The problem to solve is how this should interact with stream
|
||||
// restart.
|
||||
- config.allowsChangingSelectedContent = false;
|
||||
+ config.allowsChangingSelectedContent = true;
|
||||
NSNumber* max_stream_count = @(kMaxContentShareCountValue.Get());
|
||||
- if (type == DesktopMediaID::Type::TYPE_SCREEN) {
|
||||
- config.allowedPickerModes = SCContentSharingPickerModeSingleDisplay;
|
||||
- picker.defaultConfiguration = config;
|
||||
- picker.maximumStreamCount = max_stream_count;
|
||||
- [picker presentPickerUsingContentStyle:SCShareableContentStyleDisplay];
|
||||
- VLOG(1) << "NSCPM: Show screen-sharing picker for source_id = "
|
||||
- << source_id.longValue;
|
||||
- LogToUma(SCContentSharingPickerOperation::kPresentScreen_Start);
|
||||
- } else {
|
||||
- config.allowedPickerModes = SCContentSharingPickerModeSingleWindow;
|
||||
- picker.defaultConfiguration = config;
|
||||
- picker.maximumStreamCount = max_stream_count;
|
||||
- [picker presentPickerUsingContentStyle:SCShareableContentStyleWindow];
|
||||
- VLOG(1) << "NSCPM: Show window-sharing picker for source_id = "
|
||||
- << source_id.longValue;
|
||||
- LogToUma(SCContentSharingPickerOperation::kPresentWindow_Start);
|
||||
- }
|
||||
+ // LOG(ERROR) << "Type: " << type;
|
||||
+ // Chrome doesn't allow both screens & windows in their picker,
|
||||
+ // but Electron does; we patch out the MediaID::Type conditional here
|
||||
+ // if (type == DesktopMediaID::Type::TYPE_SCREEN) {
|
||||
+ // config.allowedPickerModes = SCContentSharingPickerModeSingleDisplay;
|
||||
+ // picker.defaultConfiguration = config;
|
||||
+ // picker.maximumStreamCount = max_stream_count;
|
||||
+ // [picker presentPickerUsingContentStyle:SCShareableContentStyleDisplay];
|
||||
+ // } else if (type == DesktopMediaID::Type::TYPE_WINDOW) {
|
||||
+ // config.allowedPickerModes = SCContentSharingPickerModeSingleWindow;
|
||||
+ // picker.defaultConfiguration = config;
|
||||
+ // picker.maximumStreamCount = max_stream_count;
|
||||
+ // [picker presentPickerUsingContentStyle:SCShareableContentStyleWindow];
|
||||
+ // VLOG(1) << "NSCPM: Show screen-sharing picker for source_id = "
|
||||
+ // << source_id.longValue;
|
||||
+ // LogToUma(SCContentSharingPickerOperation::kPresentScreen_Start);
|
||||
+ // } else {
|
||||
+ picker.defaultConfiguration = config;
|
||||
+ picker.maximumStreamCount = max_stream_count;
|
||||
+ [picker present];
|
||||
+ // VLOG(1) << "NSCPM: Show window-sharing picker for source_id = "
|
||||
+ // << source_id.longValue;
|
||||
+ // LogToUma(SCContentSharingPickerOperation::kPresentWindow_Start);
|
||||
+ // }
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
index 0e4a68f2fd8179640f877cb258b4049610fd49da..0fb8d036b7696e5303fbcd463114114aa3227a08 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -364,6 +364,7 @@ void OnShareableContentCreated(SCShareableContent* content) {
|
||||
if (!fullscreen_module_) {
|
||||
fullscreen_module_ = MaybeCreateScreenCaptureKitFullscreenModule(
|
||||
device_task_runner_, *this, window);
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -728,6 +729,7 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
SCContentFilter* filter) {
|
||||
switch (source.type) {
|
||||
case DesktopMediaID::TYPE_SCREEN:
|
||||
+ case DesktopMediaID::TYPE_NONE:
|
||||
// ScreenCaptureKitDeviceMac only supports a single display at a time.
|
||||
// It will not stitch desktops together. If
|
||||
// kScreenCaptureKitFullDesktopFallback is enabled, we will fallback to
|
||||
diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
index f0f08a834f06c7669da6030640434308a5cbd056..a34dcdbad1c3d32de59a1574de485bd831599aa1 100644
|
||||
--- a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
@@ -177,19 +177,20 @@ DesktopCaptureImplementation CreatePlatformDependentVideoCaptureDevice(
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
// Use ScreenCaptureKit with picker if specified. `desktop_id` for the picker
|
||||
// is not compatible with the other implementations.
|
||||
- if (picker) {
|
||||
- device_out = picker->CreateDevice(desktop_id);
|
||||
- if (device_out) {
|
||||
- return kScreenCaptureKitDeviceMac;
|
||||
- }
|
||||
- return kNoImplementation;
|
||||
- }
|
||||
+ // if (picker) {
|
||||
+ // device_out = picker->CreateDevice(desktop_id);
|
||||
+ // if (device_out) {
|
||||
+ // return kScreenCaptureKitDeviceMac;
|
||||
+ // }
|
||||
+ // return kNoImplementation;
|
||||
+ // }
|
||||
|
||||
// Prefer using ScreenCaptureKit. After that try DesktopCaptureDeviceMac, and
|
||||
// if both fail, use the generic DesktopCaptureDevice.
|
||||
if (desktop_id.type == DesktopMediaID::TYPE_WINDOW ||
|
||||
(desktop_id.type == DesktopMediaID::TYPE_SCREEN &&
|
||||
- base::FeatureList::IsEnabled(kScreenCaptureKitMacScreen))) {
|
||||
+ base::FeatureList::IsEnabled(kScreenCaptureKitMacScreen)) ||
|
||||
+ (desktop_id.type == DesktopMediaID::TYPE_NONE && base::FeatureList::IsEnabled(kScreenCaptureKitMacScreen))) {
|
||||
device_out = CreateScreenCaptureKitDeviceMac(desktop_id);
|
||||
if (device_out) {
|
||||
return kScreenCaptureKitDeviceMac;
|
||||
@@ -237,6 +238,9 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
DCHECK(state_ == State::READY_TO_LAUNCH);
|
||||
|
||||
if (receiver_on_io_thread) {
|
||||
+ LOG(INFO) << "InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync: Posting "
|
||||
+ "start request to device thread for device_id = "
|
||||
+ << device_id;
|
||||
std::ostringstream string_stream;
|
||||
string_stream
|
||||
<< "InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync: Posting "
|
||||
@@ -244,7 +248,7 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
<< device_id;
|
||||
receiver_on_io_thread->OnLog(string_stream.str());
|
||||
}
|
||||
-
|
||||
+ LOG(ERROR) << "receiver_on_io_thread: ";
|
||||
// Wrap the receiver, to trampoline all its method calls from the device
|
||||
// to the IO thread.
|
||||
auto receiver = std::make_unique<media::VideoFrameReceiverOnTaskRunner>(
|
||||
@@ -257,12 +261,14 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
base::BindPostTaskToCurrentDefault(base::BindOnce(
|
||||
&InProcessVideoCaptureDeviceLauncher::OnDeviceStarted,
|
||||
base::Unretained(this), callbacks, std::move(done_cb)));
|
||||
-
|
||||
+ LOG(ERROR) << "stream type: " << stream_type;
|
||||
+ LOG(ERROR) << "gum tab video capture: " << blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE;
|
||||
switch (stream_type) {
|
||||
- case blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE:
|
||||
- // Only the Service-based device launcher is supported for device capture
|
||||
- // from cameras etc.
|
||||
- NOTREACHED();
|
||||
+ // case blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE:
|
||||
+ // // Only the Service-based device launcher is supported for device capture
|
||||
+ // // from cameras etc.
|
||||
+ // LOG(INFO) << "device video capture not reached";
|
||||
+ // NOTREACHED();
|
||||
#if BUILDFLAG(ENABLE_SCREEN_CAPTURE)
|
||||
case blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE:
|
||||
start_capture_closure = base::BindOnce(
|
||||
@@ -274,10 +280,14 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
case blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE:
|
||||
case blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE:
|
||||
case blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB:
|
||||
+ case blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE:
|
||||
case blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_SET: {
|
||||
const DesktopMediaID desktop_id = DesktopMediaID::Parse(device_id);
|
||||
- if (desktop_id.is_null()) {
|
||||
- DLOG(ERROR) << "Desktop media ID is null";
|
||||
+ LOG(ERROR) << "desktop_id.is_null(): " << desktop_id.is_null();
|
||||
+ LOG(ERROR) << "desktop_id.id: " << desktop_id.id;
|
||||
+ LOG(ERROR) << "DesktopMediaID::kMacOsNativePickerId: " << DesktopMediaID::kMacOsNativePickerId;
|
||||
+ if (desktop_id.is_null() && desktop_id.id != DesktopMediaID::kMacOsNativePickerId) {
|
||||
+ LOG(ERROR) << "in null case";
|
||||
start_capture_closure =
|
||||
base::BindOnce(std::move(after_start_capture_callback), nullptr);
|
||||
break;
|
||||
@@ -319,13 +329,18 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
#if defined(USE_AURA)
|
||||
bool allow_window_id = false;
|
||||
#elif BUILDFLAG(IS_MAC)
|
||||
+
|
||||
bool allow_window_id =
|
||||
desktop_id.id == DesktopMediaID::kMacOsNativePickerId;
|
||||
+
|
||||
+ LOG(ERROR) << "allow_window_id: " << allow_window_id << " desktop_id.id: " << desktop_id.id;
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
+ LOG(ERROR) << "in if block";
|
||||
if (!allow_window_id &&
|
||||
desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
+ LOG(ERROR) << "allow_window_id: " << allow_window_id << " desktop_id.window_id: " << desktop_id.window_id;
|
||||
// For the other capturers, when a bug reports the type of capture it's
|
||||
// easy enough to determine which capturer was used, but it's a little
|
||||
// fuzzier with window capture.
|
||||
@@ -354,6 +369,7 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
kMaxNumberOfBuffers, std::move(receiver),
|
||||
std::move(receiver_on_io_thread)),
|
||||
std::move(after_start_capture_callback));
|
||||
+ LOG(ERROR) << "capture closure";
|
||||
break;
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_SCREEN_CAPTURE)
|
||||
@@ -368,6 +384,7 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
// above are NOTREACHED() then.
|
||||
#if BUILDFLAG(ENABLE_SCREEN_CAPTURE)
|
||||
state_ = State::DEVICE_START_IN_PROGRESS;
|
||||
+ LOG(ERROR) << "start capture closure";
|
||||
device_task_runner_->PostTask(FROM_HERE, std::move(start_capture_closure));
|
||||
#endif
|
||||
}
|
||||
@@ -418,9 +435,11 @@ void InProcessVideoCaptureDeviceLauncher::OnDeviceStarted(
|
||||
base::OnceClosure done_cb,
|
||||
std::unique_ptr<media::VideoCaptureDevice> device) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
+ LOG(ERROR) << "on device started";
|
||||
State state_copy = state_;
|
||||
state_ = State::READY_TO_LAUNCH;
|
||||
if (!device) {
|
||||
+ LOG(ERROR) << "device is null";
|
||||
switch (state_copy) {
|
||||
case State::DEVICE_START_IN_PROGRESS:
|
||||
callbacks->OnDeviceLaunchFailed(
|
||||
@@ -439,13 +458,15 @@ void InProcessVideoCaptureDeviceLauncher::OnDeviceStarted(
|
||||
|
||||
auto launched_device = std::make_unique<InProcessLaunchedVideoCaptureDevice>(
|
||||
std::move(device), device_task_runner_);
|
||||
-
|
||||
+ LOG(ERROR) << "launched device";
|
||||
switch (state_copy) {
|
||||
case State::DEVICE_START_IN_PROGRESS:
|
||||
+ LOG(ERROR) << "on device started, case 1";
|
||||
callbacks->OnDeviceLaunched(std::move(launched_device));
|
||||
std::move(done_cb).Run();
|
||||
return;
|
||||
case State::DEVICE_START_ABORTING:
|
||||
+ LOG(ERROR) << "on device started, case 2";
|
||||
launched_device.reset();
|
||||
callbacks->OnDeviceLaunchAborted();
|
||||
std::move(done_cb).Run();
|
||||
@@ -505,7 +526,8 @@ void InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread(
|
||||
std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
|
||||
ReceiveDeviceCallback result_callback) {
|
||||
DCHECK(device_task_runner_->BelongsToCurrentThread());
|
||||
- DCHECK(!desktop_id.is_null());
|
||||
+ LOG(INFO) << "DO START DESKTOP CAPTURE ON DEVICE THREAD " << desktop_id.id;
|
||||
+ DCHECK(!desktop_id.is_null() || desktop_id.id == DesktopMediaID::kMacOsNativePickerId);
|
||||
|
||||
std::unique_ptr<media::VideoCaptureDevice> video_capture_device;
|
||||
DesktopCaptureImplementation implementation =
|
||||
@@ -514,8 +536,10 @@ void InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread(
|
||||
DVLOG(1) << __func__ << " implementation " << implementation << " type "
|
||||
<< desktop_id.type;
|
||||
ReportDesktopCaptureImplementationAndType(implementation, desktop_id.type);
|
||||
- if (video_capture_device)
|
||||
+ if (video_capture_device) {
|
||||
+ LOG(ERROR) << "allocate and start capture device";
|
||||
video_capture_device->AllocateAndStart(params, std::move(device_client));
|
||||
+ }
|
||||
std::move(result_callback).Run(std::move(video_capture_device));
|
||||
}
|
||||
|
||||
diff --git a/content/browser/renderer_host/media/in_process_video_capture_provider.cc b/content/browser/renderer_host/media/in_process_video_capture_provider.cc
|
||||
index 4462efa154a2be9cc25f82688fdbc7edf71a7bb1..4207dd1a79c16df5cc972943da32699f414f81fa 100644
|
||||
--- a/content/browser/renderer_host/media/in_process_video_capture_provider.cc
|
||||
+++ b/content/browser/renderer_host/media/in_process_video_capture_provider.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "content/browser/renderer_host/media/in_process_video_capture_device_launcher.h"
|
||||
+#include "content/browser/media/capture/native_screen_capture_picker.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
|
||||
index 2949c2abd5f97e66719ec0f77cb23813865bb701..bd11a0fcdc084da00407c80e4ee229a130fdedc8 100644
|
||||
--- a/content/browser/renderer_host/media/video_capture_manager.cc
|
||||
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
|
||||
@@ -283,6 +283,7 @@ void VideoCaptureManager::QueueStartDevice(
|
||||
mojo::PendingRemote<media::mojom::ReadonlyVideoEffectsManager>
|
||||
readonly_video_effects_manager) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
+ LOG(ERROR) << "QueueStartDevice";
|
||||
DCHECK(lock_time_.is_null());
|
||||
device_start_request_queue_.push_back(
|
||||
CaptureDeviceStartRequest(std::move(controller), session_id, params,
|
||||
@@ -297,6 +298,7 @@ void VideoCaptureManager::DoStopDevice(VideoCaptureController* controller) {
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("video_and_image_capture"),
|
||||
"VideoCaptureManager::DoStopDevice");
|
||||
DCHECK(base::Contains(controllers_, controller));
|
||||
+ LOG(ERROR) << "DoStopDevice called for stream type: " << controller->stream_type();
|
||||
|
||||
// If start request has not yet started processing, i.e. if it is not at the
|
||||
// beginning of the queue, remove it from the queue.
|
||||
@@ -327,6 +329,7 @@ void VideoCaptureManager::DoStopDevice(VideoCaptureController* controller) {
|
||||
|
||||
void VideoCaptureManager::ProcessDeviceStartRequestQueue() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
+ LOG(ERROR) << "ProcessDeviceStartRequestQueue";
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("video_and_image_capture"),
|
||||
"VideoCaptureManager::ProcessDeviceStartRequestQueue");
|
||||
auto request = device_start_request_queue_.begin();
|
||||
@@ -335,7 +338,7 @@ void VideoCaptureManager::ProcessDeviceStartRequestQueue() {
|
||||
|
||||
scoped_refptr<VideoCaptureController> const controller =
|
||||
request->controller();
|
||||
-
|
||||
+ LOG(ERROR) << "ProcessDeviceStartRequestQueue, controller: " << controller->device_id();
|
||||
EmitLogMessage("VideoCaptureManager::ProcessDeviceStartRequestQueue", 3);
|
||||
// The unit test VideoCaptureManagerTest.OpenNotExisting requires us to fail
|
||||
// synchronously if the stream_type is MEDIA_DEVICE_VIDEO_CAPTURE and no
|
||||
@@ -351,6 +354,7 @@ void VideoCaptureManager::ProcessDeviceStartRequestQueue() {
|
||||
const media::VideoCaptureDeviceInfo* device_info =
|
||||
GetDeviceInfoById(controller->device_id());
|
||||
if (!device_info) {
|
||||
+ LOG(ERROR) << "ProcessDeviceStartRequestQueue, device_info not found";
|
||||
OnDeviceLaunchFailed(
|
||||
controller.get(),
|
||||
media::VideoCaptureError::
|
||||
@@ -381,6 +385,7 @@ void VideoCaptureManager::ProcessDeviceStartRequestQueue() {
|
||||
void VideoCaptureManager::OnDeviceLaunched(VideoCaptureController* controller) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
std::ostringstream string_stream;
|
||||
+ LOG(ERROR) << "OnDeviceLaunched";
|
||||
string_stream << "Launching device has succeeded. device_id = "
|
||||
<< controller->device_id();
|
||||
EmitLogMessage(string_stream.str(), 1);
|
||||
@@ -391,7 +396,9 @@ void VideoCaptureManager::OnDeviceLaunched(VideoCaptureController* controller) {
|
||||
if (blink::IsVideoDesktopCaptureMediaType(controller->stream_type())) {
|
||||
const media::VideoCaptureSessionId session_id =
|
||||
device_start_request_queue_.front().session_id();
|
||||
+ LOG(ERROR) << "isvideodesktopcapturemediatype";
|
||||
DCHECK_NE(session_id, FakeSessionId());
|
||||
+ LOG(ERROR) << "maybe post desktop capture window id";
|
||||
MaybePostDesktopCaptureWindowId(session_id);
|
||||
}
|
||||
|
||||
@@ -407,7 +414,9 @@ void VideoCaptureManager::OnDeviceLaunched(VideoCaptureController* controller) {
|
||||
}
|
||||
}
|
||||
|
||||
+ LOG(ERROR) << "OnDeviceLaunched, device_start_request_queue_.pop_front";
|
||||
device_start_request_queue_.pop_front();
|
||||
+ LOG(ERROR) << "OnDeviceLaunched, ProcessDeviceStartRequestQueue";
|
||||
ProcessDeviceStartRequestQueue();
|
||||
}
|
||||
|
||||
@@ -467,6 +476,7 @@ void VideoCaptureManager::ConnectClient(
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("video_and_image_capture"),
|
||||
"VideoCaptureManager::ConnectClient");
|
||||
+ LOG(ERROR) << "ConnectClient";
|
||||
{
|
||||
std::ostringstream string_stream;
|
||||
string_stream << "ConnectClient: session_id = " << session_id
|
||||
@@ -479,6 +489,7 @@ void VideoCaptureManager::ConnectClient(
|
||||
scoped_refptr<VideoCaptureController> controller =
|
||||
GetOrCreateController(session_id, params);
|
||||
if (!controller) {
|
||||
+ LOG(ERROR) << "ConnectClient, controller not found";
|
||||
std::move(done_cb).Run(nullptr);
|
||||
return;
|
||||
}
|
||||
@@ -502,6 +513,7 @@ void VideoCaptureManager::ConnectClient(
|
||||
string_stream
|
||||
<< "VideoCaptureManager queueing device start for device_id = "
|
||||
<< controller->device_id();
|
||||
+ LOG(ERROR) << "ConnectClient, videocapturemanager queueing device start for device_id = " << controller->device_id();
|
||||
EmitLogMessage(string_stream.str(), 1);
|
||||
mojo::PendingRemote<video_effects::mojom::VideoEffectsProcessor>
|
||||
video_effects_processor;
|
||||
@@ -524,6 +536,7 @@ void VideoCaptureManager::ConnectClient(
|
||||
readonly_video_effects_manager.InitWithNewPipeAndPassReceiver());
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_VIDEO_EFFECTS)
|
||||
+ LOG(ERROR) << "ConnectClient, videocapturemanager queueing device start for device_id = " << controller->device_id();
|
||||
QueueStartDevice(session_id, controller, params,
|
||||
std::move(video_effects_processor),
|
||||
std::move(readonly_video_effects_manager));
|
||||
diff --git a/content/public/browser/desktop_media_id.cc b/content/public/browser/desktop_media_id.cc
|
||||
index b39b684ff84baaf292eef1a23b7f9fb4585023c5..55507f7a782a9472800221f1e908618a5bad2914 100644
|
||||
--- a/content/public/browser/desktop_media_id.cc
|
||||
+++ b/content/public/browser/desktop_media_id.cc
|
||||
@@ -21,6 +21,7 @@ namespace content {
|
||||
|
||||
const char kScreenPrefix[] = "screen";
|
||||
const char kWindowPrefix[] = "window";
|
||||
+const char kNonePrefix[] = "none";
|
||||
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
// static
|
||||
@@ -82,6 +83,8 @@ DesktopMediaID DesktopMediaID::Parse(const std::string& str) {
|
||||
type = TYPE_SCREEN;
|
||||
} else if (parts[0] == kWindowPrefix) {
|
||||
type = TYPE_WINDOW;
|
||||
+ } else if (parts[0] == kNonePrefix) {
|
||||
+ type = TYPE_NONE;
|
||||
} else {
|
||||
return DesktopMediaID();
|
||||
}
|
||||
@@ -104,6 +107,8 @@ std::string DesktopMediaID::ToString() const {
|
||||
std::string prefix;
|
||||
switch (type) {
|
||||
case TYPE_NONE:
|
||||
+ prefix = kNonePrefix;
|
||||
+ break;
|
||||
NOTREACHED();
|
||||
case TYPE_SCREEN:
|
||||
prefix = kScreenPrefix;
|
||||
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
||||
index c458c1e87dc46cf4f92d5c4423ab837f29067aa0..1749fb96bbd0c69ad5c6377eabb4bbab12e3f7c3 100644
|
||||
--- a/media/base/media_switches.cc
|
||||
+++ b/media/base/media_switches.cc
|
||||
@@ -356,7 +356,7 @@ BASE_FEATURE(kMacLoopbackAudioForScreenShare,
|
||||
// is required to avoid recurring permission dialogs.
|
||||
BASE_FEATURE(kUseSCContentSharingPicker,
|
||||
"UseSCContentSharingPicker",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
diff --git a/media/capture/video/file_video_capture_device.cc b/media/capture/video/file_video_capture_device.cc
|
||||
index 5090aae198e4e0e52212eb502bb4de0475c79b04..c74887a14bcc4249e433d2afd545029d36f744bf 100644
|
||||
--- a/media/capture/video/file_video_capture_device.cc
|
||||
+++ b/media/capture/video/file_video_capture_device.cc
|
||||
@@ -482,6 +482,7 @@ void FileVideoCaptureDevice::AllocateAndStart(
|
||||
CHECK(!capture_thread_.IsRunning());
|
||||
|
||||
capture_thread_.Start();
|
||||
+ LOG(ERROR) << "allocate and start file video capture device";
|
||||
capture_thread_.task_runner()->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&FileVideoCaptureDevice::OnAllocateAndStart,
|
||||
@@ -604,6 +605,7 @@ void FileVideoCaptureDevice::TakePhoto(TakePhotoCallback callback) {
|
||||
void FileVideoCaptureDevice::OnAllocateAndStart(
|
||||
const VideoCaptureParams& params,
|
||||
std::unique_ptr<VideoCaptureDevice::Client> client) {
|
||||
+ LOG(ERROR) << "on allocate and start file video capture device";
|
||||
DCHECK(capture_thread_.task_runner()->BelongsToCurrentThread());
|
||||
|
||||
client_ = std::move(client);
|
||||
@@ -20,59 +20,59 @@ This patch will be removed when the deprecated sync api support is
|
||||
removed.
|
||||
|
||||
diff --git a/components/permissions/permission_util.cc b/components/permissions/permission_util.cc
|
||||
index 20056b1464699cc7d45717bfc710366eb48d85f6..b227ed62991cdf285c3b90f19e09e3718e2800ea 100644
|
||||
index 6f4d9651862e90abaa22b93e1dcf97ac07592c5c..d91d81297e7cdb79ee7b7a3979dcedf977e16c92 100644
|
||||
--- a/components/permissions/permission_util.cc
|
||||
+++ b/components/permissions/permission_util.cc
|
||||
@@ -384,6 +384,7 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingsTypeSafe(
|
||||
return ContentSettingsType::AUTOMATIC_FULLSCREEN;
|
||||
case PermissionType::WEB_APP_INSTALLATION:
|
||||
@@ -389,6 +389,7 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingsTypeSafe(
|
||||
return ContentSettingsType::WEB_APP_INSTALLATION;
|
||||
case PermissionType::LOCAL_NETWORK_ACCESS:
|
||||
return ContentSettingsType::LOCAL_NETWORK_ACCESS;
|
||||
+ case PermissionType::DEPRECATED_SYNC_CLIPBOARD_READ:
|
||||
case PermissionType::NUM:
|
||||
break;
|
||||
}
|
||||
diff --git a/content/browser/permissions/permission_controller_impl.cc b/content/browser/permissions/permission_controller_impl.cc
|
||||
index e991887c103618b35688cf72307ca05fdb202e6e..54894f3412d42264eae80d767be5215e52f08184 100644
|
||||
index 0c6b537ddc2afbc4cd22f1c08f1bbae3c3bbffe3..333f557c89bc03ae5b25060359b9af096b188726 100644
|
||||
--- a/content/browser/permissions/permission_controller_impl.cc
|
||||
+++ b/content/browser/permissions/permission_controller_impl.cc
|
||||
@@ -86,6 +86,7 @@ PermissionToSchedulingFeature(PermissionType permission_name) {
|
||||
case PermissionType::POINTER_LOCK:
|
||||
@@ -87,6 +87,7 @@ PermissionToSchedulingFeature(PermissionType permission_name) {
|
||||
case PermissionType::AUTOMATIC_FULLSCREEN:
|
||||
case PermissionType::WEB_APP_INSTALLATION:
|
||||
case PermissionType::LOCAL_NETWORK_ACCESS:
|
||||
+ case PermissionType::DEPRECATED_SYNC_CLIPBOARD_READ:
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
diff --git a/third_party/blink/common/permissions/permission_utils.cc b/third_party/blink/common/permissions/permission_utils.cc
|
||||
index 779b458094edfa866ac70d7e0ac6413cc700c6a5..b42cbc34f1d2e214d8cc6ed2aacfa9ae21c2569a 100644
|
||||
index aad897dbc32caa3469a2f04b4f004355888c84d8..875260fc2a884ab5b1e62cd45fc91c2e4dc162ee 100644
|
||||
--- a/third_party/blink/common/permissions/permission_utils.cc
|
||||
+++ b/third_party/blink/common/permissions/permission_utils.cc
|
||||
@@ -99,6 +99,8 @@ std::string GetPermissionString(PermissionType permission) {
|
||||
return "AutomaticFullscreen";
|
||||
case PermissionType::WEB_APP_INSTALLATION:
|
||||
@@ -101,6 +101,8 @@ std::string GetPermissionString(PermissionType permission) {
|
||||
return "WebAppInstallation";
|
||||
case PermissionType::LOCAL_NETWORK_ACCESS:
|
||||
return "LocalNetworkAccess";
|
||||
+ case PermissionType::DEPRECATED_SYNC_CLIPBOARD_READ:
|
||||
+ return "DeprecatedSyncClipboardRead";
|
||||
case PermissionType::NUM:
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -171,6 +173,7 @@ PermissionTypeToPermissionsPolicyFeature(PermissionType permission) {
|
||||
case PermissionType::NOTIFICATIONS:
|
||||
case PermissionType::KEYBOARD_LOCK:
|
||||
@@ -175,6 +177,7 @@ PermissionTypeToPermissionsPolicyFeature(PermissionType permission) {
|
||||
case PermissionType::POINTER_LOCK:
|
||||
// TODO(crbug.com/394009026): Add permission policy for LNA.
|
||||
case PermissionType::LOCAL_NETWORK_ACCESS:
|
||||
+ case PermissionType::DEPRECATED_SYNC_CLIPBOARD_READ:
|
||||
return std::nullopt;
|
||||
|
||||
case PermissionType::NUM:
|
||||
diff --git a/third_party/blink/public/common/permissions/permission_utils.h b/third_party/blink/public/common/permissions/permission_utils.h
|
||||
index f9b1db54dd367d1f0e42cdfcfd04255d452f0e1b..54b4b742298af03d8924f6ad613081f1b5dfae4d 100644
|
||||
index 947bd8125bf300a3a82c811810e31996e6147c7c..caeeaf6cecf7da47c39b140dfcc295fba12f6f84 100644
|
||||
--- a/third_party/blink/public/common/permissions/permission_utils.h
|
||||
+++ b/third_party/blink/public/common/permissions/permission_utils.h
|
||||
@@ -64,6 +64,7 @@ enum class PermissionType {
|
||||
AUTOMATIC_FULLSCREEN = 40,
|
||||
@@ -65,6 +65,7 @@ enum class PermissionType {
|
||||
HAND_TRACKING = 41,
|
||||
WEB_APP_INSTALLATION = 42,
|
||||
+ DEPRECATED_SYNC_CLIPBOARD_READ = 43,
|
||||
LOCAL_NETWORK_ACCESS = 43,
|
||||
+ DEPRECATED_SYNC_CLIPBOARD_READ = 44,
|
||||
|
||||
// Always keep this at the end.
|
||||
NUM,
|
||||
|
||||
@@ -14,10 +14,10 @@ This patch likely can't be upstreamed as-is, as Chromium doesn't have
|
||||
this use case in mind currently.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 9888ac709c51cd30228e3bca6915f7d89071cb83..e7b2bc1905958d2ff9c34ed7a22eb53e7ea3b9b8 100644
|
||||
index 3d8a590aacd3a65d5a19004dc11e770b31a0f614..64dd7b6e507b61fab7a044823462fb04eabba698 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -932,13 +932,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
@@ -941,13 +941,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
|
||||
void HWNDMessageHandler::PaintAsActiveChanged() {
|
||||
if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
|
||||
@@ -33,7 +33,7 @@ index 9888ac709c51cd30228e3bca6915f7d89071cb83..e7b2bc1905958d2ff9c34ed7a22eb53e
|
||||
}
|
||||
|
||||
void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
|
||||
@@ -2327,17 +2327,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
||||
@@ -2337,17 +2337,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
||||
delegate_->SchedulePaint();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Linux or Windows to un-fullscreen in some circumstances without this
|
||||
change.
|
||||
|
||||
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f25d04780 100644
|
||||
index 91db1bbd912807833243c101e126e42ad5579d2b..7c624e0babddbca7c0deef1d805ccbfc21e6e9a9 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
@@ -20,12 +20,16 @@
|
||||
@@ -50,7 +50,7 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
|
||||
// Keep the current state. |SetTabWithExclusiveAccess| may change the return
|
||||
// value of |IsWindowFullscreenForTabOrPending|.
|
||||
@@ -389,12 +395,14 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
|
||||
@@ -388,12 +394,14 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
|
||||
void FullscreenController::FullscreenTabOpeningPopup(
|
||||
content::WebContents* opener,
|
||||
content::WebContents* popup) {
|
||||
@@ -65,7 +65,7 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
}
|
||||
|
||||
void FullscreenController::OnTabDeactivated(
|
||||
@@ -484,10 +492,12 @@ void FullscreenController::FullscreenTransitionCompleted() {
|
||||
@@ -483,10 +491,12 @@ void FullscreenController::FullscreenTransitionCompleted() {
|
||||
#endif // DCHECK_IS_ON()
|
||||
tab_fullscreen_target_display_id_ = display::kInvalidDisplayId;
|
||||
started_fullscreen_transition_ = false;
|
||||
@@ -78,7 +78,7 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
}
|
||||
|
||||
void FullscreenController::RunOrDeferUntilTransitionIsComplete(
|
||||
@@ -612,18 +622,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -616,18 +626,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
|
||||
// from manually entering fullscreen mode and also disables kiosk mode on
|
||||
// desktop platforms.
|
||||
@@ -97,20 +97,20 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
+#if 0
|
||||
bool entering_tab_fullscreen = option == TAB && !tab_fullscreen_;
|
||||
+#endif
|
||||
GURL url;
|
||||
url::Origin origin;
|
||||
+#if 0
|
||||
if (option == TAB) {
|
||||
url = GetRequestingOrigin();
|
||||
origin = GetRequestingOrigin();
|
||||
tab_fullscreen_ = true;
|
||||
@@ -658,6 +667,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
url = extension_caused_fullscreen_;
|
||||
@@ -662,6 +671,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
origin = url::Origin::Create(extension_url_.value());
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
fullscreen_start_time_ = base::TimeTicks::Now();
|
||||
if (option == BROWSER) {
|
||||
@@ -679,6 +689,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -683,6 +693,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
// `fullscreen_start_time_` is null if a fullscreen tab moves to a new window.
|
||||
if (fullscreen_start_time_ && exclusive_access_tab()) {
|
||||
ukm::SourceId source_id =
|
||||
@@ -690,15 +701,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -694,15 +705,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
.Record(ukm::UkmRecorder::Get());
|
||||
fullscreen_start_time_.reset();
|
||||
}
|
||||
@@ -136,9 +136,9 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
-#endif
|
||||
+
|
||||
exclusive_access_manager()->context()->ExitFullscreen();
|
||||
extension_caused_fullscreen_ = GURL();
|
||||
extension_url_.reset();
|
||||
exclusive_access_manager()->UpdateBubble(base::NullCallback());
|
||||
@@ -762,8 +774,12 @@ GURL FullscreenController::GetEmbeddingOrigin() const {
|
||||
@@ -766,8 +778,12 @@ url::Origin FullscreenController::GetEmbeddingOrigin() const {
|
||||
void FullscreenController::RecordMetricsOnFullscreenApiRequested(
|
||||
content::RenderFrameHost* requesting_frame) {
|
||||
history::HistoryService* service =
|
||||
@@ -152,7 +152,7 @@ index 458029244ad9db7beace040778117d82d90f4bea..66202201b11de10bf2d781a52640a81f
|
||||
// Check if the origin has been visited more than a day ago and whether it's
|
||||
// on an allowlist, then record those bits of information in a metric.
|
||||
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.h b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
index 7fdf883310b13e3334ba007580a1a4287d49d592..d7c2bdaa08cae1645bf52f1d9b9d84b1cdb78c66 100644
|
||||
index 5854fd8401f3934cabd6abfe48da332d7a670af3..d714c44a6fd2206f9192dbfe82787a4b06042ed0 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
@@ -250,10 +250,12 @@ class FullscreenController : public ExclusiveAccessControllerBase {
|
||||
|
||||
@@ -12,10 +12,10 @@ ui problems (like dissapearing popup during typing in html's
|
||||
input list.
|
||||
|
||||
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
|
||||
index 842ea6f7eb2415170a59e46ca955165d656ba149..1ea926753f65baa8f9671fdd63f98fb94c28ba6c 100644
|
||||
index bfea25523fd1df85d9393fce80259a8654b8a7c2..e3cd3083bc8c19fdc29729d7ff6db7d0fc562ce6 100644
|
||||
--- a/ui/views/widget/widget.h
|
||||
+++ b/ui/views/widget/widget.h
|
||||
@@ -1200,6 +1200,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
|
||||
@@ -1209,6 +1209,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
|
||||
// True if widget was created in headless mode.
|
||||
bool is_headless() const { return is_headless_; }
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
|
||||
BrowserWindow.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index a802f4b710b6f8fa154d11846c061720a91e15e4..2bd015be3178ab8dea012d6b1f71d13dd0548c14 100644
|
||||
index adade58a533c373087d8c51a5744e8f118ba6e9d..3a60e310d1c4048f0e37e085c97b8dfc093aefda 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3747,15 +3747,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
|
||||
@@ -3759,15 +3759,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
|
||||
delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
|
||||
min_window_size = delegate_->DIPToScreenSize(min_window_size);
|
||||
max_window_size = delegate_->DIPToScreenSize(max_window_size);
|
||||
|
||||
@@ -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 8c4070309b4a1072496e3e55f6f530a52a799451..afd62da2e140da715d9be15eb5c93f0339f59145 100644
|
||||
index 4f7e3cd70d45dd9d0d67b6a39a5dac59af9b95af..a8a0bedfc14cd475ff112e5ff07e137ec4219662 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -11048,6 +11048,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
@@ -11068,6 +11068,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
"blob");
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ index 8c4070309b4a1072496e3e55f6f530a52a799451..afd62da2e140da715d9be15eb5c93f03
|
||||
// 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 0c7b5af098a53a8709cdf62d455520ccef222dbb..1b6a7942c1506abc2fbe7d1efe58c0964a4e3be0 100644
|
||||
index ab265777ded9c875ccafd83b44853d92e35c60fb..074fa3544afd423555578cf0df835171ab559201 100644
|
||||
--- a/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
@@ -2336,6 +2336,10 @@ Frame* DocumentLoader::CalculateOwnerFrame() {
|
||||
@@ -2334,6 +2334,10 @@ Frame* DocumentLoader::CalculateOwnerFrame() {
|
||||
scoped_refptr<SecurityOrigin> DocumentLoader::CalculateOrigin(
|
||||
Document* owner_document) {
|
||||
scoped_refptr<SecurityOrigin> origin;
|
||||
@@ -59,7 +59,7 @@ index 0c7b5af098a53a8709cdf62d455520ccef222dbb..1b6a7942c1506abc2fbe7d1efe58c096
|
||||
StringBuilder debug_info_builder;
|
||||
// Whether the origin is newly created within this call, instead of copied
|
||||
// from an existing document's origin or from `origin_to_commit_`. If this is
|
||||
@@ -2389,6 +2393,10 @@ scoped_refptr<SecurityOrigin> DocumentLoader::CalculateOrigin(
|
||||
@@ -2387,6 +2391,10 @@ scoped_refptr<SecurityOrigin> DocumentLoader::CalculateOrigin(
|
||||
// the end of this function.
|
||||
origin = origin_to_commit_;
|
||||
debug_info_builder.Append("use_origin_to_commit");
|
||||
|
||||
@@ -53,10 +53,10 @@ index 008df596834faccfa19525dcae0239ffed7b2c3f..aecfa059c6ac53a3377e1f60b3c66bbb
|
||||
void Compositor::SetSeamlessRefreshRates(
|
||||
const std::vector<float>& seamless_refresh_rates) {
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 8a61b0cc5d45a55ac188babf63b59492cff428e1..07200e5320c999f1a067ce785b7ad5c7952586d7 100644
|
||||
index cabb39363b30c97f63d323d7a8156774b67f6b32..54e012fa4b0253d8c8f88cc2021be0dcf77cbdee 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -523,6 +523,10 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
@@ -519,6 +519,10 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
|
||||
const cc::LayerTreeSettings& GetLayerTreeSettings() const;
|
||||
|
||||
@@ -67,7 +67,7 @@ index 8a61b0cc5d45a55ac188babf63b59492cff428e1..07200e5320c999f1a067ce785b7ad5c7
|
||||
size_t saved_events_metrics_count_for_testing() const {
|
||||
return host_->saved_events_metrics_count_for_testing();
|
||||
}
|
||||
@@ -714,6 +718,12 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
@@ -710,6 +714,12 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
// See go/report-ux-metrics-at-painting for details.
|
||||
bool animation_started_ = false;
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Sat, 1 Mar 2025 05:11:41 +0900
|
||||
Subject: fix: enable __wrap_iter in string_view and array
|
||||
|
||||
Refs https://github.com/electron/electron/issues/45810#issuecomment-2691417213
|
||||
|
||||
Patch can be removed when build_make_libcxx_abi_unstable_false_for_electron.patch is removed.
|
||||
|
||||
diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site
|
||||
index e240ff6fff94a6cebf8662996712fe7eb22e5fff..ddf1693002aa171b3d91aa4ef08f5b360e4adddc 100644
|
||||
--- a/buildtools/third_party/libc++/__config_site
|
||||
+++ b/buildtools/third_party/libc++/__config_site
|
||||
@@ -19,6 +19,8 @@
|
||||
#define _LIBCPP_ABI_NAMESPACE __Cr
|
||||
|
||||
#define _LIBCPP_ABI_VERSION 1
|
||||
+#define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY
|
||||
+#define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
|
||||
|
||||
#define _LIBCPP_ABI_FORCE_ITANIUM 0
|
||||
#define _LIBCPP_ABI_FORCE_MICROSOFT 0
|
||||
@@ -40,18 +40,18 @@ accessing uninitialized lower indexes can return garbage values that cannot be n
|
||||
Refer to v8::EmbedderDataSlot::store_aligned_pointer for context.
|
||||
|
||||
diff --git a/gin/public/gin_embedders.h b/gin/public/gin_embedders.h
|
||||
index 8d7c5631fd8f1499c67384286f0e3c4037673b32..99b2e2f63be8a46c5546dd53bc9b05e8c54e857c 100644
|
||||
index 8d7c5631fd8f1499c67384286f0e3c4037673b32..2b7bdfbac06a42e6bc51eb65e023c3673e6eb885 100644
|
||||
--- a/gin/public/gin_embedders.h
|
||||
+++ b/gin/public/gin_embedders.h
|
||||
@@ -18,6 +18,8 @@ namespace gin {
|
||||
enum GinEmbedder : uint16_t {
|
||||
kEmbedderNativeGin,
|
||||
@@ -20,6 +20,8 @@ enum GinEmbedder : uint16_t {
|
||||
kEmbedderBlink,
|
||||
+ kEmbedderElectron,
|
||||
+ kEmbedderBlinkTag,
|
||||
kEmbedderPDFium,
|
||||
kEmbedderFuchsia,
|
||||
+ kEmbedderElectron,
|
||||
+ kEmbedderBlinkTag,
|
||||
};
|
||||
|
||||
} // namespace gin
|
||||
diff --git a/third_party/blink/renderer/platform/bindings/script_state.cc b/third_party/blink/renderer/platform/bindings/script_state.cc
|
||||
index e4a27a24c83dd1a478b2ada8b6c8220076790791..c76dc818f38a62fff63852dbecbc85e304ac731d 100644
|
||||
--- a/third_party/blink/renderer/platform/bindings/script_state.cc
|
||||
@@ -86,7 +86,7 @@ index e4a27a24c83dd1a478b2ada8b6c8220076790791..c76dc818f38a62fff63852dbecbc85e3
|
||||
|
||||
// Cut the reference from ScriptState to V8 context.
|
||||
diff --git a/third_party/blink/renderer/platform/bindings/script_state.h b/third_party/blink/renderer/platform/bindings/script_state.h
|
||||
index b3cc8d819b06108386aed9465cab4f27a28b675f..a1757901e52360a9c2ec3c573adb20d03cd6ecae 100644
|
||||
index b3cc8d819b06108386aed9465cab4f27a28b675f..9c8818f10de59fdd2a3fd44d9cd23d40a93b53a7 100644
|
||||
--- a/third_party/blink/renderer/platform/bindings/script_state.h
|
||||
+++ b/third_party/blink/renderer/platform/bindings/script_state.h
|
||||
@@ -185,7 +185,12 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected<ScriptState> {
|
||||
@@ -112,14 +112,13 @@ index b3cc8d819b06108386aed9465cab4f27a28b675f..a1757901e52360a9c2ec3c573adb20d0
|
||||
static constexpr int kV8ContextPerContextDataIndex =
|
||||
static_cast<int>(gin::kPerContextDataStartIndex) +
|
||||
static_cast<int>(gin::kEmbedderBlink);
|
||||
@@ -271,6 +278,11 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected<ScriptState> {
|
||||
@@ -271,6 +278,10 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected<ScriptState> {
|
||||
// internals.idl.
|
||||
String last_compiled_script_file_name_;
|
||||
bool last_compiled_script_used_code_cache_ = false;
|
||||
+
|
||||
+ static constexpr int kV8ContextPerContextDataTagIndex =
|
||||
+ static_cast<int>(gin::kPerContextDataStartIndex) +
|
||||
+ static_cast<int>(gin::kEmbedderBlink) +
|
||||
+ static_cast<int>(gin::kEmbedderBlinkTag);
|
||||
};
|
||||
|
||||
|
||||
43
patches/chromium/fix_linter_error.patch
Normal file
43
patches/chromium/fix_linter_error.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Kerr <charles@charleskerr.com>
|
||||
Date: Thu, 6 Mar 2025 17:06:49 -0600
|
||||
Subject: fix: linter error
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
fix: linter error
|
||||
|
||||
This is showing up in an eslint build step in Electron:
|
||||
|
||||
> /__w/electron/electron/src/out/Default/gen/ui/webui/resources/cr_elements/preprocessed/cr_menu_selector/cr_menu_selector.ts
|
||||
> 77:23 error This assertion is unnecessary since the receiver accepts the original type of the expression @typescript-eslint/no-unnecessary-type-assertion
|
||||
>
|
||||
> ✖ 1 problem (1 error, 0 warnings)
|
||||
> 1 error and 0 warnings potentially fixable with the `--fix` option.
|
||||
|
||||
However, removing the assertion causes a typescript build failure:
|
||||
|
||||
> gen/ui/webui/resources/cr_elements/preprocessed/cr_menu_selector/cr_menu_selector.ts:77:23 - error TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'HTMLElement'.
|
||||
> Type 'null' is not assignable to type 'HTMLElement'.
|
||||
>
|
||||
> 77 items.indexOf(this.querySelector<HTMLElement>(':focus'));
|
||||
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
So I think the two different steps may be picking up typescript definitions.
|
||||
|
||||
This patch should be removed after the issue is tracked down
|
||||
andfixed in a followup task.
|
||||
|
||||
diff --git a/ui/webui/resources/cr_elements/cr_menu_selector/cr_menu_selector.ts b/ui/webui/resources/cr_elements/cr_menu_selector/cr_menu_selector.ts
|
||||
index 0a83b8041b8201c95442e680c77555d4c11bc06a..abdb8e9bfbbfb1fce6fa38e226e50a35477e49a2 100644
|
||||
--- a/ui/webui/resources/cr_elements/cr_menu_selector/cr_menu_selector.ts
|
||||
+++ b/ui/webui/resources/cr_elements/cr_menu_selector/cr_menu_selector.ts
|
||||
@@ -74,6 +74,7 @@ export class CrMenuSelector extends CrMenuSelectorBase {
|
||||
const items = this.getAllFocusableItems_();
|
||||
assert(items.length >= 1);
|
||||
const currentFocusedIndex =
|
||||
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
items.indexOf(this.querySelector<HTMLElement>(':focus')!);
|
||||
|
||||
let newFocusedIndex = currentFocusedIndex;
|
||||
@@ -75,7 +75,7 @@ index ea4646388c4747438ddd7a9164a9e61091679c28..5aded14b616e70ac98e0daa7ff94ec42
|
||||
|
||||
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 996f6f99f722683428ea4ff5aef9cdc5d396af2c..f35c07ec123f4e3a5883999f7e0d81cd9d88e1c0 100644
|
||||
index f9e29227fe9396747bed8b1ec970cfdfcf72c03c..d96f85145d1ad2843cf2659f68e2fd1d93c4c1c4 100644
|
||||
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
@@ -430,11 +430,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
|
||||
|
||||
@@ -9,10 +9,10 @@ focus node change via TextInputManager.
|
||||
chromium-bug: https://crbug.com/1369605
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 9503beefcbcfe7d99674582ece10a7e551fae96d..32302e3dae2098319ed2d1f1403649fe8db2887e 100644
|
||||
index 7e9f2e71f08c1324a805462064d4fa485041c19f..2b4543ca40eac0f56c6408e27aac523827093724 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -3229,6 +3229,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
|
||||
@@ -3220,6 +3220,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ index 06fc7daf2761ae728f3adf9eb2ef3910a14cf827..8d34f9dfd9a8625a3fab397f7b96c12c
|
||||
// Detaches |this| from the input method object.
|
||||
// is_removed flag is true if this is called while the window is
|
||||
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc
|
||||
index 9a0aad0d4a3dada0faec031d155c6d346355e8a5..8852c53847bbe2f906aff4bdacc355fc41cf5021 100644
|
||||
index 4f1d98e960b58cf417d53c487f7eafa2b15c2c1e..1de7a9b74555e01e17ea89ac457dc4d011001a3c 100644
|
||||
--- a/content/browser/renderer_host/text_input_manager.cc
|
||||
+++ b/content/browser/renderer_host/text_input_manager.cc
|
||||
@@ -183,6 +183,7 @@ void TextInputManager::UpdateTextInputState(
|
||||
@@ -50,7 +50,7 @@ index 9a0aad0d4a3dada0faec031d155c6d346355e8a5..8852c53847bbe2f906aff4bdacc355fc
|
||||
// We reached here because an IPC is received to reset the TextInputState
|
||||
// for |view|. But |view| != |active_view_|, which suggests that at least
|
||||
// one other view has become active and we have received the corresponding
|
||||
@@ -485,6 +486,12 @@ void TextInputManager::NotifyObserversAboutInputStateUpdate(
|
||||
@@ -473,6 +474,12 @@ void TextInputManager::NotifyObserversAboutInputStateUpdate(
|
||||
observer.OnUpdateTextInputStateCalled(this, updated_view, did_update_state);
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ index 9a0aad0d4a3dada0faec031d155c6d346355e8a5..8852c53847bbe2f906aff4bdacc355fc
|
||||
|
||||
TextInputManager::SelectionRegion::SelectionRegion(
|
||||
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h
|
||||
index 51522e60d6dc14f1113cc438558b6b393c3fe73a..153ed02f493a83ef9ca354cc18736f9394fc9a72 100644
|
||||
index 75df43e3cd2721a92c90c18154d53d5c203e2465..ce42c75c8face36d21f53f44c0201ac46df71d6a 100644
|
||||
--- a/content/browser/renderer_host/text_input_manager.h
|
||||
+++ b/content/browser/renderer_host/text_input_manager.h
|
||||
@@ -72,6 +72,10 @@ class CONTENT_EXPORT TextInputManager {
|
||||
@@ -69,6 +69,10 @@ class CONTENT_EXPORT TextInputManager {
|
||||
virtual void OnTextSelectionChanged(
|
||||
TextInputManager* text_input_manager,
|
||||
RenderWidgetHostViewBase* updated_view) {}
|
||||
@@ -78,7 +78,7 @@ index 51522e60d6dc14f1113cc438558b6b393c3fe73a..153ed02f493a83ef9ca354cc18736f93
|
||||
};
|
||||
|
||||
// Text selection bounds.
|
||||
@@ -308,6 +312,7 @@ class CONTENT_EXPORT TextInputManager {
|
||||
@@ -304,6 +308,7 @@ class CONTENT_EXPORT TextInputManager {
|
||||
|
||||
void NotifyObserversAboutInputStateUpdate(RenderWidgetHostViewBase* view,
|
||||
bool did_update_state);
|
||||
@@ -87,10 +87,10 @@ index 51522e60d6dc14f1113cc438558b6b393c3fe73a..153ed02f493a83ef9ca354cc18736f93
|
||||
// The view with active text input state, i.e., a focused <input> element.
|
||||
// It will be nullptr if no such view exists. Note that the active view
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index f5013667355aea93bfb5a926375cb674198d7e2c..8c805aec2042d7c02ba0a28f544feb6d976a0775 100644
|
||||
index c3b563b0b727bc35f6d4499c589110644ebe9cd1..6010d9f9fc9bfeffb3e5a64de7352b52a202cbf7 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9733,7 +9733,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -9772,7 +9772,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -18,10 +18,10 @@ or resizing, but Electron does not seem to run into that issue
|
||||
for opaque frameless windows even with that block commented out.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 759f00dd4e674d1dfca690b82e6e1820900ebf0c..9888ac709c51cd30228e3bca6915f7d89071cb83 100644
|
||||
index 8fe48c9bef144218e34434d563883b15733d03bc..3d8a590aacd3a65d5a19004dc11e770b31a0f614 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -1786,7 +1786,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
|
||||
@@ -1796,7 +1796,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
|
||||
SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS),
|
||||
0);
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ Subject: fix: remove profiles from spellcheck_service
|
||||
Electron doesn't support profiles.
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
index 979630ba7ffe84d78804a02b832ce7787aecf2d9..3b1cdaab5d3229c802c8da53a4fa17a464978391 100644
|
||||
index 910534aac947890b16b176b10ac8eae9857bd2d7..1bb22b89b6ec4d620354bb7747c37cae9dd3a57e 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
@@ -21,8 +21,10 @@
|
||||
@@ -20,8 +20,10 @@
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profiles_state.h"
|
||||
@@ -20,7 +20,7 @@ index 979630ba7ffe84d78804a02b832ce7787aecf2d9..3b1cdaab5d3229c802c8da53a4fa17a4
|
||||
#include "chrome/browser/spellchecker/spellcheck_factory.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
|
||||
#include "components/language/core/browser/pref_names.h"
|
||||
@@ -67,7 +69,10 @@ SpellcheckService::SpellCheckerBinder& GetSpellCheckerBinderOverride() {
|
||||
@@ -66,7 +68,10 @@ SpellcheckService::SpellCheckerBinder& GetSpellCheckerBinderOverride() {
|
||||
// Only record spelling-configuration metrics for profiles in which the user
|
||||
// can configure spelling.
|
||||
bool RecordSpellingConfigurationMetrics(content::BrowserContext* context) {
|
||||
|
||||
@@ -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 e420ccfd374e1a6be1ab1e16752584413de23c63..7d3d003fee030926e330a02a9f00b1f807940be3 100644
|
||||
index 7c31b82e2903507bb69aaa71fc0ed51cad06d1c2..0ad97d9973fc6d637967f911cb37ada2313e2776 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2103,9 +2103,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
|
||||
@@ -2114,9 +2114,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
|
||||
|
||||
@@ -20,10 +20,10 @@ index fc9cb7e68bdad4c40fab63f70243e09ad005ab80..199fbceda530da31aab9126d78b4bd21
|
||||
injector_->ExpectsResults(), injector_->ShouldWaitForPromise());
|
||||
}
|
||||
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
|
||||
index f5ec8d885be87b7f2199092b118524f8fb0cc6bc..e42ffaabae75a7db9fe46a33ce58f430c80d768f 100644
|
||||
index 3758966f3cdfb8c37f3b23b1a903996b9d1ac5fb..a1c908e3281a03600268332d6cde2051aa225ff6 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame.h
|
||||
@@ -459,6 +459,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame {
|
||||
@@ -460,6 +460,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame {
|
||||
mojom::EvaluationTiming,
|
||||
mojom::LoadEventBlockingOption,
|
||||
WebScriptExecutionCallback,
|
||||
@@ -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 4da759d7ab6d6fb6b6d4d1648da0e62d7629ad5c..7e537b54b11220f3bc6619b027677182485b201d 100644
|
||||
index 99ae1320be10ac19d204edfe1c1cf4f52c62eb76..e6a3957848f760809deb0080ee5b87c849dca587 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -3092,6 +3092,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3099,6 +3099,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -70,7 +70,7 @@ index 4da759d7ab6d6fb6b6d4d1648da0e62d7629ad5c..7e537b54b11220f3bc6619b027677182
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_behavior) {
|
||||
@@ -3124,7 +3125,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3131,7 +3132,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
PausableScriptExecutor::CreateAndRun(
|
||||
script_state, std::move(script_sources), execute_script_policy,
|
||||
user_gesture, evaluation_timing, blocking_option, want_result_option,
|
||||
@@ -80,10 +80,10 @@ index 4da759d7ab6d6fb6b6d4d1648da0e62d7629ad5c..7e537b54b11220f3bc6619b027677182
|
||||
|
||||
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
index b90e58cb52d32c10d5dcabf3de001b510e1a4cc4..c2ba0c05a74fc786684b50093720e509c6f723c3 100644
|
||||
index 5cdeaa531babca965bed7e1e18ee993f1ba0d847..651e64c0ea39ec28db117aa3a61ea87d3f24117d 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
@@ -814,6 +814,7 @@ class CORE_EXPORT LocalFrame final
|
||||
@@ -815,6 +815,7 @@ class CORE_EXPORT LocalFrame final
|
||||
mojom::blink::EvaluationTiming,
|
||||
mojom::blink::LoadEventBlockingOption,
|
||||
WebScriptExecutionCallback,
|
||||
@@ -104,10 +104,10 @@ index b77ad041a717ef8f317a9d15edd61af3c465b2aa..e3955c64ff894682b91c4cc3c49c6726
|
||||
wants_result
|
||||
? mojom::blink::WantResultOption::kWantResultDateAndRegExpAllowed
|
||||
diff --git a/third_party/blink/renderer/core/frame/pausable_script_executor.cc b/third_party/blink/renderer/core/frame/pausable_script_executor.cc
|
||||
index 9b344e09e545b4a24deb2272d0f093d551866f97..f4d0431f981b3c521c4ce0620886e0564efb3096 100644
|
||||
index 2d674cef2d653ed555cd99848f37c67e29eb00fa..cbc8b8b642376959f366a03bd04eace55f9d02bb 100644
|
||||
--- a/third_party/blink/renderer/core/frame/pausable_script_executor.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/pausable_script_executor.cc
|
||||
@@ -246,7 +246,7 @@ void PausableScriptExecutor::CreateAndRun(
|
||||
@@ -243,7 +243,7 @@ void PausableScriptExecutor::CreateAndRun(
|
||||
script_state, mojom::blink::UserActivationOption::kDoNotActivate,
|
||||
mojom::blink::LoadEventBlockingOption::kDoNotBlock,
|
||||
want_result_option, mojom::blink::PromiseResultOption::kDoNotWait,
|
||||
@@ -116,7 +116,7 @@ index 9b344e09e545b4a24deb2272d0f093d551866f97..f4d0431f981b3c521c4ce0620886e056
|
||||
MakeGarbageCollected<V8FunctionExecutor>(
|
||||
script_state->GetIsolate(), function, receiver, argc, argv));
|
||||
executor->Run();
|
||||
@@ -261,10 +261,11 @@ void PausableScriptExecutor::CreateAndRun(
|
||||
@@ -258,10 +258,11 @@ void PausableScriptExecutor::CreateAndRun(
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_result_option,
|
||||
@@ -130,7 +130,7 @@ index 9b344e09e545b4a24deb2272d0f093d551866f97..f4d0431f981b3c521c4ce0620886e056
|
||||
MakeGarbageCollected<WebScriptExecutor>(std::move(sources),
|
||||
execute_script_policy));
|
||||
switch (evaluation_timing) {
|
||||
@@ -286,6 +287,14 @@ void PausableScriptExecutor::ContextDestroyed() {
|
||||
@@ -283,6 +284,14 @@ void PausableScriptExecutor::ContextDestroyed() {
|
||||
ScriptState::Scope script_scope(script_state_);
|
||||
std::move(callback_).Run({}, {});
|
||||
}
|
||||
@@ -145,7 +145,7 @@ index 9b344e09e545b4a24deb2272d0f093d551866f97..f4d0431f981b3c521c4ce0620886e056
|
||||
Dispose();
|
||||
}
|
||||
|
||||
@@ -296,10 +305,12 @@ PausableScriptExecutor::PausableScriptExecutor(
|
||||
@@ -293,10 +302,12 @@ PausableScriptExecutor::PausableScriptExecutor(
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_result_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -158,7 +158,7 @@ index 9b344e09e545b4a24deb2272d0f093d551866f97..f4d0431f981b3c521c4ce0620886e056
|
||||
user_activation_option_(user_activation_option),
|
||||
blocking_option_(blocking_option),
|
||||
want_result_option_(want_result_option),
|
||||
@@ -423,6 +434,13 @@ void PausableScriptExecutor::HandleResults(
|
||||
@@ -420,6 +431,13 @@ void PausableScriptExecutor::HandleResults(
|
||||
std::move(callback_).Run(std::move(value), start_time_);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ index fa65331f40b90d812b71a489fd560e9359152d2b..390714d631dc88ef92d59ef9618a5706
|
||||
const mojom::blink::UserActivationOption user_activation_option_;
|
||||
const mojom::blink::LoadEventBlockingOption blocking_option_;
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
index 2e2aa78d308157642cf27941fc22a211f6396a0d..c5bcbe1f933f2e79003f7eb9f6368174426a6f0a 100644
|
||||
index b71f1318b186d33fdedd051b0afd04cc60d4d430..5c9fb1e773d9550d2b6b248c66c97ad07e84674e 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
@@ -298,6 +298,7 @@ void ExecuteScriptsInMainWorld(
|
||||
@@ -215,10 +215,10 @@ index 2e2aa78d308157642cf27941fc22a211f6396a0d..c5bcbe1f933f2e79003f7eb9f6368174
|
||||
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 17dfa9c34625493409a7e1f7a403413d1f4ac940..1b43dc5b302b8ba3c4194b37c7cd45332d329912 100644
|
||||
index 7f9cc8cfe501692d4dab847416298ff980aaa500..6524313c1c2a7520b5cf3c4e6abeb2e300c67ec0 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
|
||||
@@ -1097,14 +1097,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
|
||||
@@ -1107,14 +1107,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -237,7 +237,7 @@ index 17dfa9c34625493409a7e1f7a403413d1f4ac940..1b43dc5b302b8ba3c4194b37c7cd4533
|
||||
|
||||
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 7bc07b1705207447f7727592049c201b011e6b5c..626d0501c0344d7c171f26c96dc78f5e85fb2a81 100644
|
||||
index 9ae322eb9d30c684ef18addf59201aad4474d34c..3a320e56db9b43c813b3e63f0394cc1c93f9c3b8 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
|
||||
@@ -196,6 +196,7 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: select the first menu item when opened via keyboard
|
||||
This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed.
|
||||
|
||||
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
|
||||
index 6337d0d70f247b06c7871fb7faa75c2b0b7d541c..2bd399161329b054dd67961f767ccc4480af413c 100644
|
||||
index e82f04bf408c5f7c08df6d476ae3130705af6ae4..402e39e39b24f676ec6fc7525235c0ec5f5cdf9b 100644
|
||||
--- a/ui/views/controls/menu/menu_controller.cc
|
||||
+++ b/ui/views/controls/menu/menu_controller.cc
|
||||
@@ -700,6 +700,14 @@ void MenuController::Run(Widget* parent,
|
||||
@@ -24,7 +24,7 @@ index 6337d0d70f247b06c7871fb7faa75c2b0b7d541c..2bd399161329b054dd67961f767ccc44
|
||||
if (button_controller) {
|
||||
pressed_lock_ = button_controller->TakeLock(
|
||||
false, ui::LocatedEvent::FromIfValid(event));
|
||||
@@ -2401,19 +2409,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
@@ -2406,19 +2414,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
}
|
||||
item->GetSubmenu()->ShowAt(params);
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 13 Mar 2025 10:47:00 +0100
|
||||
Subject: fix: take Snapped status into account when showing a window
|
||||
|
||||
Adjusts HWNDMessageHandler::Show to correctly restore windows that were
|
||||
in a snapped state prior to being hidden or maximized. From Windows
|
||||
documentation at
|
||||
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowarranged:
|
||||
|
||||
> A snapped window (see Snap your windows) is considered to be arranged.
|
||||
> You should treat arranged as a window state similar to maximized. Arranged,
|
||||
> maximized, and minimized are mutually exclusive states.
|
||||
|
||||
The logic already took into account a window being maximized and
|
||||
correctly restored it, but if the window was snapped prior to this CL it
|
||||
would be removed from its snapped state when re-shown. This fixes that.
|
||||
|
||||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/6330848.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 64dd7b6e507b61fab7a044823462fb04eabba698..2cd734db007174834c70365ffe6b46d52673e5cb 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -683,7 +683,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
SetWindowPlacement(hwnd(), &placement);
|
||||
native_show_state = SW_SHOWMAXIMIZED;
|
||||
} else {
|
||||
- const bool is_maximized = IsMaximized();
|
||||
+ const bool is_maximized_or_arranged =
|
||||
+ IsMaximized() || IsWindowArranged(hwnd());
|
||||
|
||||
// Use SW_SHOW/SW_SHOWNA instead of SW_SHOWNORMAL/SW_SHOWNOACTIVATE so that
|
||||
// the window is not restored to its original position if it is maximized.
|
||||
@@ -693,7 +694,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
// position, some do not. See crbug.com/1296710
|
||||
switch (show_state) {
|
||||
case ui::mojom::WindowShowState::kInactive:
|
||||
- native_show_state = is_maximized ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
+ native_show_state =
|
||||
+ is_maximized_or_arranged ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
break;
|
||||
case ui::mojom::WindowShowState::kMaximized:
|
||||
native_show_state = SW_SHOWMAXIMIZED;
|
||||
@@ -704,9 +706,11 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
case ui::mojom::WindowShowState::kNormal:
|
||||
if ((GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_TRANSPARENT) ||
|
||||
(GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_NOACTIVATE)) {
|
||||
- native_show_state = is_maximized ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
+ native_show_state =
|
||||
+ is_maximized_or_arranged ? SW_SHOWNA : SW_SHOWNOACTIVATE;
|
||||
} else {
|
||||
- native_show_state = is_maximized ? SW_SHOW : SW_SHOWNORMAL;
|
||||
+ native_show_state =
|
||||
+ is_maximized_or_arranged ? SW_SHOW : SW_SHOWNORMAL;
|
||||
}
|
||||
break;
|
||||
case ui::mojom::WindowShowState::kFullscreen:
|
||||
@@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
|
||||
Allows embedder to intercept site instances created by chromium.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
index 7ece2f1a4e55587c37bff9ebeec6d8783625f795..fc5f6cffb6eee6a80728e649ec503d3be10644bc 100644
|
||||
index e9f000ae316ac64cd23827f1533ec1416b3ed040..c3fb6dbd8f4c39e1087be567f6a2c2df69b19ef8 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
@@ -4728,6 +4728,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -4752,6 +4752,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ index 7ece2f1a4e55587c37bff9ebeec6d8783625f795..fc5f6cffb6eee6a80728e649ec503d3b
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index abdac7f78b24392e04c431584a0bae8fca814df6..bd284a39c7f23fc56860eb4ad68afefbd1b18801 100644
|
||||
index 7459b083156d1f6bc01198690c4c9ec02d88d862..d564908c539ee9f8c32c27c90f51b63c152f1392 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -339,6 +339,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
@@ -41,10 +41,10 @@ index ff42cfbb6a228e902317c7e3ab035d8437d5dd62..e27f177ce27e177abf6cee84cd466e7a
|
||||
// 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 93b49420765273ac2d49822ee406c3495aff25d4..7f7ea9ea6dd9b5f3af436570661fa736f912132e 100644
|
||||
index 51c8cd7cc3f44936e1e33d9dc937d5a68d737dd6..578e200a88d89b356e991b3317ff1e71f25ff75e 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -548,7 +548,8 @@ void SetFeatureFlags() {
|
||||
@@ -555,7 +555,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 93b49420765273ac2d49822ee406c3495aff25d4..7f7ea9ea6dd9b5f3af436570661fa736
|
||||
static bool v8_is_initialized = false;
|
||||
if (v8_is_initialized)
|
||||
return;
|
||||
@@ -562,7 +563,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
@@ -570,7 +571,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
}
|
||||
SetFlags(mode, js_command_line_flags);
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
|
||||
Add electron resources file to the list of resource ids generation.
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
|
||||
index 4d696890b52f95c29c5d0f47ce45ecf277a17e92..20d60e4ccaf97d4ef70dc7fcdaa431a16b4f0801 100644
|
||||
index 77707df02c02ba2ffd66ac280d53479993498fff..acc783a27d84465b81b8aef8b6f151a9ad5f0669 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -1472,6 +1472,11 @@
|
||||
@@ -1480,6 +1480,11 @@
|
||||
"<(SHARED_INTERMEDIATE_DIR)/third_party/blink/public/strings/permission_element_generated_strings.grd": {
|
||||
"META": {"sizes": {"messages": [2000],}},
|
||||
"messages": [10080],
|
||||
|
||||
@@ -11,10 +11,10 @@ Bug: N/A
|
||||
Change-Id: I9fc472212b2d3afac2c8e18a2159bc2d50bbdf98
|
||||
|
||||
diff --git a/AUTHORS b/AUTHORS
|
||||
index 66e37c775006eaba80440a48b92cce825efd2944..8d03ca899968f24ef73c8563dfe8f13bf4fc6ee8 100644
|
||||
index b55c6916e97a7c8e317145f5239a34d8abca810e..dbd924a91a8fca8ff9d85bf6addcdb5a7b17ca3a 100644
|
||||
--- a/AUTHORS
|
||||
+++ b/AUTHORS
|
||||
@@ -340,6 +340,7 @@ David Futcher <david.mike.futcher@gmail.com>
|
||||
@@ -341,6 +341,7 @@ David Futcher <david.mike.futcher@gmail.com>
|
||||
David Jin <davidjin@amazon.com>
|
||||
David Lechner <david@pybricks.com>
|
||||
David Leen <davileen@amazon.com>
|
||||
|
||||
@@ -9,7 +9,7 @@ be created for each child process, despite logs being redirected to a
|
||||
file.
|
||||
|
||||
diff --git a/content/app/content_main.cc b/content/app/content_main.cc
|
||||
index 7db566cf1492baabe15b8892692ace5a703a0814..82dea74c154d625978353d28577274d5198801ea 100644
|
||||
index ffc5c377428008a9cee3969e958e19357b3ecead..892fa6258a77a6ec3ddfa209a9d3fd63a372406c 100644
|
||||
--- a/content/app/content_main.cc
|
||||
+++ b/content/app/content_main.cc
|
||||
@@ -330,16 +330,14 @@ NO_STACK_PROTECTOR int RunContentProcess(
|
||||
|
||||
@@ -7,10 +7,10 @@ Allows embedders to get a handle to the gdk_pixbuf
|
||||
library already loaded in the process.
|
||||
|
||||
diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc
|
||||
index 3a4b856ec5c2f5c3ede6e8f6db7858498b737702..e410998c4197c98947d2e1ad8bebe12c70379358 100644
|
||||
index d6ac3233de3165d2be3e5d4fb3e221dca8b8d415..4f15069af07b7adc3e3c45e67e23ec8525668c21 100644
|
||||
--- a/ui/gtk/gtk_compat.cc
|
||||
+++ b/ui/gtk/gtk_compat.cc
|
||||
@@ -66,11 +66,6 @@ void* GetLibGio() {
|
||||
@@ -69,11 +69,6 @@ void* GetLibGio() {
|
||||
return libgio;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ index 3a4b856ec5c2f5c3ede6e8f6db7858498b737702..e410998c4197c98947d2e1ad8bebe12c
|
||||
void* GetLibGdk3() {
|
||||
static void* libgdk3 = DlOpen("libgdk-3.so.0");
|
||||
return libgdk3;
|
||||
@@ -134,6 +129,11 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) {
|
||||
@@ -150,6 +145,11 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) {
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to
|
||||
system priority.
|
||||
|
||||
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
||||
index f16a24f070ff6e004473a794e3189e078126584c..54d6573cd704261e65fd0e4c3673d0e60b492101 100644
|
||||
index 6bf37c804ddb77a28e788af02bb215970ba343c8..4bf9d4050c44dd155b3455082c8b87afa30e9ac7 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1031,6 +1031,7 @@ component("base") {
|
||||
@@ -269,11 +269,11 @@ index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..8b5f4cae3123ac5480ad73f0c873fca0
|
||||
|
||||
} // namespace
|
||||
diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
index 3a8b44a2a295119f37ca37d5866dfcfa21121db0..b408e9c73fe97dd8885b5479923481e20955cf8d 100644
|
||||
index 92646b4978457724d46eb526d6f34cd308562f0b..c3e669ed8fb0682f7f973bb1c69d069bd6a3aa0c 100644
|
||||
--- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
+++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
@@ -9,7 +9,9 @@
|
||||
#include "components/remote_cocoa/app_shim/features.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
|
||||
#include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h"
|
||||
+#include "electron/mas.h"
|
||||
@@ -298,7 +298,7 @@ index 3a8b44a2a295119f37ca37d5866dfcfa21121db0..b408e9c73fe97dd8885b5479923481e2
|
||||
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle {
|
||||
// - NSThemeFrame and its subclasses will be nil if it's missing at runtime.
|
||||
if ([BrowserWindowFrame class])
|
||||
@@ -163,6 +168,8 @@ - (BOOL)_usesCustomDrawing {
|
||||
@@ -164,6 +169,8 @@ - (BOOL)_usesCustomDrawing {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ index 3a8b44a2a295119f37ca37d5866dfcfa21121db0..b408e9c73fe97dd8885b5479923481e2
|
||||
// Handle "Move focus to the window toolbar" configured in System Preferences ->
|
||||
// Keyboard -> Shortcuts -> Keyboard. Usually Ctrl+F5. The argument (|unknown|)
|
||||
// tends to just be nil.
|
||||
@@ -173,8 +180,8 @@ - (void)_handleFocusToolbarHotKey:(id)unknown {
|
||||
@@ -174,8 +181,8 @@ - (void)_handleFocusToolbarHotKey:(id)unknown {
|
||||
}
|
||||
|
||||
- (void)setAlwaysShowTrafficLights:(BOOL)alwaysShow {
|
||||
@@ -449,10 +449,10 @@ index 2b50e3c3750c9ac6dd84a514663062a5d754b43e..49ced9aa87d3bcb00cd3d76ac32d4eec
|
||||
bool shouldShowWindowTitle = YES;
|
||||
if (_bridge)
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
index bcd3ea598687c5a85cddc862cdb16eab2d8dbd5d..2ed210685453409a2aa330bf718694f70a3d862d 100644
|
||||
index aa59dfc5c689c6347a4a34fbce46ea549f46dc9d..29fa39513d0273d0a23fb45e627dda14b91c62d4 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -42,6 +42,7 @@
|
||||
#import "components/remote_cocoa/app_shim/views_nswindow_delegate.h"
|
||||
#import "components/remote_cocoa/app_shim/window_move_loop.h"
|
||||
#include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h"
|
||||
@@ -460,7 +460,7 @@ index bcd3ea598687c5a85cddc862cdb16eab2d8dbd5d..2ed210685453409a2aa330bf718694f7
|
||||
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
||||
#include "net/cert/x509_util_apple.h"
|
||||
#include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
|
||||
@@ -676,10 +677,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
|
||||
@@ -677,10 +678,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
|
||||
// this should be treated as an error and caught early.
|
||||
CHECK(bridged_view_);
|
||||
|
||||
@@ -474,10 +474,10 @@ index bcd3ea598687c5a85cddc862cdb16eab2d8dbd5d..2ed210685453409a2aa330bf718694f7
|
||||
// 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 b1cb8132b0e8d7bb18848d49634ecaaa939eefd4..610ed4c922705697b27af569af55064daeff5d25 100644
|
||||
index 3c4ab01a87d5011925e08ca296722d99ac7f33d4..41c3a5128b9936f48587d6fc6ddd2050bffc9c36 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -371,6 +371,7 @@ viz_component("service") {
|
||||
@@ -384,6 +384,7 @@ viz_component("service") {
|
||||
"frame_sinks/external_begin_frame_source_mac.h",
|
||||
]
|
||||
}
|
||||
@@ -485,7 +485,7 @@ index b1cb8132b0e8d7bb18848d49634ecaaa939eefd4..610ed4c922705697b27af569af55064d
|
||||
}
|
||||
|
||||
if (is_android || use_ozone) {
|
||||
@@ -671,6 +672,7 @@ viz_source_set("unit_tests") {
|
||||
@@ -684,6 +685,7 @@ viz_source_set("unit_tests") {
|
||||
"display_embedder/software_output_device_mac_unittest.mm",
|
||||
]
|
||||
frameworks = [ "IOSurface.framework" ]
|
||||
@@ -545,7 +545,7 @@ index dbf334caa3a6d10017b69ad76802e389a011436b..da828823e8195cc9e497866363c9af93
|
||||
|
||||
void ForwardKeyboardEvent(const input::NativeWebKeyboardEvent& key_event,
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index 08186f30eaa97caf18ac2fe47655526e7733d9df..e4cd1f436ad1734f357429cb3ad6c85430bf1d76 100644
|
||||
index b712b8af0e770aa3acbeb1167b1a20bc1547c98a..fdb476a7e470c4b32649d4b3b7e4e44559b5b1c1 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -35,6 +35,7 @@
|
||||
@@ -556,7 +556,7 @@ index 08186f30eaa97caf18ac2fe47655526e7733d9df..e4cd1f436ad1734f357429cb3ad6c854
|
||||
#include "skia/ext/skia_utils_mac.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/mojom/input/input_handler.mojom.h"
|
||||
@@ -2151,15 +2152,21 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
@@ -2142,15 +2143,21 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
||||
// make any key-typing jank. --hbono 7/23/09
|
||||
//
|
||||
@@ -579,10 +579,10 @@ index 08186f30eaa97caf18ac2fe47655526e7733d9df..e4cd1f436ad1734f357429cb3ad6c854
|
||||
return kAttributes;
|
||||
}
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 9a868b490b76e06bea11c8042989ef597448ee5e..5e5f3ba7c011fdb7aa6ac0f752c52ce19fb75675 100644
|
||||
index 4424636d013725023c2bf35529c034adecf823b1..62151d9e640771580ae85231762dfef260b0e4ff 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -332,6 +332,7 @@ source_set("browser") {
|
||||
@@ -339,6 +339,7 @@ source_set("browser") {
|
||||
"//ui/webui/resources",
|
||||
"//v8",
|
||||
"//v8:v8_version",
|
||||
@@ -591,7 +591,7 @@ index 9a868b490b76e06bea11c8042989ef597448ee5e..5e5f3ba7c011fdb7aa6ac0f752c52ce1
|
||||
|
||||
public_deps = [
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
index b58722615ebd4012816ed3246145cb1a088bfe17..1fde1a7ae8a8885bc3210fe0298476acbb2c915d 100644
|
||||
index d73737088c819274c854db491a7d4d26f9367eb2..b72427517b88e5cb4179dbc551f3f4f321fd8b4e 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
@@ -24,6 +24,7 @@
|
||||
@@ -612,7 +612,7 @@ index b58722615ebd4012816ed3246145cb1a088bfe17..1fde1a7ae8a8885bc3210fe0298476ac
|
||||
@class RenderWidgetHostViewCocoa;
|
||||
|
||||
namespace content {
|
||||
@@ -693,9 +696,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
|
||||
@@ -691,9 +694,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
|
||||
// EnsureSurfaceSynchronizedForWebTest().
|
||||
uint32_t latest_capture_sequence_number_ = 0u;
|
||||
|
||||
@@ -625,7 +625,7 @@ index b58722615ebd4012816ed3246145cb1a088bfe17..1fde1a7ae8a8885bc3210fe0298476ac
|
||||
// Used to force the NSApplication's focused accessibility element to be the
|
||||
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 9924e2e37dc04b12cc08b3451769734267b600bf..943e3b8875c68178e84ae79c241c7a31e9305c6c 100644
|
||||
index e8c48002df717501128b9a135d5662dfca044e9c..71db145609652dbbe733dbc96d2630b686f6c8c9 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -49,6 +49,7 @@
|
||||
@@ -647,7 +647,7 @@ index 9924e2e37dc04b12cc08b3451769734267b600bf..943e3b8875c68178e84ae79c241c7a31
|
||||
|
||||
// Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling
|
||||
// pointers. `ns_view_` gets reinitialized later in this method.
|
||||
@@ -1627,8 +1630,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1626,8 +1629,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
|
||||
gfx::NativeViewAccessible
|
||||
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
|
||||
@@ -658,7 +658,7 @@ index 9924e2e37dc04b12cc08b3451769734267b600bf..943e3b8875c68178e84ae79c241c7a31
|
||||
return [GetInProcessNSView() window];
|
||||
}
|
||||
|
||||
@@ -1677,9 +1682,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1676,9 +1681,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
|
||||
@@ -670,7 +670,7 @@ index 9924e2e37dc04b12cc08b3451769734267b600bf..943e3b8875c68178e84ae79c241c7a31
|
||||
}
|
||||
|
||||
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
|
||||
@@ -2206,20 +2213,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -2205,20 +2212,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken(
|
||||
GetRenderWidgetAccessibilityTokenCallback callback) {
|
||||
base::ProcessId pid = getpid();
|
||||
@@ -698,10 +698,10 @@ index 9924e2e37dc04b12cc08b3451769734267b600bf..943e3b8875c68178e84ae79c241c7a31
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
|
||||
index 9de0d44a70c4c2587a7e4283783b614174393819..87dfae661a98819118d48cd973862d8fabc7bfa6 100644
|
||||
index fb23dfd8f90ad3eeb55e4db373ca67f75d8e5ce1..df902b0b01ed4d092070a92fdf77cf69fde475e7 100644
|
||||
--- a/content/common/BUILD.gn
|
||||
+++ b/content/common/BUILD.gn
|
||||
@@ -285,6 +285,7 @@ source_set("common") {
|
||||
@@ -283,6 +283,7 @@ source_set("common") {
|
||||
"//ui/shell_dialogs",
|
||||
"//url",
|
||||
"//url/ipc:url_ipc",
|
||||
@@ -710,10 +710,10 @@ index 9de0d44a70c4c2587a7e4283783b614174393819..87dfae661a98819118d48cd973862d8f
|
||||
|
||||
defines = []
|
||||
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
|
||||
index 9c312682be17f1add7e9aa56772c3e1a2e22f98b..5f4362d3c717f24f787ab9298d4f5103442f3073 100644
|
||||
index dcb22228bcc86d081c9d0a0a7bdeab896ed07ca7..3e863d861c22e044099e227346845bb6422e21fd 100644
|
||||
--- a/content/renderer/BUILD.gn
|
||||
+++ b/content/renderer/BUILD.gn
|
||||
@@ -329,6 +329,7 @@ target(link_target_type, "renderer") {
|
||||
@@ -331,6 +331,7 @@ target(link_target_type, "renderer") {
|
||||
"//ui/surface",
|
||||
"//url",
|
||||
"//v8",
|
||||
@@ -792,7 +792,7 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
index 0418e7a1e0678b7a943281e7066677a6852960de..972fc355ea251de4758957c6c4b1e980591ec971 100644
|
||||
index 1163dd9e0d25b74fbdc584f742392a4452008724..246c50d5f05ecbf4f57dfc8f3bd68db03fe131f7 100644
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -658,6 +658,7 @@ static_library("test_support") {
|
||||
@@ -811,7 +811,7 @@ index 0418e7a1e0678b7a943281e7066677a6852960de..972fc355ea251de4758957c6c4b1e980
|
||||
}
|
||||
|
||||
mojom("content_test_mojo_bindings") {
|
||||
@@ -1945,6 +1947,7 @@ test("content_browsertests") {
|
||||
@@ -1946,6 +1948,7 @@ test("content_browsertests") {
|
||||
"//ui/shell_dialogs",
|
||||
"//ui/snapshot",
|
||||
"//ui/webui:test_support",
|
||||
@@ -819,10 +819,10 @@ index 0418e7a1e0678b7a943281e7066677a6852960de..972fc355ea251de4758957c6c4b1e980
|
||||
]
|
||||
|
||||
if (!(is_chromeos && target_cpu == "arm64" && current_cpu == "arm")) {
|
||||
@@ -3246,6 +3249,7 @@ test("content_unittests") {
|
||||
"//ui/latency:test_support",
|
||||
@@ -3264,6 +3267,7 @@ test("content_unittests") {
|
||||
"//ui/shell_dialogs:shell_dialogs",
|
||||
"//ui/webui:test_support",
|
||||
"//url",
|
||||
+ "//electron/build/config:generate_mas_config"
|
||||
]
|
||||
|
||||
@@ -910,7 +910,7 @@ index 973cd337f2781271b4ca3e29db07939ec6917327..90658a336138e4e50f93c38f1c1f465c
|
||||
if (is_ios) {
|
||||
sources += [ "image_transport_surface_ios.mm" ]
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
index 93665e7ec19efa8d94fe0bb4f195642f43432c24..23c25ce53e4e630e173777943770a09ee736cc3d 100644
|
||||
index ae040bbac8755b677dc6e19383a2390df407e5a6..e95ca30f49506c66a37d6d5269929f437005f863 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
@@ -8,6 +8,7 @@
|
||||
@@ -932,7 +932,7 @@ index 93665e7ec19efa8d94fe0bb4f195642f43432c24..23c25ce53e4e630e173777943770a09e
|
||||
|
||||
namespace ui {
|
||||
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
|
||||
index 87126a36725849cbaf478e2dc24dc3a628a30846..a3a88b07af91b86191d9e5727a1d021ebbbb22ce 100644
|
||||
index 7122165cf5ddb39056369e32fc29107f29e9f425..f11417e459e067f4976f59f1c58d4a5197520902 100644
|
||||
--- a/media/audio/BUILD.gn
|
||||
+++ b/media/audio/BUILD.gn
|
||||
@@ -196,6 +196,7 @@ source_set("audio") {
|
||||
@@ -1431,7 +1431,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..9921ccb10d3455600eddd85f77f10228
|
||||
|
||||
} // namespace sandbox
|
||||
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
|
||||
index cae611cd83ef3a32a0d4f7474f407c6299d2bfa1..69ce20735646f577386f175b0223b43035b4b20a 100644
|
||||
index 3ff395b3ff3b646a64c43503d2c172776bf68c84..e40030307e8d9df7e00a402e241e00664b236c7d 100644
|
||||
--- a/third_party/blink/renderer/core/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/core/BUILD.gn
|
||||
@@ -414,6 +414,7 @@ component("core") {
|
||||
@@ -1463,10 +1463,10 @@ index d38e951cdbf1ab9b367273ad0fb8f962155a7f3b..e39ee0414cb54004096dbfffc4f768e8
|
||||
blink_core_sources_editing += [ "kill_ring_none.cc" ]
|
||||
}
|
||||
diff --git a/ui/accelerated_widget_mac/BUILD.gn b/ui/accelerated_widget_mac/BUILD.gn
|
||||
index 47e88da13d22b60e27b458f2fd33f10829b31fc0..b32ad8cd5af69c835ecfdbf50329347fb700f9b3 100644
|
||||
index ce3dc22f38b9d3f2f12e469b23f5dfe06ecbb98a..a69af46e05365028379dbf6abafaacd9b19e4569 100644
|
||||
--- a/ui/accelerated_widget_mac/BUILD.gn
|
||||
+++ b/ui/accelerated_widget_mac/BUILD.gn
|
||||
@@ -68,6 +68,7 @@ component("accelerated_widget_mac") {
|
||||
@@ -77,6 +77,7 @@ component("accelerated_widget_mac") {
|
||||
"//ui/gfx",
|
||||
"//ui/gfx/geometry",
|
||||
"//ui/gl",
|
||||
@@ -1579,10 +1579,10 @@ index dcf493d62990018040a3f84b6f875af737bd2214..3d1c4dcc9ee0bbfdac15f40d9c74e9f3
|
||||
|
||||
void DisplayCALayerTree::GotIOSurfaceFrame(
|
||||
diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn
|
||||
index 2f7f2a8f81ec0e033cb83f82daac4835a2863cbc..21388d7de99fbb97c79eecbab658934d5cac5650 100644
|
||||
index 8b25953be73da43fa2e0b5957569ae481dc6a082..7f9175e7eb67ef27fe110ee72f5e9c885018c2ac 100644
|
||||
--- a/ui/accessibility/platform/BUILD.gn
|
||||
+++ b/ui/accessibility/platform/BUILD.gn
|
||||
@@ -283,6 +283,7 @@ component("platform") {
|
||||
@@ -288,6 +288,7 @@ component("platform") {
|
||||
"AppKit.framework",
|
||||
"Foundation.framework",
|
||||
]
|
||||
@@ -1591,7 +1591,7 @@ index 2f7f2a8f81ec0e033cb83f82daac4835a2863cbc..21388d7de99fbb97c79eecbab658934d
|
||||
|
||||
if (is_ios) {
|
||||
diff --git a/ui/accessibility/platform/browser_accessibility_manager_mac.mm b/ui/accessibility/platform/browser_accessibility_manager_mac.mm
|
||||
index 444f315852deabbac971165a7de9751a1bb367e3..7aba9f251f869c64d7722558084f209bd5d27075 100644
|
||||
index c642b2ce1e19a48bc00822c429d833d5d45c4f98..ebe0b80b142a997aaf928fa72a2ca71492d1a54e 100644
|
||||
--- a/ui/accessibility/platform/browser_accessibility_manager_mac.mm
|
||||
+++ b/ui/accessibility/platform/browser_accessibility_manager_mac.mm
|
||||
@@ -13,6 +13,7 @@
|
||||
@@ -1673,7 +1673,7 @@ index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..c2ac4da580e3e7f749a0a4de1e859af6
|
||||
// Accessible object
|
||||
if (AXElementWrapper::IsValidElement(value)) {
|
||||
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
||||
index 04702a2c6fec9f84a279e587a59c27c42ae20655..fdda175688baaeabf4991173b4a68ee8fce60d73 100644
|
||||
index 4b91bad93384b435bed2e8da5e185603fb0a66a3..d68202e3fe92d01b148bf494a3599e2a8d8ced91 100644
|
||||
--- a/ui/base/BUILD.gn
|
||||
+++ b/ui/base/BUILD.gn
|
||||
@@ -363,6 +363,13 @@ component("base") {
|
||||
@@ -1690,7 +1690,7 @@ index 04702a2c6fec9f84a279e587a59c27c42ae20655..fdda175688baaeabf4991173b4a68ee8
|
||||
if (is_ios) {
|
||||
sources += [
|
||||
"device_form_factor_ios.mm",
|
||||
@@ -514,6 +521,12 @@ component("base") {
|
||||
@@ -516,6 +523,12 @@ component("base") {
|
||||
"//url",
|
||||
]
|
||||
|
||||
@@ -1843,10 +1843,10 @@ index 29ae2da6a8a2c2a612dfb92f7f9c03ca5fa306b1..440c139a32a0c205e77b657d4aab6468
|
||||
// Query the display's refresh rate.
|
||||
if (@available(macos 12.0, *)) {
|
||||
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
|
||||
index 230a9e8266fa494f870ed7fc7dc444d1db5bbb48..99facff7a8e98cbc175354ae4e1d1f592197320a 100644
|
||||
index cb507971bef962e91cd8fca696692194696d1142..d2aee3962e3377980940e6d3538487a566a609b4 100644
|
||||
--- a/ui/gfx/BUILD.gn
|
||||
+++ b/ui/gfx/BUILD.gn
|
||||
@@ -332,6 +332,12 @@ component("gfx") {
|
||||
@@ -334,6 +334,12 @@ component("gfx") {
|
||||
"//ui/base:ui_data_pack",
|
||||
]
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user