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

Unified Diff: sdk/lib/_internal/pub/lib/src/utils.dart

Issue 17490002: Make asBroadcastStream take two callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reintroduce zone. Created 7 years, 6 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/_internal/pub/lib/src/error_group.dart ('k') | sdk/lib/_internal/pub/test/error_group_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index d5210f3d57887889592f05027c36bc629c77ef17..f2706c2064312fd1117c476a68883b5eecdc5eee 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -183,14 +183,13 @@ Future streamFirst(Stream stream) {
/// Returns a wrapped version of [stream] along with a [StreamSubscription] that
/// can be used to control the wrapped stream.
Pair<Stream, StreamSubscription> streamWithSubscription(Stream stream) {
- var controller = new StreamController(sync: true);
- var controllerStream = stream.isBroadcast ?
- controller.stream.asBroadcastStream() :
- controller.stream;
+ var controller =
+ stream.isBroadcast ? new StreamController.broadcast(sync: true)
+ : new StreamController(sync: true);
var subscription = stream.listen(controller.add,
onError: controller.addError,
onDone: controller.close);
- return new Pair<Stream, StreamSubscription>(controllerStream, subscription);
+ return new Pair<Stream, StreamSubscription>(controller.stream, subscription);
}
// TODO(nweiz): remove this when issue 7787 is fixed.
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/error_group.dart ('k') | sdk/lib/_internal/pub/test/error_group_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698