提交 b0d50e48 编写于 作者: J John McCutchan 提交者: GitHub

Fix service isolate startup (#2788)

上级 469d954a
......@@ -171,8 +171,12 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri,
if (settings.enable_observatory) {
std::string ip = "127.0.0.1";
const intptr_t port = settings.observatory_port;
const bool disable_websocket_origin_check = false;
const bool service_isolate_booted = DartServiceIsolate::Startup(
ip, port, DartLibraryTagHandler, IsRunningPrecompiledCode(), error);
ip, port, DartLibraryTagHandler,
IsRunningPrecompiledCode(),
disable_websocket_origin_check,
error);
CHECK(service_isolate_booted) << error;
}
......
......@@ -82,6 +82,7 @@ bool DartServiceIsolate::Startup(std::string server_ip,
intptr_t server_port,
Dart_LibraryTagHandler embedder_tag_handler,
bool running_precompiled,
bool disable_origin_check,
char** error) {
Dart_Isolate isolate = Dart_CurrentIsolate();
CHECK(isolate);
......@@ -167,6 +168,10 @@ bool DartServiceIsolate::Startup(std::string server_ip,
Dart_NewStringFromCString("_autoStart"),
Dart_NewBoolean(auto_start));
SHUTDOWN_ON_ERROR(result);
result = Dart_SetField(library,
Dart_NewStringFromCString("_originCheckDisabled"),
Dart_NewBoolean(disable_origin_check));
SHUTDOWN_ON_ERROR(result);
return true;
}
......
......@@ -19,6 +19,7 @@ class DartServiceIsolate {
intptr_t server_port,
Dart_LibraryTagHandler embedder_tag_handler,
bool running_precompiled,
bool disable_origin_check,
char** error);
static int GetObservatoryPort();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册