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

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
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 3de4c29597c8148429f16abbd40ccc6adb65e37c..8dbb54b54825362810a09c9e86c135381b6eb664 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -842,12 +842,6 @@ class _SocketStreamConsumer extends StreamConsumer<List<int>> {
offset += socket._write(buffer, offset, buffer.length - offset);
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();

Powered by Google App Engine
This is Rietveld 408576698