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

Side by Side Diff: sdk/lib/async/stream_controller.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698