Chromium Code Reviews| Index: runtime/vm/service.cc |
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
| index 34675b208a337037f29c6a5008048aa31c0a7c39..b1e8689efbe07ba012f6003d056407780f5a2e0e 100644 |
| --- a/runtime/vm/service.cc |
| +++ b/runtime/vm/service.cc |
| @@ -629,6 +629,24 @@ static bool HandleStackTrace(Isolate* isolate, JSONStream* js) { |
| } |
| +static bool HandleIO(Isolate* isolate, JSONStream* js) { |
| + TextBuffer* buffer = js->buffer(); |
| + Dart_Handle io_lib = |
| + Dart_LookupLibrary(Dart_NewStringFromCString("dart:io")); |
| + if (Dart_IsError(io_lib)) Dart_PropagateError(io_lib); |
| + Dart_Handle result = |
| + Dart_Invoke(io_lib, |
| + Dart_NewStringFromCString("_test"), |
| + 0, |
| + NULL); |
| + if (Dart_IsError(result)) Dart_PropagateError(result); |
|
Cutch
2014/02/13 22:42:09
This code is executing inside the users isolate, i
Søren Gjesse
2014/02/14 12:10:13
Done.
|
| + const char *json; |
| + Dart_StringToCString(result, &json); |
| + buffer->AddString(json); |
| + return true; |
| +} |
| + |
| + |
| static bool HandleObjectHistogram(Isolate* isolate, JSONStream* js) { |
| ObjectHistogram* histogram = Isolate::Current()->object_histogram(); |
| if (histogram == NULL) { |
| @@ -1105,6 +1123,7 @@ static IsolateMessageHandlerEntry isolate_handlers[] = { |
| { "profile", HandleProfile }, |
| { "scripts", HandleScripts }, |
| { "stacktrace", HandleStackTrace }, |
| + { "io", HandleIO }, |
| }; |