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 _classRepository = new ClassRepository(); | 9 final _classRepository = new ClassRepository(); |
10 final _classSampleProfileRepository = new ClassSampleProfileRepository(); | 10 final _classSampleProfileRepository = new ClassSampleProfileRepository(); |
(...skipping 17 matching lines...) Expand all Loading... |
28 final _persistentHandlesRepository = new PersistentHandlesRepository(); | 28 final _persistentHandlesRepository = new PersistentHandlesRepository(); |
29 final _portsRepository = new PortsRepository(); | 29 final _portsRepository = new PortsRepository(); |
30 final _scriptRepository = new ScriptRepository(); | 30 final _scriptRepository = new ScriptRepository(); |
31 final _singleTargetCacheRepository = new SingleTargetCacheRepository(); | 31 final _singleTargetCacheRepository = new SingleTargetCacheRepository(); |
32 final _stronglyReachangleInstancesRepository = | 32 final _stronglyReachangleInstancesRepository = |
33 new StronglyReachableInstancesRepository(); | 33 new StronglyReachableInstancesRepository(); |
34 final _subtypeTestCacheRepository = new SubtypeTestCacheRepository(); | 34 final _subtypeTestCacheRepository = new SubtypeTestCacheRepository(); |
35 final _topRetainingInstancesRepository = new TopRetainingInstancesRepository(); | 35 final _topRetainingInstancesRepository = new TopRetainingInstancesRepository(); |
36 final _typeArgumentsRepository = new TypeArgumentsRepository(); | 36 final _typeArgumentsRepository = new TypeArgumentsRepository(); |
37 final _unlinkedCallRepository = new UnlinkedCallRepository(); | 37 final _unlinkedCallRepository = new UnlinkedCallRepository(); |
| 38 final _vmrepository = new VMRepository(); |
38 | 39 |
39 class IsolateNotFound implements Exception { | 40 class IsolateNotFound implements Exception { |
40 String isolateId; | 41 String isolateId; |
41 IsolateNotFound(this.isolateId); | 42 IsolateNotFound(this.isolateId); |
42 String toString() => "IsolateNotFound: $isolateId"; | 43 String toString() => "IsolateNotFound: $isolateId"; |
43 } | 44 } |
44 | 45 |
45 RetainedSizeRepository _retainedSizeRepository = new RetainedSizeRepository(); | 46 RetainedSizeRepository _retainedSizeRepository = new RetainedSizeRepository(); |
46 ReachableSizeRepository _reachableSizeRepository = | 47 ReachableSizeRepository _reachableSizeRepository = |
47 new ReachableSizeRepository(); | 48 new ReachableSizeRepository(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 void _visit(Uri uri) { | 164 void _visit(Uri uri) { |
164 super._visit(uri); | 165 super._visit(uri); |
165 if (app.vm == null) { | 166 if (app.vm == null) { |
166 Logger.root.severe('VMPage has no VM'); | 167 Logger.root.severe('VMPage has no VM'); |
167 // Reroute to vm-connect. | 168 // Reroute to vm-connect. |
168 app.locationManager.go(Uris.vmConnect()); | 169 app.locationManager.go(Uris.vmConnect()); |
169 return; | 170 return; |
170 } | 171 } |
171 app.vm.reload().then((VM vm) { | 172 app.vm.reload().then((VM vm) { |
172 container.children = [ | 173 container.children = [ |
173 new VMViewElement(vm, app.events, app.notifications, | 174 new VMViewElement(vm, _vmrepository, app.events, app.notifications, |
174 new IsolateRepository(app.vm), _scriptRepository, | 175 new IsolateRepository(app.vm), _scriptRepository, |
175 queue: app.queue) | 176 queue: app.queue) |
176 ]; | 177 ]; |
177 }).catchError((e, stack) { | 178 }).catchError((e, stack) { |
178 Logger.root.severe('VMPage visit error: $e'); | 179 Logger.root.severe('VMPage visit error: $e'); |
179 // Reroute to vm-connect. | 180 // Reroute to vm-connect. |
180 app.locationManager.go(Uris.vmConnect()); | 181 app.locationManager.go(Uris.vmConnect()); |
181 }); | 182 }); |
182 } | 183 } |
183 } | 184 } |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 Logger.root.severe('MemoryDashboard has no VM'); | 702 Logger.root.severe('MemoryDashboard has no VM'); |
702 // Reroute to vm-connect. | 703 // Reroute to vm-connect. |
703 app.locationManager.go(Uris.vmConnect()); | 704 app.locationManager.go(Uris.vmConnect()); |
704 return; | 705 return; |
705 } | 706 } |
706 final editor = getEditor(uri); | 707 final editor = getEditor(uri); |
707 app.vm.reload().then((VM vm) async { | 708 app.vm.reload().then((VM vm) async { |
708 // Preload all isolates to avoid sorting problems. | 709 // Preload all isolates to avoid sorting problems. |
709 await Future.wait(vm.isolates.map((i) => i.load())); | 710 await Future.wait(vm.isolates.map((i) => i.load())); |
710 container.children = [ | 711 container.children = [ |
711 new MemoryDashboardElement(vm, new IsolateRepository(vm), editor, | 712 new MemoryDashboardElement(vm, _vmrepository, new IsolateRepository(vm), |
712 _allocationProfileRepository, app.events, app.notifications, | 713 editor, _allocationProfileRepository, app.events, app.notifications, |
713 queue: app.queue) | 714 queue: app.queue) |
714 ]; | 715 ]; |
715 }).catchError((e, stack) { | 716 }).catchError((e, stack) { |
716 Logger.root.severe('MemoryDashboard visit error: $e'); | 717 Logger.root.severe('MemoryDashboard visit error: $e'); |
717 // Reroute to vm-connect. | 718 // Reroute to vm-connect. |
718 app.locationManager.go(Uris.vmConnect()); | 719 app.locationManager.go(Uris.vmConnect()); |
719 }); | 720 }); |
720 } | 721 } |
721 | 722 |
722 void onInstall() { | 723 void onInstall() { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 element = new TimelinePageElement(app.vm, app.events, app.notifications, | 965 element = new TimelinePageElement(app.vm, app.events, app.notifications, |
965 queue: app.queue); | 966 queue: app.queue); |
966 } | 967 } |
967 | 968 |
968 void _visit(Uri uri) { | 969 void _visit(Uri uri) { |
969 assert(canVisit(uri)); | 970 assert(canVisit(uri)); |
970 } | 971 } |
971 | 972 |
972 bool canVisit(Uri uri) => uri.path == 'timeline'; | 973 bool canVisit(Uri uri) => uri.path == 'timeline'; |
973 } | 974 } |
OLD | NEW |