| 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 app; | 5 part of app; |
| 6 | 6 |
| 7 final _allocationProfileRepository = new AllocationProfileRepository(); | 7 final _allocationProfileRepository = new AllocationProfileRepository(); |
| 8 final _breakpointRepository = new BreakpointRepository(); | 8 final _breakpointRepository = new BreakpointRepository(); |
| 9 final _classSampleProfileRepository = new ClassSampleProfileRepository(); | 9 final _classSampleProfileRepository = new ClassSampleProfileRepository(); |
| 10 final _classRepository = new ClassRepository(); | 10 final _classRepository = new ClassRepository(); |
| 11 final _contextRepository = new ContextRepository(); | 11 final _contextRepository = new ContextRepository(); |
| 12 final _evalRepository = new EvalRepository(); | 12 final _evalRepository = new EvalRepository(); |
| 13 final _fieldRepository = new FieldRepository(); | 13 final _fieldRepository = new FieldRepository(); |
| 14 final _functionRepository = new FunctionRepository(); | 14 final _functionRepository = new FunctionRepository(); |
| 15 final _heapSnapshotRepository = new HeapSnapshotRepository(); | 15 final _heapSnapshotRepository = new HeapSnapshotRepository(); |
| 16 final _icdataRepository = new ICDataRepository(); | 16 final _icdataRepository = new ICDataRepository(); |
| 17 final _inboundReferencesRepository = new InboundReferencesRepository(); | 17 final _inboundReferencesRepository = new InboundReferencesRepository(); |
| 18 final _instanceRepository = new InstanceRepository(); | 18 final _instanceRepository = new InstanceRepository(); |
| 19 final _isolateRepository = new IsolateRepository(); |
| 19 final _isolateSampleProfileRepository = new IsolateSampleProfileRepository(); | 20 final _isolateSampleProfileRepository = new IsolateSampleProfileRepository(); |
| 20 final _libraryRepository = new LibraryRepository(); | 21 final _libraryRepository = new LibraryRepository(); |
| 21 final _megamorphicCacheRepository = new MegamorphicCacheRepository(); | 22 final _megamorphicCacheRepository = new MegamorphicCacheRepository(); |
| 22 final _objectRepository = new ObjectRepository(); | 23 final _objectRepository = new ObjectRepository(); |
| 23 final _objectPoolRepository = new ObjectPoolRepository(); | 24 final _objectPoolRepository = new ObjectPoolRepository(); |
| 24 final _objectstoreRepository = new ObjectStoreRepository(); | 25 final _objectstoreRepository = new ObjectStoreRepository(); |
| 25 final _persistentHandlesRepository = new PersistentHandlesRepository(); | 26 final _persistentHandlesRepository = new PersistentHandlesRepository(); |
| 26 final _portsRepository = new PortsRepository(); | 27 final _portsRepository = new PortsRepository(); |
| 27 final _scriptRepository = new ScriptRepository(); | 28 final _scriptRepository = new ScriptRepository(); |
| 28 final _stronglyReachangleInstancesRepository = | 29 final _stronglyReachangleInstancesRepository = |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 assert(canVisit(uri)); | 131 assert(canVisit(uri)); |
| 131 | 132 |
| 132 (element as GeneralErrorElement).message = "Path '${uri.path}' not found"; | 133 (element as GeneralErrorElement).message = "Path '${uri.path}' not found"; |
| 133 } | 134 } |
| 134 | 135 |
| 135 /// Catch all. | 136 /// Catch all. |
| 136 bool canVisit(Uri uri) => true; | 137 bool canVisit(Uri uri) => true; |
| 137 } | 138 } |
| 138 | 139 |
| 139 /// Top-level vm info page. | 140 /// Top-level vm info page. |
| 140 class VMPage extends SimplePage { | 141 class VMPage extends MatchingPage { |
| 141 VMPage(app) : super('vm', 'vm-view', app); | 142 VMPage(app) : super('vm', app); |
| 143 |
| 144 final DivElement container = new DivElement(); |
| 145 |
| 146 void onInstall() { |
| 147 if (element == null) { |
| 148 element = container; |
| 149 } |
| 150 assert(element != null); |
| 151 } |
| 142 | 152 |
| 143 void _visit(Uri uri) { | 153 void _visit(Uri uri) { |
| 144 super._visit(uri); | 154 super._visit(uri); |
| 145 app.vm.reload().then((vm) { | 155 app.vm.reload().then((VM vm) { |
| 146 if (element != null) { | 156 container.children = [ |
| 147 VMViewElement serviceElement = element; | 157 new VMViewElement(vm, app.events, app.notifications, |
| 148 serviceElement.vm = vm; | 158 _isolateRepository, _scriptRepository, |
| 149 } | 159 queue: app.queue) |
| 160 ]; |
| 150 }).catchError((e, stack) { | 161 }).catchError((e, stack) { |
| 151 Logger.root.severe('VMPage visit error: $e'); | 162 Logger.root.severe('VMPage visit error: $e'); |
| 152 // Reroute to vm-connect. | 163 // Reroute to vm-connect. |
| 153 app.locationManager.go(app.locationManager.makeLink('/vm-connect')); | 164 app.locationManager.go(app.locationManager.makeLink('/vm-connect')); |
| 154 }); | 165 }); |
| 155 } | 166 } |
| 156 } | 167 } |
| 157 | 168 |
| 158 class FlagsPage extends SimplePage { | 169 class FlagsPage extends SimplePage { |
| 159 FlagsPage(app) : super('flags', 'flag-list', app); | 170 FlagsPage(app) : super('flags', 'flag-list', app); |
| 160 | 171 |
| 161 @override | 172 @override |
| 162 onInstall() { | 173 onInstall() { |
| 163 element = new FlagListElement(app.vm, | 174 element = new FlagListElement(app.vm, |
| 164 app.events, | 175 app.events, |
| 165 new FlagsRepository(app.vm), | 176 new FlagsRepository(app.vm), |
| 166 app.notifications); | 177 app.notifications, |
| 178 queue: app.queue); |
| 167 } | 179 } |
| 168 | 180 |
| 169 void _visit(Uri uri) { | 181 void _visit(Uri uri) { |
| 170 super._visit(uri); | 182 super._visit(uri); |
| 171 } | 183 } |
| 172 } | 184 } |
| 173 | 185 |
| 174 class InspectPage extends MatchingPage { | 186 class InspectPage extends MatchingPage { |
| 175 InspectPage(app) : super('inspect', app); | 187 InspectPage(app) : super('inspect', app); |
| 176 | 188 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 _reachableSizeRepository, | 268 _reachableSizeRepository, |
| 257 _inboundReferencesRepository, | 269 _inboundReferencesRepository, |
| 258 _retainingPathRepository, | 270 _retainingPathRepository, |
| 259 _scriptRepository, | 271 _scriptRepository, |
| 260 _evalRepository, | 272 _evalRepository, |
| 261 _typeArgumentsRepository, | 273 _typeArgumentsRepository, |
| 262 _breakpointRepository, | 274 _breakpointRepository, |
| 263 _functionRepository, | 275 _functionRepository, |
| 264 queue: app.queue) | 276 queue: app.queue) |
| 265 ]; | 277 ]; |
| 278 } else if (obj is Isolate) { |
| 279 container.children = [ |
| 280 new IsolateViewElement(app.vm, obj, app.events, |
| 281 app.notifications, |
| 282 _isolateRepository, |
| 283 _scriptRepository, |
| 284 _functionRepository, |
| 285 _libraryRepository, |
| 286 _instanceRepository, |
| 287 _evalRepository, |
| 288 queue: app.queue) |
| 289 ]; |
| 266 } else if (obj is ServiceFunction) { | 290 } else if (obj is ServiceFunction) { |
| 267 container.children = [ | 291 container.children = [ |
| 268 new FunctionViewElement(app.vm, obj.isolate, obj, app.events, | 292 new FunctionViewElement(app.vm, obj.isolate, obj, app.events, |
| 269 app.notifications, | 293 app.notifications, |
| 270 _functionRepository, | 294 _functionRepository, |
| 271 _classRepository, | 295 _classRepository, |
| 272 _retainedSizeRepository, | 296 _retainedSizeRepository, |
| 273 _reachableSizeRepository, | 297 _reachableSizeRepository, |
| 274 _inboundReferencesRepository, | 298 _inboundReferencesRepository, |
| 275 _retainingPathRepository, | 299 _retainingPathRepository, |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 assert(element != null); | 782 assert(element != null); |
| 759 } | 783 } |
| 760 | 784 |
| 761 void _visit(Uri uri) { | 785 void _visit(Uri uri) { |
| 762 assert(element != null); | 786 assert(element != null); |
| 763 assert(canVisit(uri)); | 787 assert(canVisit(uri)); |
| 764 } | 788 } |
| 765 | 789 |
| 766 bool canVisit(Uri uri) => uri.path == 'timeline'; | 790 bool canVisit(Uri uri) => uri.path == 'timeline'; |
| 767 } | 791 } |
| OLD | NEW |