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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 * Exits an isolate. After this call, Dart_CurrentIsolate will | 337 * Exits an isolate. After this call, Dart_CurrentIsolate will |
| 338 * return NULL. | 338 * return NULL. |
| 339 * | 339 * |
| 340 * Requires there to be a current isolate. | 340 * Requires there to be a current isolate. |
| 341 */ | 341 */ |
| 342 DART_EXPORT void Dart_ExitIsolate(); | 342 DART_EXPORT void Dart_ExitIsolate(); |
| 343 // TODO(turnidge): We don't want users of the api to be able to exit a | 343 // TODO(turnidge): We don't want users of the api to be able to exit a |
| 344 // "pure" dart isolate. Implement and document. | 344 // "pure" dart isolate. Implement and document. |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * Creates a snapshot of the state of the current isolate. | 347 * Creates a full snapshot of the current isolate. |
| 348 * (A full snapshot is a compact representation of the dart heap state and | |
| 349 * can be used for fast initialization of an isolate). | |
|
turnidge
2011/12/05 18:49:00
So does a "full" snapshot contain the script snaps
siva
2011/12/05 21:35:37
Yes "full" will contain any scripts that were load
| |
| 350 * This function can only be called before any dart code has executed. | |
| 351 * | |
| 352 * \param buffer Returns a pointer to a buffer containing the snapshot. | |
| 353 * The buffer is allocated in the current Api zone and will be | |
| 354 * deleted when the current Api scope is exited using Dart_ExitScope. | |
| 355 * \param size Returns the size of the buffer. | |
| 356 * | |
| 357 * \return A handle to the True object if the creation of snapshot was | |
| 358 * successful, otherwise it returns an error handle. | |
| 348 */ | 359 */ |
|
turnidge
2011/12/05 18:49:00
I would use more blank lines in the doc comment to
siva
2011/12/05 21:35:37
Done.
| |
| 349 DART_EXPORT Dart_Handle Dart_CreateSnapshot(uint8_t** snaphot_buffer, | 360 DART_EXPORT Dart_Handle Dart_CreateSnapshot(uint8_t** buffer, |
| 350 intptr_t* snapshot_size); | 361 intptr_t* size); |
| 362 | |
| 363 /** | |
| 364 * Creates a snapshot of the specified application script, this is used for | |
| 365 * implementing fast startup of applications (skips the script tokenizing | |
| 366 * and parsing process). | |
| 367 * This function can only be called before any dart code has executed. | |
| 368 * | |
| 369 * \param script THe application script for which a snapshot is to be created. | |
|
turnidge
2011/12/05 18:49:00
THe -> The. Or maybe "An"?
siva
2011/12/05 21:35:37
Done.
| |
| 370 * \param buffer Returns a pointer to a buffer containing the snapshot. | |
| 371 * The buffer is allocated in the current Api zone and will be | |
| 372 * deleted when the current Api scope is exited using Dart_ExitScope. | |
| 373 * \param size Returns the size of the buffer. | |
| 374 * | |
| 375 * \return A handle to the True object if the creation of snapshot was | |
| 376 * successful, otherwise it returns an error handle. | |
| 377 */ | |
|
turnidge
2011/12/05 18:49:00
Similar comments as above.
siva
2011/12/05 21:35:37
Done.
| |
| 378 DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(Dart_Handle library, | |
| 379 uint8_t** buffer, | |
| 380 intptr_t* size); | |
| 381 | |
| 351 | 382 |
| 352 // --- Messages and Ports --- | 383 // --- Messages and Ports --- |
| 353 | 384 |
| 354 /** | 385 /** |
| 355 * Messages are used to communicate between isolates. | 386 * Messages are used to communicate between isolates. |
| 356 */ | 387 */ |
| 357 typedef struct _Dart_Message* Dart_Message; | 388 typedef struct _Dart_Message* Dart_Message; |
| 358 | 389 |
| 359 /** | 390 /** |
| 360 * A port is used to send or receive inter-isolate messages | 391 * A port is used to send or receive inter-isolate messages |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1169 /** | 1200 /** |
| 1170 * Loads the root script for the current isolate. | 1201 * Loads the root script for the current isolate. |
| 1171 * | 1202 * |
| 1172 * TODO(turnidge): Document. | 1203 * TODO(turnidge): Document. |
| 1173 */ | 1204 */ |
| 1174 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, | 1205 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, |
| 1175 Dart_Handle source, | 1206 Dart_Handle source, |
| 1176 Dart_LibraryTagHandler handler); | 1207 Dart_LibraryTagHandler handler); |
| 1177 | 1208 |
| 1178 /** | 1209 /** |
| 1210 * Loads the root script for current isolate from a snapshot. | |
| 1211 * | |
| 1212 * \param snapshot Buffer which contains a snapshot of the script. | |
|
turnidge
2011/12/05 18:49:00
"Buffer" -> "A buffer"
siva
2011/12/05 21:35:37
Done.
| |
| 1213 * | |
| 1214 * \return if no error occurs, the Library object corresponding to the root | |
| 1215 * script is returned. Otherwise an error handle is returned. | |
| 1216 **/ | |
| 1217 DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* snapshot); | |
| 1218 | |
| 1219 /** | |
| 1179 * Forces all loaded classes and functions to be compiled eagerly in | 1220 * Forces all loaded classes and functions to be compiled eagerly in |
| 1180 * the current isolate.. | 1221 * the current isolate.. |
| 1181 * | 1222 * |
| 1182 * TODO(turnidge): Document. | 1223 * TODO(turnidge): Document. |
| 1183 */ | 1224 */ |
| 1184 DART_EXPORT Dart_Handle Dart_CompileAll(); | 1225 DART_EXPORT Dart_Handle Dart_CompileAll(); |
| 1185 | 1226 |
| 1186 /** | 1227 /** |
| 1187 * Is this object a Library? | 1228 * Is this object a Library? |
| 1188 */ | 1229 */ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1227 | 1268 |
| 1228 // --- Profiling support ---- | 1269 // --- Profiling support ---- |
| 1229 | 1270 |
| 1230 // External pprof support for gathering and dumping symbolic | 1271 // External pprof support for gathering and dumping symbolic |
| 1231 // information that can be used for better profile reports for | 1272 // information that can be used for better profile reports for |
| 1232 // dynamically generated code. | 1273 // dynamically generated code. |
| 1233 DART_EXPORT void Dart_InitPprofSupport(); | 1274 DART_EXPORT void Dart_InitPprofSupport(); |
| 1234 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1275 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1235 | 1276 |
| 1236 #endif // INCLUDE_DART_API_H_ | 1277 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |