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

Unified Diff: runtime/include/dart_api.h

Issue 11413101: Added support for isolate unhandled exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 8cc518acb9645b6577dd4c35ade7d00f6d28fb0d..c692db95a5c21b4f390fc20eadaa1f2202e819f7 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -622,6 +622,20 @@ typedef bool (*Dart_IsolateInterruptCallback)();
// TODO(turnidge): Define and implement unwinding.
/**
+ * An isolate unhandled exception callback function.
+ *
+ * This callback, provided by the embedder, is called when an
+ * unhandled exception is thrown during isolate execution.
+ * When the callback is called, Dart_CurrentIsolate can be used to
+ * figure out which isolate was running when the exception was
+ * thrown.
+ *
+ * \param error The unhandled exception. This handle's scope is
+ * only valid until the embedder returns from this callback.
+ */
+typedef void (*Dart_IsolateUnhandledExceptionCallback)(Dart_Handle error);
+
+/**
* An isolate shutdown callback function.
*
* This callback, provided by the embedder, is called after the vm
@@ -644,12 +658,18 @@ typedef void (*Dart_IsolateShutdownCallback)(void* callback_data);
* See Dart_IsolateCreateCallback.
* \param interrupt A function to be called when an isolate is interrupted.
* See Dart_IsolateInterruptCallback.
+ * \param unhandled_exception A function to be called if an isolate has an
+ * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback.
+ * \param shutdown A function to be called when an isolate is shutdown.
+ * See Dart_IsolateShutdownCallback.
*
* \return True if initialization is successful.
*/
-DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create,
- Dart_IsolateInterruptCallback interrupt,
- Dart_IsolateShutdownCallback shutdown);
+DART_EXPORT bool Dart_Initialize(
+ Dart_IsolateCreateCallback create,
+ Dart_IsolateInterruptCallback interrupt,
+ Dart_IsolateUnhandledExceptionCallback unhandled_exception,
+ Dart_IsolateShutdownCallback shutdown);
/**
* Sets command line flags. Should be called before Dart_Initialize.
« no previous file with comments | « runtime/bin/run_vm_tests.cc ('k') | runtime/lib/isolate.cc » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698