| 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 patch class ReceivePort { |    5 patch class ReceivePort { | 
|    6   /* patch */ factory ReceivePort() { |    6   /* patch */ factory ReceivePort() { | 
|    7     return new _ReceivePortImpl(); |    7     return new _ReceivePortImpl(); | 
|    8   } |    8   } | 
|    9 } |    9 } | 
|   10  |   10  | 
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  123   return _portInternal; |  123   return _portInternal; | 
|  124 } |  124 } | 
|  125  |  125  | 
|  126 patch spawnFunction(void topLevelFunction(), |  126 patch spawnFunction(void topLevelFunction(), | 
|  127     [bool UnhandledExceptionCallback(IsolateUnhandledException e)])  |  127     [bool UnhandledExceptionCallback(IsolateUnhandledException e)])  | 
|  128     native "isolate_spawnFunction"; |  128     native "isolate_spawnFunction"; | 
|  129  |  129  | 
|  130 patch spawnUri(String uri) native "isolate_spawnUri"; |  130 patch spawnUri(String uri) native "isolate_spawnUri"; | 
|  131  |  131  | 
|  132 patch class Timer { |  132 patch class Timer { | 
|  133   /* patch */ factory Timer(int milliSeconds, void callback(Timer timer)) { |  133   /* patch */ factory Timer(int milliseconds, void callback(Timer timer)) { | 
|  134     if (_TimerFactory._factory == null) { |  134     if (_TimerFactory._factory == null) { | 
|  135       throw new UnsupportedError("Timer interface not supported."); |  135       throw new UnsupportedError("Timer interface not supported."); | 
|  136     } |  136     } | 
|  137     return _TimerFactory._factory(milliSeconds, callback, false); |  137     return _TimerFactory._factory(milliseconds, callback, false); | 
|  138   } |  138   } | 
|  139  |  139  | 
|  140   /** |  140   /** | 
|  141    * Creates a new repeating timer. The [callback] is invoked every |  141    * Creates a new repeating timer. The [callback] is invoked every | 
|  142    * [milliSeconds] millisecond until cancelled. |  142    * [milliseconds] millisecond until cancelled. | 
|  143    */ |  143    */ | 
|  144   /* patch */ factory Timer.repeating(int milliSeconds, |  144   /* patch */ factory Timer.repeating(int milliseconds, | 
|  145                                       void callback(Timer timer)) { |  145                                       void callback(Timer timer)) { | 
|  146     if (_TimerFactory._factory == null) { |  146     if (_TimerFactory._factory == null) { | 
|  147       throw new UnsupportedError("Timer interface not supported."); |  147       throw new UnsupportedError("Timer interface not supported."); | 
|  148     } |  148     } | 
|  149     return _TimerFactory._factory(milliSeconds, callback, true); |  149     return _TimerFactory._factory(milliseconds, callback, true); | 
|  150   } |  150   } | 
|  151 } |  151 } | 
|  152  |  152  | 
|  153 typedef Timer _TimerFactoryClosure(int milliSeconds, |  153 typedef Timer _TimerFactoryClosure(int milliseconds, | 
|  154                                    void callback(Timer timer), |  154                                    void callback(Timer timer), | 
|  155                                    bool repeating); |  155                                    bool repeating); | 
|  156  |  156  | 
|  157 class _TimerFactory { |  157 class _TimerFactory { | 
|  158   static _TimerFactoryClosure _factory; |  158   static _TimerFactoryClosure _factory; | 
|  159 } |  159 } | 
|  160  |  160  | 
|  161 // TODO(ahe): Warning: this is NOT called by Dartium. Instead, it sets |  161 // TODO(ahe): Warning: this is NOT called by Dartium. Instead, it sets | 
|  162 // [_TimerFactory._factory] directly. |  162 // [_TimerFactory._factory] directly. | 
|  163 void _setTimerFactoryClosure(_TimerFactoryClosure closure) { |  163 void _setTimerFactoryClosure(_TimerFactoryClosure closure) { | 
|  164   _TimerFactory._factory = closure; |  164   _TimerFactory._factory = closure; | 
|  165 } |  165 } | 
| OLD | NEW |