Skip to content

Commit 6859abe

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[io] Hide more unsafe natives.
TEST=lib/mirrors/invocation_fuzz_test/smi CoreLibraryReviewExempt: does not change public API Bug: #60721 Change-Id: Ica2cba560751532918fe72c3419cb76c1d115259 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429222 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Brian Quinlan <[email protected]>
1 parent 1159405 commit 6859abe

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

sdk/lib/_internal/vm/bin/file_patch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ abstract class _FileSystemWatcher {
284284
}
285285

286286
static Stream _listenOnSocket(int socketId, int id, int pathId) {
287-
final nativeSocket = _NativeSocket.watch(socketId);
287+
final nativeSocket = _NativeSocket._watch(socketId);
288288
final rawSocket = _RawSocket(nativeSocket);
289289
return rawSocket.expand((event) {
290290
var stops = [];

sdk/lib/_internal/vm/bin/process_patch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class _SignalController {
119119
return;
120120
}
121121
_id = id;
122-
var socket = _RawSocket(_NativeSocket.watchSignal(id));
122+
var socket = _RawSocket(_NativeSocket._watchSignal(id));
123123
socket.listen((event) {
124124
if (event == RawSocketEvent.read) {
125125
var bytes = socket.read()!;

sdk/lib/_internal/vm/bin/socket_patch.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,10 +1280,10 @@ base class _NativeSocket extends _NativeSocketNativeWrapper
12801280
_nativeSetSocketId(id, typeFlags);
12811281
}
12821282

1283-
_NativeSocket.watchSignal(int id)
1283+
_NativeSocket._watchSignal(int id)
12841284
: this._watchCommon(id, typeInternalSignalSocket);
12851285

1286-
_NativeSocket.watch(int id) : this._watchCommon(id, typeInternalSocket);
1286+
_NativeSocket._watch(int id) : this._watchCommon(id, typeInternalSocket);
12871287

12881288
bool get isListening => (typeFlags & typeListeningSocket) != 0;
12891289
bool get isPipe => (typeFlags & typePipe) != 0;

sdk/lib/_internal/vm/bin/stdio_patch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class _StdIOUtils {
3838
type,
3939
);
4040
}
41-
return Stdout._(IOSink(_StdConsumer(fd)), fd);
41+
return Stdout._(IOSink(_StdConsumer._(fd)), fd);
4242
}
4343

4444
@patch

sdk/lib/io/file_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class _FileStreamConsumer implements StreamConsumer<List<int>> {
211211
: _file = file,
212212
_openFuture = file.open(mode: mode);
213213

214-
_FileStreamConsumer.fromStdio(int fd)
214+
_FileStreamConsumer._fromStdio(int fd)
215215
: _openFuture = new Future.value(_File._openStdioSync(fd));
216216

217217
_FileStreamConsumer.fromRandomAccessFile(RandomAccessFile f)

sdk/lib/io/stdio.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class Stdout extends _StdSink implements IOSink {
280280
/// The returned `IOSink` will be initialized with an [encoding] of UTF-8 and
281281
/// will not do line ending conversion.
282282
IOSink get nonBlocking {
283-
return _nonBlocking ??= new IOSink(new _FileStreamConsumer.fromStdio(_fd));
283+
return _nonBlocking ??= new IOSink(new _FileStreamConsumer._fromStdio(_fd));
284284
}
285285
}
286286

@@ -317,7 +317,7 @@ class StdinException implements IOException {
317317
class _StdConsumer implements StreamConsumer<List<int>> {
318318
final RandomAccessFile _file;
319319

320-
_StdConsumer(int fd) : _file = _File._openStdioSync(fd);
320+
_StdConsumer._(int fd) : _file = _File._openStdioSync(fd);
321321

322322
Future addStream(Stream<List<int>> stream) {
323323
var completer = new Completer();

0 commit comments

Comments
 (0)