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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/service/object.dart

Issue 346763007: Fix code coverage (again!) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 service; 5 part of service;
6 6
7 /// A [ServiceObject] is an object known to the VM service and is tied 7 /// A [ServiceObject] is an object known to the VM service and is tied
8 /// to an owning [Isolate]. 8 /// to an owning [Isolate].
9 abstract class ServiceObject extends Observable { 9 abstract class ServiceObject extends Observable {
10 /// The owner of this [ServiceObject]. This can be an [Isolate], a 10 /// The owner of this [ServiceObject]. This can be an [Isolate], a
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 fields.addAll(map['fields']); 1102 fields.addAll(map['fields']);
1103 1103
1104 functions.clear(); 1104 functions.clear();
1105 functions.addAll(map['functions']); 1105 functions.addAll(map['functions']);
1106 1106
1107 superClass = map['super']; 1107 superClass = map['super'];
1108 if (superClass != null) { 1108 if (superClass != null) {
1109 superClass._addToChildren(this); 1109 superClass._addToChildren(this);
1110 } 1110 }
1111 error = map['error']; 1111 error = map['error'];
1112 1112
1113 var allocationStats = map['allocationStats']; 1113 var allocationStats = map['allocationStats'];
1114 if (allocationStats != null) { 1114 if (allocationStats != null) {
1115 newSpace.update(allocationStats['new']); 1115 newSpace.update(allocationStats['new']);
1116 oldSpace.update(allocationStats['old']); 1116 oldSpace.update(allocationStats['old']);
1117 } 1117 }
1118 } 1118 }
1119 1119
1120 void _addToChildren(Class cls) { 1120 void _addToChildren(Class cls) {
1121 if (children.contains(cls)) { 1121 if (children.contains(cls)) {
1122 return; 1122 return;
1123 } 1123 }
1124 children.add(cls); 1124 children.add(cls);
1125 } 1125 }
1126 1126
1127 Future<ServiceObject> get(String command) { 1127 Future<ServiceObject> get(String command) {
1128 return isolate.get(id + "/$command"); 1128 return isolate.get(id + "/$command");
1129 } 1129 }
1130 } 1130 }
1131 1131
1132 class ScriptLine extends Observable { 1132 class ScriptLine extends Observable {
1133 final int line; 1133 final int line;
1134 final String text; 1134 final String text;
1135 @observable int hits; 1135 @observable int hits;
1136 ScriptLine(this.line, this.text); 1136 ScriptLine(this.line, this.text);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 lastTokenPos : tokenOffset; 1200 lastTokenPos : tokenOffset;
1201 } 1201 }
1202 _tokenToLine[tokenOffset] = lineNumber; 1202 _tokenToLine[tokenOffset] = lineNumber;
1203 _tokenToCol[tokenOffset] = colNumber; 1203 _tokenToCol[tokenOffset] = colNumber;
1204 } 1204 }
1205 } 1205 }
1206 } 1206 }
1207 1207
1208 void _processHits(List scriptHits) { 1208 void _processHits(List scriptHits) {
1209 // Update hits table. 1209 // Update hits table.
1210 _hits.clear();
1211 for (var i = 0; i < scriptHits.length; i += 2) { 1210 for (var i = 0; i < scriptHits.length; i += 2) {
1212 var line = scriptHits[i]; 1211 var line = scriptHits[i];
1213 var hit = scriptHits[i + 1]; // hit status. 1212 var hit = scriptHits[i + 1]; // hit status.
1214 assert(line >= 1); // Lines start at 1. 1213 assert(line >= 1); // Lines start at 1.
1214 var oldHits = _hits[line];
1215 if (oldHits != null) {
1216 hit += oldHits;
1217 }
1215 _hits[line] = hit; 1218 _hits[line] = hit;
1216 } 1219 }
1217 _applyHitsToLines(); 1220 _applyHitsToLines();
1218 } 1221 }
1219 1222
1220 void _processSource(String source) { 1223 void _processSource(String source) {
1221 // Preemptyively mark that this is not loaded. 1224 // Preemptyively mark that this is not loaded.
1222 _loaded = false; 1225 _loaded = false;
1223 if (source == null) { 1226 if (source == null) {
1224 return; 1227 return;
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 var v = list[i]; 1827 var v = list[i];
1825 if ((v is ObservableMap) && _isServiceMap(v)) { 1828 if ((v is ObservableMap) && _isServiceMap(v)) {
1826 list[i] = owner.getFromMap(v); 1829 list[i] = owner.getFromMap(v);
1827 } else if (v is ObservableList) { 1830 } else if (v is ObservableList) {
1828 _upgradeObservableList(v, owner); 1831 _upgradeObservableList(v, owner);
1829 } else if (v is ObservableMap) { 1832 } else if (v is ObservableMap) {
1830 _upgradeObservableMap(v, owner); 1833 _upgradeObservableMap(v, owner);
1831 } 1834 }
1832 } 1835 }
1833 } 1836 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698