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

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: 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 | « sdk/lib/io/http_parser.dart ('k') | sdk/lib/mdv_observe_impl/mdv_observe_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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: () {
+ _subscription.cancel();
},
onListen: () {
_subscription = stream.listen(
@@ -126,9 +125,6 @@ class MimeMultipartTransformer
onError: (error) {
_controller.addError(error);
});
- },
- onCancel: () {
- _subscription.cancel();
});
return _controller.stream;
}
« no previous file with comments | « sdk/lib/io/http_parser.dart ('k') | sdk/lib/mdv_observe_impl/mdv_observe_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698