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(); |