Chromium Code Reviews| Index: runtime/vm/service.cc |
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
| index 35178e3007804bff98da41b2dd03cb6f1f71fb42..7cd35e53fa49b229dfdb5057121ed10dbc59539b 100644 |
| --- a/runtime/vm/service.cc |
| +++ b/runtime/vm/service.cc |
| @@ -14,6 +14,7 @@ |
| #include "vm/debugger.h" |
| #include "vm/isolate.h" |
| #include "vm/message.h" |
| +#include "vm/message_handler.h" |
| #include "vm/native_entry.h" |
| #include "vm/native_arguments.h" |
| #include "vm/object.h" |
| @@ -263,6 +264,8 @@ Isolate* Service::GetServiceIsolate(void* callback_data) { |
| if (isolate == NULL) { |
| return NULL; |
| } |
|
turnidge
2014/03/18 21:45:37
Add comment here.
Cutch
2014/03/18 23:32:33
Done.
|
| + isolate->message_handler()->set_wedge_on_start(false); |
| + isolate->message_handler()->set_wedge_on_exit(false); |
| Isolate::SetCurrent(isolate); |
| { |
| // Install the dart:vmservice library. |
| @@ -366,6 +369,11 @@ bool Service::SendIsolateStartupMessage() { |
| MessageWriter writer(&data, &allocator); |
| writer.WriteMessage(list); |
| intptr_t len = writer.BytesWritten(); |
| + if (FLAG_trace_service) { |
| + OS::Print("Isolate %s %" Pd64 " registered with service \n", |
| + name.ToCString(), |
| + Dart_GetMainPortId()); |
| + } |
| return PortMap::PostMessage( |
| new Message(port_, data, len, Message::kNormalPriority)); |
| } |
| @@ -378,15 +386,22 @@ bool Service::SendIsolateShutdownMessage() { |
| Isolate* isolate = Isolate::Current(); |
| ASSERT(isolate != NULL); |
| HANDLESCOPE(isolate); |
| + const String& name = String::Handle(String::New(isolate->name())); |
| + ASSERT(!name.IsNull()); |
| const Array& list = Array::Handle( |
| MakeServiceControlMessage(Dart_GetMainPortId(), |
| VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID, |
| - String::Handle(String::null()))); |
| + name)); |
| ASSERT(!list.IsNull()); |
| uint8_t* data = NULL; |
| MessageWriter writer(&data, &allocator); |
| writer.WriteMessage(list); |
| intptr_t len = writer.BytesWritten(); |
| + if (FLAG_trace_service) { |
| + OS::Print("Isolate %s %" Pd64 " deregistered with service \n", |
| + name.ToCString(), |
| + Dart_GetMainPortId()); |
| + } |
| return PortMap::PostMessage( |
| new Message(port_, data, len, Message::kNormalPriority)); |
| } |
| @@ -1416,7 +1431,14 @@ static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { |
| static bool HandleUnpin(Isolate* isolate, JSONStream* js) { |
|
turnidge
2014/03/18 21:45:37
Can we call this resume instead of unpin? That wa
Cutch
2014/03/18 23:32:33
Done.
|
| // TODO(johnmccutchan): What do I respond with?? |
| - isolate->ClosePinPort(); |
| + if (isolate->message_handler()->wedge_on_start()) { |
| + isolate->message_handler()->set_wedge_on_start(false); |
| + return true; |
| + } |
| + if (isolate->message_handler()->wedge_on_exit()) { |
| + isolate->message_handler()->set_wedge_on_exit(false); |
| + return true; |
| + } |
| return true; |
| } |