| 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 /** Abstract and private interface for a place to put events. */ | 7 /** Abstract and private interface for a place to put events. */ |
| 8 abstract class _EventSink<T> { | 8 abstract class _EventSink<T> { |
| 9 void _add(T data); | 9 void _add(T data); |
| 10 void _addError(Object error, StackTrace stackTrace); | 10 void _addError(Object error, StackTrace stackTrace); |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 if (!isPaused && !_isSent) { | 769 if (!isPaused && !_isSent) { |
| 770 _schedule(); | 770 _schedule(); |
| 771 } | 771 } |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 | 774 |
| 775 Future cancel() => null; | 775 Future cancel() => null; |
| 776 | 776 |
| 777 Future asFuture([futureValue]) { | 777 Future asFuture([futureValue]) { |
| 778 _Future result = new _Future(); | 778 _Future result = new _Future(); |
| 779 _onDone = () { result._completeWithValue(null); } | 779 _onDone = () { result._completeWithValue(null); }; |
| 780 return result; | 780 return result; |
| 781 } | 781 } |
| 782 | 782 |
| 783 void _sendDone() { | 783 void _sendDone() { |
| 784 _state &= ~_SCHEDULED; | 784 _state &= ~_SCHEDULED; |
| 785 if (isPaused) return; | 785 if (isPaused) return; |
| 786 _state |= _DONE_SENT; | 786 _state |= _DONE_SENT; |
| 787 _zone.runGuarded(_onDone); | 787 _zone.runGuarded(_onDone); |
| 788 } | 788 } |
| 789 } | 789 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 _Future<bool> hasNext = _futureOrPrefetch; | 1066 _Future<bool> hasNext = _futureOrPrefetch; |
| 1067 _clear(); | 1067 _clear(); |
| 1068 hasNext._complete(false); | 1068 hasNext._complete(false); |
| 1069 return; | 1069 return; |
| 1070 } | 1070 } |
| 1071 _subscription.pause(); | 1071 _subscription.pause(); |
| 1072 _futureOrPrefetch = null; | 1072 _futureOrPrefetch = null; |
| 1073 _state = _STATE_EXTRA_DONE; | 1073 _state = _STATE_EXTRA_DONE; |
| 1074 } | 1074 } |
| 1075 } | 1075 } |
| OLD | NEW |