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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 * Most embedders will only call this function once, before isolate | 1031 * Most embedders will only call this function once, before isolate |
1032 * execution begins. If this function is called after isolate | 1032 * execution begins. If this function is called after isolate |
1033 * execution begins, the embedder is responsible for threading issues. | 1033 * execution begins, the embedder is responsible for threading issues. |
1034 */ | 1034 */ |
1035 DART_EXPORT void Dart_SetMessageNotifyCallback( | 1035 DART_EXPORT void Dart_SetMessageNotifyCallback( |
1036 Dart_MessageNotifyCallback message_notify_callback); | 1036 Dart_MessageNotifyCallback message_notify_callback); |
1037 /* TODO(turnidge): Consider moving this to isolate creation so that it | 1037 /* TODO(turnidge): Consider moving this to isolate creation so that it |
1038 * is impossible to mess up. */ | 1038 * is impossible to mess up. */ |
1039 | 1039 |
1040 /** | 1040 /** |
| 1041 * The VM's default message handler supports pausing an isolate before it starts |
| 1042 * and before it exits. This is controlled by two VM flags: |
| 1043 * |
| 1044 * `--pause-isolates-on-start` |
| 1045 * `--pause-isolates-on-exit` |
| 1046 * |
| 1047 * When an embedder is using a Dart_MessageNotifyCallback the following |
| 1048 * functions can be used to implement pausing on start and exit. |
| 1049 */ |
| 1050 |
| 1051 /** |
| 1052 * If the VM flag `--pause-isolates-on-start` was passed this will be true. |
| 1053 * |
| 1054 * \return A boolean value indicating if pause on start was requested. |
| 1055 */ |
| 1056 DART_EXPORT bool Dart_ShouldPauseOnStart(); |
| 1057 |
| 1058 /** |
| 1059 * Override the VM flag `--pause-isolates-on-start` for the current isolate. |
| 1060 * |
| 1061 * NOTE: This must be called before Dart_IsolateMakeRunnable. |
| 1062 */ |
| 1063 DART_EXPORT void Dart_SetShouldPauseOnStart(bool value); |
| 1064 |
| 1065 /** |
| 1066 * Is the current isolate paused on start? |
| 1067 * |
| 1068 * \return A boolean value indicating if the isolate is paused on start. |
| 1069 */ |
| 1070 DART_EXPORT bool Dart_IsPausedOnStart(); |
| 1071 |
| 1072 /** |
| 1073 * Called when the embedder has paused the current isolate on start and when |
| 1074 * the embedder has released the isolate. |
| 1075 * |
| 1076 * \return A boolean value indicating if the isolate is paused on start. |
| 1077 */ |
| 1078 DART_EXPORT void Dart_SetPausedOnStart(bool value); |
| 1079 |
| 1080 /** |
| 1081 * If the VM flag `--pause-isolates-on-exit` was passed this will be true. |
| 1082 * |
| 1083 * \return A boolean value indicating if pause on start was requested. |
| 1084 */ |
| 1085 DART_EXPORT bool Dart_ShouldPauseOnExit(); |
| 1086 |
| 1087 /** |
| 1088 * Override the VM flag `--pause-isolates-on-start` for the current isolate. |
| 1089 * |
| 1090 * NOTE: This must be called before Dart_IsolateMakeRunnable. |
| 1091 */ |
| 1092 DART_EXPORT void Dart_SetShouldPauseOnExit(bool value); |
| 1093 |
| 1094 /** |
| 1095 * Is the current isolate paused on exit? |
| 1096 * |
| 1097 * \return A boolean value indicating if the isolate is paused on start. |
| 1098 */ |
| 1099 DART_EXPORT bool Dart_IsPausedOnExit(); |
| 1100 |
| 1101 /** |
| 1102 * Called when the embedder has paused the current isolate on start and when |
| 1103 * the embedder has released the isolate. |
| 1104 * |
| 1105 * \return A boolean value indicating if the isolate is paused on start. |
| 1106 */ |
| 1107 DART_EXPORT void Dart_SetPausedOnExit(bool value); |
| 1108 |
| 1109 |
| 1110 /** |
1041 * Handles the next pending message for the current isolate. | 1111 * Handles the next pending message for the current isolate. |
1042 * | 1112 * |
1043 * May generate an unhandled exception error. | 1113 * May generate an unhandled exception error. |
1044 * | 1114 * |
1045 * \return A valid handle if no error occurs during the operation. | 1115 * \return A valid handle if no error occurs during the operation. |
1046 */ | 1116 */ |
1047 DART_EXPORT Dart_Handle Dart_HandleMessage(); | 1117 DART_EXPORT Dart_Handle Dart_HandleMessage(); |
1048 | 1118 |
1049 /** | 1119 /** |
| 1120 * Handles all pending messages for the current isolate. |
| 1121 * |
| 1122 * May generate an unhandled exception error. |
| 1123 * |
| 1124 * \return A valid handle if no error occurs during the operation. |
| 1125 */ |
| 1126 DART_EXPORT Dart_Handle Dart_HandleMessages(); |
| 1127 |
| 1128 /** |
1050 * Handles any pending messages for the vm service for the current | 1129 * Handles any pending messages for the vm service for the current |
1051 * isolate. | 1130 * isolate. |
1052 * | 1131 * |
1053 * This function may be used by an embedder at a breakpoint to avoid | 1132 * This function may be used by an embedder at a breakpoint to avoid |
1054 * pausing the vm service. | 1133 * pausing the vm service. |
1055 * | 1134 * |
1056 * This function can indirectly cause the message notify callback to | 1135 * This function can indirectly cause the message notify callback to |
1057 * be called. | 1136 * be called. |
1058 * | 1137 * |
1059 * \return true if the vm service requests the program resume | 1138 * \return true if the vm service requests the program resume |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2805 intptr_t* vm_isolate_snapshot_size, | 2884 intptr_t* vm_isolate_snapshot_size, |
2806 uint8_t** isolate_snapshot_buffer, | 2885 uint8_t** isolate_snapshot_buffer, |
2807 intptr_t* isolate_snapshot_size, | 2886 intptr_t* isolate_snapshot_size, |
2808 uint8_t** instructions_snapshot_buffer, | 2887 uint8_t** instructions_snapshot_buffer, |
2809 intptr_t* instructions_snapshot_size); | 2888 intptr_t* instructions_snapshot_size); |
2810 | 2889 |
2811 | 2890 |
2812 DART_EXPORT bool Dart_IsRunningPrecompiledCode(); | 2891 DART_EXPORT bool Dart_IsRunningPrecompiledCode(); |
2813 | 2892 |
2814 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2893 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |