Skip to content

Commit

Permalink
[fuchsia] Set up the namespace in dart:zircon (flutter#4628)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanderso authored Feb 2, 2018
1 parent 750c7e4 commit d5338ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions content_handler/runtime_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) {
}
InitDartIoInternal();
InitFuchsia();
InitZircon();
InitMozartInternal();
}

Expand Down Expand Up @@ -434,6 +435,17 @@ void RuntimeHolder::InitFuchsia() {
ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest());
}

void RuntimeHolder::InitZircon() {
Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon"));
DART_CHECK_VALID(zircon_lib);

Dart_Handle namespace_type =
Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr);
DART_CHECK_VALID(namespace_type);
DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"),
ToDart(reinterpret_cast<intptr_t>(namespc_))));
}

void RuntimeHolder::InitMozartInternal() {
fidl::InterfaceHandle<mozart::ViewContainer> view_container;
view_->GetContainer(view_container.NewRequest());
Expand Down
1 change: 1 addition & 0 deletions content_handler/runtime_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class RuntimeHolder : public blink::RuntimeDelegate,

void InitDartIoInternal();
void InitFuchsia();
void InitZircon();
void InitMozartInternal();

void PostBeginFrame();
Expand Down
1 change: 1 addition & 0 deletions runtime/dart_vm_entry_points_fuchsia.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dart:io,_EmbedderConfig,_mayExit
dart:io,_Namespace,_setupNamespace
dart:mozart.internal,::,_context
dart:mozart.internal,::,_viewContainer
dart:zircon,_Namespace,_namespace
dart:zircon,GetSizeResult,GetSizeResult.
dart:zircon,Handle,Handle._
dart:zircon,HandlePairResult,HandlePairResult.
Expand Down

0 comments on commit d5338ed

Please sign in to comment.