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

Issue 10832188: Add an OutputStream.closed getter. (Closed)

Created:
8 years, 4 months ago by nweiz
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add an OutputStream.closed getter. BUG=3603 Committed: https://code.google.com/p/dart/source/detail?r=10455

Patch Set 1 #

Total comments: 26

Patch Set 2 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -21 lines) Patch
M compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/file_impl.dart View 1 3 chunks +13 lines, -10 lines 0 comments Download
M runtime/bin/http_impl.dart View 5 chunks +9 lines, -5 lines 0 comments Download
M runtime/bin/list_stream_impl.dart View 2 chunks +3 lines, -0 lines 0 comments Download
M runtime/bin/output_stream.dart View 1 3 chunks +13 lines, -6 lines 0 comments Download
M runtime/bin/socket_stream_impl.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/standalone/io/file_output_stream_test.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M tests/standalone/io/list_output_stream_test.dart View 1 2 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
nweiz
Contrary to bug 3603, I didn't cause OutputStream.close() to throw an exception if the stream ...
8 years, 4 months ago (2012-08-07 20:43:27 UTC) #1
Søren Gjesse
lgtm https://chromiumcodereview.appspot.com/10832188/diff/1/compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart File compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart (right): https://chromiumcodereview.appspot.com/10832188/diff/1/compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart#newcode88 compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart:88: final bool closed = false; Accidental edit? https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/http_server_socket_test.dart ...
8 years, 4 months ago (2012-08-08 11:49:15 UTC) #2
Bill Hesse
Let me take a look - there are some tricky semantics about close(), closed(), and ...
8 years, 4 months ago (2012-08-08 12:46:01 UTC) #3
Bill Hesse
LGTM. https://chromiumcodereview.appspot.com/10832188/diff/1/compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart File compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart (right): https://chromiumcodereview.appspot.com/10832188/diff/1/compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart#newcode88 compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart:88: final bool closed = false; On 2012/08/08 11:49:15, ...
8 years, 4 months ago (2012-08-08 14:21:11 UTC) #4
nweiz
8 years, 4 months ago (2012-08-09 19:39:52 UTC) #5
https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/file_impl....
File runtime/bin/file_impl.dart (right):

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/file_impl....
runtime/bin/file_impl.dart:223: } else if (!_closeCallbackCalled) {
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Call this _closeCallbackScheduled.

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/file_impl....
runtime/bin/file_impl.dart:272: (_onNoPendingWrites != null)) {
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Extra parentheses.

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/file_impl....
runtime/bin/file_impl.dart:291: // When this is set to true the close callback
has been called and
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Change the comment and the name to closeCallbackScheduled.

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/output_str...
File runtime/bin/output_stream.dart (right):

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/output_str...
runtime/bin/output_stream.dart:61: * Indicate that all data has been written to
the output
On 2012/08/08 14:21:11, Bill Hesse wrote:
> "Signal that no more data will be written to the output stream.  When all
> buffered data has been written out to
> the communication channel, the channel will be closed and
> the onClosed callback will be called."

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/output_str...
runtime/bin/output_stream.dart:74: * Returns whether the stream is closed. No
more data may be written to a
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Returns whether the stream has been closed by calling close().   If true, no
> more data may be written to the output stream, but there still may be buffered
> data that has not been written to the communication channel.  The onClosed
> handler will only be called once all data has been written out.

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/runtime/bin/output_str...
runtime/bin/output_stream.dart:89: * communication channel has been closed and
no more data can be
On 2012/08/08 14:21:11, Bill Hesse wrote:
> has been closed and all the buffered data has been sent.

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/fi...
File tests/standalone/io/file_output_stream_test.dart (right):

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/fi...
tests/standalone/io/file_output_stream_test.dart:26: Expect.isTrue(x.closed);
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Should you test that write() throws an exception here?

Yes, but currently it would fail that test due to a bug in _FileOutputStream
that's unrelated to this change.

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/ht...
File tests/standalone/io/http_server_socket_test.dart (right):

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/ht...
tests/standalone/io/http_server_socket_test.dart:37: bool get closed() =>
_socket._closed;
On 2012/08/08 11:49:15, Søren Gjesse wrote:
> Not strictly needed here. It is never used and ExpectedDataOutputStream is
> already missing other methods from OutputStream.

Removed.

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/li...
File tests/standalone/io/list_output_stream_test.dart (right):

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/li...
tests/standalone/io/list_output_stream_test.dart:148:
Expect.isTrue(stream.closed);
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Why not check the contents here?

Done.

https://chromiumcodereview.appspot.com/10832188/diff/1/tests/standalone/io/li...
tests/standalone/io/list_output_stream_test.dart:157: 
On 2012/08/08 14:21:11, Bill Hesse wrote:
> Add a test that .write throws an exception here?

Done.

Powered by Google App Engine
This is Rietveld 408576698