| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of html; | 5 part of html; |
| 6 | 6 |
| 7 class _Utils { | 7 class _Utils { |
| 8 static double dateTimeToDouble(DateTime dateTime) => | 8 static double dateTimeToDouble(DateTime dateTime) => |
| 9 dateTime.millisecondsSinceEpoch.toDouble(); | 9 dateTime.millisecondsSinceEpoch.toDouble(); |
| 10 static DateTime doubleToDateTime(double dateTime) { | 10 static DateTime doubleToDateTime(double dateTime) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 _canceler(); | 222 _canceler(); |
| 223 } | 223 } |
| 224 _canceler = null; | 224 _canceler = null; |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool get isActive => _canceler != null; | 227 bool get isActive => _canceler != null; |
| 228 } | 228 } |
| 229 | 229 |
| 230 get _timerFactoryClosure => | 230 get _timerFactoryClosure => |
| 231 (int milliSeconds, void callback(Timer timer), bool repeating) { | 231 (int milliSeconds, void callback(Timer timer), bool repeating) { |
| 232 return new _Timer(milliseconds, callback, repeating); | 232 return new _Timer(milliSeconds, callback, repeating); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 | 235 |
| 236 class _PureIsolateTimer implements Timer { | 236 class _PureIsolateTimer implements Timer { |
| 237 bool _isActive = true; | 237 bool _isActive = true; |
| 238 final ReceivePort _port = new ReceivePort(); | 238 final ReceivePort _port = new ReceivePort(); |
| 239 SendPort _sendPort; // Effectively final. | 239 SendPort _sendPort; // Effectively final. |
| 240 | 240 |
| 241 static SendPort _SEND_PORT; | 241 static SendPort _SEND_PORT; |
| 242 | 242 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 265 _send(msg) { | 265 _send(msg) { |
| 266 _sendToHelperIsolate(msg, _sendPort); | 266 _sendToHelperIsolate(msg, _sendPort); |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool get isActive => _isActive; | 269 bool get isActive => _isActive; |
| 270 } | 270 } |
| 271 | 271 |
| 272 get _pureIsolateTimerFactoryClosure => | 272 get _pureIsolateTimerFactoryClosure => |
| 273 ((int milliSeconds, void callback(Timer time), bool repeating) => | 273 ((int milliSeconds, void callback(Timer time), bool repeating) => |
| 274 new _PureIsolateTimer(milliSeconds, callback, repeating)); | 274 new _PureIsolateTimer(milliSeconds, callback, repeating)); |
| OLD | NEW |