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

Unified Diff: pkg/http/lib/src/utils.dart

Issue 11975017: Stop treating StreamController as a Stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/http/lib/src/streamed_request.dart ('k') | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index 87a78a0aa0e3158c87dbf78b1497f7b8aa210b95..14490806713bcf250a1c21818032b029322355e4 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -159,7 +159,7 @@ ByteStream wrapInputStream(InputStream stream) {
stream.onClosed = controller.close;
stream.onData = () => controller.add(stream.read());
stream.onError = (e) => controller.signalError(new AsyncError(e));
- return new ByteStream(controller);
+ return new ByteStream(controller.stream);
}
// TODO(nweiz): remove this once issue 7785 is fixed.
@@ -242,10 +242,10 @@ Stream get emptyStream => streamFromIterable([]);
/// Creates a single-subscription stream that emits the items in [iter] and then
/// ends.
Stream streamFromIterable(Iterable iter) {
- var stream = new StreamController();
- iter.forEach(stream.add);
- stream.close();
- return stream.stream;
+ var controller = new StreamController();
+ iter.forEach(controller.add);
+ controller.close();
+ return controller.stream;
}
// TODO(nweiz): remove this when issue 7787 is fixed.
« no previous file with comments | « pkg/http/lib/src/streamed_request.dart ('k') | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698