| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 }); | 346 }); |
| 347 } | 347 } |
| 348 | 348 |
| 349 final _printClosure = window.console.log; | 349 final _printClosure = window.console.log; |
| 350 final _pureIsolatePrintClosure = (s) { | 350 final _pureIsolatePrintClosure = (s) { |
| 351 _sendToHelperIsolate([_PRINT, s], null); | 351 _sendToHelperIsolate([_PRINT, s], null); |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 final _forwardingPrintClosure = _Utils.forwardingPrint; | 354 final _forwardingPrintClosure = _Utils.forwardingPrint; |
| 355 | 355 |
| 356 class _Timer implements Timer{ | 356 class _Timer implements Timer { |
| 357 var _canceler; | 357 var _canceler; |
| 358 | 358 |
| 359 _Timer(int milliSeconds, void callback(Timer timer), bool repeating) { | 359 _Timer(int milliSeconds, void callback(Timer timer), bool repeating) { |
| 360 | 360 |
| 361 if (repeating) { | 361 if (repeating) { |
| 362 int id = window._setInterval(() { | 362 int id = window._setInterval(() { |
| 363 callback(this); | 363 callback(this); |
| 364 }, milliSeconds); | 364 }, milliSeconds); |
| 365 _canceler = () => window._clearInterval(id); | 365 _canceler = () => window._clearInterval(id); |
| 366 } else { | 366 } else { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 _send(msg) { | 420 _send(msg) { |
| 421 _sendToHelperIsolate(msg, _sendPort); | 421 _sendToHelperIsolate(msg, _sendPort); |
| 422 } | 422 } |
| 423 | 423 |
| 424 bool get isActive => _isActive; | 424 bool get isActive => _isActive; |
| 425 } | 425 } |
| 426 | 426 |
| 427 get _pureIsolateTimerFactoryClosure => | 427 get _pureIsolateTimerFactoryClosure => |
| 428 ((int milliSeconds, void callback(Timer time), bool repeating) => | 428 ((int milliSeconds, void callback(Timer time), bool repeating) => |
| 429 new _PureIsolateTimer(milliSeconds, callback, repeating)); | 429 new _PureIsolateTimer(milliSeconds, callback, repeating)); |
| OLD | NEW |