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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
515 * Requires there to be a current isolate. | 515 * Requires there to be a current isolate. |
516 * | 516 * |
517 * \param port The destination port. | 517 * \param port The destination port. |
518 * \param object An object from the current isolate. | 518 * \param object An object from the current isolate. |
519 * | 519 * |
520 * \return True if the message was posted. | 520 * \return True if the message was posted. |
521 */ | 521 */ |
522 DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle object); | 522 DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle object); |
523 | 523 |
524 /** | 524 /** |
525 * A native message handling funciton. | |
siva
2012/01/28 00:21:05
function.
turnidge
2012/01/31 20:04:31
Done.
| |
526 * | |
527 * This function is associated with a native port by calling | |
528 * Dart_NewNativePort. | |
siva
2012/01/28 00:21:05
Should we say:
/**
* A native message handler.
*
turnidge
2012/01/31 20:04:31
Done.
| |
529 */ | |
530 typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id, | |
531 Dart_Port reply_port_id, | |
532 uint8_t* data); | |
533 // TODO(turnidge): Make this function take more appropriate arguments. | |
534 | |
535 /** | |
536 * Creates a new native port. When messages are received on this | |
537 * native port, then they will be dispatched to the provided native | |
538 * message handler. | |
539 * | |
540 * \param name The name of this port in debugging messags. | |
Søren Gjesse
2012/01/27 13:33:14
messags -> messages
turnidge
2012/01/31 20:04:31
Done.
| |
541 * \param handler The C handler to run when messages arrive on the port. | |
542 * \param allow_concurrent Is it okay to process requests on this | |
543 * native port concurrently? | |
siva
2012/01/28 00:21:05
Would handle_concurrently be more readable than al
turnidge
2012/01/31 20:04:31
Changed.
| |
544 * | |
545 * \return A port id for the native port. | |
546 */ | |
547 DART_EXPORT Dart_Port Dart_NewNativePort(const char* name, | |
548 Dart_NativeMessageHandler func, | |
siva
2012/01/28 00:21:05
handler instead of func?
turnidge
2012/01/31 20:04:31
Done.
| |
549 bool allow_concurrent); | |
550 // TODO(turnidge): Currently allow_concurrent is ignored. | |
551 | |
552 /** | |
553 * Closes the native port with the given id. | |
554 * | |
555 * The port must have been allocated by a call to Dart_NewNativePort. | |
556 * | |
557 * \param native_port_id The id of the native port to close. | |
siva
2012/01/28 00:21:05
s/The id/Id/
turnidge
2012/01/31 20:04:31
What's wrong with "The id"?
siva
2012/02/01 00:38:56
"The id of the native port" sounds weird, I could
turnidge
2012/02/01 18:51:26
It sounds okay to my ears. My guess is that this
| |
558 * | |
559 * \return Returns true if the port was closed successfully. | |
560 */ | |
561 DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id); | |
562 | |
563 /** | |
525 * Returns a new SendPort with the provided port id. | 564 * Returns a new SendPort with the provided port id. |
526 */ | 565 */ |
527 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id); | 566 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id); |
528 | 567 |
529 /** | 568 /** |
530 * Gets the ReceivePort for the provided port id, creating it if necessary. | 569 * Gets the ReceivePort for the provided port id, creating it if necessary. |
531 * | 570 * |
532 * Note that there is at most one ReceivePort for a given port id. | 571 * Note that there is at most one ReceivePort for a given port id. |
533 */ | 572 */ |
534 DART_EXPORT Dart_Handle Dart_GetReceivePort(Dart_Port port_id); | 573 DART_EXPORT Dart_Handle Dart_GetReceivePort(Dart_Port port_id); |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1345 | 1384 |
1346 // --- Profiling support ---- | 1385 // --- Profiling support ---- |
1347 | 1386 |
1348 // External pprof support for gathering and dumping symbolic | 1387 // External pprof support for gathering and dumping symbolic |
1349 // information that can be used for better profile reports for | 1388 // information that can be used for better profile reports for |
1350 // dynamically generated code. | 1389 // dynamically generated code. |
1351 DART_EXPORT void Dart_InitPprofSupport(); | 1390 DART_EXPORT void Dart_InitPprofSupport(); |
1352 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1391 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
1353 | 1392 |
1354 #endif // INCLUDE_DART_API_H_ | 1393 #endif // INCLUDE_DART_API_H_ |
OLD | NEW |