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

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

Issue 13430008: Only use special method to send messages to helper isolate. (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
Index: tools/dom/src/Timer.dart
diff --git a/tools/dom/src/Timer.dart b/tools/dom/src/Timer.dart
index 8d3660976a89b6319a3c335345ed5dac3014f78f..604899bc47759e7076c04959f63cbe451e6a8352 100644
--- a/tools/dom/src/Timer.dart
+++ b/tools/dom/src/Timer.dart
@@ -4,7 +4,6 @@
part of html;
-// TODO(antonm): support not DOM isolates too.
class _Timer implements Timer {
final canceller;
@@ -55,22 +54,8 @@ class _PureIsolateTimer implements Timer {
_port.close();
}
- // Tricky part.
- // Once _HELPER_ISOLATE_PORT gets resolved, it will still delay in .then
- // and to delay Timer.run is used. However, Timer.run will try to register
- // another Timer and here we got stuck: event cannot be posted as then
- // callback is not executed because it's delayed with timer.
- // Therefore once future is resolved, it's unsafe to call .then on it
- // in Timer code.
_send(msg) {
- if (_SEND_PORT != null) {
- _SEND_PORT.send(msg, _sendPort);
- } else {
- _HELPER_ISOLATE_PORT.then((port) {
- _SEND_PORT = port;
- _SEND_PORT.send(msg, _sendPort);
- });
- }
+ _sendToHelperIsolate(msg, _sendPort);
}
}

Powered by Google App Engine
This is Rietveld 408576698