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

Unified Diff: utils/pub/error_group.dart

Issue 14136004: Remove StreamController.broadcast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: utils/pub/error_group.dart
diff --git a/utils/pub/error_group.dart b/utils/pub/error_group.dart
index b5f8f8e9ea5fc1f9804b36411473a215e6238fae..d268d61f626540a5ed0a298bba3d6b2e377264f0 100644
--- a/utils/pub/error_group.dart
+++ b/utils/pub/error_group.dart
@@ -225,6 +225,10 @@ class _ErrorGroupStream extends Stream {
/// The underlying [StreamController] for [this].
final StreamController _controller;
+ /// The controller's [Stream]. May be different than `_controller.stream` if
+ /// the wrapped stream is a broadcasting stream.
+ Stream _stream;
+
/// The [StreamSubscription] that connects the wrapped [Stream] to
/// [_controller].
StreamSubscription _subscription;
@@ -235,9 +239,10 @@ class _ErrorGroupStream extends Stream {
/// Creates a new [_ErrorGroupFuture] that's a child of [_group] and wraps
/// [inner].
_ErrorGroupStream(this._group, Stream inner)
- : _controller = inner.isBroadcast ?
- new StreamController.broadcast() :
- new StreamController() {
+ : _controller = new StreamController() {
+ this.stream = isBroadcast
+ ? _controller.stream.asBroadcastStream()
+ : _controller.stream;
_subscription = inner.listen((v) {
_controller.add(v);
}, onError: (e) {

Powered by Google App Engine
This is Rietveld 408576698