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

Unified Diff: runtime/bin/socket_stream_impl.dart

Issue 9382001: Another attempt at fixing the Socket tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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/socket_impl.dart ('k') | tests/standalone/src/SocketCloseTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_stream_impl.dart
diff --git a/runtime/bin/socket_stream_impl.dart b/runtime/bin/socket_stream_impl.dart
index d04c41bfb439a1b3ac53665e3a8e7402738ca10f..8a8ca8c57e4bbaaae99fb7b9f5d23c4563163218 100644
--- a/runtime/bin/socket_stream_impl.dart
+++ b/runtime/bin/socket_stream_impl.dart
@@ -4,6 +4,7 @@
class _SocketInputStream implements SocketInputStream {
_SocketInputStream(Socket socket) : _socket = socket {
+ if (_socket._id == -1) _closed = true;
_socket.closeHandler = _closeHandler;
}
@@ -51,7 +52,6 @@ class _SocketInputStream implements SocketInputStream {
void close() {
if (!_closed) {
_socket.close();
- if (_clientCloseHandler !== null) _clientCloseHandler();
}
}
@@ -72,7 +72,9 @@ class _SocketInputStream implements SocketInputStream {
void _closeHandler() {
_closed = true;
- if (_clientCloseHandler !== null) _clientCloseHandler();
+ if (_clientCloseHandler !== null) {
+ _clientCloseHandler();
+ }
}
Socket _socket;
@@ -120,10 +122,6 @@ class _SocketOutputStream implements SocketOutputStream {
}
}
- void set closeHandler(void callback()) {
Søren Gjesse 2012/02/10 10:44:33 We still have a closeHandler setter int the Output
- _socket.closeHandler = callback;
- }
-
void set errorHandler(void callback()) {
_streamErrorHandler = callback;
if (_streamErrorHandler != null) {
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | tests/standalone/src/SocketCloseTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698