Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: runtime/bin/stdio_patch.dart

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | runtime/bin/utf_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio_patch.dart
diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart
index 9ec2d52906982903fb63bf9ccbf3a6bdf84ff635..38c488d1857070345f2796b21336caf916b4c378 100644
--- a/runtime/bin/stdio_patch.dart
+++ b/runtime/bin/stdio_patch.dart
@@ -3,45 +3,39 @@
// BSD-style license that can be found in the LICENSE file.
patch class _StdIOUtils {
- static InputStream _getStdioInputStream() {
+ static Stream<List<int>> _getStdioInputStream() {
switch (_getStdioHandleType(0)) {
case _STDIO_HANDLE_TYPE_TERMINAL:
case _STDIO_HANDLE_TYPE_PIPE:
case _STDIO_HANDLE_TYPE_SOCKET:
- Socket s = new _Socket._internalReadOnly();
- _getStdioHandle(s, 0);
- s._closed = false;
- return s.inputStream;
+ return new _Socket._readPipe(0);
case _STDIO_HANDLE_TYPE_FILE:
- return new _FileInputStream.fromStdio(0);
+ return new _FileStream.forStdin();
default:
throw new FileIOException("Unsupported stdin type");
}
}
- static OutputStream _getStdioOutputStream(int fd) {
+ static IOSink _getStdioOutputStream(int fd) {
assert(fd == 1 || fd == 2);
switch (_getStdioHandleType(fd)) {
case _STDIO_HANDLE_TYPE_TERMINAL:
case _STDIO_HANDLE_TYPE_PIPE:
case _STDIO_HANDLE_TYPE_SOCKET:
- Socket s = new _Socket._internalWriteOnly();
- _getStdioHandle(s, fd);
- s._closed = false;
- return s.outputStream;
+ return new _Socket._writePipe(fd);
case _STDIO_HANDLE_TYPE_FILE:
- return new _FileOutputStream.fromStdio(fd);
+ return new IOSink(new _FileStreamConsumer.fromStdio(fd));
default:
throw new FileIOException("Unsupported stdin type");
}
}
- static int _socketType(Socket socket) {
- return _getSocketType(socket);
+ static int _socketType(nativeSocket) {
+ return _getSocketType(nativeSocket);
}
}
-_getStdioHandle(Socket socket, int num) native "Socket_GetStdioHandle";
+_getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle";
_getStdioHandleType(int num) native "File_GetStdioHandleType";
-_getSocketType(Socket socket) native "Socket_GetType";
+_getSocketType(_NativeSocket nativeSocket) native "Socket_GetType";
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | runtime/bin/utf_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698