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

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

Issue 2893893002: Use generic functions in zones. (Closed)
Patch Set: Fix more tests. Created 3 years, 4 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_impl.dart ('k') | sdk/lib/async/zone.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/timer.dart
diff --git a/sdk/lib/async/timer.dart b/sdk/lib/async/timer.dart
index 97f68983e31bb2bdcfbfa9afe50cb647f5b18464..5e103dc689dadcb30119be9d79c42872e5119fec 100644
--- a/sdk/lib/async/timer.dart
+++ b/sdk/lib/async/timer.dart
@@ -48,8 +48,8 @@ abstract class Timer {
// be invoked in the root zone.
return Zone.current.createTimer(duration, callback);
}
- return Zone.current.createTimer(
- duration, Zone.current.bindCallback(callback, runGuarded: true));
+ return Zone.current
+ .createTimer(duration, Zone.current.bindCallbackGuarded(callback));
}
/**
@@ -74,10 +74,7 @@ abstract class Timer {
// be invoked in the root zone.
return Zone.current.createPeriodicTimer(duration, callback);
}
- // TODO(floitsch): the return type should be 'void', and the type
- // should be inferred.
- var boundCallback = Zone.current
- .bindUnaryCallback<dynamic, Timer>(callback, runGuarded: true);
+ var boundCallback = Zone.current.bindUnaryCallbackGuarded<Timer>(callback);
return Zone.current.createPeriodicTimer(duration, boundCallback);
}
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | sdk/lib/async/zone.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698