Compare commits

..

253 Commits

Author SHA1 Message Date
Electron Bot
011a874021 Bump v15.0.0-alpha.2 2021-07-26 10:07:59 -07:00
trop[bot]
bac728a134 fix: process.exit crash in nativeWindowOpen (#30238)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-26 18:28:37 +02:00
trop[bot]
9d6c37ac88 docs: update title of guide (#30260)
Co-authored-by: Antón Molleda <amolleda@gmail.com>
2021-07-26 20:18:20 +09:00
trop[bot]
25fc9acec6 fix: increase stack size on windows x86 (#30243)
* fix: increace main thread stack size on windows x86

* chore: improve quit-on-crashed-event spec

* chore: add debug logs

* Revert "chore: add debug logs"

This reverts commit 0be81ae07c.

* chore: use a reliable crash endpoint

Co-authored-by: Stephen Wang <wangwenqiang.wwq@bytedance.com>
Co-authored-by: Deepak Mohan <hop2deep@gmail.com>
2021-07-26 17:45:36 +09:00
Electron Bot
edb65a07f1 Bump v15.0.0-alpha.1 2021-07-21 15:05:18 -07:00
Samuel Attard
82b5fbc396 build: handle alpha tag existing before beta line has finished 2021-07-21 14:50:06 -07:00
Keeley Hammond
19820fc2a7 chore: add additional crash key to gin::Wrappable (#30161) 2021-07-21 09:33:25 -04:00
Electron Bot
adc3f39a9e Bump v15.0.0-nightly.20210721 2021-07-21 06:02:02 -07:00
Samuel Attard
9fe70c5580 build: handle release failure by existing with code 1 (#30216) 2021-07-21 00:45:57 -07:00
Electron Bot
ea69da279f Bump v15.0.0-nightly.20210720 2021-07-20 06:02:23 -07:00
Keeley Hammond
deb75ceaa5 build: update version-bumper to support alpha (#30165)
* build: update version-bumper to support alpha

* build: seperate alpha bump version tests

For easier deletion. If we want to continue supporting an alpha channel,
they can be reintegrated with main tests.

* chore: fix regex

Co-authored-by: Samuel Attard <sam@electronjs.org>

Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-07-19 17:58:15 -07:00
Jeremy Rose
d35fb2a2e3 docs: mention sandboxing in security docs (#30147) 2021-07-19 12:45:47 -07:00
Jeremy Rose
c9ba0d02d7 feat: support crashpad on linux (#29719) 2021-07-19 10:11:10 -07:00
Jeremy Rose
612361c4da chore: remove unused getWebPreferences method (#30160) 2021-07-19 09:29:23 -07:00
Mark Lee
a3298424b3 docs: update default branch for Electron Packager API links (#30175) 2021-07-19 09:25:05 -07:00
Jota
9441ff747d docs: Ffx broken context isolation link in sandbox docs (#30177) 2021-07-19 09:24:27 -07:00
Electron Bot
d4b2f69f36 Bump v15.0.0-nightly.20210719 2021-07-19 06:02:42 -07:00
Electron Bot
cfb2829634 Bump v15.0.0-nightly.20210716 2021-07-16 06:01:06 -07:00
Jeremy Rose
0d9e6f29ba fix: allow colored tray titles when font type is specified (#30146) 2021-07-15 16:45:20 -07:00
Shelley Vohr
1bb689e6dd fix: BrowserWindow transparency not working (#30136) 2021-07-15 16:18:39 -04:00
electron-roller[bot]
063ac19712 chore: bump node to v16.5.0 (main) (#30031)
* chore: bump node in DEPS to v16.4.2

* chore: update patches

* ci: run main and remote woa tests separately

* chore: bump node in DEPS to v16.5.0

* build: restore libplatform headers in distribution

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

* build: pass directory instead of list of files to js2c.py

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

* chore: various BoringSSL/OpenSSL upstreams

- https://github.com/nodejs/node/pull/39136
- https://github.com/nodejs/node/pull/39138
- https://github.com/nodejs/node/pull/39054

* test: move debugger test case to parallel

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

* chore: fixup patch indices

* build: pass directory instead of list of files to js2c.py

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

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-15 11:25:00 -04:00
Electron Bot
849a3b6f81 Bump v15.0.0-nightly.20210715 2021-07-15 07:13:56 -07:00
David Sanders
341b370213 fix: handle redirects within registered protocols (#29796) 2021-07-15 20:14:46 +09:00
Shelley Vohr
3f38681c55 fix: double traffic lights on exit fullscreen (#30114) 2021-07-14 16:45:12 -07:00
Cheng Zhao
05ba6359d0 feat: add signal option to dialog.showMessageBox (#26102)
* mac: add dialog.closeMessageBox API

* win: Implement dialog.closeMessageBox

* mac: Return cancelId with closeMessageBox

* gtk: Implement dialog.closeMessageBox

* win: Fix 32bit build

* win: Reduce the scope of lock

* fix: Build error after rebase

* feat: Use AbortSignal to close message box

* chore: silently handle duplicate ID

* win: Add more notes about the threads

* chore: apply reviews

* fix: base::NoDestructor should be warpped in function

* chore: fix style on windows
2021-07-15 07:59:27 +09:00
George Xu
4b780f9770 docs: update supported versions to match new release cadence (#30121) 2021-07-14 15:38:28 -07:00
Utkarsh Dixit
b2da2f759a docs: add runtime.reload as supported extension api (#29925) 2021-07-14 15:37:53 -07:00
Robo
4931c055a9 spec: disable flaky fullscreen test (#30141) 2021-07-14 15:26:09 -07:00
Antón Molleda
a855aa34d9 docs: fix fiddle path (#30139)
This is breaking the build in `electron/electronjs.org-new` and will
most likely not work when clicking the "Fiddle" button.

Rel: https://github.com/electron/electronjs.org-new/pull/65
2021-07-14 16:16:59 -04:00
Jeremy Rose
bec47f54f4 fix: use correct userData path when unbundled (#30113) 2021-07-14 13:10:37 -07:00
Electron Bot
4db7221c7d Bump v15.0.0-nightly.20210714 2021-07-14 06:02:07 -07:00
Davenury
75b4267aa9 Update quick-start.md (#30064)
Change app-quit link definition, so both window-all-closed and app-quit redirects to appropriate sites.
2021-07-14 20:59:32 +09:00
Milan Burda
c0995b8dff docs: add <webview> 'did-attach' event documentation (#29899) 2021-07-14 20:59:20 +09:00
Cheng Zhao
637ba48b42 fix: pressing ESC should exit fullscreen from webview (#30063) 2021-07-14 20:51:26 +09:00
Jeremy Rose
4d0475c9ce feat: expose location and modifiers on before-input-event (#29850)
* feat: expose location and modifiers on before-input-event

* lint
2021-07-14 20:50:02 +09:00
Keeley Hammond
1897b14af3 chore: update releases to 8 weeks in CONTRIBUTING (#30115)
* chore: update releases to 8 weeks in CONTRIBUTING

* chore: update support.md for four version support
2021-07-13 13:57:19 -07:00
Sofia Nguy
eb2efd4b7e docs: Update timeline for E15 alpha announcement (#30109)
* docs: Update timeline for E15 alpha announcement

* fix line break
2021-07-13 13:54:13 -07:00
1akshat1
d267f979b7 feat: continue-activity event is extended to support webpageURL property (#30042)
Co-authored-by: Akshat Malik <amalik@microstrategy.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-13 13:21:33 -07:00
Electron Bot
3582a513ca Bump v15.0.0-nightly.20210713 2021-07-13 06:02:20 -07:00
Milan Burda
9959f01e4c spec: fix check for electron_common_testing binding in logging-spec.ts (#30086) 2021-07-12 22:11:19 -07:00
Robo
19a6286dfd chore: cherry-pick 9bab573a37 from chromium (#30084)
Refs https://chromium-review.googlesource.com/c/chromium/src/+/3010140
2021-07-12 18:35:29 -07:00
Jeremy Rose
459a8417e3 test: disable failing node tests (#30096) 2021-07-13 09:40:58 +09:00
Jeremy Rose
96ff8d7bd7 build: decode error output as utf8 (#30093) 2021-07-12 15:22:26 -07:00
Jeremy Rose
e26901aba4 fix: crash when invoking login callback synchronously (#30068) 2021-07-12 12:33:41 -07:00
Jeremy Rose
0cb5631b0b fix: return RGBA values from getSystemColor (#30055) 2021-07-12 11:08:10 -07:00
Robo
36079b822a chore: disable fullscreen test on mac arm (#30083) 2021-07-12 08:53:35 -07:00
Electron Bot
c15f44c20f Bump v15.0.0-nightly.20210712 2021-07-12 06:01:17 -07:00
Robo
c806184bfe chore: fix flaky fullscreen inheritance test (#30081) 2021-07-11 23:19:30 -07:00
Cheng Zhao
21f6937728 chore: remove unneeded conversions between wstring and u16string (#30047) 2021-07-12 13:33:26 +09:00
Robo
ccfde6c9d4 fix: window ordering on mac (#29857) 2021-07-09 13:38:25 -07:00
Electron Bot
98f617e856 Bump v15.0.0-nightly.20210709 2021-07-09 06:01:45 -07:00
George Xu
b7164428ec docs: modernize protocol-handler docs (#29380)
* docs: modernize protocol-handler docs

* docs: iadd contextIsolation

* docs: add guide for launch-app-from-URL-in-other-app

* docs: address comments

* chore: fix brackets

* chore: add escaped brackets
2021-07-08 11:42:28 -07:00
Electron Bot
0824fc57f7 Bump v15.0.0-nightly.20210708 2021-07-08 06:01:00 -07:00
Milan Burda
53386914e1 docs: move webRequest filters definition to structures/web-request-filter.md (#29900) 2021-07-08 00:20:08 -07:00
Milan Burda
635ed5a6e3 feat: add missing resourceType conversions for webRequest listener details (#29902) 2021-07-08 00:19:16 -07:00
Milan Burda
13bf2fd7ec build: fix building with enable_plugins = false (#30040) 2021-07-08 00:18:11 -07:00
Electron Bot
cd031a77dd Bump v15.0.0-nightly.20210707 2021-07-07 13:02:22 -07:00
Electron Bot
767b4973a3 Revert "Bump v15.0.0-nightly.20210707"
This reverts commit 5f1233cdad.
2021-07-07 12:11:40 -07:00
Electron Bot
5f1233cdad Bump v15.0.0-nightly.20210707 2021-07-07 06:01:31 -07:00
Jeremy Rose
550d3c11a8 docs: mention contextIsolation in ipc-main example (#29918) 2021-07-06 10:27:35 -07:00
Electron Bot
257b796856 Bump v15.0.0-nightly.20210706 2021-07-06 06:01:39 -07:00
electron-roller[bot]
2585e6d5fa chore: bump chromium to 93.0.4566.0 (main) (#29980)
* chore: bump chromium in DEPS to 93.0.4562.0

* chore: update patches

* [base] Made Value::Take{Dict,List}() rvalue ref-qualified.

https://chromium-review.googlesource.com/c/chromium/src/+/2988105

* Revert "Reland "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)""

https://chromium-review.googlesource.com/c/chromium/src/+/2995482

This reverts commit 9691d6c265 and 797723ec83

* Pass gfx::Insets to GetHTComponentForFrame

https://chromium-review.googlesource.com/c/chromium/src/+/2984243

* chore: bump chromium in DEPS to 93.0.4563.0

* [Clipboard API] Clipboard Custom Formats implementation Part 2.

https://chromium-review.googlesource.com/c/chromium/src/+/2967649

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4564.0

* chore: bump chromium in DEPS to 93.0.4565.0

* chore: update patches

* Prevent use of base::NoDestructor for trivially-destructible types

https://chromium-review.googlesource.com/c/chromium/src/+/2998672

* chore: update patches

* fixup! [Clipboard API] Clipboard Custom Formats implementation Part 2.

* chore: bump chromium in DEPS to 93.0.4566.0

* chore: update patches

* chore: add missing header

* ci: do not run clipboard tests on WOA

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-07-06 08:17:13 -04:00
Samuel Attard
7169734470 fix: download the arm64 version of Electron when running node under rosetta (#29953) 2021-07-06 10:40:26 +09:00
Jenux
f3517b6635 docs: match css filename in dark-mode.md (#29936)
* Update dark-mode.md

Fix the unmatched css file name

* Update docs/tutorial/dark-mode.md

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-06 10:37:41 +09:00
David Sanders
6c251da201 chore: correct spelling of is_quitting in electron::Browser (#29948) 2021-07-05 15:45:50 -04:00
electron-roller[bot]
60366ad171 chore: bump node to v16.4.1 (main) (#29994)
* chore: bump node in DEPS to v16.4.1

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-05 13:47:09 -04:00
Electron Bot
6db9b274b7 Bump v15.0.0-nightly.20210705 2021-07-05 06:01:17 -07:00
Cheng Zhao
25a77761f6 fix: build error caused by extra ] (#30015) 2021-07-05 01:34:39 -07:00
Shelley Vohr
af991123f1 fix: self.module.paths not working in web workers (#29955)
* fix: global.module.paths in workers

* spec: add a regression test
2021-07-05 08:48:46 +09:00
Antón Molleda
20c1f504ae docs: remove Experimental from contextBridge.exposeInMainWorld (#29985)
The API has been around for about 3 years. It should no longer be
considered experimental.
2021-07-05 08:46:47 +09:00
Cheng Zhao
18d0ed8155 fix: do not leak NSUUID (#29990) 2021-07-05 08:45:00 +09:00
Cheng Zhao
0403494a6b docs: remove mention of node-mac-notifier (#29991) 2021-07-03 13:23:47 -07:00
Electron Bot
800873b44d Bump v15.0.0-nightly.20210702 2021-07-02 06:01:44 -07:00
Cheng Zhao
85a69f88f1 chore: remove unused _grantOriginAccess method (#29976) 2021-07-01 19:53:38 -07:00
Cheng Zhao
6eff9231b8 fix: webview should maximize on requestFullscreen (#29952) 2021-07-01 20:56:29 -04:00
David Sanders
95a9ff952c chore: cleanup usages of const char* (#29906) 2021-07-02 09:51:52 +09:00
David Sanders
f6531166ae chore: clean up forward declarations (#29904) 2021-07-02 09:51:37 +09:00
John Kleinschmidt
1f8a46c9c6 feat: enable window controls overlay on macOS (#29253)
* feat: enable windows control overlay on macOS

* address review feedback

* chore: address review feedback

* Address review feedback

* update doc per review

* only enable WCO when titleBarStyle is overlay

* Revert "only enable WCO when titleBarStyle is overlay"

This reverts commit 1b58b5b1fc.

* Add new titleBarOverlay property to manage feature

* spelling fix

* Update docs/api/frameless-window.md

Co-authored-by: Samuel Attard <sam@electronjs.org>

* Update shell/browser/api/electron_api_browser_window.cc

Co-authored-by: Samuel Attard <sam@electronjs.org>

* update per review feedback

Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-07-01 15:25:40 -04:00
Electron Bot
0fe2836151 Bump v15.0.0-nightly.20210701 2021-07-01 06:00:47 -07:00
Samuel Attard
331444d103 build: add support for spawning builds for a specific commit on appveyor (#29971) 2021-06-30 18:17:59 -07:00
Shelley Vohr
98809d8d64 fix: honor user-defined Downloads directory (#29938) 2021-06-30 22:54:02 +02:00
Shelley Vohr
372ecf32e6 fix: potential crash on macOS app exit (#29941) 2021-06-30 20:12:17 +02:00
Jeremy Rose
a8b3c22518 fix: correctly propagate title updates for window with no navigation entries (#29946) 2021-06-30 10:53:10 -07:00
Shelley Vohr
675bbfe092 refactor: modify Node.js options object directly (#29939)
* refactor: modify Node.js options object directly

* chore: update patch to reflect upstream
2021-06-30 16:07:28 +02:00
Electron Bot
a310bd7473 Bump v15.0.0-nightly.20210630 2021-06-30 06:00:59 -07:00
Electron Bot
cb8d9cebbc Revert "Bump v15.0.0-nightly.20210630"
This reverts commit 97c4b59747.
2021-06-30 03:50:14 -07:00
Electron Bot
97c4b59747 Bump v15.0.0-nightly.20210630 2021-06-30 02:43:32 -07:00
Robo
522b19e2d8 fix: crash when clicking links with target=_blank from webview (#29874) 2021-06-29 18:10:18 -07:00
Samuel Attard
da9261497e feat: add MenuItem.userAccelerator property (#26682)
* feat: add MenuItem.userAccelerator property

This allows folks to read the user-assigned accelerator that macOS users can provide in system preferences. Useful for showing in-app shortcut help dialogs, you need to know if the accelerator you provided is not being used in favor of a user assigned one.

* chore: update syntax

* chore: add safety check for command index being -1
2021-06-29 16:28:16 -07:00
Rituka Patwal
3e69985b76 chore: set python interpreter to python3 in script/spec-runner.js (#29740)
The new installs of the python module, python-dbusmock, is broken for
python2. The tests still run fine on linux machine in Electron's
pipeline setup on CircleCI, because the docker image used has
the non-broken version of python-dbusmock for python2 installed.
But running electron tests on any other linux machine would fail if
they don't have this non-broken version of python-dbusmock for python2
installed, already, which is the case for most of the machines.
Moreover, Python2 is deprecated now. So it would be better if we change
the python interpreter in script/spec-runner.js file to python3, for
which all the python modules are updated and working.

Co-authored-by: Rituka Patwal <rituka.patwal@postman.com>
2021-06-29 15:46:12 -07:00
electron-roller[bot]
d3c1f10e33 chore: bump chromium to 93.0.4558.0 (main) (#29895)
* chore: bump chromium in DEPS to 93.0.4553.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4555.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4556.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4557.0

* chore: update patches

* Fix warnings for -Wc++11-narrowing.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2942212

* fixup! Fix warnings for -Wc++11-narrowing.

* chore: run gen-libc++-filenames.js

* Reland "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)"

https://chromium-review.googlesource.com/c/chromium/src/+/2988699

* chore: bump chromium in DEPS to 93.0.4558.0

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-06-29 13:02:27 -07:00
Electron Bot
37b57a1013 Bump v15.0.0-nightly.20210629 2021-06-29 06:01:38 -07:00
Omar Kilani
1b4ce6c69a fix: geolocation crashes electron on macOS (#29343) (#29913) 2021-06-28 20:26:57 -07:00
David Sanders
9142563748 docs: remove requestHeaders in webRequest.onHeadersReceived (#29907) 2021-06-28 15:52:06 -07:00
electron-roller[bot]
e4807ac020 chore: bump node to v16.4.0 (main) (#29699) 2021-06-28 18:05:38 +02:00
Electron Bot
da2baabb96 Bump v15.0.0-nightly.20210628 2021-06-28 06:01:29 -07:00
David Sanders
b60b96b221 chore: remove unused using and namespace declarations (#29892) 2021-06-28 15:26:10 +09:00
Electron Bot
21319926a0 Bump v15.0.0-nightly.20210625 2021-06-25 06:00:29 -07:00
electron-roller[bot]
a518e4b2e1 chore: bump chromium to 93.0.4552.0 (main) (#29862)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-06-24 17:06:42 -07:00
Shelley Vohr
f9bfd1da25 fix: properly order out child windows (#29821) 2021-06-24 20:43:28 +02:00
Shelley Vohr
9b5dd5380f fix: Inspector method overrides when contextIsolation enabled (#29841) 2021-06-24 20:36:22 +02:00
Jeremy Rose
0f16575eee fix: stop window.open from hanging when prevented (#29851) 2021-06-24 08:50:48 -07:00
Electron Bot
9de8e676dd Bump v15.0.0-nightly.20210624 2021-06-24 06:01:03 -07:00
dependabot[bot]
47a8c952e9 build(deps): bump lodash from 4.17.20 to 4.17.21 in /spec (#29067)
* build(deps): bump lodash from 4.17.20 to 4.17.21 in /spec

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-06-23 16:51:28 -07:00
Jeremy Rose
2c01deae03 fix: deny instead of canceling when certificate-error passes false (#29826) 2021-06-23 16:40:51 -07:00
Electron Bot
d9d2f01563 Bump v15.0.0-nightly.20210623 2021-06-23 06:01:12 -07:00
David Sanders
ff39a0e939 fix: ensure set vibrancy with invalid value is a no-op (#29795) 2021-06-23 15:09:42 +09:00
Shelley Vohr
129f92e1fa fix: child window alwaysOnTop level persistence (#29813)
* fix: child window alwaysOnTop level

* chore: add undocumented getAlwaysOnTopLevel

* test: add test for level persistence

* Address feedback from review
2021-06-23 15:09:09 +09:00
Robo
6e310b7424 chore: remove revert_remove_contentrendererclient_shouldfork.patch (#29842) 2021-06-22 14:50:57 -07:00
electron-roller[bot]
b8261f1591 chore: bump chromium to 93.0.4550.0 (main) (#29751) 2021-06-22 12:17:16 -07:00
Jeremy Rose
c5066cce22 docs: fix broken markdown in dialog.md (#29782) 2021-06-22 09:49:30 -07:00
Electron Bot
92901ddf18 Bump v15.0.0-nightly.20210622 2021-06-22 06:01:22 -07:00
David Sanders
bc8cb75e4e fix: properly handle optional requestHeaders with onBeforeSendHeaders (#29798) 2021-06-22 15:08:52 +09:00
Keeley Hammond
0ad73ac423 fix: allow ppapi processes access to resource bundle on all platforms (#29827)
* wip: debug resource bundle failure

* fix: include ppapi subprocesses for windows resource bundle

* fix: allow ppapi plugin processes access to resource bundle on all platforms.

Aligns with chrome_main_delegate here: https://chromium-review.googlesource.com/c/chromium/src/+/2619003
2021-06-21 20:46:53 -07:00
David Sanders
98d2824c7f refactor: migrate AdaptCallbackForRepeating to SplitOnceCallback (#29825) 2021-06-21 18:04:31 -07:00
Electron Bot
0e465f1885 Bump v15.0.0-nightly.20210621 2021-06-21 06:01:31 -07:00
marekharanczyk
507cbdc80a fix: do not cancel CORS preflight request on proxy auth. (#29266)
* fix: do not cancel CORS preflight request on proxy auth.

If connecting via proxy, preflight request can receive 407
header response from proxy. This does not mean request
was finished even though it received headers (from proxy,
not the destination server), so prevent "completing"
and most importantly deleting it, which causes request
to be canceled in network layer. Just continue to monitor it
and await proper response from server. Also add circut breaker
to cancel request if proxy auth failed 3 times (for example
user keeps cancelling auth). This behavior happens only
when app registered WebRequest api listeners.

* Port chromium webrequest changes to electron code.

Move relevant parts of chromium WebRequestProxyingURLLoaderFactory from
https://chromium-review.googlesource.com/c/chromium/src/+/2011781
into electron ProxyingURLLoaderFactory.

* Update code to upstreamed version and remove retyr count failsafe.

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-06-21 14:06:52 +09:00
Fedor Indutny
d4a1b41129 fix: microtasks policy in CreateEnvironment (#29531)
* fix: microtasks policy in CreateEnvironment

Microtasks policy should not be updated for the renderer because
`NodeBindings::CreateEnvironment` might be entered with or without
`UvRunOnce()` on stack. One of the examples of such calls is
`window.open()` which is possible to invoke while `uv_run()` is still
running (e.g. with `setImmediate()`).

All in all, it doesn't matter that much which policy we use since
`v8::MicrotasksScope` has a check for the policy in its destructor and
no commits will be made if the policy is `kExplicit`. It is important,
however, to not change the policy in the middle of `UvRunOnce()` so we
should respect whatever we currently have and move on.

Fix: #29463

* Move test to a better place

* Update spec-main/fixtures/crash-cases/setimmediate-window-open-crash/index.html

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* Update spec-main/fixtures/crash-cases/setimmediate-window-open-crash/index.html

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* simplify crash-case

* comment

* fix comment

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Fedor Indutny <indutny@signal.org>
2021-06-21 14:06:17 +09:00
Darshan Sen
cfc846a337 fix: relax app.getLocaleCountryCode() test (#29679)
If the app is run with LC_ALL=C on Linux, the test would fail as
app.getLocaleCountryCode() would return "".

Signed-off-by: Darshan Sen <raisinten@gmail.com>
2021-06-21 14:05:28 +09:00
Samuel Attard
e7ae6edbd4 fix: update Squirel.Mac to fix CPU spin during update (#29791)
* fix: update Squirel.Mac to fix CPU spin during update

Refs: https://github.com/Squirrel/Squirrel.Mac/pull/259
Closes: #29119

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-21 14:02:20 +09:00
David Sanders
8844034fa8 chore: tune-up electron::api::NetLog (#29534) 2021-06-20 18:52:28 -07:00
Erick Zhao
aca14bf7dd docs: fix frontmatter for Tray tutorial (#29788) 2021-06-21 10:13:39 +09:00
Samuel Maddock
ef2ce9dd67 fix: flakey extension bg page test (#29744) 2021-06-21 10:11:40 +09:00
sssooonnnggg
e54667e17e fix: fix hover state not clear bug when BrowserWindow is not resizable (#611) (#29721) 2021-06-21 10:10:40 +09:00
dependabot[bot]
cef4e434cb build(deps-dev): bump ws from 7.2.1 to 7.4.6 in /spec-main (#29421)
Bumps [ws](https://github.com/websockets/ws) from 7.2.1 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.2.1...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-18 14:20:29 -07:00
John Kleinschmidt
58c58c46c4 ci: cleanup electron dirs after running tests on arm (#29769)
* ci: cleanup electron dirs after running tests on arm

(cherry picked from commit 1c0a6045fb)

* use start-stop-daemon to kill Xvfb
2021-06-18 14:35:44 -04:00
Electron Bot
e5aa13e2a4 Bump v15.0.0-nightly.20210618 2021-06-18 06:01:54 -07:00
Shelley Vohr
4450327fda fix: select element not working on Windows (#29742) 2021-06-18 09:05:18 +02:00
Milan Burda
de6696ef1d chore: remove unused and broken ipcRendererInternal.sendTo() (#29743) 2021-06-17 23:26:18 -05:00
John Kleinschmidt
6b4c59b8d8 ci: run linux arm tests on CircleCI (#29714) 2021-06-17 18:38:25 -04:00
Charles Kerr
8ccab4ce91 feat: bring --enable-logging functionality in line with Chromium (#25089)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-06-17 14:17:25 -07:00
Shelley Vohr
c841247815 fix: color select eyedropper not working within DevTools (#29729) 2021-06-17 08:42:51 -05:00
Electron Bot
f00a2d0629 Bump v15.0.0-nightly.20210617 2021-06-17 06:01:15 -07:00
Shelley Vohr
b3daa2d672 chore: fix BoringSSL conflict in patches (#29748) 2021-06-17 13:06:19 +02:00
Shelley Vohr
542abcd6fd chore: bump Node.js to v16.2.0 (#29244) 2021-06-17 08:50:56 +02:00
Erick Zhao
9a7e61cfc0 docs: clarify use of ELECTRON_SKIP_BINARY_DOWNLOAD (#29720) 2021-06-17 15:34:08 +09:00
electron-roller[bot]
85718349cc chore: bump chromium to 93.0.4539.0 (main) (#29608)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-06-16 15:43:51 -07:00
Samuel Attard
f71c6c04fd fix: ensure detached devtools are not always draggable (#29717) 2021-06-16 10:18:02 -07:00
Cheng Zhao
330c3bc136 chore: remove c-style conversion for vibrantView (#29724) 2021-06-16 10:13:42 -07:00
Shelley Vohr
d59e2d7b2e fix: draggable regions with devtools open (#29696) 2021-06-16 09:58:30 -07:00
trop[bot]
6fd9e4280c fix: disable CET as v8 deoptimization is incompatible with it (#29689)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-06-16 09:57:58 -07:00
Electron Bot
7474c59ea0 Bump v15.0.0-nightly.20210616 2021-06-16 06:02:12 -07:00
kdau
226f2a9a56 fix setWindowOpenHandler call syntax (#29551) 2021-06-16 16:16:18 +09:00
Shelley Vohr
2ae7e04598 fix: potential crash when setting vibrancy (#29677) 2021-06-16 15:39:20 +09:00
Samuel Attard
81795744cf fix: ensure the typescript definitions only export correct value types (#28712)
* fix: ensure the typescript definitions only export correct value types

In typescript there are two main types of "types" you can export, value types (class, const) and definition types (type, interface).  The typescript compiler will let anything declared via const or class be used as a value.  Unfortunately we were exporting a bunch of things (see the diff) as class/const when they weren't actually exported values. This lead to typescript being happy but the runtime throwing errors (not something we want).

This change passes "exported-in" context through our docs, to the parser and then to the definitions generator to ensure we only mark things as exported in the ts defs that we actually export.

Fixes #22167

* chore: update typescript-defs

* chore: update typescript-defs

* chore: fix bad typescript in IPC test

* docs: test rendering of new syntax

* chore: update per feedback, use same syntax but with 'this is not exportedd' line
2021-06-15 13:50:31 -07:00
Calvin
18b03db073 chore: bumping NAN dep to include test changes (#29686) 2021-06-15 16:09:39 -04:00
Keeley Hammond
af276c96ec chore: disable default async spellchecker on Windows (#29690)
* chore: disable default async spellchecker on Windows

* chore: disable kWinRetrieveSuggestionsOnlyOnDemand in feature list
2021-06-15 09:11:49 -07:00
Electron Bot
31a4cc26d5 Bump v15.0.0-nightly.20210615 2021-06-15 06:01:55 -07:00
David Sanders
214fcfc46d test: re-enable some skipped tests (#29655)
* test: re-enable some skipped tests

* test: enable more tests
2021-06-15 10:55:08 +09:00
George Xu
f022ead559 docs: added guide and updated docs for Tray (#29385)
* docs: added guide and updated docs for Tray

* docs: improve clarity
2021-06-15 10:34:53 +09:00
Kevin Hartman
3e2ec0e2ce docs: Update represented-file fiddle tutorial (#29245)
* Update represented-file fiddle.

* add index and code back to guide

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
2021-06-15 10:29:51 +09:00
Milan Burda
56ac67e059 refactor: use std::make_unique/base::MakeRefCounted when possible (#29637) 2021-06-15 09:37:55 +09:00
Jeremy Rose
ebf54d7cc0 refactor: use PathProvider for user-data-dir and others (#29649)
* refactor: use PathProvider for user-data-dir and others

* consolidate logic for DIR_RECENT and DIR_APP_LOGS into path provider

* fix bad include

* remove debugging code

* fix build on mac

* fix build on win

* create app logs dir on both mac and non-mac
2021-06-15 09:32:56 +09:00
Samuel Attard
8b945cb296 build: restore workspace on osx builds to get docs-only-change file (#29465)
* build: restore workspace on osx builds to get docs-only-change file

* build: clean up attached workspace before checking out from cache
2021-06-14 12:20:59 -07:00
David Sanders
7019713126 docs: use relative links within docs (#29651) 2021-06-14 14:02:23 -05:00
Luke Ingalls
86ff4a9836 docs: fix typo in process-model.md (#29563) 2021-06-14 11:33:07 -04:00
Darshan Sen
cc04450b85 docs: fix file mode of versioning-sketch-2.png (#29609)
Unlike the other files, this file had its executable bit set in its file
mode. This change removes the executable bit to align its file mode with
the rest of the files.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
2021-06-14 11:28:01 -04:00
Electron Bot
0b10c865d3 Bump v15.0.0-nightly.20210614 2021-06-14 06:01:21 -07:00
David Sanders
8d76b4ded1 chore: use consistent integer type for request ID (#29540) 2021-06-14 21:01:36 +09:00
Darshan Sen
4b9e804b82 refactor: use locale functions in command_line_args.cc (#29550)
This change refactors the code to use isalpha() and
isspace() so that the code is more readable.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
2021-06-14 21:01:00 +09:00
Jeremy Rose
34a4e26b24 fix: check DCHECK_IS_ON() instead of #ifdef DCHECK_IS_ON (#29620) 2021-06-14 11:06:09 +09:00
David Sanders
fed5ad5303 fix: use correct spelling of attachment with Content-Disposition header (#29621) 2021-06-14 11:05:16 +09:00
David Sanders
f6d673c32a chore: use HTTP method constants (#29650) 2021-06-14 11:04:36 +09:00
David Sanders
e8c9a814d6 fix: copy received data in URLPipeLoader to prevent corruption (#29567) 2021-06-14 10:18:52 +09:00
Electron Bot
af7181b93f Bump v15.0.0-nightly.20210611 2021-06-11 06:01:09 -07:00
Darshan Sen
9b99bdb570 docs: fix image links in performance.md (#29592)
* docs: fix image links in performance.md

Fixes https://github.com/electron/electron/issues/29580

Signed-off-by: Darshan Sen <raisinten@gmail.com>

* Apply suggestions from code review

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-10 12:44:04 -05:00
Electron Bot
057b15f7bb Bump v15.0.0-nightly.20210610 2021-06-10 06:01:21 -07:00
Shelley Vohr
63cc82d91d fix: ensure custom traffic lights float to top (#29595)
* fix: ensure custom traffic lights float to top

* chore: split into separate function
2021-06-10 14:52:23 +02:00
Samuel Attard
73266f8f3d fix: ensure fuse order is read in a stable way (#29599) 2021-06-09 08:30:02 -07:00
Electron Bot
5f2e25b0b2 Bump v15.0.0-nightly.20210609 2021-06-09 08:29:41 -07:00
Samuel Attard
fa0323a3db fix: Revert "fix: don't propagate GDK_BACKEND to subprocs (#28898)" (#29610)
This reverts commit 7b169c2884.
2021-06-09 08:28:52 -07:00
Samuel Attard
c252deb878 Revert "Bump v15.0.0-nightly.20210609"
This reverts commit c9ccd136a8.
2021-06-09 08:28:12 -07:00
John Kleinschmidt
396ea4b29c fix: select-bluetooth-device on Windows (#29591) 2021-06-09 10:48:18 -04:00
Electron Bot
c9ccd136a8 Bump v15.0.0-nightly.20210609 2021-06-09 06:01:09 -07:00
electron-roller[bot]
04679121d6 chore: bump chromium to 93.0.4536.0 (main) (#29586)
* chore: bump chromium in DEPS to 93.0.4536.0

* chore: update patches

* [2918475] Make InkDrop a View class property

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2918475

Replace old views::Button::ink_drop() calls with views::InkDrop::Get()

* [2935942] Convert use of gfx::ImageSkia to ui::ImageModel for WidgetDelegates

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2935942

Update GetWindowIcon(), GetWindowAppIcon(), and GetDevToolsWindowIcon()
to return ui::ImageModel instead of gfx::ImageSkia.

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-06-08 15:22:43 -05:00
Shelley Vohr
7b169c2884 fix: don't propagate GDK_BACKEND to subprocs (#28898) 2021-06-08 16:10:27 +02:00
Electron Bot
b27c5b94f7 Bump v15.0.0-nightly.20210608 2021-06-08 06:00:58 -07:00
ZReC
330b7849a3 docs: fix typo (#29553)
* Typo fix

* Update main.js
2021-06-08 11:45:45 +09:00
John Kleinschmidt
556c91a989 ci: save artifacts before cleaning up big things on macOS (#29578) 2021-06-07 22:02:21 -04:00
Samuel Attard
8446ce1fc7 feat: add new imageAnimationPolicy webpref and webContents setter (#29095) 2021-06-08 11:00:22 +09:00
David Sanders
79cb5144ae chore: use std::make_unique/base::MakeRefCounted when possible (#29510) 2021-06-08 11:00:05 +09:00
Shelley Vohr
a4decffe9a fix: improper wrapping of fs.promises.readFile (#29528) 2021-06-07 21:19:39 +02:00
electron-roller[bot]
5665738ceb chore: bump chromium to 93.0.4535.0 (main) (#29549)
* chore: bump chromium in DEPS to 93.0.4533.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4534.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4535.0

* chore: remove PdfViewerDocumentProperties from feature-flag conditional

https://chromium-review.googlesource.com/c/chromium/src/+/2938363

This feature is now enabled by default upstream.

* chore: remove kPdfViewerPresentationMode from feature-flag conditional

https://chromium-review.googlesource.com/c/chromium/src/+/2938037

This feature is now enabled by default upstream.

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-06-07 14:09:41 -05:00
Samuel Attard
c48ec133a5 build: remove individual release build workflows (#29344)
* build: remove individual release build workflows

* build: ensure even builds we do not want to run have at least one step
2021-06-07 10:17:27 -04:00
David Sanders
070f25db54 fix: make intermediates work with 'select-client-certificate' (#29552) 2021-06-07 06:40:43 -07:00
Electron Bot
c5b0ba0c01 Bump v15.0.0-nightly.20210607 2021-06-07 06:02:04 -07:00
Jeremy Foster
fc10b53f95 docs: Update notifications (renderer) docs (#29267)
* remove version information from html

* change format for readability

* clarify which console the message should appear in

* minor changes to renderer.md

* update UI on click instead of developer console

* remove node-integration and fix md

* update content

* chore: remove ****

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-06-07 13:02:20 +09:00
Kevin Hartman
dd98fa3cd3 docs: Updated "recent documents" fiddle tutorial (#29242)
* Port recent-documents fiddle to 12-x-y.

* Update recent-documents tutorial.

* update for review comments

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
2021-06-07 10:43:24 +09:00
David Sanders
1a30f9f974 chore: update base class name in comment (#29512) 2021-06-07 10:18:17 +09:00
electron-roller[bot]
fa2db00e55 chore: bump chromium to 93.0.4532.2 (main) (#29527)
* chore: bump chromium in DEPS to 93.0.4531.0

* chore: update patches

* Remove IPC::Listener from WebContentsObserver

https://chromium-review.googlesource.com/c/chromium/src/+/2910240

* serial: Move serial policy from profile to local state

https://chromium-review.googlesource.com/c/chromium/src/+/2914194

* chore: fix pip test

* chore: bump chromium in DEPS to 93.0.4532.2

* chore: update patches

* Follow up ColorChooser clean ups

https://chromium-review.googlesource.com/c/chromium/src/+/2928026

* Distinguish between no default printer vs. query error

https://chromium-review.googlesource.com/c/chromium/src/+/2932396

* chore: remove build_do_not_include_vr_directx_helpers_when_enable_vr.patch

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-06-04 19:03:31 -07:00
Electron Bot
1c0e8a65c4 Bump v15.0.0-nightly.20210604 2021-06-04 06:01:20 -07:00
David Sanders
79ae8b427c chore: return early on promise rejection (#29279) 2021-06-04 13:21:02 +09:00
David Sanders
8e1176cbc0 chore: pull ProxyingURLLoaderFactory closer to upstream class it mirrors (#29486)
* chore: pull ProxyingURLLoaderFactory closer to upstream class it mirrors

* chore: add another change which was accepted upstream
2021-06-04 13:18:02 +09:00
David Sanders
81c5da5221 chore: use =default for default constructors/destructors (#29511) 2021-06-04 13:16:13 +09:00
David Sanders
b1d1ac6524 fix: change ASAR archive cache to per-process to fix leak (#29293)
* fix: change ASAR archive cache to per-process to fix leak (#29292)

* chore: address code review comments

* chore: tighten up thread-safety

* chore: better address code review comments

* chore: more code review changes
2021-06-04 10:49:08 +09:00
Milan Burda
00693bab30 refactor: use auto env = base::Environment::Create(); everywhere (#29502) 2021-06-04 09:23:06 +09:00
Electron Bot
5929d6335f Bump v15.0.0-nightly.20210603 2021-06-03 09:50:54 -07:00
Jeremy Rose
b79fc79a01 docs: remove devDependencies badge from README (#29499) 2021-06-03 09:44:48 -07:00
electron-roller[bot]
8532e1239e chore: bump chromium to 93.0.4530.0 (master) (#29256)
* chore: bump chromium in DEPS to 92.0.4512.6

* 2887336: [CaptureHandle][#2] Propagate CaptureHandleConfig in browser process

https://chromium-review.googlesource.com/c/chromium/src/+/2887336

* refactor: base::Optional -> absl::optional

* chore: fixup patch indices

* chore: bump chromium in DEPS to 92.0.4514.0

* 2899417: Make build work when enable_pdf is set to false.

https://chromium-review.googlesource.com/c/chromium/src/+/2899417

* 2904731: use BrowserContext instead of Profile in PreconnectManager

https://chromium-review.googlesource.com/c/chromium/src/+/2904731

* 2295749: fix: check IsSecureEventInputEnabled in constructor before setting SetPasswordInputEnabled to true

https://chromium-review.googlesource.com/c/chromium/src/+/2295749

* 2893803: Add a GetWebView to RenderFrame.

https://chromium-review.googlesource.com/c/chromium/src/+/2893803

* 2892345: Implement WebContents::ForEachRenderFrameHost

https://chromium-review.googlesource.com/c/chromium/src/+/2892345

* chore: fixup patch indices

* 2892048: Real instance methods for BrowserContext: remaining 5 methods.

https://chromium-review.googlesource.com/c/chromium/src/+/2892048

* 2902821: [mojo] Don't require full header includes for referenced interfaces

https://chromium-review.googlesource.com/c/chromium/src/+/2902821

* 2496500: Remove last deprecated extension Event ctor.

https://chromium-review.googlesource.com/c/chromium/src/+/2496500

* chore: fixup malformed pepper support patch

* chore: bump chromium in DEPS to 92.0.4515.0

* 2908461: Add CreateEmptyPrintPagesParamsPtr() inside print_view_manager_base.cc.

https://chromium-review.googlesource.com/c/chromium/src/+/2908461

* 2880838: viz: add optional HDRMetadata to TransferableResource

https://chromium-review.googlesource.com/c/chromium/src/+/2880838

* chore: fixup patch indices

* chore: bump chromium in DEPS to 92.0.4515.5

* chore: update patches

* chore: bump chromium in DEPS to 92.0.4515.7

* chore: bump chromium in DEPS to 92.0.4515.9

* chore: bump chromium in DEPS to 93.0.4522.0

* chore: bump chromium in DEPS to 93.0.4523.0

* chore: bump chromium in DEPS to 93.0.4524.0

* chore: update patches

* chore: enable_pak_file_integrity_checks was reverted

* chore: update patches

* refactor: base/optional was replaced with absl::optional

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202

* refactor: replace all usages of base::nullopt with absl::nullopt

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202

* chore: add missing base::Contains include

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202

* refactor: replace all usages of base::make_optional with
absl::make_optional

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202

* refactor: replace WorldScriptContext() with GetScriptContextFromWorldId

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2893213

* chore: clean up left over opening namespace

Refs: 95bfe6d08f

* chore: add missing base::Contains include

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202

* refactor: replace GetCurrentDisplayIterator with the hard checker
GetCurrentDisplay

This code looks suspicious but if the iterator was invalid before it
will also be invalid now.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2893191

* refactor: headers are now passed directly in extensions client

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2918906

* refactor: base::DictionaryValue::empty() has been removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2912424

* chore: add missing includes for network URLLoaderFactory

Refs: unknown, probably a side effect of header changes

* refactor: make convenience wrapper around AppendArg

There is no converter FromV8 for base::StringPiece (apparently its not
possible).  So we now take in an std::string and use the construct for
StringPiece to do implicit conversion.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2905544

* chore: add patch

* chore: bump chromium in DEPS to 93.0.4525.0

* chore: update patches

* refactor: CanResize has been de-virtualized

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2485774

* chore: update resource integrity patch

* chore: add character encoding idl patch

* chore: bump chromium in DEPS to 93.0.4526.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4527.0

* chore: bump chromium in DEPS to 93.0.4528.0

* chore: update patches

* chore: update idl encoding patch

* chore: bump chromium in DEPS to 93.0.4529.0

* chore: update patches

* chore: bump chromium in DEPS to 93.0.4530.0

* chore: update patches

* fix: only SetCanResize after the widget has been initialized

* chore: add patch for vr on windows gn gen

* spec: fix focus related tests on linux due to delay in focus swap

* chore: remove new usages of base::Optional from main

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-06-03 01:05:04 -07:00
Milan Burda
8d0ed05c99 refactor: replace a few usages of V8 hidden properties (#29400) 2021-06-03 14:59:56 +09:00
David Sanders
bb6903543c docs: link to IncomingMessage (#29457) 2021-06-03 14:54:33 +09:00
Juan Cruz Viotti
d6d9a6a039 build: Improve squirrel.mac BUILD.gn xcrun_action error (#29448)
Right now, if executing `xcrun` fails, then the error message prints the
second argument to the `xcrun.py` script, which is the first argument to
the tool that `xcrun` is executing, making the whole error message quite
confusing.

Consider the following error:

```
python ../../third_party/squirrel.mac/build/xcrun.py dtrace -h -s /private/tmp/20210531211008-def376dc/src/third_party/squirrel.mac/vendor/ReactiveObjC/ReactiveObjC/RACSignalProvider.d -o /private/tmp/20210531211008-def376dc/src/out/release/gen/third_party/squirrel.mac/dtrace/RACSignalProvider.h
xcrun script '-h' failed with code '71':
xcrun: error: can't exec '/tmp/20210531211008-def376dc/dtrace' (errno=Permission denied)
```

The command that `xcrun` is executing is `dtrace`, but the error just
mentions the `-h` flag.

Notes: none
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2021-06-03 14:54:16 +09:00
Milan Burda
8040cb788f test: add spec for --require filtering in NODE_OPTIONS (#29501) 2021-06-03 14:46:44 +09:00
Keeley Hammond
d8d6e2ebc0 build: update support.md on stable version bumps (#29381)
* build: update support.md on stable version bumps

* build: update supported on major stable & nightly bumps

* test: updateSupported tests

* chore: fix syntax

* chore: use fspromise in version-bumper script/spec
2021-06-02 12:53:23 -07:00
Jeremy Rose
8ce63a9f18 refactor: point prepare-release at main (#29394) 2021-06-02 12:21:20 -07:00
Milan Burda
44491b023a refactor: eliminate duplicate C++ / JavaScript implementation of app.isPackaged (#29464) 2021-06-02 12:17:08 -07:00
Electron Bot
f0d3e1d1cf Bump v15.0.0-nightly.20210602 2021-06-02 06:03:17 -07:00
David Sanders
97fde6dc9c build: fix macOS build (#29484) 2021-06-02 19:42:07 +09:00
Cheng Zhao
3cfe5c6a21 fix: keep shifted character in menu accelerator (#29202)
* fix: correctly handle shifted char in accelerator

* test: use actual accelerator of NSMenuItem

* chore: simplify KeyboardCodeFromStr

* chore: GetAcceleratorTextAt is testing only
2021-06-02 16:32:48 +09:00
David Sanders
31190d4c6d chore: use static_cast rather than C-style cast (#29467) 2021-06-02 00:32:10 -07:00
David Sanders
cb59bab8cf chore: don't use after move (#29468) 2021-06-02 00:31:25 -07:00
Juan Cruz Viotti
f9213faec5 build: support building Electron on msys2 (#29449)
Electron already seems to support `cygwin`, so `msys` is a natural
addition. This is the only required change as far as I can see on my
local development environment, as otherwise the build scripts don't
realize that msys = windows.

Notes: none
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2021-06-02 16:29:19 +09:00
Shelley Vohr
d6109b2eb4 chore: remove unused methods (#29438) 2021-06-02 16:27:45 +09:00
Sergio Padrino
abf6f5c8ba feat: add new runningUnderARM64Translation property to detect x64 translated apps running on Windows ARM (#29168)
* feat: add new runningUnderARM64Translation property to detect x64 translated apps running on Windows ARM

* docs: add documentation for the new runningUnderARM64Translation property

* refactor: clean up `IsRunningUnderARM64Translation` Windows implementation

* Return false if IsWow64Process2 doesn't exist

* Emit deprecation warning in runningUnderRosettaTranslation
2021-06-02 16:16:33 +09:00
Shelley Vohr
3b75549511 fix: inspector context menu throwing an error (#29436) 2021-06-01 20:39:48 -07:00
Jeremy Foster
dee4c4b908 docs: Updated "progress bar" fiddle feature in docs (#29237)
* improve progress bar fiddle

* add comments to code snippet

* edits to progress-bar tutorial

* remove versions and nodeIntegration

* limit line length to 100

* implement standard linter suggestions

* add indeterminate and clear timers

* update to have reader replace all of main.js

* remove extra button

* loop the progress bar

* add logic to show reset state briefly

* Update docs/tutorial/progress-bar.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* chore: fix lint

Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-06-02 11:41:13 +09:00
Samuel Maddock
f9d2a7077e feat: include resize edge with will-resize event (#29199)
* feat: emit resize edge with will-resize event

fix: wparam type

fix: private member usage on mac

docs: will-resize event edge option

refactor: 'info' -> 'details' for better type gen

* Update docs/api/browser-window.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* Update docs/api/browser-window.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-06-02 11:37:10 +09:00
Jeremy Rose
750a762bf0 feat: support loading debug urls with loadURL() (#29404) 2021-06-01 17:17:15 -07:00
Electron Bot
fa703016f0 Bump v15.0.0-nightly.20210601 2021-06-01 06:02:35 -07:00
David Sanders
a1a649c0d6 chore: remove duplicate option get for CustomScheme (#29422) 2021-06-01 17:47:12 +09:00
Cheng Zhao
0444d74830 fix: Alt+Click should not toggle menu bar (#29318) 2021-06-01 17:42:47 +09:00
Pete Torres
19dce8caa5 docs: adjust markdown link syntax in introduction.md (#29426)
Co-authored-by: peteness <hello@peteness.org>
2021-06-01 09:32:50 +02:00
David Sanders
80a039ec40 chore: move destructors to header so they can be trivially destructible (#29379) 2021-05-31 21:00:09 -07:00
Cheng Zhao
d74ad51826 fix: correctly handle Alt+Key shortcuts (#29328) 2021-06-01 10:48:52 +09:00
David Sanders
0208e4adad chore: use HTTP status code constants (#29378) 2021-06-01 10:47:53 +09:00
David Sanders
ba26580f23 chore: use consistent parameter names (#29361) 2021-06-01 10:46:25 +09:00
David Sanders
d18dbdd72b fix: add service worker schemes from command line in renderer (#29425) 2021-06-01 10:45:23 +09:00
David Sanders
038359a7d8 chore: fix typos in comments (#29401) 2021-06-01 10:42:38 +09:00
David Sanders
93c9374e95 chore: trim unused STL includes (#29414) 2021-06-01 10:34:44 +09:00
Samuel Attard
71fff6ea0e build: merge chromedriver gen and build (#29439) 2021-05-31 16:20:40 -07:00
Electron Bot
73adee6d53 Bump v15.0.0-nightly.20210531 2021-05-31 06:05:57 -07:00
dependabot[bot]
646b79470a build(deps-dev): bump ws from 6.2.1 to 7.4.6 in /spec (#29416)
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/6.2.1...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-31 11:53:07 +02:00
Vishal
049d81e590 docs: fix issue with reference links (#29384) 2021-05-31 11:52:44 +02:00
Jeremy Rose
95bb0ba001 fix: use default_branch in release-notes (#29415) 2021-05-30 17:22:33 -07:00
Jeremy Rose
750ebfdbca refactor: use main in release-notes (#29395) 2021-05-28 12:14:50 -07:00
Jeremy Rose
a61f1446bc refactor: publish-to-npm respects main (#29375) 2021-05-28 12:13:12 -07:00
Electron Bot
221d4abca4 Bump v15.0.0-nightly.20210528 2021-05-28 06:01:45 -07:00
David Sanders
bedd587784 docs: update link to Chromium's coding style guide (#29330) 2021-05-27 19:07:46 -07:00
Jeremy Rose
1373a030b4 refactor: version-utils respects main (#29374) 2021-05-27 17:32:37 -07:00
Jeremy Rose
f664f37793 refactor: getCurrentBranch respects main (#29369) 2021-05-27 17:32:16 -07:00
Jeremy Rose
f3dff819fc docs: remove freenode channel from support list (#29370) 2021-05-27 15:53:39 -07:00
David Sanders
d80e36bcdb chore: simplify WrappableBase::SecondWeakCallback (#29359) 2021-05-27 13:15:25 -07:00
David Sanders
9bb7051f54 chore: prefer empty() check for readability (#29360) 2021-05-27 13:08:30 -07:00
David Sanders
77ecc7d432 chore: fix typos in comments (#29362) 2021-05-27 11:48:03 -07:00
aydon
9fcdb06272 Update quick-start.md (#29333)
In version 13.0.1 preload process should added to webPreferences.
2021-05-27 11:46:32 -07:00
Electron Bot
cc93b8acc0 Bump v15.0.0-nightly.20210527 2021-05-27 11:06:31 -07:00
Jeremy Foster
5e033cb7f8 docs: Update notifications (main) docs (#29268)
* remove version info from index.html page

* remove nodeIntegration

* format code and update readme

* add note to user in index.html
2021-05-27 10:18:50 +09:00
David Sanders
36bca3278d docs: fix typos in clang-tidy examples (#29327) 2021-05-27 09:45:37 +09:00
Erick Zhao
bb26060564 docs: fix link to docs/fiddle/quick-start (#29325) 2021-05-27 09:45:23 +09:00
Cheng Zhao
acce13234e fix: close autoHide menu bar when focus is lost (#29320) 2021-05-27 09:36:15 +09:00
George Xu
386572bb86 Chore: update Windows build instructions (#29342)
update "Change" to "Modify" to reflect the actual options the user sees when opening visual studio installer
2021-05-26 14:19:43 -07:00
Samuel Attard
7984933e9c feat: add experimental cookie encryption support (#27524)
* feat: add experimental cookie encryption support on macOS

* chore: fix TODO

* update patches

* feat: make cookie encryption work on windows

* chore: update cookie encryption support comments

* fix: only call OSCrypt::Init on windows

* chore: make cookie encryption work on linux

* Update shell/browser/net/system_network_context_manager.cc

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* chore: fix lint

* chore: update patches

* chore: update patches to upstreamed variants

* chore: use chrome ::switches constants

* chore: remove bad patch

* build: disable cookie encryption by default

* chore: update patches

* fix: provide std::string to NoDestructor

* chore: fix macos, nodestructor syntax

* build: fix macOS build due to mismatch in DEFINE

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-05-26 12:16:55 -07:00
Samuel Attard
f01e35f4ea feat: add support for Blob's going over the ctx bridge (#29247) 2021-05-26 10:34:29 -07:00
419 changed files with 4394 additions and 3698 deletions

View File

@@ -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:

View File

@@ -22,5 +22,8 @@
"no-trailing-spaces": {
"br_spaces": 0
},
"single-h1": false
"single-h1": false,
"no-inline-html": {
"allowed_elements": ["br"]
}
}

2
DEPS
View File

@@ -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

View File

@@ -1 +1 @@
14.0.0-beta.17
15.0.0-alpha.2

View File

@@ -2,7 +2,6 @@
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/master.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/master)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/master)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.com/invite/electron)
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.

View File

@@ -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'

View File

@@ -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',

View File

@@ -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));
}

View File

@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
#define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
#include <map>
#include <memory>
#include <string>

View File

@@ -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"

View File

@@ -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_));

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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].

View File

@@ -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.

View File

@@ -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.

View File

@@ -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`.

View File

@@ -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.

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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].

View File

@@ -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`

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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`.

View File

@@ -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:

View 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.

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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()`

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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)`

View File

@@ -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`

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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', '*')
```

View File

@@ -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

View File

@@ -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.

View File

@@ -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')

View File

@@ -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

View File

@@ -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`.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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",
]

View File

@@ -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;

View File

@@ -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 || (() => {});

View File

@@ -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,

View File

@@ -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.

View File

@@ -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);

View File

@@ -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',

View File

@@ -1,4 +1,3 @@
/* eslint no-eval: "off" */
/* global binding */
import * as events from 'events';
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';

View File

@@ -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);

View File

@@ -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",

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 {

View File

@@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP.
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..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)

View File

@@ -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]

View File

@@ -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]

View File

@@ -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();

View File

@@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
of this.
diff --git a/lib/internal/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.

View File

@@ -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');

View File

@@ -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',
}],

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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() {
}
}

View File

@@ -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,

View File

@@ -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"', {

View File

@@ -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'],
}],

View File

@@ -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().

View File

@@ -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

View File

@@ -7,10 +7,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
This API is used by Electron to create Node's tracing controller.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 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,

View File

@@ -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

View File

@@ -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');
});

View File

@@ -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(),

View File

@@ -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

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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;
};

View File

@@ -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))

View File

@@ -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;

View File

@@ -7,10 +7,10 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 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 };

View File

@@ -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');
}

View File

@@ -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