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

Unified Diff: runtime/observatory/bin/shell.dart

Issue 897193002: Finish moving service protocol to json rpc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 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
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/observatory/lib/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/bin/shell.dart
diff --git a/runtime/observatory/bin/shell.dart b/runtime/observatory/bin/shell.dart
index ef2459c453187fec93bae91a88494450d049a374..1a1f13c880894da79df568ded1d332d771025694 100644
--- a/runtime/observatory/bin/shell.dart
+++ b/runtime/observatory/bin/shell.dart
@@ -11,16 +11,18 @@ import 'dart:io';
// Simple demo for service_io library. Connects to localhost on the default
// port, picks the first isolate, reads requests from stdin, and prints
// results to stdout. Example session:
-// <<< prefix /isolates/1071334835
+// <<< isolate isolates/1071334835
// >>> /classes/40
// <<< {"type":"Class","id":"classes\/40","name":"num","user_name":"num",...
// >>> /objects/0
// >>> {"type":"Array","class":{"type":"@Class","id":"classes\/62",...
-void repl(VM vm, String prefix, String lastResult) {
+void repl(VM vm, Isolate isolate, String lastResult) {
print(lastResult);
- // TODO(turnidge): use the non-deprecated api here.
- vm.getStringDeprecated(prefix + stdin.readLineSync()).then((String result) {
+ Map params = {
+ 'objectId': stdin.readLineSync(),
+ };
+ isolate.invokeRpc('getObject', params).then((String result) {
repl(vm, prefix, result);
});
}
@@ -29,7 +31,6 @@ void main() {
String addr = 'ws://localhost:8181/ws';
new WebSocketVM(new WebSocketVMTarget(addr)).load().then((VM vm) {
Isolate isolate = vm.isolates.first;
- String prefix = '${isolate.link}';
- repl(vm, prefix, 'prefix $prefix');
+ repl(vm, isolate, 'isolate ${isolate.id}');
});
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/observatory/lib/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698