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

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

Issue 192443004: Complete the switch to ServiceObject (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« runtime/vm/json_stream.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 RunningIsolates(); 10 RunningIsolates();
(...skipping 11 matching lines...) Expand all
22 var members = []; 22 var members = [];
23 var result = {}; 23 var result = {};
24 isolates.forEach((portId, runningIsolate) { 24 isolates.forEach((portId, runningIsolate) {
25 members.add({ 25 members.add({
26 'type': '@Isolate', 26 'type': '@Isolate',
27 'id': 'isolates/$portId', 27 'id': 'isolates/$portId',
28 'name': '$portId', 28 'name': '$portId',
29 }); 29 });
30 }); 30 });
31 result['type'] = 'IsolateList'; 31 result['type'] = 'IsolateList';
32 result['id'] = 'isolates';
32 result['members'] = members; 33 result['members'] = members;
33 message.setResponse(JSON.encode(result)); 34 message.setResponse(JSON.encode(result));
34 } 35 }
35 36
36 Future<String> route(Message message) { 37 Future<String> route(Message message) {
37 if (message.path.length == 0) { 38 if (message.path.length == 0) {
38 message.setErrorResponse('No path.'); 39 message.setErrorResponse('No path.');
39 return message.response; 40 return message.response;
40 } 41 }
41 if (message.path[0] != 'isolates') { 42 if (message.path[0] != 'isolates') {
(...skipping 15 matching lines...) Expand all
57 var isolate = isolates[isolateId]; 58 var isolate = isolates[isolateId];
58 if (isolate == null) { 59 if (isolate == null) {
59 message.setErrorResponse('Cannot find isolate id: $isolateId'); 60 message.setErrorResponse('Cannot find isolate id: $isolateId');
60 return message.response; 61 return message.response;
61 } 62 }
62 // Consume '/isolates/isolateId' 63 // Consume '/isolates/isolateId'
63 message.path.removeRange(0, 2); 64 message.path.removeRange(0, 2);
64 return isolate.route(message); 65 return isolate.route(message);
65 } 66 }
66 } 67 }
OLDNEW
« runtime/vm/json_stream.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698