From 7e1c40b475a93dfa6c0288854aaa3c434d1d2e4a Mon Sep 17 00:00:00 2001 From: ZYSzys Date: Fri, 15 Mar 2019 21:12:01 +0800 Subject: [PATCH] src: fix warning in node_messaging --- src/node_messaging.cc | 18 +++++++++--------- src/node_messaging.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/node_messaging.cc b/src/node_messaging.cc index e6e7f743de27ad..650d64b3954f65 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -30,7 +30,7 @@ using v8::String; using v8::Value; using v8::ValueDeserializer; using v8::ValueSerializer; -using v8::WasmCompiledModule; +using v8::WasmModuleObject; namespace node { namespace worker { @@ -49,7 +49,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { Environment* env, const std::vector& message_ports, const std::vector>& shared_array_buffers, - const std::vector& wasm_modules) + const std::vector& wasm_modules) : message_ports_(message_ports), shared_array_buffers_(shared_array_buffers), wasm_modules_(wasm_modules) {} @@ -70,10 +70,10 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { return shared_array_buffers_[clone_id]; } - MaybeLocal GetWasmModuleFromId( + MaybeLocal GetWasmModuleFromId( Isolate* isolate, uint32_t transfer_id) override { CHECK_LE(transfer_id, wasm_modules_.size()); - return WasmCompiledModule::FromTransferrableModule( + return WasmModuleObject::FromTransferrableModule( isolate, wasm_modules_[transfer_id]); } @@ -82,7 +82,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { private: const std::vector& message_ports_; const std::vector>& shared_array_buffers_; - const std::vector& wasm_modules_; + const std::vector& wasm_modules_; }; } // anonymous namespace @@ -170,7 +170,7 @@ void Message::AddMessagePort(std::unique_ptr&& data) { message_ports_.emplace_back(std::move(data)); } -uint32_t Message::AddWASMModule(WasmCompiledModule::TransferrableModule&& mod) { +uint32_t Message::AddWASMModule(WasmModuleObject::TransferrableModule&& mod) { wasm_modules_.emplace_back(std::move(mod)); return wasm_modules_.size() - 1; } @@ -235,7 +235,7 @@ class SerializerDelegate : public ValueSerializer::Delegate { } Maybe GetWasmModuleTransferId( - Isolate* isolate, Local module) override { + Isolate* isolate, Local module) override { return Just(msg_->AddWASMModule(module->GetTransferrableModule())); } @@ -302,7 +302,7 @@ Maybe Message::Serialize(Environment* env, Local ab = entry.As(); // If we cannot render the ArrayBuffer unusable in this Isolate and // take ownership of its memory, copying the buffer will have to do. - if (!ab->IsNeuterable() || ab->IsExternal() || + if (!ab->IsDetachable() || ab->IsExternal() || !env->isolate_data()->uses_node_allocator()) { continue; } @@ -368,7 +368,7 @@ Maybe Message::Serialize(Environment* env, // (a.k.a. externalize) the underlying memory region and render // it inaccessible in this Isolate. ArrayBuffer::Contents contents = ab->Externalize(); - ab->Neuter(); + ab->Detach(); CHECK(env->isolate_data()->uses_node_allocator()); env->isolate_data()->node_allocator()->UnregisterPointer( diff --git a/src/node_messaging.h b/src/node_messaging.h index 282ad93468d95f..99e344b8ca2c0f 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -49,7 +49,7 @@ class Message : public MemoryRetainer { void AddMessagePort(std::unique_ptr&& 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); + uint32_t AddWASMModule(v8::WasmModuleObject::TransferrableModule&& mod); // The MessagePorts that will be transferred, as recorded by Serialize(). // Used for warning user about posting the target MessagePort to itself, @@ -68,7 +68,7 @@ class Message : public MemoryRetainer { std::vector> array_buffer_contents_; std::vector shared_array_buffers_; std::vector> message_ports_; - std::vector wasm_modules_; + std::vector wasm_modules_; friend class MessagePort; };