Skip to content

Commit 0752a18

Browse files
ZYSzysaddaleax
authored andcommitted
src: fix warning in node_messaging
PR-URL: #26682 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent c32615c commit 0752a18

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/node_messaging.cc

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using v8::String;
3030
using v8::Value;
3131
using v8::ValueDeserializer;
3232
using v8::ValueSerializer;
33-
using v8::WasmCompiledModule;
33+
using v8::WasmModuleObject;
3434

3535
namespace node {
3636
namespace worker {
@@ -49,7 +49,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
4949
Environment* env,
5050
const std::vector<MessagePort*>& message_ports,
5151
const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers,
52-
const std::vector<WasmCompiledModule::TransferrableModule>& wasm_modules)
52+
const std::vector<WasmModuleObject::TransferrableModule>& wasm_modules)
5353
: message_ports_(message_ports),
5454
shared_array_buffers_(shared_array_buffers),
5555
wasm_modules_(wasm_modules) {}
@@ -70,10 +70,10 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
7070
return shared_array_buffers_[clone_id];
7171
}
7272

73-
MaybeLocal<WasmCompiledModule> GetWasmModuleFromId(
73+
MaybeLocal<WasmModuleObject> GetWasmModuleFromId(
7474
Isolate* isolate, uint32_t transfer_id) override {
7575
CHECK_LE(transfer_id, wasm_modules_.size());
76-
return WasmCompiledModule::FromTransferrableModule(
76+
return WasmModuleObject::FromTransferrableModule(
7777
isolate, wasm_modules_[transfer_id]);
7878
}
7979

@@ -82,7 +82,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
8282
private:
8383
const std::vector<MessagePort*>& message_ports_;
8484
const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers_;
85-
const std::vector<WasmCompiledModule::TransferrableModule>& wasm_modules_;
85+
const std::vector<WasmModuleObject::TransferrableModule>& wasm_modules_;
8686
};
8787

8888
} // anonymous namespace
@@ -170,7 +170,7 @@ void Message::AddMessagePort(std::unique_ptr<MessagePortData>&& data) {
170170
message_ports_.emplace_back(std::move(data));
171171
}
172172

173-
uint32_t Message::AddWASMModule(WasmCompiledModule::TransferrableModule&& mod) {
173+
uint32_t Message::AddWASMModule(WasmModuleObject::TransferrableModule&& mod) {
174174
wasm_modules_.emplace_back(std::move(mod));
175175
return wasm_modules_.size() - 1;
176176
}
@@ -235,7 +235,7 @@ class SerializerDelegate : public ValueSerializer::Delegate {
235235
}
236236

237237
Maybe<uint32_t> GetWasmModuleTransferId(
238-
Isolate* isolate, Local<WasmCompiledModule> module) override {
238+
Isolate* isolate, Local<WasmModuleObject> module) override {
239239
return Just(msg_->AddWASMModule(module->GetTransferrableModule()));
240240
}
241241

@@ -302,7 +302,7 @@ Maybe<bool> Message::Serialize(Environment* env,
302302
Local<ArrayBuffer> ab = entry.As<ArrayBuffer>();
303303
// If we cannot render the ArrayBuffer unusable in this Isolate and
304304
// take ownership of its memory, copying the buffer will have to do.
305-
if (!ab->IsNeuterable() || ab->IsExternal() ||
305+
if (!ab->IsDetachable() || ab->IsExternal() ||
306306
!env->isolate_data()->uses_node_allocator()) {
307307
continue;
308308
}
@@ -368,7 +368,7 @@ Maybe<bool> Message::Serialize(Environment* env,
368368
// (a.k.a. externalize) the underlying memory region and render
369369
// it inaccessible in this Isolate.
370370
ArrayBuffer::Contents contents = ab->Externalize();
371-
ab->Neuter();
371+
ab->Detach();
372372

373373
CHECK(env->isolate_data()->uses_node_allocator());
374374
env->isolate_data()->node_allocator()->UnregisterPointer(

src/node_messaging.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Message : public MemoryRetainer {
4949
void AddMessagePort(std::unique_ptr<MessagePortData>&& data);
5050
// Internal method of Message that is called when a new WebAssembly.Module
5151
// object is encountered in the incoming value's structure.
52-
uint32_t AddWASMModule(v8::WasmCompiledModule::TransferrableModule&& mod);
52+
uint32_t AddWASMModule(v8::WasmModuleObject::TransferrableModule&& mod);
5353

5454
// The MessagePorts that will be transferred, as recorded by Serialize().
5555
// Used for warning user about posting the target MessagePort to itself,
@@ -68,7 +68,7 @@ class Message : public MemoryRetainer {
6868
std::vector<MallocedBuffer<char>> array_buffer_contents_;
6969
std::vector<SharedArrayBufferMetadataReference> shared_array_buffers_;
7070
std::vector<std::unique_ptr<MessagePortData>> message_ports_;
71-
std::vector<v8::WasmCompiledModule::TransferrableModule> wasm_modules_;
71+
std::vector<v8::WasmModuleObject::TransferrableModule> wasm_modules_;
7272

7373
friend class MessagePort;
7474
};

0 commit comments

Comments
 (0)