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

Unified Diff: runtime/lib/timer_impl.dart

Issue 3011503002: Revert "Add ticks counter to Timer." (Closed)
Patch Set: 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
Index: runtime/lib/timer_impl.dart
diff --git a/runtime/lib/timer_impl.dart b/runtime/lib/timer_impl.dart
index fb0dfa897e49dae346c0cb158cb62af63bf1288a..8c0a670abdfdaedafdb94b18d33dc589c7e4e2fa 100644
--- a/runtime/lib/timer_impl.dart
+++ b/runtime/lib/timer_impl.dart
@@ -146,8 +146,6 @@ class _Timer implements Timer {
var _indexOrNext; // Index if part of the TimerHeap, link otherwise.
int _id; // Incrementing id to enable sorting of timers with same expiry.
- int _tick = 0; // Backing for [tick],
-
// Get the next available id. We accept collisions and reordering when the
// _idCount overflows and the timers expire at the same millisecond.
static int _nextId() {
@@ -199,8 +197,6 @@ class _Timer implements Timer {
bool get isActive => _callback != null;
- int get tick => _tick;
-
// Cancels a set timer. The timer is removed from the timer heap if it is a
// non-zero timer. Zero timers are kept in the list as they need to consume
// the corresponding pending message.
@@ -367,18 +363,7 @@ class _Timer implements Timer {
if (!timer._repeating) {
// Mark timer as inactive.
timer._callback = null;
- } else if (timer._milliSeconds > 0) {
- var ms = timer._milliSeconds;
- int overdue =
- VMLibraryHooks.timerMillisecondClock() - timer._wakeupTime;
- if (overdue > ms) {
- int missedTicks = overdue ~/ ms;
- timer._wakeupTime += missedTicks * ms;
- timer._tick += missedTicks;
- }
}
- timer._tick += 1;
-
callback(timer);
// Re-insert repeating timer if not canceled.
if (timer._repeating && (timer._callback != null)) {
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js ('k') | sdk/lib/_internal/js_runtime/lib/isolate_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698