OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 * for details. All rights reserved. Use of this source code is governed by a | 3 * for details. All rights reserved. Use of this source code is governed by a |
4 * BSD-style license that can be found in the LICENSE file. | 4 * BSD-style license that can be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef RUNTIME_INCLUDE_DART_API_H_ | 7 #ifndef RUNTIME_INCLUDE_DART_API_H_ |
8 #define RUNTIME_INCLUDE_DART_API_H_ | 8 #define RUNTIME_INCLUDE_DART_API_H_ |
9 | 9 |
10 /** \mainpage Dart Embedding API Reference | 10 /** \mainpage Dart Embedding API Reference |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 * This function should be used to dispose of native resources that | 701 * This function should be used to dispose of native resources that |
702 * are allocated to an isolate in order to avoid leaks. | 702 * are allocated to an isolate in order to avoid leaks. |
703 * | 703 * |
704 * \param callback_data The same callback data which was passed to the | 704 * \param callback_data The same callback data which was passed to the |
705 * isolate when it was created. | 705 * isolate when it was created. |
706 * | 706 * |
707 */ | 707 */ |
708 typedef void (*Dart_IsolateShutdownCallback)(void* callback_data); | 708 typedef void (*Dart_IsolateShutdownCallback)(void* callback_data); |
709 | 709 |
710 /** | 710 /** |
| 711 * An isolate cleanup callback function. |
| 712 * |
| 713 * This callback, provided by the embedder, is called after the vm |
| 714 * shuts down an isolate. There will be no current isolate and it is *not* |
| 715 * safe to run Dart code. |
| 716 * |
| 717 * This function should be used to dispose of native resources that |
| 718 * are allocated to an isolate in order to avoid leaks. |
| 719 * |
| 720 * \param callback_data The same callback data which was passed to the |
| 721 * isolate when it was created. |
| 722 * |
| 723 */ |
| 724 typedef void (*Dart_IsolateCleanupCallback)(void* callback_data); |
| 725 |
| 726 /** |
711 * A thread death callback function. | 727 * A thread death callback function. |
712 * This callback, provided by the embedder, is called before a thread in the | 728 * This callback, provided by the embedder, is called before a thread in the |
713 * vm thread pool exits. | 729 * vm thread pool exits. |
714 * This function could be used to dispose of native resources that | 730 * This function could be used to dispose of native resources that |
715 * are associated and attached to the thread, in order to avoid leaks. | 731 * are associated and attached to the thread, in order to avoid leaks. |
716 */ | 732 */ |
717 typedef void (*Dart_ThreadExitCallback)(); | 733 typedef void (*Dart_ThreadExitCallback)(); |
718 | 734 |
719 /** | 735 /** |
720 * Callbacks provided by the embedder for file operations. If the | 736 * Callbacks provided by the embedder for file operations. If the |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 * \param version Identifies the version of the struct used by the client. | 797 * \param version Identifies the version of the struct used by the client. |
782 * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION. | 798 * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION. |
783 * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate | 799 * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate |
784 * or NULL if no snapshot is provided. | 800 * or NULL if no snapshot is provided. |
785 * \param instructions_snapshot A buffer containing a snapshot of precompiled | 801 * \param instructions_snapshot A buffer containing a snapshot of precompiled |
786 * instructions, or NULL if no snapshot is provided. | 802 * instructions, or NULL if no snapshot is provided. |
787 * \param create A function to be called during isolate creation. | 803 * \param create A function to be called during isolate creation. |
788 * See Dart_IsolateCreateCallback. | 804 * See Dart_IsolateCreateCallback. |
789 * \param shutdown A function to be called when an isolate is shutdown. | 805 * \param shutdown A function to be called when an isolate is shutdown. |
790 * See Dart_IsolateShutdownCallback. | 806 * See Dart_IsolateShutdownCallback. |
| 807 * \param cleanup A function to be called after an isolate is shutdown. |
| 808 * See Dart_IsolateCleanupCallback. |
791 * \param get_service_assets A function to be called by the service isolate when | 809 * \param get_service_assets A function to be called by the service isolate when |
792 * it requires the vmservice assets archive. | 810 * it requires the vmservice assets archive. |
793 * See Dart_GetVMServiceAssetsArchive. | 811 * See Dart_GetVMServiceAssetsArchive. |
794 */ | 812 */ |
795 typedef struct { | 813 typedef struct { |
796 int32_t version; | 814 int32_t version; |
797 const uint8_t* vm_snapshot_data; | 815 const uint8_t* vm_snapshot_data; |
798 const uint8_t* vm_snapshot_instructions; | 816 const uint8_t* vm_snapshot_instructions; |
799 Dart_IsolateCreateCallback create; | 817 Dart_IsolateCreateCallback create; |
800 Dart_IsolateShutdownCallback shutdown; | 818 Dart_IsolateShutdownCallback shutdown; |
| 819 Dart_IsolateCleanupCallback cleanup; |
801 Dart_ThreadExitCallback thread_exit; | 820 Dart_ThreadExitCallback thread_exit; |
802 Dart_FileOpenCallback file_open; | 821 Dart_FileOpenCallback file_open; |
803 Dart_FileReadCallback file_read; | 822 Dart_FileReadCallback file_read; |
804 Dart_FileWriteCallback file_write; | 823 Dart_FileWriteCallback file_write; |
805 Dart_FileCloseCallback file_close; | 824 Dart_FileCloseCallback file_close; |
806 Dart_EntropySource entropy_source; | 825 Dart_EntropySource entropy_source; |
807 Dart_GetVMServiceAssetsArchive get_service_assets; | 826 Dart_GetVMServiceAssetsArchive get_service_assets; |
808 } Dart_InitializeParams; | 827 } Dart_InitializeParams; |
809 | 828 |
810 /** | 829 /** |
(...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3322 */ | 3341 */ |
3323 DART_EXPORT bool Dart_IsPrecompiledRuntime(); | 3342 DART_EXPORT bool Dart_IsPrecompiledRuntime(); |
3324 | 3343 |
3325 | 3344 |
3326 /** | 3345 /** |
3327 * Print a native stack trace. Used for crash handling. | 3346 * Print a native stack trace. Used for crash handling. |
3328 */ | 3347 */ |
3329 DART_EXPORT void Dart_DumpNativeStackTrace(void* context); | 3348 DART_EXPORT void Dart_DumpNativeStackTrace(void* context); |
3330 | 3349 |
3331 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 3350 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |