Граф коммитов

23599 Коммитов

Автор SHA1 Сообщение Дата
Samuel Attard 8bc5d171a0
chore: use new NMV of 69. Refs: https://github.com/nodejs/TSC/issues/651 2019-01-31 14:31:34 -08:00
Andy Dill 4d44266b78 fix: use zlib from electron_node (#75) 2018-10-16 09:36:01 -07:00
Jeremy Apthorp 3349ef049f
fix: export napi symbols (#77)
matches the change in node.h in 88b494191c, both are necessary because Chromium builds with symbols hidden by default
2018-10-15 15:15:58 -07:00
Shelley Vohr 3bcbfdff69
fix: remove NODE_WITHOUT_NODE_OPTIONS (#76) 2018-10-15 07:50:37 -07:00
Jeremy Apthorp f14ddf9d7e fix: export libuv symbols (#73)
Closes electron/electron#15075
2018-10-12 10:24:57 +11:00
Andy Dill 42ddb00775 fix: include names.h in zlib header package (#74) 2018-10-11 16:19:08 -07:00
Samuel Attard 5654c276d0 fix: fix the patch that adds the build_v8_with_gn variable for node < 10 support 2018-10-11 13:10:12 +11:00
Samuel Attard 78e956e08a chore: remove logging from tar.py 2018-10-11 13:09:47 +11:00
Andreas Haas 5331c9dc72 src: initialize PerIsolateData eagerly
PR-URL: https://github.com/nodejs/node/pull/21983
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-10-06 00:26:40 +05:30
deepak1556 c5042a210d Revert "fix: Allow creation and registration of isolates before they are"
This reverts commit 5cd9a43505d67a89af181f9ff7f4a955f9625893.
2018-10-06 00:14:38 +05:30
Samuel Attard cd67eb1d4c fix: Allow creation and registration of isolates before they are
initialized

At the moment in node, isolates are allocated and initialized in a
single step.  Directly after that step the IsolateData* is initialized
which instantly attempts to use the isolate and registers the isolate
data on the node platform.

One of those two things is good, we need to register the IsolateData
on the platform but we we don't want the isolate to be used.

In gin (chromium) the isolate creation is split up into two steps,
allocation and initialization.  Chrome wants a task runner to be
obtainable from the platform after allocation but before initialization.
In order for this to work the IsolateData* needs to be registered with
the platform so we need this patch to allow us to control usage of the
Isolate inside IsolateData so we can register the IsolateData manually
and be responsible for setting up private properties after the isolate
is initialized.

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

Note: This is a pretty hefty patch and I'd love to reduce it at some
point, it has counterparts in both Electron and Electron's gin patches.
2018-10-05 09:53:36 -07:00
Jeremy Apthorp 4535a605b2 inspector generator paths changed 2018-10-05 09:53:36 -07:00
Jeremy Apthorp bcb351aed8 EmbedderGraph::AddEdge now takes a name
https://chromium-review.googlesource.com/1133299
2018-10-05 09:53:36 -07:00
Samuel Attard 18a9880b70
fix: tar.py is somehow broken 2018-10-04 10:08:23 +10:00
Samuel Attard 2297d0c115
gn: generate header tar.gz file as part of gn headers target 2018-10-04 08:54:23 +10:00
Jeremy Apthorp a7fb6742d8 export Environment::kNodeContextTagPtr 2018-10-02 17:09:15 -07:00
Shelley Vohr e4758e5ed5 feat: add flags for low-level hooks and exceptions
This commit adds two new exposed methods to `node.cc`, `InitGeneric` and
`LoadEnvironmentGeneric` that allow for control of which mode Node
should run, which i have called `standalone_mode` and
`upstream_node_mode`. Default behavior of `Init` and `LoadEnvironment`
remain the same.

We have 3 modes when running Node in Electron:
1. In the main process, we want to have a full Node environment, but
with signal handlers and other low level things disabled
2. In renderer process, we want Node to reuse the web page's context
3. In `ELECTRON_RUN_AS_NODE`, we want Node to run as it runs officially
by default

For modes 1 and 3, we have Node create a new V8 context with a Node
Environment on it. However, for mode 2, since the V8 context is created
by blink for web frames and web workers we make Node create the Node
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.
2018-10-02 17:00:53 -07:00
Shelley Vohr 2a26a8c73c
feat: add new built_with_electron variable to config.gypi 2018-10-02 11:39:58 -07:00
Jeremy Apthorp d687ba7436
build: automatically generate some file lists that the GN build uses 2018-10-02 11:36:13 -07:00
Jeremy Apthorp d621ca7061
fix: export DebugOptions parser in a cross-platform-compatible way 2018-10-02 11:36:13 -07:00
Jeremy Apthorp 0fee0c1f39
fix: microsoft-goto warning w/ clang-cl
see nodejs/node#22961
2018-10-02 11:36:13 -07:00
Jeremy Apthorp f34104ac94
fix: extern template classes shouldn't be dllexported 2018-10-02 11:36:13 -07:00
Jeremy Apthorp f92c965ca2
fix: add a default value for the 'enable_lto' variable in common.gypi 2018-10-02 11:36:13 -07:00
Samuel Attard 8aaf952450
Update node_headers target in GN 2018-10-02 11:36:13 -07:00
Jeremy Apthorp b7d1da6b37
fix: export DebugOptions 2018-10-02 11:36:13 -07:00
Jeremy Apthorp 458779ec66
fix: atom_common_asar is a builtin, not an internal 2018-10-02 11:36:13 -07:00
Jeremy Apthorp 39e2e31d82
fix: remove OCB support when OPENSSL_NO_OCB is defined
BoringSSL doesn't support OCB.
2018-10-02 11:36:13 -07:00
Gabriel Charette 59a15b1445
backport: src: use modern v8::Platform worker threads APIs
Precursor to removing deprecated APIs on the v8 side @
https://chromium-review.googlesource.com/c/v8/v8/+/1045310

PR-URL: https://github.com/nodejs/node/pull/21079
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
(cherry-picked from 0f3c2c64d2)
2018-10-02 11:36:13 -07:00
Jeremy Apthorp 86c6016250
fix: trace_event_categories moved to per_process_opts 2018-10-02 11:36:13 -07:00
Jeremy Apthorp 107c4455dc
fix: StartInspector now takes a shared_ptr to DebugOptions 2018-10-02 11:36:13 -07:00
Jeremy Apthorp 88b494191c
build: add GN build files 2018-10-02 11:36:13 -07:00
Shelley Vohr db067ff376
fix: enable auto cert chaining to match OpenSSL behaviour 2018-10-02 11:36:13 -07:00
Shelley Vohr e66aa775ee
fix: allocate memory of Buffer with V8's allocator
Blink overrides ArrayBuffer's allocator with its own one, while Node
simply uses malloc and free. This commit prevents the crash that would
be resultant of mixing them together.
2018-10-02 11:36:13 -07:00
Shelley Vohr 10df34b2bb
fix: patch js2c.py to give the right name to config_gypi 2018-10-02 11:36:13 -07:00
Cheng Zhao e4f98b45dc
fix: do not use external string as keys (#42)
blink can not recognize external strings from Node, and it will crash
when encountered one, for example executing `window.string_decoder`.

Note that the values are still using external strings, but making them
normal string may have negative affects on performance, and it is very
unlikely they would be passed to blink.
2018-10-02 11:36:13 -07:00
deepak1556 bb756c7749
fix: expose InternalCallbackScope
This commit exposes InternalCallbackScope in order to allow us access to kAllowEmptyResource for usage https://github.com/electron/electron/blob/master/atom/common/api/atom_bindings.cc\#L108. We should look to accomplish this another way so we no longer need to do this, as in verbose mode the regular CallBack Scope doesn't swallow errors and so we can otherwise use it.
2018-10-02 11:36:13 -07:00
Shelley Vohr d191ff485e
FIXME: use redefined version of internalModuleStat
Instantiate redefined version of the internalModuleStat function
(see lib/common/asar.js in the electron/electron repo). For some reason
this has to be done after the upgrade to the Node.js v8.7.0. `const
internalModuleStat` in the very beginning of the file holds a reference
to a native Node.js implementation of the function.
2018-10-02 11:36:13 -07:00
Shelley Vohr b2a01141fd
FIXME: remove async_id assertion check 2018-10-02 11:36:13 -07:00
Shelley Vohr 5a903b71f8
fix: build and expose inspector agent
Node inspector initialization happens in a different start-up function in node.cc, which we don't call in Electron. This allows for us to use the inspector agent in electron/atom/browser/node_debugger.cc
2018-10-02 11:36:13 -07:00
Shelley Vohr 105c63b0db
fix: expose TraceEventHelper
Node required tracing controller to be initialized, otherwise a crash would occur. Changed in concert with 0e5b6f9300\#diff-0cdfa12fff513e022fac830c6af9c19a
2018-10-02 11:36:13 -07:00
Shelley Vohr 6ce4fdc7c5
fix: avoid exposing trace_event.h to prevent include conflicts
We include node_internals.h as a part of node_includes.h in electron, so we run into conflicts with trace headers from chromium. To mitigate that, we removed trace_event.h from node_internals.h and just added it to the required places in node.
2018-10-02 11:36:13 -07:00
Thiago de Arruda 050f40fbe1
Expose `get_builtin_module` function
This is a requirement for electron/electron#8815, which exposes some builtin
modules to sandboxed renderers.

(cherry picked from commit 4c058a6cb5331eef1c7f51c042dd074a2d4f9234)
2018-10-02 11:36:13 -07:00
Kevin Sawicki 9ee6f49304
Call process.log from fallback stream on Windows
(cherry picked from commit d31e629b4f2daf3500a485caab2b2990a41e3ad4)
2018-10-02 11:36:13 -07:00
Cheng Zhao 114335d106
Export NativeModule
This is used by atom for doing module compile cache.

(cherry picked from commit 83b45fddb9a36c1376f7a2b5c70717e37b6f0133)
2018-10-02 11:36:13 -07:00
Cheng Zhao bbab795813
Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
2018-10-02 11:36:13 -07:00
Shelley Vohr 3749292669
fix: create dummy stream if failure to create stdout
On Windows, if code accesses process.stdin an exception will happen because there is no stdin pipe in GUI programs on Windows. This commit fixes that issue by creating a dummy stream
2018-10-02 11:36:13 -07:00
Shelley Vohr 24b1a8290b
feat: initialize asar support 2018-10-02 11:36:13 -07:00
Shelley Vohr a5bd5d5407
feat: add uv_loop watcher_queue code
Electron's Node Integration works by listening to Node's backend file descriptor in a separate thread; when an event is ready the backend file descriptor will trigger a new event for it, and the main thread will then iterate the libuv loop. For certain operations (ex. adding a timeout task) the backend file descriptor isn't informed, & as a result the main thread doesn't know it needs to iterate the libuv loop so the timeout task will never execute until something else trigger a new event. This commit should be removed when https://github.com/libuv/libuv/pull/1921 is merged
2018-10-02 11:36:13 -07:00
Shelley Vohr c798ba1b7d
refactor: alter child_process.fork to use execute script with Electron
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.
2018-10-02 11:36:13 -07:00
Shelley Vohr 8ba653c77b
fix: don't create console window when creating process
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes https://github.com/nodejs/node/pull/21316
2018-10-02 11:36:13 -07:00