mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
253 Commits
v14.0.0-be
...
v15.0.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
011a874021 | ||
|
|
bac728a134 | ||
|
|
9d6c37ac88 | ||
|
|
25fc9acec6 | ||
|
|
edb65a07f1 | ||
|
|
82b5fbc396 | ||
|
|
19820fc2a7 | ||
|
|
adc3f39a9e | ||
|
|
9fe70c5580 | ||
|
|
ea69da279f | ||
|
|
deb75ceaa5 | ||
|
|
d35fb2a2e3 | ||
|
|
c9ba0d02d7 | ||
|
|
612361c4da | ||
|
|
a3298424b3 | ||
|
|
9441ff747d | ||
|
|
d4b2f69f36 | ||
|
|
cfb2829634 | ||
|
|
0d9e6f29ba | ||
|
|
1bb689e6dd | ||
|
|
063ac19712 | ||
|
|
849a3b6f81 | ||
|
|
341b370213 | ||
|
|
3f38681c55 | ||
|
|
05ba6359d0 | ||
|
|
4b780f9770 | ||
|
|
b2da2f759a | ||
|
|
4931c055a9 | ||
|
|
a855aa34d9 | ||
|
|
bec47f54f4 | ||
|
|
4db7221c7d | ||
|
|
75b4267aa9 | ||
|
|
c0995b8dff | ||
|
|
637ba48b42 | ||
|
|
4d0475c9ce | ||
|
|
1897b14af3 | ||
|
|
eb2efd4b7e | ||
|
|
d267f979b7 | ||
|
|
3582a513ca | ||
|
|
9959f01e4c | ||
|
|
19a6286dfd | ||
|
|
459a8417e3 | ||
|
|
96ff8d7bd7 | ||
|
|
e26901aba4 | ||
|
|
0cb5631b0b | ||
|
|
36079b822a | ||
|
|
c15f44c20f | ||
|
|
c806184bfe | ||
|
|
21f6937728 | ||
|
|
ccfde6c9d4 | ||
|
|
98f617e856 | ||
|
|
b7164428ec | ||
|
|
0824fc57f7 | ||
|
|
53386914e1 | ||
|
|
635ed5a6e3 | ||
|
|
13bf2fd7ec | ||
|
|
cd031a77dd | ||
|
|
767b4973a3 | ||
|
|
5f1233cdad | ||
|
|
550d3c11a8 | ||
|
|
257b796856 | ||
|
|
2585e6d5fa | ||
|
|
7169734470 | ||
|
|
f3517b6635 | ||
|
|
6c251da201 | ||
|
|
60366ad171 | ||
|
|
6db9b274b7 | ||
|
|
25a77761f6 | ||
|
|
af991123f1 | ||
|
|
20c1f504ae | ||
|
|
18d0ed8155 | ||
|
|
0403494a6b | ||
|
|
800873b44d | ||
|
|
85a69f88f1 | ||
|
|
6eff9231b8 | ||
|
|
95a9ff952c | ||
|
|
f6531166ae | ||
|
|
1f8a46c9c6 | ||
|
|
0fe2836151 | ||
|
|
331444d103 | ||
|
|
98809d8d64 | ||
|
|
372ecf32e6 | ||
|
|
a8b3c22518 | ||
|
|
675bbfe092 | ||
|
|
a310bd7473 | ||
|
|
cb8d9cebbc | ||
|
|
97c4b59747 | ||
|
|
522b19e2d8 | ||
|
|
da9261497e | ||
|
|
3e69985b76 | ||
|
|
d3c1f10e33 | ||
|
|
37b57a1013 | ||
|
|
1b4ce6c69a | ||
|
|
9142563748 | ||
|
|
e4807ac020 | ||
|
|
da2baabb96 | ||
|
|
b60b96b221 | ||
|
|
21319926a0 | ||
|
|
a518e4b2e1 | ||
|
|
f9bfd1da25 | ||
|
|
9b5dd5380f | ||
|
|
0f16575eee | ||
|
|
9de8e676dd | ||
|
|
47a8c952e9 | ||
|
|
2c01deae03 | ||
|
|
d9d2f01563 | ||
|
|
ff39a0e939 | ||
|
|
129f92e1fa | ||
|
|
6e310b7424 | ||
|
|
b8261f1591 | ||
|
|
c5066cce22 | ||
|
|
92901ddf18 | ||
|
|
bc8cb75e4e | ||
|
|
0ad73ac423 | ||
|
|
98d2824c7f | ||
|
|
0e465f1885 | ||
|
|
507cbdc80a | ||
|
|
d4a1b41129 | ||
|
|
cfc846a337 | ||
|
|
e7ae6edbd4 | ||
|
|
8844034fa8 | ||
|
|
aca14bf7dd | ||
|
|
ef2ce9dd67 | ||
|
|
e54667e17e | ||
|
|
cef4e434cb | ||
|
|
58c58c46c4 | ||
|
|
e5aa13e2a4 | ||
|
|
4450327fda | ||
|
|
de6696ef1d | ||
|
|
6b4c59b8d8 | ||
|
|
8ccab4ce91 | ||
|
|
c841247815 | ||
|
|
f00a2d0629 | ||
|
|
b3daa2d672 | ||
|
|
542abcd6fd | ||
|
|
9a7e61cfc0 | ||
|
|
85718349cc | ||
|
|
f71c6c04fd | ||
|
|
330c3bc136 | ||
|
|
d59e2d7b2e | ||
|
|
6fd9e4280c | ||
|
|
7474c59ea0 | ||
|
|
226f2a9a56 | ||
|
|
2ae7e04598 | ||
|
|
81795744cf | ||
|
|
18b03db073 | ||
|
|
af276c96ec | ||
|
|
31a4cc26d5 | ||
|
|
214fcfc46d | ||
|
|
f022ead559 | ||
|
|
3e2ec0e2ce | ||
|
|
56ac67e059 | ||
|
|
ebf54d7cc0 | ||
|
|
8b945cb296 | ||
|
|
7019713126 | ||
|
|
86ff4a9836 | ||
|
|
cc04450b85 | ||
|
|
0b10c865d3 | ||
|
|
8d76b4ded1 | ||
|
|
4b9e804b82 | ||
|
|
34a4e26b24 | ||
|
|
fed5ad5303 | ||
|
|
f6d673c32a | ||
|
|
e8c9a814d6 | ||
|
|
af7181b93f | ||
|
|
9b99bdb570 | ||
|
|
057b15f7bb | ||
|
|
63cc82d91d | ||
|
|
73266f8f3d | ||
|
|
5f2e25b0b2 | ||
|
|
fa0323a3db | ||
|
|
c252deb878 | ||
|
|
396ea4b29c | ||
|
|
c9ccd136a8 | ||
|
|
04679121d6 | ||
|
|
7b169c2884 | ||
|
|
b27c5b94f7 | ||
|
|
330b7849a3 | ||
|
|
556c91a989 | ||
|
|
8446ce1fc7 | ||
|
|
79cb5144ae | ||
|
|
a4decffe9a | ||
|
|
5665738ceb | ||
|
|
c48ec133a5 | ||
|
|
070f25db54 | ||
|
|
c5b0ba0c01 | ||
|
|
fc10b53f95 | ||
|
|
dd98fa3cd3 | ||
|
|
1a30f9f974 | ||
|
|
fa2db00e55 | ||
|
|
1c0e8a65c4 | ||
|
|
79ae8b427c | ||
|
|
8e1176cbc0 | ||
|
|
81c5da5221 | ||
|
|
b1d1ac6524 | ||
|
|
00693bab30 | ||
|
|
5929d6335f | ||
|
|
b79fc79a01 | ||
|
|
8532e1239e | ||
|
|
8d0ed05c99 | ||
|
|
bb6903543c | ||
|
|
d6d9a6a039 | ||
|
|
8040cb788f | ||
|
|
d8d6e2ebc0 | ||
|
|
8ce63a9f18 | ||
|
|
44491b023a | ||
|
|
f0d3e1d1cf | ||
|
|
97fde6dc9c | ||
|
|
3cfe5c6a21 | ||
|
|
31190d4c6d | ||
|
|
cb59bab8cf | ||
|
|
f9213faec5 | ||
|
|
d6109b2eb4 | ||
|
|
abf6f5c8ba | ||
|
|
3b75549511 | ||
|
|
dee4c4b908 | ||
|
|
f9d2a7077e | ||
|
|
750a762bf0 | ||
|
|
fa703016f0 | ||
|
|
a1a649c0d6 | ||
|
|
0444d74830 | ||
|
|
19dce8caa5 | ||
|
|
80a039ec40 | ||
|
|
d74ad51826 | ||
|
|
0208e4adad | ||
|
|
ba26580f23 | ||
|
|
d18dbdd72b | ||
|
|
038359a7d8 | ||
|
|
93c9374e95 | ||
|
|
71fff6ea0e | ||
|
|
73adee6d53 | ||
|
|
646b79470a | ||
|
|
049d81e590 | ||
|
|
95bb0ba001 | ||
|
|
750ebfdbca | ||
|
|
a61f1446bc | ||
|
|
221d4abca4 | ||
|
|
bedd587784 | ||
|
|
1373a030b4 | ||
|
|
f664f37793 | ||
|
|
f3dff819fc | ||
|
|
d80e36bcdb | ||
|
|
9bb7051f54 | ||
|
|
77ecc7d432 | ||
|
|
9fcdb06272 | ||
|
|
cc93b8acc0 | ||
|
|
5e033cb7f8 | ||
|
|
36bca3278d | ||
|
|
bb26060564 | ||
|
|
acce13234e | ||
|
|
386572bb86 | ||
|
|
7984933e9c | ||
|
|
f01e35f4ea |
@@ -17,46 +17,24 @@ 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:
|
||||
@@ -67,7 +45,7 @@ executors:
|
||||
type: enum
|
||||
enum: ["medium", "xlarge", "2xlarge+"]
|
||||
docker:
|
||||
- image: electron.azurecr.io/build:4fc81b50f9c0980699d329bc32062fac20a26701
|
||||
- image: electron.azurecr.io/build:fe71f448c9b00708c7a8a67a0210bcef5055ac64
|
||||
resource_class: << parameters.size >>
|
||||
|
||||
macos:
|
||||
@@ -612,21 +590,13 @@ 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"
|
||||
@@ -1523,7 +1493,6 @@ commands:
|
||||
- *step-maybe-cross-arch-snapshot
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
|
||||
- when:
|
||||
@@ -1619,7 +1588,6 @@ commands:
|
||||
- *step-mksnapshot-build
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
|
||||
# Node.js headers
|
||||
@@ -1830,9 +1798,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- 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
|
||||
|
||||
linux-ia32-testing:
|
||||
executor: linux-docker
|
||||
@@ -1872,9 +1847,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- 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
|
||||
|
||||
linux-arm-testing:
|
||||
executor: linux-docker
|
||||
@@ -1917,9 +1899,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- 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
|
||||
|
||||
linux-arm64-testing:
|
||||
executor: linux-docker
|
||||
@@ -1971,9 +1960,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
- 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
|
||||
|
||||
osx-testing-x64:
|
||||
executor: macos
|
||||
@@ -1999,31 +1995,6 @@ 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:
|
||||
@@ -2032,9 +2003,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- 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
|
||||
|
||||
osx-publish-arm64-skip-checkout:
|
||||
executor: macos
|
||||
@@ -2045,9 +2023,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- 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
|
||||
|
||||
osx-testing-arm64:
|
||||
executor: macos
|
||||
@@ -2091,32 +2076,6 @@ 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
|
||||
@@ -2126,9 +2085,16 @@ jobs:
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- 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
|
||||
|
||||
mas-publish-arm64-skip-checkout:
|
||||
executor: macos
|
||||
@@ -2139,9 +2105,16 @@ jobs:
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *env-ninja-status
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
- 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
|
||||
|
||||
mas-testing-arm64:
|
||||
executor: macos
|
||||
@@ -2380,12 +2353,6 @@ 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:
|
||||
@@ -2398,54 +2365,6 @@ 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,5 +22,8 @@
|
||||
"no-trailing-spaces": {
|
||||
"br_spaces": 0
|
||||
},
|
||||
"single-h1": false
|
||||
"single-h1": false,
|
||||
"no-inline-html": {
|
||||
"allowed_elements": ["br"]
|
||||
}
|
||||
}
|
||||
|
||||
2
DEPS
2
DEPS
@@ -17,7 +17,7 @@ vars = {
|
||||
'chromium_version':
|
||||
'93.0.4566.0',
|
||||
'node_version':
|
||||
'v14.17.0',
|
||||
'v16.5.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 @@
|
||||
14.0.0-beta.17
|
||||
15.0.0-alpha.2
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
[](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: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
||||
|
||||
@@ -53,6 +53,16 @@ steps:
|
||||
env:
|
||||
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
||||
|
||||
- powershell: |
|
||||
$localArtifactPath = "$pwd\src\pdb.zip"
|
||||
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip"
|
||||
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
||||
cd src
|
||||
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
|
||||
displayName: 'Download pdb files for detailed stacktraces'
|
||||
env:
|
||||
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
||||
|
||||
- powershell: |
|
||||
New-Item src\out\Default\gen\node_headers\Release -Type directory
|
||||
Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
|
||||
@@ -63,15 +73,30 @@ steps:
|
||||
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
||||
set npm_config_arch=arm64
|
||||
cd electron
|
||||
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
||||
node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion
|
||||
displayName: 'Run Electron tests'
|
||||
node script/yarn test --runners=main --runTestFilesSeperately --enable-logging --disable-features=CalculateNativeWinOcclusion
|
||||
displayName: 'Run Electron Main process tests'
|
||||
env:
|
||||
ELECTRON_ENABLE_STACK_DUMPING: true
|
||||
ELECTRON_OUT_DIR: Default
|
||||
IGNORE_YARN_INSTALL_ERROR: 1
|
||||
ELECTRON_TEST_RESULTS_DIR: junit
|
||||
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
|
||||
- script: |
|
||||
cd src
|
||||
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
||||
set npm_config_arch=arm64
|
||||
cd electron
|
||||
node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion
|
||||
displayName: 'Run Electron Remote based tests'
|
||||
env:
|
||||
ELECTRON_OUT_DIR: Default
|
||||
IGNORE_YARN_INSTALL_ERROR: 1
|
||||
ELECTRON_TEST_RESULTS_DIR: junit
|
||||
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
condition: always()
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Test Results'
|
||||
|
||||
@@ -31,12 +31,6 @@ PATHS_TO_SKIP = [
|
||||
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
|
||||
# ship it.
|
||||
'pyproto',
|
||||
# On Windows, this binary doesn't exist (the crashpad handler is built-in).
|
||||
# On MacOS, the binary is called 'chrome_crashpad_handler' and is inside the
|
||||
# app bundle.
|
||||
# On Linux, we don't use crashpad, but this binary is still built for some
|
||||
# reason. Exclude it from the zip.
|
||||
'./crashpad_handler',
|
||||
# Skip because these are outputs that we don't need.
|
||||
'resources/inspector',
|
||||
'gen/third_party/devtools-frontend/src',
|
||||
|
||||
@@ -133,7 +133,7 @@ void CertificateManagerModel::DidGetCertDBOnUIThread(
|
||||
CreationCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
std::unique_ptr<CertificateManagerModel> model(
|
||||
auto model = base::WrapUnique(
|
||||
new CertificateManagerModel(cert_db, is_user_db_available));
|
||||
std::move(callback).Run(std::move(model));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
|
||||
#define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
#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_ = new LinuxWatcher(this);
|
||||
watcher_ = base::MakeRefCounted<LinuxWatcher>(this);
|
||||
base::PostTask(FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening,
|
||||
watcher_, sock_));
|
||||
|
||||
@@ -161,6 +161,8 @@ Returns:
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` unknown - Contains app-specific state stored by the activity on
|
||||
another device.
|
||||
* `details` Object
|
||||
* `webpageURL` String (optional) - A string identifying the URL of the webpage accessed by the activity on another device, if available.
|
||||
|
||||
Emitted during [Handoff][handoff] when an activity from a different device wants
|
||||
to be resumed. You should call `event.preventDefault()` if you want to handle
|
||||
@@ -698,7 +700,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](https://github.com/electron/electron/blob/master/docs/api/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](command-line-switches.md).
|
||||
|
||||
**Note:** When distributing your packaged app, you have to also ship the
|
||||
`locales` folder.
|
||||
@@ -1427,7 +1429,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_
|
||||
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ _Deprecated_
|
||||
|
||||
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,3 +1437,18 @@ 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,7 +2,8 @@
|
||||
|
||||
> Manipulate the child browser window
|
||||
|
||||
Process: [Renderer](../glossary.md#renderer-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._
|
||||
|
||||
The `BrowserWindowProxy` object is returned from `window.open` and provides
|
||||
limited functionality with the child window.
|
||||
|
||||
@@ -294,6 +294,7 @@ 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`.
|
||||
@@ -342,9 +343,8 @@ 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 `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.
|
||||
`window.open()`. Defaults to `true`. Child windows will always have node
|
||||
integration disabled unless `nodeIntegrationInSubFrames` is true.
|
||||
* `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
|
||||
@@ -528,11 +528,20 @@ 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.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Make HTTP/HTTPS requests.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
`ClientRequest` implements the [Writable Stream](https://nodejs.org/api/stream.html#stream_writable_streams)
|
||||
interface and is therefore an [EventEmitter][event-emitter].
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Manipulate the command line arguments for your app that Chromium reads
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
The following example shows how to check if the `--disable-gpu` flag is set.
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ 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,7 +2,8 @@
|
||||
|
||||
> Query and modify a session's cookies.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
Instances of the `Cookies` class are accessed by using `cookies` property of
|
||||
a `Session`.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> An alternate transport for Chrome's remote debugging protocol.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
Chrome Developer Tools has a [special binding][rdp] available at JavaScript
|
||||
runtime that allows interacting with pages and instrumenting them.
|
||||
|
||||
@@ -273,6 +273,11 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
|
||||
will result in one button labeled "OK".
|
||||
* `defaultId` Integer (optional) - Index of the button in the buttons array which will
|
||||
be selected by default when the message box opens.
|
||||
* `signal` AbortSignal (optional) - Pass an instance of [AbortSignal][] to
|
||||
optionally close the message box, the message box will behave as if it was
|
||||
cancelled by the user. On macOS, `signal` does not work with message boxes
|
||||
that do not have a parent window, since those message boxes run
|
||||
synchronously due to platform limitations.
|
||||
* `title` String (optional) - Title of the message box, some platforms will not show it.
|
||||
* `detail` String (optional) - Extra information of the message.
|
||||
* `checkboxLabel` String (optional) - If provided, the message box will
|
||||
@@ -360,3 +365,5 @@ window is provided.
|
||||
|
||||
You can call `BrowserWindow.getCurrentWindow().setSheetOffset(offset)` to change
|
||||
the offset from the window frame where sheets are attached.
|
||||
|
||||
[AbortSignal]: https://nodejs.org/api/globals.html#globals_class_abortsignal
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Control your app in the macOS dock
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
The following example shows how to bounce your icon on the dock.
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Control file downloads from remote sources.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
`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
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Handle responses to HTTP/HTTPS requests.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
`IncomingMessage` implements the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams)
|
||||
interface and is therefore an [EventEmitter][event-emitter].
|
||||
|
||||
@@ -159,7 +159,13 @@ A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
|
||||
|
||||
#### `menuItem.accelerator`
|
||||
|
||||
A `Accelerator` (optional) indicating the item's accelerator, if set.
|
||||
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`.
|
||||
|
||||
#### `menuItem.icon`
|
||||
|
||||
|
||||
@@ -405,4 +405,4 @@ Menu:
|
||||
```
|
||||
|
||||
[AboutInformationPropertyListFiles]: https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html
|
||||
[setMenu]: https://github.com/electron/electron/blob/master/docs/api/browser-window.md#winsetmenumenu-linux-windows
|
||||
[setMenu]: browser-window.md#winsetmenumenu-linux-windows
|
||||
|
||||
@@ -16,7 +16,8 @@ channel messaging.
|
||||
|
||||
> Port interface for channel messaging in the main process.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
||||
@@ -215,7 +215,8 @@ 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)
|
||||
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._
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Query and receive events from a sessions active service workers.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
Instances of the `ServiceWorkers` class are accessed by using `serviceWorkers` property of
|
||||
a `Session`.
|
||||
|
||||
@@ -54,7 +54,8 @@ A `Session` object, the default session object of the app.
|
||||
|
||||
> Get and set properties of a session.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
You can create a `Session` object in the `session` module:
|
||||
|
||||
|
||||
3
docs/api/structures/web-request-filter.md
Normal file
3
docs/api/structures/web-request-filter.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# WebRequestFilter Object
|
||||
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a button in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarButton(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a color picker in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarColorPicker(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a group in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarGroup(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a label in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarLabel(options)`
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
>
|
||||
> Note: Only one instance of this class can be added per TouchBar.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarOtherItemsProxy()`
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a popover in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarPopover(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a scrubber (a scrollable selector)
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarScrubber(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a segmented control (a button group) where one button has a selected state
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarSegmentedControl(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a slider in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarSlider(options)`
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Create a spacer between two items in the touch bar for native macOS applications
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### `new TouchBarSpacer(options)`
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ 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)
|
||||
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._
|
||||
|
||||
### Instance Events
|
||||
|
||||
@@ -448,6 +449,8 @@ Returns:
|
||||
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
|
||||
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
|
||||
* `meta` Boolean - Equivalent to [KeyboardEvent.metaKey][keyboardevent].
|
||||
* `location` Number - Equivalent to [KeyboardEvent.location][keyboardevent].
|
||||
* `modifiers` String[] - See [InputEvent.modifiers](structures/input-event.md).
|
||||
|
||||
Emitted before dispatching the `keydown` and `keyup` events in the page.
|
||||
Calling `event.preventDefault` will prevent the page `keydown`/`keyup` events
|
||||
@@ -1923,6 +1926,20 @@ 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,7 +68,8 @@ or `undefined` if there is no WebFrameMain associated with the given IDs.
|
||||
|
||||
## Class: WebFrameMain
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
> Intercept and modify the contents of a request at various stages of its lifetime.
|
||||
|
||||
Process: [Main](../glossary.md#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._
|
||||
|
||||
Instances of the `WebRequest` class are accessed by using the `webRequest`
|
||||
property of a `Session`.
|
||||
@@ -42,9 +43,7 @@ The following methods are available on instances of `WebRequest`:
|
||||
|
||||
#### `webRequest.onBeforeRequest([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -87,9 +86,7 @@ Some examples of valid `urls`:
|
||||
|
||||
#### `webRequest.onBeforeSendHeaders([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -116,9 +113,7 @@ The `callback` has to be called with a `response` object.
|
||||
|
||||
#### `webRequest.onSendHeaders([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -138,9 +133,7 @@ response are visible by the time this listener is fired.
|
||||
|
||||
#### `webRequest.onHeadersReceived([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -171,9 +164,7 @@ The `callback` has to be called with a `response` object.
|
||||
|
||||
#### `webRequest.onResponseStarted([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -197,9 +188,7 @@ and response headers are available.
|
||||
|
||||
#### `webRequest.onBeforeRedirect([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -224,9 +213,7 @@ redirect is about to occur.
|
||||
|
||||
#### `webRequest.onCompleted([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
@@ -249,9 +236,7 @@ completed.
|
||||
|
||||
#### `webRequest.onErrorOccurred([filter, ]listener)`
|
||||
|
||||
* `filter` Object (optional)
|
||||
* `urls` String[] - Array of URL patterns that will be used to filter out the
|
||||
requests that do not match the URL patterns.
|
||||
* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional)
|
||||
* `listener` Function | null
|
||||
* `details` Object
|
||||
* `id` Integer
|
||||
|
||||
@@ -18,7 +18,8 @@ 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)
|
||||
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._
|
||||
|
||||
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,16 +6,15 @@ 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()`
|
||||
|
||||
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`.
|
||||
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.
|
||||
|
||||
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.
|
||||
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`.
|
||||
|
||||
Electron pairs this native Chrome `Window` with a BrowserWindow under the hood.
|
||||
You can take advantage of all the customization available when creating a
|
||||
@@ -68,49 +67,18 @@ 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 `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', '*')
|
||||
```
|
||||
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.
|
||||
|
||||
### Native `Window` example
|
||||
|
||||
```javascript
|
||||
// main.js
|
||||
const mainWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nativeWindowOpen: true
|
||||
}
|
||||
})
|
||||
const mainWindow = new BrowserWindow()
|
||||
|
||||
// In this example, only windows with the `about:blank` url will be created.
|
||||
// All other urls will be blocked.
|
||||
@@ -137,3 +105,33 @@ 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,18 +12,6 @@ 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`
|
||||
@@ -45,7 +33,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)](https://www.electronjs.org/docs/api/browser-window#winsettitletitle).
|
||||
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).
|
||||
|
||||
### Removed: `worldSafeExecuteJavaScript`
|
||||
|
||||
@@ -55,6 +43,16 @@ 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
|
||||
@@ -248,7 +246,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](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
|
||||
We [recommend having contextIsolation enabled](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`.
|
||||
@@ -811,7 +809,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](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
|
||||
see the `dialog.showOpenDialog` API ([link](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
|
||||
`Change` → `Individual Components`, scroll down and select the appropriate
|
||||
`Modify` → `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.
|
||||
|
||||
@@ -133,7 +133,7 @@ are likely using [`electron-packager`], which includes [`electron-osx-sign`] and
|
||||
|
||||
If you're using Packager's API, you can pass [in configuration that both signs
|
||||
and notarizes your
|
||||
application](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html).
|
||||
application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html).
|
||||
|
||||
```js
|
||||
const packager = require('electron-packager')
|
||||
|
||||
@@ -200,6 +200,6 @@ Run the example using Electron Fiddle and then click the "Toggle Dark Mode" butt
|
||||
[system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/
|
||||
[electron-forge]: https://www.electronforge.io/
|
||||
[electron-packager]: https://github.com/electron/electron-packager
|
||||
[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport
|
||||
[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport
|
||||
[prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
|
||||
[event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
|
||||
|
||||
@@ -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](https://www.electronjs.org/docs/development/build-instructions-gn).
|
||||
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).
|
||||
|
||||
### 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](https://www.electronjs.org/docs/development/build-instructions-gn#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](../development/build-instructions-gn.md#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`.
|
||||
|
||||
@@ -79,7 +79,7 @@ or [Parcel][parcel].
|
||||
Note that because the environment presented to the `preload` script is substantially
|
||||
more privileged than that of a sandboxed renderer, it is still possible to leak
|
||||
privileged APIs to untrusted code running in the renderer process unless
|
||||
[`contextIsolation`][contextIsolation] is enabled.
|
||||
[`contextIsolation`][context-isolation] is enabled.
|
||||
|
||||
## Configuring the sandbox
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ Chromium shared library and Node.js. Vulnerabilities affecting these components
|
||||
may impact the security of your application. By updating Electron to the latest
|
||||
version, you ensure that critical vulnerabilities (such as *nodeIntegration bypasses*)
|
||||
are already patched and cannot be exploited in your application. For more information,
|
||||
see "[Use a current version of Electron](#15-use-a-current-version-of-electron)".
|
||||
see "[Use a current version of Electron](#16-use-a-current-version-of-electron)".
|
||||
|
||||
* **Evaluate your dependencies.** While NPM provides half a million reusable packages,
|
||||
it is your responsibility to choose trusted 3rd-party libraries. If you use outdated
|
||||
@@ -88,18 +88,19 @@ You should at least follow these steps to improve the security of your applicati
|
||||
1. [Only load secure content](#1-only-load-secure-content)
|
||||
2. [Disable the Node.js integration in all renderers that display remote content](#2-do-not-enable-nodejs-integration-for-remote-content)
|
||||
3. [Enable context isolation in all renderers that display remote content](#3-enable-context-isolation-for-remote-content)
|
||||
4. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#4-handle-session-permission-requests-from-remote-content)
|
||||
5. [Do not disable `webSecurity`](#5-do-not-disable-websecurity)
|
||||
6. [Define a `Content-Security-Policy`](#6-define-a-content-security-policy) and use restrictive rules (i.e. `script-src 'self'`)
|
||||
7. [Do not set `allowRunningInsecureContent` to `true`](#7-do-not-set-allowrunninginsecurecontent-to-true)
|
||||
8. [Do not enable experimental features](#8-do-not-enable-experimental-features)
|
||||
9. [Do not use `enableBlinkFeatures`](#9-do-not-use-enableblinkfeatures)
|
||||
10. [`<webview>`: Do not use `allowpopups`](#10-do-not-use-allowpopups)
|
||||
11. [`<webview>`: Verify options and params](#11-verify-webview-options-before-creation)
|
||||
12. [Disable or limit navigation](#12-disable-or-limit-navigation)
|
||||
13. [Disable or limit creation of new windows](#13-disable-or-limit-creation-of-new-windows)
|
||||
14. [Do not use `openExternal` with untrusted content](#14-do-not-use-openexternal-with-untrusted-content)
|
||||
15. [Use a current version of Electron](#15-use-a-current-version-of-electron)
|
||||
4. [Enable sandboxing](#4-enable-sandboxing)
|
||||
5. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#5-handle-session-permission-requests-from-remote-content)
|
||||
6. [Do not disable `webSecurity`](#6-do-not-disable-websecurity)
|
||||
7. [Define a `Content-Security-Policy`](#7-define-a-content-security-policy) and use restrictive rules (i.e. `script-src 'self'`)
|
||||
8. [Do not set `allowRunningInsecureContent` to `true`](#8-do-not-set-allowrunninginsecurecontent-to-true)
|
||||
9. [Do not enable experimental features](#9-do-not-enable-experimental-features)
|
||||
10. [Do not use `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures)
|
||||
11. [`<webview>`: Do not use `allowpopups`](#11-do-not-use-allowpopups)
|
||||
12. [`<webview>`: Verify options and params](#12-verify-webview-options-before-creation)
|
||||
13. [Disable or limit navigation](#13-disable-or-limit-navigation)
|
||||
14. [Disable or limit creation of new windows](#14-disable-or-limit-creation-of-new-windows)
|
||||
15. [Do not use `openExternal` with untrusted content](#15-do-not-use-openexternal-with-untrusted-content)
|
||||
16. [Use a current version of Electron](#16-use-a-current-version-of-electron)
|
||||
|
||||
To automate the detection of misconfigurations and insecure patterns, it is
|
||||
possible to use
|
||||
@@ -239,7 +240,26 @@ and prevent the use of Node primitives `contextIsolation` **must** also be used.
|
||||
For more information on what `contextIsolation` is and how to enable it please
|
||||
see our dedicated [Context Isolation](context-isolation.md) document.
|
||||
|
||||
## 4) Handle Session Permission Requests From Remote Content
|
||||
## 4) Enable Sandboxing
|
||||
|
||||
[Sandboxing](sandbox.md) is a Chromium feature that uses the operating system to
|
||||
significantly limit what renderer processes have access to. You should enable
|
||||
the sandbox in all renderers. Loading, reading or processing any untrusted
|
||||
content in an unsandboxed process, including the main process, is not advised.
|
||||
|
||||
### How?
|
||||
|
||||
When creating a window, pass the `sandbox: true` option in `webPreferences`:
|
||||
|
||||
```js
|
||||
const win = new BrowserWindow({
|
||||
webPreferences: {
|
||||
sandbox: true
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## 5) Handle Session Permission Requests From Remote Content
|
||||
|
||||
You may have seen permission requests while using Chrome: They pop up whenever
|
||||
the website attempts to use a feature that the user has to manually approve (
|
||||
@@ -277,7 +297,7 @@ session
|
||||
})
|
||||
```
|
||||
|
||||
## 5) Do Not Disable WebSecurity
|
||||
## 6) Do Not Disable WebSecurity
|
||||
|
||||
_Recommendation is Electron's default_
|
||||
|
||||
@@ -318,7 +338,7 @@ const mainWindow = new BrowserWindow()
|
||||
<webview src="page.html"></webview>
|
||||
```
|
||||
|
||||
## 6) Define a Content Security Policy
|
||||
## 7) Define a Content Security Policy
|
||||
|
||||
A Content Security Policy (CSP) is an additional layer of protection against
|
||||
cross-site-scripting attacks and data injection attacks. We recommend that they
|
||||
@@ -374,7 +394,7 @@ on a page directly in the markup using a `<meta>` tag:
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'">
|
||||
```
|
||||
|
||||
## 7) Do Not Set `allowRunningInsecureContent` to `true`
|
||||
## 8) Do Not Set `allowRunningInsecureContent` to `true`
|
||||
|
||||
_Recommendation is Electron's default_
|
||||
|
||||
@@ -407,7 +427,7 @@ const mainWindow = new BrowserWindow({
|
||||
const mainWindow = new BrowserWindow({})
|
||||
```
|
||||
|
||||
## 8) Do Not Enable Experimental Features
|
||||
## 9) Do Not Enable Experimental Features
|
||||
|
||||
_Recommendation is Electron's default_
|
||||
|
||||
@@ -439,7 +459,7 @@ const mainWindow = new BrowserWindow({
|
||||
const mainWindow = new BrowserWindow({})
|
||||
```
|
||||
|
||||
## 9) Do Not Use `enableBlinkFeatures`
|
||||
## 10) Do Not Use `enableBlinkFeatures`
|
||||
|
||||
_Recommendation is Electron's default_
|
||||
|
||||
@@ -471,7 +491,7 @@ const mainWindow = new BrowserWindow({
|
||||
const mainWindow = new BrowserWindow()
|
||||
```
|
||||
|
||||
## 10) Do Not Use `allowpopups`
|
||||
## 11) Do Not Use `allowpopups`
|
||||
|
||||
_Recommendation is Electron's default_
|
||||
|
||||
@@ -498,7 +518,7 @@ you know it needs that feature.
|
||||
<webview src="page.html"></webview>
|
||||
```
|
||||
|
||||
## 11) Verify WebView Options Before Creation
|
||||
## 12) Verify WebView Options Before Creation
|
||||
|
||||
A WebView created in a renderer process that does not have Node.js integration
|
||||
enabled will not be able to enable integration itself. However, a WebView will
|
||||
@@ -545,7 +565,7 @@ app.on('web-contents-created', (event, contents) => {
|
||||
Again, this list merely minimizes the risk, it does not remove it. If your goal
|
||||
is to display a website, a browser will be a more secure option.
|
||||
|
||||
## 12) Disable or limit navigation
|
||||
## 13) Disable or limit navigation
|
||||
|
||||
If your app has no need to navigate or only needs to navigate to known pages,
|
||||
it is a good idea to limit navigation outright to that known scope, disallowing
|
||||
@@ -589,7 +609,7 @@ app.on('web-contents-created', (event, contents) => {
|
||||
})
|
||||
```
|
||||
|
||||
## 13) Disable or limit creation of new windows
|
||||
## 14) Disable or limit creation of new windows
|
||||
|
||||
If you have a known set of windows, it's a good idea to limit the creation of
|
||||
additional windows in your app.
|
||||
@@ -636,7 +656,7 @@ app.on('web-contents-created', (event, contents) => {
|
||||
})
|
||||
```
|
||||
|
||||
## 14) Do not use `openExternal` with untrusted content
|
||||
## 15) Do not use `openExternal` with untrusted content
|
||||
|
||||
Shell's [`openExternal`][open-external] allows opening a given protocol URI with
|
||||
the desktop's native utilities. On macOS, for instance, this function is similar
|
||||
@@ -663,7 +683,7 @@ const { shell } = require('electron')
|
||||
shell.openExternal('https://example.com/index.html')
|
||||
```
|
||||
|
||||
## 15) Use a current version of Electron
|
||||
## 16) Use a current version of Electron
|
||||
|
||||
You should strive for always using the latest available version of Electron.
|
||||
Whenever a new major version is released, you should attempt to update your
|
||||
|
||||
@@ -70,6 +70,7 @@ until the maintainers feel the maintenance burden is too high to continue doing
|
||||
|
||||
### Currently supported versions
|
||||
|
||||
* 14.x.y
|
||||
* 13.x.y
|
||||
* 12.x.y
|
||||
* 11.x.y
|
||||
|
||||
@@ -162,7 +162,7 @@ client
|
||||
## Workflow
|
||||
|
||||
To test your application without rebuilding Electron,
|
||||
[place](https://github.com/electron/electron/blob/master/docs/tutorial/application-distribution.md)
|
||||
[place](application-distribution.md)
|
||||
your app source into Electron's resource directory.
|
||||
|
||||
Alternatively, pass an argument to run with your Electron binary that points to
|
||||
|
||||
@@ -128,6 +128,7 @@ auto_filenames = {
|
||||
"docs/api/structures/upload-file.md",
|
||||
"docs/api/structures/upload-raw-data.md",
|
||||
"docs/api/structures/user-default-types.md",
|
||||
"docs/api/structures/web-request-filter.md",
|
||||
"docs/api/structures/web-source.md",
|
||||
]
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ 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');
|
||||
|
||||
@@ -807,6 +806,8 @@ 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
|
||||
@@ -819,8 +820,8 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
Module._load = (request: string, ...args: any[]) => {
|
||||
const loadResult = originalModuleLoad(request, ...args);
|
||||
if (request === 'child_process') {
|
||||
if (!v8Util.getHiddenValue(loadResult, 'asar-ready')) {
|
||||
v8Util.setHiddenValue(loadResult, 'asar-ready', true);
|
||||
if (!asarReady.has(loadResult)) {
|
||||
asarReady.add(loadResult);
|
||||
// Just to make it obvious what we are dealing with here
|
||||
const childProcess = loadResult;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Menu } from 'electron/main';
|
||||
|
||||
@@ -55,14 +54,6 @@ 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 || (() => {});
|
||||
|
||||
|
||||
@@ -22,6 +22,11 @@ enum OpenFileDialogProperties {
|
||||
dontAddToRecent = 1 << 8 // Windows
|
||||
}
|
||||
|
||||
let nextId = 0;
|
||||
const getNextId = function () {
|
||||
return ++nextId;
|
||||
};
|
||||
|
||||
const normalizeAccessKey = (text: string) => {
|
||||
if (typeof text !== 'string') return text;
|
||||
|
||||
@@ -157,6 +162,7 @@ const messageBox = (sync: boolean, window: BrowserWindow | null, options?: Messa
|
||||
let {
|
||||
buttons = [],
|
||||
cancelId,
|
||||
signal,
|
||||
checkboxLabel = '',
|
||||
checkboxChecked,
|
||||
defaultId = -1,
|
||||
@@ -196,10 +202,21 @@ const messageBox = (sync: boolean, window: BrowserWindow | null, options?: Messa
|
||||
}
|
||||
}
|
||||
|
||||
// AbortSignal processing.
|
||||
let id: number | undefined;
|
||||
if (signal) {
|
||||
// Generate an ID used for closing the message box.
|
||||
id = getNextId();
|
||||
// Close the message box when signal is aborted.
|
||||
if (signal.aborted) { return Promise.resolve({ cancelId, checkboxChecked }); }
|
||||
signal.addEventListener('abort', () => dialogBinding._closeMessageBox(id));
|
||||
}
|
||||
|
||||
const settings = {
|
||||
window,
|
||||
messageBoxType,
|
||||
buttons,
|
||||
id,
|
||||
defaultId,
|
||||
cancelId,
|
||||
noLink,
|
||||
|
||||
@@ -43,6 +43,15 @@ 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,10 +1,11 @@
|
||||
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;
|
||||
|
||||
@@ -60,7 +61,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) v8Util.setHiddenValue(this.groupsMap[id][0], 'checked', true);
|
||||
if (!found) checked.set(this.groupsMap[id][0], true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -169,7 +170,7 @@ Menu.setApplicationMenu = function (menu: MenuType) {
|
||||
}
|
||||
|
||||
applicationMenu = menu;
|
||||
v8Util.setHiddenValue(global, 'applicationMenuSet', true);
|
||||
setApplicationMenuWasSet();
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
if (!menu) return;
|
||||
@@ -275,15 +276,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.
|
||||
v8Util.setHiddenValue(item, 'checked', item.checked);
|
||||
checked.set(item, item.checked);
|
||||
Object.defineProperty(item, 'checked', {
|
||||
enumerable: true,
|
||||
get: () => v8Util.getHiddenValue(item, 'checked'),
|
||||
get: () => checked.get(item),
|
||||
set: () => {
|
||||
this.groupsMap[item.groupId].forEach(other => {
|
||||
if (other !== item) v8Util.setHiddenValue(other, 'checked', false);
|
||||
if (other !== item) checked.set(other, false);
|
||||
});
|
||||
v8Util.setHiddenValue(item, 'checked', true);
|
||||
checked.set(item, true);
|
||||
}
|
||||
});
|
||||
this.insertRadioItem(pos, item.commandId, item.label, item.groupId);
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
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 (v8Util.getHiddenValue<boolean>(global, 'applicationMenuSet')) return;
|
||||
if (applicationMenuWasSet) return;
|
||||
|
||||
const helpMenu: Electron.MenuItemConstructorOptions = {
|
||||
role: 'help',
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint no-eval: "off" */
|
||||
/* global binding */
|
||||
import * as events from 'events';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
const { version } = require('./package');
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
@@ -18,14 +19,30 @@ if (isInstalled()) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const platform = process.env.npm_config_platform || process.platform;
|
||||
let arch = process.env.npm_config_arch || process.arch;
|
||||
|
||||
if (platform === 'darwin' && process.platform === 'darwin' && arch === 'x64') {
|
||||
// When downloading for macOS ON macOS and we think we need x64 we should
|
||||
// check if we're running under rosetta and download the arm64 version if appropriate
|
||||
try {
|
||||
const output = childProcess.execSync('sysctl -in sysctl.proc_translated');
|
||||
if (output.toString().trim() === '1') {
|
||||
arch = 'arm64';
|
||||
}
|
||||
} catch {
|
||||
// Ignore failure
|
||||
}
|
||||
}
|
||||
|
||||
// downloads if not cached
|
||||
downloadArtifact({
|
||||
version,
|
||||
artifactName: 'electron',
|
||||
force: process.env.force_no_cache === 'true',
|
||||
cacheRoot: process.env.electron_config_cache,
|
||||
platform: process.env.npm_config_platform || process.platform,
|
||||
arch: process.env.npm_config_arch || process.arch
|
||||
platform,
|
||||
arch
|
||||
}).then(extractFile).catch(err => {
|
||||
console.error(err.stack);
|
||||
process.exit(1);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "14.0.0-beta.17",
|
||||
"version": "15.0.0-alpha.2",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
"@electron/docs-parser": "^0.11.0",
|
||||
"@electron/typescript-definitions": "^8.9.0",
|
||||
"@electron/docs-parser": "^0.12.1",
|
||||
"@electron/typescript-definitions": "^8.9.4",
|
||||
"@octokit/auth-app": "^2.10.0",
|
||||
"@octokit/rest": "^18.0.3",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
expose_ripemd160.patch
|
||||
expose_aes-cfb.patch
|
||||
expose_des-ede3.patch
|
||||
fix_sync_evp_get_cipherbynid_and_evp_get_cipherbyname.patch
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
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;
|
||||
}
|
||||
@@ -98,8 +98,8 @@ 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
|
||||
set_svgimage_page_after_document_install.patch
|
||||
add_gin_wrappable_crash_key.patch
|
||||
|
||||
@@ -74,6 +74,32 @@ index 39557cce474439238255ecd28030215085db0c81..5b3f980837911c710686ab91a2a81c31
|
||||
#if defined(OS_ANDROID)
|
||||
// Used by WebView to sample crashes without generating the unwanted dumps. If
|
||||
// the returned value is less than 100, crash dumping will be sampled to that
|
||||
diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc
|
||||
index 5f97c1ef00d9c63a7b16265cc97d9f145adae550..8c3028f228373b5e1145fe3235dc06663f8b087f 100644
|
||||
--- a/components/crash/core/app/crashpad_linux.cc
|
||||
+++ b/components/crash/core/app/crashpad_linux.cc
|
||||
@@ -165,6 +165,7 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
// where crash_reporter provides it's own values for lsb-release.
|
||||
annotations["lsb-release"] = base::GetLinuxDistro();
|
||||
#endif
|
||||
+ crash_reporter_client->GetProcessSimpleAnnotations(&annotations);
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
|
||||
@@ -186,6 +187,13 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (!crash_reporter_client->GetShouldRateLimit()) {
|
||||
+ arguments.push_back("--no-rate-limit");
|
||||
+ }
|
||||
+ if (!crash_reporter_client->GetShouldCompressUploads()) {
|
||||
+ arguments.push_back("--no-upload-gzip");
|
||||
+ }
|
||||
+
|
||||
bool result =
|
||||
client.StartHandler(handler_path, database_path, metrics_path, url,
|
||||
annotations, arguments, false, false);
|
||||
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
|
||||
index e3fc1fb2bcab31d6a7cb325a892acb26dc00d4e4..fd654d6e514de416457c283caeb1895dba6286e1 100644
|
||||
--- a/components/crash/core/app/crashpad_mac.mm
|
||||
|
||||
@@ -5,32 +5,22 @@ 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_enable_lto_and_build_v8_with_gn_in.patch
|
||||
fix_add_default_values_for_variables_in_common_gypi.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_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_handle_boringssl_and_openssl_incompatibilities.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
|
||||
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
|
||||
fix_account_for_debugger_agent_race_condition.patch
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
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..446119163d1f7bad577cb0b7b217ecf24b994526
|
||||
index 0000000000000000000000000000000000000000..bd26c3623d3314539609a978270d3ced1d167777
|
||||
--- /dev/null
|
||||
+++ b/BUILD.gn
|
||||
@@ -0,0 +1,360 @@
|
||||
@@ -0,0 +1,400 @@
|
||||
+import("//electron/build/asar.gni")
|
||||
+import("//v8/gni/v8.gni")
|
||||
+
|
||||
@@ -273,18 +273,58 @@ index 0000000000000000000000000000000000000000..446119163d1f7bad577cb0b7b217ecf2
|
||||
+ 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" ]
|
||||
+ }
|
||||
@@ -848,10 +888,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230ab5985ea
|
||||
index 0000000000000000000000000000000000000000..6ce2f7899ffc39e145a767685a51597fa4473e50
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,550 @@
|
||||
@@ -0,0 +1,544 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
@@ -871,68 +911,16 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ {
|
||||
+ "dest_dir": "include/node//cppgc/",
|
||||
+ "files": [
|
||||
+ "//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"
|
||||
+ "//v8/include/cppgc/common.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"
|
||||
+ ]
|
||||
@@ -973,216 +961,260 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ }
|
||||
+ ],
|
||||
+ "library_files": [
|
||||
+ "lib/internal/bootstrap/environment.js",
|
||||
+ "lib/internal/bootstrap/loaders.js",
|
||||
+ "lib/internal/bootstrap/node.js",
|
||||
+ "lib/internal/bootstrap/pre_execution.js",
|
||||
+ "lib/internal/bootstrap/switches/does_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/does_not_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/is_main_thread.js",
|
||||
+ "lib/internal/bootstrap/switches/is_not_main_thread.js",
|
||||
+ "lib/internal/per_context/primordials.js",
|
||||
+ "lib/internal/per_context/domexception.js",
|
||||
+ "lib/internal/per_context/messageport.js",
|
||||
+ "lib/async_hooks.js",
|
||||
+ "lib/assert.js",
|
||||
+ "lib/buffer.js",
|
||||
+ "lib/child_process.js",
|
||||
+ "lib/console.js",
|
||||
+ "lib/constants.js",
|
||||
+ "lib/crypto.js",
|
||||
+ "lib/cluster.js",
|
||||
+ "lib/diagnostics_channel.js",
|
||||
+ "lib/dgram.js",
|
||||
+ "lib/dns.js",
|
||||
+ "lib/domain.js",
|
||||
+ "lib/events.js",
|
||||
+ "lib/fs.js",
|
||||
+ "lib/fs/promises.js",
|
||||
+ "lib/http.js",
|
||||
+ "lib/http2.js",
|
||||
+ "lib/_http_agent.js",
|
||||
+ "lib/_http_client.js",
|
||||
+ "lib/_http_common.js",
|
||||
+ "lib/_http_incoming.js",
|
||||
+ "lib/_http_outgoing.js",
|
||||
+ "lib/_http_server.js",
|
||||
+ "lib/https.js",
|
||||
+ "lib/inspector.js",
|
||||
+ "lib/module.js",
|
||||
+ "lib/net.js",
|
||||
+ "lib/os.js",
|
||||
+ "lib/path.js",
|
||||
+ "lib/perf_hooks.js",
|
||||
+ "lib/process.js",
|
||||
+ "lib/punycode.js",
|
||||
+ "lib/querystring.js",
|
||||
+ "lib/readline.js",
|
||||
+ "lib/repl.js",
|
||||
+ "lib/stream.js",
|
||||
+ "lib/_stream_readable.js",
|
||||
+ "lib/_stream_writable.js",
|
||||
+ "lib/_stream_duplex.js",
|
||||
+ "lib/_stream_transform.js",
|
||||
+ "lib/_stream_passthrough.js",
|
||||
+ "lib/_stream_wrap.js",
|
||||
+ "lib/string_decoder.js",
|
||||
+ "lib/sys.js",
|
||||
+ "lib/timers.js",
|
||||
+ "lib/tls.js",
|
||||
+ "lib/_tls_common.js",
|
||||
+ "lib/_tls_wrap.js",
|
||||
+ "lib/trace_events.js",
|
||||
+ "lib/tty.js",
|
||||
+ "lib/url.js",
|
||||
+ "lib/events.js",
|
||||
+ "lib/repl.js",
|
||||
+ "lib/util.js",
|
||||
+ "lib/v8.js",
|
||||
+ "lib/dgram.js",
|
||||
+ "lib/vm.js",
|
||||
+ "lib/wasi.js",
|
||||
+ "lib/stream.js",
|
||||
+ "lib/child_process.js",
|
||||
+ "lib/assert.js",
|
||||
+ "lib/_tls_wrap.js",
|
||||
+ "lib/http2.js",
|
||||
+ "lib/inspector.js",
|
||||
+ "lib/os.js",
|
||||
+ "lib/_http_server.js",
|
||||
+ "lib/console.js",
|
||||
+ "lib/perf_hooks.js",
|
||||
+ "lib/readline.js",
|
||||
+ "lib/punycode.js",
|
||||
+ "lib/_http_incoming.js",
|
||||
+ "lib/https.js",
|
||||
+ "lib/_stream_wrap.js",
|
||||
+ "lib/domain.js",
|
||||
+ "lib/dns.js",
|
||||
+ "lib/_http_client.js",
|
||||
+ "lib/diagnostics_channel.js",
|
||||
+ "lib/tty.js",
|
||||
+ "lib/_http_agent.js",
|
||||
+ "lib/timers.js",
|
||||
+ "lib/_http_outgoing.js",
|
||||
+ "lib/querystring.js",
|
||||
+ "lib/_tls_common.js",
|
||||
+ "lib/module.js",
|
||||
+ "lib/_stream_passthrough.js",
|
||||
+ "lib/_stream_transform.js",
|
||||
+ "lib/worker_threads.js",
|
||||
+ "lib/sys.js",
|
||||
+ "lib/_stream_duplex.js",
|
||||
+ "lib/path.js",
|
||||
+ "lib/_http_common.js",
|
||||
+ "lib/string_decoder.js",
|
||||
+ "lib/cluster.js",
|
||||
+ "lib/v8.js",
|
||||
+ "lib/crypto.js",
|
||||
+ "lib/wasi.js",
|
||||
+ "lib/_stream_readable.js",
|
||||
+ "lib/zlib.js",
|
||||
+ "lib/internal/abort_controller.js",
|
||||
+ "lib/internal/assert.js",
|
||||
+ "lib/internal/assert/assertion_error.js",
|
||||
+ "lib/internal/assert/calltracker.js",
|
||||
+ "lib/internal/async_hooks.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/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/certificate.js",
|
||||
+ "lib/internal/crypto/cipher.js",
|
||||
+ "lib/internal/crypto/diffiehellman.js",
|
||||
+ "lib/internal/crypto/hash.js",
|
||||
+ "lib/internal/crypto/keygen.js",
|
||||
+ "lib/internal/crypto/keys.js",
|
||||
+ "lib/internal/crypto/pbkdf2.js",
|
||||
+ "lib/internal/crypto/random.js",
|
||||
+ "lib/internal/crypto/scrypt.js",
|
||||
+ "lib/internal/crypto/sig.js",
|
||||
+ "lib/internal/crypto/util.js",
|
||||
+ "lib/url.js",
|
||||
+ "lib/tls.js",
|
||||
+ "lib/_stream_writable.js",
|
||||
+ "lib/async_hooks.js",
|
||||
+ "lib/process.js",
|
||||
+ "lib/http.js",
|
||||
+ "lib/buffer.js",
|
||||
+ "lib/fs.js",
|
||||
+ "lib/util/types.js",
|
||||
+ "lib/timers/promises.js",
|
||||
+ "lib/path/win32.js",
|
||||
+ "lib/path/posix.js",
|
||||
+ "lib/stream/promises.js",
|
||||
+ "lib/stream/web.js",
|
||||
+ "lib/internal/constants.js",
|
||||
+ "lib/internal/dgram.js",
|
||||
+ "lib/internal/dns/promises.js",
|
||||
+ "lib/internal/dns/utils.js",
|
||||
+ "lib/internal/dtrace.js",
|
||||
+ "lib/internal/encoding.js",
|
||||
+ "lib/internal/errors.js",
|
||||
+ "lib/internal/error_serdes.js",
|
||||
+ "lib/internal/event_target.js",
|
||||
+ "lib/internal/fixed_queue.js",
|
||||
+ "lib/internal/freelist.js",
|
||||
+ "lib/internal/freeze_intrinsics.js",
|
||||
+ "lib/internal/fs/dir.js",
|
||||
+ "lib/internal/fs/promises.js",
|
||||
+ "lib/internal/fs/read_file_context.js",
|
||||
+ "lib/internal/fs/rimraf.js",
|
||||
+ "lib/internal/fs/streams.js",
|
||||
+ "lib/internal/fs/sync_write_stream.js",
|
||||
+ "lib/internal/fs/utils.js",
|
||||
+ "lib/internal/fs/watchers.js",
|
||||
+ "lib/internal/http.js",
|
||||
+ "lib/internal/heap_utils.js",
|
||||
+ "lib/internal/histogram.js",
|
||||
+ "lib/internal/idna.js",
|
||||
+ "lib/internal/inspector_async_hook.js",
|
||||
+ "lib/internal/js_stream_socket.js",
|
||||
+ "lib/internal/linkedlist.js",
|
||||
+ "lib/internal/main/check_syntax.js",
|
||||
+ "lib/internal/main/eval_string.js",
|
||||
+ "lib/internal/main/eval_stdin.js",
|
||||
+ "lib/internal/main/inspect.js",
|
||||
+ "lib/internal/main/print_help.js",
|
||||
+ "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",
|
||||
+ "lib/internal/modules/cjs/helpers.js",
|
||||
+ "lib/internal/modules/cjs/loader.js",
|
||||
+ "lib/internal/modules/esm/loader.js",
|
||||
+ "lib/internal/modules/esm/create_dynamic_module.js",
|
||||
+ "lib/internal/modules/esm/get_format.js",
|
||||
+ "lib/internal/modules/esm/get_source.js",
|
||||
+ "lib/internal/modules/esm/module_job.js",
|
||||
+ "lib/internal/modules/esm/module_map.js",
|
||||
+ "lib/internal/modules/esm/resolve.js",
|
||||
+ "lib/internal/modules/esm/transform_source.js",
|
||||
+ "lib/internal/modules/esm/translators.js",
|
||||
+ "lib/internal/abort_controller.js",
|
||||
+ "lib/internal/net.js",
|
||||
+ "lib/internal/options.js",
|
||||
+ "lib/internal/policy/manifest.js",
|
||||
+ "lib/internal/policy/sri.js",
|
||||
+ "lib/internal/priority_queue.js",
|
||||
+ "lib/internal/process/esm_loader.js",
|
||||
+ "lib/internal/process/execution.js",
|
||||
+ "lib/internal/process/per_thread.js",
|
||||
+ "lib/internal/process/policy.js",
|
||||
+ "lib/internal/process/promises.js",
|
||||
+ "lib/internal/process/warning.js",
|
||||
+ "lib/internal/process/worker_thread_only.js",
|
||||
+ "lib/internal/process/report.js",
|
||||
+ "lib/internal/process/signal.js",
|
||||
+ "lib/internal/process/task_queues.js",
|
||||
+ "lib/internal/querystring.js",
|
||||
+ "lib/internal/readline/utils.js",
|
||||
+ "lib/internal/v8_prof_processor.js",
|
||||
+ "lib/internal/event_target.js",
|
||||
+ "lib/internal/inspector_async_hook.js",
|
||||
+ "lib/internal/validators.js",
|
||||
+ "lib/internal/linkedlist.js",
|
||||
+ "lib/internal/cli_table.js",
|
||||
+ "lib/internal/repl.js",
|
||||
+ "lib/internal/repl/await.js",
|
||||
+ "lib/internal/repl/history.js",
|
||||
+ "lib/internal/repl/utils.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/timers/promises.js",
|
||||
+ "lib/internal/timers.js",
|
||||
+ "lib/internal/tls.js",
|
||||
+ "lib/internal/trace_events_async_hooks.js",
|
||||
+ "lib/internal/tty.js",
|
||||
+ "lib/internal/url.js",
|
||||
+ "lib/internal/util.js",
|
||||
+ "lib/internal/histogram.js",
|
||||
+ "lib/internal/error_serdes.js",
|
||||
+ "lib/internal/dgram.js",
|
||||
+ "lib/internal/child_process.js",
|
||||
+ "lib/internal/assert.js",
|
||||
+ "lib/internal/fixed_queue.js",
|
||||
+ "lib/internal/blocklist.js",
|
||||
+ "lib/internal/v8_prof_polyfill.js",
|
||||
+ "lib/internal/options.js",
|
||||
+ "lib/internal/worker.js",
|
||||
+ "lib/internal/dtrace.js",
|
||||
+ "lib/internal/idna.js",
|
||||
+ "lib/internal/watchdog.js",
|
||||
+ "lib/internal/encoding.js",
|
||||
+ "lib/internal/tty.js",
|
||||
+ "lib/internal/freeze_intrinsics.js",
|
||||
+ "lib/internal/timers.js",
|
||||
+ "lib/internal/heap_utils.js",
|
||||
+ "lib/internal/querystring.js",
|
||||
+ "lib/internal/js_stream_socket.js",
|
||||
+ "lib/internal/errors.js",
|
||||
+ "lib/internal/priority_queue.js",
|
||||
+ "lib/internal/freelist.js",
|
||||
+ "lib/internal/blob.js",
|
||||
+ "lib/internal/socket_list.js",
|
||||
+ "lib/internal/socketaddress.js",
|
||||
+ "lib/internal/stream_base_commons.js",
|
||||
+ "lib/internal/url.js",
|
||||
+ "lib/internal/async_hooks.js",
|
||||
+ "lib/internal/http.js",
|
||||
+ "lib/internal/buffer.js",
|
||||
+ "lib/internal/trace_events_async_hooks.js",
|
||||
+ "lib/internal/crypto/sig.js",
|
||||
+ "lib/internal/crypto/rsa.js",
|
||||
+ "lib/internal/crypto/aes.js",
|
||||
+ "lib/internal/crypto/util.js",
|
||||
+ "lib/internal/crypto/scrypt.js",
|
||||
+ "lib/internal/crypto/random.js",
|
||||
+ "lib/internal/crypto/keys.js",
|
||||
+ "lib/internal/crypto/x509.js",
|
||||
+ "lib/internal/crypto/certificate.js",
|
||||
+ "lib/internal/crypto/ec.js",
|
||||
+ "lib/internal/crypto/keygen.js",
|
||||
+ "lib/internal/crypto/mac.js",
|
||||
+ "lib/internal/crypto/diffiehellman.js",
|
||||
+ "lib/internal/crypto/hkdf.js",
|
||||
+ "lib/internal/crypto/cipher.js",
|
||||
+ "lib/internal/crypto/hash.js",
|
||||
+ "lib/internal/crypto/pbkdf2.js",
|
||||
+ "lib/internal/crypto/webcrypto.js",
|
||||
+ "lib/internal/crypto/dsa.js",
|
||||
+ "lib/internal/crypto/hashnames.js",
|
||||
+ "lib/internal/cluster/shared_handle.js",
|
||||
+ "lib/internal/cluster/round_robin_handle.js",
|
||||
+ "lib/internal/cluster/worker.js",
|
||||
+ "lib/internal/cluster/primary.js",
|
||||
+ "lib/internal/cluster/utils.js",
|
||||
+ "lib/internal/cluster/child.js",
|
||||
+ "lib/internal/webstreams/util.js",
|
||||
+ "lib/internal/webstreams/writablestream.js",
|
||||
+ "lib/internal/webstreams/readablestream.js",
|
||||
+ "lib/internal/webstreams/queuingstrategies.js",
|
||||
+ "lib/internal/webstreams/transformstream.js",
|
||||
+ "lib/internal/webstreams/transfer.js",
|
||||
+ "lib/internal/bootstrap/loaders.js",
|
||||
+ "lib/internal/bootstrap/pre_execution.js",
|
||||
+ "lib/internal/bootstrap/node.js",
|
||||
+ "lib/internal/bootstrap/environment.js",
|
||||
+ "lib/internal/bootstrap/switches/does_not_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/is_not_main_thread.js",
|
||||
+ "lib/internal/bootstrap/switches/does_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/is_main_thread.js",
|
||||
+ "lib/internal/test/binding.js",
|
||||
+ "lib/internal/test/transfer.js",
|
||||
+ "lib/internal/util/types.js",
|
||||
+ "lib/internal/util/inspector.js",
|
||||
+ "lib/internal/util/comparisons.js",
|
||||
+ "lib/internal/util/debuglog.js",
|
||||
+ "lib/internal/util/inspect.js",
|
||||
+ "lib/internal/util/inspector.js",
|
||||
+ "lib/internal/util/types.js",
|
||||
+ "lib/internal/util/iterable_weak_map.js",
|
||||
+ "lib/internal/streams/add-abort-signal.js",
|
||||
+ "lib/internal/streams/destroy.js",
|
||||
+ "lib/internal/streams/legacy.js",
|
||||
+ "lib/internal/streams/passthrough.js",
|
||||
+ "lib/internal/streams/readable.js",
|
||||
+ "lib/internal/streams/from.js",
|
||||
+ "lib/internal/streams/writable.js",
|
||||
+ "lib/internal/streams/state.js",
|
||||
+ "lib/internal/streams/buffer_list.js",
|
||||
+ "lib/internal/streams/end-of-stream.js",
|
||||
+ "lib/internal/streams/utils.js",
|
||||
+ "lib/internal/streams/transform.js",
|
||||
+ "lib/internal/streams/lazy_transform.js",
|
||||
+ "lib/internal/streams/duplex.js",
|
||||
+ "lib/internal/streams/pipeline.js",
|
||||
+ "lib/internal/readline/utils.js",
|
||||
+ "lib/internal/readline/emitKeypressEvents.js",
|
||||
+ "lib/internal/readline/callbacks.js",
|
||||
+ "lib/internal/repl/history.js",
|
||||
+ "lib/internal/repl/utils.js",
|
||||
+ "lib/internal/repl/await.js",
|
||||
+ "lib/internal/legacy/processbinding.js",
|
||||
+ "lib/internal/assert/calltracker.js",
|
||||
+ "lib/internal/assert/assertion_error.js",
|
||||
+ "lib/internal/http2/util.js",
|
||||
+ "lib/internal/http2/core.js",
|
||||
+ "lib/internal/http2/compat.js",
|
||||
+ "lib/internal/http2/util.js",
|
||||
+ "lib/internal/v8_prof_polyfill.js",
|
||||
+ "lib/internal/v8_prof_processor.js",
|
||||
+ "lib/internal/validators.js",
|
||||
+ "lib/internal/stream_base_commons.js",
|
||||
+ "lib/internal/per_context/messageport.js",
|
||||
+ "lib/internal/per_context/primordials.js",
|
||||
+ "lib/internal/per_context/domexception.js",
|
||||
+ "lib/internal/vm/module.js",
|
||||
+ "lib/internal/worker.js",
|
||||
+ "lib/internal/tls/secure-pair.js",
|
||||
+ "lib/internal/tls/parse-cert-string.js",
|
||||
+ "lib/internal/tls/secure-context.js",
|
||||
+ "lib/internal/child_process/serialization.js",
|
||||
+ "lib/internal/debugger/inspect_repl.js",
|
||||
+ "lib/internal/debugger/inspect_client.js",
|
||||
+ "lib/internal/debugger/_inspect.js",
|
||||
+ "lib/internal/worker/io.js",
|
||||
+ "lib/internal/worker/js_transferable.js",
|
||||
+ "lib/internal/watchdog.js",
|
||||
+ "lib/internal/streams/lazy_transform.js",
|
||||
+ "lib/internal/streams/buffer_list.js",
|
||||
+ "lib/internal/streams/duplexpair.js",
|
||||
+ "lib/internal/streams/from.js",
|
||||
+ "lib/internal/streams/legacy.js",
|
||||
+ "lib/internal/streams/readable.js",
|
||||
+ "lib/internal/streams/writable.js",
|
||||
+ "lib/internal/streams/duplex.js",
|
||||
+ "lib/internal/streams/passthrough.js",
|
||||
+ "lib/internal/streams/transform.js",
|
||||
+ "lib/internal/streams/destroy.js",
|
||||
+ "lib/internal/streams/state.js",
|
||||
+ "lib/internal/streams/pipeline.js",
|
||||
+ "lib/internal/streams/end-of-stream.js",
|
||||
+ "lib/internal/main/repl.js",
|
||||
+ "lib/internal/main/print_help.js",
|
||||
+ "lib/internal/main/eval_string.js",
|
||||
+ "lib/internal/main/check_syntax.js",
|
||||
+ "lib/internal/main/prof_process.js",
|
||||
+ "lib/internal/main/worker_thread.js",
|
||||
+ "lib/internal/main/inspect.js",
|
||||
+ "lib/internal/main/eval_stdin.js",
|
||||
+ "lib/internal/main/run_main_module.js",
|
||||
+ "lib/internal/modules/run_main.js",
|
||||
+ "lib/internal/modules/package_json_reader.js",
|
||||
+ "lib/internal/modules/esm/module_job.js",
|
||||
+ "lib/internal/modules/esm/get_source.js",
|
||||
+ "lib/internal/modules/esm/translators.js",
|
||||
+ "lib/internal/modules/esm/resolve.js",
|
||||
+ "lib/internal/modules/esm/create_dynamic_module.js",
|
||||
+ "lib/internal/modules/esm/module_map.js",
|
||||
+ "lib/internal/modules/esm/get_format.js",
|
||||
+ "lib/internal/modules/esm/transform_source.js",
|
||||
+ "lib/internal/modules/esm/loader.js",
|
||||
+ "lib/internal/modules/cjs/helpers.js",
|
||||
+ "lib/internal/modules/cjs/loader.js",
|
||||
+ "lib/internal/source_map/source_map.js",
|
||||
+ "lib/internal/source_map/prepare_stack_trace.js",
|
||||
+ "lib/internal/source_map/source_map_cache.js",
|
||||
+ "lib/internal/dns/promises.js",
|
||||
+ "lib/internal/dns/utils.js",
|
||||
+ "lib/internal/fs/watchers.js",
|
||||
+ "lib/internal/fs/promises.js",
|
||||
+ "lib/internal/fs/read_file_context.js",
|
||||
+ "lib/internal/fs/rimraf.js",
|
||||
+ "lib/internal/fs/sync_write_stream.js",
|
||||
+ "lib/internal/fs/dir.js",
|
||||
+ "lib/internal/fs/streams.js",
|
||||
+ "lib/internal/fs/utils.js",
|
||||
+ "lib/internal/perf/nodetiming.js",
|
||||
+ "lib/internal/perf/usertiming.js",
|
||||
+ "lib/internal/perf/performance_entry.js",
|
||||
+ "lib/internal/perf/performance.js",
|
||||
+ "lib/internal/perf/timerify.js",
|
||||
+ "lib/internal/perf/utils.js",
|
||||
+ "lib/internal/perf/observe.js",
|
||||
+ "lib/internal/perf/event_loop_delay.js",
|
||||
+ "lib/internal/perf/event_loop_utilization.js",
|
||||
+ "lib/internal/policy/manifest.js",
|
||||
+ "lib/internal/policy/sri.js",
|
||||
+ "lib/internal/process/task_queues.js",
|
||||
+ "lib/internal/process/per_thread.js",
|
||||
+ "lib/internal/process/warning.js",
|
||||
+ "lib/internal/process/policy.js",
|
||||
+ "lib/internal/process/promises.js",
|
||||
+ "lib/internal/process/signal.js",
|
||||
+ "lib/internal/process/execution.js",
|
||||
+ "lib/internal/process/esm_loader.js",
|
||||
+ "lib/internal/process/report.js",
|
||||
+ "lib/internal/process/worker_thread_only.js",
|
||||
+ "lib/internal/console/constructor.js",
|
||||
+ "lib/internal/console/global.js",
|
||||
+ "lib/assert/strict.js",
|
||||
+ "lib/dns/promises.js",
|
||||
+ "lib/fs/promises.js",
|
||||
+ "//v8/tools/splaytree.mjs",
|
||||
+ "//v8/tools/codemap.mjs",
|
||||
+ "//v8/tools/consarray.mjs",
|
||||
@@ -1194,21 +1226,15 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "//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",
|
||||
+ "deps/acorn-plugins/acorn-private-class-elements/index.js",
|
||||
+ "deps/acorn-plugins/acorn-private-methods/index.js",
|
||||
+ "deps/acorn-plugins/acorn-static-class-features/index.js",
|
||||
+ "deps/cjs-module-lexer/lexer.js",
|
||||
+ "deps/cjs-module-lexer/dist/lexer.js"
|
||||
+ ],
|
||||
+ "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",
|
||||
@@ -1236,6 +1262,7 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "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",
|
||||
@@ -1244,6 +1271,7 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "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",
|
||||
@@ -1265,6 +1293,7 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "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",
|
||||
@@ -1272,6 +1301,7 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "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",
|
||||
@@ -1332,12 +1362,14 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "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",
|
||||
@@ -1361,9 +1393,11 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "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",
|
||||
@@ -1402,39 +1436,6 @@ index 0000000000000000000000000000000000000000..c94c7150b72e64fe0e0f5c693da31230
|
||||
+ "//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
|
||||
@@ -1641,7 +1642,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 5419747db7b6504ad9d61b1cd3d53d93913e360f..e51bf333b77e67af188a3d352ca22b12d939e412 100644
|
||||
index 0523885212d429ee5c4142137524cb127d8adc97..116815364055a01f0c0619f0f22e9a387c2f2e2e 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
@@ -1650,7 +1651,7 @@ index 5419747db7b6504ad9d61b1cd3d53d93913e360f..e51bf333b77e67af188a3d352ca22b12
|
||||
*/
|
||||
+// Electron sets NODE_MODULE_VERSION in their GN configuration
|
||||
+#ifndef NODE_MODULE_VERSION
|
||||
#define NODE_MODULE_VERSION 83
|
||||
#define NODE_MODULE_VERSION 93
|
||||
+#endif
|
||||
|
||||
// The NAPI_VERSION provided by this version of the runtime. This is the version
|
||||
@@ -1674,17 +1675,17 @@ 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..e5fd79da5323e7039730fd8cca66caae8c84e903
|
||||
index 0000000000000000000000000000000000000000..ece315d915f0a7b2c8e823caccba7ffec8420fdf
|
||||
--- /dev/null
|
||||
+++ b/tools/generate_gn_filenames_json.py
|
||||
@@ -0,0 +1,70 @@
|
||||
@@ -0,0 +1,75 @@
|
||||
+#!/usr/bin/env python
|
||||
+import json
|
||||
+import os
|
||||
+import sys
|
||||
+
|
||||
+import install
|
||||
+
|
||||
+import subprocess
|
||||
+
|
||||
+def LoadPythonDictionary(path):
|
||||
+ file_string = open(path).read()
|
||||
@@ -1717,6 +1718,7 @@ index 0000000000000000000000000000000000000000..e5fd79da5323e7039730fd8cca66caae
|
||||
+ if t['target_name'] == '<(node_lib_target_name)')
|
||||
+ node_source_blocklist = {
|
||||
+ '<@(library_files)',
|
||||
+ '<@(deps_files)',
|
||||
+ 'common.gypi',
|
||||
+ '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
|
||||
+ }
|
||||
@@ -1726,7 +1728,10 @@ index 0000000000000000000000000000000000000000..e5fd79da5323e7039730fd8cca66caae
|
||||
+ files = [f.replace('deps/v8/', '//v8/', 1) for f in files]
|
||||
+ return files
|
||||
+
|
||||
+ out['library_files'] = filter_v8_files(node_gyp['variables']['library_files'])
|
||||
+ cwd = os.path.join(os.getcwd(), 'tools/search_files.py')
|
||||
+ lib_files = subprocess.check_output('{} {} --ext js lib'.format('python3', cwd), shell=True).split()
|
||||
+ out['library_files'] = filter_v8_files(lib_files)
|
||||
+ out['library_files'] += filter_v8_files(node_gyp['variables']['deps_files'])
|
||||
+
|
||||
+ blocklisted_sources = [
|
||||
+ f for f in node_lib_target['sources']
|
||||
@@ -1739,8 +1744,9 @@ index 0000000000000000000000000000000000000000..e5fd79da5323e7039730fd8cca66caae
|
||||
+ 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]
|
||||
+ hs = {'files': sorted(files), 'dest_dir': dest_dir}
|
||||
+ out['headers'].append(hs)
|
||||
+ if files:
|
||||
+ hs = {'files': sorted(files), 'dest_dir': dest_dir}
|
||||
+ out['headers'].append(hs)
|
||||
+
|
||||
+ install.variables = {'node_shared_libuv': 'false'}
|
||||
+ install.headers(add_headers)
|
||||
@@ -1780,34 +1786,52 @@ index 0000000000000000000000000000000000000000..3088ae4bdf814ae255c9805ebd393b2e
|
||||
+
|
||||
+ out_file.writelines(new_contents)
|
||||
diff --git a/tools/install.py b/tools/install.py
|
||||
index 693faff4c37ac4d83a47e818f4412900497a2b62..7ab58f7cba6f210e4b7829257fb87e26a091cc89 100755
|
||||
index 24cf51e73199e60b4c24700e1074fe9bd0a399e6..3cbf4f45fabec1a26e0edebb18fb589fbecfbe68 100755
|
||||
--- a/tools/install.py
|
||||
+++ b/tools/install.py
|
||||
@@ -159,8 +159,8 @@ def files(action):
|
||||
@@ -159,17 +159,18 @@ def files(action):
|
||||
def headers(action):
|
||||
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'
|
||||
def wanted_v8_headers(files_arg, dest):
|
||||
v8_headers = [
|
||||
- 'deps/v8/include/cppgc/common.h',
|
||||
- 'deps/v8/include/libplatform/libplatform.h',
|
||||
- 'deps/v8/include/libplatform/libplatform-export.h',
|
||||
- 'deps/v8/include/libplatform/v8-tracing.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/libplatform/libplatform.h',
|
||||
+ '../../v8/include/libplatform/libplatform-export.h',
|
||||
+ '../../v8/include/libplatform/v8-tracing.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',
|
||||
]
|
||||
files_arg = [name for name in files_arg if name not in inspector_headers]
|
||||
+ v8_headers = [h.replace('deps/', '../../') for h in v8_headers]
|
||||
files_arg = [name for name in files_arg if name in v8_headers]
|
||||
action(files_arg, dest)
|
||||
@@ -182,7 +182,7 @@ def headers(action):
|
||||
|
||||
@@ -190,7 +191,7 @@ def headers(action):
|
||||
if sys.platform.startswith('aix'):
|
||||
action(['out/Release/node.exp'], 'include/node/')
|
||||
|
||||
- subdir_files('deps/v8/include', 'include/node/', ignore_inspector_headers)
|
||||
+ subdir_files('../../v8/include', 'include/node/', ignore_inspector_headers)
|
||||
- subdir_files('deps/v8/include', 'include/node/', wanted_v8_headers)
|
||||
+ subdir_files('../../v8/include', 'include/node/', wanted_v8_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 0f073e182bdb2858957e4b28ae15b366d7933dbe..93e9474297fd9032981786ae9d4e005f2d1a9a2e 100755
|
||||
index d93be2123e0f8c75dd6a0041ef164982db0860e4..4d9317527d46ac8c6d8066bfba707233053b8615 100755
|
||||
--- a/tools/js2c.py
|
||||
+++ b/tools/js2c.py
|
||||
@@ -130,6 +130,14 @@ def NormalizeFileName(filename):
|
||||
@@ -131,6 +131,14 @@ def NormalizeFileName(filename):
|
||||
split = split[1:]
|
||||
if len(split):
|
||||
filename = '/'.join(split)
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
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,8 +13,29 @@ 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 4c3633e06c60265c974bdd2a5a3d2e615e4aeb82..5e03a3a6e35e934faf71e765d7fc6e356f40e8d0 100644
|
||||
index 2642982330e8cff166d10682af3d847105dc5c2e..f5491b416203877b89db69bde44f4ff50901ed8b 100644
|
||||
--- a/src/node_native_module.cc
|
||||
+++ b/src/node_native_module.cc
|
||||
@@ -20,6 +20,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
|
||||
@@ -38,11 +59,11 @@ index 3be3f2364dd252bcdd668c699a0e7ae1e754e873..b2af1bce312ffca44e7005e11f92327e
|
||||
|
||||
bool Exists(const char* id);
|
||||
diff --git a/tools/js2c.py b/tools/js2c.py
|
||||
index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e325f707d 100755
|
||||
index 4d9317527d46ac8c6d8066bfba707233053b8615..83225036208b68087a6066adf1d1948b84c5c234 100755
|
||||
--- a/tools/js2c.py
|
||||
+++ b/tools/js2c.py
|
||||
@@ -38,6 +38,8 @@ import functools
|
||||
import codecs
|
||||
@@ -39,6 +39,8 @@ import codecs
|
||||
import utils
|
||||
|
||||
def ReadFile(filename):
|
||||
+ if filename.startswith("//v8"):
|
||||
@@ -50,7 +71,7 @@ index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e
|
||||
if is_verbose:
|
||||
print(filename)
|
||||
with codecs.open(filename, "r", "utf-8") as f:
|
||||
@@ -56,13 +58,15 @@ namespace native_module {{
|
||||
@@ -57,13 +59,15 @@ namespace native_module {{
|
||||
|
||||
{0}
|
||||
|
||||
@@ -68,7 +89,7 @@ index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e
|
||||
|
||||
}} // namespace native_module
|
||||
|
||||
@@ -112,8 +116,8 @@ def GetDefinition(var, source, step=30):
|
||||
@@ -113,8 +117,8 @@ def GetDefinition(var, source, step=30):
|
||||
return definition, len(code_points)
|
||||
|
||||
|
||||
@@ -79,18 +100,18 @@ index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e
|
||||
name = NormalizeFileName(filename)
|
||||
slug = SLUGGER_RE.sub('_', name)
|
||||
var = slug + '_raw'
|
||||
@@ -123,7 +127,9 @@ def AddModule(filename, definitions, initializers):
|
||||
@@ -124,7 +128,9 @@ def AddModule(filename, definitions, initializers):
|
||||
initializers.append(initializer)
|
||||
|
||||
def NormalizeFileName(filename):
|
||||
- split = filename.split(os.path.sep)
|
||||
- split = filename.split('/')
|
||||
+ 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,7 +147,7 @@ def NormalizeFileName(filename):
|
||||
@@ -142,23 +148,36 @@ def NormalizeFileName(filename):
|
||||
return os.path.splitext(filename)[0]
|
||||
|
||||
|
||||
@@ -99,22 +120,29 @@ index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e
|
||||
# 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)
|
||||
+ # 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():
|
||||
+ 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')"))
|
||||
+
|
||||
+ config_size = 0
|
||||
+ if not only_js:
|
||||
@@ -129,18 +157,20 @@ index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e
|
||||
write_if_chaged(out, target)
|
||||
|
||||
|
||||
@@ -211,17 +230,21 @@ def main():
|
||||
)
|
||||
parser.add_argument('--target', help='output file')
|
||||
@@ -218,6 +237,7 @@ def main():
|
||||
default=None,
|
||||
help='input file directory')
|
||||
parser.add_argument('--verbose', action='store_true', help='output file')
|
||||
+ parser.add_argument('--only-js', action='store_true', help='do not require or parse any config.gypi files')
|
||||
parser.add_argument('sources', nargs='*', help='input files')
|
||||
options = parser.parse_args()
|
||||
global is_verbose
|
||||
is_verbose = options.verbose
|
||||
source_files = functools.reduce(SourceFileByExt, options.sources, {})
|
||||
# Should have exactly 2 types: `.js`, and `.gypi`
|
||||
- assert len(source_files) == 2
|
||||
@@ -230,12 +250,15 @@ def main():
|
||||
|
||||
source_files = functools.reduce(SourceFileByExt, sources, {})
|
||||
|
||||
- # Should have exactly 3 types: `.js`, `.mjs` and `.gypi`
|
||||
- assert len(source_files) == 3
|
||||
- # Currently config.gypi is the only `.gypi` file allowed
|
||||
- assert source_files['.gypi'] == ['config.gypi']
|
||||
- source_files['config.gypi'] = source_files.pop('.gypi')[0]
|
||||
@@ -148,7 +178,8 @@ index 93e9474297fd9032981786ae9d4e005f2d1a9a2e..bca4c44a31d1ffe7c9ae15b6f60cd55e
|
||||
+ if options.only_js:
|
||||
+ assert len(source_files) == 1
|
||||
+ else:
|
||||
+ assert len(source_files) == 2
|
||||
+ # Should have exactly 3 types: `.js`, `.mjs` and `.gypi`
|
||||
+ 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]
|
||||
|
||||
@@ -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 ca5a01f925a2ae69ba4295d82316e546f45c60cd..a0f6730de75b9b1dc58e2cec5ed64f9619162a2b 100644
|
||||
index 3c05e553c8e61456205a1f632c903055650a3fc6..292204024f64e6457f1344db1c74d006b7233c82 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <atomic>
|
||||
#include "env-inl.h"
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "node_errors.h"
|
||||
#include "node_external_reference.h"
|
||||
#include "node_native_module_env.h"
|
||||
+#include "node_process.h"
|
||||
#include "util.h"
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
@@ -463,7 +464,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
#include <string>
|
||||
@@ -465,7 +466,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 a66ac87237ad1de85318be58d15b508be568cf1f..62553011f9fd16dbaccd8d7e8eecee627be7137c 100644
|
||||
index c90a19d5eed72a55cb9ee89dd2471a32a30c1377..68a52e1ce1f0a2bf4fc2b19ea735948cf6586e06 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -89,10 +89,12 @@ function patchProcessObject(expandArgv1) {
|
||||
@@ -103,10 +103,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 a66ac87237ad1de85318be58d15b508be568cf1f..62553011f9fd16dbaccd8d7e8eecee62
|
||||
|
||||
// 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 e2a205739ce89820fe5f1f24e609ff16b86afb04..db6980d387ed399671957170266e2a01c04fae9a 100644
|
||||
index afb1eca73a2d91b76d098114de18ad7e29846e5c..01070c214e961d31ac508cfca669df2733abbff6 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1042,6 +1042,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -1069,6 +1069,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 5aab40071b68affe602be16d451be598b246faa1..6a55064eac76ee88d3b0b734d4f242da80aca119 100644
|
||||
index ef06d0563fa7452348754418867a56c9b8c6f4e1..a313402f93937cf2f1f93eb74422d9609e291d76 100644
|
||||
--- a/lib/internal/bootstrap/node.js
|
||||
+++ b/lib/internal/bootstrap/node.js
|
||||
@@ -119,7 +119,7 @@ const {
|
||||
@@ -193,7 +193,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 3f305b39cb35a1a36a54cff80476fecba1556d5d..cd56b9b314823ff48c1a599ec51c6a3077b62f98 100644
|
||||
index 65729132b233dc5801f142f05a00253ac951e66a..e717a0b76513401daee6910502ea580485a20612 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -64,7 +64,7 @@
|
||||
@@ -20,7 +20,7 @@ index 3f305b39cb35a1a36a54cff80476fecba1556d5d..cd56b9b314823ff48c1a599ec51c6a30
|
||||
|
||||
# Disable V8 untrusted code mitigations.
|
||||
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
|
||||
@@ -124,6 +124,9 @@
|
||||
@@ -125,6 +125,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 8665b2827583d3ac7cfbfde661878026caba15ca..ca5a01f925a2ae69ba4295d82316e546f45c60cd 100644
|
||||
index b5e42af79510b690a1687d4d32a2a583704a397f..3c05e553c8e61456205a1f632c903055650a3fc6 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -608,6 +608,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -607,6 +607,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 905afd8c235b7b1a7b45823db486384935a2a52b..102847cd32d03addeb40c9539eafc92ba49c8ec4 100644
|
||||
index 3ee25ebbd67a01d607456e5158c98ca2fdea396b..6302bb925339d709a54151a8fc8b58f1a2253881 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -134,6 +134,8 @@ using v8::Undefined;
|
||||
@@ -139,6 +139,8 @@ using v8::Undefined;
|
||||
using v8::V8;
|
||||
using v8::Value;
|
||||
|
||||
@@ -36,7 +36,7 @@ index 905afd8c235b7b1a7b45823db486384935a2a52b..102847cd32d03addeb40c9539eafc92b
|
||||
namespace per_process {
|
||||
|
||||
// node_revert.h
|
||||
@@ -837,7 +839,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -860,7 +862,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
binding::RegisterBuiltinModules();
|
||||
|
||||
// Make inherited handles noninheritable.
|
||||
@@ -47,28 +47,30 @@ index 905afd8c235b7b1a7b45823db486384935a2a52b..102847cd32d03addeb40c9539eafc92b
|
||||
|
||||
// Cache the original command line to be
|
||||
// used in diagnostic reports.
|
||||
@@ -871,6 +875,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -894,7 +898,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,
|
||||
@@ -915,6 +921,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
errors,
|
||||
@@ -937,7 +942,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
return 9;
|
||||
}
|
||||
per_process::metadata.versions.InitializeIntlVersions();
|
||||
#endif
|
||||
-
|
||||
+ } // g_upstream_node_mode
|
||||
|
||||
NativeModuleEnv::InitializeCodeCache();
|
||||
|
||||
# ifndef __POSIX__
|
||||
std::string tz;
|
||||
if (credentials::SafeGetenv("TZ", &tz) && !tz.empty()) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 38e0ef50f9b283b1d7ca8f54412d99b8cd38e524..34a16feaed229a59181e1b2e48b0e111d5b0b2a6 100644
|
||||
index 4348dfba5b2be8973eda7f36bfb9479a744a07f6..4e533cab0b74221219752aea7533866830067c09 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -220,6 +220,8 @@ namespace node {
|
||||
@@ -213,6 +213,8 @@ namespace node {
|
||||
|
||||
class IsolateData;
|
||||
class Environment;
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
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 dfd7249e907ebcc0aa0e511b96435507af3f90aa..a66ac87237ad1de85318be58d15b508be568cf1f 100644
|
||||
index 3b69844dc4ea0c4e17a74ea514c4f0dc390e3a61..c90a19d5eed72a55cb9ee89dd2471a32a30c1377 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -69,6 +69,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
@@ -75,6 +75,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
|
||||
loadPreloadModules();
|
||||
initializeFrozenIntrinsics();
|
||||
@@ -17,7 +17,7 @@ index dfd7249e907ebcc0aa0e511b96435507af3f90aa..a66ac87237ad1de85318be58d15b508b
|
||||
}
|
||||
|
||||
function patchProcessObject(expandArgv1) {
|
||||
@@ -468,6 +469,10 @@ function loadPreloadModules() {
|
||||
@@ -475,6 +476,10 @@ function loadPreloadModules() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
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/parallel/test-debugger-address.js b/test/parallel/test-debugger-address.js
|
||||
index 95dd1c6e3f82835d5ccaf65544d654b71efaa392..ed8dccf91247068455dd593bb3e8c02bddc89ae5 100644
|
||||
--- a/test/parallel/test-debugger-address.js
|
||||
+++ b/test/parallel/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 402c1f86dd4ed99b413eca5fce8a2db47797b11a..74ef0a1618ccf1f6671bbe2a03548eee6cd0b88c 100644
|
||||
--- a/test/sequential/test-debugger-pid.js
|
||||
+++ b/test/sequential/test-debugger-pid.js
|
||||
@@ -41,6 +41,7 @@ function launchTarget(...args) {
|
||||
.then(() => cli.command('sb("alive.js", 3)'))
|
||||
.then(() => cli.waitFor(/break/))
|
||||
.then(() => cli.waitForPrompt())
|
||||
+ .then(() => new Promise(resolve => setTimeout(resolve, 1000)))
|
||||
.then(() => {
|
||||
assert.match(
|
||||
cli.output,
|
||||
@@ -1,17 +1,16 @@
|
||||
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 'enable_lto' and 'build_v8_with_gn' in
|
||||
common.gypi
|
||||
Subject: fix: add default values for variables 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 aa4279d93ca35c83ad8c417a11292ef5ca91c495..3f305b39cb35a1a36a54cff80476fecba1556d5d 100644
|
||||
index 71862791dae3be5f05fbe00b91df6240473debb1..65729132b233dc5801f142f05a00253ac951e66a 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -81,6 +81,22 @@
|
||||
@@ -81,6 +81,23 @@
|
||||
|
||||
##### end V8 defaults #####
|
||||
|
||||
@@ -30,6 +29,7 @@ index aa4279d93ca35c83ad8c417a11292ef5ca91c495..3f305b39cb35a1a36a54cff80476fecb
|
||||
+ # 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 cd56b9b314823ff48c1a599ec51c6a3077b62f98..709943635ad31da1c7a7ef91d2f3bfbeb78ea937 100644
|
||||
index e717a0b76513401daee6910502ea580485a20612..e7c50b5e46624b537de3ffed51fc21a15b666dc8 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -65,6 +65,7 @@
|
||||
@@ -25,7 +25,7 @@ index cd56b9b314823ff48c1a599ec51c6a3077b62f98..709943635ad31da1c7a7ef91d2f3bfbe
|
||||
##### end V8 defaults #####
|
||||
|
||||
# When building native modules using 'npm install' with the system npm,
|
||||
@@ -372,6 +374,9 @@
|
||||
@@ -381,6 +383,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 53b07052e43a09f29f863ee1b2287bdebe7b7a7f..c08fe4b32d4155badb572f15529f903c0ec63146 100644
|
||||
index de29d45adde76587f2a9cd50392ba45b8e24839e..09c0d22ff91856704f61024646c946a39baf53d8 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -358,12 +358,14 @@ Environment* CreateEnvironment(
|
||||
thread_id);
|
||||
|
||||
@@ -341,12 +341,14 @@ Environment* CreateEnvironment(
|
||||
Environment* env = new Environment(
|
||||
isolate_data, context, args, exec_args, nullptr, flags, thread_id);
|
||||
#if HAVE_INSPECTOR
|
||||
- if (inspector_parent_handle) {
|
||||
- env->InitializeInspector(
|
||||
@@ -36,10 +36,10 @@ index 53b07052e43a09f29f863ee1b2287bdebe7b7a7f..c08fe4b32d4155badb572f15529f903c
|
||||
#endif
|
||||
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index 9b2f82cc00e661f139611dd2de53598d6d8ff210..006bcaf4a9a864438cd447dc4235b3a5257cd2a5 100644
|
||||
index b3b1ea908253b9240cc37931f34b2a8c8c9fa3ab..dc37298aa0e13bb79030123f38070d0254691b28 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -829,6 +829,10 @@ inline bool Environment::tracks_unmanaged_fds() const {
|
||||
@@ -877,6 +877,10 @@ inline bool Environment::tracks_unmanaged_fds() const {
|
||||
return flags_ & EnvironmentFlags::kTrackUnmanagedFds;
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index 9b2f82cc00e661f139611dd2de53598d6d8ff210..006bcaf4a9a864438cd447dc4235b3a5
|
||||
return emit_filehandle_warning_;
|
||||
}
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 9c435f12db0e2d0a13ebd2b01810f0857c55fe2e..1ea1caf0e327719c39f91ce3c0897dde5034c904 100644
|
||||
index e1b89261fcb1e94220424aae2273db9fba010331..45210f074a0ca4d57f9fdc5019e8e82540b28b72 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -1026,6 +1026,7 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1199,6 +1199,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 9c435f12db0e2d0a13ebd2b01810f0857c55fe2e..1ea1caf0e327719c39f91ce3c0897dde
|
||||
inline worker::Worker* worker_context() const;
|
||||
Environment* worker_parent_env() const;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index a649f52403659fd18898e1e813f97e32f33784e7..b646fdda58ebcbf2dd92ee4fc9cb0d9c039174d1 100644
|
||||
index 41f79ef869128636ac04093919e8e5816b39bef9..691c16ba60b0ce8633555825e44c3ace96c5000f 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -426,7 +426,11 @@ enum Flags : uint64_t {
|
||||
@@ -405,7 +405,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().
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
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 2c4acbc4fa0eca3b7c6d03b997445633646446e7..53b07052e43a09f29f863ee1b2287bdebe7b7a7f 100644
|
||||
index b7e213602b57d5cf15890726ae773d6067877c44..de29d45adde76587f2a9cd50392ba45b8e24839e 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -472,6 +472,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
|
||||
@@ -456,6 +456,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
|
||||
return env->platform();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ index 2c4acbc4fa0eca3b7c6d03b997445633646446e7..53b07052e43a09f29f863ee1b2287bde
|
||||
int thread_pool_size,
|
||||
node::tracing::TracingController* tracing_controller) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 34a16feaed229a59181e1b2e48b0e111d5b0b2a6..a649f52403659fd18898e1e813f97e32f33784e7 100644
|
||||
index 4e533cab0b74221219752aea7533866830067c09..41f79ef869128636ac04093919e8e5816b39bef9 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -125,6 +125,7 @@ namespace node {
|
||||
@@ -118,6 +118,7 @@ namespace node {
|
||||
|
||||
namespace tracing {
|
||||
|
||||
@@ -33,12 +33,12 @@ index 34a16feaed229a59181e1b2e48b0e111d5b0b2a6..a649f52403659fd18898e1e813f97e32
|
||||
class TracingController;
|
||||
|
||||
}
|
||||
@@ -522,6 +523,8 @@ NODE_DEPRECATED("Use GetMultiIsolatePlatform(env) instead",
|
||||
@@ -484,6 +485,8 @@ NODE_EXTERN v8::MaybeLocal<v8::Value> PrepareStackTraceCallback(
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
|
||||
|
||||
+NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
+
|
||||
// Legacy variants of MultiIsolatePlatform::Create().
|
||||
NODE_DEPRECATED("Use variant taking a v8::TracingController* pointer instead",
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
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_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 f18304cd655842e999a39659315c4eb3ce1c0c6e..1aed0e7e88460cea63950f71dac502829d662cff 100644
|
||||
--- a/src/crypto/crypto_util.cc
|
||||
+++ b/src/crypto/crypto_util.cc
|
||||
@@ -491,24 +491,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;
|
||||
@@ -668,7 +658,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.
|
||||
@@ -680,7 +670,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);
|
||||
@@ -688,10 +678,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_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
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
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');
|
||||
});
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
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(),
|
||||
@@ -1,67 +0,0 @@
|
||||
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
|
||||
@@ -1,49 +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: 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 aa7180e18544cab4004a0ef87ba230bd2e732d28..0a01dcd8ed194b205d7fe510451315610e5a60be 100644
|
||||
index 8f7929994f3243fbd58b47374dfcadafb1feda8f..c333dc3464d2a23437fa22659d38dd17b6678112 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -368,10 +368,11 @@ class TraceEventScope {
|
||||
@@ -386,10 +386,11 @@ class TraceEventScope {
|
||||
TraceEventScope(const char* category,
|
||||
const char* name,
|
||||
void* id) : category_(category), name_(name), id_(id) {
|
||||
|
||||
@@ -7,19 +7,15 @@ 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 ebe0c741c9e177fe99631643030f97e8545c3368..82c08cd17b33c14b85e6586269b5dc4b233fd9e6 100644
|
||||
index d969a6449cf545c4bb313450dce3940a47be40a2..51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1199,8 +1199,8 @@ Module._initPaths = function() {
|
||||
|
||||
@@ -1222,7 +1222,7 @@ Module._initPaths = function() {
|
||||
modulePaths = paths;
|
||||
|
||||
- // Clone as a shallow copy, for introspection.
|
||||
- Module.globalPaths = modulePaths.slice(0);
|
||||
+ // clone as a shallow copy, for introspection.
|
||||
// Clone as a shallow copy, for introspection.
|
||||
- Module.globalPaths = ArrayPrototypeSlice(modulePaths);
|
||||
+ Module.globalPaths = modulePaths;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
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 82c08cd17b33c14b85e6586269b5dc4b233fd9e6..ef52bf6486d8c827dce105e50b57c1129dcaf5a4 100644
|
||||
index 51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3..9a304f05cf4e09038531007efff28c4f57218c1d 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -109,6 +109,13 @@ const {
|
||||
@@ -121,6 +121,13 @@ const {
|
||||
CHAR_COLON
|
||||
} = require('internal/constants');
|
||||
|
||||
@@ -23,18 +23,18 @@ index 82c08cd17b33c14b85e6586269b5dc4b233fd9e6..ef52bf6486d8c827dce105e50b57c112
|
||||
const {
|
||||
isProxy
|
||||
} = require('internal/util/types');
|
||||
@@ -1063,10 +1070,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (requireDepth === 0) statCache = new Map();
|
||||
@@ -1090,10 +1097,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (requireDepth === 0) statCache = new SafeMap();
|
||||
if (inspectorWrapper) {
|
||||
result = inspectorWrapper(compiledWrapper, thisValue, exports,
|
||||
- require, module, filename, dirname);
|
||||
+ require, module, filename, dirname,
|
||||
+ process, localGlobal, localBuffer);
|
||||
} else {
|
||||
result = compiledWrapper.call(thisValue, exports, require, module,
|
||||
- filename, dirname);
|
||||
+ filename, dirname, process, localGlobal,
|
||||
+ localBuffer);
|
||||
result = ReflectApply(compiledWrapper, thisValue,
|
||||
- [exports, require, module, filename, dirname]);
|
||||
+ [exports, require, module, 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 2705f8b50a658db0fc1ce6fba245792f6a567300..5aab40071b68affe602be16d451be598b246faa1 100644
|
||||
index 58f7396990dddb7dd4cf3d23fcdcc1d48f52623e..ef06d0563fa7452348754418867a56c9b8c6f4e1 100644
|
||||
--- a/lib/internal/bootstrap/node.js
|
||||
+++ b/lib/internal/bootstrap/node.js
|
||||
@@ -57,6 +57,10 @@ setupBuffer();
|
||||
@@ -62,6 +62,10 @@ setupBuffer();
|
||||
process.domain = null;
|
||||
process._exiting = false;
|
||||
|
||||
@@ -19,13 +19,13 @@ index 2705f8b50a658db0fc1ce6fba245792f6a567300..5aab40071b68affe602be16d451be598
|
||||
+process.internalBinding = internalBinding;
|
||||
+
|
||||
// process.config is serialized config.gypi
|
||||
process.config = JSONParse(internalBinding('native_module').config);
|
||||
require('internal/worker/js_transferable').setup();
|
||||
const nativeModule = internalBinding('native_module');
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index ef52bf6486d8c827dce105e50b57c1129dcaf5a4..e2a205739ce89820fe5f1f24e609ff16b86afb04 100644
|
||||
index 9a304f05cf4e09038531007efff28c4f57218c1d..afb1eca73a2d91b76d098114de18ad7e29846e5c 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -71,7 +71,7 @@ const fs = require('fs');
|
||||
@@ -84,7 +84,7 @@ const fs = require('fs');
|
||||
const internalFS = require('internal/fs/utils');
|
||||
const path = require('path');
|
||||
const { sep } = path;
|
||||
@@ -34,17 +34,17 @@ index ef52bf6486d8c827dce105e50b57c1129dcaf5a4..e2a205739ce89820fe5f1f24e609ff16
|
||||
const packageJsonReader = require('internal/modules/package_json_reader');
|
||||
const { safeGetenv } = internalBinding('credentials');
|
||||
const {
|
||||
@@ -143,7 +143,7 @@ function stat(filename) {
|
||||
@@ -155,7 +155,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) statCache.set(filename, result);
|
||||
return result;
|
||||
}
|
||||
if (statCache !== null && result >= 0) {
|
||||
// Only set cache when `internalModuleStat(filename)` succeeds.
|
||||
statCache.set(filename, result);
|
||||
diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js
|
||||
index 4a2b0e6ddb3ed8881f896c6f556c9debaf778b81..209df9033a26c29c6e60bd173f71055884a0db89 100644
|
||||
index 09eb12bd1533bfed44d9cb62c068e2c880df8ba2..11a6e4b2edc0930049d7acecf2a6e94e51abeb1c 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 4a2b0e6ddb3ed8881f896c6f556c9debaf778b81..209df9033a26c29c6e60bd173f710558
|
||||
return cache.get(jsonPath);
|
||||
}
|
||||
|
||||
- const [string, containsKeys] = internalModuleReadJSON(
|
||||
+ const [string, containsKeys] = internalFsBinding.internalModuleReadJSON(
|
||||
- const { 0: string, 1: containsKeys } = internalModuleReadJSON(
|
||||
+ const { 0: string, 1: 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 ad5bce3db044d97b5283a8e9b3948bb21cf8970a..56b581121a8423874fd78698167adea5b2d63f27 100644
|
||||
index 62c552d567eaad07ffe65ea5cb24be101b57ebdd..73c11500d7e4a540f26cc7ee3b692a2f4b158b19 100644
|
||||
--- a/lib/child_process.js
|
||||
+++ b/lib/child_process.js
|
||||
@@ -123,6 +123,15 @@ function fork(modulePath /* , args, options */) {
|
||||
@@ -161,6 +161,15 @@ function fork(modulePath /* , args, options */) {
|
||||
throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,18 @@ 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.
|
||||
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.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index c08fe4b32d4155badb572f15529f903c0ec63146..a8cf0d763f78c2752e3aa22479dadd9fa53c222f 100644
|
||||
index 09c0d22ff91856704f61024646c946a39baf53d8..b060a8e980432637c430bd66a5216095984e4381 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -488,8 +488,9 @@ MultiIsolatePlatform* CreatePlatform(
|
||||
@@ -472,8 +472,9 @@ MultiIsolatePlatform* CreatePlatform(
|
||||
|
||||
MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
@@ -22,7 +27,7 @@ index c08fe4b32d4155badb572f15529f903c0ec63146..a8cf0d763f78c2752e3aa22479dadd9f
|
||||
.release();
|
||||
}
|
||||
|
||||
@@ -499,8 +500,9 @@ void FreePlatform(MultiIsolatePlatform* platform) {
|
||||
@@ -483,8 +484,9 @@ void FreePlatform(MultiIsolatePlatform* platform) {
|
||||
|
||||
std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create(
|
||||
int thread_pool_size,
|
||||
@@ -35,10 +40,10 @@ index c08fe4b32d4155badb572f15529f903c0ec63146..a8cf0d763f78c2752e3aa22479dadd9f
|
||||
|
||||
MaybeLocal<Object> GetPerContextExports(Local<Context> context) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index b646fdda58ebcbf2dd92ee4fc9cb0d9c039174d1..14893ad605b9f8c64b0b8fc28625e235655dcd63 100644
|
||||
index 691c16ba60b0ce8633555825e44c3ace96c5000f..ccb452bbe941c30fdc8c4eb616eb6f0259aa8b8e 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -333,7 +333,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
||||
@@ -313,7 +313,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
||||
|
||||
static std::unique_ptr<MultiIsolatePlatform> Create(
|
||||
int thread_pool_size,
|
||||
@@ -48,18 +53,18 @@ index b646fdda58ebcbf2dd92ee4fc9cb0d9c039174d1..14893ad605b9f8c64b0b8fc28625e235
|
||||
};
|
||||
|
||||
enum IsolateSettingsFlags {
|
||||
@@ -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);
|
||||
@@ -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));
|
||||
|
||||
// Get/set the currently active tracing controller. Using CreatePlatform()
|
||||
diff --git a/src/node_platform.cc b/src/node_platform.cc
|
||||
index aac0682670fcffd235fcf450bc5e2b0d45985b47..96be2281b562c44b276483970c06862250ea8941 100644
|
||||
index eb918bdd559c404a0e311e0dd92cfee8940491bc..5be79694fef65c9290f1b46d2657581dea16f543 100644
|
||||
--- a/src/node_platform.cc
|
||||
+++ b/src/node_platform.cc
|
||||
@@ -324,12 +324,16 @@ void PerIsolatePlatformData::DecreaseHandleCount() {
|
||||
@@ -80,7 +85,7 @@ index aac0682670fcffd235fcf450bc5e2b0d45985b47..96be2281b562c44b276483970c068622
|
||||
// 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.
|
||||
@@ -544,6 +548,10 @@ Platform::StackTracePrinter NodePlatform::GetStackTracePrinter() {
|
||||
@@ -550,6 +554,10 @@ Platform::StackTracePrinter NodePlatform::GetStackTracePrinter() {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -88,11 +93,11 @@ index aac0682670fcffd235fcf450bc5e2b0d45985b47..96be2281b562c44b276483970c068622
|
||||
+ return page_allocator_;
|
||||
+}
|
||||
+
|
||||
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 a274be6bbea19a4488bca393712a9ac8b50fe16a..314cf2d1056d30a77ead400d100a4d4c6f844be6 100644
|
||||
index a7139ebdcc28d24087fb49697a0973331e0387a6..4a05f3bba58c8e875d0ab67f292589edbb3b812b 100644
|
||||
--- a/src/node_platform.h
|
||||
+++ b/src/node_platform.h
|
||||
@@ -138,7 +138,8 @@ class WorkerThreadsTaskRunner {
|
||||
@@ -105,7 +110,7 @@ index a274be6bbea19a4488bca393712a9ac8b50fe16a..314cf2d1056d30a77ead400d100a4d4c
|
||||
~NodePlatform() override;
|
||||
|
||||
void DrainTasks(v8::Isolate* isolate) override;
|
||||
@@ -168,6 +169,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
@@ -170,6 +171,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
v8::Isolate* isolate) override;
|
||||
|
||||
Platform::StackTracePrinter GetStackTracePrinter() override;
|
||||
@@ -113,7 +118,7 @@ index a274be6bbea19a4488bca393712a9ac8b50fe16a..314cf2d1056d30a77ead400d100a4d4c
|
||||
|
||||
private:
|
||||
IsolatePlatformDelegate* ForIsolate(v8::Isolate* isolate);
|
||||
@@ -179,6 +181,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
@@ -181,6 +183,7 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
std::unordered_map<v8::Isolate*, DelegatePair> per_isolate_;
|
||||
|
||||
v8::TracingController* tracing_controller_;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user