Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 828 var sampleCount = profile['samples']; | 828 var sampleCount = profile['samples']; |
| 829 for (var codeRegion in codeRegions) { | 829 for (var codeRegion in codeRegions) { |
| 830 Code code = codeRegion['code']; | 830 Code code = codeRegion['code']; |
| 831 code.updateProfileData(codeRegion, codeTable, sampleCount); | 831 code.updateProfileData(codeRegion, codeTable, sampleCount); |
| 832 } | 832 } |
| 833 } | 833 } |
| 834 | 834 |
| 835 /// Fetches and builds the class hierarchy for this isolate. Returns the | 835 /// Fetches and builds the class hierarchy for this isolate. Returns the |
| 836 /// Object class object. | 836 /// Object class object. |
| 837 Future<Class> getClassHierarchy() { | 837 Future<Class> getClassHierarchy() { |
| 838 return get('classes').then(_loadClasses).then(_buildClassHierarchy); | 838 return invokeRpc('getClassList', {}).then( |
| 839 _loadClasses).then(_buildClassHierarchy); | |
|
turnidge
2015/02/03 17:39:29
Not sure how to best indent this...
blah()
Cutch
2015/02/03 17:54:30
Done.
| |
| 839 } | 840 } |
| 840 | 841 |
| 841 /// Given the class list, loads each class. | 842 /// Given the class list, loads each class. |
| 842 Future<List<Class>> _loadClasses(ServiceMap classList) { | 843 Future<List<Class>> _loadClasses(ServiceMap classList) { |
| 843 assert(classList.type == 'ClassList'); | 844 assert(classList.type == 'ClassList'); |
| 844 var futureClasses = []; | 845 var futureClasses = []; |
| 845 for (var cls in classList['members']) { | 846 for (var cls in classList['classes']) { |
| 846 // Skip over non-class classes. | 847 // Skip over non-class classes. |
| 847 if (cls is Class) { | 848 if (cls is Class) { |
| 848 futureClasses.add(cls.load()); | 849 futureClasses.add(cls.load()); |
| 849 } | 850 } |
| 850 } | 851 } |
| 851 return Future.wait(futureClasses); | 852 return Future.wait(futureClasses); |
| 852 } | 853 } |
| 853 | 854 |
| 854 /// Builds the class hierarchy and returns the Object class. | 855 /// Builds the class hierarchy and returns the Object class. |
| 855 Future<Class> _buildClassHierarchy(List<Class> classes) { | 856 Future<Class> _buildClassHierarchy(List<Class> classes) { |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2909 var v = list[i]; | 2910 var v = list[i]; |
| 2910 if ((v is ObservableMap) && _isServiceMap(v)) { | 2911 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2911 list[i] = owner.getFromMap(v); | 2912 list[i] = owner.getFromMap(v); |
| 2912 } else if (v is ObservableList) { | 2913 } else if (v is ObservableList) { |
| 2913 _upgradeObservableList(v, owner); | 2914 _upgradeObservableList(v, owner); |
| 2914 } else if (v is ObservableMap) { | 2915 } else if (v is ObservableMap) { |
| 2915 _upgradeObservableMap(v, owner); | 2916 _upgradeObservableMap(v, owner); |
| 2916 } | 2917 } |
| 2917 } | 2918 } |
| 2918 } | 2919 } |
| OLD | NEW |