| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 class _Timer implements Timer { | 7 class _Timer implements Timer { |
| 8 // Set jitter to wake up timer events that would happen in _TIMER_JITTER ms. | 8 // Set jitter to wake up timer events that would happen in _TIMER_JITTER ms. |
| 9 static const int _TIMER_JITTER = 0; | 9 static const int _TIMER_JITTER = 0; |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 if (timer._callback != null) { | 151 if (timer._callback != null) { |
| 152 timer._callback(timer); | 152 timer._callback(timer); |
| 153 if (timer._repeating) { | 153 if (timer._repeating) { |
| 154 timer._advanceWakeupTime(); | 154 timer._advanceWakeupTime(); |
| 155 timer._addTimerToList(); | 155 timer._addTimerToList(); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 } finally { | 159 } finally { |
| 160 _handling_callbacks = false; | 160 _handling_callbacks = false; |
| 161 _notifyEventHandler(); |
| 161 } | 162 } |
| 162 _notifyEventHandler(); | |
| 163 } | 163 } |
| 164 | 164 |
| 165 if(_receivePort == null) { | 165 if(_receivePort == null) { |
| 166 _receivePort = new ReceivePort(); | 166 _receivePort = new ReceivePort(); |
| 167 _receivePort.receive((var message, ignored) { | 167 _receivePort.receive((var message, ignored) { |
| 168 _handleTimeout(); | 168 _handleTimeout(); |
| 169 }); | 169 }); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 193 _getTimerFactoryClosure() { | 193 _getTimerFactoryClosure() { |
| 194 return (int milliSeconds, void callback(Timer timer), bool repeating) { | 194 return (int milliSeconds, void callback(Timer timer), bool repeating) { |
| 195 if (repeating) { | 195 if (repeating) { |
| 196 return new _Timer.periodic(milliSeconds, callback); | 196 return new _Timer.periodic(milliSeconds, callback); |
| 197 } | 197 } |
| 198 return new _Timer(milliSeconds, callback); | 198 return new _Timer(milliSeconds, callback); |
| 199 }; | 199 }; |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| OLD | NEW |