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 import 'dart:_internal' hide Symbol; |
| 6 |
5 @patch class Timer { | 7 @patch class Timer { |
6 @patch static Timer _createTimer(Duration duration, void callback()) { | 8 @patch static Timer _createTimer(Duration duration, void callback()) { |
7 // TODO(iposva): Remove _TimerFactory and use VMLibraryHooks exclusively. | 9 // TODO(iposva): Remove _TimerFactory and use VMLibraryHooks exclusively. |
8 if (_TimerFactory._factory == null) { | 10 if (_TimerFactory._factory == null) { |
9 _TimerFactory._factory = VMLibraryHooks.timerFactory; | 11 _TimerFactory._factory = VMLibraryHooks.timerFactory; |
10 } | 12 } |
11 if (_TimerFactory._factory == null) { | 13 if (_TimerFactory._factory == null) { |
12 throw new UnsupportedError("Timer interface not supported."); | 14 throw new UnsupportedError("Timer interface not supported."); |
13 } | 15 } |
14 int milliseconds = duration.inMilliseconds; | 16 int milliseconds = duration.inMilliseconds; |
(...skipping 18 matching lines...) Expand all Loading... |
33 | 35 |
34 typedef Timer _TimerFactoryClosure(int milliseconds, | 36 typedef Timer _TimerFactoryClosure(int milliseconds, |
35 void callback(Timer timer), | 37 void callback(Timer timer), |
36 bool repeating); | 38 bool repeating); |
37 | 39 |
38 // Warning: Dartium sets _TimerFactory._factory instead of setting things up | 40 // Warning: Dartium sets _TimerFactory._factory instead of setting things up |
39 // through VMLibraryHooks.timerFactory. | 41 // through VMLibraryHooks.timerFactory. |
40 class _TimerFactory { | 42 class _TimerFactory { |
41 static _TimerFactoryClosure _factory; | 43 static _TimerFactoryClosure _factory; |
42 } | 44 } |
OLD | NEW |