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

Unified Diff: utils/pub/utils.dart

Issue 12374033: Remove the wrapStream workaround for issue 8310. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/utils.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 6fe071f65b2950c90ef5b88179d3f34686e0416c..1e893f5bb39adfcd85f39cd0c65c031be427a381 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -236,7 +236,7 @@ final RegExp _lineRegexp = new RegExp(r"\r\n|\r|\n");
/// newline is ignored.
Stream<String> streamToLines(Stream<String> stream) {
var buffer = new StringBuffer();
- return wrapStream(stream.transform(new StreamTransformer(
+ return stream.transform(new StreamTransformer(
handleData: (chunk, sink) {
var lines = chunk.split(_lineRegexp);
var leftover = lines.removeLast();
@@ -254,20 +254,7 @@ Stream<String> streamToLines(Stream<String> stream) {
handleDone: (sink) {
if (!buffer.isEmpty) sink.add(buffer.toString());
sink.close();
- })));
-}
-
-// TODO(nweiz): remove this when issue 8310 is fixed.
-/// Returns a [Stream] identical to [stream], but piped through a new
-/// [StreamController]. This exists to work around issue 8310.
-Stream wrapStream(Stream stream) {
- var controller = stream.isBroadcast
- ? new StreamController.broadcast()
- : new StreamController();
- stream.listen(controller.add,
- onError: (e) => controller.signalError(e),
- onDone: controller.close);
- return controller.stream;
+ }));
}
/// Like [Iterable.where], but allows [test] to return [Future]s and uses the
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698