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

Side by Side Diff: sdk/lib/async/stream_impl.dart

Issue 18749002: Use typedefs in lib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 7 years, 5 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_pipe.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 /** 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 * Set by calling [cancel], or by handling a "done" event, or an "error" event 70 * Set by calling [cancel], or by handling a "done" event, or an "error" event
71 * when `cancelOnError` is true. 71 * when `cancelOnError` is true.
72 */ 72 */
73 static const int _STATE_CANCELED = 8; 73 static const int _STATE_CANCELED = 8;
74 static const int _STATE_IN_CALLBACK = 16; 74 static const int _STATE_IN_CALLBACK = 16;
75 static const int _STATE_HAS_PENDING = 32; 75 static const int _STATE_HAS_PENDING = 32;
76 static const int _STATE_PAUSE_COUNT = 64; 76 static const int _STATE_PAUSE_COUNT = 64;
77 static const int _STATE_PAUSE_COUNT_SHIFT = 6; 77 static const int _STATE_PAUSE_COUNT_SHIFT = 6;
78 78
79 /* Event handlers provided in constructor. */ 79 /* Event handlers provided in constructor. */
80 /* TODO(7733): Fix Function->_DataHandler<T> when dart2js understands 80 _DataHandler<T> _onData;
81 * parameterized function types. */
82 Function _onData;
83 _ErrorHandler _onError; 81 _ErrorHandler _onError;
84 _DoneHandler _onDone; 82 _DoneHandler _onDone;
85 final _Zone _zone = _Zone.current; 83 final _Zone _zone = _Zone.current;
86 84
87 /** Bit vector based on state-constants above. */ 85 /** Bit vector based on state-constants above. */
88 int _state; 86 int _state;
89 87
90 /** 88 /**
91 * Queue of pending events. 89 * Queue of pending events.
92 * 90 *
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 _FutureImpl<bool> hasNext = _futureOrPrefetch; 1000 _FutureImpl<bool> hasNext = _futureOrPrefetch;
1003 _clear(); 1001 _clear();
1004 hasNext._setValue(false); 1002 hasNext._setValue(false);
1005 return; 1003 return;
1006 } 1004 }
1007 _subscription.pause(); 1005 _subscription.pause();
1008 _futureOrPrefetch = null; 1006 _futureOrPrefetch = null;
1009 _state = _STATE_EXTRA_DONE; 1007 _state = _STATE_EXTRA_DONE;
1010 } 1008 }
1011 } 1009 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698