Flutter Engine
 
Loading...
Searching...
No Matches
flutter::SomeDataExtensionSerializer Class Reference

#include <test_codec_extensions.h>

Inheritance diagram for flutter::SomeDataExtensionSerializer:
flutter::StandardCodecSerializer

Public Member Functions

 SomeDataExtensionSerializer ()
 
virtual ~SomeDataExtensionSerializer ()
 
EncodableValue ReadValueOfType (uint8_t type, ByteStreamReader *stream) const override
 
void WriteValue (const EncodableValue &value, ByteStreamWriter *stream) const override
 
- Public Member Functions inherited from flutter::StandardCodecSerializer
virtual ~StandardCodecSerializer ()
 
 StandardCodecSerializer (StandardCodecSerializer const &)=delete
 
StandardCodecSerializeroperator= (StandardCodecSerializer const &)=delete
 
EncodableValue ReadValue (ByteStreamReader *stream) const
 

Static Public Member Functions

static const SomeDataExtensionSerializerGetInstance ()
 
- Static Public Member Functions inherited from flutter::StandardCodecSerializer
static const StandardCodecSerializerGetInstance ()
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::StandardCodecSerializer
 StandardCodecSerializer ()
 
size_t ReadSize (ByteStreamReader *stream) const
 
void WriteSize (size_t size, ByteStreamWriter *stream) const
 

Detailed Description

Definition at line 68 of file test_codec_extensions.h.

Constructor & Destructor Documentation

◆ SomeDataExtensionSerializer()

flutter::SomeDataExtensionSerializer::SomeDataExtensionSerializer ( )
default

◆ ~SomeDataExtensionSerializer()

flutter::SomeDataExtensionSerializer::~SomeDataExtensionSerializer ( )
virtualdefault

Member Function Documentation

◆ GetInstance()

const SomeDataExtensionSerializer & flutter::SomeDataExtensionSerializer::GetInstance ( )
static

Definition at line 46 of file test_codec_extensions.cc.

46 {
47 static SomeDataExtensionSerializer sInstance;
48 return sInstance;
49}

Referenced by flutter::TEST().

◆ ReadValueOfType()

EncodableValue flutter::SomeDataExtensionSerializer::ReadValueOfType ( uint8_t  type,
ByteStreamReader stream 
) const
overridevirtual

Reimplemented from flutter::StandardCodecSerializer.

Definition at line 51 of file test_codec_extensions.cc.

53 {
54 if (type == kSomeDataType) {
55 size_t size = ReadSize(stream);
56 std::vector<uint8_t> data;
57 data.resize(size);
58 stream->ReadBytes(data.data(), size);
59 EncodableValue label = ReadValue(stream);
60 return CustomEncodableValue(SomeData(std::get<std::string>(label), data));
61 }
63}
GLenum type
EncodableValue ReadValue(ByteStreamReader *stream) const
virtual EncodableValue ReadValueOfType(uint8_t type, ByteStreamReader *stream) const
size_t ReadSize(ByteStreamReader *stream) const
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switch_defs.h:36

References flutter::data, flutter::ByteStreamReader::ReadBytes(), flutter::StandardCodecSerializer::ReadSize(), flutter::StandardCodecSerializer::ReadValue(), flutter::StandardCodecSerializer::ReadValueOfType(), flutter::size, and type.

◆ WriteValue()

void flutter::SomeDataExtensionSerializer::WriteValue ( const EncodableValue value,
ByteStreamWriter stream 
) const
overridevirtual

Reimplemented from flutter::StandardCodecSerializer.

Definition at line 65 of file test_codec_extensions.cc.

66 {
67 auto custom_value = std::get_if<CustomEncodableValue>(&value);
68 if (!custom_value) {
70 return;
71 }
72 stream->WriteByte(kSomeDataType);
73 const SomeData& some_data = std::any_cast<SomeData>(*custom_value);
74 size_t data_size = some_data.data().size();
75 WriteSize(data_size, stream);
76 stream->WriteBytes(some_data.data().data(), data_size);
77 WriteValue(EncodableValue(some_data.label()), stream);
78}
void WriteValue(const EncodableValue &value, ByteStreamWriter *stream) const override
virtual void WriteValue(const EncodableValue &value, ByteStreamWriter *stream) const
void WriteSize(size_t size, ByteStreamWriter *stream) const

References flutter::SomeData::data(), flutter::SomeData::label(), value, flutter::ByteStreamWriter::WriteByte(), flutter::ByteStreamWriter::WriteBytes(), flutter::StandardCodecSerializer::WriteSize(), flutter::StandardCodecSerializer::WriteValue(), and WriteValue().

Referenced by WriteValue().


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