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

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

Issue 205713004: Add isolate tag-profile and better handling of errors (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/service/message.dart ('k') | runtime/vm/tags.h » ('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 7f6b045cb40277888f88511bf952ee4c04e1a016..8c7bc81abfcf7090f669af1134f922d0315d2433 100644
--- a/runtime/vm/service/running_isolates.dart
+++ b/runtime/vm/service/running_isolates.dart
@@ -6,15 +6,22 @@ part of vmservice;
class RunningIsolates implements MessageRouter {
final Map<int, RunningIsolate> isolates = new Map<int, RunningIsolate>();
+ int _rootPortId;
RunningIsolates();
void isolateStartup(int portId, SendPort sp, String name) {
+ if (_rootPortId == null) {
+ _rootPortId = portId;
+ }
var ri = new RunningIsolate(portId, sp, name);
isolates[portId] = ri;
}
void isolateShutdown(int portId, SendPort sp) {
+ if (_rootPortId == portId) {
+ _rootPortId = null;
+ }
isolates.remove(portId);
}
@@ -32,12 +39,17 @@ class RunningIsolates implements MessageRouter {
return message.response;
}
var isolateId;
- try {
- isolateId = int.parse(message.path[1]);
- } catch (e) {
- message.setErrorResponse('Could not parse isolate id: $e');
- return message.response;
+ if ((message.path[1] == 'root') && (_rootPortId != null)) {
+ isolateId = _rootPortId;
+ } else {
+ try {
+ isolateId = int.parse(message.path[1]);
+ } catch (e) {
+ message.setErrorResponse('Could not parse isolate id: $e');
+ return message.response;
+ }
}
+ assert(isolateId != null);
var isolate = isolates[isolateId];
if (isolate == null) {
message.setErrorResponse('Cannot find isolate id: $isolateId');
« no previous file with comments | « runtime/vm/service/message.dart ('k') | runtime/vm/tags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698