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

Unified Diff: sdk/lib/io/mime_multipart_parser.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: Remove remaining debugging prints. 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: sdk/lib/io/mime_multipart_parser.dart
diff --git a/sdk/lib/io/mime_multipart_parser.dart b/sdk/lib/io/mime_multipart_parser.dart
index 4bfbebe2a6151286345d8e3101f2f7dc6b263002..dc3f2069e8fb4377d685772cf0229ff1ae844973 100644
--- a/sdk/lib/io/mime_multipart_parser.dart
+++ b/sdk/lib/io/mime_multipart_parser.dart
@@ -101,11 +101,10 @@ class MimeMultipartTransformer
Stream<MimeMultipart> bind(Stream<List<int>> stream) {
_controller = new StreamController(
- onPause: () {
- _pauseStream();
- },
- onResume: () {
- _resumeStream();
+ onPause: _pauseStream,
+ onResume:_resumeStream,
+ onCancel: () {
floitsch 2013/05/24 15:53:17 add comment, that we need a closure, because _subs
+ _subscription.cancel();
},
onListen: () {
_subscription = stream.listen(
@@ -126,9 +125,6 @@ class MimeMultipartTransformer
onError: (error) {
_controller.addError(error);
});
- },
- onCancel: () {
- _subscription.cancel();
});
return _controller.stream;
}

Powered by Google App Engine
This is Rietveld 408576698