Chromium Code Reviews| 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 #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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 * can be used to store objects across scopes. Persistent handles have | 93 * can be used to store objects across scopes. Persistent handles have |
| 94 * the lifetime of the current isolate unless they are explicitly | 94 * the lifetime of the current isolate unless they are explicitly |
| 95 * deallocated (see Dart_DeletePersistentHandle). | 95 * deallocated (see Dart_DeletePersistentHandle). |
| 96 */ | 96 */ |
| 97 typedef struct _Dart_Handle* Dart_Handle; | 97 typedef struct _Dart_Handle* Dart_Handle; |
| 98 | 98 |
| 99 typedef void (*Dart_WeakPersistentHandleFinalizer)(Dart_Handle handle, | 99 typedef void (*Dart_WeakPersistentHandleFinalizer)(Dart_Handle handle, |
| 100 void* peer); | 100 void* peer); |
| 101 typedef void (*Dart_PeerFinalizer)(void* peer); | 101 typedef void (*Dart_PeerFinalizer)(void* peer); |
| 102 | 102 |
| 103 typedef void (*Dart_HeapProfileWriteCallback)(const void* data, | |
|
turnidge
2012/05/29 17:50:01
Maybe add short comment above this.
cshapiro
2012/06/01 04:27:02
Certainly. Done.
| |
| 104 intptr_t length, | |
| 105 void* stream); | |
| 106 | |
| 103 /** | 107 /** |
| 104 * Is this an error handle? | 108 * Is this an error handle? |
| 105 * | 109 * |
| 106 * Requires there to be a current isolate. | 110 * Requires there to be a current isolate. |
| 107 */ | 111 */ |
| 108 DART_EXPORT bool Dart_IsError(Dart_Handle handle); | 112 DART_EXPORT bool Dart_IsError(Dart_Handle handle); |
| 109 | 113 |
| 110 /** | 114 /** |
| 111 * Gets the error message from an error handle. | 115 * Gets the error message from an error handle. |
| 112 * | 116 * |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 * \param callback A function pointer to an epilogue callback | 381 * \param callback A function pointer to an epilogue callback |
| 378 * function. This function must have been added as an epilogue | 382 * function. This function must have been added as an epilogue |
| 379 * callback. | 383 * callback. |
| 380 * | 384 * |
| 381 * \return Success if the callback was removed. Otherwise, returns an | 385 * \return Success if the callback was removed. Otherwise, returns an |
| 382 * error handle. | 386 * error handle. |
| 383 */ | 387 */ |
| 384 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback( | 388 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback( |
| 385 Dart_GcEpilogueCallback callback); | 389 Dart_GcEpilogueCallback callback); |
| 386 | 390 |
| 391 /** | |
| 392 * Generates a heap profile. | |
| 393 * | |
| 394 * \param callback A function pointer that will be repeatedly invoked | |
| 395 * with heap profile data. | |
| 396 * \param context A pointer that will be passed to the callback. This | |
| 397 * is a convenient way to provide an open stream to the callback. | |
| 398 * | |
| 399 * \return Success if the heap profile is successful. | |
| 400 */ | |
| 401 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback, | |
| 402 void* context); | |
| 403 | |
| 387 // --- Initialization and Globals --- | 404 // --- Initialization and Globals --- |
| 388 | 405 |
| 389 /** | 406 /** |
| 390 * An isolate creation and initialization callback function. | 407 * An isolate creation and initialization callback function. |
| 391 * | 408 * |
| 392 * This callback, provided by the embedder, is called when the vm | 409 * This callback, provided by the embedder, is called when the vm |
| 393 * needs to create an isolate. The callback should create an isolate | 410 * needs to create an isolate. The callback should create an isolate |
| 394 * by calling Dart_CreateIsolate and load any scripts required for | 411 * by calling Dart_CreateIsolate and load any scripts required for |
| 395 * execution. | 412 * execution. |
| 396 * | 413 * |
| (...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2082 | 2099 |
| 2083 // --- Profiling support ---- | 2100 // --- Profiling support ---- |
| 2084 | 2101 |
| 2085 // External pprof support for gathering and dumping symbolic | 2102 // External pprof support for gathering and dumping symbolic |
| 2086 // information that can be used for better profile reports for | 2103 // information that can be used for better profile reports for |
| 2087 // dynamically generated code. | 2104 // dynamically generated code. |
| 2088 DART_EXPORT void Dart_InitPprofSupport(); | 2105 DART_EXPORT void Dart_InitPprofSupport(); |
| 2089 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 2106 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 2090 | 2107 |
| 2091 #endif // INCLUDE_DART_API_H_ | 2108 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |