| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 typedef _NoCallbackSyncStreamController/*<T>*/ = _StreamController/*<T>*/ | 572 typedef _NoCallbackSyncStreamController/*<T>*/ = _StreamController/*<T>*/ |
| 573 with _SyncStreamControllerDispatch/*<T>*/, _NoCallbacks; | 573 with _SyncStreamControllerDispatch/*<T>*/, _NoCallbacks; |
| 574 | 574 |
| 575 typedef void _NotificationHandler(); | 575 typedef void _NotificationHandler(); |
| 576 | 576 |
| 577 void _runGuarded(_NotificationHandler notificationHandler) { | 577 void _runGuarded(_NotificationHandler notificationHandler) { |
| 578 if (notificationHandler == null) return; | 578 if (notificationHandler == null) return; |
| 579 try { | 579 try { |
| 580 notificationHandler(); | 580 notificationHandler(); |
| 581 } catch (e, s) { | 581 } catch (e, s) { |
| 582 Zone.current.handleUncaughtError(_asyncError(e, s)); | 582 Zone.current.handleUncaughtError(_asyncError(e, s), s); |
| 583 } | 583 } |
| 584 } | 584 } |
| 585 | 585 |
| 586 class _ControllerStream<T> extends _StreamImpl<T> { | 586 class _ControllerStream<T> extends _StreamImpl<T> { |
| 587 _StreamControllerLifecycle<T> _controller; | 587 _StreamControllerLifecycle<T> _controller; |
| 588 | 588 |
| 589 _ControllerStream(this._controller); | 589 _ControllerStream(this._controller); |
| 590 | 590 |
| 591 StreamSubscription<T> _createSubscription( | 591 StreamSubscription<T> _createSubscription( |
| 592 void onData(T data), | 592 void onData(T data), |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 var varData; | 686 var varData; |
| 687 | 687 |
| 688 _StreamControllerAddStreamState(_StreamController controller, | 688 _StreamControllerAddStreamState(_StreamController controller, |
| 689 this.varData, | 689 this.varData, |
| 690 Stream source) : super(controller, source) { | 690 Stream source) : super(controller, source) { |
| 691 if (controller.isPaused) { | 691 if (controller.isPaused) { |
| 692 addSubscription.pause(); | 692 addSubscription.pause(); |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 } | 695 } |
| OLD | NEW |