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

Unified Diff: runtime/bin/socket_stream_impl.dart

Issue 10317007: Revert socket output stream changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « no previous file | tests/standalone/standalone.status » ('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 cf9f59092b1d4b7a5192086bec9eeda485aee8a3..ac750b9c091bf8be33c60f7458d78103de011f97 100644
--- a/runtime/bin/socket_stream_impl.dart
+++ b/runtime/bin/socket_stream_impl.dart
@@ -112,7 +112,7 @@ class _SocketOutputStream
if (!_pendingWrites.isEmpty()) {
// Mark the socket for close when all data is written.
_closing = true;
- _setupWriteHander();
+ _socket._onWrite = _onWrite;
} else {
// Close the socket for writing.
_socket._closeWrite();
@@ -128,19 +128,9 @@ class _SocketOutputStream
}
void set onNoPendingWrites(void callback()) {
- if (_noPendingWritesTimer != null) {
- _noPendingWritesTimer.cancel();
- _noPendingWritesTimer = null;
- }
_onNoPendingWrites = callback;
if (_onNoPendingWrites != null) {
- if (_pendingWrites.isEmpty()) {
- _noPendingWritesTimer = new Timer(0, (t) {
- if (_onNoPendingWrites != null) _onNoPendingWrites();
- });
- } else {
- _setupWriteHander();
- }
+ _socket._onWrite = _onWrite;
}
}
@@ -164,7 +154,7 @@ class _SocketOutputStream
assert(offset + len == buffer.length);
_pendingWrites.add(buffer, notWrittenOffset);
}
- _setupWriteHander();
+ _socket._onWrite = _onWrite;
return false;
}
@@ -196,16 +186,6 @@ class _SocketOutputStream
}
}
- void _setupWriteHander() {
- // Set up the callback for writing the pending data as the
- // underlying socket becomes ready for writing.
- if (_noPendingWritesTimer != null) {
- _noPendingWritesTimer.cancel();
- _noPendingWritesTimer = null;
- }
- _socket._onWrite = _onWrite;
- }
-
bool _onSocketError(e) {
close();
if (_onError != null) {
@@ -219,7 +199,6 @@ class _SocketOutputStream
Socket _socket;
_BufferList _pendingWrites;
Function _onNoPendingWrites;
- Timer _noPendingWritesTimer;
bool _closing = false;
bool _closed = false;
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698