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

Unified Diff: runtime/bin/file_impl.dart

Issue 10832188: Add an OutputStream.closed getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
Index: runtime/bin/file_impl.dart
diff --git a/runtime/bin/file_impl.dart b/runtime/bin/file_impl.dart
index e1ff548fb669cfe7ba00be357490453da5ea5226..3e1f153f5c33b58eb0483d0d10844391d4e42604 100644
--- a/runtime/bin/file_impl.dart
+++ b/runtime/bin/file_impl.dart
@@ -217,13 +217,14 @@ class _FileOutputStream extends _BaseOutputStream implements OutputStream {
Bill Hesse 2012/08/08 14:21:11 This will all need some work if we want writes aft
void close() {
+ _streamMarkedClosed = true;
if (_file == null) {
_pendingOperations.add(_PendingOperation.CLOSE);
- } else if (!_streamMarkedClosed) {
+ } else if (!_closeCallbackCalled) {
Bill Hesse 2012/08/08 14:21:11 Call this _closeCallbackScheduled.
nweiz 2012/08/09 19:39:52 Done.
_file.close().then((ignore) {
if (_onClosed != null) _onClosed();
});
- _streamMarkedClosed = true;
+ _closeCallbackCalled = true;
}
}
@@ -279,6 +280,8 @@ class _FileOutputStream extends _BaseOutputStream implements OutputStream {
});
}
+ bool get closed() => _streamMarkedClosed;
+
RandomAccessFile _file;
// When this is set to true the stream is marked closed. When a

Powered by Google App Engine
This is Rietveld 408576698