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