mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
79 Commits
v36.0.0-al
...
sckp-macos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
589272e065 | ||
|
|
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 |
6
.github/actions/checkout/action.yml
vendored
6
.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
|
||||
|
||||
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:
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -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: |
|
||||
|
||||
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':
|
||||
'136.0.7062.0',
|
||||
'136.0.7067.0',
|
||||
'node_version':
|
||||
'v22.14.0',
|
||||
'nan_version':
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -14,6 +14,19 @@ 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
|
||||
|
||||
@@ -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 c0c65798b61650aec08b971b417b21aa4b2305c6..6212d3ae2b11f35a576fcd02afe7f55965206e08 100644
|
||||
index 10b062abf8304df32652c57f377d57209bb47ed1..4eefe928daaf959d0cb1f0820e01ee05754bb4d5 100644
|
||||
--- a/ssl/ssl_lib.cc
|
||||
+++ b/ssl/ssl_lib.cc
|
||||
@@ -1204,7 +1204,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 c0c65798b61650aec08b971b417b21aa4b2305c6..6212d3ae2b11f35a576fcd02afe7f559
|
||||
return SSL_ERROR_ZERO_RETURN;
|
||||
}
|
||||
// An EOF was observed which violates the protocol, and the underlying
|
||||
@@ -2571,13 +2571,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@ chore_remove_reference_to_chrome_browser_themes.patch
|
||||
feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
|
||||
build_allow_electron_mojom_interfaces_to_depend_on_blink.patch
|
||||
osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch
|
||||
feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch
|
||||
chore_partial_revert_of.patch
|
||||
fix_software_compositing_infinite_loop.patch
|
||||
fix_add_method_which_disables_headless_mode_on_native_widget.patch
|
||||
@@ -140,6 +139,8 @@ 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
|
||||
fix_debug_desktop_capturer_picture.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 3afbd7c4e88d97f1a5c744e82eba2da19cd9e53f..143c42b98965c879557213670a9fbbe460faec5b 100644
|
||||
index 0fb92081a1bbfb14c0ddd74dfe91f94bb2be1d2a..886f677564084d8b6af15b03403cfa56aeddd3c9 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4794,6 +4794,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 1368fae3346175c0fdd652d74f882eca26dd7aa2..7f2ca2366ea188bfb0a6e846a519b9cf790ec56a 100755
|
||||
index 12ad657f5df3ff4af2bdbd8b9fb7959131db2970..f2b03596dd5ff96236272b6348336515df85eef0 100755
|
||||
--- a/tools/licenses/licenses.py
|
||||
+++ b/tools/licenses/licenses.py
|
||||
@@ -336,6 +336,31 @@ SPECIAL_CASES = {
|
||||
|
||||
@@ -49,10 +49,10 @@ index 9dc450bc20744463c8898bc822a558be38486493..576421cb9600625ad8b9eda25cb99954
|
||||
// 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 dbb0843658e356f3c47dcaef470789c9e047aeee..feb30ced77cfc7d0a1faa637cd8bdec399155504 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 dbb0843658e356f3c47dcaef470789c9e047aeee..feb30ced77cfc7d0a1faa637cd8bdec3
|
||||
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(
|
||||
|
||||
@@ -33,10 +33,10 @@ index b38442f018b218944c7b85c9f8bd8b8eb6137b9e..dd15f6cf5dc40f2d54134c833d35508f
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index d668c23e5eb34602fab4f9002c341a9d38f13995..55e5e98c332fdc99b7ce824665d71ceb826d647f 100644
|
||||
index 0ad542897fa8e45003a7945d9393f84844f993d3..0fb8770c97c2a3c2ffebb558cd81081821747b2a 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4564,7 +4564,7 @@ static_library("browser") {
|
||||
@@ -4567,7 +4567,7 @@ static_library("browser") {
|
||||
[ "//chrome/browser/ui/webui/signin:profile_impl" ]
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index d668c23e5eb34602fab4f9002c341a9d38f13995..55e5e98c332fdc99b7ce824665d71ceb
|
||||
# than here in :chrome_dll.
|
||||
deps += [ "//chrome:packed_resources_integrity_header" ]
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index ceefd25c55645ddc0bc04c7509962edec1148506..bfb8ee6710ac4fa9e35cd92d109fc8b1647c552d 100644
|
||||
index 1cc7b3905eae8d1c3025ae3454482ea8418a5217..bf71a7514f337cc6447e27a8ebd3a2c299840121 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7024,9 +7024,12 @@ test("unit_tests") {
|
||||
@@ -7031,9 +7031,12 @@ test("unit_tests") {
|
||||
"//chrome/notification_helper",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index ceefd25c55645ddc0bc04c7509962edec1148506..bfb8ee6710ac4fa9e35cd92d109fc8b1
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -7990,6 +7993,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 ceefd25c55645ddc0bc04c7509962edec1148506..bfb8ee6710ac4fa9e35cd92d109fc8b1
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8045,7 +8052,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 9e64769566a136b41cab4ab5e31798ae33d2ebd1..0303488f688c1e18d0cdbafc0c481cccbbcc96d0 100644
|
||||
index bdf8b13631a3cdf698078f70c435e9316cf0bfc3..53df468e94bdd2cdf049604e29e55863efdd3a8d 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
@@ -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 6708ec005561fb174ed9557ad92a85f5c33666ee..37af686964489bd77d84be95d5f3aba9cd0a7a0c 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
|
||||
@@ -9629,6 +9629,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,7 +21,7 @@ index 6708ec005561fb174ed9557ad92a85f5c33666ee..37af686964489bd77d84be95d5f3aba9
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index c28aabb66b8ff483a140a6c18b4cd7fbc82c649d..60ed731f7648497d62fbc7b43181a47a82743c4b 100644
|
||||
index c53ab4b96a16b7326dfde14452b20d2170aecf04..e500fe77f55836b3e5832536f98cf9581984b8c1 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5061,6 +5061,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -51,13 +51,13 @@ index c28aabb66b8ff483a140a6c18b4cd7fbc82c649d..60ed731f7648497d62fbc7b43181a47a
|
||||
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 54014f1d8374b4286b3f4358cca1b6964ce370f8..50c5073b4281239a485ea8b0e08d687d7e9a3cf3 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 54014f1d8374b4286b3f4358cca1b6964ce370f8..50c5073b4281239a485ea8b0e08d687d
|
||||
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 f3750ed03dff3ca9885b189692dde2c919ab3eb3..faf574d7778e24d6fc9e3f539b39c9cb1c149bbc 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 f3750ed03dff3ca9885b189692dde2c919ab3eb3..faf574d7778e24d6fc9e3f539b39c9cb
|
||||
} // 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 602bea4189f0d23c19cbc7afd56583927cbb7e0c..3afbd7c4e88d97f1a5c744e82eba2da19cd9e53f 100644
|
||||
index 0e2524de1159d7e2628c66d188002c6a417bfa52..0fb92081a1bbfb14c0ddd74dfe91f94bb2be1d2a 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6916,6 +6916,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,
|
||||
|
||||
@@ -61,10 +61,10 @@ index 4865d79c95c34d8cead96d3bb8063a0e2bd6076b..ebfa09ed15dca98b75a013e3dcbb566c
|
||||
// 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 7f29d902ae0a2f980a56e77e6e25935dab3c0685..ad844f4d6d150aee3e00fd6465600bfb248d79d2 100644
|
||||
index 3a60e310d1c4048f0e37e085c97b8dfc093aefda..8fe48c9bef144218e34434d563883b15733d03bc 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3146,15 +3146,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.
|
||||
@@ -86,7 +86,7 @@ index 7f29d902ae0a2f980a56e77e6e25935dab3c0685..ad844f4d6d150aee3e00fd6465600bfb
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3177,6 +3181,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
@@ -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();
|
||||
@@ -94,7 +94,7 @@ index 7f29d902ae0a2f980a56e77e6e25935dab3c0685..ad844f4d6d150aee3e00fd6465600bfb
|
||||
// |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu()
|
||||
// expect screen coordinates.
|
||||
POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
|
||||
@@ -3184,7 +3189,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
@@ -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) {
|
||||
|
||||
@@ -14,7 +14,7 @@ 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 a16c2368a4e37756642544c45d3e4b1fe7d64b26..f3d223efcfa8f909e810ec43dd5ef90c9fc5c620 100644
|
||||
index 6010d9f9fc9bfeffb3e5a64de7352b52a202cbf7..4325cdfd256ae7a1008e073d42da995b82df5bba 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4980,7 +4980,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
@@ -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,
|
||||
@@ -218,7 +218,7 @@ 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 e84ef165670048dd2f030a48ff2d9796b5170b52..591c87ffc5f56b38d0f329da8b983a77af9662ee 100644
|
||||
index 952fd20f71560acd89c74f08e9d8cdbf34fb5a1a..59b05937ceb1b81b69d913f587150021b9031106 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4943,8 +4943,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
@@ -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 2235a264ff87ef400734a7308c2735886c63c92c..2310a951c5b4d34447a39c7585bdf1027a9953cc 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:
|
||||
@@ -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 f4475e34d3d6cf78b1d5b5492e398d1551c2bd90..f13799f1cc440a20d8e3c55ee35f64e6505e5590 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 f4475e34d3d6cf78b1d5b5492e398d1551c2bd90..f13799f1cc440a20d8e3c55ee35f64e6
|
||||
// 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 99fe44aab8599bffe256e4683ec36441c06925b8..72c5afe5d028c77acb76757698c15a013379860d 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
|
||||
@@ -1017,6 +1017,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();
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ index 24f63e82a1a170b392bdc8e868729ddd5f9238fa..55c426aee12da4d4d1f62dc7d489133e
|
||||
excluded_margin);
|
||||
}
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index a10d781e667416e74f53583081867d879f9f1eae..d1146216b6969562876a318586420636331f63d1 100644
|
||||
index 8d5002fab43ccfcaccdb044fc9b2a95748e71b75..adade58a533c373087d8c51a5744e8f118ba6e9d 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -990,8 +990,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,7 +33,7 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
|
||||
|
||||
} // namespace net
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 771fee7092bb25e4f7546941a04647d060e966c2..356d7e8fd5e8a82a8d506d1172844706bc76c99f 100644
|
||||
index b1df0a09a9bfd226ffe7b37144e6599b099e619e..f8c7bc591552fea25b4a8e0edd7a3823b00e6b06 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1814,6 +1814,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -63,10 +63,10 @@ index 930e0bd987c48d111b2c8d71147c09e4418bda6c..9373a53c5cac879c689fcea77f1dbbb3
|
||||
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 773049b72e7784d396bb9cd1ebd29c3a523e7454..eccbcaf01b06d3c7613556d8f7617502c823e074 100644
|
||||
index cf4d2dcf86b6536c37d46875f74517e478b34928..b19976926137cae56094ec6e292a5014c2fd546b 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1261,6 +1261,9 @@ interface NetworkContext {
|
||||
@@ -1267,6 +1267,9 @@ interface NetworkContext {
|
||||
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
||||
NetworkConditions? conditions);
|
||||
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -62,10 +62,10 @@ index 2e657f24bb625c7a7af14686553aebdc06ad8eda..6f2384338ac4a48a78bc8aac8b4bb9d3
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
};
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index b5ed5d33890bf4f98237c92bbe642063d27d0092..82c1705ae0dbc7ac33eb90e7978d48c7de7f1c8f 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());
|
||||
|
||||
@@ -1,383 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <marshallofsound@electronjs.org>
|
||||
Date: Thu, 8 Aug 2024 08:39:10 -0700
|
||||
Subject: feat: allow usage of SCContentSharingPicker on supported platforms
|
||||
|
||||
This is implemented as a magic "window id" that instead of pulling an SCStream manually
|
||||
instead farms out to the screen picker.
|
||||
|
||||
diff --git a/content/browser/media/capture/desktop_capture_device_mac.cc b/content/browser/media/capture/desktop_capture_device_mac.cc
|
||||
index afb657b7c9e1ede1273532b16428d37cc5d75c59..16707cf516cd34682c84ea2ccebddaa0f84e01f8 100644
|
||||
--- a/content/browser/media/capture/desktop_capture_device_mac.cc
|
||||
+++ b/content/browser/media/capture/desktop_capture_device_mac.cc
|
||||
@@ -29,7 +29,7 @@ class DesktopCaptureDeviceMac : public IOSurfaceCaptureDeviceBase {
|
||||
~DesktopCaptureDeviceMac() override = default;
|
||||
|
||||
// IOSurfaceCaptureDeviceBase:
|
||||
- void OnStart() override {
|
||||
+ void OnStart(std::optional<bool> use_native_picker) override {
|
||||
requested_format_ = capture_params().requested_format;
|
||||
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 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(
|
||||
client_ = std::move(client);
|
||||
capture_params_ = params;
|
||||
|
||||
- OnStart();
|
||||
+ OnStart(params.use_native_picker);
|
||||
}
|
||||
|
||||
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 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
|
||||
~IOSurfaceCaptureDeviceBase() override;
|
||||
|
||||
// OnStart is called by AllocateAndStart.
|
||||
- virtual void OnStart() = 0;
|
||||
+ virtual void OnStart(std::optional<bool> use_native_picker) = 0;
|
||||
|
||||
// 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 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
|
||||
@@ -27,6 +27,61 @@
|
||||
std::optional<float>,
|
||||
bool)>;
|
||||
using ErrorCallback = base::RepeatingClosure;
|
||||
+using CancelCallback = base::RepeatingClosure;
|
||||
+
|
||||
+API_AVAILABLE(macos(15.0))
|
||||
+@interface ScreenCaptureKitPickerHelper
|
||||
+ : NSObject <SCContentSharingPickerObserver>
|
||||
+
|
||||
+- (void)contentSharingPicker:(SCContentSharingPicker *)picker
|
||||
+ didCancelForStream:(SCStream *)stream;
|
||||
+
|
||||
+- (void)contentSharingPicker:(SCContentSharingPicker *)picker
|
||||
+ didUpdateWithFilter:(SCContentFilter *)filter
|
||||
+ forStream:(SCStream *)stream;
|
||||
+
|
||||
+- (void)contentSharingPickerStartDidFailWithError:(NSError *)error;
|
||||
+
|
||||
+@end
|
||||
+
|
||||
+@implementation ScreenCaptureKitPickerHelper {
|
||||
+ base::RepeatingCallback<void(SCContentFilter *)> _pickerCallback;
|
||||
+ ErrorCallback _errorCallback;
|
||||
+ CancelCallback _cancelCallback;
|
||||
+}
|
||||
+
|
||||
+- (void)contentSharingPicker:(SCContentSharingPicker *)picker
|
||||
+ didCancelForStream:(SCStream *)stream {
|
||||
+ // TODO: This doesn't appear to be called on Apple's side;
|
||||
+ // implement this logic
|
||||
+ _cancelCallback.Run();
|
||||
+}
|
||||
+
|
||||
+- (void)contentSharingPicker:(SCContentSharingPicker *)picker
|
||||
+ didUpdateWithFilter:(SCContentFilter *)filter
|
||||
+ forStream:(SCStream *)stream {
|
||||
+ if (stream == nil) {
|
||||
+ _pickerCallback.Run(filter);
|
||||
+ [picker removeObserver:self];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+- (void)contentSharingPickerStartDidFailWithError:(NSError *)error {
|
||||
+ _errorCallback.Run();
|
||||
+}
|
||||
+
|
||||
+- (instancetype)initWithStreamPickCallback:(base::RepeatingCallback<void(SCContentFilter *)>)pickerCallback
|
||||
+ cancelCallback:(CancelCallback)cancelCallback
|
||||
+ errorCallback:(ErrorCallback)errorCallback {
|
||||
+ if (self = [super init]) {
|
||||
+ _pickerCallback = pickerCallback;
|
||||
+ _cancelCallback = cancelCallback;
|
||||
+ _errorCallback = errorCallback;
|
||||
+ }
|
||||
+ return self;
|
||||
+}
|
||||
+
|
||||
+@end
|
||||
|
||||
namespace {
|
||||
API_AVAILABLE(macos(12.3))
|
||||
@@ -123,18 +178,22 @@ @interface ScreenCaptureKitDeviceHelper
|
||||
: NSObject <SCStreamDelegate, SCStreamOutput>
|
||||
|
||||
- (instancetype)initWithSampleCallback:(SampleCallback)sampleCallback
|
||||
+ cancelCallback:(CancelCallback)cancelCallback
|
||||
errorCallback:(ErrorCallback)errorCallback;
|
||||
@end
|
||||
|
||||
@implementation ScreenCaptureKitDeviceHelper {
|
||||
SampleCallback _sampleCallback;
|
||||
+ CancelCallback _cancelCallback;
|
||||
ErrorCallback _errorCallback;
|
||||
}
|
||||
|
||||
- (instancetype)initWithSampleCallback:(SampleCallback)sampleCallback
|
||||
+ cancelCallback:(CancelCallback)cancelCallback
|
||||
errorCallback:(ErrorCallback)errorCallback {
|
||||
if (self = [super init]) {
|
||||
_sampleCallback = sampleCallback;
|
||||
+ _cancelCallback = cancelCallback;
|
||||
_errorCallback = errorCallback;
|
||||
}
|
||||
return self;
|
||||
@@ -211,29 +270,53 @@ + (SCStreamConfiguration*)streamConfigurationWithFrameSize:(gfx::Size)frameSize
|
||||
|
||||
class API_AVAILABLE(macos(12.3)) ScreenCaptureKitDeviceMac
|
||||
: public IOSurfaceCaptureDeviceBase,
|
||||
- public ScreenCaptureKitResetStreamInterface {
|
||||
+ public ScreenCaptureKitResetStreamInterface
|
||||
+ {
|
||||
public:
|
||||
explicit ScreenCaptureKitDeviceMac(const DesktopMediaID& source,
|
||||
- SCContentFilter* filter)
|
||||
+ [[maybe_unused]] SCContentFilter* filter)
|
||||
: source_(source),
|
||||
- filter_(filter),
|
||||
device_task_runner_(base::SingleThreadTaskRunner::GetCurrentDefault()) {
|
||||
SampleCallback sample_callback = base::BindPostTask(
|
||||
device_task_runner_,
|
||||
base::BindRepeating(&ScreenCaptureKitDeviceMac::OnStreamSample,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
+ CancelCallback cancel_callback = base::BindPostTask(
|
||||
+ device_task_runner_,
|
||||
+ base::BindRepeating(&ScreenCaptureKitDeviceMac::OnStreamError,
|
||||
+ weak_factory_.GetWeakPtr()));
|
||||
ErrorCallback error_callback = base::BindPostTask(
|
||||
device_task_runner_,
|
||||
base::BindRepeating(&ScreenCaptureKitDeviceMac::OnStreamError,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
helper_ = [[ScreenCaptureKitDeviceHelper alloc]
|
||||
initWithSampleCallback:sample_callback
|
||||
+ cancelCallback:cancel_callback
|
||||
errorCallback:error_callback];
|
||||
+
|
||||
+ if (@available(macOS 15.0, *)) {
|
||||
+ auto picker_callback = base::BindPostTask(
|
||||
+ device_task_runner_,
|
||||
+ base::BindRepeating(&ScreenCaptureKitDeviceMac::OnContentFilterReady, weak_factory_.GetWeakPtr())
|
||||
+ );
|
||||
+ picker_helper_ = [[ScreenCaptureKitPickerHelper alloc] initWithStreamPickCallback:picker_callback cancelCallback:cancel_callback errorCallback:error_callback];
|
||||
+ [[SCContentSharingPicker sharedPicker] addObserver:picker_helper_];
|
||||
+ }
|
||||
}
|
||||
ScreenCaptureKitDeviceMac(const ScreenCaptureKitDeviceMac&) = delete;
|
||||
ScreenCaptureKitDeviceMac& operator=(const ScreenCaptureKitDeviceMac&) =
|
||||
delete;
|
||||
- ~ScreenCaptureKitDeviceMac() override = default;
|
||||
+ ~ScreenCaptureKitDeviceMac() override {
|
||||
+ if (@available(macOS 15.0, *)) {
|
||||
+ auto* picker = [SCContentSharingPicker sharedPicker];
|
||||
+ ScreenCaptureKitDeviceMac::active_streams_--;
|
||||
+ picker.maximumStreamCount = @(ScreenCaptureKitDeviceMac::active_streams_);
|
||||
+ if (ScreenCaptureKitDeviceMac::active_streams_ == 0 && picker.active) {
|
||||
+ picker.active = false;
|
||||
+ [[SCContentSharingPicker sharedPicker] removeObserver:picker_helper_];
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
void OnShareableContentCreated(SCShareableContent* content) {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
@@ -301,7 +384,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
return;
|
||||
}
|
||||
|
||||
- if (@available(macOS 14.0, *)) {
|
||||
+ if (@available(macOS 15.0, *)) {
|
||||
// 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.
|
||||
@@ -310,6 +393,9 @@ void CreateStream(SCContentFilter* filter) {
|
||||
filter.contentRect.size.height * filter.pointPixelScale);
|
||||
}
|
||||
|
||||
+ OnContentFilterReady(filter);
|
||||
+ }
|
||||
+ void OnContentFilterReady(SCContentFilter* filter) {
|
||||
gfx::RectF dest_rect_in_frame;
|
||||
actual_capture_format_ = capture_params().requested_format;
|
||||
actual_capture_format_.pixel_format = media::PIXEL_FORMAT_NV12;
|
||||
@@ -323,6 +409,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
stream_ = [[SCStream alloc] initWithFilter:filter
|
||||
configuration:config
|
||||
delegate:helper_];
|
||||
+
|
||||
{
|
||||
NSError* error = nil;
|
||||
bool add_stream_output_result =
|
||||
@@ -480,7 +567,7 @@ void OnStreamError() {
|
||||
if (fullscreen_module_) {
|
||||
fullscreen_module_->Reset();
|
||||
}
|
||||
- OnStart();
|
||||
+ OnStart(std::nullopt);
|
||||
} else {
|
||||
client()->OnError(media::VideoCaptureError::kScreenCaptureKitStreamError,
|
||||
FROM_HERE, "Stream delegate called didStopWithError");
|
||||
@@ -503,23 +590,41 @@ void OnUpdateConfigurationError() {
|
||||
}
|
||||
|
||||
// IOSurfaceCaptureDeviceBase:
|
||||
- void OnStart() override {
|
||||
+ void OnStart(std::optional<bool> use_native_picker) override {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
- if (filter_) {
|
||||
- // SCContentSharingPicker is used where filter_ is set on creation.
|
||||
- CreateStream(filter_);
|
||||
- } else {
|
||||
- // Chrome picker is used.
|
||||
- auto content_callback = base::BindPostTask(
|
||||
- device_task_runner_,
|
||||
- base::BindRepeating(
|
||||
- &ScreenCaptureKitDeviceMac::OnShareableContentCreated,
|
||||
- weak_factory_.GetWeakPtr()));
|
||||
- auto handler = ^(SCShareableContent* content, NSError* error) {
|
||||
- content_callback.Run(content);
|
||||
- };
|
||||
- [SCShareableContent getShareableContentWithCompletionHandler:handler];
|
||||
+
|
||||
+ if (@available(macOS 15.0, *)) {
|
||||
+ constexpr bool DefaultUseNativePicker = true;
|
||||
+ if (use_native_picker.value_or(DefaultUseNativePicker) &&
|
||||
+ source_.id == DesktopMediaID::kMacOsNativePickerId &&
|
||||
+ source_.window_id < 0) {
|
||||
+ auto* picker = [SCContentSharingPicker sharedPicker];
|
||||
+ ScreenCaptureKitDeviceMac::active_streams_++;
|
||||
+ picker.maximumStreamCount = @(ScreenCaptureKitDeviceMac::active_streams_);
|
||||
+ if (!picker.active) {
|
||||
+ picker.active = true;
|
||||
+ }
|
||||
+ NSMutableArray<NSNumber*>* exclude_ns_windows = [NSMutableArray array];
|
||||
+ [[[[NSApplication sharedApplication] windows] filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSWindow* win, NSDictionary *bindings) {
|
||||
+ return [win sharingType] == NSWindowSharingNone;
|
||||
+ }]] enumerateObjectsUsingBlock:^(NSWindow* win, NSUInteger idx, BOOL *stop) {
|
||||
+ [exclude_ns_windows addObject:@([win windowNumber])];
|
||||
+ }];
|
||||
+ picker.defaultConfiguration.excludedWindowIDs = exclude_ns_windows;
|
||||
+ [picker present];
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ auto content_callback = base::BindPostTask(
|
||||
+ device_task_runner_,
|
||||
+ base::BindRepeating(
|
||||
+ &ScreenCaptureKitDeviceMac::OnShareableContentCreated,
|
||||
+ weak_factory_.GetWeakPtr()));
|
||||
+ auto handler = ^(SCShareableContent* content, NSError* error) {
|
||||
+ content_callback.Run(content);
|
||||
+ };
|
||||
+ [SCShareableContent getShareableContentWithCompletionHandler:handler];
|
||||
}
|
||||
void OnStop() override {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
@@ -577,8 +682,9 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
}
|
||||
|
||||
private:
|
||||
+ static int active_streams_;
|
||||
+
|
||||
const DesktopMediaID source_;
|
||||
- SCContentFilter* const filter_;
|
||||
const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
|
||||
|
||||
// The actual format of the video frames that are sent to `client`.
|
||||
@@ -594,6 +700,10 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
// Helper class that acts as output and delegate for `stream_`.
|
||||
ScreenCaptureKitDeviceHelper* __strong helper_;
|
||||
|
||||
+ // Helper class that acts as an observer for SCContentSharingPicker
|
||||
+ API_AVAILABLE(macos(15.0))
|
||||
+ ScreenCaptureKitPickerHelper* __strong picker_helper_;
|
||||
+
|
||||
// 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_;
|
||||
@@ -606,6 +716,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
base::WeakPtrFactory<ScreenCaptureKitDeviceMac> weak_factory_{this};
|
||||
};
|
||||
|
||||
+int ScreenCaptureKitDeviceMac::active_streams_ = 0;
|
||||
+
|
||||
} // namespace
|
||||
|
||||
// Although ScreenCaptureKit is available in 12.3 there were some bugs that
|
||||
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 0ab684dc8e792359abb90b91917eddae42e6123d..f0f08a834f06c7669da6030640434308a5cbd056 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
|
||||
@@ -316,8 +316,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
break;
|
||||
}
|
||||
|
||||
+#if defined(USE_AURA)
|
||||
+ bool allow_window_id = false;
|
||||
+#elif BUILDFLAG(IS_MAC)
|
||||
+ bool allow_window_id =
|
||||
+ desktop_id.id == DesktopMediaID::kMacOsNativePickerId;
|
||||
+#endif
|
||||
+
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
- if (desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
+ if (!allow_window_id &&
|
||||
+ desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
// 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.
|
||||
@@ -333,13 +341,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
}
|
||||
#endif // defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
|
||||
+ media::VideoCaptureParams updated_params = params;
|
||||
+ updated_params.use_native_picker = stream_type != blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE;
|
||||
// All cases other than tab capture or Aura desktop/window capture.
|
||||
TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("video_and_image_capture"),
|
||||
"UsingDesktopCapturer", TRACE_EVENT_SCOPE_THREAD);
|
||||
start_capture_closure = base::BindOnce(
|
||||
&InProcessVideoCaptureDeviceLauncher::
|
||||
DoStartDesktopCaptureOnDeviceThread,
|
||||
- base::Unretained(this), desktop_id, params,
|
||||
+ base::Unretained(this), desktop_id, updated_params,
|
||||
CreateDeviceClient(media::VideoCaptureBufferType::kSharedMemory,
|
||||
kMaxNumberOfBuffers, std::move(receiver),
|
||||
std::move(receiver_on_io_thread)),
|
||||
diff --git a/content/public/browser/desktop_media_id.h b/content/public/browser/desktop_media_id.h
|
||||
index 415156d403a59bf426cf4561a9d58ecdb27524b4..78aa7b2359c684d5305bf6352751dfbb7ca00d29 100644
|
||||
--- a/content/public/browser/desktop_media_id.h
|
||||
+++ b/content/public/browser/desktop_media_id.h
|
||||
@@ -27,6 +27,8 @@ struct CONTENT_EXPORT DesktopMediaID {
|
||||
static constexpr Id kNullId = 0;
|
||||
// Represents a fake id to create a dummy capturer for autotests.
|
||||
static constexpr Id kFakeId = -3;
|
||||
+ // Represents an id to use native macOS picker for screenshare
|
||||
+ static constexpr Id kMacOsNativePickerId = -4;
|
||||
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
// Assigns integer identifier to the |window| and returns its DesktopMediaID.
|
||||
diff --git a/media/capture/video_capture_types.h b/media/capture/video_capture_types.h
|
||||
index 53e8077c9c0b635df0abdeca43fa9a6373c68252..2805e36cc42190d8197d83f5df235094570e3d5d 100644
|
||||
--- a/media/capture/video_capture_types.h
|
||||
+++ b/media/capture/video_capture_types.h
|
||||
@@ -355,6 +355,8 @@ struct CAPTURE_EXPORT VideoCaptureParams {
|
||||
// Flag indicating whether HiDPI mode should be enabled for tab capture
|
||||
// sessions.
|
||||
bool is_high_dpi_enabled = true;
|
||||
+
|
||||
+ std::optional<bool> use_native_picker;
|
||||
};
|
||||
|
||||
CAPTURE_EXPORT std::ostream& operator<<(
|
||||
@@ -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 e7ba8edf2b6e2228bc142bb164c9cd5a147ce5ad..a278a3eca9eedf53ca3878fc8c41d42de3a1b708 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 d0ea177f54b8db8837840e22f5cdb6b64a0c9605..94e4a27fefff406e1d09e7867c0e84e43e6027cf 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 d0ea177f54b8db8837840e22f5cdb6b64a0c9605..94e4a27fefff406e1d09e7867c0e84e4
|
||||
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.
|
||||
|
||||
@@ -37,7 +37,7 @@ index b60fd23a39eb423450b57275526ac4ba36058225..deafb4cd5a55853eb11a1371ca8331ee
|
||||
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 6430943ce0a4817d2806f701ef39b4263648ce6e..4b8eddb96f739e86cb35f7bfe2d9742de8dcecda 100644
|
||||
index b87bb47d4d51f734ee3dc1e38158726795fcd19e..dd862ff8c43ecbc08467bf2b49ed5044d92ad3f3 100644
|
||||
--- a/services/network/public/cpp/resource_request.h
|
||||
+++ b/services/network/public/cpp/resource_request.h
|
||||
@@ -77,6 +77,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
@@ -49,7 +49,7 @@ index 6430943ce0a4817d2806f701ef39b4263648ce6e..4b8eddb96f739e86cb35f7bfe2d9742d
|
||||
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 33f4def7593dac366034b5a8e83b5079a726f4b7..cd83b5d95099af724d1d04642cad313905c5d3a1 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
|
||||
@@ -49,6 +49,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
|
||||
@@ -61,7 +61,7 @@ index 33f4def7593dac366034b5a8e83b5079a726f4b7..cd83b5d95099af724d1d04642cad3139
|
||||
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 cdf5283b5b3e58f77f37e9501d2b867493fa6cf7..86e41493fcffb0d9fc9b4306714b910e2f2963e0 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
|
||||
@@ -71,6 +71,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
@@ -76,7 +76,7 @@ index cdf5283b5b3e58f77f37e9501d2b867493fa6cf7..86e41493fcffb0d9fc9b4306714b910e
|
||||
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 8fae9662ac05c94dc3545a125cb5e838664c97c2..5abf38ed936163b14a4bfd613728f03f1494c6df 100644
|
||||
index eb5ca6401eec0ff1d6a897ea86ca2a1a252f86ec..caedd3dfde37dd136721429f90799e0493ab0a9d 100644
|
||||
--- a/services/network/public/mojom/url_request.mojom
|
||||
+++ b/services/network/public/mojom/url_request.mojom
|
||||
@@ -74,6 +74,9 @@ struct TrustedUrlRequestParams {
|
||||
@@ -90,7 +90,7 @@ index 8fae9662ac05c94dc3545a125cb5e838664c97c2..5abf38ed936163b14a4bfd613728f03f
|
||||
// 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 d11d199c44c1f4d72765714d772066d4a36ad8e2..3d5c61726679cedfc6d9e9587eaedfe4ada2f1f9 100644
|
||||
index c5f551ca79ecfb80a3c29b901d44a83d082a6da6..bae9c2c10d240a8691787d6e52190b13575df020 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -667,6 +667,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 d11d199c44c1f4d72765714d772066d4a36ad8e2..3d5c61726679cedfc6d9e9587eaedfe4
|
||||
devtools_request_id_(request.devtools_request_id),
|
||||
options_(PopulateOptions(options,
|
||||
factory_params_->is_orb_enabled,
|
||||
@@ -964,7 +967,7 @@ void URLLoader::ConfigureRequest(
|
||||
@@ -970,7 +973,7 @@ void URLLoader::ConfigureRequest(
|
||||
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ index d11d199c44c1f4d72765714d772066d4a36ad8e2..3d5c61726679cedfc6d9e9587eaedfe4
|
||||
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 d11d199c44c1f4d72765714d772066d4a36ad8e2..3d5c61726679cedfc6d9e9587eaedfe4
|
||||
|
||||
// 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 c45d947ad9059df5694eccd2c20774248e951c6f..d4d37eb83fcae5145922346db8d7200ddd33002d 100644
|
||||
index 06b9d01648881d1b955cc6db195a658811e47e84..730fd3ef9f95ba634b43856d432c072962d6000e 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -711,6 +711,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_;
|
||||
|
||||
|
||||
@@ -0,0 +1,737 @@
|
||||
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 7e17594c30ac3cf8cb484b53563b03fc75bd2e0b..fef50841f472bf3e76c171d9e106c689157adaae 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -281,6 +281,7 @@ void OnShareableContentCreated(SCShareableContent* content) {
|
||||
if (!fullscreen_module_) {
|
||||
fullscreen_module_ = MaybeCreateScreenCaptureKitFullscreenModule(
|
||||
device_task_runner_, *this, window);
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -616,6 +617,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 0ab684dc8e792359abb90b91917eddae42e6123d..2351919905fbec6c1bfe9ce59d799192a9e2e0e6 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;
|
||||
@@ -316,8 +326,21 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
break;
|
||||
}
|
||||
|
||||
+#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)
|
||||
- if (desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
+ 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.
|
||||
@@ -344,6 +367,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)
|
||||
@@ -358,6 +382,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
|
||||
}
|
||||
@@ -408,9 +433,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(
|
||||
@@ -429,13 +456,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();
|
||||
@@ -495,7 +524,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 =
|
||||
@@ -504,8 +534,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 d68fd93d4cb912b9b27d3a7cdfecc6faf638b91e..22ed43bdf4dbaccc598135807abc8383c52db50e 100644
|
||||
index 3d8a590aacd3a65d5a19004dc11e770b31a0f614..64dd7b6e507b61fab7a044823462fb04eabba698 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -934,13 +934,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
@@ -941,13 +941,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
|
||||
void HWNDMessageHandler::PaintAsActiveChanged() {
|
||||
if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
|
||||
@@ -33,7 +33,7 @@ index d68fd93d4cb912b9b27d3a7cdfecc6faf638b91e..22ed43bdf4dbaccc598135807abc8383
|
||||
}
|
||||
|
||||
void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
|
||||
@@ -2329,17 +2329,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
||||
@@ -2337,17 +2337,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
||||
delegate_->SchedulePaint();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 d1146216b6969562876a318586420636331f63d1..7f29d902ae0a2f980a56e77e6e25935dab3c0685 100644
|
||||
index adade58a533c373087d8c51a5744e8f118ba6e9d..3a60e310d1c4048f0e37e085c97b8dfc093aefda 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3749,15 +3749,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 0bd3df72a9a5f127cb8215ab4182e143ca99548d..f8b00313490e898c0d70667b996b3e66a0063c4b 100644
|
||||
index 4f7e3cd70d45dd9d0d67b6a39a5dac59af9b95af..a8a0bedfc14cd475ff112e5ff07e137ec4219662 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -11059,6 +11059,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
@@ -11068,6 +11068,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
"blob");
|
||||
}
|
||||
|
||||
|
||||
130
patches/chromium/fix_debug_desktop_capturer_picture.patch
Normal file
130
patches/chromium/fix_debug_desktop_capturer_picture.patch
Normal file
@@ -0,0 +1,130 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Keeley Hammond <khammond@slack-corp.com>
|
||||
Date: Tue, 15 Apr 2025 16:34:52 -0700
|
||||
Subject: fix: debug desktop capturer picture
|
||||
|
||||
|
||||
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 fef50841f472bf3e76c171d9e106c689157adaae..1e9ffc1e097439eea731e2cff6193c5f50c984d8 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -286,6 +286,25 @@ void OnShareableContentCreated(SCShareableContent* content) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
+ case DesktopMediaID::TYPE_NONE:
|
||||
+ for (SCWindow* window in content.windows) {
|
||||
+ LOG(ERROR) << "Inside TYPE_NONE for loop";
|
||||
+ LOG(ERROR) << "source_.id: " << source_.id;
|
||||
+ LOG(ERROR) << "window.windowID: " << window.windowID;
|
||||
+ if (source_.id == window.windowID) {
|
||||
+ LOG(ERROR) << "window.windowID: " << window.windowID;
|
||||
+ filter = [[SCContentFilter alloc]
|
||||
+ initWithDesktopIndependentWindow:window];
|
||||
+ CGRect frame = window.frame;
|
||||
+ stream_config_content_size_ = gfx::Size(frame.size);
|
||||
+ if (!fullscreen_module_) {
|
||||
+ fullscreen_module_ = MaybeCreateScreenCaptureKitFullscreenModule(
|
||||
+ device_task_runner_, *this, window);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
}
|
||||
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 2351919905fbec6c1bfe9ce59d799192a9e2e0e6..aa97cad0ca0fecc8dfc1ee44760ab1d36086785c 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
|
||||
@@ -104,6 +104,7 @@ void IncrementDesktopCaptureCounters(const DesktopMediaID& device_id) {
|
||||
: SCREEN_CAPTURER_CREATED_WITHOUT_AUDIO);
|
||||
break;
|
||||
case DesktopMediaID::TYPE_WINDOW:
|
||||
+ case DesktopMediaID::TYPE_NONE:
|
||||
IncrementDesktopCaptureCounter(WINDOW_CAPTURER_CREATED);
|
||||
break;
|
||||
case DesktopMediaID::TYPE_WEB_CONTENTS:
|
||||
@@ -112,8 +113,8 @@ void IncrementDesktopCaptureCounters(const DesktopMediaID& device_id) {
|
||||
device_id.audio_share ? TAB_VIDEO_CAPTURER_CREATED_WITH_AUDIO
|
||||
: TAB_VIDEO_CAPTURER_CREATED_WITHOUT_AUDIO);
|
||||
break;
|
||||
- case DesktopMediaID::TYPE_NONE:
|
||||
- NOTREACHED();
|
||||
+ // case DesktopMediaID::TYPE_NONE:
|
||||
+ // NOTREACHED();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,13 +286,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
const DesktopMediaID desktop_id = DesktopMediaID::Parse(device_id);
|
||||
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;
|
||||
- }
|
||||
+ // TODO(Keeley): kMacOsNativePickerId seems to have been removed upstream.
|
||||
+ // Reconcile this with the upstream changes.
|
||||
+ // 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;
|
||||
+ // }
|
||||
|
||||
if (desktop_id.id == DesktopMediaID::kFakeId) {
|
||||
start_capture_closure = base::BindOnce(
|
||||
@@ -329,18 +332,16 @@ 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;
|
||||
+ // 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;
|
||||
+ // if (!allow_window_id &&
|
||||
+ // desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
+ if (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.
|
||||
@@ -525,7 +526,7 @@ void InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread(
|
||||
ReceiveDeviceCallback result_callback) {
|
||||
DCHECK(device_task_runner_->BelongsToCurrentThread());
|
||||
LOG(INFO) << "DO START DESKTOP CAPTURE ON DEVICE THREAD " << desktop_id.id;
|
||||
- DCHECK(!desktop_id.is_null() || desktop_id.id == DesktopMediaID::kMacOsNativePickerId);
|
||||
+ // DCHECK(!desktop_id.is_null() || desktop_id.id == DesktopMediaID::kMacOsNativePickerId);
|
||||
|
||||
std::unique_ptr<media::VideoCaptureDevice> video_capture_device;
|
||||
DesktopCaptureImplementation implementation =
|
||||
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
|
||||
index bd11a0fcdc084da00407c80e4ee229a130fdedc8..74d9ce9facea9cda90073ca6b70e8c4be3b62f6f 100644
|
||||
--- a/content/browser/renderer_host/media/video_capture_manager.cc
|
||||
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
|
||||
@@ -920,6 +920,8 @@ void VideoCaptureManager::DestroyControllerIfNoClients(
|
||||
// closed.
|
||||
CloseNativeScreenCapturePicker(
|
||||
DesktopMediaID::Parse(controller->device_id()));
|
||||
+ LOG(ERROR) << "Closing native screen capture picker";
|
||||
+ LOG(ERROR) << "VideoCaptureManager: " << string_stream.str();
|
||||
|
||||
// The VideoCaptureController is removed from |controllers_| immediately.
|
||||
// The controller is deleted immediately, and the device is freed
|
||||
@@ -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
|
||||
@@ -87,10 +87,10 @@ index 75df43e3cd2721a92c90c18154d53d5c203e2465..ce42c75c8face36d21f53f44c0201ac4
|
||||
// The view with active text input state, i.e., a focused <input> element.
|
||||
// It will be nullptr if no such view exists. Note that the active view
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 6f323c5863f4bb869a66d265fac1d372c5243187..a16c2368a4e37756642544c45d3e4b1fe7d64b26 100644
|
||||
index c3b563b0b727bc35f6d4499c589110644ebe9cd1..6010d9f9fc9bfeffb3e5a64de7352b52a202cbf7 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9768,7 +9768,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 ad844f4d6d150aee3e00fd6465600bfb248d79d2..d68fd93d4cb912b9b27d3a7cdfecc6faf638b91e 100644
|
||||
index 8fe48c9bef144218e34434d563883b15733d03bc..3d8a590aacd3a65d5a19004dc11e770b31a0f614 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -1788,7 +1788,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);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ 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 e46e5eb74c54bc00ead6e2e4eff99fd500e09262..c07ffdb0ae8b275a72d789e9091a807362379474 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
|
||||
@@ -2114,9 +2114,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
|
||||
|
||||
@@ -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 feb30ced77cfc7d0a1faa637cd8bdec399155504..6137dc5905604e4309466dd82b2d2fe31e5cd6a7 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
|
||||
@@ -3097,6 +3097,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 feb30ced77cfc7d0a1faa637cd8bdec399155504..6137dc5905604e4309466dd82b2d2fe3
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_behavior) {
|
||||
@@ -3129,7 +3130,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,7 +80,7 @@ index feb30ced77cfc7d0a1faa637cd8bdec399155504..6137dc5905604e4309466dd82b2d2fe3
|
||||
|
||||
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 80006535d1b7a7bfff69ebc46a1d9f70ee8c609d..842aa5f37e5f09235969b8510d4aa914e385d1ad 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
|
||||
@@ -815,6 +815,7 @@ class CORE_EXPORT LocalFrame final
|
||||
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ 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 22ed43bdf4dbaccc598135807abc8383c52db50e..c5457e3e58b53ca04697b22a885da654c6c0655f 100644
|
||||
index 64dd7b6e507b61fab7a044823462fb04eabba698..2cd734db007174834c70365ffe6b46d52673e5cb 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -676,7 +676,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
@@ -683,7 +683,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
SetWindowPlacement(hwnd(), &placement);
|
||||
native_show_state = SW_SHOWMAXIMIZED;
|
||||
} else {
|
||||
@@ -32,7 +32,7 @@ index 22ed43bdf4dbaccc598135807abc8383c52db50e..c5457e3e58b53ca04697b22a885da654
|
||||
|
||||
// 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.
|
||||
@@ -686,7 +687,8 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
@@ -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:
|
||||
@@ -42,7 +42,7 @@ index 22ed43bdf4dbaccc598135807abc8383c52db50e..c5457e3e58b53ca04697b22a885da654
|
||||
break;
|
||||
case ui::mojom::WindowShowState::kMaximized:
|
||||
native_show_state = SW_SHOWMAXIMIZED;
|
||||
@@ -697,9 +699,11 @@ void HWNDMessageHandler::Show(ui::mojom::WindowShowState show_state,
|
||||
@@ -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)) {
|
||||
|
||||
@@ -20,7 +20,7 @@ index e9f000ae316ac64cd23827f1533ec1416b3ed040..c3fb6dbd8f4c39e1087be567f6a2c2df
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index faf574d7778e24d6fc9e3f539b39c9cb1c149bbc..ff3255b51e73aea4ec47cc30dfc0032de474ec06 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 {
|
||||
|
||||
@@ -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 dd7c5df4907dd369ff4df8f5d7286f83674f74f3..9215843a93e795123fd97848bcb2507f0960ed12 100644
|
||||
index 77707df02c02ba2ffd66ac280d53479993498fff..acc783a27d84465b81b8aef8b6f151a9ad5f0669 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -1476,6 +1476,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,7 +11,7 @@ Bug: N/A
|
||||
Change-Id: I9fc472212b2d3afac2c8e18a2159bc2d50bbdf98
|
||||
|
||||
diff --git a/AUTHORS b/AUTHORS
|
||||
index 143ea35ef1591719589fa9a750177c7bae526fec..5883c4d63181be3bc95ee3ddbb0e33fb935e070b 100644
|
||||
index b55c6916e97a7c8e317145f5239a34d8abca810e..dbd924a91a8fca8ff9d85bf6addcdb5a7b17ca3a 100644
|
||||
--- a/AUTHORS
|
||||
+++ b/AUTHORS
|
||||
@@ -341,6 +341,7 @@ David Futcher <david.mike.futcher@gmail.com>
|
||||
|
||||
@@ -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 998d8906b6bd33f48199dc5a67bbd149742eb561..90015e0be79e850a9225263e90b662fa3fbe005f 100644
|
||||
index 6bf37c804ddb77a28e788af02bb215970ba343c8..4bf9d4050c44dd155b3455082c8b87afa30e9ac7 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1031,6 +1031,7 @@ component("base") {
|
||||
@@ -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 9145261d8c3350e3df8844bf4109d9fda7b6ed46..b83c0faf8a6d4898e382d989348c8035086d0510 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 9145261d8c3350e3df8844bf4109d9fda7b6ed46..b83c0faf8a6d4898e382d989348c8035
|
||||
#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_);
|
||||
|
||||
@@ -579,7 +579,7 @@ index b712b8af0e770aa3acbeb1167b1a20bc1547c98a..fdb476a7e470c4b32649d4b3b7e4e445
|
||||
return kAttributes;
|
||||
}
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 2413228f605776322caff19098c6b60183005df5..b392e1ee627c982c4c0b099a6b6ea8a9e698b601 100644
|
||||
index 4424636d013725023c2bf35529c034adecf823b1..62151d9e640771580ae85231762dfef260b0e4ff 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -339,6 +339,7 @@ source_set("browser") {
|
||||
@@ -792,7 +792,7 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
index 482a1721cb2157f0221c901423423aab37efdaf0..b736432543ab619af6483070895f8968248fd71f 100644
|
||||
index 1163dd9e0d25b74fbdc584f742392a4452008724..246c50d5f05ecbf4f57dfc8f3bd68db03fe131f7 100644
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -658,6 +658,7 @@ static_library("test_support") {
|
||||
@@ -819,7 +819,7 @@ index 482a1721cb2157f0221c901423423aab37efdaf0..b736432543ab619af6483070895f8968
|
||||
]
|
||||
|
||||
if (!(is_chromeos && target_cpu == "arm64" && current_cpu == "arm")) {
|
||||
@@ -3263,6 +3266,7 @@ test("content_unittests") {
|
||||
@@ -3264,6 +3267,7 @@ test("content_unittests") {
|
||||
"//ui/shell_dialogs:shell_dialogs",
|
||||
"//ui/webui:test_support",
|
||||
"//url",
|
||||
@@ -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") {
|
||||
@@ -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",
|
||||
@@ -1591,7 +1591,7 @@ index 8b25953be73da43fa2e0b5957569ae481dc6a082..7f9175e7eb67ef27fe110ee72f5e9c88
|
||||
|
||||
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 @@
|
||||
|
||||
@@ -7,7 +7,7 @@ This adds a callback from the network service that's used to implement
|
||||
session.setCertificateVerifyCallback.
|
||||
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 8529c98678d7a671cea947a864d0c13e031a153a..771fee7092bb25e4f7546941a04647d060e966c2 100644
|
||||
index b9a14ef983f6c985fefeee342eddfdf3f0a24a84..b1df0a09a9bfd226ffe7b37144e6599b099e619e 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -159,6 +159,11 @@
|
||||
@@ -136,7 +136,7 @@ index 8529c98678d7a671cea947a864d0c13e031a153a..771fee7092bb25e4f7546941a04647d0
|
||||
void NetworkContext::CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) {
|
||||
@@ -2617,6 +2722,10 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -2618,6 +2723,10 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
cert_verifier = std::make_unique<net::CachingCertVerifier>(
|
||||
std::make_unique<net::CoalescingCertVerifier>(
|
||||
std::move(cert_verifier)));
|
||||
@@ -178,7 +178,7 @@ index f2dcec57a22d95892a08f1fa43696d6eea46a820..930e0bd987c48d111b2c8d71147c09e4
|
||||
std::unique_ptr<HostResolver> internal_host_resolver_;
|
||||
std::set<std::unique_ptr<HostResolver>, base::UniquePtrComparator>
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 5cfbf71f644b391009d533132621a4ece224bfd3..773049b72e7784d396bb9cd1ebd29c3a523e7454 100644
|
||||
index 0f053267c23795be6bb0e75d10a92e1777532484..cf4d2dcf86b6536c37d46875f74517e478b34928 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -308,6 +308,17 @@ struct SocketBrokerRemotes {
|
||||
@@ -199,7 +199,7 @@ index 5cfbf71f644b391009d533132621a4ece224bfd3..773049b72e7784d396bb9cd1ebd29c3a
|
||||
// Parameters for constructing a network context.
|
||||
struct NetworkContextParams {
|
||||
// The user agent string.
|
||||
@@ -939,6 +950,9 @@ interface NetworkContext {
|
||||
@@ -945,6 +956,9 @@ interface NetworkContext {
|
||||
// Sets a client for this network context.
|
||||
SetClient(pending_remote<NetworkContextClient> client);
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ index 05d3a12dd84c7005d46cc73b312f97ef418d96f5..4765de982802541b3efc7211d106acc7
|
||||
const GURL& document_url,
|
||||
const WeakDocumentPtr& weak_document_ptr,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 5a13f11b6007eb87c59c5bdfaa02d1ab8f27a15e..c7025b0e43bcc9dd1e4b89dac39b5440e1a6ee30 100644
|
||||
index a8e3f365d2e9c72f9ae46388dc5b12ad57887b6b..bf18683a08e1c144b360f904ab65adcab66aa607 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2146,7 +2146,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
|
||||
@@ -10,7 +10,7 @@ an about:blank check to this area.
|
||||
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 4ffe6251a941cb51b60a5d19fd6307b011a49f39..6f3d5528c289444c16691ea42a00b87f6f7faeaa 100644
|
||||
index 5de5748662c957f5b0e671057b827e2eb2224893..72ebb0e18dbc8c678ff93c7a3c028d7fb362263f 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -806,8 +806,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch(
|
||||
|
||||
@@ -881,10 +881,10 @@ index 97cb6458bc9eec767db89b56abfc5f4b4136ff7b..d9a0b343158b8464b5c9aa8e0e655c0b
|
||||
ScriptingThrottler scripting_throttler_;
|
||||
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index b392e1ee627c982c4c0b099a6b6ea8a9e698b601..a2e944cb987f739d75428649793e622400ed0213 100644
|
||||
index 62151d9e640771580ae85231762dfef260b0e4ff..52555181f779772dff8a471c4389af8128fd7a6a 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -3123,8 +3123,9 @@ source_set("browser") {
|
||||
@@ -3129,8 +3129,9 @@ source_set("browser") {
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ index 8ad5a5042355ce918ab13784fbc0d633b6f0efa9..7f7b86abf3e18501025a854000f0d9ad
|
||||
// RenderWidgetHost on the primary main frame, and false otherwise.
|
||||
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index f13799f1cc440a20d8e3c55ee35f64e6505e5590..e46e5eb74c54bc00ead6e2e4eff99fd500e09262 100644
|
||||
index a409c64768968c81be3b6c7e7646f8df26e2afe6..7c31b82e2903507bb69aaa71fc0ed51cad06d1c2 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2048,6 +2048,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
|
||||
@@ -44,7 +44,7 @@ index f13799f1cc440a20d8e3c55ee35f64e6505e5590..e46e5eb74c54bc00ead6e2e4eff99fd5
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 60ed731f7648497d62fbc7b43181a47a82743c4b..e84ef165670048dd2f030a48ff2d9796b5170b52 100644
|
||||
index e500fe77f55836b3e5832536f98cf9581984b8c1..952fd20f71560acd89c74f08e9d8cdbf34fb5a1a 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5810,6 +5810,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
|
||||
@@ -8,7 +8,7 @@ it in Electron and prevent drift from Chrome's blocklist. We should look for a w
|
||||
to upstream this change to Chrome.
|
||||
|
||||
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
|
||||
index 7d5813ad07169f2f779846c4541101eac376aa4c..21e17ef542a89a9829ca4583da760fb6b1c59836 100644
|
||||
index f08ff195ede9980cd0f491053510ed09c1b6c58a..2bdfcc05ef92c1983a9517deea98ed589ac0a065 100644
|
||||
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
|
||||
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
|
||||
@@ -45,7 +45,6 @@
|
||||
|
||||
@@ -15,10 +15,10 @@ This CL removes these filters so the unresponsive event can still be
|
||||
accessed from our JS event. The filtering is moved into Electron's code.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index f3d223efcfa8f909e810ec43dd5ef90c9fc5c620..c48f9c00f129d1373ce64d33f83ce7a634433622 100644
|
||||
index 4325cdfd256ae7a1008e073d42da995b82df5bba..b895fb34f7fe7d48613a972dc29039c7d9c26987 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9905,25 +9905,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
@@ -9909,25 +9909,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
base::RepeatingClosure hang_monitor_restarter) {
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
|
||||
"render_widget_host", render_widget_host);
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: scroll_bounce_flag.patch
|
||||
Patch to make scrollBounce option work.
|
||||
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
index 86399ed26f1ba6808d1f7bb0b1d7649df9da8901..b05f83c47f138f7040a175cc46dba99dcf054765 100644
|
||||
index e5701fe6ddcf8b9d846373d331e91e705870e523..a64b6d00637a177fd4f6d66b236bed9b0d8d4d8c 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1310,7 +1310,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
|
||||
@@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index c7025b0e43bcc9dd1e4b89dac39b5440e1a6ee30..30a3715e3dfa76e68d9a75742b1d085ec32a3fc3 100644
|
||||
index bf18683a08e1c144b360f904ab65adcab66aa607..829a0c2f09490099bb58ece6a41995e3fe3d6c81 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1754,6 +1754,10 @@ bool RenderProcessHostImpl::Init() {
|
||||
|
||||
@@ -9,7 +9,7 @@ is needed for OSR.
|
||||
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 591c87ffc5f56b38d0f329da8b983a77af9662ee..b139a13c80eb9d356c78c587f823a4cb8452abe9 100644
|
||||
index 59b05937ceb1b81b69d913f587150021b9031106..97512399db631236afd1aeafb1ecee97cb754f60 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3882,6 +3882,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
|
||||
@@ -15,10 +15,10 @@ Note that we also need to manually update embedder's
|
||||
`api::WebContents::IsFullscreenForTabOrPending` value.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 37af686964489bd77d84be95d5f3aba9cd0a7a0c..4ffe6251a941cb51b60a5d19fd6307b011a49f39 100644
|
||||
index 27db5dbfd05106788feda9daab9d1aaaf1ae920f..5de5748662c957f5b0e671057b827e2eb2224893 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8739,6 +8739,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -8745,6 +8745,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ index 37af686964489bd77d84be95d5f3aba9cd0a7a0c..4ffe6251a941cb51b60a5d19fd6307b0
|
||||
if (had_fullscreen_token && !GetView()->HasFocus())
|
||||
GetView()->Focus();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index b139a13c80eb9d356c78c587f823a4cb8452abe9..6f323c5863f4bb869a66d265fac1d372c5243187 100644
|
||||
index 97512399db631236afd1aeafb1ecee97cb754f60..c3b563b0b727bc35f6d4499c589110644ebe9cd1 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4157,21 +4157,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -88,7 +88,7 @@ index b139a13c80eb9d356c78c587f823a4cb8452abe9..6f323c5863f4bb869a66d265fac1d372
|
||||
features::kAutomaticFullscreenContentSetting)) {
|
||||
// Ensure the window is made active to take input focus. The user may have
|
||||
diff --git a/third_party/blink/renderer/core/fullscreen/fullscreen.cc b/third_party/blink/renderer/core/fullscreen/fullscreen.cc
|
||||
index 983f8a795725a097adf4e13f7d9c24b7c16d3467..75f1b9b60460713da6d832a803cfc03d7c90c9ca 100644
|
||||
index 0a37c1f1eb49023a4a209e9664e0fadadb97e297..76c52a0528a100787b83ccd76f552f98216a5aaa 100644
|
||||
--- a/third_party/blink/renderer/core/fullscreen/fullscreen.cc
|
||||
+++ b/third_party/blink/renderer/core/fullscreen/fullscreen.cc
|
||||
@@ -110,7 +110,7 @@ void FullscreenElementChanged(Document& document,
|
||||
|
||||
@@ -26,10 +26,10 @@ index 7a2d251ba2d13d0a34df176111e6524a27b87f55..cbbe0fbdd25a0f7859b113fdb3dcd9ce
|
||||
// An empty URL is returned if the URL is not overriden.
|
||||
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index 4b9fce8429d10cd002017128645ae8a54cd1f088..8ea2df6c0b543dec1309531573d2277b94353923 100644
|
||||
index d912ff1b05e9fe5c4d8edf1f681fc824b6f2d38a..92c28a027ebd10a3bb8a864231b237908fbf7394 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -897,6 +897,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
@@ -906,6 +906,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ index 4b9fce8429d10cd002017128645ae8a54cd1f088..8ea2df6c0b543dec1309531573d2277b
|
||||
const v8::Local<v8::Context>& worker) {
|
||||
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index f726c03e34578032f5fc6c9a914ba72858efce89..9c5eeba6e24bb53fc112082c198a103256b06e32 100644
|
||||
index b6d525fb400ae27e04967c9b1b197e01f4a21123..5daf30bfb5cfc27148aa5f0d784ee8348c577dbf 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -196,6 +196,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -198,6 +198,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
|
||||
@@ -35,10 +35,10 @@ index cbbe0fbdd25a0f7859b113fdb3dcd9ce57e597d6..1345bb5008e1b4fc3a450f7e353d52ec
|
||||
// from the worker thread.
|
||||
virtual void WillDestroyWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index 8ea2df6c0b543dec1309531573d2277b94353923..3ac2e0783f9a7ab65d89352bf03e68f3b83c64b9 100644
|
||||
index 92c28a027ebd10a3bb8a864231b237908fbf7394..21ac02b10b698b943feb982743c09d4f1107c437 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -909,6 +909,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
|
||||
@@ -918,6 +918,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
|
||||
worker);
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ index 8ea2df6c0b543dec1309531573d2277b94353923..3ac2e0783f9a7ab65d89352bf03e68f3
|
||||
const blink::WebSecurityOrigin& script_origin) {
|
||||
return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index 9c5eeba6e24bb53fc112082c198a103256b06e32..fad9cf104d62d4e19a2b27eff54d17f908357b41 100644
|
||||
index 5daf30bfb5cfc27148aa5f0d784ee8348c577dbf..182d574f14a679707e824e82bb4feeb4ee68de90 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -196,6 +196,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -198,6 +198,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
|
||||
@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
|
||||
patching legacy devtools code.
|
||||
|
||||
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
|
||||
index 117f738fa274ffdb79e1666a5de322fb163d19b8..d8f512c9b4284571bc96285a64f8d0faf1826c52 100644
|
||||
index 75d54b60cb265eef90a493295dd9d495f8327b7c..2d98c8470115b70bda7d728ff4c00d2282159913 100644
|
||||
--- a/front_end/entrypoints/main/MainImpl.ts
|
||||
+++ b/front_end/entrypoints/main/MainImpl.ts
|
||||
@@ -760,6 +760,8 @@ export class MainImpl {
|
||||
@@ -761,6 +761,8 @@ export class MainImpl {
|
||||
globalThis.Main = globalThis.Main || {};
|
||||
// @ts-expect-error Exported for Tests.js
|
||||
globalThis.Main.Main = MainImpl;
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
chore_allow_customizing_microtask_policy_per_context.patch
|
||||
deps_add_v8_object_setinternalfieldfornodecore.patch
|
||||
revert_api_delete_deprecated_attachcppheap_and_detachcppheap.patch
|
||||
|
||||
@@ -46,10 +46,10 @@ index 3e57ae8efe33f326ef0e5d609c311d4be5b8afd6..dc521d39c2280dfc3217e97c1e413b2b
|
||||
V8_INLINE static void* GetAlignedPointerFromInternalField(
|
||||
const BasicTracedReference<Object>& object, int index) {
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 3e6a975f912cf482fbf668142080df7e9aa80455..64044e9cf44d401c249787feafb651688ee0d9f9 100644
|
||||
index c1ba8bb806927ec63af004a620768d736b122c4f..f4ed96bf45183c8a7453ebac994904c2ea7d9707 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -6322,14 +6322,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
|
||||
@@ -6324,14 +6324,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
|
||||
i::Cast<i::JSObject>(*obj)->GetEmbedderField(index), isolate));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Kerr <charles@charleskerr.com>
|
||||
Date: Thu, 6 Mar 2025 14:31:19 -0600
|
||||
Subject: Revert "[api] Delete deprecated AttachCppHeap and DetachCppHeap"
|
||||
|
||||
Restore this API because Node.js needs it.
|
||||
|
||||
This patch can be removed after an upstream fix lands in Node.js,
|
||||
e.g. in https://github.com/nodejs/node-v8/tree/canary
|
||||
|
||||
diff --git a/include/v8-isolate.h b/include/v8-isolate.h
|
||||
index 97f1030dd2ca47ca4b58ac64e2e11e615bc46130..24ef6b5e0af63179e557b9896134838e112c59db 100644
|
||||
--- a/include/v8-isolate.h
|
||||
+++ b/include/v8-isolate.h
|
||||
@@ -1172,6 +1172,28 @@ class V8_EXPORT Isolate {
|
||||
*/
|
||||
void SetEmbedderRootsHandler(EmbedderRootsHandler* handler);
|
||||
|
||||
+ /**
|
||||
+ * Attaches a managed C++ heap as an extension to the JavaScript heap. The
|
||||
+ * embedder maintains ownership of the CppHeap. At most one C++ heap can be
|
||||
+ * attached to V8.
|
||||
+ *
|
||||
+ * Multi-threaded use requires the use of v8::Locker/v8::Unlocker, see
|
||||
+ * CppHeap.
|
||||
+ *
|
||||
+ * If a CppHeap is set via CreateParams, then this call is a noop.
|
||||
+ */
|
||||
+ V8_DEPRECATED("Set the heap on Isolate creation using CreateParams instead.")
|
||||
+ void AttachCppHeap(CppHeap*);
|
||||
+
|
||||
+ /**
|
||||
+ * Detaches a managed C++ heap if one was attached using `AttachCppHeap()`.
|
||||
+ *
|
||||
+ * If a CppHeap is set via CreateParams, then this call is a noop.
|
||||
+ */
|
||||
+ V8_DEPRECATED(
|
||||
+ "The CppHeap gets detached automatically during Isolate tear down.")
|
||||
+ void DetachCppHeap();
|
||||
+
|
||||
using ReleaseCppHeapCallback = void (*)(std::unique_ptr<CppHeap>);
|
||||
|
||||
/**
|
||||
@@ -1219,7 +1241,6 @@ class V8_EXPORT Isolate {
|
||||
class V8_DEPRECATED("AtomicsWaitWakeHandle is unused and will be removed.")
|
||||
#endif
|
||||
V8_EXPORT AtomicsWaitWakeHandle {
|
||||
-
|
||||
public:
|
||||
/**
|
||||
* Stop this `Atomics.wait()` call and call the |AtomicsWaitCallback|
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 64044e9cf44d401c249787feafb651688ee0d9f9..1677e54b188b6a1699370d8cff37d2acf2933f38 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -9876,6 +9876,16 @@ void Isolate::SetEmbedderRootsHandler(EmbedderRootsHandler* handler) {
|
||||
i_isolate->heap()->SetEmbedderRootsHandler(handler);
|
||||
}
|
||||
|
||||
+void Isolate::AttachCppHeap(CppHeap* cpp_heap) {
|
||||
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
|
||||
+ i_isolate->heap()->AttachCppHeap(cpp_heap);
|
||||
+}
|
||||
+
|
||||
+void Isolate::DetachCppHeap() {
|
||||
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
|
||||
+ i_isolate->heap()->DetachCppHeap();
|
||||
+}
|
||||
+
|
||||
CppHeap* Isolate::GetCppHeap() const {
|
||||
const i::Isolate* i_isolate = reinterpret_cast<const i::Isolate*>(this);
|
||||
return i_isolate->heap()->cpp_heap();
|
||||
diff --git a/src/heap/cppgc-js/cpp-heap.cc b/src/heap/cppgc-js/cpp-heap.cc
|
||||
index e033791ca1cdeba4a304e69b922d4169a22f9caa..706f81f7bbc1b5a7a1b73afe018b0b2c0184d9ef 100644
|
||||
--- a/src/heap/cppgc-js/cpp-heap.cc
|
||||
+++ b/src/heap/cppgc-js/cpp-heap.cc
|
||||
@@ -513,6 +513,11 @@ CppHeap::CppHeap(
|
||||
}
|
||||
|
||||
CppHeap::~CppHeap() {
|
||||
+ if (isolate_) {
|
||||
+ // TODO(ahaas): Delete this code once `v8::Isolate::DetachCppHeap` has been
|
||||
+ // deleted.
|
||||
+ isolate_->heap()->DetachCppHeap();
|
||||
+ }
|
||||
Terminate();
|
||||
}
|
||||
|
||||
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
||||
index cedf308a6042cc45241d4ee2731d2ee240ee8d9f..794c6380db4a669e7a83f6cce1db1dbe4fcde972 100644
|
||||
--- a/src/heap/heap.cc
|
||||
+++ b/src/heap/heap.cc
|
||||
@@ -6065,6 +6065,21 @@ void Heap::AttachCppHeap(v8::CppHeap* cpp_heap) {
|
||||
cpp_heap_ = cpp_heap;
|
||||
}
|
||||
|
||||
+void Heap::DetachCppHeap() {
|
||||
+ // The API function should be a noop in case a CppHeap was passed on Isolate
|
||||
+ // creation.
|
||||
+ if (owning_cpp_heap_) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // The CppHeap may have been detached already.
|
||||
+ if (!cpp_heap_) return;
|
||||
+
|
||||
+ CppHeap::From(cpp_heap_)->StartDetachingIsolate();
|
||||
+ CppHeap::From(cpp_heap_)->DetachIsolate();
|
||||
+ cpp_heap_ = nullptr;
|
||||
+}
|
||||
+
|
||||
std::optional<StackState> Heap::overridden_stack_state() const {
|
||||
if (!embedder_stack_state_origin_) return {};
|
||||
return embedder_stack_state_;
|
||||
diff --git a/src/heap/heap.h b/src/heap/heap.h
|
||||
index 200a3bdcd563a54b9fbd6c7ca007fb940b1a9451..0946601a9c25a03a830fb6a8fb5389057bfe5d33 100644
|
||||
--- a/src/heap/heap.h
|
||||
+++ b/src/heap/heap.h
|
||||
@@ -1108,6 +1108,9 @@ class Heap final {
|
||||
// Unified heap (C++) support. ===============================================
|
||||
// ===========================================================================
|
||||
|
||||
+ V8_EXPORT_PRIVATE void AttachCppHeap(v8::CppHeap* cpp_heap);
|
||||
+ V8_EXPORT_PRIVATE void DetachCppHeap();
|
||||
+
|
||||
v8::CppHeap* cpp_heap() const { return cpp_heap_; }
|
||||
|
||||
std::optional<StackState> overridden_stack_state() const;
|
||||
@@ -1649,8 +1652,6 @@ class Heap final {
|
||||
private:
|
||||
class AllocationTrackerForDebugging;
|
||||
|
||||
- void AttachCppHeap(v8::CppHeap* cpp_heap);
|
||||
-
|
||||
using ExternalStringTableUpdaterCallback =
|
||||
Tagged<String> (*)(Heap* heap, FullObjectSlot pointer);
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
"parallel/test-webcrypto-wrap-unwrap",
|
||||
"parallel/test-worker-no-atomics",
|
||||
"parallel/test-worker-no-sab",
|
||||
"parallel/test-worker-resource-limits",
|
||||
"parallel/test-zlib-unused-weak",
|
||||
"report/test-report-fatalerror-oomerror-compact",
|
||||
"report/test-report-fatalerror-oomerror-directory",
|
||||
|
||||
@@ -2,23 +2,31 @@ const { appCredentialsFromString, getTokenForRepo } = require('@electron/github-
|
||||
|
||||
const cp = require('node:child_process');
|
||||
|
||||
const { PATCH_UP_APP_CREDS } = process.env;
|
||||
|
||||
async function main () {
|
||||
if (!PATCH_UP_APP_CREDS) {
|
||||
throw new Error('PATCH_UP_APP_CREDS environment variable not set');
|
||||
}
|
||||
|
||||
const token = await getTokenForRepo(
|
||||
{
|
||||
name: 'electron',
|
||||
owner: 'electron'
|
||||
},
|
||||
appCredentialsFromString(process.env.PATCH_UP_APP_CREDS)
|
||||
appCredentialsFromString(PATCH_UP_APP_CREDS)
|
||||
);
|
||||
|
||||
const remoteURL = `https://x-access-token:${token}@github.com/electron/electron.git`;
|
||||
|
||||
// NEVER LOG THE OUTPUT OF THIS COMMAND
|
||||
// GIT LEAKS THE ACCESS CREDENTIALS IN CONSOLE LOGS
|
||||
const { status } = cp.spawnSync('git', ['push', '--set-upstream', remoteURL], {
|
||||
stdio: 'ignore'
|
||||
});
|
||||
|
||||
if (status !== 0) {
|
||||
console.error('Failed to push to target branch');
|
||||
process.exit(1);
|
||||
throw new Error('Failed to push to target branch');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ int GetPathConstant(std::string_view name) {
|
||||
{"videos", chrome::DIR_USER_VIDEOS},
|
||||
});
|
||||
// clang-format on
|
||||
const auto* iter = Lookup.find(name);
|
||||
auto iter = Lookup.find(name);
|
||||
return iter != Lookup.end() ? iter->second : -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/flat_map.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "chrome/browser/media/webrtc/desktop_capturer_wrapper.h"
|
||||
@@ -18,6 +20,7 @@
|
||||
#include "content/public/browser/desktop_capture.h"
|
||||
#include "gin/handle.h"
|
||||
#include "gin/object_template_builder.h"
|
||||
#include "media/base/media_switches.h"
|
||||
#include "shell/browser/javascript_environment.h"
|
||||
#include "shell/common/api/electron_api_native_image.h"
|
||||
#include "shell/common/gin_converters/gfx_converter.h"
|
||||
@@ -143,6 +146,21 @@ base::flat_map<int32_t, uint32_t> MonitorAtomIdToDisplayId() {
|
||||
}
|
||||
#endif
|
||||
|
||||
std::unique_ptr<ThumbnailCapturer> MakeScreenAndWindowCapturer() {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kNone)) {
|
||||
LOG(ERROR) << "creating thumbnail capturer, knone *****";
|
||||
return CreateThumbnailCapturerMac(DesktopMediaList::Type::kNone);
|
||||
}
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
LOG(ERROR) << "should not hit this *****";
|
||||
std::unique_ptr<webrtc::DesktopCapturer> window_capturer =
|
||||
content::desktop_capture::CreateWindowCapturer();
|
||||
return window_capturer ? std::make_unique<DesktopCapturerWrapper>(
|
||||
std::move(window_capturer))
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<ThumbnailCapturer> MakeWindowCapturer() {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kWindow)) {
|
||||
@@ -258,7 +276,8 @@ void DesktopCapturer::DesktopListListener::OnDelegatedSourceListDismissed() {
|
||||
void DesktopCapturer::StartHandling(bool capture_window,
|
||||
bool capture_screen,
|
||||
const gfx::Size& thumbnail_size,
|
||||
bool fetch_window_icons) {
|
||||
bool fetch_window_icons,
|
||||
bool use_system_picker) {
|
||||
fetch_window_icons_ = fetch_window_icons;
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (content::desktop_capture::CreateDesktopCaptureOptions()
|
||||
@@ -272,35 +291,76 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
||||
|
||||
// clear any existing captured sources.
|
||||
captured_sources_.clear();
|
||||
|
||||
LOG(ERROR) << "capture_window: " << capture_window << " capture_screen: " << capture_screen;
|
||||
if (capture_window && capture_screen) {
|
||||
// Some capturers like PipeWire support a single capturer for both screens
|
||||
// and windows. Use it if possible, treating both as window capture
|
||||
std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer =
|
||||
webrtc::DesktopCapturer::CreateGenericCapturer(
|
||||
content::desktop_capture::CreateDesktopCaptureOptions());
|
||||
auto capturer = desktop_capturer ? std::make_unique<DesktopCapturerWrapper>(
|
||||
std::move(desktop_capturer))
|
||||
: nullptr;
|
||||
if (capturer && capturer->GetDelegatedSourceListController()) {
|
||||
capture_screen_ = false;
|
||||
if (IsDisplayMediaSystemPickerAvailable()) {
|
||||
auto capturer = MakeScreenAndWindowCapturer();
|
||||
capture_screen_ = capture_screen;
|
||||
capture_window_ = capture_window;
|
||||
window_capturer_ = std::make_unique<NativeDesktopMediaList>(
|
||||
DesktopMediaList::Type::kWindow, std::move(capturer), true, true);
|
||||
window_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
// TODO(review): Maybe just call this a capturer
|
||||
screen_capturer_ = std::make_unique<NativeDesktopMediaList>(
|
||||
DesktopMediaList::Type::kNone, std::move(capturer), true, true);
|
||||
screen_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
screen_capturer_->ShowDelegatedList();
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
screen_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kNone) ? 2 : 0;
|
||||
LOG(ERROR) << "SET SKIP NEXT REFRESH TO 2";
|
||||
#endif
|
||||
|
||||
LOG(ERROR) << "screen_capturer_->skip_next_refresh_ " << screen_capturer_->skip_next_refresh_;
|
||||
OnceCallback update_callback = base::BindOnce(
|
||||
&DesktopCapturer::UpdateSourcesList, weak_ptr_factory_.GetWeakPtr(),
|
||||
window_capturer_.get());
|
||||
OnceCallback failure_callback = base::BindOnce(
|
||||
&DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr());
|
||||
screen_capturer_.get());
|
||||
|
||||
window_listener_ = std::make_unique<DesktopListListener>(
|
||||
std::move(update_callback), std::move(failure_callback),
|
||||
thumbnail_size.IsEmpty());
|
||||
window_capturer_->StartUpdating(window_listener_.get());
|
||||
// Needed to force a refresh for the native MacOS Picker
|
||||
OnceCallback wrapped_update_callback = base::BindOnce(
|
||||
&DesktopCapturer::RequestUpdate, weak_ptr_factory_.GetWeakPtr(),
|
||||
screen_capturer_.get(), std::move(update_callback));
|
||||
|
||||
if (screen_capturer_->IsSourceListDelegated()) {
|
||||
OnceCallback failure_callback = base::BindOnce(
|
||||
&DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr());
|
||||
screen_listener_ = std::make_unique<DesktopListListener>(
|
||||
std::move(wrapped_update_callback), std::move(failure_callback),
|
||||
thumbnail_size.IsEmpty());
|
||||
screen_capturer_->StartUpdating(screen_listener_.get());
|
||||
} else {
|
||||
screen_capturer_->Update(std::move(update_callback),
|
||||
/* refresh_thumbnails = */ true);
|
||||
}
|
||||
|
||||
return;
|
||||
} else {
|
||||
// Some capturers like PipeWire support a single capturer for both screens
|
||||
// and windows. Use it if possible, treating both as window capture
|
||||
std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer =
|
||||
webrtc::DesktopCapturer::CreateGenericCapturer(
|
||||
content::desktop_capture::CreateDesktopCaptureOptions());
|
||||
auto capturer = desktop_capturer
|
||||
? std::make_unique<DesktopCapturerWrapper>(
|
||||
std::move(desktop_capturer))
|
||||
: nullptr;
|
||||
if (capturer && capturer->GetDelegatedSourceListController()) {
|
||||
capture_screen_ = false;
|
||||
capture_window_ = capture_window;
|
||||
window_capturer_ = std::make_unique<NativeDesktopMediaList>(
|
||||
DesktopMediaList::Type::kWindow, std::move(capturer));
|
||||
window_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
|
||||
OnceCallback update_callback = base::BindOnce(
|
||||
&DesktopCapturer::UpdateSourcesList, weak_ptr_factory_.GetWeakPtr(),
|
||||
window_capturer_.get());
|
||||
OnceCallback failure_callback = base::BindOnce(
|
||||
&DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr());
|
||||
|
||||
window_listener_ = std::make_unique<DesktopListListener>(
|
||||
std::move(update_callback), std::move(failure_callback),
|
||||
thumbnail_size.IsEmpty());
|
||||
window_capturer_->StartUpdating(window_listener_.get());
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,21 +379,30 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
||||
// Initialize the source list.
|
||||
// Apply the new thumbnail size and restart capture.
|
||||
if (capture_window) {
|
||||
LOG(ERROR) << "WE SHOULDNT BE HERE *****";
|
||||
auto capturer = MakeWindowCapturer();
|
||||
if (capturer) {
|
||||
window_capturer_ = std::make_unique<NativeDesktopMediaList>(
|
||||
DesktopMediaList::Type::kWindow, std::move(capturer), true, true);
|
||||
window_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
window_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kWindow) ? 2
|
||||
: 0;
|
||||
#endif
|
||||
|
||||
OnceCallback update_callback = base::BindOnce(
|
||||
&DesktopCapturer::UpdateSourcesList, weak_ptr_factory_.GetWeakPtr(),
|
||||
window_capturer_.get());
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
window_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kWindow) ? 2
|
||||
: 0;
|
||||
|
||||
if (base::FeatureList::IsEnabled(media::kUseSCContentSharingPicker)) {
|
||||
window_capturer_->ShowDelegatedList();
|
||||
// Needed to force a refresh for the native MacOS Picker
|
||||
update_callback = base::BindOnce(
|
||||
&DesktopCapturer::RequestUpdate, weak_ptr_factory_.GetWeakPtr(),
|
||||
window_capturer_.get(), std::move(update_callback));
|
||||
}
|
||||
#endif
|
||||
if (window_capturer_->IsSourceListDelegated()) {
|
||||
OnceCallback failure_callback = base::BindOnce(
|
||||
&DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr());
|
||||
@@ -354,16 +423,25 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
||||
screen_capturer_ = std::make_unique<NativeDesktopMediaList>(
|
||||
DesktopMediaList::Type::kScreen, std::move(capturer));
|
||||
screen_capturer_->SetThumbnailSize(thumbnail_size);
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
screen_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kScreen) ? 2
|
||||
: 0;
|
||||
#endif
|
||||
|
||||
OnceCallback update_callback = base::BindOnce(
|
||||
&DesktopCapturer::UpdateSourcesList, weak_ptr_factory_.GetWeakPtr(),
|
||||
screen_capturer_.get());
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
screen_capturer_->skip_next_refresh_ =
|
||||
ShouldUseThumbnailCapturerMac(DesktopMediaList::Type::kScreen) ? 2
|
||||
: 0;
|
||||
|
||||
if (base::FeatureList::IsEnabled(media::kUseSCContentSharingPicker)) {
|
||||
screen_capturer_->ShowDelegatedList();
|
||||
// Needed to force a refresh for the native MacOS Picker
|
||||
update_callback = base::BindOnce(
|
||||
&DesktopCapturer::RequestUpdate, weak_ptr_factory_.GetWeakPtr(),
|
||||
screen_capturer_.get(), std::move(update_callback));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (screen_capturer_->IsSourceListDelegated()) {
|
||||
OnceCallback failure_callback = base::BindOnce(
|
||||
&DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr());
|
||||
@@ -380,9 +458,15 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
||||
}
|
||||
}
|
||||
|
||||
void DesktopCapturer::RequestUpdate(DesktopMediaList* list,
|
||||
OnceCallback update_callback) {
|
||||
list->Update(std::move(update_callback));
|
||||
}
|
||||
|
||||
void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
|
||||
if (capture_window_ &&
|
||||
list->GetMediaListType() == DesktopMediaList::Type::kWindow) {
|
||||
(list->GetMediaListType() == DesktopMediaList::Type::kWindow ||
|
||||
list->GetMediaListType() == DesktopMediaList::Type::kNone)) {
|
||||
capture_window_ = false;
|
||||
std::vector<DesktopCapturer::Source> window_sources;
|
||||
window_sources.reserve(list->GetSourceCount());
|
||||
@@ -395,7 +479,8 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
|
||||
}
|
||||
|
||||
if (capture_screen_ &&
|
||||
list->GetMediaListType() == DesktopMediaList::Type::kScreen) {
|
||||
(list->GetMediaListType() == DesktopMediaList::Type::kScreen ||
|
||||
list->GetMediaListType() == DesktopMediaList::Type::kNone)) {
|
||||
capture_screen_ = false;
|
||||
std::vector<DesktopCapturer::Source> screen_sources;
|
||||
screen_sources.reserve(list->GetSourceCount());
|
||||
@@ -465,7 +550,6 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
|
||||
std::move(screen_sources.begin(), screen_sources.end(),
|
||||
std::back_inserter(captured_sources_));
|
||||
}
|
||||
|
||||
if (!capture_window_ && !capture_screen_)
|
||||
HandleSuccess();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ class DesktopCapturer final : public gin::Wrappable<DesktopCapturer>,
|
||||
void StartHandling(bool capture_window,
|
||||
bool capture_screen,
|
||||
const gfx::Size& thumbnail_size,
|
||||
bool fetch_window_icons);
|
||||
bool fetch_window_icons,
|
||||
bool use_system_picker);
|
||||
|
||||
// gin::Wrappable
|
||||
static gin::WrapperInfo kWrapperInfo;
|
||||
@@ -94,6 +95,7 @@ class DesktopCapturer final : public gin::Wrappable<DesktopCapturer>,
|
||||
bool have_thumbnail_ = false;
|
||||
};
|
||||
|
||||
void RequestUpdate(DesktopMediaList* list, OnceCallback update_callback);
|
||||
void UpdateSourcesList(DesktopMediaList* list);
|
||||
void HandleFailure();
|
||||
void HandleSuccess();
|
||||
|
||||
@@ -119,7 +119,7 @@ bool GlobalShortcut::Register(const ui::Accelerator& accelerator,
|
||||
}
|
||||
|
||||
if (instance->IsRegistrationHandledExternally()) {
|
||||
auto* context = ElectronBrowserContext::From("", false);
|
||||
auto* context = ElectronBrowserContext::GetDefaultBrowserContext();
|
||||
PrefService* prefs = context->prefs();
|
||||
|
||||
// Need a unique profile id. Set one if not generated yet, otherwise re-use
|
||||
|
||||
@@ -282,6 +282,12 @@ GURL ServiceWorkerMain::ScopeURL() const {
|
||||
return version_info()->scope;
|
||||
}
|
||||
|
||||
GURL ServiceWorkerMain::ScriptURL() const {
|
||||
if (version_destroyed_)
|
||||
return {};
|
||||
return version_info()->script_url;
|
||||
}
|
||||
|
||||
// static
|
||||
gin::Handle<ServiceWorkerMain> ServiceWorkerMain::New(v8::Isolate* isolate) {
|
||||
return gin::Handle<ServiceWorkerMain>();
|
||||
@@ -330,6 +336,7 @@ void ServiceWorkerMain::FillObjectTemplate(
|
||||
&ServiceWorkerMain::CountExternalRequestsForTest)
|
||||
.SetProperty("versionId", &ServiceWorkerMain::VersionID)
|
||||
.SetProperty("scope", &ServiceWorkerMain::ScopeURL)
|
||||
.SetProperty("scriptURL", &ServiceWorkerMain::ScriptURL)
|
||||
.Build();
|
||||
}
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ class ServiceWorkerMain final
|
||||
|
||||
int64_t VersionID() const;
|
||||
GURL ScopeURL() const;
|
||||
GURL ScriptURL() const;
|
||||
|
||||
// Version ID unique only to the StoragePartition.
|
||||
int64_t version_id_;
|
||||
|
||||
@@ -701,14 +701,13 @@ v8::Local<v8::Promise> Session::ClearStorageData(gin::Arguments* args) {
|
||||
ClearStorageDataOptions options;
|
||||
args->GetNext(&options);
|
||||
|
||||
auto* storage_partition = browser_context()->GetStoragePartition(nullptr);
|
||||
if (options.storage_types & StoragePartition::REMOVE_DATA_MASK_COOKIES) {
|
||||
// Reset media device id salt when cookies are cleared.
|
||||
// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-deviceid
|
||||
MediaDeviceIDSalt::Reset(browser_context()->prefs());
|
||||
}
|
||||
|
||||
storage_partition->ClearData(
|
||||
browser_context()->GetDefaultStoragePartition()->ClearData(
|
||||
options.storage_types, options.quota_types, options.storage_key,
|
||||
base::Time(), base::Time::Max(),
|
||||
base::BindOnce(gin_helper::Promise<void>::ResolvePromise,
|
||||
@@ -717,8 +716,7 @@ v8::Local<v8::Promise> Session::ClearStorageData(gin::Arguments* args) {
|
||||
}
|
||||
|
||||
void Session::FlushStorageData() {
|
||||
auto* storage_partition = browser_context()->GetStoragePartition(nullptr);
|
||||
storage_partition->Flush();
|
||||
browser_context()->GetDefaultStoragePartition()->Flush();
|
||||
}
|
||||
|
||||
v8::Local<v8::Promise> Session::SetProxy(gin::Arguments* args) {
|
||||
@@ -1681,7 +1679,7 @@ gin::Handle<Session> Session::FromPartition(v8::Isolate* isolate,
|
||||
ElectronBrowserContext* browser_context;
|
||||
if (partition.empty()) {
|
||||
browser_context =
|
||||
ElectronBrowserContext::From("", false, std::move(options));
|
||||
ElectronBrowserContext::GetDefaultBrowserContext(std::move(options));
|
||||
} else if (partition.starts_with(kPersistPrefix)) {
|
||||
std::string name = partition.substr(8);
|
||||
browser_context =
|
||||
|
||||
@@ -129,7 +129,7 @@ std::string SystemPreferences::GetColor(gin_helper::ErrorThrower thrower,
|
||||
{"window-text", COLOR_WINDOWTEXT},
|
||||
});
|
||||
|
||||
if (const auto* iter = Lookup.find(color); iter != Lookup.end())
|
||||
if (auto iter = Lookup.find(color); iter != Lookup.end())
|
||||
return ToRGBAHex(color_utils::GetSysSkColor(iter->second));
|
||||
|
||||
thrower.ThrowError("Unknown color: " + color);
|
||||
|
||||
@@ -80,7 +80,7 @@ struct UserData : public base::SupportsUserData::Data {
|
||||
};
|
||||
|
||||
extensions::WebRequestResourceType ParseResourceType(std::string_view value) {
|
||||
if (const auto* iter = ResourceTypes.find(value); iter != ResourceTypes.end())
|
||||
if (auto iter = ResourceTypes.find(value); iter != ResourceTypes.end())
|
||||
return iter->second;
|
||||
|
||||
return extensions::WebRequestResourceType::OTHER;
|
||||
|
||||
@@ -318,6 +318,14 @@ ElectronBrowserContext::browser_context_map() {
|
||||
return *browser_context_map;
|
||||
}
|
||||
|
||||
// static
|
||||
void ElectronBrowserContext::DestroyAllContexts() {
|
||||
auto& map = browser_context_map();
|
||||
// Avoid UAF by destroying the default context last. See ba629e3 for info.
|
||||
const auto extracted = map.extract(PartitionKey{"", false});
|
||||
map.clear();
|
||||
}
|
||||
|
||||
ElectronBrowserContext::ElectronBrowserContext(
|
||||
const PartitionOrPath partition_location,
|
||||
bool in_memory,
|
||||
@@ -841,6 +849,12 @@ ElectronBrowserContext* ElectronBrowserContext::From(
|
||||
return context.get();
|
||||
}
|
||||
|
||||
// static
|
||||
ElectronBrowserContext* ElectronBrowserContext::GetDefaultBrowserContext(
|
||||
base::Value::Dict options) {
|
||||
return ElectronBrowserContext::From("", false, std::move(options));
|
||||
}
|
||||
|
||||
ElectronBrowserContext* ElectronBrowserContext::FromPath(
|
||||
const base::FilePath& path,
|
||||
base::Value::Dict options) {
|
||||
|
||||
@@ -84,6 +84,10 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||
using BrowserContextMap =
|
||||
std::map<PartitionKey, std::unique_ptr<ElectronBrowserContext>>;
|
||||
|
||||
// Get or create the default BrowserContext.
|
||||
static ElectronBrowserContext* GetDefaultBrowserContext(
|
||||
base::Value::Dict options = {});
|
||||
|
||||
// Get or create the BrowserContext according to its |partition| and
|
||||
// |in_memory|. The |options| will be passed to constructor when there is no
|
||||
// existing BrowserContext.
|
||||
@@ -99,6 +103,8 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||
|
||||
static BrowserContextMap& browser_context_map();
|
||||
|
||||
static void DestroyAllContexts();
|
||||
|
||||
void SetUserAgent(const std::string& user_agent);
|
||||
std::string GetUserAgent() const;
|
||||
bool can_use_http_cache() const { return use_cache_; }
|
||||
|
||||
@@ -598,11 +598,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
|
||||
node_bindings_->set_uv_env(nullptr);
|
||||
node_env_.reset();
|
||||
|
||||
auto default_context_key = ElectronBrowserContext::PartitionKey("", false);
|
||||
std::unique_ptr<ElectronBrowserContext> default_context = std::move(
|
||||
ElectronBrowserContext::browser_context_map()[default_context_key]);
|
||||
ElectronBrowserContext::browser_context_map().clear();
|
||||
default_context.reset();
|
||||
ElectronBrowserContext::DestroyAllContexts();
|
||||
|
||||
fake_browser_process_->PostMainMessageLoopRun();
|
||||
content::DevToolsAgentHost::StopRemoteDebuggingPipeHandler();
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "extensions/browser/extension_file_task_runner.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/pref_names.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/error_utils.h"
|
||||
#include "extensions/common/file_util.h"
|
||||
#include "extensions/common/manifest_constants.h"
|
||||
@@ -95,7 +97,10 @@ ElectronExtensionLoader::ElectronExtensionLoader(
|
||||
content::BrowserContext* browser_context)
|
||||
: browser_context_(browser_context),
|
||||
extension_registrar_(ExtensionRegistrar::Get(browser_context)) {
|
||||
extension_registrar_->SetDelegate(this);
|
||||
extension_registrar_->Init(
|
||||
this, /*extensions_enabled=*/true,
|
||||
browser_context_->GetPath().AppendASCII(kInstallDirectoryName),
|
||||
browser_context_->GetPath().AppendASCII(kUnpackedInstallDirectoryName));
|
||||
}
|
||||
|
||||
ElectronExtensionLoader::~ElectronExtensionLoader() = default;
|
||||
|
||||
@@ -112,7 +112,7 @@ BrowserContext* ElectronExtensionsBrowserClient::GetOriginalContext(
|
||||
BrowserContext* context) {
|
||||
DCHECK(context);
|
||||
if (context->IsOffTheRecord()) {
|
||||
return ElectronBrowserContext::From("", false);
|
||||
return ElectronBrowserContext::GetDefaultBrowserContext();
|
||||
} else {
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,27 @@ std::string EnablePlatformSpecificFeatures() {
|
||||
#else
|
||||
return "ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma,"
|
||||
"ThumbnailCapturerMac:capture_mode/sc_screenshot_manager";
|
||||
#endif
|
||||
}
|
||||
if (@available(macOS 15.0, *)) {
|
||||
// These flags aren't exported so reference them by name directly, they are
|
||||
// used to ensure that screen and window capture exclusive use
|
||||
// ScreenCaptureKit APIs to avoid warning dialogs on macOS 15.0 and higher.
|
||||
// kScreenCaptureKitPickerScreen,
|
||||
// chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
// kScreenCaptureKitStreamPickerSonoma,
|
||||
// chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
// kThumbnailCapturerMac,
|
||||
// chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
// kUseSCContentSharingPicker,
|
||||
// chrome/browser/media/webrtc/thumbnail_capturer_mac.mm
|
||||
#if DCHECK_IS_ON()
|
||||
return "ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma,"
|
||||
"UseSCContentSharingPicker";
|
||||
#else
|
||||
return "ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma,"
|
||||
"UseSCContentSharingPicker,"
|
||||
"ThumbnailCapturerMac:capture_mode/sc_screenshot_manager";
|
||||
#endif
|
||||
}
|
||||
return "";
|
||||
|
||||
@@ -1221,7 +1221,7 @@ SkColor NativeWindowViews::GetBackgroundColor() const {
|
||||
auto* background = root_view_.background();
|
||||
if (!background)
|
||||
return SK_ColorTRANSPARENT;
|
||||
return background->get_color();
|
||||
return background->color().ConvertToSkColor(root_view_.GetColorProvider());
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetBackgroundColor(SkColor background_color) {
|
||||
|
||||
@@ -544,8 +544,7 @@ void ElectronURLLoaderFactory::StartLoadingHttp(
|
||||
request->method != net::HttpRequestHeaders::kHeadMethod)
|
||||
dict.Get("uploadData", &upload_data);
|
||||
|
||||
ElectronBrowserContext* browser_context =
|
||||
ElectronBrowserContext::From("", false);
|
||||
auto* browser_context = ElectronBrowserContext::GetDefaultBrowserContext();
|
||||
v8::Local<v8::Value> value;
|
||||
if (dict.Get("session", &value)) {
|
||||
if (value->IsNull()) {
|
||||
|
||||
@@ -138,7 +138,7 @@ bool DevToolsManagerDelegate::HasBundledFrontendResources() {
|
||||
}
|
||||
|
||||
content::BrowserContext* DevToolsManagerDelegate::GetDefaultBrowserContext() {
|
||||
return ElectronBrowserContext::From("", false);
|
||||
return ElectronBrowserContext::GetDefaultBrowserContext();
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -416,7 +416,7 @@ void ClientFrameViewLinux::LayoutButtonsOnSide(
|
||||
}
|
||||
|
||||
for (views::FrameButton frame_button : frame_buttons) {
|
||||
auto* button =
|
||||
auto button =
|
||||
std::ranges::find_if(nav_buttons_, [&](const NavButton& test) {
|
||||
return test.type != skip_type && test.frame_button == frame_button;
|
||||
});
|
||||
|
||||
@@ -206,7 +206,8 @@ void MenuBar::ViewHierarchyChanged(
|
||||
const views::ViewHierarchyChangedDetails& details) {
|
||||
views::AccessiblePaneView::ViewHierarchyChanged(details);
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
background_color_ = GetBackground()->get_color();
|
||||
background_color_ =
|
||||
GetBackground()->color().ConvertToSkColor(root_view_->GetColorProvider());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -219,7 +220,8 @@ void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
|
||||
disabled_color_ = gtk::GetFgColor(
|
||||
"GtkMenuBar#menubar GtkMenuItem#menuitem:disabled GtkLabel");
|
||||
#elif BUILDFLAG(IS_WIN)
|
||||
background_color_ = GetBackground()->get_color();
|
||||
background_color_ = GetBackground()->color().ConvertToSkColor(
|
||||
root_view_->GetColorProvider());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user