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

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

Issue 399043002: DevTools: switch Timeline frontend into buffered mode and remove the corresponding experiment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor changes Created 6 years, 5 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 | Annotate | Revision Log
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 _frameModel: function() 260 _frameModel: function()
261 { 261 {
262 if (this._lazyFrameModel) 262 if (this._lazyFrameModel)
263 return this._lazyFrameModel; 263 return this._lazyFrameModel;
264 if (this._tracingModel) { 264 if (this._tracingModel) {
265 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel(t his._model.target()); 265 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel(t his._model.target());
266 tracingFrameModel.addTraceEvents(this._tracingTimelineModel.inspecte dTargetEvents(), this._tracingModel.sessionId() || ""); 266 tracingFrameModel.addTraceEvents(this._tracingTimelineModel.inspecte dTargetEvents(), this._tracingModel.sessionId() || "");
267 this._lazyFrameModel = tracingFrameModel; 267 this._lazyFrameModel = tracingFrameModel;
268 } else { 268 } else {
269 var frameModel = new WebInspector.TimelineFrameModel(this._model.tar get()); 269 var frameModel = new WebInspector.TimelineFrameModel(this._model.tar get());
270 frameModel.setMergeRecords(!WebInspector.experimentsSettings.timelin eNoLiveUpdate.isEnabled() || !this._recordingInProgress); 270 frameModel.setMergeRecords(!this._recordingInProgress);
271 frameModel.addRecords(this._model.records()); 271 frameModel.addRecords(this._model.records());
272 this._lazyFrameModel = frameModel; 272 this._lazyFrameModel = frameModel;
273 } 273 }
274 return this._lazyFrameModel; 274 return this._lazyFrameModel;
275 }, 275 },
276 276
277 /** 277 /**
278 * @return {!WebInspector.TimelineView} 278 * @return {!WebInspector.TimelineView}
279 */ 279 */
280 _timelineView: function() 280 _timelineView: function()
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 WebInspector.inspectorView.setCurrentPanelLocked(!enabled); 696 WebInspector.inspectorView.setCurrentPanelLocked(!enabled);
697 }, 697 },
698 698
699 /** 699 /**
700 * @param {boolean} userInitiated 700 * @param {boolean} userInitiated
701 */ 701 */
702 _startRecording: function(userInitiated) 702 _startRecording: function(userInitiated)
703 { 703 {
704 this._userInitiatedRecording = userInitiated; 704 this._userInitiatedRecording = userInitiated;
705 this._model.startRecording(this._captureStacksSetting.get(), this._captu reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay ersAndPicturesSetting.get()); 705 this._model.startRecording(this._captureStacksSetting.get(), this._captu reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay ersAndPicturesSetting.get());
706 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() && this._lazyFrameModel) 706 if (this._lazyFrameModel)
707 this._lazyFrameModel.setMergeRecords(false); 707 this._lazyFrameModel.setMergeRecords(false);
708 708
709 for (var i = 0; i < this._overviewControls.length; ++i) 709 for (var i = 0; i < this._overviewControls.length; ++i)
710 this._overviewControls[i].timelineStarted(); 710 this._overviewControls[i].timelineStarted();
711 711
712 if (userInitiated) 712 if (userInitiated)
713 WebInspector.userMetrics.TimelineStarted.record(); 713 WebInspector.userMetrics.TimelineStarted.record();
714 this._setUIControlsEnabled(false); 714 this._setUIControlsEnabled(false);
715 }, 715 },
716 716
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 for (var i = 0; i < this._currentViews.length; ++i) 791 for (var i = 0; i < this._currentViews.length; ++i)
792 this._currentViews[i].reset(); 792 this._currentViews[i].reset();
793 for (var i = 0; i < this._overviewControls.length; ++i) 793 for (var i = 0; i < this._overviewControls.length; ++i)
794 this._overviewControls[i].reset(); 794 this._overviewControls[i].reset();
795 this._updateSelectedRangeStats(); 795 this._updateSelectedRangeStats();
796 }, 796 },
797 797
798 _onRecordingStarted: function() 798 _onRecordingStarted: function()
799 { 799 {
800 this._updateToggleTimelineButton(true); 800 this._updateToggleTimelineButton(true);
801 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) 801 this._updateProgress(WebInspector.UIString("%d events collected", 0));
802 this._updateProgress(WebInspector.UIString("%d events collected", 0) );
803 }, 802 },
804 803
805 _recordingInProgress: function() 804 _recordingInProgress: function()
806 { 805 {
807 return this.toggleTimelineButton.toggled; 806 return this.toggleTimelineButton.toggled;
808 }, 807 },
809 808
810 /** 809 /**
811 * @param {!WebInspector.Event} event 810 * @param {!WebInspector.Event} event
812 */ 811 */
813 _onRecordingProgress: function(event) 812 _onRecordingProgress: function(event)
814 { 813 {
815 if (!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled())
816 return;
817 this._updateProgress(WebInspector.UIString("%d events collected", event. data)); 814 this._updateProgress(WebInspector.UIString("%d events collected", event. data));
818 }, 815 },
819 816
820 /** 817 /**
821 * @param {!WebInspector.Event} event 818 * @param {!WebInspector.Event} event
822 */ 819 */
823 _onTracingBufferUsage: function(event) 820 _onTracingBufferUsage: function(event)
824 { 821 {
825 var usage = /** @type {number} */ (event.data); 822 var usage = /** @type {number} */ (event.data);
826 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun d(usage * 100))); 823 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun d(usage * 100)));
(...skipping 20 matching lines...) Expand all
847 if (this._progressElement) 844 if (this._progressElement)
848 this._progressElement.remove(); 845 this._progressElement.remove();
849 delete this._progressElement; 846 delete this._progressElement;
850 }, 847 },
851 848
852 _onRecordingStopped: function() 849 _onRecordingStopped: function()
853 { 850 {
854 this._stopPending = false; 851 this._stopPending = false;
855 this._updateToggleTimelineButton(false); 852 this._updateToggleTimelineButton(false);
856 if (this._lazyFrameModel) { 853 if (this._lazyFrameModel) {
854 this._lazyFrameModel.reset();
857 if (this._tracingTimelineModel) { 855 if (this._tracingTimelineModel) {
858 this._lazyFrameModel.reset();
859 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i nspectedTargetEvents(), this._tracingModel.sessionId()); 856 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i nspectedTargetEvents(), this._tracingModel.sessionId());
860 this._overviewPane.update(); 857 this._overviewPane.update();
861 } else if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isE nabled()) { 858 } else {
862 this._lazyFrameModel.reset();
863 this._lazyFrameModel.addRecords(this._model.records()); 859 this._lazyFrameModel.addRecords(this._model.records());
864 } 860 }
865 } 861 }
866 if (this._tracingTimelineModel) { 862 if (this._tracingTimelineModel) {
867 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime (), this._tracingTimelineModel.maximumRecordTime()); 863 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime (), this._tracingTimelineModel.maximumRecordTime());
868 this._refreshViews(); 864 this._refreshViews();
869 } 865 }
870 this._hideProgressPane(); 866 this._hideProgressPane();
871 }, 867 },
872 868
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 * @param {!WebInspector.TimelineModel.Record} record 1473 * @param {!WebInspector.TimelineModel.Record} record
1478 * @return {boolean} 1474 * @return {boolean}
1479 */ 1475 */
1480 accept: function(record) 1476 accept: function(record)
1481 { 1477 {
1482 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex); 1478 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex);
1483 }, 1479 },
1484 1480
1485 __proto__: WebInspector.TimelineModel.Filter.prototype 1481 __proto__: WebInspector.TimelineModel.Filter.prototype
1486 } 1482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698