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

Unified Diff: runtime/vm/service.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/raw_object.h ('k') | runtime/vm/service_isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 47751e215fb0d98a505f62c3b77079c8065470fc..70d9e431d9de0df5edd1cd1b7b7b92838593d68e 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -672,9 +672,9 @@ void Service::SendEvent(const char* stream_id,
writer.WriteMessage(list);
intptr_t len = writer.BytesWritten();
if (FLAG_trace_service) {
- OS::Print(
- "vm-service: Pushing event of type %s to stream %s (%s), len %" Pd "\n",
- event_type, stream_id, isolate->name(), len);
+ OS::Print("vm-service: Pushing ServiceEvent(isolate='%s', kind='%s',"
+ " len=%" Pd ") to stream %s\n",
+ isolate->name(), event_type, len, stream_id);
}
// TODO(turnidge): For now we ignore failure to send an event. Revisit?
PortMap::PostMessage(
@@ -770,9 +770,9 @@ void Service::PostEvent(const char* stream_id,
if (isolate != NULL) {
isolate_name = isolate->name();
}
- OS::Print(
- "vm-service: Pushing event of type %s to stream %s (%s)\n",
- kind, stream_id, isolate_name);
+ OS::Print("vm-service: Pushing ServiceEvent(isolate='%s', kind='%s') "
+ "to stream %s\n",
+ isolate_name, kind, stream_id);
}
Dart_PostCObject(ServiceIsolate::Port(), &list_cobj);
@@ -2968,6 +2968,19 @@ static bool GetVM(Isolate* isolate, JSONStream* js) {
}
+static const MethodParameter* restart_vm_params[] = {
+ NO_ISOLATE_PARAMETER,
+ NULL,
+};
+
+
+static bool RestartVM(Isolate* isolate, JSONStream* js) {
+ Isolate::KillAllIsolates(Isolate::kVMRestartMsg);
+ PrintSuccess(js);
+ return true;
+}
+
+
static const MethodParameter* set_exception_pause_info_params[] = {
ISOLATE_PARAMETER,
NULL,
@@ -3194,6 +3207,8 @@ static ServiceMethodDescriptor service_methods_[] = {
pause_params },
{ "removeBreakpoint", RemoveBreakpoint,
remove_breakpoint_params },
+ { "_restartVM", RestartVM,
+ restart_vm_params },
{ "resume", Resume,
resume_params },
{ "_requestHeapSnapshot", RequestHeapSnapshot,
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/service_isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698