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

Unified Diff: sdk/lib/_internal/pub/lib/src/error_group.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 | « samples/swarm/swarm_ui_lib/touch/Scroller.dart ('k') | sdk/lib/_internal/pub/lib/src/utils.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/error_group.dart
diff --git a/sdk/lib/_internal/pub/lib/src/error_group.dart b/sdk/lib/_internal/pub/lib/src/error_group.dart
index 51fb27db7b59651b7a58c644a7e0cb8d34e097e2..71344af88114f98bbdf508e9317b00ddfae7abd6 100644
--- a/sdk/lib/_internal/pub/lib/src/error_group.dart
+++ b/sdk/lib/_internal/pub/lib/src/error_group.dart
@@ -225,10 +225,6 @@ 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;
@@ -239,10 +235,9 @@ class _ErrorGroupStream extends Stream {
/// Creates a new [_ErrorGroupFuture] that's a child of [_group] and wraps
/// [inner].
_ErrorGroupStream(this._group, Stream inner)
- : _controller = new StreamController(sync: true) {
- this._stream = inner.isBroadcast
- ? _controller.stream.asBroadcastStream()
- : _controller.stream;
+ : _controller =
+ inner.isBroadcast ? new StreamController.broadcast(sync: true)
+ : new StreamController(sync: true) {
_subscription = inner.listen((v) {
_controller.add(v);
}, onError: (e) {
@@ -257,7 +252,7 @@ class _ErrorGroupStream extends Stream {
StreamSubscription listen(void onData(value),
{void onError(var error), void onDone(),
bool cancelOnError}) {
- return _stream.listen(onData,
+ return _controller.stream.listen(onData,
onError: onError,
onDone: onDone,
cancelOnError: true);
« no previous file with comments | « samples/swarm/swarm_ui_lib/touch/Scroller.dart ('k') | sdk/lib/_internal/pub/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698