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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 * C string containing an error message in the case of failures. | 238 * C string containing an error message in the case of failures. |
239 * | 239 * |
240 * \return The embedder returns false if the creation and initialization was not | 240 * \return The embedder returns false if the creation and initialization was not |
241 * successful and true if successful. The embedder is responsible for | 241 * successful and true if successful. The embedder is responsible for |
242 * maintaining consistency in the case of errors (e.g: isolate is created, | 242 * maintaining consistency in the case of errors (e.g: isolate is created, |
243 * but loading of scripts fails then the embedder should ensure that | 243 * but loading of scripts fails then the embedder should ensure that |
244 * Dart_ShutdownIsolate is called on the isolate). | 244 * Dart_ShutdownIsolate is called on the isolate). |
245 * In the case of errors the caller is responsible for freeing the buffer | 245 * In the case of errors the caller is responsible for freeing the buffer |
246 * returned in error containing an error string. | 246 * returned in error containing an error string. |
247 */ | 247 */ |
248 typedef bool (*Dart_IsolateCreateCallback)(void* callback_data, char** error); | 248 typedef bool (*Dart_IsolateCreateCallback)(const char* name_prefix, |
Ivan Posva
2012/01/20 16:28:29
name_prefix and callback_data are not documented a
| |
249 void* callback_data, | |
250 char** error); | |
249 | 251 |
250 /** | 252 /** |
251 * An isolate interrupt callback function. | 253 * An isolate interrupt callback function. |
252 * | 254 * |
253 * This callback, provided by the embedder, is called when an isolate | 255 * This callback, provided by the embedder, is called when an isolate |
254 * is interrupted as a result of a call to Dart_InterruptIsolate(). | 256 * is interrupted as a result of a call to Dart_InterruptIsolate(). |
255 * When the callback is called, Dart_CurrentIsolate can be used to | 257 * When the callback is called, Dart_CurrentIsolate can be used to |
256 * figure out which isolate is being interrupted. | 258 * figure out which isolate is being interrupted. |
257 * | 259 * |
258 * \param current_isolate The isolate being interrupted. | 260 * \param current_isolate The isolate being interrupted. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 */ | 310 */ |
309 typedef struct _Dart_Isolate* Dart_Isolate; | 311 typedef struct _Dart_Isolate* Dart_Isolate; |
310 | 312 |
311 /** | 313 /** |
312 * Creates a new isolate. The new isolate becomes the current isolate. | 314 * Creates a new isolate. The new isolate becomes the current isolate. |
313 * | 315 * |
314 * A snapshot can be used to restore the VM quickly to a saved state | 316 * A snapshot can be used to restore the VM quickly to a saved state |
315 * and is useful for fast startup. If snapshot data is provided, the | 317 * and is useful for fast startup. If snapshot data is provided, the |
316 * isolate will be started using that snapshot data. | 318 * isolate will be started using that snapshot data. |
317 * | 319 * |
318 * Requires there to be no current isolate. | 320 * Requires there to be no current isolate. |
Ivan Posva
2012/01/20 16:28:29
I don't think this is the case. Please check with
| |
319 * | 321 * |
320 * \param snapshot A buffer containing a VM snapshot or NULL if no | 322 * \param snapshot A buffer containing a VM snapshot or NULL if no |
321 * snapshot is provided. | 323 * snapshot is provided. |
322 * | 324 * |
323 * \return The new isolate is returned. May be NULL if an error | 325 * \return The new isolate is returned. May be NULL if an error |
324 * occurs duing isolate initialization. | 326 * occurs duing isolate initialization. |
325 */ | 327 */ |
326 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const uint8_t* snapshot, | 328 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* name_prefix, |
Ivan Posva
2012/01/20 16:28:29
name_prefix and callback_data are not documented.
| |
329 const uint8_t* snapshot, | |
327 void* callback_data, | 330 void* callback_data, |
328 char** error); | 331 char** error); |
329 // TODO(turnidge): Document behavior when there is already a current | 332 // TODO(turnidge): Document behavior when there is already a current |
330 // isolate. | 333 // isolate. |
331 | 334 |
332 /** | 335 /** |
333 * Shuts down the current isolate. After this call, the current | 336 * Shuts down the current isolate. After this call, the current |
334 * isolate is NULL. | 337 * isolate is NULL. |
335 * | 338 * |
336 * Requires there to be a current isolate. | 339 * Requires there to be a current isolate. |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1381 | 1384 |
1382 // --- Profiling support ---- | 1385 // --- Profiling support ---- |
1383 | 1386 |
1384 // External pprof support for gathering and dumping symbolic | 1387 // External pprof support for gathering and dumping symbolic |
1385 // information that can be used for better profile reports for | 1388 // information that can be used for better profile reports for |
1386 // dynamically generated code. | 1389 // dynamically generated code. |
1387 DART_EXPORT void Dart_InitPprofSupport(); | 1390 DART_EXPORT void Dart_InitPprofSupport(); |
1388 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1391 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
1389 | 1392 |
1390 #endif // INCLUDE_DART_API_H_ | 1393 #endif // INCLUDE_DART_API_H_ |
OLD | NEW |