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

Unified Diff: runtime/bin/timer_impl.dart

Issue 8992007: Make the repeating argument to timers optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 9 years 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 | « runtime/bin/timer.dart ('k') | samples/actors/core/actors-term.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/timer_impl.dart
diff --git a/runtime/bin/timer_impl.dart b/runtime/bin/timer_impl.dart
index 78baa8c3fbe812d1944ba4070ce844cae6150ea4..d86df5a93c2b5ed5f9b3dc02c30fefd326ead114 100644
--- a/runtime/bin/timer_impl.dart
+++ b/runtime/bin/timer_impl.dart
@@ -14,9 +14,9 @@ class _Timer implements Timer {
*/
static final int _NO_TIMER = -1;
- factory _Timer(void callback(Timer timer),
- int milliSeconds,
- bool repeating) {
+ static Timer createTimer(void callback(Timer timer),
Søren Gjesse 2011/12/19 12:31:36 _createTimer?
Mads Ager (google) 2011/12/19 12:34:37 Done.
+ int milliSeconds,
+ bool repeating) {
EventHandler._start();
if (_timers === null) {
_timers = new DoubleLinkedQueue<_Timer>();
@@ -31,6 +31,14 @@ class _Timer implements Timer {
return timer;
}
+ factory _Timer(void callback(Timer timer), int milliSeconds) {
+ return createTimer(callback, milliSeconds, false);
+ }
+
+ factory _Timer.repeating(void callback(Timer timer), int milliSeconds) {
+ return createTimer(callback, milliSeconds, true);
+ }
+
_Timer._internal() {}
void _clear() {
« no previous file with comments | « runtime/bin/timer.dart ('k') | samples/actors/core/actors-term.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698