OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 * @param {!WebInspector.TimelineFrameModelBase} frameModel | 35 * @param {!WebInspector.TimelineFrameModelBase} frameModel |
36 */ | 36 */ |
37 WebInspector.TimelineFlameChartDataProvider = function(model, frameModel) | 37 WebInspector.TimelineFlameChartDataProvider = function(model, frameModel) |
38 { | 38 { |
39 WebInspector.FlameChartDataProvider.call(this); | 39 WebInspector.FlameChartDataProvider.call(this); |
40 this.reset(); | 40 this.reset(); |
41 this._model = model; | 41 this._model = model; |
42 this._frameModel = frameModel; | 42 this._frameModel = frameModel; |
43 this._font = "12px " + WebInspector.fontFamily(); | 43 this._font = "12px " + WebInspector.fontFamily(); |
44 this._linkifier = new WebInspector.Linkifier(); | 44 this._linkifier = new WebInspector.Linkifier(); |
45 this._captureCausesSetting = WebInspector.settings.createSetting("timelineCa
ptureCauses", true); | 45 if (Runtime.experiments.isEnabled("timelineJSCPUProfile")) |
| 46 this._enableJSSamplingSettingSetting = WebInspector.settings.createSetti
ng("timelineEnableJSSampling", false); |
46 this._filters = []; | 47 this._filters = []; |
47 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); | 48 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); |
48 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte
r([WebInspector.TracingTimelineModel.RecordType.Program])); | 49 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte
r([WebInspector.TracingTimelineModel.RecordType.Program])); |
49 } | 50 } |
50 | 51 |
51 WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.01
; | 52 WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.01
; |
52 WebInspector.TimelineFlameChartDataProvider.JSFrameCoalesceThresholdMs = 1.1; | 53 WebInspector.TimelineFlameChartDataProvider.JSFrameCoalesceThresholdMs = 1.1; |
53 | 54 |
54 /** | 55 /** |
55 * @return {!WebInspector.FlameChart.ColorGenerator} | 56 * @return {!WebInspector.FlameChart.ColorGenerator} |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 }, | 191 }, |
191 | 192 |
192 /** | 193 /** |
193 * @param {string} threadTitle | 194 * @param {string} threadTitle |
194 * @param {!Array.<!WebInspector.TracingModel.Event>} syncEvents | 195 * @param {!Array.<!WebInspector.TracingModel.Event>} syncEvents |
195 * @param {!Array.<!Array.<!WebInspector.TracingModel.Event>>} asyncEvents | 196 * @param {!Array.<!Array.<!WebInspector.TracingModel.Event>>} asyncEvents |
196 */ | 197 */ |
197 _appendThreadTimelineData: function(threadTitle, syncEvents, asyncEvents) | 198 _appendThreadTimelineData: function(threadTitle, syncEvents, asyncEvents) |
198 { | 199 { |
199 var levelCount = this._appendAsyncEvents(threadTitle, asyncEvents); | 200 var levelCount = this._appendAsyncEvents(threadTitle, asyncEvents); |
200 if (Runtime.experiments.isEnabled("timelineJSCPUProfile")) { | 201 if (this._enableJSSamplingSettingSetting && this._enableJSSamplingSettin
gSetting.get()) { |
201 if (this._captureCausesSetting.get()) { | 202 var jsFrameEvents = this._generateJSFrameEvents(syncEvents); |
202 var jsFrameEvents = this._generateJSFrameEvents(syncEvents); | 203 syncEvents = jsFrameEvents.mergeOrdered(syncEvents, WebInspector.Tra
cingModel.Event.orderedCompareStartTime); |
203 syncEvents = jsFrameEvents.mergeOrdered(syncEvents, WebInspector
.TracingModel.Event.orderedCompareStartTime); | |
204 } | |
205 } | 204 } |
206 levelCount += this._appendSyncEvents(levelCount ? null : threadTitle, sy
ncEvents); | 205 levelCount += this._appendSyncEvents(levelCount ? null : threadTitle, sy
ncEvents); |
207 if (levelCount) | 206 if (levelCount) |
208 ++this._currentLevel; | 207 ++this._currentLevel; |
209 }, | 208 }, |
210 | 209 |
211 /** | 210 /** |
212 * @param {?string} headerName | 211 * @param {?string} headerName |
213 * @param {!Array.<!WebInspector.TracingModel.Event>} events | 212 * @param {!Array.<!WebInspector.TracingModel.Event>} events |
214 * @return {boolean} | 213 * @return {boolean} |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 /** | 881 /** |
883 * @constructor | 882 * @constructor |
884 * @param {!WebInspector.TimelineSelection} selection | 883 * @param {!WebInspector.TimelineSelection} selection |
885 * @param {number} entryIndex | 884 * @param {number} entryIndex |
886 */ | 885 */ |
887 WebInspector.TimelineFlameChart.Selection = function(selection, entryIndex) | 886 WebInspector.TimelineFlameChart.Selection = function(selection, entryIndex) |
888 { | 887 { |
889 this.timelineSelection = selection; | 888 this.timelineSelection = selection; |
890 this.entryIndex = entryIndex; | 889 this.entryIndex = entryIndex; |
891 } | 890 } |
OLD | NEW |