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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1371193005: VM restart + shutdown fixes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: more code review Created 5 years, 2 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/debugger.cc » ('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 70cb4d3bd39a514a0d7545befd182d0817fae76f..473a665af1e32caf9716692090edceab83bf694c 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -747,6 +747,13 @@ DART_EXPORT bool Dart_IsFatalError(Dart_Handle object) {
}
+DART_EXPORT bool Dart_IsVMRestartRequest(Dart_Handle handle) {
+ DARTSCOPE(Thread::Current());
+ const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
+ return (obj.IsUnwindError() && UnwindError::Cast(obj).is_vm_restart());
+}
+
+
DART_EXPORT const char* Dart_GetError(Dart_Handle handle) {
DARTSCOPE(Thread::Current());
const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
@@ -1674,7 +1681,7 @@ DART_EXPORT Dart_Handle Dart_HandleMessage() {
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE_SCOPE(isolate);
CHECK_CALLBACK_STATE(isolate);
- if (!isolate->message_handler()->HandleNextMessage()) {
+ if (isolate->message_handler()->HandleNextMessage() != MessageHandler::kOK) {
Dart_Handle error = Api::NewHandle(isolate,
isolate->object_store()->sticky_error());
isolate->object_store()->clear_sticky_error();
@@ -1690,8 +1697,10 @@ DART_EXPORT bool Dart_HandleServiceMessages() {
CHECK_CALLBACK_STATE(isolate);
ASSERT(isolate->GetAndClearResumeRequest() == false);
- isolate->message_handler()->HandleOOBMessages();
- return isolate->GetAndClearResumeRequest();
+ MessageHandler::MessageStatus status =
+ isolate->message_handler()->HandleOOBMessages();
+ bool resume = isolate->GetAndClearResumeRequest();
+ return (status != MessageHandler::kOK) || resume;
}
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698