Compare commits

..

23 Commits

Author SHA1 Message Date
Keeley Hammond
4911476787 build: use node18.12 appveyor image (24-x-y) (#37283)
build: use node18.12 appveyor image
2023-02-15 14:22:45 -08:00
trop[bot]
7a62411ad1 feat: include all standard paper sizes for webContents.print() (#37265)
feat: include standard paper sizes for webContents.print()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-15 19:58:49 +01:00
trop[bot]
99d648faaa fix: cookies filter secure invalid (#37246)
* fix: cookies filter secure and session invalid

Co-authored-by: Black-Hole1 <158blackhole@gmail.com>

* test: add test

Co-authored-by: Black-Hole1 <158blackhole@gmail.com>

* test: fix test failed

Co-authored-by: Black-Hole1 <158blackhole@gmail.com>

* test: fix test failed again

Co-authored-by: Black-Hole1 <158blackhole@gmail.com>

* fix: session check logic incorrect

Co-authored-by: Black-Hole1 <158blackhole@gmail.com>

* refactor: reset cookies filter session logic

Co-authored-by: Black-Hole1 <158blackhole@gmail.com>

* Update shell/browser/api/electron_api_cookies.cc

Co-authored-by: Robo <hop2deep@gmail.com>

Co-authored-by: Black-Hole <158blackhole@gmail.com>

* chore: re-enable worker spec failures (#37015)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-15 12:38:01 +01:00
trop[bot]
91776c5484 docs: add win.isFocusable() return type (#37260)
docs: fix `win.isFocusable()` return type

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Andrew Ferreira <andrew.shien2@gmail.com>
2023-02-15 11:52:11 +01:00
trop[bot]
1a48e36313 fix: BrowserView crash when 'beforeunload' prevented (#37268)
fix: crash when beforeunload prevented

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-14 20:54:52 +01:00
trop[bot]
97c66e5985 refactor: simplify Node.js event loop with SpinEventLoop (#37258)
refactor: simplify Node.js event loop with SpinEventLoop

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-14 18:42:05 +01:00
trop[bot]
4ce69207b0 build: set make_latest correctly on published releases (#37242)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-02-13 14:47:26 +01:00
trop[bot]
cf4f6285c8 chore: update https://cs.chromium.org/ links to https://source.chromium.org/ (#37234)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-02-13 16:32:32 +09:00
trop[bot]
253a60f8ae ci: update appveyor build agent (#37229)
ci update appveyor image

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-02-11 19:20:22 -05:00
Milan Burda
e5e9186d61 docs: add missing clipboard-sanitized-write permission value to setPermissionRequestHandler() (#37173)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-02-09 11:38:39 +01:00
Shelley Vohr
478ce96914 fix: avoid using v8 on Isolate termination (#35766)
* fix: avoid using v8 on Isolate termination

* chore: refactor for review

---------

Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com>
2023-02-09 09:48:49 +01:00
Jeremy Rose
8dc98aeeae chore: remove load-url event (#37174) 2023-02-09 14:40:37 +09:00
Milan Burda
35a9e67dba chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
Samuel Attard
8b380ee2f2 test: ensure fullscreen test is retryable (#37179)
spec: ensure fullscreen test is retryable
2023-02-08 12:40:24 -08:00
Shelley Vohr
a15c9d3058 test: Node.js hkdf tests work now (#37180) 2023-02-08 13:35:28 -05:00
David Sanders
22de86d5f4 docs: remove reference to electron/releases (#37164) 2023-02-08 15:27:09 +01:00
Samuel Attard
8783d03a59 test: mark some node specs as flaky (#37181) 2023-02-08 15:19:02 +01:00
Bruno Pitrus
df6f99aa72 fix: correct redefinition which is invalid C++ (#36096)
* fix: correct redefinition which is invalid C++

See https://stackoverflow.com/a/15538759 for an explanation of class scope.
GCC gives an error when compiling this code: https://godbolt.org/z/sYhc3cMjE

* Update export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch

---------

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2023-02-08 16:03:47 +09:00
Samuel Attard
00a542358d build: only retry tests on CI (#37167) 2023-02-07 22:44:53 -08:00
Jeremy Rose
9a0a0a7a46 fix: type for received-apns-notification event (#37177) 2023-02-07 22:43:29 -08:00
Milan Burda
6a3cb34326 fix: expose native bindings by process type (#35949) 2023-02-07 20:22:18 -05:00
electron-roller[bot]
de607cbcde chore: bump node to v18.14.0 (main) (#37129)
* chore: bump node in DEPS to v18.14.0

* src: add support for externally shared js builtins

https://github.com/nodejs/node/pull/44376

* test: fix test broken under --node-builtin-modules-path

https://github.com/nodejs/node/pull/45894

* build: add option to disable shared readonly heap

https://github.com/nodejs/node/pull/45887

* src: remove unnecessary semicolons

https://github.com/nodejs/node/pull/46171

* src: remove return after abort

https://github.com/nodejs/node/pull/46172

* chore: fixup patch indices

* test_runner: parse yaml

https://github.com/nodejs/node/pull/45815

* src: use simdutf for converting externalized builtins to UTF-16

https://github.com/nodejs/node/pull/46119

* src: rename internal module declaration as internal bindings

https://github.com/nodejs/node/pull/45551

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-07 15:51:07 -05:00
David Sanders
7abe38b46e build: fix version check in release_dependency_versions.yml (#37155)
* build: fix version check in release_dependency_versions.yml

* chore: also mksnapshot
2023-02-07 11:38:50 -05:00
117 changed files with 782 additions and 599 deletions

View File

@@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag: v3
- name: Trigger New chromedriver Release
run: |
if [[ ${{ github.event.release.tag_name }} =~ ^v\d+\.\d+\.\d+$ ]]; then
if [[ ${{ github.event.release.tag_name }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
gh api /repos/:owner/chromedriver/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
else
echo "Not releasing for version ${{ github.event.release.tag_name }}"
@@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag: v3
- name: Trigger New mksnapshot Release
run: |
if [[ ${{ github.event.release.tag_name }} =~ ^v\d+\.\d+\.\d+$ ]]; then
if [[ ${{ github.event.release.tag_name }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
gh api /repos/:owner/mksnapshot/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
else
echo "Not releasing for version ${{ github.event.release.tag_name }}"

2
DEPS
View File

@@ -4,7 +4,7 @@ vars = {
'chromium_version':
'111.0.5560.0',
'node_version':
'v18.13.0',
'v18.14.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':

View File

@@ -6,7 +6,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-110.0.5451.0
image: e-111.0.5560.0-node18
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -16,22 +16,58 @@ environment:
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
PYTHONIOENCODING: UTF-8
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP before bake begins
# install:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# init:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - appveyor version
# - ps: $ErrorActionPreference = 'Stop'
# - ps: 'Write-Host "OS Build: $((Get-CimInstance Win32_OperatingSystem).BuildNumber)"'
# clone_folder: '%USERPROFILE%\image-bake-scripts'
# clone_script:
# - ps: Invoke-WebRequest "https://github.com/appveyor/build-images/archive/1f90d94e74c8243c909a09b994e527584dfcb838.zip" -OutFile "$env:temp\scripts.zip"
# - ps: Expand-Archive -Path "$env:temp\scripts.zip" -DestinationPath "$env:temp\scripts" -Force
# - ps: Copy-Item -Path "$env:temp\scripts\build-images-1f90d94e74c8243c909a09b994e527584dfcb838\scripts\Windows\*" -Destination $env:APPVEYOR_BUILD_FOLDER -Recurse
build_script:
# Uncomment/change the following line if the hard drive/partition size needs to change
# - ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# - ps: .\init_server.ps1
# - ps: .\extend_system_volume.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# - appveyor version
# - ps: .\install_path_utils.ps1
# - ps: .\install_powershell_core.ps1
# - ps: .\install_powershell_get.ps1
# - ps: .\install_7zip.ps1
# - ps: .\install_chocolatey.ps1
# - ps: .\install_webpi.ps1
# - ps: .\install_nuget.ps1
# - ps: .\install_pstools.ps1
# - ps: .\install_git.ps1
# - ps: .\install_git_lfs.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# END LINES FOR COMPLETELY NEW IMAGE
- git config --global core.longpaths true
- cd ..
- ps: >-
if (-not (Test-Path -Path .\src)) {
New-Item -Path .\src -ItemType Directory
if (-not (Test-Path -Path C:\projects\src)) {
New-Item -Path C:\projects\src -ItemType Directory
}
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- cd C:\projects\
- git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/electron/electron.git C:\projects\src\electron
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- update_depot_tools.bat
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
# Uncomment the following line if windows deps change
# - src\electron\script\setup-win-for-dev.bat
- >-
@@ -47,20 +83,25 @@ build_script:
- ps: cd ..\..
- gclient sync --with_branch_heads --with_tags --nohooks
- ps: regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\amd64\msdia140.dll"
- ps: |
$env:appveyor_user = "appveyor"
$env:appveyor_password = [Guid]::NewGuid().ToString('B')
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
Set-LocalUser -Name $env:appveyor_user -Password (ConvertTo-SecureString -AsPlainText $env:appveyor_password -Force) -PasswordNeverExpires:$true
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/build-images/master/scripts/Windows/enable_autologon.ps1'))
# - cd %USERPROFILE%\image-bake-scripts
# - appveyor version
# - ps: .\optimize_dotnet_runtime.ps1
# - ps: .\disable_windows_background_services.ps1
# - ps: .\enforce_windows_firewall.ps1
# - ps: .\cleanup_windows.ps1
# END LINES FOR COMPLETELY NEW IMAGE
on_image_bake:
- ps: >-
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
- ps: Remove-Item -Recurse -Force $pwd\depot_tools
- ps: Remove-Item -Recurse -Force $pwd\src\electron
- ps: Remove-Item -Recurse -Force C:\projects\depot_tools
- ps: Remove-Item -Recurse -Force C:\projects\src\electron
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP after bake is done
#on_finish:
# - ps: >-
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# # on_finish:
# - ps: >-
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-111.0.5518.0
image: e-111.0.5560.0-2
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -82,7 +82,7 @@ for:
if (Test-Path -Path "$pwd\build-tools") {
Remove-Item -Recurse -Force $pwd\build-tools
}
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-111.0.5560.0
image: e-111.0.5560.0-node18
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -80,7 +80,7 @@ for:
if (Test-Path -Path "$pwd\build-tools") {
Remove-Item -Recurse -Force $pwd\build-tools
}
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {

View File

@@ -1776,7 +1776,7 @@ On macOS it does not remove the focus from the window.
#### `win.isFocusable()` _macOS_ _Windows_
Returns whether the window can be focused.
Returns `boolean` - Whether the window can be focused.
#### `win.setParentWindow(parent)`
@@ -1910,7 +1910,7 @@ removed in future Electron releases.
On a Window with Window Controls Overlay already enabled, this method updates
the style of the title bar overlay.
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
[page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look
[vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc

View File

@@ -26,6 +26,7 @@ The `pushNotification` module emits the following events:
Returns:
* `event` Event
* `userInfo` Record<String, any>
Emitted when the app receives a remote notification while running.

View File

@@ -784,6 +784,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
* `permission` string - The type of requested permission.
* `clipboard-read` - Request access to read from the clipboard.
* `clipboard-sanitized-write` - Request access to write to the clipboard.
* `media` - Request access to media devices such as camera, microphone and speakers.
* `display-capture` - Request access to capture the screen.
* `mediaKeySystem` - Request access to DRM protected content.

View File

@@ -1409,8 +1409,8 @@ Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/
* `vertical` number (optional) - The vertical dpi.
* `header` string (optional) - string to be printed as page header.
* `footer` string (optional) - string to be printed as page footer.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`,
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
* `callback` Function (optional)
* `success` boolean - Indicates success of the print call.
* `failureReason` string - Error description called back if the print fails.

View File

@@ -1001,7 +1001,7 @@ Emitted when DevTools is closed.
Emitted when DevTools is focused / opened.
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
[chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/
### Event: 'context-menu'

View File

@@ -18,8 +18,8 @@ See also [V8 Development](v8-development.md)
### Code Resources
- [Code Search](https://cs.chromium.org/) - Indexed and searchable source code for Chromium and associated projects.
- [Source Code](https://cs.chromium.org/chromium/src/) - The source code for Chromium itself.
- [Code Search](https://source.chromium.org/chromium) - Indexed and searchable source code for Chromium and associated projects.
- [Source Code](https://source.chromium.org/chromium/chromium/src) - The source code for Chromium itself.
- [Chromium Review](https://chromium-review.googlesource.com) - The searchable code host which facilitates code reviews for Chromium and related projects.
### Informational Resources

View File

@@ -138,13 +138,13 @@ interface Process {
At the very bottom of your `api_name.cc` file:
```cpp title='api_name.cc'
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_{api_name},Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_{api_name},Initialize)
```
In your [`shell/common/node_bindings.cc`](https://github.com/electron/electron/blob/main/shell/common/node_bindings.cc) file, add your node binding name to Electron's built-in modules.
```cpp title='shell/common/node_bindings.cc'
#define ELECTRON_BUILTIN_MODULES(V) \
#define ELECTRON_BROWSER_MODULES(V) \
V(electron_browser_{api_name})
```

View File

@@ -121,14 +121,13 @@ need to install Node.js themselves as a prerequisite to running your app.
To check which version of Node.js is running in your app, you can access the global
[`process.versions`][] variable in the main process or preload script. You can also reference
the list of versions in the [electron/releases][] repository.
<https://releases.electronjs.org/releases.json>.
:::
<!-- Links -->
[chromium]: https://www.chromium.org/
[electron/releases]: https://github.com/electron/releases/blob/master/readme.md#releases
[homebrew]: https://brew.sh/
[mdn-guide]: https://developer.mozilla.org/en-US/docs/Learn/
[node]: https://nodejs.org/

View File

@@ -28,11 +28,47 @@ type PostData = LoadURLOptions['postData']
// Stock page sizes
const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
A5: {
custom_display_name: 'A5',
height_microns: 210000,
name: 'ISO_A5',
width_microns: 148000
Letter: {
custom_display_name: 'Letter',
height_microns: 279400,
name: 'NA_LETTER',
width_microns: 215900
},
Legal: {
custom_display_name: 'Legal',
height_microns: 355600,
name: 'NA_LEGAL',
width_microns: 215900
},
Tabloid: {
height_microns: 431800,
name: 'NA_LEDGER',
width_microns: 279400,
custom_display_name: 'Tabloid'
},
A0: {
custom_display_name: 'A0',
height_microns: 1189000,
name: 'ISO_A0',
width_microns: 841000
},
A1: {
custom_display_name: 'A1',
height_microns: 841000,
name: 'ISO_A1',
width_microns: 594000
},
A2: {
custom_display_name: 'A2',
height_microns: 594000,
name: 'ISO_A2',
width_microns: 420000
},
A3: {
custom_display_name: 'A3',
height_microns: 420000,
name: 'ISO_A3',
width_microns: 297000
},
A4: {
custom_display_name: 'A4',
@@ -41,29 +77,17 @@ const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
is_default: 'true',
width_microns: 210000
},
A3: {
custom_display_name: 'A3',
height_microns: 420000,
name: 'ISO_A3',
width_microns: 297000
A5: {
custom_display_name: 'A5',
height_microns: 210000,
name: 'ISO_A5',
width_microns: 148000
},
Legal: {
custom_display_name: 'Legal',
height_microns: 355600,
name: 'NA_LEGAL',
width_microns: 215900
},
Letter: {
custom_display_name: 'Letter',
height_microns: 279400,
name: 'NA_LETTER',
width_microns: 215900
},
Tabloid: {
height_microns: 431800,
name: 'NA_LEDGER',
width_microns: 279400,
custom_display_name: 'Tabloid'
A6: {
custom_display_name: 'A6',
height_microns: 148000,
name: 'ISO_A6',
width_microns: 105000
}
} as const;
@@ -465,7 +489,6 @@ WebContents.prototype.loadURL = function (url, options) {
// Add a no-op rejection handler to silence the unhandled rejection error.
p.catch(() => {});
this._loadURL(url, options);
this.emit('load-url', url, options);
return p;
};

View File

@@ -11,7 +11,7 @@
"@electron/fiddle-core": "^1.0.4",
"@electron/github-app-auth": "^1.5.0",
"@electron/typescript-definitions": "^8.10.0",
"@octokit/rest": "^18.0.3",
"@octokit/rest": "^19.0.7",
"@primer/octicons": "^10.0.0",
"@types/basic-auth": "^1.1.3",
"@types/busboy": "^1.5.0",

View File

@@ -9,26 +9,26 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead
of the default V8 allocator. This probably can't be usptreamed.
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
index c4f2df96133012faebec25ac3a738c34cd6b4cf8..1b0333b2efe05a659e161f28ce6c01e572fddcef 100644
index c4f2df96133012faebec25ac3a738c34cd6b4cf8..54bc2625686b9344c2c793c74589ed85de8227ba 100644
--- a/gin/public/v8_platform.h
+++ b/gin/public/v8_platform.h
@@ -30,6 +30,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
// enabling Arm's Branch Target Instructions for executable pages. This is
// verified in the tests for gin::PageAllocator.
PageAllocator* GetPageAllocator() override;
+ static PageAllocator* PageAllocator();
+ static PageAllocator* GetCurrentPageAllocator();
void OnCriticalMemoryPressure() override;
v8::ZoneBackingAllocator* GetZoneBackingAllocator() override;
#endif
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
index bbb16efbf5208989fa88c7f6d83d36aa5e54a0d1..1ead276abf4327d48a816d8b520ebe958b5aa17b 100644
index bbb16efbf5208989fa88c7f6d83d36aa5e54a0d1..ef562c9a9abed85198282728287637d178a0af0f 100644
--- a/gin/v8_platform.cc
+++ b/gin/v8_platform.cc
@@ -370,6 +370,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
return g_page_allocator.Pointer();
}
+PageAllocator* V8Platform::PageAllocator() {
+PageAllocator* V8Platform::GetCurrentPageAllocator() {
+ return g_page_allocator.Pointer();
+}
+

View File

@@ -34,5 +34,5 @@ fix_expose_lookupandcompile_with_parameters.patch
fix_prevent_changing_functiontemplateinfo_after_publish.patch
enable_crashpad_linux_node_processes.patch
allow_embedder_to_control_codegenerationfromstringscallback.patch
chore_remove_errant_semicolons.patch
chore_remove_unreached_return.patch
src_allow_optional_isolation_termination_in_node.patch
test_mark_cpu_prof_tests_as_flaky_in_electron.patch

View File

@@ -8,10 +8,10 @@ This is needed to blend Blink and Node's code generation policy.
This should be upstreamed.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index c0c422e969543dcd570dabfd8ff0755abe37face..4f14b308d14f3653c8646345a5b375014a51851f 100644
index e3c42d892eed8dd605301348c08ad24f4362a7aa..c718b9919bb30627e5da2b92a8de58c494bf4b93 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -267,11 +267,15 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
@@ -268,11 +268,15 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
isolate->SetMicrotasksPolicy(s.policy);

View File

@@ -9,7 +9,7 @@ This patch can be removed when Node.js updates to a V8 version containing
the above CL.
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 323fc7d4ff635ca287ee241cee234da0600340a2..36ab78f739f3faecab47eead99f9aa3c403672c0 100644
index 9f620154ce3696cff90bf308da934147319b1096..806d9700ca4b5faf46042814c0e2ce212945bece 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -495,9 +495,9 @@ void OnFatalError(const char* location, const char* message) {
@@ -25,7 +25,7 @@ index 323fc7d4ff635ca287ee241cee234da0600340a2..36ab78f739f3faecab47eead99f9aa3c
if (location) {
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
diff --git a/src/node_errors.h b/src/node_errors.h
index 926f54286ec72fda98a9a477ac8e22feef522291..f926cc1c70dd6f883c0729c46f09e10972ce6385 100644
index 850d437acdfe09fc43a7a37790c2926e6109749d..5a33d17b0e90e8ca8dc670e14f93de8fef99d526 100644
--- a/src/node_errors.h
+++ b/src/node_errors.h
@@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env,

View File

@@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP.
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..db80a8f00a84bf54f723c21300e7579c994d0514
index 0000000000000000000000000000000000000000..5e8577795316984f3073204523d82a17f44b0f88
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,438 @@
@@ -0,0 +1,439 @@
+import("//v8/gni/v8.gni")
+import("node.gni")
+
@@ -223,8 +223,9 @@ index 0000000000000000000000000000000000000000..db80a8f00a84bf54f723c21300e7579c
+ deps = [
+ ":node_js2c",
+ "deps/googletest:gtest",
+ "deps/uvwasi",
+ "deps/base64",
+ "deps/simdutf",
+ "deps/uvwasi",
+ "//third_party/zlib",
+ "//third_party/brotli:dec",
+ "//third_party/brotli:enc",
@@ -945,6 +946,32 @@ index 0000000000000000000000000000000000000000..23eed033d31eced6a85c794eee550655
+ "lib/nghttp2_version.c",
+ ]
+}
diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..bfbd4e656db1a6c73048443f96f1d576a0df7519
--- /dev/null
+++ b/deps/simdutf/BUILD.gn
@@ -0,0 +1,20 @@
+config("simdutf_config") {
+ include_dirs = [ "." ]
+}
+
+static_library("simdutf") {
+ include_dirs = [ "." ]
+ sources = [
+ "simdutf.cpp",
+ ]
+
+ public_configs = [ ":simdutf_config" ]
+
+ cflags_cc = [
+ "-Wno-ambiguous-reversed-operator",
+ "-Wno-c++98-compat-extra-semi",
+ "-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..d6bed57461820ce08391fc424a1f842bd282fa75
@@ -1193,7 +1220,7 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101af305de82
index 0000000000000000000000000000000000000000..2a9146e592429c1726527353c6484bd4534731b1
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,653 @@
@@ -1358,7 +1385,6 @@ index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101a
+ "lib/internal/assert.js",
+ "lib/internal/assert/assertion_error.js",
+ "lib/internal/assert/calltracker.js",
+ "lib/internal/assert/snapshot.js",
+ "lib/internal/async_hooks.js",
+ "lib/internal/blob.js",
+ "lib/internal/blocklist.js",
@@ -1548,6 +1574,7 @@ index 0000000000000000000000000000000000000000..a991bef2b98766a1cfb248d2af97101a
+ "lib/internal/test_runner/tap_stream.js",
+ "lib/internal/test_runner/test.js",
+ "lib/internal/test_runner/utils.js",
+ "lib/internal/test_runner/yaml_parser.js",
+ "lib/internal/timers.js",
+ "lib/internal/tls/secure-context.js",
+ "lib/internal/tls/secure-pair.js",
@@ -2091,7 +2118,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index d6b2f18cf8599ed7994954c808379565b740ac83..cd73f646bb3e9dbc4d9f4a3f24ef5970ec33b3a5 100644
index c42b070a3367283155f9ff6b861b9f0160b5e9ed..ff8a64174e6f09af533b2fe05b2fe6e600624910 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@

View File

@@ -7,7 +7,7 @@ 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 6704d96142f806be9c0605f0b41206e77f492b96..f1404d27e14ce7143d3b2dbccde7af8269369cbf 100644
index b661dc4a1b3149e780eef46033e70e68038417b0..15b6155017233ed9d4c60c2453f498ba8a33403d 100644
--- a/common.gypi
+++ b/common.gypi
@@ -79,6 +79,8 @@
@@ -40,10 +40,10 @@ index 6704d96142f806be9c0605f0b41206e77f492b96..f1404d27e14ce7143d3b2dbccde7af82
'defines': [
'V8_COMPRESS_POINTERS',
diff --git a/configure.py b/configure.py
index bae674fd264ff0bfbe025c286279182358872b23..1f3c398c034d2c0bf0eca51b892ca87c3fcf7ce1 100755
index 171afd04030e6933da054db866d44428ae808acf..363bf746101c85630a6c52146303986e7e0dcdce 100755
--- a/configure.py
+++ b/configure.py
@@ -1511,6 +1511,7 @@ def configure_library(lib, output, pkgname=None):
@@ -1517,6 +1517,7 @@ def configure_library(lib, output, pkgname=None):
def configure_v8(o):

View File

@@ -8,7 +8,7 @@ Aligns common.gypi with the current build flag state of //v8.
Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`.
diff --git a/common.gypi b/common.gypi
index cbbc7264c6ad097c5da4902ac1bdbdcebfdd36af..6704d96142f806be9c0605f0b41206e77f492b96 100644
index 2c2f3218a8ae387802af3d154ede601aedcb52dd..b661dc4a1b3149e780eef46033e70e68038417b0 100644
--- a/common.gypi
+++ b/common.gypi
@@ -65,6 +65,7 @@
@@ -42,14 +42,14 @@ index cbbc7264c6ad097c5da4902ac1bdbdcebfdd36af..6704d96142f806be9c0605f0b41206e7
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}],
diff --git a/configure.py b/configure.py
index 81d54a14b7af51b77b6340a4f7bf605d6f1656bc..bae674fd264ff0bfbe025c286279182358872b23 100755
index 0a45c07f587ed8d21dff45d523b7074606c586ac..171afd04030e6933da054db866d44428ae808acf 100755
--- a/configure.py
+++ b/configure.py
@@ -1524,6 +1524,7 @@ def configure_v8(o):
@@ -1530,6 +1530,7 @@ def configure_v8(o):
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
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_shared_ro_heap'] = 0 if options.enable_pointer_compression else 1
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)

View File

@@ -14,10 +14,10 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded
through LoadEmbedderJavaScriptSource()
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f266e53c2e 100644
index bc4555584ab1f97806a1e9cd17085a2488320908..b17dbf2a98c9f4b14fea60c87f05afcee6ec54fb 100644
--- a/lib/internal/fs/watchers.js
+++ b/lib/internal/fs/watchers.js
@@ -290,11 +290,13 @@ function emitCloseNT(self) {
@@ -293,11 +293,13 @@ function emitCloseNT(self) {
// Legacy alias on the C++ wrapper object. This is not public API, so we may
// want to runtime-deprecate it at some point. There's no hurry, though.
@@ -28,31 +28,31 @@ index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f2
-});
+if (!'owner' in FSEvent.prototype) {
+ ObjectDefineProperty(FSEvent.prototype, 'owner', {
+ __proto__: null,
+ __proto__: null,
+ get() { return this[owner_symbol]; },
+ set(v) { return this[owner_symbol] = v; }
+ });
+}
async function* watch(filename, options = {}) {
async function* watch(filename, options = kEmptyObject) {
const path = toNamespacedPath(getValidatedPath(filename));
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 9d82a06adcefe386ea230c7cfbdccffb67d0b8c1..6e1a55adbd0b01383f3e54e924864dfeb6a57f0b 100644
index 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e155345a454 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -32,6 +32,7 @@ BuiltinLoader BuiltinLoader::instance_;
@@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_;
BuiltinLoader::BuiltinLoader() : config_(GetConfig()), has_code_cache_(false) {
LoadJavaScriptSource();
+ LoadEmbedderJavaScriptSource();
#if defined(NODE_HAVE_I18N_SUPPORT)
#ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH
AddExternalizedBuiltin(
"internal/deps/cjs-module-lexer/lexer",
diff --git a/src/node_builtins.h b/src/node_builtins.h
index a6fbff98ccb0a7f5fd33cf3b084cfdf47aaa995e..8228e57d27b2f883d87ec12274f2745628caa6e1 100644
index 90b158b84bb2a66781cf92f5b4c1a64f9e2ee651..8d9f7c409659a30747e5feeac6cfec4208791370 100644
--- a/src/node_builtins.h
+++ b/src/node_builtins.h
@@ -73,6 +73,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
@@ -71,6 +71,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
// Generated by tools/js2c.py as node_javascript.cc
void LoadJavaScriptSource(); // Loads data into source_

View File

@@ -8,7 +8,7 @@ modules from being used in the renderer process. This should be upstreamed as
a customizable error message.
diff --git a/src/node_binding.cc b/src/node_binding.cc
index c4e6347f6f302b46fe4569f543335e426cd4ded5..f772e71521c71edd7d40b0489c5fc875357e3790 100644
index 175d0bee02d3592891f671533857b737057ab684..cf1cbcd54448754c7199a128b5447945aecf3e92 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -4,6 +4,7 @@

View File

@@ -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 44e4c22ebf39fc9c52f789173a2cc50300bcd181..035de64bf1f0ab46de2b803edeaf0596c8bf68a0 100644
index 207142322bba89e94f4e3052a22bef6ffebcdc39..c83d8b0db630d3fc26fb273170945c872bede091 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1192,6 +1192,13 @@ Module.prototype._compile = function(content, filename) {
@@ -1200,6 +1200,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.

View File

@@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 9 Jan 2023 13:53:36 +0100
Subject: chore: remove errant semicolons
- https://github.com/nodejs/node/pull/44179
- https://github.com/nodejs/node/pull/44193
This should be upstreamed.
diff --git a/src/node_realm.h b/src/node_realm.h
index 9ece8cb38958c364c6177118a5e7443c3a6bdf1a..0d3259a149e94b7d9657959c0ccac25a146978b4 100644
--- a/src/node_realm.h
+++ b/src/node_realm.h
@@ -55,7 +55,7 @@ class Realm : public MemoryRetainer {
Realm& operator=(Realm&&) = delete;
SET_MEMORY_INFO_NAME(Realm)
- SET_SELF_SIZE(Realm);
+ SET_SELF_SIZE(Realm)
void MemoryInfo(MemoryTracker* tracker) const override;
void CreateProperties();
diff --git a/src/node_util.h b/src/node_util.h
index 616b8c003b2d0dd80e01297ca3fe7e4926220ad7..9590842ae4764dd3363a4d74038d3351f0061177 100644
--- a/src/node_util.h
+++ b/src/node_util.h
@@ -12,7 +12,7 @@ namespace util {
class WeakReference : public SnapshotableObject {
public:
- SERIALIZABLE_OBJECT_METHODS();
+ SERIALIZABLE_OBJECT_METHODS()
static constexpr FastStringKey type_name{"node::util::WeakReference"};
static constexpr EmbedderObjectType type_int =

View File

@@ -1,22 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 9 Jan 2023 14:34:01 +0100
Subject: chore: remove unreached return
https://github.com/nodejs/node/pull/44376 added a return after a call to
ABORT(), triggering an unreachable code error.
This should be upstreamed.
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 25b02f9904127780c68db9b451a7dfcf02a6fc5e..1be20aea500fd9d606c5a38a86b4aef66b49d133 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -247,7 +247,6 @@ void BuiltinLoader::AddExternalizedBuiltin(const char* id,
fprintf(
stderr, "Cannot load externalized builtin: \"%s:%s\".\n", id, filename);
ABORT();
- return;
}
icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8(

View File

@@ -9,7 +9,7 @@ modules to sandboxed renderers.
TODO(codebytere): remove and replace with a public facing API.
diff --git a/src/node_binding.cc b/src/node_binding.cc
index a7a325e591eba3daf80bebb11fc3cd83891b627d..c4e6347f6f302b46fe4569f543335e426cd4ded5 100644
index c7ae1c26fe2bbade7c5b3ffdb2d30efcf8551cb9..175d0bee02d3592891f671533857b737057ab684 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -608,6 +608,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
@@ -24,7 +24,7 @@ index a7a325e591eba3daf80bebb11fc3cd83891b627d..c4e6347f6f302b46fe4569f543335e42
Environment* env = Environment::GetCurrent(args);
diff --git a/src/node_binding.h b/src/node_binding.h
index 5bced5b41431dc7838d1a30774a1a41ff797290e..4233ee968fb4b3b5456997cbf1450ecf07392455 100644
index 13681bac67c64f5b9c81a034f0be1eeb2b346bb1..76898adc448c48715d8b9dc4aa782217a4fc7e05 100644
--- a/src/node_binding.h
+++ b/src/node_binding.h
@@ -91,6 +91,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);

View File

@@ -7,10 +7,10 @@ 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 fbc4fbb27b065d6a9e3ce7492a21b1eee2f334eb..59bab65f4cd6f0f977a0edc8d33b96d7fc4cdb16 100644
index bea695bd8c92d44cb9526f347a9464549155ed85..0cbd1b25c107b5deba5fdd14551cc641904f7f21 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -665,6 +665,10 @@ inline bool Environment::no_global_search_paths() const {
@@ -669,6 +669,10 @@ inline bool Environment::no_global_search_paths() const {
!options_->global_search_paths;
}
@@ -22,10 +22,10 @@ index fbc4fbb27b065d6a9e3ce7492a21b1eee2f334eb..59bab65f4cd6f0f977a0edc8d33b96d7
// configure --no-browser-globals
#ifdef NODE_NO_BROWSER_GLOBALS
diff --git a/src/env.h b/src/env.h
index 4d5e72f9f44762fda4698f0bf62166d1222d1028..0cc91123f4b14439ea4f55814570c323b028ceb3 100644
index 673581fd0e2ef91886fa5e6be6523a2394df6db1..562610e6827d8302f146b81d599dd366ba25cd74 100644
--- a/src/env.h
+++ b/src/env.h
@@ -765,6 +765,7 @@ class Environment : public MemoryRetainer {
@@ -767,6 +767,7 @@ class Environment : public MemoryRetainer {
inline bool tracks_unmanaged_fds() const;
inline bool hide_console_windows() const;
inline bool no_global_search_paths() const;

View File

@@ -7,7 +7,7 @@ common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi
index f3e479096776395c6465efc2597bc51918e90322..cbbc7264c6ad097c5da4902ac1bdbdcebfdd36af 100644
index 5372c8d42de531b68b97a7e8405724676ea7d5cf..2c2f3218a8ae387802af3d154ede601aedcb52dd 100644
--- a/common.gypi
+++ b/common.gypi
@@ -80,6 +80,23 @@

View File

@@ -31,7 +31,7 @@ index 4e3c32fdcd23fbe3e74bd5e624b739d224689f33..19d65aae7fa8ec9f9b907733ead17a20
// Test Parallel Execution w/ KeyObject is threadsafe in openssl3
{
diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js
index 162b451c5b459c566980c7d3476b3df0cef72871..db59d7fb8b46b5a6d4c77de7b5c492408351816d 100644
index d358f6b63c0e9f5761157dc200daa484d9c5ead6..7a3e376d04020e7a883f56591bc07d9970d15c9a 100644
--- a/test/parallel/test-crypto-authenticated.js
+++ b/test/parallel/test-crypto-authenticated.js
@@ -50,7 +50,9 @@ const errMessages = {
@@ -958,26 +958,10 @@ index b06f2fa2c53ea72f9a66f0d002dd9281d0259a0f..864fffeebfad75d95416fd47efdea7f2
const server = https.createServer(opts, (req, res) => {
diff --git a/test/parallel/test-webcrypto-derivebits.js b/test/parallel/test-webcrypto-derivebits.js
index 442423954b10b2ee1696eb7db56eaa4c88492122..c65610245e7e328d5e844afc48f8f685c49be3b7 100644
index 442423954b10b2ee1696eb7db56eaa4c88492122..cbb96d7de046c80fad608431b7ec0216e2d271fb 100644
--- a/test/parallel/test-webcrypto-derivebits.js
+++ b/test/parallel/test-webcrypto-derivebits.js
@@ -37,6 +37,7 @@ const { subtle } = require('crypto').webcrypto;
test('P-521').then(common.mustCall());
}
+/*
// Test HKDF bit derivation
{
async function test(pass, info, salt, hash, length, expected) {
@@ -68,6 +69,7 @@ const { subtle } = require('crypto').webcrypto;
tests.then(common.mustCall());
}
+*/
// Test PBKDF2 bit derivation
{
@@ -101,6 +103,7 @@ const { subtle } = require('crypto').webcrypto;
@@ -101,6 +101,7 @@ const { subtle } = require('crypto').webcrypto;
tests.then(common.mustCall());
}
@@ -985,32 +969,16 @@ index 442423954b10b2ee1696eb7db56eaa4c88492122..c65610245e7e328d5e844afc48f8f685
// Test X25519 and X448 bit derivation
{
async function test(name) {
@@ -126,3 +129,4 @@ const { subtle } = require('crypto').webcrypto;
@@ -126,3 +127,4 @@ const { subtle } = require('crypto').webcrypto;
test('X25519').then(common.mustCall());
test('X448').then(common.mustCall());
}
+*/
diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js
index b819b998d217e0c71e9b41f175de6802d3ac7d90..2afaa9918d7ebd156061094a055dbf076f9965f5 100644
index b819b998d217e0c71e9b41f175de6802d3ac7d90..fbd32b02abd120aa02b9ac92341ef1331422308d 100644
--- a/test/parallel/test-webcrypto-derivekey.js
+++ b/test/parallel/test-webcrypto-derivekey.js
@@ -46,6 +46,7 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
test('P-521').then(common.mustCall());
}
+/*
// Test HKDF key derivation
{
async function test(pass, info, salt, hash, expected) {
@@ -82,6 +83,7 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
tests.then(common.mustCall());
}
+*/
// Test PBKDF2 key derivation
{
@@ -174,6 +176,7 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
@@ -174,6 +174,7 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
})().then(common.mustCall());
}
@@ -1018,7 +986,7 @@ index b819b998d217e0c71e9b41f175de6802d3ac7d90..2afaa9918d7ebd156061094a055dbf07
// Test X25519 and X448 key derivation
{
async function test(name) {
@@ -208,3 +211,4 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
@@ -208,3 +209,4 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
test('X25519').then(common.mustCall());
test('X448').then(common.mustCall());
}

View File

@@ -10,10 +10,10 @@ parameters.
This should be upstreamed.
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 6e1a55adbd0b01383f3e54e924864dfeb6a57f0b..25b02f9904127780c68db9b451a7dfcf02a6fc5e 100644
index d3a0dd7cedb0d239ae427d1af2335e155345a454..de0c39234bb4155c56b4e51e42a399df3c4b8f87 100644
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -438,6 +438,22 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompile(
@@ -439,6 +439,22 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompile(
return maybe;
}
@@ -37,10 +37,10 @@ index 6e1a55adbd0b01383f3e54e924864dfeb6a57f0b..25b02f9904127780c68db9b451a7dfcf
BuiltinLoader* loader = GetInstance();
std::vector<std::string> ids = loader->GetBuiltinIds();
diff --git a/src/node_builtins.h b/src/node_builtins.h
index 8228e57d27b2f883d87ec12274f2745628caa6e1..b07c34a6d247a050f4f307940c9e157fb14d6166 100644
index 8d9f7c409659a30747e5feeac6cfec4208791370..34a51c3e5a79154c3633143b352aa9e108497767 100644
--- a/src/node_builtins.h
+++ b/src/node_builtins.h
@@ -53,6 +53,11 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
@@ -50,6 +50,11 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
v8::Local<v8::Context> context,
const char* id,
Environment* optional_env);

View File

@@ -18,7 +18,7 @@ index a7329d279bb07542d3f4027e0c8e2b035d493e5b..5cff70923b4ea7a4df918b2d3d1fbc71
/**
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
index 7cec4e9a3e3675ba75d66a44ed4e142d13ca1821..0c7aad193442a7e5cab62638441969a7d4983ef9 100644
index 646b12382f6ebd073fe5968f8c1c0f36dbc64eac..15415e0652864d059390bc7383e073c86f5d0c03 100644
--- a/lib/internal/modules/esm/resolve.js
+++ b/lib/internal/modules/esm/resolve.js
@@ -824,6 +824,8 @@ function parsePackageName(specifier, base) {

View File

@@ -7,10 +7,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
This API is used by Electron to create Node's tracing controller.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 3e2e6a04ddd51e688f77e4f0f7db53b933cb2390..2e6f4a5c4b894a7425db110b3aadbe734f137327 100644
index a17495d93cd98f335f07d854cf8f405239164893..e0bacccd4514fcc9122f6b6e7a613141b2510157 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -490,6 +490,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
@@ -501,6 +501,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
return env->platform();
}

View File

@@ -17,7 +17,7 @@ Upstreams:
- https://github.com/nodejs/node/pull/39136
diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc
index 81ba818a2dc7d31aa6cadfb3a3c547e10631ecf3..6d5fbe2ffa81f379f7899b29f4b26bfbf590bc4e 100644
index 2685f5ea0bea998094453a5a29d23b1aaae55667..0ad4ba47b50a87bcf9e31a73c20a3a51be4ab96e 100644
--- a/src/crypto/crypto_cipher.cc
+++ b/src/crypto/crypto_cipher.cc
@@ -27,7 +27,8 @@ using v8::Value;
@@ -191,7 +191,7 @@ index dd69323b80076d7333b80453c9cc9ef5b680ce27..6431b768c83fa27b2287588e936f93ae
UNREACHABLE();
}
diff --git a/src/crypto/crypto_dsa.cc b/src/crypto/crypto_dsa.cc
index 862c091b05f5886479cedb8b95b756e4fd1547ee..c4cf3a59677ae9640e444f2649f89de3ab3c5c9e 100644
index 6839283fbf4ca7ee7dd586e749c80671ad965658..4e186abdf13613cbe576da5b7d547408c0ee9f93 100644
--- a/src/crypto/crypto_dsa.cc
+++ b/src/crypto/crypto_dsa.cc
@@ -40,7 +40,7 @@ namespace crypto {
@@ -228,7 +228,7 @@ index 2f9e9aacb1e652202d72c69b46f8e76d6c5405a8..5f19c38a78e37d3e8d92bcc20ae1357f
THROW_ERR_CRYPTO_OPERATION_FAILED(env, "could not generate prime");
return Nothing<bool>();
diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc
index 4eacb1f142b6e04d6db17ca267d1fb6814666a01..79ad930c8bea22cf1ca645373438cc2706777c12 100644
index 47a42246eddfc795b735f5efd08edf2832bbf6c1..7e6afaa1d3a4612fd567924b40438a318ac93bac 100644
--- a/src/crypto/crypto_rsa.cc
+++ b/src/crypto/crypto_rsa.cc
@@ -610,10 +610,11 @@ Maybe<bool> GetRsaKeyDetail(
@@ -309,7 +309,7 @@ index 28eb1bd6b7dc839fa6aefebe5813343c8e9444bb..1fe573cd7b6894743a0986e87802960a
} // namespace
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
index 716b40be50cdc2ebbd249e5a9d562385169f77ad..43247cf3d70b78a1e332d55336c2a5175a155e93 100644
index fd014e703454dd1988e9b5a013b937881c1f514a..0adbe57d582eff906476330083258716e5bcae99 100644
--- a/src/crypto/crypto_util.h
+++ b/src/crypto/crypto_util.h
@@ -15,6 +15,7 @@
@@ -321,10 +321,10 @@ index 716b40be50cdc2ebbd249e5a9d562385169f77ad..43247cf3d70b78a1e332d55336c2a517
#include <openssl/rsa.h>
#include <openssl/dsa.h>
diff --git a/src/node_metadata.cc b/src/node_metadata.cc
index d4c8ccde21d3973f3099ee3075dc3c11d55cb514..d57435a73e17c21dad2a7c8fb2c6e8a356630d88 100644
index ed28871c385532b13e102200ba549bb7d7e901e6..c69d3f1867cd1b86194b109351643d9520c661e7 100644
--- a/src/node_metadata.cc
+++ b/src/node_metadata.cc
@@ -10,7 +10,7 @@
@@ -13,7 +13,7 @@
#include "v8.h"
#include "zlib.h"
@@ -334,7 +334,7 @@ index d4c8ccde21d3973f3099ee3075dc3c11d55cb514..d57435a73e17c21dad2a7c8fb2c6e8a3
#if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h>
diff --git a/src/node_metadata.h b/src/node_metadata.h
index 89c2d36611ee7bca78fc0c818e720188d0cbd6fc..a40121abd28ae7c51f91eabae39db947ab0b12d5 100644
index 2a924141d6edbaade371dd29d553eb1107ff5f75..be37169bb1d5e70e11601ccf00db0552ee3511ed 100644
--- a/src/node_metadata.h
+++ b/src/node_metadata.h
@@ -6,7 +6,7 @@
@@ -347,7 +347,7 @@ index 89c2d36611ee7bca78fc0c818e720188d0cbd6fc..a40121abd28ae7c51f91eabae39db947
#if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h>
diff --git a/src/node_options.cc b/src/node_options.cc
index 633c574c8199c1f57b6e55b732ea6f3792bf9317..d0af2849045fbe0287836dffe5c5d0083f35557d 100644
index def333cfddef800fefb4244d7fad6e489a5dafed..99f5274aec7512956a5e13a5ca9c0b593a57cc7a 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -5,7 +5,7 @@
@@ -360,7 +360,7 @@ index 633c574c8199c1f57b6e55b732ea6f3792bf9317..d0af2849045fbe0287836dffe5c5d008
#endif
diff --git a/src/node_options.h b/src/node_options.h
index 6c9c929399f336dda2da4fe095d69c8f87970103..431536297e1a18b65f3c7a10883a736abcebe84d 100644
index 2e4da9decf3b4b05b89a586cda194a475e0cd41d..8fabd68975721ed27fd99ff50dbbfcb3158336e7 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -11,7 +11,7 @@

View File

@@ -37,7 +37,7 @@ index 3a3228ddc9eb6b53efc0721466479a9f62cd8967..175a67840348ca507d6e8b29835e5ab3
HistogramBase::kInternalFieldCount);
SetProtoMethodNoSideEffect(isolate, tmpl, "count", GetCount);
diff --git a/src/node_messaging.cc b/src/node_messaging.cc
index 009ac0056c5486a3f94889f70b592e26827d86a0..ba497064de834c4ea565bb267d1e95e4647b79eb 100644
index d1296fe20c290bd137cb0aa0c077d1672c18c7a1..1c0f54286f9269efa436ba0fbc730766224891c0 100644
--- a/src/node_messaging.cc
+++ b/src/node_messaging.cc
@@ -1495,13 +1495,16 @@ static void InitMessaging(Local<Object> target,

View File

@@ -7,7 +7,7 @@ Wc++98-compat-extra-semi is turned on for Electron so this
patch fixes that error in node.
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
index 97917c91c06dc47dfa6be2c194944cdc93e6bd7f..177390a24eb6490b128e22c104014e80f338c9d9 100644
index 1cdd436b343861a96582a803b460aefe1e81cdd0..0249574c4431fb5b98852699f1368f71b49691c1 100644
--- a/src/node_serdes.cc
+++ b/src/node_serdes.cc
@@ -32,7 +32,7 @@ namespace serdes {

View File

@@ -6,7 +6,7 @@ Subject: Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 33bc7f28a41c6c40face8f493d07d3c0061608a7..eb73c774118653c0746f78d4b72b31cb7c4f41f2 100644
index b942b37dd90498432728bf897fb6f694b7041ba5..9da60135ac79a2034a646c0a1380923f7fbfacab 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -137,6 +137,13 @@ const {
@@ -23,7 +23,7 @@ index 33bc7f28a41c6c40face8f493d07d3c0061608a7..eb73c774118653c0746f78d4b72b31cb
const {
isProxy
} = require('internal/util/types');
@@ -1213,10 +1220,12 @@ Module.prototype._compile = function(content, filename) {
@@ -1221,10 +1228,12 @@ Module.prototype._compile = function(content, filename) {
if (requireDepth === 0) statCache = new SafeMap();
if (inspectorWrapper) {
result = inspectorWrapper(compiledWrapper, thisValue, exports,

View File

@@ -7,10 +7,10 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index cbca692e0ef458aad9beea30d04e1152e1fed5e5..9cf2c2d71208ad960f54965ddefa98bea51bfa6a 100644
index 81b441a554e34556fc41066fc8761c713acb0ced..7dd89d5f134b09da2678dd54fa9139466fea179c 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -104,6 +104,10 @@ process.domain = null;
@@ -101,6 +101,10 @@ process.domain = null;
}
process._exiting = false;
@@ -22,7 +22,7 @@ index cbca692e0ef458aad9beea30d04e1152e1fed5e5..9cf2c2d71208ad960f54965ddefa98be
// release cycle, remove the Proxy and setter and update the
// getter to either return a read-only object or always return
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index eb73c774118653c0746f78d4b72b31cb7c4f41f2..44e4c22ebf39fc9c52f789173a2cc50300bcd181 100644
index 9da60135ac79a2034a646c0a1380923f7fbfacab..207142322bba89e94f4e3052a22bef6ffebcdc39 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -94,7 +94,7 @@ const fs = require('fs');

View File

@@ -0,0 +1,75 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 7 Feb 2023 10:53:11 +0100
Subject: src: allow optional isolation termination in node
This patch allows for node::Stop() to conditionally call
V8:Isolate::TerminateExecution().
We do not want to invoke a termination exception at exit when
we're running with only_terminate_in_safe_scope set to false. Heap and
coverage profilers run after environment exit and if there is a pending
exception at this stage then they will fail to generate the appropriate
profiles. Node.js does not call node::Stop(), which previously always
called isolate->TerminateExecution(), and therefore does not have this
issue when also running with only_terminate_in_safe_scope set to false.
diff --git a/src/env.cc b/src/env.cc
index 837a879864c46d6f500684444ec38583c05f8be2..69a8b9ea405a400254041734b037c00aff4758f7 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -902,10 +902,11 @@ void Environment::InitializeLibuv() {
StartProfilerIdleNotifier();
}
-void Environment::ExitEnv() {
+void Environment::ExitEnv(bool terminate) {
// Should not access non-thread-safe methods here.
set_stopping(true);
- isolate_->TerminateExecution();
+ if (terminate)
+ isolate_->TerminateExecution();
SetImmediateThreadsafe([](Environment* env) {
env->set_can_call_into_js(false);
uv_stop(env->event_loop());
diff --git a/src/env.h b/src/env.h
index 562610e6827d8302f146b81d599dd366ba25cd74..c358c139aafcd7c958915b036f8d176909341556 100644
--- a/src/env.h
+++ b/src/env.h
@@ -628,7 +628,7 @@ class Environment : public MemoryRetainer {
void RegisterHandleCleanups();
void CleanupHandles();
void Exit(int code);
- void ExitEnv();
+ void ExitEnv(bool terminate);
// Register clean-up cb to be called on environment destruction.
inline void RegisterHandleCleanup(uv_handle_t* handle,
diff --git a/src/node.cc b/src/node.cc
index 1067dee74c8877d9a3a0da6527c4c37faf9bd15f..b550fd4aa8488c6d721db3dee94cc4ce1346c708 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -1229,8 +1229,8 @@ int Start(int argc, char** argv) {
return LoadSnapshotDataAndRun(&snapshot_data, result.get());
}
-int Stop(Environment* env) {
- env->ExitEnv();
+int Stop(Environment* env, bool terminate) {
+ env->ExitEnv(terminate);
return 0;
}
diff --git a/src/node.h b/src/node.h
index 5a849f047feca5d4d101c21c125e1c0500150077..db9a9c5c54f176ffdfc67e045b970729341eee7f 100644
--- a/src/node.h
+++ b/src/node.h
@@ -316,7 +316,7 @@ NODE_EXTERN int Start(int argc, char* argv[]);
// Tear down Node.js while it is running (there are active handles
// in the loop and / or actively executing JavaScript code).
-NODE_EXTERN int Stop(Environment* env);
+NODE_EXTERN int Stop(Environment* env, bool terminate = true);
// This runs a subset of the initialization performed by
// InitializeOncePerProcess(), which supersedes this function.

View File

@@ -7,7 +7,7 @@ This refactors several allocators to allocate within the V8 memory cage,
allowing them to be compatible with the V8_SANDBOXED_POINTERS feature.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 2e6f4a5c4b894a7425db110b3aadbe734f137327..c0c422e969543dcd570dabfd8ff0755abe37face 100644
index e0bacccd4514fcc9122f6b6e7a613141b2510157..e3c42d892eed8dd605301348c08ad24f4362a7aa 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -86,6 +86,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
@@ -105,7 +105,7 @@ index 1fe573cd7b6894743a0986e87802960ad09e2dd9..ff1346f65f3c280da9962df87eb0710a
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
#ifndef OPENSSL_IS_BORINGSSL
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
index 43247cf3d70b78a1e332d55336c2a5175a155e93..b9066b4b0fb9a529c4cbf774e5aacfd8a7aa99c8 100644
index 0adbe57d582eff906476330083258716e5bcae99..e2fb3e67900cc1dd0e77b81dd9fad225ea0ac272 100644
--- a/src/crypto/crypto_util.h
+++ b/src/crypto/crypto_util.h
@@ -280,7 +280,7 @@ class ByteSource {
@@ -118,7 +118,7 @@ index 43247cf3d70b78a1e332d55336c2a5175a155e93..b9066b4b0fb9a529c4cbf774e5aacfd8
v8::Local<v8::ArrayBuffer> ToArrayBuffer(Environment* env);
diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index 808f1fa8d77718e0d44033203485fb2c2796d8e1..56ea735e74fe6d4296d3b179ccb9792daac568b5 100644
index d5d8943f1c66159ad8f345d8909275137b097ec2..21a99269711035b02efabe87309a62c27e3d8cb0 100644
--- a/src/node_i18n.cc
+++ b/src/node_i18n.cc
@@ -104,7 +104,7 @@ namespace {
@@ -131,7 +131,7 @@ index 808f1fa8d77718e0d44033203485fb2c2796d8e1..56ea735e74fe6d4296d3b179ccb9792d
return ret;
diff --git a/src/node_internals.h b/src/node_internals.h
index efbdbeabf5a6afb658cbdc7888f94952e55f4f71..8b37639361e8902d7e1481071d3ec24be30339e0 100644
index ece9a4cfd45bf885169fdd278e09c467c6b4bbab..0c0dac67c0834ab7feba4260796292456a24c08d 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -99,7 +99,9 @@ v8::Maybe<bool> InitializePrimordials(v8::Local<v8::Context> context);
@@ -155,7 +155,7 @@ index efbdbeabf5a6afb658cbdc7888f94952e55f4f71..8b37639361e8902d7e1481071d3ec24b
// Delegate to V8's allocator for compatibility with the V8 memory cage.
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
index 45a16d9de43703c2115dde85c9faae3a04be2a88..97917c91c06dc47dfa6be2c194944cdc93e6bd7f 100644
index 6864f2d88b34abfa4090780d6993684cd0b366a3..1cdd436b343861a96582a803b460aefe1e81cdd0 100644
--- a/src/node_serdes.cc
+++ b/src/node_serdes.cc
@@ -29,6 +29,11 @@ using v8::ValueSerializer;
@@ -238,12 +238,12 @@ index 45a16d9de43703c2115dde85c9faae3a04be2a88..97917c91c06dc47dfa6be2c194944cdc
if (!buf.IsEmpty()) {
args.GetReturnValue().Set(buf.ToLocalChecked());
diff --git a/test/parallel/test-v8-serialize-leak.js b/test/parallel/test-v8-serialize-leak.js
index a90c398adcdaf30491a0fecdcf00895038d62e69..f5b8a1430ad2033eae06ca0157af2fb51d3f36a5 100644
index 696dbfea65ba95b1157cb6f469762d4a6e196199..b342ec59100809187689d0770a462b0b99e75e58 100644
--- a/test/parallel/test-v8-serialize-leak.js
+++ b/test/parallel/test-v8-serialize-leak.js
@@ -23,5 +23,5 @@ const after = process.memoryUsage.rss();
if (process.config.variables.asan) {
assert(after < before * 10, `asan: before=${before} after=${after}`);
@@ -25,5 +25,5 @@ if (process.config.variables.asan) {
} else if (process.config.variables.node_builtin_modules_path) {
assert(after < before * 4, `node_builtin_modules_path: before=${before} after=${after}`);
} else {
- assert(after < before * 2, `before=${before} after=${after}`);
+ assert(after < before * 3, `before=${before} after=${after}`);

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Wed, 8 Feb 2023 02:54:05 -0800
Subject: test: mark cpu prof tests as flaky in electron
Instead of disabling the tests, flag them as flaky so they still run
but don't cause CI failures on flakes.
diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status
index 5d88747b7066ce795b091eaaec2a5653f42b2c26..e3c7b531bc519bc97f363a1d4e7df2f059b11614 100644
--- a/test/sequential/sequential.status
+++ b/test/sequential/sequential.status
@@ -7,6 +7,15 @@ prefix sequential
[true] # This section applies to all platforms
# https://github.com/nodejs/node/issues/27611#issuecomment-613100468
test-cpu-prof-dir-worker: PASS, FLAKY
+test-cpu-prof-dir-and-name: PASS, FLAKY
+test-cpu-prof-worker-argv: PASS, FLAKY
+test-cpu-prof-default: PASS, FLAKY
+test-cpu-prof-dir-absolute: PASS, FLAKY
+test-cpu-prof-dir-relative: PASS, FLAKY
+test-cpu-prof-exit: PASS, FLAKY
+test-cpu-prof-name: PASS, FLAKY
+test-worker-prof: PASS, FLAKY
+test-inspector-stop-profile-after-done: PASS, FLAKY
# https://github.com/nodejs/node/issues/44898
test-watch-mode: PASS, FLAKY
test-watch-mode-inspect: PASS, FLAKY

View File

@@ -6,8 +6,6 @@ workaround_an_undefined_symbol_error.patch
do_not_export_private_v8_symbols_on_windows.patch
fix_build_deprecated_attribute_for_older_msvc_versions.patch
fix_disable_implies_dcheck_for_node_stream_array_buffers.patch
revert_runtime_dhceck_terminating_exception_in_microtasks.patch
chore_disable_is_execution_terminating_dcheck.patch
force_cppheapcreateparams_to_be_noncopyable.patch
chore_allow_customizing_microtask_policy_per_context.patch
disable_the_use_of_preserve_most_on_arm64_windows.patch

View File

@@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 31 May 2022 19:58:01 +0200
Subject: chore: disable is_execution_terminating DCHECK
This causes a slew of crashes in Node.js.
Upstream issue opened at https://github.com/nodejs/node-v8/issues/227.
diff --git a/src/api/api-macros.h b/src/api/api-macros.h
index 149dd0555a69be576fd1eb97aa79b8aedafcac04..233e6d2ac511c4a7fa45d47bb7448beead52faf1 100644
--- a/src/api/api-macros.h
+++ b/src/api/api-macros.h
@@ -97,8 +97,6 @@
// Lightweight version for APIs that don't require an active context.
#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) \
- /* Embedders should never enter V8 after terminating it */ \
- DCHECK(!i_isolate->is_execution_terminating()); \
DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate)
#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \
diff --git a/src/execution/microtask-queue.cc b/src/execution/microtask-queue.cc
index ac48de9b499aed29a09ba918ddabfa67cd5485da..aa50aeb1d4f3943f83ded5e328b4a65bcfbc7317 100644
--- a/src/execution/microtask-queue.cc
+++ b/src/execution/microtask-queue.cc
@@ -180,7 +180,7 @@ int MicrotaskQueue::RunMicrotasks(Isolate* isolate) {
if (isolate->is_execution_terminating()) {
DCHECK(isolate->has_scheduled_exception());
- DCHECK(maybe_result.is_null());
+ // DCHECK(maybe_result.is_null());
delete[] ring_buffer_;
ring_buffer_ = nullptr;
capacity_ = 0;

View File

@@ -1,48 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Rose <japthorp@slack-corp.com>
Date: Mon, 9 May 2022 17:09:21 -0700
Subject: Revert "[runtime] DHCECK terminating exception in Microtasks"
This reverts commit bccb536c98181e8a6e9cf0b6342311adbbf61aca.
diff --git a/src/builtins/builtins-microtask-queue-gen.cc b/src/builtins/builtins-microtask-queue-gen.cc
index f58636fee555d782e18b7521c0c4f28ed60b3a52..6b0c63b34ff09f70cb9a4fe419f3b9bb0adf6790 100644
--- a/src/builtins/builtins-microtask-queue-gen.cc
+++ b/src/builtins/builtins-microtask-queue-gen.cc
@@ -118,7 +118,6 @@ void MicrotaskQueueBuiltinsAssembler::PrepareForContext(
void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
TNode<Context> current_context, TNode<Microtask> microtask) {
CSA_DCHECK(this, TaggedIsNotSmi(microtask));
- CSA_DCHECK(this, Word32BinaryNot(IsExecutionTerminating()));
StoreRoot(RootIndex::kCurrentMicrotask, microtask);
TNode<IntPtrT> saved_entered_context_count = GetEnteredContextCount();
diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc
index 7d47afa2c92c1da43657702d5a85251646d680fd..10c3ec8387522ce2e35b77a7e6eb04de22597349 100644
--- a/src/codegen/code-stub-assembler.cc
+++ b/src/codegen/code-stub-assembler.cc
@@ -6417,12 +6417,6 @@ void CodeStubAssembler::SetPendingMessage(TNode<HeapObject> message) {
StoreFullTaggedNoWriteBarrier(pending_message, message);
}
-TNode<BoolT> CodeStubAssembler::IsExecutionTerminating() {
- TNode<HeapObject> pending_message = GetPendingMessage();
- return TaggedEqual(pending_message,
- LoadRoot(RootIndex::kTerminationException));
-}
-
TNode<BoolT> CodeStubAssembler::InstanceTypeEqual(TNode<Int32T> instance_type,
int type) {
return Word32Equal(instance_type, Int32Constant(type));
diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h
index fdd6da601705f72bd5d1a9101171048bdf408b9d..496c73225f8641e78793ba74d80e2e8b1e3f5c02 100644
--- a/src/codegen/code-stub-assembler.h
+++ b/src/codegen/code-stub-assembler.h
@@ -2550,7 +2550,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<HeapObject> GetPendingMessage();
void SetPendingMessage(TNode<HeapObject> message);
- TNode<BoolT> IsExecutionTerminating();
// Type checks.
// Check whether the map is for an object with special properties, such as a

View File

@@ -134,9 +134,6 @@
"parallel/test-webcrypto-export-import-cfrg",
"parallel/test-webcrypto-keygen",
"parallel/test-webcrypto-sign-verify-eddsa",
"parallel/test-worker-debug",
"parallel/test-worker-init-failure",
"parallel/test-worker-stdio",
"parallel/test-zlib-unused-weak",
"report/test-report-fatalerror-oomerror-set",
"report/test-report-fatalerror-oomerror-directory",

View File

@@ -29,6 +29,7 @@ const defaultOptions = [
'default',
`--skip-tests=${DISABLED_TESTS.join(',')}`,
'--flaky-tests=dontcare',
'--measure-flakiness=9',
'--shell',
utils.getAbsoluteElectronExec(),
'-J'

View File

@@ -14,8 +14,8 @@ const ROLLER_BRANCH_PATTERN = /^roller\/chromium$/;
const DEFAULT_BUILD_CLOUD_ID = '1598';
const DEFAULT_BUILD_CLOUD = 'electronhq-16-core';
const DEFAULT_BAKE_BASE_IMAGE = 'e-110.0.5451.0';
const DEFAULT_BUILD_IMAGE = 'e-110.0.5451.0';
const DEFAULT_BAKE_BASE_IMAGE = 'e-111.0.5560.0-node18';
const DEFAULT_BUILD_IMAGE = 'e-111.0.5560.0-node18';
const appveyorBakeJob = 'electron-bake-image';
const appVeyorJobs = {

View File

@@ -13,6 +13,7 @@ const fs = require('fs');
const { execSync } = require('child_process');
const got = require('got');
const path = require('path');
const semver = require('semver');
const temp = require('temp').track();
const { URL } = require('url');
const { BlobServiceClient } = require('@azure/storage-blob');
@@ -317,12 +318,20 @@ function saveShaSumFile (checksums, fileName) {
}
async function publishRelease (release) {
const currentLatest = await octokit.repos.getLatestRelease({
owner: 'electron',
repo: targetRepo
});
const makeLatest = !release.prerelease && semver.gte(release.tag_name, currentLatest.data.tag_name);
return octokit.repos.updateRelease({
owner: 'electron',
repo: targetRepo,
release_id: release.id,
tag_name: release.tag_name,
draft: false
draft: false,
make_latest: makeLatest ? 'true' : 'false'
}).catch(err => {
console.log(`${fail} Error publishing release:`, err);
process.exit(1);

View File

@@ -56,7 +56,8 @@ REM Install Windows SDK
choco install windows-sdk-10-version-2104-all
REM Install nodejs python git and yarn needed dependencies
choco install -y nodejs-lts python2 git yarn
choco install -y --force nodejs --version=18.12.1
choco install -y python2 git yarn
choco install python --version 3.7.9
call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd
SET PATH=C:\Python27\;C:\Python27\Scripts;C:\Python39\;C:\Python39\Scripts;%PATH%

View File

@@ -146,8 +146,8 @@ int NodeMain(int argc, char* argv[]) {
feature_list->InitializeFromCommandLine("", "");
base::FeatureList::SetInstance(std::move(feature_list));
// Explicitly register electron's builtin modules.
NodeBindings::RegisterBuiltinModules();
// Explicitly register electron's builtin bindings.
NodeBindings::RegisterBuiltinBindings();
// Parse and set Node.js cli flags.
int flags_exit_code = SetNodeCliFlags();
@@ -226,7 +226,8 @@ int NodeMain(int argc, char* argv[]) {
uint64_t env_flags = node::EnvironmentFlags::kDefaultFlags |
node::EnvironmentFlags::kHideConsoleWindows;
env = node::CreateEnvironment(
isolate_data, gin_env.context(), result->args(), result->exec_args(),
isolate_data, isolate->GetCurrentContext(), result->args(),
result->exec_args(),
static_cast<node::EnvironmentFlags::Flags>(env_flags));
CHECK_NE(nullptr, env);
@@ -259,41 +260,14 @@ int NodeMain(int argc, char* argv[]) {
v8::HandleScope scope(isolate);
node::LoadEnvironment(env, node::StartExecutionCallback{});
env->set_trace_sync_io(env->options()->trace_sync_io);
{
v8::SealHandleScope seal(isolate);
bool more;
env->performance_state()->Mark(
node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_START);
do {
uv_run(env->event_loop(), UV_RUN_DEFAULT);
gin_env.platform()->DrainTasks(isolate);
more = uv_loop_alive(env->event_loop());
if (more && !env->is_stopping())
continue;
if (!uv_loop_alive(env->event_loop())) {
EmitBeforeExit(env);
}
// Emit `beforeExit` if the loop became alive either after emitting
// event, or after running some callbacks.
more = uv_loop_alive(env->event_loop());
} while (more && !env->is_stopping());
env->performance_state()->Mark(
node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_EXIT);
}
env->set_trace_sync_io(false);
exit_code = node::EmitExit(env);
// Potential reasons we get Nothing here may include: the env
// is stopping, or the user hooks process.emit('exit').
exit_code = node::SpinEventLoop(env).FromMaybe(1);
node::ResetStdio();
node::Stop(env);
node::Stop(env, false);
node::FreeEnvironment(env);
node::FreeIsolateData(isolate_data);
}

View File

@@ -1865,4 +1865,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_app, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_app, Initialize)

View File

@@ -149,4 +149,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_auto_updater, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_auto_updater, Initialize)

View File

@@ -1359,4 +1359,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_base_window, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_base_window, Initialize)

View File

@@ -221,4 +221,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_browser_view, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_browser_view, Initialize)

View File

@@ -112,7 +112,6 @@ BrowserWindow::~BrowserWindow() {
api_web_contents_->RemoveObserver(this);
// Destroy the WebContents.
OnCloseContents();
api_web_contents_->Destroy();
}
}
@@ -140,6 +139,7 @@ void BrowserWindow::WebContentsDestroyed() {
void BrowserWindow::OnCloseContents() {
BaseWindow::ResetBrowserViews();
api_web_contents_->Destroy();
}
void BrowserWindow::OnRendererResponsive(content::RenderProcessHost*) {
@@ -488,4 +488,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_window, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_window, Initialize)

View File

@@ -178,4 +178,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_content_tracing, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_content_tracing, Initialize)

View File

@@ -128,10 +128,10 @@ bool MatchesCookie(const base::Value::Dict& filter,
!MatchesDomain(*str, cookie.Domain()))
return false;
absl::optional<bool> secure_filter = filter.FindBool("secure");
if (secure_filter && *secure_filter == cookie.IsSecure())
if (secure_filter && *secure_filter != cookie.IsSecure())
return false;
absl::optional<bool> session_filter = filter.FindBool("session");
if (session_filter && *session_filter != !cookie.IsPersistent())
if (session_filter && *session_filter == cookie.IsPersistent())
return false;
return true;
}

View File

@@ -279,4 +279,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_crash_reporter, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_crash_reporter, Initialize)

View File

@@ -356,4 +356,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_desktop_capturer, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_desktop_capturer, Initialize)

View File

@@ -105,4 +105,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_dialog, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_dialog, Initialize)

View File

@@ -25,4 +25,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_event, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_event, Initialize)

View File

@@ -46,4 +46,4 @@ v8::Local<v8::Object> GetEventEmitterPrototype(v8::Isolate* isolate) {
} // namespace electron
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_event_emitter, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_event_emitter, Initialize)

View File

@@ -195,4 +195,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_global_shortcut, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_global_shortcut, Initialize)

View File

@@ -230,4 +230,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_in_app_purchase, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_in_app_purchase, Initialize)

View File

@@ -321,4 +321,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_menu, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_menu, Initialize)

View File

@@ -170,4 +170,4 @@ bool Converter<ui::NativeTheme::ThemeSource>::FromV8(
} // namespace gin
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_native_theme, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_native_theme, Initialize)

View File

@@ -58,4 +58,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_net, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_net, Initialize)

View File

@@ -299,4 +299,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_notification, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_notification, Initialize)

View File

@@ -154,4 +154,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_power_monitor, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_power_monitor, Initialize)

View File

@@ -139,5 +139,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_power_save_blocker,
Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_power_save_blocker,
Initialize)

View File

@@ -111,4 +111,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_printing, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_printing, Initialize)

View File

@@ -339,4 +339,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_protocol, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_protocol, Initialize)

View File

@@ -73,5 +73,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_push_notifications,
Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_push_notifications,
Initialize)

View File

@@ -131,4 +131,4 @@ void Initialize(v8::Local<v8::Object> exports,
dict.SetMethod("decryptString", &electron::safestorage::DecryptString);
}
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_safe_storage, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_safe_storage, Initialize)

View File

@@ -196,4 +196,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_screen, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_screen, Initialize)

View File

@@ -1313,4 +1313,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_session, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_session, Initialize)

View File

@@ -132,5 +132,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_system_preferences,
Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_system_preferences,
Initialize)

View File

@@ -436,4 +436,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_tray, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_tray, Initialize)

View File

@@ -417,4 +417,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_utility_process, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_utility_process, Initialize)

View File

@@ -76,4 +76,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_view, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_view, Initialize)

View File

@@ -1222,7 +1222,9 @@ void WebContents::CloseContents(content::WebContents* source) {
for (ExtendedWebContentsObserver& observer : observers_)
observer.OnCloseContents();
Destroy();
// If there are observers, OnCloseContents will call Destroy()
if (observers_.empty())
Destroy();
}
void WebContents::ActivateContents(content::WebContents* source) {
@@ -4244,4 +4246,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_contents, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_web_contents, Initialize)

View File

@@ -131,4 +131,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_contents_view, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_web_contents_view,
Initialize)

View File

@@ -459,4 +459,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_frame_main, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_web_frame_main, Initialize)

View File

@@ -47,4 +47,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_view_manager, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_web_view_manager, Initialize)

View File

@@ -293,4 +293,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_message_port, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_message_port, Initialize)

View File

@@ -56,4 +56,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_image_view, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_image_view, Initialize)

View File

@@ -273,7 +273,7 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
node_bindings_->Initialize();
// Create the global environment.
node::Environment* env = node_bindings_->CreateEnvironment(
js_env_->context(), js_env_->platform());
js_env_->isolate()->GetCurrentContext(), js_env_->platform());
node_env_ = std::make_unique<NodeEnvironment>(env);
env->set_trace_sync_io(env->options()->trace_sync_io);
@@ -626,7 +626,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
// invoke Node/V8 APIs inside them.
node_env_->env()->set_trace_sync_io(false);
js_env_->DestroyMicrotasksRunner();
node::Stop(node_env_->env());
node::Stop(node_env_->env(), false);
node_env_.reset();
auto default_context_key = ElectronBrowserContext::PartitionKey("", false);

View File

@@ -74,22 +74,45 @@ struct base::trace_event::TraceValue::Helper<
namespace electron {
namespace {
gin::IsolateHolder CreateIsolateHolder(v8::Isolate* isolate) {
std::unique_ptr<v8::Isolate::CreateParams> create_params =
gin::IsolateHolder::getDefaultIsolateParams();
// Align behavior with V8 Isolate default for Node.js.
// This is necessary for important aspects of Node.js
// including heap and cpu profilers to function properly.
//
// Additional note:
// We do not want to invoke a termination exception at exit when
// we're running with only_terminate_in_safe_scope set to false. Heap and
// coverage profilers run after environment exit and if there is a pending
// exception at this stage then they will fail to generate the appropriate
// profiles. Node.js does not call node::Stop(), which calls
// isolate->TerminateExecution(), and therefore does not have this issue
// when also running with only_terminate_in_safe_scope set to false.
create_params->only_terminate_in_safe_scope = false;
return gin::IsolateHolder(
base::SingleThreadTaskRunner::GetCurrentDefault(),
gin::IsolateHolder::kSingleThread,
gin::IsolateHolder::IsolateType::kUtility, std::move(create_params),
gin::IsolateHolder::IsolateCreationMode::kNormal, isolate);
}
} // namespace
JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop,
bool setup_wasm_streaming)
: isolate_(Initialize(event_loop, setup_wasm_streaming)),
isolate_holder_(base::SingleThreadTaskRunner::GetCurrentDefault(),
gin::IsolateHolder::kSingleThread,
gin::IsolateHolder::kAllowAtomicsWait,
gin::IsolateHolder::IsolateType::kUtility,
gin::IsolateHolder::IsolateCreationMode::kNormal,
nullptr,
nullptr,
isolate_),
isolate_holder_(CreateIsolateHolder(isolate_)),
locker_(isolate_) {
isolate_->Enter();
v8::HandleScope scope(isolate_);
auto context = node::NewContext(isolate_);
context_ = v8::Global<v8::Context>(isolate_, context);
CHECK(!context.IsEmpty());
context->Enter();
}
@@ -99,7 +122,7 @@ JavascriptEnvironment::~JavascriptEnvironment() {
{
v8::HandleScope scope(isolate_);
context_.Get(isolate_)->Exit();
isolate_->GetCurrentContext()->Exit();
}
isolate_->Exit();
g_isolate = nullptr;
@@ -267,7 +290,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
platform_ = node::MultiIsolatePlatform::Create(
base::RecommendedMaxNumberOfThreadsInThreadGroup(3, 8, 0.1, 0),
tracing_controller, gin::V8Platform::PageAllocator());
tracing_controller, gin::V8Platform::GetCurrentPageAllocator());
v8::V8::InitializePlatform(platform_.get());
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,

View File

@@ -22,8 +22,8 @@ class MicrotasksRunner;
// Manage the V8 isolate and context automatically.
class JavascriptEnvironment {
public:
explicit JavascriptEnvironment(uv_loop_t* event_loop,
bool setup_wasm_streaming = false);
JavascriptEnvironment(uv_loop_t* event_loop,
bool setup_wasm_streaming = false);
~JavascriptEnvironment();
// disable copy
@@ -35,9 +35,6 @@ class JavascriptEnvironment {
node::MultiIsolatePlatform* platform() const { return platform_.get(); }
v8::Isolate* isolate() const { return isolate_; }
v8::Local<v8::Context> context() const {
return v8::Local<v8::Context>::New(isolate_, context_);
}
static v8::Isolate* GetIsolate();
@@ -48,7 +45,6 @@ class JavascriptEnvironment {
v8::Isolate* isolate_;
gin::IsolateHolder isolate_holder_;
v8::Locker locker_;
v8::Global<v8::Context> context_;
std::unique_ptr<MicrotasksRunner> microtasks_runner_;
};

View File

@@ -36,4 +36,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_crashpad_support, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_crashpad_support, Initialize)

View File

@@ -246,4 +246,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_asar, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_asar, Initialize)

View File

@@ -291,4 +291,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_clipboard, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_clipboard, Initialize)

View File

@@ -67,4 +67,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_command_line, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_command_line, Initialize)

View File

@@ -42,4 +42,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_environment, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_environment, Initialize)

View File

@@ -641,4 +641,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_native_image, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_native_image, Initialize)

View File

@@ -186,4 +186,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_shell, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_shell, Initialize)

View File

@@ -44,5 +44,5 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_testing, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_testing, Initialize)
#endif

View File

@@ -138,4 +138,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_v8_util, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_v8_util, Initialize)

View File

@@ -84,4 +84,4 @@ void Initialize(v8::Local<v8::Object> exports,
} // namespace
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_common_features, Initialize)
NODE_LINKED_BINDING_CONTEXT_AWARE(electron_common_features, Initialize)

Some files were not shown because too many files have changed in this diff Show More