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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/list_stream_impl.dart ('k') | runtime/bin/stream_util.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 SocketInputStream { 5 class _SocketInputStream implements SocketInputStream {
6 _SocketInputStream(Socket socket) : _socket = socket { 6 _SocketInputStream(Socket socket) : _socket = socket {
7 if (_socket._closed) _closed = true; 7 if (_socket._closed) _closed = true;
8 _socket.onClosed = _onClosed; 8 _socket.onClosed = _onClosed;
9 } 9 }
10 10
(...skipping 27 matching lines...) Expand all
38 int readInto(List<int> buffer, [int offset = 0, int len]) { 38 int readInto(List<int> buffer, [int offset = 0, int len]) {
39 if (_closed) return null; 39 if (_closed) return null;
40 if (len === null) len = buffer.length; 40 if (len === null) len = buffer.length;
41 if (offset < 0) throw new StreamException("Illegal offset $offset"); 41 if (offset < 0) throw new StreamException("Illegal offset $offset");
42 if (len < 0) throw new StreamException("Illegal length $len"); 42 if (len < 0) throw new StreamException("Illegal length $len");
43 return _socket.readList(buffer, offset, len); 43 return _socket.readList(buffer, offset, len);
44 } 44 }
45 45
46 int available() => _socket.available(); 46 int available() => _socket.available();
47 47
48 void pipe(OutputStream output, [bool close = true]) { 48 void pipe(OutputStream output, {bool close: true}) {
49 _pipe(this, output, close: close); 49 _pipe(this, output, close: close);
50 } 50 }
51 51
52 void close() { 52 void close() {
53 if (!_closed) { 53 if (!_closed) {
54 _socket.close(); 54 _socket.close();
55 } 55 }
56 } 56 }
57 57
58 bool get closed => _closed; 58 bool get closed => _closed;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 } 222 }
223 223
224 Socket _socket; 224 Socket _socket;
225 _BufferList _pendingWrites; 225 _BufferList _pendingWrites;
226 Function _onNoPendingWrites; 226 Function _onNoPendingWrites;
227 Function _onClosed; 227 Function _onClosed;
228 bool _closing = false; 228 bool _closing = false;
229 bool _closed = false; 229 bool _closed = false;
230 } 230 }
OLDNEW
« no previous file with comments | « runtime/bin/list_stream_impl.dart ('k') | runtime/bin/stream_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698