| 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 // ------------------------------------------------------------------- | 7 // ------------------------------------------------------------------- |
| 8 // Controller for creating and adding events to a stream. | 8 // Controller for creating and adding events to a stream. |
| 9 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
| 10 | 10 |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 if (_isEmpty) return; | 657 if (_isEmpty) return; |
| 658 _forEachListener((_BufferingStreamSubscription<T> subscription) { | 658 _forEachListener((_BufferingStreamSubscription<T> subscription) { |
| 659 subscription._addError(error); | 659 subscription._addError(error); |
| 660 }); | 660 }); |
| 661 } | 661 } |
| 662 | 662 |
| 663 void _sendDone() { | 663 void _sendDone() { |
| 664 if (_isEmpty) return; | 664 if (_isEmpty) return; |
| 665 _forEachListener((_BroadcastSubscription<T> subscription) { | 665 _forEachListener((_BroadcastSubscription<T> subscription) { |
| 666 subscription._close(); | 666 subscription._close(); |
| 667 subscription._eventState |= | |
| 668 _BroadcastSubscription._STATE_REMOVE_AFTER_FIRING; | |
| 669 }); | 667 }); |
| 670 } | 668 } |
| 671 } | 669 } |
| 672 | 670 |
| 673 class _AsyncBroadcastStreamController<T> extends _BroadcastStreamController<T> { | 671 class _AsyncBroadcastStreamController<T> extends _BroadcastStreamController<T> { |
| 674 _AsyncBroadcastStreamController(void onListen(), void onCancel()) | 672 _AsyncBroadcastStreamController(void onListen(), void onCancel()) |
| 675 : super(onListen, onCancel); | 673 : super(onListen, onCancel); |
| 676 | 674 |
| 677 // EventDispatch interface. | 675 // EventDispatch interface. |
| 678 | 676 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 763 } |
| 766 | 764 |
| 767 void _callOnCancel() { | 765 void _callOnCancel() { |
| 768 if (_hasPending) { | 766 if (_hasPending) { |
| 769 _pending.clear(); | 767 _pending.clear(); |
| 770 _pending = null; | 768 _pending = null; |
| 771 } | 769 } |
| 772 super._callOnCancel(); | 770 super._callOnCancel(); |
| 773 } | 771 } |
| 774 } | 772 } |
| OLD | NEW |