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

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

Issue 1387043002: Make dart:_vmservice a proper builtin library (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/running_isolate.dart ('k') | runtime/vm/service/vmservice.dart » ('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
deleted file mode 100644
index b10128c3b1d8791f040bc904fc39412c423d5191..0000000000000000000000000000000000000000
--- a/runtime/vm/service/running_isolates.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-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);
- }
-
- Future<String> route(Message message) {
- String isolateParam = message.params['isolateId'];
- int isolateId;
- if (!isolateParam.startsWith('isolates/')) {
- message.setErrorResponse(
- kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
- return message.response;
- }
- isolateParam = isolateParam.substring('isolates/'.length);
- if (isolateParam == 'root') {
- isolateId = _rootPortId;
- } else {
- try {
- isolateId = int.parse(isolateParam);
- } catch (e) {
- message.setErrorResponse(
- kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
- return message.response;
- }
- }
- var isolate = isolates[isolateId];
- if (isolate == null) {
- // There is some chance that this isolate may have lived before,
- // so return a sentinel rather than an error.
- var result = {
- 'type' : 'Sentinel',
- 'kind' : 'Collected',
- 'valueAsString' : '<collected>',
- };
- message.setResponse(encodeResult(message, result));
- return message.response;
- }
- return isolate.route(message);
- }
-}
« no previous file with comments | « runtime/vm/service/running_isolate.dart ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698