Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
69ae5694
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
69ae5694
编写于
10月 03, 2018
作者:
J
Jason Simmons
提交者:
GitHub
10月 03, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not register UI-related native functions in secondary isolates (#6401)
Fixes
https://github.com/flutter/flutter/issues/22478
上级
19c135c6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
4 deletion
+23
-4
lib/ui/dart_ui.cc
lib/ui/dart_ui.cc
+21
-2
lib/ui/dart_ui.h
lib/ui/dart_ui.h
+1
-1
runtime/dart_isolate.cc
runtime/dart_isolate.cc
+1
-1
未找到文件。
lib/ui/dart_ui.cc
浏览文件 @
69ae5694
...
...
@@ -35,6 +35,7 @@ namespace blink {
namespace
{
static
tonic
::
DartLibraryNatives
*
g_natives
;
static
tonic
::
DartLibraryNatives
*
g_natives_secondary
;
Dart_NativeFunction
GetNativeFunction
(
Dart_Handle
name
,
int
argument_count
,
...
...
@@ -42,10 +43,21 @@ Dart_NativeFunction GetNativeFunction(Dart_Handle name,
return
g_natives
->
GetNativeFunction
(
name
,
argument_count
,
auto_setup_scope
);
}
Dart_NativeFunction
GetNativeFunctionSecondary
(
Dart_Handle
name
,
int
argument_count
,
bool
*
auto_setup_scope
)
{
return
g_natives_secondary
->
GetNativeFunction
(
name
,
argument_count
,
auto_setup_scope
);
}
const
uint8_t
*
GetSymbol
(
Dart_NativeFunction
native_function
)
{
return
g_natives
->
GetSymbol
(
native_function
);
}
const
uint8_t
*
GetSymbolSecondary
(
Dart_NativeFunction
native_function
)
{
return
g_natives_secondary
->
GetSymbol
(
native_function
);
}
}
// namespace
void
DartUI
::
InitForGlobal
()
{
...
...
@@ -73,13 +85,20 @@ void DartUI::InitForGlobal() {
SemanticsUpdateBuilder
::
RegisterNatives
(
g_natives
);
Vertices
::
RegisterNatives
(
g_natives
);
Window
::
RegisterNatives
(
g_natives
);
// Secondary isolates do not provide UI-related APIs.
g_natives_secondary
=
new
tonic
::
DartLibraryNatives
();
DartRuntimeHooks
::
RegisterNatives
(
g_natives_secondary
);
}
}
void
DartUI
::
InitForIsolate
()
{
void
DartUI
::
InitForIsolate
(
bool
is_root_isolate
)
{
FML_DCHECK
(
g_natives
);
auto
get_native_function
=
is_root_isolate
?
GetNativeFunction
:
GetNativeFunctionSecondary
;
auto
get_symbol
=
is_root_isolate
?
GetSymbol
:
GetSymbolSecondary
;
DART_CHECK_VALID
(
Dart_SetNativeResolver
(
Dart_LookupLibrary
(
ToDart
(
"dart:ui"
)),
GetNativeFunction
,
GetS
ymbol
));
get_native_function
,
get_s
ymbol
));
}
}
// namespace blink
lib/ui/dart_ui.h
浏览文件 @
69ae5694
...
...
@@ -12,7 +12,7 @@ namespace blink {
class
DartUI
{
public:
static
void
InitForGlobal
();
static
void
InitForIsolate
();
static
void
InitForIsolate
(
bool
is_root_isolate
);
private:
FML_DISALLOW_IMPLICIT_CONSTRUCTORS
(
DartUI
);
...
...
runtime/dart_isolate.cc
浏览文件 @
69ae5694
...
...
@@ -243,7 +243,7 @@ bool DartIsolate::LoadLibraries(bool is_root_isolate) {
DartIO
::
InitForIsolate
();
DartUI
::
InitForIsolate
();
DartUI
::
InitForIsolate
(
is_root_isolate
);
const
bool
is_service_isolate
=
Dart_IsServiceIsolate
(
isolate
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录