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

Unified Diff: runtime/vm/service.cc

Issue 163903002: Prototype of I/O statistics for Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« runtime/bin/socket_patch.dart ('K') | « runtime/bin/socket_win.cc ('k') | no next file » | 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 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 },
};
« runtime/bin/socket_patch.dart ('K') | « runtime/bin/socket_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698