| 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 /// The observatory application. Instances of this are created and owned | 7 /// The observatory application. Instances of this are created and owned |
| 8 /// by the observatory_application custom element. | 8 /// by the observatory_application custom element. |
| 9 class ObservatoryApplication extends Observable { | 9 class ObservatoryApplication extends Observable { |
| 10 static ObservatoryApplication app; | 10 static ObservatoryApplication app; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 notifications.removeWhere((oldEvent) { | 59 notifications.removeWhere((oldEvent) { |
| 60 return (oldEvent.isolate == isolate && | 60 return (oldEvent.isolate == isolate && |
| 61 isPauseEvent(oldEvent)); | 61 isPauseEvent(oldEvent)); |
| 62 }); | 62 }); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void _onEvent(ServiceEvent event) { | 65 void _onEvent(ServiceEvent event) { |
| 66 switch(event.eventType) { | 66 switch(event.eventType) { |
| 67 case 'IsolateCreated': | 67 case 'IsolateStart': |
| 68 case '_Graph': |
| 69 case 'BreakpointAdded': |
| 70 case 'BreakpointResolved': |
| 71 case 'BreakpointRemoved': |
| 72 case 'GC': |
| 68 // Ignore for now. | 73 // Ignore for now. |
| 69 break; | 74 break; |
| 70 | 75 |
| 71 case 'IsolateResumed': | 76 case 'IsolateExit': |
| 72 event.isolate.pauseEvent = null; | 77 case 'Resume': |
| 78 removePauseEvents(event.isolate); |
| 73 break; | 79 break; |
| 74 | 80 |
| 75 case 'IsolateShutdown': | 81 case 'PauseStart': |
| 76 // TODO(turnidge): Should we show the user isolate shutdown events? | 82 case 'PauseExit': |
| 77 // What if there are hundreds of them? Coalesce multiple | 83 case 'PauseBreakpoint': |
| 78 // shutdown events into one notification? | 84 case 'PauseInterrupted': |
| 79 removePauseEvents(event.isolate); | 85 case 'PauseException': |
| 80 | |
| 81 // TODO(turnidge): Reload the isolate for now in case it is | |
| 82 // paused. We may need to distinguish an IsolateShutdown | |
| 83 // event from a "paused at isolate shutdown" event. | |
| 84 event.isolate.reload(); | |
| 85 break; | |
| 86 | |
| 87 case 'BreakpointResolved': | |
| 88 event.isolate.reloadBreakpoints(); | |
| 89 break; | |
| 90 | |
| 91 case 'BreakpointReached': | |
| 92 case 'IsolateInterrupted': | |
| 93 case 'ExceptionThrown': | |
| 94 event.isolate.pauseEvent = event; | |
| 95 removePauseEvents(event.isolate); | 86 removePauseEvents(event.isolate); |
| 96 notifications.add(event); | 87 notifications.add(event); |
| 97 break; | 88 break; |
| 98 | 89 |
| 99 case '_Graph': | |
| 100 event.isolate.loadHeapSnapshot(event); | |
| 101 break; | |
| 102 | |
| 103 case 'GC': | |
| 104 // Ignore GC events for now. | |
| 105 break; | |
| 106 | |
| 107 default: | 90 default: |
| 108 // Ignore unrecognized events. | 91 // Ignore unrecognized events. |
| 109 Logger.root.severe('Unrecognized event: $event'); | 92 Logger.root.severe('Unrecognized event: $event'); |
| 110 break; | 93 break; |
| 111 } | 94 } |
| 112 } | 95 } |
| 113 | 96 |
| 114 void _registerPages() { | 97 void _registerPages() { |
| 115 _pageRegistry.add(new VMPage(this)); | 98 _pageRegistry.add(new VMPage(this)); |
| 116 _pageRegistry.add(new FlagsPage(this)); | 99 _pageRegistry.add(new FlagsPage(this)); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 213 |
| 231 _vmDisconnected(VM vm) { | 214 _vmDisconnected(VM vm) { |
| 232 if (this.vm != vm) { | 215 if (this.vm != vm) { |
| 233 // This disconnect event occured *after* a new VM was installed. | 216 // This disconnect event occured *after* a new VM was installed. |
| 234 return; | 217 return; |
| 235 } | 218 } |
| 236 this.vm = null; | 219 this.vm = null; |
| 237 notifications.add(new ServiceEvent.vmDisconencted()); | 220 notifications.add(new ServiceEvent.vmDisconencted()); |
| 238 } | 221 } |
| 239 } | 222 } |
| OLD | NEW |