mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 15:04:33 -05:00
feat: add TransferSharedArrayBuffer (#1619)
This commit is contained in:
parent
42112f0fc3
commit
dd84fa398e
2 changed files with 26 additions and 0 deletions
|
@ -3663,6 +3663,12 @@ void v8__ValueDeserializer__TransferArrayBuffer(
|
|||
self->TransferArrayBuffer(transfer_id, array_buffer);
|
||||
}
|
||||
|
||||
void v8__ValueDeserializer__TransferSharedArrayBuffer(
|
||||
v8::ValueDeserializer* self, uint32_t transfer_id,
|
||||
v8::Local<v8::SharedArrayBuffer> shared_array_buffer) {
|
||||
self->TransferSharedArrayBuffer(transfer_id, shared_array_buffer);
|
||||
}
|
||||
|
||||
void v8__ValueDeserializer__SetSupportsLegacyWireFormat(
|
||||
v8::ValueDeserializer* self, bool supports_legacy_wire_format) {
|
||||
self->SetSupportsLegacyWireFormat(supports_legacy_wire_format);
|
||||
|
|
|
@ -118,6 +118,12 @@ extern "C" {
|
|||
array_buffer: Local<ArrayBuffer>,
|
||||
);
|
||||
|
||||
fn v8__ValueDeserializer__TransferSharedArrayBuffer(
|
||||
this: *mut CxxValueDeserializer,
|
||||
transfer_id: u32,
|
||||
array_buffer: Local<SharedArrayBuffer>,
|
||||
);
|
||||
|
||||
fn v8__ValueDeserializer__SetSupportsLegacyWireFormat(
|
||||
this: *mut CxxValueDeserializer,
|
||||
supports_legacy_wire_format: bool,
|
||||
|
@ -336,6 +342,20 @@ pub trait ValueDeserializerHelper {
|
|||
};
|
||||
}
|
||||
|
||||
fn transfer_shared_array_buffer(
|
||||
&self,
|
||||
transfer_id: u32,
|
||||
shared_array_buffer: Local<SharedArrayBuffer>,
|
||||
) {
|
||||
unsafe {
|
||||
v8__ValueDeserializer__TransferSharedArrayBuffer(
|
||||
cast_to_ptr(self.get_cxx_value_deserializer()),
|
||||
transfer_id,
|
||||
shared_array_buffer,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
fn get_wire_format_version(&self) -> u32 {
|
||||
unsafe {
|
||||
v8__ValueDeserializer__GetWireFormatVersion(cast_to_ptr(
|
||||
|
|
Loading…
Reference in a new issue