Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
a925df18
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,发现更多精彩内容 >>
未验证
提交
a925df18
编写于
10月 16, 2019
作者:
C
Chinmay Garde
提交者:
GitHub
10月 16, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove incomplete static thread safety annotations. (#13151)
Fixes
https://github.com/flutter/flutter/issues/42704
.
上级
ee1a140f
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
30 addition
and
281 deletion
+30
-281
ci/licenses_golden/licenses_flutter
ci/licenses_golden/licenses_flutter
+0
-2
fml/BUILD.gn
fml/BUILD.gn
+0
-2
fml/concurrent_message_loop.h
fml/concurrent_message_loop.h
+0
-1
fml/message_loop_impl.h
fml/message_loop_impl.h
+0
-1
fml/message_loop_task_queues.h
fml/message_loop_task_queues.h
+1
-3
fml/message_loop_unittests.cc
fml/message_loop_unittests.cc
+1
-0
fml/synchronization/thread_annotations.h
fml/synchronization/thread_annotations.h
+0
-91
fml/synchronization/thread_annotations_unittest.cc
fml/synchronization/thread_annotations_unittest.cc
+0
-127
fml/synchronization/waitable_event.cc
fml/synchronization/waitable_event.cc
+1
-1
fml/synchronization/waitable_event.h
fml/synchronization/waitable_event.h
+0
-1
lib/ui/isolate_name_server/isolate_name_server.h
lib/ui/isolate_name_server/isolate_name_server.h
+5
-10
lib/ui/plugins/callback_cache.h
lib/ui/plugins/callback_cache.h
+6
-9
runtime/dart_service_isolate.cc
runtime/dart_service_isolate.cc
+0
-1
runtime/dart_service_isolate.h
runtime/dart_service_isolate.h
+1
-3
runtime/dart_vm.cc
runtime/dart_vm.cc
+0
-1
runtime/dart_vm_lifecycle.cc
runtime/dart_vm_lifecycle.cc
+5
-8
runtime/service_protocol.h
runtime/service_protocol.h
+0
-1
shell/common/persistent_cache.h
shell/common/persistent_cache.h
+2
-5
shell/common/shell.h
shell/common/shell.h
+0
-1
shell/common/shell_test.h
shell/common/shell_test.h
+2
-3
shell/common/vsync_waiter.h
shell/common/vsync_waiter.h
+2
-3
shell/platform/darwin/ios/platform_view_ios.h
shell/platform/darwin/ios/platform_view_ios.h
+1
-1
shell/platform/embedder/embedder_task_runner.h
shell/platform/embedder/embedder_task_runner.h
+2
-4
testing/test_dart_native_resolver.cc
testing/test_dart_native_resolver.cc
+1
-2
未找到文件。
ci/licenses_golden/licenses_flutter
浏览文件 @
a925df18
...
...
@@ -203,8 +203,6 @@ FILE: ../../../flutter/fml/synchronization/semaphore_unittest.cc
FILE: ../../../flutter/fml/synchronization/shared_mutex.h
FILE: ../../../flutter/fml/synchronization/shared_mutex_std.cc
FILE: ../../../flutter/fml/synchronization/shared_mutex_std.h
FILE: ../../../flutter/fml/synchronization/thread_annotations.h
FILE: ../../../flutter/fml/synchronization/thread_annotations_unittest.cc
FILE: ../../../flutter/fml/synchronization/waitable_event.cc
FILE: ../../../flutter/fml/synchronization/waitable_event.h
FILE: ../../../flutter/fml/synchronization/waitable_event_unittest.cc
...
...
fml/BUILD.gn
浏览文件 @
a925df18
...
...
@@ -60,7 +60,6 @@ source_set("fml") {
"synchronization/semaphore.cc",
"synchronization/semaphore.h",
"synchronization/shared_mutex.h",
"synchronization/thread_annotations.h",
"synchronization/waitable_event.cc",
"synchronization/waitable_event.h",
"task_runner.cc",
...
...
@@ -212,7 +211,6 @@ executable("fml_unittests") {
"platform/darwin/string_range_sanitization_unittests.mm",
"synchronization/count_down_latch_unittests.cc",
"synchronization/semaphore_unittest.cc",
"synchronization/thread_annotations_unittest.cc",
"synchronization/waitable_event_unittest.cc",
"thread_local_unittests.cc",
"thread_unittests.cc",
...
...
fml/concurrent_message_loop.h
浏览文件 @
a925df18
...
...
@@ -11,7 +11,6 @@
#include "flutter/fml/closure.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
namespace
fml
{
...
...
fml/message_loop_impl.h
浏览文件 @
a925df18
...
...
@@ -18,7 +18,6 @@
#include "flutter/fml/memory/ref_counted.h"
#include "flutter/fml/message_loop.h"
#include "flutter/fml/message_loop_task_queues.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/time/time_point.h"
#include "flutter/fml/wakeable.h"
...
...
fml/message_loop_task_queues.h
浏览文件 @
a925df18
...
...
@@ -14,7 +14,6 @@
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/ref_counted.h"
#include "flutter/fml/synchronization/shared_mutex.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/wakeable.h"
namespace
fml
{
...
...
@@ -146,8 +145,7 @@ class MessageLoopTaskQueues
fml
::
TimePoint
GetNextWakeTimeUnlocked
(
TaskQueueId
queue_id
)
const
;
static
std
::
mutex
creation_mutex_
;
static
fml
::
RefPtr
<
MessageLoopTaskQueues
>
instance_
FML_GUARDED_BY
(
creation_mutex_
);
static
fml
::
RefPtr
<
MessageLoopTaskQueues
>
instance_
;
std
::
unique_ptr
<
fml
::
SharedMutex
>
queue_meta_mutex_
;
std
::
map
<
TaskQueueId
,
std
::
unique_ptr
<
TaskQueueEntry
>>
queue_entries_
;
...
...
fml/message_loop_unittests.cc
浏览文件 @
a925df18
...
...
@@ -7,6 +7,7 @@
#include <iostream>
#include <thread>
#include "flutter/fml/build_config.h"
#include "flutter/fml/concurrent_message_loop.h"
#include "flutter/fml/message_loop.h"
#include "flutter/fml/synchronization/count_down_latch.h"
...
...
fml/synchronization/thread_annotations.h
已删除
100644 → 0
浏览文件 @
ee1a140f
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Macros for static thread-safety analysis.
//
// These are from http://clang.llvm.org/docs/ThreadSafetyAnalysis.html (and thus
// really derive from google3's thread_annotations.h).
//
// TODO(vtl): We're still using the old-fashioned, deprecated annotations
// ("locks" instead of "capabilities"), since the new ones don't work yet (in
// particular, |TRY_ACQUIRE()| doesn't work: b/19264527).
// https://github.com/domokit/mojo/issues/314
#ifndef FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_
#define FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_
#include "flutter/fml/build_config.h"
// Enable thread-safety attributes only with clang.
// The attributes can be safely erased when compiling with other compilers.
#if defined(__clang__) && !defined(OS_ANDROID)
#define FML_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
#define FML_THREAD_ANNOTATION_ATTRIBUTE__(x)
#endif
#define FML_GUARDED_BY(x) FML_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
#define FML_PT_GUARDED_BY(x) FML_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
#define FML_ACQUIRE(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
#define FML_RELEASE(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
#define FML_ACQUIRED_AFTER(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
#define FML_ACQUIRED_BEFORE(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
#define FML_EXCLUSIVE_LOCKS_REQUIRED(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
#define FML_SHARED_LOCKS_REQUIRED(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__))
#define FML_LOCKS_EXCLUDED(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
#define FML_LOCK_RETURNED(x) FML_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
#define FML_LOCKABLE FML_THREAD_ANNOTATION_ATTRIBUTE__(lockable)
#define FML_SCOPED_LOCKABLE FML_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
#define FML_EXCLUSIVE_LOCK_FUNCTION(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__))
#define FML_SHARED_LOCK_FUNCTION(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__))
#define FML_ASSERT_EXCLUSIVE_LOCK(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__))
#define FML_ASSERT_SHARED_LOCK(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__))
#define FML_EXCLUSIVE_TRYLOCK_FUNCTION(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__))
#define FML_SHARED_TRYLOCK_FUNCTION(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__))
#define FML_UNLOCK_FUNCTION(...) \
FML_THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__))
#define FML_NO_THREAD_SAFETY_ANALYSIS \
FML_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
// Use this in the header to annotate a function/method as not being
// thread-safe. This is equivalent to |FML_NO_THREAD_SAFETY_ANALYSIS|, but
// semantically different: it declares that the caller must abide by additional
// restrictions. Limitation: Unfortunately, you can't apply this to a method in
// an interface (i.e., pure virtual method) and have it applied automatically to
// implementations.
#define FML_NOT_THREAD_SAFE FML_NO_THREAD_SAFETY_ANALYSIS
#endif // FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_
fml/synchronization/thread_annotations_unittest.cc
已删除
100644 → 0
浏览文件 @
ee1a140f
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Tests of the static thread annotation macros. These fall into two categories,
// positive tests (testing that correct code compiles and works) and negative
// tests (testing that incorrect code does not compile).
//
// Unfortunately, we don't have systematic/automated negative compilation tests.
// So instead we have some cheesy macros that you can define to enable
// individual compilation failures.
#include "flutter/fml/synchronization/thread_annotations.h"
#include <mutex>
#include "flutter/fml/macros.h"
#include "gtest/gtest.h"
// Uncomment these to enable particular compilation failure tests.
// #define NC_GUARDED_BY
// TODO(vtl): |ACQUIRED_{BEFORE,AFTER}()| are currently unimplemented in clang
// as of 2015-07-06 ("To be fixed in a future update."). So this actually
// compiles!
// #define NC_ACQUIRED_BEFORE
namespace
fml
{
namespace
{
// Test FML_GUARDED_BY ---------------------------------------------------------
class
GuardedByClass
{
public:
GuardedByClass
()
:
x_
()
{}
~
GuardedByClass
()
{}
void
GoodSet
(
int
x
)
{
mu_
.
lock
();
x_
=
x
;
mu_
.
unlock
();
}
#ifdef NC_GUARDED_BY
void
BadSet
(
int
x
)
{
x_
=
x
;
}
#endif
private:
std
::
mutex
mu_
;
int
x_
FML_GUARDED_BY
(
mu_
);
FML_DISALLOW_COPY_AND_ASSIGN
(
GuardedByClass
);
};
TEST
(
ThreadAnnotationsTest
,
GuardedBy
)
{
GuardedByClass
c
;
c
.
GoodSet
(
123
);
}
// Test FML_ACQUIRED_BEFORE ----------------------------------------------------
class
AcquiredBeforeClass2
;
class
AcquiredBeforeClass1
{
public:
AcquiredBeforeClass1
()
{}
~
AcquiredBeforeClass1
()
{}
void
NoOp
()
{
mu_
.
lock
();
mu_
.
unlock
();
}
#ifdef NC_ACQUIRED_BEFORE
void
BadMethod
(
AcquiredBeforeClass2
*
c2
);
#endif
private:
friend
class
AcquiredBeforeClass2
;
std
::
mutex
mu_
;
FML_DISALLOW_COPY_AND_ASSIGN
(
AcquiredBeforeClass1
);
};
class
AcquiredBeforeClass2
{
public:
AcquiredBeforeClass2
()
{}
~
AcquiredBeforeClass2
()
{}
void
NoOp
()
{
mu_
.
lock
();
mu_
.
unlock
();
}
void
GoodMethod
(
AcquiredBeforeClass1
*
c1
)
{
mu_
.
lock
();
c1
->
NoOp
();
mu_
.
unlock
();
}
private:
std
::
mutex
mu_
FML_ACQUIRED_BEFORE
(
AcquiredBeforeClass1
::
mu_
);
FML_DISALLOW_COPY_AND_ASSIGN
(
AcquiredBeforeClass2
);
};
#ifdef NC_ACQUIRED_BEFORE
void
AcquiredBeforeClass1
::
BadMethod
(
AcquiredBeforeClass2
*
c2
)
{
mu_
.
lock
();
c2
->
NoOp
();
mu_
.
unlock
();
}
#endif
TEST
(
ThreadAnnotationsTest
,
AcquiredBefore
)
{
AcquiredBeforeClass1
c1
;
AcquiredBeforeClass2
c2
;
c2
.
GoodMethod
(
&
c1
);
#ifdef NC_ACQUIRED_BEFORE
c1
.
BadMethod
(
&
c2
);
#endif
}
// TODO(vtl): Test more things.
}
// namespace
}
// namespace fml
fml/synchronization/waitable_event.cc
浏览文件 @
a925df18
...
...
@@ -150,7 +150,7 @@ bool ManualResetWaitableEvent::WaitWithTimeout(TimeDelta timeout) {
// holding |mutex_|.
bool
rv
=
WaitWithTimeoutImpl
(
&
locker
,
&
cv_
,
[
this
,
last_signal_id
]()
FML_NO_THREAD_SAFETY_ANALYSIS
{
[
this
,
last_signal_id
]()
{
// Also check |signaled_| in case we're already signaled.
return
signaled_
||
signal_id_
!=
last_signal_id
;
},
...
...
fml/synchronization/waitable_event.h
浏览文件 @
a925df18
...
...
@@ -14,7 +14,6 @@
#include <mutex>
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/time/time_delta.h"
namespace
fml
{
...
...
lib/ui/isolate_name_server/isolate_name_server.h
浏览文件 @
a925df18
...
...
@@ -10,7 +10,6 @@
#include <string>
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "third_party/dart/runtime/include/dart_api.h"
namespace
flutter
{
...
...
@@ -23,25 +22,21 @@ class IsolateNameServer {
// Looks up the Dart_Port associated with a given name. Returns ILLEGAL_PORT
// if the name does not exist.
Dart_Port
LookupIsolatePortByName
(
const
std
::
string
&
name
)
FML_LOCKS_EXCLUDED
(
mutex_
);
Dart_Port
LookupIsolatePortByName
(
const
std
::
string
&
name
);
// Registers a Dart_Port with a given name. Returns true if registration is
// successful, false if the name entry already exists.
bool
RegisterIsolatePortWithName
(
Dart_Port
port
,
const
std
::
string
&
name
)
FML_LOCKS_EXCLUDED
(
mutex_
);
bool
RegisterIsolatePortWithName
(
Dart_Port
port
,
const
std
::
string
&
name
);
// Removes a name to Dart_Port mapping given a name. Returns true if the
// mapping was successfully removed, false if the mapping does not exist.
bool
RemoveIsolateNameMapping
(
const
std
::
string
&
name
)
FML_LOCKS_EXCLUDED
(
mutex_
);
bool
RemoveIsolateNameMapping
(
const
std
::
string
&
name
);
private:
Dart_Port
LookupIsolatePortByNameUnprotected
(
const
std
::
string
&
name
)
FML_EXCLUSIVE_LOCKS_REQUIRED
(
mutex_
);
Dart_Port
LookupIsolatePortByNameUnprotected
(
const
std
::
string
&
name
);
mutable
std
::
mutex
mutex_
;
std
::
map
<
std
::
string
,
Dart_Port
>
port_mapping_
FML_GUARDED_BY
(
mutex_
)
;
std
::
map
<
std
::
string
,
Dart_Port
>
port_mapping_
;
FML_DISALLOW_COPY_AND_ASSIGN
(
IsolateNameServer
);
};
...
...
lib/ui/plugins/callback_cache.h
浏览文件 @
a925df18
...
...
@@ -11,7 +11,6 @@
#include <string>
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "third_party/dart/runtime/include/dart_api.h"
namespace
flutter
{
...
...
@@ -29,28 +28,26 @@ class DartCallbackCache {
static
int64_t
GetCallbackHandle
(
const
std
::
string
&
name
,
const
std
::
string
&
class_name
,
const
std
::
string
&
library_path
)
FML_LOCKS_EXCLUDED
(
mutex_
);
const
std
::
string
&
library_path
);
static
Dart_Handle
GetCallback
(
int64_t
handle
)
FML_LOCKS_EXCLUDED
(
mutex_
)
;
static
Dart_Handle
GetCallback
(
int64_t
handle
);
static
std
::
unique_ptr
<
DartCallbackRepresentation
>
GetCallbackInformation
(
int64_t
handle
)
FML_LOCKS_EXCLUDED
(
mutex_
)
;
int64_t
handle
);
static
void
LoadCacheFromDisk
()
FML_LOCKS_EXCLUDED
(
mutex_
)
;
static
void
LoadCacheFromDisk
();
private:
static
Dart_Handle
LookupDartClosure
(
const
std
::
string
&
name
,
const
std
::
string
&
class_name
,
const
std
::
string
&
library_path
);
static
void
SaveCacheToDisk
()
FML_EXCLUSIVE_LOCKS_REQUIRED
(
mutex_
)
;
static
void
SaveCacheToDisk
();
static
std
::
mutex
mutex_
;
static
std
::
string
cache_path_
;
static
std
::
map
<
int64_t
,
DartCallbackRepresentation
>
cache_
FML_GUARDED_BY
(
mutex_
);
static
std
::
map
<
int64_t
,
DartCallbackRepresentation
>
cache_
;
FML_DISALLOW_IMPLICIT_CONSTRUCTORS
(
DartCallbackCache
);
};
...
...
runtime/dart_service_isolate.cc
浏览文件 @
a925df18
...
...
@@ -50,7 +50,6 @@ const uint8_t* GetSymbol(Dart_NativeFunction native_function) {
std
::
mutex
DartServiceIsolate
::
callbacks_mutex_
;
FML_GUARDED_BY
(
DartServiceIsolate
::
callbacks_mutex_
)
std
::
set
<
std
::
unique_ptr
<
DartServiceIsolate
::
ObservatoryServerStateCallback
>>
DartServiceIsolate
::
callbacks_
;
...
...
runtime/dart_service_isolate.h
浏览文件 @
a925df18
...
...
@@ -11,7 +11,6 @@
#include <string>
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "third_party/dart/runtime/include/dart_api.h"
...
...
@@ -46,8 +45,7 @@ class DartServiceIsolate {
static
void
Shutdown
(
Dart_NativeArguments
args
);
static
std
::
mutex
callbacks_mutex_
;
static
std
::
set
<
std
::
unique_ptr
<
ObservatoryServerStateCallback
>>
callbacks_
FML_GUARDED_BY
(
callbacks_mutex_
);
static
std
::
set
<
std
::
unique_ptr
<
ObservatoryServerStateCallback
>>
callbacks_
;
};
}
// namespace flutter
...
...
runtime/dart_vm.cc
浏览文件 @
a925df18
...
...
@@ -17,7 +17,6 @@
#include "flutter/fml/mapping.h"
#include "flutter/fml/size.h"
#include "flutter/fml/synchronization/count_down_latch.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/time/time_delta.h"
#include "flutter/fml/trace_event.h"
#include "flutter/lib/io/dart_io.h"
...
...
runtime/dart_vm_lifecycle.cc
浏览文件 @
a925df18
...
...
@@ -12,8 +12,8 @@ namespace flutter {
// critical section. All accesses (not just const members) to the global VM
// object weak pointer are behind this mutex.
static
std
::
mutex
gVMMutex
;
static
std
::
weak_ptr
<
DartVM
>
gVM
FML_GUARDED_BY
(
gVMMutex
)
;
static
std
::
shared_ptr
<
DartVM
>*
gVMLeak
FML_GUARDED_BY
(
gVMMutex
)
;
static
std
::
weak_ptr
<
DartVM
>
gVM
;
static
std
::
shared_ptr
<
DartVM
>*
gVMLeak
;
// We are going to be modifying more than just the control blocks of the
// following weak pointers (in the |Create| case where an old VM could not be
...
...
@@ -21,12 +21,9 @@ static std::shared_ptr<DartVM>* gVMLeak FML_GUARDED_BY(gVMMutex);
// but that is only available since C++20. We don't expect contention on these
// locks so we just use one mutex for all.
static
std
::
mutex
gVMDependentsMutex
;
static
std
::
weak_ptr
<
const
DartVMData
>
gVMData
FML_GUARDED_BY
(
gVMDependentsMutex
);
static
std
::
weak_ptr
<
ServiceProtocol
>
gVMServiceProtocol
FML_GUARDED_BY
(
gVMDependentsMutex
);
static
std
::
weak_ptr
<
IsolateNameServer
>
gVMIsolateNameServer
FML_GUARDED_BY
(
gVMDependentsMutex
);
static
std
::
weak_ptr
<
const
DartVMData
>
gVMData
;
static
std
::
weak_ptr
<
ServiceProtocol
>
gVMServiceProtocol
;
static
std
::
weak_ptr
<
IsolateNameServer
>
gVMIsolateNameServer
;
DartVMRef
::
DartVMRef
(
std
::
shared_ptr
<
DartVM
>
vm
)
:
vm_
(
vm
)
{}
...
...
runtime/service_protocol.h
浏览文件 @
a925df18
...
...
@@ -14,7 +14,6 @@
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/atomic_object.h"
#include "flutter/fml/synchronization/shared_mutex.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/task_runner.h"
#include "rapidjson/document.h"
...
...
shell/common/persistent_cache.h
浏览文件 @
a925df18
...
...
@@ -10,7 +10,6 @@
#include <set>
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/task_runner.h"
#include "flutter/fml/unique_fd.h"
#include "third_party/skia/include/gpu/GrContextOptions.h"
...
...
@@ -66,8 +65,7 @@ class PersistentCache : public GrContextOptions::PersistentCache {
static
std
::
string
cache_base_path_
;
static
std
::
mutex
instance_mutex_
;
static
std
::
unique_ptr
<
PersistentCache
>
gPersistentCache
FML_GUARDED_BY
(
instance_mutex_
);
static
std
::
unique_ptr
<
PersistentCache
>
gPersistentCache
;
// Mutable static switch that can be set before GetCacheForProcess is called
// and GrContextOptions.fShaderCacheStrategy is set. If true, it means that
...
...
@@ -83,8 +81,7 @@ class PersistentCache : public GrContextOptions::PersistentCache {
const
std
::
shared_ptr
<
fml
::
UniqueFD
>
cache_directory_
;
const
std
::
shared_ptr
<
fml
::
UniqueFD
>
sksl_cache_directory_
;
mutable
std
::
mutex
worker_task_runners_mutex_
;
std
::
multiset
<
fml
::
RefPtr
<
fml
::
TaskRunner
>>
worker_task_runners_
FML_GUARDED_BY
(
worker_task_runners_mutex_
);
std
::
multiset
<
fml
::
RefPtr
<
fml
::
TaskRunner
>>
worker_task_runners_
;
bool
stored_new_shaders_
=
false
;
bool
is_dumping_skp_
=
false
;
...
...
shell/common/shell.h
浏览文件 @
a925df18
...
...
@@ -18,7 +18,6 @@
#include "flutter/fml/memory/thread_checker.h"
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/fml/status.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/thread.h"
#include "flutter/lib/ui/semantics/custom_accessibility_action.h"
...
...
shell/common/shell_test.h
浏览文件 @
a925df18
...
...
@@ -10,7 +10,6 @@
#include "flutter/common/settings.h"
#include "flutter/flow/layers/container_layer.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/lib/ui/window/platform_message.h"
#include "flutter/shell/common/run_configuration.h"
#include "flutter/shell/common/shell.h"
...
...
@@ -101,8 +100,8 @@ class ShellTestVsyncClock {
private:
std
::
mutex
mutex_
;
std
::
vector
<
std
::
promise
<
int
>>
vsync_promised_
FML_GUARDED_BY
(
mutex_
)
;
size_t
vsync_issued_
FML_GUARDED_BY
(
mutex_
)
=
0
;
std
::
vector
<
std
::
promise
<
int
>>
vsync_promised_
;
size_t
vsync_issued_
=
0
;
};
class
ShellTestVsyncWaiter
:
public
VsyncWaiter
{
...
...
shell/common/vsync_waiter.h
浏览文件 @
a925df18
...
...
@@ -10,7 +10,6 @@
#include <mutex>
#include "flutter/common/task_runners.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/time/time_point.h"
namespace
flutter
{
...
...
@@ -58,10 +57,10 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
private:
std
::
mutex
callback_mutex_
;
Callback
callback_
FML_GUARDED_BY
(
callback_mutex_
)
;
Callback
callback_
;
std
::
mutex
secondary_callback_mutex_
;
fml
::
closure
secondary_callback_
FML_GUARDED_BY
(
callback_mutex_
)
;
fml
::
closure
secondary_callback_
;
FML_DISALLOW_COPY_AND_ASSIGN
(
VsyncWaiter
);
};
...
...
shell/platform/darwin/ios/platform_view_ios.h
浏览文件 @
a925df18
...
...
@@ -66,7 +66,7 @@ class PlatformViewIOS final : public PlatformView {
// Since the `ios_surface_` is created on the platform thread but
// used on the GPU thread we need to protect it with a mutex.
std
::
mutex
ios_surface_mutex_
;
std
::
unique_ptr
<
IOSSurface
>
ios_surface_
FML_GUARDED_BY
(
ios_surface_mutex_
)
;
std
::
unique_ptr
<
IOSSurface
>
ios_surface_
;
std
::
shared_ptr
<
IOSGLContext
>
gl_context_
;
PlatformMessageRouter
platform_message_router_
;
std
::
unique_ptr
<
AccessibilityBridge
>
accessibility_bridge_
;
...
...
shell/platform/embedder/embedder_task_runner.h
浏览文件 @
a925df18
...
...
@@ -9,7 +9,6 @@
#include <unordered_map>
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "flutter/fml/task_runner.h"
namespace
flutter
{
...
...
@@ -76,9 +75,8 @@ class EmbedderTaskRunner final : public fml::TaskRunner {
const
size_t
embedder_identifier_
;
DispatchTable
dispatch_table_
;
std
::
mutex
tasks_mutex_
;
uint64_t
last_baton_
FML_GUARDED_BY
(
tasks_mutex_
);
std
::
unordered_map
<
uint64_t
,
fml
::
closure
>
pending_tasks_
FML_GUARDED_BY
(
tasks_mutex_
);
uint64_t
last_baton_
;
std
::
unordered_map
<
uint64_t
,
fml
::
closure
>
pending_tasks_
;
fml
::
TaskQueueId
placeholder_id_
;
// |fml::TaskRunner|
...
...
testing/test_dart_native_resolver.cc
浏览文件 @
a925df18
...
...
@@ -8,7 +8,6 @@
#include <vector>
#include "flutter/fml/logging.h"
#include "flutter/fml/synchronization/thread_annotations.h"
#include "third_party/tonic/logging/dart_error.h"
#include "tonic/converter/dart_converter.h"
...
...
@@ -36,7 +35,7 @@ Dart_NativeFunction TestDartNativeResolver::ResolveCallback(
static
std
::
mutex
gIsolateResolversMutex
;
static
std
::
map
<
Dart_Isolate
,
std
::
weak_ptr
<
TestDartNativeResolver
>>
gIsolateResolvers
FML_GUARDED_BY
(
gIsolateResolversMutex
)
;
gIsolateResolvers
;
Dart_NativeFunction
TestDartNativeResolver
::
DartNativeEntryResolverCallback
(
Dart_Handle
dart_name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录