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

Unified Diff: runtime/bin/list_stream.dart

Issue 9029001: Add close to input stream and cleanup socket and streams (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments by ager@ Created 8 years, 12 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/input_stream.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/list_stream.dart
diff --git a/runtime/bin/list_stream.dart b/runtime/bin/list_stream.dart
index da5826ec8e956bbec2039d07d62e81b6fb8fc7ad..f925d529ec8eb7d06a1eefc22d83c082dcf4adbd 100644
--- a/runtime/bin/list_stream.dart
+++ b/runtime/bin/list_stream.dart
@@ -26,6 +26,10 @@ class ListInputStream extends _BaseDataInputStream implements InputStream {
return bytesToRead;
}
+ void _close() {
+ _offset = _buffer.length;
+ }
+
List<int> _buffer;
int _offset = 0;
}
@@ -38,6 +42,9 @@ class DynamicListInputStream
int available() => _bufferList.length;
void write(List<int> data) {
+ if (_streamMarkedClosed) {
+ throw new StreamException.streamClosed();
+ }
_bufferList.add(data);
_checkScheduleCallbacks();
}
@@ -57,6 +64,11 @@ class DynamicListInputStream
return bytesToRead;
}
+ void _close() {
+ _streamMarkedClosed = true;
+ _bufferList.clear();
+ }
+
_BufferList _bufferList;
}
« no previous file with comments | « runtime/bin/input_stream.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698