| OLD | NEW |
| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 _frameModel: function() | 273 _frameModel: function() |
| 274 { | 274 { |
| 275 if (this._lazyFrameModel) | 275 if (this._lazyFrameModel) |
| 276 return this._lazyFrameModel; | 276 return this._lazyFrameModel; |
| 277 if (this._tracingModel) { | 277 if (this._tracingModel) { |
| 278 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel()
; | 278 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel()
; |
| 279 tracingFrameModel.addTraceEvents(this._tracingTimelineModel.inspecte
dTargetEvents(), this._tracingModel.sessionId() || ""); | 279 tracingFrameModel.addTraceEvents(this._tracingTimelineModel.inspecte
dTargetEvents(), this._tracingModel.sessionId() || ""); |
| 280 this._lazyFrameModel = tracingFrameModel; | 280 this._lazyFrameModel = tracingFrameModel; |
| 281 } else { | 281 } else { |
| 282 var frameModel = new WebInspector.TimelineFrameModel(); | 282 var frameModel = new WebInspector.TimelineFrameModel(); |
| 283 frameModel.setMergeRecords(!WebInspector.experimentsSettings.timelin
eNoLiveUpdate.isEnabled() || !this._recordingInProgress); | 283 frameModel.setMergeRecords(!this._recordingInProgress); |
| 284 frameModel.addRecords(this._model.records()); | 284 frameModel.addRecords(this._model.records()); |
| 285 this._lazyFrameModel = frameModel; | 285 this._lazyFrameModel = frameModel; |
| 286 } | 286 } |
| 287 return this._lazyFrameModel; | 287 return this._lazyFrameModel; |
| 288 }, | 288 }, |
| 289 | 289 |
| 290 /** | 290 /** |
| 291 * @return {!WebInspector.TimelineView} | 291 * @return {!WebInspector.TimelineView} |
| 292 */ | 292 */ |
| 293 _timelineView: function() | 293 _timelineView: function() |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 WebInspector.inspectorView.setCurrentPanelLocked(!enabled); | 699 WebInspector.inspectorView.setCurrentPanelLocked(!enabled); |
| 700 }, | 700 }, |
| 701 | 701 |
| 702 /** | 702 /** |
| 703 * @param {boolean} userInitiated | 703 * @param {boolean} userInitiated |
| 704 */ | 704 */ |
| 705 _startRecording: function(userInitiated) | 705 _startRecording: function(userInitiated) |
| 706 { | 706 { |
| 707 this._userInitiatedRecording = userInitiated; | 707 this._userInitiatedRecording = userInitiated; |
| 708 this._model.startRecording(this._captureStacksSetting.get(), this._captu
reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay
ersAndPicturesSetting.get()); | 708 this._model.startRecording(this._captureStacksSetting.get(), this._captu
reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay
ersAndPicturesSetting.get()); |
| 709 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() &&
this._lazyFrameModel) | 709 if (this._lazyFrameModel) |
| 710 this._lazyFrameModel.setMergeRecords(false); | 710 this._lazyFrameModel.setMergeRecords(false); |
| 711 | 711 |
| 712 for (var i = 0; i < this._overviewControls.length; ++i) | 712 for (var i = 0; i < this._overviewControls.length; ++i) |
| 713 this._overviewControls[i].timelineStarted(); | 713 this._overviewControls[i].timelineStarted(); |
| 714 | 714 |
| 715 if (userInitiated) | 715 if (userInitiated) |
| 716 WebInspector.userMetrics.TimelineStarted.record(); | 716 WebInspector.userMetrics.TimelineStarted.record(); |
| 717 this._setUIControlsEnabled(false); | 717 this._setUIControlsEnabled(false); |
| 718 }, | 718 }, |
| 719 | 719 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 for (var i = 0; i < this._currentViews.length; ++i) | 795 for (var i = 0; i < this._currentViews.length; ++i) |
| 796 this._currentViews[i].reset(); | 796 this._currentViews[i].reset(); |
| 797 for (var i = 0; i < this._overviewControls.length; ++i) | 797 for (var i = 0; i < this._overviewControls.length; ++i) |
| 798 this._overviewControls[i].reset(); | 798 this._overviewControls[i].reset(); |
| 799 this._updateSelectedRangeStats(); | 799 this._updateSelectedRangeStats(); |
| 800 }, | 800 }, |
| 801 | 801 |
| 802 _onRecordingStarted: function() | 802 _onRecordingStarted: function() |
| 803 { | 803 { |
| 804 this._updateToggleTimelineButton(true); | 804 this._updateToggleTimelineButton(true); |
| 805 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) | 805 this._updateProgress(WebInspector.UIString("%d events collected", 0)); |
| 806 this._updateProgress(WebInspector.UIString("%d events collected", 0)
); | |
| 807 }, | 806 }, |
| 808 | 807 |
| 809 _recordingInProgress: function() | 808 _recordingInProgress: function() |
| 810 { | 809 { |
| 811 return this.toggleTimelineButton.toggled; | 810 return this.toggleTimelineButton.toggled; |
| 812 }, | 811 }, |
| 813 | 812 |
| 814 /** | 813 /** |
| 815 * @param {!WebInspector.Event} event | 814 * @param {!WebInspector.Event} event |
| 816 */ | 815 */ |
| 817 _onRecordingProgress: function(event) | 816 _onRecordingProgress: function(event) |
| 818 { | 817 { |
| 819 if (!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) | |
| 820 return; | |
| 821 this._updateProgress(WebInspector.UIString("%d events collected", event.
data)); | 818 this._updateProgress(WebInspector.UIString("%d events collected", event.
data)); |
| 822 }, | 819 }, |
| 823 | 820 |
| 824 /** | 821 /** |
| 825 * @param {!WebInspector.Event} event | 822 * @param {!WebInspector.Event} event |
| 826 */ | 823 */ |
| 827 _onTracingBufferUsage: function(event) | 824 _onTracingBufferUsage: function(event) |
| 828 { | 825 { |
| 829 var usage = /** @type {number} */ (event.data); | 826 var usage = /** @type {number} */ (event.data); |
| 830 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun
d(usage * 100))); | 827 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun
d(usage * 100))); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 851 if (this._progressElement) | 848 if (this._progressElement) |
| 852 this._progressElement.remove(); | 849 this._progressElement.remove(); |
| 853 delete this._progressElement; | 850 delete this._progressElement; |
| 854 }, | 851 }, |
| 855 | 852 |
| 856 _onRecordingStopped: function() | 853 _onRecordingStopped: function() |
| 857 { | 854 { |
| 858 this._stopPending = false; | 855 this._stopPending = false; |
| 859 this._updateToggleTimelineButton(false); | 856 this._updateToggleTimelineButton(false); |
| 860 if (this._lazyFrameModel) { | 857 if (this._lazyFrameModel) { |
| 858 this._lazyFrameModel.reset(); |
| 861 if (this._tracingTimelineModel) { | 859 if (this._tracingTimelineModel) { |
| 862 this._lazyFrameModel.reset(); | |
| 863 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i
nspectedTargetEvents(), this._tracingModel.sessionId()); | 860 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i
nspectedTargetEvents(), this._tracingModel.sessionId()); |
| 864 this._overviewPane.update(); | 861 this._overviewPane.update(); |
| 865 } else if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isE
nabled()) { | 862 } else { |
| 866 this._lazyFrameModel.reset(); | |
| 867 this._lazyFrameModel.addRecords(this._model.records()); | 863 this._lazyFrameModel.addRecords(this._model.records()); |
| 868 } | 864 } |
| 869 } | 865 } |
| 870 if (this._tracingTimelineModel) { | 866 if (this._tracingTimelineModel) { |
| 871 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime
(), this._tracingTimelineModel.maximumRecordTime()); | 867 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime
(), this._tracingTimelineModel.maximumRecordTime()); |
| 872 this._refreshViews(); | 868 this._refreshViews(); |
| 873 } | 869 } |
| 874 this._hideProgressPane(); | 870 this._hideProgressPane(); |
| 875 }, | 871 }, |
| 876 | 872 |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 * @param {!WebInspector.TimelineModel.Record} record | 1477 * @param {!WebInspector.TimelineModel.Record} record |
| 1482 * @return {boolean} | 1478 * @return {boolean} |
| 1483 */ | 1479 */ |
| 1484 accept: function(record) | 1480 accept: function(record) |
| 1485 { | 1481 { |
| 1486 return !this._regex || this._uiUtils.testContentMatching(record, this._r
egex); | 1482 return !this._regex || this._uiUtils.testContentMatching(record, this._r
egex); |
| 1487 }, | 1483 }, |
| 1488 | 1484 |
| 1489 __proto__: WebInspector.TimelineModel.Filter.prototype | 1485 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1490 } | 1486 } |
| OLD | NEW |