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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory/isolate.dart

Issue 184233007: Refactor Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
Index: runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
diff --git a/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart b/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
deleted file mode 100644
index 0135c4b6ef0701bf72d8c874b5fe42d319fe3ccd..0000000000000000000000000000000000000000
--- a/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
+++ /dev/null
@@ -1,125 +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 observatory;
-
-
-/// State for a running isolate.
-class Isolate extends Observable {
- static ObservatoryApplication _application;
-
- @observable Profile profile;
- @observable final Map<String, Script> scripts =
- toObservable(new Map<String, Script>());
- @observable final List<Code> codes = new List<Code>();
- @observable String id;
- @observable String name;
- @observable String vmName;
- @observable Map entry;
- @observable String rootLib;
- @observable final Map<String, double> timers =
- toObservable(new Map<String, double>());
-
- @observable int newHeapUsed = 0;
- @observable int oldHeapUsed = 0;
-
- @observable Map topFrame = null;
- @observable String fileAndLine = null;
-
- Isolate.fromId(this.id) : name = 'isolate' {}
-
- Isolate.fromMap(Map map)
- : id = map['id'], name = map['name'] {
- }
-
- Future refresh() {
- var request = '/$id/';
- return _application.requestManager.requestMap(request).then((map) {
- update(map);
- }).catchError((e, trace) {
- Logger.root.severe('Error while updating isolate summary: $e\n$trace');
- });
- }
-
- void update(Map map) {
- if (map['type'] != 'Isolate') {
- Logger.root.severe('Unexpected message type in Isolate.update: ${map["type"]}');
- return;
- }
- if (map['rootLib'] == null ||
- map['timers'] == null ||
- map['heap'] == null) {
- Logger.root.severe("Malformed 'Isolate' response: $map");
- return;
- }
- rootLib = map['rootLib']['id'];
- vmName = map['name'];
- if (map['entry'] != null) {
- entry = map['entry'];
- name = entry['name'];
- } else {
- // fred
- name = 'root isolate';
- }
- if (map['topFrame'] != null) {
- topFrame = map['topFrame'];
- }
-
- var timerMap = {};
- map['timers'].forEach((timer) {
- timerMap[timer['name']] = timer['time'];
- });
- timers['total'] = timerMap['time_total_runtime'];
- timers['compile'] = timerMap['time_compilation'];
- timers['gc'] = 0.0; // TODO(turnidge): Export this from VM.
- timers['init'] = (timerMap['time_script_loading'] +
- timerMap['time_creating_snapshot'] +
- timerMap['time_isolate_initialization'] +
- timerMap['time_bootstrap']);
- timers['dart'] = timerMap['time_dart_execution'];
-
- newHeapUsed = map['heap']['usedNew'];
- oldHeapUsed = map['heap']['usedOld'];
- }
-
- String toString() => '$id';
-
- Code findCodeByAddress(int address) {
- for (var i = 0; i < codes.length; i++) {
- if (codes[i].contains(address)) {
- return codes[i];
- }
- }
- return null;
- }
-
- Code findCodeByName(String name) {
- for (var i = 0; i < codes.length; i++) {
- if (codes[i].name == name) {
- return codes[i];
- }
- }
- return null;
- }
-
- void resetCodeTicks() {
- Logger.root.info('Reset all code ticks.');
- for (var i = 0; i < codes.length; i++) {
- codes[i].resetTicks();
- }
- }
-
- void updateCoverage(List coverages) {
- for (var coverage in coverages) {
- var id = coverage['script']['id'];
- var script = scripts[id];
- if (script == null) {
- script = new Script.fromMap(coverage['script']);
- scripts[id] = script;
- }
- assert(script != null);
- script._processCoverageHits(coverage['hits']);
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698