5#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_message_codec.h"
31 fl_standard_message_codec,
32 fl_message_codec_get_type())
67 while (
buffer->len % align != 0) {
90 if ((*
offset) % align == 0) {
94 size_t required = align - (*offset) % align;
99 (*offset) += required;
105 return static_cast<const uint8_t*
>(g_bytes_get_data(
buffer,
nullptr)) +
135 *
offset +=
sizeof(uint16_t);
150 *
offset +=
sizeof(uint32_t);
166 *
offset +=
sizeof(int32_t);
182 *
offset +=
sizeof(int64_t);
201 *
offset +=
sizeof(double);
359 if (child ==
nullptr) {
385 if (
key ==
nullptr) {
390 if (
value ==
nullptr) {
403 FlStandardMessageCodec*
self =
404 reinterpret_cast<FlStandardMessageCodec*
>(codec);
406 g_autoptr(GByteArray)
buffer = g_byte_array_new();
410 return g_byte_array_free_to_bytes(
411 static_cast<GByteArray*
>(g_steal_pointer(&
buffer)));
418 if (g_bytes_get_size(
message) == 0) {
422 FlStandardMessageCodec*
self =
423 reinterpret_cast<FlStandardMessageCodec*
>(codec);
428 if (
value ==
nullptr) {
435 "Unused %zi bytes after standard message",
445 FlStandardMessageCodec*
self,
449 if (
value ==
nullptr) {
467 if (v >= INT32_MIN && v <= INT32_MAX) {
495 sizeof(uint8_t) *
length);
506 sizeof(int32_t) *
length);
517 sizeof(int64_t) *
length);
569 "Custom value not implemented");
581 FlStandardMessageCodec*
self,
618 "Unexpected standard codec type %02x",
type);
626 FlStandardMessageCodecClass* klass) {
627 FL_MESSAGE_CODEC_CLASS(klass)->encode_message =
629 FL_MESSAGE_CODEC_CLASS(klass)->decode_message =
638 return static_cast<FlStandardMessageCodec*
>(
639 g_object_new(fl_standard_message_codec_get_type(),
nullptr));
643 FlStandardMessageCodec* codec,
648 }
else if (
size <= 0xffff) {
658 FlStandardMessageCodec* codec,
672 }
else if (value8 == 254) {
686 FlStandardMessageCodec*
self,
690 return FL_STANDARD_MESSAGE_CODEC_GET_CLASS(
self)->write_value(
self,
buffer,
695 FlStandardMessageCodec*
self,
704 return FL_STANDARD_MESSAGE_CODEC_GET_CLASS(
self)->read_value_of_type(
@ FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA
@ FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE
@ FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA
#define FL_MESSAGE_CODEC_ERROR
const uint8_t uint32_t uint32_t GError ** error
static FlValue * read_int64_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
G_MODULE_EXPORT gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec *codec, GBytes *buffer, size_t *offset, uint32_t *value, GError **error)
G_MODULE_EXPORT gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec *self, GByteArray *buffer, FlValue *value, GError **error)
static FlValue * read_int32_value(GBytes *buffer, size_t *offset, GError **error)
static constexpr int kValueNull
static constexpr int kValueString
static gboolean read_uint32(GBytes *buffer, size_t *offset, uint32_t *value, GError **error)
static FlValue * read_float64_value(GBytes *buffer, size_t *offset, GError **error)
G_MODULE_EXPORT void fl_standard_message_codec_write_size(FlStandardMessageCodec *codec, GByteArray *buffer, uint32_t size)
static FlValue * fl_standard_message_codec_decode_message(FlMessageCodec *codec, GBytes *message, GError **error)
static gboolean check_size(GBytes *buffer, size_t offset, size_t required, GError **error)
static constexpr int kValueTrue
static FlValue * read_float32_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static gboolean fl_standard_message_codec_real_write_value(FlStandardMessageCodec *self, GByteArray *buffer, FlValue *value, GError **error)
static gboolean read_align(GBytes *buffer, size_t *offset, size_t align, GError **error)
static void write_align(GByteArray *buffer, guint align)
static const uint8_t * get_data(GBytes *buffer, size_t *offset)
static GBytes * fl_standard_message_codec_encode_message(FlMessageCodec *codec, FlValue *message, GError **error)
static constexpr int kValueInt64List
static FlValue * read_int64_value(GBytes *buffer, size_t *offset, GError **error)
G_MODULE_EXPORT FlValue * fl_standard_message_codec_read_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static constexpr int kValueFloat64List
static constexpr int kValueFloat32List
static constexpr int kValueUint8List
G_MODULE_EXPORT FlStandardMessageCodec * fl_standard_message_codec_new()
static void fl_standard_message_codec_init(FlStandardMessageCodec *self)
static constexpr int kValueInt32
static constexpr int kValueList
static gboolean read_uint16(GBytes *buffer, size_t *offset, uint16_t *value, GError **error)
static constexpr int kValueFloat64
static constexpr int kValueMap
static FlValue * read_string_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static constexpr int kValueInt32List
static FlValue * read_uint8_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static void write_uint32(GByteArray *buffer, uint32_t value)
static void write_int64(GByteArray *buffer, int64_t value)
static FlValue * read_float64_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static void write_uint16(GByteArray *buffer, uint16_t value)
static FlValue * fl_standard_message_codec_read_value_of_type(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, int type, GError **error)
static gboolean read_uint8(GBytes *buffer, size_t *offset, uint8_t *value, GError **error)
static void write_float64(GByteArray *buffer, double value)
static constexpr int kValueInt64
static void write_int32(GByteArray *buffer, int32_t value)
static FlValue * read_map_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static void fl_standard_message_codec_class_init(FlStandardMessageCodecClass *klass)
static constexpr int kValueFalse
static FlValue * read_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
static FlValue * read_int32_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
G_DEFINE_TYPE(FlStandardMessageCodec, fl_standard_message_codec, fl_message_codec_get_type()) static void write_uint8(GByteArray *buffer
g_byte_array_append(buffer, &type, sizeof(uint8_t))
G_MODULE_EXPORT FlValue * fl_value_new_map()
G_MODULE_EXPORT FlValue * fl_value_ref(FlValue *self)
G_MODULE_EXPORT const double * fl_value_get_float_list(FlValue *self)
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_null()
G_MODULE_EXPORT FlValue * fl_value_new_float32_list(const float *data, size_t data_length)
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
G_MODULE_EXPORT const uint8_t * fl_value_get_uint8_list(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_list()
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
G_MODULE_EXPORT const float * fl_value_get_float32_list(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
G_MODULE_EXPORT const int32_t * fl_value_get_int32_list(FlValue *self)
G_MODULE_EXPORT const int64_t * fl_value_get_int64_list(FlValue *self)
G_MODULE_EXPORT void fl_value_set(FlValue *self, FlValue *key, FlValue *value)
typedefG_BEGIN_DECLS struct _FlValue FlValue
@ FL_VALUE_TYPE_FLOAT32_LIST
@ FL_VALUE_TYPE_INT32_LIST
@ FL_VALUE_TYPE_UINT8_LIST
@ FL_VALUE_TYPE_INT64_LIST
@ FL_VALUE_TYPE_FLOAT_LIST
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer 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
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>