1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 00:08:46 +00:00

[io] Remove incorrect docs that listSupport is not available on Android.

Bug:https://github.com/dart-lang/sdk/issues/47894
Change-Id: Id79a37f5ba6a8118a30d2297c95cff5a7ca1a03f
TEST=unit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276660
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
Brian Quinlan 2022-12-21 00:23:02 +00:00 committed by Commit Queue
parent 51d672e77d
commit 9b2b9df09e
13 changed files with 10 additions and 43 deletions

View File

@ -84,6 +84,11 @@
removed. See [#49536](https://github.com/dart-lang/sdk/issues/49536) for
details.
#### `dart:io`
- Deprecated `NetworkInterface.listSupported`. Has always returned true since
Dart 2.3.
#### `dart:js_util`
- Added several helper functions to access more JavaScript operator, like

View File

@ -94,7 +94,6 @@ namespace bin {
V(Namespace_Create, 2) \
V(Namespace_GetDefault, 0) \
V(Namespace_GetPointer, 1) \
V(NetworkInterface_ListSupported, 0) \
V(OSError_inProgressErrorCode, 0) \
V(Platform_NumberOfProcessors, 0) \
V(Platform_OperatingSystem, 0) \

View File

@ -294,10 +294,6 @@ void FUNCTION_NAME(InternetAddress_RawAddrToString)(Dart_NativeArguments args) {
Dart_SetReturnValue(args, ThrowIfError(DartUtils::NewString(str)));
}
void FUNCTION_NAME(NetworkInterface_ListSupported)(Dart_NativeArguments args) {
Dart_SetBooleanReturnValue(args, SocketBase::ListInterfacesSupported());
}
void FUNCTION_NAME(SocketBase_IsBindError)(Dart_NativeArguments args) {
intptr_t error_number =
DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 1));

View File

@ -278,9 +278,6 @@ class SocketBase : public AllStatic {
static bool RawAddrToString(RawAddr* addr, char* str);
static bool FormatNumericAddress(const RawAddr& addr, char* address, int len);
// Whether ListInterfaces is supported.
static bool ListInterfacesSupported();
// List interfaces. Returns a AddressList of InterfaceSocketAddress's.
static AddressList<InterfaceSocketAddress>* ListInterfaces(
int type,

View File

@ -332,10 +332,6 @@ static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) {
((family == AF_INET) || (family == AF_INET6)))));
}
bool SocketBase::ListInterfacesSupported() {
return true;
}
AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
int type,
OSError** os_error) {

View File

@ -334,10 +334,6 @@ static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) {
((family == AF_INET) || (family == AF_INET6)))));
}
bool SocketBase::ListInterfacesSupported() {
return true;
}
AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
int type,
OSError** os_error) {

View File

@ -375,10 +375,6 @@ static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) {
((family == AF_INET) || (family == AF_INET6))));
}
bool SocketBase::ListInterfacesSupported() {
return true;
}
AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
int type,
OSError** os_error) {

View File

@ -331,10 +331,6 @@ bool SocketBase::RawAddrToString(RawAddr* addr, char* str) {
return false;
}
bool SocketBase::ListInterfacesSupported() {
return true;
}
AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
int type,
OSError** os_error) {

View File

@ -99,9 +99,7 @@ class InternetAddress {
@patch
class NetworkInterface {
@patch
static bool get listSupported {
return _listSupported();
}
static bool get listSupported => true;
@patch
static Future<List<NetworkInterface>> list(
@ -113,9 +111,6 @@ class NetworkInterface {
includeLinkLocal: includeLinkLocal,
type: type);
}
@pragma("vm:external-name", "NetworkInterface_ListSupported")
external static bool _listSupported();
}
void _throwOnBadPort(int port) {
@ -761,8 +756,7 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
"Address family not supported by protocol family, "
// ...and then add some details.
"sourceAddress.type must be ${InternetAddressType.unix} but was "
"${source.type}",
address: address);
"${source.type}", address: address);
}
connectionResult = socket.nativeCreateUnixDomainBindConnect(
address.address, source.address, _Namespace._namespace);

View File

@ -178,7 +178,9 @@ abstract class NetworkInterface {
/// Whether the [list] method is supported.
///
/// The [list] method is currently unsupported on Android.
/// The [list] method is supported on all platforms supported by Dart so this
/// property is always true.
@Deprecated("listSupported is always true.")
external static bool get listSupported;
/// Query the system for [NetworkInterface]s.

View File

@ -43,9 +43,6 @@ void testListIndex() {
}
void main() {
if (!NetworkInterface.listSupported) {
return;
}
testListLoopback();
testListLinkLocal();
testListIndex();

View File

@ -45,9 +45,6 @@ void testListIndex() {
}
void main() {
if (!NetworkInterface.listSupported) {
return;
}
testListLoopback();
testListLinkLocal();
testListIndex();

View File

@ -128,10 +128,6 @@ testDatagramSocketMulticastIf() {
option = RawSocketOption(RawSocketOption.levelIPv4,
RawSocketOption.IPv4MulticastInterface, address.rawAddress);
} else {
if (!NetworkInterface.listSupported) {
asyncEnd();
return;
}
var interface = await NetworkInterface.list();
if (interface.length == 0) {
asyncEnd();