Index: sdk/lib/async/broadcast_stream_controller.dart |
diff --git a/sdk/lib/async/broadcast_stream_controller.dart b/sdk/lib/async/broadcast_stream_controller.dart |
index e5a1efc777d0e212c2ea3ae37b2622d024f5a071..6f4ddab11c5156fe17302360b3052d655d63b7a6 100644 |
--- a/sdk/lib/async/broadcast_stream_controller.dart |
+++ b/sdk/lib/async/broadcast_stream_controller.dart |
@@ -79,8 +79,8 @@ abstract class _BroadcastStreamController<T> |
static const int _STATE_CLOSED = 4; |
static const int _STATE_ADDSTREAM = 8; |
- _NotificationHandler _onListen; |
- _NotificationHandler _onCancel; |
+ ControllerCallback onListen; |
+ ControllerCancelCallback onCancel; |
// State of the controller. |
int _state; |
@@ -107,24 +107,30 @@ abstract class _BroadcastStreamController<T> |
*/ |
_Future _doneFuture; |
- _BroadcastStreamController(this._onListen, this._onCancel) |
+ _BroadcastStreamController(this.onListen, this.onCancel) |
: _state = _STATE_INITIAL { |
_next = _previous = this; |
} |
- void set onListen(void onListenHandler()) { _onListen = onListenHandler; } |
+ ControllerCallback get onPause { |
+ throw new UnsupportedError( |
+ "Broadcast stream controllers do not support pause callbacks"); |
+ } |
void set onPause(void onPauseHandler()) { |
throw new UnsupportedError( |
"Broadcast stream controllers do not support pause callbacks"); |
} |
- void set onResume(void onResumeHandler()) { |
+ ControllerCallback get onResume { |
throw new UnsupportedError( |
"Broadcast stream controllers do not support pause callbacks"); |
} |
- void set onCancel(onCancelHandler()) { _onCancel = onCancelHandler; } |
+ void set onResume(void onResumeHandler()) { |
+ throw new UnsupportedError( |
+ "Broadcast stream controllers do not support pause callbacks"); |
+ } |
// StreamController interface. |
@@ -209,7 +215,7 @@ abstract class _BroadcastStreamController<T> |
_addListener(subscription); |
if (identical(_next, _previous)) { |
// Only one listener, so it must be the first listener. |
- _runGuarded(_onListen); |
+ _runGuarded(onListen); |
} |
return subscription; |
} |
@@ -310,7 +316,7 @@ abstract class _BroadcastStreamController<T> |
// Get event id of this event. |
int id = (_state & _STATE_EVENT_ID); |
- // Start firing (set the _STATE_FIRING bit). We don't do [_onCancel] |
+ // Start firing (set the _STATE_FIRING bit). We don't do [onCancel] |
// callbacks while firing, and we prevent reentrancy of this function. |
// |
// Set [_state]'s event id to the next event's id. |
@@ -346,7 +352,7 @@ abstract class _BroadcastStreamController<T> |
// When closed, _doneFuture is not null. |
_doneFuture._asyncComplete(null); |
} |
- _runGuarded(_onCancel); |
+ _runGuarded(onCancel); |
} |
} |