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

Side by Side Diff: runtime/observatory/lib/src/app/page.dart

Issue 2279973002: Converted Observatory heap-map element (Closed)
Patch Set: Fixed tests Created 4 years, 3 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 super._visit(uri); 392 super._visit(uri);
393 getIsolate(uri).then((isolate) { 393 getIsolate(uri).then((isolate) {
394 if (element != null) { 394 if (element != null) {
395 PersistentHandlesPageElement page = element; 395 PersistentHandlesPageElement page = element;
396 page.isolate = isolate; 396 page.isolate = isolate;
397 } 397 }
398 }); 398 });
399 } 399 }
400 } 400 }
401 401
402 class HeapMapPage extends SimplePage { 402 class HeapMapPage extends MatchingPage {
403 HeapMapPage(app) : super('heap-map', 'heap-map', app); 403 HeapMapPage(app) : super('heap-map', app);
404
405 final DivElement container = new DivElement();
404 406
405 void _visit(Uri uri) { 407 void _visit(Uri uri) {
406 super._visit(uri); 408 super._visit(uri);
407 getIsolate(uri).then((isolate) { 409 getIsolate(uri).then((isolate) {
408 if (element != null) { 410 container.children = [
409 /// Update the page. 411 new HeapMapElement(isolate.vm, isolate, app.events, app.notifications,
410 HeapMapElement page = element; 412 queue: app.queue)
411 page.isolate = isolate; 413 ];
412 }
413 }); 414 });
414 } 415 }
416
417 void onInstall() {
418 if (element == null) {
419 element = container;
420 }
421 }
415 } 422 }
416 423
417 class HeapSnapshotPage extends MatchingPage { 424 class HeapSnapshotPage extends MatchingPage {
418 HeapSnapshotPage(app) : super('heap-snapshot', app); 425 HeapSnapshotPage(app) : super('heap-snapshot', app);
419 426
420 final DivElement container = new DivElement(); 427 final DivElement container = new DivElement();
421 428
422 void _visit(Uri uri) { 429 void _visit(Uri uri) {
423 super._visit(uri); 430 super._visit(uri);
424 getIsolate(uri).then((isolate) { 431 getIsolate(uri).then((isolate) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 assert(element != null); 594 assert(element != null);
588 } 595 }
589 596
590 void _visit(Uri uri) { 597 void _visit(Uri uri) {
591 assert(element != null); 598 assert(element != null);
592 assert(canVisit(uri)); 599 assert(canVisit(uri));
593 } 600 }
594 601
595 bool canVisit(Uri uri) => uri.path == 'timeline'; 602 bool canVisit(Uri uri) => uri.path == 'timeline';
596 } 603 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/elements.html ('k') | runtime/observatory/lib/src/elements/css/shared.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698