mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
107 Commits
v15.0.0-ni
...
v14.0.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
678c8382e2 | ||
|
|
aab2479d94 | ||
|
|
6b530bf62d | ||
|
|
a32c39955e | ||
|
|
d27adae569 | ||
|
|
2a3aa7ee0d | ||
|
|
6d89edf590 | ||
|
|
ebd1261e58 | ||
|
|
9957887412 | ||
|
|
a5a8b92894 | ||
|
|
94bce49d0f | ||
|
|
4b59ebefb8 | ||
|
|
5a202219b6 | ||
|
|
f5392751d1 | ||
|
|
8486a73b86 | ||
|
|
23a5789af6 | ||
|
|
9a6ac40593 | ||
|
|
5530497c82 | ||
|
|
5d6b8919b7 | ||
|
|
755af34e1c | ||
|
|
b49248d34c | ||
|
|
272f9db3f8 | ||
|
|
5c3670c68c | ||
|
|
dfe061017f | ||
|
|
d79d073513 | ||
|
|
2dbe781ea3 | ||
|
|
c0d5a148e5 | ||
|
|
fe2f8c31c2 | ||
|
|
3f8f78de50 | ||
|
|
8cd0c8152e | ||
|
|
0fe50bb64e | ||
|
|
e203029c4c | ||
|
|
19cbb030d0 | ||
|
|
12f835858e | ||
|
|
6d39c35de7 | ||
|
|
879b32840b | ||
|
|
5b2a6f6a2b | ||
|
|
0d72f4ee48 | ||
|
|
1666664502 | ||
|
|
4055bf0d58 | ||
|
|
bc0cd83447 | ||
|
|
17c3649811 | ||
|
|
56926d9bee | ||
|
|
2f4e729f8d | ||
|
|
1789cfa5d3 | ||
|
|
5e3bdfd920 | ||
|
|
6128e25ace | ||
|
|
2fcd000f0c | ||
|
|
f1fcdbd4a0 | ||
|
|
014409f98e | ||
|
|
3b39ff300b | ||
|
|
e81d3756d5 | ||
|
|
789bfe627b | ||
|
|
f465439843 | ||
|
|
066e356ada | ||
|
|
7665ba0838 | ||
|
|
b884381311 | ||
|
|
1d0be9d6ed | ||
|
|
f4ed98c43b | ||
|
|
faf3477388 | ||
|
|
8cf7c46570 | ||
|
|
dd5dd2a426 | ||
|
|
0e673d069d | ||
|
|
d24de10707 | ||
|
|
6a429e9d04 | ||
|
|
172ac25013 | ||
|
|
e3a613d103 | ||
|
|
73696eadde | ||
|
|
bdbf78dca8 | ||
|
|
40dbeb6836 | ||
|
|
3ff100521d | ||
|
|
f1752a0b6f | ||
|
|
e67b244571 | ||
|
|
fef79701e0 | ||
|
|
c2877a342c | ||
|
|
4e610b1948 | ||
|
|
4d30e7618a | ||
|
|
7381738d85 | ||
|
|
0f2ad3e384 | ||
|
|
b8812c8942 | ||
|
|
7a11390b8a | ||
|
|
6ab2684234 | ||
|
|
80f051d859 | ||
|
|
95e7c6d53a | ||
|
|
1b4c3428a9 | ||
|
|
8edb7b456f | ||
|
|
6362736703 | ||
|
|
670ae438b9 | ||
|
|
10c6959c7f | ||
|
|
1066dce975 | ||
|
|
d584afdf5b | ||
|
|
0d69ba8ca2 | ||
|
|
c2ba3ab114 | ||
|
|
72a33e79d0 | ||
|
|
3ee0536b1d | ||
|
|
846a12056d | ||
|
|
e0f6313739 | ||
|
|
8866b312ad | ||
|
|
cb8fada7a0 | ||
|
|
b983bda721 | ||
|
|
3125ec093d | ||
|
|
a27329d9ad | ||
|
|
5362882cf6 | ||
|
|
c58446d9d7 | ||
|
|
1c2ed2ba95 | ||
|
|
1c0e496ee2 | ||
|
|
0f32b0f1ce |
@@ -17,24 +17,46 @@ parameters:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
run-linux-x64-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-ia32-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-arm-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-arm64-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-osx-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-osx-publish-arm64:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-mas-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-mas-publish-arm64:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
linux-publish-arch-limit:
|
||||
type: enum
|
||||
default: all
|
||||
enum: ["all", "arm", "arm64", "x64", "ia32"]
|
||||
|
||||
run-macos-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
macos-publish-arch-limit:
|
||||
type: enum
|
||||
default: all
|
||||
enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]
|
||||
|
||||
# Executors
|
||||
executors:
|
||||
linux-docker:
|
||||
@@ -590,13 +612,21 @@ step-electron-dist-build: &step-electron-dist-build
|
||||
fi
|
||||
fi
|
||||
|
||||
step-electron-maybe-chromedriver-gn-gen: &step-electron-maybe-chromedriver-gn-gen
|
||||
run:
|
||||
name: chromedriver GN gen
|
||||
command: |
|
||||
cd src
|
||||
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
|
||||
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
fi
|
||||
|
||||
step-electron-chromedriver-build: &step-electron-chromedriver-build
|
||||
run:
|
||||
name: Build chromedriver.zip
|
||||
command: |
|
||||
cd src
|
||||
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
|
||||
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
export CHROMEDRIVER_DIR="out/chromedriver"
|
||||
else
|
||||
export CHROMEDRIVER_DIR="out/Default"
|
||||
@@ -1493,6 +1523,7 @@ commands:
|
||||
- *step-maybe-cross-arch-snapshot
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
|
||||
- when:
|
||||
@@ -1588,6 +1619,7 @@ commands:
|
||||
- *step-mksnapshot-build
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
|
||||
# Node.js headers
|
||||
@@ -1798,16 +1830,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
- equal: ["x64", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-ia32-testing:
|
||||
executor: linux-docker
|
||||
@@ -1847,16 +1872,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
- equal: ["ia32", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-arm-testing:
|
||||
executor: linux-docker
|
||||
@@ -1899,16 +1917,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
- equal: ["arm", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-arm64-testing:
|
||||
executor: linux-docker
|
||||
@@ -1960,16 +1971,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
- equal: ["arm64", << pipeline.parameters.linux-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
osx-testing-x64:
|
||||
executor: macos
|
||||
@@ -1995,6 +1999,31 @@ jobs:
|
||||
<<: *env-testing-build
|
||||
<<: *steps-electron-gn-check
|
||||
|
||||
osx-publish-x64:
|
||||
executor: macos
|
||||
environment:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
osx-publish-arm64:
|
||||
executor: macos
|
||||
environment:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-release-build
|
||||
<<: *env-apple-silicon
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
osx-publish-x64-skip-checkout:
|
||||
executor: macos
|
||||
environment:
|
||||
@@ -2003,16 +2032,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
- equal: ["osx-x64", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
osx-publish-arm64-skip-checkout:
|
||||
executor: macos
|
||||
@@ -2023,16 +2045,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
- equal: ["osx-arm64", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
osx-testing-arm64:
|
||||
executor: macos
|
||||
@@ -2076,6 +2091,32 @@ jobs:
|
||||
<<: *env-mas
|
||||
<<: *env-testing-build
|
||||
<<: *steps-electron-gn-check
|
||||
|
||||
mas-publish:
|
||||
executor: macos
|
||||
environment:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-mas
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
mas-publish-arm64:
|
||||
executor: macos
|
||||
environment:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-mas-apple-silicon
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
mas-publish-x64-skip-checkout:
|
||||
executor: macos
|
||||
@@ -2085,16 +2126,9 @@ jobs:
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
- equal: ["mas-x64", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
mas-publish-arm64-skip-checkout:
|
||||
executor: macos
|
||||
@@ -2105,16 +2139,9 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- run: echo running
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
- equal: ["mas-arm64", << pipeline.parameters.macos-publish-arch-limit >>]
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
mas-testing-arm64:
|
||||
executor: macos
|
||||
@@ -2353,6 +2380,12 @@ jobs:
|
||||
workflows:
|
||||
version: 2.1
|
||||
|
||||
# The publish workflows below each contain one job so that they are
|
||||
# compatible with how sudowoodo works today. If these workflows are
|
||||
# changed to have multiple jobs, then scripts/release/ci-release-build.js
|
||||
# will need to be updated and there will most likely need to be changes to
|
||||
# sudowoodo
|
||||
|
||||
publish-linux:
|
||||
when: << pipeline.parameters.run-linux-publish >>
|
||||
jobs:
|
||||
@@ -2365,6 +2398,54 @@ workflows:
|
||||
- linux-arm64-publish:
|
||||
context: release-env
|
||||
|
||||
publish-x64-linux:
|
||||
when: << pipeline.parameters.run-linux-x64-publish >>
|
||||
jobs:
|
||||
- linux-x64-publish:
|
||||
context: release-env
|
||||
|
||||
publish-ia32-linux:
|
||||
when: << pipeline.parameters.run-linux-ia32-publish >>
|
||||
jobs:
|
||||
- linux-ia32-publish:
|
||||
context: release-env
|
||||
|
||||
publish-arm-linux:
|
||||
when: << pipeline.parameters.run-linux-arm-publish >>
|
||||
jobs:
|
||||
- linux-arm-publish:
|
||||
context: release-env
|
||||
|
||||
publish-arm64-linux:
|
||||
when: << pipeline.parameters.run-linux-arm64-publish >>
|
||||
jobs:
|
||||
- linux-arm64-publish:
|
||||
context: release-env
|
||||
|
||||
publish-osx:
|
||||
when: << pipeline.parameters.run-osx-publish >>
|
||||
jobs:
|
||||
- osx-publish-x64:
|
||||
context: release-env
|
||||
|
||||
publish-mas:
|
||||
when: << pipeline.parameters.run-mas-publish >>
|
||||
jobs:
|
||||
- mas-publish:
|
||||
context: release-env
|
||||
|
||||
publish-osx-arm64:
|
||||
when: << pipeline.parameters.run-osx-publish-arm64 >>
|
||||
jobs:
|
||||
- osx-publish-arm64:
|
||||
context: release-env
|
||||
|
||||
publish-mas-arm64:
|
||||
when: << pipeline.parameters.run-mas-publish-arm64 >>
|
||||
jobs:
|
||||
- mas-publish-arm64:
|
||||
context: release-env
|
||||
|
||||
publish-macos:
|
||||
when: << pipeline.parameters.run-macos-publish >>
|
||||
jobs:
|
||||
|
||||
@@ -22,8 +22,5 @@
|
||||
"no-trailing-spaces": {
|
||||
"br_spaces": 0
|
||||
},
|
||||
"single-h1": false,
|
||||
"no-inline-html": {
|
||||
"allowed_elements": ["br"]
|
||||
}
|
||||
"single-h1": false
|
||||
}
|
||||
|
||||
4
DEPS
4
DEPS
@@ -15,9 +15,9 @@ gclient_gn_args = [
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'93.0.4558.0',
|
||||
'93.0.4557.4',
|
||||
'node_version':
|
||||
'v16.4.0',
|
||||
'v14.17.0',
|
||||
'nan_version':
|
||||
# The following commit hash of NAN is v2.14.2 with *only* changes to the
|
||||
# test suite. This should be updated to a specific tag when one becomes
|
||||
|
||||
@@ -1 +1 @@
|
||||
15.0.0-nightly.20210702
|
||||
14.0.0-beta.12
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
[](https://circleci.com/gh/electron/electron/tree/master)
|
||||
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/master)
|
||||
[](https://david-dm.org/electron/electron?type=dev)
|
||||
[](https://discord.com/invite/electron)
|
||||
|
||||
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
||||
|
||||
@@ -133,7 +133,7 @@ void CertificateManagerModel::DidGetCertDBOnUIThread(
|
||||
CreationCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
auto model = base::WrapUnique(
|
||||
std::unique_ptr<CertificateManagerModel> model(
|
||||
new CertificateManagerModel(cert_db, is_user_db_available));
|
||||
std::move(callback).Run(std::move(model));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
|
||||
#define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include <windows.h>
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
|
||||
@@ -878,7 +878,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
|
||||
}
|
||||
|
||||
void ProcessSingleton::StartListeningOnSocket() {
|
||||
watcher_ = base::MakeRefCounted<LinuxWatcher>(this);
|
||||
watcher_ = new LinuxWatcher(this);
|
||||
base::PostTask(FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening,
|
||||
watcher_, sock_));
|
||||
|
||||
@@ -698,7 +698,7 @@ Overrides the current application's name.
|
||||
Returns `String` - The current application locale, fetched using Chromium's `l10n_util` library.
|
||||
Possible return values are documented [here](https://source.chromium.org/chromium/chromium/src/+/master:ui/base/l10n/l10n_util.cc).
|
||||
|
||||
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](command-line-switches.md).
|
||||
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](https://github.com/electron/electron/blob/master/docs/api/command-line-switches.md).
|
||||
|
||||
**Note:** When distributing your packaged app, you have to also ship the
|
||||
`locales` folder.
|
||||
@@ -1427,7 +1427,7 @@ This is the user agent that will be used when no user agent is set at the
|
||||
app has the same user agent. Set to a custom value as early as possible
|
||||
in your app's initialization to ensure that your overridden value is used.
|
||||
|
||||
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ _Deprecated_
|
||||
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_
|
||||
|
||||
A `Boolean` which when `true` indicates that the app is currently running
|
||||
under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)).
|
||||
@@ -1435,18 +1435,3 @@ under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta
|
||||
You can use this property to prompt users to download the arm64 version of
|
||||
your application when they are running the x64 version under Rosetta
|
||||
incorrectly.
|
||||
|
||||
**Deprecated:** This property is superceded by the `runningUnderARM64Translation`
|
||||
property which detects when the app is being translated to ARM64 in both macOS
|
||||
and Windows.
|
||||
|
||||
### `app.runningUnderARM64Translation` _Readonly_ _macOS_ _Windows_
|
||||
|
||||
A `Boolean` which when `true` indicates that the app is currently running under
|
||||
an ARM64 translator (like the macOS
|
||||
[Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software))
|
||||
or Windows [WOW](https://en.wikipedia.org/wiki/Windows_on_Windows)).
|
||||
|
||||
You can use this property to prompt users to download the arm64 version of
|
||||
your application when they are running the x64 version under Rosetta
|
||||
incorrectly.
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Manipulate the child browser window
|
||||
|
||||
Process: [Renderer](../glossary.md#renderer-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
The `BrowserWindowProxy` object is returned from `window.open` and provides
|
||||
limited functionality with the child window.
|
||||
|
||||
@@ -294,7 +294,6 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
* `allowRunningInsecureContent` Boolean (optional) - Allow an https page to run
|
||||
JavaScript, CSS or plugins from http URLs. Default is `false`.
|
||||
* `images` Boolean (optional) - Enables image support. Default is `true`.
|
||||
* `imageAnimationPolicy` String (optional) - Specifies how to run image animations (E.g. GIFs). Can be `animate`, `animateOnce` or `noAnimation`. Default is `animate`.
|
||||
* `textAreasAreResizable` Boolean (optional) - Make TextArea elements resizable. Default
|
||||
is `true`.
|
||||
* `webgl` Boolean (optional) - Enables WebGL support. Default is `true`.
|
||||
@@ -343,8 +342,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
context in the dev tools by selecting the 'Electron Isolated Context'
|
||||
entry in the combo box at the top of the Console tab.
|
||||
* `nativeWindowOpen` Boolean (optional) - Whether to use native
|
||||
`window.open()`. Defaults to `true`. Child windows will always have node
|
||||
integration disabled unless `nodeIntegrationInSubFrames` is true.
|
||||
`window.open()`. Defaults to `false`. Child windows will always have node
|
||||
integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** The default
|
||||
value will be changing to `true` in Electron 15.
|
||||
* `webviewTag` Boolean (optional) - Whether to enable the [`<webview>` tag](webview-tag.md).
|
||||
Defaults to `false`. **Note:** The
|
||||
`preload` script configured for the `<webview>` will have node integration
|
||||
@@ -392,10 +392,6 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
contain the layout of the document—without requiring scrolling. Enabling
|
||||
this will cause the `preferred-size-changed` event to be emitted on the
|
||||
`WebContents` when the preferred size changes. Default is `false`.
|
||||
* `titleBarOverlay` Boolean (optional) - On macOS, when using a frameless window in conjunction with
|
||||
`win.setWindowButtonVisibility(true)` or using a `titleBarStyle` so that the traffic lights are visible,
|
||||
this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and
|
||||
[CSS Environment Variables][overlay-css-env-vars]. Default is `false`.
|
||||
|
||||
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
|
||||
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
|
||||
@@ -528,20 +524,11 @@ Returns:
|
||||
|
||||
* `event` Event
|
||||
* `newBounds` [Rectangle](structures/rectangle.md) - Size the window is being resized to.
|
||||
* `details` Object
|
||||
* `edge` (String) - The edge of the window being dragged for resizing. Can be `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.
|
||||
|
||||
Emitted before the window is resized. Calling `event.preventDefault()` will prevent the window from being resized.
|
||||
|
||||
Note that this is only emitted when the window is being resized manually. Resizing the window with `setBounds`/`setSize` will not emit this event.
|
||||
|
||||
The possible values and behaviors of the `edge` option are platform dependent. Possible values are:
|
||||
|
||||
* On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right`.
|
||||
* On macOS, possible values are `bottom` and `right`.
|
||||
* The value `bottom` is used to denote vertical resizing.
|
||||
* The value `right` is used to denote horizontal resizing.
|
||||
|
||||
#### Event: 'resize'
|
||||
|
||||
Emitted after the window has been resized.
|
||||
@@ -1819,5 +1806,3 @@ removed in future Electron releases.
|
||||
[window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level
|
||||
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
||||
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Make HTTP/HTTPS requests.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
`ClientRequest` implements the [Writable Stream](https://nodejs.org/api/stream.html#stream_writable_streams)
|
||||
interface and is therefore an [EventEmitter][event-emitter].
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Manipulate the command line arguments for your app that Chromium reads
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
The following example shows how to check if the `--disable-gpu` flag is set.
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ When `contextIsolation` is enabled in your `webPreferences` (this is the default
|
||||
|
||||
The `contextBridge` module has the following methods:
|
||||
|
||||
### `contextBridge.exposeInMainWorld(apiKey, api)` _Experimental_
|
||||
### `contextBridge.exposeInMainWorld(apiKey, api)`
|
||||
|
||||
* `apiKey` String - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
|
||||
* `api` any - Your API, more information on what this API can be and how it works is available below.
|
||||
@@ -50,7 +50,7 @@ The `contextBridge` module has the following methods:
|
||||
|
||||
### API
|
||||
|
||||
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api-experimental) must be a `Function`, `String`, `Number`, `Array`, `Boolean`, or an object
|
||||
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api) must be a `Function`, `String`, `Number`, `Array`, `Boolean`, or an object
|
||||
whose keys are strings and values are a `Function`, `String`, `Number`, `Array`, `Boolean`, or another nested object that meets the same conditions.
|
||||
|
||||
`Function` values are proxied to the other context and all other values are **copied** and **frozen**. Any data / primitives sent in
|
||||
@@ -107,7 +107,6 @@ has been included below for completeness:
|
||||
| `Function` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending classes or constructors will not work. |
|
||||
| [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple | ✅ | ✅ | See the linked document on cloneable types |
|
||||
| `Element` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending custom elements will not work. |
|
||||
| `Blob` | Complex | ✅ | ✅ | N/A |
|
||||
| `Symbol` | N/A | ❌ | ❌ | Symbols cannot be copied across contexts so they are dropped |
|
||||
|
||||
If the type you care about is not in the above table, it is probably not supported.
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Query and modify a session's cookies.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Instances of the `Cookies` class are accessed by using `cookies` property of
|
||||
a `Session`.
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> An alternate transport for Chrome's remote debugging protocol.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Chrome Developer Tools has a [special binding][rdp] available at JavaScript
|
||||
runtime that allows interacting with pages and instrumenting them.
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Control your app in the macOS dock
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
The following example shows how to bounce your icon on the dock.
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Control file downloads from remote sources.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
`DownloadItem` is an [EventEmitter][event-emitter] that represents a download item in Electron.
|
||||
It is used in `will-download` event of `Session` class, and allows users to
|
||||
|
||||
@@ -61,21 +61,6 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa
|
||||
win.show()
|
||||
```
|
||||
|
||||
## Windows Control Overlay
|
||||
|
||||
On macOS, when using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` or using one of the `titleBarStyle`s described above so
|
||||
that the traffic lights are visible, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and
|
||||
[CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true:
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({
|
||||
titleBarStyle: 'hiddenInset',
|
||||
titleBarOverlay: true
|
||||
})
|
||||
win.show()
|
||||
```
|
||||
|
||||
## Transparent window
|
||||
|
||||
By setting the `transparent` option to `true`, you can also make the frameless
|
||||
@@ -201,5 +186,3 @@ behave correctly on all platforms you should never use a custom context menu on
|
||||
draggable areas.
|
||||
|
||||
[ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options
|
||||
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
||||
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Handle responses to HTTP/HTTPS requests.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
`IncomingMessage` implements the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams)
|
||||
interface and is therefore an [EventEmitter][event-emitter].
|
||||
|
||||
@@ -159,13 +159,7 @@ A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
|
||||
|
||||
#### `menuItem.accelerator`
|
||||
|
||||
An `Accelerator` (optional) indicating the item's accelerator, if set.
|
||||
|
||||
#### `menuItem.userAccelerator` _Readonly_ _macOS_
|
||||
|
||||
An `Accelerator | null` indicating the item's [user-assigned accelerator](https://developer.apple.com/documentation/appkit/nsmenuitem/1514850-userkeyequivalent?language=objc) for the menu item.
|
||||
|
||||
**Note:** This property is only initialized after the `MenuItem` has been added to a `Menu`. Either via `Menu.buildFromTemplate` or via `Menu.append()/insert()`. Accessing before initialization will just return `null`.
|
||||
A `Accelerator` (optional) indicating the item's accelerator, if set.
|
||||
|
||||
#### `menuItem.icon`
|
||||
|
||||
|
||||
@@ -405,4 +405,4 @@ Menu:
|
||||
```
|
||||
|
||||
[AboutInformationPropertyListFiles]: https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html
|
||||
[setMenu]: browser-window.md#winsetmenumenu-linux-windows
|
||||
[setMenu]: https://github.com/electron/electron/blob/master/docs/api/browser-window.md#winsetmenumenu-linux-windows
|
||||
|
||||
@@ -16,8 +16,7 @@ channel messaging.
|
||||
|
||||
> Port interface for channel messaging in the main process.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
||||
@@ -215,8 +215,7 @@ where `SYSTEM_IMAGE_NAME` should be replaced with any value from [this list](htt
|
||||
|
||||
> Natively wrap images such as tray, dock, and application icons.
|
||||
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Query and receive events from a sessions active service workers.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Instances of the `ServiceWorkers` class are accessed by using `serviceWorkers` property of
|
||||
a `Session`.
|
||||
|
||||
@@ -54,8 +54,7 @@ A `Session` object, the default session object of the app.
|
||||
|
||||
> Get and set properties of a session.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
You can create a `Session` object in the `session` module:
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a button in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarButton(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a color picker in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarColorPicker(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a group in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarGroup(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a label in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarLabel(options)`
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
>
|
||||
> Note: Only one instance of this class can be added per TouchBar.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarOtherItemsProxy()`
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a popover in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarPopover(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a scrubber (a scrollable selector)
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarScrubber(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a segmented control (a button group) where one button has a selected state
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarSegmentedControl(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a slider in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarSlider(options)`
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Create a spacer between two items in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### `new TouchBarSpacer(options)`
|
||||
|
||||
|
||||
@@ -49,8 +49,7 @@ Returns `WebContents` | undefined - A WebContents instance with the given ID, or
|
||||
|
||||
> Render and control the contents of a BrowserWindow instance.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### Instance Events
|
||||
|
||||
@@ -1924,20 +1923,6 @@ when the page becomes backgrounded. This also affects the Page Visibility API.
|
||||
|
||||
Returns `String` - the type of the webContent. Can be `backgroundPage`, `window`, `browserView`, `remote`, `webview` or `offscreen`.
|
||||
|
||||
#### `contents.setImageAnimationPolicy(policy)`
|
||||
|
||||
* `policy` String - Can be `animate`, `animateOnce` or `noAnimation`.
|
||||
|
||||
Sets the image animation policy for this webContents. The policy only affects
|
||||
_new_ images, existing images that are currently being animated are unaffected.
|
||||
This is a known limitation in Chromium, you can force image animation to be
|
||||
recalculated with `img.src = img.src` which will result in no network traffic
|
||||
but will update the animation policy.
|
||||
|
||||
This corresponds to the [animationPolicy][] accessibility feature in Chromium.
|
||||
|
||||
[animationPolicy]: https://developer.chrome.com/docs/extensions/reference/accessibilityFeatures/#property-animationPolicy
|
||||
|
||||
### Instance Properties
|
||||
|
||||
#### `contents.audioMuted`
|
||||
|
||||
@@ -68,8 +68,7 @@ or `undefined` if there is no WebFrameMain associated with the given IDs.
|
||||
|
||||
## Class: WebFrameMain
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
> Intercept and modify the contents of a request at various stages of its lifetime.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Instances of the `WebRequest` class are accessed by using the `webRequest`
|
||||
property of a `Session`.
|
||||
@@ -155,6 +154,7 @@ response are visible by the time this listener is fired.
|
||||
* `timestamp` Double
|
||||
* `statusLine` String
|
||||
* `statusCode` Integer
|
||||
* `requestHeaders` Record<string, string>
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `callback` Function
|
||||
* `headersReceivedResponse` Object
|
||||
|
||||
@@ -18,8 +18,7 @@ more information see the [BrowserWindow constructor docs](browser-window.md).
|
||||
|
||||
> Display external web content in an isolated frame and process.
|
||||
|
||||
Process: [Renderer](../glossary.md#renderer-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
Process: [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
Use the `webview` tag to embed 'guest' content (such as web pages) in your
|
||||
Electron app. The guest content is contained within the `webview` container.
|
||||
|
||||
@@ -6,15 +6,16 @@ untrusted content within a renderer. Windows can be created from the renderer in
|
||||
* clicking on links or submitting forms adorned with `target=_blank`
|
||||
* JavaScript calling `window.open()`
|
||||
|
||||
For same-origin content, the new window is created within the same process,
|
||||
enabling the parent to access the child window directly. This can be very
|
||||
useful for app sub-windows that act as preference panels, or similar, as the
|
||||
parent can render to the sub-window directly, as if it were a `div` in the
|
||||
parent. This is the same behavior as in the browser.
|
||||
In non-sandboxed renderers, or when `nativeWindowOpen` is false (the default), this results in the creation of a
|
||||
[`BrowserWindowProxy`](browser-window-proxy.md), a light wrapper around
|
||||
`BrowserWindow`.
|
||||
|
||||
When `nativeWindowOpen` is set to false, `window.open` instead results in the
|
||||
creation of a [`BrowserWindowProxy`](browser-window-proxy.md), a light wrapper
|
||||
around `BrowserWindow`.
|
||||
However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a
|
||||
`Window` instance is created, as you'd expect in the browser. For same-origin
|
||||
content, the new window is created within the same process, enabling the parent
|
||||
to access the child window directly. This can be very useful for app sub-windows that act
|
||||
as preference panels, or similar, as the parent can render to the sub-window
|
||||
directly, as if it were a `div` in the parent.
|
||||
|
||||
Electron pairs this native Chrome `Window` with a BrowserWindow under the hood.
|
||||
You can take advantage of all the customization available when creating a
|
||||
@@ -67,18 +68,49 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn
|
||||
|
||||
To customize or cancel the creation of the window, you can optionally set an
|
||||
override handler with `webContents.setWindowOpenHandler()` from the main
|
||||
process. Returning `{ action: 'deny' }` cancels the window. Returning `{
|
||||
action: 'allow', overrideBrowserWindowOptions: { ... } }` will allow opening
|
||||
the window and setting the `BrowserWindowConstructorOptions` to be used when
|
||||
creating the window. Note that this is more powerful than passing options
|
||||
through the feature string, as the renderer has more limited privileges in
|
||||
deciding security preferences than the main process.
|
||||
process. Returning `false` cancels the window, while returning an object sets
|
||||
the `BrowserWindowConstructorOptions` used when creating the window. Note that
|
||||
this is more powerful than passing options through the feature string, as the
|
||||
renderer has more limited privileges in deciding security preferences than the
|
||||
main process.
|
||||
|
||||
### `BrowserWindowProxy` example
|
||||
|
||||
```javascript
|
||||
|
||||
// main.js
|
||||
const mainWindow = new BrowserWindow()
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (url.startsWith('https://github.com/')) {
|
||||
return { action: 'allow' }
|
||||
}
|
||||
return { action: 'deny' }
|
||||
})
|
||||
|
||||
mainWindow.webContents.on('did-create-window', (childWindow) => {
|
||||
// For example...
|
||||
childWindow.webContents.on('will-navigate', (e) => {
|
||||
e.preventDefault()
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
```javascript
|
||||
// renderer.js
|
||||
const windowProxy = window.open('https://github.com/', null, 'minimizable=false')
|
||||
windowProxy.postMessage('hi', '*')
|
||||
```
|
||||
|
||||
### Native `Window` example
|
||||
|
||||
```javascript
|
||||
// main.js
|
||||
const mainWindow = new BrowserWindow()
|
||||
const mainWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nativeWindowOpen: true
|
||||
}
|
||||
})
|
||||
|
||||
// In this example, only windows with the `about:blank` url will be created.
|
||||
// All other urls will be blocked.
|
||||
@@ -105,33 +137,3 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
const childWindow = window.open('', 'modal')
|
||||
childWindow.document.write('<h1>Hello</h1>')
|
||||
```
|
||||
|
||||
### `BrowserWindowProxy` example
|
||||
|
||||
```javascript
|
||||
|
||||
// main.js
|
||||
const mainWindow = new BrowserWindow({
|
||||
webPreferences: { nativeWindowOpen: false }
|
||||
})
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (url.startsWith('https://github.com/')) {
|
||||
return { action: 'allow' }
|
||||
}
|
||||
return { action: 'deny' }
|
||||
})
|
||||
|
||||
mainWindow.webContents.on('did-create-window', (childWindow) => {
|
||||
// For example...
|
||||
childWindow.webContents.on('will-navigate', (e) => {
|
||||
e.preventDefault()
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
```javascript
|
||||
// renderer.js
|
||||
const windowProxy = window.open('https://github.com/', null, 'minimizable=false')
|
||||
windowProxy.postMessage('hi', '*')
|
||||
```
|
||||
|
||||
@@ -12,6 +12,18 @@ This document uses the following convention to categorize breaking changes:
|
||||
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
|
||||
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
|
||||
|
||||
## Planned Breaking API Changes (15.0)
|
||||
|
||||
### Default Changed: `nativeWindowOpen` defaults to `true`
|
||||
|
||||
Prior to Electron 15, `window.open` was by default shimmed to use
|
||||
`BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work
|
||||
to open synchronously scriptable child windows, among other incompatibilities.
|
||||
`nativeWindowOpen: true` is no longer experimental, and is now the default.
|
||||
|
||||
See the documentation for [window.open in Electron](api/window-open.md)
|
||||
for more details.
|
||||
|
||||
## Planned Breaking API Changes (14.0)
|
||||
|
||||
### Removed: `app.allowRendererProcessReuse`
|
||||
@@ -33,7 +45,7 @@ For more detailed information see [#18397](https://github.com/electron/electron/
|
||||
|
||||
The optional parameter `frameName` will no longer set the title of the window. This now follows the specification described by the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) under the corresponding parameter `windowName`.
|
||||
|
||||
If you were using this parameter to set the title of a window, you can instead use [win.setTitle(title)](api/browser-window.md#winsettitletitle).
|
||||
If you were using this parameter to set the title of a window, you can instead use [win.setTitle(title)](https://www.electronjs.org/docs/api/browser-window#winsettitletitle).
|
||||
|
||||
### Removed: `worldSafeExecuteJavaScript`
|
||||
|
||||
@@ -43,16 +55,6 @@ ensure your code works with this property enabled. It has been enabled by defau
|
||||
|
||||
You will be affected by this change if you use either `webFrame.executeJavaScript` or `webFrame.executeJavaScriptInIsolatedWorld`. You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) as these methods use the same value passing semantics.
|
||||
|
||||
### Default Changed: `nativeWindowOpen` defaults to `true`
|
||||
|
||||
Prior to Electron 14, `window.open` was by default shimmed to use
|
||||
`BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work
|
||||
to open synchronously scriptable child windows, among other incompatibilities.
|
||||
`nativeWindowOpen` is no longer experimental, and is now the default.
|
||||
|
||||
See the documentation for [window.open in Electron](api/window-open.md)
|
||||
for more details.
|
||||
|
||||
### Removed: BrowserWindowConstructorOptions inheriting from parent windows
|
||||
|
||||
Prior to Electron 14, windows opened with `window.open` would inherit
|
||||
@@ -246,7 +248,7 @@ value.
|
||||
In Electron 12, `contextIsolation` will be enabled by default. To restore
|
||||
the previous behavior, `contextIsolation: false` must be specified in WebPreferences.
|
||||
|
||||
We [recommend having contextIsolation enabled](tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
|
||||
We [recommend having contextIsolation enabled](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
|
||||
|
||||
Another implication is that `require()` cannot be used in the renderer process unless
|
||||
`nodeIntegration` is `true` and `contextIsolation` is `false`.
|
||||
@@ -809,7 +811,7 @@ In Electron 7, this now returns a `FileList` with a `File` object for:
|
||||
|
||||
Note that `webkitdirectory` no longer exposes the path to the selected folder.
|
||||
If you require the path to the selected folder rather than the folder contents,
|
||||
see the `dialog.showOpenDialog` API ([link](api/dialog.md#dialogshowopendialogbrowserwindow-options)).
|
||||
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
|
||||
|
||||
### API Changed: Callback-based versions of promisified APIs
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ creating a full distribution since `symstore.exe` is used for creating a symbol
|
||||
store from `.pdb` files.
|
||||
* Different versions of the SDK can be installed side by side. To install the
|
||||
SDK, open Visual Studio Installer, select
|
||||
`Modify` → `Individual Components`, scroll down and select the appropriate
|
||||
`Change` → `Individual Components`, scroll down and select the appropriate
|
||||
Windows SDK to install. Another option would be to look at the
|
||||
[Windows SDK and emulator archive](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive)
|
||||
and download the standalone version of the SDK respectively.
|
||||
|
||||
@@ -45,7 +45,7 @@ Here is a pre-configured project that you can download and directly debug in VSC
|
||||
|
||||
If you want to build Electron from source and modify the native Electron codebase, this section will help you in testing your modifications.
|
||||
|
||||
For those unsure where to acquire this code or how to build it, [Electron's Build Tools](https://github.com/electron/build-tools) automates and explains most of this process. If you wish to manually set up the environment, you can instead use these [build instructions](../development/build-instructions-gn.md).
|
||||
For those unsure where to acquire this code or how to build it, [Electron's Build Tools](https://github.com/electron/build-tools) automates and explains most of this process. If you wish to manually set up the environment, you can instead use these [build instructions](https://www.electronjs.org/docs/development/build-instructions-gn).
|
||||
|
||||
### Windows (C++)
|
||||
|
||||
@@ -89,7 +89,7 @@ $ code electron-quick-start
|
||||
* `cppvsdbg` requires the [built-in C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) be enabled.
|
||||
* `${workspaceFolder}` is the full path to Chromium's `src` directory.
|
||||
* `your-executable-location` will be one of the following depending on a few items:
|
||||
* `Testing`: If you are using the default settings of [Electron's Build-Tools](https://github.com/electron/build-tools) or the default instructions when [building from source](../development/build-instructions-gn.md#building).
|
||||
* `Testing`: If you are using the default settings of [Electron's Build-Tools](https://github.com/electron/build-tools) or the default instructions when [building from source](https://www.electronjs.org/docs/development/build-instructions-gn#building).
|
||||
* `Release`: If you built a Release build rather than a Testing build.
|
||||
* `your-directory-name`: If you modified this during your build process from the default, this will be whatever you specified.
|
||||
* The `args` array string `"your-electron-project-path"` should be the absolute path to either the directory or `main.js` file of the Electron project you are using for testing. In this example, it should be your path to `electron-quick-start`.
|
||||
|
||||
@@ -130,14 +130,6 @@ if you exceed that limit.
|
||||
|
||||
[apple-notification-guidelines]: https://developer.apple.com/macos/human-interface-guidelines/system-capabilities/notifications/
|
||||
|
||||
#### Advanced Notifications
|
||||
|
||||
Later versions of macOS allow for notifications with an input field, allowing the user
|
||||
to quickly reply to a notification. In order to send notifications with an input field,
|
||||
use the userland module [node-mac-notifier][node-mac-notifier].
|
||||
|
||||
[node-mac-notifier]: https://github.com/CharlieHess/node-mac-notifier
|
||||
|
||||
#### Do not disturb / Session State
|
||||
|
||||
To detect whether or not you're allowed to send a notification, use the userland module
|
||||
|
||||
@@ -162,7 +162,7 @@ client
|
||||
## Workflow
|
||||
|
||||
To test your application without rebuilding Electron,
|
||||
[place](application-distribution.md)
|
||||
[place](https://github.com/electron/electron/blob/master/docs/tutorial/application-distribution.md)
|
||||
your app source into Electron's resource directory.
|
||||
|
||||
Alternatively, pass an argument to run with your Electron binary that points to
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
const asar = process._linkedBinding('electron_common_asar');
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util');
|
||||
|
||||
const Module = require('module');
|
||||
|
||||
@@ -806,8 +807,6 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
overrideAPISync(childProcess, 'execFileSync');
|
||||
};
|
||||
|
||||
const asarReady = new WeakSet();
|
||||
|
||||
// Lazily override the child_process APIs only when child_process is
|
||||
// fetched the first time. We will eagerly override the child_process APIs
|
||||
// when this env var is set so that stack traces generated inside node unit
|
||||
@@ -820,8 +819,8 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
Module._load = (request: string, ...args: any[]) => {
|
||||
const loadResult = originalModuleLoad(request, ...args);
|
||||
if (request === 'child_process') {
|
||||
if (!asarReady.has(loadResult)) {
|
||||
asarReady.add(loadResult);
|
||||
if (!v8Util.getHiddenValue(loadResult, 'asar-ready')) {
|
||||
v8Util.setHiddenValue(loadResult, 'asar-ready', true);
|
||||
// Just to make it obvious what we are dealing with here
|
||||
const childProcess = loadResult;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Menu } from 'electron/main';
|
||||
|
||||
@@ -54,6 +55,14 @@ Object.defineProperty(app, 'applicationMenu', {
|
||||
}
|
||||
});
|
||||
|
||||
(app as any).isPackaged = (() => {
|
||||
const execFile = path.basename(process.execPath).toLowerCase();
|
||||
if (process.platform === 'win32') {
|
||||
return execFile !== 'electron.exe';
|
||||
}
|
||||
return execFile !== 'electron';
|
||||
})();
|
||||
|
||||
// The native implementation is not provided on non-windows platforms
|
||||
app.setAppUserModelId = app.setAppUserModelId || (() => {});
|
||||
|
||||
|
||||
@@ -43,15 +43,6 @@ const MenuItem = function (this: any, options: any) {
|
||||
|
||||
this.overrideReadOnlyProperty('commandId', ++nextCommandId);
|
||||
|
||||
Object.defineProperty(this, 'userAccelerator', {
|
||||
get: () => {
|
||||
if (process.platform !== 'darwin') return null;
|
||||
if (!this.menu) return null;
|
||||
return this.menu._getUserAcceleratorAt(this.commandId);
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
const click = options.click;
|
||||
this.click = (event: Event, focusedWindow: BrowserWindow, focusedWebContents: WebContents) => {
|
||||
// Manually flip the checked flags when clicked.
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { BaseWindow, MenuItem, webContents, Menu as MenuType, BrowserWindow, MenuItemConstructorOptions } from 'electron/main';
|
||||
import { sortMenuItems } from '@electron/internal/browser/api/menu-utils';
|
||||
import { setApplicationMenuWasSet } from '@electron/internal/browser/default-menu';
|
||||
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util');
|
||||
const bindings = process._linkedBinding('electron_browser_menu');
|
||||
|
||||
const { Menu } = bindings as { Menu: typeof MenuType };
|
||||
const checked = new WeakMap<MenuItem, boolean>();
|
||||
let applicationMenu: MenuType | null = null;
|
||||
let groupIdIndex = 0;
|
||||
|
||||
@@ -61,7 +60,7 @@ Menu.prototype._menuWillShow = function () {
|
||||
// Ensure radio groups have at least one menu item selected
|
||||
for (const id of Object.keys(this.groupsMap)) {
|
||||
const found = this.groupsMap[id].find(item => item.checked) || null;
|
||||
if (!found) checked.set(this.groupsMap[id][0], true);
|
||||
if (!found) v8Util.setHiddenValue(this.groupsMap[id][0], 'checked', true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -170,7 +169,7 @@ Menu.setApplicationMenu = function (menu: MenuType) {
|
||||
}
|
||||
|
||||
applicationMenu = menu;
|
||||
setApplicationMenuWasSet();
|
||||
v8Util.setHiddenValue(global, 'applicationMenuSet', true);
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
if (!menu) return;
|
||||
@@ -276,15 +275,15 @@ function insertItemByType (this: MenuType, item: MenuItem, pos: number) {
|
||||
this.groupsMap[item.groupId].push(item);
|
||||
|
||||
// Setting a radio menu item should flip other items in the group.
|
||||
checked.set(item, item.checked);
|
||||
v8Util.setHiddenValue(item, 'checked', item.checked);
|
||||
Object.defineProperty(item, 'checked', {
|
||||
enumerable: true,
|
||||
get: () => checked.get(item),
|
||||
get: () => v8Util.getHiddenValue(item, 'checked'),
|
||||
set: () => {
|
||||
this.groupsMap[item.groupId].forEach(other => {
|
||||
if (other !== item) checked.set(other, false);
|
||||
if (other !== item) v8Util.setHiddenValue(other, 'checked', false);
|
||||
});
|
||||
checked.set(item, true);
|
||||
v8Util.setHiddenValue(item, 'checked', true);
|
||||
}
|
||||
});
|
||||
this.insertRadioItem(pos, item.commandId, item.label, item.groupId);
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { app, Menu } from 'electron/main';
|
||||
import { shell } from 'electron/common';
|
||||
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util');
|
||||
|
||||
const isMac = process.platform === 'darwin';
|
||||
|
||||
let applicationMenuWasSet = false;
|
||||
|
||||
export const setApplicationMenuWasSet = () => {
|
||||
applicationMenuWasSet = true;
|
||||
};
|
||||
|
||||
export const setDefaultApplicationMenu = () => {
|
||||
if (applicationMenuWasSet) return;
|
||||
if (v8Util.getHiddenValue<boolean>(global, 'applicationMenuSet')) return;
|
||||
|
||||
const helpMenu: Electron.MenuItemConstructorOptions = {
|
||||
role: 'help',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint no-eval: "off" */
|
||||
/* global binding */
|
||||
import * as events from 'events';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
@@ -12,6 +12,9 @@ require('../common/reset-search-paths');
|
||||
// Import common settings.
|
||||
require('@electron/internal/common/init');
|
||||
|
||||
// Process command line arguments.
|
||||
const { hasSwitch, getSwitchValue } = process._linkedBinding('electron_common_command_line');
|
||||
|
||||
// Export node bindings to global.
|
||||
const { makeRequireFunction } = __non_webpack_require__('internal/modules/cjs/helpers') // eslint-disable-line
|
||||
global.module = new Module('electron/js2c/worker_init');
|
||||
@@ -32,4 +35,10 @@ if (self.location.protocol === 'file:') {
|
||||
// For backwards compatibility we fake these two paths here
|
||||
global.__filename = path.join(process.resourcesPath, 'electron.asar', 'worker', 'init.js');
|
||||
global.__dirname = path.join(process.resourcesPath, 'electron.asar', 'worker');
|
||||
|
||||
const appPath = hasSwitch('app-path') ? getSwitchValue('app-path') : null;
|
||||
if (appPath) {
|
||||
// Search for module under the app directory.
|
||||
global.module.paths = Module._nodeModulePaths(appPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "15.0.0-nightly.20210702",
|
||||
"version": "14.0.0-beta.12",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
"@electron/docs-parser": "^0.12.1",
|
||||
"@electron/typescript-definitions": "^8.9.4",
|
||||
"@electron/docs-parser": "^0.11.0",
|
||||
"@electron/typescript-definitions": "^8.9.0",
|
||||
"@octokit/auth-app": "^2.10.0",
|
||||
"@octokit/rest": "^18.0.3",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
expose_ripemd160.patch
|
||||
expose_aes-cfb.patch
|
||||
expose_des-ede3.patch
|
||||
fix_sync_evp_get_cipherbynid_and_evp_get_cipherbyname.patch
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 28 Jun 2021 10:41:09 +0200
|
||||
Subject: fix: sync EVP_get_cipherbynid and EVP_get_cipherbyname
|
||||
|
||||
This commit syncs the results of EVP_get_cipherbynid and
|
||||
EVP_get_cipherbyname. Node.js logic assumes that calling EVP_get_cipherbynid
|
||||
on a NID returned from a call to `getCipherInfo` with the cipher name
|
||||
will return the same cipher information - this assumption holds in OpenSSL
|
||||
and should also hold in BoringSSL.
|
||||
|
||||
This will be upstreamed.
|
||||
|
||||
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c
|
||||
index 8205e121c152fe4e2d8df34a1ac2fe0498381f31..0870ffe6bff3f647907d7df66d7bf74916be1836 100644
|
||||
--- a/crypto/cipher_extra/cipher_extra.c
|
||||
+++ b/crypto/cipher_extra/cipher_extra.c
|
||||
@@ -69,20 +69,58 @@
|
||||
|
||||
const EVP_CIPHER *EVP_get_cipherbynid(int nid) {
|
||||
switch (nid) {
|
||||
- case NID_rc2_cbc:
|
||||
- return EVP_rc2_cbc();
|
||||
- case NID_rc2_40_cbc:
|
||||
- return EVP_rc2_40_cbc();
|
||||
+ case NID_rc4:
|
||||
+ return EVP_rc4();
|
||||
+ case NID_des_cbc:
|
||||
+ return EVP_des_cbc();
|
||||
+ case NID_des_ede3_ecb:
|
||||
+ return EVP_des_ede3();
|
||||
case NID_des_ede3_cbc:
|
||||
return EVP_des_ede3_cbc();
|
||||
- case NID_des_ede_cbc:
|
||||
- return EVP_des_cbc();
|
||||
case NID_aes_128_cbc:
|
||||
return EVP_aes_128_cbc();
|
||||
+ case NID_aes_128_cfb128:
|
||||
+ return EVP_aes_128_cfb128();
|
||||
case NID_aes_192_cbc:
|
||||
return EVP_aes_192_cbc();
|
||||
case NID_aes_256_cbc:
|
||||
return EVP_aes_256_cbc();
|
||||
+ case NID_aes_256_cfb128:
|
||||
+ return EVP_aes_256_cfb128();
|
||||
+ case NID_aes_128_ctr:
|
||||
+ return EVP_aes_128_ctr();
|
||||
+ case NID_aes_192_ctr:
|
||||
+ return EVP_aes_192_ctr();
|
||||
+ case NID_aes_256_ctr:
|
||||
+ return EVP_aes_256_ctr();
|
||||
+ case NID_aes_128_ecb:
|
||||
+ return EVP_aes_128_ecb();
|
||||
+ case NID_aes_192_ecb:
|
||||
+ return EVP_aes_192_ecb();
|
||||
+ case NID_aes_256_ecb:
|
||||
+ return EVP_aes_256_ecb();
|
||||
+ case NID_aes_128_gcm:
|
||||
+ return EVP_aes_128_gcm();
|
||||
+ case NID_aes_192_gcm:
|
||||
+ return EVP_aes_192_gcm();
|
||||
+ case NID_aes_256_gcm:
|
||||
+ return EVP_aes_256_gcm();
|
||||
+ case NID_aes_128_ofb128:
|
||||
+ return EVP_aes_128_ofb();
|
||||
+ case NID_aes_192_ofb128:
|
||||
+ return EVP_aes_192_ofb();
|
||||
+ case NID_aes_256_ofb128:
|
||||
+ return EVP_aes_256_ofb();
|
||||
+ case NID_des_ecb:
|
||||
+ return EVP_des_ecb();
|
||||
+ case NID_des_ede_ecb:
|
||||
+ return EVP_des_ede();
|
||||
+ case NID_des_ede_cbc:
|
||||
+ return EVP_des_ede_cbc();
|
||||
+ case NID_rc2_cbc:
|
||||
+ return EVP_rc2_cbc();
|
||||
+ case NID_rc2_40_cbc:
|
||||
+ return EVP_rc2_40_cbc();
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -89,7 +89,6 @@ export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch
|
||||
fix_export_zlib_symbols.patch
|
||||
don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch
|
||||
web_contents.patch
|
||||
webview_fullscreen.patch
|
||||
disable_unload_metrics.patch
|
||||
fix_add_check_for_sandbox_then_result.patch
|
||||
extend_apply_webpreferences.patch
|
||||
@@ -98,6 +97,6 @@ add_setter_for_browsermainloop_result_code.patch
|
||||
make_include_of_stack_trace_h_unconditional.patch
|
||||
build_libc_as_static_library.patch
|
||||
build_do_not_depend_on_packed_resource_integrity.patch
|
||||
don_t_run_pcscan_notifythreadcreated_if_pcscan_is_disabled.patch
|
||||
refactor_restore_base_adaptcallbackforrepeating.patch
|
||||
hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch
|
||||
don_t_run_pcscan_notifythreadcreated_if_pcscan_is_disabled.patch
|
||||
|
||||
@@ -33,10 +33,10 @@ index a1aa8466ead6e428544ff00d7fcf3f92a3daf080..b7afa3200133220fecea3a410d902220
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 857c8f362d01bb89dd7f0d72a77aa537d3f4d04c..4c701c34f717e994ce6e876ba56d2292680967e4 100644
|
||||
index 57fa8d4642c61997081cc5c7336e253f019a1390..1d774971cc1557303b9ebfa9c6226bfdbccdf679 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4294,7 +4294,7 @@ static_library("browser") {
|
||||
@@ -4290,7 +4290,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 857c8f362d01bb89dd7f0d72a77aa537d3f4d04c..4c701c34f717e994ce6e876ba56d2292
|
||||
}
|
||||
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index f042b4cf1de0ade85b5abddbad5ec4efe0d48e4c..4eb71e24ae01031929d2196897e92d2fb468b489 100644
|
||||
index f51ad2e7b6df421c902c61b5c0f0d3c4ca541cb1..a4c47f966324d75c7b4a9def367b354cf23dfa80 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -5220,7 +5220,6 @@ test("unit_tests") {
|
||||
@@ -5214,7 +5214,6 @@ test("unit_tests") {
|
||||
assert(toolkit_views)
|
||||
sources += [ "../browser/ui/startup/credential_provider_signin_info_fetcher_win_unittest.cc" ]
|
||||
deps += [
|
||||
@@ -57,7 +57,7 @@ index f042b4cf1de0ade85b5abddbad5ec4efe0d48e4c..4eb71e24ae01031929d2196897e92d2f
|
||||
"//chrome/browser:chrome_process_finder",
|
||||
"//chrome/browser/safe_browsing/chrome_cleaner",
|
||||
"//chrome/browser/safe_browsing/chrome_cleaner:public",
|
||||
@@ -5233,6 +5232,12 @@ test("unit_tests") {
|
||||
@@ -5227,6 +5226,12 @@ test("unit_tests") {
|
||||
"//components/chrome_cleaner/public/proto",
|
||||
"//ui/events/devices:test_support",
|
||||
]
|
||||
@@ -70,7 +70,7 @@ index f042b4cf1de0ade85b5abddbad5ec4efe0d48e4c..4eb71e24ae01031929d2196897e92d2f
|
||||
}
|
||||
|
||||
if (is_win || is_chromeos_ash || is_mac) {
|
||||
@@ -5791,7 +5796,6 @@ test("unit_tests") {
|
||||
@@ -5785,7 +5790,6 @@ test("unit_tests") {
|
||||
}
|
||||
|
||||
deps += [
|
||||
@@ -78,7 +78,7 @@ index f042b4cf1de0ade85b5abddbad5ec4efe0d48e4c..4eb71e24ae01031929d2196897e92d2f
|
||||
"//chrome/browser:cart_db_content_proto",
|
||||
"//chrome/browser/media/router:test_support",
|
||||
"//chrome/browser/promo_browser_command:mojo_bindings",
|
||||
@@ -5826,6 +5830,9 @@ test("unit_tests") {
|
||||
@@ -5820,6 +5824,9 @@ test("unit_tests") {
|
||||
"//ui/color:test_support",
|
||||
"//ui/native_theme:test_support",
|
||||
]
|
||||
|
||||
@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
|
||||
Electrons grit header instead of Chromes
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 443adf944cca37697a480a385e92193f729a774e..857c8f362d01bb89dd7f0d72a77aa537d3f4d04c 100644
|
||||
index c77a5d0e3eb23fcb6940b333b9eb8e472be0f601..57fa8d4642c61997081cc5c7336e253f019a1390 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -6450,6 +6450,7 @@ static_library("browser") {
|
||||
@@ -6444,6 +6444,7 @@ static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
|
||||
Add electron resources file to the list of resource ids generation.
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
|
||||
index b27b177661d5a52812634c62e7db8b00919804ca..40fde94a58d3204b64511f4a201cca2251723eae 100644
|
||||
index 7669ab4ed8d048a75c779636cbe4bc43dcf96507..850a172c1581e76b84c4e593306f8c68007c9b7f 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -802,6 +802,11 @@
|
||||
@@ -798,6 +798,11 @@
|
||||
"includes": [3880],
|
||||
},
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ index 5a23ea7558814eec59eda349bc7194afcb70d01e..c9147bbe5a225291552082434e5db342
|
||||
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
|
||||
// can only be accomplished by overriding methods.
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
index f4104fe938bb8c5d35e3396506ce0a6163a738da..7eb9070dc96b27dfe02046f75b45dee3e868d83a 100644
|
||||
index e301610a2d7cc0559e1bca7947f4f557b32b3c94..c98a6a1d02a607bb30869c14e915ed12f1941b91 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
@@ -16,7 +16,9 @@
|
||||
@@ -126,7 +126,7 @@ index f4104fe938bb8c5d35e3396506ce0a6163a738da..7eb9070dc96b27dfe02046f75b45dee3
|
||||
@implementation NativeWidgetMacNSWindow {
|
||||
@private
|
||||
base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
|
||||
@@ -186,6 +192,8 @@ - (BOOL)hasViewsMenuActive {
|
||||
@@ -181,6 +187,8 @@ - (BOOL)hasViewsMenuActive {
|
||||
|
||||
// NSWindow overrides.
|
||||
|
||||
@@ -135,7 +135,7 @@ index f4104fe938bb8c5d35e3396506ce0a6163a738da..7eb9070dc96b27dfe02046f75b45dee3
|
||||
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
if (windowStyle & NSWindowStyleMaskTitled) {
|
||||
if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
|
||||
@@ -197,6 +205,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
@@ -192,6 +200,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
return [super frameViewClassForStyleMask:windowStyle];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 4 Oct 2018 14:57:02 -0700
|
||||
Subject: fix: also propagate fullscreen state for outer frame
|
||||
|
||||
When entering fullscreen with Element.requestFullscreen in child frames,
|
||||
the parent frame should also enter fullscreen mode too. Chromium handles
|
||||
this for iframes, but not for webviews as they are essentially main
|
||||
frames instead of child frames.
|
||||
|
||||
This patch makes webviews propagate the fullscreen state to embedder.
|
||||
|
||||
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 5c16a9ee9bbf461c24456613ff709f4f608e3441..4e4d1fdf50e2d480e099c9af71a45fc864d2cf56 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -5520,6 +5520,15 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
notified_instances.insert(parent_site_instance);
|
||||
}
|
||||
|
||||
+ // Entering fullscreen from webview should also notify its outer frame.
|
||||
+ if (frame_tree_node()->render_manager()->IsMainFrameForInnerDelegate()) {
|
||||
+ RenderFrameProxyHost* outer_proxy =
|
||||
+ frame_tree_node()->render_manager()->GetProxyToOuterDelegate();
|
||||
+ DCHECK(outer_proxy);
|
||||
+ outer_proxy->GetAssociatedRemoteFrame()->WillEnterFullscreen(
|
||||
+ options.Clone());
|
||||
+ }
|
||||
+
|
||||
delegate_->EnterFullscreenMode(this, *options);
|
||||
delegate_->FullscreenStateChanged(this, true /* is_fullscreen */,
|
||||
std::move(options));
|
||||
@@ -67,10 +67,10 @@ index 7691e1e8b3289774f89830fd850c6f6d155dec24..e311411dc9b7074290cff0551fc3ae80
|
||||
const WebSecurityOrigin& script_origin) {
|
||||
return false;
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
index c694aa7cab116003ec4baeb096cc3e386d99019e..1bfc60026d81fa77f120d26d65d9e852afbe1864 100644
|
||||
index 314dc76e24dad33d8363cf8ae1f24787c448fb5b..9306fcca19dfaa1ed7a52cafd2e56eed190dd203 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
@@ -717,6 +717,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
@@ -738,6 +738,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
nested_runner_->QuitNow();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,22 +5,32 @@ feat_add_uv_loop_watcher_queue_code.patch
|
||||
feat_initialize_asar_support.patch
|
||||
expose_get_builtin_module_function.patch
|
||||
build_add_gn_build_files.patch
|
||||
fix_add_default_values_for_variables_in_common_gypi.patch
|
||||
fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
|
||||
feat_add_new_built_with_electron_variable_to_config_gypi.patch
|
||||
feat_add_flags_for_low-level_hooks_and_exceptions.patch
|
||||
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
|
||||
pass_all_globals_through_require.patch
|
||||
fixme_comment_trace_event_macro.patch
|
||||
fix_key_gen_apis_are_not_available_in_boringssl.patch
|
||||
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
|
||||
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
|
||||
chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
|
||||
chore_add_context_to_context_aware_module_prevention.patch
|
||||
chore_read_nobrowserglobals_from_global_not_process.patch
|
||||
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
|
||||
fix_handle_boringssl_and_openssl_incompatibilities.patch
|
||||
fix_use_crypto_impls_for_compat.patch
|
||||
fix_comment_out_incompatible_crypto_modules.patch
|
||||
update_tests_after_increasing_typed_array_size.patch
|
||||
feat_add_implementation_of_v8_platform_postjob.patch
|
||||
fix_-wincompatible-pointer-types-discards-qualifiers_error.patch
|
||||
fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch
|
||||
fix_allow_preventing_initializeinspector_in_env.patch
|
||||
src_allow_embedders_to_provide_a_custom_pageallocator_to.patch
|
||||
allow_preventing_preparestacktracecallback.patch
|
||||
fix_remove_outdated_--experimental-wasm-bigint_flag.patch
|
||||
fix_crypto_tests_to_run_with_bssl.patch
|
||||
fix_account_for_debugger_agent_race_condition.patch
|
||||
build_add_mjs_support_to_js2c.patch
|
||||
src_inline_asynccleanuphookhandle_in_headers.patch
|
||||
fix_handle_new_tostring_behavior_in_v8_serdes_test.patch
|
||||
node-api_faster_threadsafe_function.patch
|
||||
src_remove_extra_semi_after_member_fn.patch
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 7 Dec 2020 16:54:23 -0800
|
||||
Subject: Allow preventing PrepareStackTraceCallback
|
||||
|
||||
Node.js sets a stack trace handler specific to the v8::Context
|
||||
corresponding to the current Environment. When we're running in a
|
||||
non-Node.js v8::Context, there will be no correspondent Environment - we
|
||||
therefore need to prevent this handler being set so that Blink falls back to its
|
||||
default handling and displays the correct stacktrace.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index a8cf0d763f78c2752e3aa22479dadd9fa53c222f..8ccc0638b32039571c4a56725e21f0353b592984 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -228,9 +228,11 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
|
||||
s.fatal_error_callback : OnFatalError;
|
||||
isolate->SetFatalErrorHandler(fatal_error_cb);
|
||||
|
||||
- auto* prepare_stack_trace_cb = s.prepare_stack_trace_callback ?
|
||||
- s.prepare_stack_trace_callback : PrepareStackTraceCallback;
|
||||
- isolate->SetPrepareStackTraceCallback(prepare_stack_trace_cb);
|
||||
+ if ((s.flags & SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK) == 0) {
|
||||
+ auto* prepare_stack_trace_cb = s.prepare_stack_trace_callback ?
|
||||
+ s.prepare_stack_trace_callback : PrepareStackTraceCallback;
|
||||
+ isolate->SetPrepareStackTraceCallback(prepare_stack_trace_cb);
|
||||
+ }
|
||||
}
|
||||
|
||||
void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 14893ad605b9f8c64b0b8fc28625e235655dcd63..f150725b54ee1315476d202797963369490d5152 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -340,7 +340,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
||||
enum IsolateSettingsFlags {
|
||||
MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0,
|
||||
DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1,
|
||||
- SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2
|
||||
+ SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2,
|
||||
+ SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3
|
||||
};
|
||||
|
||||
struct IsolateSettings {
|
||||
@@ -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..bd26c3623d3314539609a978270d3ced1d167777
|
||||
index 0000000000000000000000000000000000000000..446119163d1f7bad577cb0b7b217ecf24b994526
|
||||
--- /dev/null
|
||||
+++ b/BUILD.gn
|
||||
@@ -0,0 +1,400 @@
|
||||
@@ -0,0 +1,360 @@
|
||||
+import("//electron/build/asar.gni")
|
||||
+import("//v8/gni/v8.gni")
|
||||
+
|
||||
@@ -273,58 +273,18 @@ index 0000000000000000000000000000000000000000..bd26c3623d3314539609a978270d3ced
|
||||
+ if (node_use_openssl) {
|
||||
+ deps += [ "//third_party/boringssl" ]
|
||||
+ sources += [
|
||||
+ "src/crypto/crypto_aes.cc",
|
||||
+ "src/crypto/crypto_aes.h",
|
||||
+ "src/crypto/crypto_bio.cc",
|
||||
+ "src/crypto/crypto_bio.h",
|
||||
+ "src/crypto/crypto_cipher.cc",
|
||||
+ "src/crypto/crypto_cipher.h",
|
||||
+ "src/crypto/crypto_clienthello-inl.h",
|
||||
+ "src/crypto/crypto_clienthello.cc",
|
||||
+ "src/crypto/crypto_clienthello.h",
|
||||
+ "src/crypto/crypto_common.cc",
|
||||
+ "src/crypto/crypto_common.h",
|
||||
+ "src/crypto/crypto_context.cc",
|
||||
+ "src/crypto/crypto_context.h",
|
||||
+ "src/crypto/crypto_dh.cc",
|
||||
+ "src/crypto/crypto_dh.h",
|
||||
+ "src/crypto/crypto_dsa.cc",
|
||||
+ "src/crypto/crypto_dsa.h",
|
||||
+ "src/crypto/crypto_ec.cc",
|
||||
+ "src/crypto/crypto_ec.h",
|
||||
+ "src/crypto/crypto_groups.h",
|
||||
+ "src/crypto/crypto_hash.cc",
|
||||
+ "src/crypto/crypto_hash.h",
|
||||
+ "src/crypto/crypto_hkdf.cc",
|
||||
+ "src/crypto/crypto_hkdf.h",
|
||||
+ "src/crypto/crypto_hmac.cc",
|
||||
+ "src/crypto/crypto_hmac.h",
|
||||
+ "src/crypto/crypto_keygen.cc",
|
||||
+ "src/crypto/crypto_keygen.h",
|
||||
+ "src/crypto/crypto_keys.cc",
|
||||
+ "src/crypto/crypto_keys.h",
|
||||
+ "src/crypto/crypto_pbkdf2.cc",
|
||||
+ "src/crypto/crypto_pbkdf2.h",
|
||||
+ "src/crypto/crypto_random.cc",
|
||||
+ "src/crypto/crypto_random.h",
|
||||
+ "src/crypto/crypto_rsa.cc",
|
||||
+ "src/crypto/crypto_rsa.h",
|
||||
+ "src/crypto/crypto_scrypt.cc",
|
||||
+ "src/crypto/crypto_scrypt.h",
|
||||
+ "src/crypto/crypto_sig.cc",
|
||||
+ "src/crypto/crypto_sig.h",
|
||||
+ "src/crypto/crypto_spkac.cc",
|
||||
+ "src/crypto/crypto_spkac.h",
|
||||
+ "src/crypto/crypto_timing.cc",
|
||||
+ "src/crypto/crypto_timing.h",
|
||||
+ "src/crypto/crypto_tls.cc",
|
||||
+ "src/crypto/crypto_tls.h",
|
||||
+ "src/crypto/crypto_util.cc",
|
||||
+ "src/crypto/crypto_util.h",
|
||||
+ "src/crypto/crypto_x509.cc",
|
||||
+ "src/crypto/crypto_x509.h",
|
||||
+ "src/node_crypto.cc",
|
||||
+ "src/node_crypto.h",
|
||||
+ "src/node_crypto_common.cc",
|
||||
+ "src/node_crypto_common.h",
|
||||
+ "src/node_crypto_bio.cc",
|
||||
+ "src/node_crypto_bio.h",
|
||||
+ "src/node_crypto_clienthello-inl.h",
|
||||
+ "src/node_crypto_clienthello.cc",
|
||||
+ "src/node_crypto_clienthello.h",
|
||||
+ "src/node_crypto_groups.h",
|
||||
+ "src/tls_wrap.cc",
|
||||
+ "src/tls_wrap.h",
|
||||
+ ]
|
||||
+ cflags_cc += [ "-Wno-sign-compare" ]
|
||||
+ }
|
||||
@@ -888,10 +848,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee5a9e0646
|
||||
index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230ab5985ea
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,530 @@
|
||||
@@ -0,0 +1,550 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
@@ -911,21 +871,81 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ {
|
||||
+ "dest_dir": "include/node//cppgc/",
|
||||
+ "files": [
|
||||
+ "//v8/include/cppgc/common.h"
|
||||
+ "//v8/include/cppgc/allocation.h",
|
||||
+ "//v8/include/cppgc/common.h",
|
||||
+ "//v8/include/cppgc/cross-thread-persistent.h",
|
||||
+ "//v8/include/cppgc/custom-space.h",
|
||||
+ "//v8/include/cppgc/default-platform.h",
|
||||
+ "//v8/include/cppgc/ephemeron-pair.h",
|
||||
+ "//v8/include/cppgc/explicit-management.h",
|
||||
+ "//v8/include/cppgc/garbage-collected.h",
|
||||
+ "//v8/include/cppgc/heap-consistency.h",
|
||||
+ "//v8/include/cppgc/heap-state.h",
|
||||
+ "//v8/include/cppgc/heap-statistics.h",
|
||||
+ "//v8/include/cppgc/heap.h",
|
||||
+ "//v8/include/cppgc/liveness-broker.h",
|
||||
+ "//v8/include/cppgc/macros.h",
|
||||
+ "//v8/include/cppgc/member.h",
|
||||
+ "//v8/include/cppgc/name-provider.h",
|
||||
+ "//v8/include/cppgc/object-size-trait.h",
|
||||
+ "//v8/include/cppgc/persistent.h",
|
||||
+ "//v8/include/cppgc/platform.h",
|
||||
+ "//v8/include/cppgc/prefinalizer.h",
|
||||
+ "//v8/include/cppgc/process-heap-statistics.h",
|
||||
+ "//v8/include/cppgc/sentinel-pointer.h",
|
||||
+ "//v8/include/cppgc/source-location.h",
|
||||
+ "//v8/include/cppgc/testing.h",
|
||||
+ "//v8/include/cppgc/trace-trait.h",
|
||||
+ "//v8/include/cppgc/type-traits.h",
|
||||
+ "//v8/include/cppgc/visitor.h"
|
||||
+ ]
|
||||
+ },
|
||||
+ {
|
||||
+ "dest_dir": "include/node//cppgc/internal/",
|
||||
+ "files": [
|
||||
+ "//v8/include/cppgc/internal/api-constants.h",
|
||||
+ "//v8/include/cppgc/internal/atomic-entry-flag.h",
|
||||
+ "//v8/include/cppgc/internal/caged-heap-local-data.h",
|
||||
+ "//v8/include/cppgc/internal/compiler-specific.h",
|
||||
+ "//v8/include/cppgc/internal/finalizer-trait.h",
|
||||
+ "//v8/include/cppgc/internal/gc-info.h",
|
||||
+ "//v8/include/cppgc/internal/logging.h",
|
||||
+ "//v8/include/cppgc/internal/name-trait.h",
|
||||
+ "//v8/include/cppgc/internal/persistent-node.h",
|
||||
+ "//v8/include/cppgc/internal/pointer-policies.h",
|
||||
+ "//v8/include/cppgc/internal/prefinalizer-handler.h",
|
||||
+ "//v8/include/cppgc/internal/write-barrier.h"
|
||||
+ ]
|
||||
+ },
|
||||
+ {
|
||||
+ "dest_dir": "include/node//",
|
||||
+ "files": [
|
||||
+ "//v8/include/v8-cppgc.h",
|
||||
+ "//v8/include/v8-fast-api-calls.h",
|
||||
+ "//v8/include/v8-internal.h",
|
||||
+ "//v8/include/v8-metrics.h",
|
||||
+ "//v8/include/v8-platform.h",
|
||||
+ "//v8/include/v8-profiler.h",
|
||||
+ "//v8/include/v8-unwinder-state.h",
|
||||
+ "//v8/include/v8-util.h",
|
||||
+ "//v8/include/v8-value-serializer-version.h",
|
||||
+ "//v8/include/v8-version-string.h",
|
||||
+ "//v8/include/v8-version.h",
|
||||
+ "//v8/include/v8-wasm-trap-handler-posix.h",
|
||||
+ "//v8/include/v8-wasm-trap-handler-win.h",
|
||||
+ "//v8/include/v8.h",
|
||||
+ "//v8/include/v8config.h"
|
||||
+ ]
|
||||
+ },
|
||||
+ {
|
||||
+ "dest_dir": "include/node//libplatform/",
|
||||
+ "files": [
|
||||
+ "//v8/include/libplatform/libplatform-export.h",
|
||||
+ "//v8/include/libplatform/libplatform.h",
|
||||
+ "//v8/include/libplatform/v8-tracing.h"
|
||||
+ ]
|
||||
+ },
|
||||
+ {
|
||||
+ "dest_dir": "include/node//uv/",
|
||||
+ "files": [
|
||||
+ "deps/uv/include/uv/aix.h",
|
||||
@@ -966,7 +986,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/per_context/messageport.js",
|
||||
+ "lib/async_hooks.js",
|
||||
+ "lib/assert.js",
|
||||
+ "lib/assert/strict.js",
|
||||
+ "lib/buffer.js",
|
||||
+ "lib/child_process.js",
|
||||
+ "lib/console.js",
|
||||
@@ -976,7 +995,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/diagnostics_channel.js",
|
||||
+ "lib/dgram.js",
|
||||
+ "lib/dns.js",
|
||||
+ "lib/dns/promises.js",
|
||||
+ "lib/domain.js",
|
||||
+ "lib/events.js",
|
||||
+ "lib/fs.js",
|
||||
@@ -995,8 +1013,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/net.js",
|
||||
+ "lib/os.js",
|
||||
+ "lib/path.js",
|
||||
+ "lib/path/posix.js",
|
||||
+ "lib/path/win32.js",
|
||||
+ "lib/perf_hooks.js",
|
||||
+ "lib/process.js",
|
||||
+ "lib/punycode.js",
|
||||
@@ -1004,7 +1020,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/readline.js",
|
||||
+ "lib/repl.js",
|
||||
+ "lib/stream.js",
|
||||
+ "lib/stream/promises.js",
|
||||
+ "lib/_stream_readable.js",
|
||||
+ "lib/_stream_writable.js",
|
||||
+ "lib/_stream_duplex.js",
|
||||
@@ -1013,7 +1028,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/_stream_wrap.js",
|
||||
+ "lib/string_decoder.js",
|
||||
+ "lib/sys.js",
|
||||
+ "lib/timers/promises.js",
|
||||
+ "lib/timers.js",
|
||||
+ "lib/tls.js",
|
||||
+ "lib/_tls_common.js",
|
||||
@@ -1022,7 +1036,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/tty.js",
|
||||
+ "lib/url.js",
|
||||
+ "lib/util.js",
|
||||
+ "lib/util/types.js",
|
||||
+ "lib/v8.js",
|
||||
+ "lib/vm.js",
|
||||
+ "lib/wasi.js",
|
||||
@@ -1033,44 +1046,30 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/assert/assertion_error.js",
|
||||
+ "lib/internal/assert/calltracker.js",
|
||||
+ "lib/internal/async_hooks.js",
|
||||
+ "lib/internal/blob.js",
|
||||
+ "lib/internal/blocklist.js",
|
||||
+ "lib/internal/buffer.js",
|
||||
+ "lib/internal/cli_table.js",
|
||||
+ "lib/internal/child_process.js",
|
||||
+ "lib/internal/child_process/serialization.js",
|
||||
+ "lib/internal/cluster/child.js",
|
||||
+ "lib/internal/cluster/primary.js",
|
||||
+ "lib/internal/cluster/master.js",
|
||||
+ "lib/internal/cluster/round_robin_handle.js",
|
||||
+ "lib/internal/cluster/shared_handle.js",
|
||||
+ "lib/internal/cluster/utils.js",
|
||||
+ "lib/internal/cluster/worker.js",
|
||||
+ "lib/internal/console/constructor.js",
|
||||
+ "lib/internal/console/global.js",
|
||||
+ "lib/internal/crypto/aes.js",
|
||||
+ "lib/internal/crypto/certificate.js",
|
||||
+ "lib/internal/crypto/cipher.js",
|
||||
+ "lib/internal/crypto/diffiehellman.js",
|
||||
+ "lib/internal/crypto/dsa.js",
|
||||
+ "lib/internal/crypto/ec.js",
|
||||
+ "lib/internal/crypto/hash.js",
|
||||
+ "lib/internal/crypto/hashnames.js",
|
||||
+ "lib/internal/crypto/hkdf.js",
|
||||
+ "lib/internal/crypto/keygen.js",
|
||||
+ "lib/internal/crypto/keys.js",
|
||||
+ "lib/internal/crypto/mac.js",
|
||||
+ "lib/internal/crypto/pbkdf2.js",
|
||||
+ "lib/internal/crypto/random.js",
|
||||
+ "lib/internal/crypto/rsa.js",
|
||||
+ "lib/internal/crypto/scrypt.js",
|
||||
+ "lib/internal/crypto/sig.js",
|
||||
+ "lib/internal/crypto/util.js",
|
||||
+ "lib/internal/crypto/webcrypto.js",
|
||||
+ "lib/internal/crypto/x509.js",
|
||||
+ "lib/internal/constants.js",
|
||||
+ "lib/internal/debugger/_inspect.js",
|
||||
+ "lib/internal/debugger/inspect_client.js",
|
||||
+ "lib/internal/debugger/inspect_repl.js",
|
||||
+ "lib/internal/dgram.js",
|
||||
+ "lib/internal/dns/promises.js",
|
||||
+ "lib/internal/dns/utils.js",
|
||||
@@ -1096,7 +1095,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/idna.js",
|
||||
+ "lib/internal/inspector_async_hook.js",
|
||||
+ "lib/internal/js_stream_socket.js",
|
||||
+ "lib/internal/legacy/processbinding.js",
|
||||
+ "lib/internal/linkedlist.js",
|
||||
+ "lib/internal/main/check_syntax.js",
|
||||
+ "lib/internal/main/eval_string.js",
|
||||
@@ -1106,6 +1104,7 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/main/prof_process.js",
|
||||
+ "lib/internal/main/repl.js",
|
||||
+ "lib/internal/main/run_main_module.js",
|
||||
+ "lib/internal/main/run_third_party_main.js",
|
||||
+ "lib/internal/main/worker_thread.js",
|
||||
+ "lib/internal/modules/run_main.js",
|
||||
+ "lib/internal/modules/package_json_reader.js",
|
||||
@@ -1122,13 +1121,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/modules/esm/translators.js",
|
||||
+ "lib/internal/net.js",
|
||||
+ "lib/internal/options.js",
|
||||
+ "lib/internal/perf/perf.js",
|
||||
+ "lib/internal/perf/nodetiming.js",
|
||||
+ "lib/internal/perf/usertiming.js",
|
||||
+ "lib/internal/perf/observe.js",
|
||||
+ "lib/internal/perf/event_loop_delay.js",
|
||||
+ "lib/internal/perf/event_loop_utilization.js",
|
||||
+ "lib/internal/perf/timerify.js",
|
||||
+ "lib/internal/policy/manifest.js",
|
||||
+ "lib/internal/policy/sri.js",
|
||||
+ "lib/internal/priority_queue.js",
|
||||
@@ -1143,20 +1135,17 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/process/signal.js",
|
||||
+ "lib/internal/process/task_queues.js",
|
||||
+ "lib/internal/querystring.js",
|
||||
+ "lib/internal/readline/callbacks.js",
|
||||
+ "lib/internal/readline/emitKeypressEvents.js",
|
||||
+ "lib/internal/readline/utils.js",
|
||||
+ "lib/internal/repl.js",
|
||||
+ "lib/internal/repl/await.js",
|
||||
+ "lib/internal/repl/history.js",
|
||||
+ "lib/internal/repl/utils.js",
|
||||
+ "lib/internal/socketaddress.js",
|
||||
+ "lib/internal/socket_list.js",
|
||||
+ "lib/internal/source_map/prepare_stack_trace.js",
|
||||
+ "lib/internal/source_map/source_map.js",
|
||||
+ "lib/internal/source_map/source_map_cache.js",
|
||||
+ "lib/internal/test/binding.js",
|
||||
+ "lib/internal/test/transfer.js",
|
||||
+ "lib/internal/timers/promises.js",
|
||||
+ "lib/internal/timers.js",
|
||||
+ "lib/internal/tls.js",
|
||||
+ "lib/internal/trace_events_async_hooks.js",
|
||||
@@ -1167,7 +1156,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/util/debuglog.js",
|
||||
+ "lib/internal/util/inspect.js",
|
||||
+ "lib/internal/util/inspector.js",
|
||||
+ "lib/internal/util/iterable_weak_map.js",
|
||||
+ "lib/internal/util/types.js",
|
||||
+ "lib/internal/http2/core.js",
|
||||
+ "lib/internal/http2/compat.js",
|
||||
@@ -1182,7 +1170,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/worker/js_transferable.js",
|
||||
+ "lib/internal/watchdog.js",
|
||||
+ "lib/internal/streams/lazy_transform.js",
|
||||
+ "lib/internal/streams/add-abort-signal.js",
|
||||
+ "lib/internal/streams/buffer_list.js",
|
||||
+ "lib/internal/streams/duplexpair.js",
|
||||
+ "lib/internal/streams/from.js",
|
||||
@@ -1196,7 +1183,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "lib/internal/streams/state.js",
|
||||
+ "lib/internal/streams/pipeline.js",
|
||||
+ "lib/internal/streams/end-of-stream.js",
|
||||
+ "lib/internal/streams/utils.js",
|
||||
+ "//v8/tools/splaytree.mjs",
|
||||
+ "//v8/tools/codemap.mjs",
|
||||
+ "//v8/tools/consarray.mjs",
|
||||
@@ -1208,6 +1194,9 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "//v8/tools/tickprocessor.mjs",
|
||||
+ "//v8/tools/sourcemap.mjs",
|
||||
+ "//v8/tools/tickprocessor-driver.mjs",
|
||||
+ "deps/node-inspect/lib/_inspect.js",
|
||||
+ "deps/node-inspect/lib/internal/inspect_client.js",
|
||||
+ "deps/node-inspect/lib/internal/inspect_repl.js",
|
||||
+ "deps/acorn/acorn/dist/acorn.js",
|
||||
+ "deps/acorn/acorn-walk/dist/walk.js",
|
||||
+ "deps/acorn-plugins/acorn-class-fields/index.js",
|
||||
@@ -1220,7 +1209,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "node_sources": [
|
||||
+ "src/api/async_resource.cc",
|
||||
+ "src/api/callback.cc",
|
||||
+ "src/api/embed_helpers.cc",
|
||||
+ "src/api/encoding.cc",
|
||||
+ "src/api/environment.cc",
|
||||
+ "src/api/exceptions.cc",
|
||||
@@ -1248,7 +1236,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "src/node.cc",
|
||||
+ "src/node_api.cc",
|
||||
+ "src/node_binding.cc",
|
||||
+ "src/node_blob.cc",
|
||||
+ "src/node_buffer.cc",
|
||||
+ "src/node_config.cc",
|
||||
+ "src/node_constants.cc",
|
||||
@@ -1257,7 +1244,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "src/node_dir.cc",
|
||||
+ "src/node_env_var.cc",
|
||||
+ "src/node_errors.cc",
|
||||
+ "src/node_external_reference.cc",
|
||||
+ "src/node_file.cc",
|
||||
+ "src/node_http_parser.cc",
|
||||
+ "src/node_http2.cc",
|
||||
@@ -1279,7 +1265,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "src/node_report_module.cc",
|
||||
+ "src/node_report_utils.cc",
|
||||
+ "src/node_serdes.cc",
|
||||
+ "src/node_snapshotable.cc",
|
||||
+ "src/node_sockaddr.cc",
|
||||
+ "src/node_stat_watcher.cc",
|
||||
+ "src/node_symbols.cc",
|
||||
@@ -1287,7 +1272,6 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "src/node_trace_events.cc",
|
||||
+ "src/node_types.cc",
|
||||
+ "src/node_url.cc",
|
||||
+ "src/node_url_tables.cc",
|
||||
+ "src/node_util.cc",
|
||||
+ "src/node_v8.cc",
|
||||
+ "src/node_wasi.cc",
|
||||
@@ -1348,14 +1332,12 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "src/node_api.h",
|
||||
+ "src/node_api_types.h",
|
||||
+ "src/node_binding.h",
|
||||
+ "src/node_blob.h",
|
||||
+ "src/node_buffer.h",
|
||||
+ "src/node_constants.h",
|
||||
+ "src/node_context_data.h",
|
||||
+ "src/node_contextify.h",
|
||||
+ "src/node_dir.h",
|
||||
+ "src/node_errors.h",
|
||||
+ "src/node_external_reference.h",
|
||||
+ "src/node_file.h",
|
||||
+ "src/node_file-inl.h",
|
||||
+ "src/node_http_common.h",
|
||||
@@ -1379,11 +1361,9 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "src/node_perf_common.h",
|
||||
+ "src/node_platform.h",
|
||||
+ "src/node_process.h",
|
||||
+ "src/node_process-inl.h",
|
||||
+ "src/node_report.h",
|
||||
+ "src/node_revert.h",
|
||||
+ "src/node_root_certs.h",
|
||||
+ "src/node_snapshotable.h",
|
||||
+ "src/node_sockaddr.h",
|
||||
+ "src/node_sockaddr-inl.h",
|
||||
+ "src/node_stat_watcher.h",
|
||||
@@ -1422,6 +1402,39 @@ index 0000000000000000000000000000000000000000..7225bdb6b281837253978430a665e9ee
|
||||
+ "//v8/include/v8.h"
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/node.gyp b/node.gyp
|
||||
index 61b789ec74ab554648164875d540f34c09ffc116..753f135322a007b3b9d330ccd4101cc18b454e58 100644
|
||||
--- a/node.gyp
|
||||
+++ b/node.gyp
|
||||
@@ -238,17 +238,17 @@
|
||||
'lib/internal/streams/state.js',
|
||||
'lib/internal/streams/pipeline.js',
|
||||
'lib/internal/streams/end-of-stream.js',
|
||||
- 'deps/v8/tools/splaytree.js',
|
||||
- 'deps/v8/tools/codemap.js',
|
||||
- 'deps/v8/tools/consarray.js',
|
||||
- 'deps/v8/tools/csvparser.js',
|
||||
- 'deps/v8/tools/profile.js',
|
||||
- 'deps/v8/tools/profile_view.js',
|
||||
- 'deps/v8/tools/logreader.js',
|
||||
- 'deps/v8/tools/arguments.js',
|
||||
- 'deps/v8/tools/tickprocessor.js',
|
||||
- 'deps/v8/tools/SourceMap.js',
|
||||
- 'deps/v8/tools/tickprocessor-driver.js',
|
||||
+ 'deps/v8/tools/splaytree.mjs',
|
||||
+ 'deps/v8/tools/codemap.mjs',
|
||||
+ 'deps/v8/tools/consarray.mjs',
|
||||
+ 'deps/v8/tools/csvparser.mjs',
|
||||
+ 'deps/v8/tools/profile.mjs',
|
||||
+ 'deps/v8/tools/profile_view.mjs',
|
||||
+ 'deps/v8/tools/logreader.mjs',
|
||||
+ 'deps/v8/tools/arguments.mjs',
|
||||
+ 'deps/v8/tools/tickprocessor.mjs',
|
||||
+ 'deps/v8/tools/sourcemap.mjs',
|
||||
+ 'deps/v8/tools/tickprocessor-driver.mjs',
|
||||
'deps/node-inspect/lib/_inspect.js',
|
||||
'deps/node-inspect/lib/internal/inspect_client.js',
|
||||
'deps/node-inspect/lib/internal/inspect_repl.js',
|
||||
diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb3048361d9d591
|
||||
@@ -1628,7 +1641,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 a1a67f0f9034e448a650658df951f160430981ae..c04f70fd1357418b85f1cc64ba9ee0af97076592 100644
|
||||
index 5419747db7b6504ad9d61b1cd3d53d93913e360f..e51bf333b77e67af188a3d352ca22b12d939e412 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
@@ -1637,7 +1650,7 @@ index a1a67f0f9034e448a650658df951f160430981ae..c04f70fd1357418b85f1cc64ba9ee0af
|
||||
*/
|
||||
+// Electron sets NODE_MODULE_VERSION in their GN configuration
|
||||
+#ifndef NODE_MODULE_VERSION
|
||||
#define NODE_MODULE_VERSION 93
|
||||
#define NODE_MODULE_VERSION 83
|
||||
+#endif
|
||||
|
||||
// The NAPI_VERSION provided by this version of the runtime. This is the version
|
||||
@@ -1661,10 +1674,10 @@ index 0000000000000000000000000000000000000000..01f62d4ae6e3b9d539444e3dff069f00
|
||||
+ main(sys.argv[1:])
|
||||
diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py
|
||||
new file mode 100755
|
||||
index 0000000000000000000000000000000000000000..cf3b8df67d73b4096a0113b55e2a916b59701b23
|
||||
index 0000000000000000000000000000000000000000..e5fd79da5323e7039730fd8cca66caae8c84e903
|
||||
--- /dev/null
|
||||
+++ b/tools/generate_gn_filenames_json.py
|
||||
@@ -0,0 +1,71 @@
|
||||
@@ -0,0 +1,70 @@
|
||||
+#!/usr/bin/env python
|
||||
+import json
|
||||
+import os
|
||||
@@ -1726,9 +1739,8 @@ index 0000000000000000000000000000000000000000..cf3b8df67d73b4096a0113b55e2a916b
|
||||
+ files = [f for f in files if f.endswith('.h') and f != 'src/node_version.h']
|
||||
+ elif any(f.startswith('../../v8/') for f in files):
|
||||
+ files = [f.replace('../../v8/', '//v8/', 1) for f in files]
|
||||
+ if files:
|
||||
+ hs = {'files': sorted(files), 'dest_dir': dest_dir}
|
||||
+ out['headers'].append(hs)
|
||||
+ hs = {'files': sorted(files), 'dest_dir': dest_dir}
|
||||
+ out['headers'].append(hs)
|
||||
+
|
||||
+ install.variables = {'node_shared_libuv': 'false'}
|
||||
+ install.headers(add_headers)
|
||||
@@ -1768,43 +1780,31 @@ index 0000000000000000000000000000000000000000..3088ae4bdf814ae255c9805ebd393b2e
|
||||
+
|
||||
+ out_file.writelines(new_contents)
|
||||
diff --git a/tools/install.py b/tools/install.py
|
||||
index 045d406d84be301722f3de62abc448db84e751f8..95aa4c985d33ef37a73eebfca8bb8651e5059d37 100755
|
||||
index 693faff4c37ac4d83a47e818f4412900497a2b62..7ab58f7cba6f210e4b7829257fb87e26a091cc89 100755
|
||||
--- a/tools/install.py
|
||||
+++ b/tools/install.py
|
||||
@@ -159,14 +159,15 @@ def files(action):
|
||||
@@ -159,8 +159,8 @@ def files(action):
|
||||
def headers(action):
|
||||
def wanted_v8_headers(files_arg, dest):
|
||||
v8_headers = [
|
||||
- 'deps/v8/include/cppgc/common.h',
|
||||
- 'deps/v8/include/v8.h',
|
||||
- 'deps/v8/include/v8-internal.h',
|
||||
- 'deps/v8/include/v8-platform.h',
|
||||
- 'deps/v8/include/v8-profiler.h',
|
||||
- 'deps/v8/include/v8-version.h',
|
||||
- 'deps/v8/include/v8config.h',
|
||||
+ '../../v8/include/cppgc/common.h',
|
||||
+ '../../v8/include/v8.h',
|
||||
+ '../../v8/include/v8-internal.h',
|
||||
+ '../../v8/include/v8-platform.h',
|
||||
+ '../../v8/include/v8-profiler.h',
|
||||
+ '../../v8/include/v8-version.h',
|
||||
+ '../../v8/include/v8config.h',
|
||||
def ignore_inspector_headers(files_arg, dest):
|
||||
inspector_headers = [
|
||||
- 'deps/v8/include/v8-inspector.h',
|
||||
- 'deps/v8/include/v8-inspector-protocol.h'
|
||||
+ '../../v8/include/v8-inspector.h',
|
||||
+ '../../v8/include/v8-inspector-protocol.h'
|
||||
]
|
||||
+ v8_headers = [h.replace('deps/', '../../') for h in v8_headers]
|
||||
files_arg = [name for name in files_arg if name in v8_headers]
|
||||
files_arg = [name for name in files_arg if name not in inspector_headers]
|
||||
action(files_arg, dest)
|
||||
|
||||
@@ -187,7 +188,7 @@ def headers(action):
|
||||
@@ -182,7 +182,7 @@ def headers(action):
|
||||
if sys.platform.startswith('aix'):
|
||||
action(['out/Release/node.exp'], 'include/node/')
|
||||
|
||||
- subdir_files('deps/v8/include', 'include/node/', wanted_v8_headers)
|
||||
+ subdir_files('../../v8/include', 'include/node/', wanted_v8_headers)
|
||||
- subdir_files('deps/v8/include', 'include/node/', ignore_inspector_headers)
|
||||
+ subdir_files('../../v8/include', 'include/node/', ignore_inspector_headers)
|
||||
|
||||
if 'false' == variables.get('node_shared_libuv'):
|
||||
subdir_files('deps/uv/include', 'include/node/', action)
|
||||
diff --git a/tools/js2c.py b/tools/js2c.py
|
||||
index d40f28ce2bff2b7fc28ceeafc7772831746e7f89..4af54c3fa00602f9d0ce5cc4dca253d425048706 100755
|
||||
index 0f073e182bdb2858957e4b28ae15b366d7933dbe..93e9474297fd9032981786ae9d4e005f2d1a9a2e 100755
|
||||
--- a/tools/js2c.py
|
||||
+++ b/tools/js2c.py
|
||||
@@ -130,6 +130,14 @@ def NormalizeFileName(filename):
|
||||
|
||||
172
patches/node/build_add_mjs_support_to_js2c.patch
Normal file
172
patches/node/build_add_mjs_support_to_js2c.patch
Normal file
@@ -0,0 +1,172 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Kleinschmidt <jkleinsc@electronjs.org>
|
||||
Date: Thu, 18 Feb 2021 17:35:39 -0500
|
||||
Subject: build: add .mjs support to js2c
|
||||
|
||||
V8 now uses .mjs files, so this updates js2c to handle those files.
|
||||
|
||||
diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js
|
||||
index 5f5922c5386543189d6ae9293108425cf212b054..605c7274c1fff1a2f1bd0b6c4f667f86145036bd 100644
|
||||
--- a/lib/internal/v8_prof_polyfill.js
|
||||
+++ b/lib/internal/v8_prof_polyfill.js
|
||||
@@ -69,7 +69,7 @@ function read(fileName) {
|
||||
const quit = process.exit;
|
||||
|
||||
// Polyfill "readline()".
|
||||
-const logFile = arguments[arguments.length - 1];
|
||||
+const logFile = globalThis.arguments[globalThis.arguments.length - 1];
|
||||
try {
|
||||
fs.accessSync(logFile);
|
||||
} catch(e) {
|
||||
@@ -159,3 +159,11 @@ function macCppfiltNm(out) {
|
||||
return prefix + (filtered[i++] || postfix);
|
||||
});
|
||||
}
|
||||
+
|
||||
+Object.assign(globalThis, {
|
||||
+ os,
|
||||
+ print,
|
||||
+ read,
|
||||
+ quit,
|
||||
+ readline,
|
||||
+});
|
||||
diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js
|
||||
index daae650b2ad8ef146eb3a55c95dc80e0dbc2e3d7..7d6c7dce30058a73427dc7705f3dd98c4a6f4319 100644
|
||||
--- a/lib/internal/v8_prof_processor.js
|
||||
+++ b/lib/internal/v8_prof_processor.js
|
||||
@@ -3,43 +3,51 @@
|
||||
const {
|
||||
ArrayPrototypePush,
|
||||
ArrayPrototypeSlice,
|
||||
- JSONStringify,
|
||||
+ StringPrototypeSlice,
|
||||
} = primordials;
|
||||
|
||||
+const Buffer = require('buffer').Buffer;
|
||||
+const console = require('internal/console/global');
|
||||
const vm = require('vm');
|
||||
+const { SourceTextModule } = require('internal/vm/module');
|
||||
|
||||
-const scriptFiles = [
|
||||
- 'internal/v8_prof_polyfill',
|
||||
- 'internal/deps/v8/tools/splaytree',
|
||||
- 'internal/deps/v8/tools/codemap',
|
||||
- 'internal/deps/v8/tools/csvparser',
|
||||
- 'internal/deps/v8/tools/consarray',
|
||||
- 'internal/deps/v8/tools/profile',
|
||||
- 'internal/deps/v8/tools/profile_view',
|
||||
- 'internal/deps/v8/tools/logreader',
|
||||
- 'internal/deps/v8/tools/arguments',
|
||||
- 'internal/deps/v8/tools/tickprocessor',
|
||||
- 'internal/deps/v8/tools/SourceMap',
|
||||
- 'internal/deps/v8/tools/tickprocessor-driver'
|
||||
-];
|
||||
-let script = '';
|
||||
-
|
||||
-for (const s of scriptFiles) {
|
||||
- script += internalBinding('natives')[s] + '\n';
|
||||
-}
|
||||
+const natives = internalBinding('natives');
|
||||
|
||||
-const tickArguments = [];
|
||||
-if (process.platform === 'darwin') {
|
||||
- ArrayPrototypePush(tickArguments, '--mac');
|
||||
-} else if (process.platform === 'win32') {
|
||||
- ArrayPrototypePush(tickArguments, '--windows');
|
||||
+async function linker(specifier, referencingModule) {
|
||||
+ // Transform "./file.mjs" to "file"
|
||||
+ const file = StringPrototypeSlice(specifier, 2, -4);
|
||||
+ const code = natives[`internal/deps/v8/tools/${file}`];
|
||||
+ return new SourceTextModule(code, { context: referencingModule.context });
|
||||
}
|
||||
-ArrayPrototypePush(tickArguments,
|
||||
- ...ArrayPrototypeSlice(process.argv, 1));
|
||||
-script = `(function(module, require) {
|
||||
- arguments = ${JSONStringify(tickArguments)};
|
||||
- function write (s) { process.stdout.write(s) }
|
||||
- function printErr(err) { console.error(err); }
|
||||
- ${script}
|
||||
-})`;
|
||||
-vm.runInThisContext(script)(module, require);
|
||||
+
|
||||
+(async () => {
|
||||
+ const tickArguments = [];
|
||||
+ if (process.platform === 'darwin') {
|
||||
+ ArrayPrototypePush(tickArguments, '--mac');
|
||||
+ } else if (process.platform === 'win32') {
|
||||
+ ArrayPrototypePush(tickArguments, '--windows');
|
||||
+ }
|
||||
+ ArrayPrototypePush(tickArguments,
|
||||
+ ...ArrayPrototypeSlice(process.argv, 1));
|
||||
+
|
||||
+ const context = vm.createContext({
|
||||
+ arguments: tickArguments,
|
||||
+ write(s) { process.stdout.write(s); },
|
||||
+ printErr(err) { console.error(err); },
|
||||
+ console,
|
||||
+ process,
|
||||
+ Buffer,
|
||||
+ });
|
||||
+
|
||||
+ const polyfill = natives['internal/v8_prof_polyfill'];
|
||||
+ const script = `(function(module, require) {
|
||||
+ ${polyfill}
|
||||
+ })`;
|
||||
+
|
||||
+ vm.runInContext(script, context)(module, require);
|
||||
+
|
||||
+ const tickProcessor = natives['internal/deps/v8/tools/tickprocessor-driver'];
|
||||
+ const tickprocessorDriver = new SourceTextModule(tickProcessor, { context });
|
||||
+ await tickprocessorDriver.link(linker);
|
||||
+ await tickprocessorDriver.evaluate();
|
||||
+})();
|
||||
\ No newline at end of file
|
||||
diff --git a/tools/js2c.py b/tools/js2c.py
|
||||
index bca4c44a31d1ffe7c9ae15b6f60cd55e325f707d..7acb27e753e31429fbb5de30c62dd30a3be3b5bc 100755
|
||||
--- a/tools/js2c.py
|
||||
+++ b/tools/js2c.py
|
||||
@@ -151,20 +151,21 @@ def JS2C(source_files, target, only_js):
|
||||
# Build source code lines
|
||||
definitions = []
|
||||
initializers = []
|
||||
-
|
||||
- for filename in source_files['.js']:
|
||||
- AddModule(filename, definitions, initializers)
|
||||
-
|
||||
- # Electron: Expose fs module without asar support.
|
||||
- if filename == 'lib/fs.js':
|
||||
- # Node's 'fs' and 'internal/fs/<filename> have lazy-loaded circular
|
||||
- # dependencies. So to expose the unmodified Node 'fs' functionality here,
|
||||
- # we have to copy both 'fs' *and* 'internal/fs/<filename>' files and modify the
|
||||
- # copies to depend on each other instead of on our asarified 'fs' code.
|
||||
- AddModule('lib/original-fs.js', definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/", "require('internal/original-fs/"))
|
||||
- elif filename.startswith('lib/internal/fs/'):
|
||||
- original_fs_filename = filename.replace('internal/fs/', 'internal/original-fs/')
|
||||
- AddModule(original_fs_filename, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
|
||||
+ for extension in source_files.keys():
|
||||
+ for filename in source_files[extension]:
|
||||
+ if extension == '.js' or extension == '.mjs':
|
||||
+ AddModule(filename, definitions, initializers)
|
||||
+
|
||||
+ # Electron: Expose fs module without asar support.
|
||||
+ if filename == 'lib/fs.js':
|
||||
+ # Node's 'fs' and 'internal/fs/<filename> have lazy-loaded circular
|
||||
+ # dependencies. So to expose the unmodified Node 'fs' functionality here,
|
||||
+ # we have to copy both 'fs' *and* 'internal/fs/<filename>' files and modify the
|
||||
+ # copies to depend on each other instead of on our asarified 'fs' code.
|
||||
+ AddModule('lib/original-fs.js', definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/", "require('internal/original-fs/"))
|
||||
+ elif filename.startswith('lib/internal/fs/'):
|
||||
+ original_fs_filename = filename.replace('internal/fs/', 'internal/original-fs/')
|
||||
+ AddModule(original_fs_filename, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
|
||||
|
||||
config_size = 0
|
||||
if not only_js:
|
||||
@@ -240,7 +241,7 @@ def main():
|
||||
if options.only_js:
|
||||
assert len(source_files) == 1
|
||||
else:
|
||||
- assert len(source_files) == 2
|
||||
+ assert len(source_files) == 3
|
||||
# Currently config.gypi is the only `.gypi` file allowed
|
||||
assert source_files['.gypi'][0].endswith('config.gypi')
|
||||
source_files['config.gypi'] = source_files.pop('.gypi')[0]
|
||||
@@ -13,32 +13,11 @@ process and provide embedder modules (electrons
|
||||
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 b45af42d12ff7df8a9e125e87f51af3456811c23..c84ff7feb07aebf656ada7e37d812d9d8a81300f 100644
|
||||
--- a/lib/internal/fs/watchers.js
|
||||
+++ b/lib/internal/fs/watchers.js
|
||||
@@ -290,10 +290,12 @@ 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.
|
||||
-ObjectDefineProperty(FSEvent.prototype, 'owner', {
|
||||
- get() { return this[owner_symbol]; },
|
||||
- set(v) { return this[owner_symbol] = v; }
|
||||
-});
|
||||
+if (!'owner' in FSEvent.prototype) {
|
||||
+ ObjectDefineProperty(FSEvent.prototype, 'owner', {
|
||||
+ get() { return this[owner_symbol]; },
|
||||
+ set(v) { return this[owner_symbol] = v; }
|
||||
+ });
|
||||
+}
|
||||
|
||||
async function* watch(filename, options = {}) {
|
||||
const path = toNamespacedPath(getValidatedPath(filename));
|
||||
diff --git a/src/node_native_module.cc b/src/node_native_module.cc
|
||||
index f788732ae569d460a0e596397e589774ba4be4f1..186c24c0ba37781d8d9d0443d18b4f4bb0e02bef 100644
|
||||
index 4c3633e06c60265c974bdd2a5a3d2e615e4aeb82..5e03a3a6e35e934faf71e765d7fc6e356f40e8d0 100644
|
||||
--- a/src/node_native_module.cc
|
||||
+++ b/src/node_native_module.cc
|
||||
@@ -19,6 +19,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
|
||||
@@ -20,6 +20,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
|
||||
|
||||
NativeModuleLoader::NativeModuleLoader() : config_(GetConfig()) {
|
||||
LoadJavaScriptSource();
|
||||
@@ -59,7 +38,7 @@ index 3be3f2364dd252bcdd668c699a0e7ae1e754e873..b2af1bce312ffca44e7005e11f92327e
|
||||
|
||||
bool Exists(const char* id);
|
||||
diff --git a/tools/js2c.py b/tools/js2c.py
|
||||
index 4af54c3fa00602f9d0ce5cc4dca253d425048706..18f584473fb87f036ce2a67c5172cccaf0caaa5f 100755
|
||||
index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e325f707d 100755
|
||||
--- a/tools/js2c.py
|
||||
+++ b/tools/js2c.py
|
||||
@@ -38,6 +38,8 @@ import functools
|
||||
@@ -104,14 +83,14 @@ index 4af54c3fa00602f9d0ce5cc4dca253d425048706..18f584473fb87f036ce2a67c5172ccca
|
||||
initializers.append(initializer)
|
||||
|
||||
def NormalizeFileName(filename):
|
||||
- split = filename.split('/')
|
||||
- split = filename.split(os.path.sep)
|
||||
+ if filename.startswith('//v8'):
|
||||
+ filename = "deps/" + filename[2:]
|
||||
+ split = os.path.normpath(filename).split(os.path.sep)
|
||||
if split[0] == 'deps':
|
||||
split = ['internal'] + split
|
||||
else: # `lib/**/*.js` so drop the 'lib' part
|
||||
@@ -141,23 +147,36 @@ def NormalizeFileName(filename):
|
||||
@@ -141,7 +147,7 @@ def NormalizeFileName(filename):
|
||||
return os.path.splitext(filename)[0]
|
||||
|
||||
|
||||
@@ -120,29 +99,22 @@ index 4af54c3fa00602f9d0ce5cc4dca253d425048706..18f584473fb87f036ce2a67c5172ccca
|
||||
# Build source code lines
|
||||
definitions = []
|
||||
initializers = []
|
||||
@@ -149,13 +155,26 @@ def JS2C(source_files, target):
|
||||
for filename in source_files['.js']:
|
||||
AddModule(filename, definitions, initializers)
|
||||
|
||||
- for filename in source_files['.js']:
|
||||
- AddModule(filename, definitions, initializers)
|
||||
- for filename in source_files['.mjs']:
|
||||
- AddModule(filename, definitions, initializers)
|
||||
-
|
||||
- config_def, config_size = handle_config_gypi(source_files['config.gypi'])
|
||||
- definitions.append(config_def)
|
||||
+ for extension in source_files.keys():
|
||||
+ if extension == '.js' or extension == '.mjs':
|
||||
+ for filename in source_files[extension]:
|
||||
+ AddModule(filename, definitions, initializers)
|
||||
+
|
||||
+ # Electron: Expose fs module without asar support.
|
||||
+ if filename == 'lib/fs.js':
|
||||
+ # Node's 'fs' and 'internal/fs/<filename> have lazy-loaded circular
|
||||
+ # dependencies. So to expose the unmodified Node 'fs' functionality here,
|
||||
+ # we have to copy both 'fs' *and* 'internal/fs/<filename>' files and modify the
|
||||
+ # copies to depend on each other instead of on our asarified 'fs' code.
|
||||
+ AddModule('lib/original-fs.js', definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/", "require('internal/original-fs/"))
|
||||
+ elif filename.startswith('lib/internal/fs/'):
|
||||
+ original_fs_filename = filename.replace('internal/fs/', 'internal/original-fs/')
|
||||
+ AddModule(original_fs_filename, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
|
||||
+ # Electron: Expose fs module without asar support.
|
||||
+ if filename == 'lib/fs.js':
|
||||
+ # Node's 'fs' and 'internal/fs/<filename> have lazy-loaded circular
|
||||
+ # dependencies. So to expose the unmodified Node 'fs' functionality here,
|
||||
+ # we have to copy both 'fs' *and* 'internal/fs/<filename>' files and modify the
|
||||
+ # copies to depend on each other instead of on our asarified 'fs' code.
|
||||
+ AddModule('lib/original-fs.js', definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/", "require('internal/original-fs/"))
|
||||
+ elif filename.startswith('lib/internal/fs/'):
|
||||
+ original_fs_filename = filename.replace('internal/fs/', 'internal/original-fs/')
|
||||
+ AddModule(original_fs_filename, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
|
||||
+
|
||||
+ config_size = 0
|
||||
+ if not only_js:
|
||||
@@ -157,7 +129,7 @@ index 4af54c3fa00602f9d0ce5cc4dca253d425048706..18f584473fb87f036ce2a67c5172ccca
|
||||
write_if_chaged(out, target)
|
||||
|
||||
|
||||
@@ -213,18 +232,21 @@ def main():
|
||||
@@ -211,17 +230,21 @@ def main():
|
||||
)
|
||||
parser.add_argument('--target', help='output file')
|
||||
parser.add_argument('--verbose', action='store_true', help='output file')
|
||||
@@ -167,22 +139,20 @@ index 4af54c3fa00602f9d0ce5cc4dca253d425048706..18f584473fb87f036ce2a67c5172ccca
|
||||
global is_verbose
|
||||
is_verbose = options.verbose
|
||||
source_files = functools.reduce(SourceFileByExt, options.sources, {})
|
||||
- # Should have exactly 3 types: `.js`, `.mjs` and `.gypi`
|
||||
- assert len(source_files) == 3
|
||||
# Should have exactly 2 types: `.js`, and `.gypi`
|
||||
- assert len(source_files) == 2
|
||||
- # Currently config.gypi is the only `.gypi` file allowed
|
||||
- assert source_files['.gypi'] == ['config.gypi']
|
||||
- source_files['config.gypi'] = source_files.pop('.gypi')[0]
|
||||
- JS2C(source_files, options.target)
|
||||
-
|
||||
+ if options.only_js:
|
||||
+ assert len(source_files) == 1
|
||||
+ else:
|
||||
+ # Should have exactly 3 types: `.js`, `.mjs` and `.gypi`
|
||||
+ assert len(source_files) == 3
|
||||
+ assert len(source_files) == 2
|
||||
+ # Currently config.gypi is the only `.gypi` file allowed
|
||||
+ assert source_files['.gypi'][0].endswith('config.gypi')
|
||||
+ source_files['config.gypi'] = source_files.pop('.gypi')[0]
|
||||
+ JS2C(source_files, options.target, options.only_js)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -8,18 +8,18 @@ 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 3c05e553c8e61456205a1f632c903055650a3fc6..292204024f64e6457f1344db1c74d006b7233c82 100644
|
||||
index ca5a01f925a2ae69ba4295d82316e546f45c60cd..a0f6730de75b9b1dc58e2cec5ed64f9619162a2b 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "node_errors.h"
|
||||
#include "node_external_reference.h"
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <atomic>
|
||||
#include "env-inl.h"
|
||||
#include "node_native_module_env.h"
|
||||
+#include "node_process.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <string>
|
||||
@@ -465,7 +466,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
#if HAVE_OPENSSL
|
||||
@@ -463,7 +464,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
if (mp->nm_context_register_func == nullptr) {
|
||||
if (env->force_context_aware()) {
|
||||
dlib->Close();
|
||||
|
||||
@@ -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/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index f7e9ffa74a4f19caa96680b3c955937f7ab31ea0..d1fb880f5f904909a1535f8253ab0b29203304bf 100644
|
||||
index a66ac87237ad1de85318be58d15b508be568cf1f..62553011f9fd16dbaccd8d7e8eecee627be7137c 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -102,10 +102,12 @@ function patchProcessObject(expandArgv1) {
|
||||
@@ -89,10 +89,12 @@ function patchProcessObject(expandArgv1) {
|
||||
if (expandArgv1 && process.argv[1] &&
|
||||
!StringPrototypeStartsWith(process.argv[1], '-')) {
|
||||
// Expand process.argv[1] into a full path.
|
||||
@@ -29,10 +29,10 @@ index f7e9ffa74a4f19caa96680b3c955937f7ab31ea0..d1fb880f5f904909a1535f8253ab0b29
|
||||
|
||||
// TODO(joyeecheung): most of these should be deprecated and removed,
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index afb1eca73a2d91b76d098114de18ad7e29846e5c..01070c214e961d31ac508cfca669df2733abbff6 100644
|
||||
index e2a205739ce89820fe5f1f24e609ff16b86afb04..db6980d387ed399671957170266e2a01c04fae9a 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1069,6 +1069,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -1042,6 +1042,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.
|
||||
|
||||
@@ -7,10 +7,10 @@ This is used so that we can modify the flag at runtime where
|
||||
config can only be set at compile time.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
|
||||
index 8b70f79d2b278f2f6b15abc2eba5045b1ca503b4..bfc6edfae4b4b4f8b7ee2a97209e1801d7c2d4c9 100644
|
||||
index 5aab40071b68affe602be16d451be598b246faa1..6a55064eac76ee88d3b0b734d4f242da80aca119 100644
|
||||
--- a/lib/internal/bootstrap/node.js
|
||||
+++ b/lib/internal/bootstrap/node.js
|
||||
@@ -193,7 +193,7 @@ const {
|
||||
@@ -119,7 +119,7 @@ const {
|
||||
queueMicrotask
|
||||
} = require('internal/process/task_queues');
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
|
||||
out in memory on 64-bit machines, and will summarily fail to work.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 9481fdb6dd4628833e60ae7099f03eca41edd057..60789d5553352563eb41a341860df70175153e4c 100644
|
||||
index 3f305b39cb35a1a36a54cff80476fecba1556d5d..cd56b9b314823ff48c1a599ec51c6a3077b62f98 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -64,7 +64,7 @@
|
||||
@@ -20,7 +20,7 @@ index 9481fdb6dd4628833e60ae7099f03eca41edd057..60789d5553352563eb41a341860df701
|
||||
|
||||
# Disable V8 untrusted code mitigations.
|
||||
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
|
||||
@@ -125,6 +125,9 @@
|
||||
@@ -124,6 +124,9 @@
|
||||
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
|
||||
'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
|
||||
}],
|
||||
|
||||
@@ -9,10 +9,10 @@ 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 b5e42af79510b690a1687d4d32a2a583704a397f..3c05e553c8e61456205a1f632c903055650a3fc6 100644
|
||||
index 8665b2827583d3ac7cfbfde661878026caba15ca..ca5a01f925a2ae69ba4295d82316e546f45c60cd 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -607,6 +607,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -608,6 +608,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
args.GetReturnValue().Set(exports);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ Environment on the V8 context of blink, so no new V8 context is created.
|
||||
As a result, a renderer process may have multiple Node Environments in it.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index b60be116b6139bd4b7c10485bfdad2c1b905c995..c9d491f01651ef57fb793dda108469cb7ddccc5c 100644
|
||||
index 905afd8c235b7b1a7b45823db486384935a2a52b..102847cd32d03addeb40c9539eafc92ba49c8ec4 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -139,6 +139,8 @@ using v8::Undefined;
|
||||
@@ -134,6 +134,8 @@ using v8::Undefined;
|
||||
using v8::V8;
|
||||
using v8::Value;
|
||||
|
||||
@@ -36,7 +36,7 @@ index b60be116b6139bd4b7c10485bfdad2c1b905c995..c9d491f01651ef57fb793dda108469cb
|
||||
namespace per_process {
|
||||
|
||||
// node_revert.h
|
||||
@@ -860,7 +862,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -837,7 +839,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
binding::RegisterBuiltinModules();
|
||||
|
||||
// Make inherited handles noninheritable.
|
||||
@@ -47,30 +47,28 @@ index b60be116b6139bd4b7c10485bfdad2c1b905c995..c9d491f01651ef57fb793dda108469cb
|
||||
|
||||
// Cache the original command line to be
|
||||
// used in diagnostic reports.
|
||||
@@ -894,7 +898,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -871,6 +875,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
if (exit_code != 0) return exit_code;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
+ if (g_upstream_node_mode) {
|
||||
+ // NOTE(jeremy): indentation is intentionally wrong here, to ease rebasing.
|
||||
|
||||
const int exit_code = ProcessGlobalArgs(argv,
|
||||
exec_argv,
|
||||
errors,
|
||||
@@ -937,7 +942,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
return 9;
|
||||
@@ -915,6 +921,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
}
|
||||
per_process::metadata.versions.InitializeIntlVersions();
|
||||
-
|
||||
#endif
|
||||
+ } // g_upstream_node_mode
|
||||
# ifndef __POSIX__
|
||||
std::string tz;
|
||||
if (credentials::SafeGetenv("TZ", &tz) && !tz.empty()) {
|
||||
|
||||
NativeModuleEnv::InitializeCodeCache();
|
||||
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 4348dfba5b2be8973eda7f36bfb9479a744a07f6..4e533cab0b74221219752aea7533866830067c09 100644
|
||||
index 38e0ef50f9b283b1d7ca8f54412d99b8cd38e524..34a16feaed229a59181e1b2e48b0e111d5b0b2a6 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -213,6 +213,8 @@ namespace node {
|
||||
@@ -220,6 +220,8 @@ namespace node {
|
||||
|
||||
class IsolateData;
|
||||
class Environment;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Wed, 29 Jul 2020 12:03:04 -0700
|
||||
Subject: feat: add implementation of v8::Platform::PostJob
|
||||
|
||||
Uses the new "v8::platform::NewDefaultJobHandle" method
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2315981
|
||||
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2304812
|
||||
|
||||
diff --git a/src/node_platform.cc b/src/node_platform.cc
|
||||
index 7e68b7af891ffb87ce083081775015cc7b62fc42..aac0682670fcffd235fcf450bc5e2b0d45985b47 100644
|
||||
--- a/src/node_platform.cc
|
||||
+++ b/src/node_platform.cc
|
||||
@@ -544,6 +544,10 @@ Platform::StackTracePrinter NodePlatform::GetStackTracePrinter() {
|
||||
};
|
||||
}
|
||||
|
||||
+std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority, std::unique_ptr<v8::JobTask> job_task) {
|
||||
+ return v8::platform::NewDefaultJobHandle(this, priority, std::move(job_task), 1 /* num_worker_threads */);
|
||||
+}
|
||||
+
|
||||
template <class T>
|
||||
TaskQueue<T>::TaskQueue()
|
||||
: lock_(), tasks_available_(), tasks_drained_(),
|
||||
diff --git a/src/node_platform.h b/src/node_platform.h
|
||||
index dc512ddf08facf1ebb0d8c9e7677d349d0d2c87c..a274be6bbea19a4488bca393712a9ac8b50fe16a 100644
|
||||
--- a/src/node_platform.h
|
||||
+++ b/src/node_platform.h
|
||||
@@ -162,6 +162,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
void UnregisterIsolate(v8::Isolate* isolate) override;
|
||||
void AddIsolateFinishedCallback(v8::Isolate* isolate,
|
||||
void (*callback)(void*), void* data) override;
|
||||
+ std::unique_ptr<v8::JobHandle> PostJob(v8::TaskPriority priority, std::unique_ptr<v8::JobTask> job_task) override;
|
||||
|
||||
std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner(
|
||||
v8::Isolate* isolate) override;
|
||||
@@ -6,10 +6,10 @@ Subject: feat: initialize asar support
|
||||
This patch initializes asar support in Node.js.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index 83ccfe90c110657f54e068d522c3a75c7f19c75a..f7e9ffa74a4f19caa96680b3c955937f7ab31ea0 100644
|
||||
index dfd7249e907ebcc0aa0e511b96435507af3f90aa..a66ac87237ad1de85318be58d15b508be568cf1f 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -74,6 +74,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
@@ -69,6 +69,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
|
||||
loadPreloadModules();
|
||||
initializeFrozenIntrinsics();
|
||||
@@ -17,7 +17,7 @@ index 83ccfe90c110657f54e068d522c3a75c7f19c75a..f7e9ffa74a4f19caa96680b3c955937f
|
||||
}
|
||||
|
||||
function patchProcessObject(expandArgv1) {
|
||||
@@ -469,6 +470,10 @@ function loadPreloadModules() {
|
||||
@@ -468,6 +469,10 @@ function loadPreloadModules() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 10 Jun 2021 15:15:35 +0200
|
||||
Subject: fix: account for debugger agent race condition
|
||||
|
||||
In Electron the debugger agent hasn't necessarily been enabled by the
|
||||
time the inspect prompt displays, leading to "Debugger agent is not enabled"
|
||||
errors. This is remedied by adding a small timeout to the test.
|
||||
|
||||
We'll either upstream this or figure out a better solution.
|
||||
|
||||
diff --git a/test/sequential/test-debugger-address.js b/test/sequential/test-debugger-address.js
|
||||
index ff31747016c2d49ac87fa272eba3231e9d4fbae5..e4f7b13aad3c60100e56df00165d1af550f1a117 100644
|
||||
--- a/test/sequential/test-debugger-address.js
|
||||
+++ b/test/sequential/test-debugger-address.js
|
||||
@@ -59,6 +59,7 @@ function launchTarget(...args) {
|
||||
cli = startCLI([`${host || '127.0.0.1'}:${port}`]);
|
||||
return cli.waitForPrompt();
|
||||
})
|
||||
+ .then(() => new Promise(resolve => setTimeout(resolve, 1000)))
|
||||
.then(() => cli.command('sb("alive.js", 3)'))
|
||||
.then(() => cli.waitFor(/break/))
|
||||
.then(() => cli.waitForPrompt())
|
||||
diff --git a/test/sequential/test-debugger-pid.js b/test/sequential/test-debugger-pid.js
|
||||
index 97de9f40369d2d1df9674c6df5bbaf78022667c6..3d51a8963ba24e5e5f6a64cd792859535670dd9a 100644
|
||||
--- a/test/sequential/test-debugger-pid.js
|
||||
+++ b/test/sequential/test-debugger-pid.js
|
||||
@@ -38,6 +38,7 @@ function launchTarget(...args) {
|
||||
cli = startCLI(['-p', `${target.pid}`]);
|
||||
return cli.waitForPrompt();
|
||||
})
|
||||
+ .then(() => new Promise(resolve => setTimeout(resolve, 1000)))
|
||||
.then(() => cli.command('sb("alive.js", 3)'))
|
||||
.then(() => cli.waitFor(/break/))
|
||||
.then(() => cli.waitForPrompt())
|
||||
@@ -1,16 +1,17 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 19 Sep 2018 12:20:44 -0700
|
||||
Subject: fix: add default values for variables in common.gypi
|
||||
Subject: fix: add default values for 'enable_lto' and 'build_v8_with_gn' in
|
||||
common.gypi
|
||||
|
||||
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 aa42c69f96391b72e5e3cbada27fd662cb0cc69d..9481fdb6dd4628833e60ae7099f03eca41edd057 100644
|
||||
index aa4279d93ca35c83ad8c417a11292ef5ca91c495..3f305b39cb35a1a36a54cff80476fecba1556d5d 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -81,6 +81,23 @@
|
||||
@@ -81,6 +81,22 @@
|
||||
|
||||
##### end V8 defaults #####
|
||||
|
||||
@@ -29,7 +30,6 @@ index aa42c69f96391b72e5e3cbada27fd662cb0cc69d..9481fdb6dd4628833e60ae7099f03eca
|
||||
+ # these values being accurate.
|
||||
+ 'build_v8_with_gn': 'false',
|
||||
+ 'enable_lto%': 'false',
|
||||
+ 'llvm_version': '0.0',
|
||||
+
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
@@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi
|
||||
This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 60789d5553352563eb41a341860df70175153e4c..9067a6a27606099ec5decbc4cd74283fced77711 100644
|
||||
index cd56b9b314823ff48c1a599ec51c6a3077b62f98..709943635ad31da1c7a7ef91d2f3bfbeb78ea937 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -65,6 +65,7 @@
|
||||
@@ -25,7 +25,7 @@ index 60789d5553352563eb41a341860df70175153e4c..9067a6a27606099ec5decbc4cd74283f
|
||||
##### end V8 defaults #####
|
||||
|
||||
# When building native modules using 'npm install' with the system npm,
|
||||
@@ -381,6 +383,9 @@
|
||||
@@ -372,6 +374,9 @@
|
||||
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
|
||||
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
|
||||
}],
|
||||
|
||||
@@ -11,12 +11,12 @@ initialize it in the browser process. This adds a new
|
||||
EnvironmentFlags option which allows preventing that invocation.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index de29d45adde76587f2a9cd50392ba45b8e24839e..09c0d22ff91856704f61024646c946a39baf53d8 100644
|
||||
index 53b07052e43a09f29f863ee1b2287bdebe7b7a7f..c08fe4b32d4155badb572f15529f903c0ec63146 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -341,12 +341,14 @@ Environment* CreateEnvironment(
|
||||
Environment* env = new Environment(
|
||||
isolate_data, context, args, exec_args, nullptr, flags, thread_id);
|
||||
@@ -358,12 +358,14 @@ Environment* CreateEnvironment(
|
||||
thread_id);
|
||||
|
||||
#if HAVE_INSPECTOR
|
||||
- if (inspector_parent_handle) {
|
||||
- env->InitializeInspector(
|
||||
@@ -36,10 +36,10 @@ index de29d45adde76587f2a9cd50392ba45b8e24839e..09c0d22ff91856704f61024646c946a3
|
||||
#endif
|
||||
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index b3b1ea908253b9240cc37931f34b2a8c8c9fa3ab..dc37298aa0e13bb79030123f38070d0254691b28 100644
|
||||
index 9b2f82cc00e661f139611dd2de53598d6d8ff210..006bcaf4a9a864438cd447dc4235b3a5257cd2a5 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -877,6 +877,10 @@ inline bool Environment::tracks_unmanaged_fds() const {
|
||||
@@ -829,6 +829,10 @@ inline bool Environment::tracks_unmanaged_fds() const {
|
||||
return flags_ & EnvironmentFlags::kTrackUnmanagedFds;
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index b3b1ea908253b9240cc37931f34b2a8c8c9fa3ab..dc37298aa0e13bb79030123f38070d02
|
||||
return emit_filehandle_warning_;
|
||||
}
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 7b136f70fbad1e0a90406add90d5e538577e2a2b..eaf8a17c99aa6a4135c54616f68b15e0620e4378 100644
|
||||
index 9c435f12db0e2d0a13ebd2b01810f0857c55fe2e..1ea1caf0e327719c39f91ce3c0897dde5034c904 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -1197,6 +1197,7 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1026,6 +1026,7 @@ class Environment : public MemoryRetainer {
|
||||
inline bool owns_process_state() const;
|
||||
inline bool owns_inspector() const;
|
||||
inline bool tracks_unmanaged_fds() const;
|
||||
@@ -63,10 +63,10 @@ index 7b136f70fbad1e0a90406add90d5e538577e2a2b..eaf8a17c99aa6a4135c54616f68b15e0
|
||||
inline worker::Worker* worker_context() const;
|
||||
Environment* worker_parent_env() const;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 41f79ef869128636ac04093919e8e5816b39bef9..691c16ba60b0ce8633555825e44c3ace96c5000f 100644
|
||||
index a649f52403659fd18898e1e813f97e32f33784e7..b646fdda58ebcbf2dd92ee4fc9cb0d9c039174d1 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -405,7 +405,11 @@ enum Flags : uint64_t {
|
||||
@@ -426,7 +426,11 @@ enum Flags : uint64_t {
|
||||
kNoRegisterESMLoader = 1 << 3,
|
||||
// Set this flag to make Node.js track "raw" file descriptors, i.e. managed
|
||||
// by fs.open() and fs.close(), and close them during FreeEnvironment().
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 27 May 2020 13:02:13 -0700
|
||||
Subject: fix: comment out incompatible crypto modules
|
||||
|
||||
Node.js introduced some functionality in https://github.com/nodejs/node/pull/32739
|
||||
and https://github.com/nodejs/node/pull/31178 that is not currently compatible
|
||||
with what's exposed through BoringSSL. I plan to upstream parts of this or
|
||||
otherwise introduce shims to reduce friction.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index c119b2314f18d1710bb3cbf1910c86ff994ec951..58554799b50097972405e40f593d089236bca961 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -5207,11 +5207,11 @@ bool DiffieHellman::Init(int primeLength, int g) {
|
||||
bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
dh_.reset(DH_new());
|
||||
if (p_len <= 0) {
|
||||
- BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL);
|
||||
+ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL);
|
||||
return false;
|
||||
}
|
||||
if (g <= 1) {
|
||||
- DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR);
|
||||
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
BIGNUM* bn_p =
|
||||
@@ -5230,18 +5230,18 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
|
||||
dh_.reset(DH_new());
|
||||
if (p_len <= 0) {
|
||||
- BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL);
|
||||
+ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL);
|
||||
return false;
|
||||
}
|
||||
if (g_len <= 0) {
|
||||
- DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR);
|
||||
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
BIGNUM* bn_g =
|
||||
BN_bin2bn(reinterpret_cast<const unsigned char*>(g), g_len, nullptr);
|
||||
if (BN_is_zero(bn_g) || BN_is_one(bn_g)) {
|
||||
BN_free(bn_g);
|
||||
- DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR);
|
||||
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
BIGNUM* bn_p =
|
||||
@@ -5734,7 +5734,7 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
|
||||
if (!EC_KEY_set_public_key(new_key.get(), pub.get()))
|
||||
return env->ThrowError("Failed to set generated public key");
|
||||
|
||||
- EC_KEY_copy(ecdh->key_.get(), new_key.get());
|
||||
+ ecdh->key_.reset(EC_KEY_dup(new_key.get()));
|
||||
ecdh->group_ = EC_KEY_get0_group(ecdh->key_.get());
|
||||
}
|
||||
|
||||
@@ -6222,6 +6222,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
EVPKeyCtxPointer Setup() override {
|
||||
EVPKeyPointer params;
|
||||
if (prime_info_.fixed_value_) {
|
||||
+#if 0
|
||||
DHPointer dh(DH_new());
|
||||
if (!dh)
|
||||
return nullptr;
|
||||
@@ -6238,6 +6239,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
params = EVPKeyPointer(EVP_PKEY_new());
|
||||
CHECK(params);
|
||||
EVP_PKEY_assign_DH(params.get(), dh.release());
|
||||
+#endif
|
||||
} else {
|
||||
EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DH, nullptr));
|
||||
if (!param_ctx)
|
||||
@@ -6245,7 +6247,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
|
||||
if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
|
||||
return nullptr;
|
||||
-
|
||||
+#if 0
|
||||
if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(param_ctx.get(),
|
||||
prime_info_.prime_size_) <= 0)
|
||||
return nullptr;
|
||||
@@ -6253,7 +6255,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
if (EVP_PKEY_CTX_set_dh_paramgen_generator(param_ctx.get(),
|
||||
generator_) <= 0)
|
||||
return nullptr;
|
||||
-
|
||||
+#endif
|
||||
EVP_PKEY* raw_params = nullptr;
|
||||
if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0)
|
||||
return nullptr;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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 b7e213602b57d5cf15890726ae773d6067877c44..de29d45adde76587f2a9cd50392ba45b8e24839e 100644
|
||||
index 2c4acbc4fa0eca3b7c6d03b997445633646446e7..53b07052e43a09f29f863ee1b2287bdebe7b7a7f 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -456,6 +456,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
|
||||
@@ -472,6 +472,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
|
||||
return env->platform();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ index b7e213602b57d5cf15890726ae773d6067877c44..de29d45adde76587f2a9cd50392ba45b
|
||||
int thread_pool_size,
|
||||
node::tracing::TracingController* tracing_controller) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 4e533cab0b74221219752aea7533866830067c09..41f79ef869128636ac04093919e8e5816b39bef9 100644
|
||||
index 34a16feaed229a59181e1b2e48b0e111d5b0b2a6..a649f52403659fd18898e1e813f97e32f33784e7 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -118,6 +118,7 @@ namespace node {
|
||||
@@ -125,6 +125,7 @@ namespace node {
|
||||
|
||||
namespace tracing {
|
||||
|
||||
@@ -33,12 +33,12 @@ index 4e533cab0b74221219752aea7533866830067c09..41f79ef869128636ac04093919e8e581
|
||||
class TracingController;
|
||||
|
||||
}
|
||||
@@ -484,6 +485,8 @@ NODE_EXTERN v8::MaybeLocal<v8::Value> PrepareStackTraceCallback(
|
||||
@@ -522,6 +523,8 @@ NODE_DEPRECATED("Use GetMultiIsolatePlatform(env) instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
|
||||
|
||||
+NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
+
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
// Legacy variants of MultiIsolatePlatform::Create().
|
||||
NODE_DEPRECATED("Use variant taking a v8::TracingController* pointer instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
|
||||
@@ -1,365 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 12 Feb 2020 15:08:04 -0800
|
||||
Subject: fix: handle BoringSSL and OpenSSL incompatibilities
|
||||
|
||||
This patch corrects for imcompatibilities between OpenSSL, which Node.js uses,
|
||||
and BoringSSL which Electron uses via Chromium. Each incompatibility typically has
|
||||
~2 paths forward:
|
||||
* Upstream a shim or adapted implementation to BoringSSL
|
||||
* Alter Node.js functionality to something which both libraries can handle.
|
||||
|
||||
Where possible, we should seek to make this patch as minimal as possible.
|
||||
|
||||
Upstreams:
|
||||
- https://github.com/nodejs/node/pull/39054
|
||||
- https://github.com/nodejs/node/pull/39138
|
||||
- https://github.com/nodejs/node/pull/39136
|
||||
|
||||
diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc
|
||||
index f4b7bd3ad8548a0b69943ddea669e6f1991b7a49..221d652fa7de246e5f69fcf392e334087bac0199 100644
|
||||
--- a/src/crypto/crypto_common.cc
|
||||
+++ b/src/crypto/crypto_common.cc
|
||||
@@ -242,7 +242,7 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
const unsigned char* buf;
|
||||
size_t len;
|
||||
size_t rem;
|
||||
-
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
if (!SSL_client_hello_get0_ext(
|
||||
ssl.get(),
|
||||
TLSEXT_TYPE_application_layer_protocol_negotiation,
|
||||
@@ -255,13 +255,15 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
len = (buf[0] << 8) | buf[1];
|
||||
if (len + 2 != rem) return nullptr;
|
||||
return reinterpret_cast<const char*>(buf + 3);
|
||||
+#endif
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
const char* GetClientHelloServerName(const SSLPointer& ssl) {
|
||||
const unsigned char* buf;
|
||||
size_t len;
|
||||
size_t rem;
|
||||
-
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
if (!SSL_client_hello_get0_ext(
|
||||
ssl.get(),
|
||||
TLSEXT_TYPE_server_name,
|
||||
@@ -283,6 +285,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
|
||||
if (len + 2 > rem)
|
||||
return nullptr;
|
||||
return reinterpret_cast<const char*>(buf + 5);
|
||||
+#endif
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
const char* GetServerName(SSL* ssl) {
|
||||
@@ -290,7 +294,10 @@ const char* GetServerName(SSL* ssl) {
|
||||
}
|
||||
|
||||
bool SetGroups(SecureContext* sc, const char* groups) {
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
return SSL_CTX_set1_groups_list(**sc, groups) == 1;
|
||||
+#endif
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const char* X509ErrorCode(long err) { // NOLINT(runtime/int)
|
||||
@@ -757,13 +764,13 @@ MaybeLocal<Array> GetClientHelloCiphers(
|
||||
Environment* env,
|
||||
const SSLPointer& ssl) {
|
||||
EscapableHandleScope scope(env->isolate());
|
||||
- const unsigned char* buf;
|
||||
- size_t len = SSL_client_hello_get0_ciphers(ssl.get(), &buf);
|
||||
+ const unsigned char* buf = nullptr;
|
||||
+ size_t len = 0; // SSL_client_hello_get0_ciphers(ssl.get(), &buf);
|
||||
size_t count = len / 2;
|
||||
MaybeStackBuffer<Local<Value>, 16> ciphers(count);
|
||||
int j = 0;
|
||||
for (size_t n = 0; n < len; n += 2) {
|
||||
- const SSL_CIPHER* cipher = SSL_CIPHER_find(ssl.get(), buf);
|
||||
+ const SSL_CIPHER* cipher = nullptr; // SSL_CIPHER_find(ssl.get(), buf);
|
||||
buf += 2;
|
||||
Local<Object> obj = Object::New(env->isolate());
|
||||
if (!Set(env->context(),
|
||||
diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc
|
||||
index 1c48f98656fd211403354bb88331450e51ffb3e5..19029e058eb7ebbea283ad49be47c0c6246cf4e7 100644
|
||||
--- a/src/crypto/crypto_dh.cc
|
||||
+++ b/src/crypto/crypto_dh.cc
|
||||
@@ -120,13 +120,11 @@ void DiffieHellman::MemoryInfo(MemoryTracker* tracker) const {
|
||||
bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
dh_.reset(DH_new());
|
||||
if (p_len <= 0) {
|
||||
- ERR_put_error(ERR_LIB_BN, BN_F_BN_GENERATE_PRIME_EX,
|
||||
- BN_R_BITS_TOO_SMALL, __FILE__, __LINE__);
|
||||
+ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL);
|
||||
return false;
|
||||
}
|
||||
if (g <= 1) {
|
||||
- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS,
|
||||
- DH_R_BAD_GENERATOR, __FILE__, __LINE__);
|
||||
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
BIGNUM* bn_p =
|
||||
@@ -144,21 +142,18 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
|
||||
dh_.reset(DH_new());
|
||||
if (p_len <= 0) {
|
||||
- ERR_put_error(ERR_LIB_BN, BN_F_BN_GENERATE_PRIME_EX,
|
||||
- BN_R_BITS_TOO_SMALL, __FILE__, __LINE__);
|
||||
+ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL);
|
||||
return false;
|
||||
}
|
||||
if (g_len <= 0) {
|
||||
- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS,
|
||||
- DH_R_BAD_GENERATOR, __FILE__, __LINE__);
|
||||
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
BIGNUM* bn_g =
|
||||
BN_bin2bn(reinterpret_cast<const unsigned char*>(g), g_len, nullptr);
|
||||
if (BN_is_zero(bn_g) || BN_is_one(bn_g)) {
|
||||
BN_free(bn_g);
|
||||
- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS,
|
||||
- DH_R_BAD_GENERATOR, __FILE__, __LINE__);
|
||||
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
BIGNUM* bn_p =
|
||||
@@ -478,16 +473,20 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
|
||||
if (!BN_set_word(bn_g.get(), params->params.generator) ||
|
||||
!DH_set0_pqg(dh.get(), prime, nullptr, bn_g.get()))
|
||||
return EVPKeyCtxPointer();
|
||||
-
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
params->params.prime_fixed_value.release();
|
||||
bn_g.release();
|
||||
|
||||
key_params = EVPKeyPointer(EVP_PKEY_new());
|
||||
CHECK(key_params);
|
||||
EVP_PKEY_assign_DH(key_params.get(), dh.release());
|
||||
+#else
|
||||
+ return EVPKeyCtxPointer();
|
||||
+#endif
|
||||
} else {
|
||||
EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DH, nullptr));
|
||||
EVP_PKEY* raw_params = nullptr;
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
if (!param_ctx ||
|
||||
EVP_PKEY_paramgen_init(param_ctx.get()) <= 0 ||
|
||||
EVP_PKEY_CTX_set_dh_paramgen_prime_len(
|
||||
@@ -499,8 +498,10 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
|
||||
EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0) {
|
||||
return EVPKeyCtxPointer();
|
||||
}
|
||||
-
|
||||
key_params = EVPKeyPointer(raw_params);
|
||||
+#else
|
||||
+ return EVPKeyCtxPointer();
|
||||
+#endif
|
||||
}
|
||||
|
||||
EVPKeyCtxPointer ctx(EVP_PKEY_CTX_new(key_params.get(), nullptr));
|
||||
diff --git a/src/crypto/crypto_dsa.cc b/src/crypto/crypto_dsa.cc
|
||||
index 271db427fa8539feb30c1712574976fb1f623e91..b2b6af1f9e6db54bdff0be7a567255f47da7b918 100644
|
||||
--- a/src/crypto/crypto_dsa.cc
|
||||
+++ b/src/crypto/crypto_dsa.cc
|
||||
@@ -29,7 +29,7 @@ namespace crypto {
|
||||
EVPKeyCtxPointer DsaKeyGenTraits::Setup(DsaKeyPairGenConfig* params) {
|
||||
EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DSA, nullptr));
|
||||
EVP_PKEY* raw_params = nullptr;
|
||||
-
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
if (!param_ctx ||
|
||||
EVP_PKEY_paramgen_init(param_ctx.get()) <= 0 ||
|
||||
EVP_PKEY_CTX_set_dsa_paramgen_bits(
|
||||
@@ -49,7 +49,9 @@ EVPKeyCtxPointer DsaKeyGenTraits::Setup(DsaKeyPairGenConfig* params) {
|
||||
return EVPKeyCtxPointer();
|
||||
}
|
||||
}
|
||||
-
|
||||
+#else
|
||||
+ return EVPKeyCtxPointer();
|
||||
+#endif
|
||||
if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0)
|
||||
return EVPKeyCtxPointer();
|
||||
|
||||
diff --git a/src/crypto/crypto_ec.cc b/src/crypto/crypto_ec.cc
|
||||
index ea4c70ad5d8c844860ba3480fc7ef4205f0a3cdc..cdf8dd47d6e2a5894066cec01fbe347af079ec22 100644
|
||||
--- a/src/crypto/crypto_ec.cc
|
||||
+++ b/src/crypto/crypto_ec.cc
|
||||
@@ -314,7 +314,7 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
|
||||
return THROW_ERR_CRYPTO_OPERATION_FAILED(env,
|
||||
"Failed to set generated public key");
|
||||
|
||||
- EC_KEY_copy(ecdh->key_.get(), new_key.get());
|
||||
+ ecdh->key_.reset(EC_KEY_dup(new_key.get()));
|
||||
ecdh->group_ = EC_KEY_get0_group(ecdh->key_.get());
|
||||
}
|
||||
|
||||
diff --git a/src/crypto/crypto_hkdf.cc b/src/crypto/crypto_hkdf.cc
|
||||
index 0aa96ada47abe4b66fb616c665101278bbe0afb6..1e9a4863c5faea5f6b275483ca16f3a6e8dac25b 100644
|
||||
--- a/src/crypto/crypto_hkdf.cc
|
||||
+++ b/src/crypto/crypto_hkdf.cc
|
||||
@@ -101,6 +101,7 @@ bool HKDFTraits::DeriveBits(
|
||||
Environment* env,
|
||||
const HKDFConfig& params,
|
||||
ByteSource* out) {
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
EVPKeyCtxPointer ctx =
|
||||
EVPKeyCtxPointer(EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, nullptr));
|
||||
if (!ctx ||
|
||||
@@ -132,6 +133,9 @@ bool HKDFTraits::DeriveBits(
|
||||
|
||||
*out = std::move(buf);
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
void HKDFConfig::MemoryInfo(MemoryTracker* tracker) const {
|
||||
diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc
|
||||
index 7cb4513f9ad0eaadd055b169520ae1e5073b7e2d..50a6663966cdb147a702df21240fa449850c3549 100644
|
||||
--- a/src/crypto/crypto_random.cc
|
||||
+++ b/src/crypto/crypto_random.cc
|
||||
@@ -150,7 +150,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(
|
||||
|
||||
params->bits = bits;
|
||||
params->safe = safe;
|
||||
- params->prime.reset(BN_secure_new());
|
||||
+ params->prime.reset(BN_new());
|
||||
if (!params->prime) {
|
||||
THROW_ERR_CRYPTO_OPERATION_FAILED(env, "could not generate prime");
|
||||
return Nothing<bool>();
|
||||
diff --git a/src/crypto/crypto_sig.cc b/src/crypto/crypto_sig.cc
|
||||
index 7b113a8dcb06b0b0e1329ce0daf7305598ea6545..b04e53a7f24885ffb6639430988d0ffb524b028e 100644
|
||||
--- a/src/crypto/crypto_sig.cc
|
||||
+++ b/src/crypto/crypto_sig.cc
|
||||
@@ -110,7 +110,7 @@ unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
|
||||
if (base_id == EVP_PKEY_DSA) {
|
||||
const DSA* dsa_key = EVP_PKEY_get0_DSA(pkey.get());
|
||||
// Both r and s are computed mod q, so their width is limited by that of q.
|
||||
- bits = BN_num_bits(DSA_get0_q(dsa_key));
|
||||
+ bits = BN_num_bits(dsa_key->q);
|
||||
} else if (base_id == EVP_PKEY_EC) {
|
||||
const EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey.get());
|
||||
const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
|
||||
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
|
||||
index 13c40dcb757661220288465c39101de0b4018e90..7d1d4400319292a8ddf3afe013b5678f84c25576 100644
|
||||
--- a/src/crypto/crypto_util.cc
|
||||
+++ b/src/crypto/crypto_util.cc
|
||||
@@ -139,7 +139,6 @@ void InitCryptoOnce() {
|
||||
OPENSSL_init_ssl(0, settings);
|
||||
OPENSSL_INIT_free(settings);
|
||||
settings = nullptr;
|
||||
-#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
if (per_process::cli_options->secure_heap != 0) {
|
||||
@@ -160,6 +159,7 @@ void InitCryptoOnce() {
|
||||
}
|
||||
#endif
|
||||
|
||||
+#endif
|
||||
// Turn off compression. Saves memory and protects against CRIME attacks.
|
||||
// No-op with OPENSSL_NO_COMP builds of OpenSSL.
|
||||
sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
|
||||
@@ -490,24 +490,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
|
||||
V(BIO) \
|
||||
V(PKCS7) \
|
||||
V(X509V3) \
|
||||
- V(PKCS12) \
|
||||
V(RAND) \
|
||||
- V(DSO) \
|
||||
V(ENGINE) \
|
||||
V(OCSP) \
|
||||
V(UI) \
|
||||
V(COMP) \
|
||||
V(ECDSA) \
|
||||
V(ECDH) \
|
||||
- V(OSSL_STORE) \
|
||||
- V(FIPS) \
|
||||
- V(CMS) \
|
||||
- V(TS) \
|
||||
V(HMAC) \
|
||||
- V(CT) \
|
||||
- V(ASYNC) \
|
||||
- V(KDF) \
|
||||
- V(SM2) \
|
||||
V(USER) \
|
||||
|
||||
#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
|
||||
@@ -667,7 +657,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
|
||||
CHECK(args[0]->IsUint32());
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
uint32_t len = args[0].As<Uint32>()->Value();
|
||||
- char* data = static_cast<char*>(OPENSSL_secure_malloc(len));
|
||||
+ char* data = static_cast<char*>(OPENSSL_malloc(len));
|
||||
if (data == nullptr) {
|
||||
// There's no memory available for the allocation.
|
||||
// Return nothing.
|
||||
@@ -679,7 +669,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
|
||||
data,
|
||||
len,
|
||||
[](void* data, size_t len, void* deleter_data) {
|
||||
- OPENSSL_secure_clear_free(data, len);
|
||||
+ OPENSSL_clear_free(data, len);
|
||||
},
|
||||
data);
|
||||
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
|
||||
@@ -687,10 +677,12 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
if (CRYPTO_secure_malloc_initialized())
|
||||
args.GetReturnValue().Set(
|
||||
BigInt::New(env->isolate(), CRYPTO_secure_used()));
|
||||
+#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
|
||||
index ac95612a0b1a856d7fe07efde59786e811f1b98d..aa62753d7c929027f5265fa4330b0429c726f7ef 100644
|
||||
--- a/src/crypto/crypto_util.h
|
||||
+++ b/src/crypto/crypto_util.h
|
||||
@@ -15,7 +15,9 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/ec.h>
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
#include <openssl/kdf.h>
|
||||
+#endif
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/ssl.h>
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index c9d491f01651ef57fb793dda108469cb7ddccc5c..6a55535b5c6ef72b1cdb366299840a2e78643911 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -1035,7 +1035,7 @@ InitializationResult InitializeOncePerProcess(
|
||||
}
|
||||
|
||||
if (init_flags & kInitOpenSSL) {
|
||||
-#if HAVE_OPENSSL
|
||||
+#if HAVE_OPENSSL && !defined(OPENSSL_IS_BORINGSSL)
|
||||
{
|
||||
std::string extra_ca_certs;
|
||||
if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs))
|
||||
diff --git a/src/node_metadata.h b/src/node_metadata.h
|
||||
index 4486d5af2c1622c7c8f44401dc3ebb986d8e3c2e..db1769f1b3f1617ed8dbbea57b5e324183b42be2 100644
|
||||
--- a/src/node_metadata.h
|
||||
+++ b/src/node_metadata.h
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <string>
|
||||
#include "node_version.h"
|
||||
|
||||
-#if HAVE_OPENSSL
|
||||
+#if 0
|
||||
#include <openssl/crypto.h>
|
||||
#endif // HAVE_OPENSSL
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Wed, 14 Apr 2021 12:03:27 -0700
|
||||
Subject: fix: handle new ToString() behavior in v8 serdes test
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2739980
|
||||
|
||||
diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js
|
||||
index f080f551396c8bb27e16448babecca2f2ad18a2b..d7304e6255648bd19c66012b55b93598d5ffa66d 100644
|
||||
--- a/test/parallel/test-v8-serdes.js
|
||||
+++ b/test/parallel/test-v8-serdes.js
|
||||
@@ -50,7 +50,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
|
||||
{
|
||||
const ser = new v8.DefaultSerializer();
|
||||
ser._getDataCloneError = common.mustCall((message) => {
|
||||
- assert.strictEqual(message, '[object Object] could not be cloned.');
|
||||
+ assert.strictEqual(message, '#<Object> could not be cloned.');
|
||||
return new Error('foobar');
|
||||
});
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Fri, 29 Mar 2019 16:50:56 +0900
|
||||
Subject: fix: key gen APIs are not available in BoringSSL
|
||||
|
||||
This will make Node's key pair generation APIs fail.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index bd40705e6b1ae0927239a06c40a2181e4458b1c4..79e781fb3e6ec63334c2c5d4b24d2a6049be79fc 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -291,24 +291,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
|
||||
V(BIO) \
|
||||
V(PKCS7) \
|
||||
V(X509V3) \
|
||||
- V(PKCS12) \
|
||||
V(RAND) \
|
||||
- V(DSO) \
|
||||
V(ENGINE) \
|
||||
V(OCSP) \
|
||||
V(UI) \
|
||||
V(COMP) \
|
||||
V(ECDSA) \
|
||||
V(ECDH) \
|
||||
- V(OSSL_STORE) \
|
||||
- V(FIPS) \
|
||||
- V(CMS) \
|
||||
- V(TS) \
|
||||
V(HMAC) \
|
||||
- V(CT) \
|
||||
- V(ASYNC) \
|
||||
- V(KDF) \
|
||||
- V(SM2) \
|
||||
V(USER) \
|
||||
|
||||
#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
|
||||
@@ -6138,6 +6128,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
|
||||
return nullptr;
|
||||
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
|
||||
return nullptr;
|
||||
|
||||
@@ -6148,6 +6139,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
EVP_PKEY* raw_params = nullptr;
|
||||
if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0)
|
||||
diff --git a/src/node_crypto_common.cc b/src/node_crypto_common.cc
|
||||
index 6473b652ac95609aff555d99be38b48a5aa513a5..caaaf19dc02101c2024b511780c94fc85476b7a2 100644
|
||||
--- a/src/node_crypto_common.cc
|
||||
+++ b/src/node_crypto_common.cc
|
||||
@@ -240,10 +240,10 @@ int UseSNIContext(const SSLPointer& ssl, BaseObjectPtr<SecureContext> context) {
|
||||
}
|
||||
|
||||
const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
const unsigned char* buf;
|
||||
size_t len;
|
||||
size_t rem;
|
||||
-
|
||||
if (!SSL_client_hello_get0_ext(
|
||||
ssl.get(),
|
||||
TLSEXT_TYPE_application_layer_protocol_negotiation,
|
||||
@@ -252,17 +252,18 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
rem < 2) {
|
||||
return nullptr;
|
||||
}
|
||||
-
|
||||
len = (buf[0] << 8) | buf[1];
|
||||
if (len + 2 != rem) return nullptr;
|
||||
return reinterpret_cast<const char*>(buf + 3);
|
||||
+#endif
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
const char* GetClientHelloServerName(const SSLPointer& ssl) {
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
const unsigned char* buf;
|
||||
size_t len;
|
||||
size_t rem;
|
||||
-
|
||||
if (!SSL_client_hello_get0_ext(
|
||||
ssl.get(),
|
||||
TLSEXT_TYPE_server_name,
|
||||
@@ -284,6 +285,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
|
||||
if (len + 2 > rem)
|
||||
return nullptr;
|
||||
return reinterpret_cast<const char*>(buf + 5);
|
||||
+#endif
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
const char* GetServerName(SSL* ssl) {
|
||||
@@ -291,7 +294,10 @@ const char* GetServerName(SSL* ssl) {
|
||||
}
|
||||
|
||||
bool SetGroups(SecureContext* sc, const char* groups) {
|
||||
+#ifndef OPENSSL_IS_BORINGSSL
|
||||
return SSL_CTX_set1_groups_list(**sc, groups) == 1;
|
||||
+#endif
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const char* X509ErrorCode(long err) { // NOLINT(runtime/int)
|
||||
@@ -768,13 +774,13 @@ MaybeLocal<Array> GetClientHelloCiphers(
|
||||
Environment* env,
|
||||
const SSLPointer& ssl) {
|
||||
EscapableHandleScope scope(env->isolate());
|
||||
- const unsigned char* buf;
|
||||
- size_t len = SSL_client_hello_get0_ciphers(ssl.get(), &buf);
|
||||
+ const unsigned char* buf = nullptr;
|
||||
+ size_t len = 0; // SSL_client_hello_get0_ciphers(ssl.get(), &buf);
|
||||
size_t count = len / 2;
|
||||
MaybeStackBuffer<Local<Value>, 16> ciphers(count);
|
||||
int j = 0;
|
||||
for (size_t n = 0; n < len; n += 2) {
|
||||
- const SSL_CIPHER* cipher = SSL_CIPHER_find(ssl.get(), buf);
|
||||
+ const SSL_CIPHER* cipher = nullptr; // SSL_CIPHER_find(ssl.get(), buf);
|
||||
buf += 2;
|
||||
Local<Object> obj = Object::New(env->isolate());
|
||||
if (!Set(env->context(),
|
||||
@@ -0,0 +1,67 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 12 Jan 2021 09:17:14 -0800
|
||||
Subject: fix: remove outdated --experimental-wasm-bigint flag
|
||||
|
||||
The --experimental-wasm-bigint flag was removed in https://chromium-review.googlesource.com/c/v8/v8/+/2610965
|
||||
but not yet from Node v14, as its version of V8 is not recent enough.
|
||||
|
||||
This patch can be removed as soon as we upgrade Node.js to a version of
|
||||
V8 which contains the above CL.
|
||||
|
||||
diff --git a/test/wasi/test-return-on-exit.js b/test/wasi/test-return-on-exit.js
|
||||
index eef97996fbf7442a6bdd808fe1b5b6eab148f322..e61f4174c3d4ee3778f5d0d5aeb2270f263ee63f 100644
|
||||
--- a/test/wasi/test-return-on-exit.js
|
||||
+++ b/test/wasi/test-return-on-exit.js
|
||||
@@ -1,4 +1,4 @@
|
||||
-// Flags: --experimental-wasi-unstable-preview1 --experimental-wasm-bigint
|
||||
+// Flags: --experimental-wasi-unstable-preview1
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
diff --git a/test/wasi/test-wasi-not-started.js b/test/wasi/test-wasi-not-started.js
|
||||
index ad13e6d711802b029c4b536f2ed8944484d821cf..14c8cdfddf2f5cc7c8219cc7810bbdcb56482905 100644
|
||||
--- a/test/wasi/test-wasi-not-started.js
|
||||
+++ b/test/wasi/test-wasi-not-started.js
|
||||
@@ -29,7 +29,6 @@ if (process.argv[2] === 'wasi-child') {
|
||||
|
||||
const child = cp.spawnSync(process.execPath, [
|
||||
'--experimental-wasi-unstable-preview1',
|
||||
- '--experimental-wasm-bigint',
|
||||
__filename,
|
||||
'wasi-child'
|
||||
], {
|
||||
diff --git a/test/wasi/test-wasi-stdio.js b/test/wasi/test-wasi-stdio.js
|
||||
index 4abe3c1ad8ae0d7af7b57040fdc4b146931a2b15..647990064efb438e36b0c5ec9a3480338d09b2f9 100644
|
||||
--- a/test/wasi/test-wasi-stdio.js
|
||||
+++ b/test/wasi/test-wasi-stdio.js
|
||||
@@ -1,4 +1,4 @@
|
||||
-// Flags: --experimental-wasi-unstable-preview1 --experimental-wasm-bigint
|
||||
+// Flags: --experimental-wasi-unstable-preview1
|
||||
'use strict';
|
||||
require('../common');
|
||||
const tmpdir = require('../common/tmpdir');
|
||||
diff --git a/test/wasi/test-wasi-symlinks.js b/test/wasi/test-wasi-symlinks.js
|
||||
index d1ec796125cb532e95e27562620312fdae40fac3..f619a8a2439a7d0c8624ffb31f1a83b87a9ad5ba 100644
|
||||
--- a/test/wasi/test-wasi-symlinks.js
|
||||
+++ b/test/wasi/test-wasi-symlinks.js
|
||||
@@ -62,7 +62,6 @@ if (process.argv[2] === 'wasi-child') {
|
||||
const opts = { env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi' } };
|
||||
const child = cp.spawnSync(process.execPath, [
|
||||
'--experimental-wasi-unstable-preview1',
|
||||
- '--experimental-wasm-bigint',
|
||||
__filename,
|
||||
'wasi-child',
|
||||
options.test,
|
||||
diff --git a/test/wasi/test-wasi.js b/test/wasi/test-wasi.js
|
||||
index b4c404e515cbb2a54eac4fd52eb92d8535b577d9..85543255b2ddf8f8ebd7f7893ea0fe0c60513b22 100644
|
||||
--- a/test/wasi/test-wasi.js
|
||||
+++ b/test/wasi/test-wasi.js
|
||||
@@ -51,7 +51,6 @@ if (process.argv[2] === 'wasi-child') {
|
||||
|
||||
const child = cp.spawnSync(process.execPath, [
|
||||
'--experimental-wasi-unstable-preview1',
|
||||
- '--experimental-wasm-bigint',
|
||||
__filename,
|
||||
'wasi-child',
|
||||
options.test
|
||||
49
patches/node/fix_use_crypto_impls_for_compat.patch
Normal file
49
patches/node/fix_use_crypto_impls_for_compat.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 12 Feb 2020 15:08:04 -0800
|
||||
Subject: fix: use crypto impls for compat
|
||||
|
||||
BoringSSL does not export DSA_get0_q, OPENSSL_secure_malloc, or
|
||||
OPENSSL_secure_clear_free.
|
||||
|
||||
This patch works around the DSA_get0_q problem by using the
|
||||
implementations of that function as found in the OpenSSL repo.
|
||||
|
||||
Node.js added the malloc/free incompatibilities in https://github.com/nodejs/node/pull/36729
|
||||
though they don't use secure heap at the moment. This makes it equivalent
|
||||
to swap these out with OPENSSL_malloc and OPENSSL_clear_free at present.
|
||||
We can revisit this once that happens and determine a more mutually
|
||||
compatible path forward either by upstreaming a shim to BoringSSL or
|
||||
adapting Node.js.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 79e781fb3e6ec63334c2c5d4b24d2a6049be79fc..c119b2314f18d1710bb3cbf1910c86ff994ec951 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -4574,7 +4574,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
|
||||
if (base_id == EVP_PKEY_DSA) {
|
||||
DSA* dsa_key = EVP_PKEY_get0_DSA(pkey.get());
|
||||
// Both r and s are computed mod q, so their width is limited by that of q.
|
||||
- bits = BN_num_bits(DSA_get0_q(dsa_key));
|
||||
+ bits = BN_num_bits(dsa_key->q);
|
||||
} else if (base_id == EVP_PKEY_EC) {
|
||||
EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey.get());
|
||||
const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
|
||||
@@ -6949,7 +6949,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
|
||||
CHECK(args[0]->IsUint32());
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
uint32_t len = args[0].As<Uint32>()->Value();
|
||||
- char* data = static_cast<char*>(OPENSSL_secure_malloc(len));
|
||||
+ char* data = static_cast<char*>(OPENSSL_malloc(len));
|
||||
if (data == nullptr) {
|
||||
// There's no memory available for the allocation.
|
||||
// Return nothing.
|
||||
@@ -6961,7 +6961,7 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) {
|
||||
data,
|
||||
len,
|
||||
[](void* data, size_t len, void* deleter_data) {
|
||||
- OPENSSL_secure_clear_free(data, len);
|
||||
+ OPENSSL_clear_free(data, len);
|
||||
},
|
||||
data);
|
||||
Local<ArrayBuffer> buffer = ArrayBuffer::New(env->isolate(), store);
|
||||
@@ -7,10 +7,10 @@ This broke the build at some point. Does it still? We should probably remove
|
||||
this patch and find out!
|
||||
|
||||
diff --git a/src/node_internals.h b/src/node_internals.h
|
||||
index 31076551e70c46da2c32cafd7ac08aee91366537..d57c51ebcc3c9dda1ef41b10ee49453839781deb 100644
|
||||
index aa7180e18544cab4004a0ef87ba230bd2e732d28..0a01dcd8ed194b205d7fe510451315610e5a60be 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -391,10 +391,11 @@ class TraceEventScope {
|
||||
@@ -368,10 +368,11 @@ class TraceEventScope {
|
||||
TraceEventScope(const char* category,
|
||||
const char* name,
|
||||
void* id) : category_(category), name_(name), id_(id) {
|
||||
|
||||
@@ -7,15 +7,19 @@ We need to hack the search paths of the require function so we can
|
||||
load libraries from embedded applications without modifications of
|
||||
node's module code.
|
||||
|
||||
(cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index d969a6449cf545c4bb313450dce3940a47be40a2..51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3 100644
|
||||
index ebe0c741c9e177fe99631643030f97e8545c3368..82c08cd17b33c14b85e6586269b5dc4b233fd9e6 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1222,7 +1222,7 @@ Module._initPaths = function() {
|
||||
@@ -1199,8 +1199,8 @@ Module._initPaths = function() {
|
||||
|
||||
modulePaths = paths;
|
||||
|
||||
// Clone as a shallow copy, for introspection.
|
||||
- Module.globalPaths = ArrayPrototypeSlice(modulePaths);
|
||||
- // Clone as a shallow copy, for introspection.
|
||||
- Module.globalPaths = modulePaths.slice(0);
|
||||
+ // clone as a shallow copy, for introspection.
|
||||
+ Module.globalPaths = modulePaths;
|
||||
};
|
||||
|
||||
|
||||
262
patches/node/node-api_faster_threadsafe_function.patch
Normal file
262
patches/node/node-api_faster_threadsafe_function.patch
Normal file
@@ -0,0 +1,262 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Fedor Indutny <fedor@indutny.com>
|
||||
Date: Sat, 1 May 2021 11:26:46 -0700
|
||||
Subject: node-api: faster threadsafe_function
|
||||
|
||||
Invoke threadsafe_function during the same tick and avoid marshalling
|
||||
costs between threads and/or churning event loop if either:
|
||||
|
||||
1. There's a queued call already
|
||||
2. `Push()` is called while the main thread was running
|
||||
threadsafe_function
|
||||
|
||||
PR-URL: https://github.com/nodejs/node/pull/38506
|
||||
Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
||||
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
||||
Reviewed-By: James M Snell <jasnell@gmail.com>
|
||||
|
||||
diff --git a/src/node_api.cc b/src/node_api.cc
|
||||
index f1a5265b6a7234dc754aedc86ecd3132f3d90b09..d1076b29aeb5133a0325d3e7ebd097d207e4f4a6 100644
|
||||
--- a/src/node_api.cc
|
||||
+++ b/src/node_api.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "tracing/traced_value.h"
|
||||
#include "util-inl.h"
|
||||
|
||||
+#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
struct node_napi_env__ : public napi_env__ {
|
||||
@@ -131,6 +132,7 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
*v8::String::Utf8Value(env_->isolate, name)),
|
||||
thread_count(thread_count_),
|
||||
is_closing(false),
|
||||
+ dispatch_state(kDispatchIdle),
|
||||
context(context_),
|
||||
max_queue_size(max_queue_size_),
|
||||
env(env_),
|
||||
@@ -170,10 +172,8 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
return napi_closing;
|
||||
}
|
||||
} else {
|
||||
- if (uv_async_send(&async) != 0) {
|
||||
- return napi_generic_failure;
|
||||
- }
|
||||
queue.push(data);
|
||||
+ Send();
|
||||
return napi_ok;
|
||||
}
|
||||
}
|
||||
@@ -205,9 +205,7 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
if (is_closing && max_queue_size > 0) {
|
||||
cond->Signal(lock);
|
||||
}
|
||||
- if (uv_async_send(&async) != 0) {
|
||||
- return napi_generic_failure;
|
||||
- }
|
||||
+ Send();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +230,6 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
cond = std::make_unique<node::ConditionVariable>();
|
||||
}
|
||||
if (max_queue_size == 0 || cond) {
|
||||
- CHECK_EQ(0, uv_idle_init(loop, &idle));
|
||||
return napi_ok;
|
||||
}
|
||||
|
||||
@@ -257,21 +254,46 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
|
||||
napi_status Unref() {
|
||||
uv_unref(reinterpret_cast<uv_handle_t*>(&async));
|
||||
- uv_unref(reinterpret_cast<uv_handle_t*>(&idle));
|
||||
|
||||
return napi_ok;
|
||||
}
|
||||
|
||||
napi_status Ref() {
|
||||
uv_ref(reinterpret_cast<uv_handle_t*>(&async));
|
||||
- uv_ref(reinterpret_cast<uv_handle_t*>(&idle));
|
||||
|
||||
return napi_ok;
|
||||
}
|
||||
|
||||
- void DispatchOne() {
|
||||
+ inline void* Context() {
|
||||
+ return context;
|
||||
+ }
|
||||
+
|
||||
+ protected:
|
||||
+ void Dispatch() {
|
||||
+ bool has_more = true;
|
||||
+
|
||||
+ // Limit maximum synchronous iteration count to prevent event loop
|
||||
+ // starvation. See `src/node_messaging.cc` for an inspiration.
|
||||
+ unsigned int iterations_left = kMaxIterationCount;
|
||||
+ while (has_more && --iterations_left != 0) {
|
||||
+ dispatch_state = kDispatchRunning;
|
||||
+ has_more = DispatchOne();
|
||||
+
|
||||
+ // Send() was called while we were executing the JS function
|
||||
+ if (dispatch_state.exchange(kDispatchIdle) != kDispatchRunning) {
|
||||
+ has_more = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (has_more) {
|
||||
+ Send();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ bool DispatchOne() {
|
||||
void* data = nullptr;
|
||||
bool popped_value = false;
|
||||
+ bool has_more = false;
|
||||
|
||||
{
|
||||
node::Mutex::ScopedLock lock(this->mutex);
|
||||
@@ -296,9 +318,9 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
cond->Signal(lock);
|
||||
}
|
||||
CloseHandlesAndMaybeDelete();
|
||||
- } else {
|
||||
- CHECK_EQ(0, uv_idle_stop(&idle));
|
||||
}
|
||||
+ } else {
|
||||
+ has_more = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,6 +338,8 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
call_js_cb(env, js_callback, context, data);
|
||||
});
|
||||
}
|
||||
+
|
||||
+ return has_more;
|
||||
}
|
||||
|
||||
void Finalize() {
|
||||
@@ -329,10 +353,6 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
EmptyQueueAndDelete();
|
||||
}
|
||||
|
||||
- inline void* Context() {
|
||||
- return context;
|
||||
- }
|
||||
-
|
||||
void CloseHandlesAndMaybeDelete(bool set_closing = false) {
|
||||
v8::HandleScope scope(env->isolate);
|
||||
if (set_closing) {
|
||||
@@ -352,18 +372,20 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
ThreadSafeFunction* ts_fn =
|
||||
node::ContainerOf(&ThreadSafeFunction::async,
|
||||
reinterpret_cast<uv_async_t*>(handle));
|
||||
- v8::HandleScope scope(ts_fn->env->isolate);
|
||||
- ts_fn->env->node_env()->CloseHandle(
|
||||
- reinterpret_cast<uv_handle_t*>(&ts_fn->idle),
|
||||
- [](uv_handle_t* handle) -> void {
|
||||
- ThreadSafeFunction* ts_fn =
|
||||
- node::ContainerOf(&ThreadSafeFunction::idle,
|
||||
- reinterpret_cast<uv_idle_t*>(handle));
|
||||
- ts_fn->Finalize();
|
||||
- });
|
||||
+ ts_fn->Finalize();
|
||||
});
|
||||
}
|
||||
|
||||
+ void Send() {
|
||||
+ // Ask currently running Dispatch() to make one more iteration
|
||||
+ unsigned char current_state = dispatch_state.fetch_or(kDispatchPending);
|
||||
+ if ((current_state & kDispatchRunning) == kDispatchRunning) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ CHECK_EQ(0, uv_async_send(&async));
|
||||
+ }
|
||||
+
|
||||
// Default way of calling into JavaScript. Used when ThreadSafeFunction is
|
||||
// without a call_js_cb_.
|
||||
static void CallJs(napi_env env, napi_value cb, void* context, void* data) {
|
||||
@@ -387,16 +409,10 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
}
|
||||
}
|
||||
|
||||
- static void IdleCb(uv_idle_t* idle) {
|
||||
- ThreadSafeFunction* ts_fn =
|
||||
- node::ContainerOf(&ThreadSafeFunction::idle, idle);
|
||||
- ts_fn->DispatchOne();
|
||||
- }
|
||||
-
|
||||
static void AsyncCb(uv_async_t* async) {
|
||||
ThreadSafeFunction* ts_fn =
|
||||
node::ContainerOf(&ThreadSafeFunction::async, async);
|
||||
- CHECK_EQ(0, uv_idle_start(&ts_fn->idle, IdleCb));
|
||||
+ ts_fn->Dispatch();
|
||||
}
|
||||
|
||||
static void Cleanup(void* data) {
|
||||
@@ -405,14 +421,20 @@ class ThreadSafeFunction : public node::AsyncResource {
|
||||
}
|
||||
|
||||
private:
|
||||
+ static const unsigned char kDispatchIdle = 0;
|
||||
+ static const unsigned char kDispatchRunning = 1 << 0;
|
||||
+ static const unsigned char kDispatchPending = 1 << 1;
|
||||
+
|
||||
+ static const unsigned int kMaxIterationCount = 1000;
|
||||
+
|
||||
// These are variables protected by the mutex.
|
||||
node::Mutex mutex;
|
||||
std::unique_ptr<node::ConditionVariable> cond;
|
||||
std::queue<void*> queue;
|
||||
uv_async_t async;
|
||||
- uv_idle_t idle;
|
||||
size_t thread_count;
|
||||
bool is_closing;
|
||||
+ std::atomic_uchar dispatch_state;
|
||||
|
||||
// These are variables set once, upon creation, and then never again, which
|
||||
// means we don't need the mutex to read them.
|
||||
diff --git a/test/node-api/test_threadsafe_function/binding.c b/test/node-api/test_threadsafe_function/binding.c
|
||||
index b016dfa6c36656acf4a9010fd6fca18f10785158..339e772aa7e0e67b2448b7c23f5d87002e082305 100644
|
||||
--- a/test/node-api/test_threadsafe_function/binding.c
|
||||
+++ b/test/node-api/test_threadsafe_function/binding.c
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <node_api.h>
|
||||
#include "../../js-native-api/common.h"
|
||||
|
||||
-#define ARRAY_LENGTH 10
|
||||
+#define ARRAY_LENGTH 10000
|
||||
#define MAX_QUEUE_SIZE 2
|
||||
|
||||
static uv_thread_t uv_threads[2];
|
||||
@@ -72,7 +72,7 @@ static void data_source_thread(void* data) {
|
||||
for (index = ARRAY_LENGTH - 1; index > -1 && !queue_was_closing; index--) {
|
||||
status = napi_call_threadsafe_function(ts_fn, &ints[index],
|
||||
ts_fn_info->block_on_full);
|
||||
- if (ts_fn_info->max_queue_size == 0) {
|
||||
+ if (ts_fn_info->max_queue_size == 0 && (index % 1000 == 0)) {
|
||||
// Let's make this thread really busy for 200 ms to give the main thread a
|
||||
// chance to abort.
|
||||
uint64_t start = uv_hrtime();
|
||||
diff --git a/test/node-api/test_threadsafe_function/test.js b/test/node-api/test_threadsafe_function/test.js
|
||||
index 3603d79ee6b5d36590503989d8168368eaf12b03..ccd3f4228a793ae77eff760309e31191ba8de49a 100644
|
||||
--- a/test/node-api/test_threadsafe_function/test.js
|
||||
+++ b/test/node-api/test_threadsafe_function/test.js
|
||||
@@ -210,6 +210,15 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
||||
}))
|
||||
.then((result) => assert.strictEqual(result.indexOf(0), -1))
|
||||
|
||||
+// Make sure that threadsafe function isn't stalled when we hit
|
||||
+// `kMaxIterationCount` in `src/node_api.cc`
|
||||
+.then(() => testWithJSMarshaller({
|
||||
+ threadStarter: 'StartThreadNonblocking',
|
||||
+ maxQueueSize: binding.ARRAY_LENGTH >>> 1,
|
||||
+ quitAfter: binding.ARRAY_LENGTH
|
||||
+}))
|
||||
+.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
+
|
||||
// Start a child process to test rapid teardown
|
||||
.then(() => testUnref(binding.MAX_QUEUE_SIZE))
|
||||
|
||||
@@ -6,10 +6,10 @@ 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 51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3..9a304f05cf4e09038531007efff28c4f57218c1d 100644
|
||||
index 82c08cd17b33c14b85e6586269b5dc4b233fd9e6..ef52bf6486d8c827dce105e50b57c1129dcaf5a4 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -121,6 +121,13 @@ const {
|
||||
@@ -109,6 +109,13 @@ const {
|
||||
CHAR_COLON
|
||||
} = require('internal/constants');
|
||||
|
||||
@@ -23,18 +23,18 @@ index 51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3..9a304f05cf4e09038531007efff28c4f
|
||||
const {
|
||||
isProxy
|
||||
} = require('internal/util/types');
|
||||
@@ -1090,10 +1097,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (requireDepth === 0) statCache = new SafeMap();
|
||||
@@ -1063,10 +1070,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (requireDepth === 0) statCache = new Map();
|
||||
if (inspectorWrapper) {
|
||||
result = inspectorWrapper(compiledWrapper, thisValue, exports,
|
||||
- require, module, filename, dirname);
|
||||
+ require, module, filename, dirname,
|
||||
+ process, localGlobal, localBuffer);
|
||||
} else {
|
||||
result = ReflectApply(compiledWrapper, thisValue,
|
||||
- [exports, require, module, filename, dirname]);
|
||||
+ [exports, require, module, filename,
|
||||
+ dirname, process, localGlobal, localBuffer]);
|
||||
result = compiledWrapper.call(thisValue, exports, require, module,
|
||||
- filename, dirname);
|
||||
+ filename, dirname, process, localGlobal,
|
||||
+ localBuffer);
|
||||
}
|
||||
hasLoadedAnyUserCJSModule = true;
|
||||
if (requireDepth === 0) statCache = null;
|
||||
|
||||
@@ -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 863d4ef5608bcebc9b49c3988509be9cfb18b6cd..8b70f79d2b278f2f6b15abc2eba5045b1ca503b4 100644
|
||||
index 2705f8b50a658db0fc1ce6fba245792f6a567300..5aab40071b68affe602be16d451be598b246faa1 100644
|
||||
--- a/lib/internal/bootstrap/node.js
|
||||
+++ b/lib/internal/bootstrap/node.js
|
||||
@@ -62,6 +62,10 @@ setupBuffer();
|
||||
@@ -57,6 +57,10 @@ setupBuffer();
|
||||
process.domain = null;
|
||||
process._exiting = false;
|
||||
|
||||
@@ -19,13 +19,13 @@ index 863d4ef5608bcebc9b49c3988509be9cfb18b6cd..8b70f79d2b278f2f6b15abc2eba5045b
|
||||
+process.internalBinding = internalBinding;
|
||||
+
|
||||
// process.config is serialized config.gypi
|
||||
const nativeModule = internalBinding('native_module');
|
||||
|
||||
process.config = JSONParse(internalBinding('native_module').config);
|
||||
require('internal/worker/js_transferable').setup();
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 9a304f05cf4e09038531007efff28c4f57218c1d..afb1eca73a2d91b76d098114de18ad7e29846e5c 100644
|
||||
index ef52bf6486d8c827dce105e50b57c1129dcaf5a4..e2a205739ce89820fe5f1f24e609ff16b86afb04 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -84,7 +84,7 @@ const fs = require('fs');
|
||||
@@ -71,7 +71,7 @@ const fs = require('fs');
|
||||
const internalFS = require('internal/fs/utils');
|
||||
const path = require('path');
|
||||
const { sep } = path;
|
||||
@@ -34,17 +34,17 @@ index 9a304f05cf4e09038531007efff28c4f57218c1d..afb1eca73a2d91b76d098114de18ad7e
|
||||
const packageJsonReader = require('internal/modules/package_json_reader');
|
||||
const { safeGetenv } = internalBinding('credentials');
|
||||
const {
|
||||
@@ -155,7 +155,7 @@ function stat(filename) {
|
||||
@@ -143,7 +143,7 @@ function stat(filename) {
|
||||
const result = statCache.get(filename);
|
||||
if (result !== undefined) return result;
|
||||
}
|
||||
- const result = internalModuleStat(filename);
|
||||
+ const result = internalFsBinding.internalModuleStat(filename);
|
||||
if (statCache !== null && result >= 0) {
|
||||
// Only set cache when `internalModuleStat(filename)` succeeds.
|
||||
statCache.set(filename, result);
|
||||
if (statCache !== null) statCache.set(filename, result);
|
||||
return result;
|
||||
}
|
||||
diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js
|
||||
index 09eb12bd1533bfed44d9cb62c068e2c880df8ba2..11a6e4b2edc0930049d7acecf2a6e94e51abeb1c 100644
|
||||
index 4a2b0e6ddb3ed8881f896c6f556c9debaf778b81..209df9033a26c29c6e60bd173f71055884a0db89 100644
|
||||
--- a/lib/internal/modules/package_json_reader.js
|
||||
+++ b/lib/internal/modules/package_json_reader.js
|
||||
@@ -1,7 +1,7 @@
|
||||
@@ -60,8 +60,8 @@ index 09eb12bd1533bfed44d9cb62c068e2c880df8ba2..11a6e4b2edc0930049d7acecf2a6e94e
|
||||
return cache.get(jsonPath);
|
||||
}
|
||||
|
||||
- const { 0: string, 1: containsKeys } = internalModuleReadJSON(
|
||||
+ const { 0: string, 1: containsKeys } = internalFsBinding.internalModuleReadJSON(
|
||||
- const [string, containsKeys] = internalModuleReadJSON(
|
||||
+ const [string, containsKeys] = internalFsBinding.internalModuleReadJSON(
|
||||
toNamespacedPath(jsonPath)
|
||||
);
|
||||
const result = { string, containsKeys };
|
||||
|
||||
@@ -7,10 +7,10 @@ Subject: refactor: alter child_process.fork to use execute script with
|
||||
When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary.
|
||||
|
||||
diff --git a/lib/child_process.js b/lib/child_process.js
|
||||
index 62c552d567eaad07ffe65ea5cb24be101b57ebdd..73c11500d7e4a540f26cc7ee3b692a2f4b158b19 100644
|
||||
index ad5bce3db044d97b5283a8e9b3948bb21cf8970a..56b581121a8423874fd78698167adea5b2d63f27 100644
|
||||
--- a/lib/child_process.js
|
||||
+++ b/lib/child_process.js
|
||||
@@ -161,6 +161,15 @@ function fork(modulePath /* , args, options */) {
|
||||
@@ -123,6 +123,15 @@ function fork(modulePath /* , args, options */) {
|
||||
throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,18 +4,13 @@ Date: Tue, 3 Nov 2020 16:17:38 -0800
|
||||
Subject: src: allow embedders to provide a custom PageAllocator to
|
||||
NodePlatform
|
||||
|
||||
For certain embedder use cases there are more complex memory allocation requirements that
|
||||
the default V8 page allocator does not handle, for example using MAP_JIT when running under
|
||||
a hardened runtime environment on macOS. This allows such embedders to provide their own
|
||||
allocator that does handle these cases.
|
||||
|
||||
Upstreamed in https://github.com/nodejs/node/pull/38362.
|
||||
For certain embedder use cases there are more complex memory allocation requirements that the default V8 page allocator does not handle, for example using MAP_JIT when running under a hardened runtime environment on macOS. This allows such embedders to provide their own allocator that does handle these cases.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095984e4381 100644
|
||||
index c08fe4b32d4155badb572f15529f903c0ec63146..a8cf0d763f78c2752e3aa22479dadd9fa53c222f 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -472,8 +472,9 @@ MultiIsolatePlatform* CreatePlatform(
|
||||
@@ -488,8 +488,9 @@ MultiIsolatePlatform* CreatePlatform(
|
||||
|
||||
MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
@@ -27,7 +22,7 @@ index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095
|
||||
.release();
|
||||
}
|
||||
|
||||
@@ -483,8 +484,9 @@ void FreePlatform(MultiIsolatePlatform* platform) {
|
||||
@@ -499,8 +500,9 @@ void FreePlatform(MultiIsolatePlatform* platform) {
|
||||
|
||||
std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create(
|
||||
int thread_pool_size,
|
||||
@@ -40,10 +35,10 @@ index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095
|
||||
|
||||
MaybeLocal<Object> GetPerContextExports(Local<Context> context) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 691c16ba60b0ce8633555825e44c3ace96c5000f..ccb452bbe941c30fdc8c4eb616eb6f0259aa8b8e 100644
|
||||
index b646fdda58ebcbf2dd92ee4fc9cb0d9c039174d1..14893ad605b9f8c64b0b8fc28625e235655dcd63 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -313,7 +313,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
||||
@@ -333,7 +333,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
||||
|
||||
static std::unique_ptr<MultiIsolatePlatform> Create(
|
||||
int thread_pool_size,
|
||||
@@ -53,18 +48,18 @@ index 691c16ba60b0ce8633555825e44c3ace96c5000f..ccb452bbe941c30fdc8c4eb616eb6f02
|
||||
};
|
||||
|
||||
enum IsolateSettingsFlags {
|
||||
@@ -494,7 +495,8 @@ NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
- v8::TracingController* tracing_controller));
|
||||
+ v8::TracingController* tracing_controller,
|
||||
+ v8::PageAllocator* = nullptr));
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform));
|
||||
@@ -536,7 +537,8 @@ NODE_DEPRECATED("Use variant taking a v8::TracingController* pointer instead",
|
||||
node::tracing::TracingController* tracing_controller));
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
- v8::TracingController* tracing_controller);
|
||||
+ v8::TracingController* tracing_controller,
|
||||
+ v8::PageAllocator* = nullptr);
|
||||
NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform);
|
||||
|
||||
// Get/set the currently active tracing controller. Using CreatePlatform()
|
||||
diff --git a/src/node_platform.cc b/src/node_platform.cc
|
||||
index eb918bdd559c404a0e311e0dd92cfee8940491bc..5be79694fef65c9290f1b46d2657581dea16f543 100644
|
||||
index aac0682670fcffd235fcf450bc5e2b0d45985b47..96be2281b562c44b276483970c06862250ea8941 100644
|
||||
--- a/src/node_platform.cc
|
||||
+++ b/src/node_platform.cc
|
||||
@@ -324,12 +324,16 @@ void PerIsolatePlatformData::DecreaseHandleCount() {
|
||||
@@ -85,7 +80,7 @@ index eb918bdd559c404a0e311e0dd92cfee8940491bc..5be79694fef65c9290f1b46d2657581d
|
||||
// TODO(addaleax): It's a bit icky that we use global state here, but we can't
|
||||
// really do anything about it unless V8 starts exposing a way to access the
|
||||
// current v8::Platform instance.
|
||||
@@ -550,6 +554,10 @@ Platform::StackTracePrinter NodePlatform::GetStackTracePrinter() {
|
||||
@@ -544,6 +548,10 @@ Platform::StackTracePrinter NodePlatform::GetStackTracePrinter() {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,11 +88,11 @@ index eb918bdd559c404a0e311e0dd92cfee8940491bc..5be79694fef65c9290f1b46d2657581d
|
||||
+ return page_allocator_;
|
||||
+}
|
||||
+
|
||||
template <class T>
|
||||
TaskQueue<T>::TaskQueue()
|
||||
: lock_(), tasks_available_(), tasks_drained_(),
|
||||
std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority, std::unique_ptr<v8::JobTask> job_task) {
|
||||
return v8::platform::NewDefaultJobHandle(this, priority, std::move(job_task), 1 /* num_worker_threads */);
|
||||
}
|
||||
diff --git a/src/node_platform.h b/src/node_platform.h
|
||||
index a7139ebdcc28d24087fb49697a0973331e0387a6..4a05f3bba58c8e875d0ab67f292589edbb3b812b 100644
|
||||
index a274be6bbea19a4488bca393712a9ac8b50fe16a..314cf2d1056d30a77ead400d100a4d4c6f844be6 100644
|
||||
--- a/src/node_platform.h
|
||||
+++ b/src/node_platform.h
|
||||
@@ -138,7 +138,8 @@ class WorkerThreadsTaskRunner {
|
||||
@@ -110,7 +105,7 @@ index a7139ebdcc28d24087fb49697a0973331e0387a6..4a05f3bba58c8e875d0ab67f292589ed
|
||||
~NodePlatform() override;
|
||||
|
||||
void DrainTasks(v8::Isolate* isolate) override;
|
||||
@@ -170,6 +171,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
@@ -168,6 +169,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
v8::Isolate* isolate) override;
|
||||
|
||||
Platform::StackTracePrinter GetStackTracePrinter() override;
|
||||
@@ -118,7 +113,7 @@ index a7139ebdcc28d24087fb49697a0973331e0387a6..4a05f3bba58c8e875d0ab67f292589ed
|
||||
|
||||
private:
|
||||
IsolatePlatformDelegate* ForIsolate(v8::Isolate* isolate);
|
||||
@@ -181,6 +183,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
@@ -179,6 +181,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
std::unordered_map<v8::Isolate*, DelegatePair> per_isolate_;
|
||||
|
||||
v8::TracingController* tracing_controller_;
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tyler Ang-Wanek <tylerw@axosoft.com>
|
||||
Date: Tue, 19 Jan 2021 07:39:14 -0700
|
||||
Subject: src: inline AsyncCleanupHookHandle in headers
|
||||
|
||||
Fixes: https://github.com/nodejs/node/issues/36349
|
||||
|
||||
PR-URL: https://github.com/nodejs/node/pull/37000
|
||||
Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
||||
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
||||
Reviewed-By: James M Snell <jasnell@gmail.com>
|
||||
|
||||
diff --git a/src/api/hooks.cc b/src/api/hooks.cc
|
||||
index a719a861dbe9d8d9ca67c3bb5920b14b0df16d83..8f191aad7e2dcfbedddeaeb88f47ed721ef51cf1 100644
|
||||
--- a/src/api/hooks.cc
|
||||
+++ b/src/api/hooks.cc
|
||||
@@ -133,7 +133,7 @@ static void RunAsyncCleanupHook(void* arg) {
|
||||
info->fun(info->arg, FinishAsyncCleanupHook, info);
|
||||
}
|
||||
|
||||
-AsyncCleanupHookHandle AddEnvironmentCleanupHook(
|
||||
+ACHHandle* AddEnvironmentCleanupHookInternal(
|
||||
Isolate* isolate,
|
||||
AsyncCleanupHook fun,
|
||||
void* arg) {
|
||||
@@ -145,11 +145,11 @@ AsyncCleanupHookHandle AddEnvironmentCleanupHook(
|
||||
info->arg = arg;
|
||||
info->self = info;
|
||||
env->AddCleanupHook(RunAsyncCleanupHook, info.get());
|
||||
- return AsyncCleanupHookHandle(new ACHHandle { info });
|
||||
+ return new ACHHandle { info };
|
||||
}
|
||||
|
||||
-void RemoveEnvironmentCleanupHook(
|
||||
- AsyncCleanupHookHandle handle) {
|
||||
+void RemoveEnvironmentCleanupHookInternal(
|
||||
+ ACHHandle* handle) {
|
||||
if (handle->info->started) return;
|
||||
handle->info->self.reset();
|
||||
handle->info->env->RemoveCleanupHook(RunAsyncCleanupHook, handle->info.get());
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index f150725b54ee1315476d202797963369490d5152..7ab2ed9345c83cb4c1f51c0cc3050abc6571e3fa 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -905,12 +905,26 @@ struct ACHHandle;
|
||||
struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; };
|
||||
typedef std::unique_ptr<ACHHandle, DeleteACHHandle> AsyncCleanupHookHandle;
|
||||
|
||||
-NODE_EXTERN AsyncCleanupHookHandle AddEnvironmentCleanupHook(
|
||||
+/* This function is not intended to be used externally, it exists to aid in
|
||||
+ * keeping ABI compatibility between Node and Electron. */
|
||||
+NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookInternal(
|
||||
v8::Isolate* isolate,
|
||||
void (*fun)(void* arg, void (*cb)(void*), void* cbarg),
|
||||
void* arg);
|
||||
+inline AsyncCleanupHookHandle AddEnvironmentCleanupHook(
|
||||
+ v8::Isolate* isolate,
|
||||
+ void (*fun)(void* arg, void (*cb)(void*), void* cbarg),
|
||||
+ void* arg) {
|
||||
+ return AsyncCleanupHookHandle(AddEnvironmentCleanupHookInternal(isolate, fun,
|
||||
+ arg));
|
||||
+}
|
||||
|
||||
-NODE_EXTERN void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder);
|
||||
+/* This function is not intended to be used externally, it exists to aid in
|
||||
+ * keeping ABI compatibility between Node and Electron. */
|
||||
+NODE_EXTERN void RemoveEnvironmentCleanupHookInternal(ACHHandle* holder);
|
||||
+inline void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder) {
|
||||
+ RemoveEnvironmentCleanupHookInternal(holder.get());
|
||||
+}
|
||||
|
||||
/* Returns the id of the current execution context. If the return value is
|
||||
* zero then no execution has been set. This will happen if the user handles
|
||||
38
patches/node/src_remove_extra_semi_after_member_fn.patch
Normal file
38
patches/node/src_remove_extra_semi_after_member_fn.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Fri, 14 May 2021 13:55:28 +0200
|
||||
Subject: src: remove extra semi after member fn
|
||||
|
||||
This was added in https://github.com/nodejs/node/pull/34186 and
|
||||
https://github.com/nodejs/node/pull/38172.
|
||||
|
||||
Fix upstreamed at https://github.com/nodejs/node/pull/38686.
|
||||
|
||||
diff --git a/src/cares_wrap.h b/src/cares_wrap.h
|
||||
index bceafcb8b7f46b8044c69716e7241d2fa065ee5c..20d350a76321e8414508083c2037ad8c238c940b 100644
|
||||
--- a/src/cares_wrap.h
|
||||
+++ b/src/cares_wrap.h
|
||||
@@ -141,8 +141,8 @@ struct NodeAresTask final : public MemoryRetainer {
|
||||
uv_poll_t poll_watcher;
|
||||
|
||||
inline void MemoryInfo(MemoryTracker* trakcer) const override;
|
||||
- SET_MEMORY_INFO_NAME(NodeAresTask);
|
||||
- SET_SELF_SIZE(NodeAresTask);
|
||||
+ SET_MEMORY_INFO_NAME(NodeAresTask)
|
||||
+ SET_SELF_SIZE(NodeAresTask)
|
||||
|
||||
struct Hash {
|
||||
inline size_t operator()(NodeAresTask* a) const {
|
||||
diff --git a/src/timer_wrap.h b/src/timer_wrap.h
|
||||
index b2c20bf24d8746b5bc33ac2e55f20cd303dff269..dbc23b442bea39d4556a21bb7f365dd68239095d 100644
|
||||
--- a/src/timer_wrap.h
|
||||
+++ b/src/timer_wrap.h
|
||||
@@ -32,7 +32,7 @@ class TimerWrap final : public MemoryRetainer {
|
||||
void Ref();
|
||||
void Unref();
|
||||
|
||||
- SET_NO_MEMORY_INFO();
|
||||
+ SET_NO_MEMORY_INFO()
|
||||
SET_MEMORY_INFO_NAME(TimerWrap)
|
||||
SET_SELF_SIZE(TimerWrap)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kim-Anh Tran <kimanh@chromium.org>
|
||||
Date: Fri, 19 Jun 2020 11:29:45 +0200
|
||||
Subject: Update tests after increasing typed array size
|
||||
|
||||
Refs https://github.com/v8/node/pull/114
|
||||
|
||||
diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js
|
||||
index 070a3803802e56ec7736791559ec7d7204625754..9f626c0683ae74ae984496c77d0b73c9b4c7b872 100644
|
||||
--- a/test/parallel/test-buffer-alloc.js
|
||||
+++ b/test/parallel/test-buffer-alloc.js
|
||||
@@ -8,8 +8,8 @@ const SlowBuffer = require('buffer').SlowBuffer;
|
||||
// Verify the maximum Uint8Array size. There is no concrete limit by spec. The
|
||||
// internal limits should be updated if this fails.
|
||||
assert.throws(
|
||||
- () => new Uint8Array(2 ** 32),
|
||||
- { message: 'Invalid typed array length: 4294967296' }
|
||||
+ () => new Uint8Array(2 ** 32 + 1),
|
||||
+ { message: 'Invalid typed array length: 4294967297' }
|
||||
);
|
||||
|
||||
const b = Buffer.allocUnsafe(1024);
|
||||
diff --git a/test/parallel/test-buffer-over-max-length.js b/test/parallel/test-buffer-over-max-length.js
|
||||
index b04f89aae0344c008dff4c737aac96f53d6f7e17..ddbd93ddb088deb53304cb06d8fcdc59214dbc31 100644
|
||||
--- a/test/parallel/test-buffer-over-max-length.js
|
||||
+++ b/test/parallel/test-buffer-over-max-length.js
|
||||
@@ -12,11 +12,11 @@ const bufferMaxSizeMsg = {
|
||||
message: /^The value "[^"]*" is invalid for option "size"$/
|
||||
};
|
||||
|
||||
-assert.throws(() => Buffer((-1 >>> 0) + 1), bufferMaxSizeMsg);
|
||||
-assert.throws(() => SlowBuffer((-1 >>> 0) + 1), bufferMaxSizeMsg);
|
||||
-assert.throws(() => Buffer.alloc((-1 >>> 0) + 1), bufferMaxSizeMsg);
|
||||
-assert.throws(() => Buffer.allocUnsafe((-1 >>> 0) + 1), bufferMaxSizeMsg);
|
||||
-assert.throws(() => Buffer.allocUnsafeSlow((-1 >>> 0) + 1), bufferMaxSizeMsg);
|
||||
+assert.throws(() => Buffer((-1 >>> 0) + 2), bufferMaxSizeMsg);
|
||||
+assert.throws(() => SlowBuffer((-1 >>> 0) + 2), bufferMaxSizeMsg);
|
||||
+assert.throws(() => Buffer.alloc((-1 >>> 0) + 2), bufferMaxSizeMsg);
|
||||
+assert.throws(() => Buffer.allocUnsafe((-1 >>> 0) + 2), bufferMaxSizeMsg);
|
||||
+assert.throws(() => Buffer.allocUnsafeSlow((-1 >>> 0) + 2), bufferMaxSizeMsg);
|
||||
|
||||
assert.throws(() => Buffer(kMaxLength + 1), bufferMaxSizeMsg);
|
||||
assert.throws(() => SlowBuffer(kMaxLength + 1), bufferMaxSizeMsg);
|
||||
@@ -25,5 +25,5 @@ assert.throws(() => Buffer.allocUnsafe(kMaxLength + 1), bufferMaxSizeMsg);
|
||||
assert.throws(() => Buffer.allocUnsafeSlow(kMaxLength + 1), bufferMaxSizeMsg);
|
||||
|
||||
// issue GH-4331
|
||||
-assert.throws(() => Buffer.allocUnsafe(0x100000000), bufferMaxSizeMsg);
|
||||
+assert.throws(() => Buffer.allocUnsafe(0x100000001), bufferMaxSizeMsg);
|
||||
assert.throws(() => Buffer.allocUnsafe(0xFFFFFFFFF), bufferMaxSizeMsg);
|
||||
@@ -12,20 +12,15 @@
|
||||
"parallel/test-buffer-constructor-node-modules-paths",
|
||||
"parallel/test-buffer-constructor-outside-node-modules",
|
||||
"parallel/test-child-process-fork-exec-path",
|
||||
"parallel/test-child-process-stdio-overlapped",
|
||||
"parallel/test-cli-node-print-help",
|
||||
"parallel/test-code-cache",
|
||||
"parallel/test-crypto-aes-wrap",
|
||||
"parallel/test-crypto-authenticated-stream",
|
||||
"parallel/test-crypto-async-sign-verify",
|
||||
"parallel/test-crypto-certificate",
|
||||
"parallel/test-crypto-des3-wrap",
|
||||
"parallel/test-crypto-dh-stateless",
|
||||
"parallel/test-crypto-ecb",
|
||||
"parallel/test-crypto-engine",
|
||||
"parallel/test-crypto-fips",
|
||||
"parallel/test-crypto-hkdf.js",
|
||||
"parallel/test-crypto-secure-heap",
|
||||
"parallel/test-debug-args",
|
||||
"parallel/test-debug-usage",
|
||||
"parallel/test-debugger-pid",
|
||||
@@ -34,6 +29,7 @@
|
||||
"parallel/test-finalization-group-error",
|
||||
"parallel/test-freeze-intrinsics",
|
||||
"parallel/test-fs-utimes-y2K38",
|
||||
"parallel/test-fs-write-sigxfsz",
|
||||
"parallel/test-gc-tls-external-memory",
|
||||
"parallel/test-http2-clean-output",
|
||||
"parallel/test-http2-reset-flood",
|
||||
@@ -43,6 +39,7 @@
|
||||
"parallel/test-inspector-multisession-ws",
|
||||
"parallel/test-inspector-port-zero-cluster",
|
||||
"parallel/test-inspector-tracing-domain",
|
||||
"parallel/test-inspector-tracing-domain",
|
||||
"parallel/test-inspector-vm-global-accessors-getter-sideeffect",
|
||||
"parallel/test-inspector-vm-global-accessors-sideeffects",
|
||||
"parallel/test-module-loading-globalpaths",
|
||||
@@ -79,7 +76,6 @@
|
||||
"parallel/test-tls-client-mindhsize",
|
||||
"parallel/test-tls-client-reject",
|
||||
"parallel/test-tls-client-renegotiation-13",
|
||||
"parallel/test-tls-cnnic-whitelist",
|
||||
"parallel/test-tls-disable-renegotiation",
|
||||
"parallel/test-tls-empty-sni-context",
|
||||
"parallel/test-tls-env-bad-extra-ca",
|
||||
@@ -113,6 +109,7 @@
|
||||
"parallel/test-tls-socket-failed-handshake-emits-error",
|
||||
"parallel/test-tls-ticket",
|
||||
"parallel/test-tls-ticket-cluster",
|
||||
"parallel/test-tls-write-error",
|
||||
"parallel/test-trace-events-all",
|
||||
"parallel/test-trace-events-async-hooks",
|
||||
"parallel/test-trace-events-binding",
|
||||
@@ -139,16 +136,6 @@
|
||||
"parallel/test-vm-parse-abort-on-uncaught-exception",
|
||||
"parallel/test-vm-sigint-existing-handler",
|
||||
"parallel/test-vm-timeout",
|
||||
"parallel/test-webcrypto-derivebits-hkdf",
|
||||
"parallel/test-webcrypto-derivebits-node-dh",
|
||||
"parallel/test-webcrypto-ed25519-ed448",
|
||||
"parallel/test-webcrypto-encrypt-decrypt",
|
||||
"parallel/test-webcrypto-encrypt-decrypt-rsa",
|
||||
"parallel/test-webcrypto-rsa-pss-params",
|
||||
"parallel/test-webcrypto-x25519-x448",
|
||||
"parallel/test-webcrypto-sign-verify-node-dsa",
|
||||
"parallel/test-webcrypto-keygen",
|
||||
"parallel/test-webcrypto-encrypt-decrypt-aes",
|
||||
"parallel/test-whatwg-encoding-custom-textdecoder",
|
||||
"parallel/test-worker-message-channel",
|
||||
"parallel/test-worker-message-port",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user