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

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

Issue 2989083002: Add memory-dashboard page to Observatory (Closed)
Patch Set: Addressed CL comments Created 3 years, 4 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
« no previous file with comments | « runtime/observatory/lib/elements.dart ('k') | runtime/observatory/lib/src/elements/css/shared.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a8cbe2e84a60e862350daf1a51f4bbb3b0c80970..8500d32e877bb828863aa2865cbaad3bead4aab1 100644
--- a/runtime/observatory/lib/src/app/page.dart
+++ b/runtime/observatory/lib/src/app/page.dart
@@ -105,10 +105,8 @@ abstract class MatchingPage extends Page {
}
EditorRepository getEditor(Uri uri) {
- var editor = uri.queryParameters['editor'];
- if (editor != null) {
- return new EditorRepository(editor);
- }
+ final editor = uri.queryParameters['editor'];
+ return new EditorRepository(app.vm, editor: editor);
return null;
}
@@ -699,12 +697,25 @@ class MemoryDashboardPage extends MatchingPage {
void _visit(Uri uri) {
super._visit(uri);
- getIsolate(uri).then((isolate) {
+ if (app.vm == null) {
+ Logger.root.severe('MemoryDashboard has no VM');
+ // Reroute to vm-connect.
+ app.locationManager.go(Uris.vmConnect());
+ return;
+ }
+ final editor = getEditor(uri);
+ app.vm.reload().then((VM vm) async {
+ // Preload all isolates to avoid sorting problems.
+ await Future.wait(vm.isolates.map((i) => i.load()));
container.children = [
- new MemoryDashboardElement(isolate.vm, isolate, app.events,
- app.notifications, _allocationProfileRepository, getEditor(uri),
+ new MemoryDashboardElement(vm, new IsolateRepository(vm), editor,
+ _allocationProfileRepository, app.events, app.notifications,
queue: app.queue)
];
+ }).catchError((e, stack) {
+ Logger.root.severe('MemoryDashboard visit error: $e');
+ // Reroute to vm-connect.
+ app.locationManager.go(Uris.vmConnect());
});
}
« no previous file with comments | « runtime/observatory/lib/elements.dart ('k') | runtime/observatory/lib/src/elements/css/shared.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698