| 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 28 matching lines...) Expand all Loading... |
| 39 String _vmType; | 39 String _vmType; |
| 40 | 40 |
| 41 bool get isBool => vmType == 'Bool'; | 41 bool get isBool => vmType == 'Bool'; |
| 42 bool get isClosure => false; | 42 bool get isClosure => false; |
| 43 bool get isContext => vmType == 'Context'; | 43 bool get isContext => vmType == 'Context'; |
| 44 bool get isDouble => vmType == 'Double'; | 44 bool get isDouble => vmType == 'Double'; |
| 45 bool get isError => vmType == 'Error'; | 45 bool get isError => vmType == 'Error'; |
| 46 bool get isInstance => vmType == 'Instance'; | 46 bool get isInstance => vmType == 'Instance'; |
| 47 bool get isInt => vmType == 'Smi' || vmType == 'Mint' || vmType == 'Bigint'; | 47 bool get isInt => vmType == 'Smi' || vmType == 'Mint' || vmType == 'Bigint'; |
| 48 bool get isList => vmType == 'GrowableObjectArray' || vmType == 'Array'; | 48 bool get isList => vmType == 'GrowableObjectArray' || vmType == 'Array'; |
| 49 bool get isMirrorReference => vmType == 'MirrorReference'; |
| 49 bool get isNull => vmType == 'Null'; | 50 bool get isNull => vmType == 'Null'; |
| 50 bool get isSentinel => vmType == 'Sentinel'; | 51 bool get isSentinel => vmType == 'Sentinel'; |
| 51 bool get isString => vmType == 'String'; | 52 bool get isString => vmType == 'String'; |
| 52 bool get isType => vmType == 'Type'; | 53 bool get isType => vmType == 'Type'; |
| 53 | 54 |
| 54 /// The complete service url of this object. | 55 /// The complete service url of this object. |
| 55 @reflectable String get link => _owner.relativeLink(_id); | 56 @reflectable String get link => _owner.relativeLink(_id); |
| 56 | 57 |
| 57 /// Has this object been fully loaded? | 58 /// Has this object been fully loaded? |
| 58 bool get loaded => _loaded; | 59 bool get loaded => _loaded; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 case 'Gauge': | 109 case 'Gauge': |
| 109 obj = new ServiceMetric._empty(owner); | 110 obj = new ServiceMetric._empty(owner); |
| 110 break; | 111 break; |
| 111 case 'Array': | 112 case 'Array': |
| 112 case 'Bigint': | 113 case 'Bigint': |
| 113 case 'Bool': | 114 case 'Bool': |
| 114 case 'Double': | 115 case 'Double': |
| 115 case 'GrowableObjectArray': | 116 case 'GrowableObjectArray': |
| 116 case 'Instance': | 117 case 'Instance': |
| 117 case 'Mint': | 118 case 'Mint': |
| 119 case 'MirrorReference': |
| 118 case 'Null': | 120 case 'Null': |
| 119 case 'Sentinel': // TODO(rmacnak): Separate this out. | 121 case 'Sentinel': // TODO(rmacnak): Separate this out. |
| 120 case 'Smi': | 122 case 'Smi': |
| 121 case 'String': | 123 case 'String': |
| 122 case 'Type': | 124 case 'Type': |
| 123 obj = new Instance._empty(owner); | 125 obj = new Instance._empty(owner); |
| 124 break; | 126 break; |
| 125 case 'Isolate': | 127 case 'Isolate': |
| 126 obj = new Isolate._empty(owner.vm); | 128 obj = new Isolate._empty(owner.vm); |
| 127 break; | 129 break; |
| (...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 @observable ServiceFunction closureFunc; // If a closure. | 1482 @observable ServiceFunction closureFunc; // If a closure. |
| 1481 @observable Context closureCtxt; // If a closure. | 1483 @observable Context closureCtxt; // If a closure. |
| 1482 @observable String name; // If a Type. | 1484 @observable String name; // If a Type. |
| 1483 @observable int length; // If a List. | 1485 @observable int length; // If a List. |
| 1484 | 1486 |
| 1485 @observable var typeClass; | 1487 @observable var typeClass; |
| 1486 @observable var fields; | 1488 @observable var fields; |
| 1487 @observable var nativeFields; | 1489 @observable var nativeFields; |
| 1488 @observable var elements; | 1490 @observable var elements; |
| 1489 @observable var userName; | 1491 @observable var userName; |
| 1492 @observable var referent; // If a MirrorReference. |
| 1490 | 1493 |
| 1491 bool get isClosure => closureFunc != null; | 1494 bool get isClosure => closureFunc != null; |
| 1492 | 1495 |
| 1493 Instance._empty(ServiceObjectOwner owner) : super._empty(owner); | 1496 Instance._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 1494 | 1497 |
| 1495 void _update(ObservableMap map, bool mapIsRef) { | 1498 void _update(ObservableMap map, bool mapIsRef) { |
| 1496 // Extract full properties. | 1499 // Extract full properties. |
| 1497 _upgradeCollection(map, isolate); | 1500 _upgradeCollection(map, isolate); |
| 1498 | 1501 |
| 1499 clazz = map['class']; | 1502 clazz = map['class']; |
| 1500 size = map['size']; | 1503 size = map['size']; |
| 1501 valueAsString = map['valueAsString']; | 1504 valueAsString = map['valueAsString']; |
| 1502 closureFunc = map['closureFunc']; | 1505 closureFunc = map['closureFunc']; |
| 1503 closureCtxt = map['closureCtxt']; | 1506 closureCtxt = map['closureCtxt']; |
| 1504 name = map['name']; | 1507 name = map['name']; |
| 1505 length = map['length']; | 1508 length = map['length']; |
| 1506 | 1509 |
| 1507 if (mapIsRef) { | 1510 if (mapIsRef) { |
| 1508 return; | 1511 return; |
| 1509 } | 1512 } |
| 1510 | 1513 |
| 1511 nativeFields = map['nativeFields']; | 1514 nativeFields = map['nativeFields']; |
| 1512 fields = map['fields']; | 1515 fields = map['fields']; |
| 1513 elements = map['elements']; | 1516 elements = map['elements']; |
| 1514 typeClass = map['type_class']; | 1517 typeClass = map['type_class']; |
| 1515 userName = map['user_name']; | 1518 userName = map['user_name']; |
| 1519 referent = map['referent']; |
| 1516 | 1520 |
| 1517 // We are fully loaded. | 1521 // We are fully loaded. |
| 1518 _loaded = true; | 1522 _loaded = true; |
| 1519 } | 1523 } |
| 1520 | 1524 |
| 1521 String get shortName => valueAsString != null ? valueAsString : 'a ${clazz.nam
e}'; | 1525 String get shortName => valueAsString != null ? valueAsString : 'a ${clazz.nam
e}'; |
| 1522 | 1526 |
| 1523 String toString() => 'Instance($shortName)'; | 1527 String toString() => 'Instance($shortName)'; |
| 1524 } | 1528 } |
| 1525 | 1529 |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 var v = list[i]; | 2524 var v = list[i]; |
| 2521 if ((v is ObservableMap) && _isServiceMap(v)) { | 2525 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2522 list[i] = owner.getFromMap(v); | 2526 list[i] = owner.getFromMap(v); |
| 2523 } else if (v is ObservableList) { | 2527 } else if (v is ObservableList) { |
| 2524 _upgradeObservableList(v, owner); | 2528 _upgradeObservableList(v, owner); |
| 2525 } else if (v is ObservableMap) { | 2529 } else if (v is ObservableMap) { |
| 2526 _upgradeObservableMap(v, owner); | 2530 _upgradeObservableMap(v, owner); |
| 2527 } | 2531 } |
| 2528 } | 2532 } |
| 2529 } | 2533 } |
| OLD | NEW |