v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::ValueDeserializer Class Reference

#include <v8-value-serializer.h>

Collaboration diagram for v8::ValueDeserializer:

Classes

class  Delegate
 
struct  PrivateData
 

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)
 
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
 

Private Attributes

PrivateDataprivate_
 

Detailed Description

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

Definition at line 215 of file v8-value-serializer.h.

Constructor & Destructor Documentation

◆ ValueDeserializer() [1/3]

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

Definition at line 3392 of file api.cc.

◆ ValueDeserializer() [2/3]

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

Definition at line 3396 of file api.cc.

◆ ~ValueDeserializer()

v8::ValueDeserializer::~ValueDeserializer ( )

Definition at line 3402 of file api.cc.

◆ ValueDeserializer() [3/3]

v8::ValueDeserializer::ValueDeserializer ( const ValueDeserializer & )
delete

Member Function Documentation

◆ GetWireFormatVersion()

uint32_t v8::ValueDeserializer::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.

Definition at line 3431 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void v8::ValueDeserializer::operator= ( const ValueDeserializer & )
delete

◆ ReadDouble()

bool v8::ValueDeserializer::ReadDouble ( double * value)

Definition at line 3470 of file api.cc.

Here is the call graph for this function:

◆ ReadHeader()

Maybe< bool > v8::ValueDeserializer::ReadHeader ( Local< Context > context)

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

Definition at line 3404 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadRawBytes()

bool v8::ValueDeserializer::ReadRawBytes ( size_t length,
const void ** data )

Definition at line 3474 of file api.cc.

Here is the call graph for this function:

◆ ReadUint32()

bool v8::ValueDeserializer::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.

Definition at line 3462 of file api.cc.

Here is the call graph for this function:

◆ ReadUint64()

bool v8::ValueDeserializer::ReadUint64 ( uint64_t * value)

Definition at line 3466 of file api.cc.

Here is the call graph for this function:

◆ ReadValue()

MaybeLocal< Value > v8::ValueDeserializer::ReadValue ( Local< Context > context)

Deserializes a JavaScript value from the buffer.

Definition at line 3435 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSupportsLegacyWireFormat()

void v8::ValueDeserializer::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.

Definition at line 3426 of file api.cc.

◆ TransferArrayBuffer()

void v8::ValueDeserializer::TransferArrayBuffer ( uint32_t transfer_id,
Local< ArrayBuffer > array_buffer )

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

Definition at line 3450 of file api.cc.

Here is the call graph for this function:

◆ TransferSharedArrayBuffer()

void v8::ValueDeserializer::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.

Definition at line 3456 of file api.cc.

Here is the call graph for this function:

Member Data Documentation

◆ private_

PrivateData* v8::ValueDeserializer::private_
private

Definition at line 311 of file v8-value-serializer.h.


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