mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
44 Commits
fix-ipc-ra
...
v30.0.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7031c930fd | ||
|
|
b5c9945692 | ||
|
|
9ebeeb40ac | ||
|
|
5655b68c37 | ||
|
|
ba1e7fcaa7 | ||
|
|
313476a724 | ||
|
|
1b80911417 | ||
|
|
83777ac83f | ||
|
|
f585a4ef37 | ||
|
|
a8e2ec14ba | ||
|
|
a46685fd59 | ||
|
|
9ef3902841 | ||
|
|
0f1e52fafe | ||
|
|
21341a56a7 | ||
|
|
516f6d0a40 | ||
|
|
78ce4c473b | ||
|
|
417e16cedd | ||
|
|
a47b724c99 | ||
|
|
ee4bbb5851 | ||
|
|
b713e34947 | ||
|
|
b39f36496d | ||
|
|
d16f1d52e8 | ||
|
|
d3b182f8b9 | ||
|
|
35099d9289 | ||
|
|
b45f579eda | ||
|
|
64c031f264 | ||
|
|
058c6b4af7 | ||
|
|
333ee6d51a | ||
|
|
e7300ad4c8 | ||
|
|
58ee15905b | ||
|
|
036e8502e0 | ||
|
|
17856cf91a | ||
|
|
56dfcc5468 | ||
|
|
105acec227 | ||
|
|
174aedf54c | ||
|
|
47deb401b0 | ||
|
|
7331e5dfb1 | ||
|
|
a55f23979e | ||
|
|
4a727c6a72 | ||
|
|
fd8eec3585 | ||
|
|
ef40e551cf | ||
|
|
532039ea2c | ||
|
|
25b0212fe6 | ||
|
|
310598c43d |
@@ -4,8 +4,12 @@
|
||||
"onCreateCommand": ".devcontainer/on-create-command.sh",
|
||||
"updateContentCommand": ".devcontainer/update-content-command.sh",
|
||||
"workspaceFolder": "/workspaces/gclient/src/electron",
|
||||
"forwardPorts": [6080, 5901],
|
||||
"forwardPorts": [8088, 6080, 5901],
|
||||
"portsAttributes": {
|
||||
"8088": {
|
||||
"label": "Goma Control Panel",
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"6080": {
|
||||
"label": "VNC web client (noVNC)",
|
||||
"onAutoForward": "silent"
|
||||
|
||||
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@@ -11,9 +11,6 @@ DEPS @electron/wg-upgrades
|
||||
/docs/breaking-changes.md @electron/wg-releases
|
||||
/npm/ @electron/wg-releases
|
||||
/script/release @electron/wg-releases
|
||||
appveyor.yml @electron/wg-releases
|
||||
appveyor-bake.yml @electron/wg-releases
|
||||
appveyor-woa.yml @electron/wg-releases
|
||||
|
||||
# Security WG
|
||||
/lib/browser/devtools.ts @electron/wg-security
|
||||
|
||||
18
.github/workflows/issue-labeled.yml
vendored
18
.github/workflows/issue-labeled.yml
vendored
@@ -8,24 +8,6 @@ permissions: # added using https://github.com/step-security/secure-workflows
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
issue-labeled-with-status:
|
||||
name: status/{confirmed,reviewed} label added
|
||||
if: github.event.label.name == 'status/confirmed' || github.event.label.name == 'status/reviewed'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
field: Status
|
||||
field-value: ✅ Triaged
|
||||
issue-labeled-blocked:
|
||||
name: blocked/* label added
|
||||
if: startsWith(github.event.label.name, 'blocked/')
|
||||
|
||||
41
.github/workflows/issue-opened.yml
vendored
41
.github/workflows/issue-opened.yml
vendored
@@ -25,44 +25,3 @@ jobs:
|
||||
field-value: ${{ github.event.issue.user.login }}
|
||||
project-number: 90
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
set-labels:
|
||||
if: ${{ contains(github.event.issue.labels.*.name, 'bug :beetle:') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- run: npm install mdast-util-from-markdown@2.0.0 unist-util-select@5.1.0
|
||||
- name: Add labels
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
env:
|
||||
ISSUE_BODY: ${{ github.event.issue.body }}
|
||||
with:
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
script: |
|
||||
const { fromMarkdown } = await import('${{ github.workspace }}/node_modules/mdast-util-from-markdown/index.js');
|
||||
const { select } = await import('${{ github.workspace }}/node_modules/unist-util-select/index.js');
|
||||
|
||||
const [ owner, repo ] = '${{ github.repository }}'.split('/');
|
||||
const issue_number = ${{ github.event.issue.number }};
|
||||
|
||||
const tree = fromMarkdown(process.env.ISSUE_BODY);
|
||||
|
||||
const labels = [];
|
||||
|
||||
const gistUrl = select('heading:has(> text[value="Testcase Gist URL"]) + paragraph > text', tree)?.value.trim();
|
||||
if (gistUrl !== undefined && gistUrl.startsWith('https://gist.github.com/')) {
|
||||
labels.push('has-repro-gist');
|
||||
}
|
||||
|
||||
if (labels.length) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number,
|
||||
labels,
|
||||
});
|
||||
}
|
||||
|
||||
41
.github/workflows/update_appveyor_image.yml
vendored
41
.github/workflows/update_appveyor_image.yml
vendored
@@ -6,23 +6,22 @@ on:
|
||||
schedule:
|
||||
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
|
||||
|
||||
permissions: {}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
bake-appveyor-image:
|
||||
name: Bake AppVeyor Image
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write # to create a new PR with updated Appveyor images
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Yarn install
|
||||
run: |
|
||||
node script/yarn.js install --frozen-lockfile
|
||||
@@ -50,24 +49,26 @@ jobs:
|
||||
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
|
||||
patch -f appveyor.yml < appveyor.diff
|
||||
rm appveyor2.yml appveyor.diff
|
||||
git add appveyor.yml
|
||||
- name: (Optionally) Generate Commit Diff for WOA
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
run: |
|
||||
diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
|
||||
patch -f appveyor-woa.yml < appveyor-woa.diff
|
||||
rm appveyor-woa2.yml appveyor-woa.diff
|
||||
git add appveyor-woa.yml
|
||||
- name: (Optionally) Commit to Branch
|
||||
- name: (Optionally) Commit and Pull Request
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
uses: dsanders11/github-app-commit-action@1dd0a2d22c564461d3f598b6858856e8842d7a16 # v1.1.0
|
||||
uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0
|
||||
with:
|
||||
message: 'build: update appveyor image to latest version'
|
||||
ref: bump-appveyor-image
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: (Optionally) Create Pull Request
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
run: |
|
||||
printf "This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.\n\nNotes: none" | gh pr create --head bump-appveyor-image --label no-backport --label semver/none --title 'build: update appveyor image to latest version' --body-file=-
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'build: update appveyor image to latest version'
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
signoff: false
|
||||
branch: bump-appveyor-image
|
||||
delete-branch: true
|
||||
reviewers: electron/wg-releases
|
||||
title: 'build: update appveyor image to latest version'
|
||||
labels: semver/none,no-backport
|
||||
body: |
|
||||
This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.
|
||||
Notes: none
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
{
|
||||
"extends": "@electron/lint-roller/configs/markdownlint.json",
|
||||
"no-angle-brackets": true,
|
||||
"no-inline-html": {
|
||||
"allowed_elements": [
|
||||
"br",
|
||||
"details",
|
||||
"img",
|
||||
"li",
|
||||
"summary",
|
||||
"ul",
|
||||
"unknown",
|
||||
"Tabs",
|
||||
"TabItem",
|
||||
]
|
||||
}
|
||||
"extends": "@electron/lint-roller/configs/markdownlint.json"
|
||||
}
|
||||
|
||||
6
BUILD.gn
6
BUILD.gn
@@ -475,7 +475,6 @@ source_set("electron_lib") {
|
||||
"//net:extras",
|
||||
"//net:net_resources",
|
||||
"//printing/buildflags",
|
||||
"//services/device/public/cpp/bluetooth:bluetooth",
|
||||
"//services/device/public/cpp/geolocation",
|
||||
"//services/device/public/cpp/hid",
|
||||
"//services/device/public/mojom",
|
||||
@@ -503,7 +502,6 @@ source_set("electron_lib") {
|
||||
"//ui/native_theme",
|
||||
"//ui/shell_dialogs",
|
||||
"//ui/views",
|
||||
"//ui/views/controls/webview",
|
||||
"//v8",
|
||||
"//v8:v8_libplatform",
|
||||
]
|
||||
@@ -639,6 +637,7 @@ source_set("electron_lib") {
|
||||
"//ui/gtk:gtk_config",
|
||||
"//ui/linux:linux_ui",
|
||||
"//ui/linux:linux_ui_factory",
|
||||
"//ui/views/controls/webview",
|
||||
"//ui/wm",
|
||||
]
|
||||
if (ozone_platform_x11) {
|
||||
@@ -667,6 +666,7 @@ source_set("electron_lib") {
|
||||
deps += [
|
||||
"//components/crash/core/app:crash_export_thunks",
|
||||
"//ui/native_theme:native_theme_browser",
|
||||
"//ui/views/controls/webview",
|
||||
"//ui/wm",
|
||||
"//ui/wm/public",
|
||||
]
|
||||
@@ -856,7 +856,7 @@ if (is_mac) {
|
||||
if (is_asan) {
|
||||
# crashpad_handler requires the ASan runtime at its @executable_path.
|
||||
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
|
||||
public_deps += [ "//build/config/sanitizers:copy_sanitizer_runtime" ]
|
||||
public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
DEPS
2
DEPS
@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'124.0.6359.0',
|
||||
'124.0.6367.9',
|
||||
'node_version':
|
||||
'v20.11.1',
|
||||
'nan_version':
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-124.0.6359.0
|
||||
image: e-123.0.6312.5
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
@@ -39,7 +39,7 @@ environment:
|
||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
||||
GYP_MSVS_HASH_27370823e7: 28622d16b1
|
||||
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
||||
PYTHONIOENCODING: UTF-8
|
||||
|
||||
matrix:
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-124.0.6359.0
|
||||
image: e-123.0.6312.5
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
@@ -39,7 +39,7 @@ environment:
|
||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
||||
GYP_MSVS_HASH_27370823e7: 28622d16b1
|
||||
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
||||
PYTHONIOENCODING: UTF-8
|
||||
|
||||
matrix:
|
||||
|
||||
@@ -656,7 +656,7 @@ Closes the currently open [Quick Look][quick-look] panel.
|
||||
|
||||
#### `win.setBounds(bounds[, animate])`
|
||||
|
||||
* `bounds` Partial\<[Rectangle](structures/rectangle.md)\>
|
||||
* `bounds` Partial<[Rectangle](structures/rectangle.md)>
|
||||
* `animate` boolean (optional) _macOS_
|
||||
|
||||
Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
|
||||
|
||||
@@ -17,8 +17,6 @@ following properties:
|
||||
method.
|
||||
* `url` string (optional) - The request URL. Must be provided in the absolute
|
||||
form with the protocol scheme specified as http or https.
|
||||
* `headers` Record\<string, string | string[]\> (optional) - Headers to be sent
|
||||
with the request.
|
||||
* `session` Session (optional) - The [`Session`](session.md) instance with
|
||||
which the request is associated.
|
||||
* `partition` string (optional) - The name of the [`partition`](session.md)
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
## Class: NavigationHistory
|
||||
|
||||
> Manage a list of navigation entries, representing the user's browsing history within the application.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
|
||||
Each navigation entry corresponds to a specific page. The indexing system follows a sequential order, where the first available navigation entry is at index 0, representing the earliest visited page, and the latest navigation entry is at index N, representing the most recent page. Maintaining this ordered list of navigation entries enables seamless navigation both backward and forward through the user's browsing history.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
#### `navigationHistory.getActiveIndex()`
|
||||
|
||||
Returns `Integer` - The index of the current page, from which we would go back/forward or reload.
|
||||
|
||||
#### `navigationHistory.getEntryAtIndex(index)`
|
||||
|
||||
* `index` Integer
|
||||
|
||||
Returns `Object`:
|
||||
|
||||
* `url` string - The URL of the navigation entry at the given index.
|
||||
* `title` string - The page title of the navigation entry at the given index.
|
||||
|
||||
If index is out of bounds (greater than history length or less than 0), null will be returned.
|
||||
|
||||
#### `navigationHistory.length()`
|
||||
|
||||
Returns `Integer` - History length.
|
||||
@@ -1428,37 +1428,6 @@ is emitted.
|
||||
Returns `string | null` - The absolute file system path where data for this
|
||||
session is persisted on disk. For in memory sessions this returns `null`.
|
||||
|
||||
#### `ses.clearData([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `dataTypes` String[] (optional) - The types of data to clear. By default, this will clear all types of data.
|
||||
* `backgroundFetch` - Background Fetch
|
||||
* `cache` - Cache
|
||||
* `cookies` - Cookies
|
||||
* `downloads` - Downloads
|
||||
* `fileSystems` - File Systems
|
||||
* `indexedDB` - IndexedDB
|
||||
* `localStorage` - Local Storage
|
||||
* `serviceWorkers` - Service Workers
|
||||
* `webSQL` - WebSQL
|
||||
* `origins` String[] (optional) - Clear data for only these origins. Cannot be used with `excludeOrigins`.
|
||||
* `excludeOrigins` String[] (optional) - Clear data for all origins except these ones. Cannot be used with `origins`.
|
||||
* `avoidClosingConnections` boolean (optional) - Skips deleting cookies that would close current network connections. (Default: `false`)
|
||||
* `originMatchingMode` String (optional) - The behavior for matching data to origins.
|
||||
* `third-parties-included` (default) - Storage is matched on origin in first-party contexts and top-level-site in third-party contexts.
|
||||
* `origin-in-all-contexts` - Storage is matched on origin only in all contexts.
|
||||
|
||||
Returns `Promise<void>` - resolves when all data has been cleared.
|
||||
|
||||
Clears various different types of data.
|
||||
|
||||
This method clears more types of data and is more thourough than the
|
||||
`clearStorageData` method.
|
||||
|
||||
**Note:** Cookies are stored at a broader scope than origins. When removing cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be removed at the [registrable domain](https://url.spec.whatwg.org/#host-registrable-domain) level. For example, clearing cookies for the origin `https://really.specific.origin.example.com/` will end up clearing all cookies for `example.com`. Clearing cookies for the origin `https://my.website.example.co.uk/` will end up clearing all cookies for `example.co.uk`.
|
||||
|
||||
For more information, refer to Chromium's [`BrowsingDataRemover` interface](https://source.chromium.org/chromium/chromium/src/+/main:content/public/browser/browsing_data_remover.h).
|
||||
|
||||
### Instance Properties
|
||||
|
||||
The following properties are available on instances of `Session`:
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# WindowOpenHandlerResponse Object
|
||||
|
||||
* `action` string - Can be `allow` or `deny`. Controls whether new window should be created.
|
||||
* `overrideBrowserWindowOptions` BrowserWindowConstructorOptions (optional) - Allows customization of the created window.
|
||||
* `outlivesOpener` boolean (optional) - By default, child windows are closed when their opener is closed. This can be
|
||||
changed by specifying `outlivesOpener: true`, in which case the opened window will not be closed when its opener is closed.
|
||||
* `createWindow` (options: BrowserWindowConstructorOptions) => WebContents (optional) - If specified, will be called instead of `new BrowserWindow` to create the new child window and event [`did-create-window`](../web-contents.md#event-did-create-window) will not be emitted. Constructed child window should use passed `options` object. This can be used for example to have the new window open as a BrowserView instead of in a separate window.
|
||||
@@ -1288,7 +1288,7 @@ Ignore application menu shortcuts while this web contents is focused.
|
||||
|
||||
#### `contents.setWindowOpenHandler(handler)`
|
||||
|
||||
* `handler` Function\<[WindowOpenHandlerResponse](structures/window-open-handler-response.md)\>
|
||||
* `handler` Function\<{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}\>
|
||||
* `details` Object
|
||||
* `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
||||
* `frameName` string - Name of the window provided in `window.open()`
|
||||
@@ -1303,8 +1303,11 @@ Ignore application menu shortcuts while this web contents is focused.
|
||||
be set. If no post data is to be sent, the value will be `null`. Only defined
|
||||
when the window is being created by a form that set `target=_blank`.
|
||||
|
||||
Returns `WindowOpenHandlerResponse` - When set to `{ action: 'deny' }` cancels the creation of the new
|
||||
window. `{ action: 'allow' }` will allow the new window to be created.
|
||||
Returns `{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
|
||||
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
|
||||
By default, child windows are closed when their opener is closed. This can be
|
||||
changed by specifying `outlivesOpener: true`, in which case the opened window
|
||||
will not be closed when its opener is closed.
|
||||
Returning an unrecognized value such as a null, undefined, or an object
|
||||
without a recognized 'action' value will result in a console error and have
|
||||
the same effect as returning `{action: 'deny'}`.
|
||||
@@ -1315,26 +1318,6 @@ submitting a form with `<form target="_blank">`. See
|
||||
[`window.open()`](window-open.md) for more details and how to use this in
|
||||
conjunction with `did-create-window`.
|
||||
|
||||
An example showing how to customize the process of new `BrowserWindow` creation to be `BrowserView` attached to main window instead:
|
||||
|
||||
```js
|
||||
const { BrowserView, BrowserWindow } = require('electron')
|
||||
|
||||
const mainWindow = new BrowserWindow()
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
return {
|
||||
action: 'allow',
|
||||
createWindow: (options) => {
|
||||
const browserView = new BrowserView(options)
|
||||
mainWindow.addBrowserView(browserView)
|
||||
browserView.setBounds({ x: 0, y: 0, width: 640, height: 480 })
|
||||
return browserView.webContents
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### `contents.setAudioMuted(muted)`
|
||||
|
||||
* `muted` boolean
|
||||
@@ -2223,10 +2206,6 @@ A `Integer` representing the unique ID of this WebContents. Each ID is unique am
|
||||
|
||||
A [`Session`](session.md) used by this webContents.
|
||||
|
||||
#### `contents.navigationHistory` _Readonly_
|
||||
|
||||
A [`NavigationHistory`](navigation-history.md) used by this webContents.
|
||||
|
||||
#### `contents.hostWebContents` _Readonly_
|
||||
|
||||
A [`WebContents`](web-contents.md) instance that might own this `WebContents`.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 4.2 MiB |
@@ -234,7 +234,7 @@ Notification) whereas camelCase modules are not instantiable (e.g. app, ipcRende
|
||||
<details><summary>Typed import aliases</summary>
|
||||
|
||||
For better type checking when writing TypeScript code, you can choose to import
|
||||
main process modules from `electron/main`.
|
||||
main process modules from <code>electron/main</code>.
|
||||
|
||||
```js
|
||||
const { app, BrowserWindow } = require('electron/main')
|
||||
|
||||
@@ -34,7 +34,6 @@ auto_filenames = {
|
||||
"docs/api/message-port-main.md",
|
||||
"docs/api/native-image.md",
|
||||
"docs/api/native-theme.md",
|
||||
"docs/api/navigation-history.md",
|
||||
"docs/api/net-log.md",
|
||||
"docs/api/net.md",
|
||||
"docs/api/notification.md",
|
||||
@@ -145,7 +144,6 @@ auto_filenames = {
|
||||
"docs/api/structures/web-preferences.md",
|
||||
"docs/api/structures/web-request-filter.md",
|
||||
"docs/api/structures/web-source.md",
|
||||
"docs/api/structures/window-open-handler-response.md",
|
||||
]
|
||||
|
||||
sandbox_bundle_deps = [
|
||||
|
||||
@@ -155,8 +155,12 @@ filenames = {
|
||||
"shell/browser/osr/osr_web_contents_view_mac.mm",
|
||||
"shell/browser/relauncher_mac.cc",
|
||||
"shell/browser/ui/certificate_trust_mac.mm",
|
||||
"shell/browser/ui/cocoa/delayed_native_view_host.h",
|
||||
"shell/browser/ui/cocoa/delayed_native_view_host.mm",
|
||||
"shell/browser/ui/cocoa/electron_bundle_mover.h",
|
||||
"shell/browser/ui/cocoa/electron_bundle_mover.mm",
|
||||
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h",
|
||||
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm",
|
||||
"shell/browser/ui/cocoa/electron_menu_controller.h",
|
||||
"shell/browser/ui/cocoa/electron_menu_controller.mm",
|
||||
"shell/browser/ui/cocoa/electron_native_widget_mac.h",
|
||||
@@ -183,6 +187,8 @@ filenames = {
|
||||
"shell/browser/ui/cocoa/window_buttons_proxy.mm",
|
||||
"shell/browser/ui/drag_util_mac.mm",
|
||||
"shell/browser/ui/file_dialog_mac.mm",
|
||||
"shell/browser/ui/inspectable_web_contents_view_mac.h",
|
||||
"shell/browser/ui/inspectable_web_contents_view_mac.mm",
|
||||
"shell/browser/ui/message_box_mac.mm",
|
||||
"shell/browser/ui/tray_icon_cocoa.h",
|
||||
"shell/browser/ui/tray_icon_cocoa.mm",
|
||||
@@ -198,7 +204,6 @@ filenames = {
|
||||
"shell/common/node_bindings_mac.cc",
|
||||
"shell/common/node_bindings_mac.h",
|
||||
"shell/common/platform_util_mac.mm",
|
||||
"shell/browser/ui/views/inspectable_web_contents_view_mac.mm",
|
||||
]
|
||||
|
||||
lib_sources_views = [
|
||||
@@ -213,6 +218,8 @@ filenames = {
|
||||
"shell/browser/ui/views/electron_views_delegate.h",
|
||||
"shell/browser/ui/views/frameless_view.cc",
|
||||
"shell/browser/ui/views/frameless_view.h",
|
||||
"shell/browser/ui/views/inspectable_web_contents_view_views.cc",
|
||||
"shell/browser/ui/views/inspectable_web_contents_view_views.h",
|
||||
"shell/browser/ui/views/menu_bar.cc",
|
||||
"shell/browser/ui/views/menu_bar.h",
|
||||
"shell/browser/ui/views/menu_delegate.cc",
|
||||
|
||||
@@ -433,15 +433,14 @@ WebContents.prototype.loadURL = function (url, options) {
|
||||
return p;
|
||||
};
|
||||
|
||||
WebContents.prototype.setWindowOpenHandler = function (handler: (details: Electron.HandlerDetails) => Electron.WindowOpenHandlerResponse) {
|
||||
WebContents.prototype.setWindowOpenHandler = function (handler: (details: Electron.HandlerDetails) => ({action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions, outlivesOpener?: boolean})) {
|
||||
this._windowOpenHandler = handler;
|
||||
};
|
||||
|
||||
WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event, details: Electron.HandlerDetails): {browserWindowConstructorOptions: BrowserWindowConstructorOptions | null, outlivesOpener: boolean, createWindow?: Electron.CreateWindowFunction} {
|
||||
WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event, details: Electron.HandlerDetails): {browserWindowConstructorOptions: BrowserWindowConstructorOptions | null, outlivesOpener: boolean} {
|
||||
const defaultResponse = {
|
||||
browserWindowConstructorOptions: null,
|
||||
outlivesOpener: false,
|
||||
createWindow: undefined
|
||||
outlivesOpener: false
|
||||
};
|
||||
if (!this._windowOpenHandler) {
|
||||
return defaultResponse;
|
||||
@@ -467,8 +466,7 @@ WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event,
|
||||
} else if (response.action === 'allow') {
|
||||
return {
|
||||
browserWindowConstructorOptions: typeof response.overrideBrowserWindowOptions === 'object' ? response.overrideBrowserWindowOptions : null,
|
||||
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false,
|
||||
createWindow: typeof response.createWindow === 'function' ? response.createWindow : undefined
|
||||
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false
|
||||
};
|
||||
} else {
|
||||
event.preventDefault();
|
||||
@@ -533,17 +531,6 @@ WebContents.prototype._init = function () {
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
// Add navigationHistory property which handles session history,
|
||||
// maintaining a list of navigation entries for backward and forward navigation.
|
||||
Object.defineProperty(this, 'navigationHistory', {
|
||||
value: {
|
||||
getActiveIndex: this._getActiveIndex.bind(this),
|
||||
length: this._historyLength.bind(this),
|
||||
getEntryAtIndex: this._getNavigationEntryAtIndex.bind(this)
|
||||
},
|
||||
writable: false
|
||||
});
|
||||
|
||||
// Dispatch IPC messages to the ipc module.
|
||||
this.on('-ipc-message' as any, function (this: Electron.WebContents, event: Electron.IpcMainEvent, internal: boolean, channel: string, args: any[]) {
|
||||
addSenderToEvent(event, this);
|
||||
@@ -666,16 +653,13 @@ WebContents.prototype._init = function () {
|
||||
postData,
|
||||
overrideBrowserWindowOptions: options || {},
|
||||
windowOpenArgs: details,
|
||||
outlivesOpener: result.outlivesOpener,
|
||||
createWindow: result.createWindow
|
||||
outlivesOpener: result.outlivesOpener
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let windowOpenOverriddenOptions: BrowserWindowConstructorOptions | null = null;
|
||||
let windowOpenOutlivesOpenerOption: boolean = false;
|
||||
let createWindow: Electron.CreateWindowFunction | undefined;
|
||||
|
||||
this.on('-will-add-new-contents' as any, (event: Electron.Event, url: string, frameName: string, rawFeatures: string, disposition: Electron.HandlerDetails['disposition'], referrer: Electron.Referrer, postData: PostData) => {
|
||||
const postBody = postData ? {
|
||||
data: postData,
|
||||
@@ -700,7 +684,6 @@ WebContents.prototype._init = function () {
|
||||
|
||||
windowOpenOutlivesOpenerOption = result.outlivesOpener;
|
||||
windowOpenOverriddenOptions = result.browserWindowConstructorOptions;
|
||||
createWindow = result.createWindow;
|
||||
if (!event.defaultPrevented) {
|
||||
const secureOverrideWebPreferences = windowOpenOverriddenOptions ? {
|
||||
// Allow setting of backgroundColor as a webPreference even though
|
||||
@@ -730,9 +713,6 @@ WebContents.prototype._init = function () {
|
||||
referrer: Electron.Referrer, rawFeatures: string, postData: PostData) => {
|
||||
const overriddenOptions = windowOpenOverriddenOptions || undefined;
|
||||
const outlivesOpener = windowOpenOutlivesOpenerOption;
|
||||
const windowOpenFunction = createWindow;
|
||||
|
||||
createWindow = undefined;
|
||||
windowOpenOverriddenOptions = null;
|
||||
// false is the default
|
||||
windowOpenOutlivesOpenerOption = false;
|
||||
@@ -755,8 +735,7 @@ WebContents.prototype._init = function () {
|
||||
frameName,
|
||||
features: rawFeatures
|
||||
},
|
||||
outlivesOpener,
|
||||
createWindow: windowOpenFunction
|
||||
outlivesOpener
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,16 +16,16 @@ export type WindowOpenArgs = {
|
||||
features: string,
|
||||
}
|
||||
|
||||
const frameNamesToWindow = new Map<string, WebContents>();
|
||||
const registerFrameNameToGuestWindow = (name: string, webContents: WebContents) => frameNamesToWindow.set(name, webContents);
|
||||
const frameNamesToWindow = new Map<string, BrowserWindow>();
|
||||
const registerFrameNameToGuestWindow = (name: string, win: BrowserWindow) => frameNamesToWindow.set(name, win);
|
||||
const unregisterFrameName = (name: string) => frameNamesToWindow.delete(name);
|
||||
const getGuestWebContentsByFrameName = (name: string) => frameNamesToWindow.get(name);
|
||||
const getGuestWindowByFrameName = (name: string) => frameNamesToWindow.get(name);
|
||||
|
||||
/**
|
||||
* `openGuestWindow` is called to create and setup event handling for the new
|
||||
* window.
|
||||
*/
|
||||
export function openGuestWindow ({ embedder, guest, referrer, disposition, postData, overrideBrowserWindowOptions, windowOpenArgs, outlivesOpener, createWindow }: {
|
||||
export function openGuestWindow ({ embedder, guest, referrer, disposition, postData, overrideBrowserWindowOptions, windowOpenArgs, outlivesOpener }: {
|
||||
embedder: WebContents,
|
||||
guest?: WebContents,
|
||||
referrer: Referrer,
|
||||
@@ -34,8 +34,7 @@ export function openGuestWindow ({ embedder, guest, referrer, disposition, postD
|
||||
overrideBrowserWindowOptions?: BrowserWindowConstructorOptions,
|
||||
windowOpenArgs: WindowOpenArgs,
|
||||
outlivesOpener: boolean,
|
||||
createWindow?: Electron.CreateWindowFunction
|
||||
}): void {
|
||||
}): BrowserWindow | undefined {
|
||||
const { url, frameName, features } = windowOpenArgs;
|
||||
const { options: parsedOptions } = parseFeatures(features);
|
||||
const browserWindowOptions = {
|
||||
@@ -49,42 +48,17 @@ export function openGuestWindow ({ embedder, guest, referrer, disposition, postD
|
||||
// To spec, subsequent window.open calls with the same frame name (`target` in
|
||||
// spec parlance) will reuse the previous window.
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#apis-for-creating-and-navigating-browsing-contexts-by-name
|
||||
const existingWebContents = getGuestWebContentsByFrameName(frameName);
|
||||
if (existingWebContents) {
|
||||
if (existingWebContents.isDestroyed()) {
|
||||
const existingWindow = getGuestWindowByFrameName(frameName);
|
||||
if (existingWindow) {
|
||||
if (existingWindow.isDestroyed() || existingWindow.webContents.isDestroyed()) {
|
||||
// FIXME(t57ser): The webContents is destroyed for some reason, unregister the frame name
|
||||
unregisterFrameName(frameName);
|
||||
} else {
|
||||
existingWebContents.loadURL(url);
|
||||
return;
|
||||
existingWindow.loadURL(url);
|
||||
return existingWindow;
|
||||
}
|
||||
}
|
||||
|
||||
if (createWindow) {
|
||||
const webContents = createWindow({
|
||||
webContents: guest,
|
||||
...browserWindowOptions
|
||||
});
|
||||
|
||||
if (guest != null) {
|
||||
if (webContents !== guest) {
|
||||
throw new Error('Invalid webContents. Created window should be connected to webContents passed with options object.');
|
||||
}
|
||||
|
||||
webContents.loadURL(url, {
|
||||
httpReferrer: referrer,
|
||||
...(postData && {
|
||||
postData,
|
||||
extraHeaders: formatPostDataHeaders(postData as Electron.UploadRawData[])
|
||||
})
|
||||
});
|
||||
|
||||
handleWindowLifecycleEvents({ embedder, frameName, guest, outlivesOpener });
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const window = new BrowserWindow({
|
||||
webContents: guest,
|
||||
...browserWindowOptions
|
||||
@@ -103,9 +77,11 @@ export function openGuestWindow ({ embedder, guest, referrer, disposition, postD
|
||||
});
|
||||
}
|
||||
|
||||
handleWindowLifecycleEvents({ embedder, frameName, guest: window.webContents, outlivesOpener });
|
||||
handleWindowLifecycleEvents({ embedder, frameName, guest: window, outlivesOpener });
|
||||
|
||||
embedder.emit('did-create-window', window, { url, frameName, options: browserWindowOptions, disposition, referrer, postData });
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,12 +92,12 @@ export function openGuestWindow ({ embedder, guest, referrer, disposition, postD
|
||||
*/
|
||||
const handleWindowLifecycleEvents = function ({ embedder, guest, frameName, outlivesOpener }: {
|
||||
embedder: WebContents,
|
||||
guest: WebContents,
|
||||
guest: BrowserWindow,
|
||||
frameName: string,
|
||||
outlivesOpener: boolean
|
||||
}) {
|
||||
const closedByEmbedder = function () {
|
||||
guest.removeListener('destroyed', closedByUser);
|
||||
guest.removeListener('closed', closedByUser);
|
||||
guest.destroy();
|
||||
};
|
||||
|
||||
@@ -134,11 +110,11 @@ const handleWindowLifecycleEvents = function ({ embedder, guest, frameName, outl
|
||||
if (!outlivesOpener) {
|
||||
embedder.once('current-render-view-deleted' as any, closedByEmbedder);
|
||||
}
|
||||
guest.once('destroyed', closedByUser);
|
||||
guest.once('closed', closedByUser);
|
||||
|
||||
if (frameName) {
|
||||
registerFrameNameToGuestWindow(frameName, guest);
|
||||
guest.once('destroyed', function () {
|
||||
guest.once('closed', function () {
|
||||
unregisterFrameName(frameName);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -209,22 +209,6 @@ type ExtraURLLoaderOptions = {
|
||||
headers: Record<string, { name: string, value: string | string[] }>;
|
||||
allowNonHttpProtocols: boolean;
|
||||
}
|
||||
|
||||
function validateHeader (name: any, value: any): void {
|
||||
if (typeof name !== 'string') {
|
||||
throw new TypeError('`name` should be a string in setHeader(name, value)');
|
||||
}
|
||||
if (value == null) {
|
||||
throw new Error('`value` required in setHeader("' + name + '", value)');
|
||||
}
|
||||
if (!isValidHeaderName(name)) {
|
||||
throw new Error(`Invalid header name: '${name}'`);
|
||||
}
|
||||
if (!isValidHeaderValue(value.toString())) {
|
||||
throw new Error(`Invalid value for header '${name}': '${value}'`);
|
||||
}
|
||||
}
|
||||
|
||||
function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & ExtraURLLoaderOptions {
|
||||
// eslint-disable-next-line node/no-deprecated-api
|
||||
const options: any = typeof optionsIn === 'string' ? url.parse(optionsIn) : { ...optionsIn };
|
||||
@@ -291,7 +275,12 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
|
||||
};
|
||||
const headers: Record<string, string | string[]> = options.headers || {};
|
||||
for (const [name, value] of Object.entries(headers)) {
|
||||
validateHeader(name, value);
|
||||
if (!isValidHeaderName(name)) {
|
||||
throw new Error(`Invalid header name: '${name}'`);
|
||||
}
|
||||
if (!isValidHeaderValue(value.toString())) {
|
||||
throw new Error(`Invalid value for header '${name}': '${value}'`);
|
||||
}
|
||||
const key = name.toLowerCase();
|
||||
urlLoaderOptions.headers[key] = { name, value };
|
||||
}
|
||||
@@ -362,10 +351,21 @@ export class ClientRequest extends Writable implements Electron.ClientRequest {
|
||||
}
|
||||
|
||||
setHeader (name: string, value: string) {
|
||||
if (typeof name !== 'string') {
|
||||
throw new TypeError('`name` should be a string in setHeader(name, value)');
|
||||
}
|
||||
if (value == null) {
|
||||
throw new Error('`value` required in setHeader("' + name + '", value)');
|
||||
}
|
||||
if (this._started || this._firstWrite) {
|
||||
throw new Error('Can\'t set headers after they are sent');
|
||||
}
|
||||
validateHeader(name, value);
|
||||
if (!isValidHeaderName(name)) {
|
||||
throw new Error(`Invalid header name: '${name}'`);
|
||||
}
|
||||
if (!isValidHeaderValue(value.toString())) {
|
||||
throw new Error(`Invalid value for header '${name}': '${value}'`);
|
||||
}
|
||||
|
||||
const key = name.toLowerCase();
|
||||
this._urlLoaderOptions.headers[key] = { name, value };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Buffer } from 'buffer';
|
||||
import { Dirent, constants } from 'fs';
|
||||
import { constants } from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
@@ -46,17 +46,7 @@ process._getOrCreateArchive = getOrCreateArchive;
|
||||
|
||||
const asarRe = /\.asar/i;
|
||||
|
||||
const {
|
||||
getValidatedPath,
|
||||
getOptions,
|
||||
getDirent
|
||||
} = __non_webpack_require__('internal/fs/utils');
|
||||
|
||||
const {
|
||||
validateBoolean,
|
||||
validateFunction
|
||||
} = __non_webpack_require__('internal/validators');
|
||||
|
||||
const { getValidatedPath } = __non_webpack_require__('internal/fs/utils');
|
||||
// In the renderer node internals use the node global URL but we do not set that to be
|
||||
// the global URL instance. We need to do instanceof checks against the internal URL impl
|
||||
const { URL: NodeURL } = __non_webpack_require__('internal/url');
|
||||
@@ -88,23 +78,6 @@ const gid = process.getgid?.() ?? 0;
|
||||
|
||||
const fakeTime = new Date();
|
||||
|
||||
function getDirents (p: string, { 0: names, 1: types }: any[][]): Dirent[] {
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
let type = types[i];
|
||||
const info = splitPath(path.join(p, names[i]));
|
||||
if (info.isAsar) {
|
||||
const archive = getOrCreateArchive(info.asarPath);
|
||||
if (!archive) continue;
|
||||
const stats = archive.stat(info.filePath);
|
||||
if (!stats) continue;
|
||||
type = stats.type;
|
||||
}
|
||||
names[i] = getDirent(p, names[i], type);
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
enum AsarFileType {
|
||||
kFile = (constants as any).UV_DIRENT_FILE,
|
||||
kDirectory = (constants as any).UV_DIRENT_DIR,
|
||||
@@ -689,27 +662,13 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return (encoding) ? buffer.toString(encoding) : buffer;
|
||||
};
|
||||
|
||||
type ReaddirOptions = { encoding: BufferEncoding | null; withFileTypes?: false, recursive?: false } | undefined | null;
|
||||
type ReaddirCallback = (err: NodeJS.ErrnoException | null, files: string[]) => void;
|
||||
|
||||
const { readdir } = fs;
|
||||
fs.readdir = function (pathArgument: string, options: ReaddirOptions, callback: ReaddirCallback) {
|
||||
callback = typeof options === 'function' ? options : callback;
|
||||
validateFunction(callback, 'callback');
|
||||
|
||||
options = getOptions(options);
|
||||
pathArgument = getValidatedPath(pathArgument);
|
||||
|
||||
if (options?.recursive != null) {
|
||||
validateBoolean(options?.recursive, 'options.recursive');
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
nextTick(callback!, [null, readdirSyncRecursive(pathArgument, options)]);
|
||||
return;
|
||||
}
|
||||
|
||||
fs.readdir = function (pathArgument: string, options?: { encoding?: string | null; withFileTypes?: boolean } | null, callback?: Function) {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = undefined;
|
||||
}
|
||||
if (!pathInfo.isAsar) return readdir.apply(this, arguments);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
|
||||
@@ -746,62 +705,12 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
nextTick(callback!, [null, files]);
|
||||
};
|
||||
|
||||
const { readdir: readdirPromise } = require('fs').promises;
|
||||
fs.promises.readdir = async function (pathArgument: string, options: ReaddirOptions) {
|
||||
options = getOptions(options);
|
||||
pathArgument = getValidatedPath(pathArgument);
|
||||
fs.promises.readdir = util.promisify(fs.readdir);
|
||||
|
||||
if (options?.recursive != null) {
|
||||
validateBoolean(options?.recursive, 'options.recursive');
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
return readdirRecursive(pathArgument, options);
|
||||
}
|
||||
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readdirPromise(pathArgument, options);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
|
||||
const archive = getOrCreateArchive(asarPath);
|
||||
if (!archive) {
|
||||
return Promise.reject(createError(AsarError.INVALID_ARCHIVE, { asarPath }));
|
||||
}
|
||||
|
||||
const files = archive.readdir(filePath);
|
||||
if (!files) {
|
||||
return Promise.reject(createError(AsarError.NOT_FOUND, { asarPath, filePath }));
|
||||
}
|
||||
|
||||
if (options?.withFileTypes) {
|
||||
const dirents = [];
|
||||
for (const file of files) {
|
||||
const childPath = path.join(filePath, file);
|
||||
const stats = archive.stat(childPath);
|
||||
if (!stats) {
|
||||
throw createError(AsarError.NOT_FOUND, { asarPath, filePath: childPath });
|
||||
}
|
||||
dirents.push(new fs.Dirent(file, stats.type));
|
||||
}
|
||||
return Promise.resolve(dirents);
|
||||
}
|
||||
|
||||
return Promise.resolve(files);
|
||||
};
|
||||
type ReaddirSyncOptions = { encoding: BufferEncoding | null; withFileTypes?: false };
|
||||
|
||||
const { readdirSync } = fs;
|
||||
fs.readdirSync = function (pathArgument: string, options: ReaddirOptions) {
|
||||
options = getOptions(options);
|
||||
pathArgument = getValidatedPath(pathArgument);
|
||||
|
||||
if (options?.recursive != null) {
|
||||
validateBoolean(options?.recursive, 'options.recursive');
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
return readdirSyncRecursive(pathArgument, options);
|
||||
}
|
||||
|
||||
fs.readdirSync = function (pathArgument: string, options: ReaddirSyncOptions | BufferEncoding | null) {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readdirSync.apply(this, arguments);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
@@ -816,7 +725,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
throw createError(AsarError.NOT_FOUND, { asarPath, filePath });
|
||||
}
|
||||
|
||||
if (options?.withFileTypes) {
|
||||
if (options && (options as ReaddirSyncOptions).withFileTypes) {
|
||||
const dirents = [];
|
||||
for (const file of files) {
|
||||
const childPath = path.join(filePath, file);
|
||||
@@ -832,8 +741,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return files;
|
||||
};
|
||||
|
||||
const binding = internalBinding('fs');
|
||||
const { internalModuleReadJSON, kUsePromises } = binding;
|
||||
const { internalModuleReadJSON } = internalBinding('fs');
|
||||
internalBinding('fs').internalModuleReadJSON = (pathArgument: string) => {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return internalModuleReadJSON(pathArgument);
|
||||
@@ -879,187 +787,6 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return (stats.type === AsarFileType.kDirectory) ? 1 : 0;
|
||||
};
|
||||
|
||||
async function readdirRecursive (originalPath: string, options: ReaddirOptions) {
|
||||
const result: any[] = [];
|
||||
|
||||
const pathInfo = splitPath(originalPath);
|
||||
let queue: [string, string[]][] = [];
|
||||
const withFileTypes = Boolean(options?.withFileTypes);
|
||||
|
||||
let initialItem = [];
|
||||
if (pathInfo.isAsar) {
|
||||
const archive = getOrCreateArchive(pathInfo.asarPath);
|
||||
if (!archive) return result;
|
||||
const files = archive.readdir(pathInfo.filePath);
|
||||
if (!files) return result;
|
||||
|
||||
// If we're in an asar dir, we need to ensure the result is in the same format as the
|
||||
// native call to readdir withFileTypes i.e. an array of arrays.
|
||||
initialItem = files;
|
||||
if (withFileTypes) {
|
||||
initialItem = [
|
||||
[...initialItem], initialItem.map((p: string) => {
|
||||
return internalBinding('fs').internalModuleStat(path.join(originalPath, p));
|
||||
})
|
||||
];
|
||||
}
|
||||
} else {
|
||||
initialItem = await binding.readdir(
|
||||
path.toNamespacedPath(originalPath),
|
||||
options!.encoding,
|
||||
withFileTypes,
|
||||
kUsePromises
|
||||
);
|
||||
}
|
||||
|
||||
queue = [[originalPath, initialItem]];
|
||||
|
||||
if (withFileTypes) {
|
||||
while (queue.length > 0) {
|
||||
// @ts-expect-error this is a valid array destructure assignment.
|
||||
const { 0: pathArg, 1: readDir } = queue.pop();
|
||||
for (const dirent of getDirents(pathArg, readDir)) {
|
||||
result.push(dirent);
|
||||
if (dirent.isDirectory()) {
|
||||
const direntPath = path.join(pathArg, dirent.name);
|
||||
const info = splitPath(direntPath);
|
||||
let readdirResult;
|
||||
if (info.isAsar) {
|
||||
const archive = getOrCreateArchive(info.asarPath);
|
||||
if (!archive) continue;
|
||||
const files = archive.readdir(info.filePath);
|
||||
if (!files) continue;
|
||||
|
||||
readdirResult = [
|
||||
[...files], files.map((p: string) => {
|
||||
return internalBinding('fs').internalModuleStat(path.join(direntPath, p));
|
||||
})
|
||||
];
|
||||
} else {
|
||||
readdirResult = await binding.readdir(
|
||||
direntPath,
|
||||
options!.encoding,
|
||||
true,
|
||||
kUsePromises
|
||||
);
|
||||
}
|
||||
queue.push([direntPath, readdirResult]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while (queue.length > 0) {
|
||||
// @ts-expect-error this is a valid array destructure assignment.
|
||||
const { 0: pathArg, 1: readDir } = queue.pop();
|
||||
for (const ent of readDir) {
|
||||
const direntPath = path.join(pathArg, ent);
|
||||
const stat = internalBinding('fs').internalModuleStat(direntPath);
|
||||
result.push(path.relative(originalPath, direntPath));
|
||||
|
||||
if (stat === 1) {
|
||||
const subPathInfo = splitPath(direntPath);
|
||||
let item = [];
|
||||
if (subPathInfo.isAsar) {
|
||||
const archive = getOrCreateArchive(subPathInfo.asarPath);
|
||||
if (!archive) return;
|
||||
const files = archive.readdir(subPathInfo.filePath);
|
||||
if (!files) return result;
|
||||
item = files;
|
||||
} else {
|
||||
item = await binding.readdir(
|
||||
path.toNamespacedPath(direntPath),
|
||||
options!.encoding,
|
||||
false,
|
||||
kUsePromises
|
||||
);
|
||||
}
|
||||
queue.push([direntPath, item]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function readdirSyncRecursive (basePath: string, options: ReaddirOptions) {
|
||||
const withFileTypes = Boolean(options!.withFileTypes);
|
||||
const encoding = options!.encoding;
|
||||
|
||||
const readdirResults: string[] = [];
|
||||
const pathsQueue = [basePath];
|
||||
|
||||
function read (pathArg: string) {
|
||||
let readdirResult;
|
||||
|
||||
const pathInfo = splitPath(pathArg);
|
||||
if (pathInfo.isAsar) {
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
const archive = getOrCreateArchive(asarPath);
|
||||
if (!archive) return;
|
||||
|
||||
readdirResult = archive.readdir(filePath);
|
||||
if (!readdirResult) return;
|
||||
// If we're in an asar dir, we need to ensure the result is in the same format as the
|
||||
// native call to readdir withFileTypes i.e. an array of arrays.
|
||||
if (withFileTypes) {
|
||||
readdirResult = [
|
||||
[...readdirResult], readdirResult.map((p: string) => {
|
||||
return internalBinding('fs').internalModuleStat(path.join(pathArg, p));
|
||||
})
|
||||
];
|
||||
}
|
||||
} else {
|
||||
readdirResult = binding.readdir(
|
||||
path.toNamespacedPath(pathArg),
|
||||
encoding,
|
||||
withFileTypes
|
||||
);
|
||||
}
|
||||
|
||||
if (readdirResult === undefined) return;
|
||||
|
||||
if (withFileTypes) {
|
||||
const length = readdirResult[0].length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
const resultPath = path.join(pathArg, readdirResult[0][i]);
|
||||
const info = splitPath(resultPath);
|
||||
|
||||
let type = readdirResult[1][i];
|
||||
if (info.isAsar) {
|
||||
const archive = getOrCreateArchive(info.asarPath);
|
||||
if (!archive) return;
|
||||
const stats = archive.stat(info.filePath);
|
||||
if (!stats) continue;
|
||||
type = stats.type;
|
||||
}
|
||||
|
||||
const dirent = getDirent(pathArg, readdirResult[0][i], type);
|
||||
|
||||
readdirResults.push(dirent);
|
||||
if (dirent.isDirectory()) {
|
||||
pathsQueue.push(path.join(dirent.path, dirent.name));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < readdirResult.length; i++) {
|
||||
const resultPath = path.join(pathArg, readdirResult[i]);
|
||||
const relativeResultPath = path.relative(basePath, resultPath);
|
||||
const stat = internalBinding('fs').internalModuleStat(resultPath);
|
||||
|
||||
readdirResults.push(relativeResultPath);
|
||||
if (stat === 1) pathsQueue.push(resultPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < pathsQueue.length; i++) {
|
||||
read(pathsQueue[i]);
|
||||
}
|
||||
|
||||
return readdirResults;
|
||||
}
|
||||
|
||||
// Calling mkdir for directory inside asar archive should throw ENOTDIR
|
||||
// error, but on Windows it throws ENOENT.
|
||||
if (process.platform === 'win32') {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"@electron/docs-parser": "^1.2.0",
|
||||
"@electron/fiddle-core": "^1.0.4",
|
||||
"@electron/github-app-auth": "^2.0.0",
|
||||
"@electron/lint-roller": "^1.12.1",
|
||||
"@electron/lint-roller": "^1.9.0",
|
||||
"@electron/typescript-definitions": "^8.15.2",
|
||||
"@octokit/rest": "^19.0.7",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
@@ -49,7 +49,7 @@
|
||||
"eslint-plugin-standard": "^4.0.1",
|
||||
"eslint-plugin-unicorn": "^46.0.1",
|
||||
"events": "^3.2.0",
|
||||
"express": "^4.19.2",
|
||||
"express": "^4.16.4",
|
||||
"folder-hash": "^2.1.1",
|
||||
"fs-extra": "^9.0.1",
|
||||
"got": "^11.8.5",
|
||||
|
||||
@@ -23,7 +23,7 @@ index 289a8c25f14cad42b9178ce94b11f67870be7434..5b91eadb698eeb5a87c9d0b2edf7e5cc
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 0eed4c5645d4e119393e9e0fbd770847eaf01030..95eb5224b90268937c1d24190c1234a5f42cb235 100644
|
||||
index 0ba40a2efd5d8e04d1237ec94046c36904560a2a..92334b605f839d9f126584763b5375a5a89e5326 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4684,6 +4684,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
|
||||
@@ -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 cc7b17e13c4c8b9e483df9a097b23935ab2e56bc..b89810659dab27dd8150c0b7185ea2b679ab98a4 100755
|
||||
index f3a8ba3756a19beb286a3f7bba52399705bf59bf..7cf72db56d3bc71cf6fb2b3f88a80e7866db1598 100755
|
||||
--- a/tools/licenses/licenses.py
|
||||
+++ b/tools/licenses/licenses.py
|
||||
@@ -336,6 +336,31 @@ SPECIAL_CASES = {
|
||||
|
||||
@@ -8,10 +8,10 @@ was removed as part of the Raw Clipboard API scrubbing.
|
||||
https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
|
||||
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
index 6095ece239ae3b3ef6795d54e5c8bc4d1bb730ff..43c39f61e7d040c9923dac60ddc50fce2e3ee038 100644
|
||||
index 6022a0af4241fe65bd03d7cbf95785e8879dc78e..ec9e4c6ece9014b66e7d65e99cda2b956a9a5d80 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
@@ -227,6 +227,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
|
||||
@@ -229,6 +229,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
@@ -29,7 +29,7 @@ index 6095ece239ae3b3ef6795d54e5c8bc4d1bb730ff..43c39f61e7d040c9923dac60ddc50fce
|
||||
objects_.clear();
|
||||
platform_representations_.clear();
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
index 6328d90cd1aca85c481b96bf859f0e9acb9de055..9aad0ae0134387fb2821d098a7d015ddd445de78 100644
|
||||
index 08fce03a51ded80c8dfe59f17a438ace21f8daa7..ffbd0cbff14ae7af2d00d5949f6b608e998e0429 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
@@ -89,6 +89,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
|
||||
|
||||
@@ -51,7 +51,7 @@ index a94977d7a76ae9952bbba0efe59a7cb5021a1c84..11c4f890eaeae1329ca5a6634a698aef
|
||||
void SendRendererPreferencesToRenderer(
|
||||
const blink::RendererPreferences& preferences);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 4c78692adb777b8e0a8fa2e2350775b7e2ef676a..fa18900586854c5d6b936d6b9e6fac1c9e571bce 100644
|
||||
index b95f3df368ce3bff6e7d2e38ac4d1984c7b9bac5..d6d2107313687f21e5ed619a5b79b266191265cb 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -553,8 +553,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
@@ -116,7 +116,7 @@ index c4348be90db209a757f21cbc518e1244fe0954d5..1ee953ad860291cdc1095880f6646d1d
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 735b6ae3eefaeb9c558a1cf63371f533685cc5db..986b4c9f35431ed14989d5f69fc09d17a2c3fda9 100644
|
||||
index fb042e637c831e3de72d7ed6fd33db9df5976c18..689010902c8508b85208618cc11b922adf10c08e 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2431,6 +2431,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -130,7 +130,7 @@ index 735b6ae3eefaeb9c558a1cf63371f533685cc5db..986b4c9f35431ed14989d5f69fc09d17
|
||||
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
|
||||
!old_state->is_in_back_forward_cache;
|
||||
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
|
||||
@@ -3932,10 +3936,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3937,10 +3941,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ index 0a742bbbd5e8e1eb3610cc32f785f779e8907e75..26967019244d409dadf4533405d4d5d2
|
||||
// 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 81e90b80d4ff25c7003e4e98f071848be98280d6..92cfe0001933cd18ecb7384ead1dda26f563e62b 100644
|
||||
index b89cc3f1dc53bc04793ebd2b4075df6e60193a73..0ba08a946155ee4d04a693cf26840a95f315b9a3 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -684,10 +684,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: boringssl BUILD.gn
|
||||
Build BoringSSL with some extra functions that nodejs needs.
|
||||
|
||||
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
|
||||
index 6a0e44685b3208663e89287894c55be8e1285a1a..084d29bf0a38f73aeeceb9a6649ae347a7ba9c9a 100644
|
||||
index feaef4bfd7f8c04c32f555ab2c61ec838844e355..ed49c4a14a0cd8c3ff0f7ed9c5dd78b385c623ea 100644
|
||||
--- a/third_party/boringssl/BUILD.gn
|
||||
+++ b/third_party/boringssl/BUILD.gn
|
||||
@@ -56,6 +56,21 @@ config("no_asm_config") {
|
||||
@@ -28,6 +28,6 @@ index 6a0e44685b3208663e89287894c55be8e1285a1a..084d29bf0a38f73aeeceb9a6649ae347
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
if (enable_rust_boringssl) {
|
||||
if (enable_rust) {
|
||||
rust_bindgen("raw_bssl_sys_bindings") {
|
||||
header = "src/rust/bssl-sys/wrapper.h"
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: build: allow electron to use exec_script
|
||||
This is similar to the //build usecase so we're OK adding ourselves here
|
||||
|
||||
diff --git a/.gn b/.gn
|
||||
index 6abe8e52e11154d5f3cb7c80d57754b1a3819e46..22adbcc359a53405b0c1b4dbc170a5c896eb2b5c 100644
|
||||
index afe0b3e90fafb9413cc49198cf3ad5d66d433b54..6b83b22994998ba98895144ec81b4cdff1b0e0db 100644
|
||||
--- a/.gn
|
||||
+++ b/.gn
|
||||
@@ -173,4 +173,8 @@ exec_script_whitelist =
|
||||
@@ -167,4 +167,8 @@ exec_script_whitelist =
|
||||
|
||||
"//tools/grit/grit_rule.gni",
|
||||
"//tools/gritsettings/BUILD.gn",
|
||||
|
||||
@@ -33,10 +33,10 @@ index 4af5b8d5da1c0ae4c5603f49e3a1dbfec422f55e..d21e450d1ee387a72bbe601412856260
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 34cdca093a7fb4cf849c2964e6542558966bf3b1..e0ac5b6c7412a017077c342ef2f3d13cc0123008 100644
|
||||
index 5d698b969a13448f548f033a6878219cbc9507c1..a76aa8859fbc0ed5c4fad29779f7ca784212d2bc 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4793,7 +4793,7 @@ static_library("browser") {
|
||||
@@ -4798,7 +4798,7 @@ static_library("browser") {
|
||||
|
||||
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
|
||||
# than here in :chrome_dll.
|
||||
@@ -46,10 +46,10 @@ index 34cdca093a7fb4cf849c2964e6542558966bf3b1..e0ac5b6c7412a017077c342ef2f3d13c
|
||||
sources += [ "certificate_viewer_stub.cc" ]
|
||||
}
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index bfb0033d1536941b52592a834b0c64d15cc1ed2c..2313065706e3c4531dfa8179a8b0ff26266aa7d9 100644
|
||||
index 3b670b8f271d4eacd554d59244949b9eed21f4e4..a7bdf2253872291e38d79ed67116878e3235b6c6 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7195,9 +7195,12 @@ test("unit_tests") {
|
||||
@@ -7201,9 +7201,12 @@ test("unit_tests") {
|
||||
"//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_2",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index bfb0033d1536941b52592a834b0c64d15cc1ed2c..2313065706e3c4531dfa8179a8b0ff26
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -8176,6 +8179,10 @@ test("unit_tests") {
|
||||
@@ -8184,6 +8187,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index bfb0033d1536941b52592a834b0c64d15cc1ed2c..2313065706e3c4531dfa8179a8b0ff26
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8245,7 +8252,6 @@ test("unit_tests") {
|
||||
@@ -8253,7 +8260,6 @@ test("unit_tests") {
|
||||
}
|
||||
|
||||
deps += [
|
||||
|
||||
@@ -9,7 +9,7 @@ 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 06360bebe3baaa7571c412c7182ccd1fd1078fda..c36367b28a627f7e6e77bcf3fc10f907b131523b 100644
|
||||
index 6066f87e7d50d08fe71b280d13935e9993888ff3..b22781e1b849373bcd899e1fd470b4a4185ebe15 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8389,6 +8389,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -66,7 +66,7 @@ index 268f150c1cc987ea020192a86ab886ed206a0064..05856b853112072a18ec16589f2b442f
|
||||
|
||||
// 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 05d036b9262689f2103a3df1ee30b7ec16c96a34..952356fa426c6cb7df85b837ccdff3661fa90531 100644
|
||||
index f697700af13bb7f889d16e26a11dd4ba566f9840..ee5c4ac09ce90139c830511ed7d49958a2bb692e 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -725,6 +725,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -79,7 +79,7 @@ index 05d036b9262689f2103a3df1ee30b7ec16c96a34..952356fa426c6cb7df85b837ccdff366
|
||||
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 48e6a6c74004650b5b07ce24f6476d7c9a306236..b777041ec1111444d690d1d188dd622ce4677d4c 100644
|
||||
index 6135759cb7f39b0d459d2a7c0d1560a43256cfac..d5b05ada6566b07b4232f1d20d1670e87502d03e 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -183,6 +183,7 @@ class NetworkService;
|
||||
@@ -148,10 +148,10 @@ index c44ef9991cbb07ab2895a28a890466ce1bc8235f..1384a322617b4be4b4ffbda5c44b41ac
|
||||
// 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 e131d7d256bad0ce6080e9817f196e60ca6c883c..0eed4c5645d4e119393e9e0fbd770847eaf01030 100644
|
||||
index 26d71550270ffd5e58bab5a9e947c80def47570a..0ba40a2efd5d8e04d1237ec94046c36904560a2a 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6686,6 +6686,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6688,6 +6688,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ index a55c4c5bbbb298bce97fe7c1072e5bca4c032c73..e6ffcfcefd2aa29a0d761051e6169950
|
||||
/googleurl
|
||||
/gpu/gles2_conform_test
|
||||
diff --git a/third_party/.gitignore b/third_party/.gitignore
|
||||
index 71ff59deb05168f0090e1887c954f60de337ad44..18c70eec5ecc1900a70e4b8c20c657588e0566e4 100644
|
||||
index 1a18347e45e1e82834efde9718d9bb33531dd234..b0007c4b305dc681dc9cb951c499e7bcbe54d717 100644
|
||||
--- a/third_party/.gitignore
|
||||
+++ b/third_party/.gitignore
|
||||
@@ -51,7 +51,9 @@
|
||||
@@ -39,7 +39,7 @@ index 71ff59deb05168f0090e1887c954f60de337ad44..18c70eec5ecc1900a70e4b8c20c65758
|
||||
/ninja/ninja*
|
||||
/node/*.tar.gz
|
||||
/node/linux/
|
||||
@@ -148,6 +151,7 @@
|
||||
@@ -149,6 +152,7 @@
|
||||
/soda-win64
|
||||
/speex
|
||||
/sqlite4java/lib/
|
||||
|
||||
@@ -34,10 +34,10 @@ index 8d5b01098915dd8e27ed047fa3a250169157a382..797670a6d0a34f25ee5d6f266bb2a1f5
|
||||
Widget* GetWidget();
|
||||
const Widget* GetWidget() const;
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 259dc1a97511864256085bf9cb5806f17fddad8c..9e750772739b966647ae4effe625edc11ecf6c04 100644
|
||||
index ceb278617bd3621aa70671ac620d0c9969d56a38..577aa886b1ea3d942ae7b2bbca85ea6ae93fea7a 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3118,15 +3118,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
@@ -3128,15 +3128,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
SetMsgHandled(FALSE);
|
||||
// We must let Windows handle the caption buttons if it's drawing them, or
|
||||
// they won't work.
|
||||
|
||||
@@ -9,7 +9,7 @@ Electron does not support Profiles, so this Profile::FromBrowserContext()
|
||||
call is not needed and will not link. This change patches it out.
|
||||
|
||||
diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
|
||||
index 489b19328cd26afba530ce066d76eabdd808e38d..e8a32d20406b490418319f971c030e6765f6cc3d 100644
|
||||
index a0c5971008d6d7238f2cf13c046a0e19d5454c7a..f22ddd167a1613732d7166d18050400818bf32f0 100644
|
||||
--- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
|
||||
+++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
|
||||
@@ -44,6 +44,7 @@ namespace {
|
||||
|
||||
@@ -102,10 +102,10 @@ index 2b0919b9a56bd37a398109777dfd199d777a9f74..823f44ab0303ccd6c7502ec65560ddb5
|
||||
friend class ContentClientCreator;
|
||||
friend class ContentClientInitializer;
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index bf101d76e22d80fe909d0eebe1f5c2c399cb09b9..3f8ca1e015e88a5d50d80903ecd0526778af0d58 100644
|
||||
index d069889816cbc50a922bed055c78d6779c49e03d..158a96fd3a14fe975554a0d0c40c80f090eb6490 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -575,8 +575,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
@@ -577,8 +577,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
|
||||
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
||||
|
||||
@@ -115,7 +115,7 @@ index bf101d76e22d80fe909d0eebe1f5c2c399cb09b9..3f8ca1e015e88a5d50d80903ecd05267
|
||||
if (g_mapped_snapshot) {
|
||||
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
|
||||
// files in a process.
|
||||
@@ -585,10 +584,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
@@ -587,10 +586,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
|
||||
base::MemoryMappedFile::Region file_region;
|
||||
base::File file =
|
||||
|
||||
@@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
|
||||
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
|
||||
|
||||
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
|
||||
index 0019c6a54eb8c509597cad4b6727a23dec2926ed..b37cb96cb5d6a55671942cc4315100f81e23d7ba 100644
|
||||
index d8f2a9bee7f2b7a7e9cf3582f707da36c00099b0..a060087b655218864425500e8bd4dfe2359ec4ec 100644
|
||||
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
|
||||
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
|
||||
@@ -1947,6 +1947,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
@@ -1966,6 +1966,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
loader_factory_bundle_info =
|
||||
context()->loader_factory_bundle_for_update_check()->Clone();
|
||||
|
||||
@@ -38,7 +38,7 @@ index 0019c6a54eb8c509597cad4b6727a23dec2926ed..b37cb96cb5d6a55671942cc4315100f8
|
||||
if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
|
||||
browser_context(), scope)) {
|
||||
// If this is a Service Worker for a WebUI, the WebUI's URLDataSource
|
||||
@@ -1966,9 +1986,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
@@ -1985,9 +2005,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
features::kEnableServiceWorkersForChromeScheme) &&
|
||||
scope.scheme_piece() == kChromeUIScheme) {
|
||||
config->RegisterURLDataSource(browser_context());
|
||||
@@ -49,7 +49,7 @@ index 0019c6a54eb8c509597cad4b6727a23dec2926ed..b37cb96cb5d6a55671942cc4315100f8
|
||||
.emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
|
||||
browser_context(), kChromeUIScheme,
|
||||
base::flat_set<std::string>()));
|
||||
@@ -1976,9 +1994,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
@@ -1995,9 +2013,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
features::kEnableServiceWorkersForChromeUntrusted) &&
|
||||
scope.scheme_piece() == kChromeUIUntrustedScheme) {
|
||||
config->RegisterURLDataSource(browser_context());
|
||||
|
||||
@@ -82,10 +82,10 @@ index afc2cf89299315cca68b50196c2377a7d474883d..52bfd487d501ef895915800b9ee83a5b
|
||||
const Source& GetSource(int index) const override;
|
||||
DesktopMediaList::Type GetMediaListType() const override;
|
||||
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
index 2b736f68d112aa3780548f10ce5f461374356ef9..2529b53a4815c619ba75c61cf1d44f9433022a8c 100644
|
||||
index 335792a98ee6db5dd742b532fbf29efb142da26e..764535ed5855296de2139ca2405a43e146300104 100644
|
||||
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
|
||||
@@ -170,7 +170,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
BASE_FEATURE(kWindowCaptureMacV2,
|
||||
"WindowCaptureMacV2",
|
||||
@@ -94,7 +94,7 @@ index 2b736f68d112aa3780548f10ce5f461374356ef9..2529b53a4815c619ba75c61cf1d44f94
|
||||
#endif
|
||||
|
||||
content::DesktopMediaID::Type ConvertToDesktopMediaIDType(
|
||||
@@ -345,7 +345,7 @@ class NativeDesktopMediaList::Worker
|
||||
@@ -355,7 +355,7 @@ class NativeDesktopMediaList::Worker
|
||||
base::WeakPtr<NativeDesktopMediaList> media_list_;
|
||||
|
||||
DesktopMediaID::Type source_type_;
|
||||
@@ -103,7 +103,7 @@ index 2b736f68d112aa3780548f10ce5f461374356ef9..2529b53a4815c619ba75c61cf1d44f94
|
||||
const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
|
||||
const bool add_current_process_windows_;
|
||||
|
||||
@@ -633,6 +633,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
|
||||
@@ -643,6 +643,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
|
||||
FROM_HERE,
|
||||
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
|
||||
media_list_));
|
||||
@@ -116,7 +116,7 @@ index 2b736f68d112aa3780548f10ce5f461374356ef9..2529b53a4815c619ba75c61cf1d44f94
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::Worker::OnCaptureResult(
|
||||
@@ -1017,6 +1023,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
|
||||
@@ -1027,6 +1033,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
|
||||
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
|
||||
base::Unretained(worker_.get()),
|
||||
std::move(native_ids), thumbnail_size_));
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: disabling compositor recycling
|
||||
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 39e03b029c4ebf03020f6cc8b67922f73652772a..3ca1d0e229a5c0892fe431c606acbe43bcc0707b 100644
|
||||
index 96283a4f72b32eb45357eb6ec1f5b807593d5f07..ef9a5d3b4b99b40a8785c59c4e7ab495c6aa811c 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -557,7 +557,11 @@
|
||||
|
||||
@@ -33,7 +33,7 @@ index fb89c4500eeae064c6c8f3d4c0ad7b5b4deecb5a..52868268ba4843e0743284afc684e549
|
||||
void StartDragging(blink::mojom::DragDataPtr drag_data,
|
||||
const url::Origin& source_origin,
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 094686284afc96d9719ca1821092863d1e160e0c..4c78692adb777b8e0a8fa2e2350775b7e2ef676a 100644
|
||||
index e065ce0700764bcfd29b1e91eff76104908ae1a3..b95f3df368ce3bff6e7d2e38ac4d1984c7b9bac5 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -614,7 +614,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
|
||||
@@ -19,10 +19,10 @@ index f63948de2c5bfa589ea3ada817bb0820697e4bb2..8c009b8e50049d49e47802395d1499b4
|
||||
excluded_margin);
|
||||
}
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 7516856fb93141302a4cfa92c2d14d4bdd2f8018..e209fa1848263e52d87cac8aa61e5c219e54a2e1 100644
|
||||
index b1f7412f7a8e7d3264545e2854c57c4f58541bae..871ec001eea168aaa47dcaf225342bbcf7106ee4 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -963,8 +963,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
|
||||
@@ -964,8 +964,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 851280c5c26cb93a6a80977b0b3a9815ce2d5d11..df7c34715576f27f20fb1850c8adb8c74bc88ff9 100644
|
||||
index a68c23c049078ce0e1d893dd1921c1e55ebe1019..9fa71011ed7c7ec9e1d3191cab34b7b741280004 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1614,6 +1614,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -51,7 +51,7 @@ index 851280c5c26cb93a6a80977b0b3a9815ce2d5d11..df7c34715576f27f20fb1850c8adb8c7
|
||||
// This may only be called on NetworkContexts created with the constructor
|
||||
// that calls MakeURLRequestContext().
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 7cb0642b4661c5415b4f8f4a934ef32f27b9eb28..382ee5ff8352fb0c4623fdb12b5673479231e8ea 100644
|
||||
index 5db4f275fb5b619f0dba5526202fec6e8a69399a..37db9e43d950010bec8048ddd76068c340431b0d 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -315,6 +315,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -63,7 +63,7 @@ index 7cb0642b4661c5415b4f8f4a934ef32f27b9eb28..382ee5ff8352fb0c4623fdb12b567347
|
||||
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 567d6f230e33b2e7d9ff8e3f768fc4c94704eaac..7a4e4b3a60a868bb8848f701b77fea5229212506 100644
|
||||
index 01e438f5060f8e249a599712248586d26f3b7b47..48d75aeed63b046659512b642ea4d2c964d8d408 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1252,6 +1252,9 @@ interface NetworkContext {
|
||||
@@ -77,7 +77,7 @@ index 567d6f230e33b2e7d9ff8e3f768fc4c94704eaac..7a4e4b3a60a868bb8848f701b77fea52
|
||||
SetAcceptLanguage(string new_accept_language);
|
||||
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index 3061938ac5af0f2f1dbe0e0c70457b21ab1cd6c2..e8b682d80e4ea30c12a71402a130751e0f093bdf 100644
|
||||
index 981fc599cee08d36387ef4265a6c7c5816c174ac..d17290e52fcc1e27d44fe77e4f6d4c713edf0683 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -147,6 +147,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
|
||||
@@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be
|
||||
done in future work.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 986b4c9f35431ed14989d5f69fc09d17a2c3fda9..b88f27942cbefb1c3ae819a3fc4135d8a3a819fa 100644
|
||||
index 689010902c8508b85208618cc11b922adf10c08e..291b943982fcda859cd55e8dd2be57bb9e7b1bfa 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -167,6 +167,7 @@
|
||||
|
||||
@@ -13,10 +13,10 @@ uses internally for things like menus and devtools.
|
||||
We can remove this patch once it has in some shape been upstreamed.
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
|
||||
index c5bcbe62463a418cf78c4813678d7a1e39c4dd9d..f51e2e70bb249f5113ee592f121e53d61bc334fc 100644
|
||||
index d466e72df7e2c7094ed80d6b70b78eab7a93ba4c..a9a10f2c91a473c41d5e2a0ce7ce2608894f55a8 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -191,6 +191,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
|
||||
@@ -209,6 +209,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
|
||||
NativeTheme::~NativeTheme() = default;
|
||||
|
||||
bool NativeTheme::ShouldUseDarkColors() const {
|
||||
@@ -26,7 +26,7 @@ index c5bcbe62463a418cf78c4813678d7a1e39c4dd9d..f51e2e70bb249f5113ee592f121e53d6
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index e1c2037c320efc78bc9df701960af57aa0ef180c..3a74da489cfbe6457aa9a206364a977bb3052d80 100644
|
||||
index 3385e9e9d5690d746d4935f3ddc74bc09746c017..278663682017393b1cd52475d8fffb601d0cbe25 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -443,6 +443,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -53,19 +53,19 @@ index e1c2037c320efc78bc9df701960af57aa0ef180c..3a74da489cfbe6457aa9a206364a977b
|
||||
// Returns a shared instance of the native theme that should be used for web
|
||||
// rendering. Do not use it in a normal application context (i.e. browser).
|
||||
// The returned object should not be deleted by the caller. This function is
|
||||
@@ -658,6 +675,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
bool inverted_colors_ = false;
|
||||
@@ -672,6 +689,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
|
||||
PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;
|
||||
std::optional<base::TimeDelta> caret_blink_interval_;
|
||||
+ ThemeSource theme_source_ = ThemeSource::kSystem;
|
||||
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
};
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index 9830931142e76fe117266e64444d50f83eefa842..a9313c3bac674ca3e785adfe10ec4a03d74245c8 100644
|
||||
index 566230f830edec321ec3032b81e3478f155912c6..65d4d09c1e9e50197244a3e0f79ace8498463774 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -661,6 +661,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
@@ -673,6 +673,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
// ...unless --force-dark-mode was specified in which case caveat emptor.
|
||||
if (InForcedColorsMode() && !IsForcedDarkMode())
|
||||
return false;
|
||||
|
||||
@@ -140,7 +140,7 @@ index f5c5ff2c89489257003dfe3284ee9de9f517c99b..fdd2e2483171c4d43963590200817dac
|
||||
|
||||
// JavaScript from chrome and chrome-untrusted pages. The resource URLs are
|
||||
diff --git a/content/browser/code_cache/generated_code_cache_browsertest.cc b/content/browser/code_cache/generated_code_cache_browsertest.cc
|
||||
index 50e0966199b18f88f85443016f57e8e217d7cf9c..fca44ad6a96981349a52dc2eeff4626e4dcb8bcd 100644
|
||||
index 6f86563fe6c80ecd3db75b9480e1ed13399ccc18..31ef1e43db6ea4a51333d1ae4f84c3c274e26b53 100644
|
||||
--- a/content/browser/code_cache/generated_code_cache_browsertest.cc
|
||||
+++ b/content/browser/code_cache/generated_code_cache_browsertest.cc
|
||||
@@ -8,13 +8,18 @@
|
||||
@@ -171,7 +171,7 @@ index 50e0966199b18f88f85443016f57e8e217d7cf9c..fca44ad6a96981349a52dc2eeff4626e
|
||||
bool SupportsSharedWorker() {
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// SharedWorkers are not enabled on Android. https://crbug.com/154571
|
||||
@@ -710,4 +717,82 @@ IN_PROC_BROWSER_TEST_F(LocalCompileHintsBrowserTest, LocalCompileHints) {
|
||||
@@ -714,4 +721,82 @@ IN_PROC_BROWSER_TEST_F(LocalCompileHintsBrowserTest, LocalCompileHints) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,19 +110,19 @@ index 8736af0021dccba915e3d2303191ae3ec80f6e75..56f8384c3ff4959272363cb71e4c380e
|
||||
}
|
||||
|
||||
diff --git a/content/browser/child_process_launcher_helper_win.cc b/content/browser/child_process_launcher_helper_win.cc
|
||||
index 1d6bc6590720cda38983203455cc20638710148f..8f965150db13d3f4fe1757a021b9a2f6446529d6 100644
|
||||
index 220eab3370bb2632150f845d29ab7babf44472f5..6f055560ecfe480de1c7c8f4f2c22a5977043b9c 100644
|
||||
--- a/content/browser/child_process_launcher_helper_win.cc
|
||||
+++ b/content/browser/child_process_launcher_helper_win.cc
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "sandbox/policy/win/sandbox_win.h"
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "mojo/public/cpp/platform/platform_channel.h"
|
||||
#include "sandbox/win/src/sandbox_types.h"
|
||||
|
||||
+#include <windows.h>
|
||||
+
|
||||
namespace {
|
||||
|
||||
// /prefetch:# arguments to use when launching various process types. It has
|
||||
@@ -189,6 +191,30 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
// Helper to avoid marking the log file as non-executable every time we launch a
|
||||
@@ -259,6 +261,30 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
mojo_channel_->PrepareToPassRemoteEndpoint(&options->handles_to_inherit,
|
||||
command_line());
|
||||
}
|
||||
@@ -153,7 +153,7 @@ index 1d6bc6590720cda38983203455cc20638710148f..8f965150db13d3f4fe1757a021b9a2f6
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -216,7 +242,7 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThread(
|
||||
@@ -286,7 +312,7 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThread(
|
||||
ChildProcessLauncherHelper::Process process;
|
||||
*launch_result =
|
||||
StartSandboxedProcess(delegate_.get(), *command_line(),
|
||||
|
||||
@@ -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 5b5583740d5ea67e4d68447ceca675b83cb0acee..d9cbb47b71946a12ca493dd1c766bf18d3de76f6 100644
|
||||
index 5c4a1aed2e63aa16b0011375502532d85d543887..6f638b2003ff86bc06bd82402ab358dfb61c58b7 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -905,13 +905,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
@@ -906,13 +906,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
|
||||
|
||||
void HWNDMessageHandler::PaintAsActiveChanged() {
|
||||
if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
|
||||
@@ -33,7 +33,7 @@ index 5b5583740d5ea67e4d68447ceca675b83cb0acee..d9cbb47b71946a12ca493dd1c766bf18
|
||||
}
|
||||
|
||||
void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
|
||||
@@ -2258,17 +2258,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
||||
@@ -2268,17 +2268,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
|
||||
if (IsVisible())
|
||||
delegate_->SchedulePaint();
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Linux or Windows to un-fullscreen in some circumstances without this
|
||||
change.
|
||||
|
||||
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
index 243af5d34d99577d1e0b7205cf059962035b26f7..81a164a0fc8ff304814e0cc5990c544a7c0c7519 100644
|
||||
index f80cafcb32bb84070e451e4e5a3ede4d25a40aeb..b181478f43f4f42acb327e65dd8345b9fded029a 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
@@ -16,12 +16,16 @@
|
||||
@@ -77,7 +77,7 @@ index 243af5d34d99577d1e0b7205cf059962035b26f7..81a164a0fc8ff304814e0cc5990c544a
|
||||
}
|
||||
|
||||
void FullscreenController::RunOrDeferUntilTransitionIsComplete(
|
||||
@@ -486,18 +496,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -498,18 +508,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
|
||||
// from manually entering fullscreen mode and also disables kiosk mode on
|
||||
// desktop platforms.
|
||||
@@ -101,7 +101,7 @@ index 243af5d34d99577d1e0b7205cf059962035b26f7..81a164a0fc8ff304814e0cc5990c544a
|
||||
if (option == TAB) {
|
||||
url = GetRequestingOrigin();
|
||||
tab_fullscreen_ = true;
|
||||
@@ -530,6 +539,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -542,6 +551,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
if (!extension_caused_fullscreen_.is_empty())
|
||||
url = extension_caused_fullscreen_;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ index 243af5d34d99577d1e0b7205cf059962035b26f7..81a164a0fc8ff304814e0cc5990c544a
|
||||
|
||||
fullscreen_start_time_ = base::TimeTicks::Now();
|
||||
if (option == BROWSER)
|
||||
@@ -549,6 +559,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -561,6 +571,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
if (chrome::IsRunningInAppMode())
|
||||
return;
|
||||
|
||||
@@ -117,7 +117,7 @@ index 243af5d34d99577d1e0b7205cf059962035b26f7..81a164a0fc8ff304814e0cc5990c544a
|
||||
// `fullscreen_start_time_` is null if a fullscreen tab moves to a new window.
|
||||
if (fullscreen_start_time_ && exclusive_access_tab()) {
|
||||
ukm::SourceId source_id =
|
||||
@@ -560,15 +571,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -572,15 +583,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
.Record(ukm::UkmRecorder::Get());
|
||||
fullscreen_start_time_.reset();
|
||||
}
|
||||
@@ -138,10 +138,10 @@ index 243af5d34d99577d1e0b7205cf059962035b26f7..81a164a0fc8ff304814e0cc5990c544a
|
||||
extension_caused_fullscreen_ = GURL();
|
||||
|
||||
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.h b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
index 439f0aaceb443e650c82951bd1dffc937d58f2a2..781e02163bf11ac40bd82081465d08f5bb4be448 100644
|
||||
index 94a4cae3185365f492b902e5c0e9cc19ed7733ff..83ff0bd57e63571e2c157de2ec7586d46d6ff87f 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
@@ -248,10 +248,12 @@ class FullscreenController : public ExclusiveAccessControllerBase {
|
||||
@@ -251,10 +251,12 @@ class FullscreenController : public ExclusiveAccessControllerBase {
|
||||
// Used in testing to set the state to tab fullscreen.
|
||||
bool is_tab_fullscreen_for_testing_ = false;
|
||||
|
||||
|
||||
@@ -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 e209fa1848263e52d87cac8aa61e5c219e54a2e1..259dc1a97511864256085bf9cb5806f17fddad8c 100644
|
||||
index 871ec001eea168aaa47dcaf225342bbcf7106ee4..ceb278617bd3621aa70671ac620d0c9969d56a38 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3665,14 +3665,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
|
||||
@@ -3675,14 +3675,29 @@ 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);
|
||||
|
||||
@@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
|
||||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
|
||||
index 1ca5ce3110edea41fde30db79b384489d0297977..072d02f2130294d59176e510caafade29feca96f 100644
|
||||
index 52cdd617511bd4f5a5f6666914bc99131e0f4980..1c067652d2757b8b0c6719d3797a69de82c61cef 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -10420,6 +10420,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
@@ -10422,6 +10422,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
return std::make_pair(parent->GetLastCommittedOrigin(), "about_srcdoc");
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ focus node change via TextInputManager.
|
||||
chromium-bug: https://crbug.com/1369605
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index fa18900586854c5d6b936d6b9e6fac1c9e571bce..6df34cc1c58d5722d6b6832abb47d2376a7818d8 100644
|
||||
index d6d2107313687f21e5ed619a5b79b266191265cb..035711ff9eeba7d3e7833ba95d6cf782186cbcb9 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -2916,6 +2916,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
|
||||
@@ -2921,6 +2921,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ index fa18900586854c5d6b936d6b9e6fac1c9e571bce..6df34cc1c58d5722d6b6832abb47d237
|
||||
RenderWidgetHostViewAura* popup_child_host_view) {
|
||||
popup_child_host_view_ = popup_child_host_view;
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
|
||||
index e44b23e055f985fea140a41a87f10a5423f7c77d..d1e09b159746ad13de9f3fea6b189bb9db041434 100644
|
||||
index 1fabbf3e1f8ec327120678d2a1fd6bdfda3568a0..a649351845d845b04592a468ff4447721f52d6bc 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
|
||||
@@ -628,6 +628,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
||||
@@ -629,6 +629,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
||||
RenderWidgetHostViewBase* updated_view) override;
|
||||
void OnTextSelectionChanged(TextInputManager* text_input_mangager,
|
||||
RenderWidgetHostViewBase* updated_view) override;
|
||||
|
||||
@@ -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 9e750772739b966647ae4effe625edc11ecf6c04..5b5583740d5ea67e4d68447ceca675b83cb0acee 100644
|
||||
index 577aa886b1ea3d942ae7b2bbca85ea6ae93fea7a..5c4a1aed2e63aa16b0011375502532d85d543887 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -1738,7 +1738,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
|
||||
@@ -1739,7 +1739,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
|
||||
SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS),
|
||||
0);
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ index cba373664bec3a32abad6fe0396bd67b53b7e67f..7a985067b1371604644d48159f2f5aa7
|
||||
|
||||
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 92cfe0001933cd18ecb7384ead1dda26f563e62b..0e90800b13e3d0fd18e4c8c32f0a90d64bcff4b9 100644
|
||||
index 0ba08a946155ee4d04a693cf26840a95f315b9a3..2c6203cf838b6c988e49ffffe147264919d312c9 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -2982,6 +2982,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -2991,6 +2991,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -75,7 +75,7 @@ index 92cfe0001933cd18ecb7384ead1dda26f563e62b..0e90800b13e3d0fd18e4c8c32f0a90d6
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_behavior) {
|
||||
@@ -3015,7 +3016,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3024,7 +3025,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
PausableScriptExecutor::CreateAndRun(
|
||||
script_state, std::move(script_sources), execute_script_policy,
|
||||
user_gesture, evaluation_timing, blocking_option, want_result_option,
|
||||
@@ -85,7 +85,7 @@ index 92cfe0001933cd18ecb7384ead1dda26f563e62b..0e90800b13e3d0fd18e4c8c32f0a90d6
|
||||
|
||||
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 b05cbf16c6917c646684774829493ad6c908d465..38c9e6c423144fa1f15dc8bc0d76109428b888cb 100644
|
||||
index fe3a87df88b5959cdc388123738d836625ccfaad..328cd42b4c7595181f6477a9d6b3a63af8939e7b 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
@@ -825,6 +825,7 @@ class CORE_EXPORT LocalFrame final
|
||||
|
||||
@@ -20,7 +20,7 @@ index 91521d844841ba42cc98b98ec646e0a36f2cc393..62a069836bc680bd82559eaa1eb5a7f1
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index b777041ec1111444d690d1d188dd622ce4677d4c..7541c01f350b41e5b69a6d91f6ab10409615f2a8 100644
|
||||
index d5b05ada6566b07b4232f1d20d1670e87502d03e..c0650175d71dfb9165fe95da74d5bb6e01fc6343 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -308,6 +308,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
@@ -38,10 +38,10 @@ index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7
|
||||
// Returns whether `Initialize` has already been invoked in the process.
|
||||
// Initialization is a one-way operation (i.e., this method cannot return
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 87a32462a37a1226dfc14b47bf73b9f21f9eb898..bf101d76e22d80fe909d0eebe1f5c2c399cb09b9 100644
|
||||
index c8a18ab7ed686111c31147920604dc005abf5829..d069889816cbc50a922bed055c78d6779c49e03d 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -463,7 +463,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
|
||||
@@ -465,7 +465,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
|
||||
// static
|
||||
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
const std::string js_command_line_flags,
|
||||
@@ -51,7 +51,7 @@ index 87a32462a37a1226dfc14b47bf73b9f21f9eb898..bf101d76e22d80fe909d0eebe1f5c2c3
|
||||
static bool v8_is_initialized = false;
|
||||
if (v8_is_initialized)
|
||||
return;
|
||||
@@ -473,7 +474,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
@@ -475,7 +476,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
// See https://crbug.com/v8/11043
|
||||
SetFlags(mode, js_command_line_flags);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 af3d2926f558788796ba09b3adc0960c24096a2a..2b4b2e54ef1a7424bb675ff6d2f98b976a747fea 100644
|
||||
index 3b6a1acc7deefa79f90d3413a6862bd5b94ed416..abdbcaceab717ec10e045870d3522da1e6131164 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -1283,6 +1283,11 @@
|
||||
|
||||
@@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1:
|
||||
Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903
|
||||
|
||||
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
|
||||
index 677ce05277c770d901829b6b6bc5242a448ed0c9..b8fc1ec916848f8fc301e043e7e28c4303209087 100755
|
||||
index 1c9c6fcc4dda9b38e71b5fc0d6feca4c75c350f4..299d765be8856c01a31af477f2c2e22012802dfe 100755
|
||||
--- a/tools/clang/scripts/update.py
|
||||
+++ b/tools/clang/scripts/update.py
|
||||
@@ -306,6 +306,8 @@ def GetDefaultHostOs():
|
||||
|
||||
@@ -35,10 +35,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to
|
||||
system priority.
|
||||
|
||||
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
||||
index 353b3e7c6a519570af5a4842135388a8cc01e130..a836d7380a396813ec0a7a294c91ae0d09cc889f 100644
|
||||
index 25356ec40cdbf63c89ccc4b05245b00d65e0739a..0c347ca1a75a9c894a0dc067ef87c34ae5a5b495 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1050,6 +1050,7 @@ component("base") {
|
||||
@@ -1058,6 +1058,7 @@ component("base") {
|
||||
"//build/config/compiler:prevent_unsafe_narrowing",
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
"//build/config/compiler:wglobal_constructors",
|
||||
@@ -471,7 +471,7 @@ index 7c53d9b2015c6c57f19c23c52c1aab3ffeea15ea..f6b7ba2f3512dcd2528323bb6853452c
|
||||
libs = []
|
||||
frameworks = []
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index abdf8a8d28639dc3735d3dc5bd309c237917f087..c08c84c3b243a6bafd358a34cbb391a6d6a9262a 100644
|
||||
index e9e46e9c3ccfc08032cbeffdd6342236bbc6406c..c6836ccf3fc6089144bb31a248aea7a6f6af06f1 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -21,7 +21,9 @@
|
||||
@@ -500,7 +500,7 @@ index abdf8a8d28639dc3735d3dc5bd309c237917f087..c08c84c3b243a6bafd358a34cbb391a6
|
||||
|
||||
// Use native VoiceOver support for live regions.
|
||||
BrowserAccessibilityCocoa* retained_node = native_node;
|
||||
@@ -621,6 +625,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -619,6 +623,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
return window == [NSApp accessibilityFocusedWindow];
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ index abdf8a8d28639dc3735d3dc5bd309c237917f087..c08c84c3b243a6bafd358a34cbb391a6
|
||||
// TODO(accessibility): We need a solution to the problem described below.
|
||||
// If the window is NSAccessibilityRemoteUIElement, there are some challenges:
|
||||
// 1. NSApp is the browser which spawned the PWA, and what it considers the
|
||||
@@ -649,6 +654,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -647,6 +652,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) {
|
||||
return true;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ index abdf8a8d28639dc3735d3dc5bd309c237917f087..c08c84c3b243a6bafd358a34cbb391a6
|
||||
return false;
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
index d4e154d08dc61e7240fbb564d942732d3eef7a1a..7b30649c6656107a9401475c745467dd525358ca 100644
|
||||
index 5497f4e3faa66cc0a78d449e92d54c1da0cb041c..a768ff0ad1fd0aebc14f0432b9f4b88b8a42e34a 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
@@ -49,7 +49,9 @@ class ScopedPasswordInputEnabler;
|
||||
@@ -530,7 +530,7 @@ index d4e154d08dc61e7240fbb564d942732d3eef7a1a..7b30649c6656107a9401475c745467dd
|
||||
@class RenderWidgetHostViewCocoa;
|
||||
@class CursorAccessibilityScaleFactorObserver;
|
||||
|
||||
@@ -681,9 +683,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
|
||||
@@ -682,9 +684,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
|
||||
// EnsureSurfaceSynchronizedForWebTest().
|
||||
uint32_t latest_capture_sequence_number_ = 0u;
|
||||
|
||||
@@ -543,7 +543,7 @@ index d4e154d08dc61e7240fbb564d942732d3eef7a1a..7b30649c6656107a9401475c745467dd
|
||||
// Used to force the NSApplication's focused accessibility element to be the
|
||||
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 72b957cd89704085ad44d040e0826148d56881fb..39e03b029c4ebf03020f6cc8b67922f73652772a 100644
|
||||
index a2c2c78947c5e3e64632fd0f128745a80ce45fa8..96283a4f72b32eb45357eb6ec1f5b807593d5f07 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -272,8 +272,10 @@
|
||||
@@ -557,7 +557,7 @@ index 72b957cd89704085ad44d040e0826148d56881fb..39e03b029c4ebf03020f6cc8b67922f7
|
||||
|
||||
// Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling
|
||||
// pointers. `ns_view_` gets reinitialized later in this method.
|
||||
@@ -1649,8 +1651,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1654,8 +1656,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
|
||||
gfx::NativeViewAccessible
|
||||
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
|
||||
@@ -568,7 +568,7 @@ index 72b957cd89704085ad44d040e0826148d56881fb..39e03b029c4ebf03020f6cc8b67922f7
|
||||
return [GetInProcessNSView() window];
|
||||
}
|
||||
|
||||
@@ -1699,9 +1703,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1704,9 +1708,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
|
||||
@@ -580,7 +580,7 @@ index 72b957cd89704085ad44d040e0826148d56881fb..39e03b029c4ebf03020f6cc8b67922f7
|
||||
}
|
||||
|
||||
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
|
||||
@@ -2209,20 +2215,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -2214,20 +2220,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken(
|
||||
GetRenderWidgetAccessibilityTokenCallback callback) {
|
||||
base::ProcessId pid = getpid();
|
||||
@@ -700,7 +700,7 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
index f8b1c7ebd90d032411b1885a183403162ec3ff0c..ec30a59330641562d0e3597a4fe12368408dadde 100644
|
||||
index 4d747913c7c3904f5e3f463580523907f758dcbe..d3b6b24ee7ca6ccc6e45b492735b21836b715102 100644
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -488,6 +488,7 @@ static_library("test_support") {
|
||||
@@ -719,7 +719,7 @@ index f8b1c7ebd90d032411b1885a183403162ec3ff0c..ec30a59330641562d0e3597a4fe12368
|
||||
}
|
||||
|
||||
mojom("content_test_mojo_bindings") {
|
||||
@@ -1703,6 +1705,7 @@ test("content_browsertests") {
|
||||
@@ -1702,6 +1704,7 @@ test("content_browsertests") {
|
||||
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
|
||||
|
||||
configs += [ "//build/config:precompiled_headers" ]
|
||||
@@ -727,7 +727,7 @@ index f8b1c7ebd90d032411b1885a183403162ec3ff0c..ec30a59330641562d0e3597a4fe12368
|
||||
|
||||
public_deps = [
|
||||
":test_interfaces",
|
||||
@@ -2930,6 +2933,7 @@ test("content_unittests") {
|
||||
@@ -2929,6 +2932,7 @@ test("content_unittests") {
|
||||
}
|
||||
|
||||
configs += [ "//build/config:precompiled_headers" ]
|
||||
@@ -805,10 +805,10 @@ index 3033b23a07041d375d5733bad1901f9a61bdf3b6..9dd6cb1aa49d03c167d1a92100d4ba5f
|
||||
|
||||
base::WeakPtr<BluetoothLowEnergyAdapterApple>
|
||||
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn
|
||||
index ea3578a727bdccfff74a4112529af9ac052165f2..a0f8573a4401922e4bc9de9b0faf11951efef741 100644
|
||||
index 6716bd24f4bed27a57777e12846056cbd3d4ea03..b8c268ce7b04d48867d5f4b7becc70c93b0440fd 100644
|
||||
--- a/gpu/ipc/service/BUILD.gn
|
||||
+++ b/gpu/ipc/service/BUILD.gn
|
||||
@@ -135,6 +135,7 @@ component("service") {
|
||||
@@ -134,6 +134,7 @@ component("service") {
|
||||
"QuartzCore.framework",
|
||||
]
|
||||
defines += [ "GL_SILENCE_DEPRECATION" ]
|
||||
@@ -842,10 +842,10 @@ index 88bac8b417b0618fdb3c14ec4eb3c5006edd58d9..16106d3122cfc18f32285e4f475b01a5
|
||||
|
||||
gfx::Size pixel_size_;
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
index 9599d5f3351942d9d71d4c019ecefa35370e8327..268e05efbf68fc556763d18d54934ee711fa1d45 100644
|
||||
index 6b4b723f40c67b4ca465dfdb113ef9f3d495719a..16cdb97882e90a6a8d3bac494c745b7d3891a04e 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -75,12 +75,16 @@
|
||||
@@ -74,12 +74,16 @@
|
||||
} // namespace
|
||||
|
||||
ImageTransportSurfaceOverlayMacEGL::ImageTransportSurfaceOverlayMacEGL()
|
||||
@@ -863,7 +863,7 @@ index 9599d5f3351942d9d71d4c019ecefa35370e8327..268e05efbf68fc556763d18d54934ee7
|
||||
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
|
||||
use_remote_layer_api_, !av_disabled_at_command_line);
|
||||
|
||||
@@ -101,6 +105,10 @@
|
||||
@@ -100,6 +104,10 @@
|
||||
#endif
|
||||
ca_context_.layer = ca_layer_tree_coordinator_->GetCALayerForDisplay();
|
||||
}
|
||||
@@ -874,7 +874,7 @@ index 9599d5f3351942d9d71d4c019ecefa35370e8327..268e05efbf68fc556763d18d54934ee7
|
||||
}
|
||||
|
||||
ImageTransportSurfaceOverlayMacEGL::~ImageTransportSurfaceOverlayMacEGL() {
|
||||
@@ -233,9 +241,13 @@
|
||||
@@ -232,9 +240,13 @@
|
||||
TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD,
|
||||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
@@ -1596,10 +1596,10 @@ index 0ab5fbd2a81d8860c73f29c08896f6755b5ca5fa..9400c6c7698258ff2834c550fb8901b4
|
||||
// enough.
|
||||
return PlatformFontMac::SystemFontType::kGeneral;
|
||||
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
|
||||
index d2a918d304afa5e540ab07a5d80887fe9ea6b60e..0fa6cc4314e7d2f16289b7bd7ab38d45cf5bed42 100644
|
||||
index ebc3920648cd0c02ad53ec97884a8906dc2d7321..43844bb1d2fb2daa4a8e9fd18e10fc0e8a3fb817 100644
|
||||
--- a/ui/views/BUILD.gn
|
||||
+++ b/ui/views/BUILD.gn
|
||||
@@ -712,6 +712,7 @@ component("views") {
|
||||
@@ -714,6 +714,7 @@ component("views") {
|
||||
"IOSurface.framework",
|
||||
"QuartzCore.framework",
|
||||
]
|
||||
@@ -1607,7 +1607,7 @@ index d2a918d304afa5e540ab07a5d80887fe9ea6b60e..0fa6cc4314e7d2f16289b7bd7ab38d45
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
@@ -1143,6 +1144,8 @@ source_set("test_support") {
|
||||
@@ -1147,6 +1148,8 @@ source_set("test_support") {
|
||||
"//testing/gtest",
|
||||
]
|
||||
|
||||
@@ -1644,7 +1644,7 @@ index 06cb52062e66fc27c00941e703b909cf42cfa322..309f7a351b8a2aa2ccc42a084a5af086
|
||||
// Used to force the NSApplication's focused accessibility element to be the
|
||||
// views::Views accessibility tree when the NSView for this is focused.
|
||||
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
||||
index 800e715ad7a7051743ce3b1da1b2f9a2c07a4b7e..57169b5f44e6a457c2747f407b8e2b5a26785297 100644
|
||||
index 7201c4c13c1b225b921eeca073e8f0514de2c6af..a88c37536e54628b06f26c3405f6df2d34a7daaa 100644
|
||||
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
||||
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
||||
@@ -345,7 +345,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
@@ -1671,7 +1671,19 @@ index 800e715ad7a7051743ce3b1da1b2f9a2c07a4b7e..57169b5f44e6a457c2747f407b8e2b5a
|
||||
}
|
||||
|
||||
remote_cocoa::mojom::NativeWidgetNSWindow*
|
||||
@@ -1410,6 +1418,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
@@ -1263,9 +1271,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
// for PWAs. However this breaks accessibility on in-process windows,
|
||||
// so set it back to NO when a local window gains focus. See
|
||||
// https://crbug.com/41485830.
|
||||
+#if !IS_MAS_BUILD()
|
||||
if (is_key && features::IsAccessibilityRemoteUIAppEnabled()) {
|
||||
[NSAccessibilityRemoteUIElement setRemoteUIApp:!!application_host_];
|
||||
}
|
||||
+#endif
|
||||
// Explicitly set the keyboard accessibility state on regaining key
|
||||
// window status.
|
||||
if (is_key && is_content_first_responder)
|
||||
@@ -1418,17 +1428,20 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
|
||||
const std::vector<uint8_t>& window_token,
|
||||
const std::vector<uint8_t>& view_token) {
|
||||
@@ -1679,10 +1691,9 @@ index 800e715ad7a7051743ce3b1da1b2f9a2c07a4b7e..57169b5f44e6a457c2747f407b8e2b5a
|
||||
remote_window_accessible_ =
|
||||
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
|
||||
remote_view_accessible_ =
|
||||
@@ -1421,11 +1430,13 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
![NSAccessibilityRemoteUIElement isRemoteUIApp]) {
|
||||
[NSAccessibilityRemoteUIElement setRemoteUIApp:YES];
|
||||
}
|
||||
ui::RemoteAccessibility::GetRemoteElementFromToken(view_token);
|
||||
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_];
|
||||
[remote_view_accessible_ setTopLevelUIElement:remote_window_accessible_];
|
||||
+#endif
|
||||
}
|
||||
|
||||
@@ -1693,7 +1704,7 @@ index 800e715ad7a7051743ce3b1da1b2f9a2c07a4b7e..57169b5f44e6a457c2747f407b8e2b5a
|
||||
*pid = getpid();
|
||||
id element_id = GetNativeViewAccessible();
|
||||
|
||||
@@ -1438,6 +1449,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
@@ -1441,6 +1454,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
}
|
||||
|
||||
*token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id);
|
||||
|
||||
@@ -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 ecefb420b45e9729fa97cb81362de36ccec4ae64..851280c5c26cb93a6a80977b0b3a9815ce2d5d11 100644
|
||||
index 16e8cf435e4b07240064afc13432512a920acf7f..a68c23c049078ce0e1d893dd1921c1e55ebe1019 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -151,6 +151,11 @@
|
||||
@@ -147,7 +147,7 @@ index ecefb420b45e9729fa97cb81362de36ccec4ae64..851280c5c26cb93a6a80977b0b3a9815
|
||||
|
||||
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index bf94d00d748c6b703081f49f9b1df8c7f906930a..7cb0642b4661c5415b4f8f4a934ef32f27b9eb28 100644
|
||||
index a3ba05cb98fdb566a3b2287e5920f32039c49087..5db4f275fb5b619f0dba5526202fec6e8a69399a 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -113,6 +113,7 @@ class URLMatcher;
|
||||
@@ -167,7 +167,7 @@ index bf94d00d748c6b703081f49f9b1df8c7f906930a..7cb0642b4661c5415b4f8f4a934ef32f
|
||||
void ResetURLLoaderFactories() override;
|
||||
void GetViaObliviousHttp(
|
||||
mojom::ObliviousHttpRequestPtr request,
|
||||
@@ -875,6 +878,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -887,6 +890,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
std::vector<base::OnceClosure> dismount_closures_;
|
||||
#endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
|
||||
|
||||
@@ -177,7 +177,7 @@ index bf94d00d748c6b703081f49f9b1df8c7f906930a..7cb0642b4661c5415b4f8f4a934ef32f
|
||||
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 e6b9d328b94d229dcb5a6267d3e5f3f7d42d1baf..567d6f230e33b2e7d9ff8e3f768fc4c94704eaac 100644
|
||||
index c774dfca15ae18c80084b9f46f0a9cf571ee42f4..01e438f5060f8e249a599712248586d26f3b7b47 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -298,6 +298,16 @@ struct SocketBrokerRemotes {
|
||||
@@ -208,7 +208,7 @@ index e6b9d328b94d229dcb5a6267d3e5f3f7d42d1baf..567d6f230e33b2e7d9ff8e3f768fc4c9
|
||||
CreateURLLoaderFactory(pending_receiver<URLLoaderFactory> url_loader_factory,
|
||||
URLLoaderFactoryParams params);
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index 73cfd546a0c5b5119aac6df910be9d925b48ade7..3061938ac5af0f2f1dbe0e0c70457b21ab1cd6c2 100644
|
||||
index 5868a904e53b2df6ea2cf6864ac1300bdc9bd967..981fc599cee08d36387ef4265a6c7c5816c174ac 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -62,6 +62,8 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
|
||||
@@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
|
||||
This patch also fixes callback for manual user cancellation and success.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index 69e759c3b34692beac06ceeddf4b3f1637fb7788..42d0da7f936626aa8bb90057723deeaafce8744d 100644
|
||||
index 4b37258f1bbba1d37e414ea7ec9a93cbd7a1efc4..4667f496f093cb7df71c5e5756fc61bb06053a8b 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -973,7 +973,6 @@ if (is_win) {
|
||||
@@ -640,7 +640,7 @@ index 4ecdb28904fac480cf102fffdff24ae008ac88cf..e8150c95fafd83d7e2fe1f472a35acec
|
||||
PrintingFailed(int32 cookie, PrintFailureReason reason);
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a95306c72e2d 100644
|
||||
index 5df31ec780ae5388b431e6fd63cee5de705a177a..ed520b130544a3854c4dcf98b04ada0cc2a14587 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -47,6 +47,7 @@
|
||||
@@ -651,7 +651,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
#include "printing/units.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
@@ -1229,14 +1230,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1231,14 +1232,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
}
|
||||
|
||||
print_in_progress_ = true;
|
||||
@@ -668,7 +668,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
if (!weak_this) {
|
||||
return;
|
||||
}
|
||||
@@ -1267,7 +1268,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1269,7 +1270,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
@@ -1282,7 +1283,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
@@ -1284,7 +1285,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// plugin node and print that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
|
||||
@@ -686,7 +686,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
|
||||
if (render_frame_gone_) {
|
||||
return;
|
||||
@@ -1371,7 +1372,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1373,7 +1374,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
}
|
||||
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
@@ -696,7 +696,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
if (render_frame_gone_) {
|
||||
return;
|
||||
}
|
||||
@@ -1434,6 +1436,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
@@ -1436,6 +1438,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
|
||||
@@ -705,7 +705,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
@@ -2011,7 +2015,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2013,7 +2017,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
}
|
||||
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
@@ -715,7 +715,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
// Check if `this` is still valid.
|
||||
if (!weak_this) {
|
||||
return;
|
||||
@@ -2027,17 +2032,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2029,17 +2034,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -738,7 +738,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
DidFinishPrinting(PrintingResult::kFailPrintInit);
|
||||
return;
|
||||
}
|
||||
@@ -2058,8 +2065,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -2060,8 +2067,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -755,7 +755,7 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
// Check if `this` is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2317,25 +2331,33 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2319,25 +2333,33 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
}
|
||||
|
||||
bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
|
||||
@@ -785,11 +785,11 @@ index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a953
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fit_to_paper_size = !IsPrintingPdfFrame(frame, node);
|
||||
bool center_on_paper = !IsPrintingPdfFrame(frame, node);
|
||||
- settings.params->print_scaling_option =
|
||||
+ settings->params->print_scaling_option =
|
||||
fit_to_paper_size ? mojom::PrintScalingOption::kFitToPrintableArea
|
||||
: mojom::PrintScalingOption::kSourceSize;
|
||||
center_on_paper ? mojom::PrintScalingOption::kCenterShrinkToFitPaper
|
||||
: mojom::PrintScalingOption::kSourceSize;
|
||||
- SetPrintPagesParams(settings);
|
||||
+ SetPrintPagesParams(*settings);
|
||||
return true;
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch
|
||||
... something to do with OSR? and maybe <webview> as well? terrifying.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index 577d2ad516dc748ff067f1bdcae35317bff602d1..252c754aa1f0145879d95a971af486512fc14fa0 100644
|
||||
index 6b6902c0cb0eee071741421fdfd616d6bacea619..ad27029859895a1b3434913c6f4d38e9dfd69bea 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -718,6 +718,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableForIOv2For(
|
||||
@@ -724,6 +724,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableForIOv2For(
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ index 577d2ad516dc748ff067f1bdcae35317bff602d1..252c754aa1f0145879d95a971af48651
|
||||
const blink::WebMouseEvent& event,
|
||||
const ui::LatencyInfo& latency) {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
index 6f246e3c59620d2c4f98c73ca1833817938fb86f..547d7108a1e984d71eb8f1e74b875d391bd42725 100644
|
||||
index 116046b24a3e03984913d0bccb3697bd4b9c6b9a..a4635a52ffe5caa72745ad66b089b9ca895bdf05 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -25,10 +25,13 @@
|
||||
|
||||
@@ -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 1952b5018f8e5bed87b7dc9d8012c8f2fac00c96..ecef0e83520cbf1015ba1d639be39791ec0cfbb5 100644
|
||||
index 3594bc7a25c95dd348495b42a27aa0e1f54323dc..1c1fb1609b75b865f0cd9e81794ebb186fdeafba 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1263,7 +1263,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
|
||||
@@ -15,7 +15,7 @@ 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 c36367b28a627f7e6e77bcf3fc10f907b131523b..ed7e48a9b2313eedae4a733e15286a2c28a42a74 100644
|
||||
index b22781e1b849373bcd899e1fd470b4a4185ebe15..266a590078dd04d8ffe6fbea7d91d256392cffe7 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -7548,6 +7548,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
|
||||
@@ -33,6 +33,7 @@ fix_assert_module_in_the_renderer_process.patch
|
||||
fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch
|
||||
win_process_avoid_assert_after_spawning_store_app_4152.patch
|
||||
chore_remove_use_of_deprecated_kmaxlength.patch
|
||||
fix_missing_include_for_node_extern.patch
|
||||
feat_optionally_prevent_calling_v8_enablewebassemblytraphandler.patch
|
||||
build_only_create_cppgc_heap_on_non-32_bit_platforms.patch
|
||||
fix_-wshadow_error_in_uvwasi_c.patch
|
||||
|
||||
@@ -87,18 +87,10 @@ index 895ff3a5948add3513700ecc2f32fce4c2fbe4eb..3182a5e4aad2ba0be2b6769edb696b81
|
||||
|
||||
MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
|
||||
diff --git a/src/module_wrap.h b/src/module_wrap.h
|
||||
index e17048357feca2419087621ed280de30882a90bc..63682be31ce00a3bf7b9be909cac4b7f9ec02a8e 100644
|
||||
index e17048357feca2419087621ed280de30882a90bc..061117dc3182d63e35d7e99ffd95801f96356322 100644
|
||||
--- a/src/module_wrap.h
|
||||
+++ b/src/module_wrap.h
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "base_object.h"
|
||||
+#include "node.h"
|
||||
|
||||
namespace node {
|
||||
|
||||
@@ -31,7 +32,14 @@ enum HostDefinedOptions : int {
|
||||
@@ -31,7 +31,14 @@ enum HostDefinedOptions : int {
|
||||
kLength = 9,
|
||||
};
|
||||
|
||||
@@ -114,7 +106,7 @@ index e17048357feca2419087621ed280de30882a90bc..63682be31ce00a3bf7b9be909cac4b7f
|
||||
public:
|
||||
enum InternalFields {
|
||||
kModuleSlot = BaseObject::kInternalFieldCount,
|
||||
@@ -68,6 +76,8 @@ class ModuleWrap : public BaseObject {
|
||||
@@ -68,6 +75,8 @@ class ModuleWrap : public BaseObject {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -123,7 +115,7 @@ index e17048357feca2419087621ed280de30882a90bc..63682be31ce00a3bf7b9be909cac4b7f
|
||||
private:
|
||||
ModuleWrap(Realm* realm,
|
||||
v8::Local<v8::Object> object,
|
||||
@@ -102,7 +112,6 @@ class ModuleWrap : public BaseObject {
|
||||
@@ -102,7 +111,6 @@ class ModuleWrap : public BaseObject {
|
||||
v8::Local<v8::String> specifier,
|
||||
v8::Local<v8::FixedArray> import_attributes,
|
||||
v8::Local<v8::Module> referrer);
|
||||
|
||||
26
patches/node/fix_missing_include_for_node_extern.patch
Normal file
26
patches/node/fix_missing_include_for_node_extern.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 15 Nov 2023 12:25:39 +0100
|
||||
Subject: fix: missing include for NODE_EXTERN
|
||||
|
||||
At some point it seems that node.h was removed from the include chain,
|
||||
causing the following error:
|
||||
|
||||
../../third_party/electron_node/src/module_wrap.h:33:1: error: unknown type name 'NODE_EXTERN'
|
||||
33 | NODE_EXTERN v8::MaybeLocal<v8::Promise> ImportModuleDynamically(
|
||||
| ^
|
||||
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/src/module_wrap.h b/src/module_wrap.h
|
||||
index 061117dc3182d63e35d7e99ffd95801f96356322..63682be31ce00a3bf7b9be909cac4b7f9ec02a8e 100644
|
||||
--- a/src/module_wrap.h
|
||||
+++ b/src/module_wrap.h
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "base_object.h"
|
||||
+#include "node.h"
|
||||
|
||||
namespace node {
|
||||
|
||||
@@ -13,7 +13,7 @@ THREEWAY = "ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES" in os.environ
|
||||
def apply_patches(target):
|
||||
repo = target.get('repo')
|
||||
if not os.path.exists(repo):
|
||||
warnings.warn(f'repo not found: {repo}')
|
||||
warnings.warn('repo not found: %s' % repo)
|
||||
return
|
||||
patch_dir = target.get('patch_dir')
|
||||
git.import_patches(
|
||||
|
||||
@@ -13,13 +13,13 @@ def stop():
|
||||
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
|
||||
|
||||
def start():
|
||||
with sys.stdout if is_verbose_mode() \
|
||||
else open(os.devnull, 'w', encoding='utf-8') as log:
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, log)
|
||||
log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
||||
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, log)
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, log)
|
||||
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, log)
|
||||
|
||||
if __name__ == '__main__':
|
||||
start()
|
||||
|
||||
@@ -11,7 +11,7 @@ from lib import git
|
||||
def export_patches(target, dry_run):
|
||||
repo = target.get('repo')
|
||||
if not os.path.exists(repo):
|
||||
warnings.warn(f'repo not found: {repo}')
|
||||
warnings.warn('repo not found: %s' % repo)
|
||||
return
|
||||
git.export_patches(
|
||||
dry_run=dry_run,
|
||||
|
||||
@@ -29,15 +29,15 @@ def run_node_configure(target_cpu):
|
||||
|
||||
def read_node_config_gypi():
|
||||
config_gypi = os.path.join(NODE_DIR, 'config.gypi')
|
||||
with open(config_gypi, 'r', encoding='utf-8') as file_in:
|
||||
content = file_in.read()
|
||||
with open(config_gypi, 'r') as f:
|
||||
content = f.read()
|
||||
return ast.literal_eval(content)
|
||||
|
||||
def read_electron_args():
|
||||
all_gn = os.path.join(ELECTRON_DIR, 'build', 'args', 'all.gn')
|
||||
args = {}
|
||||
with open(all_gn, 'r', encoding='utf-8') as file_in:
|
||||
for line in file_in:
|
||||
with open(all_gn, 'r') as f:
|
||||
for line in f:
|
||||
if line.startswith('#'):
|
||||
continue
|
||||
m = re.match('([\w_]+) = (.+)', line)
|
||||
@@ -62,8 +62,8 @@ def main(target_file, target_cpu):
|
||||
# Used by certain versions of node-gyp.
|
||||
v['build_v8_with_gn'] = 'false'
|
||||
|
||||
with open(target_file, 'w+', encoding='utf-8') as file_out:
|
||||
file_out.write(pprint.pformat(config, indent=2))
|
||||
with open(target_file, 'w+') as f:
|
||||
f.write(pprint.pformat(config, indent=2))
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1], sys.argv[2]))
|
||||
|
||||
@@ -4,7 +4,7 @@ import zipfile
|
||||
import sys
|
||||
|
||||
def main(zip_path, manifest_out):
|
||||
with open(manifest_out, 'w', encoding='utf-8') as manifest, \
|
||||
with open(manifest_out, 'w') as manifest, \
|
||||
zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z:
|
||||
for name in sorted(z.namelist()):
|
||||
manifest.write(name + '\n')
|
||||
|
||||
@@ -8,8 +8,7 @@ NMV = None
|
||||
if len(sys.argv) > 3:
|
||||
NMV = sys.argv[3]
|
||||
|
||||
with open(node_version_file, 'r', encoding='utf-8') as in_file, \
|
||||
open(out_file, 'w', encoding='utf-8') as out_file:
|
||||
with open(node_version_file, 'r') as in_file, open(out_file, 'w') as out_file:
|
||||
changed = False
|
||||
contents = in_file.read()
|
||||
new_contents = re.sub(
|
||||
|
||||
@@ -43,7 +43,7 @@ def get_zip_name(name, version, suffix=''):
|
||||
arch = get_target_arch()
|
||||
if arch == 'arm':
|
||||
arch += 'v7l'
|
||||
zip_name = f'{name}-{version}-{get_platform_key()}-{arch}'
|
||||
zip_name = '{0}-{1}-{2}-{3}'.format(name, version, get_platform_key(), arch)
|
||||
if suffix:
|
||||
zip_name += '-' + suffix
|
||||
return zip_name + '.zip'
|
||||
|
||||
@@ -72,10 +72,13 @@ def am(repo, patch_data, threeway=False, directory=None, exclude=None,
|
||||
root_args += ['-c', 'user.email=' + committer_email]
|
||||
root_args += ['-c', 'commit.gpgsign=false']
|
||||
command = ['git'] + root_args + ['am'] + args
|
||||
with subprocess.Popen(command, stdin=subprocess.PIPE) as proc:
|
||||
proc.communicate(patch_data.encode('utf-8'))
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError(f"Command {command} returned {proc.returncode}")
|
||||
proc = subprocess.Popen(
|
||||
command,
|
||||
stdin=subprocess.PIPE)
|
||||
proc.communicate(patch_data.encode('utf-8'))
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError("Command {} returned {}".format(command,
|
||||
proc.returncode))
|
||||
|
||||
|
||||
def import_patches(repo, ref=UPSTREAM_HEAD, **kwargs):
|
||||
@@ -226,19 +229,19 @@ def export_patches(repo, out_dir,
|
||||
dry_run=False, grep=None):
|
||||
if not os.path.exists(repo):
|
||||
sys.stderr.write(
|
||||
f"Skipping patches in {repo} because it does not exist.\n"
|
||||
"Skipping patches in {} because it does not exist.\n".format(repo)
|
||||
)
|
||||
return
|
||||
if patch_range is None:
|
||||
patch_range, n_patches = guess_base_commit(repo, ref)
|
||||
msg = f"Exporting {n_patches} patches in {repo} since {patch_range[0:7]}\n"
|
||||
sys.stderr.write(msg)
|
||||
patch_range, num_patches = guess_base_commit(repo, ref)
|
||||
sys.stderr.write("Exporting {} patches in {} since {}\n".format(
|
||||
num_patches, repo, patch_range[0:7]))
|
||||
patch_data = format_patch(repo, patch_range)
|
||||
patches = split_patches(patch_data)
|
||||
if grep:
|
||||
olen = len(patches)
|
||||
patches = filter_patches(patches, grep)
|
||||
sys.stderr.write(f"Exporting {len(patches)} of {olen} patches\n")
|
||||
sys.stderr.write("Exporting {} of {} patches\n".format(len(patches), olen))
|
||||
|
||||
try:
|
||||
os.mkdir(out_dir)
|
||||
@@ -253,8 +256,7 @@ def export_patches(repo, out_dir,
|
||||
for patch in patches:
|
||||
filename = get_file_name(patch)
|
||||
filepath = posixpath.join(out_dir, filename)
|
||||
with io.open(filepath, 'rb') as inp:
|
||||
existing_patch = str(inp.read(), 'utf-8')
|
||||
existing_patch = str(io.open(filepath, 'rb').read(), 'utf-8')
|
||||
formatted_patch = join_patch(patch)
|
||||
if formatted_patch != existing_patch:
|
||||
bad_patches.append(filename)
|
||||
|
||||
@@ -65,7 +65,7 @@ class Platform:
|
||||
return Platform.WINDOWS
|
||||
|
||||
raise AssertionError(
|
||||
f"unexpected current platform '{platform}'")
|
||||
"unexpected current platform '{}'".format(platform))
|
||||
|
||||
@staticmethod
|
||||
def get_all():
|
||||
@@ -101,19 +101,19 @@ class TestsList():
|
||||
# First check that all names are present in the config.
|
||||
for binary_name in binaries:
|
||||
if binary_name not in self.tests:
|
||||
msg = f"binary {binary_name} not found in config '{self.config_path}'"
|
||||
raise Exception(msg)
|
||||
raise Exception("binary {0} not found in config '{1}'".format(
|
||||
binary_name, self.config_path))
|
||||
|
||||
# Respect the "platform" setting.
|
||||
for binary_name in binaries:
|
||||
if not self.__platform_supports(binary_name):
|
||||
host = Platform.get_current()
|
||||
errmsg = f"binary {binary_name} cannot run on {host}. Check the config"
|
||||
raise Exception(errmsg)
|
||||
raise Exception(
|
||||
"binary {0} cannot be run on {1}, check the config".format(
|
||||
binary_name, Platform.get_current()))
|
||||
|
||||
suite_returncode = sum(
|
||||
self.__run(binary, output_dir, verbosity, disabled_tests_policy)
|
||||
for binary in binaries)
|
||||
[self.__run(binary, output_dir, verbosity, disabled_tests_policy)
|
||||
for binary in binaries])
|
||||
return suite_returncode
|
||||
|
||||
def run_all(self, output_dir=None, verbosity=Verbosity.CHATTY,
|
||||
@@ -134,7 +134,7 @@ class TestsList():
|
||||
|
||||
@staticmethod
|
||||
def __get_config_data(config_path):
|
||||
with open(config_path, 'r', encoding='utf-8') as stream:
|
||||
with open(config_path, 'r') as stream:
|
||||
return yaml.load(stream)
|
||||
|
||||
@staticmethod
|
||||
@@ -146,7 +146,7 @@ class TestsList():
|
||||
if isinstance(value, str):
|
||||
return {value: None}
|
||||
|
||||
raise AssertionError(f"unexpected shorthand type: {type(value)}")
|
||||
raise AssertionError("unexpected shorthand type: {}".format(type(value)))
|
||||
|
||||
@staticmethod
|
||||
def __make_a_list(value):
|
||||
@@ -166,7 +166,7 @@ class TestsList():
|
||||
return [list_item for key in value for list_item in value[key]]
|
||||
|
||||
raise AssertionError(
|
||||
f"unexpected type for list merging: {type(value)}")
|
||||
"unexpected type for list merging: {}".format(type(value)))
|
||||
|
||||
def __platform_supports(self, binary_name):
|
||||
return Platform.get_current() in self.tests[binary_name]['platforms']
|
||||
@@ -194,7 +194,8 @@ class TestsList():
|
||||
|
||||
for platform in platforms:
|
||||
assert Platform.is_valid(platform), \
|
||||
f"Unsupported platform {platform}, check {binary_name} config"
|
||||
"platform '{0}' is not supported, check {1} config" \
|
||||
.format(platform, binary_name)
|
||||
|
||||
test_data['platforms'] = platforms
|
||||
|
||||
@@ -230,7 +231,7 @@ class TestsList():
|
||||
if output_dir is None:
|
||||
return None
|
||||
|
||||
return os.path.join(output_dir, f"results_{binary_name}.xml")
|
||||
return os.path.join(output_dir, "results_{}.xml".format(binary_name))
|
||||
|
||||
|
||||
class TestBinary():
|
||||
@@ -247,40 +248,50 @@ class TestBinary():
|
||||
gtest_output = TestBinary.__get_gtest_output(output_file_path)
|
||||
|
||||
args = [self.binary_path, gtest_filter, gtest_output]
|
||||
stdout, stderr = TestBinary.__get_stdout_and_stderr(verbosity)
|
||||
|
||||
returncode = 0
|
||||
|
||||
with open(os.devnull, "w", encoding='utf-8') as devnull:
|
||||
stdout = stderr = None
|
||||
if Verbosity.le(verbosity, Verbosity.ERRORS):
|
||||
stdout = devnull
|
||||
if verbosity == Verbosity.SILENT:
|
||||
stderr = devnull
|
||||
|
||||
try:
|
||||
returncode = subprocess.call(args, stdout=stdout, stderr=stderr)
|
||||
except Exception as exception:
|
||||
if Verbosity.ge(verbosity, Verbosity.ERRORS):
|
||||
print(f"An error occurred while running '{self.binary_path}':",
|
||||
'\n', exception, file=sys.stderr)
|
||||
returncode = 1
|
||||
try:
|
||||
returncode = subprocess.call(args, stdout=stdout, stderr=stderr)
|
||||
except Exception as exception:
|
||||
if Verbosity.ge(verbosity, Verbosity.ERRORS):
|
||||
print("An error occurred while running '{}':".format(self.binary_path),
|
||||
'\n', exception, file=sys.stderr)
|
||||
returncode = 1
|
||||
|
||||
return returncode
|
||||
|
||||
@staticmethod
|
||||
def __get_gtest_filter(included_tests, excluded_tests):
|
||||
included_str = TestBinary.__list_tests(included_tests)
|
||||
excluded_str = TestBinary.__list_tests(excluded_tests)
|
||||
return f"--gtest_filter={included_str}-{excluded_str}"
|
||||
included_tests_string = TestBinary.__list_tests(included_tests)
|
||||
excluded_tests_string = TestBinary.__list_tests(excluded_tests)
|
||||
|
||||
gtest_filter = "--gtest_filter={}-{}".format(included_tests_string,
|
||||
excluded_tests_string)
|
||||
return gtest_filter
|
||||
|
||||
@staticmethod
|
||||
def __get_gtest_output(output_file_path):
|
||||
if output_file_path is None:
|
||||
return ""
|
||||
return f"--gtest_output={TestBinary.output_format}:{output_file_path}"
|
||||
gtest_output = ""
|
||||
if output_file_path is not None:
|
||||
gtest_output = "--gtest_output={0}:{1}".format(TestBinary.output_format,
|
||||
output_file_path)
|
||||
return gtest_output
|
||||
|
||||
@staticmethod
|
||||
def __list_tests(tests):
|
||||
if tests is None:
|
||||
return ''
|
||||
return ':'.join(tests)
|
||||
|
||||
@staticmethod
|
||||
def __get_stdout_and_stderr(verbosity):
|
||||
stdout = stderr = None
|
||||
|
||||
if Verbosity.le(verbosity, Verbosity.ERRORS):
|
||||
devnull = open(os.devnull, 'w')
|
||||
stdout = devnull
|
||||
if verbosity == Verbosity.SILENT:
|
||||
stderr = devnull
|
||||
|
||||
return (stdout, stderr)
|
||||
|
||||
@@ -21,8 +21,8 @@ def read_patch(patch_dir, patch_filename):
|
||||
for l in f.readlines():
|
||||
line_has_correct_start = l.startswith('diff -') or l.startswith('---')
|
||||
if not added_patch_location and line_has_correct_start:
|
||||
ret.append(f'{PATCH_DIR_PREFIX}{patch_dir}\n')
|
||||
ret.append(f'{PATCH_FILENAME_PREFIX}{patch_filename}\n')
|
||||
ret.append('{}{}\n'.format(PATCH_DIR_PREFIX, patch_dir))
|
||||
ret.append('{}{}\n'.format(PATCH_FILENAME_PREFIX, patch_filename))
|
||||
added_patch_location = True
|
||||
ret.append(l)
|
||||
return ''.join(ret)
|
||||
@@ -31,8 +31,8 @@ def read_patch(patch_dir, patch_filename):
|
||||
def patch_from_dir(patch_dir):
|
||||
"""Read a directory of patches into a format suitable for passing to
|
||||
'git am'"""
|
||||
with open(os.path.join(patch_dir, ".patches"), encoding='utf-8') as file_in:
|
||||
patch_list = [line.rstrip('\n') for line in file_in.readlines()]
|
||||
with open(os.path.join(patch_dir, ".patches")) as f:
|
||||
patch_list = [l.rstrip('\n') for l in f.readlines()]
|
||||
|
||||
return ''.join([
|
||||
read_patch(patch_dir, patch_filename)
|
||||
|
||||
@@ -35,8 +35,9 @@ def scoped_cwd(path):
|
||||
|
||||
def download(text, url, path):
|
||||
safe_mkdir(os.path.dirname(path))
|
||||
with open(path, 'wb') as local_file, urlopen(url) as web_file:
|
||||
print(f"Downloading {url} to {path}")
|
||||
with open(path, 'wb') as local_file:
|
||||
print("Downloading %s to %s" % (url, path))
|
||||
web_file = urlopen(url)
|
||||
info = web_file.info()
|
||||
if hasattr(info, 'getheader'):
|
||||
file_size = int(info.getheaders("Content-Length")[0])
|
||||
@@ -57,11 +58,11 @@ def download(text, url, path):
|
||||
|
||||
if not ci:
|
||||
percent = downloaded_size * 100. / file_size
|
||||
status = f"\r{text} {downloaded_size:10d} [{percent:3.1f}%]"
|
||||
status = "\r%s %10d [%3.1f%%]" % (text, downloaded_size, percent)
|
||||
print(status, end=' ')
|
||||
|
||||
if ci:
|
||||
print(f"{text} done.")
|
||||
print("%s done." % (text))
|
||||
else:
|
||||
print()
|
||||
return path
|
||||
@@ -73,16 +74,15 @@ def make_zip(zip_file_path, files, dirs):
|
||||
allfiles = files + dirs
|
||||
execute(['zip', '-r', '-y', zip_file_path] + allfiles)
|
||||
else:
|
||||
with zipfile.ZipFile(zip_file_path, "w",
|
||||
zipfile.ZIP_DEFLATED,
|
||||
allowZip64=True) as zip_file:
|
||||
for filename in files:
|
||||
zip_file.write(filename, filename)
|
||||
for dirname in dirs:
|
||||
for root, _, filenames in os.walk(dirname):
|
||||
for f in filenames:
|
||||
zip_file.write(os.path.join(root, f))
|
||||
zip_file.close()
|
||||
zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED,
|
||||
allowZip64=True)
|
||||
for filename in files:
|
||||
zip_file.write(filename, filename)
|
||||
for dirname in dirs:
|
||||
for root, _, filenames in os.walk(dirname):
|
||||
for f in filenames:
|
||||
zip_file.write(os.path.join(root, f))
|
||||
zip_file.close()
|
||||
|
||||
|
||||
def rm_rf(path):
|
||||
@@ -128,8 +128,8 @@ def get_electron_branding():
|
||||
SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
|
||||
branding_file_path = os.path.join(
|
||||
SOURCE_ROOT, 'shell', 'app', 'BRANDING.json')
|
||||
with open(branding_file_path, encoding='utf-8') as file_in:
|
||||
return json.load(file_in)
|
||||
with open(branding_file_path) as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
cached_electron_version = None
|
||||
@@ -173,14 +173,14 @@ def get_electron_exec():
|
||||
out_dir = get_out_dir()
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
return f'{out_dir}/Electron.app/Contents/MacOS/Electron'
|
||||
return '{0}/Electron.app/Contents/MacOS/Electron'.format(out_dir)
|
||||
if sys.platform == 'win32':
|
||||
return f'{out_dir}/electron.exe'
|
||||
return '{0}/electron.exe'.format(out_dir)
|
||||
if sys.platform == 'linux':
|
||||
return f'{out_dir}/electron'
|
||||
return '{0}/electron'.format(out_dir)
|
||||
|
||||
raise Exception(
|
||||
f"get_electron_exec: unexpected platform '{sys.platform}'")
|
||||
"get_electron_exec: unexpected platform '{0}'".format(sys.platform))
|
||||
|
||||
def get_buildtools_executable(name):
|
||||
buildtools = os.path.realpath(os.path.join(ELECTRON_DIR, '..', 'buildtools'))
|
||||
|
||||
@@ -120,10 +120,10 @@ const LINTERS = [{
|
||||
roots: ['script'],
|
||||
test: filename => filename.endsWith('.py'),
|
||||
run: (opts, filenames) => {
|
||||
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc-2.17');
|
||||
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc');
|
||||
const args = ['--rcfile=' + rcfile, ...filenames];
|
||||
const env = { PYTHONPATH: path.join(ELECTRON_ROOT, 'script'), ...process.env };
|
||||
spawnAndCheckExitCode('pylint-2.17', args, { env });
|
||||
spawnAndCheckExitCode('pylint-2.7', args, { env });
|
||||
}
|
||||
}, {
|
||||
key: 'javascript',
|
||||
|
||||
@@ -65,19 +65,19 @@ def parse_args():
|
||||
# 'config' must exist and be a file.
|
||||
args.config = os.path.abspath(args.config)
|
||||
if not os.path.isfile(args.config):
|
||||
parser.error(f"file '{args.config}' doesn't exist")
|
||||
parser.error("file '{}' doesn't exist".format(args.config))
|
||||
|
||||
# 'tests_dir' must exist and be a directory.
|
||||
if args.tests_dir is not None:
|
||||
args.tests_dir = os.path.abspath(args.tests_dir)
|
||||
if not os.path.isdir(args.tests_dir):
|
||||
parser.error(f"directory '{args.tests_dir}' doesn't exist")
|
||||
parser.error("directory '{}' doesn't exist".format(args.tests_dir))
|
||||
|
||||
# 'output_dir' must exist and be a directory.
|
||||
if args.output_dir is not None:
|
||||
args.output_dir = os.path.abspath(args.output_dir)
|
||||
if not os.path.isdir(args.output_dir):
|
||||
parser.error(f"directory '{args.output_dir}' doesn't exist")
|
||||
parser.error("directory '{}' doesn't exist".format(args.output_dir))
|
||||
|
||||
return args
|
||||
|
||||
@@ -99,7 +99,7 @@ def main():
|
||||
return tests_list.run_all(args.output_dir, args.verbosity,
|
||||
args.disabled_tests_policy)
|
||||
|
||||
raise AssertionError(f"unexpected command '{args.command}'")
|
||||
raise AssertionError("unexpected command '{}'".format(args.command))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -77,8 +77,8 @@ def set_mtimes(patches_config, mtime):
|
||||
|
||||
mtime_cache[file_path] = mtime
|
||||
|
||||
for file_path, file_mtime in mtime_cache.items():
|
||||
os.utime(file_path, (file_mtime, file_mtime))
|
||||
for file_path in mtime_cache:
|
||||
os.utime(file_path, (mtime_cache[file_path], mtime_cache[file_path]))
|
||||
|
||||
|
||||
def main():
|
||||
@@ -131,17 +131,17 @@ def main():
|
||||
if args.operation == "generate":
|
||||
try:
|
||||
# Cache file may exist from a previously aborted sync. Reuse it.
|
||||
with open(args.cache_file, mode='r', encoding='utf-8') as fin:
|
||||
json.load(fin) # Make sure it's not an empty file
|
||||
with open(args.cache_file, mode="r") as f:
|
||||
json.load(f) # Make sure it's not an empty file
|
||||
print("Using existing mtime cache for patches")
|
||||
return 0
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
with open(args.cache_file, mode="w", encoding='utf-8') as fin:
|
||||
with open(args.cache_file, mode="w") as f:
|
||||
mtime_cache = generate_cache(json.load(args.patches_config))
|
||||
json.dump(mtime_cache, fin, indent=2)
|
||||
json.dump(mtime_cache, f, indent=2)
|
||||
except Exception:
|
||||
print(
|
||||
"ERROR: failed to generate mtime cache for patches",
|
||||
@@ -155,8 +155,8 @@ def main():
|
||||
return 0 # Cache file may not exist, fail more gracefully
|
||||
|
||||
try:
|
||||
with open(args.cache_file, mode='r', encoding='utf-8') as file_in:
|
||||
apply_mtimes(json.load(file_in))
|
||||
with open(args.cache_file, mode="r") as f:
|
||||
apply_mtimes(json.load(f))
|
||||
|
||||
if not args.preserve_cache:
|
||||
os.remove(args.cache_file)
|
||||
|
||||
@@ -3,18 +3,9 @@ if (!process.env.CI) require('dotenv-safe').load();
|
||||
const assert = require('node:assert');
|
||||
const got = require('got');
|
||||
|
||||
const { Octokit } = require('@octokit/rest');
|
||||
const octokit = new Octokit({
|
||||
auth: process.env.ELECTRON_GITHUB_TOKEN
|
||||
});
|
||||
|
||||
const BUILD_APPVEYOR_URL = 'https://ci.appveyor.com/api/builds';
|
||||
const CIRCLECI_PIPELINE_URL = 'https://circleci.com/api/v2/project/gh/electron/electron/pipeline';
|
||||
const GH_ACTIONS_PIPELINE_URL = 'https://github.com/electron/electron/actions';
|
||||
const GH_ACTIONS_API_URL = '/repos/electron/electron/actions';
|
||||
|
||||
const CIRCLECI_WAIT_TIME = process.env.CIRCLECI_WAIT_TIME || 30000;
|
||||
const GH_ACTIONS_WAIT_TIME = process.env.GH_ACTIONS_WAIT_TIME || 30000;
|
||||
|
||||
const appVeyorJobs = {
|
||||
'electron-x64': 'electron-x64-release',
|
||||
@@ -32,14 +23,6 @@ const circleCIPublishIndividualArches = {
|
||||
'linux-publish': ['arm', 'arm64', 'x64']
|
||||
};
|
||||
|
||||
const ghActionsPublishWorkflows = [
|
||||
'macos-publish'
|
||||
];
|
||||
|
||||
const ghActionsPublishIndividualArches = {
|
||||
'macos-publish': ['osx-x64', 'mas-x64', 'osx-arm64', 'mas-arm64']
|
||||
};
|
||||
|
||||
let jobRequestedCount = 0;
|
||||
|
||||
async function makeRequest ({ auth, username, password, url, headers, body, method }) {
|
||||
@@ -70,65 +53,6 @@ async function makeRequest ({ auth, username, password, url, headers, body, meth
|
||||
return JSON.parse(response.body);
|
||||
}
|
||||
|
||||
async function githubActionsCall (targetBranch, workflowName, options) {
|
||||
console.log(`Triggering GitHub Actions to run build job: ${workflowName} on branch: ${targetBranch} with release flag.`);
|
||||
const buildRequest = {
|
||||
branch: targetBranch,
|
||||
parameters: {}
|
||||
};
|
||||
if (options.ghRelease) {
|
||||
buildRequest.parameters['upload-to-storage'] = '0';
|
||||
} else {
|
||||
buildRequest.parameters['upload-to-storage'] = '1';
|
||||
}
|
||||
buildRequest.parameters[`run-${workflowName}`] = true;
|
||||
if (options.arch) {
|
||||
const validArches = ghActionsPublishIndividualArches[workflowName];
|
||||
assert(validArches.includes(options.arch), `Unknown GitHub Actions architecture "${options.arch}". Valid values are ${JSON.stringify(validArches)}`);
|
||||
buildRequest.parameters['macos-publish-arch-limit'] = options.arch;
|
||||
}
|
||||
|
||||
jobRequestedCount++;
|
||||
try {
|
||||
const commits = await octokit.repos.listCommits({
|
||||
owner: 'electron',
|
||||
repo: 'electron',
|
||||
sha: targetBranch,
|
||||
per_page: 5
|
||||
});
|
||||
if (!commits.data.length) {
|
||||
console.error('Could not fetch most recent commits for GitHub Actions, returning early');
|
||||
}
|
||||
|
||||
await octokit.request(`POST ${GH_ACTIONS_API_URL}/workflows/${workflowName}.yml/dispatches`, {
|
||||
ref: buildRequest.branch,
|
||||
inputs: {
|
||||
...buildRequest.parameters
|
||||
},
|
||||
headers: {
|
||||
'X-GitHub-Api-Version': '2022-11-28'
|
||||
}
|
||||
});
|
||||
|
||||
const runNumber = await getGitHubActionsRun(workflowName, commits.data[0].sha);
|
||||
if (runNumber === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`GitHub Actions release build pipeline ${runNumber} for ${workflowName} triggered.`);
|
||||
const runUrl = `${GH_ACTIONS_PIPELINE_URL}/runs/${runNumber}`;
|
||||
|
||||
if (options.runningPublishWorkflows) {
|
||||
console.log(`GitHub Actions release workflow request for ${workflowName} successful. Check ${runUrl} for status.`);
|
||||
} else {
|
||||
console.log(`GitHub Actions release build workflow running at ${GH_ACTIONS_PIPELINE_URL}/runs/${runNumber} for ${workflowName}.`);
|
||||
console.log(`GitHub Actions release build request for ${workflowName} successful. Check ${runUrl} for status.`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Error calling GitHub Actions: ', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function circleCIcall (targetBranch, workflowName, options) {
|
||||
console.log(`Triggering CircleCI to run build job: ${workflowName} on branch: ${targetBranch} with release flag.`);
|
||||
const buildRequest = {
|
||||
@@ -243,59 +167,6 @@ async function getCircleCIJobNumber (workflowId) {
|
||||
return jobNumber;
|
||||
}
|
||||
|
||||
async function getGitHubActionsRun (workflowId, headCommit) {
|
||||
let runNumber = 0;
|
||||
let actionRun;
|
||||
while (runNumber === 0) {
|
||||
const actionsRuns = await octokit.request(`GET ${GH_ACTIONS_API_URL}/workflows/${workflowId}.yml/runs`, {
|
||||
headers: {
|
||||
'X-GitHub-Api-Version': '2022-11-28'
|
||||
}
|
||||
});
|
||||
if (!actionsRuns.data.workflow_runs.length) {
|
||||
console.log(`No current workflow_runs found for ${workflowId}, response was: ${actionsRuns.data.workflow_runs}`);
|
||||
runNumber = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
for (const run of actionsRuns.data.workflow_runs) {
|
||||
if (run.head_sha === headCommit) {
|
||||
console.log(`GitHub Actions run ${run.html_url} found for ${headCommit}, waiting on status.`);
|
||||
actionRun = run;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (actionRun) {
|
||||
switch (actionRun.status) {
|
||||
case 'in_progress':
|
||||
case 'pending':
|
||||
case 'queued':
|
||||
case 'requested':
|
||||
case 'waiting': {
|
||||
if (actionRun.id && !isNaN(actionRun.id)) {
|
||||
console.log(`GitHub Actions run ${actionRun.status} for ${actionRun.html_url}.`);
|
||||
runNumber = actionRun.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'action_required':
|
||||
case 'cancelled':
|
||||
case 'failure':
|
||||
case 'skipped':
|
||||
case 'timed_out':
|
||||
case 'failed': {
|
||||
console.log(`Error workflow run returned a status of ${actionRun.status} for ${actionRun.html_url}`);
|
||||
runNumber = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, GH_ACTIONS_WAIT_TIME));
|
||||
}
|
||||
}
|
||||
return runNumber;
|
||||
}
|
||||
|
||||
async function circleCIRequest (url, method, requestBody) {
|
||||
const requestOpts = {
|
||||
username: process.env.CIRCLE_TOKEN,
|
||||
@@ -323,6 +194,18 @@ async function circleCIRequest (url, method, requestBody) {
|
||||
});
|
||||
}
|
||||
|
||||
function buildAppVeyor (targetBranch, options) {
|
||||
const validJobs = Object.keys(appVeyorJobs);
|
||||
if (options.job) {
|
||||
assert(validJobs.includes(options.job), `Unknown AppVeyor CI job name: ${options.job}. Valid values are: ${validJobs}.`);
|
||||
callAppVeyor(targetBranch, options.job, options);
|
||||
} else {
|
||||
for (const job of validJobs) {
|
||||
callAppVeyor(targetBranch, job, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function callAppVeyor (targetBranch, job, options) {
|
||||
console.log(`Triggering AppVeyor to run build job: ${job} on branch: ${targetBranch} with release flag.`);
|
||||
const environmentVariables = {
|
||||
@@ -369,18 +252,6 @@ async function callAppVeyor (targetBranch, job, options) {
|
||||
}
|
||||
}
|
||||
|
||||
function buildAppVeyor (targetBranch, options) {
|
||||
const validJobs = Object.keys(appVeyorJobs);
|
||||
if (options.job) {
|
||||
assert(validJobs.includes(options.job), `Unknown AppVeyor CI job name: ${options.job}. Valid values are: ${validJobs}.`);
|
||||
callAppVeyor(targetBranch, options.job, options);
|
||||
} else {
|
||||
for (const job of validJobs) {
|
||||
callAppVeyor(targetBranch, job, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildCircleCI (targetBranch, options) {
|
||||
if (options.job) {
|
||||
assert(circleCIPublishWorkflows.includes(options.job), `Unknown CircleCI workflow name: ${options.job}. Valid values are: ${circleCIPublishWorkflows}.`);
|
||||
@@ -394,19 +265,6 @@ function buildCircleCI (targetBranch, options) {
|
||||
}
|
||||
}
|
||||
|
||||
function buildGHActions (targetBranch, options) {
|
||||
if (options.job) {
|
||||
assert(ghActionsPublishWorkflows.includes(options.job), `Unknown GitHub Actions workflow name: ${options.job}. Valid values are: ${ghActionsPublishWorkflows}.`);
|
||||
githubActionsCall(targetBranch, options.job, options);
|
||||
} else {
|
||||
assert(!options.arch, 'Cannot provide a single architecture while building all workflows, please specify a single workflow via --workflow');
|
||||
options.runningPublishWorkflows = true;
|
||||
for (const job of ghActionsPublishWorkflows) {
|
||||
githubActionsCall(targetBranch, job, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function runRelease (targetBranch, options) {
|
||||
if (options.ci) {
|
||||
switch (options.ci) {
|
||||
@@ -414,10 +272,6 @@ function runRelease (targetBranch, options) {
|
||||
buildCircleCI(targetBranch, options);
|
||||
break;
|
||||
}
|
||||
case 'GitHubActions': {
|
||||
buildGHActions(targetBranch, options);
|
||||
break;
|
||||
}
|
||||
case 'AppVeyor': {
|
||||
buildAppVeyor(targetBranch, options);
|
||||
break;
|
||||
@@ -430,8 +284,6 @@ function runRelease (targetBranch, options) {
|
||||
} else {
|
||||
buildCircleCI(targetBranch, options);
|
||||
buildAppVeyor(targetBranch, options);
|
||||
// TODO(vertedinde): Enable GH Actions in defaults when ready
|
||||
// buildGHActions(targetBranch, options);
|
||||
}
|
||||
console.log(`${jobRequestedCount} jobs were requested.`);
|
||||
}
|
||||
@@ -445,7 +297,7 @@ if (require.main === module) {
|
||||
const targetBranch = args._[0];
|
||||
if (args._.length < 1) {
|
||||
console.log(`Trigger CI to build release builds of electron.
|
||||
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=CircleCI|AppVeyor|GitHubActions]
|
||||
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=CircleCI|AppVeyor]
|
||||
[--ghRelease] [--circleBuildNum=xxx] [--appveyorJobId=xxx] [--commit=sha] TARGET_BRANCH
|
||||
`);
|
||||
process.exit(0);
|
||||
|
||||
@@ -32,8 +32,9 @@ def get_content(retry_count = 5):
|
||||
headers={"Authorization" : authToken}
|
||||
)
|
||||
|
||||
with urlopen(request) as resp:
|
||||
proposed_content = resp.read()
|
||||
proposed_content = urlopen(
|
||||
request
|
||||
).read()
|
||||
|
||||
if is_json(proposed_content):
|
||||
return proposed_content
|
||||
|
||||
@@ -29,7 +29,7 @@ def main():
|
||||
]
|
||||
|
||||
if args.target_dir is None:
|
||||
store_artifact(directory, f'headers/dist/{args.version}',
|
||||
store_artifact(directory, 'headers/dist/{0}'.format(args.version),
|
||||
checksums)
|
||||
else:
|
||||
copy_files(checksums, args.target_dir)
|
||||
@@ -51,10 +51,10 @@ def parse_args():
|
||||
|
||||
def get_files_list(version):
|
||||
return [
|
||||
{ "filename": f'node-{version}.tar.gz', "required": True },
|
||||
{ "filename": f'node-{version}-headers.tar.gz', "required": True },
|
||||
{ "filename": f'iojs-{version}.tar.gz', "required": True },
|
||||
{ "filename": f'iojs-{version}-headers.tar.gz', "required": True },
|
||||
{ "filename": 'node-{0}.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'node-{0}-headers.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'iojs-{0}.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'iojs-{0}-headers.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'node.lib', "required": False },
|
||||
{ "filename": 'x64/node.lib', "required": False },
|
||||
{ "filename": 'win-x86/iojs.lib', "required": False },
|
||||
@@ -91,8 +91,8 @@ def create_checksum(algorithm, directory, filename, files):
|
||||
lines.append(h.hexdigest() + ' ' + os.path.relpath(path, directory))
|
||||
|
||||
checksum_file = os.path.join(directory, filename)
|
||||
with open(checksum_file, 'w', encoding='utf-8') as fout:
|
||||
fout.write('\n'.join(lines) + '\n')
|
||||
with open(checksum_file, 'w') as f:
|
||||
f.write('\n'.join(lines) + '\n')
|
||||
return checksum_file
|
||||
|
||||
def copy_files(source_files, output_dir):
|
||||
|
||||
@@ -45,9 +45,9 @@ def upload_node(version):
|
||||
versioned_header_tar = header_tar.format(version)
|
||||
shutil.copy2(generated_tar, os.path.join(GEN_DIR, versioned_header_tar))
|
||||
|
||||
store_artifact(GEN_DIR, f'headers/dist/{version}',
|
||||
store_artifact(GEN_DIR, 'headers/dist/{0}'.format(version),
|
||||
glob.glob('node-*.tar.gz'))
|
||||
store_artifact(GEN_DIR, f'headers/dist/{version}',
|
||||
store_artifact(GEN_DIR, 'headers/dist/{0}'.format(version),
|
||||
glob.glob('iojs-*.tar.gz'))
|
||||
|
||||
if PLATFORM == 'win32':
|
||||
@@ -73,13 +73,13 @@ def upload_node(version):
|
||||
shutil.copy2(electron_lib, v4_node_lib)
|
||||
|
||||
# Upload the node.lib.
|
||||
store_artifact(DIST_DIR, f'headers/dist/{version}', [node_lib])
|
||||
store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the iojs.lib.
|
||||
store_artifact(DIST_DIR, f'headers/dist/{version}', [iojs_lib])
|
||||
store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [iojs_lib])
|
||||
|
||||
# Upload the v4 node.lib.
|
||||
store_artifact(DIST_DIR, f'headers/dist/{version}',
|
||||
store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version),
|
||||
[v4_node_lib])
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ PRODUCT_NAME = get_electron_branding()['product_name']
|
||||
SYMBOLS_DIR = os.path.join(RELEASE_DIR, 'breakpad_symbols')
|
||||
|
||||
PDB_LIST = [
|
||||
os.path.join(RELEASE_DIR, f'{PROJECT_NAME}.exe.pdb')
|
||||
os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME))
|
||||
]
|
||||
|
||||
PDB_LIST += glob.glob(os.path.join(RELEASE_DIR, '*.dll.pdb'))
|
||||
@@ -80,14 +80,8 @@ def main():
|
||||
|
||||
|
||||
def run_symstore(pdb, dest, product):
|
||||
for attempt in range(2):
|
||||
try:
|
||||
execute(['symstore', 'add', '/r', '/f', pdb, '/s', dest, '/t', product])
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"An error occurred while adding '{pdb}' to SymStore: {str(e)}")
|
||||
if attempt == 0:
|
||||
print("Retrying...")
|
||||
execute(['symstore', 'add', '/r', '/f', pdb, '/s', dest, '/t', product])
|
||||
|
||||
|
||||
def upload_symbols(files):
|
||||
store_artifact(SYMBOLS_DIR, 'symbols',
|
||||
|
||||
@@ -53,8 +53,9 @@ def main():
|
||||
|
||||
build_version = get_electron_build_version()
|
||||
if not ELECTRON_VERSION.startswith(build_version):
|
||||
errmsg = f"Tag ({ELECTRON_VERSION}) should match build ({build_version})\n"
|
||||
sys.stderr.write(errmsg)
|
||||
error = 'Tag name ({0}) should match build version ({1})\n'.format(
|
||||
ELECTRON_VERSION, build_version)
|
||||
sys.stderr.write(error)
|
||||
sys.stderr.flush()
|
||||
return 1
|
||||
|
||||
@@ -343,7 +344,8 @@ def upload_electron(release, file_path, args):
|
||||
# if upload_to_storage is set, skip github upload.
|
||||
# todo (vertedinde): migrate this variable to upload_to_storage
|
||||
if args.upload_to_storage:
|
||||
key_prefix = f'release-builds/{args.version}_{args.upload_timestamp}'
|
||||
key_prefix = 'release-builds/{0}_{1}'.format(args.version,
|
||||
args.upload_timestamp)
|
||||
store_artifact(os.path.dirname(file_path), key_prefix, [file_path])
|
||||
upload_sha256_checksum(args.version, file_path, key_prefix)
|
||||
return
|
||||
@@ -356,30 +358,30 @@ def upload_electron(release, file_path, args):
|
||||
|
||||
|
||||
def upload_io_to_github(release, filename, filepath, version):
|
||||
print(f'Uploading {filename} to GitHub')
|
||||
print('Uploading %s to GitHub' % \
|
||||
(filename))
|
||||
script_path = os.path.join(
|
||||
ELECTRON_DIR, 'script', 'release', 'uploaders', 'upload-to-github.ts')
|
||||
with subprocess.Popen([TS_NODE, script_path, filepath,
|
||||
filename, str(release['id']), version],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT) as upload_process:
|
||||
if is_verbose_mode():
|
||||
for c in iter(lambda: upload_process.stdout.read(1), b""):
|
||||
sys.stdout.buffer.write(c)
|
||||
sys.stdout.flush()
|
||||
upload_process = subprocess.Popen([TS_NODE, script_path, filepath, filename,
|
||||
str(release['id']), version], stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
if is_verbose_mode():
|
||||
for c in iter(lambda: upload_process.stdout.read(1), b""):
|
||||
sys.stdout.buffer.write(c)
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def upload_sha256_checksum(version, file_path, key_prefix=None):
|
||||
checksum_path = f'{file_path}.sha256sum'
|
||||
checksum_path = '{}.sha256sum'.format(file_path)
|
||||
if key_prefix is None:
|
||||
key_prefix = f'checksums-scratchpad/{version}'
|
||||
key_prefix = 'checksums-scratchpad/{0}'.format(version)
|
||||
sha256 = hashlib.sha256()
|
||||
with open(file_path, 'rb') as f:
|
||||
sha256.update(f.read())
|
||||
|
||||
filename = os.path.basename(file_path)
|
||||
with open(checksum_path, 'w', encoding='utf-8') as checksum:
|
||||
checksum.write(f'{sha256.hexdigest()} *{filename}')
|
||||
with open(checksum_path, 'w') as checksum:
|
||||
checksum.write('{} *{}'.format(sha256.hexdigest(), filename))
|
||||
store_artifact(os.path.dirname(checksum_path), key_prefix, [checksum_path])
|
||||
|
||||
|
||||
@@ -392,7 +394,7 @@ def get_release(version):
|
||||
release_env['NODE_NO_WARNINGS'] = '1'
|
||||
release_info = execute(['node', script_path, version], release_env)
|
||||
if is_verbose_mode():
|
||||
print(f'Release info for version: {version}:\n')
|
||||
print('Release info for version: {}:\n'.format(version))
|
||||
print(release_info)
|
||||
release = json.loads(release_info)
|
||||
return release
|
||||
|
||||
@@ -85,8 +85,8 @@ def make_diff(diff_file, original, reformatted):
|
||||
difflib.unified_diff(
|
||||
original,
|
||||
reformatted,
|
||||
fromfile=f'a/{diff_file}',
|
||||
tofile=f'b/{diff_file}',
|
||||
fromfile='a/{}'.format(diff_file),
|
||||
tofile='b/{}'.format(diff_file),
|
||||
n=3))
|
||||
|
||||
|
||||
@@ -111,7 +111,8 @@ def run_clang_format_diff_wrapper(args, file_name):
|
||||
raise
|
||||
except Exception as e:
|
||||
# pylint: disable=W0707
|
||||
raise UnexpectedError(f'{file_name}: {e.__class__.__name__}: {e}', e)
|
||||
raise UnexpectedError('{}: {}: {}'.format(
|
||||
file_name, e.__class__.__name__, e), e)
|
||||
|
||||
|
||||
def run_clang_format_diff(args, file_name):
|
||||
@@ -130,22 +131,25 @@ def run_clang_format_diff(args, file_name):
|
||||
print(" ".join(invocation))
|
||||
return [], []
|
||||
try:
|
||||
with subprocess.Popen(' '.join(invocation),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True) as proc:
|
||||
outs = list(proc.stdout.readlines())
|
||||
errs = list(proc.stderr.readlines())
|
||||
proc.wait()
|
||||
if proc.returncode:
|
||||
code = proc.returncode
|
||||
msg = f"clang-format exited with code {code}: '{file_name}'"
|
||||
raise DiffError(msg, errs)
|
||||
proc = subprocess.Popen(
|
||||
' '.join(invocation),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True)
|
||||
except OSError as exc:
|
||||
# pylint: disable=raise-missing-from
|
||||
cmd = subprocess.list2cmdline(invocation)
|
||||
raise DiffError(f"Command '{cmd}' failed to start: {exc}")
|
||||
# pylint: disable=W0707
|
||||
raise DiffError(
|
||||
"Command '{}' failed to start: {}".format(
|
||||
subprocess.list2cmdline(invocation), exc
|
||||
)
|
||||
)
|
||||
outs = list(proc.stdout.readlines())
|
||||
errs = list(proc.stderr.readlines())
|
||||
proc.wait()
|
||||
if proc.returncode:
|
||||
raise DiffError("clang-format exited with status {}: '{}'".format(
|
||||
proc.returncode, file_name), errs)
|
||||
if args.fix:
|
||||
return None, errs
|
||||
if sys.platform == 'win32':
|
||||
@@ -196,7 +200,7 @@ def print_trouble(prog, message, use_colors):
|
||||
error_text = 'error:'
|
||||
if use_colors:
|
||||
error_text = bold_red(error_text)
|
||||
print(f"{prog}: {error_text} {message}", file=sys.stderr)
|
||||
print("{}: {} {}".format(prog, error_text, message), file=sys.stderr)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -208,8 +212,8 @@ def main():
|
||||
default=get_buildtools_executable('clang-format'))
|
||||
parser.add_argument(
|
||||
'--extensions',
|
||||
help='comma-separated list of file extensions'
|
||||
f' (default: {DEFAULT_EXTENSIONS})',
|
||||
help='comma separated list of file extensions (default: {})'.format(
|
||||
DEFAULT_EXTENSIONS),
|
||||
default=DEFAULT_EXTENSIONS)
|
||||
parser.add_argument(
|
||||
'--fix',
|
||||
@@ -286,18 +290,18 @@ def main():
|
||||
|
||||
parse_files = []
|
||||
if args.changed:
|
||||
with subprocess.Popen(
|
||||
stdout = subprocess.Popen(
|
||||
"git diff --name-only --cached",
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=True,
|
||||
universal_newlines=True
|
||||
) as child:
|
||||
for line in child.communicate()[0].split("\n"):
|
||||
file_name = line.rstrip()
|
||||
# don't check deleted files
|
||||
if os.path.isfile(file_name):
|
||||
parse_files.append(file_name)
|
||||
).communicate()[0].split("\n")
|
||||
for line in stdout:
|
||||
file_name = line.rstrip()
|
||||
# don't check deleted files
|
||||
if os.path.isfile(file_name):
|
||||
parse_files.append(file_name)
|
||||
|
||||
else:
|
||||
parse_files = args.files
|
||||
@@ -320,7 +324,6 @@ def main():
|
||||
njobs = min(len(files), njobs)
|
||||
|
||||
if not args.fix:
|
||||
# pylint: disable=consider-using-with
|
||||
patch_file = tempfile.NamedTemporaryFile(delete=False,
|
||||
prefix='electron-format-')
|
||||
|
||||
@@ -330,7 +333,6 @@ def main():
|
||||
it = (run_clang_format_diff_wrapper(args, file) for file in files)
|
||||
pool = None
|
||||
else:
|
||||
# pylint: disable=consider-using-with
|
||||
pool = multiprocessing.Pool(njobs)
|
||||
it = pool.imap_unordered(
|
||||
partial(run_clang_format_diff_wrapper, args), files)
|
||||
@@ -371,11 +373,8 @@ def main():
|
||||
patch_file.close()
|
||||
os.unlink(patch_file.name)
|
||||
else:
|
||||
print(
|
||||
'To patch these files, run:',
|
||||
f"$ git apply {patch_file.name}", sep='\n')
|
||||
filename=patch_file.name
|
||||
print(f"\nTo patch these files, run:\n$ git apply {filename}\n")
|
||||
print("\nTo patch these files, run:\n$ git apply {}\n"
|
||||
.format(patch_file.name))
|
||||
|
||||
return retcode
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ target = sys.argv[2]
|
||||
|
||||
os.chdir(os.path.dirname(source))
|
||||
|
||||
with tarfile.open(name=os.path.basename(target), mode='w:gz') as tarball:
|
||||
tarball.add(os.path.relpath(source))
|
||||
tarball.close()
|
||||
tarball = tarfile.open(name=os.path.basename(target), mode='w:gz')
|
||||
tarball.add(os.path.relpath(source))
|
||||
tarball.close()
|
||||
|
||||
@@ -21,15 +21,14 @@ def main():
|
||||
|
||||
chromedriver_path = os.path.join(
|
||||
args.source_root, args.build_dir, chromedriver_name[sys.platform])
|
||||
with subprocess.Popen([chromedriver_path],
|
||||
stdout=subprocess.PIPE,
|
||||
universal_newlines=True) as proc:
|
||||
try:
|
||||
output = proc.stdout.readline()
|
||||
except KeyboardInterrupt:
|
||||
returncode = 0
|
||||
finally:
|
||||
proc.terminate()
|
||||
proc = subprocess.Popen([chromedriver_path],
|
||||
stdout=subprocess.PIPE, universal_newlines=True)
|
||||
try:
|
||||
output = proc.stdout.readline()
|
||||
except KeyboardInterrupt:
|
||||
returncode = 0
|
||||
finally:
|
||||
proc.terminate()
|
||||
|
||||
returncode = 0
|
||||
match = re.search(
|
||||
|
||||
@@ -24,10 +24,10 @@ def main():
|
||||
electron = os.path.join(app_path, 'Contents', 'MacOS', PRODUCT_NAME)
|
||||
ffmpeg_name = 'libffmpeg.dylib'
|
||||
ffmpeg_app_path = os.path.join(app_path, 'Contents', 'Frameworks',
|
||||
f'{PRODUCT_NAME} Framework.framework',
|
||||
'{0} Framework.framework'.format(PRODUCT_NAME),
|
||||
'Libraries')
|
||||
elif sys.platform == 'win32':
|
||||
electron = os.path.join(app_path, f'{PROJECT_NAME}.exe')
|
||||
electron = os.path.join(app_path, '{0}.exe'.format(PROJECT_NAME))
|
||||
ffmpeg_app_path = app_path
|
||||
ffmpeg_name = 'ffmpeg.dll'
|
||||
else:
|
||||
@@ -69,7 +69,7 @@ def create_app_copy(initial_app_path):
|
||||
+ '-no-proprietary-codecs')
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
app_name = f'{PRODUCT_NAME}.app'
|
||||
app_name = '{0}.app'.format(PRODUCT_NAME)
|
||||
initial_app_path = os.path.join(initial_app_path, app_name)
|
||||
app_path = os.path.join(app_path, app_name)
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@ def main():
|
||||
try:
|
||||
with scoped_cwd(app_path):
|
||||
if args.snapshot_files_dir is None:
|
||||
snapshot_filename = os.path.join(app_path, 'mksnapshot_args')
|
||||
with open(snapshot_filename, encoding='utf-8') as file_in:
|
||||
mkargs = file_in.read().splitlines()
|
||||
with open(os.path.join(app_path, 'mksnapshot_args')) as f:
|
||||
mkargs = f.read().splitlines()
|
||||
print('running: ' + ' '.join(mkargs + [ SNAPSHOT_SOURCE ]))
|
||||
subprocess.check_call(mkargs + [ SNAPSHOT_SOURCE ], cwd=app_path)
|
||||
print('ok mksnapshot successfully created snapshot_blob.bin.')
|
||||
@@ -42,7 +41,7 @@ def main():
|
||||
gen_binary = get_binary_path('v8_context_snapshot_generator', \
|
||||
app_path)
|
||||
genargs = [ gen_binary, \
|
||||
f'--output_file={context_snapshot_path}' ]
|
||||
'--output_file={0}'.format(context_snapshot_path) ]
|
||||
print('running: ' + ' '.join(genargs))
|
||||
subprocess.check_call(genargs)
|
||||
print('ok v8_context_snapshot_generator successfully created ' \
|
||||
@@ -60,15 +59,15 @@ def main():
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
bin_files = glob.glob(os.path.join(app_path, '*.bin'))
|
||||
app_dir = os.path.join(app_path, f'{PRODUCT_NAME}.app')
|
||||
app_dir = os.path.join(app_path, '{0}.app'.format(PRODUCT_NAME))
|
||||
electron = os.path.join(app_dir, 'Contents', 'MacOS', PRODUCT_NAME)
|
||||
bin_out_path = os.path.join(app_dir, 'Contents', 'Frameworks',
|
||||
f'{PROJECT_NAME} Framework.framework',
|
||||
'{0} Framework.framework'.format(PROJECT_NAME),
|
||||
'Resources')
|
||||
for bin_file in bin_files:
|
||||
shutil.copy2(bin_file, bin_out_path)
|
||||
elif sys.platform == 'win32':
|
||||
electron = os.path.join(app_path, f'{PROJECT_NAME}.exe')
|
||||
electron = os.path.join(app_path, '{0}.exe'.format(PROJECT_NAME))
|
||||
else:
|
||||
electron = os.path.join(app_path, PROJECT_NAME)
|
||||
|
||||
@@ -82,7 +81,7 @@ def main():
|
||||
except KeyboardInterrupt:
|
||||
print('Other error')
|
||||
returncode = 0
|
||||
print(f'Returning with error code: {returncode}')
|
||||
print('Returning with error code: {0}'.format(returncode))
|
||||
return returncode
|
||||
|
||||
|
||||
@@ -99,7 +98,7 @@ def create_app_copy(initial_app_path):
|
||||
|
||||
def get_binary_path(binary_name, root_path):
|
||||
if sys.platform == 'win32':
|
||||
binary_path = os.path.join(root_path, f'{binary_name}.exe')
|
||||
binary_path = os.path.join(root_path, '{0}.exe'.format(binary_name))
|
||||
else:
|
||||
binary_path = os.path.join(root_path, binary_name)
|
||||
return binary_path
|
||||
|
||||
@@ -4,7 +4,7 @@ import zipfile
|
||||
import sys
|
||||
|
||||
def main(zip_path, manifest_in):
|
||||
with open(manifest_in, 'r', encoding='utf-8') as manifest, \
|
||||
with open(manifest_in, 'r') as manifest, \
|
||||
zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z:
|
||||
files_in_zip = set(z.namelist())
|
||||
files_in_manifest = {l.strip() for l in manifest.readlines()}
|
||||
|
||||
@@ -1206,7 +1206,7 @@ JumpListResult App::SetJumpList(v8::Local<v8::Value> val,
|
||||
if (!delete_jump_list &&
|
||||
!gin::ConvertFromV8(args->isolate(), val, &categories)) {
|
||||
gin_helper::ErrorThrower(args->isolate())
|
||||
.ThrowTypeError("Argument must be null or an array of categories");
|
||||
.ThrowError("Argument must be null or an array of categories");
|
||||
return JumpListResult::kArgumentError;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,11 @@ BaseWindow::BaseWindow(gin_helper::Arguments* args,
|
||||
BaseWindow::~BaseWindow() {
|
||||
CloseImmediately();
|
||||
|
||||
// Destroy the native window in next tick because the native code might be
|
||||
// iterating all windows.
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault()->DeleteSoon(
|
||||
FROM_HERE, window_.release());
|
||||
|
||||
// Remove global reference so the JS object can be garbage collected.
|
||||
self_ref_.Reset();
|
||||
}
|
||||
|
||||
@@ -12,12 +12,10 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/containers/fixed_flat_map.h"
|
||||
#include "base/files/file_enumerator.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/scoped_observation.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/uuid.h"
|
||||
@@ -34,14 +32,11 @@
|
||||
#include "content/browser/code_cache/generated_code_cache_context.h" // nogncheck
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/browsing_data_filter_builder.h"
|
||||
#include "content/public/browser/browsing_data_remover.h"
|
||||
#include "content/public/browser/download_item_utils.h"
|
||||
#include "content/public/browser/download_manager_delegate.h"
|
||||
#include "content/public/browser/network_service_instance.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "gin/arguments.h"
|
||||
#include "gin/converter.h"
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
||||
#include "net/base/completion_repeating_callback.h"
|
||||
@@ -82,14 +77,12 @@
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/object_template_builder.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/common/process_util.h"
|
||||
#include "third_party/blink/public/common/storage_key/storage_key.h"
|
||||
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
@@ -110,8 +103,6 @@
|
||||
#endif
|
||||
|
||||
using content::BrowserThread;
|
||||
using content::BrowsingDataFilterBuilder;
|
||||
using content::BrowsingDataRemover;
|
||||
using content::StoragePartition;
|
||||
|
||||
namespace {
|
||||
@@ -123,23 +114,25 @@ struct ClearStorageDataOptions {
|
||||
};
|
||||
|
||||
uint32_t GetStorageMask(const std::vector<std::string>& storage_types) {
|
||||
static constexpr auto Lookup =
|
||||
base::MakeFixedFlatMap<std::string_view, uint32_t>(
|
||||
{{"cookies", StoragePartition::REMOVE_DATA_MASK_COOKIES},
|
||||
{"filesystem", StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS},
|
||||
{"indexdb", StoragePartition::REMOVE_DATA_MASK_INDEXEDDB},
|
||||
{"localstorage", StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE},
|
||||
{"shadercache", StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE},
|
||||
{"websql", StoragePartition::REMOVE_DATA_MASK_WEBSQL},
|
||||
{"serviceworkers",
|
||||
StoragePartition::REMOVE_DATA_MASK_SERVICE_WORKERS},
|
||||
{"cachestorage", StoragePartition::REMOVE_DATA_MASK_CACHE_STORAGE}});
|
||||
|
||||
uint32_t storage_mask = 0;
|
||||
for (const auto& it : storage_types) {
|
||||
auto type = base::ToLowerASCII(it);
|
||||
if (Lookup.contains(type))
|
||||
storage_mask |= Lookup.at(type);
|
||||
if (type == "cookies")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_COOKIES;
|
||||
else if (type == "filesystem")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS;
|
||||
else if (type == "indexdb")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_INDEXEDDB;
|
||||
else if (type == "localstorage")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE;
|
||||
else if (type == "shadercache")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE;
|
||||
else if (type == "websql")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_WEBSQL;
|
||||
else if (type == "serviceworkers")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_SERVICE_WORKERS;
|
||||
else if (type == "cachestorage")
|
||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_CACHE_STORAGE;
|
||||
}
|
||||
return storage_mask;
|
||||
}
|
||||
@@ -156,204 +149,6 @@ uint32_t GetQuotaMask(const std::vector<std::string>& quota_types) {
|
||||
return quota_mask;
|
||||
}
|
||||
|
||||
constexpr BrowsingDataRemover::DataType kClearDataTypeAll = ~0ULL;
|
||||
constexpr BrowsingDataRemover::OriginType kClearOriginTypeAll =
|
||||
BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB |
|
||||
BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB;
|
||||
|
||||
constexpr auto kDataTypeLookup =
|
||||
base::MakeFixedFlatMap<std::string_view, BrowsingDataRemover::DataType>({
|
||||
{"backgroundFetch", BrowsingDataRemover::DATA_TYPE_BACKGROUND_FETCH},
|
||||
{"cache", BrowsingDataRemover::DATA_TYPE_CACHE |
|
||||
BrowsingDataRemover::DATA_TYPE_CACHE_STORAGE},
|
||||
{"cookies", BrowsingDataRemover::DATA_TYPE_COOKIES},
|
||||
{"downloads", BrowsingDataRemover::DATA_TYPE_DOWNLOADS},
|
||||
{"fileSystems", BrowsingDataRemover::DATA_TYPE_FILE_SYSTEMS},
|
||||
{"indexedDB", BrowsingDataRemover::DATA_TYPE_INDEXED_DB},
|
||||
{"localStorage", BrowsingDataRemover::DATA_TYPE_LOCAL_STORAGE},
|
||||
{"serviceWorkers", BrowsingDataRemover::DATA_TYPE_SERVICE_WORKERS},
|
||||
{"webSQL", BrowsingDataRemover::DATA_TYPE_WEB_SQL},
|
||||
});
|
||||
|
||||
BrowsingDataRemover::DataType GetDataTypeMask(
|
||||
const std::vector<std::string>& data_types) {
|
||||
BrowsingDataRemover::DataType mask = 0u;
|
||||
for (const auto& type : data_types) {
|
||||
if (kDataTypeLookup.contains(type)) {
|
||||
mask |= kDataTypeLookup.at(type);
|
||||
}
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetDataTypesFromMask(
|
||||
BrowsingDataRemover::DataType mask) {
|
||||
std::vector<std::string> results;
|
||||
for (const auto [type, flag] : kDataTypeLookup) {
|
||||
if (mask & flag) {
|
||||
results.emplace_back(type);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
// Represents a task to clear browsing data for the `clearData` API method.
|
||||
//
|
||||
// This type manages its own lifetime, deleting itself once the task finishes
|
||||
// completely.
|
||||
class ClearDataTask {
|
||||
public:
|
||||
// Starts running a task. This function will return before the task is
|
||||
// finished, but will resolve or reject the |promise| when it finishes.
|
||||
static void Run(
|
||||
BrowsingDataRemover* remover,
|
||||
gin_helper::Promise<void> promise,
|
||||
BrowsingDataRemover::DataType data_type_mask,
|
||||
std::vector<url::Origin> origins,
|
||||
BrowsingDataFilterBuilder::Mode filter_mode,
|
||||
BrowsingDataFilterBuilder::OriginMatchingMode origin_matching_mode) {
|
||||
std::shared_ptr<ClearDataTask> task(new ClearDataTask(std::move(promise)));
|
||||
|
||||
// This method counts as an operation. This is important so we can call
|
||||
// `OnOperationFinished` at the end of this method as a fallback if all the
|
||||
// other operations finished while this method was still executing
|
||||
task->operations_running_ = 1;
|
||||
|
||||
// Cookies are scoped more broadly than other types of data, so if we are
|
||||
// filtering then we need to do it at the registrable domain level
|
||||
if (!origins.empty() &&
|
||||
data_type_mask & BrowsingDataRemover::DATA_TYPE_COOKIES) {
|
||||
data_type_mask &= ~BrowsingDataRemover::DATA_TYPE_COOKIES;
|
||||
|
||||
auto cookies_filter_builder =
|
||||
BrowsingDataFilterBuilder::Create(filter_mode);
|
||||
|
||||
for (const url::Origin& origin : origins) {
|
||||
std::string domain = GetDomainAndRegistry(
|
||||
origin,
|
||||
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
|
||||
if (domain.empty()) {
|
||||
domain = origin.host();
|
||||
}
|
||||
cookies_filter_builder->AddRegisterableDomain(domain);
|
||||
}
|
||||
|
||||
StartOperation(task, remover, BrowsingDataRemover::DATA_TYPE_COOKIES,
|
||||
std::move(cookies_filter_builder));
|
||||
}
|
||||
|
||||
// If cookies aren't the only data type and weren't handled above, then we
|
||||
// can start an operation that is scoped to origins
|
||||
if (data_type_mask) {
|
||||
auto filter_builder =
|
||||
BrowsingDataFilterBuilder::Create(filter_mode, origin_matching_mode);
|
||||
|
||||
for (auto const& origin : origins) {
|
||||
filter_builder->AddOrigin(origin);
|
||||
}
|
||||
|
||||
StartOperation(task, remover, data_type_mask, std::move(filter_builder));
|
||||
}
|
||||
|
||||
// This static method counts as an operation.
|
||||
task->OnOperationFinished(std::nullopt);
|
||||
}
|
||||
|
||||
private:
|
||||
// An individiual |content::BrowsingDataRemover::Remove...| operation as part
|
||||
// of a full |ClearDataTask|. This class manages its own lifetime, cleaning
|
||||
// itself up after the operation completes and notifies the task of the
|
||||
// result.
|
||||
class ClearDataOperation : public BrowsingDataRemover::Observer {
|
||||
public:
|
||||
static void Run(std::shared_ptr<ClearDataTask> task,
|
||||
BrowsingDataRemover* remover,
|
||||
BrowsingDataRemover::DataType data_type_mask,
|
||||
std::unique_ptr<BrowsingDataFilterBuilder> filter_builder) {
|
||||
auto* operation = new ClearDataOperation(task, remover);
|
||||
|
||||
remover->RemoveWithFilterAndReply(base::Time::Min(), base::Time::Max(),
|
||||
data_type_mask, kClearOriginTypeAll,
|
||||
std::move(filter_builder), operation);
|
||||
}
|
||||
|
||||
// BrowsingDataRemover::Observer:
|
||||
void OnBrowsingDataRemoverDone(
|
||||
BrowsingDataRemover::DataType failed_data_types) override {
|
||||
task_->OnOperationFinished(failed_data_types);
|
||||
delete this;
|
||||
}
|
||||
|
||||
private:
|
||||
ClearDataOperation(std::shared_ptr<ClearDataTask> task,
|
||||
BrowsingDataRemover* remover)
|
||||
: task_(task) {
|
||||
observation_.Observe(remover);
|
||||
}
|
||||
|
||||
std::shared_ptr<ClearDataTask> task_;
|
||||
base::ScopedObservation<BrowsingDataRemover, BrowsingDataRemover::Observer>
|
||||
observation_{this};
|
||||
};
|
||||
|
||||
explicit ClearDataTask(gin_helper::Promise<void> promise)
|
||||
: promise_(std::move(promise)) {}
|
||||
|
||||
static void StartOperation(
|
||||
std::shared_ptr<ClearDataTask> task,
|
||||
BrowsingDataRemover* remover,
|
||||
BrowsingDataRemover::DataType data_type_mask,
|
||||
std::unique_ptr<BrowsingDataFilterBuilder> filter_builder) {
|
||||
// Track this operation
|
||||
task->operations_running_ += 1;
|
||||
|
||||
ClearDataOperation::Run(task, remover, data_type_mask,
|
||||
std::move(filter_builder));
|
||||
}
|
||||
|
||||
void OnOperationFinished(
|
||||
std::optional<BrowsingDataRemover::DataType> failed_data_types) {
|
||||
DCHECK_GT(operations_running_, 0);
|
||||
operations_running_ -= 1;
|
||||
|
||||
if (failed_data_types.has_value()) {
|
||||
failed_data_types_ |= failed_data_types.value();
|
||||
}
|
||||
|
||||
// If this is the last operation, then the task is finished
|
||||
if (operations_running_ == 0) {
|
||||
OnTaskFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void OnTaskFinished() {
|
||||
if (failed_data_types_ == 0ULL) {
|
||||
promise_.Resolve();
|
||||
} else {
|
||||
v8::Isolate* isolate = promise_.isolate();
|
||||
|
||||
v8::Local<v8::Value> failed_data_types_array =
|
||||
gin::ConvertToV8(isolate, GetDataTypesFromMask(failed_data_types_));
|
||||
|
||||
// Create a rich error object with extra detail about what data types
|
||||
// failed
|
||||
auto error = v8::Exception::Error(
|
||||
gin::StringToV8(isolate, "Failed to clear data"));
|
||||
error.As<v8::Object>()
|
||||
->Set(promise_.GetContext(),
|
||||
gin::StringToV8(isolate, "failedDataTypes"),
|
||||
failed_data_types_array)
|
||||
.Check();
|
||||
|
||||
promise_.Reject(error);
|
||||
}
|
||||
}
|
||||
|
||||
int operations_running_ = 0;
|
||||
BrowsingDataRemover::DataType failed_data_types_ = 0ULL;
|
||||
gin_helper::Promise<void> promise_;
|
||||
};
|
||||
|
||||
base::Value::Dict createProxyConfig(ProxyPrefs::ProxyMode proxy_mode,
|
||||
std::string const& pac_url,
|
||||
std::string const& proxy_server,
|
||||
@@ -1306,89 +1101,6 @@ v8::Local<v8::Promise> Session::ClearCodeCaches(
|
||||
return handle;
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> Session::ClearData(gin_helper::ErrorThrower thrower,
|
||||
gin::Arguments* args) {
|
||||
auto* isolate = JavascriptEnvironment::GetIsolate();
|
||||
|
||||
BrowsingDataRemover::DataType data_type_mask = kClearDataTypeAll;
|
||||
std::vector<url::Origin> origins;
|
||||
BrowsingDataFilterBuilder::OriginMatchingMode origin_matching_mode =
|
||||
BrowsingDataFilterBuilder::OriginMatchingMode::kThirdPartiesIncluded;
|
||||
BrowsingDataFilterBuilder::Mode filter_mode =
|
||||
BrowsingDataFilterBuilder::Mode::kPreserve;
|
||||
|
||||
if (gin_helper::Dictionary options; args->GetNext(&options)) {
|
||||
if (std::vector<std::string> data_types;
|
||||
options.Get("dataTypes", &data_types)) {
|
||||
data_type_mask = GetDataTypeMask(data_types);
|
||||
}
|
||||
|
||||
if (bool avoid_closing_connections;
|
||||
options.Get("avoidClosingConnections", &avoid_closing_connections) &&
|
||||
avoid_closing_connections) {
|
||||
data_type_mask |=
|
||||
BrowsingDataRemover::DATA_TYPE_AVOID_CLOSING_CONNECTIONS;
|
||||
}
|
||||
|
||||
std::vector<GURL> origin_urls;
|
||||
{
|
||||
bool has_origins_key = options.Get("origins", &origin_urls);
|
||||
std::vector<GURL> exclude_origin_urls;
|
||||
bool has_exclude_origins_key =
|
||||
options.Get("excludeOrigins", &exclude_origin_urls);
|
||||
|
||||
if (has_origins_key && has_exclude_origins_key) {
|
||||
thrower.ThrowError(
|
||||
"Cannot provide both 'origins' and 'excludeOrigins'");
|
||||
return v8::Undefined(isolate);
|
||||
}
|
||||
|
||||
if (has_origins_key) {
|
||||
filter_mode = BrowsingDataFilterBuilder::Mode::kDelete;
|
||||
} else if (has_exclude_origins_key) {
|
||||
origin_urls = std::move(exclude_origin_urls);
|
||||
}
|
||||
}
|
||||
|
||||
if (!origin_urls.empty()) {
|
||||
origins.reserve(origin_urls.size());
|
||||
for (const GURL& origin_url : origin_urls) {
|
||||
auto origin = url::Origin::Create(origin_url);
|
||||
|
||||
// Opaque origins cannot be used with this API
|
||||
if (origin.opaque()) {
|
||||
thrower.ThrowError(
|
||||
base::StringPrintf("Invalid origin: '%s'",
|
||||
origin_url.possibly_invalid_spec().c_str()));
|
||||
return v8::Undefined(isolate);
|
||||
}
|
||||
|
||||
origins.push_back(std::move(origin));
|
||||
}
|
||||
}
|
||||
|
||||
if (std::string origin_matching_mode_string;
|
||||
options.Get("originMatchingMode", &origin_matching_mode_string)) {
|
||||
if (origin_matching_mode_string == "third-parties-included") {
|
||||
origin_matching_mode = BrowsingDataFilterBuilder::OriginMatchingMode::
|
||||
kThirdPartiesIncluded;
|
||||
} else if (origin_matching_mode_string == "origin-in-all-contexts") {
|
||||
origin_matching_mode =
|
||||
BrowsingDataFilterBuilder::OriginMatchingMode::kOriginInAllContexts;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gin_helper::Promise<void> promise(isolate);
|
||||
v8::Local<v8::Promise> promise_handle = promise.GetHandle();
|
||||
|
||||
BrowsingDataRemover* remover = browser_context_->GetBrowsingDataRemover();
|
||||
ClearDataTask::Run(remover, std::move(promise), data_type_mask,
|
||||
std::move(origins), filter_mode, origin_matching_mode);
|
||||
|
||||
return promise_handle;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
base::Value Session::GetSpellCheckerLanguages() {
|
||||
return browser_context_->prefs()
|
||||
@@ -1658,7 +1370,6 @@ void Session::FillObjectTemplate(v8::Isolate* isolate,
|
||||
.SetMethod("getStoragePath", &Session::GetPath)
|
||||
.SetMethod("setCodeCachePath", &Session::SetCodeCachePath)
|
||||
.SetMethod("clearCodeCaches", &Session::ClearCodeCaches)
|
||||
.SetMethod("clearData", &Session::ClearData)
|
||||
.SetProperty("cookies", &Session::Cookies)
|
||||
.SetProperty("netLog", &Session::NetLog)
|
||||
.SetProperty("protocol", &Session::Protocol)
|
||||
|
||||
@@ -147,8 +147,6 @@ class Session : public gin::Wrappable<Session>,
|
||||
v8::Local<v8::Value> GetPath(v8::Isolate* isolate);
|
||||
void SetCodeCachePath(gin::Arguments* args);
|
||||
v8::Local<v8::Promise> ClearCodeCaches(const gin_helper::Dictionary& options);
|
||||
v8::Local<v8::Value> ClearData(gin_helper::ErrorThrower thrower,
|
||||
gin::Arguments* args);
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
base::Value GetSpellCheckerLanguages();
|
||||
void SetSpellCheckerLanguages(gin_helper::ErrorThrower thrower,
|
||||
|
||||
@@ -352,20 +352,6 @@ struct Converter<scoped_refptr<content::DevToolsAgentHost>> {
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<content::NavigationEntry*> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
content::NavigationEntry* entry) {
|
||||
if (!entry) {
|
||||
return v8::Null(isolate);
|
||||
}
|
||||
gin_helper::Dictionary dict(isolate, v8::Object::New(isolate));
|
||||
dict.Set("url", entry->GetURL().spec());
|
||||
dict.Set("title", entry->GetTitleForDisplay());
|
||||
return dict.GetHandle();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace gin
|
||||
|
||||
namespace electron::api {
|
||||
@@ -1753,6 +1739,23 @@ void WebContents::RenderFrameHostChanged(content::RenderFrameHost* old_host,
|
||||
if (new_host)
|
||||
new_host->GetRenderWidgetHost()->AddInputEventObserver(this);
|
||||
}
|
||||
|
||||
// During cross-origin navigation, a FrameTreeNode will swap out its RFH.
|
||||
// If an instance of WebFrameMain exists, it will need to have its RFH
|
||||
// swapped as well.
|
||||
//
|
||||
// |old_host| can be a nullptr so we use |new_host| for looking up the
|
||||
// WebFrameMain instance.
|
||||
auto* web_frame = WebFrameMain::FromRenderFrameHost(new_host);
|
||||
if (web_frame) {
|
||||
web_frame->UpdateRenderFrameHost(new_host);
|
||||
}
|
||||
}
|
||||
|
||||
void WebContents::FrameDeleted(int frame_tree_node_id) {
|
||||
auto* web_frame = WebFrameMain::FromFrameTreeNodeId(frame_tree_node_id);
|
||||
if (web_frame)
|
||||
web_frame->Destroyed();
|
||||
}
|
||||
|
||||
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
|
||||
@@ -2557,11 +2560,6 @@ int WebContents::GetActiveIndex() const {
|
||||
return web_contents()->GetController().GetCurrentEntryIndex();
|
||||
}
|
||||
|
||||
content::NavigationEntry* WebContents::GetNavigationEntryAtIndex(
|
||||
int index) const {
|
||||
return web_contents()->GetController().GetEntryAtIndex(index);
|
||||
}
|
||||
|
||||
void WebContents::ClearHistory() {
|
||||
// In some rare cases (normally while there is no real history) we are in a
|
||||
// state where we can't prune navigation entries
|
||||
@@ -4355,11 +4353,9 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate,
|
||||
.SetMethod("goToOffset", &WebContents::GoToOffset)
|
||||
.SetMethod("canGoToIndex", &WebContents::CanGoToIndex)
|
||||
.SetMethod("goToIndex", &WebContents::GoToIndex)
|
||||
.SetMethod("_getActiveIndex", &WebContents::GetActiveIndex)
|
||||
.SetMethod("_getNavigationEntryAtIndex",
|
||||
&WebContents::GetNavigationEntryAtIndex)
|
||||
.SetMethod("_historyLength", &WebContents::GetHistoryLength)
|
||||
.SetMethod("getActiveIndex", &WebContents::GetActiveIndex)
|
||||
.SetMethod("clearHistory", &WebContents::ClearHistory)
|
||||
.SetMethod("length", &WebContents::GetHistoryLength)
|
||||
.SetMethod("isCrashed", &WebContents::IsCrashed)
|
||||
.SetMethod("forcefullyCrashRenderer",
|
||||
&WebContents::ForcefullyCrashRenderer)
|
||||
|
||||
@@ -194,7 +194,6 @@ class WebContents : public ExclusiveAccessContext,
|
||||
bool CanGoToIndex(int index) const;
|
||||
void GoToIndex(int index);
|
||||
int GetActiveIndex() const;
|
||||
content::NavigationEntry* GetNavigationEntryAtIndex(int index) const;
|
||||
void ClearHistory();
|
||||
int GetHistoryLength() const;
|
||||
const std::string GetWebRTCIPHandlingPolicy() const;
|
||||
@@ -628,6 +627,7 @@ class WebContents : public ExclusiveAccessContext,
|
||||
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
||||
void RenderFrameHostChanged(content::RenderFrameHost* old_host,
|
||||
content::RenderFrameHost* new_host) override;
|
||||
void FrameDeleted(int frame_tree_node_id) override;
|
||||
void RenderViewDeleted(content::RenderViewHost*) override;
|
||||
void PrimaryMainFrameRenderProcessGone(
|
||||
base::TerminationStatus status) override;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user