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

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

Issue 23926011: Rewrite Futures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad asserts. 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 | « sdk/lib/async/stream_pipe.dart ('k') | tests/lib/async/future_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/zone.dart
diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
index 9be85d1053b5ea6cc2f49decfe9611a5e5209940..bd1da92549d8a1e5620fed053b553cb65387c9aa 100644
--- a/sdk/lib/async/zone.dart
+++ b/sdk/lib/async/zone.dart
@@ -87,13 +87,13 @@ abstract class _Zone {
*
* Returns the result of the invocation.
*/
- runFromChildZone(f());
+ dynamic runFromChildZone(f());
/**
* Same as [runFromChildZone] but catches uncaught errors and gives them to
* [handleUncaughtError].
*/
- runFromChildZoneGuarded(f());
+ dynamic runFromChildZoneGuarded(f());
/**
* Runs [f] asynchronously in [zone].
@@ -181,7 +181,7 @@ class _ZoneBase implements _Zone {
* A zone is done when its dynamic extent has finished executing and
* there are no outstanding asynchronous callbacks.
*/
- _dispose() {
+ void _dispose() {
if (_parentZone != null) {
_parentZone._removeChild(this);
}
@@ -218,10 +218,10 @@ class _ZoneBase implements _Zone {
this._runGuarded(f);
}
- runFromChildZone(f()) => this._runUnguarded(f);
- runFromChildZoneGuarded(f()) => this._runGuarded(f);
+ dynamic runFromChildZone(f()) => this._runUnguarded(f);
+ dynamic runFromChildZoneGuarded(f()) => this._runGuarded(f);
- _runInZone(f(), bool handleUncaught) {
+ dynamic _runInZone(f(), bool handleUncaught) {
if (identical(_Zone._current, this)
&& !handleUncaught
&& _isExecutingCallback) {
@@ -261,18 +261,18 @@ class _ZoneBase implements _Zone {
*
* Uncaught errors are given to [handleUncaughtError].
*/
- _runGuarded(void f()) {
+ dynamic _runGuarded(void f()) {
return _runInZone(f, true);
}
/**
* Runs the function but doesn't catch uncaught errors.
*/
- _runUnguarded(void f()) {
+ dynamic _runUnguarded(void f()) {
return _runInZone(f, false);
}
- runAsync(void f(), _Zone zone) => _parentZone.runAsync(f, zone);
+ void runAsync(void f(), _Zone zone) => _parentZone.runAsync(f, zone);
// TODO(floitsch): the zone should just forward to the parent zone. The
// default zone should then create the _ZoneTimer.
@@ -305,7 +305,7 @@ class _DefaultZone extends _ZoneBase {
_Zone get _errorZone => this;
- handleUncaughtError(error) {
+ void handleUncaughtError(error) {
_scheduleAsyncCallback(() {
print("Uncaught Error: ${error}");
var trace = getAttachedStackTrace(error);
@@ -341,14 +341,15 @@ class _WaitForCompletionZone extends _ZoneBase {
_WaitForCompletionZone(_Zone parentZone, this._onDone) : super(parentZone);
/**
- * Runs the given function asynchronously. Executes the [_onDone] callback
- * when the zone is done.
+ * Runs the given function.
+ *
+ * Executes the [_onDone] callback when the zone is done.
*/
- runWaitForCompletion(void f()) {
+ dynamic runWaitForCompletion(void f()) {
return this._runUnguarded(f);
}
- _dispose() {
+ void _dispose() {
super._dispose();
_onDone();
}
@@ -370,7 +371,7 @@ class _CatchErrorsZone extends _WaitForCompletionZone {
_Zone get _errorZone => this;
- handleUncaughtError(error) {
+ void handleUncaughtError(error) {
try {
_handleError(error);
} catch(e, s) {
@@ -386,7 +387,7 @@ class _CatchErrorsZone extends _WaitForCompletionZone {
* Runs the given function asynchronously. Executes the [_onDone] callback
* when the zone is done.
*/
- runWaitForCompletion(void f()) {
+ dynamic runWaitForCompletion(void f()) {
return this._runGuarded(f);
}
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | tests/lib/async/future_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698