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

Unified Diff: sdk/lib/async/stream_controller.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: sdk/lib/async/stream_controller.dart
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index 24a9999b654b0c1a29700d3ea9e1b4155dd9e140..6fcc53746f8eada82fef6f84e6e12646f7e0c441 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.dart
@@ -50,22 +50,6 @@ class StreamController<T> extends EventSink<T> {
final _StreamImpl<T> stream;
/**
- * A controller with a broadcast [stream]..
- *
- * The [onPauseStateChange] function is called when the stream becomes
- * paused or resumes after being paused. The current pause state can
- * be read from [isPaused]. Ignored if [:null:].
- *
- * The [onSubscriptionStateChange] function is called when the stream
- * receives its first listener or loses its last. The current subscription
- * state can be read from [hasListener]. Ignored if [:null:].
- */
- StreamController.broadcast({void onPauseStateChange(),
- void onSubscriptionStateChange()})
- : stream = new _MultiControllerStream<T>(onSubscriptionStateChange,
- onPauseStateChange);
-
- /**
* A controller with a [stream] that supports only one single subscriber.
*
* The controller will buffer all incoming events until the subscriber is
@@ -141,33 +125,6 @@ class StreamController<T> extends EventSink<T> {
typedef void _NotificationHandler();
-class _MultiControllerStream<T> extends _MultiStreamImpl<T> {
- _NotificationHandler _subscriptionHandler;
- _NotificationHandler _pauseHandler;
-
- _MultiControllerStream(this._subscriptionHandler, this._pauseHandler);
-
- void _onSubscriptionStateChange() {
- if (_subscriptionHandler != null) {
- try {
- _subscriptionHandler();
- } catch (e, s) {
- new AsyncError(e, s).throwDelayed();
- }
- }
- }
-
- void _onPauseStateChange() {
- if (_pauseHandler != null) {
- try {
- _pauseHandler();
- } catch (e, s) {
- new AsyncError(e, s).throwDelayed();
- }
- }
- }
-}
-
class _SingleControllerStream<T> extends _SingleStreamImpl<T> {
_NotificationHandler _subscriptionHandler;
_NotificationHandler _pauseHandler;

Powered by Google App Engine
This is Rietveld 408576698