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

Unified Diff: runtime/bin/stream_util.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: 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/stream_util.dart
diff --git a/runtime/bin/stream_util.dart b/runtime/bin/stream_util.dart
index 48039e1e92debc47052e769203ea5af39b5809c4..9175cce246badbede9a431c68fd9ce23011c7522 100644
--- a/runtime/bin/stream_util.dart
+++ b/runtime/bin/stream_util.dart
@@ -35,6 +35,12 @@ class _BaseDataInputStream {
_pipe(this, output, close: close);
}
+ void close() {
+ if (_scheduledDataCallback != null) _scheduledDataCallback.cancel();
+ _close();
+ _checkScheduleCallbacks();
+ }
+
bool get closed() => _closeCallbackCalled;
void set dataHandler(void callback()) {

Powered by Google App Engine
This is Rietveld 408576698