Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
54b81419
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,发现更多精彩内容 >>
提交
54b81419
编写于
11月 01, 2016
作者:
J
John McCutchan
提交者:
GitHub
11月 01, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix profile and release mode isolate spawning (#3191)
Fixes #6496
上级
cdd7db26
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
15 deletion
+19
-15
runtime/dart_init.cc
runtime/dart_init.cc
+19
-15
未找到文件。
runtime/dart_init.cc
浏览文件 @
54b81419
...
@@ -258,22 +258,25 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
...
@@ -258,22 +258,25 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
return
ServiceIsolateCreateCallback
(
script_uri
,
error
);
return
ServiceIsolateCreateCallback
(
script_uri
,
error
);
}
}
// Assert that entry script URI starts with file://
std
::
string
entry_uri
=
script_uri
;
std
::
string
entry_uri
=
script_uri
;
FTL_CHECK
(
entry_uri
.
find
(
kFileUriPrefix
)
==
0u
);
// Are we running from a Dart source file?
// Entry script path (file:// is stripped).
const
bool
running_from_source
=
StringEndsWith
(
entry_uri
,
".dart"
);
std
::
string
entry_path
(
script_uri
+
strlen
(
kFileUriPrefix
));
// Are we running a .dart source file?
const
bool
running_from_source
=
StringEndsWith
(
entry_path
,
".dart"
);
std
::
vector
<
uint8_t
>
snapshot_data
;
std
::
vector
<
uint8_t
>
snapshot_data
;
if
(
!
IsRunningPrecompiledCode
()
&&
!
running_from_source
)
{
std
::
string
entry_path
;
// Attempt to copy the snapshot from the asset bundle.
if
(
!
IsRunningPrecompiledCode
())
{
const
std
::
string
&
bundle_path
=
entry_path
;
// Assert that entry script URI starts with file://
ftl
::
RefPtr
<
ZipAssetStore
>
zip_asset_store
=
FTL_CHECK
(
entry_uri
.
find
(
kFileUriPrefix
)
==
0u
);
ftl
::
MakeRefCounted
<
ZipAssetStore
>
(
// Entry script path (file:// is stripped).
GetUnzipperProviderForPath
(
std
::
move
(
bundle_path
)));
entry_path
=
std
::
string
(
script_uri
+
strlen
(
kFileUriPrefix
));
zip_asset_store
->
GetAsBuffer
(
kSnapshotAssetKey
,
&
snapshot_data
);
if
(
!
running_from_source
)
{
// Attempt to copy the snapshot from the asset bundle.
const
std
::
string
&
bundle_path
=
entry_path
;
ftl
::
RefPtr
<
ZipAssetStore
>
zip_asset_store
=
ftl
::
MakeRefCounted
<
ZipAssetStore
>
(
GetUnzipperProviderForPath
(
std
::
move
(
bundle_path
)));
zip_asset_store
->
GetAsBuffer
(
kSnapshotAssetKey
,
&
snapshot_data
);
}
}
}
UIDartState
*
parent_dart_state
=
static_cast
<
UIDartState
*>
(
callback_data
);
UIDartState
*
parent_dart_state
=
static_cast
<
UIDartState
*>
(
callback_data
);
...
@@ -311,7 +314,8 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
...
@@ -311,7 +314,8 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
// We are running from a script snapshot.
// We are running from a script snapshot.
FTL_CHECK
(
!
LogIfError
(
Dart_LoadScriptFromSnapshot
(
snapshot_data
.
data
(),
FTL_CHECK
(
!
LogIfError
(
Dart_LoadScriptFromSnapshot
(
snapshot_data
.
data
(),
snapshot_data
.
size
())));
snapshot_data
.
size
())));
}
else
{
}
else
if
(
running_from_source
)
{
// We are running from source.
// Forward the .packages configuration from the parent isolate to the
// Forward the .packages configuration from the parent isolate to the
// child isolate.
// child isolate.
tonic
::
FileLoader
&
parent_loader
=
parent_dart_state
->
file_loader
();
tonic
::
FileLoader
&
parent_loader
=
parent_dart_state
->
file_loader
();
...
@@ -320,7 +324,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
...
@@ -320,7 +324,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
if
(
!
packages
.
empty
()
&&
!
loader
.
LoadPackagesMap
(
packages
))
{
if
(
!
packages
.
empty
()
&&
!
loader
.
LoadPackagesMap
(
packages
))
{
FTL_LOG
(
WARNING
)
<<
"Failed to load package map: "
<<
packages
;
FTL_LOG
(
WARNING
)
<<
"Failed to load package map: "
<<
packages
;
}
}
//
We are running from source
.
//
Load the script
.
FTL_CHECK
(
!
LogIfError
(
loader
.
LoadScript
(
entry_path
)));
FTL_CHECK
(
!
LogIfError
(
loader
.
LoadScript
(
entry_path
)));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录