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 INCLUDE_DART_API_H_ | 7 #ifndef INCLUDE_DART_API_H_ |
8 #define INCLUDE_DART_API_H_ | 8 #define INCLUDE_DART_API_H_ |
9 | 9 |
10 /** \mainpage Dart Embedding API Reference | 10 /** \mainpage Dart Embedding API Reference |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 | 861 |
862 typedef void (*Dart_FileWriteCallback)(const void* data, | 862 typedef void (*Dart_FileWriteCallback)(const void* data, |
863 intptr_t length, | 863 intptr_t length, |
864 void* stream); | 864 void* stream); |
865 | 865 |
866 typedef void (*Dart_FileCloseCallback)(void* stream); | 866 typedef void (*Dart_FileCloseCallback)(void* stream); |
867 | 867 |
868 typedef bool (*Dart_EntropySource)(uint8_t* buffer, intptr_t length); | 868 typedef bool (*Dart_EntropySource)(uint8_t* buffer, intptr_t length); |
869 | 869 |
870 /** | 870 /** |
| 871 * Callback provided by the embedder that is used by the vmservice isolate |
| 872 * to request the asset archive. The asset archive must be an uncompressed tar |
| 873 * archive that is stored in a Uint8List. |
| 874 * |
| 875 * If the embedder has no vmservice isolate assets, the callback can be NULL. |
| 876 * |
| 877 * \return The embedder must return a handle to a Uint8List containing an |
| 878 * uncompressed tar archive or null. |
| 879 */ |
| 880 typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)(); |
| 881 |
| 882 /** |
871 * Initializes the VM. | 883 * Initializes the VM. |
872 * | 884 * |
873 * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate | 885 * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate |
874 * or NULL if no snapshot is provided. | 886 * or NULL if no snapshot is provided. |
875 * \param instructions_snapshot A buffer containing a snapshot of precompiled | 887 * \param instructions_snapshot A buffer containing a snapshot of precompiled |
876 * instructions, or NULL if no snapshot is provided. | 888 * instructions, or NULL if no snapshot is provided. |
877 * \param create A function to be called during isolate creation. | 889 * \param create A function to be called during isolate creation. |
878 * See Dart_IsolateCreateCallback. | 890 * See Dart_IsolateCreateCallback. |
879 * \param interrupt A function to be called when an isolate is interrupted. | 891 * \param interrupt A function to be called when an isolate is interrupted. |
880 * See Dart_IsolateInterruptCallback. | 892 * See Dart_IsolateInterruptCallback. |
881 * \param unhandled_exception A function to be called if an isolate has an | 893 * \param unhandled_exception A function to be called if an isolate has an |
882 * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback. | 894 * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback. |
883 * \param shutdown A function to be called when an isolate is shutdown. | 895 * \param shutdown A function to be called when an isolate is shutdown. |
884 * See Dart_IsolateShutdownCallback. | 896 * See Dart_IsolateShutdownCallback. |
885 * | 897 * |
| 898 * \param get_service_assets A function to be called by the service isolate when |
| 899 * it requires the vmservice assets archive. |
| 900 * See Dart_GetVMServiceAssetsArchive. |
| 901 * |
886 * \return NULL if initialization is successful. Returns an error message | 902 * \return NULL if initialization is successful. Returns an error message |
887 * otherwise. The caller is responsible for freeing the error message. | 903 * otherwise. The caller is responsible for freeing the error message. |
888 */ | 904 */ |
889 DART_EXPORT char* Dart_Initialize( | 905 DART_EXPORT char* Dart_Initialize( |
890 const uint8_t* vm_isolate_snapshot, | 906 const uint8_t* vm_isolate_snapshot, |
891 const uint8_t* instructions_snapshot, | 907 const uint8_t* instructions_snapshot, |
892 Dart_IsolateCreateCallback create, | 908 Dart_IsolateCreateCallback create, |
893 Dart_IsolateInterruptCallback interrupt, | 909 Dart_IsolateInterruptCallback interrupt, |
894 Dart_IsolateUnhandledExceptionCallback unhandled_exception, | 910 Dart_IsolateUnhandledExceptionCallback unhandled_exception, |
895 Dart_IsolateShutdownCallback shutdown, | 911 Dart_IsolateShutdownCallback shutdown, |
896 Dart_FileOpenCallback file_open, | 912 Dart_FileOpenCallback file_open, |
897 Dart_FileReadCallback file_read, | 913 Dart_FileReadCallback file_read, |
898 Dart_FileWriteCallback file_write, | 914 Dart_FileWriteCallback file_write, |
899 Dart_FileCloseCallback file_close, | 915 Dart_FileCloseCallback file_close, |
900 Dart_EntropySource entropy_source); | 916 Dart_EntropySource entropy_source, |
| 917 Dart_GetVMServiceAssetsArchive get_service_assets); |
901 | 918 |
902 /** | 919 /** |
903 * Cleanup state in the VM before process termination. | 920 * Cleanup state in the VM before process termination. |
904 * | 921 * |
905 * \return NULL if cleanup is successful. Returns an error message otherwise. | 922 * \return NULL if cleanup is successful. Returns an error message otherwise. |
906 * The caller is responsible for freeing the error message. | 923 * The caller is responsible for freeing the error message. |
907 */ | 924 */ |
908 DART_EXPORT char* Dart_Cleanup(); | 925 DART_EXPORT char* Dart_Cleanup(); |
909 | 926 |
910 /** | 927 /** |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2926 | 2943 |
2927 DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshot( | 2944 DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshot( |
2928 uint8_t** vm_isolate_snapshot_buffer, | 2945 uint8_t** vm_isolate_snapshot_buffer, |
2929 intptr_t* vm_isolate_snapshot_size, | 2946 intptr_t* vm_isolate_snapshot_size, |
2930 uint8_t** isolate_snapshot_buffer, | 2947 uint8_t** isolate_snapshot_buffer, |
2931 intptr_t* isolate_snapshot_size, | 2948 intptr_t* isolate_snapshot_size, |
2932 uint8_t** instructions_snapshot_buffer, | 2949 uint8_t** instructions_snapshot_buffer, |
2933 intptr_t* instructions_snapshot_size); | 2950 intptr_t* instructions_snapshot_size); |
2934 | 2951 |
2935 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2952 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |