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 heap. |
| 348 * | |
| 349 * A full snapshot is a compact representation of the dart heap state and | |
| 350 * can be used for fast initialization of an isolate. Snapshot of the heap | |
| 351 * can only be done before any dart code has executed. | |
|
turnidge
2011/12/05 23:23:36
Instead of "Snapshot ... can only be done ...",
siva
2011/12/06 00:23:34
Done.
| |
| 352 * | |
| 353 * Requires there to be a current isolate. | |
| 354 * | |
| 355 * \param buffer Returns a pointer to a buffer containing the | |
| 356 * snapshot. The buffer is allocated in the current Api zone and | |
| 357 * will be delete when the current Api scope is exited using | |
| 358 * Dart_ExitScope. | |
|
turnidge
2011/12/05 23:23:36
One of my earlier comments got skipped:
siva
2011/12/06 00:23:34
Done, Somehow missed it the first time around.
On
| |
| 359 * \param size Returns the size of the buffer. | |
| 360 * | |
| 361 * \return A valid handle if no error occurs during the operation. | |
| 348 */ | 362 */ |
| 349 DART_EXPORT Dart_Handle Dart_CreateSnapshot(uint8_t** snaphot_buffer, | 363 DART_EXPORT Dart_Handle Dart_CreateSnapshot(uint8_t** buffer, |
| 350 intptr_t* snapshot_size); | 364 intptr_t* size); |
| 365 | |
| 366 /** | |
| 367 * Creates a snapshot of the specified application script. | |
| 368 * | |
| 369 * A script snapshot can be used for implementing fast startup of applications | |
| 370 * (skips the script tokenizing and parsing process). Snapshot of a script | |
| 371 * can only be done before any dart code has executed. | |
|
turnidge
2011/12/05 23:23:36
Snapshot -> A snapshot
done -> created
siva
2011/12/06 00:23:34
Done.
| |
| 372 * | |
| 373 * Requires there to be a current isolate. | |
| 374 * | |
| 375 * \param script An application script for which a snapshot is to be | |
| 376 * created. | |
|
turnidge
2011/12/05 23:23:36
Need extra space to line up "created". Missing *
siva
2011/12/06 00:23:34
Done.
| |
| 377 \param buffer Returns a pointer to a buffer containing | |
| 378 * the snapshot. The buffer is allocated in the current Api zone and | |
| 379 * will be deleted when the current Api scope is exited using | |
| 380 * Dart_ExitScope. | |
| 381 * \param size Returns the size of the buffer. | |
| 382 * | |
| 383 * \return A valid handle if no error occurs during the operation. | |
| 384 */ | |
| 385 DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(Dart_Handle library, | |
| 386 uint8_t** buffer, | |
| 387 intptr_t* size); | |
| 388 | |
| 351 | 389 |
| 352 // --- Messages and Ports --- | 390 // --- Messages and Ports --- |
| 353 | 391 |
| 354 /** | 392 /** |
| 355 * Messages are used to communicate between isolates. | 393 * Messages are used to communicate between isolates. |
| 356 */ | 394 */ |
| 357 typedef struct _Dart_Message* Dart_Message; | 395 typedef struct _Dart_Message* Dart_Message; |
| 358 | 396 |
| 359 /** | 397 /** |
| 360 * A port is used to send or receive inter-isolate messages | 398 * A port is used to send or receive inter-isolate messages |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1217 /** | 1255 /** |
| 1218 * Loads the root script for the current isolate. | 1256 * Loads the root script for the current isolate. |
| 1219 * | 1257 * |
| 1220 * TODO(turnidge): Document. | 1258 * TODO(turnidge): Document. |
| 1221 */ | 1259 */ |
| 1222 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, | 1260 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, |
| 1223 Dart_Handle source, | 1261 Dart_Handle source, |
| 1224 Dart_LibraryTagHandler handler); | 1262 Dart_LibraryTagHandler handler); |
| 1225 | 1263 |
| 1226 /** | 1264 /** |
| 1265 * Loads the root script for current isolate from a snapshot. | |
| 1266 * | |
| 1267 * \param buffer A buffer which contains a snapshot of the script. | |
| 1268 * | |
| 1269 * \return if no error occurs, the Library object corresponding to the root | |
|
turnidge
2011/12/05 23:23:36
Capitalize "if"
siva
2011/12/06 00:23:34
Done.
| |
| 1270 * script is returned. Otherwise an error handle is returned. | |
| 1271 **/ | |
| 1272 DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* buffer); | |
| 1273 | |
| 1274 /** | |
| 1227 * Forces all loaded classes and functions to be compiled eagerly in | 1275 * Forces all loaded classes and functions to be compiled eagerly in |
| 1228 * the current isolate.. | 1276 * the current isolate.. |
| 1229 * | 1277 * |
| 1230 * TODO(turnidge): Document. | 1278 * TODO(turnidge): Document. |
| 1231 */ | 1279 */ |
| 1232 DART_EXPORT Dart_Handle Dart_CompileAll(); | 1280 DART_EXPORT Dart_Handle Dart_CompileAll(); |
| 1233 | 1281 |
| 1234 /** | 1282 /** |
| 1235 * Is this object a Library? | 1283 * Is this object a Library? |
| 1236 */ | 1284 */ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1275 | 1323 |
| 1276 // --- Profiling support ---- | 1324 // --- Profiling support ---- |
| 1277 | 1325 |
| 1278 // External pprof support for gathering and dumping symbolic | 1326 // External pprof support for gathering and dumping symbolic |
| 1279 // information that can be used for better profile reports for | 1327 // information that can be used for better profile reports for |
| 1280 // dynamically generated code. | 1328 // dynamically generated code. |
| 1281 DART_EXPORT void Dart_InitPprofSupport(); | 1329 DART_EXPORT void Dart_InitPprofSupport(); |
| 1282 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1330 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1283 | 1331 |
| 1284 #endif // INCLUDE_DART_API_H_ | 1332 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |