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

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

Issue 2989083002: Add memory-dashboard page to Observatory (Closed)
Patch Set: Upgrade to latest virtual-collection 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
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..6fe950e4ba6a8ff49cd073763d13327eb57007e9 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 isolate to avoid sorting problems
siva 2017/08/03 18:14:51 isolates and period at the end.
cbernaschina 2017/08/03 22:32:52 Done.
+ 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');
siva 2017/08/03 18:14:51 Where does these messages show up?
cbernaschina 2017/08/03 22:32:53 In the console of the browser
+ // Reroute to vm-connect.
+ app.locationManager.go(Uris.vmConnect());
});
}

Powered by Google App Engine
This is Rietveld 408576698