v8  8.1.307(node14.1.0)
V8 is Google's open source JavaScript engine
ValueDeserializer Class Reference

#include <v8.h>

Data Structures

class  Delegate
 

Public Member Functions

 ValueDeserializer (Isolate *isolate, const uint8_t *data, size_t size)
 
 ValueDeserializer (Isolate *isolate, const uint8_t *data, size_t size, Delegate *delegate)
 
 ~ValueDeserializer ()
 
V8_WARN_UNUSED_RESULT Maybe< bool > ReadHeader (Local< Context > context)
 
V8_WARN_UNUSED_RESULT MaybeLocal< ValueReadValue (Local< Context > context)
 
void TransferArrayBuffer (uint32_t transfer_id, Local< ArrayBuffer > array_buffer)
 
void TransferSharedArrayBuffer (uint32_t id, Local< SharedArrayBuffer > shared_array_buffer)
 
void SetSupportsLegacyWireFormat (bool supports_legacy_wire_format)
 
 V8_DEPRECATED ("Wasm module serialization is only supported via explicit methods, e.g. " "CompiledWasmModule::Serialize()") void SetExpectInlineWasm(bool allow_inline_wasm)
 
uint32_t GetWireFormatVersion () const
 
V8_WARN_UNUSED_RESULT bool ReadUint32 (uint32_t *value)
 
V8_WARN_UNUSED_RESULT bool ReadUint64 (uint64_t *value)
 
V8_WARN_UNUSED_RESULT bool ReadDouble (double *value)
 
V8_WARN_UNUSED_RESULT bool ReadRawBytes (size_t length, const void **data)
 
 ValueDeserializer (const ValueDeserializer &)=delete
 
void operator= (const ValueDeserializer &)=delete
 

Detailed Description

Deserializes values from data written with ValueSerializer, or a compatible implementation.

Definition at line 2399 of file v8.h.

Constructor & Destructor Documentation

◆ ValueDeserializer() [1/3]

ValueDeserializer ( Isolate isolate,
const uint8_t *  data,
size_t  size 
)

◆ ValueDeserializer() [2/3]

ValueDeserializer ( Isolate isolate,
const uint8_t *  data,
size_t  size,
Delegate delegate 
)

◆ ~ValueDeserializer()

◆ ValueDeserializer() [3/3]

ValueDeserializer ( const ValueDeserializer )
delete

Member Function Documentation

◆ GetWireFormatVersion()

uint32_t GetWireFormatVersion ( ) const

Reads the underlying wire format version. Likely mostly to be useful to legacy code reading old wire format versions. Must be called after ReadHeader.

◆ operator=()

void operator= ( const ValueDeserializer )
delete

◆ ReadDouble()

V8_WARN_UNUSED_RESULT bool ReadDouble ( double *  value)

◆ ReadHeader()

V8_WARN_UNUSED_RESULT Maybe<bool> ReadHeader ( Local< Context context)

Reads and validates a header (including the format version). May, for example, reject an invalid or unsupported wire format.

◆ ReadRawBytes()

V8_WARN_UNUSED_RESULT bool ReadRawBytes ( size_t  length,
const void **  data 
)

◆ ReadUint32()

V8_WARN_UNUSED_RESULT bool ReadUint32 ( uint32_t *  value)

Reads raw data in various common formats to the buffer. Note that integer types are read in base-128 varint format, not with a binary copy. For use during an override of Delegate::ReadHostObject.

◆ ReadUint64()

V8_WARN_UNUSED_RESULT bool ReadUint64 ( uint64_t *  value)

◆ ReadValue()

V8_WARN_UNUSED_RESULT MaybeLocal<Value> ReadValue ( Local< Context context)

Deserializes a JavaScript value from the buffer.

◆ SetSupportsLegacyWireFormat()

void SetSupportsLegacyWireFormat ( bool  supports_legacy_wire_format)

Must be called before ReadHeader to enable support for reading the legacy wire format (i.e., which predates this being shipped).

Don't use this unless you need to read data written by previous versions of blink::ScriptValueSerializer.

◆ TransferArrayBuffer()

void TransferArrayBuffer ( uint32_t  transfer_id,
Local< ArrayBuffer array_buffer 
)

Accepts the array buffer corresponding to the one passed previously to ValueSerializer::TransferArrayBuffer.

◆ TransferSharedArrayBuffer()

void TransferSharedArrayBuffer ( uint32_t  id,
Local< SharedArrayBuffer shared_array_buffer 
)

Similar to TransferArrayBuffer, but for SharedArrayBuffer. The id is not necessarily in the same namespace as unshared ArrayBuffer objects.

◆ V8_DEPRECATED()

V8_DEPRECATED ( "Wasm module serialization is only supported via explicit  methods,
e.g. " "CompiledWasmModule::Serialize()"   
)
inline

Expect inline wasm in the data stream (rather than in-memory transfer)

Definition at line 2470 of file v8.h.


The documentation for this class was generated from the following file: