mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
78 Commits
v29.0.0
...
v30.0.0-ni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de76fc01ec | ||
|
|
2571396584 | ||
|
|
8104c7908a | ||
|
|
db2bf1a0d1 | ||
|
|
6c9f9de40a | ||
|
|
9e630eb66a | ||
|
|
1a0991a9b9 | ||
|
|
921da723b8 | ||
|
|
3e6a038af7 | ||
|
|
a05bfd332d | ||
|
|
4164ef93ad | ||
|
|
d13a93fb61 | ||
|
|
031d636823 | ||
|
|
5ced88a90a | ||
|
|
1af9612edf | ||
|
|
1300e83884 | ||
|
|
03a3deca18 | ||
|
|
f4ee3c1b2a | ||
|
|
6ea7da4b90 | ||
|
|
135c542555 | ||
|
|
3dafb318a8 | ||
|
|
7e6fb97a2f | ||
|
|
df7f07a8af | ||
|
|
f97d8719e6 | ||
|
|
021592200e | ||
|
|
6803624576 | ||
|
|
4949c4c4e1 | ||
|
|
61f619a5e6 | ||
|
|
b3e01220cb | ||
|
|
80b220d214 | ||
|
|
57b29903e3 | ||
|
|
bbfe809d02 | ||
|
|
e83192adba | ||
|
|
be4eb4e8a7 | ||
|
|
8b9eb518a9 | ||
|
|
d5d162b622 | ||
|
|
b39ebb8625 | ||
|
|
2e4e6f10de | ||
|
|
f36ceae024 | ||
|
|
892c9d78a3 | ||
|
|
fac964ac0d | ||
|
|
c2c64d27fd | ||
|
|
d5c658545a | ||
|
|
ebf9a49fba | ||
|
|
3afb012ad1 | ||
|
|
c184b93fc5 | ||
|
|
7b4d490bfe | ||
|
|
37630a6128 | ||
|
|
3a22fd3216 | ||
|
|
73e7125041 | ||
|
|
cc1b64e01c | ||
|
|
22970f573b | ||
|
|
5086071294 | ||
|
|
8c71e2adc9 | ||
|
|
f229201f41 | ||
|
|
3a06047e61 | ||
|
|
84ba0c6c7d | ||
|
|
0672f59f26 | ||
|
|
dfce1a9eb4 | ||
|
|
baca2e302d | ||
|
|
8c89137ecd | ||
|
|
be4e4ff11b | ||
|
|
a208d45aca | ||
|
|
7995c56fb0 | ||
|
|
ab2a4fd836 | ||
|
|
95d094d75b | ||
|
|
ba97679901 | ||
|
|
15c6014324 | ||
|
|
a94fb2cb5d | ||
|
|
80d85c0e8e | ||
|
|
66b2f697ea | ||
|
|
83f15bd957 | ||
|
|
a6417cc265 | ||
|
|
08a51f3339 | ||
|
|
890a557eed | ||
|
|
5094cb4115 | ||
|
|
2eb13d377e | ||
|
|
93fdc8d33c |
@@ -353,10 +353,10 @@ step-setup-rbe-for-build: &step-setup-rbe-for-build
|
||||
mkdir third_party
|
||||
# Pull down credential helper and print status
|
||||
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
|
||||
HELPER=$(node -p "require('./src/utils/reclient.js').helperPath({})")
|
||||
HELPER=$(node -p "require('./src/utils/reclient.js').helperPath")
|
||||
$HELPER login
|
||||
echo 'export RBE_service='`node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"` >> $BASH_ENV
|
||||
echo 'export RBE_experimental_credentials_helper='`node -e "console.log(require('./src/utils/reclient.js').helperPath({}))"` >> $BASH_ENV
|
||||
echo 'export RBE_experimental_credentials_helper='`node -e "console.log(require('./src/utils/reclient.js').helperPath)"` >> $BASH_ENV
|
||||
echo 'export RBE_experimental_credentials_helper_args="print"' >> $BASH_ENV
|
||||
|
||||
step-restore-brew-cache: &step-restore-brew-cache
|
||||
|
||||
18
.github/workflows/branch-created.yml
vendored
18
.github/workflows/branch-created.yml
vendored
@@ -1,6 +1,12 @@
|
||||
name: Branch Created
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch-name:
|
||||
description: Branch name (e.g. `29-x-y`)
|
||||
required: true
|
||||
type: string
|
||||
create:
|
||||
|
||||
permissions: {}
|
||||
@@ -8,7 +14,7 @@ permissions: {}
|
||||
jobs:
|
||||
release-branch-created:
|
||||
name: Release Branch Created
|
||||
if: ${{ github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller') }}
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller')) }}
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
@@ -18,10 +24,10 @@ jobs:
|
||||
- name: Determine Major Version
|
||||
id: check-major-version
|
||||
run: |
|
||||
if [[ ${{ github.event.ref }} =~ ^([0-9]+)-x-y$ ]]; then
|
||||
if [[ ${{ github.event.inputs.branch-name || github.event.ref }} =~ ^([0-9]+)-x-y$ ]]; then
|
||||
echo "MAJOR=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Not a release branch: ${{ github.event.ref }}"
|
||||
echo "Not a release branch: ${{ github.event.inputs.branch-name || github.event.ref }}"
|
||||
fi
|
||||
- name: New Release Branch Tasks
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
@@ -93,7 +99,9 @@ jobs:
|
||||
project-number: 64
|
||||
# TODO - Set to public once GitHub fixes their GraphQL bug
|
||||
# public: true
|
||||
link-to-repository: electron/electron
|
||||
# TODO - Enable once GitHub doesn't require overly broad, read
|
||||
# and write permission for repo "Contents" to link
|
||||
# link-to-repository: electron/electron
|
||||
template-view: ${{ steps.generate-project-metadata.outputs.template-view }}
|
||||
title: ${{ steps.generate-project-metadata.outputs.major }}-x-y
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
@@ -108,8 +116,10 @@ jobs:
|
||||
id: find-prev-release-board
|
||||
with:
|
||||
title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Close Previous Release Project Board
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/close-project@3a81985616963f32fae17d1d1b406c631f3201a1 # v1.1.0
|
||||
with:
|
||||
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
This issue has been automatically marked as stale. **If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the [latest version of Electron](https://www.electronjs.org/releases/stable) or in the [beta](https://www.electronjs.org/releases/beta)—please include it with your comment!
|
||||
close-issue-message: >
|
||||
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
|
||||
exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed"
|
||||
exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed,stale-exempt"
|
||||
only-pr-labels: not-a-real-label
|
||||
pending-repro:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
16
BUILD.gn
16
BUILD.gn
@@ -9,7 +9,7 @@ import("//pdf/features.gni")
|
||||
import("//ppapi/buildflags/buildflags.gni")
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
import("//testing/test.gni")
|
||||
import("//third_party/electron_node/node.gni")
|
||||
import("//third_party/electron_node/electron_node.gni")
|
||||
import("//third_party/ffmpeg/ffmpeg_options.gni")
|
||||
import("//tools/generate_library_loader/generate_library_loader.gni")
|
||||
import("//tools/grit/grit_rule.gni")
|
||||
@@ -414,8 +414,10 @@ action("electron_generate_node_defines") {
|
||||
}
|
||||
|
||||
source_set("electron_lib") {
|
||||
configs += [ "//v8:external_startup_data" ]
|
||||
configs += [ "//third_party/electron_node:node_internals" ]
|
||||
configs += [
|
||||
"//v8:external_startup_data",
|
||||
"//third_party/electron_node:node_internals",
|
||||
]
|
||||
|
||||
public_configs = [
|
||||
":branding",
|
||||
@@ -660,6 +662,7 @@ source_set("electron_lib") {
|
||||
}
|
||||
if (is_win) {
|
||||
libs += [ "dwmapi.lib" ]
|
||||
sources += [ "shell/common/asar/archive_win.cc" ]
|
||||
deps += [
|
||||
"//components/crash/core/app:crash_export_thunks",
|
||||
"//ui/native_theme:native_theme_browser",
|
||||
@@ -693,13 +696,6 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_views_api) {
|
||||
sources += [
|
||||
"shell/browser/api/views/electron_api_image_view.cc",
|
||||
"shell/browser/api/views/electron_api_image_view.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_printing) {
|
||||
sources += [
|
||||
"shell/browser/printing/print_view_manager_electron.cc",
|
||||
|
||||
4
DEPS
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'122.0.6261.39',
|
||||
'123.0.6264.0',
|
||||
'node_version':
|
||||
'v20.9.0',
|
||||
'v20.11.0',
|
||||
'nan_version':
|
||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-121.0.6116.0
|
||||
image: e-122.0.6236.2
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
@@ -106,7 +106,7 @@ for:
|
||||
- mkdir third_party
|
||||
- ps: >-
|
||||
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
|
||||
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath({})"
|
||||
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath"
|
||||
- ps: >-
|
||||
& $env:RECLIENT_HELPER login
|
||||
- ps: >-
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-121.0.6116.0
|
||||
image: e-122.0.6236.2
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
@@ -104,7 +104,7 @@ for:
|
||||
- mkdir third_party
|
||||
- ps: >-
|
||||
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
|
||||
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath({})"
|
||||
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath"
|
||||
- ps: >-
|
||||
& $env:RECLIENT_HELPER login
|
||||
- ps: >-
|
||||
|
||||
@@ -53,12 +53,6 @@ module.exports = ({
|
||||
|
||||
const ignoredModules = [];
|
||||
|
||||
if (defines.ENABLE_VIEWS_API === 'false') {
|
||||
ignoredModules.push(
|
||||
'@electron/internal/browser/api/views/image-view.js'
|
||||
);
|
||||
}
|
||||
|
||||
const plugins = [];
|
||||
|
||||
if (onlyPrintingGraph) {
|
||||
|
||||
@@ -9,21 +9,9 @@ buildflag_header("buildflags") {
|
||||
header = "buildflags.h"
|
||||
|
||||
flags = [
|
||||
"ENABLE_VIEWS_API=$enable_views_api",
|
||||
"ENABLE_PDF_VIEWER=$enable_pdf_viewer",
|
||||
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
|
||||
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
|
||||
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
|
||||
]
|
||||
|
||||
if (electron_vendor_version != "") {
|
||||
result = string_split(electron_vendor_version, ":")
|
||||
flags += [
|
||||
"HAS_VENDOR_VERSION=true",
|
||||
"VENDOR_VERSION_NAME=\"${result[0]}\"",
|
||||
"VENDOR_VERSION_VALUE=\"${result[1]}\"",
|
||||
]
|
||||
} else {
|
||||
flags += [ "HAS_VENDOR_VERSION=false" ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
declare_args() {
|
||||
enable_views_api = true
|
||||
|
||||
enable_pdf_viewer = true
|
||||
|
||||
# Provide a fake location provider for mocking
|
||||
@@ -23,10 +21,4 @@ declare_args() {
|
||||
# Packagers and vendor builders should set this in gn args to avoid running
|
||||
# the script that reads git tag.
|
||||
override_electron_version = ""
|
||||
|
||||
# Define an extra item that will show in process.versions, the value must
|
||||
# be in the format of "key:value".
|
||||
# Packagers and vendor builders can set this in gn args to attach extra info
|
||||
# about the build in the binary.
|
||||
electron_vendor_version = ""
|
||||
}
|
||||
|
||||
@@ -242,8 +242,6 @@ static_library("chrome") {
|
||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
|
||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h",
|
||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm",
|
||||
"//chrome/browser/media/webrtc/thumbnail_capturer_mac.h",
|
||||
"//chrome/browser/media/webrtc/thumbnail_capturer_mac.mm",
|
||||
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
|
||||
"//chrome/browser/platform_util_mac.mm",
|
||||
"//chrome/browser/process_singleton_mac.mm",
|
||||
|
||||
@@ -106,7 +106,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||
|
||||
* [app](api/app.md)
|
||||
* [autoUpdater](api/auto-updater.md)
|
||||
* [BrowserView](api/browser-view.md)
|
||||
* [BaseWindow](api/base-window.md)
|
||||
* [BrowserWindow](api/browser-window.md)
|
||||
* [contentTracing](api/content-tracing.md)
|
||||
* [desktopCapturer](api/desktop-capturer.md)
|
||||
@@ -134,8 +134,10 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||
* [TouchBar](api/touch-bar.md)
|
||||
* [Tray](api/tray.md)
|
||||
* [utilityProcess](api/utility-process.md)
|
||||
* [View](api/view.md)
|
||||
* [webContents](api/web-contents.md)
|
||||
* [webFrameMain](api/web-frame-main.md)
|
||||
* [WebContentsView](api/web-contents-view.md)
|
||||
|
||||
### Modules for the Renderer Process (Web Page):
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Accelerators are strings that can contain multiple modifiers and a single key code,
|
||||
combined by the `+` character, and are used to define keyboard shortcuts
|
||||
throughout your application.
|
||||
throughout your application. Accelerators are case insensitive.
|
||||
|
||||
Examples:
|
||||
|
||||
|
||||
1380
docs/api/base-window.md
Normal file
1380
docs/api/base-window.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,9 @@
|
||||
# BrowserView
|
||||
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
A `BrowserView` can be used to embed additional web content into a
|
||||
[`BrowserWindow`](browser-window.md). It is like a child window, except that it is positioned
|
||||
relative to its owning window. It is meant to be an alternative to the
|
||||
@@ -9,6 +13,10 @@ relative to its owning window. It is meant to be an alternative to the
|
||||
|
||||
> Create and control views.
|
||||
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
This module cannot be used until the `ready` event of the `app`
|
||||
@@ -30,7 +38,7 @@ app.whenReady().then(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### `new BrowserView([options])` _Experimental_
|
||||
### `new BrowserView([options])` _Experimental_ _Deprecated_
|
||||
|
||||
* `options` Object (optional)
|
||||
* `webPreferences` [WebPreferences](structures/web-preferences.md?inline) (optional) - Settings of web page's features.
|
||||
@@ -39,7 +47,7 @@ app.whenReady().then(() => {
|
||||
|
||||
Objects created with `new BrowserView` have the following properties:
|
||||
|
||||
#### `view.webContents` _Experimental_
|
||||
#### `view.webContents` _Experimental_ _Deprecated_
|
||||
|
||||
A [`WebContents`](web-contents.md) object owned by this view.
|
||||
|
||||
@@ -47,7 +55,7 @@ A [`WebContents`](web-contents.md) object owned by this view.
|
||||
|
||||
Objects created with `new BrowserView` have the following instance methods:
|
||||
|
||||
#### `view.setAutoResize(options)` _Experimental_
|
||||
#### `view.setAutoResize(options)` _Experimental_ _Deprecated_
|
||||
|
||||
* `options` Object
|
||||
* `width` boolean (optional) - If `true`, the view's width will grow and shrink together
|
||||
@@ -59,19 +67,19 @@ Objects created with `new BrowserView` have the following instance methods:
|
||||
* `vertical` boolean (optional) - If `true`, the view's y position and height will grow
|
||||
and shrink proportionally with the window. `false` by default.
|
||||
|
||||
#### `view.setBounds(bounds)` _Experimental_
|
||||
#### `view.setBounds(bounds)` _Experimental_ _Deprecated_
|
||||
|
||||
* `bounds` [Rectangle](structures/rectangle.md)
|
||||
|
||||
Resizes and moves the view to the supplied bounds relative to the window.
|
||||
|
||||
#### `view.getBounds()` _Experimental_
|
||||
#### `view.getBounds()` _Experimental_ _Deprecated_
|
||||
|
||||
Returns [`Rectangle`](structures/rectangle.md)
|
||||
|
||||
The `bounds` of this BrowserView instance as `Object`.
|
||||
|
||||
#### `view.setBackgroundColor(color)` _Experimental_
|
||||
#### `view.setBackgroundColor(color)` _Experimental_ _Deprecated_
|
||||
|
||||
* `color` string - Color in Hex, RGB, ARGB, HSL, HSLA or named CSS color format. The alpha channel is
|
||||
optional for the hex type.
|
||||
@@ -79,25 +87,25 @@ The `bounds` of this BrowserView instance as `Object`.
|
||||
Examples of valid `color` values:
|
||||
|
||||
* Hex
|
||||
* #fff (RGB)
|
||||
* #ffff (ARGB)
|
||||
* #ffffff (RRGGBB)
|
||||
* #ffffffff (AARRGGBB)
|
||||
* `#fff` (RGB)
|
||||
* `#ffff` (ARGB)
|
||||
* `#ffffff` (RRGGBB)
|
||||
* `#ffffffff` (AARRGGBB)
|
||||
* RGB
|
||||
* rgb\((\[\d]+),\s*(\[\d]+),\s*(\[\d]+)\)
|
||||
* e.g. rgb(255, 255, 255)
|
||||
* `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
||||
* e.g. `rgb(255, 255, 255)`
|
||||
* RGBA
|
||||
* rgba\((\[\d]+),\s*(\[\d]+),\s*(\[\d]+),\s*(\[\d.]+)\)
|
||||
* e.g. rgba(255, 255, 255, 1.0)
|
||||
* `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
||||
* e.g. `rgba(255, 255, 255, 1.0)`
|
||||
* HSL
|
||||
* hsl\((-?\[\d.]+),\s*(\[\d.]+)%,\s*(\[\d.]+)%\)
|
||||
* e.g. hsl(200, 20%, 50%)
|
||||
* `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
||||
* e.g. `hsl(200, 20%, 50%)`
|
||||
* HSLA
|
||||
* hsla\((-?\[\d.]+),\s*(\[\d.]+)%,\s*(\[\d.]+)%,\s*(\[\d.]+)\)
|
||||
* e.g. hsla(200, 20%, 50%, 0.5)
|
||||
* `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
||||
* e.g. `hsla(200, 20%, 50%, 0.5)`
|
||||
* Color name
|
||||
* Options are listed in [SkParseColor.cpp](https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/utils/SkParseColor.cpp;l=11-152;drc=eea4bf52cb0d55e2a39c828b017c80a5ee054148)
|
||||
* Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
||||
* e.g. `blueviolet` or `red`
|
||||
|
||||
**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBA` or `RGA`.
|
||||
**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or `RGB`.
|
||||
|
||||
@@ -98,8 +98,8 @@ The `child` window will always show on top of the `top` window.
|
||||
|
||||
## Modal windows
|
||||
|
||||
A modal window is a child window that disables parent window, to create a modal
|
||||
window, you have to set both `parent` and `modal` options:
|
||||
A modal window is a child window that disables parent window. To create a modal
|
||||
window, you have to set both the `parent` and `modal` options:
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
@@ -140,7 +140,7 @@ state is `hidden` in order to minimize power consumption.
|
||||
* On Linux the type of modal windows will be changed to `dialog`.
|
||||
* On Linux many desktop environments do not support hiding a modal window.
|
||||
|
||||
## Class: BrowserWindow
|
||||
## Class: BrowserWindow extends `BaseWindow`
|
||||
|
||||
> Create and control browser windows.
|
||||
|
||||
@@ -440,10 +440,14 @@ Returns `BrowserWindow | null` - The window that is focused in this application,
|
||||
Returns `BrowserWindow | null` - The window that owns the given `webContents`
|
||||
or `null` if the contents are not owned by a window.
|
||||
|
||||
#### `BrowserWindow.fromBrowserView(browserView)`
|
||||
#### `BrowserWindow.fromBrowserView(browserView)` _Deprecated_
|
||||
|
||||
* `browserView` [BrowserView](browser-view.md)
|
||||
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
Returns `BrowserWindow | null` - The window that owns the given `browserView`. If the given view is not attached to any window, returns `null`.
|
||||
|
||||
#### `BrowserWindow.fromId(id)`
|
||||
@@ -1580,41 +1584,62 @@ machine has a touch bar.
|
||||
**Note:** The TouchBar API is currently experimental and may change or be
|
||||
removed in future Electron releases.
|
||||
|
||||
#### `win.setBrowserView(browserView)` _Experimental_
|
||||
#### `win.setBrowserView(browserView)` _Experimental_ _Deprecated_
|
||||
|
||||
* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`.
|
||||
If there are other `BrowserView`s attached, they will be removed from
|
||||
this window.
|
||||
|
||||
#### `win.getBrowserView()` _Experimental_
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
#### `win.getBrowserView()` _Experimental_ _Deprecated_
|
||||
|
||||
Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null`
|
||||
if one is not attached. Throws an error if multiple `BrowserView`s are attached.
|
||||
|
||||
#### `win.addBrowserView(browserView)` _Experimental_
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
#### `win.addBrowserView(browserView)` _Experimental_ _Deprecated_
|
||||
|
||||
* `browserView` [BrowserView](browser-view.md)
|
||||
|
||||
Replacement API for setBrowserView supporting work with multi browser views.
|
||||
|
||||
#### `win.removeBrowserView(browserView)` _Experimental_
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
#### `win.removeBrowserView(browserView)` _Experimental_ _Deprecated_
|
||||
|
||||
* `browserView` [BrowserView](browser-view.md)
|
||||
|
||||
#### `win.setTopBrowserView(browserView)` _Experimental_
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
#### `win.setTopBrowserView(browserView)` _Experimental_ _Deprecated_
|
||||
|
||||
* `browserView` [BrowserView](browser-view.md)
|
||||
|
||||
Raises `browserView` above other `BrowserView`s attached to `win`.
|
||||
Throws an error if `browserView` is not attached to `win`.
|
||||
|
||||
#### `win.getBrowserViews()` _Experimental_
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
#### `win.getBrowserViews()` _Experimental_ _Deprecated_
|
||||
|
||||
Returns `BrowserView[]` - a sorted by z-index array of all BrowserViews that have been attached
|
||||
with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
|
||||
|
||||
**Note:** The BrowserView API is currently experimental and may change or be
|
||||
removed in future Electron releases.
|
||||
> **Note**
|
||||
> The `BrowserView` class is deprecated, and replaced by the new
|
||||
> [`WebContentsView`](web-contents-view.md) class.
|
||||
|
||||
#### `win.setTitleBarOverlay(options)` _Windows_
|
||||
|
||||
|
||||
@@ -142,11 +142,6 @@ Setting this variable is the same as passing `--log-file`
|
||||
on the command line. For more info, see `--log-file` in [command-line
|
||||
switches](./command-line-switches.md#--log-filepath).
|
||||
|
||||
### `ELECTRON_DEBUG_DRAG_REGIONS`
|
||||
|
||||
Adds coloration to draggable regions on [`BrowserView`](./browser-view.md)s on macOS - draggable regions will be colored
|
||||
green and non-draggable regions will be colored red to aid debugging.
|
||||
|
||||
### `ELECTRON_DEBUG_NOTIFICATIONS`
|
||||
|
||||
Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to.
|
||||
|
||||
@@ -51,13 +51,6 @@ Check the _Size requirements_ section in [this article][icons].
|
||||
|
||||
[icons]: https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-icons
|
||||
|
||||
:::note
|
||||
|
||||
EXIF metadata is currently not supported and will not be taken into account during
|
||||
image encoding and decoding.
|
||||
|
||||
:::
|
||||
|
||||
## High Resolution Image
|
||||
|
||||
On platforms that have high-DPI support such as Apple Retina displays, you can
|
||||
|
||||
152
docs/api/structures/base-window-options.md
Normal file
152
docs/api/structures/base-window-options.md
Normal file
@@ -0,0 +1,152 @@
|
||||
# BaseWindowConstructorOptions Object
|
||||
|
||||
* `width` Integer (optional) - Window's width in pixels. Default is `800`.
|
||||
* `height` Integer (optional) - Window's height in pixels. Default is `600`.
|
||||
* `x` Integer (optional) - (**required** if y is used) Window's left offset from screen.
|
||||
Default is to center the window.
|
||||
* `y` Integer (optional) - (**required** if x is used) Window's top offset from screen.
|
||||
Default is to center the window.
|
||||
* `useContentSize` boolean (optional) - The `width` and `height` would be used as web
|
||||
page's size, which means the actual window's size will include window
|
||||
frame's size and be slightly larger. Default is `false`.
|
||||
* `center` boolean (optional) - Show window in the center of the screen. Default is `false`.
|
||||
* `minWidth` Integer (optional) - Window's minimum width. Default is `0`.
|
||||
* `minHeight` Integer (optional) - Window's minimum height. Default is `0`.
|
||||
* `maxWidth` Integer (optional) - Window's maximum width. Default is no limit.
|
||||
* `maxHeight` Integer (optional) - Window's maximum height. Default is no limit.
|
||||
* `resizable` boolean (optional) - Whether window is resizable. Default is `true`.
|
||||
* `movable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
movable. This is not implemented on Linux. Default is `true`.
|
||||
* `minimizable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
minimizable. This is not implemented on Linux. Default is `true`.
|
||||
* `maximizable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
maximizable. This is not implemented on Linux. Default is `true`.
|
||||
* `closable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
closable. This is not implemented on Linux. Default is `true`.
|
||||
* `focusable` boolean (optional) - Whether the window can be focused. Default is
|
||||
`true`. On Windows setting `focusable: false` also implies setting
|
||||
`skipTaskbar: true`. On Linux setting `focusable: false` makes the window
|
||||
stop interacting with wm, so the window will always stay on top in all
|
||||
workspaces.
|
||||
* `alwaysOnTop` boolean (optional) - Whether the window should always stay on top of
|
||||
other windows. Default is `false`.
|
||||
* `fullscreen` boolean (optional) - Whether the window should show in fullscreen. When
|
||||
explicitly set to `false` the fullscreen button will be hidden or disabled
|
||||
on macOS. Default is `false`.
|
||||
* `fullscreenable` boolean (optional) - Whether the window can be put into fullscreen
|
||||
mode. On macOS, also whether the maximize/zoom button should toggle full
|
||||
screen mode or maximize window. Default is `true`.
|
||||
* `simpleFullscreen` boolean (optional) _macOS_ - Use pre-Lion fullscreen on
|
||||
macOS. Default is `false`.
|
||||
* `skipTaskbar` boolean (optional) _macOS_ _Windows_ - Whether to show the window in taskbar.
|
||||
Default is `false`.
|
||||
* `hiddenInMissionControl` boolean (optional) _macOS_ - Whether window should be hidden when the user toggles into mission control.
|
||||
* `kiosk` boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
|
||||
* `title` string (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
||||
* `icon` ([NativeImage](../native-image.md) | string) (optional) - The window icon. On Windows it is
|
||||
recommended to use `ICO` icons to get best visual effects, you can also
|
||||
leave it undefined so the executable's icon will be used.
|
||||
* `show` boolean (optional) - Whether window should be shown when created. Default is
|
||||
`true`.
|
||||
* `frame` boolean (optional) - Specify `false` to create a
|
||||
[frameless window](../../tutorial/window-customization.md#create-frameless-windows). Default is `true`.
|
||||
* `parent` BaseWindow (optional) - Specify parent window. Default is `null`.
|
||||
* `modal` boolean (optional) - Whether this is a modal window. This only works when the
|
||||
window is a child window. Default is `false`.
|
||||
* `acceptFirstMouse` boolean (optional) _macOS_ - Whether clicking an
|
||||
inactive window will also click through to the web contents. Default is
|
||||
`false` on macOS. This option is not configurable on other platforms.
|
||||
* `disableAutoHideCursor` boolean (optional) - Whether to hide cursor when typing.
|
||||
Default is `false`.
|
||||
* `autoHideMenuBar` boolean (optional) - Auto hide the menu bar unless the `Alt`
|
||||
key is pressed. Default is `false`.
|
||||
* `enableLargerThanScreen` boolean (optional) _macOS_ - Enable the window to
|
||||
be resized larger than screen. Only relevant for macOS, as other OSes
|
||||
allow larger-than-screen windows by default. Default is `false`.
|
||||
* `backgroundColor` string (optional) - The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if `transparent` is set to `true`. Default is `#FFF` (white). See [win.setBackgroundColor](../browser-window.md#winsetbackgroundcolorbackgroundcolor) for more information.
|
||||
* `hasShadow` boolean (optional) - Whether window should have a shadow. Default is `true`.
|
||||
* `opacity` number (optional) _macOS_ _Windows_ - Set the initial opacity of
|
||||
the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This
|
||||
is only implemented on Windows and macOS.
|
||||
* `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
* `transparent` boolean (optional) - Makes the window [transparent](../../tutorial/window-customization.md#create-transparent-windows).
|
||||
Default is `false`. On Windows, does not work unless the window is frameless.
|
||||
* `type` string (optional) - The type of window, default is normal window. See more about
|
||||
this below.
|
||||
* `visualEffectState` string (optional) _macOS_ - Specify how the material
|
||||
appearance should reflect window activity state on macOS. Must be used
|
||||
with the `vibrancy` property. Possible values are:
|
||||
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
|
||||
* `active` - The backdrop should always appear active.
|
||||
* `inactive` - The backdrop should always appear inactive.
|
||||
* `titleBarStyle` string (optional) _macOS_ _Windows_ - The style of window title bar.
|
||||
Default is `default`. Possible values are:
|
||||
* `default` - Results in the standard title bar for macOS or Windows respectively.
|
||||
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
|
||||
* `hiddenInset` _macOS_ - Only on macOS, results in a hidden title bar
|
||||
with an alternative look where the traffic light buttons are slightly
|
||||
more inset from the window edge.
|
||||
* `customButtonsOnHover` _macOS_ - Only on macOS, results in a hidden
|
||||
title bar and a full size content window, the traffic light buttons will
|
||||
display when being hovered over in the top left of the window.
|
||||
**Note:** This option is currently experimental.
|
||||
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
|
||||
Set a custom position for the traffic light buttons in frameless windows.
|
||||
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
|
||||
should have rounded corners on macOS. Default is `true`. Setting this property
|
||||
to `false` will prevent the window from being fullscreenable.
|
||||
* `thickFrame` boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
|
||||
Windows, which adds standard window frame. Setting it to `false` will remove
|
||||
window shadow and window animations. Default is `true`.
|
||||
* `vibrancy` string (optional) _macOS_ - Add a type of vibrancy effect to
|
||||
the window, only on macOS. Can be `appearance-based`, `titlebar`, `selection`,
|
||||
`menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`,
|
||||
`tooltip`, `content`, `under-window`, or `under-page`.
|
||||
* `backgroundMaterial` string (optional) _Windows_ - Set the window's
|
||||
system-drawn background material, including behind the non-client area.
|
||||
Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See [win.setBackgroundMaterial](../browser-window.md#winsetbackgroundmaterialmaterial-windows) for more information.
|
||||
* `zoomToPageWidth` boolean (optional) _macOS_ - Controls the behavior on
|
||||
macOS when option-clicking the green stoplight button on the toolbar or by
|
||||
clicking the Window > Zoom menu item. If `true`, the window will grow to
|
||||
the preferred width of the web page when zoomed, `false` will cause it to
|
||||
zoom to the width of the screen. This will also affect the behavior when
|
||||
calling `maximize()` directly. Default is `false`.
|
||||
* `tabbingIdentifier` string (optional) _macOS_ - Tab group name, allows
|
||||
opening the window as a native tab. Windows with the same
|
||||
tabbing identifier will be grouped together. This also adds a native new
|
||||
tab button to your window's tab bar and allows your `app` and window to
|
||||
receive the `new-window-for-tab` event.
|
||||
|
||||
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
|
||||
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
|
||||
passing a size that does not follow size constraints to `setBounds`/`setSize` or
|
||||
to the constructor of `BrowserWindow`.
|
||||
|
||||
The possible values and behaviors of the `type` option are platform dependent.
|
||||
Possible values are:
|
||||
|
||||
* On Linux, possible types are `desktop`, `dock`, `toolbar`, `splash`,
|
||||
`notification`.
|
||||
* The `desktop` type places the window at the desktop background window level
|
||||
(kCGDesktopWindowLevel - 1). However, note that a desktop window will not
|
||||
receive focus, keyboard, or mouse events. You can still use globalShortcut to
|
||||
receive input sparingly.
|
||||
* The `dock` type creates a dock-like window behavior.
|
||||
* The `toolbar` type creates a window with a toolbar appearance.
|
||||
* The `splash` type behaves in a specific way. It is not
|
||||
draggable, even if the CSS styling of the window's body contains
|
||||
-webkit-app-region: drag. This type is commonly used for splash screens.
|
||||
* The `notification` type creates a window that behaves like a system notification.
|
||||
* On macOS, possible types are `desktop`, `textured`, `panel`.
|
||||
* The `textured` type adds metal gradient appearance
|
||||
(`NSWindowStyleMaskTexturedBackground`).
|
||||
* The `desktop` type places the window at the desktop background window level
|
||||
(`kCGDesktopWindowLevel - 1`). Note that desktop window will not receive
|
||||
focus, keyboard or mouse events, but you can use `globalShortcut` to receive
|
||||
input sparingly.
|
||||
* The `panel` type enables the window to float on top of full-screened apps
|
||||
by adding the `NSWindowStyleMaskNonactivatingPanel` style mask,normally
|
||||
reserved for NSPanel, at runtime. Also, the window will appear on all
|
||||
spaces (desktops).
|
||||
* On Windows, possible type is `toolbar`.
|
||||
@@ -1,161 +1,11 @@
|
||||
# BrowserWindowConstructorOptions Object
|
||||
# BrowserWindowConstructorOptions Object extends `BaseWindowConstructorOptions`
|
||||
|
||||
* `width` Integer (optional) - Window's width in pixels. Default is `800`.
|
||||
* `height` Integer (optional) - Window's height in pixels. Default is `600`.
|
||||
* `x` Integer (optional) - (**required** if y is used) Window's left offset from screen.
|
||||
Default is to center the window.
|
||||
* `y` Integer (optional) - (**required** if x is used) Window's top offset from screen.
|
||||
Default is to center the window.
|
||||
* `useContentSize` boolean (optional) - The `width` and `height` would be used as web
|
||||
page's size, which means the actual window's size will include window
|
||||
frame's size and be slightly larger. Default is `false`.
|
||||
* `center` boolean (optional) - Show window in the center of the screen. Default is `false`.
|
||||
* `minWidth` Integer (optional) - Window's minimum width. Default is `0`.
|
||||
* `minHeight` Integer (optional) - Window's minimum height. Default is `0`.
|
||||
* `maxWidth` Integer (optional) - Window's maximum width. Default is no limit.
|
||||
* `maxHeight` Integer (optional) - Window's maximum height. Default is no limit.
|
||||
* `resizable` boolean (optional) - Whether window is resizable. Default is `true`.
|
||||
* `movable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
movable. This is not implemented on Linux. Default is `true`.
|
||||
* `minimizable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
minimizable. This is not implemented on Linux. Default is `true`.
|
||||
* `maximizable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
maximizable. This is not implemented on Linux. Default is `true`.
|
||||
* `closable` boolean (optional) _macOS_ _Windows_ - Whether window is
|
||||
closable. This is not implemented on Linux. Default is `true`.
|
||||
* `focusable` boolean (optional) - Whether the window can be focused. Default is
|
||||
`true`. On Windows setting `focusable: false` also implies setting
|
||||
`skipTaskbar: true`. On Linux setting `focusable: false` makes the window
|
||||
stop interacting with wm, so the window will always stay on top in all
|
||||
workspaces.
|
||||
* `alwaysOnTop` boolean (optional) - Whether the window should always stay on top of
|
||||
other windows. Default is `false`.
|
||||
* `fullscreen` boolean (optional) - Whether the window should show in fullscreen. When
|
||||
explicitly set to `false` the fullscreen button will be hidden or disabled
|
||||
on macOS. Default is `false`.
|
||||
* `fullscreenable` boolean (optional) - Whether the window can be put into fullscreen
|
||||
mode. On macOS, also whether the maximize/zoom button should toggle full
|
||||
screen mode or maximize window. Default is `true`.
|
||||
* `simpleFullscreen` boolean (optional) _macOS_ - Use pre-Lion fullscreen on
|
||||
macOS. Default is `false`.
|
||||
* `skipTaskbar` boolean (optional) _macOS_ _Windows_ - Whether to show the window in taskbar.
|
||||
Default is `false`.
|
||||
* `hiddenInMissionControl` boolean (optional) _macOS_ - Whether window should be hidden when the user toggles into mission control.
|
||||
* `kiosk` boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
|
||||
* `title` string (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
||||
* `icon` ([NativeImage](../native-image.md) | string) (optional) - The window icon. On Windows it is
|
||||
recommended to use `ICO` icons to get best visual effects, you can also
|
||||
leave it undefined so the executable's icon will be used.
|
||||
* `show` boolean (optional) - Whether window should be shown when created. Default is
|
||||
`true`.
|
||||
* `paintWhenInitiallyHidden` boolean (optional) - Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
||||
* `frame` boolean (optional) - Specify `false` to create a
|
||||
[frameless window](../../tutorial/window-customization.md#create-frameless-windows). Default is `true`.
|
||||
* `parent` BrowserWindow (optional) - Specify parent window. Default is `null`.
|
||||
* `modal` boolean (optional) - Whether this is a modal window. This only works when the
|
||||
window is a child window. Default is `false`.
|
||||
* `acceptFirstMouse` boolean (optional) _macOS_ - Whether clicking an
|
||||
inactive window will also click through to the web contents. Default is
|
||||
`false` on macOS. This option is not configurable on other platforms.
|
||||
* `disableAutoHideCursor` boolean (optional) - Whether to hide cursor when typing.
|
||||
Default is `false`.
|
||||
* `autoHideMenuBar` boolean (optional) - Auto hide the menu bar unless the `Alt`
|
||||
key is pressed. Default is `false`.
|
||||
* `enableLargerThanScreen` boolean (optional) _macOS_ - Enable the window to
|
||||
be resized larger than screen. Only relevant for macOS, as other OSes
|
||||
allow larger-than-screen windows by default. Default is `false`.
|
||||
* `backgroundColor` string (optional) - The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if `transparent` is set to `true`. Default is `#FFF` (white). See [win.setBackgroundColor](../browser-window.md#winsetbackgroundcolorbackgroundcolor) for more information.
|
||||
* `hasShadow` boolean (optional) - Whether window should have a shadow. Default is `true`.
|
||||
* `opacity` number (optional) _macOS_ _Windows_ - Set the initial opacity of
|
||||
the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This
|
||||
is only implemented on Windows and macOS.
|
||||
* `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
* `transparent` boolean (optional) - Makes the window [transparent](../../tutorial/window-customization.md#create-transparent-windows).
|
||||
Default is `false`. On Windows, does not work unless the window is frameless.
|
||||
* `type` string (optional) - The type of window, default is normal window. See more about
|
||||
this below.
|
||||
* `visualEffectState` string (optional) _macOS_ - Specify how the material
|
||||
appearance should reflect window activity state on macOS. Must be used
|
||||
with the `vibrancy` property. Possible values are:
|
||||
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
|
||||
* `active` - The backdrop should always appear active.
|
||||
* `inactive` - The backdrop should always appear inactive.
|
||||
* `titleBarStyle` string (optional) _macOS_ _Windows_ - The style of window title bar.
|
||||
Default is `default`. Possible values are:
|
||||
* `default` - Results in the standard title bar for macOS or Windows respectively.
|
||||
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
|
||||
* `hiddenInset` _macOS_ - Only on macOS, results in a hidden title bar
|
||||
with an alternative look where the traffic light buttons are slightly
|
||||
more inset from the window edge.
|
||||
* `customButtonsOnHover` _macOS_ - Only on macOS, results in a hidden
|
||||
title bar and a full size content window, the traffic light buttons will
|
||||
display when being hovered over in the top left of the window.
|
||||
**Note:** This option is currently experimental.
|
||||
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
|
||||
Set a custom position for the traffic light buttons in frameless windows.
|
||||
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
|
||||
should have rounded corners on macOS. Default is `true`. Setting this property
|
||||
to `false` will prevent the window from being fullscreenable.
|
||||
* `thickFrame` boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
|
||||
Windows, which adds standard window frame. Setting it to `false` will remove
|
||||
window shadow and window animations. Default is `true`.
|
||||
* `vibrancy` string (optional) _macOS_ - Add a type of vibrancy effect to
|
||||
the window, only on macOS. Can be `appearance-based`, `titlebar`, `selection`,
|
||||
`menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`,
|
||||
`tooltip`, `content`, `under-window`, or `under-page`.
|
||||
* `backgroundMaterial` string (optional) _Windows_ - Set the window's
|
||||
system-drawn background material, including behind the non-client area.
|
||||
Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See [win.setBackgroundMaterial](../browser-window.md#winsetbackgroundmaterialmaterial-windows) for more information.
|
||||
* `zoomToPageWidth` boolean (optional) _macOS_ - Controls the behavior on
|
||||
macOS when option-clicking the green stoplight button on the toolbar or by
|
||||
clicking the Window > Zoom menu item. If `true`, the window will grow to
|
||||
the preferred width of the web page when zoomed, `false` will cause it to
|
||||
zoom to the width of the screen. This will also affect the behavior when
|
||||
calling `maximize()` directly. Default is `false`.
|
||||
* `tabbingIdentifier` string (optional) _macOS_ - Tab group name, allows
|
||||
opening the window as a native tab. Windows with the same
|
||||
tabbing identifier will be grouped together. This also adds a native new
|
||||
tab button to your window's tab bar and allows your `app` and window to
|
||||
receive the `new-window-for-tab` event.
|
||||
* `webPreferences` [WebPreferences](web-preferences.md?inline) (optional) - Settings of web page's features.
|
||||
* `paintWhenInitiallyHidden` boolean (optional) - Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
||||
* `titleBarOverlay` Object | Boolean (optional) - When using a frameless window in conjunction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Default is `false`.
|
||||
* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color.
|
||||
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
|
||||
* `height` Integer (optional) _macOS_ _Windows_ - The height of the title bar and Window Controls Overlay in pixels. Default is system height.
|
||||
|
||||
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
|
||||
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
|
||||
passing a size that does not follow size constraints to `setBounds`/`setSize` or
|
||||
to the constructor of `BrowserWindow`.
|
||||
|
||||
The possible values and behaviors of the `type` option are platform dependent.
|
||||
Possible values are:
|
||||
|
||||
* On Linux, possible types are `desktop`, `dock`, `toolbar`, `splash`,
|
||||
`notification`.
|
||||
* The `desktop` type places the window at the desktop background window level
|
||||
(kCGDesktopWindowLevel - 1). However, note that a desktop window will not
|
||||
receive focus, keyboard, or mouse events. You can still use globalShortcut to
|
||||
receive input sparingly.
|
||||
* The `dock` type creates a dock-like window behavior.
|
||||
* The `toolbar` type creates a window with a toolbar appearance.
|
||||
* The `splash` type behaves in a specific way. It is not
|
||||
draggable, even if the CSS styling of the window's body contains
|
||||
-webkit-app-region: drag. This type is commonly used for splash screens.
|
||||
* The `notification` type creates a window that behaves like a system notification.
|
||||
* On macOS, possible types are `desktop`, `textured`, `panel`.
|
||||
* The `textured` type adds metal gradient appearance
|
||||
(`NSWindowStyleMaskTexturedBackground`).
|
||||
* The `desktop` type places the window at the desktop background window level
|
||||
(`kCGDesktopWindowLevel - 1`). Note that desktop window will not receive
|
||||
focus, keyboard or mouse events, but you can use `globalShortcut` to receive
|
||||
input sparingly.
|
||||
* The `panel` type enables the window to float on top of full-screened apps
|
||||
by adding the `NSWindowStyleMaskNonactivatingPanel` style mask,normally
|
||||
reserved for NSPanel, at runtime. Also, the window will appear on all
|
||||
spaces (desktops).
|
||||
* On Windows, possible type is `toolbar`.
|
||||
|
||||
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
||||
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
||||
|
||||
@@ -21,11 +21,12 @@ Process: [Main](../glossary.md#main-process)<br />
|
||||
of the child process. Default is `inherit`.
|
||||
String value can be one of `pipe`, `ignore`, `inherit`, for more details on these values you can refer to
|
||||
[stdio][] documentation from Node.js. Currently this option only supports configuring `stdout` and
|
||||
`stderr` to either `pipe`, `inherit` or `ignore`. Configuring `stdin` to any property other than `ignore` is not supported and will result in an error.
|
||||
`stderr` to either `pipe`, `inherit` or `ignore`. Configuring `stdin` is not supported; `stdin` will
|
||||
always be ignored.
|
||||
For example, the supported values will be processed as following:
|
||||
* `pipe`: equivalent to \['ignore', 'pipe', 'pipe']
|
||||
* `pipe`: equivalent to \['ignore', 'pipe', 'pipe'] (the default)
|
||||
* `ignore`: equivalent to \['ignore', 'ignore', 'ignore']
|
||||
* `inherit`: equivalent to \['ignore', 'inherit', 'inherit'] (the default)
|
||||
* `inherit`: equivalent to \['ignore', 'inherit', 'inherit']
|
||||
* `serviceName` string (optional) - Name of the process that will appear in `name` property of
|
||||
[`ProcessMetric`](structures/process-metric.md) returned by [`app.getAppMetrics`](app.md#appgetappmetrics)
|
||||
and [`child-process-gone` event of `app`](app.md#event-child-process-gone).
|
||||
|
||||
106
docs/api/view.md
Normal file
106
docs/api/view.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# View
|
||||
|
||||
> Create and layout native views.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
This module cannot be used until the `ready` event of the `app`
|
||||
module is emitted.
|
||||
|
||||
```js
|
||||
const { BaseWindow, View } = require('electron')
|
||||
const win = new BaseWindow()
|
||||
const view = new View()
|
||||
|
||||
view.setBackgroundColor('red')
|
||||
view.setBounds({ x: 0, y: 0, width: 100, height: 100 })
|
||||
win.contentView.addChildView(view)
|
||||
```
|
||||
|
||||
## Class: View
|
||||
|
||||
> A basic native view.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
`View` is an [EventEmitter][event-emitter].
|
||||
|
||||
### `new View()`
|
||||
|
||||
Creates a new `View`.
|
||||
|
||||
### Instance Events
|
||||
|
||||
Objects created with `new View` emit the following events:
|
||||
|
||||
#### Event: 'bounds-changed'
|
||||
|
||||
Emitted when the view's bounds have changed in response to being laid out. The
|
||||
new bounds can be retrieved with [`view.getBounds()`](#viewgetbounds).
|
||||
|
||||
### Instance Methods
|
||||
|
||||
Objects created with `new View` have the following instance methods:
|
||||
|
||||
#### `view.addChildView(view[, index])`
|
||||
|
||||
* `view` View - Child view to add.
|
||||
* `index` Integer (optional) - Index at which to insert the child view.
|
||||
Defaults to adding the child at the end of the child list.
|
||||
|
||||
#### `view.removeChildView(view)`
|
||||
|
||||
* `view` View - Child view to remove.
|
||||
|
||||
#### `view.setBounds(bounds)`
|
||||
|
||||
* `bounds` [Rectangle](structures/rectangle.md) - New bounds of the View.
|
||||
|
||||
#### `view.getBounds()`
|
||||
|
||||
Returns [`Rectangle`](structures/rectangle.md) - The bounds of this View, relative to its parent.
|
||||
|
||||
#### `view.setBackgroundColor(color)`
|
||||
|
||||
* `color` string - Color in Hex, RGB, ARGB, HSL, HSLA or named CSS color format. The alpha channel is
|
||||
optional for the hex type.
|
||||
|
||||
Examples of valid `color` values:
|
||||
|
||||
* Hex
|
||||
* `#fff` (RGB)
|
||||
* `#ffff` (ARGB)
|
||||
* `#ffffff` (RRGGBB)
|
||||
* `#ffffffff` (AARRGGBB)
|
||||
* RGB
|
||||
* `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
||||
* e.g. `rgb(255, 255, 255)`
|
||||
* RGBA
|
||||
* `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
||||
* e.g. `rgba(255, 255, 255, 1.0)`
|
||||
* HSL
|
||||
* `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
||||
* e.g. `hsl(200, 20%, 50%)`
|
||||
* HSLA
|
||||
* `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
||||
* e.g. `hsla(200, 20%, 50%, 0.5)`
|
||||
* Color name
|
||||
* Options are listed in [SkParseColor.cpp](https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/utils/SkParseColor.cpp;l=11-152;drc=eea4bf52cb0d55e2a39c828b017c80a5ee054148)
|
||||
* Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
||||
* e.g. `blueviolet` or `red`
|
||||
|
||||
**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or `RGB`.
|
||||
|
||||
#### `view.setVisible(visible)`
|
||||
|
||||
* `visible` boolean - If false, the view will be hidden from display.
|
||||
|
||||
### Instance Properties
|
||||
|
||||
Objects created with `new View` have the following properties:
|
||||
|
||||
#### `view.children` _Readonly_
|
||||
|
||||
A `View[]` property representing the child views of this view.
|
||||
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
58
docs/api/web-contents-view.md
Normal file
58
docs/api/web-contents-view.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# WebContentsView
|
||||
|
||||
> A View that displays a WebContents.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
This module cannot be used until the `ready` event of the `app`
|
||||
module is emitted.
|
||||
|
||||
```js
|
||||
const { BaseWindow, WebContentsView } = require('electron')
|
||||
const win = new BaseWindow({ width: 800, height: 400 })
|
||||
|
||||
const view1 = new WebContentsView()
|
||||
win.contentView.addChildView(view1)
|
||||
view1.webContents.loadURL('https://electronjs.org')
|
||||
view1.setBounds({ x: 0, y: 0, width: 400, height: 400 })
|
||||
|
||||
const view2 = new WebContentsView()
|
||||
win.contentView.addChildView(view2)
|
||||
view2.webContents.loadURL('https://github.com/electron/electron')
|
||||
view2.setBounds({ x: 400, y: 0, width: 400, height: 400 })
|
||||
```
|
||||
|
||||
## Class: WebContentsView extends `View`
|
||||
|
||||
> A View that displays a WebContents.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
`WebContentsView` inherits from [`View`](view.md).
|
||||
|
||||
`WebContentsView` is an [EventEmitter][event-emitter].
|
||||
|
||||
### `new WebContentsView([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `webPreferences` [WebPreferences](structures/web-preferences.md) (optional) - Settings of web page's features.
|
||||
|
||||
Creates an empty WebContentsView.
|
||||
|
||||
### Instance Properties
|
||||
|
||||
Objects created with `new WebContentsView` have the following properties, in
|
||||
addition to those inherited from [View](view.md):
|
||||
|
||||
#### `view.webContents` _Readonly_
|
||||
|
||||
A `WebContents` property containing a reference to the displayed `WebContents`.
|
||||
Use this to interact with the `WebContents`, for instance to load a URL.
|
||||
|
||||
```js
|
||||
const { WebContentsView } = require('electron')
|
||||
const view = new WebContentsView()
|
||||
view.webContents.loadURL('https://electronjs.org/')
|
||||
```
|
||||
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
@@ -1614,7 +1614,6 @@ win.webContents.print(options, (success, errorType) => {
|
||||
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
|
||||
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
||||
* `generateTaggedPDF` boolean (optional) _Experimental_ - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards.
|
||||
* `generateDocumentOutline` boolean (optional) _Experimental_ - Whether or not to generate a PDF document outline from content headers. Defaults to false.
|
||||
|
||||
Returns `Promise<Buffer>` - Resolves with the generated PDF data.
|
||||
|
||||
@@ -1625,26 +1624,24 @@ The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
|
||||
An example of `webContents.printToPDF`:
|
||||
|
||||
```js
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
const { BrowserWindow } = require('electron')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const os = require('node:os')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
const win = new BrowserWindow()
|
||||
win.loadURL('https://github.com')
|
||||
const win = new BrowserWindow()
|
||||
win.loadURL('https://github.com')
|
||||
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
// Use default printing options
|
||||
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
|
||||
win.webContents.printToPDF({}).then(data => {
|
||||
fs.writeFile(pdfPath, data, (error) => {
|
||||
if (error) throw error
|
||||
console.log(`Wrote PDF successfully to ${pdfPath}`)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(`Failed to write PDF to ${pdfPath}: `, error)
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
// Use default printing options
|
||||
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
|
||||
win.webContents.printToPDF({}).then(data => {
|
||||
fs.writeFile(pdfPath, data, (error) => {
|
||||
if (error) throw error
|
||||
console.log(`Wrote PDF successfully to ${pdfPath}`)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(`Failed to write PDF to ${pdfPath}: `, error)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
|
||||
Electron's `webview` tag is based on [Chromium's `webview`][chrome-webview], which
|
||||
is undergoing dramatic architectural changes. This impacts the stability of `webviews`,
|
||||
including rendering, navigation, and event routing. We currently recommend to not
|
||||
use the `webview` tag and to consider alternatives, like `iframe`, [Electron's `BrowserView`](browser-view.md),
|
||||
or an architecture that avoids embedded content altogether.
|
||||
including rendering, navigation, and event routing. We currently recommend to
|
||||
not use the `webview` tag and to consider alternatives, like `iframe`, a
|
||||
[`WebContentsView`](web-contents-view.md), or an architecture that avoids
|
||||
embedded content altogether.
|
||||
|
||||
## Enabling
|
||||
|
||||
@@ -220,7 +221,9 @@ windows. Popups are disabled by default.
|
||||
```
|
||||
|
||||
A `string` which is a comma separated list of strings which specifies the web preferences to be set on the webview.
|
||||
The full list of supported preference strings can be found in [BrowserWindow](browser-window.md#new-browserwindowoptions).
|
||||
The full list of supported preference strings can be found in [BrowserWindow](browser-window.md#new-browserwindowoptions). In addition, webview supports the following preferences:
|
||||
|
||||
* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
|
||||
|
||||
The string follows the same format as the features string in `window.open`.
|
||||
A name by itself is given a `true` boolean value.
|
||||
@@ -608,7 +611,6 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
|
||||
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
|
||||
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
||||
* `generateTaggedPDF` boolean (optional) _Experimental_ - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards.
|
||||
* `generateDocumentOutline` boolean (optional) _Experimental_ - Whether or not to generate a PDF document outline from content headers. Defaults to false.
|
||||
|
||||
Returns `Promise<Uint8Array>` - Resolves with the generated PDF data.
|
||||
|
||||
|
||||
@@ -82,6 +82,18 @@ app.on('gpu-process-crashed', (event, killed) => { /* ... */ })
|
||||
app.on('child-process-gone', (event, details) => { /* ... */ })
|
||||
```
|
||||
|
||||
### Behavior Changed: `BrowserView.setAutoResize` behavior on macOS
|
||||
|
||||
In Electron 29, BrowserView is now a wrapper around the new [WebContentsView](api/web-contents-view.md) API.
|
||||
|
||||
Previously, the `setAutoResize` function of the `BrowserView` API was backed by [autoresizing](https://developer.apple.com/documentation/appkit/nsview/1483281-autoresizingmask?language=objc) on macOS, and by a custom algorithm on Windows and Linux.
|
||||
For simple use cases such as making a BrowserView fill the entire window, the behavior of these two approaches was identical.
|
||||
However, in more advanced cases, BrowserViews would be autoresized differently on macOS than they would be on other platforms, as the custom resizing algorithm for Windows and Linux did not perfectly match the behavior of macOS's autoresizing API.
|
||||
The autoresizing behavior is now standardized across all platforms.
|
||||
|
||||
If your app uses `BrowserView.setAutoResize` to do anything more complex than making a BrowserView fill the entire window, it's likely you already had custom logic in place to handle this difference in behavior on macOS.
|
||||
If so, that logic will no longer be needed in Electron 29 as autoresizing behavior is consistent.
|
||||
|
||||
## Planned Breaking API Changes (28.0)
|
||||
|
||||
### Behavior Changed: `WebContents.backgroundThrottling` set to false affects all `WebContents` in the host `BrowserWindow`
|
||||
|
||||
@@ -3,54 +3,4 @@
|
||||
> Goma is a distributed compiler service for open-source projects such as
|
||||
> Chromium and Android.
|
||||
|
||||
Electron has a deployment of a custom Goma Backend that we make available to
|
||||
all Electron Maintainers. See the [Access](#access) section below for details
|
||||
on authentication. There is also a `cache-only` Goma endpoint that will be
|
||||
used by default if you do not have credentials. Requests to the cache-only
|
||||
Goma will not hit our cluster, but will read from our cache and should result
|
||||
in significantly faster build times.
|
||||
|
||||
## Enabling Goma
|
||||
|
||||
Currently the only supported way to use Goma is to use our [Build Tools](https://github.com/electron/build-tools).
|
||||
Goma configuration is automatically included when you set up `build-tools`.
|
||||
|
||||
If you are a maintainer and have access to our cluster, please ensure that you run
|
||||
`e init` with `--goma=cluster` in order to configure `build-tools` to use
|
||||
the Goma cluster. If you have an existing config, you can just set `"goma": "cluster"`
|
||||
in your config file.
|
||||
|
||||
## Building with Goma
|
||||
|
||||
When you are using Goma you can run `ninja` with a substantially higher `j`
|
||||
value than would normally be supported by your machine.
|
||||
|
||||
Please do not set a value higher than **200**. We monitor Goma system usage, and users
|
||||
found to be abusing it with unreasonable concurrency will be de-activated.
|
||||
|
||||
```bash
|
||||
ninja -C out/Testing electron -j 200
|
||||
```
|
||||
|
||||
If you're using `build-tools`, appropriate `-j` values will automatically be used for you.
|
||||
|
||||
## Monitoring Goma
|
||||
|
||||
If you access [http://localhost:8088](http://localhost:8088) on your local
|
||||
machine you can monitor compile jobs as they flow through the goma system.
|
||||
|
||||
## Access
|
||||
|
||||
For security and cost reasons, access to Electron's Goma cluster is currently restricted
|
||||
to Electron Maintainers. If you want access please head to `#access-requests` in
|
||||
Slack and ping `@goma-squad` to ask for access. Please be aware that being a
|
||||
maintainer does not _automatically_ grant access and access is determined on a
|
||||
case by case basis.
|
||||
|
||||
## Uptime / Support
|
||||
|
||||
We have automated monitoring of our Goma cluster and cache at https://status.notgoma.com
|
||||
|
||||
We do not provide support for usage of Goma and any issues raised asking for help / having
|
||||
issues will _probably_ be closed without much reason, we do not have the capacity to handle
|
||||
that kind of support.
|
||||
Electron's deployment of Goma is deprecated and we are gradually shifting all usage to the [reclient](reclient.md) system. At some point in 2024 the Goma backend will be shutdown.
|
||||
|
||||
46
docs/development/reclient.md
Normal file
46
docs/development/reclient.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Reclient
|
||||
|
||||
> Reclient integrates with an existing build system to enable remote execution and caching of build actions.
|
||||
|
||||
Electron has a deployment of a [reclient](https://github.com/bazelbuild/reclient)
|
||||
compatible RBE Backend that is available to all Electron Maintainers.
|
||||
See the [Access](#access) section below for details on authentication. Non-maintainers
|
||||
will not have access to the cluster, but can sign in to receive a `Cache Only` token
|
||||
that gives access to the cache-only CAS backend. Using this should result in
|
||||
significantly faster build times .
|
||||
|
||||
## Enabling Reclient
|
||||
|
||||
Currently the only supported way to use Reclient is to use our [Build Tools](https://github.com/electron/build-tools).
|
||||
Reclient configuration is automatically included when you set up `build-tools`.
|
||||
|
||||
If you have an existing config, you can just set `"reclient": "remote_exec"`
|
||||
in your config file.
|
||||
|
||||
## Building with Reclient
|
||||
|
||||
When you are using Reclient, you can run `autoninja` with a substantially higher `j`
|
||||
value than would normally be supported by your machine.
|
||||
|
||||
Please do not set a value higher than **200**. The RBE system is monitored.
|
||||
Users found to be abusing it with unreasonable concurrency will be deactivated.
|
||||
|
||||
```bash
|
||||
autoninja -C out/Testing electron -j 200
|
||||
```
|
||||
|
||||
If you're using `build-tools`, appropriate `-j` values will automatically be used for you.
|
||||
|
||||
## Access
|
||||
|
||||
For security and cost reasons, access to Electron's RBE backend is currently restricted
|
||||
to Electron Maintainers. If you want access, please head to `#access-requests` in
|
||||
Slack and ping `@infra-wg` to ask for it. Please be aware that being a
|
||||
maintainer does not _automatically_ grant access. Access is determined on a
|
||||
case-by-case basis.
|
||||
|
||||
## Support
|
||||
|
||||
We do not provide support for usage of Reclient. Issues raised asking for help / having
|
||||
issues will _probably_ be closed without much reason. We do not have the capacity to handle
|
||||
that kind of support.
|
||||
@@ -102,7 +102,7 @@ const template = [
|
||||
})(),
|
||||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
focusedWindow.toggleDevTools()
|
||||
focusedWindow.webContents.toggleDevTools()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,10 +14,10 @@ process:
|
||||
|
||||
Electron will listen for V8 inspector protocol messages on the specified `port`,
|
||||
an external debugger will need to connect on this port. The default `port` is
|
||||
`5858`.
|
||||
`9229`.
|
||||
|
||||
```shell
|
||||
electron --inspect=5858 your/app
|
||||
electron --inspect=9229 your/app
|
||||
```
|
||||
|
||||
### `--inspect-brk=[port]`
|
||||
|
||||
@@ -15,7 +15,7 @@ Fuses are the solution to this problem, at a high level they are "magic bits" in
|
||||
**Default:** Enabled
|
||||
**@electron/fuses:** `FuseV1Options.RunAsNode`
|
||||
|
||||
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).
|
||||
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function.
|
||||
|
||||
### `cookieEncryption`
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ will be able to execute native code on the user's machine.
|
||||
Under no circumstances should you load and execute remote code with
|
||||
Node.js integration enabled. Instead, use only local files (packaged together
|
||||
with your application) to execute Node.js code. To display remote content, use
|
||||
the [`<webview>`][webview-tag] tag or [`BrowserView`][browser-view], make sure
|
||||
to disable the `nodeIntegration` and enable `contextIsolation`.
|
||||
the [`<webview>`][webview-tag] tag or a [`WebContentsView`][web-contents-view]
|
||||
and make sure to disable the `nodeIntegration` and enable `contextIsolation`.
|
||||
:::
|
||||
|
||||
:::info Electron security warnings
|
||||
@@ -114,8 +114,6 @@ You should at least follow these steps to improve the security of your applicati
|
||||
15. [Do not use `shell.openExternal` with untrusted content](#15-do-not-use-shellopenexternal-with-untrusted-content)
|
||||
16. [Use a current version of Electron](#16-use-a-current-version-of-electron)
|
||||
17. [Validate the `sender` of all IPC messages](#17-validate-the-sender-of-all-ipc-messages)
|
||||
18. [Avoid usage of the `file://` protocol and prefer usage of custom protocols](#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols)
|
||||
19. [Check which fuses you can change](#19-check-which-fuses-you-can-change)
|
||||
|
||||
To automate the detection of misconfigurations and insecure patterns, it is
|
||||
possible to use
|
||||
@@ -168,7 +166,7 @@ This recommendation is the default behavior in Electron since 5.0.0.
|
||||
:::
|
||||
|
||||
It is paramount that you do not enable Node.js integration in any renderer
|
||||
([`BrowserWindow`][browser-window], [`BrowserView`][browser-view], or
|
||||
([`BrowserWindow`][browser-window], [`WebContentsView`][web-contents-view], or
|
||||
[`<webview>`][webview-tag]) that loads remote content. The goal is to limit the
|
||||
powers you grant to remote content, thus making it dramatically more difficult
|
||||
for an attacker to harm your users should they gain the ability to execute
|
||||
@@ -308,8 +306,8 @@ This recommendation is Electron's default.
|
||||
|
||||
You may have already guessed that disabling the `webSecurity` property on a
|
||||
renderer process ([`BrowserWindow`][browser-window],
|
||||
[`BrowserView`][browser-view], or [`<webview>`][webview-tag]) disables crucial
|
||||
security features.
|
||||
[`WebContentsView`][web-contents-view], or [`<webview>`][webview-tag]) disables
|
||||
crucial security features.
|
||||
|
||||
Do not disable `webSecurity` in production applications.
|
||||
|
||||
@@ -782,34 +780,12 @@ set of files.
|
||||
Follow the [`protocol.handle`](../api/protocol.md#protocolhandlescheme-handler) examples to
|
||||
learn how to serve files / content from a custom protocol.
|
||||
|
||||
### 19. Check which fuses you can change
|
||||
|
||||
Electron ships with a number of options that can be useful but a large portion of
|
||||
applications probably don't need. In order to avoid having to build your own version of
|
||||
Electron, these can be turned off or on using [Fuses](./fuses.md).
|
||||
|
||||
#### Why?
|
||||
|
||||
Some fuses, like `runAsNode` and `nodeCliInspect`, allow the application to behave differently
|
||||
when run from the command line using specific environment variables or CLI arguments. These
|
||||
can be used to execute commands on the device through your application.
|
||||
|
||||
This can let external scripts run commands that they potentially would not be allowed to, but
|
||||
that your application might have the rights for.
|
||||
|
||||
#### How?
|
||||
|
||||
We've made a module, [`@electron/fuses`](https://npmjs.com/package/@electron/fuses), to make
|
||||
flipping these fuses easy. Check out the README of that module for more details on usage and
|
||||
potential error cases, and refer to
|
||||
[How do I flip the fuses?](./fuses.md#how-do-i-flip-the-fuses) in our documentation.
|
||||
|
||||
[breaking-changes]: ../breaking-changes.md
|
||||
[browser-window]: ../api/browser-window.md
|
||||
[browser-view]: ../api/browser-view.md
|
||||
[webview-tag]: ../api/webview-tag.md
|
||||
[web-contents-view]: ../api/web-contents-view.md
|
||||
[responsible-disclosure]: https://en.wikipedia.org/wiki/Responsible_disclosure
|
||||
[web-contents]: ../api/web-contents.md
|
||||
[window-open-handler]: ../api/web-contents.md#contentssetwindowopenhandlerhandler
|
||||
[will-navigate]: ../api/web-contents.md#event-will-navigate
|
||||
[open-external]: ../api/shell.md#shellopenexternalurl-options
|
||||
[responsible-disclosure]: https://en.wikipedia.org/wiki/Responsible_disclosure
|
||||
|
||||
@@ -42,16 +42,15 @@ Compared to an `<iframe>`, `<webview>` tends to be slightly slower but offers
|
||||
much greater control in loading and communicating with the third-party content
|
||||
and handling various events.
|
||||
|
||||
### BrowserViews
|
||||
### WebContentsView
|
||||
|
||||
[BrowserViews](../api/browser-view.md) are not a part of the DOM - instead,
|
||||
they are created in and controlled by your Main process. They are simply
|
||||
another layer of web content on top of your existing window. This means
|
||||
that they are completely separate from your own `BrowserWindow` content and
|
||||
their position is not controlled by the DOM or CSS. Instead, it is controlled
|
||||
by setting the bounds in the Main process.
|
||||
[`WebContentsView`](../api/web-contents-view.md)s are not a part of the
|
||||
DOM—instead, they are created, controlled, positioned, and sized by your
|
||||
Main process. Using `WebContentsView`, you can combine and layer many pages
|
||||
together in the same [`BaseWindow`](../api/base-window.md).
|
||||
|
||||
`BrowserViews` offer the greatest control over their contents, since they
|
||||
implement the `webContents` similarly to how the `BrowserWindow` does it.
|
||||
However, as `BrowserViews` are not a part of your DOM, but are rather overlaid
|
||||
on top of them, you will have to manage their position manually.
|
||||
`WebContentsView`s offer the greatest control over their contents, since they
|
||||
implement the `webContents` similarly to how `BrowserWindow` does it. However,
|
||||
as `WebContentsView`s are not elements inside the DOM, positioning them
|
||||
accurately with respect to DOM content requires coordination between the
|
||||
Main and Renderer processes.
|
||||
|
||||
@@ -4,6 +4,7 @@ auto_filenames = {
|
||||
"docs/api/accelerator.md",
|
||||
"docs/api/app.md",
|
||||
"docs/api/auto-updater.md",
|
||||
"docs/api/base-window.md",
|
||||
"docs/api/browser-view.md",
|
||||
"docs/api/browser-window.md",
|
||||
"docs/api/client-request.md",
|
||||
@@ -63,6 +64,8 @@ auto_filenames = {
|
||||
"docs/api/touch-bar.md",
|
||||
"docs/api/tray.md",
|
||||
"docs/api/utility-process.md",
|
||||
"docs/api/view.md",
|
||||
"docs/api/web-contents-view.md",
|
||||
"docs/api/web-contents.md",
|
||||
"docs/api/web-frame-main.md",
|
||||
"docs/api/web-frame.md",
|
||||
@@ -70,6 +73,7 @@ auto_filenames = {
|
||||
"docs/api/web-utils.md",
|
||||
"docs/api/webview-tag.md",
|
||||
"docs/api/window-open.md",
|
||||
"docs/api/structures/base-window-options.md",
|
||||
"docs/api/structures/bluetooth-device.md",
|
||||
"docs/api/structures/browser-window-options.md",
|
||||
"docs/api/structures/certificate-principal.md",
|
||||
|
||||
@@ -118,6 +118,8 @@ filenames = {
|
||||
lib_sources_mac = [
|
||||
"shell/app/electron_main_delegate_mac.h",
|
||||
"shell/app/electron_main_delegate_mac.mm",
|
||||
"shell/browser/animation_util.h",
|
||||
"shell/browser/animation_util_mac.mm",
|
||||
"shell/browser/api/electron_api_app_mac.mm",
|
||||
"shell/browser/api/electron_api_menu_mac.h",
|
||||
"shell/browser/api/electron_api_menu_mac.mm",
|
||||
@@ -141,8 +143,6 @@ filenames = {
|
||||
"shell/browser/mac/in_app_purchase_product.mm",
|
||||
"shell/browser/mac/in_app_purchase.h",
|
||||
"shell/browser/mac/in_app_purchase.mm",
|
||||
"shell/browser/native_browser_view_mac.h",
|
||||
"shell/browser/native_browser_view_mac.mm",
|
||||
"shell/browser/native_window_mac.h",
|
||||
"shell/browser/native_window_mac.mm",
|
||||
"shell/browser/notifications/mac/cocoa_notification.h",
|
||||
@@ -209,8 +209,6 @@ filenames = {
|
||||
lib_sources_views = [
|
||||
"shell/browser/api/electron_api_menu_views.cc",
|
||||
"shell/browser/api/electron_api_menu_views.h",
|
||||
"shell/browser/native_browser_view_views.cc",
|
||||
"shell/browser/native_browser_view_views.h",
|
||||
"shell/browser/native_window_views.cc",
|
||||
"shell/browser/native_window_views.h",
|
||||
"shell/browser/ui/drag_util_views.cc",
|
||||
@@ -255,8 +253,6 @@ filenames = {
|
||||
"shell/browser/api/electron_api_auto_updater.h",
|
||||
"shell/browser/api/electron_api_base_window.cc",
|
||||
"shell/browser/api/electron_api_base_window.h",
|
||||
"shell/browser/api/electron_api_browser_view.cc",
|
||||
"shell/browser/api/electron_api_browser_view.h",
|
||||
"shell/browser/api/electron_api_browser_window.cc",
|
||||
"shell/browser/api/electron_api_browser_window.h",
|
||||
"shell/browser/api/electron_api_content_tracing.cc",
|
||||
@@ -336,6 +332,8 @@ filenames = {
|
||||
"shell/browser/api/save_page_handler.h",
|
||||
"shell/browser/api/ui_event.cc",
|
||||
"shell/browser/api/ui_event.h",
|
||||
"shell/browser/api/views/electron_api_image_view.cc",
|
||||
"shell/browser/api/views/electron_api_image_view.h",
|
||||
"shell/browser/auto_updater.cc",
|
||||
"shell/browser/auto_updater.h",
|
||||
"shell/browser/background_throttling_source.h",
|
||||
@@ -410,8 +408,6 @@ filenames = {
|
||||
"shell/browser/media/media_device_id_salt.h",
|
||||
"shell/browser/microtasks_runner.cc",
|
||||
"shell/browser/microtasks_runner.h",
|
||||
"shell/browser/native_browser_view.cc",
|
||||
"shell/browser/native_browser_view.h",
|
||||
"shell/browser/native_window.cc",
|
||||
"shell/browser/native_window.h",
|
||||
"shell/browser/native_window_features.cc",
|
||||
|
||||
@@ -4,7 +4,7 @@ const { BaseWindow } = process._linkedBinding('electron_browser_base_window') as
|
||||
|
||||
Object.setPrototypeOf(BaseWindow.prototype, EventEmitter.prototype);
|
||||
|
||||
BaseWindow.prototype._init = function () {
|
||||
BaseWindow.prototype._init = function (this: TLWT) {
|
||||
// Avoid recursive require.
|
||||
const { app } = require('electron');
|
||||
|
||||
@@ -103,7 +103,7 @@ Object.defineProperty(BaseWindow.prototype, 'movable', {
|
||||
});
|
||||
|
||||
BaseWindow.getFocusedWindow = () => {
|
||||
return BaseWindow.getAllWindows().find((win) => win.isFocused());
|
||||
return BaseWindow.getAllWindows().find((win) => win.isFocused()) ?? null;
|
||||
};
|
||||
|
||||
module.exports = BaseWindow;
|
||||
|
||||
@@ -1,3 +1,120 @@
|
||||
const { BrowserView } = process._linkedBinding('electron_browser_browser_view');
|
||||
import { BrowserWindow, AutoResizeOptions, Rectangle, WebContentsView, WebPreferences, WebContents } from 'electron/main';
|
||||
|
||||
export default BrowserView;
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util');
|
||||
|
||||
export default class BrowserView {
|
||||
#webContentsView: WebContentsView;
|
||||
|
||||
// AutoResize state
|
||||
#resizeListener: ((...args: any[]) => void) | null = null;
|
||||
#lastWindowSize: {width: number, height: number} = { width: 0, height: 0 };
|
||||
#autoResizeFlags: AutoResizeOptions = {};
|
||||
|
||||
constructor (options: {webPreferences: WebPreferences, webContents?: WebContents} = { webPreferences: {} }) {
|
||||
const { webPreferences = {}, webContents } = options;
|
||||
if (webContents) {
|
||||
v8Util.setHiddenValue(webPreferences, 'webContents', webContents);
|
||||
}
|
||||
webPreferences.type = 'browserView';
|
||||
this.#webContentsView = new WebContentsView({ webPreferences });
|
||||
}
|
||||
|
||||
get webContents () {
|
||||
return this.#webContentsView.webContents;
|
||||
}
|
||||
|
||||
setBounds (bounds: Rectangle) {
|
||||
this.#webContentsView.setBounds(bounds);
|
||||
this.#autoHorizontalProportion = null;
|
||||
this.#autoVerticalProportion = null;
|
||||
}
|
||||
|
||||
getBounds () {
|
||||
return this.#webContentsView.getBounds();
|
||||
}
|
||||
|
||||
setAutoResize (options: AutoResizeOptions) {
|
||||
if (options == null || typeof options !== 'object') { throw new Error('Invalid auto resize options'); }
|
||||
this.#autoResizeFlags = {
|
||||
width: !!options.width,
|
||||
height: !!options.height,
|
||||
horizontal: !!options.horizontal,
|
||||
vertical: !!options.vertical
|
||||
};
|
||||
this.#autoHorizontalProportion = null;
|
||||
this.#autoVerticalProportion = null;
|
||||
}
|
||||
|
||||
setBackgroundColor (color: string) {
|
||||
this.#webContentsView.setBackgroundColor(color);
|
||||
}
|
||||
|
||||
// Internal methods
|
||||
get ownerWindow (): BrowserWindow | null {
|
||||
return !this.webContents.isDestroyed() ? this.webContents.getOwnerBrowserWindow() : null;
|
||||
}
|
||||
|
||||
set ownerWindow (w: BrowserWindow | null) {
|
||||
if (this.webContents.isDestroyed()) return;
|
||||
const oldWindow = this.webContents.getOwnerBrowserWindow();
|
||||
if (oldWindow && this.#resizeListener) {
|
||||
oldWindow.off('resize', this.#resizeListener);
|
||||
this.#resizeListener = null;
|
||||
}
|
||||
this.webContents._setOwnerWindow(w);
|
||||
if (w) {
|
||||
this.#lastWindowSize = w.getBounds();
|
||||
w.on('resize', this.#resizeListener = this.#autoResize.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
#autoHorizontalProportion: {width: number, left: number} | null = null;
|
||||
#autoVerticalProportion: {height: number, top: number} | null = null;
|
||||
#autoResize () {
|
||||
if (!this.ownerWindow) throw new Error('Electron bug: #autoResize called without owner window');
|
||||
if (this.#autoResizeFlags.horizontal && this.#autoHorizontalProportion == null) {
|
||||
const viewBounds = this.#webContentsView.getBounds();
|
||||
this.#autoHorizontalProportion = {
|
||||
width: this.#lastWindowSize.width / viewBounds.width,
|
||||
left: this.#lastWindowSize.width / viewBounds.x
|
||||
};
|
||||
}
|
||||
if (this.#autoResizeFlags.vertical && this.#autoVerticalProportion == null) {
|
||||
const viewBounds = this.#webContentsView.getBounds();
|
||||
this.#autoVerticalProportion = {
|
||||
height: this.#lastWindowSize.height / viewBounds.height,
|
||||
top: this.#lastWindowSize.height / viewBounds.y
|
||||
};
|
||||
}
|
||||
const newBounds = this.ownerWindow.getBounds();
|
||||
let widthDelta = newBounds.width - this.#lastWindowSize.width;
|
||||
let heightDelta = newBounds.height - this.#lastWindowSize.height;
|
||||
if (!this.#autoResizeFlags.width) widthDelta = 0;
|
||||
if (!this.#autoResizeFlags.height) heightDelta = 0;
|
||||
|
||||
const newViewBounds = this.#webContentsView.getBounds();
|
||||
if (widthDelta || heightDelta) {
|
||||
this.#webContentsView.setBounds({
|
||||
...newViewBounds,
|
||||
width: newViewBounds.width + widthDelta,
|
||||
height: newViewBounds.height + heightDelta
|
||||
});
|
||||
}
|
||||
|
||||
if (this.#autoHorizontalProportion) {
|
||||
newViewBounds.width = newBounds.width / this.#autoHorizontalProportion.width;
|
||||
newViewBounds.x = newBounds.width / this.#autoHorizontalProportion.left;
|
||||
}
|
||||
if (this.#autoVerticalProportion) {
|
||||
newViewBounds.height = newBounds.height / this.#autoVerticalProportion.height;
|
||||
newViewBounds.y = newBounds.y / this.#autoVerticalProportion.top;
|
||||
}
|
||||
if (this.#autoHorizontalProportion || this.#autoVerticalProportion) {
|
||||
this.#webContentsView.setBounds(newViewBounds);
|
||||
}
|
||||
}
|
||||
|
||||
get webContentsView () {
|
||||
return this.#webContentsView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BaseWindow, WebContents, BrowserView, TouchBar } from 'electron/main';
|
||||
import { BaseWindow, WebContents, TouchBar, BrowserView } from 'electron/main';
|
||||
import type { BrowserWindow as BWT } from 'electron/main';
|
||||
const { BrowserWindow } = process._linkedBinding('electron_browser_window') as { BrowserWindow: typeof BWT };
|
||||
|
||||
@@ -6,7 +6,7 @@ Object.setPrototypeOf(BrowserWindow.prototype, BaseWindow.prototype);
|
||||
|
||||
BrowserWindow.prototype._init = function (this: BWT) {
|
||||
// Call parent class's _init.
|
||||
BaseWindow.prototype._init.call(this);
|
||||
(BaseWindow.prototype as any)._init.call(this);
|
||||
|
||||
// Avoid recursive require.
|
||||
const { app } = require('electron');
|
||||
@@ -52,6 +52,12 @@ BrowserWindow.prototype._init = function (this: BWT) {
|
||||
this.on(event as any, visibilityChanged);
|
||||
}
|
||||
|
||||
this._browserViews = [];
|
||||
|
||||
this.on('close', () => {
|
||||
this._browserViews.forEach(b => b.webContents?.close({ waitForBeforeUnload: true }));
|
||||
});
|
||||
|
||||
// Notify the creation of the window.
|
||||
app.emit('browser-window-created', { preventDefault () {} }, this);
|
||||
|
||||
@@ -168,4 +174,42 @@ BrowserWindow.prototype.setBackgroundThrottling = function (allowed: boolean) {
|
||||
return this.webContents.setBackgroundThrottling(allowed);
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.addBrowserView = function (browserView: BrowserView) {
|
||||
if (browserView.ownerWindow) { browserView.ownerWindow.removeBrowserView(browserView); }
|
||||
this.contentView.addChildView(browserView.webContentsView);
|
||||
browserView.ownerWindow = this;
|
||||
browserView.webContents._setOwnerWindow(this);
|
||||
this._browserViews.push(browserView);
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.setBrowserView = function (browserView: BrowserView) {
|
||||
this._browserViews.forEach(bv => {
|
||||
this.removeBrowserView(bv);
|
||||
});
|
||||
if (browserView) { this.addBrowserView(browserView); }
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.removeBrowserView = function (browserView: BrowserView) {
|
||||
const idx = this._browserViews.indexOf(browserView);
|
||||
if (idx >= 0) {
|
||||
this.contentView.removeChildView(browserView.webContentsView);
|
||||
browserView.ownerWindow = null;
|
||||
this._browserViews.splice(idx, 1);
|
||||
}
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.getBrowserView = function () {
|
||||
if (this._browserViews.length > 1) { throw new Error('This BrowserWindow has multiple BrowserViews, use getBrowserViews() instead'); }
|
||||
return this._browserViews[0] ?? null;
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.getBrowserViews = function () {
|
||||
return [...this._browserViews];
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.setTopBrowserView = function (browserView: BrowserView) {
|
||||
if (browserView.ownerWindow !== this) { throw new Error('Given BrowserView is not attached to the window'); }
|
||||
this.addBrowserView(browserView);
|
||||
};
|
||||
|
||||
module.exports = BrowserWindow;
|
||||
|
||||
@@ -14,6 +14,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'dialog', loader: () => require('./dialog') },
|
||||
{ name: 'globalShortcut', loader: () => require('./global-shortcut') },
|
||||
{ name: 'ipcMain', loader: () => require('./ipc-main') },
|
||||
{ name: 'ImageView', loader: () => require('./views/image-view') },
|
||||
{ name: 'inAppPurchase', loader: () => require('./in-app-purchase') },
|
||||
{ name: 'Menu', loader: () => require('./menu') },
|
||||
{ name: 'MenuItem', loader: () => require('./menu-item') },
|
||||
@@ -39,9 +40,3 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'WebContentsView', loader: () => require('./web-contents-view') },
|
||||
{ name: 'webFrameMain', loader: () => require('./web-frame-main') }
|
||||
];
|
||||
|
||||
if (BUILDFLAG(ENABLE_VIEWS_API)) {
|
||||
browserModuleList.push(
|
||||
{ name: 'ImageView', loader: () => require('./views/image-view') }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,21 +29,6 @@ function makeStreamFromPipe (pipe: any): ReadableStream {
|
||||
});
|
||||
}
|
||||
|
||||
function makeStreamFromFileInfo ({
|
||||
filePath,
|
||||
offset = 0,
|
||||
length = -1
|
||||
}: {
|
||||
filePath: string;
|
||||
offset?: number;
|
||||
length?: number;
|
||||
}): ReadableStream {
|
||||
return Readable.toWeb(createReadStream(filePath, {
|
||||
start: offset,
|
||||
end: length >= 0 ? offset + length : undefined
|
||||
}));
|
||||
}
|
||||
|
||||
function convertToRequestBody (uploadData: ProtocolRequest['uploadData']): RequestInit['body'] {
|
||||
if (!uploadData) return null;
|
||||
// Optimization: skip creating a stream if the request is just a single buffer.
|
||||
@@ -52,42 +37,30 @@ function convertToRequestBody (uploadData: ProtocolRequest['uploadData']): Reque
|
||||
const chunks = [...uploadData] as any[]; // TODO: types are wrong
|
||||
let current: ReadableStreamDefaultReader | null = null;
|
||||
return new ReadableStream({
|
||||
async pull (controller) {
|
||||
pull (controller) {
|
||||
if (current) {
|
||||
const { done, value } = await current.read();
|
||||
// (done => value === undefined) as per WHATWG spec
|
||||
if (done) {
|
||||
current = null;
|
||||
return this.pull!(controller);
|
||||
} else {
|
||||
current.read().then(({ done, value }) => {
|
||||
controller.enqueue(value);
|
||||
}
|
||||
if (done) current = null;
|
||||
}, (err) => {
|
||||
controller.error(err);
|
||||
});
|
||||
} else {
|
||||
if (!chunks.length) { return controller.close(); }
|
||||
const chunk = chunks.shift()!;
|
||||
if (chunk.type === 'rawData') {
|
||||
controller.enqueue(chunk.bytes);
|
||||
} else if (chunk.type === 'file') {
|
||||
current = makeStreamFromFileInfo(chunk).getReader();
|
||||
return this.pull!(controller);
|
||||
if (chunk.type === 'rawData') { controller.enqueue(chunk.bytes); } else if (chunk.type === 'file') {
|
||||
current = Readable.toWeb(createReadStream(chunk.filePath, { start: chunk.offset ?? 0, end: chunk.length >= 0 ? chunk.offset + chunk.length : undefined })).getReader();
|
||||
this.pull!(controller);
|
||||
} else if (chunk.type === 'stream') {
|
||||
current = makeStreamFromPipe(chunk.body).getReader();
|
||||
return this.pull!(controller);
|
||||
} else if (chunk.type === 'blob') {
|
||||
// Note that even though `getBlobData()` is a `Session` API, it doesn't
|
||||
// actually use the `Session` context. Its implementation solely relies
|
||||
// on global variables which allows us to implement this feature without
|
||||
// knowledge of the `Session` associated with the current request by
|
||||
// always pulling `Blob` data out of the default `Session`.
|
||||
controller.enqueue(await session.defaultSession.getBlobData(chunk.blobUUID));
|
||||
} else {
|
||||
throw new Error(`Unknown upload data chunk type: ${chunk.type}`);
|
||||
this.pull!(controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
}) as RequestInit['body'];
|
||||
}
|
||||
|
||||
// TODO(codebytere): Use Object.hasOwn() once we update to ECMAScript 2022.
|
||||
function validateResponse (res: Response) {
|
||||
if (!res || typeof res !== 'object') return false;
|
||||
|
||||
@@ -112,12 +85,8 @@ Protocol.prototype.handle = function (this: Electron.Protocol, scheme: string, h
|
||||
const success = register.call(this, scheme, async (preq: ProtocolRequest, cb: any) => {
|
||||
try {
|
||||
const body = convertToRequestBody(preq.uploadData);
|
||||
const headers = new Headers(preq.headers);
|
||||
if (headers.get('origin') === 'null') {
|
||||
headers.delete('origin');
|
||||
}
|
||||
const req = new Request(preq.url, {
|
||||
headers,
|
||||
headers: preq.headers,
|
||||
method: preq.method,
|
||||
referrer: preq.referrer,
|
||||
body,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { EventEmitter } from 'events';
|
||||
const { View } = process._linkedBinding('electron_browser_view');
|
||||
|
||||
Object.setPrototypeOf((View as any).prototype, EventEmitter.prototype);
|
||||
|
||||
export default View;
|
||||
|
||||
@@ -220,16 +220,6 @@ function parsePageSize (pageSize: string | ElectronInternal.PageSize) {
|
||||
let pendingPromise: Promise<any> | undefined;
|
||||
WebContents.prototype.printToPDF = async function (options) {
|
||||
const margins = checkType(options.margins ?? {}, 'object', 'margins');
|
||||
const pageSize = parsePageSize(options.pageSize ?? 'letter');
|
||||
|
||||
const { top, bottom, left, right } = margins;
|
||||
const validHeight = [top, bottom].every(u => u === undefined || u <= pageSize.paperHeight);
|
||||
const validWidth = [left, right].every(u => u === undefined || u <= pageSize.paperWidth);
|
||||
|
||||
if (!validHeight || !validWidth) {
|
||||
throw new Error('margins must be less than or equal to pageSize');
|
||||
}
|
||||
|
||||
const printSettings = {
|
||||
requestID: getNextId(),
|
||||
landscape: checkType(options.landscape ?? false, 'boolean', 'landscape'),
|
||||
@@ -245,8 +235,7 @@ WebContents.prototype.printToPDF = async function (options) {
|
||||
pageRanges: checkType(options.pageRanges ?? '', 'string', 'pageRanges'),
|
||||
preferCSSPageSize: checkType(options.preferCSSPageSize ?? false, 'boolean', 'preferCSSPageSize'),
|
||||
generateTaggedPDF: checkType(options.generateTaggedPDF ?? false, 'boolean', 'generateTaggedPDF'),
|
||||
generateDocumentOutline: checkType(options.generateDocumentOutline ?? false, 'boolean', 'generateDocumentOutline'),
|
||||
...pageSize
|
||||
...parsePageSize(options.pageSize ?? 'letter')
|
||||
};
|
||||
|
||||
if (this._printToPDF) {
|
||||
@@ -344,24 +333,31 @@ WebContents.prototype.loadFile = function (filePath, options = {}) {
|
||||
}));
|
||||
};
|
||||
|
||||
type LoadError = { errorCode: number, errorDescription: string, url: string };
|
||||
|
||||
WebContents.prototype.loadURL = function (url, options) {
|
||||
const p = new Promise<void>((resolve, reject) => {
|
||||
const resolveAndCleanup = () => {
|
||||
removeListeners();
|
||||
resolve();
|
||||
};
|
||||
const rejectAndCleanup = (errorCode: number, errorDescription: string, url: string) => {
|
||||
let error: LoadError | undefined;
|
||||
const rejectAndCleanup = ({ errorCode, errorDescription, url }: LoadError) => {
|
||||
const err = new Error(`${errorDescription} (${errorCode}) loading '${typeof url === 'string' ? url.substr(0, 2048) : url}'`);
|
||||
Object.assign(err, { errno: errorCode, code: errorDescription, url });
|
||||
removeListeners();
|
||||
reject(err);
|
||||
};
|
||||
const finishListener = () => {
|
||||
resolveAndCleanup();
|
||||
if (error) {
|
||||
rejectAndCleanup(error);
|
||||
} else {
|
||||
resolveAndCleanup();
|
||||
}
|
||||
};
|
||||
const failListener = (event: Electron.Event, errorCode: number, errorDescription: string, validatedURL: string, isMainFrame: boolean) => {
|
||||
if (isMainFrame) {
|
||||
rejectAndCleanup(errorCode, errorDescription, validatedURL);
|
||||
if (!error && isMainFrame) {
|
||||
error = { errorCode, errorDescription, url: validatedURL };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -379,7 +375,7 @@ WebContents.prototype.loadURL = function (url, options) {
|
||||
// considered navigation events but are triggered with isSameDocument.
|
||||
// We can ignore these to allow virtual routing on page load as long
|
||||
// as the routing does not leave the document
|
||||
return rejectAndCleanup(-3, 'ERR_ABORTED', url);
|
||||
return rejectAndCleanup({ errorCode: -3, errorDescription: 'ERR_ABORTED', url });
|
||||
}
|
||||
browserInitiatedInPageNavigation = navigationStarted && isSameDocument;
|
||||
navigationStarted = true;
|
||||
@@ -394,7 +390,10 @@ WebContents.prototype.loadURL = function (url, options) {
|
||||
// TODO(jeremy): enumerate all the cases in which this can happen. If
|
||||
// the only one is with a bad scheme, perhaps ERR_INVALID_ARGUMENT
|
||||
// would be more appropriate.
|
||||
rejectAndCleanup(-2, 'ERR_FAILED', url);
|
||||
if (!error) {
|
||||
error = { errorCode: -2, errorDescription: 'ERR_FAILED', url: url };
|
||||
}
|
||||
finishListener();
|
||||
};
|
||||
const finishListenerWhenUserInitiatedNavigation = () => {
|
||||
if (!browserInitiatedInPageNavigation) {
|
||||
@@ -593,6 +592,16 @@ WebContents.prototype._init = function () {
|
||||
}
|
||||
});
|
||||
|
||||
this.on('-before-unload-fired' as any, function (this: Electron.WebContents, event: Electron.Event, proceed: boolean) {
|
||||
const type = this.getType();
|
||||
// These are the "interactive" types, i.e. ones a user might be looking at.
|
||||
// All other types should ignore the "proceed" signal and unload
|
||||
// regardless.
|
||||
if (type === 'window' || type === 'offscreen' || type === 'browserView') {
|
||||
if (!proceed) { return event.preventDefault(); }
|
||||
}
|
||||
});
|
||||
|
||||
// The devtools requests the webContents to reload.
|
||||
this.on('devtools-reload-page', function (this: Electron.WebContents) {
|
||||
this.reload();
|
||||
@@ -777,7 +786,7 @@ WebContents.prototype._init = function () {
|
||||
const promise = parent && !prefs.offscreen ? dialog.showMessageBox(parent, options) : dialog.showMessageBox(options);
|
||||
try {
|
||||
const result = await promise;
|
||||
if (abortController.signal.aborted) return;
|
||||
if (abortController.signal.aborted || this.isDestroyed()) return;
|
||||
if (result.checkboxChecked) originCounts.set(origin, -1);
|
||||
return callback(result.response === 0, '');
|
||||
} finally {
|
||||
|
||||
@@ -3,8 +3,6 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import type * as defaultMenuModule from '@electron/internal/browser/default-menu';
|
||||
import type * as url from 'url';
|
||||
import type * as v8 from 'v8';
|
||||
|
||||
const Module = require('module') as NodeJS.ModuleInternal;
|
||||
|
||||
@@ -134,7 +132,7 @@ if (packageJson.desktopName != null) {
|
||||
// Set v8 flags, deliberately lazy load so that apps that do not use this
|
||||
// feature do not pay the price
|
||||
if (packageJson.v8Flags != null) {
|
||||
(require('v8') as typeof v8).setFlagsFromString(packageJson.v8Flags);
|
||||
require('v8').setFlagsFromString(packageJson.v8Flags);
|
||||
}
|
||||
|
||||
app.setAppPath(packagePath);
|
||||
@@ -151,6 +149,10 @@ require('@electron/internal/browser/api/web-contents');
|
||||
// Load web-frame-main module to ensure it is populated on app ready
|
||||
require('@electron/internal/browser/api/web-frame-main');
|
||||
|
||||
// Required because `new BrowserWindow` calls some WebContentsView stuff, so
|
||||
// the inheritance needs to be set up before that happens.
|
||||
require('@electron/internal/browser/api/web-contents-view');
|
||||
|
||||
// Set main startup script of the app.
|
||||
const mainStartupScript = packageJson.main || 'index.js';
|
||||
|
||||
@@ -197,7 +199,7 @@ if (packagePath) {
|
||||
// Finally load app's main.js and transfer control to C++.
|
||||
if ((packageJson.type === 'module' && !mainStartupScript.endsWith('.cjs')) || mainStartupScript.endsWith('.mjs')) {
|
||||
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
|
||||
const main = (require('url') as typeof url).pathToFileURL(path.join(packagePath, mainStartupScript));
|
||||
const main = require('url').pathToFileURL(path.join(packagePath, mainStartupScript));
|
||||
loadESM(async (esmLoader: any) => {
|
||||
try {
|
||||
await esmLoader.import(main.toString(), undefined, Object.create(null));
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as util from 'util';
|
||||
import type * as stream from 'stream';
|
||||
|
||||
import timers = require('timers');
|
||||
const timers = require('timers');
|
||||
|
||||
type AnyFn = (...args: any[]) => any
|
||||
|
||||
@@ -63,7 +62,7 @@ if (process.type === 'browser' ||
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// Always returns EOF for stdin stream.
|
||||
const { Readable } = require('stream') as typeof stream;
|
||||
const { Readable } = require('stream');
|
||||
const stdin = new Readable();
|
||||
stdin.push(null);
|
||||
Object.defineProperty(process, 'stdin', {
|
||||
|
||||
@@ -2,9 +2,7 @@ import { Buffer } from 'buffer';
|
||||
import { constants } from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
import type * as Crypto from 'crypto';
|
||||
import type * as os from 'os';
|
||||
|
||||
const asar = process._linkedBinding('electron_common_asar');
|
||||
|
||||
@@ -257,7 +255,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
if (!process.env.ELECTRON_LOG_ASAR_READS) return;
|
||||
if (!logFDs.has(asarPath)) {
|
||||
const logFilename = `${path.basename(asarPath, '.asar')}-access-log.txt`;
|
||||
const logPath = path.join((require('os') as typeof os).tmpdir(), logFilename);
|
||||
const logPath = path.join(require('os').tmpdir(), logFilename);
|
||||
logFDs.set(asarPath, fs.openSync(logPath, 'a'));
|
||||
}
|
||||
fs.writeSync(logFDs.get(asarPath), `${offset}: ${filePath}\n`);
|
||||
|
||||
@@ -3,14 +3,14 @@ import { wrapFsWithAsar } from './asar-fs-wrapper';
|
||||
wrapFsWithAsar(require('fs'));
|
||||
|
||||
// Hook child_process.fork.
|
||||
import cp = require('child_process'); // eslint-disable-line import/first
|
||||
const cp = require('child_process');
|
||||
const originalFork = cp.fork;
|
||||
cp.fork = (modulePath, args?, options?: cp.ForkOptions) => {
|
||||
cp.fork = (modulePath: string, args: any, options: any) => {
|
||||
// Parse optional args.
|
||||
if (args == null) {
|
||||
args = [];
|
||||
} else if (typeof args === 'object' && !Array.isArray(args)) {
|
||||
options = args as cp.ForkOptions;
|
||||
options = args;
|
||||
args = [];
|
||||
}
|
||||
// Fallback to original fork to report arg type errors.
|
||||
@@ -22,7 +22,7 @@ cp.fork = (modulePath, args?, options?: cp.ForkOptions) => {
|
||||
// the electron binary run like upstream Node.js.
|
||||
options = options ?? {};
|
||||
options.env = Object.create(options.env || process.env);
|
||||
options.env!.ELECTRON_RUN_AS_NODE = '1';
|
||||
options.env.ELECTRON_RUN_AS_NODE = 1;
|
||||
// On mac the child script runs in helper executable.
|
||||
if (!options.execPath && process.platform === 'darwin') {
|
||||
options.execPath = process.helperExecPath;
|
||||
@@ -31,11 +31,11 @@ cp.fork = (modulePath, args?, options?: cp.ForkOptions) => {
|
||||
};
|
||||
|
||||
// Prevent Node from adding paths outside this app to search paths.
|
||||
import path = require('path'); // eslint-disable-line import/first
|
||||
const path = require('path');
|
||||
const Module = require('module') as NodeJS.ModuleInternal;
|
||||
const resourcesPathWithTrailingSlash = process.resourcesPath + path.sep;
|
||||
const originalNodeModulePaths = Module._nodeModulePaths;
|
||||
Module._nodeModulePaths = function (from) {
|
||||
Module._nodeModulePaths = function (from: string) {
|
||||
const paths: string[] = originalNodeModulePaths(from);
|
||||
const fromPath = path.resolve(from) + path.sep;
|
||||
// If "from" is outside the app then we do nothing.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as events from 'events';
|
||||
import { setImmediate, clearImmediate } from 'timers';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
import type * as ipcRendererUtilsModule from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
@@ -127,6 +126,7 @@ function runPreloadScript (preloadSrc: string) {
|
||||
|
||||
// eval in window scope
|
||||
const preloadFn = binding.createPreloadScript(preloadWrapperSrc);
|
||||
const { setImmediate, clearImmediate } = require('timers');
|
||||
const exports = {};
|
||||
|
||||
preloadFn(preloadRequire, preloadProcess, Buffer, global, setImmediate, clearImmediate, exports, { exports });
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
build_gn.patch
|
||||
dcheck.patch
|
||||
accelerator.patch
|
||||
blink_file_path.patch
|
||||
blink_local_frame.patch
|
||||
@@ -48,6 +47,7 @@ feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
|
||||
feat_enable_offscreen_rendering_with_viz_compositor.patch
|
||||
gpu_notify_when_dxdiag_request_fails.patch
|
||||
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
|
||||
feat_add_onclose_to_messageport.patch
|
||||
allow_in-process_windows_to_have_different_web_prefs.patch
|
||||
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
|
||||
crash_allow_setting_more_options.patch
|
||||
@@ -128,6 +128,3 @@ fix_restore_original_resize_performance_on_macos.patch
|
||||
feat_allow_code_cache_in_custom_schemes.patch
|
||||
build_run_reclient_cfg_generator_after_chrome.patch
|
||||
fix_suppress_clang_-wimplicit-const-int-float-conversion_in.patch
|
||||
cherry-pick-e7ffe20ebfac.patch
|
||||
fix_getcursorscreenpoint_wrongly_returns_0_0.patch
|
||||
fix_add_support_for_skipping_first_2_no-op_refreshes_in_thumb_cap.patch
|
||||
|
||||
@@ -23,7 +23,7 @@ index 2f05e37b8513bc28d199f81130e55063643a7c49..a03a0f4294843962c7c670c96c1df002
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index f5a6fde5af92e6a8258ac80e242f7ea21e946d1a..b53c0ad1e752428ab8df1356606e7b1add8c4ba0 100644
|
||||
index 219f7297b481706656d56cb44a1ebc3039d3c9da..3952beca5ee0d71ab7154c316425ae82843cd363 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4582,6 +4582,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -92,10 +92,10 @@ index 2709519d0bbf33548704c14a99324b504d27ccbf..aa3c2d3c1ea73da128616fe676ac09e2
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
index 070f61ef364eec98080f29d089d39f74222e9759..a6d2f3bbe61486187d23d20fecb01749e1d897b7 100644
|
||||
index 6139aed9ebbb459d4d7027312c0f15b669fedfb6..db566ba272b1eff5e67547c5d82bf7420def7285 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
@@ -290,6 +290,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -289,6 +289,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,10 +51,10 @@ 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 d78f00cbb877b64892b9871252d79796fd4cabb8..4d2de00328f0b6437789612b14a53aae79eb15ab 100644
|
||||
index 8d07d5346afd62dd8b44b4ed4f7bc6c735fffea8..dbf1556cfae0e1ae18734e37f6b67acd34861180 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -559,8 +559,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
@@ -557,8 +557,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
// OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
|
||||
// which updates `visibility_`, unless the host is hidden. Make sure no update
|
||||
// is needed.
|
||||
@@ -66,10 +66,10 @@ index d78f00cbb877b64892b9871252d79796fd4cabb8..4d2de00328f0b6437789612b14a53aae
|
||||
|
||||
void RenderWidgetHostViewAura::NotifyHostAndDelegateOnWasShown(
|
||||
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
|
||||
index 9979c25ecd57e68331b628a518368635db5c2027..f65bfbbb663a5bb0511ffa389d3163e0fdeb4d1f 100644
|
||||
index 20ca763ff7f55e8176b77349b41917b11e051ae6..a50c122064b5f0092f57e3d508fb19389b72203b 100644
|
||||
--- a/content/public/browser/render_view_host.h
|
||||
+++ b/content/public/browser/render_view_host.h
|
||||
@@ -76,6 +76,9 @@ class CONTENT_EXPORT RenderViewHost {
|
||||
@@ -75,6 +75,9 @@ class CONTENT_EXPORT RenderViewHost {
|
||||
virtual void WriteIntoTrace(
|
||||
perfetto::TracedProto<TraceProto> context) const = 0;
|
||||
|
||||
|
||||
@@ -6,13 +6,15 @@ 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 afe0b3e90fafb9413cc49198cf3ad5d66d433b54..a8d83d6c95ebda9a898a383a8a1581d75da09f2e 100644
|
||||
index afe0b3e90fafb9413cc49198cf3ad5d66d433b54..6b83b22994998ba98895144ec81b4cdff1b0e0db 100644
|
||||
--- a/.gn
|
||||
+++ b/.gn
|
||||
@@ -167,4 +167,6 @@ exec_script_whitelist =
|
||||
@@ -167,4 +167,8 @@ exec_script_whitelist =
|
||||
|
||||
"//tools/grit/grit_rule.gni",
|
||||
"//tools/gritsettings/BUILD.gn",
|
||||
+
|
||||
+ "//electron/BUILD.gn"
|
||||
+ "//electron/BUILD.gn",
|
||||
+ "//third_party/electron_node/deps/base64/BUILD.gn",
|
||||
+ "//third_party/electron_node/deps/base64/unofficial.gni",
|
||||
]
|
||||
|
||||
@@ -33,10 +33,10 @@ index d09e7aeb788550e7ecefb4b9c177dd26ecc5ad4c..c894dc421f55a94e541d00e05e2f05bf
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 0811d62fd215de0231021c88c6083493b0a6b1ca..502275e7adf9388afeeaeca692784f9e9a060f8c 100644
|
||||
index 2196de3ab71427240c489529b41860c616a3ace2..34e76249dca3558aace5dfd31e8a4df72b2de45a 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4763,7 +4763,7 @@ static_library("browser") {
|
||||
@@ -4759,7 +4759,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 0811d62fd215de0231021c88c6083493b0a6b1ca..502275e7adf9388afeeaeca692784f9e
|
||||
sources += [ "certificate_viewer_stub.cc" ]
|
||||
}
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 84ea91c781a2f777461a4e99d1c8c2cdf138dc22..0d8a1ed6cebd86de4efc36a93e20cb6034a16c10 100644
|
||||
index 32620b7d8a84a74b8650c387f49f008b4a5da169..a36e4dca226c8198503fdfd62c50d1dbea708605 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7221,7 +7221,6 @@ if (!is_fuchsia) {
|
||||
@@ -7227,7 +7227,6 @@ if (!is_fuchsia) {
|
||||
|
||||
deps += [
|
||||
"//chrome:other_version",
|
||||
@@ -57,7 +57,7 @@ index 84ea91c781a2f777461a4e99d1c8c2cdf138dc22..0d8a1ed6cebd86de4efc36a93e20cb60
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -7242,6 +7241,10 @@ if (!is_fuchsia) {
|
||||
@@ -7248,6 +7247,10 @@ if (!is_fuchsia) {
|
||||
"//ui/resources",
|
||||
]
|
||||
|
||||
@@ -68,7 +68,7 @@ index 84ea91c781a2f777461a4e99d1c8c2cdf138dc22..0d8a1ed6cebd86de4efc36a93e20cb60
|
||||
ldflags = [
|
||||
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
|
||||
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
|
||||
@@ -8260,7 +8263,6 @@ if (!is_fuchsia) {
|
||||
@@ -8266,7 +8269,6 @@ if (!is_fuchsia) {
|
||||
}
|
||||
|
||||
deps += [
|
||||
@@ -76,7 +76,7 @@ index 84ea91c781a2f777461a4e99d1c8c2cdf138dc22..0d8a1ed6cebd86de4efc36a93e20cb60
|
||||
"//chrome/browser/apps:icon_standardizer",
|
||||
"//chrome/browser/apps/app_service",
|
||||
"//chrome/browser/apps/app_service:app_registry_cache_waiter",
|
||||
@@ -8353,6 +8355,10 @@ if (!is_fuchsia) {
|
||||
@@ -8359,6 +8361,10 @@ if (!is_fuchsia) {
|
||||
"//ui/webui/resources/js/browser_command:mojo_bindings",
|
||||
]
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 9b37b8a18c5c09aaf76590f53060cab3190d676f..0a095cfd413f8cb7f30f8b143b29e5e829898ad0 100644
|
||||
index 4f2943f1cc8365f1739adf0d42bc1a1b6940b190..90dd8dcbfa76a52cb6797074267ff457e57c03a0 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8272,6 +8272,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -8280,6 +8280,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
@@ -21,10 +21,10 @@ index 9b37b8a18c5c09aaf76590f53060cab3190d676f..0a095cfd413f8cb7f30f8b143b29e5e8
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 21815a78d24295c9bcaef5b133dd9ded47d1070a..e9ce07551ccd183cb205aedba787b3a9700e2a2b 100644
|
||||
index f275ba99d621d843feb22b0e2f0fd4a16d4f62c0..034f1950d3eab52dd64e38cbc4afb16bdbed2558 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4516,6 +4516,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4517,6 +4517,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
auto* new_contents_impl = new_contents.get();
|
||||
|
||||
@@ -37,7 +37,7 @@ index 21815a78d24295c9bcaef5b133dd9ded47d1070a..e9ce07551ccd183cb205aedba787b3a9
|
||||
// If the new frame has a name, make sure any SiteInstances that can find
|
||||
// this named frame have proxies for it. Must be called after
|
||||
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
|
||||
@@ -4557,12 +4563,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4558,12 +4564,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ index 3051e35ee43835113aafd8645daca12d31e873e1..53cbd6008101e8ae6851f8da9d4e6537
|
||||
|
||||
// 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 d004abc6fe3da01d605be1d7138d1809e4616662..7cef4b0c29e1b537cd172e19609744aaf4d90a11 100644
|
||||
index e099f0830ee31b630ab87a0af448961c1c3c0ed7..b07fb88ed228f4257d06700bef35a11161ebfd77 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -710,6 +710,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -79,7 +79,7 @@ index d004abc6fe3da01d605be1d7138d1809e4616662..7cef4b0c29e1b537cd172e19609744aa
|
||||
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 d0a5dbc45467019aba2d185187ebb16879775dc4..dbeebb4ed9aa1fcba31cc2ce7e2031a483f7f1fe 100644
|
||||
index f8b7a87698ad18f6b645335f113e9bda1eecbe18..4d6250a0a9f0174d1ddc61e5d125fda6f7a9c521 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -182,6 +182,7 @@ class NetworkService;
|
||||
@@ -122,7 +122,7 @@ index 55afe83e3052afb40176cb8ab6e974013e207ff5..4f9e32610e7e2c97c486be8693bd357b
|
||||
const OpenURLParams& params) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index 0a80169aa10cf956e53df5866719fd27437dd050..c34e8d3822fa5aafb351a6b2119c7d49b283a4b0 100644
|
||||
index 5466ad47516e449eb45fff043f34fadccc4ca577..e7f908366f6d38aa988673950f3329e21e4e5737 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -133,7 +133,7 @@ index 0a80169aa10cf956e53df5866719fd27437dd050..c34e8d3822fa5aafb351a6b2119c7d49
|
||||
#include "content/public/browser/eye_dropper.h"
|
||||
#include "content/public/browser/fullscreen_types.h"
|
||||
#include "content/public/browser/invalidate_type.h"
|
||||
@@ -345,6 +346,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -348,6 +349,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
const StoragePartitionConfig& partition_config,
|
||||
SessionStorageNamespace* session_storage_namespace);
|
||||
|
||||
@@ -148,10 +148,10 @@ index 0a80169aa10cf956e53df5866719fd27437dd050..c34e8d3822fa5aafb351a6b2119c7d49
|
||||
// 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 07bb68687683ac1458080659471212473d9e966a..f5a6fde5af92e6a8258ac80e242f7ea21e946d1a 100644
|
||||
index 8ae4a791a73c3e4ce56228c3e87a79b9f681bd5c..219f7297b481706656d56cb44a1ebc3039d3c9da 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6573,6 +6573,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6577,6 +6577,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aaron Leventhal <aleventhal@google.com>
|
||||
Date: Sat, 27 Jan 2024 04:15:37 +0000
|
||||
Subject: Ensure old children of objects that become leaves are cleared
|
||||
|
||||
Fixed: 1520335
|
||||
Change-Id: I9cd2fa6bfbb59d43318b7b378e4267c53e139f97
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5238389
|
||||
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
|
||||
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
|
||||
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1252998}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
|
||||
index 15a7ced45e36c76d6f2a7e6736e9ea3c1fd69cff..a94e88e79c4fb5ed1336a776eafe3e302f5d50f8 100644
|
||||
--- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
|
||||
+++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
|
||||
@@ -4599,15 +4599,7 @@ void AXNodeObject::AddChildrenImpl() {
|
||||
}
|
||||
|
||||
CHECK(NeedsToUpdateChildren());
|
||||
-
|
||||
- if (!CanHaveChildren()) {
|
||||
- // TODO(crbug.com/1407397): Make sure this is no longer firing then
|
||||
- // transform this block to CHECK(CanHaveChildren());
|
||||
- DUMP_WILL_BE_NOTREACHED_NORETURN()
|
||||
- << "Should not reach AddChildren() if CanHaveChildren() is false.\n"
|
||||
- << ToString(true, true);
|
||||
- return;
|
||||
- }
|
||||
+ CHECK(CanHaveChildren());
|
||||
|
||||
if (ShouldLoadInlineTextBoxes() && HasLayoutText(this)) {
|
||||
AddInlineTextBoxChildren();
|
||||
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc
|
||||
index 39e950c537266783f64df29fe4460a01f4a8dbcc..c465d53e8728e0cd8b3d936e50c16f1973073fa6 100644
|
||||
--- a/third_party/blink/renderer/modules/accessibility/ax_object.cc
|
||||
+++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
|
||||
@@ -5761,16 +5761,19 @@ void AXObject::UpdateChildrenIfNecessary() {
|
||||
return;
|
||||
}
|
||||
|
||||
- if (!CanHaveChildren()) {
|
||||
- SetNeedsToUpdateChildren(false);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
CHECK(!AXObjectCache().IsFrozen())
|
||||
<< "Object should have already had its children updated in "
|
||||
"AXObjectCacheImpl::UpdateTreeIfNeeded(): "
|
||||
<< ToString(true, true);
|
||||
|
||||
+ if (!CanHaveChildren()) {
|
||||
+ // Clear any children in case the node previously allowed children.
|
||||
+ ClearChildren();
|
||||
+ SetNeedsToUpdateChildren(false);
|
||||
+ child_cached_values_need_update_ = false;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
UpdateCachedAttributeValuesIfNeeded();
|
||||
|
||||
ClearChildren();
|
||||
diff --git a/third_party/blink/web_tests/external/wpt/accessibility/crashtests/inert-br-child.html b/third_party/blink/web_tests/external/wpt/accessibility/crashtests/inert-br-child.html
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9c9039c3abac39b10c730a75221a1752910d0ded
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/web_tests/external/wpt/accessibility/crashtests/inert-br-child.html
|
||||
@@ -0,0 +1,17 @@
|
||||
+<!DOCTYPE html>
|
||||
+<!-- Test for crash when inert br gains illegal child -->
|
||||
+<html>
|
||||
+<dialog></dialog>
|
||||
+<br>
|
||||
+
|
||||
+<script>
|
||||
+requestAnimationFrame(() => {
|
||||
+ requestAnimationFrame(() => {
|
||||
+ document.querySelector('dialog').showModal();
|
||||
+ const br = document.querySelector('br');
|
||||
+ br.appendChild(document.createElement('fieldset'));
|
||||
+ });
|
||||
+});
|
||||
+</script>
|
||||
+
|
||||
+</html>
|
||||
@@ -6,7 +6,7 @@ Subject: chore: add electron deps to gitignores
|
||||
Makes things like "git status" quicker when developing electron locally
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 2f9164594b1bbf9f6d7af875ab65ee0cb24b1227..4c969db1812ef64647e9d8f139961911439d0551 100644
|
||||
index 867b990689b5cbdf5ca22a83a0a51169109af943..1ade570e02b523b377ebf4139676a94c51c36784 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -208,6 +208,7 @@ vs-chromium-project.txt
|
||||
|
||||
@@ -35,10 +35,10 @@ index 9433ce4602414df4999f6ced8b371d4e847819ce..f38afaafcd6710f9cfcef816bf152cd2
|
||||
content::RenderFrameHost* requesting_frame,
|
||||
const blink::mojom::FullscreenOptions& options) final;
|
||||
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.cc b/chrome/browser/ui/ash/ash_web_view_impl.cc
|
||||
index ef5c95be3340b98ae0a74784187590781f6a7892..532576e19e4e76d021a6905da40230960f04e1a8 100644
|
||||
index f88f664eb7226425e6f1b45fe6811d49dd44f3ce..851d31a0e8bbdc57d4ca617f4d4c814343736ddd 100644
|
||||
--- a/chrome/browser/ui/ash/ash_web_view_impl.cc
|
||||
+++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
|
||||
@@ -115,10 +115,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
|
||||
@@ -112,10 +112,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -52,10 +52,10 @@ index ef5c95be3340b98ae0a74784187590781f6a7892..532576e19e4e76d021a6905da4023096
|
||||
/*from_user_gesture=*/true);
|
||||
return true;
|
||||
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.h b/chrome/browser/ui/ash/ash_web_view_impl.h
|
||||
index 0daac30efcfe15d0b3072306e5c96d56883992ae..4f794d3843192871bc78b586467a90cc56301759 100644
|
||||
index 65840fa273b367efa9d681a4d267a3930d496eea..a28bdc08ee5535c3650169d5246aaa9a14d4778d 100644
|
||||
--- a/chrome/browser/ui/ash/ash_web_view_impl.h
|
||||
+++ b/chrome/browser/ui/ash/ash_web_view_impl.h
|
||||
@@ -57,8 +57,7 @@ class AshWebViewImpl : public ash::AshWebView,
|
||||
@@ -56,8 +56,7 @@ class AshWebViewImpl : public ash::AshWebView,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -218,10 +218,10 @@ index c5b0d3b23b8da318ae55fcac2515a1187f261469..16ed1f46c9afde0ff25750128b4fcff6
|
||||
void AddNewContents(content::WebContents* source,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 245e7c6e3228001d17e62b8ace3647023cac9a73..af25cd45d6f087bc6fd06916bd5c7ba4ef69ddef 100644
|
||||
index 10e4014e065738261067abc3dfff0f254a300517..631e941a640b035a16d8b73f881670b9d4e8a581 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4422,8 +4422,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4423,8 +4423,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -246,10 +246,10 @@ index 4f9e32610e7e2c97c486be8693bd357b0d3e29f8..20c5b249bdf65694b1dbe7a703141da7
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index c34e8d3822fa5aafb351a6b2119c7d49b283a4b0..08425c4787f2181be57ebd37ca7388a994c168f7 100644
|
||||
index e7f908366f6d38aa988673950f3329e21e4e5737..24aad5e793a28439c9ab368572c2ff67b13fc912 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -324,8 +324,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -327,8 +327,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
SiteInstance* source_site_instance,
|
||||
mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
|
||||
@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
|
||||
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 5fa68db39e6ded11d4d0f6bee46c7938b2f011c0..48f1cdd0a7763242b81c7a54cad72700c8a42af1 100644
|
||||
index 1db5e8e422b62d6d92b50d600b1490bc5ac6042e..00aac10693e51c5e296bacc4fda9d801f803af73 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -39,6 +39,7 @@
|
||||
@@ -48,7 +48,7 @@ index 5fa68db39e6ded11d4d0f6bee46c7938b2f011c0..48f1cdd0a7763242b81c7a54cad72700
|
||||
#endif // V8_USE_EXTERNAL_STARTUP_DATA
|
||||
}
|
||||
|
||||
@@ -967,7 +974,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
@@ -971,7 +978,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
return TerminateForFatalInitializationError();
|
||||
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:44:38 -0700
|
||||
Subject: dcheck.patch
|
||||
|
||||
This disables some debug checks which currently fail when running the Electron
|
||||
test suite. In general there should be sustained effort to have all debug checks
|
||||
enabled. If you want to help, choose one of the diffs below and remove it. Then
|
||||
build Electron (debug configuration) and make sure all tests pass on the CI
|
||||
systems. Unfortunately the tests don't always cover the check failures, so it's
|
||||
good to also run some non-trivial Electron app to verify.
|
||||
|
||||
Apart from getting rid of a whole diff, you may also be able to replace one diff
|
||||
with another which enables at least some of the previously disabled checks. For
|
||||
example, the checks might be disabled for a whole build target, but actually
|
||||
only one or two specific checks fail. Then it's better to simply comment out the
|
||||
failing checks and allow the rest of the target to have them enabled.
|
||||
|
||||
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
||||
index 98c93666f451aaa5fddcb5c476c58925db087d56..3a88e94b94594d938a5e61889102d5322850b1f6 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -905,10 +905,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
|
||||
|
||||
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
|
||||
UINT cf_format = format.ToFormatEtc().cfFormat;
|
||||
- DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
|
||||
+ // DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
|
||||
if (handle && !::SetClipboardData(cf_format, handle)) {
|
||||
- DCHECK_NE(GetLastError(),
|
||||
- static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
|
||||
+ // DCHECK_NE(GetLastError(),
|
||||
+ // static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
|
||||
::GlobalFree(handle);
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,10 @@ index 709246523b417943b4c64ef364312980d717e1bc..079b93338c3af4605c470b88934a32d1
|
||||
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 7942ee12c003c722b02f2b76cc6cca9837551f68..d78f00cbb877b64892b9871252d79796fd4cabb8 100644
|
||||
index d81261500c208cbf1466ae23117ba3f5029d145a..8d07d5346afd62dd8b44b4ed4f7bc6c735fffea8 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -620,7 +620,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
@@ -618,7 +618,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
DCHECK(visibility_ == Visibility::HIDDEN ||
|
||||
visibility_ == Visibility::OCCLUDED);
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we
|
||||
should continue seeking for a real fix.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
|
||||
index bef15a4f17358386478d853a84a1c1e32dfd6f0e..5c785109c7223268a096a2c5a5cf6c61298e8227 100644
|
||||
index de4e4dc90d25b6cbd50bf88eeeec7c32a4b703ec..64057cb76f3028c99878e15f8f791c1ed9cfce98 100644
|
||||
--- a/content/browser/renderer_host/navigator.cc
|
||||
+++ b/content/browser/renderer_host/navigator.cc
|
||||
@@ -1288,6 +1288,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
@@ -1292,6 +1292,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
.InMilliseconds());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ index bef15a4f17358386478d853a84a1c1e32dfd6f0e..5c785109c7223268a096a2c5a5cf6c61
|
||||
// If this is a same-process navigation and we have timestamps for unload
|
||||
// durations, fill those metrics out as well.
|
||||
if (params.unload_start && params.unload_end &&
|
||||
@@ -1337,6 +1338,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
@@ -1341,6 +1342,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
first_before_unload_start_time)
|
||||
.InMilliseconds());
|
||||
}
|
||||
|
||||
31
patches/chromium/feat_add_onclose_to_messageport.patch
Normal file
31
patches/chromium/feat_add_onclose_to_messageport.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 4 Mar 2020 11:18:03 -0800
|
||||
Subject: feat: add onclose to MessagePort
|
||||
|
||||
This adds the 'onclose' event to MessagePort. Can be removed once
|
||||
https://bugs.chromium.org/p/chromium/issues/detail?id=1495616 is fixed.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
|
||||
index 2e0961fd8c0bc8f9a2a7c124693033eb234928bd..5c54705e3c1766553e9cba13142345485ca44578 100644
|
||||
--- a/third_party/blink/renderer/core/messaging/message_port.cc
|
||||
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
|
||||
@@ -195,6 +195,7 @@ void MessagePort::close() {
|
||||
Entangle(pipe.TakePort0(), nullptr);
|
||||
}
|
||||
closed_ = true;
|
||||
+ DispatchEvent(*Event::Create(event_type_names::kClose));
|
||||
}
|
||||
|
||||
void MessagePort::OnConnectionError() {
|
||||
diff --git a/third_party/blink/renderer/core/messaging/message_port.idl b/third_party/blink/renderer/core/messaging/message_port.idl
|
||||
index 9df43655b569428a6abc54341b4b0023e159f99b..3f1f181d9b8a66997136f870f55c97c08294b6eb 100644
|
||||
--- a/third_party/blink/renderer/core/messaging/message_port.idl
|
||||
+++ b/third_party/blink/renderer/core/messaging/message_port.idl
|
||||
@@ -40,5 +40,5 @@
|
||||
// event handlers
|
||||
attribute EventHandler onmessage;
|
||||
attribute EventHandler onmessageerror;
|
||||
- [RuntimeEnabled=MessagePortCloseEvent] attribute EventHandler onclose;
|
||||
+ attribute EventHandler onclose;
|
||||
};
|
||||
@@ -18,10 +18,10 @@ to STDOUT_FILENO/STD_OUTPUT_HANDLE and STDERR_FILENO/STD_ERROR_HANDLE allowing t
|
||||
parent process to read from the pipe.
|
||||
|
||||
diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h
|
||||
index e515503a0f636d935fdcd779a5ac01bd8f351e74..0669361cb063c9dd15a19486fce1a609171d4cda 100644
|
||||
index fff0bf658a41f2f85db6086662768726f4a177a6..4f50fd78ea423efbeb0db6b8551b0f161b83ae9f 100644
|
||||
--- a/content/browser/child_process_launcher.h
|
||||
+++ b/content/browser/child_process_launcher.h
|
||||
@@ -32,6 +32,7 @@
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "base/win/windows_types.h"
|
||||
@@ -29,7 +29,7 @@ index e515503a0f636d935fdcd779a5ac01bd8f351e74..0669361cb063c9dd15a19486fce1a609
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_POSIX)
|
||||
@@ -164,7 +165,10 @@ struct ChildProcessLauncherFileData {
|
||||
@@ -166,7 +167,10 @@ struct ChildProcessLauncherFileData {
|
||||
delete;
|
||||
~ChildProcessLauncherFileData();
|
||||
|
||||
@@ -41,7 +41,7 @@ index e515503a0f636d935fdcd779a5ac01bd8f351e74..0669361cb063c9dd15a19486fce1a609
|
||||
// Files opened by the browser and passed as corresponding file descriptors
|
||||
// in the child process. If a FilePath is provided, the file will be opened
|
||||
// and the descriptor cached for future process launches. If a ScopedFD is
|
||||
@@ -179,6 +183,15 @@ struct ChildProcessLauncherFileData {
|
||||
@@ -181,6 +185,15 @@ struct ChildProcessLauncherFileData {
|
||||
std::map<std::string, absl::variant<base::FilePath, base::ScopedFD>>
|
||||
files_to_preload;
|
||||
#endif
|
||||
|
||||
@@ -562,7 +562,7 @@ index febb2718cb34ea4d9f411f068d8c01a89c7db888..be8bd51cb61c20ef3df8552972a0ac2f
|
||||
gpu::SyncPointManager* GetSyncPointManager() override;
|
||||
};
|
||||
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
index 516c7f65097f139496184dcca8f054553b84d752..4fd23fbf7ab2b7aa4eee9c2fc4b98a04dd48efce 100644
|
||||
index 36a762f6a8054158bd7f05c077a2b96cf7cfd10c..598c8b46c7d4b3d48f07bb5826ec640006ade0e2 100644
|
||||
--- a/content/browser/compositor/viz_process_transport_factory.cc
|
||||
+++ b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
@@ -408,8 +408,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
|
||||
@@ -12,7 +12,7 @@ We attempt to migrate the safe storage key from the old account, if that migrati
|
||||
Existing apps that aren't built for the app store should be unimpacted, there is one edge case where a user uses BOTH an AppStore and a darwin build of the same app only one will keep it's access to the safestorage key as during the migration we delete the old account. This is an acceptable edge case as no one should be actively using two versions of the same app.
|
||||
|
||||
diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm
|
||||
index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be0985d7f334 100644
|
||||
index 901caf0217fe574e63bb1800f1f0b100dc8c30a4..cb195ee832e21377e41c011d5d5b91347cff4db1 100644
|
||||
--- a/components/os_crypt/sync/keychain_password_mac.mm
|
||||
+++ b/components/os_crypt/sync/keychain_password_mac.mm
|
||||
@@ -22,6 +22,12 @@
|
||||
@@ -38,7 +38,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
|
||||
+ const std::string suffixed_account_name = account_name + account_name_suffix;
|
||||
+
|
||||
+ // We should check if the suffixed account exists first
|
||||
OSStatus error = keychain_->FindGenericPassword(
|
||||
OSStatus error = keychain_.FindGenericPassword(
|
||||
- GetServiceName().size(), GetServiceName().c_str(),
|
||||
- GetAccountName().size(), GetAccountName().c_str(), &password_length,
|
||||
+ service_name.size(), service_name.c_str(),
|
||||
@@ -63,7 +63,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
|
||||
+ // If the suffixed account didn't exist, we should check if the legacy non-suffixed account
|
||||
+ // exists. If it does we can use that key and migrate it to the new account
|
||||
+ base::apple::ScopedCFTypeRef<SecKeychainItemRef> item_ref;
|
||||
+ error = keychain_->FindGenericPassword(
|
||||
+ error = keychain_.FindGenericPassword(
|
||||
+ service_name.size(), service_name.c_str(),
|
||||
+ account_name.size(), account_name.c_str(), &password_length,
|
||||
+ &password_data, item_ref.InitializeInto());
|
||||
@@ -74,7 +74,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
|
||||
+
|
||||
+ // If we found the legacy account name we should copy it over to
|
||||
+ // the new suffixed account
|
||||
+ error = keychain_->AddGenericPassword(
|
||||
+ error = keychain_.AddGenericPassword(
|
||||
+ service_name.size(), service_name.data(), suffixed_account_name.size(),
|
||||
+ suffixed_account_name.data(), password.size(), password_data, NULL);
|
||||
+
|
||||
@@ -82,7 +82,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
|
||||
+ // If we successfully made the suffixed account we can delete the old
|
||||
+ // account to ensure new apps don't try to use it and run into IAM
|
||||
+ // issues
|
||||
+ error = keychain_->ItemDelete(item_ref.get());
|
||||
+ error = keychain_.ItemDelete(item_ref.get());
|
||||
+ if (error != noErr) {
|
||||
+ OSSTATUS_DLOG(ERROR, error) << "Keychain delete for legacy key failed";
|
||||
+ }
|
||||
@@ -90,7 +90,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
|
||||
+ OSSTATUS_DLOG(ERROR, error) << "Keychain add for suffixed key failed";
|
||||
+ }
|
||||
+
|
||||
+ keychain_->ItemFreeContent(password_data);
|
||||
+ keychain_.ItemFreeContent(password_data);
|
||||
+ return password;
|
||||
+ }
|
||||
+
|
||||
@@ -98,4 +98,4 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
|
||||
+ // with the suffixed name
|
||||
if (error == errSecItemNotFound) {
|
||||
std::string password = AddRandomPasswordToKeychain(
|
||||
*keychain_, GetServiceName(), GetAccountName());
|
||||
keychain_, GetServiceName(), GetAccountName());
|
||||
|
||||
@@ -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 a543fb2ec5873da9d2b108748eaa5d52de4f0d50..a03f68e218dd540d3d1fd3d51e3fa67478198789 100644
|
||||
index 5e0cd62415854a3aa9e89130eacb33ddfceb68d4..216121c84840ee97e666bd8934092f7fc9583395 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
@@ -16,12 +16,16 @@
|
||||
@@ -78,7 +78,7 @@ index a543fb2ec5873da9d2b108748eaa5d52de4f0d50..a03f68e218dd540d3d1fd3d51e3fa674
|
||||
}
|
||||
|
||||
void FullscreenController::OnTabDeactivated(
|
||||
@@ -488,18 +498,17 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -486,18 +496,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.
|
||||
@@ -102,7 +102,7 @@ index a543fb2ec5873da9d2b108748eaa5d52de4f0d50..a03f68e218dd540d3d1fd3d51e3fa674
|
||||
if (option == TAB) {
|
||||
url = GetRequestingOrigin();
|
||||
tab_fullscreen_ = true;
|
||||
@@ -532,6 +541,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
@@ -530,6 +539,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
if (!extension_caused_fullscreen_.is_empty())
|
||||
url = extension_caused_fullscreen_;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ index a543fb2ec5873da9d2b108748eaa5d52de4f0d50..a03f68e218dd540d3d1fd3d51e3fa674
|
||||
|
||||
fullscreen_start_time_ = base::TimeTicks::Now();
|
||||
if (option == BROWSER)
|
||||
@@ -551,6 +561,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -549,6 +559,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
if (chrome::IsRunningInAppMode())
|
||||
return;
|
||||
|
||||
@@ -118,7 +118,7 @@ index a543fb2ec5873da9d2b108748eaa5d52de4f0d50..a03f68e218dd540d3d1fd3d51e3fa674
|
||||
CHECK(fullscreen_start_time_);
|
||||
if (exclusive_access_tab()) {
|
||||
ukm::SourceId source_id =
|
||||
@@ -562,15 +573,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
@@ -560,15 +571,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
|
||||
.Record(ukm::UkmRecorder::Get());
|
||||
fullscreen_start_time_.reset();
|
||||
}
|
||||
@@ -139,10 +139,10 @@ index a543fb2ec5873da9d2b108748eaa5d52de4f0d50..a03f68e218dd540d3d1fd3d51e3fa674
|
||||
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 c43ee31921ef8bce4214580ae6049d81e8ff9c06..fc7984332c680f2e045b1e083816be9db08b0c60 100644
|
||||
index 4b70d96a71e79ea8a02d1ef4eef3fdbd9eb8bb57..c0668fe843ebd094c6f56076e53dd239fade60a1 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
|
||||
@@ -246,10 +246,12 @@ class FullscreenController : public ExclusiveAccessControllerBase {
|
||||
@@ -244,10 +244,12 @@ class FullscreenController : public ExclusiveAccessControllerBase {
|
||||
// Used in testing to set the state to tab fullscreen.
|
||||
bool is_tab_fullscreen_for_testing_ = false;
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <marshallofsound@electronjs.org>
|
||||
Date: Tue, 13 Feb 2024 17:40:15 -0800
|
||||
Subject: fix: add support for skipping first 2 no-op refreshes in thumb cap
|
||||
|
||||
Fixes a bug in the SCK thumbnail capturer, will be reported upstream for a hopefully
|
||||
less hacky fix.
|
||||
|
||||
The first refresh is "no windows yet, no thumbnails".
|
||||
The second refresh is "we have windows, we queued the thumbnail requests"
|
||||
The third refresh (the one we want) is "we have windows, and have thumbnail requests"
|
||||
|
||||
This really isn't ideal at all, we need to refactor desktopCapturer (read completely re-implement it)
|
||||
to use StartUpdating and handle the events instead of using the "get the list once" method.
|
||||
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
index 0c6fccf16a11bbaff10115308e4b489490e5d3e6..e5ec31054a43989e630115605de435399d36559b 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
@@ -143,6 +143,8 @@ class DesktopMediaList {
|
||||
// important when IsSourceDelegated() returns true, as it helps to notify the
|
||||
// delegated source list when it should be hidden.
|
||||
virtual void HideList() = 0;
|
||||
+
|
||||
+ int skip_next_refresh_ = 0;
|
||||
};
|
||||
|
||||
#endif // CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_MEDIA_LIST_H_
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
index 780927301744ea7312f230cec76a24a33d71f767..d19b1cc9dedf839f12f4113db64293e5c8150f51 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
@@ -230,7 +230,11 @@ uint32_t DesktopMediaListBase::GetImageHash(const gfx::Image& image) {
|
||||
void DesktopMediaListBase::OnRefreshComplete() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK(refresh_callback_);
|
||||
- std::move(refresh_callback_).Run();
|
||||
+ if (skip_next_refresh_ > 0) {
|
||||
+ skip_next_refresh_--;
|
||||
+ } else {
|
||||
+ std::move(refresh_callback_).Run();
|
||||
+ }
|
||||
}
|
||||
|
||||
void DesktopMediaListBase::ScheduleNextRefresh() {
|
||||
@@ -23,7 +23,7 @@ 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 dead84566f239eff4e7f190ab707fbc209391007..28a5ef2a8751e85cfa8c29138fe45bdec06ed332 100644
|
||||
index 7a5fca0260d152a0d593615c74087eaa2df03591..f733d61bd44dc6ea78e6566c3f3f108bfb7a1e2f 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -10214,6 +10214,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Kerr <charles@charleskerr.com>
|
||||
Date: Thu, 8 Feb 2024 00:41:40 -0600
|
||||
Subject: fix: GetCursorScreenPoint() wrongly returns 0, 0
|
||||
|
||||
Fixes #41143. Discussion of the issue at
|
||||
https://github.com/electron/electron/issues/41143#issuecomment-1933443163
|
||||
|
||||
This patch should be backported to e29, upstreamed to Chromium, and then
|
||||
removed if it lands upstream.
|
||||
|
||||
diff --git a/ui/events/x/events_x_utils.cc b/ui/events/x/events_x_utils.cc
|
||||
index aa047f2bd39643dc471b25eeb567b0dd3731e0e0..eb312fb1c115751041930539d0d5f15208461e04 100644
|
||||
--- a/ui/events/x/events_x_utils.cc
|
||||
+++ b/ui/events/x/events_x_utils.cc
|
||||
@@ -586,6 +586,9 @@ gfx::Point EventLocationFromXEvent(const x11::Event& xev) {
|
||||
gfx::Point EventSystemLocationFromXEvent(const x11::Event& xev) {
|
||||
if (auto* crossing = xev.As<x11::CrossingEvent>())
|
||||
return gfx::Point(crossing->root_x, crossing->root_y);
|
||||
+ if (auto* crossing = xev.As<x11::Input::CrossingEvent>())
|
||||
+ return gfx::Point(Fp1616ToDouble(crossing->root_x),
|
||||
+ Fp1616ToDouble(crossing->root_y));
|
||||
if (auto* button = xev.As<x11::ButtonEvent>())
|
||||
return gfx::Point(button->root_x, button->root_y);
|
||||
if (auto* motion = xev.As<x11::MotionNotifyEvent>())
|
||||
@@ -13,13 +13,13 @@ messages in the legacy window handle layer.
|
||||
These conditions are regularly hit with WCO-enabled windows on Windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
||||
index 70c19054022dd8ebc28657bb9ec94c0ee3e7ad87..ed9bea21b4ee6d6b9a7b979fc63ccc43d1926184 100644
|
||||
index 2635d8967c42c85fb6830036e6de694b5736a97b..17bb1932f3a01c5027113061276f7050bb61f80e 100644
|
||||
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
||||
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
||||
@@ -320,12 +320,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
|
||||
@@ -322,12 +322,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnKeyboardRange(UINT message,
|
||||
LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
|
||||
WPARAM w_param,
|
||||
LPARAM l_param,
|
||||
BOOL& handled) {
|
||||
LPARAM l_param) {
|
||||
- if (message == WM_MOUSEMOVE) {
|
||||
+ if (message == WM_MOUSEMOVE || message == WM_NCMOUSEMOVE) {
|
||||
if (!mouse_tracking_enabled_) {
|
||||
@@ -31,27 +31,27 @@ index 70c19054022dd8ebc28657bb9ec94c0ee3e7ad87..ed9bea21b4ee6d6b9a7b979fc63ccc43
|
||||
tme.hwndTrack = hwnd();
|
||||
tme.dwHoverTime = 0;
|
||||
TrackMouseEvent(&tme);
|
||||
@@ -356,7 +356,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
|
||||
@@ -359,7 +359,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
|
||||
// out of the picture.
|
||||
if (!handled &&
|
||||
if (!msg_handled_ &&
|
||||
(message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) {
|
||||
- ret = ::DefWindowProc(GetParent(), message, w_param, l_param);
|
||||
+ // Send WM_NCMOUSEMOVE messages using the LegacyRenderWidgetHostHWND's
|
||||
+ // handle so mouse tracking on non-client areas doesn't break.
|
||||
+ HWND target = message == WM_NCMOUSEMOVE ? hwnd() : GetParent();
|
||||
+ ret = ::DefWindowProc(target, message, w_param, l_param);
|
||||
handled = TRUE;
|
||||
msg_handled_ = TRUE;
|
||||
}
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.h b/content/browser/renderer_host/legacy_render_widget_host_win.h
|
||||
index f22af1f3e24033688a4f59666346075831df2243..50c66051efb0bfcb3c13e4ccb37dddfade9abb82 100644
|
||||
index c478d6351ba160c76871ad657ede69b05b4e09ca..77631423937f7df7c52b4d3d309aa9335ab05bbb 100644
|
||||
--- a/content/browser/renderer_host/legacy_render_widget_host_win.h
|
||||
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.h
|
||||
@@ -102,6 +102,7 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND
|
||||
MESSAGE_HANDLER_EX(WM_VSCROLL, OnScroll)
|
||||
MESSAGE_HANDLER_EX(WM_NCHITTEST, OnNCHitTest)
|
||||
MESSAGE_RANGE_HANDLER(WM_NCMOUSEMOVE, WM_NCXBUTTONDBLCLK, OnMouseRange)
|
||||
+ MESSAGE_HANDLER_EX(WM_NCMOUSELEAVE, OnMouseLeave)
|
||||
MESSAGE_HANDLER_EX(WM_NCCALCSIZE, OnNCCalcSize)
|
||||
MESSAGE_HANDLER_EX(WM_SIZE, OnSize)
|
||||
MESSAGE_HANDLER_EX(WM_DESTROY, OnDestroy)
|
||||
@@ -91,6 +91,7 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND
|
||||
CR_MESSAGE_HANDLER_EX(WM_NCHITTEST, OnNCHitTest)
|
||||
CR_MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCXBUTTONDBLCLK,
|
||||
OnMouseRange)
|
||||
+ CR_MESSAGE_HANDLER_EX(WM_NCMOUSELEAVE, OnMouseLeave)
|
||||
CR_MESSAGE_HANDLER_EX(WM_NCCALCSIZE, OnNCCalcSize)
|
||||
CR_MESSAGE_HANDLER_EX(WM_SIZE, OnSize)
|
||||
CR_MESSAGE_HANDLER_EX(WM_DESTROY, OnDestroy)
|
||||
|
||||
@@ -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 4d2de00328f0b6437789612b14a53aae79eb15ab..c1ad97a53b59ccd7528ae51f27f9863b88cdac60 100644
|
||||
index dbf1556cfae0e1ae18734e37f6b67acd34861180..9fbc026dff4007e5673f2ebdecc6fe2695ae10fe 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -2926,6 +2926,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
|
||||
@@ -2919,6 +2919,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ index 4d2de00328f0b6437789612b14a53aae79eb15ab..c1ad97a53b59ccd7528ae51f27f9863b
|
||||
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 0f8d970ffb54a652c9235d13a7515b5ed3be7945..dcadbdb852ec03539168b4f27488107a800acc23 100644
|
||||
index 46f75904d60abd176b98adb5515b571ca46313d0..f1e20db777f16980cbd3f0451859704d9f898de9 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
|
||||
@@ -626,6 +626,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;
|
||||
@@ -87,10 +87,10 @@ index 01993347572548e46d8583c0bb568be4f12c7207..c679db5de0e2b60867b8f4b30c9b72b6
|
||||
// The view with active text input state, i.e., a focused <input> element.
|
||||
// It will be nullptr if no such view exists. Note that the active view
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 07ac28fe51c8f54d814c4c0718cf6f4705d0dbda..00e0321382a562ffb3733c48540d4f3071f13527 100644
|
||||
index 1b1983d2ecdbd14bf4e897e43cce6f4182a842cb..28afdf5395ae78dd0c5c7612b8b47efae7e837a3 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -8729,7 +8729,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -8730,7 +8730,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -203,6 +203,18 @@ index fa65331f40b90d812b71a489fd560e9359152d2b..390714d631dc88ef92d59ef9618a5706
|
||||
base::TimeTicks start_time_;
|
||||
const mojom::blink::UserActivationOption user_activation_option_;
|
||||
const mojom::blink::LoadEventBlockingOption blocking_option_;
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
index b704f5d3532fc91ed31583adaa19e00c9eb7a884..018f2874c21a3fea5fcc7113de8474ff58b6fafc 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
|
||||
@@ -285,6 +285,7 @@ void ExecuteScriptsInMainWorld(
|
||||
DOMWrapperWorld::kMainWorldId, sources, user_gesture,
|
||||
mojom::blink::EvaluationTiming::kSynchronous,
|
||||
mojom::blink::LoadEventBlockingOption::kDoNotBlock, std::move(callback),
|
||||
+ base::NullCallback(),
|
||||
BackForwardCacheAware::kAllow,
|
||||
mojom::blink::WantResultOption::kWantResult, wait_for_promise);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index b6a622acf02054cb425a34c27471b4450596f7f1..7747568ad1b8921eef7b639232dac99a7f816a9f 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -237,3 +249,15 @@ index f4ef9bfc74daa63f3863bc143513ca5006400074..8fd56b42955860428c8215bf562bb81b
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption,
|
||||
mojom::blink::PromiseResultOption) override;
|
||||
diff --git a/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc b/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc
|
||||
index b1e363d8ea4bce0d80daef6f32b1cf055047d086..1fcd8f667cf966ebce3ab3c970673742fb5ac654 100644
|
||||
--- a/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc
|
||||
+++ b/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc
|
||||
@@ -59,6 +59,7 @@ class VirtualTimeTest : public SimTest {
|
||||
mojom::blink::LoadEventBlockingOption::kDoNotBlock,
|
||||
WTF::BindOnce(&ScriptExecutionCallbackHelper::Completed,
|
||||
base::Unretained(&callback_helper)),
|
||||
+ base::NullCallback(),
|
||||
BackForwardCacheAware::kAllow,
|
||||
mojom::blink::WantResultOption::kWantResult,
|
||||
mojom::blink::PromiseResultOption::kDoNotWait);
|
||||
|
||||
@@ -58,7 +58,7 @@ index 50fd3ae4ff13ecc4b9c99f49f1851d368751fafa..fb8253a58ef86bcec24acdfa15ec0822
|
||||
|
||||
item->GetSubmenu()->GetWidget()->SetNativeWindowProperty(
|
||||
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
|
||||
index 55d0bb090d22149aa045515dac874b909fa18f34..7a66ddf13786a88eb19aad346c6588e042511ad3 100644
|
||||
index 5bd0f2fbd243af2f314e0bd922b7f34facf5f4ec..936d6075700ec42de531b8e169a01107e2908782 100644
|
||||
--- a/ui/views/controls/menu/menu_controller.h
|
||||
+++ b/ui/views/controls/menu/menu_controller.h
|
||||
@@ -139,6 +139,7 @@ class VIEWS_EXPORT MenuController
|
||||
|
||||
@@ -20,7 +20,7 @@ index 67cbdec6cdb18be2d99efb86436b371dc7aa3d69..9292d04288a2feeccb68d35ac26bb7ed
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index dbeebb4ed9aa1fcba31cc2ce7e2031a483f7f1fe..c7f6be5f6a651647cc3f6814f25ce4cb0bf1e4ef 100644
|
||||
index 4d6250a0a9f0174d1ddc61e5d125fda6f7a9c521..43e7758fec76a44b0b35491618d995582171700d 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -298,6 +298,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
@@ -11,10 +11,10 @@ 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 a7a7a1ac4bf95282eb53ecfb85a5b6a0221de3c6..109a27a8f833810a3017914e2c411e6e00088094 100755
|
||||
index 06ab632801a85a20edd7889ac5b924b78206aaba..cb4eb9d9e7c1be5836826aa8be5dafc133a3d800 100755
|
||||
--- a/tools/clang/scripts/update.py
|
||||
+++ b/tools/clang/scripts/update.py
|
||||
@@ -306,6 +306,8 @@ def GetDefaultHostOs():
|
||||
@@ -307,6 +307,8 @@ def GetDefaultHostOs():
|
||||
'win32': 'win',
|
||||
}
|
||||
default_host_os = _PLATFORM_HOST_OS_MAP.get(sys.platform, sys.platform)
|
||||
|
||||
@@ -9,7 +9,7 @@ but due to the nature of electron, we need to load the v8 snapshot
|
||||
in the browser process.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 0e6cd686e0b05fac5e109594a857a15fa34aceba..5fa68db39e6ded11d4d0f6bee46c7938b2f011c0 100644
|
||||
index f39a56eefbaa70f3abb9b36fe02a25b60ae20c90..1db5e8e422b62d6d92b50d600b1490bc5ac6042e 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -274,11 +274,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
|
||||
|
||||
@@ -35,7 +35,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to
|
||||
system priority.
|
||||
|
||||
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
||||
index c00c41bc2c7fd716589c325722d69316d939ecfe..83fc835ecab873c9203ffe58ad21f2404ff80d4b 100644
|
||||
index 4dda9f3b080656613777536a07a958ef839892a0..d6497675c5cd77065367f1ceae5e47ac28cc2f83 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1047,6 +1047,7 @@ component("base") {
|
||||
@@ -353,7 +353,7 @@ index eeeaec7e1064ca250ffc4ef5d5e174c562dcd640..7b0c310ab949140811031f68f0e7163e
|
||||
bool shouldShowWindowTitle = YES;
|
||||
if (_bridge)
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
index 053b8a2182778b469941116eab3acd5fd6fd8099..d085258d5970b37215fe0d5591e6c0306401a172 100644
|
||||
index 4a97dd3ea091018387ead065f5f489b39f84301c..e6df67902a269975e739d4ce22aaf49730c10a96 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
@@ -600,10 +600,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
|
||||
@@ -405,7 +405,7 @@ index eaf077d33ca54a5394b1f1ab9024b22c4e496ae5..ac2b42196188bc32b9842f95df74aa4c
|
||||
|
||||
void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index 76959be428bd4ea2efe5e73c78b0aed77246fd96..58c8c975b737c9452674090396637122bb1cde7b 100644
|
||||
index 2cc144b6001b7862d77c0e5a4240e863aff3dd21..e2f6f2c58352d0d3526a51fd180d5011c20200df 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -2020,15 +2020,21 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
@@ -443,7 +443,7 @@ index a460c6503d69549a0b236a04d9e457c2d36ee405..821e5db63fd5d69b3fcc329ec02f71a1
|
||||
libs = []
|
||||
frameworks = []
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index ce3623bd6353674fee92ba1c36eeda8da8906882..62746522bf5f398b12a8cee35f49bb4fc3b51b53 100644
|
||||
index 5a6706495ed2a8f1cd781da9bde8572318bf6897..afd4d1f728a7f056e49b2ecb006c5a05388d3409 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -21,7 +21,9 @@
|
||||
@@ -456,7 +456,7 @@ index ce3623bd6353674fee92ba1c36eeda8da8906882..62746522bf5f398b12a8cee35f49bb4f
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -225,6 +227,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -224,6 +226,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ index ce3623bd6353674fee92ba1c36eeda8da8906882..62746522bf5f398b12a8cee35f49bb4f
|
||||
BrowserAccessibilityManager* root_manager = GetManagerForRootFrame();
|
||||
if (root_manager) {
|
||||
BrowserAccessibilityManagerMac* root_manager_mac =
|
||||
@@ -247,6 +250,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -246,6 +249,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -472,7 +472,7 @@ index ce3623bd6353674fee92ba1c36eeda8da8906882..62746522bf5f398b12a8cee35f49bb4f
|
||||
|
||||
// Use native VoiceOver support for live regions.
|
||||
BrowserAccessibilityCocoa* retained_node = native_node;
|
||||
@@ -633,6 +637,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -632,6 +636,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
return window == [NSApp accessibilityFocusedWindow];
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ index ce3623bd6353674fee92ba1c36eeda8da8906882..62746522bf5f398b12a8cee35f49bb4f
|
||||
// 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
|
||||
@@ -661,6 +666,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -660,6 +665,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) {
|
||||
return true;
|
||||
}
|
||||
@@ -849,7 +849,7 @@ index 9c4e8e2536819610648aa5b3d11eaa5d2da24a9c..0b3660e51b0a15102b7b1726e17b34d5
|
||||
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
|
||||
if (io_surface) {
|
||||
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
|
||||
index b3c80d0943c7418658e0c8cbe286d994aec14a3f..08228fde75372936b6f17efad7ed23cd05eaa06b 100644
|
||||
index 90e093cd2d499ba0f37f3246bab288c758b51e19..6027134a4de53e6fe39fdbfdb67885e0b5f56e40 100644
|
||||
--- a/media/audio/BUILD.gn
|
||||
+++ b/media/audio/BUILD.gn
|
||||
@@ -199,6 +199,7 @@ source_set("audio") {
|
||||
@@ -860,10 +860,10 @@ index b3c80d0943c7418658e0c8cbe286d994aec14a3f..08228fde75372936b6f17efad7ed23cd
|
||||
}
|
||||
|
||||
if (is_ios) {
|
||||
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
index 244df26cbaecd482e812d53c96b6d63ac0a579e7..6ea4763fc7ba0d0747bd70615e076474b204853c 100644
|
||||
--- a/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
diff --git a/media/audio/apple/audio_low_latency_input.cc b/media/audio/apple/audio_low_latency_input.cc
|
||||
index 8cd474c33e514fd0aa90daf68a56ed7fc902d713..9fff9cc7b00b257c3bebb02c75a3c2e809ffdf0a 100644
|
||||
--- a/media/audio/apple/audio_low_latency_input.cc
|
||||
+++ b/media/audio/apple/audio_low_latency_input.cc
|
||||
@@ -33,19 +33,23 @@
|
||||
|
||||
namespace {
|
||||
@@ -889,7 +889,7 @@ index 244df26cbaecd482e812d53c96b6d63ac0a579e7..6ea4763fc7ba0d0747bd70615e076474
|
||||
} // namespace
|
||||
#endif
|
||||
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
||||
index e229c574bbbc7933043418c9155daf7d78e75b68..4664ab42fed9b3071696265984d6a811fd528273 100644
|
||||
index 402efe6d0d30153598649cca2c665e4b67306311..51566f515ad346d2f37ae3a0e350afc7ab4b38fa 100644
|
||||
--- a/media/audio/mac/audio_manager_mac.cc
|
||||
+++ b/media/audio/mac/audio_manager_mac.cc
|
||||
@@ -970,7 +970,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
||||
|
||||
@@ -133,10 +133,10 @@ index 38c8cf36fdf9366121c7ada96c167a4c9664952e..03b37fb62655a355e104870a088e4222
|
||||
const GURL& document_url,
|
||||
const WeakDocumentPtr& weak_document_ptr,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index b656054d342f53d655b8c068b127250a8e8af6c3..5f6267cce7c59eab684dda3f8bfc7982b6407841 100644
|
||||
index 490ed23fb4df93a7194e9bee365b73cbb4cb3109..658c01295d4674ec936c87fd45ea8c7f6ab63f56 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2045,7 +2045,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2046,7 +2046,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
@@ -145,7 +145,7 @@ index b656054d342f53d655b8c068b127250a8e8af6c3..5f6267cce7c59eab684dda3f8bfc7982
|
||||
creator_type, std::move(receiver));
|
||||
break;
|
||||
}
|
||||
@@ -2053,7 +2053,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2054,7 +2054,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
CHECK(rfh);
|
||||
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
|
||||
@@ -44,10 +44,10 @@ index 033634314d706196b5a68fc44114971d31bda3cb..1d3f8f9484f64be58f59e240b1dae1fb
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index e9ce07551ccd183cb205aedba787b3a9700e2a2b..245e7c6e3228001d17e62b8ace3647023cac9a73 100644
|
||||
index 034f1950d3eab52dd64e38cbc4afb16bdbed2558..10e4014e065738261067abc3dfff0f254a300517 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5162,6 +5162,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -5163,6 +5163,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ respond to the first mouse click in their window, which is desirable for some
|
||||
kinds of utility windows. Similarly for `disableAutoHideCursor`.
|
||||
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index 6e85ff006ca89766192812351b93eed77936be80..76959be428bd4ea2efe5e73c78b0aed77246fd96 100644
|
||||
index f62563a6f79b4f471cac4b5be57898900269661f..2cc144b6001b7862d77c0e5a4240e863aff3dd21 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -159,6 +159,15 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
|
||||
@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 5f6267cce7c59eab684dda3f8bfc7982b6407841..4551601cf77d57e74c725d4352b128c0ac8b09b7 100644
|
||||
index 658c01295d4674ec936c87fd45ea8c7f6ab63f56..2d493bac922694feaa24f7358584166d8f3f6177 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1727,9 +1727,15 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1728,9 +1728,15 @@ bool RenderProcessHostImpl::Init() {
|
||||
std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
|
||||
std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
|
||||
*cmd_line, IsPdf(), IsJitDisabled());
|
||||
|
||||
@@ -9,10 +9,10 @@ is needed for OSR.
|
||||
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index af25cd45d6f087bc6fd06916bd5c7ba4ef69ddef..57d475186f6cda633e4542646abf74f19243e6ad 100644
|
||||
index 631e941a640b035a16d8b73f881670b9d4e8a581..c6dd31fc6ef57f54dc506eaff8ec1a51049033f9 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3471,6 +3471,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3472,6 +3472,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
params.main_frame_name, GetOpener(), primary_main_frame_policy,
|
||||
base::UnguessableToken::Create());
|
||||
|
||||
@@ -26,7 +26,7 @@ index af25cd45d6f087bc6fd06916bd5c7ba4ef69ddef..57d475186f6cda633e4542646abf74f1
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3481,6 +3488,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3482,6 +3489,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ Note that we also need to manually update embedder's
|
||||
`api::WebContents::IsFullscreenForTabOrPending` value.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 0a095cfd413f8cb7f30f8b143b29e5e829898ad0..bafeeb41441d7a585bef170f81d69fe54417da63 100644
|
||||
index 90dd8dcbfa76a52cb6797074267ff457e57c03a0..53cc59c8236cfbe53214621ff64f300d0e9aadab 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -7464,6 +7464,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -7472,6 +7472,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index 0a095cfd413f8cb7f30f8b143b29e5e829898ad0..bafeeb41441d7a585bef170f81d69fe5
|
||||
if (had_fullscreen_token && !GetView()->HasFocus())
|
||||
GetView()->Focus();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 57d475186f6cda633e4542646abf74f19243e6ad..07ac28fe51c8f54d814c4c0718cf6f4705d0dbda 100644
|
||||
index c6dd31fc6ef57f54dc506eaff8ec1a51049033f9..1b1983d2ecdbd14bf4e897e43cce6f4182a842cb 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3725,21 +3725,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -3726,21 +3726,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
const NativeWebKeyboardEvent& event) {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::PreHandleKeyboardEvent");
|
||||
@@ -78,7 +78,7 @@ index 57d475186f6cda633e4542646abf74f19243e6ad..07ac28fe51c8f54d814c4c0718cf6f47
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -3875,7 +3879,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -3876,7 +3880,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
[
|
||||
{ "patch_dir": "src/electron/patches/chromium", "repo": "src" },
|
||||
{ "patch_dir": "src/electron/patches/boringssl", "repo": "src/third_party/boringssl/src" },
|
||||
{ "patch_dir": "src/electron/patches/devtools_frontend", "repo": "src/third_party/devtools-frontend/src" },
|
||||
{ "patch_dir": "src/electron/patches/ffmpeg", "repo": "src/third_party/ffmpeg" },
|
||||
{ "patch_dir": "src/electron/patches/v8", "repo": "src/v8" },
|
||||
{ "patch_dir": "src/electron/patches/node", "repo": "src/third_party/electron_node" },
|
||||
{ "patch_dir": "src/electron/patches/nan", "repo": "src/third_party/nan" },
|
||||
{ "patch_dir": "src/electron/patches/perfetto", "repo": "src/third_party/perfetto" },
|
||||
{ "patch_dir": "src/electron/patches/squirrel.mac", "repo": "src/third_party/squirrel.mac" },
|
||||
{ "patch_dir": "src/electron/patches/Mantle", "repo": "src/third_party/squirrel.mac/vendor/Mantle" },
|
||||
{ "patch_dir": "src/electron/patches/ReactiveObjC", "repo": "src/third_party/squirrel.mac/vendor/ReactiveObjC" },
|
||||
{ "patch_dir": "src/electron/patches/webrtc", "repo": "src/third_party/webrtc" },
|
||||
{ "patch_dir": "src/electron/patches/reclient-configs", "repo": "src/third_party/engflow-reclient-configs" }
|
||||
]
|
||||
{
|
||||
"src/electron/patches/chromium": "src",
|
||||
|
||||
"src/electron/patches/boringssl": "src/third_party/boringssl/src",
|
||||
|
||||
"src/electron/patches/devtools_frontend": "src/third_party/devtools-frontend/src",
|
||||
|
||||
"src/electron/patches/ffmpeg": "src/third_party/ffmpeg",
|
||||
|
||||
"src/electron/patches/v8": "src/v8",
|
||||
|
||||
"src/electron/patches/node": "src/third_party/electron_node",
|
||||
|
||||
"src/electron/patches/nan": "src/third_party/nan",
|
||||
|
||||
"src/electron/patches/perfetto": "src/third_party/perfetto",
|
||||
|
||||
"src/electron/patches/squirrel.mac": "src/third_party/squirrel.mac",
|
||||
|
||||
"src/electron/patches/Mantle": "src/third_party/squirrel.mac/vendor/Mantle",
|
||||
|
||||
"src/electron/patches/ReactiveObjC": "src/third_party/squirrel.mac/vendor/ReactiveObjC",
|
||||
|
||||
"src/electron/patches/webrtc": "src/third_party/webrtc",
|
||||
|
||||
"src/electron/patches/reclient-configs": "src/third_party/engflow-reclient-configs"
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
|
||||
patching legacy devtools code.
|
||||
|
||||
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
|
||||
index df915df956604163a9a7dda5dacb628899fe1015..1e449b06d96341ac8d1411b2760a7e2aeb087dca 100644
|
||||
index 4d51b17a1205562a799b5ac62f1f3a6a70db8455..ce4be3b83d4704e21c118a07e006c97ede8bf91e 100644
|
||||
--- a/front_end/entrypoints/main/MainImpl.ts
|
||||
+++ b/front_end/entrypoints/main/MainImpl.ts
|
||||
@@ -734,6 +734,8 @@ export class MainImpl {
|
||||
@@ -729,6 +729,8 @@ export class MainImpl {
|
||||
globalThis.Main = globalThis.Main || {};
|
||||
// @ts-ignore Exported for Tests.js
|
||||
globalThis.Main.Main = MainImpl;
|
||||
|
||||
@@ -16,7 +16,6 @@ fix_serdes_test.patch
|
||||
feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch
|
||||
feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
|
||||
support_v8_sandboxed_pointers.patch
|
||||
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
|
||||
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
|
||||
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
|
||||
fix_expose_lookupandcompile_with_parameters.patch
|
||||
@@ -27,28 +26,22 @@ test_formally_mark_some_tests_as_flaky.patch
|
||||
fix_adapt_debugger_tests_for_upstream_v8_changes.patch
|
||||
chore_remove_--no-harmony-atomics_related_code.patch
|
||||
fix_account_for_createexternalizablestring_v8_global.patch
|
||||
fix_wunreachable-code_warning_in_ares_init_rand_engine.patch
|
||||
fix_-wshadow_warning.patch
|
||||
fix_do_not_resolve_electron_entrypoints.patch
|
||||
fix_ftbfs_werror_wextra-semi.patch
|
||||
ci_ensure_node_tests_set_electron_run_as_node.patch
|
||||
fix_assert_module_in_the_renderer_process.patch
|
||||
fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch
|
||||
src_adapt_to_v8_exception_api_change.patch
|
||||
lib_test_do_not_hardcode_buffer_kmaxlength.patch
|
||||
fix_handle_possible_disabled_sharedarraybuffer.patch
|
||||
win_process_avoid_assert_after_spawning_store_app_4152.patch
|
||||
test_fix_edge_snapshot_stack_traces.patch
|
||||
chore_remove_use_of_deprecated_kmaxlength.patch
|
||||
fix_avx_detection.patch
|
||||
src_avoid_copying_string_in_fs_permission.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
|
||||
src_fix_compatility_with_upcoming_v8_12_1_apis.patch
|
||||
fix_-wshadow_error_in_uvwasi_c.patch
|
||||
src_update_default_v8_platform_to_override_functions_with_location.patch
|
||||
fix_capture_embedder_exceptions_before_entering_v8.patch
|
||||
spec_add_iterator_to_global_intrinsics.patch
|
||||
fix_undici_incorrectly_copies_headers_onto_fetches.patch
|
||||
build_do_not_rely_on_gn_helpers_in_gn_build.patch
|
||||
test_make_test-node-output-v8-warning_generic.patch
|
||||
test_match_wpt_streams_transferable_transform-stream-members_any_js.patch
|
||||
build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
|
||||
src_preload_function_for_environment.patch
|
||||
fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch
|
||||
|
||||
@@ -5,24 +5,38 @@ Subject: build: add GN build files
|
||||
|
||||
This adds GN build files for Node, so we don't have to build with GYP.
|
||||
|
||||
Note that there always GN files in upstream Node in 20/21 branches,
|
||||
however those files were cherry-picked from main branch and do not
|
||||
really in 20/21. We have to wait until 22 is released to be able to
|
||||
build with upstream GN files.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf43883207c754
|
||||
--- /dev/null
|
||||
index 1ed186b597eece7c34cb69c8e1e20870555a040d..541e7d2b8ee05677b64a3ea39c1422560fd5df75 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -0,0 +1,402 @@
|
||||
@@ -1,14 +1,404 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+import("//v8/gni/v8.gni")
|
||||
+import("//electron/js2c_toolchain.gni")
|
||||
+import("node.gni")
|
||||
+
|
||||
+import("electron_node.gni")
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+declare_args() {
|
||||
+ # Enable the V8 inspector protocol for use with node.
|
||||
+ node_enable_inspector = true
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ # Build node with SSL support.
|
||||
+ # The variable is called "openssl" for parity with node's GYP build.
|
||||
+ node_use_openssl = true
|
||||
+
|
||||
|
||||
-node_gn_build("node") {
|
||||
+ # Use the specified path to system CA (PEM format) in addition to
|
||||
+ # the BoringSSL supplied CA store or compiled-in Mozilla CA copy.
|
||||
+ node_openssl_system_ca_path = ""
|
||||
@@ -155,9 +169,12 @@ index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf4388
|
||||
+config("node_lib_config") {
|
||||
+ include_dirs = [ "src" ]
|
||||
+
|
||||
+ # FIXME(deepak1556): include paths should be corrected,
|
||||
+ # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
|
||||
+ cflags = [ "-Wno-microsoft-include" ]
|
||||
+ cflags = [
|
||||
+ "-Wno-shadow",
|
||||
+ # FIXME(deepak1556): include paths should be corrected,
|
||||
+ # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
|
||||
+ "-Wno-microsoft-include",
|
||||
+ ]
|
||||
+
|
||||
+ configs = [ ":node_features" ]
|
||||
+
|
||||
@@ -317,7 +334,6 @@ index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf4388
|
||||
+ "-Wno-unused-label",
|
||||
+ "-Wno-unused-private-field",
|
||||
+ "-Wno-unused-variable",
|
||||
+ "-Wno-shadow",
|
||||
+ ]
|
||||
+
|
||||
+ if (v8_enable_i18n_support) {
|
||||
@@ -412,188 +428,122 @@ index 0000000000000000000000000000000000000000..24c122008e0fc009833cf9189ebf4388
|
||||
+ ]
|
||||
+ cflags_cc += [ "-Wno-sign-compare" ]
|
||||
+ }
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/ada/BUILD.gn b/deps/ada/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a564653c3f05608d59fed5aa071d63b81f4e0e42
|
||||
--- /dev/null
|
||||
index e92ac3a3beac143dced2efb05304ed8ba832b067..1ce69e9deba1a9b191e8d95f4c82e0ec1f7b50ca 100644
|
||||
--- a/deps/ada/BUILD.gn
|
||||
+++ b/deps/ada/BUILD.gn
|
||||
@@ -0,0 +1,28 @@
|
||||
@@ -1,14 +1,12 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+import("//v8/gni/v8.gni")
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+config("ada_config") {
|
||||
+ include_dirs = [ "." ]
|
||||
+}
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+static_library("ada") {
|
||||
+ include_dirs = [ "." ]
|
||||
+ sources = [ "ada.cpp" ]
|
||||
+
|
||||
|
||||
-ada_gn_build("ada") {
|
||||
+ public_configs = [ ":ada_config" ]
|
||||
}
|
||||
diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni
|
||||
index 269c62d976d6adea6d020568094e23e9b0a9dc7c..14ffff0b4badb7ad71f2b6df43ad2eb300fc55ed 100644
|
||||
--- a/deps/base64/unofficial.gni
|
||||
+++ b/deps/base64/unofficial.gni
|
||||
@@ -18,6 +18,10 @@ template("base64_gn_build") {
|
||||
}
|
||||
}
|
||||
|
||||
+ # FIXME(zcbenz): ASM on win/x86 compiles perfectly in upstream Node, figure
|
||||
+ # out why it does not work in Electron's build configs.
|
||||
+ support_x86_asm = target_cpu == "x64" || (target_cpu == "x86" && !is_win)
|
||||
+
|
||||
+ defines = []
|
||||
+ deps = []
|
||||
+
|
||||
+ if (v8_enable_i18n_support) {
|
||||
+ deps += [
|
||||
+ "//third_party/icu:icui18n",
|
||||
+ "//third_party/icu:icuuc",
|
||||
+ ]
|
||||
+
|
||||
+ if (is_win) {
|
||||
+ deps += [ "//third_party/icu:icudata" ]
|
||||
+ }
|
||||
+ } else {
|
||||
+ defines += [ "ADA_HAS_ICU=0" ]
|
||||
+ }
|
||||
+}
|
||||
diff --git a/deps/base64/BUILD.gn b/deps/base64/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9b97aabe865e4cf12f6c3ccda196b372769a823b
|
||||
--- /dev/null
|
||||
+++ b/deps/base64/BUILD.gn
|
||||
@@ -0,0 +1,135 @@
|
||||
+config("base64_config") {
|
||||
+ include_dirs = [
|
||||
+ "base64/include",
|
||||
+ "base64/lib",
|
||||
+ ]
|
||||
+
|
||||
+ defines = [ "BASE64_STATIC_DEFINE" ]
|
||||
+}
|
||||
+
|
||||
+static_library("base64") {
|
||||
+ defines = []
|
||||
+ deps = [
|
||||
+ ":base64_neon32",
|
||||
+ ":base64_neon64",
|
||||
+ ":base64_avx",
|
||||
+ ":base64_avx2",
|
||||
+ ":base64_sse41",
|
||||
+ ":base64_sse42",
|
||||
+ ":base64_ssse3",
|
||||
+ ]
|
||||
+
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ cflags_c = [
|
||||
+ "-Wno-implicit-fallthrough",
|
||||
+ "-Wno-unused-but-set-variable",
|
||||
+ "-Wno-shadow",
|
||||
+ ]
|
||||
+
|
||||
+ sources = [
|
||||
+ "base64/include/libbase64.h",
|
||||
+ "base64/lib/arch/generic/codec.c",
|
||||
+ "base64/lib/codec_choose.c",
|
||||
+ "base64/lib/codecs.h",
|
||||
+ "base64/lib/lib.c",
|
||||
+ "base64/lib/tables/tables.c",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+source_set("base64_ssse3") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
|
||||
+ defines = [ "HAVE_SSSE3=1" ]
|
||||
+
|
||||
+ cflags = [ "-mssse3" ]
|
||||
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/ssse3/codec.c" ]
|
||||
+}
|
||||
+
|
||||
+source_set("base64_sse41") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
|
||||
+ defines = [ "HAVE_SSE41=1" ]
|
||||
+
|
||||
+ cflags = [ "-msse4.1" ]
|
||||
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/sse41/codec.c" ]
|
||||
+}
|
||||
+
|
||||
+
|
||||
+source_set("base64_sse42") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
|
||||
+ defines = [
|
||||
+ "BASE64_STATIC_DEFINE",
|
||||
+ "HAVE_SSE42=1",
|
||||
+ ]
|
||||
+
|
||||
+ cflags = [ "-msse4.2" ]
|
||||
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/sse42/codec.c" ]
|
||||
+}
|
||||
+
|
||||
+source_set("base64_avx") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
|
||||
+ defines = [ "HAVE_AVX=1" ]
|
||||
+
|
||||
+ cflags = [ "-mavx" ]
|
||||
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/avx/codec.c" ]
|
||||
+}
|
||||
+
|
||||
+source_set("base64_avx2") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
|
||||
+ defines = [ "HAVE_AVX2=1" ]
|
||||
+
|
||||
+ cflags = [ "-mavx2" ]
|
||||
+ cflags_c = [
|
||||
+ "-Wno-implicit-fallthrough",
|
||||
+ "-Wno-implicit-function-declaration",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/avx2/codec.c" ]
|
||||
+}
|
||||
+
|
||||
+source_set("base64_neon32") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "arm") {
|
||||
+ defines = [ "HAVE_NEON32=1" ]
|
||||
+
|
||||
+ cflags = [ "-mfpu=neon" ]
|
||||
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/neon32/codec.c" ]
|
||||
+}
|
||||
+
|
||||
+source_set("base64_neon64") {
|
||||
+ public_configs = [ ":base64_config" ]
|
||||
+
|
||||
+ if (target_cpu == "arm64") {
|
||||
+ defines = [ "HAVE_NEON64=1" ]
|
||||
+
|
||||
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [ "base64/lib/arch/neon64/codec.c" ]
|
||||
+}
|
||||
config("base64_internal_config") {
|
||||
include_dirs = [ "base64/lib" ]
|
||||
if (is_component_build) {
|
||||
@@ -25,7 +29,7 @@ template("base64_gn_build") {
|
||||
} else {
|
||||
defines = []
|
||||
}
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
defines += [
|
||||
"HAVE_SSSE3=1",
|
||||
"HAVE_SSE41=1",
|
||||
@@ -75,7 +79,7 @@ template("base64_gn_build") {
|
||||
source_set("base64_ssse3") {
|
||||
configs += [ ":base64_internal_config" ]
|
||||
sources = [ "base64/lib/arch/ssse3/codec.c" ]
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
if (is_clang || !is_win) {
|
||||
cflags_c = [ "-mssse3" ]
|
||||
}
|
||||
@@ -85,7 +89,7 @@ template("base64_gn_build") {
|
||||
source_set("base64_sse41") {
|
||||
configs += [ ":base64_internal_config" ]
|
||||
sources = [ "base64/lib/arch/sse41/codec.c" ]
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
if (is_clang || !is_win) {
|
||||
cflags_c = [ "-msse4.1" ]
|
||||
}
|
||||
@@ -95,7 +99,7 @@ template("base64_gn_build") {
|
||||
source_set("base64_sse42") {
|
||||
configs += [ ":base64_internal_config" ]
|
||||
sources = [ "base64/lib/arch/sse42/codec.c" ]
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
if (is_clang || !is_win) {
|
||||
cflags_c = [ "-msse4.2" ]
|
||||
}
|
||||
@@ -105,7 +109,7 @@ template("base64_gn_build") {
|
||||
source_set("base64_avx") {
|
||||
configs += [ ":base64_internal_config" ]
|
||||
sources = [ "base64/lib/arch/avx/codec.c" ]
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
if (is_clang || !is_win) {
|
||||
cflags_c = [ "-mavx" ]
|
||||
} else if (is_win) {
|
||||
@@ -117,7 +121,7 @@ template("base64_gn_build") {
|
||||
source_set("base64_avx2") {
|
||||
configs += [ ":base64_internal_config" ]
|
||||
sources = [ "base64/lib/arch/avx2/codec.c" ]
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
if (is_clang || !is_win) {
|
||||
cflags_c = [ "-mavx2" ]
|
||||
} else if (is_win) {
|
||||
@@ -129,7 +133,7 @@ template("base64_gn_build") {
|
||||
source_set("base64_avx512") {
|
||||
configs += [ ":base64_internal_config" ]
|
||||
sources = [ "base64/lib/arch/avx512/codec.c" ]
|
||||
- if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
+ if (support_x86_asm) {
|
||||
if (is_clang || !is_win) {
|
||||
cflags_c = [
|
||||
"-mavx512vl",
|
||||
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5a30719e4
|
||||
--- /dev/null
|
||||
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..fb1b3138cdb674205afa0ffe078270585843eca3 100644
|
||||
--- a/deps/cares/BUILD.gn
|
||||
+++ b/deps/cares/BUILD.gn
|
||||
@@ -0,0 +1,135 @@
|
||||
@@ -1,14 +1,143 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("cares_config") {
|
||||
+ include_dirs = [ "include", "src/lib" ]
|
||||
+}
|
||||
@@ -618,8 +568,26 @@ index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5
|
||||
+ "src/lib/ares__addrinfo2hostent.c",
|
||||
+ "src/lib/ares__addrinfo_localhost.c",
|
||||
+ "src/lib/ares_android.c",
|
||||
+ "src/lib/ares_cancel.c",
|
||||
+ "src/lib/ares__buf.c",
|
||||
+ "src/lib/ares__buf.h",
|
||||
+ "src/lib/ares__close_sockets.c",
|
||||
+ "src/lib/ares__htable.c",
|
||||
+ "src/lib/ares__htable.h",
|
||||
+ "src/lib/ares__htable_asvp.c",
|
||||
+ "src/lib/ares__htable_asvp.h",
|
||||
+ "src/lib/ares__htable_stvp.c",
|
||||
+ "src/lib/ares__htable_stvp.h",
|
||||
+ "src/lib/ares__llist.c",
|
||||
+ "src/lib/ares__llist.h",
|
||||
+ "src/lib/ares__get_hostent.c",
|
||||
+ "src/lib/ares__parse_into_addrinfo.c",
|
||||
+ "src/lib/ares__read_line.c",
|
||||
+ "src/lib/ares__readaddrinfo.c",
|
||||
+ "src/lib/ares__slist.c",
|
||||
+ "src/lib/ares__slist.h",
|
||||
+ "src/lib/ares__sortaddrinfo.c",
|
||||
+ "src/lib/ares__timeval.c",
|
||||
+ "src/lib/ares_cancel.c",
|
||||
+ "src/lib/ares_create_query.c",
|
||||
+ "src/lib/ares_data.c",
|
||||
+ "src/lib/ares_data.h",
|
||||
@@ -630,25 +598,22 @@ index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5
|
||||
+ "src/lib/ares_free_hostent.c",
|
||||
+ "src/lib/ares_free_string.c",
|
||||
+ "src/lib/ares_freeaddrinfo.c",
|
||||
+ "src/lib/ares_getenv.h",
|
||||
+ "src/lib/ares_getaddrinfo.c",
|
||||
+ "src/lib/ares_getenv.h",
|
||||
+ "src/lib/ares_gethostbyaddr.c",
|
||||
+ "src/lib/ares_gethostbyname.c",
|
||||
+ "src/lib/ares__get_hostent.c",
|
||||
+ "src/lib/ares_getnameinfo.c",
|
||||
+ "src/lib/ares_getsock.c",
|
||||
+ "src/lib/ares_inet_net_pton.h",
|
||||
+ "src/lib/ares_init.c",
|
||||
+ "src/lib/ares_ipv6.h",
|
||||
+ "src/lib/ares_library_init.c",
|
||||
+ "src/lib/ares_library_init.h",
|
||||
+ "src/lib/ares_llist.c",
|
||||
+ "src/lib/ares_llist.h",
|
||||
+ "src/lib/ares_mkquery.c",
|
||||
+ "src/lib/ares_nameser.h",
|
||||
+ "src/lib/ares_nowarn.c",
|
||||
+ "src/lib/ares_nowarn.h",
|
||||
+ "src/lib/ares_options.c",
|
||||
+ "src/lib/ares__parse_into_addrinfo.c",
|
||||
+ "src/lib/ares_parse_aaaa_reply.c",
|
||||
+ "src/lib/ares_parse_a_reply.c",
|
||||
+ "src/lib/ares_parse_caa_reply.c",
|
||||
@@ -665,12 +630,9 @@ index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5
|
||||
+ "src/lib/ares_process.c",
|
||||
+ "src/lib/ares_query.c",
|
||||
+ "src/lib/ares_rand.c",
|
||||
+ "src/lib/ares__read_line.c",
|
||||
+ "src/lib/ares__readaddrinfo.c",
|
||||
+ "src/lib/ares_search.c",
|
||||
+ "src/lib/ares_send.c",
|
||||
+ "src/lib/ares_setup.h",
|
||||
+ "src/lib/ares__sortaddrinfo.c",
|
||||
+ "src/lib/ares_strcasecmp.c",
|
||||
+ "src/lib/ares_strcasecmp.h",
|
||||
+ "src/lib/ares_strdup.c",
|
||||
@@ -678,15 +640,11 @@ index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5
|
||||
+ "src/lib/ares_strerror.c",
|
||||
+ "src/lib/ares_strsplit.c",
|
||||
+ "src/lib/ares_timeout.c",
|
||||
+ "src/lib/ares__timeval.c",
|
||||
+ "src/lib/ares_version.c",
|
||||
+ "src/lib/ares_writev.c",
|
||||
+ "src/lib/ares_writev.h",
|
||||
+ "src/lib/bitncmp.c",
|
||||
+ "src/lib/bitncmp.h",
|
||||
+ "src/lib/inet_net_pton.c",
|
||||
+ "src/lib/inet_ntop.c",
|
||||
+ "src/lib/ares_inet_net_pton.h",
|
||||
+ "src/lib/setup_once.h",
|
||||
+ "src/tools/ares_getopt.c",
|
||||
+ "src/tools/ares_getopt.h",
|
||||
@@ -700,7 +658,10 @@ index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5
|
||||
+ "_GNU_SOURCE",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+ if (is_win) {
|
||||
+ defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
|
||||
+ include_dirs += [ "config/win32" ]
|
||||
@@ -718,23 +679,29 @@ index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5
|
||||
+ } else {
|
||||
+ defines += [ "HAVE_CONFIG_H" ]
|
||||
+ }
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ if (is_linux) {
|
||||
+ include_dirs += [ "config/linux" ]
|
||||
+ sources += [ "config/linux/ares_config.h" ]
|
||||
+ }
|
||||
+
|
||||
|
||||
-cares_gn_build("cares") {
|
||||
+ if (is_mac) {
|
||||
+ include_dirs += [ "config/darwin" ]
|
||||
+ sources += [ "config/darwin/ares_config.h" ]
|
||||
+ }
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/googletest/BUILD.gn b/deps/googletest/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2718021c9
|
||||
--- /dev/null
|
||||
index de13f3f653b5d53610f4611001c10dce332293c2..0daf8c006cef89e76d7eccec3e924bd2718021c9 100644
|
||||
--- a/deps/googletest/BUILD.gn
|
||||
+++ b/deps/googletest/BUILD.gn
|
||||
@@ -0,0 +1,64 @@
|
||||
@@ -1,14 +1,64 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("gtest_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+ defines = [ "UNIT_TEST" ]
|
||||
@@ -747,13 +714,17 @@ index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2
|
||||
+ ]
|
||||
+
|
||||
+ public_configs = [ ":gtest_config" ]
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+ cflags_cc = [
|
||||
+ "-Wno-c++98-compat-extra-semi",
|
||||
+ "-Wno-unused-const-variable",
|
||||
+ "-Wno-unreachable-code-return",
|
||||
+ ]
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ defines = [
|
||||
+ "GTEST_HAS_POSIX_RE=0",
|
||||
+ "GTEST_LANG_CXX11=1",
|
||||
@@ -794,20 +765,28 @@ index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2
|
||||
+ "src/gtest.cc",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
|
||||
-googletest_gn_build("googletest") {
|
||||
+static_library("gtest_main") {
|
||||
+ deps = [ ":gtest" ]
|
||||
+ sources = [ "src/gtest_main.cc" ]
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/histogram/BUILD.gn b/deps/histogram/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..02bc887db7c8545e1d8adc57f73f203eec2f2592
|
||||
--- /dev/null
|
||||
index e2f3ee37137a6b7d45cbe79f8b9ba7f693ffc4d3..85467b372f01cf602af45fa2f0d599acabfc2310 100644
|
||||
--- a/deps/histogram/BUILD.gn
|
||||
+++ b/deps/histogram/BUILD.gn
|
||||
@@ -0,0 +1,19 @@
|
||||
@@ -1,14 +1,19 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("histogram_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+ cflags = [
|
||||
+ "-Wno-implicit-function-declaration",
|
||||
+ "-Wno-incompatible-pointer-types",
|
||||
@@ -815,27 +794,39 @@ index 0000000000000000000000000000000000000000..02bc887db7c8545e1d8adc57f73f203e
|
||||
+ "-Wno-atomic-alignment",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+static_library("histogram") {
|
||||
+ public_configs = [ ":histogram_config" ]
|
||||
+
|
||||
|
||||
-histogram_gn_build("histogram") {
|
||||
+ sources = [
|
||||
+ "src/hdr_histogram.c",
|
||||
+ "src/hdr_histogram.h",
|
||||
+ ]
|
||||
+}
|
||||
\ No newline at end of file
|
||||
}
|
||||
diff --git a/deps/llhttp/BUILD.gn b/deps/llhttp/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb7770d109
|
||||
--- /dev/null
|
||||
index 64a2a4799d5530276f46aa1faa63ece063390ada..fb000f8ee7647c375bc190d1729d67bb7770d109 100644
|
||||
--- a/deps/llhttp/BUILD.gn
|
||||
+++ b/deps/llhttp/BUILD.gn
|
||||
@@ -0,0 +1,15 @@
|
||||
@@ -1,14 +1,15 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
-
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
-
|
||||
-import("unofficial.gni")
|
||||
+config("llhttp_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+ cflags = [ "-Wno-unreachable-code" ]
|
||||
+}
|
||||
+
|
||||
|
||||
-llhttp_gn_build("llhttp") {
|
||||
+static_library("llhttp") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+ public_configs = [ ":llhttp_config" ]
|
||||
@@ -845,13 +836,21 @@ index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb
|
||||
+ "src/http.c",
|
||||
+ "src/llhttp.c",
|
||||
+ ]
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3124b2765
|
||||
--- /dev/null
|
||||
index 274352b0e2449f8db49d9a49c6b92a69f97e8363..7d2ca477db2415f43ababa270d8aefa3124b2765 100644
|
||||
--- a/deps/nghttp2/BUILD.gn
|
||||
+++ b/deps/nghttp2/BUILD.gn
|
||||
@@ -0,0 +1,51 @@
|
||||
@@ -1,14 +1,51 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
-
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+config("nghttp2_config") {
|
||||
+ defines = [ "NGHTTP2_STATICLIB" ]
|
||||
+ include_dirs = [ "lib/includes" ]
|
||||
@@ -865,7 +864,8 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
|
||||
+ "HAVE_CONFIG_H",
|
||||
+ ]
|
||||
+ include_dirs = [ "lib/includes" ]
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ cflags_c = [
|
||||
+ "-Wno-implicit-function-declaration",
|
||||
+ "-Wno-implicit-fallthrough",
|
||||
@@ -873,7 +873,8 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
|
||||
+ "-Wno-unreachable-code-return",
|
||||
+ "-Wno-unused-but-set-variable",
|
||||
+ ]
|
||||
+
|
||||
|
||||
-nghttp2_gn_build("nghttp2") {
|
||||
+ sources = [
|
||||
+ "lib/nghttp2_buf.c",
|
||||
+ "lib/nghttp2_callbacks.c",
|
||||
@@ -902,44 +903,81 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
|
||||
+ "lib/nghttp2_version.c",
|
||||
+ "lib/sfparse.c"
|
||||
+ ]
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/simdjson/BUILD.gn b/deps/simdjson/BUILD.gn
|
||||
index d0580ccf354d2000fb0075fd3bb4579f93477927..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
|
||||
--- a/deps/simdjson/BUILD.gn
|
||||
+++ b/deps/simdjson/BUILD.gn
|
||||
@@ -1,14 +0,0 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
-
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
-
|
||||
-import("unofficial.gni")
|
||||
-
|
||||
-simdjson_gn_build("simdjson") {
|
||||
-}
|
||||
diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..bfbd4e656db1a6c73048443f96f1d576a0df7519
|
||||
--- /dev/null
|
||||
index 119d49456911e99944294bd00b3f182a8f0e35b5..ce38c3633a228306622a7237067393d25332c59c 100644
|
||||
--- a/deps/simdutf/BUILD.gn
|
||||
+++ b/deps/simdutf/BUILD.gn
|
||||
@@ -0,0 +1,20 @@
|
||||
@@ -1,14 +1,21 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("simdutf_config") {
|
||||
+ include_dirs = [ "." ]
|
||||
+}
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+static_library("simdutf") {
|
||||
+ include_dirs = [ "." ]
|
||||
+ sources = [
|
||||
+ "simdutf.cpp",
|
||||
+ ]
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ public_configs = [ ":simdutf_config" ]
|
||||
+
|
||||
|
||||
-simdutf_gn_build("simdutf") {
|
||||
+ cflags_cc = [
|
||||
+ "-Wno-ambiguous-reversed-operator",
|
||||
+ "-Wno-c++98-compat-extra-semi",
|
||||
+ "-Wno-unreachable-code",
|
||||
+ "-Wno-unreachable-code-break",
|
||||
+ "-Wno-unused-const-variable",
|
||||
+ "-Wno-unused-function",
|
||||
+ ]
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7518168141db7958550c7f5dc1ed17ccdbbe4a60
|
||||
--- /dev/null
|
||||
index 8e6ac27048b5965e20f35c7a63e469beb6fa5970..7518168141db7958550c7f5dc1ed17ccdbbe4a60 100644
|
||||
--- a/deps/uv/BUILD.gn
|
||||
+++ b/deps/uv/BUILD.gn
|
||||
@@ -0,0 +1,194 @@
|
||||
@@ -1,14 +1,194 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("libuv_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+ defines = []
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ if (is_linux) {
|
||||
+ defines += [ "_POSIX_C_SOURCE=200112" ]
|
||||
+ }
|
||||
@@ -1053,7 +1091,8 @@ index 0000000000000000000000000000000000000000..7518168141db7958550c7f5dc1ed17cc
|
||||
+ "src/win/winsock.c",
|
||||
+ "src/win/winsock.h",
|
||||
+ ]
|
||||
+
|
||||
|
||||
-uv_gn_build("uv") {
|
||||
+ libs += [
|
||||
+ "advapi32.lib",
|
||||
+ "iphlpapi.lib",
|
||||
@@ -1128,13 +1167,17 @@ index 0000000000000000000000000000000000000000..7518168141db7958550c7f5dc1ed17cc
|
||||
+ "src/unix/kqueue.c",
|
||||
+ ]
|
||||
+ }
|
||||
+}
|
||||
}
|
||||
diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df6369a765c07
|
||||
--- /dev/null
|
||||
index 4f8fb081df805a786e523e5f0ffbb0096fdeca99..d9fcf8dc972b1caa2b7a130b1144c685316035cd 100644
|
||||
--- a/deps/uvwasi/BUILD.gn
|
||||
+++ b/deps/uvwasi/BUILD.gn
|
||||
@@ -0,0 +1,38 @@
|
||||
@@ -1,14 +1,39 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+config("uvwasi_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+}
|
||||
@@ -1154,28 +1197,44 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
|
||||
+ }
|
||||
+
|
||||
+ deps = [ "../../deps/uv" ]
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+ public_configs = [ ":uvwasi_config" ]
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+ cflags_c = []
|
||||
+ if (!is_win) {
|
||||
+ cflags_c += [ "-fvisibility=hidden" ]
|
||||
+ }
|
||||
+
|
||||
|
||||
-uvwasi_gn_build("uvwasi") {
|
||||
+ sources = [
|
||||
+ "src/clocks.c",
|
||||
+ "src/fd_table.c",
|
||||
+ "src/path_resolver.c",
|
||||
+ "src/poll_oneoff.c",
|
||||
+ "src/sync_helpers.c",
|
||||
+ "src/uv_mapping.c",
|
||||
+ "src/uvwasi.c",
|
||||
+ "src/wasi_rights.c",
|
||||
+ "src/wasi_serdes.c"
|
||||
+ ]
|
||||
}
|
||||
diff --git a/electron_node.gni b/electron_node.gni
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1c4349223
|
||||
--- /dev/null
|
||||
+++ b/electron_node.gni
|
||||
@@ -0,0 +1,4 @@
|
||||
+declare_args() {
|
||||
+ # Allows embedders to override the NODE_MODULE_VERSION define
|
||||
+ node_module_version = ""
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc556555c1e7768
|
||||
index 0000000000000000000000000000000000000000..4404338bb5d576b341cae3bf79c84334fb05654f
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,733 @@
|
||||
@@ -1191,7 +1250,6 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "lib/internal/fs/recursive_watch.js",
|
||||
+ "lib/internal/fs/rimraf.js",
|
||||
+ "lib/internal/fs/streams.js",
|
||||
+ "lib/internal/fs/sync.js",
|
||||
+ "lib/internal/fs/sync_write_stream.js",
|
||||
+ "lib/internal/fs/utils.js",
|
||||
+ "lib/internal/fs/watchers.js",
|
||||
@@ -1397,6 +1455,7 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "lib/internal/blocklist.js",
|
||||
+ "lib/internal/bootstrap/node.js",
|
||||
+ "lib/internal/bootstrap/realm.js",
|
||||
+ "lib/internal/bootstrap/shadow_realm.js",
|
||||
+ "lib/internal/bootstrap/switches/does_not_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/does_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/is_main_thread.js",
|
||||
@@ -1500,6 +1559,7 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "lib/internal/modules/helpers.js",
|
||||
+ "lib/internal/modules/package_json_reader.js",
|
||||
+ "lib/internal/modules/run_main.js",
|
||||
+ "lib/internal/navigator.js",
|
||||
+ "lib/internal/net.js",
|
||||
+ "lib/internal/options.js",
|
||||
+ "lib/internal/per_context/domexception.js",
|
||||
@@ -1548,7 +1608,6 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "lib/internal/source_map/source_map_cache.js",
|
||||
+ "lib/internal/stream_base_commons.js",
|
||||
+ "lib/internal/streams/add-abort-signal.js",
|
||||
+ "lib/internal/streams/buffer_list.js",
|
||||
+ "lib/internal/streams/compose.js",
|
||||
+ "lib/internal/streams/destroy.js",
|
||||
+ "lib/internal/streams/duplex.js",
|
||||
@@ -1565,7 +1624,6 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "lib/internal/streams/transform.js",
|
||||
+ "lib/internal/streams/utils.js",
|
||||
+ "lib/internal/streams/writable.js",
|
||||
+ "lib/internal/structured_clone.js",
|
||||
+ "lib/internal/test/binding.js",
|
||||
+ "lib/internal/test/transfer.js",
|
||||
+ "lib/internal/test_runner/coverage.js",
|
||||
@@ -1574,6 +1632,7 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "lib/internal/test_runner/mock/mock_timers.js",
|
||||
+ "lib/internal/test_runner/reporter/dot.js",
|
||||
+ "lib/internal/test_runner/reporter/junit.js",
|
||||
+ "lib/internal/test_runner/reporter/lcov.js",
|
||||
+ "lib/internal/test_runner/reporter/spec.js",
|
||||
+ "lib/internal/test_runner/reporter/tap.js",
|
||||
+ "lib/internal/test_runner/reporter/v8-serializer.js",
|
||||
@@ -1912,26 +1971,24 @@ index 0000000000000000000000000000000000000000..aa118ab320d83745723a2275efc55655
|
||||
+ "deps/postject/postject-api.h"
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/node.gni b/node.gni
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1c4349223
|
||||
--- /dev/null
|
||||
+++ b/node.gni
|
||||
@@ -0,0 +1,4 @@
|
||||
+declare_args() {
|
||||
+ # Allows embedders to override the NODE_MODULE_VERSION define
|
||||
+ node_module_version = ""
|
||||
+}
|
||||
diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868bd1321be2
|
||||
--- /dev/null
|
||||
index 909fd14345fcd988c381e640280f4b33f2e0c351..cb0e4558436ab7a109cadf439d49413b0f569a5a 100644
|
||||
--- a/src/inspector/BUILD.gn
|
||||
+++ b/src/inspector/BUILD.gn
|
||||
@@ -0,0 +1,200 @@
|
||||
@@ -1,14 +1,203 @@
|
||||
-##############################################################################
|
||||
-# #
|
||||
-# DO NOT EDIT THIS FILE! #
|
||||
-# #
|
||||
-##############################################################################
|
||||
+import("//v8/gni/v8.gni")
|
||||
+
|
||||
|
||||
-# This file is used by GN for building, which is NOT the build system used for
|
||||
-# building official binaries.
|
||||
-# Please modify the gyp files if you are making changes to build system.
|
||||
+inspector_protocol_dir = "../../tools/inspector_protocol"
|
||||
+
|
||||
|
||||
-import("unofficial.gni")
|
||||
+_protocol_generated = [
|
||||
+ "protocol/Forward.h",
|
||||
+ "protocol/Protocol.cpp",
|
||||
@@ -1943,7 +2000,8 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
|
||||
+ "protocol/NodeRuntime.cpp",
|
||||
+ "protocol/NodeRuntime.h",
|
||||
+]
|
||||
+
|
||||
|
||||
-inspector_gn_build("inspector") {
|
||||
+# These are from node_protocol_config.json
|
||||
+# These convoluted path hacks are to work around the fact that node.js is very
|
||||
+# confused about what paths are in its includes, without changing node at all.
|
||||
@@ -1990,7 +2048,10 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
|
||||
+ "../../deps/simdutf",
|
||||
+ "//third_party/icu:icuuc",
|
||||
+ ]
|
||||
+ configs += [ "../..:node_internal_config" ]
|
||||
+ configs += [
|
||||
+ "../..:node_internal_config",
|
||||
+ "../..:node_lib_config",
|
||||
+ ]
|
||||
+ public_configs = [ ":inspector_config" ]
|
||||
+}
|
||||
+
|
||||
@@ -2127,12 +2188,12 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
|
||||
+ ]
|
||||
+ script = "../../tools/compress_json.py"
|
||||
+ args = rebase_path(inputs + outputs, root_build_dir)
|
||||
+}
|
||||
}
|
||||
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
|
||||
index 84815969b6d1faa7cc3ed177e04248d9cb074596..80b36dc1aefca4d5d4124d7f84b12b9762a8de2c 100644
|
||||
index bafd8d4b8581f0aee6cb1f30b810c8dfc46c2ce9..453d874efff767a95ef25fad7005ac11717f0c67 100644
|
||||
--- a/src/node_builtins.cc
|
||||
+++ b/src/node_builtins.cc
|
||||
@@ -738,6 +738,7 @@ void BuiltinLoader::RegisterExternalReferences(
|
||||
@@ -739,6 +739,7 @@ void BuiltinLoader::RegisterExternalReferences(
|
||||
registry->Register(GetNatives);
|
||||
|
||||
RegisterExternalReferencesForInternalizedBuiltinCode(registry);
|
||||
@@ -2251,10 +2312,10 @@ index 0000000000000000000000000000000000000000..7848ddb1841b6d4f36e9376c73564eb4
|
||||
+ f.write('\n')
|
||||
diff --git a/tools/generate_original_fs.py b/tools/generate_original_fs.py
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a6cdf33f2c0bcca4d7b4eacaa407f1ac5bdcb5cb
|
||||
index 0000000000000000000000000000000000000000..98d569e6ba6d85a29a215a8f9ce3c1f6a9bd655e
|
||||
--- /dev/null
|
||||
+++ b/tools/generate_original_fs.py
|
||||
@@ -0,0 +1,19 @@
|
||||
@@ -0,0 +1,18 @@
|
||||
+import os
|
||||
+import sys
|
||||
+
|
||||
@@ -2271,9 +2332,8 @@ index 0000000000000000000000000000000000000000..a6cdf33f2c0bcca4d7b4eacaa407f1ac
|
||||
+ original_f.write(contents)
|
||||
+
|
||||
+ with open(os.path.join(out_dir, original_fs_file), 'w') as transformed_f:
|
||||
+ transformed_contents = contents.replace('internal/fs/', 'internal/original-fs/').replace('require(\'fs', 'require(\'original-fs')
|
||||
+ transformed_contents = contents.replace('internal/fs/', 'internal/original-fs/')
|
||||
+ transformed_f.write(transformed_contents)
|
||||
+
|
||||
diff --git a/tools/install.py b/tools/install.py
|
||||
index 11616e1bcac5308020eb68fdb811bfb86cb14dd5..74b01f8352021f1105c080dbbf8bb29121a13501 100755
|
||||
--- a/tools/install.py
|
||||
|
||||
171
patches/node/build_do_not_rely_on_gn_helpers_in_gn_build.patch
Normal file
171
patches/node/build_do_not_rely_on_gn_helpers_in_gn_build.patch
Normal file
@@ -0,0 +1,171 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Fri, 12 Jan 2024 08:46:57 +0900
|
||||
Subject: build: do not rely on gn_helpers in GN build
|
||||
|
||||
Backport https://github.com/nodejs/node/pull/51439
|
||||
|
||||
diff --git a/deps/ngtcp2/unofficial.gni b/deps/ngtcp2/unofficial.gni
|
||||
index a304cf4aded42d27a1656be36f2d9e1e2b1818c9..838f5d2402cfd6265f913fa1afa57c1c14ed6eca 100644
|
||||
--- a/deps/ngtcp2/unofficial.gni
|
||||
+++ b/deps/ngtcp2/unofficial.gni
|
||||
@@ -7,7 +7,7 @@
|
||||
# building official binaries.
|
||||
# Please edit the gyp files if you are making changes to build system.
|
||||
|
||||
-import("//node/node.gni")
|
||||
+import("../../node.gni")
|
||||
|
||||
# The actual configurations are put inside a template in unofficial.gni to
|
||||
# prevent accidental edits from contributors.
|
||||
diff --git a/tools/gypi_to_gn.py b/tools/gypi_to_gn.py
|
||||
index 47182d8017bfc2e4c156d43a868eaa3df15ed3e2..8a094bd7cf844f880d20a9015e76eefe350af592 100755
|
||||
--- a/tools/gypi_to_gn.py
|
||||
+++ b/tools/gypi_to_gn.py
|
||||
@@ -77,29 +77,119 @@ the input will be replaced with "bar":
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
from optparse import OptionParser
|
||||
-import os
|
||||
import sys
|
||||
|
||||
|
||||
-# Look for standalone GN distribution.
|
||||
-def FindGNPath():
|
||||
- for i in os.environ['PATH'].split(os.pathsep):
|
||||
- if i.rstrip(os.sep).endswith('gn'):
|
||||
- return i
|
||||
- return None
|
||||
+# This function is copied from build/gn_helpers.py in Chromium.
|
||||
+def ToGNString(value, pretty=False):
|
||||
+ """Returns a stringified GN equivalent of a Python value.
|
||||
|
||||
+ Args:
|
||||
+ value: The Python value to convert.
|
||||
+ pretty: Whether to pretty print. If true, then non-empty lists are rendered
|
||||
+ recursively with one item per line, with indents. Otherwise lists are
|
||||
+ rendered without new line.
|
||||
+ Returns:
|
||||
+ The stringified GN equivalent to |value|.
|
||||
|
||||
-try:
|
||||
- # May already be in the import path.
|
||||
- import gn_helpers
|
||||
-except ImportError:
|
||||
- # Add src/build to import path.
|
||||
- src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
|
||||
- os.pardir, os.pardir))
|
||||
- sys.path.append(os.path.join(src_dir, 'build'))
|
||||
- if FindGNPath():
|
||||
- sys.path.append(os.path.join(FindGNPath(), 'build'))
|
||||
- import gn_helpers
|
||||
+ Raises:
|
||||
+ ValueError: |value| cannot be printed to GN.
|
||||
+ """
|
||||
+
|
||||
+ # Emits all output tokens without intervening whitespaces.
|
||||
+ def GenerateTokens(v, level):
|
||||
+ if isinstance(v, str):
|
||||
+ yield '"' + ''.join(TranslateToGnChars(v)) + '"'
|
||||
+
|
||||
+ elif isinstance(v, bool):
|
||||
+ yield 'true' if v else 'false'
|
||||
+
|
||||
+ elif isinstance(v, int):
|
||||
+ yield str(v)
|
||||
+
|
||||
+ elif isinstance(v, list):
|
||||
+ yield '['
|
||||
+ for i, item in enumerate(v):
|
||||
+ if i > 0:
|
||||
+ yield ','
|
||||
+ for tok in GenerateTokens(item, level + 1):
|
||||
+ yield tok
|
||||
+ yield ']'
|
||||
+
|
||||
+ elif isinstance(v, dict):
|
||||
+ if level > 0:
|
||||
+ yield '{'
|
||||
+ for key in sorted(v):
|
||||
+ if not isinstance(key, str):
|
||||
+ raise ValueError('Dictionary key is not a string.')
|
||||
+ if not key or key[0].isdigit() or not key.replace('_', '').isalnum():
|
||||
+ raise ValueError('Dictionary key is not a valid GN identifier.')
|
||||
+ yield key # No quotations.
|
||||
+ yield '='
|
||||
+ for tok in GenerateTokens(v[key], level + 1):
|
||||
+ yield tok
|
||||
+ if level > 0:
|
||||
+ yield '}'
|
||||
+
|
||||
+ else: # Not supporting float: Add only when needed.
|
||||
+ raise ValueError('Unsupported type when printing to GN.')
|
||||
+
|
||||
+ can_start = lambda tok: tok and tok not in ',}]='
|
||||
+ can_end = lambda tok: tok and tok not in ',{[='
|
||||
+
|
||||
+ # Adds whitespaces, trying to keep everything (except dicts) in 1 line.
|
||||
+ def PlainGlue(gen):
|
||||
+ prev_tok = None
|
||||
+ for i, tok in enumerate(gen):
|
||||
+ if i > 0:
|
||||
+ if can_end(prev_tok) and can_start(tok):
|
||||
+ yield '\n' # New dict item.
|
||||
+ elif prev_tok == '[' and tok == ']':
|
||||
+ yield ' ' # Special case for [].
|
||||
+ elif tok != ',':
|
||||
+ yield ' '
|
||||
+ yield tok
|
||||
+ prev_tok = tok
|
||||
+
|
||||
+ # Adds whitespaces so non-empty lists can span multiple lines, with indent.
|
||||
+ def PrettyGlue(gen):
|
||||
+ prev_tok = None
|
||||
+ level = 0
|
||||
+ for i, tok in enumerate(gen):
|
||||
+ if i > 0:
|
||||
+ if can_end(prev_tok) and can_start(tok):
|
||||
+ yield '\n' + ' ' * level # New dict item.
|
||||
+ elif tok == '=' or prev_tok in '=':
|
||||
+ yield ' ' # Separator before and after '=', on same line.
|
||||
+ if tok in ']}':
|
||||
+ level -= 1
|
||||
+ # Exclude '[]' and '{}' cases.
|
||||
+ if int(prev_tok == '[') + int(tok == ']') == 1 or \
|
||||
+ int(prev_tok == '{') + int(tok == '}') == 1:
|
||||
+ yield '\n' + ' ' * level
|
||||
+ yield tok
|
||||
+ if tok in '[{':
|
||||
+ level += 1
|
||||
+ if tok == ',':
|
||||
+ yield '\n' + ' ' * level
|
||||
+ prev_tok = tok
|
||||
+
|
||||
+ token_gen = GenerateTokens(value, 0)
|
||||
+ ret = ''.join((PrettyGlue if pretty else PlainGlue)(token_gen))
|
||||
+ # Add terminating '\n' for dict |value| or multi-line output.
|
||||
+ if isinstance(value, dict) or '\n' in ret:
|
||||
+ return ret + '\n'
|
||||
+ return ret
|
||||
+
|
||||
+
|
||||
+def TranslateToGnChars(s):
|
||||
+ for code in s.encode('utf-8'):
|
||||
+ if code in (34, 36, 92): # For '"', '$', or '\\'.
|
||||
+ yield '\\' + chr(code)
|
||||
+ elif 32 <= code < 127:
|
||||
+ yield chr(code)
|
||||
+ else:
|
||||
+ yield '$0x%02X' % code
|
||||
|
||||
|
||||
def LoadPythonDictionary(path):
|
||||
@@ -209,7 +299,7 @@ def main():
|
||||
else:
|
||||
gn_dict[gn_key] = data[key]
|
||||
|
||||
- print(gn_helpers.ToGNString(DeduplicateLists(gn_dict)))
|
||||
+ print(ToGNString(DeduplicateLists(gn_dict)))
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
@@ -7,27 +7,27 @@ Subject: build: ensure native module compilation fails if not using a new
|
||||
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index a04a4a4e108862b64725345beaba73ad6f69eb51..f1c36cfd697485564f0fe7998eaf924aa30f140b 100644
|
||||
index f52d4f805406c513904151be90e433948764b3ad..7b790060b03cceec62bfe4c1f12d396b9cf52e8c 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -79,6 +79,8 @@
|
||||
# TODO(refack): make v8-perfetto happen
|
||||
@@ -86,6 +86,8 @@
|
||||
'v8_use_perfetto': 0,
|
||||
'tsan%': 0,
|
||||
|
||||
+ 'using_electron_config_gypi%': 0,
|
||||
+
|
||||
##### end V8 defaults #####
|
||||
|
||||
# When building native modules using 'npm install' with the system npm,
|
||||
@@ -282,6 +284,7 @@
|
||||
'V8_DEPRECATION_WARNINGS',
|
||||
'V8_IMMINENT_DEPRECATION_WARNINGS',
|
||||
@@ -285,6 +287,7 @@
|
||||
# Defines these mostly for node-gyp to pickup.
|
||||
'defines': [
|
||||
'_GLIBCXX_USE_CXX11_ABI=1',
|
||||
+ 'ELECTRON_ENSURE_CONFIG_GYPI',
|
||||
],
|
||||
|
||||
# Forcibly disable -Werror. We support a wide range of compilers, it's
|
||||
@@ -388,6 +391,11 @@
|
||||
@@ -391,6 +394,11 @@
|
||||
}],
|
||||
],
|
||||
}],
|
||||
@@ -36,14 +36,14 @@ index a04a4a4e108862b64725345beaba73ad6f69eb51..f1c36cfd697485564f0fe7998eaf924a
|
||||
+ 'USING_ELECTRON_CONFIG_GYPI',
|
||||
+ ],
|
||||
+ }],
|
||||
['v8_enable_pointer_compression == 1', {
|
||||
'defines': [
|
||||
'V8_COMPRESS_POINTERS',
|
||||
# The defines bellow must include all things from the external_v8_defines
|
||||
# list in v8/BUILD.gn.
|
||||
['v8_enable_v8_checks == 1', {
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 7b80ec63a082ce93ba81ca6dd41ec03041534ff7..926659883d3bd6d447c89a50d6770988b59d6f88 100755
|
||||
index 84b016cd853080656d4dcf982e64855fcfa72a55..f0cccff0eed2ef11275d2f7ec2358276f6e10458 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1484,6 +1484,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
@@ -1489,6 +1489,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
|
||||
|
||||
def configure_v8(o):
|
||||
@@ -52,7 +52,7 @@ index 7b80ec63a082ce93ba81ca6dd41ec03041534ff7..926659883d3bd6d447c89a50d6770988
|
||||
o['variables']['v8_enable_javascript_promise_hooks'] = 1
|
||||
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 99d2e1384df4000d4e1f1ffeafa83d29a152054b..9ac0d5addcdd40d5c91d375b626099b95729548a 100644
|
||||
index 868366f6d3e35d0fe543c89efd7d5e313a831a96..a512d2228e0afcfff765c3fe845e1f22073047d0 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -22,6 +22,12 @@
|
||||
|
||||
@@ -1,55 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@salesforce.com>
|
||||
Date: Thu, 7 Jul 2022 14:42:49 -0700
|
||||
Subject: build: ensure v8 pointer compression + sandbox is enabled on 64bit
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 17 Jan 2024 16:01:08 +0100
|
||||
Subject: build: ensure v8_pointer_compression_sandbox is enabled on 64bit
|
||||
|
||||
Aligns common.gypi with the current build flag state of //v8.
|
||||
The defines themselves were upstreamed in https://github.com/nodejs/node/pull/50820
|
||||
but the ability to configure the variables themselves were not. This adds that back
|
||||
in.
|
||||
|
||||
Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 0b073571cd482d5124123c4490c564f839429b28..a04a4a4e108862b64725345beaba73ad6f69eb51 100644
|
||||
index 7b790060b03cceec62bfe4c1f12d396b9cf52e8c..ef8c7a0477aa9c92439846699e739eae4340b88c 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -65,6 +65,7 @@
|
||||
# node-gyp to build addons.
|
||||
'v8_enable_pointer_compression%': 0,
|
||||
'v8_enable_31bit_smis_on_64bit_arch%': 0,
|
||||
+ 'v8_enable_sandbox%': 0,
|
||||
|
||||
# Disable v8 hugepage by default.
|
||||
'v8_enable_hugepage%': 0,
|
||||
@@ -123,6 +124,7 @@
|
||||
@@ -133,6 +133,7 @@
|
||||
['target_arch in "arm ia32 mips mipsel ppc"', {
|
||||
'v8_enable_pointer_compression': 0,
|
||||
'v8_enable_31bit_smis_on_64bit_arch': 0,
|
||||
+ 'v8_enable_sandbox': 0,
|
||||
+ 'v8_enable_sandbox': 0
|
||||
}],
|
||||
['target_arch in "ppc64 s390x"', {
|
||||
'v8_enable_backtrace': 1,
|
||||
@@ -389,9 +391,12 @@
|
||||
['v8_enable_pointer_compression == 1', {
|
||||
'defines': [
|
||||
'V8_COMPRESS_POINTERS',
|
||||
- 'V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE',
|
||||
+ 'V8_COMPRESS_POINTERS_IN_SHARED_CAGE',
|
||||
],
|
||||
}],
|
||||
+ ['v8_enable_sandbox == 1', {
|
||||
+ 'defines': ['V8_ENABLE_SANDBOX']
|
||||
+ }],
|
||||
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
|
||||
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
|
||||
}],
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 62f041ce52bf85136175e733216671e2811a337b..7b80ec63a082ce93ba81ca6dd41ec03041534ff7 100755
|
||||
index f0cccff0eed2ef11275d2f7ec2358276f6e10458..87b647ab363219add8201966a64b539215bdee03 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1497,6 +1497,7 @@ def configure_v8(o):
|
||||
@@ -1503,6 +1503,7 @@ def configure_v8(o):
|
||||
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
|
||||
o['variables']['v8_enable_maglev'] = 1 if options.v8_enable_maglev else 0
|
||||
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
|
||||
+ o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression or options.disable_shared_ro_heap else 1
|
||||
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
|
||||
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
|
||||
o['variables']['v8_enable_extensible_ro_snapshot'] = 0
|
||||
|
||||
@@ -34,7 +34,7 @@ index 99212fa713bf3f767d4604906e41d9b279447239..4e32a274a63c8244ce3168d0c5cc5620
|
||||
let kResistStopPropagation;
|
||||
|
||||
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
|
||||
index 80b36dc1aefca4d5d4124d7f84b12b9762a8de2c..f3cda64beaa1403cb33f1b0bd8089f3dfcbfc8b9 100644
|
||||
index 453d874efff767a95ef25fad7005ac11717f0c67..bcef04f980d1b1f010c5349ecbfca8080f39b308 100644
|
||||
--- a/src/node_builtins.cc
|
||||
+++ b/src/node_builtins.cc
|
||||
@@ -35,6 +35,7 @@ using v8::Value;
|
||||
|
||||
@@ -18,10 +18,10 @@ See https://gist.github.com/codebytere/275ec8923253fd6559b3d36115f7b31b for more
|
||||
This should be fixed and re-enabled on all platforms.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index 24c122008e0fc009833cf9189ebf43883207c754..1f0263b06969e099a5b3aaf09d36a66c43dd80fc 100644
|
||||
index 541e7d2b8ee05677b64a3ea39c1422560fd5df75..8d63fea3304b36654992fe718ceeb3931ef86d39 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -178,6 +178,10 @@ config("node_internal_config") {
|
||||
@@ -181,6 +181,10 @@ config("node_internal_config") {
|
||||
}
|
||||
defines += [ "NODE_ARCH=\"$node_arch\"" ]
|
||||
|
||||
@@ -33,10 +33,10 @@ index 24c122008e0fc009833cf9189ebf43883207c754..1f0263b06969e099a5b3aaf09d36a66c
|
||||
node_platform = "win32"
|
||||
} else if (target_os == "mac") {
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index 1d8df40c3446ac9c72c5f0ad24edf0b8a96cf16b..25b81dee18aeeb1bd0452ba0b66085d451723709 100644
|
||||
index a429d5526d0af66eef94132b196e42994e3f6448..ba575a04340b91709fb6c8710ab160a4ca1f8b77 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -542,7 +542,8 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
@@ -546,7 +546,8 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
// for embedder ID, V8 could accidentally enable cppgc on them. So
|
||||
// safe guard against this.
|
||||
DCHECK_NE(descriptor.wrappable_type_index, BaseObject::kSlot);
|
||||
@@ -46,7 +46,7 @@ index 1d8df40c3446ac9c72c5f0ad24edf0b8a96cf16b..25b81dee18aeeb1bd0452ba0b66085d4
|
||||
cpp_heap_ = CppHeap::Create(
|
||||
platform,
|
||||
CppHeapCreateParams{
|
||||
@@ -550,6 +551,7 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
@@ -554,6 +555,7 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
WrapperDescriptor(
|
||||
BaseObject::kEmbedderType, BaseObject::kSlot, cppgc_id)});
|
||||
isolate->AttachCppHeap(cpp_heap_.get());
|
||||
|
||||
@@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
|
||||
of this.
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 84fea979d482d3d5cacfad4b09237e6345675cad..678ed0a7b43c30c5dd6102d83f490e23c95090ce 100644
|
||||
index 1f3b719048f2477de183e2856b9b8eee8502f708..21116088c101f4679b5a5f41762ce710368e69ed 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1215,6 +1215,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -1351,6 +1351,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (getOptionValue('--inspect-brk') && process._eval == null) {
|
||||
if (!resolvedArgv) {
|
||||
// We enter the repl if we're not given a filename argument.
|
||||
@@ -26,22 +26,24 @@ index 84fea979d482d3d5cacfad4b09237e6345675cad..678ed0a7b43c30c5dd6102d83f490e23
|
||||
try {
|
||||
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
|
||||
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
|
||||
index 1f4a08515b5ae9e15ee987d9287f71b0fed3cb30..cbb89d76621de6a85b8e8697078d74c6bde0a742 100644
|
||||
index 9142fed75e9050fcc17c01208e82f1bc57923fcd..157a85623c7eb5338baa77aba5dc448a4614ded0 100644
|
||||
--- a/lib/internal/process/pre_execution.js
|
||||
+++ b/lib/internal/process/pre_execution.js
|
||||
@@ -197,11 +197,13 @@ function patchProcessObject(expandArgv1) {
|
||||
@@ -232,12 +232,14 @@ function patchProcessObject(expandArgv1) {
|
||||
if (expandArgv1 && process.argv[1] &&
|
||||
!StringPrototypeStartsWith(process.argv[1], '-')) {
|
||||
// Expand process.argv[1] into a full path.
|
||||
- const path = require('path');
|
||||
- try {
|
||||
- process.argv[1] = path.resolve(process.argv[1]);
|
||||
- mainEntry = path.resolve(process.argv[1]);
|
||||
- process.argv[1] = mainEntry;
|
||||
- } catch {
|
||||
- // Continue regardless of error.
|
||||
+ if (!process.argv[1] || !process.argv[1].startsWith('electron/js2c')) {
|
||||
+ const path = require('path');
|
||||
+ try {
|
||||
+ process.argv[1] = path.resolve(process.argv[1]);
|
||||
+ mainEntry = path.resolve(process.argv[1]);
|
||||
+ process.argv[1] = mainEntry;
|
||||
+ } catch {
|
||||
+ // Continue regardless of error.
|
||||
+ }
|
||||
|
||||
@@ -11,10 +11,10 @@ its own blended handler between Node and Blink.
|
||||
Not upstreamable.
|
||||
|
||||
diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js
|
||||
index 985784383024450833a8324d45a7af2fe214a09c..356c10aef57454be3b4607156606784f473042cf 100644
|
||||
index 003ae7eb987f03611444f02695bc8582e0ac6a67..bbf1df480bc6ec90ee3ac29312dc89ff8bf94ab3 100644
|
||||
--- a/lib/internal/modules/esm/utils.js
|
||||
+++ b/lib/internal/modules/esm/utils.js
|
||||
@@ -16,7 +16,7 @@ const {
|
||||
@@ -23,7 +23,7 @@ const {
|
||||
ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING,
|
||||
ERR_INVALID_ARG_VALUE,
|
||||
} = require('internal/errors').codes;
|
||||
@@ -23,14 +23,14 @@ index 985784383024450833a8324d45a7af2fe214a09c..356c10aef57454be3b4607156606784f
|
||||
const {
|
||||
loadPreloadModules,
|
||||
initializeFrozenIntrinsics,
|
||||
@@ -148,12 +148,13 @@ async function importModuleDynamicallyCallback(symbol, specifier, assertions) {
|
||||
// the loader worker in internal/main/worker_thread.js.
|
||||
let _isLoaderWorker = false;
|
||||
function initializeESM(isLoaderWorker = false) {
|
||||
@@ -221,12 +221,13 @@ let _forceDefaultLoader = false;
|
||||
* @param {boolean} [forceDefaultLoader=false] - A boolean indicating disabling custom loaders.
|
||||
*/
|
||||
function initializeESM(forceDefaultLoader = false) {
|
||||
+ const shouldSetOnIsolate = !getEmbedderOptions().shouldNotRegisterESMLoader;
|
||||
_isLoaderWorker = isLoaderWorker;
|
||||
_forceDefaultLoader = forceDefaultLoader;
|
||||
initializeDefaultConditions();
|
||||
// Setup per-isolate callbacks that locate data or callbacks that we keep
|
||||
// Setup per-realm callbacks that locate data or callbacks that we keep
|
||||
// track of for different ESM modules.
|
||||
- setInitializeImportMetaObjectCallback(initializeImportMetaObject);
|
||||
- setImportModuleDynamicallyCallback(importModuleDynamicallyCallback);
|
||||
@@ -38,12 +38,12 @@ index 985784383024450833a8324d45a7af2fe214a09c..356c10aef57454be3b4607156606784f
|
||||
+ setImportModuleDynamicallyCallback(importModuleDynamicallyCallback, shouldSetOnIsolate);
|
||||
}
|
||||
|
||||
function isLoaderWorker() {
|
||||
/**
|
||||
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
|
||||
index a1b0f812391486c5a429398326091a30bbe81692..a316d077f2d2ff38564959345cf8ef29a3ac678f 100644
|
||||
index 895ff3a5948add3513700ecc2f32fce4c2fbe4eb..3182a5e4aad2ba0be2b6769edb696b815ce39a61 100644
|
||||
--- a/src/module_wrap.cc
|
||||
+++ b/src/module_wrap.cc
|
||||
@@ -547,7 +547,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
|
||||
@@ -554,7 +554,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
|
||||
return module->module_.Get(isolate);
|
||||
}
|
||||
|
||||
@@ -52,15 +52,15 @@ index a1b0f812391486c5a429398326091a30bbe81692..a316d077f2d2ff38564959345cf8ef29
|
||||
Local<Context> context,
|
||||
Local<v8::Data> host_defined_options,
|
||||
Local<Value> resource_name,
|
||||
@@ -610,12 +610,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
@@ -618,12 +618,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
|
||||
Realm* realm = Realm::GetCurrent(args);
|
||||
HandleScope handle_scope(isolate);
|
||||
|
||||
- CHECK_EQ(args.Length(), 1);
|
||||
+ CHECK_EQ(args.Length(), 2);
|
||||
CHECK(args[0]->IsFunction());
|
||||
Local<Function> import_callback = args[0].As<Function>();
|
||||
env->set_host_import_module_dynamically_callback(import_callback);
|
||||
realm->set_host_import_module_dynamically_callback(import_callback);
|
||||
|
||||
- isolate->SetHostImportModuleDynamicallyCallback(ImportModuleDynamically);
|
||||
+ if (args[1]->IsBoolean() && args[1]->BooleanValue(isolate))
|
||||
@@ -68,15 +68,15 @@ index a1b0f812391486c5a429398326091a30bbe81692..a316d077f2d2ff38564959345cf8ef29
|
||||
}
|
||||
|
||||
void ModuleWrap::HostInitializeImportMetaObjectCallback(
|
||||
@@ -652,13 +653,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
Isolate* isolate = env->isolate();
|
||||
@@ -665,13 +666,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
|
||||
Realm* realm = Realm::GetCurrent(args);
|
||||
Isolate* isolate = realm->isolate();
|
||||
|
||||
- CHECK_EQ(args.Length(), 1);
|
||||
+ CHECK_EQ(args.Length(), 2);
|
||||
CHECK(args[0]->IsFunction());
|
||||
Local<Function> import_meta_callback = args[0].As<Function>();
|
||||
env->set_host_initialize_import_meta_object_callback(import_meta_callback);
|
||||
realm->set_host_initialize_import_meta_object_callback(import_meta_callback);
|
||||
|
||||
- isolate->SetHostInitializeImportMetaObjectCallback(
|
||||
- HostInitializeImportMetaObjectCallback);
|
||||
@@ -87,10 +87,10 @@ index a1b0f812391486c5a429398326091a30bbe81692..a316d077f2d2ff38564959345cf8ef29
|
||||
|
||||
MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
|
||||
diff --git a/src/module_wrap.h b/src/module_wrap.h
|
||||
index 6435bad40936fe235822c0597310b94ab98082f3..8f30f546cc47bdb402ef4b1217d7bbb675a85ef7 100644
|
||||
index e17048357feca2419087621ed280de30882a90bc..061117dc3182d63e35d7e99ffd95801f96356322 100644
|
||||
--- a/src/module_wrap.h
|
||||
+++ b/src/module_wrap.h
|
||||
@@ -30,7 +30,14 @@ enum HostDefinedOptions : int {
|
||||
@@ -31,7 +31,14 @@ enum HostDefinedOptions : int {
|
||||
kLength = 9,
|
||||
};
|
||||
|
||||
@@ -106,18 +106,18 @@ index 6435bad40936fe235822c0597310b94ab98082f3..8f30f546cc47bdb402ef4b1217d7bbb6
|
||||
public:
|
||||
enum InternalFields {
|
||||
kModuleSlot = BaseObject::kInternalFieldCount,
|
||||
@@ -65,6 +72,8 @@ class ModuleWrap : public BaseObject {
|
||||
@@ -68,6 +75,8 @@ class ModuleWrap : public BaseObject {
|
||||
return true;
|
||||
}
|
||||
|
||||
+ static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>);
|
||||
+
|
||||
private:
|
||||
ModuleWrap(Environment* env,
|
||||
ModuleWrap(Realm* realm,
|
||||
v8::Local<v8::Object> object,
|
||||
@@ -99,7 +108,6 @@ class ModuleWrap : public BaseObject {
|
||||
@@ -102,7 +111,6 @@ class ModuleWrap : public BaseObject {
|
||||
v8::Local<v8::String> specifier,
|
||||
v8::Local<v8::FixedArray> import_assertions,
|
||||
v8::Local<v8::FixedArray> import_attributes,
|
||||
v8::Local<v8::Module> referrer);
|
||||
- static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ This patch can be removed when Node.js upgrades to a version of V8 containing
|
||||
the above CL.
|
||||
|
||||
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
|
||||
index 942d7cc1305eb4cf327de5666551435802f0dbac..991c65215488b9526758b9aca96842ad17fc018e 100644
|
||||
index fbaf641789e8dc2b1ba991ad7ee755271e756ee1..53bc3ce5e144f5988a9164c41e6bbc6cc44582d2 100644
|
||||
--- a/lib/.eslintrc.yaml
|
||||
+++ b/lib/.eslintrc.yaml
|
||||
@@ -33,10 +33,6 @@ rules:
|
||||
@@ -24,7 +24,7 @@ index 942d7cc1305eb4cf327de5666551435802f0dbac..991c65215488b9526758b9aca96842ad
|
||||
message: Use `const { Blob } = require('buffer');` instead of the global.
|
||||
- name: BroadcastChannel
|
||||
diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js
|
||||
index 12ae4a9b23212d3f8ff1566a1c2b815a47d3838a..4460042d7bfbb8286a9b2abcbfb9e44f21b5d944 100644
|
||||
index 56697c3b2c2209ff58b8fefbccec03c7e3d9f9a0..4eb7230edcd0fb3d21e80218f6a912eb308fc89d 100644
|
||||
--- a/lib/internal/main/worker_thread.js
|
||||
+++ b/lib/internal/main/worker_thread.js
|
||||
@@ -112,7 +112,7 @@ port.on('message', (message) => {
|
||||
|
||||
@@ -21,10 +21,10 @@ index 606a6f5caa3b11b6d2a9068ed2fd65800530a5eb..080dcce21da05ccea398d8a856deb397
|
||||
typedef void (*FreeCallback)(char* data, void* hint);
|
||||
|
||||
diff --git a/src/node_errors.h b/src/node_errors.h
|
||||
index 569dafe82df83db02d93b0e58231ef804eb54be8..c6b8c3b5b36ea25a31bdf3c6a48ef20f3c1b6577 100644
|
||||
index 8591faab8eaf6f0e6c745e2a6e9f60a468c3efcc..32efaf5148bd6620210c58a95ef3c53bc57a4ea1 100644
|
||||
--- a/src/node_errors.h
|
||||
+++ b/src/node_errors.h
|
||||
@@ -218,7 +218,7 @@ inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
|
||||
@@ -222,7 +222,7 @@ inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
|
||||
char message[128];
|
||||
snprintf(message, sizeof(message),
|
||||
"Cannot create a Buffer larger than 0x%zx bytes",
|
||||
|
||||
@@ -8,10 +8,10 @@ which causes the `ELECTRON_RUN_AS_NODE` variable to be lost. This patch
|
||||
re-injects it.
|
||||
|
||||
diff --git a/test/common/assertSnapshot.js b/test/common/assertSnapshot.js
|
||||
index 0bd0fc18534f8b3106b79a010dfc4ffe0ab17ec3..838ee86f74ea89e052676a5c25e23481369857fa 100644
|
||||
index 88f40281e069b77ac071ac872c4491f749b64e21..0fa102da111fa370406ca74069316fa7a7a3a050 100644
|
||||
--- a/test/common/assertSnapshot.js
|
||||
+++ b/test/common/assertSnapshot.js
|
||||
@@ -76,6 +76,7 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
|
||||
@@ -80,6 +80,7 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
|
||||
const flags = common.parseTestFlags(filename);
|
||||
const executable = tty ? 'tools/pseudo-tty.py' : process.execPath;
|
||||
const args = tty ? [process.execPath, ...flags, filename] : [...flags, filename];
|
||||
@@ -47,10 +47,31 @@ index 5a1b9feb6c8bedb50b89f5c4f3c5983455bb042d..efca7811dc0b6a590c5ee023c7180170
|
||||
});
|
||||
}
|
||||
diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs
|
||||
index 4c4fc08c0cf3828d11aefe9f12318001bf10c16d..b08bcd40cdf26093e158c0bb9ae566c76f2c731e 100644
|
||||
index c0acee2bfc8c124e9d9b254041589a49c8301b8f..0e266899ffc0918b2f94e8f636043a6ec5f0870f 100644
|
||||
--- a/test/parallel/test-node-output-errors.mjs
|
||||
+++ b/test/parallel/test-node-output-errors.mjs
|
||||
@@ -61,6 +61,7 @@ describe('errors output', { concurrency: true }, () => {
|
||||
@@ -61,21 +61,22 @@ describe('errors output', { concurrency: true }, () => {
|
||||
{ name: 'errors/events_unhandled_error_subclass.js', transform: errTransform },
|
||||
{ name: 'errors/if-error-has-good-stack.js', transform: errTransform },
|
||||
{ name: 'errors/throw_custom_error.js', transform: errTransform },
|
||||
- { name: 'errors/throw_error_with_getter_throw.js', transform: errTransform },
|
||||
+ // { name: 'errors/throw_error_with_getter_throw.js', transform: errTransform },
|
||||
{ name: 'errors/throw_in_line_with_tabs.js', transform: errTransform },
|
||||
{ name: 'errors/throw_non_error.js', transform: errTransform },
|
||||
- { name: 'errors/throw_null.js', transform: errTransform },
|
||||
- { name: 'errors/throw_undefined.js', transform: errTransform },
|
||||
+ // { name: 'errors/throw_null.js', transform: errTransform },
|
||||
+ // { name: 'errors/throw_undefined.js', transform: errTransform },
|
||||
{ name: 'errors/timeout_throw.js', transform: errTransform },
|
||||
{ name: 'errors/undefined_reference_in_new_context.js', transform: errTransform },
|
||||
{ name: 'errors/promise_always_throw_unhandled.js', transform: promiseTransform },
|
||||
- { name: 'errors/promise_unhandled_warn_with_error.js', transform: promiseTransform },
|
||||
+ // { name: 'errors/promise_unhandled_warn_with_error.js', transform: promiseTransform },
|
||||
{ name: 'errors/unhandled_promise_trace_warnings.js', transform: promiseTransform },
|
||||
- { skip: skipForceColors, name: 'errors/force_colors.js',
|
||||
- transform: forceColorsTransform, env: { FORCE_COLOR: 1 } },
|
||||
+ // { skip: skipForceColors, name: 'errors/force_colors.js',
|
||||
+ // transform: forceColorsTransform, env: { FORCE_COLOR: 1 } },
|
||||
];
|
||||
for (const { name, transform = defaultTransform, env, skip = false } of tests) {
|
||||
it(name, { skip }, async () => {
|
||||
|
||||
@@ -24,10 +24,10 @@ index 97257d47c6173872e55facf6f92801bd2fc3564b..8cdee730101fbdc79415654aa6fe4015
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
|
||||
diff --git a/src/node_binding.h b/src/node_binding.h
|
||||
index 9f0692ca4e190bde251d4825aa9abac3d66b6ac6..f4024a05901f72f85e097a8ab6ddbd5812e9ba16 100644
|
||||
index 7256bf2bbcf73214a25e61156305cc212b6f2451..d129981ad8588376eeee61155964062f624695d6 100644
|
||||
--- a/src/node_binding.h
|
||||
+++ b/src/node_binding.h
|
||||
@@ -134,6 +134,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
@@ -137,6 +137,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Subject: feat: add kNoStartDebugSignalHandler to Environment to prevent
|
||||
This patch should be upstreamed, it allows embedders to prevent the call to StartDebugSignalHandler which handles SIGUSR1 and starts the inspector agent. Apps that have --inspect disabled also don't want SIGUSR1 to have this affect.
|
||||
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index 793dc72e0dbad819a1c3a51521b4a39b76c7015d..222c78ef0cb9904742fd44f8182278ab1f50cd59 100644
|
||||
index d5124e73e7c4c6b631ccfedf407e02bc444b428f..564de2990c09a54693686666f9ad66398ff76ab5 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -677,6 +677,10 @@ inline bool Environment::no_global_search_paths() const {
|
||||
@@ -22,7 +22,7 @@ index 793dc72e0dbad819a1c3a51521b4a39b76c7015d..222c78ef0cb9904742fd44f8182278ab
|
||||
// configure --no-browser-globals
|
||||
#ifdef NODE_NO_BROWSER_GLOBALS
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index afe67d2237ae6933de44dd1141cf388e9a48cee3..87df6e1f32e584aa0c6ae21856299fff31d67669 100644
|
||||
index 1047f1d794da2a3a035df5eaab1c809a7fca3d23..448075e354c760a2dbd1dd763f40b7a645730250 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -787,6 +787,7 @@ class Environment : public MemoryRetainer {
|
||||
@@ -34,7 +34,7 @@ index afe67d2237ae6933de44dd1141cf388e9a48cee3..87df6e1f32e584aa0c6ae21856299fff
|
||||
inline uint64_t thread_id() const;
|
||||
inline worker::Worker* worker_context() const;
|
||||
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
|
||||
index f0b4cc43c864aee1fab8e073ea110ea108c653ab..6d12e27b955fb9fddab24d846e563c969bb48ae7 100644
|
||||
index de372400fd9cedb0a724ce434c8944760dd2d078..58eb4befb94a68aa8f27c11665e9d7b32fe472be 100644
|
||||
--- a/src/inspector_agent.cc
|
||||
+++ b/src/inspector_agent.cc
|
||||
@@ -707,8 +707,10 @@ bool Agent::Start(const std::string& path,
|
||||
@@ -51,10 +51,10 @@ index f0b4cc43c864aee1fab8e073ea110ea108c653ab..6d12e27b955fb9fddab24d846e563c96
|
||||
parent_env_->AddCleanupHook([](void* data) {
|
||||
Environment* env = static_cast<Environment*>(data);
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index dcce529664e1d126115545d6ba7f5b8492b0e921..99d2e1384df4000d4e1f1ffeafa83d29a152054b 100644
|
||||
index 74a097279d3e5dc3ee6c5e609fd35cf44e5002f5..868366f6d3e35d0fe543c89efd7d5e313a831a96 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -654,7 +654,11 @@ enum Flags : uint64_t {
|
||||
@@ -656,7 +656,11 @@ enum Flags : uint64_t {
|
||||
// This control is needed by embedders who may not want to initialize the V8
|
||||
// inspector in situations where one has already been created,
|
||||
// e.g. Blink's in Chromium.
|
||||
|
||||
@@ -10,7 +10,7 @@ already been called.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 89e0e5524c2102b86bc5506fe49aa0c6fa0f30c1..e58f28e0f0ff8d61f35ec3c5a69aa37c66c25d78 100644
|
||||
index 524f80ee69ee5248e045a2b61faf5610c9ba4285..971668792eabe5be299849b5a3fd8a2790a2210a 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -605,6 +605,7 @@ static void PlatformInit(ProcessInitializationFlags::Flags flags) {
|
||||
@@ -22,17 +22,17 @@ index 89e0e5524c2102b86bc5506fe49aa0c6fa0f30c1..e58f28e0f0ff8d61f35ec3c5a69aa37c
|
||||
#endif // NODE_USE_V8_WASM_TRAP_HANDLER
|
||||
}
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 9ac0d5addcdd40d5c91d375b626099b95729548a..3ffc51783b0b6dee1c0f0a37d2f52cb1aec2fa3f 100644
|
||||
index a512d2228e0afcfff765c3fe845e1f22073047d0..36da93a7b41ea450a5f288ec17b61adae46ae178 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -272,6 +272,10 @@ enum Flags : uint32_t {
|
||||
// cppgc::InitializeProcess() before creating a Node.js environment
|
||||
// and call cppgc::ShutdownProcess() before process shutdown.
|
||||
@@ -274,6 +274,10 @@ enum Flags : uint32_t {
|
||||
kNoInitializeCppgc = 1 << 13,
|
||||
// Initialize the process for predictable snapshot generation.
|
||||
kGeneratePredictableSnapshot = 1 << 14,
|
||||
+ // Do not initialize the Web Assembly trap handler. This is used by
|
||||
+ // embedders to account for the case where it may already have been
|
||||
+ // initialized - calling it more than once will hard crash.
|
||||
+ kNoEnableWasmTrapHandler = 1 << 14,
|
||||
+ kNoEnableWasmTrapHandler = 1 << 15,
|
||||
|
||||
// Emulate the behavior of InitializeNodeWithArgs() when passing
|
||||
// a flags argument to the InitializeOncePerProcess() replacement
|
||||
|
||||
30
patches/node/fix_-wshadow_error_in_uvwasi_c.patch
Normal file
30
patches/node/fix_-wshadow_error_in_uvwasi_c.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Fri, 8 Dec 2023 18:05:28 +0100
|
||||
Subject: fix: -Wshadow error in uvwasi.c
|
||||
|
||||
Refs https://github.com/nodejs/node/pull/49908
|
||||
|
||||
Fixes a -Wshadow error in uvwasi.c. This should be upstreamed.
|
||||
|
||||
diff --git a/deps/uvwasi/src/uvwasi.c b/deps/uvwasi/src/uvwasi.c
|
||||
index e904b9f9293864db02f660dc3c9737f0e3684355..3e9cce85cae109ffc09f6b86ab5e896620b862d8 100644
|
||||
--- a/deps/uvwasi/src/uvwasi.c
|
||||
+++ b/deps/uvwasi/src/uvwasi.c
|
||||
@@ -2794,13 +2794,13 @@ uvwasi_errno_t uvwasi_sock_accept(uvwasi_t* uvwasi,
|
||||
goto close_sock_and_error_exit;
|
||||
}
|
||||
|
||||
- int r = uv_accept((uv_stream_t*) wrap->sock, (uv_stream_t*) uv_connect_sock);
|
||||
- if (r == UV_EAGAIN) {
|
||||
+ int rr = uv_accept((uv_stream_t*) wrap->sock, (uv_stream_t*) uv_connect_sock);
|
||||
+ if (rr == UV_EAGAIN) {
|
||||
// still no connection or error so run the loop again
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (r != 0) {
|
||||
+ if (rr != 0) {
|
||||
// An error occurred accepting the connection. Break out of the loop and
|
||||
// report an error.
|
||||
err = uvwasi__translate_uv_error(r);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user