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

Side by Side 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: Added 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of app; 5 part of app;
6 6
7 AllocationProfileRepository _allocationProfileRepository 7 AllocationProfileRepository _allocationProfileRepository
8 = new AllocationProfileRepository(); 8 = new AllocationProfileRepository();
9 ContextRepository _contextRepository = new ContextRepository(); 9 ContextRepository _contextRepository = new ContextRepository();
10 HeapSnapshotRepository _heapSnapshotRepository 10 HeapSnapshotRepository _heapSnapshotRepository
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 278
279 void onInstall() { 279 void onInstall() {
280 if (element == null) { 280 if (element == null) {
281 element = container; 281 element = container;
282 } 282 }
283 assert(element != null); 283 assert(element != null);
284 } 284 }
285 } 285 }
286 286
287 class TableCpuProfilerPage extends SimplePage { 287 class TableCpuProfilerPage extends MatchingPage {
288 TableCpuProfilerPage(app) 288 TableCpuProfilerPage(app) : super('profiler-table', app);
289 : super('profiler-table', 'cpu-profile-table', app); 289
290 DivElement container = new DivElement();
Cutch 2016/08/24 13:53:41 this could be final right?
cbernaschina 2016/08/24 15:34:43 Done.
290 291
291 void _visit(Uri uri) { 292 void _visit(Uri uri) {
292 super._visit(uri); 293 super._visit(uri);
293 getIsolate(uri).then((isolate) { 294 getIsolate(uri).then((isolate) {
294 if (element != null) { 295 container.children = [
295 /// Update the page. 296 new CpuProfileTableElement(isolate.vm, isolate, app.events,
296 CpuProfileTableElement page = element; 297 app.notifications,
297 page.isolate = isolate; 298 _isolateSampleProfileRepository)
298 // TODO(johnmccutchan): Provide a more general mechanism to notify 299 ];
299 // elements of URI parameter changes. Possibly via a stream off of
300 // LocationManager. With a stream individual elements (not just pages)
301 // could be notified.
302 page.checkParameters();
303 }
304 }); 300 });
305 } 301 }
302
303 void onInstall() {
304 if (element == null) {
305 element = container;
306 }
307 assert(element != null);
308 }
306 } 309 }
307 310
308 class AllocationProfilerPage extends MatchingPage { 311 class AllocationProfilerPage extends MatchingPage {
309 AllocationProfilerPage(app) : super('allocation-profiler', app); 312 AllocationProfilerPage(app) : super('allocation-profiler', app);
310 313
311 DivElement container = new DivElement(); 314 DivElement container = new DivElement();
312 315
313 void _visit(Uri uri) { 316 void _visit(Uri uri) {
314 super._visit(uri); 317 super._visit(uri);
315 getIsolate(uri).then((isolate) { 318 getIsolate(uri).then((isolate) {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 assert(element != null); 564 assert(element != null);
562 } 565 }
563 566
564 void _visit(Uri uri) { 567 void _visit(Uri uri) {
565 assert(element != null); 568 assert(element != null);
566 assert(canVisit(uri)); 569 assert(canVisit(uri));
567 } 570 }
568 571
569 bool canVisit(Uri uri) => uri.path == 'timeline'; 572 bool canVisit(Uri uri) => uri.path == 'timeline';
570 } 573 }
OLDNEW
« 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