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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Issue 2690603003: Timeline: streamline flame chart views update logic (Closed)
Patch Set: moar fixes Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 } 608 }
609 609
610 /** 610 /**
611 * @param {?Timeline.PerformanceModel} model 611 * @param {?Timeline.PerformanceModel} model
612 */ 612 */
613 _setModel(model) { 613 _setModel(model) {
614 if (this._performanceModel) 614 if (this._performanceModel)
615 this._performanceModel.dispose(); 615 this._performanceModel.dispose();
616 this._performanceModel = model; 616 this._performanceModel = model;
617 this._currentViews.forEach(view => view.setModel(this._performanceModel)); 617 this._currentViews.forEach(view => view.setModel(this._performanceModel));
618
618 this._overviewPane.reset(); 619 this._overviewPane.reset();
619 if (model) { 620 if (model) {
620 this._overviewPane.setBounds( 621 this._overviewPane.setBounds(
621 model.timelineModel().minimumRecordTime(), model.timelineModel().maxim umRecordTime()); 622 model.timelineModel().minimumRecordTime(), model.timelineModel().maxim umRecordTime());
622 } 623 }
623 for (var control of this._overviewControls) 624 for (var control of this._overviewControls)
624 control.setModel(model); 625 control.setModel(model);
626
625 if (model) { 627 if (model) {
626 var cpuProfiles = model.timelineModel().cpuProfiles(); 628 var cpuProfiles = model.timelineModel().cpuProfiles();
627 cpuProfiles.forEach(profile => PerfUI.LineLevelProfile.instance().appendCP UProfile(profile)); 629 cpuProfiles.forEach(profile => PerfUI.LineLevelProfile.instance().appendCP UProfile(profile));
628 630
629 this._setAutoWindowTimes(model.timelineModel()); 631 this._setAutoWindowTimes(model.timelineModel());
630 this._setMarkers(model.timelineModel()); 632 this._setMarkers(model.timelineModel());
631 } else { 633 } else {
632 this.requestWindowTimes(0, Infinity); 634 this.requestWindowTimes(0, Infinity);
633 } 635 }
634 this._overviewPane.scheduleUpdate(); 636 this._overviewPane.scheduleUpdate();
637 if (this._detailsView)
638 this._detailsView.setModel(model);
639
635 this.select(null); 640 this.select(null);
636 this._updateSearchHighlight(false, true); 641 this._updateSearchHighlight(false, true);
642 if (this._flameChart)
643 this._flameChart.resizeToPreferredHeights();
637 } 644 }
638 645
639 /** 646 /**
640 * @override 647 * @override
641 */ 648 */
642 recordingStarted() { 649 recordingStarted() {
643 this._reset(); 650 this._reset();
644 this._setState(Timeline.TimelinePanel.State.Recording); 651 this._setState(Timeline.TimelinePanel.State.Recording);
645 this._showRecordingStarted(); 652 this._showRecordingStarted();
646 this._statusPane.updateStatus(Common.UIString('Profiling\u2026')); 653 this._statusPane.updateStatus(Common.UIString('Profiling\u2026'));
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 if (!tracingModel) { 769 if (!tracingModel) {
763 performanceModel.dispose(); 770 performanceModel.dispose();
764 this._clear(); 771 this._clear();
765 return; 772 return;
766 } 773 }
767 774
768 performanceModel.setTracingModel(tracingModel); 775 performanceModel.setTracingModel(tracingModel);
769 this._backingStorage = backingStorage; 776 this._backingStorage = backingStorage;
770 this._setModel(performanceModel); 777 this._setModel(performanceModel);
771 778
772 if (this._flameChart)
773 this._flameChart.resizeToPreferredHeights();
774 if (this._detailsSplitWidget) 779 if (this._detailsSplitWidget)
775 this._detailsSplitWidget.showBoth(); 780 this._detailsSplitWidget.showBoth();
776 } 781 }
777 782
778 _showRecordingStarted() { 783 _showRecordingStarted() {
779 if (this._statusPane) 784 if (this._statusPane)
780 return; 785 return;
781 this._statusPane = new Timeline.TimelinePanel.StatusPane(true, this._stopRec ording.bind(this)); 786 this._statusPane = new Timeline.TimelinePanel.StatusPane(true, this._stopRec ording.bind(this));
782 this._statusPane.showPane(this._statusPaneContainer); 787 this._statusPane.showPane(this._statusPaneContainer);
783 this._statusPane.updateStatus(Common.UIString('Initializing profiler\u2026') ); 788 this._statusPane.updateStatus(Common.UIString('Initializing profiler\u2026') );
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 return true; 1462 return true;
1458 case 'timeline.jump-to-next-frame': 1463 case 'timeline.jump-to-next-frame':
1459 panel._jumpToFrame(1); 1464 panel._jumpToFrame(1);
1460 return true; 1465 return true;
1461 } 1466 }
1462 return false; 1467 return false;
1463 } 1468 }
1464 }; 1469 };
1465 1470
1466 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin g'); 1471 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin g');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698