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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void removePauseEvents(Isolate isolate) { | 78 void removePauseEvents(Isolate isolate) { |
79 notifications.removeWhere((notification) { | 79 notifications.removeWhere((notification) { |
80 var event = notification.event; | 80 var event = notification.event; |
81 return (event != null && | 81 return (event != null && |
82 event.isolate == isolate && | 82 event.isolate == isolate && |
83 event.isPauseEvent); | 83 event.isPauseEvent); |
84 }); | 84 }); |
85 } | 85 } |
86 | 86 |
87 void _onEvent(ServiceEvent event) { | 87 void _onEvent(ServiceEvent event) { |
88 switch(event.eventType) { | 88 switch(event.kind) { |
89 case ServiceEvent.kIsolateStart: | 89 case ServiceEvent.kIsolateStart: |
90 case ServiceEvent.kIsolateUpdate: | 90 case ServiceEvent.kIsolateUpdate: |
91 case ServiceEvent.kGraph: | 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: | 95 case ServiceEvent.kGC: |
96 // Ignore for now. | 96 // Ignore for now. |
97 break; | 97 break; |
98 | 98 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 targets = new TargetManager() { | 202 targets = new TargetManager() { |
203 _locationManager = new LocationManager(this); | 203 _locationManager = new LocationManager(this); |
204 vm = new WebSocketVM(targets.defaultTarget); | 204 vm = new WebSocketVM(targets.defaultTarget); |
205 _initOnce(); | 205 _initOnce(); |
206 } | 206 } |
207 | 207 |
208 void _removeDisconnectEvents() { | 208 void _removeDisconnectEvents() { |
209 notifications.removeWhere((notification) { | 209 notifications.removeWhere((notification) { |
210 var event = notification.event; | 210 var event = notification.event; |
211 return (event != null && | 211 return (event != null && |
212 event.eventType == ServiceEvent.kConnectionClosed); | 212 event.kind == ServiceEvent.kConnectionClosed); |
213 }); | 213 }); |
214 } | 214 } |
215 | 215 |
216 loadCrashDump(Map crashDump) { | 216 loadCrashDump(Map crashDump) { |
217 this.vm = new FakeVM(crashDump['result']); | 217 this.vm = new FakeVM(crashDump['result']); |
218 app.locationManager.go('#/vm'); | 218 app.locationManager.go('#/vm'); |
219 } | 219 } |
220 | 220 |
221 void handleException(e, st) { | 221 void handleException(e, st) { |
222 // TODO(turnidge): Report this failure via analytics. | 222 // TODO(turnidge): Report this failure via analytics. |
223 Logger.root.warning('Caught exception: ${e}\n${st}'); | 223 Logger.root.warning('Caught exception: ${e}\n${st}'); |
224 notifications.add(new Notification.fromException(e, st)); | 224 notifications.add(new Notification.fromException(e, st)); |
225 } | 225 } |
226 } | 226 } |
OLD | NEW |