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

Unified Diff: runtime/lib/timer_impl.dart

Issue 878323002: - Move timer implementation closer to the rest of message handling. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | « runtime/lib/isolate_sources.gypi ('k') | runtime/lib/timer_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/timer_impl.dart
===================================================================
--- runtime/lib/timer_impl.dart (working copy)
+++ runtime/lib/timer_impl.dart (working copy)
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.io;
-
// Timer heap implemented as a array-based binary heap[0].
// This allows for O(1) `first`, O(log(n)) `remove`/`removeFirst` and O(log(n))
// `add`.
@@ -263,7 +261,7 @@
// No pending timers: Close the receive port and let the event handler
// know.
if (_receivePort != null) {
- _EventHandler._sendData(null, _sendPort, _NO_TIMER);
+ VMLibraryHooks.eventHandlerSendData(null, _sendPort, _NO_TIMER);
_shutdownTimerHandler();
}
} else {
@@ -281,14 +279,14 @@
var wakeupTime = _heap.first._wakeupTime;
if ((_scheduledWakeupTime == null) ||
(wakeupTime != _scheduledWakeupTime)) {
- _EventHandler._sendData(null, _sendPort, wakeupTime);
+ VMLibraryHooks.eventHandlerSendData(null, _sendPort, wakeupTime);
_scheduledWakeupTime = wakeupTime;
}
}
}
}
- static void _handleTimeout(pendingImmediateCallback) {
+ static void _handleTimeout() {
// Fast exit if no timers have been scheduled.
if (_heap.isEmpty && (_firstZeroTimer == null)) {
assert(_receivePort == null);
@@ -398,7 +396,7 @@
timer._addTimerToHeap();
}
// Execute pending micro tasks.
- pendingImmediateCallback();
+ _runPendingImmediateCallback();
}
}
} finally {
@@ -439,3 +437,7 @@
return new _Timer(milliSeconds, callback);
}
}
+
+_setupHooks() {
+ VMLibraryHooks.timerFactory = _Timer._factory;
+}
« no previous file with comments | « runtime/lib/isolate_sources.gypi ('k') | runtime/lib/timer_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698