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

Side by Side Diff: dart/runtime/bin/vmservice/running_isolates.dart

Issue 119673004: Version 1.1.0-dev.5.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 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 9
10 RunningIsolates(); 10 RunningIsolates();
(...skipping 11 matching lines...) Expand all
22 throw new StateError('Unknown isolate.'); 22 throw new StateError('Unknown isolate.');
23 } 23 }
24 isolates.remove(portId); 24 isolates.remove(portId);
25 } 25 }
26 26
27 void _isolateCollectionRequest(Message message) { 27 void _isolateCollectionRequest(Message message) {
28 var members = []; 28 var members = [];
29 var result = {}; 29 var result = {};
30 isolates.forEach((portId, runningIsolate) { 30 isolates.forEach((portId, runningIsolate) {
31 members.add({ 31 members.add({
32 'id': portId, 32 'type': 'Isolate',
33 'name': runningIsolate.name 33 'id': 'isolates/$portId',
34 'name': runningIsolate.name,
34 }); 35 });
35 }); 36 });
36 result['type'] = 'IsolateList'; 37 result['type'] = 'IsolateList';
37 result['members'] = members; 38 result['members'] = members;
38 message.setResponse(JSON.encode(result)); 39 message.setResponse(JSON.encode(result));
39 } 40 }
40 41
41 Future<String> route(Message message) { 42 Future<String> route(Message message) {
42 if (message.path.length == 0) { 43 if (message.path.length == 0) {
43 message.setErrorResponse('No path.'); 44 message.setErrorResponse('No path.');
(...skipping 23 matching lines...) Expand all
67 // Consume '/isolates/isolateId' 68 // Consume '/isolates/isolateId'
68 message.path.removeRange(0, 2); 69 message.path.removeRange(0, 2);
69 if (message.path.length == 0) { 70 if (message.path.length == 0) {
70 // The message now has an empty path. 71 // The message now has an empty path.
71 message.setErrorResponse('Empty path for isolate: /isolates/$isolateId'); 72 message.setErrorResponse('Empty path for isolate: /isolates/$isolateId');
72 return message.response; 73 return message.response;
73 } 74 }
74 return isolate.route(message); 75 return isolate.route(message);
75 } 76 }
76 } 77 }
OLDNEW
« no previous file with comments | « dart/runtime/bin/vmservice/client/pubspec.yaml ('k') | dart/runtime/bin/vmservice/vmservice_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698