diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-01-02 18:33:58 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-01-06 02:54:13 +0300 |
commit | 0a549aaeaca8e3be7d19691d40f6a1c0798c82bf (patch) | |
tree | f2c981a1118e0690e4cf768829d05bd1b890e936 /src/node_messaging.h | |
parent | 47a9eea8c8843414aa09dbdea9ca5fb74279f5ab (diff) |
worker: enable transferring WASM modules
Enable in-memory transfer of WASM modules without recompilation.
Previously, the serialization step worked, but deserialization failed
because we did not explicitly enable decoding inline WASM modules,
and so the message was not successfully received.
PR-URL: https://github.com/nodejs/node/pull/25314
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'src/node_messaging.h')
-rw-r--r-- | src/node_messaging.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node_messaging.h b/src/node_messaging.h index e4674885d2b..3c79e24f24b 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -47,6 +47,9 @@ class Message : public MemoryRetainer { // Internal method of Message that is called once serialization finishes // and that transfers ownership of `data` to this message. void AddMessagePort(std::unique_ptr<MessagePortData>&& data); + // Internal method of Message that is called when a new WebAssembly.Module + // object is encountered in the incoming value's structure. + uint32_t AddWASMModule(v8::WasmCompiledModule::TransferrableModule&& mod); // The MessagePorts that will be transferred, as recorded by Serialize(). // Used for warning user about posting the target MessagePort to itself, @@ -65,6 +68,7 @@ class Message : public MemoryRetainer { std::vector<MallocedBuffer<char>> array_buffer_contents_; std::vector<SharedArrayBufferMetadataReference> shared_array_buffers_; std::vector<std::unique_ptr<MessagePortData>> message_ports_; + std::vector<v8::WasmCompiledModule::TransferrableModule> wasm_modules_; friend class MessagePort; }; |