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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 return new Future<Isolate>.error(e, st); | 315 return new Future<Isolate>.error(e, st); |
316 }; | 316 }; |
317 return completer.future; | 317 return completer.future; |
318 } | 318 } |
319 | 319 |
320 // TODO(iposva): Cleanup to have only one definition. | 320 // TODO(iposva): Cleanup to have only one definition. |
321 // These values need to be kept in sync with the class IsolateMessageHandler | 321 // These values need to be kept in sync with the class IsolateMessageHandler |
322 // in vm/isolate.cc. | 322 // in vm/isolate.cc. |
323 static const _PAUSE = 1; | 323 static const _PAUSE = 1; |
324 static const _RESUME = 2; | 324 static const _RESUME = 2; |
| 325 static const _PING = 3; |
| 326 |
325 | 327 |
326 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction, | 328 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction, |
327 var message) | 329 var message) |
328 native "Isolate_spawnFunction"; | 330 native "Isolate_spawnFunction"; |
329 | 331 |
330 static SendPort _spawnUri(SendPort readyPort, String uri, | 332 static SendPort _spawnUri(SendPort readyPort, String uri, |
331 List<String> args, var message, | 333 List<String> args, var message, |
332 String packageRoot) | 334 String packageRoot) |
333 native "Isolate_spawnUri"; | 335 native "Isolate_spawnUri"; |
334 | 336 |
(...skipping 27 matching lines...) Expand all Loading... |
362 | 364 |
363 /* patch */ void setErrorsFatal(bool errorsAreFatal) { | 365 /* patch */ void setErrorsFatal(bool errorsAreFatal) { |
364 throw new UnsupportedError("setErrorsFatal"); | 366 throw new UnsupportedError("setErrorsFatal"); |
365 } | 367 } |
366 | 368 |
367 /* patch */ void kill([int priority = BEFORE_NEXT_EVENT]) { | 369 /* patch */ void kill([int priority = BEFORE_NEXT_EVENT]) { |
368 throw new UnsupportedError("kill"); | 370 throw new UnsupportedError("kill"); |
369 } | 371 } |
370 | 372 |
371 /* patch */ void ping(SendPort responsePort, [int pingType = IMMEDIATE]) { | 373 /* patch */ void ping(SendPort responsePort, [int pingType = IMMEDIATE]) { |
372 throw new UnsupportedError("ping"); | 374 var msg = new List(4) |
| 375 ..[0] = 0 // Make room for OOM message type. |
| 376 ..[1] = _PING |
| 377 ..[2] = responsePort |
| 378 ..[3] = pingType; |
| 379 _sendOOB(controlPort, msg); |
373 } | 380 } |
374 | 381 |
375 /* patch */ void addErrorListener(SendPort port) { | 382 /* patch */ void addErrorListener(SendPort port) { |
376 throw new UnsupportedError("addErrorListener"); | 383 throw new UnsupportedError("addErrorListener"); |
377 } | 384 } |
378 | 385 |
379 /* patch */ void removeErrorListener(SendPort port) { | 386 /* patch */ void removeErrorListener(SendPort port) { |
380 throw new UnsupportedError("removeErrorListener"); | 387 throw new UnsupportedError("removeErrorListener"); |
381 } | 388 } |
382 } | 389 } |
OLD | NEW |