Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
40043b5f
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
40043b5f
编写于
5月 26, 2020
作者:
D
David Worsham
提交者:
GitHub
5月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fuchsia: Implement CreateViewWithViewProvider (#18280)
Tested: Manual test via workstation product BUG: 50875
上级
17d1dc7e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
30 deletion
+44
-30
shell/platform/fuchsia/flutter/component.cc
shell/platform/fuchsia/flutter/component.cc
+15
-6
shell/platform/fuchsia/flutter/component.h
shell/platform/fuchsia/flutter/component.h
+6
-1
shell/platform/fuchsia/flutter/engine.cc
shell/platform/fuchsia/flutter/engine.cc
+21
-23
shell/platform/fuchsia/flutter/engine.h
shell/platform/fuchsia/flutter/engine.h
+2
-0
未找到文件。
shell/platform/fuchsia/flutter/component.cc
浏览文件 @
40043b5f
...
...
@@ -11,6 +11,7 @@
#include <lib/async/default.h>
#include <lib/fdio/directory.h>
#include <lib/fdio/namespace.h>
#include <lib/ui/scenic/cpp/view_ref_pair.h>
#include <lib/ui/scenic/cpp/view_token_pair.h>
#include <lib/vfs/cpp/composed_service_dir.h>
#include <lib/vfs/cpp/remote_dir.h>
...
...
@@ -553,7 +554,6 @@ void Application::AttemptVMLaunchWithCurrentSettings(
FML_CHECK
(
vm
)
<<
"Mut be able to initialize the VM."
;
}
// |fuchsia::sys::ComponentController|
void
Application
::
Kill
()
{
application_controller_
.
events
().
OnTerminated
(
last_return_code_
.
second
,
fuchsia
::
sys
::
TerminationReason
::
EXITED
);
...
...
@@ -563,12 +563,10 @@ void Application::Kill() {
// collected.
}
// |fuchsia::sys::ComponentController|
void
Application
::
Detach
()
{
application_controller_
.
set_error_handler
(
nullptr
);
}
// |flutter::Engine::Delegate|
void
Application
::
OnEngineTerminate
(
const
Engine
*
shell_holder
)
{
auto
found
=
std
::
find_if
(
shell_holders_
.
begin
(),
shell_holders_
.
end
(),
[
shell_holder
](
const
auto
&
holder
)
{
...
...
@@ -596,11 +594,20 @@ void Application::OnEngineTerminate(const Engine* shell_holder) {
}
}
// |fuchsia::ui::app::ViewProvider|
void
Application
::
CreateView
(
zx
::
eventpair
token
,
fidl
::
InterfaceRequest
<
fuchsia
::
sys
::
ServiceProvider
>
/*incoming_services*/
,
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
ServiceProvider
>
/*outgoing_services*/
)
{
auto
view_ref_pair
=
scenic
::
ViewRefPair
::
New
();
CreateViewWithViewRef
(
std
::
move
(
token
),
std
::
move
(
view_ref_pair
.
control_ref
),
std
::
move
(
view_ref_pair
.
view_ref
));
}
void
Application
::
CreateViewWithViewRef
(
zx
::
eventpair
view_token
,
f
idl
::
InterfaceRequest
<
fuchsia
::
sys
::
ServiceProvider
>
incoming_services
,
f
idl
::
InterfaceHandle
<
fuchsia
::
sys
::
ServiceProvider
>
outgoing_services
)
{
f
uchsia
::
ui
::
views
::
ViewRefControl
control_ref
,
f
uchsia
::
ui
::
views
::
ViewRef
view_ref
)
{
if
(
!
svc_
)
{
FML_DLOG
(
ERROR
)
<<
"Component incoming services was invalid when attempting to "
...
...
@@ -616,6 +623,8 @@ void Application::CreateView(
settings_
,
// settings
std
::
move
(
isolate_snapshot_
),
// isolate snapshot
scenic
::
ToViewToken
(
std
::
move
(
view_token
)),
// view token
std
::
move
(
control_ref
),
// view ref control
std
::
move
(
view_ref
),
// view ref
std
::
move
(
fdio_ns_
),
// FDIO namespace
std
::
move
(
directory_request_
),
// outgoing request
product_config_
// product configuration
...
...
shell/platform/fuchsia/flutter/component.h
浏览文件 @
40043b5f
...
...
@@ -114,11 +114,16 @@ class Application final : public Engine::Delegate,
// |fuchsia::ui::app::ViewProvider|
void
CreateView
(
zx
::
eventpair
view_
token
,
zx
::
eventpair
token
,
fidl
::
InterfaceRequest
<
fuchsia
::
sys
::
ServiceProvider
>
incoming_services
,
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
ServiceProvider
>
outgoing_services
)
override
;
// |fuchsia::ui::app::ViewProvider|
void
CreateViewWithViewRef
(
zx
::
eventpair
view_token
,
fuchsia
::
ui
::
views
::
ViewRefControl
control_ref
,
fuchsia
::
ui
::
views
::
ViewRef
view_ref
)
override
;
// |flutter::Engine::Delegate|
void
OnEngineTerminate
(
const
Engine
*
holder
)
override
;
...
...
shell/platform/fuchsia/flutter/engine.cc
浏览文件 @
40043b5f
...
...
@@ -5,7 +5,6 @@
#include "engine.h"
#include <lib/async/cpp/task.h>
#include <lib/ui/scenic/cpp/view_ref_pair.h>
#include <zircon/status.h>
#include <sstream>
...
...
@@ -50,16 +49,19 @@ static fml::RefPtr<flutter::PlatformMessage> MakeLocalizationPlatformMessage(
nullptr
);
}
Engine
::
Engine
(
Delegate
&
delegate
,
std
::
string
thread_label
,
std
::
shared_ptr
<
sys
::
ServiceDirectory
>
svc
,
std
::
shared_ptr
<
sys
::
ServiceDirectory
>
runner_services
,
flutter
::
Settings
settings
,
fml
::
RefPtr
<
const
flutter
::
DartSnapshot
>
isolate_snapshot
,
fuchsia
::
ui
::
views
::
ViewToken
view_token
,
UniqueFDIONS
fdio_ns
,
fidl
::
InterfaceRequest
<
fuchsia
::
io
::
Directory
>
directory_request
,
FlutterRunnerProductConfiguration
product_config
)
Engine
::
Engine
(
Delegate
&
delegate
,
std
::
string
thread_label
,
std
::
shared_ptr
<
sys
::
ServiceDirectory
>
svc
,
std
::
shared_ptr
<
sys
::
ServiceDirectory
>
runner_services
,
flutter
::
Settings
settings
,
fml
::
RefPtr
<
const
flutter
::
DartSnapshot
>
isolate_snapshot
,
fuchsia
::
ui
::
views
::
ViewToken
view_token
,
scenic
:
ViewRefPair
view_ref_pair
,
UniqueFDIONS
fdio_ns
,
fidl
::
InterfaceRequest
<
fuchsia
::
io
::
Directory
>
directory_request
,
FlutterRunnerProductConfiguration
product_config
)
:
delegate_
(
delegate
),
thread_label_
(
std
::
move
(
thread_label
)),
settings_
(
std
::
move
(
settings
)),
...
...
@@ -115,18 +117,14 @@ Engine::Engine(Delegate& delegate,
});
};
auto
view_ref_pair
=
scenic
::
ViewRefPair
::
New
();
fuchsia
::
ui
::
views
::
ViewRef
view_ref
;
view_ref_pair
.
view_ref
.
Clone
(
&
view_ref
);
fuchsia
::
ui
::
views
::
ViewRef
dart_view_ref
;
view_ref_pair
.
view_ref
.
Clone
(
&
dart_view_ref
);
zx
::
eventpair
dart_view_ref_event_pair
(
std
::
move
(
dart_view_ref
.
reference
));
fuchsia
::
ui
::
views
::
ViewRef
platform_view_ref
,
isolate_view_ref
;
view_ref_pair
.
view_ref
.
Clone
(
&
platform_view_ref
);
view_ref_pair
.
view_ref
.
Clone
(
&
isolate_view_ref
);
// Setup the callback that will instantiate the platform view.
flutter
::
Shell
::
CreateCallback
<
flutter
::
PlatformView
>
on_create_platform_view
=
fml
::
MakeCopyable
(
[
debug_label
=
thread_label_
,
view_ref
=
std
::
move
(
view_ref
),
[
debug_label
=
thread_label_
,
view_ref
=
std
::
move
(
platform_
view_ref
),
runner_services
,
parent_environment_service_provider
=
std
::
move
(
parent_environment_service_provider
),
...
...
@@ -263,10 +261,10 @@ Engine::Engine(Delegate& delegate,
svc
->
Connect
(
environment
.
NewRequest
());
isolate_configurator_
=
std
::
make_unique
<
IsolateConfigurator
>
(
std
::
move
(
fdio_ns
),
//
std
::
move
(
environment
),
//
directory_request
.
TakeChannel
(),
//
std
::
move
(
dart_view_ref_event_pair
)
//
std
::
move
(
fdio_ns
),
//
std
::
move
(
environment
),
//
directory_request
.
TakeChannel
(),
//
std
::
move
(
isolate_view_ref
.
reference
)
//
);
}
...
...
shell/platform/fuchsia/flutter/engine.h
浏览文件 @
40043b5f
...
...
@@ -11,6 +11,7 @@
#include <fuchsia/ui/views/cpp/fidl.h>
#include <lib/async-loop/cpp/loop.h>
#include <lib/sys/cpp/service_directory.h>
#include <lib/ui/scenic/cpp/view_ref_pair.h>
#include <lib/zx/event.h>
#include "flutter/fml/macros.h"
...
...
@@ -37,6 +38,7 @@ class Engine final {
flutter
::
Settings
settings
,
fml
::
RefPtr
<
const
flutter
::
DartSnapshot
>
isolate_snapshot
,
fuchsia
::
ui
::
views
::
ViewToken
view_token
,
scenic
::
ViewRefPair
view_ref_pair
,
UniqueFDIONS
fdio_ns
,
fidl
::
InterfaceRequest
<
fuchsia
::
io
::
Directory
>
directory_request
,
FlutterRunnerProductConfiguration
product_config
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录