Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
8f638591
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,发现更多精彩内容 >>
未验证
提交
8f638591
编写于
2月 02, 2018
作者:
Z
Zachary Anderson
提交者:
GitHub
2月 02, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fuchsia] Enable running from source packages (#4629)
上级
c375ff54
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
9 deletion
+30
-9
content_handler/application_controller_impl.cc
content_handler/application_controller_impl.cc
+1
-0
content_handler/runtime_holder.cc
content_handler/runtime_holder.cc
+16
-3
content_handler/runtime_holder.h
content_handler/runtime_holder.h
+1
-0
lib/ui/ui_dart_state.cc
lib/ui/ui_dart_state.cc
+4
-2
lib/ui/ui_dart_state.h
lib/ui/ui_dart_state.h
+3
-1
runtime/runtime_controller.cc
runtime/runtime_controller.cc
+3
-2
runtime/runtime_controller.h
runtime/runtime_controller.h
+2
-1
未找到文件。
content_handler/application_controller_impl.cc
浏览文件 @
8f638591
...
...
@@ -64,6 +64,7 @@ ApplicationControllerImpl::ApplicationControllerImpl(
fdio_ns_t
*
fdio_ns
=
SetupNamespace
(
startup_info
->
flat_namespace
);
if
(
fdio_ns
==
nullptr
)
{
FXL_LOG
(
ERROR
)
<<
"Failed to initialize namespace"
;
return
;
}
url_
=
startup_info
->
launch_info
->
url
;
...
...
content_handler/runtime_holder.cc
浏览文件 @
8f638591
...
...
@@ -24,10 +24,12 @@
#include "flutter/runtime/runtime_init.h"
#include "lib/app/cpp/connect.h"
#include "lib/fsl/vmo/vector.h"
#include "lib/fxl/files/path.h"
#include "lib/fxl/files/unique_fd.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/logging.h"
#include "lib/fxl/time/time_delta.h"
#include "lib/tonic/logging/dart_error.h"
#include "lib/zip/create_unzipper.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/rapidjson/rapidjson/document.h"
...
...
@@ -115,6 +117,11 @@ void RuntimeHolder::Init(
FXL_DCHECK
(
rasterizer_
);
namespc_
=
namespc
;
dirfd_
=
fdio_ns_opendir
(
namespc
);
if
(
dirfd_
==
-
1
)
{
FXL_LOG
(
ERROR
)
<<
"Failed to get fd for namespace"
;
return
;
}
context_
=
std
::
move
(
context
);
outgoing_services_
=
std
::
move
(
outgoing_services
);
...
...
@@ -196,11 +203,12 @@ void RuntimeHolder::CreateView(
std
::
vector
<
uint8_t
>
kernel
;
std
::
vector
<
uint8_t
>
snapshot
;
bool
maybe_running_from_source
=
false
;
if
(
!
Dart_IsPrecompiledRuntime
())
{
if
(
!
GetAssetAsBuffer
(
kKernelKey
,
&
kernel
)
&&
!
GetAssetAsBuffer
(
kSnapshotKey
,
&
snapshot
))
{
FXL_LOG
(
ERROR
)
<<
"Unable to load kernel or snapshot from root bundle."
;
return
;
maybe_running_from_source
=
true
;
FXL_LOG
(
INFO
)
<<
"No kernel or snapshot in root bundle."
;
}
}
...
...
@@ -273,7 +281,7 @@ void RuntimeHolder::CreateView(
dlsym
(
dylib_handle_
,
"_kDartIsolateSnapshotInstructions"
));
}
runtime_
->
CreateDartController
(
script_uri
,
isolate_snapshot_data
,
isolate_snapshot_instr
);
isolate_snapshot_instr
,
dirfd_
);
runtime_
->
SetViewportMetrics
(
viewport_metrics_
);
...
...
@@ -281,6 +289,11 @@ void RuntimeHolder::CreateView(
runtime_
->
dart_controller
()
->
RunFromPrecompiledSnapshot
();
}
else
if
(
!
kernel
.
empty
())
{
runtime_
->
dart_controller
()
->
RunFromKernel
(
std
::
move
(
kernel
));
}
else
if
(
maybe_running_from_source
)
{
std
::
string
basename
=
files
::
GetBaseName
(
script_uri
);
std
::
string
main_dart
=
"pkg/data/"
+
basename
+
"/lib/main.dart"
;
FXL_LOG
(
INFO
)
<<
"Running from source with entrypoint: '"
<<
main_dart
<<
"'"
;
runtime_
->
dart_controller
()
->
RunFromSource
(
main_dart
,
"pkg/data/.packages"
);
}
else
{
runtime_
->
dart_controller
()
->
RunFromScriptSnapshot
(
snapshot
.
data
(),
snapshot
.
size
());
...
...
content_handler/runtime_holder.h
浏览文件 @
8f638591
...
...
@@ -109,6 +109,7 @@ class RuntimeHolder : public blink::RuntimeDelegate,
void
Invalidate
();
fdio_ns_t
*
namespc_
;
int
dirfd_
;
std
::
unique_ptr
<
app
::
ApplicationContext
>
context_
;
fidl
::
InterfaceRequest
<
app
::
ServiceProvider
>
outgoing_services_
;
std
::
vector
<
char
>
root_bundle_data_
;
...
...
lib/ui/ui_dart_state.cc
浏览文件 @
8f638591
...
...
@@ -15,8 +15,10 @@ namespace blink {
IsolateClient
::~
IsolateClient
()
{}
UIDartState
::
UIDartState
(
IsolateClient
*
isolate_client
,
std
::
unique_ptr
<
Window
>
window
)
:
isolate_client_
(
isolate_client
),
std
::
unique_ptr
<
Window
>
window
,
int
dirfd
)
:
tonic
::
DartState
(
dirfd
),
isolate_client_
(
isolate_client
),
main_port_
(
ILLEGAL_PORT
),
window_
(
std
::
move
(
window
))
{}
...
...
lib/ui/ui_dart_state.h
浏览文件 @
8f638591
...
...
@@ -28,7 +28,9 @@ class IsolateClient {
class
UIDartState
:
public
tonic
::
DartState
{
public:
UIDartState
(
IsolateClient
*
isolate_client
,
std
::
unique_ptr
<
Window
>
window
);
UIDartState
(
IsolateClient
*
isolate_client
,
std
::
unique_ptr
<
Window
>
window
,
int
dirfd
=
-
1
);
~
UIDartState
()
override
;
static
UIDartState
*
Current
();
...
...
runtime/runtime_controller.cc
浏览文件 @
8f638591
...
...
@@ -29,13 +29,14 @@ RuntimeController::~RuntimeController() {}
void
RuntimeController
::
CreateDartController
(
const
std
::
string
&
script_uri
,
const
uint8_t
*
isolate_snapshot_data
,
const
uint8_t
*
isolate_snapshot_instr
)
{
const
uint8_t
*
isolate_snapshot_instr
,
int
dirfd
)
{
FXL_DCHECK
(
!
dart_controller_
);
dart_controller_
.
reset
(
new
DartController
());
dart_controller_
->
CreateIsolateFor
(
script_uri
,
isolate_snapshot_data
,
isolate_snapshot_instr
,
std
::
make_unique
<
UIDartState
>
(
this
,
std
::
make_unique
<
Window
>
(
this
)));
std
::
make_unique
<
UIDartState
>
(
this
,
std
::
make_unique
<
Window
>
(
this
)
,
dirfd
));
UIDartState
*
dart_state
=
dart_controller_
->
dart_state
();
DartState
::
Scope
scope
(
dart_state
);
...
...
runtime/runtime_controller.h
浏览文件 @
8f638591
...
...
@@ -28,7 +28,8 @@ class RuntimeController : public WindowClient, public IsolateClient {
void
CreateDartController
(
const
std
::
string
&
script_uri
,
const
uint8_t
*
isolate_snapshot_data
,
const
uint8_t
*
isolate_snapshot_instr
);
const
uint8_t
*
isolate_snapshot_instr
,
int
dirfd
=
-
1
);
DartController
*
dart_controller
()
const
{
return
dart_controller_
.
get
();
}
void
SetViewportMetrics
(
const
ViewportMetrics
&
metrics
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录