Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
6688dd4d
E
engine
项目概览
weixin_43355755
/
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,发现更多精彩内容 >>
未验证
提交
6688dd4d
编写于
4月 13, 2021
作者:
C
Chase Latta
提交者:
GitHub
4月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fuchsia] create component context in main (#25290)
上级
9482a8a1
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
31 addition
and
2 deletion
+31
-2
shell/platform/fuchsia/dart_runner/BUILD.gn
shell/platform/fuchsia/dart_runner/BUILD.gn
+1
-0
shell/platform/fuchsia/dart_runner/main.cc
shell/platform/fuchsia/dart_runner/main.cc
+14
-1
shell/platform/fuchsia/flutter/BUILD.gn
shell/platform/fuchsia/flutter/BUILD.gn
+1
-0
shell/platform/fuchsia/flutter/main.cc
shell/platform/fuchsia/flutter/main.cc
+15
-1
未找到文件。
shell/platform/fuchsia/dart_runner/BUILD.gn
浏览文件 @
6688dd4d
...
...
@@ -65,6 +65,7 @@ template("runner") {
"$fuchsia_sdk_root/pkg:async-loop-cpp",
"$fuchsia_sdk_root/pkg:async-loop-default",
"$fuchsia_sdk_root/pkg:fidl_cpp",
"$fuchsia_sdk_root/pkg:sys_inspect_cpp",
"$fuchsia_sdk_root/pkg:sys_cpp",
"$fuchsia_sdk_root/pkg:syslog",
"$fuchsia_sdk_root/pkg:trace",
...
...
shell/platform/fuchsia/dart_runner/main.cc
浏览文件 @
6688dd4d
...
...
@@ -4,6 +4,7 @@
#include <lib/async-loop/cpp/loop.h>
#include <lib/async-loop/default.h>
#include <lib/sys/inspect/cpp/component.h>
#include <lib/syslog/global.h>
#include <lib/trace-provider/provider.h>
#include <lib/trace/event.h>
...
...
@@ -34,6 +35,14 @@ static void RegisterProfilerSymbols(const char* symbols_path,
int
main
(
int
argc
,
const
char
**
argv
)
{
async
::
Loop
loop
(
&
kAsyncLoopConfigAttachToCurrentThread
);
// Create our component context which is served later.
auto
context
=
sys
::
ComponentContext
::
Create
();
sys
::
ComponentInspector
inspector
(
context
.
get
());
inspect
::
Node
&
root
=
inspector
.
inspector
()
->
GetRoot
();
dart
::
SetDartVmNode
(
std
::
make_unique
<
inspect
::
Node
>
(
root
.
CreateChild
(
"vm"
)));
std
::
unique_ptr
<
trace
::
TraceProviderWithFdio
>
provider
;
{
bool
already_started
;
...
...
@@ -51,7 +60,11 @@ int main(int argc, const char** argv) {
#endif // !defined(DART_PRODUCT)
dart_utils
::
RunnerTemp
runner_temp
;
dart_runner
::
DartRunner
runner
(
dart
::
ComponentContext
());
dart_runner
::
DartRunner
runner
(
context
.
get
());
// Wait to serve until we have finished all of our setup.
context
->
outgoing
()
->
ServeFromStartupInfo
();
loop
.
Run
();
return
0
;
}
shell/platform/fuchsia/flutter/BUILD.gn
浏览文件 @
6688dd4d
...
...
@@ -124,6 +124,7 @@ template("runner_sources") {
public_deps = [
"$fuchsia_sdk_root/pkg:scenic_cpp",
"$fuchsia_sdk_root/pkg:sys_cpp",
"$fuchsia_sdk_root/pkg:sys_inspect_cpp",
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
] + flutter_public_deps
...
...
shell/platform/fuchsia/flutter/main.cc
浏览文件 @
6688dd4d
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <lib/async-loop/cpp/loop.h>
#include <lib/sys/inspect/cpp/component.h>
#include <lib/trace-provider/provider.h>
#include <lib/trace/event.h>
...
...
@@ -16,6 +17,16 @@
int
main
(
int
argc
,
char
const
*
argv
[])
{
std
::
unique_ptr
<
async
::
Loop
>
loop
(
flutter_runner
::
MakeObservableLoop
(
true
));
// Create our component context which is served later.
auto
context
=
sys
::
ComponentContext
::
Create
();
sys
::
ComponentInspector
inspector
(
context
.
get
());
inspect
::
Node
&
root
=
inspector
.
inspector
()
->
GetRoot
();
// We inject the 'vm' node into the dart vm so that it can add any inspect
// data that it needs to the inspect tree.
dart
::
SetDartVmNode
(
std
::
make_unique
<
inspect
::
Node
>
(
root
.
CreateChild
(
"vm"
)));
std
::
unique_ptr
<
trace
::
TraceProviderWithFdio
>
provider
;
{
bool
already_started
;
...
...
@@ -29,7 +40,10 @@ int main(int argc, char const* argv[]) {
FML_DLOG
(
INFO
)
<<
"Flutter application services initialized."
;
flutter_runner
::
Runner
runner
(
loop
.
get
(),
dart
::
ComponentContext
());
flutter_runner
::
Runner
runner
(
loop
.
get
(),
context
.
get
());
// Wait to serve until we have finished all of our setup.
context
->
outgoing
()
->
ServeFromStartupInfo
();
loop
->
Run
();
FML_DLOG
(
INFO
)
<<
"Flutter application services terminated."
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录