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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 this._detailsLinkifier = new WebInspector.Linkifier(); | 45 this._detailsLinkifier = new WebInspector.Linkifier(); |
46 this._windowStartTime = 0; | 46 this._windowStartTime = 0; |
47 this._windowEndTime = Infinity; | 47 this._windowEndTime = Infinity; |
48 | 48 |
49 // Create model. | 49 // Create model. |
50 this._tracingManager = new WebInspector.TracingManager(); | 50 this._tracingManager = new WebInspector.TracingManager(); |
51 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Buf
ferUsage, this._onTracingBufferUsage, this); | 51 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Buf
ferUsage, this._onTracingBufferUsage, this); |
52 | 52 |
53 this._tracingModel = new WebInspector.TracingModel(); | 53 this._tracingModel = new WebInspector.TracingModel(); |
54 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this._tra
cingManager, this._tracingModel, WebInspector.TimelineUIUtils.hiddenRecordsFilte
r()); | 54 this._model = new WebInspector.TimelineModel(this._tracingManager, this._tra
cingModel, WebInspector.TimelineUIUtils.hiddenRecordsFilter()); |
55 this._model = this._tracingTimelineModel; | |
56 | 55 |
57 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 56 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); | 57 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); |
59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); | 58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); |
60 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); | 59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); |
61 | 60 |
62 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); | 61 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); |
63 this._durationFilter = new WebInspector.TimelineIsLongFilter(); | 62 this._durationFilter = new WebInspector.TimelineIsLongFilter(); |
64 this._textFilter = new WebInspector.TimelineTextFilter(); | 63 this._textFilter = new WebInspector.TimelineTextFilter(); |
65 | 64 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 this._overviewPane.requestWindowTimes(windowStartTime, windowEndTime); | 217 this._overviewPane.requestWindowTimes(windowStartTime, windowEndTime); |
219 }, | 218 }, |
220 | 219 |
221 /** | 220 /** |
222 * @return {!WebInspector.TimelineFrameModelBase} | 221 * @return {!WebInspector.TimelineFrameModelBase} |
223 */ | 222 */ |
224 _frameModel: function() | 223 _frameModel: function() |
225 { | 224 { |
226 if (!this._lazyFrameModel) { | 225 if (!this._lazyFrameModel) { |
227 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel()
; | 226 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel()
; |
228 tracingFrameModel.addTraceEvents(this._tracingTimelineModel.inspecte
dTargetEvents(), this._tracingModel.sessionId() || ""); | 227 tracingFrameModel.addTraceEvents(this._model.inspectedTargetEvents()
, this._tracingModel.sessionId() || ""); |
229 this._lazyFrameModel = tracingFrameModel; | 228 this._lazyFrameModel = tracingFrameModel; |
230 } | 229 } |
231 return this._lazyFrameModel; | 230 return this._lazyFrameModel; |
232 }, | 231 }, |
233 | 232 |
234 /** | 233 /** |
235 * @return {!WebInspector.TimelineView} | 234 * @return {!WebInspector.TimelineView} |
236 */ | 235 */ |
237 _timelineView: function() | 236 _timelineView: function() |
238 { | 237 { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 this._overviewControls = []; | 582 this._overviewControls = []; |
584 | 583 |
585 if (isFrameMode) | 584 if (isFrameMode) |
586 this._overviewControls.push(new WebInspector.TimelineFrameOverview(t
his._model, this._frameModel())); | 585 this._overviewControls.push(new WebInspector.TimelineFrameOverview(t
his._model, this._frameModel())); |
587 else | 586 else |
588 this._overviewControls.push(new WebInspector.TimelineEventOverview(t
his._model)); | 587 this._overviewControls.push(new WebInspector.TimelineEventOverview(t
his._model)); |
589 | 588 |
590 if (this._flameChartEnabledSetting.get()) { | 589 if (this._flameChartEnabledSetting.get()) { |
591 this._filterBar.filterButton().setEnabled(false); | 590 this._filterBar.filterButton().setEnabled(false); |
592 this._filtersContainer.classList.toggle("hidden", true); | 591 this._filtersContainer.classList.toggle("hidden", true); |
593 this._addModeView(new WebInspector.TimelineFlameChart(this, this._tr
acingTimelineModel, this._frameModel())); | 592 this._addModeView(new WebInspector.TimelineFlameChart(this, this._mo
del, this._frameModel())); |
594 } else { | 593 } else { |
595 this._filterBar.filterButton().setEnabled(true); | 594 this._filterBar.filterButton().setEnabled(true); |
596 this._filtersContainer.classList.toggle("hidden", !this._filterBar.f
iltersToggled()); | 595 this._filtersContainer.classList.toggle("hidden", !this._filterBar.f
iltersToggled()); |
597 this._addModeView(this._timelineView()); | 596 this._addModeView(this._timelineView()); |
598 } | 597 } |
599 | 598 |
600 if (this._captureMemorySetting.get()) { | 599 if (this._captureMemorySetting.get()) { |
601 if (!isFrameMode) // Frame mode skews time, don't render aux overvi
ews. | 600 if (!isFrameMode) // Frame mode skews time, don't render aux overvi
ews. |
602 this._overviewControls.push(new WebInspector.TimelineMemoryOverv
iew(this._model)); | 601 this._overviewControls.push(new WebInspector.TimelineMemoryOverv
iew(this._model)); |
603 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m
odel)); | 602 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m
odel)); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 this._progressElement.remove(); | 782 this._progressElement.remove(); |
784 delete this._progressElement; | 783 delete this._progressElement; |
785 }, | 784 }, |
786 | 785 |
787 _onRecordingStopped: function() | 786 _onRecordingStopped: function() |
788 { | 787 { |
789 this._stopPending = false; | 788 this._stopPending = false; |
790 this._updateToggleTimelineButton(false); | 789 this._updateToggleTimelineButton(false); |
791 if (this._lazyFrameModel) { | 790 if (this._lazyFrameModel) { |
792 this._lazyFrameModel.reset(); | 791 this._lazyFrameModel.reset(); |
793 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.inspe
ctedTargetEvents(), this._tracingModel.sessionId()); | 792 this._lazyFrameModel.addTraceEvents(this._model.inspectedTargetEvent
s(), this._tracingModel.sessionId()); |
794 } | 793 } |
795 this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime(),
this._tracingTimelineModel.maximumRecordTime()); | 794 this.requestWindowTimes(this._model.minimumRecordTime(), this._model.max
imumRecordTime()); |
796 this._refreshViews(); | 795 this._refreshViews(); |
797 this._hideProgressPane(); | 796 this._hideProgressPane(); |
798 this._overviewPane.update(); | 797 this._overviewPane.update(); |
799 this._updateSearchHighlight(false, true); | 798 this._updateSearchHighlight(false, true); |
800 }, | 799 }, |
801 | 800 |
802 /** | 801 /** |
803 * @param {!WebInspector.Event} event | 802 * @param {!WebInspector.Event} event |
804 */ | 803 */ |
805 _willReloadPage: function(event) | 804 _willReloadPage: function(event) |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 | 950 |
952 _updateSelectionDetails: function() | 951 _updateSelectionDetails: function() |
953 { | 952 { |
954 if (!this._selection) | 953 if (!this._selection) |
955 this._selection = WebInspector.TimelineSelection.fromRange(this._win
dowStartTime, this._windowEndTime); | 954 this._selection = WebInspector.TimelineSelection.fromRange(this._win
dowStartTime, this._windowEndTime); |
956 | 955 |
957 switch (this._selection.type()) { | 956 switch (this._selection.type()) { |
958 case WebInspector.TimelineSelection.Type.Record: | 957 case WebInspector.TimelineSelection.Type.Record: |
959 var record = /** @type {!WebInspector.TimelineModel.Record} */ (this
._selection.object()); | 958 var record = /** @type {!WebInspector.TimelineModel.Record} */ (this
._selection.object()); |
960 var event = record.traceEvent(); | 959 var event = record.traceEvent(); |
961 WebInspector.TimelineUIUtils.buildTraceEventDetails(event, this._tra
cingTimelineModel, this._detailsLinkifier, this._appendDetailsTabsForTraceEventA
ndShowDetails.bind(this, event)); | 960 WebInspector.TimelineUIUtils.buildTraceEventDetails(event, this._mod
el, this._detailsLinkifier, this._appendDetailsTabsForTraceEventAndShowDetails.b
ind(this, event)); |
962 break; | 961 break; |
963 case WebInspector.TimelineSelection.Type.TraceEvent: | 962 case WebInspector.TimelineSelection.Type.TraceEvent: |
964 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._s
election.object()); | 963 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._s
election.object()); |
965 WebInspector.TimelineUIUtils.buildTraceEventDetails(event, this._tra
cingTimelineModel, this._detailsLinkifier, this._appendDetailsTabsForTraceEventA
ndShowDetails.bind(this, event)); | 964 WebInspector.TimelineUIUtils.buildTraceEventDetails(event, this._mod
el, this._detailsLinkifier, this._appendDetailsTabsForTraceEventAndShowDetails.b
ind(this, event)); |
966 break; | 965 break; |
967 case WebInspector.TimelineSelection.Type.Frame: | 966 case WebInspector.TimelineSelection.Type.Frame: |
968 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._select
ion.object()); | 967 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._select
ion.object()); |
969 this.showInDetails(WebInspector.TimelineUIUtils.generateDetailsConte
ntForFrame(this._lazyFrameModel, frame)); | 968 this.showInDetails(WebInspector.TimelineUIUtils.generateDetailsConte
ntForFrame(this._lazyFrameModel, frame)); |
970 if (frame.layerTree) { | 969 if (frame.layerTree) { |
971 var layersView = this._layersView(); | 970 var layersView = this._layersView(); |
972 layersView.showLayerTree(frame.layerTree, frame.paints); | 971 layersView.showLayerTree(frame.layerTree, frame.paints); |
973 this._detailsView.appendTab(WebInspector.TimelinePanel.DetailsTa
b.LayerViewer, WebInspector.UIString("Layers"), layersView); | 972 this._detailsView.appendTab(WebInspector.TimelinePanel.DetailsTa
b.LayerViewer, WebInspector.UIString("Layers"), layersView); |
974 } | 973 } |
975 break; | 974 break; |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 | 1468 |
1470 WebInspector.TimelinePanelFactory.prototype = { | 1469 WebInspector.TimelinePanelFactory.prototype = { |
1471 /** | 1470 /** |
1472 * @return {!WebInspector.Panel} | 1471 * @return {!WebInspector.Panel} |
1473 */ | 1472 */ |
1474 createPanel: function() | 1473 createPanel: function() |
1475 { | 1474 { |
1476 return WebInspector.TimelinePanel._instance(); | 1475 return WebInspector.TimelinePanel._instance(); |
1477 } | 1476 } |
1478 } | 1477 } |
OLD | NEW |