| 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 /// The owner of this [ServiceObject]. This can be an [Isolate], a | 10 /// The owner of this [ServiceObject]. This can be an [Isolate], a |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 @reflectable VM get vm => this; | 170 @reflectable VM get vm => this; |
| 171 @reflectable Isolate get isolate => null; | 171 @reflectable Isolate get isolate => null; |
| 172 | 172 |
| 173 @reflectable Iterable<Isolate> get isolates => _isolateCache.values; | 173 @reflectable Iterable<Isolate> get isolates => _isolateCache.values; |
| 174 | 174 |
| 175 @reflectable String get link => '$id'; | 175 @reflectable String get link => '$id'; |
| 176 | 176 |
| 177 @observable String version = 'unknown'; | 177 @observable String version = 'unknown'; |
| 178 @observable String architecture = 'unknown'; | 178 @observable String architecture = 'unknown'; |
| 179 @observable double uptime = 0.0; | 179 @observable double uptime = 0.0; |
| 180 @observable bool assertsEnabled = false; |
| 181 @observable bool typeChecksEnabled = false; |
| 180 | 182 |
| 181 VM() : super._empty(null) { | 183 VM() : super._empty(null) { |
| 182 name = 'vm'; | 184 name = 'vm'; |
| 183 vmName = 'vm'; | 185 vmName = 'vm'; |
| 184 _cache['vm'] = this; | 186 _cache['vm'] = this; |
| 185 update(toObservable({'id':'vm', 'type':'@VM'})); | 187 update(toObservable({'id':'vm', 'type':'@VM'})); |
| 186 } | 188 } |
| 187 | 189 |
| 188 final StreamController<ServiceException> exceptions = | 190 final StreamController<ServiceException> exceptions = |
| 189 new StreamController.broadcast(); | 191 new StreamController.broadcast(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 Future<String> getString(String id); | 334 Future<String> getString(String id); |
| 333 | 335 |
| 334 void _update(ObservableMap map, bool mapIsRef) { | 336 void _update(ObservableMap map, bool mapIsRef) { |
| 335 if (mapIsRef) { | 337 if (mapIsRef) { |
| 336 return; | 338 return; |
| 337 } | 339 } |
| 338 _loaded = true; | 340 _loaded = true; |
| 339 version = map['version']; | 341 version = map['version']; |
| 340 architecture = map['architecture']; | 342 architecture = map['architecture']; |
| 341 uptime = map['uptime']; | 343 uptime = map['uptime']; |
| 344 assertsEnabled = map['assertsEnabled']; |
| 345 typeChecksEnabled = map['typeChecksEnabled']; |
| 342 _updateIsolates(map['isolates']); | 346 _updateIsolates(map['isolates']); |
| 343 } | 347 } |
| 344 | 348 |
| 345 void _updateIsolates(List newIsolates) { | 349 void _updateIsolates(List newIsolates) { |
| 346 var oldIsolateCache = _isolateCache; | 350 var oldIsolateCache = _isolateCache; |
| 347 var newIsolateCache = new Map<String,Isolate>(); | 351 var newIsolateCache = new Map<String,Isolate>(); |
| 348 for (var isolateMap in newIsolates) { | 352 for (var isolateMap in newIsolates) { |
| 349 var isolateId = isolateMap['id']; | 353 var isolateId = isolateMap['id']; |
| 350 var isolate = oldIsolateCache[isolateId]; | 354 var isolate = oldIsolateCache[isolateId]; |
| 351 if (isolate != null) { | 355 if (isolate != null) { |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 var v = list[i]; | 1254 var v = list[i]; |
| 1251 if ((v is ObservableMap) && _isServiceMap(v)) { | 1255 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 1252 list[i] = owner.getFromMap(v); | 1256 list[i] = owner.getFromMap(v); |
| 1253 } else if (v is ObservableList) { | 1257 } else if (v is ObservableList) { |
| 1254 _upgradeObservableList(v, owner); | 1258 _upgradeObservableList(v, owner); |
| 1255 } else if (v is ObservableMap) { | 1259 } else if (v is ObservableMap) { |
| 1256 _upgradeObservableMap(v, owner); | 1260 _upgradeObservableMap(v, owner); |
| 1257 } | 1261 } |
| 1258 } | 1262 } |
| 1259 } | 1263 } |
| OLD | NEW |