Chromium Code Reviews| 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 file for the dart:isolate library. | 5 // Patch file for the dart:isolate library. |
| 6 | 6 |
| 7 #import("dart:uri"); | 7 #import("dart:uri"); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Called by the compiler to support switching | 10 * Called by the compiler to support switching |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 // the change to break the isolate abstraction. | 87 // the change to break the isolate abstraction. |
| 88 _Manager get _globalState() native "return \$globalState;"; | 88 _Manager get _globalState() native "return \$globalState;"; |
| 89 set _globalState(_Manager val) native "\$globalState = val;"; | 89 set _globalState(_Manager val) native "\$globalState = val;"; |
| 90 | 90 |
| 91 void _fillStatics(context) native @""" | 91 void _fillStatics(context) native @""" |
| 92 $globals = context.isolateStatics; | 92 $globals = context.isolateStatics; |
| 93 $static_init(); | 93 $static_init(); |
| 94 """; | 94 """; |
| 95 | 95 |
| 96 ReceivePort _lazyPort; | 96 ReceivePort _lazyPort; |
| 97 patch ReceivePort get port { | 97 patch ReceivePort get port() { |
|
Mads Ager (google)
2012/09/17 05:52:56
Can this go the other way instead? That is, can we
Lasse Reichstein Nielsen
2012/09/17 11:32:43
I think we can, and should.
Remove ALL the getter
Johnni Winther
2012/09/19 09:03:30
I'll do that after the patch refactoring.
ahe
2012/09/19 09:39:13
I'm sorry, I don't think that is the right order.
| |
| 98 if (_lazyPort === null) { | 98 if (_lazyPort === null) { |
| 99 _lazyPort = new ReceivePort(); | 99 _lazyPort = new ReceivePort(); |
| 100 } | 100 } |
| 101 return _lazyPort; | 101 return _lazyPort; |
| 102 } | 102 } |
| 103 | 103 |
| 104 patch SendPort spawnFunction(void topLevelFunction()) { | 104 patch SendPort spawnFunction(void topLevelFunction()) { |
| 105 final name = _IsolateNatives._getJSFunctionName(topLevelFunction); | 105 final name = _IsolateNatives._getJSFunctionName(topLevelFunction); |
| 106 if (name == null) { | 106 if (name == null) { |
| 107 throw new UnsupportedOperationException( | 107 throw new UnsupportedOperationException( |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1261 _window.clearTimeout(_handle); | 1261 _window.clearTimeout(_handle); |
| 1262 } else { | 1262 } else { |
| 1263 _window.clearInterval(_handle); | 1263 _window.clearInterval(_handle); |
| 1264 } | 1264 } |
| 1265 } | 1265 } |
| 1266 } | 1266 } |
| 1267 | 1267 |
| 1268 Timer _timerFactory(int millis, void callback(Timer timer), bool repeating) => | 1268 Timer _timerFactory(int millis, void callback(Timer timer), bool repeating) => |
| 1269 repeating ? new _Timer.repeating(millis, callback) | 1269 repeating ? new _Timer.repeating(millis, callback) |
| 1270 : new _Timer(millis, callback); | 1270 : new _Timer(millis, callback); |
| OLD | NEW |