Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Side by Side Diff: include/dart_api.h

Issue 10450016: Add a callback to inform embedders when an isolate is being shut down. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bin/run_vm_tests.cc ('k') | vm/dart.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 char** error); 428 char** error);
429 429
430 /** 430 /**
431 * An isolate interrupt callback function. 431 * An isolate interrupt callback function.
432 * 432 *
433 * This callback, provided by the embedder, is called when an isolate 433 * This callback, provided by the embedder, is called when an isolate
434 * is interrupted as a result of a call to Dart_InterruptIsolate(). 434 * is interrupted as a result of a call to Dart_InterruptIsolate().
435 * When the callback is called, Dart_CurrentIsolate can be used to 435 * When the callback is called, Dart_CurrentIsolate can be used to
436 * figure out which isolate is being interrupted. 436 * figure out which isolate is being interrupted.
437 * 437 *
438 * \param current_isolate The isolate being interrupted.
439 *
440 * \return The embedder returns true if the isolate should continue 438 * \return The embedder returns true if the isolate should continue
441 * execution. If the embedder returns false, the isolate will be 439 * execution. If the embedder returns false, the isolate will be
442 * unwound (currently unimplemented). 440 * unwound (currently unimplemented).
443 */ 441 */
444 typedef bool (*Dart_IsolateInterruptCallback)(); 442 typedef bool (*Dart_IsolateInterruptCallback)();
445 // TODO(turnidge): Define and implement unwinding. 443 // TODO(turnidge): Define and implement unwinding.
446 444
447 /** 445 /**
446 * An isolate shutdown callback function.
447 *
448 * This callback, provided by the embedder, is called when the vm
449 * shuts down an isolate.
450 *
451 * The isolate may be in the process of shutting down due to an
452 * unrecoverable error, so it is not safe to enter the isolate or use
453 * it to run any Dart code. No further Dart code will be run on this
454 * isolate by the vm.
455 *
456 * This function should be used to dispose of native resources that
457 * are allocated to an isolate in order to avoid leaks.
458 *
459 * \param callback_data The same callback data which was passed to the
460 * isolate when it was created.
461 *
462 */
463 typedef void (*Dart_IsolateShutdownCallback)(void* callback_data);
464
465 /**
448 * Initializes the VM. 466 * Initializes the VM.
449 * 467 *
450 * \param create A function to be called during isolate creation. 468 * \param create A function to be called during isolate creation.
451 * See Dart_IsolateCreateCallback. 469 * See Dart_IsolateCreateCallback.
452 * \param interrupt A function to be called when an isolate is interrupted. 470 * \param interrupt A function to be called when an isolate is interrupted.
453 * See Dart_IsolateInterruptCallback. 471 * See Dart_IsolateInterruptCallback.
454 * 472 *
455 * \return True if initialization is successful. 473 * \return True if initialization is successful.
456 */ 474 */
457 DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create, 475 DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create,
458 Dart_IsolateInterruptCallback interrupt); 476 Dart_IsolateInterruptCallback interrupt,
477 Dart_IsolateShutdownCallback shutdown);
459 478
460 /** 479 /**
461 * Sets command line flags. Should be called before Dart_Initialize. 480 * Sets command line flags. Should be called before Dart_Initialize.
462 * 481 *
463 * \param argc The length of the arguments array. 482 * \param argc The length of the arguments array.
464 * \param argv An array of arguments. 483 * \param argv An array of arguments.
465 * 484 *
466 * \return True if VM flags set successfully. 485 * \return True if VM flags set successfully.
467 */ 486 */
468 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv); 487 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv);
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 2101
2083 // --- Profiling support ---- 2102 // --- Profiling support ----
2084 2103
2085 // External pprof support for gathering and dumping symbolic 2104 // External pprof support for gathering and dumping symbolic
2086 // information that can be used for better profile reports for 2105 // information that can be used for better profile reports for
2087 // dynamically generated code. 2106 // dynamically generated code.
2088 DART_EXPORT void Dart_InitPprofSupport(); 2107 DART_EXPORT void Dart_InitPprofSupport();
2089 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 2108 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
2090 2109
2091 #endif // INCLUDE_DART_API_H_ 2110 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « bin/run_vm_tests.cc ('k') | vm/dart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698