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

Unified Diff: runtime/vm/service/running_isolates.dart

Issue 823403004: Begin migrating the vm service from a rest-style interface to a json-rpc style interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove old-style standalone tests. Created 5 years, 11 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/vm/service/protocol.md ('k') | runtime/vm/service/service.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/running_isolates.dart
diff --git a/runtime/vm/service/running_isolates.dart b/runtime/vm/service/running_isolates.dart
index 8c7bc81abfcf7090f669af1134f922d0315d2433..124eb90086ec4d66061b5dba22e1f8ebc06f45cc 100644
--- a/runtime/vm/service/running_isolates.dart
+++ b/runtime/vm/service/running_isolates.dart
@@ -26,6 +26,36 @@ class RunningIsolates implements MessageRouter {
}
Future<String> route(Message message) {
+ if (message.isOld) {
+ return routeOld(message);
+ }
+
+ String isolateParam = message.params['isolate'];
+ int isolateId;
+ if (!isolateParam.startsWith('isolates/')) {
+ message.setErrorResponse('Malformed isolate id $isolateParam');
+ return message.response;
+ }
+ isolateParam = isolateParam.substring('isolates/'.length);
+ if (isolateParam == 'isolates/root') {
+ isolateId = _rootPortId;
+ } else {
+ try {
+ isolateId = int.parse(isolateParam);
+ } catch (e) {
+ message.setErrorResponse('Could not parse isolate id: $e');
+ return message.response;
+ }
+ }
+ var isolate = isolates[isolateId];
+ if (isolate == null) {
+ message.setErrorResponse('Cannot find isolate id: $isolateId');
+ return message.response;
+ }
+ return isolate.route(message);
+ }
+
+ Future<String> routeOld(Message message) {
if (message.path.length == 0) {
message.setErrorResponse('No path.');
return message.response;
« no previous file with comments | « runtime/vm/service/protocol.md ('k') | runtime/vm/service/service.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698