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

Unified Diff: runtime/bin/socket_impl.dart

Issue 9368058: Revert "Fix potential flakiness of SocketStreamCloseTest." (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 | « no previous file | 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_impl.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
index c8a0e23975196463b81d59dfb0db042ffc1765ab..6b5293601a2e964728fcfe31f2d85f7fe6207a87 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_impl.dart
@@ -58,7 +58,7 @@ class _SocketBase {
// Don't call the in handler if there is no data available
// after all.
- if ((i == _IN_EVENT) && (this is _Socket) && (available() == 0)) {
+ if (i == _IN_EVENT && this is _Socket && available() == 0) {
continue;
}
eventHandler();
@@ -132,34 +132,28 @@ class _SocketBase {
}
void _closeWrite() {
- if (_id >= 0) {
- if (_closedRead) {
- _close();
- } else {
- _sendToEventHandler(1 << _SHUTDOWN_WRITE_COMMAND);
- }
- _closedWrite = true;
+ if (_closedRead) {
+ _close();
+ } else {
+ _sendToEventHandler(1 << _SHUTDOWN_WRITE_COMMAND);
}
+ _closedWrite = true;
}
void _closeRead() {
- if (_id >= 0) {
- if (_closedWrite) {
- _close();
- } else {
- _sendToEventHandler(1 << _SHUTDOWN_READ_COMMAND);
- }
- _closedRead = true;
+ if (_closedWrite) {
+ _close();
+ } else {
+ _sendToEventHandler(1 << _SHUTDOWN_READ_COMMAND);
}
+ _closedRead = true;
}
void _close() {
- if (_id >= 0) {
- _sendToEventHandler(1 << _CLOSE_COMMAND);
- _handler.close();
- _handler = null;
- _id = -1;
- }
+ _sendToEventHandler(1 << _CLOSE_COMMAND);
+ _handler.close();
+ _handler = null;
+ _id = -1;
}
void _sendToEventHandler(int data) {
@@ -167,7 +161,6 @@ class _SocketBase {
_handler = new ReceivePort();
_handler.receive((var message, ignored) { _multiplex(message); });
}
- assert(_id >= 0);
_EventHandler._sendData(_id, _handler, data);
}
« no previous file with comments | « no previous file | tests/standalone/src/SocketCloseTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698