145{
146 ParsingContext ctx(this);
147 if (!ctx.fXMLParser) {
148 SkDEBUGF(
"could not create XML parser\n");
149 return false;
150 }
151
152
153
154
155 unsigned long seed = static_cast<unsigned long>(
156 reinterpret_cast<size_t>(kHashSeed) & 0xFFFFFFFF);
157 XML_SetHashSalt(ctx.fXMLParser, seed ? seed : 1);
158
159 XML_SetUserData(ctx.fXMLParser, &ctx);
161 XML_SetCharacterDataHandler(ctx.fXMLParser, text_handler);
162
163
164 XML_SetEntityDeclHandler(ctx.fXMLParser, entity_decl_handler);
165
166 XML_Status status = XML_STATUS_OK;
169 status = XML_Parse(ctx.fXMLParser,
172 true);
173 } else {
176 do {
179 SkDEBUGF(
"could not buffer enough to continue\n");
180 return false;
181 }
182
186 if (XML_STATUS_ERROR == status) {
187 break;
188 }
190 }
191 if (XML_STATUS_ERROR == status) {
192#if defined(SK_DEBUG)
193 XML_Error
error = XML_GetErrorCode(ctx.fXMLParser);
194 int line = XML_GetCurrentLineNumber(ctx.fXMLParser);
195 int column = XML_GetCurrentColumnNumber(ctx.fXMLParser);
196 const XML_LChar* errorString = XML_ErrorString(
error);
198#endif
199 return false;
200 }
201
202 return true;
203}
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
static void XMLCALL start_element_handler(void *data, const char *tag, const char **attributes)
static void XMLCALL end_element_handler(void *data, const char *tag)
static const size_t kBufferSize
constexpr int32_t SkToS32(S x)
virtual size_t getPosition() const
virtual bool isAtEnd() const =0
virtual size_t getLength() const
virtual const void * getMemoryBase()
virtual bool hasLength() const
virtual size_t read(void *buffer, size_t size)=0
const uint8_t uint32_t uint32_t GError ** error
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