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

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: Addressed 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..52dc7cc7d09dd83f5686ac9171fbd48e57c3362d 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),
+ 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