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

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

Issue 8498005: Fix build (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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/output_stream.dart ('k') | no next file » | 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) { 6 SocketInputStream(Socket socket) {
7 _socket = socket; 7 _socket = socket;
8 } 8 }
9 9
10 List<int> read([int len]) { 10 List<int> read([int len]) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (bytesWritten == len) return true; 158 if (bytesWritten == len) return true;
159 } 159 }
160 160
161 // Place remaining data on the pending writes queue. 161 // Place remaining data on the pending writes queue.
162 int notWrittenOffset = offset + bytesWritten; 162 int notWrittenOffset = offset + bytesWritten;
163 if (copyBuffer) { 163 if (copyBuffer) {
164 List<int> newBuffer = 164 List<int> newBuffer =
165 buffer.getRange(notWrittenOffset, len - bytesWritten); 165 buffer.getRange(notWrittenOffset, len - bytesWritten);
166 _pendingWrites.add(newBuffer); 166 _pendingWrites.add(newBuffer);
167 } else { 167 } else {
168 assert(offset + len = buffer.length); 168 assert(offset + len == buffer.length);
169 _pendingWrites.add(buffer, notWrittenOffset); 169 _pendingWrites.add(buffer, notWrittenOffset);
170 } 170 }
171 } 171 }
172 172
173 void _writeHandler() { 173 void _writeHandler() {
174 // Write as much buffered data to the socket as possible. 174 // Write as much buffered data to the socket as possible.
175 while (!_pendingWrites.isEmpty()) { 175 while (!_pendingWrites.isEmpty()) {
176 List<int> buffer = _pendingWrites.first; 176 List<int> buffer = _pendingWrites.first;
177 int offset = _pendingWrites.index; 177 int offset = _pendingWrites.index;
178 int bytesToWrite = buffer.length - offset; 178 int bytesToWrite = buffer.length - offset;
(...skipping 19 matching lines...) Expand all
198 if (_streamErrorHandler != null) _streamErrorHandler(); 198 if (_streamErrorHandler != null) _streamErrorHandler();
199 } 199 }
200 200
201 Socket _socket; 201 Socket _socket;
202 _BufferList2 _pendingWrites; 202 _BufferList2 _pendingWrites;
203 var _noPendingWriteHandler; 203 var _noPendingWriteHandler;
204 var _streamErrorHandler; 204 var _streamErrorHandler;
205 bool _closing = false; 205 bool _closing = false;
206 bool _closed = false; 206 bool _closed = false;
207 } 207 }
OLDNEW
« no previous file with comments | « runtime/bin/output_stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698