Skip to content

Commit d5338ed

Browse files
authored
[fuchsia] Set up the namespace in dart:zircon (flutter#4628)
1 parent 750c7e4 commit d5338ed

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

content_handler/runtime_holder.cc

+12
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) {
398398
}
399399
InitDartIoInternal();
400400
InitFuchsia();
401+
InitZircon();
401402
InitMozartInternal();
402403
}
403404

@@ -434,6 +435,17 @@ void RuntimeHolder::InitFuchsia() {
434435
ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest());
435436
}
436437

438+
void RuntimeHolder::InitZircon() {
439+
Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon"));
440+
DART_CHECK_VALID(zircon_lib);
441+
442+
Dart_Handle namespace_type =
443+
Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr);
444+
DART_CHECK_VALID(namespace_type);
445+
DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"),
446+
ToDart(reinterpret_cast<intptr_t>(namespc_))));
447+
}
448+
437449
void RuntimeHolder::InitMozartInternal() {
438450
fidl::InterfaceHandle<mozart::ViewContainer> view_container;
439451
view_->GetContainer(view_container.NewRequest());

content_handler/runtime_holder.h

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class RuntimeHolder : public blink::RuntimeDelegate,
9999

100100
void InitDartIoInternal();
101101
void InitFuchsia();
102+
void InitZircon();
102103
void InitMozartInternal();
103104

104105
void PostBeginFrame();

runtime/dart_vm_entry_points_fuchsia.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dart:io,_EmbedderConfig,_mayExit
44
dart:io,_Namespace,_setupNamespace
55
dart:mozart.internal,::,_context
66
dart:mozart.internal,::,_viewContainer
7+
dart:zircon,_Namespace,_namespace
78
dart:zircon,GetSizeResult,GetSizeResult.
89
dart:zircon,Handle,Handle._
910
dart:zircon,HandlePairResult,HandlePairResult.

0 commit comments

Comments
 (0)