| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.async; | 5 part of dart.async; |
| 6 | 6 |
| 7 class _BroadcastStream<T> extends _StreamImpl<T> { | 7 class _BroadcastStream<T> extends _ControllerStream<T> { |
| 8 _BroadcastStreamController _controller; | 8 _BroadcastStream(_StreamControllerLifecycle controller) : super(controller); |
| 9 | |
| 10 _BroadcastStream(this._controller); | |
| 11 | 9 |
| 12 bool get isBroadcast => true; | 10 bool get isBroadcast => true; |
| 13 | |
| 14 StreamSubscription<T> _createSubscription( | |
| 15 void onData(T data), | |
| 16 void onError(Object error), | |
| 17 void onDone(), | |
| 18 bool cancelOnError) => | |
| 19 _controller._subscribe(onData, onError, onDone, cancelOnError); | |
| 20 } | 11 } |
| 21 | 12 |
| 22 abstract class _BroadcastSubscriptionLink { | 13 abstract class _BroadcastSubscriptionLink { |
| 23 _BroadcastSubscriptionLink _next; | 14 _BroadcastSubscriptionLink _next; |
| 24 _BroadcastSubscriptionLink _previous; | 15 _BroadcastSubscriptionLink _previous; |
| 25 } | 16 } |
| 26 | 17 |
| 27 class _BroadcastSubscription<T> extends _ControllerSubscription<T> | 18 class _BroadcastSubscription<T> extends _ControllerSubscription<T> |
| 28 implements _BroadcastSubscriptionLink { | 19 implements _BroadcastSubscriptionLink { |
| 29 static const int _STATE_EVENT_ID = 1; | 20 static const int _STATE_EVENT_ID = 1; |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 _pauseCount++; | 475 _pauseCount++; |
| 485 } | 476 } |
| 486 void resume() { _resume(null); } | 477 void resume() { _resume(null); } |
| 487 void _resume(_) { | 478 void _resume(_) { |
| 488 if (_pauseCount > 0) _pauseCount--; | 479 if (_pauseCount > 0) _pauseCount--; |
| 489 } | 480 } |
| 490 void cancel() {} | 481 void cancel() {} |
| 491 bool get isPaused => _pauseCount > 0; | 482 bool get isPaused => _pauseCount > 0; |
| 492 Future asFuture([Object value]) => new _FutureImpl(); | 483 Future asFuture([Object value]) => new _FutureImpl(); |
| 493 } | 484 } |
| OLD | NEW |