Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
2323a17a
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,发现更多精彩内容 >>
提交
2323a17a
编写于
3月 23, 2017
作者:
C
Chinmay Garde
提交者:
GitHub
3月 23, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove last reference to //base from //flutter/shell/platform/linux. (#3511)
上级
3f269db7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
25 deletion
+21
-25
shell/platform/linux/BUILD.gn
shell/platform/linux/BUILD.gn
+1
-2
shell/platform/linux/main_linux.cc
shell/platform/linux/main_linux.cc
+20
-23
未找到文件。
shell/platform/linux/BUILD.gn
浏览文件 @
2323a17a
...
@@ -10,11 +10,10 @@ executable("linux") {
...
@@ -10,11 +10,10 @@ executable("linux") {
]
]
deps = [
deps = [
"//base",
"//dart/runtime/bin:embedded_dart_io",
"//dart/runtime/bin:embedded_dart_io",
"//flutter/common",
"//flutter/common",
"//flutter/fml",
"//flutter/shell/common",
"//flutter/shell/common",
"//flutter/shell/gpu",
"//flutter/shell/testing",
"//flutter/shell/testing",
"//lib/ftl",
"//lib/ftl",
"//lib/tonic",
"//lib/tonic",
...
...
shell/platform/linux/main_linux.cc
浏览文件 @
2323a17a
...
@@ -2,12 +2,9 @@
...
@@ -2,12 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "dart/runtime/bin/embedded_dart_io.h"
#include "dart/runtime/bin/embedded_dart_io.h"
#include "flutter/common/threads.h"
#include "flutter/common/threads.h"
#include "flutter/fml/message_loop.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/switches.h"
#include "flutter/shell/common/switches.h"
...
@@ -26,31 +23,29 @@ const int kErrorExitCode = 255;
...
@@ -26,31 +23,29 @@ const int kErrorExitCode = 255;
// Checks whether the engine's main Dart isolate has no pending work. If so,
// Checks whether the engine's main Dart isolate has no pending work. If so,
// then exit the given message loop.
// then exit the given message loop.
class
ScriptCompletionTaskObserver
:
public
base
::
MessageLoop
::
TaskObserver
{
class
ScriptCompletionTaskObserver
:
public
fml
::
TaskObserver
{
public:
public:
ScriptCompletionTaskObserver
(
base
::
MessageLoop
&
main_message_loop
)
ScriptCompletionTaskObserver
(
ftl
::
RefPtr
<
ftl
::
TaskRunner
>
task_runner
)
:
main_
message_loop_
(
main_message_loop
),
:
main_
task_runner_
(
std
::
move
(
task_runner
)
),
prev_live_
(
false
),
prev_live_
(
false
),
last_error_
(
tonic
::
kNoError
)
{}
last_error_
(
tonic
::
kNoError
)
{}
void
WillProcessTask
(
const
base
::
PendingTask
&
pending_task
)
override
{}
void
DidProcessTask
()
override
{
void
DidProcessTask
(
const
base
::
PendingTask
&
pending_task
)
override
{
shell
::
TestRunner
&
test_runner
=
shell
::
TestRunner
::
Shared
();
shell
::
TestRunner
&
test_runner
=
shell
::
TestRunner
::
Shared
();
shell
::
Engine
&
engine
=
test_runner
.
platform_view
().
engine
();
shell
::
Engine
&
engine
=
test_runner
.
platform_view
().
engine
();
if
(
engine
.
GetLoadScriptError
()
!=
tonic
::
kNoError
)
{
if
(
engine
.
GetLoadScriptError
()
!=
tonic
::
kNoError
)
{
last_error_
=
engine
.
GetLoadScriptError
();
last_error_
=
engine
.
GetLoadScriptError
();
main_
message_loop_
.
PostTask
(
FROM_HERE
,
main_
task_runner_
->
PostTask
(
main_message_loop_
.
QuitWhenIdleClosure
()
);
[]()
{
fml
::
MessageLoop
::
GetCurrent
().
Terminate
();
}
);
return
;
return
;
}
}
bool
live
=
engine
.
UIIsolateHasLivePorts
();
bool
live
=
engine
.
UIIsolateHasLivePorts
();
if
(
prev_live_
&&
!
live
)
{
if
(
prev_live_
&&
!
live
)
{
last_error_
=
engine
.
GetUIIsolateLastError
();
last_error_
=
engine
.
GetUIIsolateLastError
();
main_
message_loop_
.
PostTask
(
FROM_HERE
,
main_
task_runner_
->
PostTask
(
main_message_loop_
.
QuitWhenIdleClosure
()
);
[]()
{
fml
::
MessageLoop
::
GetCurrent
().
Terminate
();
}
);
}
}
prev_live_
=
live
;
prev_live_
=
live
;
}
}
...
@@ -58,7 +53,7 @@ class ScriptCompletionTaskObserver : public base::MessageLoop::TaskObserver {
...
@@ -58,7 +53,7 @@ class ScriptCompletionTaskObserver : public base::MessageLoop::TaskObserver {
tonic
::
DartErrorHandleType
last_error
()
{
return
last_error_
;
}
tonic
::
DartErrorHandleType
last_error
()
{
return
last_error_
;
}
private:
private:
base
::
MessageLoop
&
main_message_loop
_
;
ftl
::
RefPtr
<
ftl
::
TaskRunner
>
main_task_runner
_
;
bool
prev_live_
;
bool
prev_live_
;
tonic
::
DartErrorHandleType
last_error_
;
tonic
::
DartErrorHandleType
last_error_
;
};
};
...
@@ -78,25 +73,29 @@ int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) {
...
@@ -78,25 +73,29 @@ int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) {
void
RunNonInteractive
(
ftl
::
CommandLine
initial_command_line
,
void
RunNonInteractive
(
ftl
::
CommandLine
initial_command_line
,
bool
run_forever
)
{
bool
run_forever
)
{
base
::
MessageLoop
message_loop
;
// This is a platform thread (i.e not one created by fml::Thread), so perform
// one time initialization.
fml
::
MessageLoop
::
EnsureInitializedForCurrentThread
();
shell
::
Shell
::
InitStandalone
(
initial_command_line
);
shell
::
Shell
::
InitStandalone
(
initial_command_line
);
// Note that this task observer must be added after the observer that drains
// Note that this task observer must be added after the observer that drains
// the microtask queue.
// the microtask queue.
ScriptCompletionTaskObserver
task_observer
(
message_loop
);
ScriptCompletionTaskObserver
task_observer
(
fml
::
MessageLoop
::
GetCurrent
().
GetTaskRunner
());
if
(
!
run_forever
)
{
if
(
!
run_forever
)
{
blink
::
Threads
::
UI
()
->
PostTask
([
&
task_observer
]
{
blink
::
Threads
::
UI
()
->
PostTask
([
&
task_observer
]
{
base
::
MessageLoop
::
current
()
->
AddTaskObserver
(
&
task_observer
);
fml
::
MessageLoop
::
GetCurrent
().
AddTaskObserver
(
&
task_observer
);
});
});
}
}
if
(
!
shell
::
InitForTesting
(
std
::
move
(
initial_command_line
)
))
{
if
(
!
shell
::
InitForTesting
(
initial_command_line
))
{
shell
::
PrintUsage
(
"sky_shell"
);
shell
::
PrintUsage
(
"sky_shell"
);
exit
(
1
);
exit
(
EXIT_FAILURE
);
return
;
}
}
message_loop
.
Run
();
fml
::
MessageLoop
::
GetCurrent
()
.
Run
();
shell
::
TestRunner
&
test_runner
=
shell
::
TestRunner
::
Shared
();
shell
::
TestRunner
&
test_runner
=
shell
::
TestRunner
::
Shared
();
tonic
::
DartErrorHandleType
error
=
tonic
::
DartErrorHandleType
error
=
...
@@ -117,8 +116,6 @@ int main(int argc, char* argv[]) {
...
@@ -117,8 +116,6 @@ int main(int argc, char* argv[]) {
dart
::
bin
::
SetExecutableName
(
argv
[
0
]);
dart
::
bin
::
SetExecutableName
(
argv
[
0
]);
dart
::
bin
::
SetExecutableArguments
(
argc
-
1
,
argv
);
dart
::
bin
::
SetExecutableArguments
(
argc
-
1
,
argv
);
base
::
AtExitManager
exit_manager
;
auto
command_line
=
ftl
::
CommandLineFromArgcArgv
(
argc
,
argv
);
auto
command_line
=
ftl
::
CommandLineFromArgcArgv
(
argc
,
argv
);
if
(
command_line
.
HasOption
(
shell
::
FlagForSwitch
(
shell
::
Switch
::
Help
)))
{
if
(
command_line
.
HasOption
(
shell
::
FlagForSwitch
(
shell
::
Switch
::
Help
)))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录