Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
bd8c9555
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,发现更多精彩内容 >>
未验证
提交
bd8c9555
编写于
1月 24, 2020
作者:
K
Kaushik Iska
提交者:
GitHub
1月 24, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fuchsia] Expose view_ref as part of dart:fuchsia initialization (#15958)
fixes
https://github.com/flutter/flutter/issues/47178
上级
abdf4bde
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
50 addition
and
19 deletion
+50
-19
shell/platform/fuchsia/dart-pkg/fuchsia/lib/fuchsia.dart
shell/platform/fuchsia/dart-pkg/fuchsia/lib/fuchsia.dart
+17
-0
shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc
shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc
+9
-1
shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h
shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h
+2
-1
shell/platform/fuchsia/dart_runner/builtin_libraries.cc
shell/platform/fuchsia/dart_runner/builtin_libraries.cc
+3
-1
shell/platform/fuchsia/flutter/component.cc
shell/platform/fuchsia/flutter/component.cc
+0
-2
shell/platform/fuchsia/flutter/engine.cc
shell/platform/fuchsia/flutter/engine.cc
+10
-4
shell/platform/fuchsia/flutter/engine.h
shell/platform/fuchsia/flutter/engine.h
+0
-2
shell/platform/fuchsia/flutter/isolate_configurator.cc
shell/platform/fuchsia/flutter/isolate_configurator.cc
+6
-3
shell/platform/fuchsia/flutter/isolate_configurator.h
shell/platform/fuchsia/flutter/isolate_configurator.h
+3
-1
shell/platform/fuchsia/flutter/session_connection.cc
shell/platform/fuchsia/flutter/session_connection.cc
+0
-4
未找到文件。
shell/platform/fuchsia/dart-pkg/fuchsia/lib/fuchsia.dart
浏览文件 @
bd8c9555
...
...
@@ -18,8 +18,12 @@ Handle _environment;
@pragma
(
'vm:entry-point'
)
Handle
_outgoingServices
;
@pragma
(
'vm:entry-point'
)
Handle
_viewRef
;
class
MxStartupInfo
{
// TODO: refactor Handle to a Channel
// https://github.com/flutter/flutter/issues/49439
static
Handle
takeEnvironment
()
{
if
(
_outgoingServices
==
null
&&
Platform
.
isFuchsia
)
{
throw
Exception
(
...
...
@@ -31,6 +35,7 @@ class MxStartupInfo {
}
// TODO: refactor Handle to a Channel
// https://github.com/flutter/flutter/issues/49439
static
Handle
takeOutgoingServices
()
{
if
(
_outgoingServices
==
null
&&
Platform
.
isFuchsia
)
{
throw
Exception
(
...
...
@@ -40,6 +45,18 @@ class MxStartupInfo {
_outgoingServices
=
null
;
return
handle
;
}
// TODO: refactor Handle to a ViewRef
// https://github.com/flutter/flutter/issues/49439
static
Handle
takeViewRef
()
{
if
(
_viewRef
==
null
&&
Platform
.
isFuchsia
)
{
throw
Exception
(
'Attempting to call takeViewRef more than once per process'
);
}
Handle
handle
=
_viewRef
;
_viewRef
=
null
;
return
handle
;
}
}
void
_setReturnCode
(
int
returnCode
)
native
'SetReturnCode'
;
...
...
shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc
浏览文件 @
bd8c9555
...
...
@@ -102,7 +102,8 @@ void SetReturnCode(Dart_NativeArguments arguments) {
}
// namespace
void
Initialize
(
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
Environment
>
environment
,
zx
::
channel
directory_request
)
{
zx
::
channel
directory_request
,
std
::
optional
<
zx
::
eventpair
>
view_ref
)
{
zircon
::
dart
::
Initialize
();
Dart_Handle
library
=
Dart_LookupLibrary
(
ToDart
(
"dart:fuchsia"
));
...
...
@@ -128,6 +129,13 @@ void Initialize(fidl::InterfaceHandle<fuchsia::sys::Environment> environment,
ToDart
(
zircon
::
dart
::
Handle
::
Create
(
std
::
move
(
directory_request
))));
FML_CHECK
(
!
tonic
::
LogIfError
(
result
));
}
if
(
view_ref
)
{
result
=
Dart_SetField
(
library
,
ToDart
(
"_viewRef"
),
ToDart
(
zircon
::
dart
::
Handle
::
Create
((
*
view_ref
).
release
())));
FML_CHECK
(
!
tonic
::
LogIfError
(
result
));
}
}
}
// namespace dart
...
...
shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h
浏览文件 @
bd8c9555
...
...
@@ -11,7 +11,8 @@ namespace fuchsia {
namespace
dart
{
void
Initialize
(
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
Environment
>
environment
,
zx
::
channel
directory_request
);
zx
::
channel
directory_request
,
std
::
optional
<
zx
::
eventpair
>
view_ref
);
}
// namespace dart
}
// namespace fuchsia
...
...
shell/platform/fuchsia/dart_runner/builtin_libraries.cc
浏览文件 @
bd8c9555
...
...
@@ -6,6 +6,7 @@
#include <lib/fdio/namespace.h>
#include <lib/zx/channel.h>
#include <optional>
#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h"
#include "flutter/fml/logging.h"
...
...
@@ -103,9 +104,10 @@ void InitBuiltinLibrariesForIsolate(
zx
::
channel
directory_request
,
bool
service_isolate
)
{
// dart:fuchsia --------------------------------------------------------------
// dart runner doesn't care about scenic view ref.
if
(
!
service_isolate
)
{
fuchsia
::
dart
::
Initialize
(
std
::
move
(
environment
),
std
::
move
(
directory_request
));
std
::
move
(
directory_request
)
,
std
::
nullopt
);
}
// dart:fuchsia.builtin ------------------------------------------------------
...
...
shell/platform/fuchsia/flutter/component.cc
浏览文件 @
bd8c9555
...
...
@@ -13,7 +13,6 @@
#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>
...
...
@@ -616,7 +615,6 @@ void Application::CreateView(
settings_
,
// settings
std
::
move
(
isolate_snapshot_
),
// isolate snapshot
scenic
::
ToViewToken
(
std
::
move
(
view_token
)),
// view token
scenic
::
ViewRefPair
::
New
(),
// view ref pair
std
::
move
(
fdio_ns_
),
// FDIO namespace
std
::
move
(
directory_request_
)
// outgoing request
));
...
...
shell/platform/fuchsia/flutter/engine.cc
浏览文件 @
bd8c9555
...
...
@@ -7,6 +7,7 @@
#include "engine.h"
#include <lib/async/cpp/task.h>
#include <lib/ui/scenic/cpp/view_ref_pair.h>
#include <zircon/status.h>
#include <sstream>
...
...
@@ -55,7 +56,6 @@ Engine::Engine(Delegate& delegate,
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
)
:
delegate_
(
delegate
),
...
...
@@ -111,9 +111,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
));
// Setup the callback that will instantiate the platform view.
flutter
::
Shell
::
CreateCallback
<
flutter
::
PlatformView
>
on_create_platform_view
=
fml
::
MakeCopyable
(
...
...
@@ -256,9 +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
(
fdio_ns
),
//
std
::
move
(
environment
),
//
directory_request
.
TakeChannel
(),
//
std
::
move
(
dart_view_ref_event_pair
)
//
);
}
...
...
shell/platform/fuchsia/flutter/engine.h
浏览文件 @
bd8c9555
...
...
@@ -11,7 +11,6 @@
#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,7 +36,6 @@ 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
);
~
Engine
();
...
...
shell/platform/fuchsia/flutter/isolate_configurator.cc
浏览文件 @
bd8c9555
...
...
@@ -16,10 +16,12 @@ namespace flutter_runner {
IsolateConfigurator
::
IsolateConfigurator
(
UniqueFDIONS
fdio_ns
,
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
Environment
>
environment
,
zx
::
channel
directory_request
)
zx
::
channel
directory_request
,
zx
::
eventpair
view_ref
)
:
fdio_ns_
(
std
::
move
(
fdio_ns
)),
environment_
(
std
::
move
(
environment
)),
directory_request_
(
std
::
move
(
directory_request
))
{}
directory_request_
(
std
::
move
(
directory_request
)),
view_ref_
(
std
::
move
(
view_ref
))
{}
IsolateConfigurator
::~
IsolateConfigurator
()
=
default
;
...
...
@@ -42,7 +44,8 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() {
void
IsolateConfigurator
::
BindFuchsia
()
{
fuchsia
::
dart
::
Initialize
(
std
::
move
(
environment_
),
std
::
move
(
directory_request_
));
std
::
move
(
directory_request_
),
std
::
move
(
view_ref_
));
}
void
IsolateConfigurator
::
BindZircon
()
{
...
...
shell/platform/fuchsia/flutter/isolate_configurator.h
浏览文件 @
bd8c9555
...
...
@@ -21,7 +21,8 @@ class IsolateConfigurator final {
IsolateConfigurator
(
UniqueFDIONS
fdio_ns
,
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
Environment
>
environment
,
zx
::
channel
directory_request
);
zx
::
channel
directory_request
,
zx
::
eventpair
view_ref
);
~
IsolateConfigurator
();
...
...
@@ -34,6 +35,7 @@ class IsolateConfigurator final {
UniqueFDIONS
fdio_ns_
;
fidl
::
InterfaceHandle
<
fuchsia
::
sys
::
Environment
>
environment_
;
zx
::
channel
directory_request_
;
zx
::
eventpair
view_ref_
;
void
BindFuchsia
();
...
...
shell/platform/fuchsia/flutter/session_connection.cc
浏览文件 @
bd8c9555
...
...
@@ -36,10 +36,6 @@ SessionConnection::SessionConnection(
session_wrapper_
.
SetDebugName
(
debug_label_
);
// TODO(SCN-975): Re-enable.
// view_->GetToken(std::bind(&PlatformView::ConnectSemanticsProvider, this,
// std::placeholders::_1));
root_view_
.
AddChild
(
root_node_
);
root_node_
.
SetEventMask
(
fuchsia
::
ui
::
gfx
::
kMetricsEventMask
|
fuchsia
::
ui
::
gfx
::
kSizeChangeHintEventMask
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录