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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 | 1060 |
1061 void _removeBreakpoint(Breakpoint bpt) { | 1061 void _removeBreakpoint(Breakpoint bpt) { |
1062 breakpoints.remove(bpt.number); | 1062 breakpoints.remove(bpt.number); |
1063 bpt.remove(); | 1063 bpt.remove(); |
1064 } | 1064 } |
1065 | 1065 |
1066 void _onEvent(ServiceEvent event) { | 1066 void _onEvent(ServiceEvent event) { |
1067 switch(event.eventType) { | 1067 switch(event.eventType) { |
1068 case ServiceEvent.kIsolateStart: | 1068 case ServiceEvent.kIsolateStart: |
1069 case ServiceEvent.kIsolateExit: | 1069 case ServiceEvent.kIsolateExit: |
| 1070 case ServiceEvent.kInspect: |
1070 // Handled elsewhere. | 1071 // Handled elsewhere. |
1071 break; | 1072 break; |
1072 | 1073 |
1073 case ServiceEvent.kBreakpointAdded: | 1074 case ServiceEvent.kBreakpointAdded: |
1074 _addBreakpoint(event.breakpoint); | 1075 _addBreakpoint(event.breakpoint); |
1075 break; | 1076 break; |
1076 | 1077 |
1077 case ServiceEvent.kIsolateUpdate: | 1078 case ServiceEvent.kIsolateUpdate: |
1078 case ServiceEvent.kBreakpointResolved: | 1079 case ServiceEvent.kBreakpointResolved: |
1079 // Update occurs as side-effect of caching. | 1080 // Update occurs as side-effect of caching. |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 static const kPauseExit = 'PauseExit'; | 1449 static const kPauseExit = 'PauseExit'; |
1449 static const kPauseBreakpoint = 'PauseBreakpoint'; | 1450 static const kPauseBreakpoint = 'PauseBreakpoint'; |
1450 static const kPauseInterrupted = 'PauseInterrupted'; | 1451 static const kPauseInterrupted = 'PauseInterrupted'; |
1451 static const kPauseException = 'PauseException'; | 1452 static const kPauseException = 'PauseException'; |
1452 static const kResume = 'Resume'; | 1453 static const kResume = 'Resume'; |
1453 static const kBreakpointAdded = 'BreakpointAdded'; | 1454 static const kBreakpointAdded = 'BreakpointAdded'; |
1454 static const kBreakpointResolved = 'BreakpointResolved'; | 1455 static const kBreakpointResolved = 'BreakpointResolved'; |
1455 static const kBreakpointRemoved = 'BreakpointRemoved'; | 1456 static const kBreakpointRemoved = 'BreakpointRemoved'; |
1456 static const kGraph = '_Graph'; | 1457 static const kGraph = '_Graph'; |
1457 static const kGC = 'GC'; | 1458 static const kGC = 'GC'; |
| 1459 static const kInspect = 'Inspect'; |
1458 static const kConnectionClosed = 'ConnectionClosed'; | 1460 static const kConnectionClosed = 'ConnectionClosed'; |
1459 | 1461 |
1460 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); | 1462 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); |
1461 | 1463 |
1462 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { | 1464 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { |
1463 eventType = kConnectionClosed; | 1465 eventType = kConnectionClosed; |
1464 } | 1466 } |
1465 | 1467 |
1466 @observable String eventType; | 1468 @observable String eventType; |
1467 @observable Breakpoint breakpoint; | 1469 @observable Breakpoint breakpoint; |
1468 @observable ServiceMap topFrame; | 1470 @observable ServiceMap topFrame; |
1469 @observable ServiceMap exception; | 1471 @observable ServiceMap exception; |
| 1472 @observable ServiceObject inspectee; |
1470 @observable ByteData data; | 1473 @observable ByteData data; |
1471 @observable int count; | 1474 @observable int count; |
1472 @observable String reason; | 1475 @observable String reason; |
1473 | 1476 |
1474 void _update(ObservableMap map, bool mapIsRef) { | 1477 void _update(ObservableMap map, bool mapIsRef) { |
1475 _loaded = true; | 1478 _loaded = true; |
1476 _upgradeCollection(map, owner); | 1479 _upgradeCollection(map, owner); |
1477 assert(map['isolate'] == null || owner == map['isolate']); | 1480 assert(map['isolate'] == null || owner == map['isolate']); |
1478 eventType = map['eventType']; | 1481 eventType = map['eventType']; |
1479 name = 'ServiceEvent $eventType'; | 1482 name = 'ServiceEvent $eventType'; |
1480 vmName = name; | 1483 vmName = name; |
1481 if (map['breakpoint'] != null) { | 1484 if (map['breakpoint'] != null) { |
1482 breakpoint = map['breakpoint']; | 1485 breakpoint = map['breakpoint']; |
1483 } | 1486 } |
1484 if (map['topFrame'] != null) { | 1487 if (map['topFrame'] != null) { |
1485 topFrame = map['topFrame']; | 1488 topFrame = map['topFrame']; |
1486 } | 1489 } |
1487 if (map['exception'] != null) { | 1490 if (map['exception'] != null) { |
1488 exception = map['exception']; | 1491 exception = map['exception']; |
1489 } | 1492 } |
| 1493 if (map['inspectee'] != null) { |
| 1494 inspectee = map['inspectee']; |
| 1495 } |
1490 if (map['_data'] != null) { | 1496 if (map['_data'] != null) { |
1491 data = map['_data']; | 1497 data = map['_data']; |
1492 } | 1498 } |
1493 if (map['count'] != null) { | 1499 if (map['count'] != null) { |
1494 count = map['count']; | 1500 count = map['count']; |
1495 } | 1501 } |
1496 } | 1502 } |
1497 | 1503 |
1498 String toString() { | 1504 String toString() { |
1499 if (data == null) { | 1505 if (data == null) { |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2995 var v = list[i]; | 3001 var v = list[i]; |
2996 if ((v is ObservableMap) && _isServiceMap(v)) { | 3002 if ((v is ObservableMap) && _isServiceMap(v)) { |
2997 list[i] = owner.getFromMap(v); | 3003 list[i] = owner.getFromMap(v); |
2998 } else if (v is ObservableList) { | 3004 } else if (v is ObservableList) { |
2999 _upgradeObservableList(v, owner); | 3005 _upgradeObservableList(v, owner); |
3000 } else if (v is ObservableMap) { | 3006 } else if (v is ObservableMap) { |
3001 _upgradeObservableMap(v, owner); | 3007 _upgradeObservableMap(v, owner); |
3002 } | 3008 } |
3003 } | 3009 } |
3004 } | 3010 } |
OLD | NEW |