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

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

Issue 2255613002: Converted Observatory heap-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Better sorting tests Created 4 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 e5d0b1f836c5a94ca31d24f6e57dffd63ddca766..bd2fe175166a11b9eff4de17193a4d630b31d5b9 100644
--- a/runtime/observatory/lib/src/app/page.dart
+++ b/runtime/observatory/lib/src/app/page.dart
@@ -4,6 +4,8 @@
part of app;
+AllocationProfileRepository _allocationProfileRepository
+ = new AllocationProfileRepository();
IsolateSampleProfileRepository _isolateSampleProfileRepository
= new IsolateSampleProfileRepository();
@@ -269,20 +271,34 @@ class TableCpuProfilerPage extends SimplePage {
}
}
-class AllocationProfilerPage extends SimplePage {
- AllocationProfilerPage(app)
- : super('allocation-profiler', 'heap-profile', app);
+class AllocationProfilerPage extends MatchingPage {
+ AllocationProfilerPage(app) : super('allocation-profiler', app);
+
+ DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
getIsolate(uri).then((isolate) {
- if (element != null) {
- /// Update the page.
- HeapProfileElement page = element;
- page.isolate = isolate;
- }
+ container.children = [
+ new AllocationProfileElement(isolate.vm, isolate, app.events,
+ app.notifications,
+ _allocationProfileRepository,
+ queue: app.queue)
+ ];
});
}
+
+ void onInstall() {
+ if (element == null) {
+ element = container;
+ }
+ app.startGCEventListener();
+ }
+
+ void onUninstall() {
+ super.onUninstall();
+ app.stopGCEventListener();
+ }
}
class PortsPage extends SimplePage {
« no previous file with comments | « runtime/observatory/lib/src/app/application.dart ('k') | runtime/observatory/lib/src/elements/allocation_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698