| 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 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
| 8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
| 9 // object ring. | 9 // object ring. |
| 10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 } | 596 } |
| 597 | 597 |
| 598 void addEvent(ServiceEvent event) { | 598 void addEvent(ServiceEvent event) { |
| 599 for (var controller in _controllers) { | 599 for (var controller in _controllers) { |
| 600 controller.add(event); | 600 controller.add(event); |
| 601 } | 601 } |
| 602 } | 602 } |
| 603 } | 603 } |
| 604 | 604 |
| 605 /// State for a VM being inspected. | 605 /// State for a VM being inspected. |
| 606 abstract class VM extends ServiceObjectOwner { | 606 abstract class VM extends ServiceObjectOwner implements M.VM { |
| 607 @reflectable VM get vm => this; | 607 @reflectable VM get vm => this; |
| 608 @reflectable Isolate get isolate => null; | 608 @reflectable Isolate get isolate => null; |
| 609 | 609 |
| 610 // TODO(turnidge): The connection should not be stored in the VM object. | 610 // TODO(turnidge): The connection should not be stored in the VM object. |
| 611 bool get isDisconnected; | 611 bool get isDisconnected; |
| 612 | 612 |
| 613 // Used for verbose logging. | 613 // Used for verbose logging. |
| 614 bool verbose = false; | 614 bool verbose = false; |
| 615 | 615 |
| 616 // TODO(johnmccutchan): Ensure that isolates do not end up in _cache. | 616 // TODO(johnmccutchan): Ensure that isolates do not end up in _cache. |
| 617 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); | 617 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); |
| 618 final ObservableMap<String,Isolate> _isolateCache = | 618 final ObservableMap<String,Isolate> _isolateCache = |
| 619 new ObservableMap<String,Isolate>(); | 619 new ObservableMap<String,Isolate>(); |
| 620 | 620 |
| 621 // The list of live isolates, ordered by isolate start time. | 621 // The list of live isolates, ordered by isolate start time. |
| 622 final ObservableList<Isolate> isolates = new ObservableList<Isolate>(); | 622 final ObservableList<Isolate> isolates = new ObservableList<Isolate>(); |
| 623 | 623 |
| 624 @observable String version = 'unknown'; | 624 @observable String version = 'unknown'; |
| 625 @observable String hostCPU; |
| 625 @observable String targetCPU; | 626 @observable String targetCPU; |
| 626 @observable int architectureBits; | 627 @observable int architectureBits; |
| 627 @observable bool assertsEnabled = false; | 628 @observable bool assertsEnabled = false; |
| 628 @observable bool typeChecksEnabled = false; | 629 @observable bool typeChecksEnabled = false; |
| 629 @observable int pid = 0; | 630 @observable int pid = 0; |
| 630 @observable bool profileVM = false; | 631 @observable bool profileVM = false; |
| 631 @observable DateTime startTime; | 632 @observable DateTime startTime; |
| 632 @observable DateTime refreshTime; | 633 @observable DateTime refreshTime; |
| 633 @observable Duration get upTime { | 634 @observable Duration get upTime { |
| 634 if (startTime == null) { | 635 if (startTime == null) { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 vmName = map.containsKey('_vmName') ? map['_vmName'] : name; | 890 vmName = map.containsKey('_vmName') ? map['_vmName'] : name; |
| 890 if (mapIsRef) { | 891 if (mapIsRef) { |
| 891 return; | 892 return; |
| 892 } | 893 } |
| 893 // Note that upgrading the collection creates any isolates in the | 894 // Note that upgrading the collection creates any isolates in the |
| 894 // isolate list which are new. | 895 // isolate list which are new. |
| 895 _upgradeCollection(map, vm); | 896 _upgradeCollection(map, vm); |
| 896 | 897 |
| 897 _loaded = true; | 898 _loaded = true; |
| 898 version = map['version']; | 899 version = map['version']; |
| 900 hostCPU = map['hostCPU']; |
| 899 targetCPU = map['targetCPU']; | 901 targetCPU = map['targetCPU']; |
| 900 architectureBits = map['architectureBits']; | 902 architectureBits = map['architectureBits']; |
| 901 int startTimeMillis = map['startTime']; | 903 int startTimeMillis = map['startTime']; |
| 902 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis); | 904 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis); |
| 903 refreshTime = new DateTime.now(); | 905 refreshTime = new DateTime.now(); |
| 904 notifyPropertyChange(#upTime, 0, 1); | 906 notifyPropertyChange(#upTime, 0, 1); |
| 905 pid = map['pid']; | 907 pid = map['pid']; |
| 906 profileVM = map['_profilerMode'] == 'VM'; | 908 profileVM = map['_profilerMode'] == 'VM'; |
| 907 assertsEnabled = map['_assertsEnabled']; | 909 assertsEnabled = map['_assertsEnabled']; |
| 908 typeChecksEnabled = map['_typeChecksEnabled']; | 910 typeChecksEnabled = map['_typeChecksEnabled']; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 print("${obj.runtimeType} should be a HeapObject"); | 1112 print("${obj.runtimeType} should be a HeapObject"); |
| 1111 } | 1113 } |
| 1112 return obj; | 1114 return obj; |
| 1113 })); | 1115 })); |
| 1114 } | 1116 } |
| 1115 return result; | 1117 return result; |
| 1116 } | 1118 } |
| 1117 } | 1119 } |
| 1118 | 1120 |
| 1119 /// State for a running isolate. | 1121 /// State for a running isolate. |
| 1120 class Isolate extends ServiceObjectOwner { | 1122 class Isolate extends ServiceObjectOwner implements M.IsolateRef { |
| 1121 static const kLoggingStream = '_Logging'; | 1123 static const kLoggingStream = '_Logging'; |
| 1122 static const kExtensionStream = 'Extension'; | 1124 static const kExtensionStream = 'Extension'; |
| 1123 | 1125 |
| 1124 @reflectable VM get vm => owner; | 1126 @reflectable VM get vm => owner; |
| 1125 @reflectable Isolate get isolate => this; | 1127 @reflectable Isolate get isolate => this; |
| 1126 @observable int number; | 1128 @observable int number; |
| 1127 @observable int originNumber; | 1129 @observable int originNumber; |
| 1128 @observable DateTime startTime; | 1130 @observable DateTime startTime; |
| 1129 @observable Duration get upTime { | 1131 @observable Duration get upTime { |
| 1130 if (startTime == null) { | 1132 if (startTime == null) { |
| (...skipping 2993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4124 var v = list[i]; | 4126 var v = list[i]; |
| 4125 if ((v is ObservableMap) && _isServiceMap(v)) { | 4127 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 4126 list[i] = owner.getFromMap(v); | 4128 list[i] = owner.getFromMap(v); |
| 4127 } else if (v is ObservableList) { | 4129 } else if (v is ObservableList) { |
| 4128 _upgradeObservableList(v, owner); | 4130 _upgradeObservableList(v, owner); |
| 4129 } else if (v is ObservableMap) { | 4131 } else if (v is ObservableMap) { |
| 4130 _upgradeObservableMap(v, owner); | 4132 _upgradeObservableMap(v, owner); |
| 4131 } | 4133 } |
| 4132 } | 4134 } |
| 4133 } | 4135 } |
| OLD | NEW |