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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 this._windowStartTime = 0; | 72 this._windowStartTime = 0; |
73 this._windowEndTime = Infinity; | 73 this._windowEndTime = Infinity; |
74 | 74 |
75 // Create model. | 75 // Create model. |
76 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled() || | 76 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled() || |
77 WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { | 77 WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { |
78 this._tracingModel = new WebInspector.TracingModel(WebInspector.targetMa
nager.activeTarget()); | 78 this._tracingModel = new WebInspector.TracingModel(WebInspector.targetMa
nager.activeTarget()); |
79 this._tracingModel.addEventListener(WebInspector.TracingModel.Events.Buf
ferUsage, this._onTracingBufferUsage, this); | 79 this._tracingModel.addEventListener(WebInspector.TracingModel.Events.Buf
ferUsage, this._onTracingBufferUsage, this); |
80 | 80 |
81 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this.
_tracingModel); | 81 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this.
_tracingModel); |
82 this._tracingTimelineModel.addEventListener(WebInspector.TracingTimeline
Model.Events.TracingComplete, this._onTracingComplete, this); | |
83 | |
84 this._model = this._tracingTimelineModel; | 82 this._model = this._tracingTimelineModel; |
85 } else { | 83 } else { |
86 this._model = new WebInspector.TimelineModelImpl(WebInspector.timelineMa
nager); | 84 this._model = new WebInspector.TimelineModelImpl(WebInspector.timelineMa
nager); |
87 } | 85 } |
88 | 86 |
89 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 87 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
90 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); | 88 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); |
91 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); | 89 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); |
92 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg
ress, this._onRecordingProgress, this); | 90 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg
ress, this._onRecordingProgress, this); |
93 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); | 91 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 }, | 196 }, |
199 | 197 |
200 /** | 198 /** |
201 * @return {number} | 199 * @return {number} |
202 */ | 200 */ |
203 windowStartTime: function() | 201 windowStartTime: function() |
204 { | 202 { |
205 if (this._windowStartTime) | 203 if (this._windowStartTime) |
206 return this._windowStartTime; | 204 return this._windowStartTime; |
207 var minimumRecordTime = this._model.minimumRecordTime(); | 205 var minimumRecordTime = this._model.minimumRecordTime(); |
208 if (minimumRecordTime && minimumRecordTime != -1) | 206 if (minimumRecordTime && minimumRecordTime !== -1) |
209 return minimumRecordTime; | 207 return minimumRecordTime; |
210 return 0; | 208 return 0; |
211 }, | 209 }, |
212 | 210 |
213 /** | 211 /** |
214 * @return {number} | 212 * @return {number} |
215 */ | 213 */ |
216 windowEndTime: function() | 214 windowEndTime: function() |
217 { | 215 { |
218 if (this._windowEndTime < Infinity) | 216 if (this._windowEndTime < Infinity) |
219 return this._windowEndTime; | 217 return this._windowEndTime; |
220 var maximumRecordTime = this._model.maximumRecordTime(); | 218 var maximumRecordTime = this._model.maximumRecordTime(); |
221 if (maximumRecordTime && maximumRecordTime != -1) | 219 if (maximumRecordTime && maximumRecordTime !== -1) |
222 return maximumRecordTime; | 220 return maximumRecordTime; |
223 return Infinity; | 221 return Infinity; |
224 }, | 222 }, |
225 | 223 |
226 /** | 224 /** |
227 * @param {!WebInspector.Event} event | 225 * @param {!WebInspector.Event} event |
228 */ | 226 */ |
229 _sidebarResized: function(event) | 227 _sidebarResized: function(event) |
230 { | 228 { |
231 var width = /** @type {number} */ (event.data); | 229 var width = /** @type {number} */ (event.data); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 666 |
669 _stopRecording: function() | 667 _stopRecording: function() |
670 { | 668 { |
671 this._userInitiatedRecording = false; | 669 this._userInitiatedRecording = false; |
672 this._model.stopRecording(); | 670 this._model.stopRecording(); |
673 | 671 |
674 for (var i = 0; i < this._overviewControls.length; ++i) | 672 for (var i = 0; i < this._overviewControls.length; ++i) |
675 this._overviewControls[i].timelineStopped(); | 673 this._overviewControls[i].timelineStopped(); |
676 }, | 674 }, |
677 | 675 |
678 _onTracingComplete: function() | |
679 { | |
680 if (this._lazyFrameModel) { | |
681 this._lazyFrameModel.reset(); | |
682 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.inspe
ctedTargetEvents(), this._tracingModel.sessionId()); | |
683 this._overviewPane.update(); | |
684 } | |
685 this._refreshViews(); | |
686 }, | |
687 | |
688 _onProfilingStateChanged: function() | 676 _onProfilingStateChanged: function() |
689 { | 677 { |
690 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); | 678 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); |
691 }, | 679 }, |
692 | 680 |
693 /** | 681 /** |
694 * @param {boolean} toggled | 682 * @param {boolean} toggled |
695 */ | 683 */ |
696 _updateToggleTimelineButton: function(toggled) | 684 _updateToggleTimelineButton: function(toggled) |
697 { | 685 { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 _hideProgressPane: function() | 781 _hideProgressPane: function() |
794 { | 782 { |
795 if (this._progressElement) | 783 if (this._progressElement) |
796 this._progressElement.remove(); | 784 this._progressElement.remove(); |
797 delete this._progressElement; | 785 delete this._progressElement; |
798 }, | 786 }, |
799 | 787 |
800 _onRecordingStopped: function() | 788 _onRecordingStopped: function() |
801 { | 789 { |
802 this._updateToggleTimelineButton(false); | 790 this._updateToggleTimelineButton(false); |
803 if (this._lazyFrameModel && WebInspector.experimentsSettings.timelineNoL
iveUpdate.isEnabled()) { | 791 if (this._lazyFrameModel) { |
804 this._lazyFrameModel.reset(); | 792 if (this._tracingTimelineModel) { |
805 this._lazyFrameModel.addRecords(this._model.records()); | 793 this._lazyFrameModel.reset(); |
| 794 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i
nspectedTargetEvents(), this._tracingModel.sessionId()); |
| 795 this._overviewPane.update(); |
| 796 } else if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isE
nabled()) { |
| 797 this._lazyFrameModel.reset(); |
| 798 this._lazyFrameModel.addRecords(this._model.records()); |
| 799 } |
806 } | 800 } |
| 801 if (this._tracingTimelineModel) |
| 802 this._refreshViews(); |
807 this._hideProgressPane(); | 803 this._hideProgressPane(); |
808 }, | 804 }, |
809 | 805 |
810 _onRecordAdded: function(event) | 806 _onRecordAdded: function(event) |
811 { | 807 { |
812 this._addRecord(/** @type {!WebInspector.TimelineModel.Record} */(event.
data)); | 808 this._addRecord(/** @type {!WebInspector.TimelineModel.Record} */(event.
data)); |
813 }, | 809 }, |
814 | 810 |
815 /** | 811 /** |
816 * @param {!WebInspector.TimelineModel.Record} record | 812 * @param {!WebInspector.TimelineModel.Record} record |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 * @param {!WebInspector.TimelineModel.Record} record | 1422 * @param {!WebInspector.TimelineModel.Record} record |
1427 * @return {boolean} | 1423 * @return {boolean} |
1428 */ | 1424 */ |
1429 accept: function(record) | 1425 accept: function(record) |
1430 { | 1426 { |
1431 return !this._hiddenRecords[record.type()]; | 1427 return !this._hiddenRecords[record.type()]; |
1432 }, | 1428 }, |
1433 | 1429 |
1434 __proto__: WebInspector.TimelineModel.Filter.prototype | 1430 __proto__: WebInspector.TimelineModel.Filter.prototype |
1435 } | 1431 } |
OLD | NEW |