| 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', {}) |
| 839 .then(_loadClasses) |
| 840 .then(_buildClassHierarchy); |
| 839 } | 841 } |
| 840 | 842 |
| 841 /// Given the class list, loads each class. | 843 /// Given the class list, loads each class. |
| 842 Future<List<Class>> _loadClasses(ServiceMap classList) { | 844 Future<List<Class>> _loadClasses(ServiceMap classList) { |
| 843 assert(classList.type == 'ClassList'); | 845 assert(classList.type == 'ClassList'); |
| 844 var futureClasses = []; | 846 var futureClasses = []; |
| 845 for (var cls in classList['members']) { | 847 for (var cls in classList['classes']) { |
| 846 // Skip over non-class classes. | 848 // Skip over non-class classes. |
| 847 if (cls is Class) { | 849 if (cls is Class) { |
| 848 futureClasses.add(cls.load()); | 850 futureClasses.add(cls.load()); |
| 849 } | 851 } |
| 850 } | 852 } |
| 851 return Future.wait(futureClasses); | 853 return Future.wait(futureClasses); |
| 852 } | 854 } |
| 853 | 855 |
| 854 /// Builds the class hierarchy and returns the Object class. | 856 /// Builds the class hierarchy and returns the Object class. |
| 855 Future<Class> _buildClassHierarchy(List<Class> classes) { | 857 Future<Class> _buildClassHierarchy(List<Class> classes) { |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2909 var v = list[i]; | 2911 var v = list[i]; |
| 2910 if ((v is ObservableMap) && _isServiceMap(v)) { | 2912 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2911 list[i] = owner.getFromMap(v); | 2913 list[i] = owner.getFromMap(v); |
| 2912 } else if (v is ObservableList) { | 2914 } else if (v is ObservableList) { |
| 2913 _upgradeObservableList(v, owner); | 2915 _upgradeObservableList(v, owner); |
| 2914 } else if (v is ObservableMap) { | 2916 } else if (v is ObservableMap) { |
| 2915 _upgradeObservableMap(v, owner); | 2917 _upgradeObservableMap(v, owner); |
| 2916 } | 2918 } |
| 2917 } | 2919 } |
| 2918 } | 2920 } |
| OLD | NEW |