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

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

Issue 2273993002: Converted Observatory cpu-profile-table element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed comments 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
« no previous file with comments | « runtime/observatory/lib/elements.html ('k') | runtime/observatory/lib/src/cpu_profile/cpu_profile.dart » ('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 182eae4469978933dd92af29dd8f28f9bfe66f5e..a9f244a5029898196c992973e277c7ef8dd11576 100644
--- a/runtime/observatory/lib/src/app/page.dart
+++ b/runtime/observatory/lib/src/app/page.dart
@@ -159,7 +159,7 @@ class FlagsPage extends SimplePage {
class InspectPage extends MatchingPage {
InspectPage(app) : super('inspect', app);
- DivElement container = new DivElement();
+ final DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
@@ -263,7 +263,7 @@ class ObjectStorePage extends SimplePage {
class CpuProfilerPage extends MatchingPage {
CpuProfilerPage(app) : super('profiler', app);
- DivElement container = new DivElement();
+ final DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
@@ -284,31 +284,34 @@ class CpuProfilerPage extends MatchingPage {
}
}
-class TableCpuProfilerPage extends SimplePage {
- TableCpuProfilerPage(app)
- : super('profiler-table', 'cpu-profile-table', app);
+class TableCpuProfilerPage extends MatchingPage {
+ TableCpuProfilerPage(app) : super('profiler-table', app);
+
+ final DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
getIsolate(uri).then((isolate) {
- if (element != null) {
- /// Update the page.
- CpuProfileTableElement page = element;
- page.isolate = isolate;
- // TODO(johnmccutchan): Provide a more general mechanism to notify
- // elements of URI parameter changes. Possibly via a stream off of
- // LocationManager. With a stream individual elements (not just pages)
- // could be notified.
- page.checkParameters();
- }
+ container.children = [
+ new CpuProfileTableElement(isolate.vm, isolate, app.events,
+ app.notifications,
+ _isolateSampleProfileRepository)
+ ];
});
}
+
+ void onInstall() {
+ if (element == null) {
+ element = container;
+ }
+ assert(element != null);
+ }
}
class AllocationProfilerPage extends MatchingPage {
AllocationProfilerPage(app) : super('allocation-profiler', app);
- DivElement container = new DivElement();
+ final DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
@@ -338,7 +341,7 @@ class AllocationProfilerPage extends MatchingPage {
class PortsPage extends MatchingPage {
PortsPage(app) : super('ports', app);
- DivElement container = new DivElement();
+ final DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
@@ -391,7 +394,7 @@ class HeapMapPage extends SimplePage {
class HeapSnapshotPage extends MatchingPage {
HeapSnapshotPage(app) : super('heap-snapshot', app);
- DivElement container = new DivElement();
+ final DivElement container = new DivElement();
void _visit(Uri uri) {
super._visit(uri);
@@ -472,7 +475,7 @@ class VMConnectPage extends Page {
class IsolateReconnectPage extends Page {
IsolateReconnectPage(app) : super(app);
- DivElement container = new DivElement();
+ final DivElement container = new DivElement();
void onInstall() {
element = container;
« no previous file with comments | « runtime/observatory/lib/elements.html ('k') | runtime/observatory/lib/src/cpu_profile/cpu_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698