OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 app; | 5 part of app; |
6 | 6 |
7 class Notification { | 7 class Notification { |
8 Notification.fromEvent(this.event); | 8 Notification.fromEvent(this.event); |
9 Notification.fromException(this.exception, this.stacktrace); | 9 Notification.fromException(this.exception, this.stacktrace); |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 vm.onDisconnect.then((String reason) { | 46 vm.onDisconnect.then((String reason) { |
47 if (this.vm != vm) { | 47 if (this.vm != vm) { |
48 // This disconnect event occured *after* a new VM was installed. | 48 // This disconnect event occured *after* a new VM was installed. |
49 return; | 49 return; |
50 } | 50 } |
51 notifications.add( | 51 notifications.add( |
52 new Notification.fromEvent( | 52 new Notification.fromEvent( |
53 new ServiceEvent.connectionClosed(reason))); | 53 new ServiceEvent.connectionClosed(reason))); |
54 }); | 54 }); |
55 | 55 |
56 vm.events.stream.listen(_onEvent); | 56 vm.isolateEvents.listen(_onEvent); |
| 57 vm.debugEvents.listen(_onEvent); |
57 } | 58 } |
58 _vm = vm; | 59 _vm = vm; |
59 } | 60 } |
60 final TargetManager targets; | 61 final TargetManager targets; |
61 @reflectable final ObservatoryApplicationElement rootElement; | 62 @reflectable final ObservatoryApplicationElement rootElement; |
62 | 63 |
63 TraceViewElement _traceView = null; | 64 TraceViewElement _traceView = null; |
64 | 65 |
65 @reflectable ServiceObject lastErrorOrException; | 66 @reflectable ServiceObject lastErrorOrException; |
66 @observable ObservableList<Notification> notifications = | 67 @observable ObservableList<Notification> notifications = |
(...skipping 14 matching lines...) Expand all Loading... |
81 return (event != null && | 82 return (event != null && |
82 event.isolate == isolate && | 83 event.isolate == isolate && |
83 event.isPauseEvent); | 84 event.isPauseEvent); |
84 }); | 85 }); |
85 } | 86 } |
86 | 87 |
87 void _onEvent(ServiceEvent event) { | 88 void _onEvent(ServiceEvent event) { |
88 switch(event.eventType) { | 89 switch(event.eventType) { |
89 case ServiceEvent.kIsolateStart: | 90 case ServiceEvent.kIsolateStart: |
90 case ServiceEvent.kIsolateUpdate: | 91 case ServiceEvent.kIsolateUpdate: |
91 case ServiceEvent.kGraph: | |
92 case ServiceEvent.kBreakpointAdded: | 92 case ServiceEvent.kBreakpointAdded: |
93 case ServiceEvent.kBreakpointResolved: | 93 case ServiceEvent.kBreakpointResolved: |
94 case ServiceEvent.kBreakpointRemoved: | 94 case ServiceEvent.kBreakpointRemoved: |
95 case ServiceEvent.kGC: | |
96 // Ignore for now. | 95 // Ignore for now. |
97 break; | 96 break; |
98 | 97 |
99 case ServiceEvent.kIsolateExit: | 98 case ServiceEvent.kIsolateExit: |
100 case ServiceEvent.kResume: | 99 case ServiceEvent.kResume: |
101 removePauseEvents(event.isolate); | 100 removePauseEvents(event.isolate); |
102 break; | 101 break; |
103 | 102 |
104 case ServiceEvent.kPauseStart: | 103 case ServiceEvent.kPauseStart: |
105 case ServiceEvent.kPauseExit: | 104 case ServiceEvent.kPauseExit: |
106 case ServiceEvent.kPauseBreakpoint: | 105 case ServiceEvent.kPauseBreakpoint: |
107 case ServiceEvent.kPauseInterrupted: | 106 case ServiceEvent.kPauseInterrupted: |
108 case ServiceEvent.kPauseException: | 107 case ServiceEvent.kPauseException: |
109 removePauseEvents(event.isolate); | 108 removePauseEvents(event.isolate); |
110 notifications.add(new Notification.fromEvent(event)); | 109 notifications.add(new Notification.fromEvent(event)); |
111 break; | 110 break; |
112 | 111 |
113 case ServiceEvent.kInspect: | 112 case ServiceEvent.kInspect: |
114 notifications.add(new Notification.fromEvent(event)); | 113 notifications.add(new Notification.fromEvent(event)); |
115 break; | 114 break; |
116 | 115 |
117 default: | 116 default: |
118 // Ignore unrecognized events. | 117 // Ignore unrecognized events. |
119 Logger.root.severe('Unrecognized event: $event'); | 118 Logger.root.severe('Ignoring unexpected event: $event'); |
120 break; | 119 break; |
121 } | 120 } |
122 } | 121 } |
123 | 122 |
124 void _registerPages() { | 123 void _registerPages() { |
125 _pageRegistry.add(new VMPage(this)); | 124 _pageRegistry.add(new VMPage(this)); |
126 _pageRegistry.add(new FlagsPage(this)); | 125 _pageRegistry.add(new FlagsPage(this)); |
127 _pageRegistry.add(new InspectPage(this)); | 126 _pageRegistry.add(new InspectPage(this)); |
128 _pageRegistry.add(new ClassTreePage(this)); | 127 _pageRegistry.add(new ClassTreePage(this)); |
129 _pageRegistry.add(new DebuggerPage(this)); | 128 _pageRegistry.add(new DebuggerPage(this)); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 this.vm = new FakeVM(crashDump['result']); | 215 this.vm = new FakeVM(crashDump['result']); |
217 app.locationManager.go('#/vm'); | 216 app.locationManager.go('#/vm'); |
218 } | 217 } |
219 | 218 |
220 void handleException(e, st) { | 219 void handleException(e, st) { |
221 // TODO(turnidge): Report this failure via analytics. | 220 // TODO(turnidge): Report this failure via analytics. |
222 Logger.root.warning('Caught exception: ${e}\n${st}'); | 221 Logger.root.warning('Caught exception: ${e}\n${st}'); |
223 notifications.add(new Notification.fromException(e, st)); | 222 notifications.add(new Notification.fromException(e, st)); |
224 } | 223 } |
225 } | 224 } |
OLD | NEW |