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

Unified Diff: runtime/include/dart_api.h

Issue 1665773004: Add necessary support functions so that embedders can implemented pause on start and exit (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/dart.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 2746d8d176ca98a178685f85b202169f3fb2ee20..20e8ea278f9d090da8ea99f15a119e2a6ba40cd2 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1078,6 +1078,76 @@ DART_EXPORT void Dart_SetMessageNotifyCallback(
* is impossible to mess up. */
/**
+ * The VM's default message handler supports pausing an isolate before it starts
+ * and before it exits. This is controlled by two VM flags:
+ *
+ * `--pause-isolates-on-start`
+ * `--pause-isolates-on-exit`
+ *
+ * When an embedder is using a Dart_MessageNotifyCallback the following
+ * functions can be used to implement pausing on start and exit.
+ */
+
+/**
+ * If the VM flag `--pause-isolates-on-start` was passed this will be true.
+ *
+ * \return A boolean value indicating if pause on start was requested.
+ */
+DART_EXPORT bool Dart_ShouldPauseOnStart();
+
+/**
+ * Override the VM flag `--pause-isolates-on-start` for the current isolate.
+ *
+ * NOTE: This must be called before Dart_IsolateMakeRunnable.
+ */
+DART_EXPORT void Dart_SetShouldPauseOnStart(bool value);
+
+/**
+ * Is the current isolate paused on start?
+ *
+ * \return A boolean value indicating if the isolate is paused on start.
+ */
+DART_EXPORT bool Dart_IsPausedOnStart();
+
+/**
+ * Called when the embedder has paused the current isolate on start and when
+ * the embedder has released the isolate.
+ *
+ * \return A boolean value indicating if the isolate is paused on start.
+ */
+DART_EXPORT void Dart_SetPausedOnStart(bool value);
+
+/**
+ * If the VM flag `--pause-isolates-on-exit` was passed this will be true.
+ *
+ * \return A boolean value indicating if pause on start was requested.
+ */
+DART_EXPORT bool Dart_ShouldPauseOnExit();
+
+/**
+ * Override the VM flag `--pause-isolates-on-start` for the current isolate.
+ *
+ * NOTE: This must be called before Dart_IsolateMakeRunnable.
+ */
+DART_EXPORT void Dart_SetShouldPauseOnExit(bool value);
+
+/**
+ * Is the current isolate paused on exit?
+ *
+ * \return A boolean value indicating if the isolate is paused on start.
+ */
+DART_EXPORT bool Dart_IsPausedOnExit();
+
+/**
+ * Called when the embedder has paused the current isolate on start and when
+ * the embedder has released the isolate.
+ *
+ * \return A boolean value indicating if the isolate is paused on start.
+ */
+DART_EXPORT void Dart_SetPausedOnExit(bool value);
+
+
+/**
* Handles the next pending message for the current isolate.
*
* May generate an unhandled exception error.
@@ -1087,6 +1157,15 @@ DART_EXPORT void Dart_SetMessageNotifyCallback(
DART_EXPORT Dart_Handle Dart_HandleMessage();
/**
+ * Handles all pending messages for the current isolate.
+ *
+ * May generate an unhandled exception error.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_HandleMessages();
+
+/**
* Handles any pending messages for the vm service for the current
* isolate.
*
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698