130 intptr_t server_port,
131 Dart_LibraryTagHandler embedder_tag_handler,
132 bool disable_origin_check,
133 bool disable_service_auth_codes,
134 bool enable_service_port_fallback,
136 Dart_Isolate isolate = Dart_CurrentIsolate();
140 g_embedder_tag_handler = embedder_tag_handler;
146 g_natives->Register({
147 {
"VMServiceIO_NotifyServerState", NotifyServerState, 1,
true},
148 {
"VMServiceIO_Shutdown", Shutdown, 0,
true},
152 Dart_Handle uri = Dart_NewStringFromCString(
"dart:vmservice_io");
153 Dart_Handle library = Dart_LookupLibrary(uri);
155 Dart_Handle result = Dart_SetRootLibrary(library);
157 result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol);
160 library = Dart_RootLibrary();
164 result = Dart_SetField(library, Dart_NewStringFromCString(
"_ip"),
165 Dart_NewStringFromCString(server_ip.c_str()));
168 bool auto_start = server_port >= 0;
169 if (server_port < 0) {
175 result = Dart_SetField(library, Dart_NewStringFromCString(
"_port"),
176 Dart_NewInteger(server_port));
178 result = Dart_SetField(library, Dart_NewStringFromCString(
"_autoStart"),
179 Dart_NewBoolean(auto_start));
182 Dart_SetField(library, Dart_NewStringFromCString(
"_originCheckDisabled"),
183 Dart_NewBoolean(disable_origin_check));
186 Dart_SetField(library, Dart_NewStringFromCString(
"_authCodesDisabled"),
187 Dart_NewBoolean(disable_service_auth_codes));
189 result = Dart_SetField(
190 library, Dart_NewStringFromCString(
"_enableServicePortFallback"),
191 Dart_NewBoolean(enable_service_port_fallback));
197 *
error = Dart_IsolateMakeRunnable(isolate);
199 Dart_EnterIsolate(isolate);
200 Dart_ShutdownIsolate();
203 Dart_EnterIsolate(isolate);
static bool Startup(const std::string &server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, bool disable_origin_check, bool disable_service_auth_codes, bool enable_service_port_fallback, char **error)
Start the service isolate. This call may only be made in the Dart VM initiated isolate creation callb...
const uint8_t uint32_t uint32_t GError ** error