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

Unified Diff: runtime/bin/vmservice/running_isolates.dart

Issue 19870006: Support stacktrace and objecthistogram service commands (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/bin/vmservice/running_isolate.dart ('k') | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/running_isolates.dart
diff --git a/runtime/bin/vmservice/running_isolates.dart b/runtime/bin/vmservice/running_isolates.dart
index 7e81f7c1bfd1d42123ecf09050f2656b0bd4c4ff..57e56fb7fe170584c6604165b172471093c954ad 100644
--- a/runtime/bin/vmservice/running_isolates.dart
+++ b/runtime/bin/vmservice/running_isolates.dart
@@ -15,7 +15,7 @@ class RunningIsolates implements ServiceRequestRouter {
}
var ri = new RunningIsolate(sp);
isolates[sp.hashCode] = ri;
- ri.sendIdRequest();
+ ri._sendNameRequest();
}
void isolateShutdown(SendPort sp) {
@@ -31,7 +31,7 @@ class RunningIsolates implements ServiceRequestRouter {
isolates.forEach((sp, ri) {
members.add({
'id': sp,
- 'name': ri.id
+ 'name': ri.name
});
});
result['type'] = 'IsolateList';
@@ -39,32 +39,37 @@ class RunningIsolates implements ServiceRequestRouter {
request.setResponse(JSON.stringify(result));
}
- bool route(ServiceRequest request) {
+ Future route(ServiceRequest request) {
if (request.pathSegments.length == 0) {
- return false;
+ return null;
}
if (request.pathSegments[0] != 'isolates') {
- return false;
+ return null;
}
if (request.pathSegments.length == 1) {
// Requesting list of running isolates.
_isolateCollectionRequest(request);
- return true;
+ return new Future.value(request);
}
var isolateId;
try {
isolateId = int.parse(request.pathSegments[1]);
} catch (e) {
request.setErrorResponse('Could not parse isolate id: $e');
- return true;
+ return new Future.value(request);
}
var isolate = isolates[isolateId];
if (isolate == null) {
request.setErrorResponse('Cannot find isolate id: $isolateId');
- return true;
+ return new Future.value(request);
}
// Consume '/isolates/isolateId'
request.pathSegments.removeRange(0, 2);
+ if (request.pathSegments.length == 0) {
+ // The request is now empty.
+ request.setErrorResponse('No request for isolate: /isolates/$isolateId');
+ return new Future.value(request);
+ }
return isolate.route(request);
}
}
« no previous file with comments | « runtime/bin/vmservice/running_isolate.dart ('k') | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698