Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
ed5df03d
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,发现更多精彩内容 >>
未验证
提交
ed5df03d
编写于
6月 18, 2020
作者:
M
Michael Goderbauer
提交者:
GitHub
6月 18, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Word substitutions (#19111)
上级
b5f5e633
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
42 addition
and
44 deletion
+42
-44
ci/licenses_golden/tool_signature
ci/licenses_golden/tool_signature
+1
-1
shell/common/shell_unittests.cc
shell/common/shell_unittests.cc
+5
-5
shell/common/switches.cc
shell/common/switches.cc
+8
-8
shell/platform/android/io/flutter/app/FlutterActivityDelegate.java
...tform/android/io/flutter/app/FlutterActivityDelegate.java
+2
-3
shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java
...android/io/flutter/embedding/engine/FlutterShellArgs.java
+2
-3
third_party/txt/src/minikin/FontCollection.cpp
third_party/txt/src/minikin/FontCollection.cpp
+6
-6
tools/licenses/lib/main.dart
tools/licenses/lib/main.dart
+18
-18
未找到文件。
ci/licenses_golden/tool_signature
浏览文件 @
ed5df03d
Signature:
2f4b26bff75b999feec0c8b74e7653cc
Signature:
d87fdd028d9cc76587c43c73be9d6541
shell/common/shell_unittests.cc
浏览文件 @
ed5df03d
...
...
@@ -246,7 +246,7 @@ TEST_F(ShellTest, LastEntrypoint) {
ASSERT_FALSE
(
DartVMRef
::
IsInstanceRunning
());
}
TEST
(
ShellTestNoFixture
,
EnableMirrorsIs
Whitelist
ed
)
{
TEST
(
ShellTestNoFixture
,
EnableMirrorsIs
Allow
ed
)
{
if
(
DartVM
::
IsRunningPrecompiledCode
())
{
// This covers profile and release modes which use AOT (where this flag does
// not make sense anyway).
...
...
@@ -265,7 +265,7 @@ TEST(ShellTestNoFixture, EnableMirrorsIsWhitelisted) {
EXPECT_EQ
(
settings
.
dart_flags
.
size
(),
1u
);
}
TEST_F
(
ShellTest
,
Blacklist
edDartVMFlag
)
{
TEST_F
(
ShellTest
,
Disallow
edDartVMFlag
)
{
// Run this test in a thread-safe manner, otherwise gtest will complain.
::
testing
::
FLAGS_gtest_death_test_style
=
"threadsafe"
;
...
...
@@ -273,13 +273,13 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) {
fml
::
CommandLine
::
Option
(
"dart-flags"
,
"--verify_after_gc"
)};
fml
::
CommandLine
command_line
(
""
,
options
,
std
::
vector
<
std
::
string
>
());
// Upon encountering a
non-whitelist
ed Dart flag the process terminates.
// Upon encountering a
disallow
ed Dart flag the process terminates.
const
char
*
expected
=
"Encountered
blacklist
ed Dart VM flag: --verify_after_gc"
;
"Encountered
disallow
ed Dart VM flag: --verify_after_gc"
;
ASSERT_DEATH
(
flutter
::
SettingsFromCommandLine
(
command_line
),
expected
);
}
TEST_F
(
ShellTest
,
Whitelist
edDartVMFlag
)
{
TEST_F
(
ShellTest
,
Allow
edDartVMFlag
)
{
const
std
::
vector
<
fml
::
CommandLine
::
Option
>
options
=
{
#if !FLUTTER_RELEASE
fml
::
CommandLine
::
Option
(
"dart-flags"
,
...
...
shell/common/switches.cc
浏览文件 @
ed5df03d
...
...
@@ -40,7 +40,7 @@ struct SwitchDesc {
#if FLUTTER_RELEASE
// clang-format off
static
const
std
::
string
g
DartFlagsWhitelist
[]
=
{
static
const
std
::
string
g
AllowedDartFlags
[]
=
{
"--no-causal_async_stacks"
,
"--lazy_async_stacks"
,
};
...
...
@@ -49,7 +49,7 @@ static const std::string gDartFlagsWhitelist[] = {
#else
// clang-format off
static
const
std
::
string
g
DartFlagsWhitelist
[]
=
{
static
const
std
::
string
g
AllowedDartFlags
[]
=
{
"--enable_mirrors"
,
"--enable-service-port-fallback"
,
"--lazy_async_stacks"
,
...
...
@@ -148,10 +148,10 @@ const std::string_view FlagForSwitch(Switch swtch) {
return
std
::
string_view
();
}
static
bool
Is
Whitelist
edDartVMFlag
(
const
std
::
string
&
flag
)
{
for
(
uint32_t
i
=
0
;
i
<
fml
::
size
(
g
DartFlagsWhitelist
);
++
i
)
{
const
std
::
string
&
allowed
=
g
DartFlagsWhitelist
[
i
];
// Check that the prefix of the flag matches one of the
whitelist
ed flags.
static
bool
Is
Allow
edDartVMFlag
(
const
std
::
string
&
flag
)
{
for
(
uint32_t
i
=
0
;
i
<
fml
::
size
(
g
AllowedDartFlags
);
++
i
)
{
const
std
::
string
&
allowed
=
g
AllowedDartFlags
[
i
];
// Check that the prefix of the flag matches one of the
allow
ed flags.
// We don't need to worry about cases like "--safe --sneaky_dangerous" as
// the VM will discard these as a single unrecognized flag.
if
(
std
::
equal
(
allowed
.
begin
(),
allowed
.
end
(),
flag
.
begin
()))
{
...
...
@@ -372,8 +372,8 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
// Assume that individual flags are comma separated.
while
(
std
::
getline
(
stream
,
flag
,
','
))
{
if
(
!
Is
Whitelist
edDartVMFlag
(
flag
))
{
FML_LOG
(
FATAL
)
<<
"Encountered
blacklist
ed Dart VM flag: "
<<
flag
;
if
(
!
Is
Allow
edDartVMFlag
(
flag
))
{
FML_LOG
(
FATAL
)
<<
"Encountered
disallow
ed Dart VM flag: "
<<
flag
;
}
settings
.
dart_flags
.
push_back
(
flag
);
}
...
...
shell/platform/android/io/flutter/app/FlutterActivityDelegate.java
浏览文件 @
ed5df03d
...
...
@@ -321,9 +321,8 @@ public final class FlutterActivityDelegate
args
.
add
(
"--endless-trace-buffer"
);
}
// NOTE: all flags provided with this argument are subject to filtering
// based on a whitelist in shell/common/switches.cc. If any flag provided
// is not present in the whitelist, the process will immediately
// terminate.
// based on a a list of allowed flags in shell/common/switches.cc. If any
// flag provided is not allowed, the process will immediately terminate.
if
(
intent
.
hasExtra
(
"dart-flags"
))
{
args
.
add
(
"--dart-flags="
+
intent
.
getStringExtra
(
"dart-flags"
));
}
...
...
shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java
浏览文件 @
ed5df03d
...
...
@@ -107,9 +107,8 @@ public class FlutterShellArgs {
}
// NOTE: all flags provided with this argument are subject to filtering
// based on a whitelist in shell/common/switches.cc. If any flag provided
// is not present in the whitelist, the process will immediately
// terminate.
// based on a a list of allowed flags in shell/common/switches.cc. If any
// flag provided is not allowed, the process will immediately terminate.
if
(
intent
.
hasExtra
(
ARG_KEY_DART_FLAGS
))
{
args
.
add
(
ARG_DART_FLAGS
+
"="
+
intent
.
getStringExtra
(
ARG_KEY_DART_FLAGS
));
}
...
...
third_party/txt/src/minikin/FontCollection.cpp
浏览文件 @
ed5df03d
...
...
@@ -400,16 +400,16 @@ const uint32_t STAFF_OF_AESCULAPIUS = 0x2695;
// Characters where we want to continue using existing font run instead of
// recomputing the best match in the fallback list.
static
const
uint32_t
sticky
White
list
[]
=
{
static
const
uint32_t
sticky
Allow
list
[]
=
{
'!'
,
','
,
'-'
,
'.'
,
':'
,
';'
,
'?'
,
NBSP
,
ZWJ
,
ZWNJ
,
HYPHEN
,
NB_HYPHEN
,
NNBSP
,
FEMALE_SIGN
,
MALE_SIGN
,
STAFF_OF_AESCULAPIUS
};
static
bool
isSticky
Whitelist
ed
(
uint32_t
c
)
{
for
(
size_t
i
=
0
;
i
<
sizeof
(
sticky
Whitelist
)
/
sizeof
(
stickyWhite
list
[
0
]);
static
bool
isSticky
Allow
ed
(
uint32_t
c
)
{
for
(
size_t
i
=
0
;
i
<
sizeof
(
sticky
Allowlist
)
/
sizeof
(
stickyAllow
list
[
0
]);
i
++
)
{
if
(
sticky
White
list
[
i
]
==
c
)
if
(
sticky
Allow
list
[
i
]
==
c
)
return
true
;
}
return
false
;
...
...
@@ -489,9 +489,9 @@ void FontCollection::itemize(const uint16_t* string,
bool
shouldContinueRun
=
false
;
if
(
lastFamily
!=
nullptr
)
{
if
(
isSticky
Whitelist
ed
(
ch
))
{
if
(
isSticky
Allow
ed
(
ch
))
{
// Continue using existing font as long as it has coverage and is
//
whitelisted
//
allowed.
shouldContinueRun
=
lastFamily
->
getCoverage
().
get
(
ch
);
}
else
if
(
ch
==
SOFT_HYPHEN
||
isVariationSelector
(
ch
))
{
// Always continue if the character is the soft hyphen or a variation
...
...
tools/licenses/lib/main.dart
浏览文件 @
ed5df03d
...
...
@@ -2099,10 +2099,10 @@ class _RepositoryFlutterDirectory extends _RepositoryDirectory {
/// A specialized crawler for "github.com/flutter/engine/lib" directory.
///
/// It includes everything except build tools, test build artifacts, and test code.
_RelativePath
Black
listRepositoryDirectory
_createLibDirectoryRoot
(
fs
.
Directory
entry
,
_RepositoryDirectory
parent
)
{
return
_RelativePath
Black
listRepositoryDirectory
(
_RelativePath
Deny
listRepositoryDirectory
_createLibDirectoryRoot
(
fs
.
Directory
entry
,
_RepositoryDirectory
parent
)
{
return
_RelativePath
Deny
listRepositoryDirectory
(
rootDir:
entry
,
black
list:
<
Pattern
>[
deny
list:
<
Pattern
>[
'web_ui/lib/assets/ahem.ttf'
,
// this gitignored file exists only for testing purposes
RegExp
(
r'web_ui/build/.*'
),
// this is compiler-generated output
RegExp
(
r'web_ui/dev/.*'
),
// these are build tools; they do not end up in Engine artifacts
...
...
@@ -2117,10 +2117,10 @@ _RelativePathBlacklistRepositoryDirectory _createLibDirectoryRoot(fs.Directory e
///
/// It includes everything except the "web_engine_tester" package, which is only
/// used to test the engine itself and is not shipped as part of the Flutter SDK.
_RelativePath
Black
listRepositoryDirectory
_createWebSdkDirectoryRoot
(
fs
.
Directory
entry
,
_RepositoryDirectory
parent
)
{
return
_RelativePath
Black
listRepositoryDirectory
(
_RelativePath
Deny
listRepositoryDirectory
_createWebSdkDirectoryRoot
(
fs
.
Directory
entry
,
_RepositoryDirectory
parent
)
{
return
_RelativePath
Deny
listRepositoryDirectory
(
rootDir:
entry
,
black
list:
<
Pattern
>[
deny
list:
<
Pattern
>[
RegExp
(
r'web_engine_tester/.*'
),
// contains test code for the engine itself
],
parent:
parent
,
...
...
@@ -2128,32 +2128,32 @@ _RelativePathBlacklistRepositoryDirectory _createWebSdkDirectoryRoot(fs.Director
);
}
/// Walks a [rootDir] recursively, omitting paths that match a [
black
list].
/// Walks a [rootDir] recursively, omitting paths that match a [
deny
list].
///
/// The path patterns in the [
black
list] are specified relative to the [rootDir].
class
_RelativePath
Black
listRepositoryDirectory
extends
_RepositoryDirectory
{
_RelativePath
Black
listRepositoryDirectory
({
/// The path patterns in the [
deny
list] are specified relative to the [rootDir].
class
_RelativePath
Deny
listRepositoryDirectory
extends
_RepositoryDirectory
{
_RelativePath
Deny
listRepositoryDirectory
({
@required
this
.
rootDir
,
@required
this
.
black
list
,
@required
this
.
deny
list
,
@required
_RepositoryDirectory
parent
,
@required
fs
.
Directory
io
,
})
:
super
(
parent
,
io
);
/// The directory, relative to which the paths are [
black
list]ed.
/// The directory, relative to which the paths are [
deny
list]ed.
final
fs
.
Directory
rootDir
;
/// Bl
acklist
ed path patterns.
/// Bl
ock
ed path patterns.
///
/// Paths are assumed relative to [rootDir].
final
List
<
Pattern
>
black
list
;
final
List
<
Pattern
>
deny
list
;
@override
bool
shouldRecurse
(
fs
.
IoNode
entry
)
{
final
String
relativePath
=
path
.
relative
(
entry
.
fullName
,
from:
rootDir
.
fullName
);
final
bool
isBlacklisted
=
black
list
.
any
(
final
bool
denied
=
deny
list
.
any
(
(
Pattern
pattern
)
=>
pattern
.
matchAsPrefix
(
relativePath
)
!=
null
,
);
if
(
isBlacklist
ed
)
{
if
(
deni
ed
)
{
return
false
;
}
return
super
.
shouldRecurse
(
entry
);
...
...
@@ -2161,9 +2161,9 @@ class _RelativePathBlacklistRepositoryDirectory extends _RepositoryDirectory {
@override
_RepositoryDirectory
createSubdirectory
(
fs
.
Directory
entry
)
{
return
_RelativePath
Black
listRepositoryDirectory
(
return
_RelativePath
Deny
listRepositoryDirectory
(
rootDir:
rootDir
,
blacklist:
black
list
,
denylist:
deny
list
,
parent:
this
,
io:
entry
,
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录