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(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 void onInstall() { | 146 void onInstall() { |
147 if (element == null) { | 147 if (element == null) { |
148 element = container; | 148 element = container; |
149 } | 149 } |
150 assert(element != null); | 150 assert(element != null); |
151 } | 151 } |
152 | 152 |
153 void _visit(Uri uri) { | 153 void _visit(Uri uri) { |
154 super._visit(uri); | 154 super._visit(uri); |
| 155 if (app.vm == null) { |
| 156 Logger.root.severe('VMPage has no VM'); |
| 157 // Reroute to vm-connect. |
| 158 app.locationManager.go(Uris.vmConnect()); |
| 159 return; |
| 160 } |
155 app.vm.reload().then((VM vm) { | 161 app.vm.reload().then((VM vm) { |
156 container.children = [ | 162 container.children = [ |
157 new VMViewElement(vm, app.events, app.notifications, | 163 new VMViewElement(vm, app.events, app.notifications, |
158 _isolateRepository, _scriptRepository, | 164 _isolateRepository, _scriptRepository, |
159 queue: app.queue) | 165 queue: app.queue) |
160 ]; | 166 ]; |
161 }).catchError((e, stack) { | 167 }).catchError((e, stack) { |
162 Logger.root.severe('VMPage visit error: $e'); | 168 Logger.root.severe('VMPage visit error: $e'); |
163 // Reroute to vm-connect. | 169 // Reroute to vm-connect. |
164 app.locationManager.go(app.locationManager.makeLink('/vm-connect')); | 170 app.locationManager.go(Uris.vmConnect()); |
165 }); | 171 }); |
166 } | 172 } |
167 } | 173 } |
168 | 174 |
169 class FlagsPage extends SimplePage { | 175 class FlagsPage extends SimplePage { |
170 FlagsPage(app) : super('flags', 'flag-list', app); | 176 FlagsPage(app) : super('flags', 'flag-list', app); |
171 | 177 |
172 @override | 178 @override |
173 onInstall() { | 179 onInstall() { |
174 element = new FlagListElement(app.vm, | 180 element = new FlagListElement(app.vm, |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 element = new TimelinePageElement(app.vm, app.events, app.notifications, | 802 element = new TimelinePageElement(app.vm, app.events, app.notifications, |
797 queue: app.queue); | 803 queue: app.queue); |
798 } | 804 } |
799 | 805 |
800 void _visit(Uri uri) { | 806 void _visit(Uri uri) { |
801 assert(canVisit(uri)); | 807 assert(canVisit(uri)); |
802 } | 808 } |
803 | 809 |
804 bool canVisit(Uri uri) => uri.path == 'timeline'; | 810 bool canVisit(Uri uri) => uri.path == 'timeline'; |
805 } | 811 } |
OLD | NEW |