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

Unified Diff: mojo/public/dart/src/event_stream.dart

Issue 987523002: Dart: Fixes bug in MojoEventStreamListener (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | services/dart/dart_apptests/echo_apptests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/dart/src/event_stream.dart
diff --git a/mojo/public/dart/src/event_stream.dart b/mojo/public/dart/src/event_stream.dart
index 9c8321709332fe05ab77edf1ca35dabf13b2dba9..c1251140acaaefd870bf0e18085337e16cf8a879 100644
--- a/mojo/public/dart/src/event_stream.dart
+++ b/mojo/public/dart/src/event_stream.dart
@@ -179,14 +179,6 @@ class MojoEventStreamListener {
subscription = _eventStream.listen((List<int> event) {
var signalsWatched = new MojoHandleSignals(event[0]);
var signalsReceived = new MojoHandleSignals(event[1]);
- if (signalsReceived.isPeerClosed) {
- if (onClosed != null) onClosed();
- close();
- // The peer being closed obviates any other signal we might
- // have received since we won't be able to read or write the handle.
- // Thus, we just return before invoking other handlers.
- return;
- }
_isInHandler = true;
if (signalsReceived.isReadable) {
assert(_eventStream.readyRead);
@@ -200,6 +192,14 @@ class MojoEventStreamListener {
_eventStream.enableSignals(signalsWatched);
}
_isInHandler = false;
+ if (signalsReceived.isPeerClosed) {
+ if (onClosed != null) onClosed();
+ close();
+ // The peer being closed obviates any other signal we might
+ // have received since we won't be able to read or write the handle.
+ // Thus, we just return before invoking other handlers.
+ return;
+ }
}, onDone: close);
return subscription;
}
« no previous file with comments | « no previous file | services/dart/dart_apptests/echo_apptests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698