| Index: tools/dom/src/native_DOMImplementation.dart
|
| diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
|
| index 89f139410824c907f28b772ff438896480913901..c3d9ad88d99ef728461332e6c378194c993dce3a 100644
|
| --- a/tools/dom/src/native_DOMImplementation.dart
|
| +++ b/tools/dom/src/native_DOMImplementation.dart
|
| @@ -200,10 +200,16 @@ final _forwardingPrintClosure = _Utils.forwardingPrint;
|
|
|
| class _Timer implements Timer {
|
| final canceller;
|
| + bool _isDone = false;
|
|
|
| _Timer(this.canceller);
|
|
|
| - void cancel() { canceller(); }
|
| + void cancel() {
|
| + _isDone = true;
|
| + canceller();
|
| + }
|
| +
|
| + bool get isActive => !_isDone;
|
| }
|
|
|
| get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool repeating) {
|
| @@ -223,6 +229,7 @@ get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool
|
| };
|
|
|
| class _PureIsolateTimer implements Timer {
|
| + bool _isDone = false;
|
| final ReceivePort _port = new ReceivePort();
|
| SendPort _sendPort; // Effectively final.
|
|
|
| @@ -232,6 +239,7 @@ class _PureIsolateTimer implements Timer {
|
| _sendPort = _port.toSendPort();
|
| _port.receive((msg, replyTo) {
|
| assert(msg == _TIMER_PING);
|
| + _isDone = !repeating;
|
| callback(this);
|
| if (!repeating) _cancel();
|
| });
|
| @@ -245,12 +253,15 @@ class _PureIsolateTimer implements Timer {
|
| }
|
|
|
| void _cancel() {
|
| + _isDone = true;
|
| _port.close();
|
| }
|
|
|
| _send(msg) {
|
| _sendToHelperIsolate(msg, _sendPort);
|
| }
|
| +
|
| + bool get isActive => !_isDone;
|
| }
|
|
|
| get _pureIsolateTimerFactoryClosure =>
|
|
|