summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-11-05 22:50:24 +0100
committerRich Trott <rtrott@gmail.com>2019-11-07 19:51:11 -0800
commite460e14d57869c37b181f1e4839c70d8fa89ffb3 (patch)
tree9c481c15fbce5e5a5e8413518faf099badb5ae0b /src/env.h
parent96db5a271c859eabbf81565e4ce82a93fd037fb9 (diff)
downloadandroid-node-v8-e460e14d57869c37b181f1e4839c70d8fa89ffb3.tar.gz
android-node-v8-e460e14d57869c37b181f1e4839c70d8fa89ffb3.tar.bz2
android-node-v8-e460e14d57869c37b181f1e4839c70d8fa89ffb3.zip
src: allow adding linked bindings to Environment
This allows manually adding linked bindings to an `Environment` instance, without having to register modules at program load in a global namespace. PR-URL: https://github.com/nodejs/node/pull/30274 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h
index e5490c0a5b..3e3aacc8f7 100644
--- a/src/env.h
+++ b/src/env.h
@@ -1069,11 +1069,15 @@ class Environment : public MemoryRetainer {
inline bool owns_inspector() const;
inline uint64_t thread_id() const;
inline worker::Worker* worker_context() const;
+ Environment* worker_parent_env() const;
inline void set_worker_context(worker::Worker* context);
inline void add_sub_worker_context(worker::Worker* context);
inline void remove_sub_worker_context(worker::Worker* context);
void stop_sub_worker_contexts();
inline bool is_stopping() const;
+ inline std::list<node_module>* extra_linked_bindings();
+ inline node_module* extra_linked_bindings_head();
+ inline const Mutex& extra_linked_bindings_mutex() const;
inline void ThrowError(const char* errmsg);
inline void ThrowTypeError(const char* errmsg);
@@ -1369,6 +1373,9 @@ class Environment : public MemoryRetainer {
worker::Worker* worker_context_ = nullptr;
+ std::list<node_module> extra_linked_bindings_;
+ Mutex extra_linked_bindings_mutex_;
+
static void RunTimers(uv_timer_t* handle);
struct ExitCallback {