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

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

Issue 434763002: Add VMService GC events (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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] 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 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 263 }
264 if (map['type'] != 'ServiceEvent') { 264 if (map['type'] != 'ServiceEvent') {
265 Logger.root.severe( 265 Logger.root.severe(
266 "Expected 'ServiceEvent' but found '${map['type']}'"); 266 "Expected 'ServiceEvent' but found '${map['type']}'");
267 return; 267 return;
268 } 268 }
269 269
270 // Extract the owning isolate from the event itself. 270 // Extract the owning isolate from the event itself.
271 String owningIsolateId = map['isolate']['id']; 271 String owningIsolateId = map['isolate']['id'];
272 _getIsolate(owningIsolateId).then((owningIsolate) { 272 _getIsolate(owningIsolateId).then((owningIsolate) {
273 var event = new ServiceObject._fromMap(owningIsolate, map); 273 if (owningIsolate == null) {
274 events.add(event); 274 // TODO(koda): Do we care about GC events in VM isolate?
275 Logger.root.severe(
276 'Ignoring event with unknown isolate id: $owningIsolateId');
277 } else {
278 var event = new ServiceObject._fromMap(owningIsolate, map);
279 events.add(event);
280 }
275 }); 281 });
276 } 282 }
277 283
278 static final RegExp _currentIsolateMatcher = new RegExp(r'isolates/\d+'); 284 static final RegExp _currentIsolateMatcher = new RegExp(r'isolates/\d+');
279 static final RegExp _currentObjectMatcher = new RegExp(r'isolates/\d+/'); 285 static final RegExp _currentObjectMatcher = new RegExp(r'isolates/\d+/');
280 static final String _isolatesPrefix = 'isolates/'; 286 static final String _isolatesPrefix = 'isolates/';
281 287
282 String _parseObjectId(String id) { 288 String _parseObjectId(String id) {
283 Match m = _currentObjectMatcher.matchAsPrefix(id); 289 Match m = _currentObjectMatcher.matchAsPrefix(id);
284 if (m == null) { 290 if (m == null) {
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 var v = list[i]; 2239 var v = list[i];
2234 if ((v is ObservableMap) && _isServiceMap(v)) { 2240 if ((v is ObservableMap) && _isServiceMap(v)) {
2235 list[i] = owner.getFromMap(v); 2241 list[i] = owner.getFromMap(v);
2236 } else if (v is ObservableList) { 2242 } else if (v is ObservableList) {
2237 _upgradeObservableList(v, owner); 2243 _upgradeObservableList(v, owner);
2238 } else if (v is ObservableMap) { 2244 } else if (v is ObservableMap) {
2239 _upgradeObservableMap(v, owner); 2245 _upgradeObservableMap(v, owner);
2240 } 2246 }
2241 } 2247 }
2242 } 2248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698