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

Unified Diff: sdk/lib/async/broadcast_stream_controller.dart

Issue 23967011: Revert "Rewrite Futures." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/async/future.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/broadcast_stream_controller.dart
diff --git a/sdk/lib/async/broadcast_stream_controller.dart b/sdk/lib/async/broadcast_stream_controller.dart
index aa5b111c77936bd9903cde8312cbfccf322b76ae..fb728726171c145d1dd660239824c816df80eb06 100644
--- a/sdk/lib/async/broadcast_stream_controller.dart
+++ b/sdk/lib/async/broadcast_stream_controller.dart
@@ -107,7 +107,7 @@ abstract class _BroadcastStreamController<T>
* Any attempt to listen after calling [close] will throw, so there won't
* be any further listeners.
*/
- _Future _doneFuture;
+ _FutureImpl _doneFuture;
_BroadcastStreamController(this._onListen, this._onCancel)
: _state = _STATE_INITIAL {
@@ -140,9 +140,9 @@ abstract class _BroadcastStreamController<T>
bool get _mayAddEvent => (_state < _STATE_CLOSED);
- _Future _ensureDoneFuture() {
+ _FutureImpl _ensureDoneFuture() {
if (_doneFuture != null) return _doneFuture;
- return _doneFuture = new _Future();
+ return _doneFuture = new _FutureImpl();
}
// Linked list helpers
@@ -314,7 +314,7 @@ abstract class _BroadcastStreamController<T>
assert(_isEmpty);
if (isClosed && _doneFuture._mayComplete) {
// When closed, _doneFuture is not null.
- _doneFuture._asyncComplete(null);
+ _doneFuture._asyncSetValue(null);
}
_runGuarded(_onCancel);
}
@@ -348,7 +348,7 @@ class _SyncBroadcastStreamController<T> extends _BroadcastStreamController<T> {
} else {
assert(_doneFuture != null);
assert(_doneFuture._mayComplete);
- _doneFuture._asyncComplete(null);
+ _doneFuture._asyncSetValue(null);
}
}
}
@@ -388,7 +388,7 @@ class _AsyncBroadcastStreamController<T> extends _BroadcastStreamController<T> {
} else {
assert(_doneFuture != null);
assert(_doneFuture._mayComplete);
- _doneFuture._asyncComplete(null);
+ _doneFuture._asyncSetValue(null);
}
}
}
@@ -480,5 +480,5 @@ class _DoneSubscription<T> implements StreamSubscription<T> {
}
void cancel() {}
bool get isPaused => _pauseCount > 0;
- Future asFuture([Object value]) => new _Future();
+ Future asFuture([Object value]) => new _FutureImpl();
}
« no previous file with comments | « no previous file | sdk/lib/async/future.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698