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

Side by Side Diff: runtime/bin/socket_stream.dart

Issue 8662004: Update test scripts to deal with current VM behavior on optional constructor arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/src/ProcessTestUtil.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class SocketInputStream implements InputStream { 5 class SocketInputStream implements InputStream {
6 SocketInputStream(Socket socket) : _socket = socket; 6 SocketInputStream(Socket socket) : _socket = socket;
7 7
8 List<int> read([int len]) { 8 List<int> read([int len]) {
9 int bytesToRead = available(); 9 int bytesToRead = available();
10 if (bytesToRead == 0) return null; 10 if (bytesToRead == 0) return null;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 Socket _socket; 51 Socket _socket;
52 } 52 }
53 53
54 54
55 class SocketOutputStream implements OutputStream { 55 class SocketOutputStream implements OutputStream {
56 SocketOutputStream(Socket socket) 56 SocketOutputStream(Socket socket)
57 : _socket = socket, _pendingWrites = new _BufferList(); 57 : _socket = socket, _pendingWrites = new _BufferList();
58 58
59 bool write(List<int> buffer, [bool copyBuffer = true]) { 59 bool write(List<int> buffer, [bool copyBuffer = true]) {
60 return _write(buffer, 0, buffer.length, copyBuffer); 60 return _write(buffer, 0, buffer.length, copyBuffer);
61 } 61 }
62 62
63 bool writeFrom(List<int> buffer, [int offset = 0, int len]) { 63 bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
64 return _write( 64 return _write(
65 buffer, offset, (len == null) ? buffer.length - offset : len, true); 65 buffer, offset, (len == null) ? buffer.length - offset : len, true);
66 } 66 }
67 67
68 void close() { 68 void close() {
69 if (!_pendingWrites.isEmpty()) { 69 if (!_pendingWrites.isEmpty()) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (_streamErrorHandler != null) _streamErrorHandler(); 156 if (_streamErrorHandler != null) _streamErrorHandler();
157 } 157 }
158 158
159 Socket _socket; 159 Socket _socket;
160 _BufferList _pendingWrites; 160 _BufferList _pendingWrites;
161 var _noPendingWriteHandler; 161 var _noPendingWriteHandler;
162 var _streamErrorHandler; 162 var _streamErrorHandler;
163 bool _closing = false; 163 bool _closing = false;
164 bool _closed = false; 164 bool _closed = false;
165 } 165 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/src/ProcessTestUtil.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698