Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
17e1ae43
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,发现更多精彩内容 >>
未验证
提交
17e1ae43
编写于
8月 18, 2020
作者:
C
Chase Latta
提交者:
GitHub
8月 18, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert zircon and fuchsia to null-safety (#20577)
上级
549339bd
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
74 addition
and
48 deletion
+74
-48
shell/platform/fuchsia/dart-pkg/fuchsia/lib/fuchsia.dart
shell/platform/fuchsia/dart-pkg/fuchsia/lib/fuchsia.dart
+10
-11
shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart
shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart
+0
-1
shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle_waiter.dart
...atform/fuchsia/dart-pkg/zircon/lib/src/handle_waiter.dart
+0
-1
shell/platform/fuchsia/dart-pkg/zircon/lib/src/system.dart
shell/platform/fuchsia/dart-pkg/zircon/lib/src/system.dart
+61
-30
shell/platform/fuchsia/dart-pkg/zircon/lib/zircon.dart
shell/platform/fuchsia/dart-pkg/zircon/lib/zircon.dart
+0
-1
shell/platform/fuchsia/dart_runner/embedder/builtin.dart
shell/platform/fuchsia/dart_runner/embedder/builtin.dart
+1
-2
shell/platform/fuchsia/dart_runner/kernel/BUILD.gn
shell/platform/fuchsia/dart_runner/kernel/BUILD.gn
+1
-1
shell/platform/fuchsia/flutter/kernel/BUILD.gn
shell/platform/fuchsia/flutter/kernel/BUILD.gn
+1
-1
未找到文件。
shell/platform/fuchsia/dart-pkg/fuchsia/lib/fuchsia.dart
浏览文件 @
17e1ae43
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.6
library
fuchsia
;
import
'dart:io'
;
...
...
@@ -14,25 +13,25 @@ import 'dart:zircon';
// TODO: refactors this incomingServices instead
@pragma
(
'vm:entry-point'
)
Handle
_environment
;
Handle
?
_environment
;
@pragma
(
'vm:entry-point'
)
Handle
_outgoingServices
;
Handle
?
_outgoingServices
;
@pragma
(
'vm:entry-point'
)
Handle
_viewRef
;
Handle
?
_viewRef
;
class
MxStartupInfo
{
// TODO: refactor Handle to a Channel
// https://github.com/flutter/flutter/issues/49439
static
Handle
takeEnvironment
()
{
if
(
_
outgoingServices
==
null
&&
Platform
.
isFuchsia
)
{
if
(
_
environment
==
null
&&
Platform
.
isFuchsia
)
{
throw
Exception
(
'Attempting to call takeEnvironment more than once per process'
);
}
Handle
handle
=
_environment
;
final
handle
=
_environment
;
_environment
=
null
;
return
handle
;
return
handle
!
;
}
// TODO: refactor Handle to a Channel
...
...
@@ -42,9 +41,9 @@ class MxStartupInfo {
throw
Exception
(
'Attempting to call takeOutgoingServices more than once per process'
);
}
Handle
handle
=
_outgoingServices
;
final
handle
=
_outgoingServices
;
_outgoingServices
=
null
;
return
handle
;
return
handle
!
;
}
// TODO: refactor Handle to a ViewRef
...
...
@@ -54,9 +53,9 @@ class MxStartupInfo {
throw
Exception
(
'Attempting to call takeViewRef more than once per process'
);
}
Handle
handle
=
_viewRef
;
final
handle
=
_viewRef
;
_viewRef
=
null
;
return
handle
;
return
handle
!
;
}
}
...
...
shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart
浏览文件 @
17e1ae43
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.6
part of
zircon
;
// ignore_for_file: native_function_body_in_non_sdk_code
...
...
shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle_waiter.dart
浏览文件 @
17e1ae43
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.6
part of
zircon
;
// ignore_for_file: native_function_body_in_non_sdk_code
...
...
shell/platform/fuchsia/dart-pkg/zircon/lib/src/system.dart
浏览文件 @
17e1ae43
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.6
part of
zircon
;
// ignore_for_file: native_function_body_in_non_sdk_code
...
...
@@ -16,12 +15,12 @@ class _Namespace { // ignore: unused_element
// Library private variable set by the embedder used to cache the
// namespace (as an fdio_ns_t*).
@pragma
(
'vm:entry-point'
)
static
int
_namespace
;
// ignore: unused_field
static
int
?
_namespace
;
// ignore: unused_field
}
/// An exception representing an error returned as an zx_status_t.
class
ZxStatusException
implements
Exception
{
final
String
message
;
final
String
?
message
;
final
int
status
;
ZxStatusException
(
this
.
status
,
[
this
.
message
]);
...
...
@@ -35,6 +34,9 @@ class ZxStatusException implements Exception {
}
}
/// Users of the [_Result] subclasses should check the status before
/// trying to read any data. Attempting to use a value stored in a result
/// when the status in not OK will result in an exception.
class
_Result
{
final
int
status
;
const
_Result
(
this
.
status
);
...
...
@@ -42,78 +44,107 @@ class _Result {
@pragma
(
'vm:entry-point'
)
class
HandleResult
extends
_Result
{
final
Handle
handle
;
final
Handle
?
_handle
;
Handle
get
handle
=>
_handle
!;
@pragma
(
'vm:entry-point'
)
const
HandleResult
(
final
int
status
,
[
this
.
handle
])
:
super
(
status
);
const
HandleResult
(
final
int
status
,
[
this
.
_
handle
])
:
super
(
status
);
@override
String
toString
()
=>
'HandleResult(status=
$status
, handle=
$handle
)'
;
String
toString
()
=>
'HandleResult(status=
$status
, handle=
$
_
handle
)'
;
}
@pragma
(
'vm:entry-point'
)
class
HandlePairResult
extends
_Result
{
final
Handle
first
;
final
Handle
second
;
final
Handle
?
_first
;
final
Handle
?
_second
;
Handle
get
first
=>
_first
!;
Handle
get
second
=>
_second
!;
@pragma
(
'vm:entry-point'
)
const
HandlePairResult
(
final
int
status
,
[
this
.
first
,
this
.
second
])
const
HandlePairResult
(
final
int
status
,
[
this
.
_first
,
this
.
_
second
])
:
super
(
status
);
@override
String
toString
()
=>
'HandlePairResult(status=
$status
, first=
$
first
, second=
$
second
)'
;
'HandlePairResult(status=
$status
, first=
$
_first
, second=
$_
second
)'
;
}
@pragma
(
'vm:entry-point'
)
class
ReadResult
extends
_Result
{
final
ByteData
bytes
;
final
int
numBytes
;
final
List
<
Handle
>
handles
;
final
ByteData
?
_bytes
;
final
int
?
_numBytes
;
final
List
<
Handle
>?
_handles
;
ByteData
get
bytes
=>
_bytes
!;
int
get
numBytes
=>
_numBytes
!;
List
<
Handle
>
get
handles
=>
_handles
!;
@pragma
(
'vm:entry-point'
)
const
ReadResult
(
final
int
status
,
[
this
.
bytes
,
this
.
numBytes
,
this
.
handles
])
const
ReadResult
(
final
int
status
,
[
this
.
_bytes
,
this
.
_numBytes
,
this
.
_
handles
])
:
super
(
status
);
Uint8List
bytesAsUint8List
()
=>
bytes
.
buffer
.
asUint8List
(
bytes
.
offsetInBytes
,
numBytes
);
/// Returns the bytes as a Uint8List. If status != OK this will throw
/// an exception.
Uint8List
bytesAsUint8List
()
{
return
_bytes
!.
buffer
.
asUint8List
(
_bytes
!.
offsetInBytes
,
_numBytes
!);
}
/// Returns the bytes as a String. If status != OK this will throw
/// an exception.
String
bytesAsUTF8String
()
=>
utf8
.
decode
(
bytesAsUint8List
());
@override
String
toString
()
=>
'ReadResult(status=
$status
, bytes=
$
bytes
, numBytes=
$numBytes
, handles=
$
handles
)'
;
'ReadResult(status=
$status
, bytes=
$
_bytes
, numBytes=
$_numBytes
, handles=
$_
handles
)'
;
}
@pragma
(
'vm:entry-point'
)
class
WriteResult
extends
_Result
{
final
int
numBytes
;
final
int
?
_numBytes
;
int
get
numBytes
=>
_numBytes
!;
@pragma
(
'vm:entry-point'
)
const
WriteResult
(
final
int
status
,
[
this
.
numBytes
])
:
super
(
status
);
const
WriteResult
(
final
int
status
,
[
this
.
_
numBytes
])
:
super
(
status
);
@override
String
toString
()
=>
'WriteResult(status=
$status
, numBytes=
$numBytes
)'
;
String
toString
()
=>
'WriteResult(status=
$status
, numBytes=
$
_
numBytes
)'
;
}
@pragma
(
'vm:entry-point'
)
class
GetSizeResult
extends
_Result
{
final
int
size
;
final
int
?
_size
;
int
get
size
=>
_size
!;
@pragma
(
'vm:entry-point'
)
const
GetSizeResult
(
final
int
status
,
[
this
.
size
])
:
super
(
status
);
const
GetSizeResult
(
final
int
status
,
[
this
.
_
size
])
:
super
(
status
);
@override
String
toString
()
=>
'GetSizeResult(status=
$status
, size=
$size
)'
;
String
toString
()
=>
'GetSizeResult(status=
$status
, size=
$
_
size
)'
;
}
@pragma
(
'vm:entry-point'
)
class
FromFileResult
extends
_Result
{
final
Handle
handle
;
final
int
numBytes
;
final
Handle
?
_handle
;
final
int
?
_numBytes
;
Handle
get
handle
=>
_handle
!;
int
get
numBytes
=>
_numBytes
!;
@pragma
(
'vm:entry-point'
)
const
FromFileResult
(
final
int
status
,
[
this
.
handle
,
this
.
numBytes
])
const
FromFileResult
(
final
int
status
,
[
this
.
_handle
,
this
.
_
numBytes
])
:
super
(
status
);
@override
String
toString
()
=>
'FromFileResult(status=
$status
, handle=
$
handle
, numBytes=
$
numBytes
)'
;
'FromFileResult(status=
$status
, handle=
$
_handle
, numBytes=
$_
numBytes
)'
;
}
@pragma
(
'vm:entry-point'
)
class
MapResult
extends
_Result
{
final
Uint8List
data
;
final
Uint8List
?
_data
;
Uint8List
get
data
=>
_data
!;
@pragma
(
'vm:entry-point'
)
const
MapResult
(
final
int
status
,
[
this
.
data
])
:
super
(
status
);
const
MapResult
(
final
int
status
,
[
this
.
_
data
])
:
super
(
status
);
@override
String
toString
()
=>
'MapResult(status=
$status
, data=
$data
)'
;
String
toString
()
=>
'MapResult(status=
$status
, data=
$
_
data
)'
;
}
@pragma
(
'vm:entry-point'
)
...
...
shell/platform/fuchsia/dart-pkg/zircon/lib/zircon.dart
浏览文件 @
17e1ae43
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.6
library
zircon
;
import
'dart:convert'
show
utf8
;
...
...
shell/platform/fuchsia/dart_runner/embedder/builtin.dart
浏览文件 @
17e1ae43
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.6
library
fuchsia_builtin
;
import
'dart:async'
;
...
...
@@ -25,7 +24,7 @@ class _Logger {
}
@pragma
(
'vm:entry-point'
)
String
_rawScript
;
late
String
_rawScript
;
Uri
_scriptUri
(
)
{
if
(
_rawScript
.
startsWith
(
'http:'
)
||
...
...
shell/platform/fuchsia/dart_runner/kernel/BUILD.gn
浏览文件 @
17e1ae43
...
...
@@ -21,7 +21,7 @@ compile_platform("kernel_platform_files") {
args = [
"--enable-experiment=non-nullable",
"--nnbd-
weak
",
"--nnbd-
agnostic
",
# TODO(dartbug.com/36342): enable bytecode for core libraries when performance of bytecode
# pipeline is on par with default pipeline and continuously tracked.
...
...
shell/platform/fuchsia/flutter/kernel/BUILD.gn
浏览文件 @
17e1ae43
...
...
@@ -21,7 +21,7 @@ compile_platform("kernel_platform_files") {
args = [
"--enable-experiment=non-nullable",
"--nnbd-
weak
",
"--nnbd-
agnostic
",
# TODO(dartbug.com/36342): enable bytecode for core libraries when performance of bytecode
# pipeline is on par with default pipeline and continuously tracked.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录