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

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

Issue 23450047: Run runAsync callbacks of futures in their zone. (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 | tests/lib/async/zone_future_run_async_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/future_impl.dart
diff --git a/sdk/lib/async/future_impl.dart b/sdk/lib/async/future_impl.dart
index a149161ba7ffef83552ca26fc74ec103d644aaed..c6bd25fba2972c2d631c34168a7cbb039cfd490c 100644
--- a/sdk/lib/async/future_impl.dart
+++ b/sdk/lib/async/future_impl.dart
@@ -224,9 +224,9 @@ class _Future<T> implements Future<T> {
assert(listener._nextListener == null);
if (_isComplete) {
// Handle late listeners asynchronously.
- runAsync(() {
+ _zone.runAsync(() {
_propagateToListeners(this, listener);
- });
+ }, _zone);
} else {
listener._nextListener = _resultOrListeners;
_resultOrListeners = listener;
@@ -341,9 +341,7 @@ class _Future<T> implements Future<T> {
}
_markPendingCompletion();
- runAsync(() {
- _complete(value);
- });
+ _zone.runAsync(() { _complete(value); }, _zone);
}
void _asyncCompleteError(error, [StackTrace stackTrace]) {
@@ -354,9 +352,7 @@ class _Future<T> implements Future<T> {
assert(_errorTest == null);
_markPendingCompletion();
- runAsync(() {
- _completeError(error, stackTrace);
- });
+ _zone.runAsync(() { _completeError(error, stackTrace); }, _zone);
}
/**
« no previous file with comments | « no previous file | tests/lib/async/zone_future_run_async_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698