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

Unified Diff: tools/dom/src/native_DOMImplementation.dart

Issue 13308002: Add a test for timers in child isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
« tools/dom/src/Timer.dart ('K') | « tools/dom/src/Timer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/native_DOMImplementation.dart
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index 8bcab03d4f5f5bc7de7dbed328ab2b22792e5083..2469b0272f923fbd60c3c776d606965dc5496505 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -147,10 +147,10 @@ _helperIsolateMain() {
if (cmd == _NEW_TIMER) {
final duration = new Duration(milliseconds: msg[1]);
bool periodic = msg[2];
- final callback = () { replyTo.send(_TIMER_PING); };
+ ping() { replyTo.send(_TIMER_PING); };
_TIMER_REGISTRY[replyTo] = periodic ?
- new Timer.periodic(duration, callback) :
- new Timer(duration, callback);
+ new Timer.periodic(duration, (_) { ping(); }) :
+ new Timer(duration, ping);
} else if (cmd == _CANCEL_TIMER) {
_TIMER_REGISTRY.remove(replyTo).cancel();
} else if (cmd == _PRINT) {
« tools/dom/src/Timer.dart ('K') | « tools/dom/src/Timer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698