17 if (
size > kOnStackBufferCapacity) {
24 if (p_ != &buffer_[0]) free(p_);
27 char*
p() {
return p_; }
30 static constexpr intptr_t kOnStackBufferCapacity = 4096;
32 char buffer_[kOnStackBufferCapacity];
36 : open_objects_(0), buffer_(buf_size) {}
43 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
48 intptr_t odd_bits =
length % 3;
49 intptr_t even_bits =
length - odd_bits;
50 for (intptr_t
i = 0;
i < even_bits;
i += 3) {
51 intptr_t triplet = (bytes[
i] << 16) | (bytes[
i + 1] << 8) | bytes[
i + 2];
58 intptr_t triplet = bytes[even_bits] << 16;
63 }
else if (odd_bits == 2) {
64 intptr_t triplet = (bytes[even_bits] << 16) | (bytes[even_bits + 1] << 8);
78 const char* serialized_object) {
92 if (property_name !=
nullptr) {
107 ASSERT(open_objects_ > 0);
114 if (property_name !=
nullptr) {
122 ASSERT(open_objects_ > 0);
134 buffer_.
Printf(
"%s",
b ?
"true" :
"false");
138 EnsureIntegerIsRepresentableInJavaScript(
static_cast<int64_t
>(
i));
144 EnsureIntegerIsRepresentableInJavaScript(
i);
152 const size_t kBufferLen = 25;
205 va_list measure_args;
206 va_copy(measure_args,
args);
214 va_copy(print_args,
args);
281 va_list measure_args;
282 va_copy(measure_args,
args);
290 va_copy(print_args,
args);
302 ASSERT(buffer_length !=
nullptr);
303 *buffer_length = buffer_.
length();
326bool JSONWriter::NeedComma() {
333 return (ch !=
'[') && (ch !=
'{') && (ch !=
':') && (ch !=
',');
336void JSONWriter::EnsureIntegerIsRepresentableInJavaScript(int64_t
i) {
340 "JSONWriter::EnsureIntegerIsRepresentableInJavaScript failed on "
352 intptr_t
len = strlen(
s);
363bool JSONWriter::AddDartString(
const String&
s,
376 NoSafepointScope no_safepoint;
377 if (
s.IsOneByteString()) {
379 }
else if (
s.IsTwoByteString()) {
void AddString(const char *s)
intptr_t Printf(const char *format,...) PRINTF_ATTRIBUTE(2
void AddEscapedLatin1(const uint8_t *code_units, intptr_t len)
void AddRaw(const uint8_t *buffer, intptr_t buffer_length)
void AddEscapedUTF8(const char *s, intptr_t len)
void AddEscapedUTF16(const uint16_t *code_units, intptr_t len)
void AppendBytesInBase64(const uint8_t *bytes, intptr_t length)
bool PrintPropertyStr(const char *name, const String &s, intptr_t offset=0, intptr_t count=-1)
JSONWriter(intptr_t buf_size=256)
void PrintPropertyBool(const char *name, bool b)
void PrintProperty64(const char *name, int64_t i)
void PrintPropertyBase64(const char *name, const uint8_t *bytes, intptr_t length)
void PrintCommaIfNeeded()
void Steal(char **buffer, intptr_t *buffer_length)
void PrintValue(intptr_t i)
void PrintValueBase64(const uint8_t *bytes, intptr_t length)
void PrintValueBool(bool b)
void PrintProperty(const char *name, intptr_t i)
void PrintPropertyName(const char *name)
void void VPrintfValue(const char *format, va_list args)
void PrintfValue(const char *format,...) PRINTF_ATTRIBUTE(2
void OpenArray(const char *property_name=nullptr)
void AppendBytes(const uint8_t *buffer, intptr_t buffer_length)
bool PrintValueStr(const String &s, intptr_t offset, intptr_t count)
void AppendSerializedObject(const char *serialized_object)
void void VPrintfProperty(const char *name, const char *format, va_list args)
void PrintfProperty(const char *name, const char *format,...) PRINTF_ATTRIBUTE(3
void AddEscapedUTF8String(const char *s)
void PrintValueNoEscape(const char *s)
void OpenObject(const char *property_name=nullptr)
void PrintValue64(int64_t i)
void PrintPropertyNoEscape(const char *name, const char *s)
MaybeOnStackBuffer(intptr_t size)
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
void set_length(intptr_t len)
static bool IsJavaScriptInt(int64_t value)
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
static bool RangeCheck(intptr_t offset, intptr_t count, intptr_t length)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
void DoubleToCString(double d, char *buffer, int buffer_size)
void * malloc(size_t size)
static const char base64_pad
static const char base64_digits[65]
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