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

Unified Diff: runtime/lib/timer_patch.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/timer_impl.dart ('k') | sdk/lib/io/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/timer_patch.dart
===================================================================
--- runtime/lib/timer_patch.dart (revision 43127)
+++ runtime/lib/timer_patch.dart (working copy)
@@ -4,7 +4,11 @@
patch class Timer {
/*patch*/ static Timer _createTimer(Duration duration, void callback()) {
+ // TODO(iposva): Remove _TimerFactory and use VMLibraryHooks exclusively.
if (_TimerFactory._factory == null) {
+ _TimerFactory._factory = VMLibraryHooks.timerFactory;
+ }
+ if (_TimerFactory._factory == null) {
throw new UnsupportedError("Timer interface not supported.");
}
int milliseconds = duration.inMilliseconds;
@@ -14,7 +18,11 @@
/*patch*/ static Timer _createPeriodicTimer(Duration duration,
void callback(Timer timer)) {
+ // TODO(iposva): Remove _TimerFactory and use VMLibraryHooks exclusively.
if (_TimerFactory._factory == null) {
+ _TimerFactory._factory = VMLibraryHooks.timerFactory;
+ }
+ if (_TimerFactory._factory == null) {
throw new UnsupportedError("Timer interface not supported.");
}
int milliseconds = duration.inMilliseconds;
@@ -27,12 +35,8 @@
void callback(Timer timer),
bool repeating);
+// Warning: Dartium sets _TimerFactory._factory instead of setting things up
+// through VMLibraryHooks.timerFactory.
class _TimerFactory {
static _TimerFactoryClosure _factory;
}
-
-// TODO(ahe): Warning: this is NOT called by Dartium. Instead, it sets
-// [_TimerFactory._factory] directly.
-void _setTimerFactoryClosure(_TimerFactoryClosure closure) {
- _TimerFactory._factory = closure;
-}
« no previous file with comments | « runtime/lib/timer_impl.dart ('k') | sdk/lib/io/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698