Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Unified Diff: runtime/observatory/lib/src/app/page.dart

Issue 2340973002: Improve VM connection flow in Observatory (Closed)
Patch Set: ... Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/app/page.dart
diff --git a/runtime/observatory/lib/src/app/page.dart b/runtime/observatory/lib/src/app/page.dart
index 600199cce3ea0219bdd064ef6b7a3145cd306100..6e9b01c550cabf74e6e3a2eb7dc2963ffd7cbbb1 100644
--- a/runtime/observatory/lib/src/app/page.dart
+++ b/runtime/observatory/lib/src/app/page.dart
@@ -152,6 +152,12 @@ class VMPage extends MatchingPage {
void _visit(Uri uri) {
super._visit(uri);
+ if (app.vm == null) {
+ Logger.root.severe('VMPage has no VM');
+ // Reroute to vm-connect.
+ app.locationManager.go(Uris.vmConnect());
+ return;
+ }
app.vm.reload().then((VM vm) {
container.children = [
new VMViewElement(vm, app.events, app.notifications,
@@ -161,7 +167,7 @@ class VMPage extends MatchingPage {
}).catchError((e, stack) {
Logger.root.severe('VMPage visit error: $e');
// Reroute to vm-connect.
- app.locationManager.go(app.locationManager.makeLink('/vm-connect'));
+ app.locationManager.go(Uris.vmConnect());
});
}
}
« no previous file with comments | « runtime/observatory/lib/src/app/location_manager.dart ('k') | runtime/observatory/lib/src/elements/vm_connect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698