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

Unified Diff: runtime/vm/isolate.cc

Issue 3006883002: Make service protocol respect isolate lifecycle (Closed)
Patch Set: Merged with upstream Created 3 years, 4 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/observatory/tests/service/service.status ('k') | runtime/vm/message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 4172327255161565a66b914e5e0008df5877e423..52c3c4553772e7b09d12d5a01e8b1140c798cc2b 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1995,11 +1995,22 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL));
ServiceEvent pause_event(this, ServiceEvent::kNone);
jsobj.AddProperty("pauseEvent", &pause_event);
- } else if (message_handler()->is_paused_on_start() ||
- message_handler()->should_pause_on_start()) {
- ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL));
- ServiceEvent pause_event(this, ServiceEvent::kPauseStart);
- jsobj.AddProperty("pauseEvent", &pause_event);
+ } else if (message_handler()->should_pause_on_start()) {
+ if (message_handler()->is_paused_on_start()) {
+ ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL));
+ ServiceEvent pause_event(this, ServiceEvent::kPauseStart);
+ jsobj.AddProperty("pauseEvent", &pause_event);
+ } else {
+ // Isolate is runnable but not paused on start.
+ // Some service clients get confused if they see:
+ // NotRunnable -> Runnable -> PausedAtStart
+ // Treat Runnable+ShouldPauseOnStart as NotRunnable so they see:
+ // NonRunnable -> PausedAtStart
+ // The should_pause_on_start flag is set to false after resume.
+ ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL));
+ ServiceEvent pause_event(this, ServiceEvent::kNone);
+ jsobj.AddProperty("pauseEvent", &pause_event);
+ }
} else if (message_handler()->is_paused_on_exit() &&
((debugger() == NULL) || (debugger()->PauseEvent() == NULL))) {
ServiceEvent pause_event(this, ServiceEvent::kPauseExit);
« no previous file with comments | « runtime/observatory/tests/service/service.status ('k') | runtime/vm/message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698