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

Side by Side Diff: runtime/vm/service/running_isolates.dart

Issue 922163005: Fix HTTP support in vm-service (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of vmservice; 5 part of vmservice;
6 6
7 class RunningIsolates implements MessageRouter { 7 class RunningIsolates implements MessageRouter {
8 final Map<int, RunningIsolate> isolates = new Map<int, RunningIsolate>(); 8 final Map<int, RunningIsolate> isolates = new Map<int, RunningIsolate>();
9 int _rootPortId; 9 int _rootPortId;
10 10
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 Future<String> route(Message message) { 28 Future<String> route(Message message) {
29 String isolateParam = message.params['isolateId']; 29 String isolateParam = message.params['isolateId'];
30 int isolateId; 30 int isolateId;
31 if (!isolateParam.startsWith('isolates/')) { 31 if (!isolateParam.startsWith('isolates/')) {
32 message.setErrorResponse('Malformed isolate id $isolateParam'); 32 message.setErrorResponse('Malformed isolate id $isolateParam');
33 return message.response; 33 return message.response;
34 } 34 }
35 isolateParam = isolateParam.substring('isolates/'.length); 35 isolateParam = isolateParam.substring('isolates/'.length);
36 if (isolateParam == 'isolates/root') { 36 if (isolateParam == 'root') {
37 isolateId = _rootPortId; 37 isolateId = _rootPortId;
38 } else { 38 } else {
39 try { 39 try {
40 isolateId = int.parse(isolateParam); 40 isolateId = int.parse(isolateParam);
41 } catch (e) { 41 } catch (e) {
42 message.setErrorResponse('Could not parse isolate id: $e'); 42 message.setErrorResponse('Could not parse isolate id: $e');
43 return message.response; 43 return message.response;
44 } 44 }
45 } 45 }
46 var isolate = isolates[isolateId]; 46 var isolate = isolates[isolateId];
47 if (isolate == null) { 47 if (isolate == null) {
48 message.setErrorResponse('Cannot find isolate id: $isolateId'); 48 message.setErrorResponse('Cannot find isolate id: $isolateId');
49 return message.response; 49 return message.response;
50 } 50 }
51 return isolate.route(message); 51 return isolate.route(message);
52 } 52 }
53 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698