提交 7552150f 编写于 作者: A Adam Barth 提交者: GitHub

Support Mozart::NativesDelegate on Fuchsia (#3696)

上级 cf3424ab
......@@ -43,6 +43,7 @@ template("flutter_content_handler") {
deps = [
"//application/lib/app",
"//apps/icu_data/lib",
"//apps/mozart/lib/flutter/sdk_ext",
"//apps/mozart/lib/skia:vmo",
"//apps/mozart/services/buffers",
"//apps/mozart/services/buffers/cpp",
......
......@@ -324,6 +324,14 @@ void RuntimeHolder::InitMozartInternal() {
Dart_Handle mozart_internal =
Dart_LookupLibrary(ToDart("dart:mozart.internal"));
DART_CHECK_VALID(Dart_SetNativeResolver(
mozart_internal, mozart::NativeLookup, mozart::NativeSymbol));
DART_CHECK_VALID(Dart_SetField(
mozart_internal, ToDart("_viewContainer"),
DartConverter<uint64_t>::ToDart(reinterpret_cast<intptr_t>(
static_cast<mozart::NativesDelegate*>(this)))));
DART_CHECK_VALID(Dart_SetField(
mozart_internal, ToDart("_viewContainer"),
DartConverter<mx::channel>::ToDart(view_container.PassHandle())));
......@@ -335,6 +343,10 @@ void RuntimeHolder::InitRootBundle(std::vector<char> bundle) {
GetUnzipperProviderForRootBundle());
}
mozart::View* RuntimeHolder::GetMozartView() {
return view_.get();
}
bool RuntimeHolder::HandleAssetPlatformMessage(
blink::PlatformMessage* message) {
ftl::RefPtr<blink::PlatformMessageResponse> response = message->response();
......
......@@ -11,6 +11,7 @@
#include "application/services/application_environment.fidl.h"
#include "application/services/service_provider.fidl.h"
#include "apps/mozart/lib/flutter/sdk_ext/src/natives.h"
#include "apps/mozart/services/input/input_connection.fidl.h"
#include "apps/mozart/services/input/text_input.fidl.h"
#include "apps/mozart/services/views/view_manager.fidl.h"
......@@ -29,6 +30,7 @@ namespace flutter_runner {
class Rasterizer;
class RuntimeHolder : public blink::RuntimeDelegate,
public mozart::NativesDelegate,
public mozart::ViewListener,
public mozart::InputListener,
public mozart::InputMethodEditorClient {
......@@ -55,6 +57,9 @@ class RuntimeHolder : public blink::RuntimeDelegate,
ftl::RefPtr<blink::PlatformMessage> message) override;
void DidCreateMainIsolate(Dart_Isolate isolate) override;
// |mozart::NativesDelegate| implementation:
mozart::View* GetMozartView() override;
// |mozart::InputListener| implementation:
void OnEvent(mozart::InputEventPtr event,
const OnEventCallback& callback) override;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册