88 {
89 if (reader->size() < 70) {
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105 if (
error !=
nullptr) {
107 }
108 return nullptr;
109 }
110
111 uint32_t
magic = reader->ReadUInt32();
113 if (
error !=
nullptr) {
115 }
116 return nullptr;
117 }
118
119 const uint32_t format_version = reader->ReadUInt32();
121 if (
error !=
nullptr) {
123 }
124 return nullptr;
125 }
126
128 if (
error !=
nullptr) {
130 }
131 return nullptr;
132 }
134
135 std::unique_ptr<Program> program(new Program(reader->typed_data()));
136
137
138
139 int subprogram_count = 0;
140 reader->set_offset(reader->size() - 4);
141 while (reader->offset() > 0) {
142 intptr_t
size = reader->ReadUInt32();
143 intptr_t
start = reader->offset() -
size;
144 if (start < 0 ||
size <= 0) {
145 if (
error !=
nullptr) {
147 }
148 return nullptr;
149 }
150 ++subprogram_count;
151 if (subprogram_count > 1) break;
152 reader->set_offset(start - 4);
153 }
154 program->single_program_ = subprogram_count == 1;
155
156
157 program->library_count_ = reader->ReadFromIndexNoReset(
159 intptr_t count_from_first_library_offset =
161 program->source_table_offset_ = reader->ReadFromIndexNoReset(
162 reader->size_,
164 count_from_first_library_offset,
165 1, 0);
166 program->constant_table_offset_ = reader->ReadUInt32();
167 reader->ReadUInt32();
168 program->name_table_offset_ = reader->ReadUInt32();
169 program->metadata_payloads_offset_ = reader->ReadUInt32();
170 program->metadata_mappings_offset_ = reader->ReadUInt32();
171 program->string_table_offset_ = reader->ReadUInt32();
172
173
174 program->component_index_offset_ = reader->ReadUInt32();
175
176 program->main_method_reference_ = NameIndex(reader->ReadUInt32() - 1);
177 reader->ReadUInt32();
178
179 return program;
180}
const uint8_t uint32_t uint32_t GError ** error
bool IsValidSdkHash(const uint8_t *sdk_hash)
const char * kKernelInvalidMagicIdentifier
const char * kKernelInvalidSdkHash
const int kSdkHashSizeInBytes
const char * kKernelInvalidSizeIndicated
const char * kKernelInvalidBinaryFormatVersion
const char * kKernelInvalidFilesize
static const uint32_t kMagicProgramFile
static constexpr int SourceTableFieldCountFromFirstLibraryOffset
static constexpr int LibraryCountFieldCountFromEnd
static const uint32_t kSupportedKernelFormatVersion
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