Chromium Code Reviews| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 // TODO(turnidge): Accept printf-style args here. | 131 // TODO(turnidge): Accept printf-style args here. |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Allocates a persistent handle for an object. | 134 * Allocates a persistent handle for an object. |
| 135 * | 135 * |
| 136 * This handle has the lifetime of the current isolate unless it is | 136 * This handle has the lifetime of the current isolate unless it is |
| 137 * explicitly deallocated by calling Dart_DeletePersistentHandle. | 137 * explicitly deallocated by calling Dart_DeletePersistentHandle. |
| 138 * | 138 * |
| 139 * Requires there to be a current isolate. | 139 * Requires there to be a current isolate. |
| 140 */ | 140 */ |
| 141 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object); | 141 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object); |
|
siva
2011/11/03 21:45:25
What is the use case for creating a new persistent
turnidge
2011/11/04 00:03:17
Someone who is passed a Dart_Handle doesn't know w
| |
| 142 // TODO(turnidge): This function currently only works when passes a | |
| 143 // local handle. Make it work for both local and persistent handles. | |
| 144 | 142 |
| 145 /** | 143 /** |
| 146 * Deallocates a persistent handle. | 144 * Deallocates a persistent handle. |
| 147 * | 145 * |
| 148 * Requires there to be a current isolate. | 146 * Requires there to be a current isolate. |
| 149 */ | 147 */ |
| 150 DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object); | 148 DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object); |
| 151 | 149 |
| 152 /** | 150 /** |
| 153 * Takes a persistent handle and makes it weak. | 151 * Takes a persistent handle and makes it weak. |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 * | 431 * |
| 434 * The previous scope (if any) becomes the current scope. | 432 * The previous scope (if any) becomes the current scope. |
| 435 * | 433 * |
| 436 * Requires there to be a current isolate. | 434 * Requires there to be a current isolate. |
| 437 */ | 435 */ |
| 438 DART_EXPORT void Dart_ExitScope(); | 436 DART_EXPORT void Dart_ExitScope(); |
| 439 | 437 |
| 440 // --- Objects ---- | 438 // --- Objects ---- |
| 441 | 439 |
| 442 /** | 440 /** |
| 441 * Returns the null object. | |
| 442 * | |
| 443 * Requires there to be a current isolate. | |
| 444 * | |
| 445 * \return A handle to the null object. | |
| 446 */ | |
| 447 DART_EXPORT Dart_Handle Dart_Null(); | |
| 448 | |
| 449 /** | |
| 443 * Is this object null? | 450 * Is this object null? |
| 444 */ | 451 */ |
| 445 DART_EXPORT bool Dart_IsNull(Dart_Handle object); | 452 DART_EXPORT bool Dart_IsNull(Dart_Handle object); |
| 446 | 453 |
| 447 /** | 454 /** |
| 448 * Converts an object to a string. | 455 * Converts an object to a string. |
| 449 * | 456 * |
| 450 * If an exception occurs during the conversion, this is treated as an | 457 * If an exception occurs during the conversion, this is treated as an |
| 451 * error. | 458 * error. |
| 452 * | 459 * |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 560 * the next call to Dart_ExitScope. | 567 * the next call to Dart_ExitScope. |
| 561 * | 568 * |
| 562 * \return A valid handle if no error occurs during the operation. | 569 * \return A valid handle if no error occurs during the operation. |
| 563 */ | 570 */ |
| 564 DART_EXPORT Dart_Handle Dart_IntegerValueHexCString(Dart_Handle integer, | 571 DART_EXPORT Dart_Handle Dart_IntegerValueHexCString(Dart_Handle integer, |
| 565 const char** value); | 572 const char** value); |
| 566 | 573 |
| 567 // --- Booleans ---- | 574 // --- Booleans ---- |
| 568 | 575 |
| 569 /** | 576 /** |
| 577 * Returns the True object. | |
| 578 * | |
| 579 * Requires there to be a current isolate. | |
| 580 * | |
| 581 * \return A handle to the True object. | |
| 582 */ | |
| 583 DART_EXPORT Dart_Handle Dart_True(); | |
| 584 | |
| 585 /** | |
| 586 * Returns the False object. | |
| 587 * | |
| 588 * Requires there to be a current isolate. | |
| 589 * | |
| 590 * \return A handle to the False object. | |
| 591 */ | |
| 592 DART_EXPORT Dart_Handle Dart_False(); | |
| 593 | |
| 594 /** | |
| 570 * Is this object a Boolean? | 595 * Is this object a Boolean? |
| 571 */ | 596 */ |
| 572 DART_EXPORT bool Dart_IsBoolean(Dart_Handle object); | 597 DART_EXPORT bool Dart_IsBoolean(Dart_Handle object); |
| 573 | 598 |
| 574 /** | 599 /** |
| 575 * Returns a Boolean with the provided value. | 600 * Returns a Boolean with the provided value. |
| 576 * | 601 * |
| 577 * \param value true or false. | 602 * \param value true or false. |
| 578 * | 603 * |
| 579 * \return The Boolean object if no errors occurs. Otherwise returns | 604 * \return The Boolean object if no errors occurs. Otherwise returns |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1117 | 1142 |
| 1118 // --- Profiling support ---- | 1143 // --- Profiling support ---- |
| 1119 | 1144 |
| 1120 // External pprof support for gathering and dumping symbolic | 1145 // External pprof support for gathering and dumping symbolic |
| 1121 // information that can be used for better profile reports for | 1146 // information that can be used for better profile reports for |
| 1122 // dynamically generated code. | 1147 // dynamically generated code. |
| 1123 DART_EXPORT void Dart_InitPprofSupport(); | 1148 DART_EXPORT void Dart_InitPprofSupport(); |
| 1124 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1149 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1125 | 1150 |
| 1126 #endif // INCLUDE_DART_API_H_ | 1151 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |