diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2022-05-05 14:37:01 +0300 |
---|---|---|
committer | RafaelGSS <rafael.nunu@hotmail.com> | 2022-05-10 15:13:18 +0300 |
commit | a20310d171aea18accf93ade3d60234944ba6c54 (patch) | |
tree | 8ad6f6cdf65bab60d99ad3cf661e79e113d63b2a /src/node_worker.h | |
parent | 2df1624f804ca5113655575a0546f41a58dc8e02 (diff) |
bootstrap: use a context snapshotted with primordials in workers
PR-URL: https://github.com/nodejs/node/pull/42867
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'src/node_worker.h')
-rw-r--r-- | src/node_worker.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/node_worker.h b/src/node_worker.h index f2a9386aeab..faf28b04d33 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -9,6 +9,8 @@ #include "uv.h" namespace node { + +struct SnapshotData; namespace worker { class WorkerThreadData; @@ -29,7 +31,8 @@ class Worker : public AsyncWrap { const std::string& url, std::shared_ptr<PerIsolateOptions> per_isolate_opts, std::vector<std::string>&& exec_argv, - std::shared_ptr<KVStore> env_vars); + std::shared_ptr<KVStore> env_vars, + const SnapshotData* snapshot_data); ~Worker() override; // Run the worker. This is only called from the worker thread. @@ -54,6 +57,7 @@ class Worker : public AsyncWrap { bool IsNotIndicativeOfMemoryLeakAtExit() const override; bool is_stopped() const; + const SnapshotData* snapshot_data() const { return snapshot_data_; } static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static void CloneParentEnvVars( @@ -126,6 +130,7 @@ class Worker : public AsyncWrap { // destroyed alongwith the worker thread. Environment* env_ = nullptr; + const SnapshotData* snapshot_data_ = nullptr; friend class WorkerThreadData; }; |