| 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] represents a persistent object within the vm. | 7 /// A [ServiceObject] represents a persistent object within the vm. |
| 8 abstract class ServiceObject extends Observable { | 8 abstract class ServiceObject extends Observable { |
| 9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { | 9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { |
| 10 return o1.name.compareTo(o2.name); | 10 return o1.name.compareTo(o2.name); |
| (...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2607 return; | 2607 return; |
| 2608 } | 2608 } |
| 2609 // Load the script and then update descriptors. | 2609 // Load the script and then update descriptors. |
| 2610 function.script.load().then(_updateDescriptors); | 2610 function.script.load().then(_updateDescriptors); |
| 2611 } | 2611 } |
| 2612 | 2612 |
| 2613 /// Reload [this]. Returns a future which completes to [this] or | 2613 /// Reload [this]. Returns a future which completes to [this] or |
| 2614 /// a [ServiceError]. | 2614 /// a [ServiceError]. |
| 2615 Future<ServiceObject> reload() { | 2615 Future<ServiceObject> reload() { |
| 2616 assert(kind != null); | 2616 assert(kind != null); |
| 2617 if (kind == CodeKind.Dart) { | 2617 if (isDartCode) { |
| 2618 // We only reload Dart code. | 2618 // We only reload Dart code. |
| 2619 return super.reload(); | 2619 return super.reload(); |
| 2620 } | 2620 } |
| 2621 return new Future.value(this); | 2621 return new Future.value(this); |
| 2622 } | 2622 } |
| 2623 | 2623 |
| 2624 void _update(ObservableMap m, bool mapIsRef) { | 2624 void _update(ObservableMap m, bool mapIsRef) { |
| 2625 name = m['name']; | 2625 name = m['name']; |
| 2626 vmName = (m.containsKey('vmName') ? m['vmName'] : name); | 2626 vmName = (m.containsKey('vmName') ? m['vmName'] : name); |
| 2627 isOptimized = m['_optimized']; | 2627 isOptimized = m['_optimized']; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 } | 2746 } |
| 2747 } | 2747 } |
| 2748 | 2748 |
| 2749 /// Returns true if [address] is contained inside [this]. | 2749 /// Returns true if [address] is contained inside [this]. |
| 2750 bool contains(int address) { | 2750 bool contains(int address) { |
| 2751 return (address >= startAddress) && (address < endAddress); | 2751 return (address >= startAddress) && (address < endAddress); |
| 2752 } | 2752 } |
| 2753 | 2753 |
| 2754 @reflectable bool get isDartCode => (kind == CodeKind.Dart) || | 2754 @reflectable bool get isDartCode => (kind == CodeKind.Dart) || |
| 2755 (kind == CodeKind.Stub); | 2755 (kind == CodeKind.Stub); |
| 2756 |
| 2757 String toString() => 'Code($kind, $name)'; |
| 2756 } | 2758 } |
| 2757 | 2759 |
| 2758 | 2760 |
| 2759 class SocketKind { | 2761 class SocketKind { |
| 2760 final _value; | 2762 final _value; |
| 2761 const SocketKind._internal(this._value); | 2763 const SocketKind._internal(this._value); |
| 2762 String toString() => '$_value'; | 2764 String toString() => '$_value'; |
| 2763 | 2765 |
| 2764 static SocketKind fromString(String s) { | 2766 static SocketKind fromString(String s) { |
| 2765 if (s == 'Listening') { | 2767 if (s == 'Listening') { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2995 var v = list[i]; | 2997 var v = list[i]; |
| 2996 if ((v is ObservableMap) && _isServiceMap(v)) { | 2998 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2997 list[i] = owner.getFromMap(v); | 2999 list[i] = owner.getFromMap(v); |
| 2998 } else if (v is ObservableList) { | 3000 } else if (v is ObservableList) { |
| 2999 _upgradeObservableList(v, owner); | 3001 _upgradeObservableList(v, owner); |
| 3000 } else if (v is ObservableMap) { | 3002 } else if (v is ObservableMap) { |
| 3001 _upgradeObservableMap(v, owner); | 3003 _upgradeObservableMap(v, owner); |
| 3002 } | 3004 } |
| 3003 } | 3005 } |
| 3004 } | 3006 } |
| OLD | NEW |