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

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

Issue 1053053002: Tidy up the service protocol. Begin improving the documentation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 assert(scriptCoverage['script'] != null); 303 assert(scriptCoverage['script'] != null);
304 scriptCoverage['script']._processCallSites(scriptCoverage['callSites']); 304 scriptCoverage['script']._processCallSites(scriptCoverage['callSites']);
305 }); 305 });
306 } 306 }
307 307
308 Future refreshCallSiteData() { 308 Future refreshCallSiteData() {
309 Map params = {}; 309 Map params = {};
310 if (this is! Isolate) { 310 if (this is! Isolate) {
311 params['targetId'] = id; 311 params['targetId'] = id;
312 } 312 }
313 return isolate.invokeRpcNoUpgrade('getCallSiteData', params).then( 313 return isolate.invokeRpcNoUpgrade('_getCallSiteData', params).then(
314 (ObservableMap map) { 314 (ObservableMap map) {
315 var coverage = new ServiceObject._fromMap(isolate, map); 315 var coverage = new ServiceObject._fromMap(isolate, map);
316 assert(coverage.type == 'CodeCoverage'); 316 assert(coverage.type == 'CodeCoverage');
317 var coverageList = coverage['coverage']; 317 var coverageList = coverage['coverage'];
318 assert(coverageList != null); 318 assert(coverageList != null);
319 processCallSiteData(coverageList); 319 processCallSiteData(coverageList);
320 return this; 320 return this;
321 }); 321 });
322 } 322 }
323 } 323 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // Note that upgrading the collection creates any isolates in the 565 // Note that upgrading the collection creates any isolates in the
566 // isolate list which are new. 566 // isolate list which are new.
567 _upgradeCollection(map, vm); 567 _upgradeCollection(map, vm);
568 568
569 _loaded = true; 569 _loaded = true;
570 version = map['version']; 570 version = map['version'];
571 targetCPU = map['targetCPU']; 571 targetCPU = map['targetCPU'];
572 architectureBits = map['architectureBits']; 572 architectureBits = map['architectureBits'];
573 var startTimeMillis = map['startTime']; 573 var startTimeMillis = map['startTime'];
574 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis); 574 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis);
575 var refreshTimeMillis = map['refreshTime']; 575 refreshTime = new DateTime.now();
576 refreshTime = new DateTime.fromMillisecondsSinceEpoch(refreshTimeMillis);
577 notifyPropertyChange(#upTime, 0, 1); 576 notifyPropertyChange(#upTime, 0, 1);
578 assertsEnabled = map['assertsEnabled'];
579 pid = map['pid']; 577 pid = map['pid'];
580 typeChecksEnabled = map['typeChecksEnabled']; 578 assertsEnabled = map['_assertsEnabled'];
579 typeChecksEnabled = map['_typeChecksEnabled'];
581 _removeDeadIsolates(map['isolates']); 580 _removeDeadIsolates(map['isolates']);
582 } 581 }
583 582
584 // Reload all isolates. 583 // Reload all isolates.
585 Future reloadIsolates() { 584 Future reloadIsolates() {
586 var reloads = []; 585 var reloads = [];
587 for (var isolate in isolates) { 586 for (var isolate in isolates) {
588 var reload = isolate.reload().catchError((e) { 587 var reload = isolate.reload().catchError((e) {
589 Logger.root.info('Bulk reloading of isolates failed: $e'); 588 Logger.root.info('Bulk reloading of isolates failed: $e');
590 }); 589 });
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 final Allocations newSpace = new Allocations(); 1624 final Allocations newSpace = new Allocations();
1626 final Allocations oldSpace = new Allocations(); 1625 final Allocations oldSpace = new Allocations();
1627 final AllocationCount promotedByLastNewGC = new AllocationCount(); 1626 final AllocationCount promotedByLastNewGC = new AllocationCount();
1628 1627
1629 bool get hasNoAllocations => newSpace.empty && oldSpace.empty; 1628 bool get hasNoAllocations => newSpace.empty && oldSpace.empty;
1630 1629
1631 @reflectable final fields = new ObservableList<Field>(); 1630 @reflectable final fields = new ObservableList<Field>();
1632 @reflectable final functions = new ObservableList<ServiceFunction>(); 1631 @reflectable final functions = new ObservableList<ServiceFunction>();
1633 1632
1634 @observable Class superclass; 1633 @observable Class superclass;
1635 @reflectable final interfaces = new ObservableList<Class>(); 1634 @reflectable final interfaces = new ObservableList<Instance>();
1636 @reflectable final subclasses = new ObservableList<Class>(); 1635 @reflectable final subclasses = new ObservableList<Class>();
1637 1636
1638 bool get canCache => true; 1637 bool get canCache => true;
1639 bool get immutable => false; 1638 bool get immutable => false;
1640 1639
1641 Class._empty(ServiceObjectOwner owner) : super._empty(owner); 1640 Class._empty(ServiceObjectOwner owner) : super._empty(owner);
1642 1641
1643 void _update(ObservableMap map, bool mapIsRef) { 1642 void _update(ObservableMap map, bool mapIsRef) {
1644 name = map['name']; 1643 name = map['name'];
1645 vmName = (map.containsKey('vmName') ? map['vmName'] : name); 1644 vmName = (map.containsKey('vmName') ? map['vmName'] : name);
(...skipping 26 matching lines...) Expand all
1672 isPatch = map['patch']; 1671 isPatch = map['patch'];
1673 isImplemented = map['implemented']; 1672 isImplemented = map['implemented'];
1674 1673
1675 tokenPos = map['tokenPos']; 1674 tokenPos = map['tokenPos'];
1676 endTokenPos = map['endTokenPos']; 1675 endTokenPos = map['endTokenPos'];
1677 1676
1678 subclasses.clear(); 1677 subclasses.clear();
1679 subclasses.addAll(map['subclasses']); 1678 subclasses.addAll(map['subclasses']);
1680 subclasses.sort(ServiceObject.LexicalSortName); 1679 subclasses.sort(ServiceObject.LexicalSortName);
1681 1680
1681 interfaces.clear();
1682 interfaces.addAll(map['interfaces']);
1683 interfaces.sort(ServiceObject.LexicalSortName);
1684
1682 fields.clear(); 1685 fields.clear();
1683 fields.addAll(map['fields']); 1686 fields.addAll(map['fields']);
1684 fields.sort(ServiceObject.LexicalSortName); 1687 fields.sort(ServiceObject.LexicalSortName);
1685 1688
1686 functions.clear(); 1689 functions.clear();
1687 functions.addAll(map['functions']); 1690 functions.addAll(map['functions']);
1688 functions.sort(ServiceObject.LexicalSortName); 1691 functions.sort(ServiceObject.LexicalSortName);
1689 1692
1690 superclass = map['super']; 1693 superclass = map['super'];
1691 // Work-around Object not tracking its subclasses in the VM. 1694 // Work-around Object not tracking its subclasses in the VM.
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2930 var v = list[i]; 2933 var v = list[i];
2931 if ((v is ObservableMap) && _isServiceMap(v)) { 2934 if ((v is ObservableMap) && _isServiceMap(v)) {
2932 list[i] = owner.getFromMap(v); 2935 list[i] = owner.getFromMap(v);
2933 } else if (v is ObservableList) { 2936 } else if (v is ObservableList) {
2934 _upgradeObservableList(v, owner); 2937 _upgradeObservableList(v, owner);
2935 } else if (v is ObservableMap) { 2938 } else if (v is ObservableMap) {
2936 _upgradeObservableMap(v, owner); 2939 _upgradeObservableMap(v, owner);
2937 } 2940 }
2938 } 2941 }
2939 } 2942 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/class_view.html ('k') | runtime/observatory/test/call_site_data_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698