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

Side by Side Diff: runtime/observatory/lib/src/service/object.dart

Issue 1090293003: Kill service_test.cc tests in favor of dart tests for the service protocol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix tests Created 5 years, 8 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
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] represents a persistent object within the vm. 7 /// A [ServiceObject] represents a persistent object within the vm.
8 abstract class ServiceObject extends Observable { 8 abstract class ServiceObject extends Observable {
9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { 9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) {
10 return o1.name.compareTo(o2.name); 10 return o1.name.compareTo(o2.name);
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 'frame': framePos, 1175 'frame': framePos,
1176 'expression': expression, 1176 'expression': expression,
1177 }; 1177 };
1178 return invokeRpc('evalFrame', params); 1178 return invokeRpc('evalFrame', params);
1179 } 1179 }
1180 1180
1181 Future<ServiceObject> getRetainedSize(ServiceObject target) { 1181 Future<ServiceObject> getRetainedSize(ServiceObject target) {
1182 Map params = { 1182 Map params = {
1183 'targetId': target.id, 1183 'targetId': target.id,
1184 }; 1184 };
1185 return invokeRpc('getRetainedSize', params); 1185 return invokeRpc('_getRetainedSize', params);
1186 } 1186 }
1187 1187
1188 Future<ServiceObject> getRetainingPath(ServiceObject target, var limit) { 1188 Future<ServiceObject> getRetainingPath(ServiceObject target, var limit) {
1189 Map params = { 1189 Map params = {
1190 'targetId': target.id, 1190 'targetId': target.id,
1191 'limit': limit.toString(), 1191 'limit': limit.toString(),
1192 }; 1192 };
1193 return invokeRpc('getRetainingPath', params); 1193 return invokeRpc('_getRetainingPath', params);
1194 } 1194 }
1195 1195
1196 Future<ServiceObject> getInboundReferences(ServiceObject target, var limit) { 1196 Future<ServiceObject> getInboundReferences(ServiceObject target, var limit) {
1197 Map params = { 1197 Map params = {
1198 'targetId': target.id, 1198 'targetId': target.id,
1199 'limit': limit.toString(), 1199 'limit': limit.toString(),
1200 }; 1200 };
1201 return invokeRpc('getInboundReferences', params); 1201 return invokeRpc('_getInboundReferences', params);
1202 } 1202 }
1203 1203
1204 Future<ServiceObject> getTypeArgumentsList(bool onlyWithInstantiations) { 1204 Future<ServiceObject> getTypeArgumentsList(bool onlyWithInstantiations) {
1205 Map params = { 1205 Map params = {
1206 'onlyWithInstantiations': onlyWithInstantiations, 1206 'onlyWithInstantiations': onlyWithInstantiations,
1207 }; 1207 };
1208 return invokeRpc('getTypeArgumentsList', params); 1208 return invokeRpc('getTypeArgumentsList', params);
1209 } 1209 }
1210 1210
1211 Future<ServiceObject> getInstances(Class cls, var limit) { 1211 Future<ServiceObject> getInstances(Class cls, var limit) {
1212 Map params = { 1212 Map params = {
1213 'classId': cls.id, 1213 'classId': cls.id,
1214 'limit': limit.toString(), 1214 'limit': limit.toString(),
1215 }; 1215 };
1216 return invokeRpc('getInstances', params); 1216 return invokeRpc('_getInstances', params);
1217 } 1217 }
1218 1218
1219 Future<ServiceObject> getObjectByAddress(String address, [bool ref=true]) { 1219 Future<ServiceObject> getObjectByAddress(String address, [bool ref=true]) {
1220 Map params = { 1220 Map params = {
1221 'address': address, 1221 'address': address,
1222 'ref': ref, 1222 'ref': ref,
1223 }; 1223 };
1224 return invokeRpc('getObjectByAddress', params); 1224 return invokeRpc('getObjectByAddress', params);
1225 } 1225 }
1226 1226
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 // TODO(turnidge): Currently _map.clear() prevents us from 1288 // TODO(turnidge): Currently _map.clear() prevents us from
1289 // upgrading an already upgraded submap. Is clearing really the 1289 // upgrading an already upgraded submap. Is clearing really the
1290 // right thing to do here? 1290 // right thing to do here?
1291 _map.clear(); 1291 _map.clear();
1292 _map.addAll(map); 1292 _map.addAll(map);
1293 1293
1294 name = _map['name']; 1294 name = _map['name'];
1295 vmName = (_map.containsKey('vmName') ? _map['vmName'] : name); 1295 vmName = (_map.containsKey('vmName') ? _map['vmName'] : name);
1296 } 1296 }
1297 1297
1298 // TODO(turnidge): These are temporary until we have a proper root
1299 // object for all dart heap objects.
1300 int get size => _map['size'];
1301 int get clazz => _map['class'];
1302
1298 // Forward Map interface calls. 1303 // Forward Map interface calls.
1299 void addAll(Map other) => _map.addAll(other); 1304 void addAll(Map other) => _map.addAll(other);
1300 void clear() => _map.clear(); 1305 void clear() => _map.clear();
1301 bool containsValue(v) => _map.containsValue(v); 1306 bool containsValue(v) => _map.containsValue(v);
1302 bool containsKey(k) => _map.containsKey(k); 1307 bool containsKey(k) => _map.containsKey(k);
1303 void forEach(Function f) => _map.forEach(f); 1308 void forEach(Function f) => _map.forEach(f);
1304 putIfAbsent(key, Function ifAbsent) => _map.putIfAbsent(key, ifAbsent); 1309 putIfAbsent(key, Function ifAbsent) => _map.putIfAbsent(key, ifAbsent);
1305 void remove(key) => _map.remove(key); 1310 void remove(key) => _map.remove(key);
1306 operator [](k) => _map[k]; 1311 operator [](k) => _map[k];
1307 operator []=(k, v) => _map[k] = v; 1312 operator []=(k, v) => _map[k] = v;
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 var v = list[i]; 2945 var v = list[i];
2941 if ((v is ObservableMap) && _isServiceMap(v)) { 2946 if ((v is ObservableMap) && _isServiceMap(v)) {
2942 list[i] = owner.getFromMap(v); 2947 list[i] = owner.getFromMap(v);
2943 } else if (v is ObservableList) { 2948 } else if (v is ObservableList) {
2944 _upgradeObservableList(v, owner); 2949 _upgradeObservableList(v, owner);
2945 } else if (v is ObservableMap) { 2950 } else if (v is ObservableMap) {
2946 _upgradeObservableMap(v, owner); 2951 _upgradeObservableMap(v, owner);
2947 } 2952 }
2948 } 2953 }
2949 } 2954 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/object_view.dart ('k') | runtime/observatory/tests/service/allocations_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698