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 #ifndef INCLUDE_DART_API_H_ | 5 #ifndef INCLUDE_DART_API_H_ |
6 #define INCLUDE_DART_API_H_ | 6 #define INCLUDE_DART_API_H_ |
7 | 7 |
8 /** \mainpage Dart Embedding API Reference | 8 /** \mainpage Dart Embedding API Reference |
9 * | 9 * |
10 * Dart is a class-based programming language for creating structured | 10 * Dart is a class-based programming language for creating structured |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 * | 438 * |
439 * This function waits for incoming messages for the current | 439 * This function waits for incoming messages for the current |
440 * isolate. As new messages arrive, they are handled using | 440 * isolate. As new messages arrive, they are handled using |
441 * Dart_HandleMessage. The routine exits when all ports to the | 441 * Dart_HandleMessage. The routine exits when all ports to the |
442 * current isolate are closed. | 442 * current isolate are closed. |
443 */ | 443 */ |
444 DART_EXPORT Dart_Handle Dart_RunLoop(); | 444 DART_EXPORT Dart_Handle Dart_RunLoop(); |
445 // TODO(turnidge): Should this be removed from the public api? | 445 // TODO(turnidge): Should this be removed from the public api? |
446 | 446 |
447 /** | 447 /** |
448 * Gets the main Dart_Port for the current isolate. | |
449 */ | |
450 DART_EXPORT Dart_Port Dart_GetMainPort(); | |
451 | |
452 /** | |
453 * Does the current isolate have live ReceivePorts? | |
454 * | |
455 * A port is live when it has not been closed and when | |
456 * ReceivePort.receive() has been called to install a receive handler. | |
457 */ | |
siva
2011/11/29 19:50:27
Is this comment still valid?
turnidge
2011/12/05 17:53:34
Updated.
| |
458 DART_EXPORT bool Dart_HasLivePorts(); | |
459 | |
460 /** | |
448 * Posts a message for some isolate. The message is built from a raw | 461 * Posts a message for some isolate. The message is built from a raw |
449 * array. | 462 * array. |
450 * | 463 * |
451 * \param port The destination port. | 464 * \param port The destination port. |
452 * \param length The length of the data array. | 465 * \param length The length of the data array. |
453 * \param data A data array to be sent in the message. | 466 * \param data A data array to be sent in the message. |
454 * | 467 * |
455 * \return True if the message was posted. | 468 * \return True if the message was posted. |
456 */ | 469 */ |
457 DART_EXPORT bool Dart_PostIntArray(Dart_Port port, | 470 DART_EXPORT bool Dart_PostIntArray(Dart_Port port, |
458 intptr_t length, | 471 intptr_t length, |
459 intptr_t* data); | 472 intptr_t* data); |
460 // TODO(turnidge): Should this be intptr_t or some fixed length type? | 473 // TODO(turnidge): Should this be intptr_t or some fixed length type? |
461 // TODO(turnidge): Reverse length/data for consistency. | 474 // TODO(turnidge): Reverse length/data for consistency. |
462 | 475 |
463 /** | 476 /** |
464 * Posts a message for some isolate. The message is a serialized | 477 * Posts a message for some isolate. The message is a serialized |
465 * object. | 478 * object. |
466 * | 479 * |
467 * Requires there to be a current isolate. | 480 * Requires there to be a current isolate. |
468 * | 481 * |
469 * \param port The destination port. | 482 * \param port The destination port. |
470 * \param object An object from the current isolate. | 483 * \param object An object from the current isolate. |
471 * | 484 * |
472 * \return True if the message was posted. | 485 * \return True if the message was posted. |
473 */ | 486 */ |
474 DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle object); | 487 DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle object); |
475 | 488 |
489 /** | |
490 * Returns a new SendPort with the provided id. | |
491 */ | |
492 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port); | |
siva
2011/11/29 19:50:27
I would call the variable port_id to avoid having
turnidge
2011/12/05 17:53:34
Done. I also updated all other Dart_Port paramete
| |
493 | |
494 /** | |
495 * Returns a new ReceivePort with the provided id. | |
496 * | |
497 * Do not create multiple ReceivePorts with the same id. | |
siva
2011/11/29 19:50:27
Is this a comment for the user stating that they s
turnidge
2011/12/05 17:53:34
Changed this function to Dart_GetReceivePort to im
| |
498 */ | |
499 DART_EXPORT Dart_Handle Dart_NewReceivePort(Dart_Port port); | |
siva
2011/11/29 19:50:27
port => port_id
turnidge
2011/12/05 17:53:34
Done.
| |
500 | |
476 // --- Scopes ---- | 501 // --- Scopes ---- |
477 | 502 |
478 /** | 503 /** |
479 * Enters a new scope. | 504 * Enters a new scope. |
480 * | 505 * |
481 * All new local handles will be created in this scope. Additionally, | 506 * All new local handles will be created in this scope. Additionally, |
482 * some functions may return "scope allocated" memory which is only | 507 * some functions may return "scope allocated" memory which is only |
483 * valid within this scope. | 508 * valid within this scope. |
484 * | 509 * |
485 * Requires there to be a current isolate. | 510 * Requires there to be a current isolate. |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1204 | 1229 |
1205 // --- Profiling support ---- | 1230 // --- Profiling support ---- |
1206 | 1231 |
1207 // External pprof support for gathering and dumping symbolic | 1232 // External pprof support for gathering and dumping symbolic |
1208 // information that can be used for better profile reports for | 1233 // information that can be used for better profile reports for |
1209 // dynamically generated code. | 1234 // dynamically generated code. |
1210 DART_EXPORT void Dart_InitPprofSupport(); | 1235 DART_EXPORT void Dart_InitPprofSupport(); |
1211 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1236 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
1212 | 1237 |
1213 #endif // INCLUDE_DART_API_H_ | 1238 #endif // INCLUDE_DART_API_H_ |
OLD | NEW |