| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 _pageRegistry.add(new VMPage(this)); | 104 _pageRegistry.add(new VMPage(this)); |
| 105 _pageRegistry.add(new FlagsPage(this)); | 105 _pageRegistry.add(new FlagsPage(this)); |
| 106 _pageRegistry.add(new InspectPage(this)); | 106 _pageRegistry.add(new InspectPage(this)); |
| 107 _pageRegistry.add(new ClassTreePage(this)); | 107 _pageRegistry.add(new ClassTreePage(this)); |
| 108 _pageRegistry.add(new DebuggerPage(this)); | 108 _pageRegistry.add(new DebuggerPage(this)); |
| 109 _pageRegistry.add(new CpuProfilerPage(this)); | 109 _pageRegistry.add(new CpuProfilerPage(this)); |
| 110 _pageRegistry.add(new TableCpuProfilerPage(this)); | 110 _pageRegistry.add(new TableCpuProfilerPage(this)); |
| 111 _pageRegistry.add(new AllocationProfilerPage(this)); | 111 _pageRegistry.add(new AllocationProfilerPage(this)); |
| 112 _pageRegistry.add(new HeapMapPage(this)); | 112 _pageRegistry.add(new HeapMapPage(this)); |
| 113 _pageRegistry.add(new VMConnectPage(this)); | 113 _pageRegistry.add(new VMConnectPage(this)); |
| 114 _pageRegistry.add(new IsolateReconnectPage(this)); |
| 114 _pageRegistry.add(new ErrorViewPage(this)); | 115 _pageRegistry.add(new ErrorViewPage(this)); |
| 115 _pageRegistry.add(new MetricsPage(this)); | 116 _pageRegistry.add(new MetricsPage(this)); |
| 116 // Note that ErrorPage must be the last entry in the list as it is | 117 // Note that ErrorPage must be the last entry in the list as it is |
| 117 // the catch all. | 118 // the catch all. |
| 118 _pageRegistry.add(new ErrorPage(this)); | 119 _pageRegistry.add(new ErrorPage(this)); |
| 119 } | 120 } |
| 120 | 121 |
| 121 void _onError(ServiceError error) { | 122 void _onError(ServiceError error) { |
| 122 lastErrorOrException = error; | 123 lastErrorOrException = error; |
| 123 _visit(Uri.parse('error/'), null); | 124 _visit(Uri.parse('error/'), null); |
| 124 } | 125 } |
| 125 | 126 |
| 126 void _onException(ServiceException exception) { | 127 void _onException(ServiceException exception) { |
| 127 lastErrorOrException = exception; | 128 lastErrorOrException = exception; |
| 128 if (exception.kind == 'NetworkException') { | 129 if (exception.kind == 'NetworkException') { |
| 129 // Got a network exception, visit the vm-connect page. | 130 // Got a network exception, visit the vm-connect page. |
| 130 this.vm = null; | 131 this.vm = null; |
| 131 locationManager.go(locationManager.makeLink('/vm-connect/')); | 132 locationManager.go(locationManager.makeLink('/vm-connect')); |
| 132 } else { | 133 } else { |
| 133 _visit(Uri.parse('error/'), null); | 134 _visit(Uri.parse('error/'), null); |
| 134 } | 135 } |
| 135 } | 136 } |
| 136 | 137 |
| 137 void _visit(Uri uri, Map internalArguments) { | 138 void _visit(Uri uri, Map internalArguments) { |
| 138 if (internalArguments['trace'] != null) { | 139 if (internalArguments['trace'] != null) { |
| 139 var traceArg = internalArguments['trace']; | 140 var traceArg = internalArguments['trace']; |
| 140 if (traceArg == 'on') { | 141 if (traceArg == 'on') { |
| 141 Tracer.start(); | 142 Tracer.start(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 214 |
| 214 _vmDisconnected(VM vm) { | 215 _vmDisconnected(VM vm) { |
| 215 if (this.vm != vm) { | 216 if (this.vm != vm) { |
| 216 // This disconnect event occured *after* a new VM was installed. | 217 // This disconnect event occured *after* a new VM was installed. |
| 217 return; | 218 return; |
| 218 } | 219 } |
| 219 this.vm = null; | 220 this.vm = null; |
| 220 notifications.add(new ServiceEvent.vmDisconencted()); | 221 notifications.add(new ServiceEvent.vmDisconencted()); |
| 221 } | 222 } |
| 222 } | 223 } |
| OLD | NEW |