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

Unified Diff: runtime/bin/socket_patch.dart

Issue 14753009: Make StreamSubscription be the active part of a stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 7 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 | « pkg/scheduled_test/lib/src/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/error_group.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index f233a982789d4ad4d18f2c88aba3147a9118a9ea..d86a17c1d8de72491c92c29d068310286db63a87 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -837,11 +837,6 @@ class _SocketStreamConsumer extends StreamConsumer<List<int>> {
if (offset < buffer.length) {
if (!paused) {
paused = true;
- // TODO(ajohnsen): It would be nice to avoid this check.
- // Some info: socket._write can emit an event, if it fails to write.
- // If the user closes the socket in that event, stop() will be called
- // before we get a change to pause.
- if (subscription == null) return;
subscription.pause();
}
socket._enableWriteEvent();
@@ -874,6 +869,7 @@ class _SocketStreamConsumer extends StreamConsumer<List<int>> {
if (subscription == null) return;
subscription.cancel();
subscription = null;
+ paused = false;
socket._disableWriteEvent();
}
}
« no previous file with comments | « pkg/scheduled_test/lib/src/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/error_group.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698