New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: improve embedder API #30467
src: improve embedder API #30467
Commits on Mar 12, 2020
-
src: make
FreeEnvironment()
perform all necessary cleanupMake the calls `stop_sub_worker_contexts()`, `RunCleanup()` part of the public API for easier embedding. (Note that calling `RunAtExit()` is idempotent because the at-exit callback queue is cleared after each call.)
Configuration menu - View commit details
-
Copy full SHA for b6738bc - Browse repository at this point
Copy the full SHA b6738bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e2da59 - Browse repository at this point
Copy the full SHA 7e2da59View commit details -
src: move worker_context from Environment to IsolateData
Workers are fully in control of their Isolates, and this helps avoid a problem with later changes to `CreateEnvironment()` because now we can run the boostrapping code inside the latter.
Configuration menu - View commit details
-
Copy full SHA for 8a04c59 - Browse repository at this point
Copy the full SHA 8a04c59View commit details -
src: associate is_main_thread() with worker_context()
In our codebase, the assumption generally is that `!is_main_thread()` means that the current Environment belongs to a Node.js Worker thread.
Configuration menu - View commit details
-
Copy full SHA for b732a01 - Browse repository at this point
Copy the full SHA b732a01View commit details -
src: align worker and main thread code with embedder API
This addresses some long-standing TODOs by Joyee and me about making the embedder API more powerful and us less reliant on internal APIs for creating the main thread and Workers.
Configuration menu - View commit details
-
Copy full SHA for 162b9ee - Browse repository at this point
Copy the full SHA 162b9eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f7cda2 - Browse repository at this point
Copy the full SHA 2f7cda2View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb04cac - Browse repository at this point
Copy the full SHA eb04cacView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf89ff0 - Browse repository at this point
Copy the full SHA cf89ff0View commit details -
src: provide a variant of LoadEnvironment taking a callback
This allows embedders to flexibly control how they start JS code rather than using `third_party_main`.
Configuration menu - View commit details
-
Copy full SHA for 7336b7f - Browse repository at this point
Copy the full SHA 7336b7fView commit details -
src: add LoadEnvironment() variant taking a string
Allow passing a string as the main module rather than using the callback variant.
Configuration menu - View commit details
-
Copy full SHA for 61098fc - Browse repository at this point
Copy the full SHA 61098fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 541d7f6 - Browse repository at this point
Copy the full SHA 541d7f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0b957c - Browse repository at this point
Copy the full SHA c0b957cView commit details -
src: add unique_ptr equivalent of CreatePlatform
This makes this bit of the embedder situation a bit easier to use.
Configuration menu - View commit details
-
Copy full SHA for 9bd88e7 - Browse repository at this point
Copy the full SHA 9bd88e7View commit details -
src: make InitializeNodeWithArgs() official public API
This is a decent replacement for the to-be-deprecated Init() API.
Configuration menu - View commit details
-
Copy full SHA for 99912a0 - Browse repository at this point
Copy the full SHA 99912a0View commit details -
src: add ability to look up platform based on
Environment*
This should eventually remove any necessity to use the global-state `GetMainThreadMultiIsolatePlatform()`.
Configuration menu - View commit details
-
Copy full SHA for 23b9ace - Browse repository at this point
Copy the full SHA 23b9aceView commit details -
src: allow non-Node.js TracingControllers
We do not need a Node.js-provided `v8::TracingController`, generally. Loosen that restriction in order to make it easier for embedders to provide their own subclass of `v8::TracingController`, or none at all. Refs: electron/electron@9c36576
Configuration menu - View commit details
-
Copy full SHA for ededfc9 - Browse repository at this point
Copy the full SHA ededfc9View commit details -
src: fix what a dispose without checking
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called. Refs: nodejs#31260
Configuration menu - View commit details
-
Copy full SHA for 36ec54b - Browse repository at this point
Copy the full SHA 36ec54bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 718f91f - Browse repository at this point
Copy the full SHA 718f91fView commit details -
src: shutdown platform from FreePlatform()
There is currently no way to properly do this.
Configuration menu - View commit details
-
Copy full SHA for 12bb53a - Browse repository at this point
Copy the full SHA 12bb53aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 487df31 - Browse repository at this point
Copy the full SHA 487df31View commit details -
Configuration menu - View commit details
-
Copy full SHA for 799c9b8 - Browse repository at this point
Copy the full SHA 799c9b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab5e211 - Browse repository at this point
Copy the full SHA ab5e211View commit details -
test: add extended embedder cctest
Add an embedder cctest that also covers a multi-Environment situation, including worker_threads-style inspector support.
Configuration menu - View commit details
-
Copy full SHA for 682e804 - Browse repository at this point
Copy the full SHA 682e804View commit details
Commits on Mar 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f191a72 - Browse repository at this point
Copy the full SHA f191a72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ce279a - Browse repository at this point
Copy the full SHA 3ce279aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f46c44c - Browse repository at this point
Copy the full SHA f46c44cView commit details
Commits on Mar 17, 2020
-
squash! test: add extended embedder cctest
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 330f4a7 - Browse repository at this point
Copy the full SHA 330f4a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 634a289 - Browse repository at this point
Copy the full SHA 634a289View commit details