OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class _ReceivePortFactory { | 5 class _ReceivePortFactory { |
6 factory ReceivePort() { | 6 factory ReceivePort() { |
7 return new _ReceivePortImpl(); | 7 return new _ReceivePortImpl(); |
8 } | 8 } |
9 | 9 |
10 factory ReceivePort.singleShot() { | 10 factory ReceivePort.singleShot() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 | 149 |
150 // Starts a new isolate calling the run method on a new instance of the | 150 // Starts a new isolate calling the run method on a new instance of the |
151 // remote class's type. | 151 // remote class's type. |
152 // Returns the send port which is passed to the newly created isolate. | 152 // Returns the send port which is passed to the newly created isolate. |
153 // This method is being dispatched to from the public core library code. | 153 // This method is being dispatched to from the public core library code. |
154 static SendPort _start(Isolate isolate, bool light) | 154 static SendPort _start(Isolate isolate, bool light) |
155 native "IsolateNatives_start"; | 155 native "IsolateNatives_start"; |
156 } | 156 } |
157 | 157 |
158 // TODO(sigmund,turnidge): implement | 158 _getPortInternal() native "isolate_getPortInternal"; |
159 | 159 |
160 SendPort _spawnFunction(void topLevelFunction()) { | 160 ReceivePort _portInternal; |
161 throw new NotImplementedException(); | 161 |
| 162 ReceivePort get _port() { |
| 163 if (_portInternal) { |
| 164 return _portInternal; |
| 165 } |
| 166 _portInternal = _getPortInternal(); |
| 167 return _portInternal; |
162 } | 168 } |
163 | 169 |
| 170 _spawnFunction(void topLevelFunction()) native "isolate_spawnFunction"; |
| 171 |
| 172 // TODO(sigmund,turnidge): implement |
164 SendPort _spawnUri(String uri) { | 173 SendPort _spawnUri(String uri) { |
165 throw new NotImplementedException(); | 174 throw new NotImplementedException(); |
166 } | 175 } |
167 | |
168 ReceivePort _port = null; | |
OLD | NEW |