Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
15062ca7
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,发现更多精彩内容 >>
未验证
提交
15062ca7
编写于
2月 12, 2020
作者:
G
George Wright
提交者:
GitHub
2月 12, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Re-arm timer as necessary in MessageLoopFuchsia" (#16568)
This reverts commit
8ec994b4
.
上级
c4c6ef67
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
44 deletion
+4
-44
fml/message_loop_unittests.cc
fml/message_loop_unittests.cc
+0
-30
fml/platform/fuchsia/message_loop_fuchsia.cc
fml/platform/fuchsia/message_loop_fuchsia.cc
+4
-11
fml/platform/fuchsia/message_loop_fuchsia.h
fml/platform/fuchsia/message_loop_fuchsia.h
+0
-3
未找到文件。
fml/message_loop_unittests.cc
浏览文件 @
15062ca7
...
...
@@ -10,7 +10,6 @@
#include "flutter/fml/build_config.h"
#include "flutter/fml/concurrent_message_loop.h"
#include "flutter/fml/message_loop.h"
#include "flutter/fml/message_loop_impl.h"
#include "flutter/fml/synchronization/count_down_latch.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/task_runner.h"
...
...
@@ -316,32 +315,3 @@ TEST(MessageLoop, CanCreateConcurrentMessageLoop) {
latch
.
Wait
();
ASSERT_GE
(
thread_ids
.
size
(),
1u
);
}
TEST
(
MessageLoop
,
TIME_SENSITIVE
(
WakeUpTimersAreSingletons
))
{
auto
loop_impl
=
fml
::
MessageLoopImpl
::
Create
();
const
auto
t1
=
fml
::
TimeDelta
::
FromMilliseconds
(
10
);
const
auto
t2
=
fml
::
TimeDelta
::
FromMilliseconds
(
20
);
const
auto
begin
=
fml
::
TimePoint
::
Now
();
// Register a task scheduled for 10ms in the future. This schedules a
// WakeUp call on the MessageLoopImpl with that fml::TimePoint
loop_impl
->
PostTask
(
[
&
]()
{
auto
delta
=
fml
::
TimePoint
::
Now
()
-
begin
;
auto
ms
=
delta
.
ToMillisecondsF
();
ASSERT_GE
(
ms
,
10
);
ASSERT_LE
(
ms
,
25
);
loop_impl
->
Terminate
();
},
fml
::
TimePoint
::
Now
()
+
t1
);
// Call WakeUp manually to change the WakeUp time to the future. If the
// timer is correctly set up to be rearmed instead of a new timer scheduled,
// the above task will be executed at t2 instead of t1 now.
loop_impl
->
WakeUp
(
fml
::
TimePoint
::
Now
()
+
t2
);
loop_impl
->
Run
();
}
fml/platform/fuchsia/message_loop_fuchsia.cc
浏览文件 @
15062ca7
...
...
@@ -5,16 +5,13 @@
#include "flutter/fml/platform/fuchsia/message_loop_fuchsia.h"
#include <lib/async-loop/default.h>
#include <lib/async/cpp/task.h>
#include <lib/zx/time.h>
namespace
fml
{
MessageLoopFuchsia
::
MessageLoopFuchsia
()
:
loop_
(
&
kAsyncLoopConfigAttachToCurrentThread
)
{
auto
handler
=
[
this
](
async_dispatcher_t
*
dispatcher
,
async
::
Task
*
task
,
zx_status_t
status
)
{
RunExpiredTasksNow
();
};
task_
.
set_handler
(
handler
);
}
:
loop_
(
&
kAsyncLoopConfigAttachToCurrentThread
)
{}
MessageLoopFuchsia
::~
MessageLoopFuchsia
()
=
default
;
...
...
@@ -33,12 +30,8 @@ void MessageLoopFuchsia::WakeUp(fml::TimePoint time_point) {
due_time
=
zx
::
nsec
((
time_point
-
now
).
ToNanoseconds
());
}
std
::
scoped_lock
lock
(
task_mutex_
);
auto
status
=
task_
.
Cancel
();
FML_DCHECK
(
status
==
ZX_OK
||
status
==
ZX_ERR_NOT_FOUND
);
status
=
task_
.
PostDelayed
(
loop_
.
dispatcher
(),
due_time
);
auto
status
=
async
::
PostDelayedTask
(
loop_
.
dispatcher
(),
[
this
]()
{
RunExpiredTasksNow
();
},
due_time
);
FML_DCHECK
(
status
==
ZX_OK
);
}
...
...
fml/platform/fuchsia/message_loop_fuchsia.h
浏览文件 @
15062ca7
...
...
@@ -6,7 +6,6 @@
#define FLUTTER_FML_PLATFORM_FUCHSIA_MESSAGE_LOOP_FUCHSIA_H_
#include <lib/async-loop/cpp/loop.h>
#include <lib/async/cpp/task.h>
#include "flutter/fml/macros.h"
#include "flutter/fml/message_loop_impl.h"
...
...
@@ -26,8 +25,6 @@ class MessageLoopFuchsia : public MessageLoopImpl {
void
WakeUp
(
fml
::
TimePoint
time_point
)
override
;
async
::
Loop
loop_
;
std
::
mutex
task_mutex_
;
async
::
Task
task_
;
FML_FRIEND_MAKE_REF_COUNTED
(
MessageLoopFuchsia
);
FML_FRIEND_REF_COUNTED_THREAD_SAFE
(
MessageLoopFuchsia
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录