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

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

Issue 2299893003: Converted Observatory logging-page element (Closed)
Patch Set: Updated observatory_sources.gypi 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 final _allocationProfileRepository = new AllocationProfileRepository(); 7 final _allocationProfileRepository = new AllocationProfileRepository();
8 final _breakpointRepository = new BreakpointRepository(); 8 final _breakpointRepository = new BreakpointRepository();
9 final _classSampleProfileRepository = new ClassSampleProfileRepository(); 9 final _classSampleProfileRepository = new ClassSampleProfileRepository();
10 final _classRepository = new ClassRepository(); 10 final _classRepository = new ClassRepository();
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 }); 637 });
638 } 638 }
639 639
640 void onInstall() { 640 void onInstall() {
641 if (element == null) { 641 if (element == null) {
642 element = container; 642 element = container;
643 } 643 }
644 } 644 }
645 } 645 }
646 646
647 class LoggingPage extends MatchingPage {
648 LoggingPage(app) : super('logging', app);
647 649
648 class LoggingPage extends SimplePage { 650 final DivElement container = new DivElement();
649 LoggingPage(app) : super('logging', 'logging-page', app); 651
652 @override
653 void onInstall() {
654 element = container;
655 container.children = const [];
656 app.startLoggingEventListener();
657 }
658
659 @override
660 void onUninstall() {
661 app.stopLoggingEventListener();
662 }
650 663
651 void _visit(Uri uri) { 664 void _visit(Uri uri) {
652 super._visit(uri); 665 assert(element != null);
666 assert(canVisit(uri));
653 getIsolate(uri).then((isolate) { 667 getIsolate(uri).then((isolate) {
654 if (element != null) { 668 container.children = [
655 /// Update the page. 669 new LoggingPageElement(app.vm, isolate, app.events,
656 LoggingPageElement page = element; 670 app.notifications, queue: app.queue)
657 page.isolate = isolate; 671 ];
658 }
659 }); 672 });
660 } 673 }
661 } 674 }
662 675
663 class ErrorViewPage extends Page { 676 class ErrorViewPage extends Page {
664 ErrorViewPage(app) : super(app); 677 ErrorViewPage(app) : super(app);
665 678
666 void onInstall() { 679 void onInstall() {
667 element = new ErrorViewElement(app.notifications, 680 element = new ErrorViewElement(app.notifications,
668 app.lastErrorOrException as DartError, 681 app.lastErrorOrException as DartError,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 assert(element != null); 805 assert(element != null);
793 } 806 }
794 807
795 void _visit(Uri uri) { 808 void _visit(Uri uri) {
796 assert(element != null); 809 assert(element != null);
797 assert(canVisit(uri)); 810 assert(canVisit(uri));
798 } 811 }
799 812
800 bool canVisit(Uri uri) => uri.path == 'timeline'; 813 bool canVisit(Uri uri) => uri.path == 'timeline';
801 } 814 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/app/application.dart ('k') | runtime/observatory/lib/src/elements/css/shared.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698