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

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: Incorporated code review feedback 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
« no previous file with comments | « runtime/bin/run_vm_tests.cc ('k') | runtime/lib/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 821014c1d17c3787bc59f13ef512ae3511a8f642..801d983a7680f559366035fbe2850549bc9884be 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -622,6 +622,19 @@ 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 or internal error is thrown during isolate execution. When the
+ * callback is invoked, Dart_CurrentIsolate can be used to figure out which
+ * isolate was running when the exception was thrown.
+ *
+ * \param error The unhandled exception or error. 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 +657,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698