| 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:collection" show HashMap; | 5 import "dart:collection" show HashMap; |
| 6 | 6 |
| 7 patch class ReceivePort { | 7 patch class ReceivePort { |
| 8 /* patch */ factory ReceivePort() = _ReceivePortImpl; | 8 /* patch */ factory ReceivePort() = _ReceivePortImpl; |
| 9 | 9 |
| 10 /* patch */ factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) = | 10 /* patch */ factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) = |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 return new Future<Isolate>.error(e, st); | 304 return new Future<Isolate>.error(e, st); |
| 305 }; | 305 }; |
| 306 return completer.future; | 306 return completer.future; |
| 307 } | 307 } |
| 308 | 308 |
| 309 // TODO(iposva): Cleanup to have only one definition. | 309 // TODO(iposva): Cleanup to have only one definition. |
| 310 // These values need to be kept in sync with the class IsolateMessageHandler | 310 // These values need to be kept in sync with the class IsolateMessageHandler |
| 311 // in vm/isolate.cc. | 311 // in vm/isolate.cc. |
| 312 static const _PAUSE = 1; | 312 static const _PAUSE = 1; |
| 313 static const _RESUME = 2; | 313 static const _RESUME = 2; |
| 314 static const _PING = 3; |
| 315 |
| 314 | 316 |
| 315 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction, | 317 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction, |
| 316 var message) | 318 var message) |
| 317 native "Isolate_spawnFunction"; | 319 native "Isolate_spawnFunction"; |
| 318 | 320 |
| 319 static SendPort _spawnUri(SendPort readyPort, String uri, | 321 static SendPort _spawnUri(SendPort readyPort, String uri, |
| 320 List<String> args, var message, | 322 List<String> args, var message, |
| 321 String packageRoot) | 323 String packageRoot) |
| 322 native "Isolate_spawnUri"; | 324 native "Isolate_spawnUri"; |
| 323 | 325 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 351 | 353 |
| 352 /* patch */ void setErrorsFatal(bool errorsAreFatal) { | 354 /* patch */ void setErrorsFatal(bool errorsAreFatal) { |
| 353 throw new UnsupportedError("setErrorsFatal"); | 355 throw new UnsupportedError("setErrorsFatal"); |
| 354 } | 356 } |
| 355 | 357 |
| 356 /* patch */ void kill([int priority = BEFORE_NEXT_EVENT]) { | 358 /* patch */ void kill([int priority = BEFORE_NEXT_EVENT]) { |
| 357 throw new UnsupportedError("kill"); | 359 throw new UnsupportedError("kill"); |
| 358 } | 360 } |
| 359 | 361 |
| 360 /* patch */ void ping(SendPort responsePort, [int pingType = IMMEDIATE]) { | 362 /* patch */ void ping(SendPort responsePort, [int pingType = IMMEDIATE]) { |
| 361 throw new UnsupportedError("ping"); | 363 var msg = new List(4) |
| 364 ..[0] = 0 // Make room for OOM message type. |
| 365 ..[1] = _PING |
| 366 ..[2] = responsePort |
| 367 ..[3] = pingType; |
| 368 _sendOOB(controlPort, msg); |
| 362 } | 369 } |
| 363 | 370 |
| 364 /* patch */ void addErrorListener(SendPort port) { | 371 /* patch */ void addErrorListener(SendPort port) { |
| 365 throw new UnsupportedError("addErrorListener"); | 372 throw new UnsupportedError("addErrorListener"); |
| 366 } | 373 } |
| 367 | 374 |
| 368 /* patch */ void removeErrorListener(SendPort port) { | 375 /* patch */ void removeErrorListener(SendPort port) { |
| 369 throw new UnsupportedError("removeErrorListener"); | 376 throw new UnsupportedError("removeErrorListener"); |
| 370 } | 377 } |
| 371 } | 378 } |
| OLD | NEW |