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

Side by Side Diff: bin/socket_stream.dart

Issue 9194002: Fix failure (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011, 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 InputStream { 5 class SocketInputStream implements InputStream {
6 SocketInputStream(Socket socket) : _socket = socket { 6 SocketInputStream(Socket socket) : _socket = socket {
7 _socket.closeHandler = _closeHandler; 7 _socket.closeHandler = _closeHandler;
8 } 8 }
9 9
10 List<int> read([int len]) { 10 List<int> read([int len]) {
11 int bytesToRead = available(); 11 int bytesToRead = available();
12 if (bytesToRead == 0) return null; 12 if (bytesToRead <= 0) return null;
Søren Gjesse 2012/01/12 07:32:47 I think we should assert that available is never n
siva 2012/01/12 19:30:50 Removed this check here and added an asserion in t
13 if (len !== null) { 13 if (len !== null) {
14 if (len <= 0) { 14 if (len <= 0) {
15 throw new StreamException("Illegal length $len"); 15 throw new StreamException("Illegal length $len");
16 } else if (bytesToRead > len) { 16 } else if (bytesToRead > len) {
17 bytesToRead = len; 17 bytesToRead = len;
18 } 18 }
19 } 19 }
20 List<int> buffer = new List<int>(bytesToRead); 20 List<int> buffer = new List<int>(bytesToRead);
21 int bytesRead = _socket.readList(buffer, 0, bytesToRead); 21 int bytesRead = _socket.readList(buffer, 0, bytesToRead);
22 if (bytesRead < bytesToRead) { 22 if (bytesRead < bytesToRead) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (_streamErrorHandler != null) _streamErrorHandler(); 180 if (_streamErrorHandler != null) _streamErrorHandler();
181 } 181 }
182 182
183 Socket _socket; 183 Socket _socket;
184 _BufferList _pendingWrites; 184 _BufferList _pendingWrites;
185 var _noPendingWriteHandler; 185 var _noPendingWriteHandler;
186 var _streamErrorHandler; 186 var _streamErrorHandler;
187 bool _closing = false; 187 bool _closing = false;
188 bool _closed = false; 188 bool _closed = false;
189 } 189 }
OLDNEW
« bin/fdutils_macos.cc ('K') | « bin/fdutils_macos.cc ('k') | bin/stream_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698