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

Unified Diff: runtime/vm/service.cc

Issue 2411153002: Make reloadSources service RPC public (Closed)
Patch Set: Created 4 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
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index efc5c24b304a3a46a81b962b952b86f92593ea3f..5145ebe0ef031f68be650bd9502ab3378d347c25 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -970,7 +970,15 @@ void Service::HandleObjectRootMessage(const Array& msg_instance) {
void Service::HandleIsolateMessage(Isolate* isolate, const Array& msg) {
ASSERT(isolate != NULL);
+ const bool is_paused = isolate->IsPaused();
InvokeMethod(isolate, msg);
+ // Don't pause twice.
+ if (!is_paused) {
+ if (isolate->should_pause_post_reload_request()) {
+ isolate->set_should_pause_post_reload_request(false);
+ isolate->PausePostReload();
+ }
+ }
}
@@ -1085,6 +1093,11 @@ static void ReportPauseOnConsole(ServiceEvent* event) {
"vm-service: isolate '%s' has no debugger attached and is paused.",
name);
break;
+ case ServiceEvent::kPausePostReload:
+ OS::PrintErr(
+ "vm-service: isolate '%s' has no debugger attached and is paused "
+ "post reload.", name);
+ break;
default:
UNREACHABLE();
break;
@@ -2510,6 +2523,7 @@ static bool GetSourceReport(Thread* thread, JSONStream* js) {
static const MethodParameter* reload_sources_params[] = {
RUNNABLE_ISOLATE_PARAMETER,
new BoolParameter("force", false),
+ new BoolParameter("pause", false),
NULL,
};
@@ -2554,6 +2568,10 @@ static bool ReloadSources(Thread* thread, JSONStream* js) {
isolate->ReloadSources(js, force_reload);
+ // Should we pause?
+ isolate->set_should_pause_post_reload_request(
+ BoolParameter::Parse(js->LookupParam("pause"), false));
+
return true;
}
@@ -4163,6 +4181,8 @@ static const ServiceMethodDescriptor service_methods_[] = {
remove_breakpoint_params },
{ "_restartVM", RestartVM,
restart_vm_params },
+ { "reloadSources", ReloadSources,
+ reload_sources_params },
{ "_reloadSources", ReloadSources,
reload_sources_params },
{ "resume", Resume,
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/service_event.h » ('j') | runtime/vm/service_event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698