Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions runtime/dart_isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate) {

SetMessageHandlingTaskRunner(GetTaskRunners().GetUITaskRunner());

if (tonic::LogIfError(
Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))) {
return false;
}

if (!UpdateThreadPoolNames()) {
return false;
}
Expand Down Expand Up @@ -618,9 +623,10 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(

tonic::DartState::Scope scope(service_isolate);
if (!DartServiceIsolate::Startup(
settings.observatory_host, // server IP address
settings.observatory_port, // server observatory port
false, // disable websocket origin check
settings.observatory_host, // server IP address
settings.observatory_port, // server observatory port
tonic::DartState::HandleLibraryTag, // embedder library tag handler
false, // disable websocket origin check
settings.disable_service_auth_codes, // disable VM service auth codes
error // error (out)
)) {
Expand Down
6 changes: 6 additions & 0 deletions runtime/dart_service_isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
namespace flutter {
namespace {

static Dart_LibraryTagHandler g_embedder_tag_handler;
static tonic::DartLibraryNatives* g_natives;
static std::string g_observatory_uri;

Expand Down Expand Up @@ -126,12 +127,17 @@ void DartServiceIsolate::Shutdown(Dart_NativeArguments args) {

bool DartServiceIsolate::Startup(std::string server_ip,
intptr_t server_port,
Dart_LibraryTagHandler embedder_tag_handler,
bool disable_origin_check,
bool disable_service_auth_codes,
char** error) {
Dart_Isolate isolate = Dart_CurrentIsolate();
FML_CHECK(isolate);

// Remember the embedder's library tag handler.
g_embedder_tag_handler = embedder_tag_handler;
FML_CHECK(g_embedder_tag_handler);

// Setup native entries.
if (!g_natives) {
g_natives = new tonic::DartLibraryNatives();
Expand Down
1 change: 1 addition & 0 deletions runtime/dart_service_isolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DartServiceIsolate {

static bool Startup(std::string server_ip,
intptr_t server_port,
Dart_LibraryTagHandler embedder_tag_handler,
bool disable_origin_check,
bool disable_service_auth_codes,
char** error);
Expand Down