| 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); | 10 void _addError(Object error); |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 /** A delayed event on a buffering stream subscription. */ | 542 /** A delayed event on a buffering stream subscription. */ |
| 543 abstract class _DelayedEvent { | 543 abstract class _DelayedEvent { |
| 544 /** Added as a linked list on the [StreamController]. */ | 544 /** Added as a linked list on the [StreamController]. */ |
| 545 _DelayedEvent next; | 545 _DelayedEvent next; |
| 546 /** Execute the delayed event on the [StreamController]. */ | 546 /** Execute the delayed event on the [StreamController]. */ |
| 547 void perform(_EventDispatch dispatch); | 547 void perform(_EventDispatch dispatch); |
| 548 } | 548 } |
| 549 | 549 |
| 550 /** A delayed data event. */ | 550 /** A delayed data event. */ |
| 551 class _DelayedData<T> extends _DelayedEvent{ | 551 class _DelayedData<T> extends _DelayedEvent { |
| 552 final T value; | 552 final T value; |
| 553 _DelayedData(this.value); | 553 _DelayedData(this.value); |
| 554 void perform(_EventDispatch<T> dispatch) { | 554 void perform(_EventDispatch<T> dispatch) { |
| 555 dispatch._sendData(value); | 555 dispatch._sendData(value); |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 | 558 |
| 559 /** A delayed error event. */ | 559 /** A delayed error event. */ |
| 560 class _DelayedError extends _DelayedEvent { | 560 class _DelayedError extends _DelayedEvent { |
| 561 final error; | 561 final error; |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 _FutureImpl<bool> hasNext = _futureOrPrefetch; | 1000 _FutureImpl<bool> hasNext = _futureOrPrefetch; |
| 1001 _clear(); | 1001 _clear(); |
| 1002 hasNext._setValue(false); | 1002 hasNext._setValue(false); |
| 1003 return; | 1003 return; |
| 1004 } | 1004 } |
| 1005 _subscription.pause(); | 1005 _subscription.pause(); |
| 1006 _futureOrPrefetch = null; | 1006 _futureOrPrefetch = null; |
| 1007 _state = _STATE_EXTRA_DONE; | 1007 _state = _STATE_EXTRA_DONE; |
| 1008 } | 1008 } |
| 1009 } | 1009 } |
| OLD | NEW |