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

Unified Diff: sdk/lib/io/timer_impl.dart

Issue 78103002: Simplify 0-timers to not go through the eventhandler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/eventhandler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/timer_impl.dart
diff --git a/sdk/lib/io/timer_impl.dart b/sdk/lib/io/timer_impl.dart
index 49c0b434620aa1552e8d131628c775a362a8a0a7..1d7b277c2189463e6d1bec90dcfc38e32c687dc4 100644
--- a/sdk/lib/io/timer_impl.dart
+++ b/sdk/lib/io/timer_impl.dart
@@ -16,15 +16,17 @@ class _Timer extends LinkedListEntry<_Timer> implements Timer {
Function _callback;
int _milliSeconds;
- int _wakeupTime;
+ int _wakeupTime = 0;
static Timer _createTimer(void callback(Timer timer),
int milliSeconds,
bool repeating) {
_Timer timer = new _Timer._internal();
timer._callback = callback;
- timer._wakeupTime =
- new DateTime.now().millisecondsSinceEpoch + milliSeconds;
+ if (milliSeconds > 0) {
+ timer._wakeupTime =
+ new DateTime.now().millisecondsSinceEpoch + milliSeconds;
+ }
timer._milliSeconds = repeating ? milliSeconds : -1;
timer._addTimerToList();
timer._notifyEventHandler();
« no previous file with comments | « runtime/bin/eventhandler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698