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

Unified Diff: runtime/vm/dart_api_impl.cc

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 | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index e35e0280270271cd751d3522bf9a97bc70862f94..3c4cb1789dfdcc513acd3a3f2c959f3113ffe670 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1366,6 +1366,66 @@ DART_EXPORT void Dart_ThreadEnableProfiling() {
}
+DART_EXPORT bool Dart_ShouldPauseOnStart() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ return isolate->message_handler()->should_pause_on_start();
+}
+
+
+DART_EXPORT void Dart_SetShouldPauseOnStart(bool should_pause) {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ return isolate->message_handler()->set_should_pause_on_start(should_pause);
+}
+
+
+DART_EXPORT bool Dart_IsPausedOnStart() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ return isolate->message_handler()->is_paused_on_start();
+}
+
+
+DART_EXPORT void Dart_SetPausedOnStart(bool paused) {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ if (isolate->message_handler()->is_paused_on_start() != paused) {
+ isolate->message_handler()->PausedOnStart(paused);
+ }
+}
+
+
+DART_EXPORT bool Dart_ShouldPauseOnExit() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ return isolate->message_handler()->should_pause_on_exit();
+}
+
+
+DART_EXPORT void Dart_SetShouldPauseOnExit(bool should_pause) {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ return isolate->message_handler()->set_should_pause_on_exit(should_pause);
+}
+
+
+DART_EXPORT bool Dart_IsPausedOnExit() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ return isolate->message_handler()->is_paused_on_exit();
+}
+
+
+DART_EXPORT void Dart_SetPausedOnExit(bool paused) {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ if (isolate->message_handler()->is_paused_on_exit() != paused) {
+ isolate->message_handler()->PausedOnExit(paused);
+ }
+}
+
+
DART_EXPORT void Dart_ExitIsolate() {
Thread* T = Thread::Current();
CHECK_ISOLATE(T->isolate());
@@ -1580,6 +1640,22 @@ DART_EXPORT Dart_Handle Dart_HandleMessage() {
}
+DART_EXPORT Dart_Handle Dart_HandleMessages() {
+ Thread* T = Thread::Current();
+ Isolate* I = T->isolate();
+ CHECK_API_SCOPE(T);
+ CHECK_CALLBACK_STATE(T);
+ API_TIMELINE_BEGIN_END;
+ TransitionNativeToVM transition(T);
+ if (I->message_handler()->HandleAllMessages() != MessageHandler::kOK) {
+ Dart_Handle error = Api::NewHandle(T, I->object_store()->sticky_error());
+ I->object_store()->clear_sticky_error();
+ return error;
+ }
+ return Api::Success();
+}
+
+
DART_EXPORT bool Dart_HandleServiceMessages() {
Thread* T = Thread::Current();
Isolate* I = T->isolate();
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698