| 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 20 matching lines...) Expand all Loading... |
| 31 /** | 31 /** |
| 32 * @implements {PerfUI.FlameChartDataProvider} | 32 * @implements {PerfUI.FlameChartDataProvider} |
| 33 * @unrestricted | 33 * @unrestricted |
| 34 */ | 34 */ |
| 35 Timeline.TimelineFlameChartDataProvider = class { | 35 Timeline.TimelineFlameChartDataProvider = class { |
| 36 /** | 36 /** |
| 37 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters | 37 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters |
| 38 */ | 38 */ |
| 39 constructor(filters) { | 39 constructor(filters) { |
| 40 this.reset(); | 40 this.reset(); |
| 41 this._font = '11px ' + Host.fontFamily(); | 41 var font = '11px ' + Host.fontFamily(); |
| 42 this._font = font; |
| 42 this._filters = filters; | 43 this._filters = filters; |
| 43 /** @type {?PerfUI.FlameChart.TimelineData} */ | 44 /** @type {?PerfUI.FlameChart.TimelineData} */ |
| 44 this._timelineData = null; | 45 this._timelineData = null; |
| 45 this._currentLevel = 0; | 46 this._currentLevel = 0; |
| 46 /** @type {?Timeline.PerformanceModel} */ | 47 /** @type {?Timeline.PerformanceModel} */ |
| 47 this._performanceModel = null; | 48 this._performanceModel = null; |
| 48 /** @type {?TimelineModel.TimelineModel} */ | 49 /** @type {?TimelineModel.TimelineModel} */ |
| 49 this._model = null; | 50 this._model = null; |
| 50 | 51 |
| 51 this._consoleColorGenerator = | 52 this._consoleColorGenerator = |
| 52 new PerfUI.FlameChart.ColorGenerator({min: 30, max: 55}, {min: 70, max:
100, count: 6}, 50, 0.7); | 53 new PerfUI.FlameChart.ColorGenerator({min: 30, max: 55}, {min: 70, max:
100, count: 6}, 50, 0.7); |
| 53 this._extensionColorGenerator = | 54 this._extensionColorGenerator = |
| 54 new PerfUI.FlameChart.ColorGenerator({min: 210, max: 300}, {min: 70, max
: 100, count: 6}, 70, 0.7); | 55 new PerfUI.FlameChart.ColorGenerator({min: 210, max: 300}, {min: 70, max
: 100, count: 6}, 70, 0.7); |
| 55 | 56 |
| 56 var defaultGroupStyle = { | 57 /** |
| 57 padding: 4, | 58 * @param {!Object} extra |
| 58 height: 17, | 59 * @return {!PerfUI.FlameChart.GroupStyle} |
| 59 collapsible: true, | 60 */ |
| 60 color: UI.themeSupport.patchColorText('#222', UI.ThemeSupport.ColorUsage.F
oreground), | 61 function buildGroupStyle(extra) { |
| 61 backgroundColor: UI.themeSupport.patchColorText('white', UI.ThemeSupport.C
olorUsage.Background), | 62 var defaultGroupStyle = { |
| 62 font: this._font, | 63 padding: 4, |
| 63 nestingLevel: 0, | 64 height: 17, |
| 64 shareHeaderLine: true | 65 collapsible: true, |
| 65 }; | 66 color: UI.themeSupport.patchColorText('#222', UI.ThemeSupport.ColorUsage
.Foreground), |
| 67 backgroundColor: UI.themeSupport.patchColorText('white', UI.ThemeSupport
.ColorUsage.Background), |
| 68 font: font, |
| 69 nestingLevel: 0, |
| 70 shareHeaderLine: true |
| 71 }; |
| 72 return /** @type {!PerfUI.FlameChart.GroupStyle} */ (Object.assign(default
GroupStyle, extra)); |
| 73 } |
| 66 | 74 |
| 67 this._headerLevel1 = /** @type {!PerfUI.FlameChart.GroupStyle} */ | 75 this._headerLevel1 = buildGroupStyle({shareHeaderLine: false}); |
| 68 (Object.assign({}, defaultGroupStyle, {shareHeaderLine: false})); | 76 this._headerLevel2 = buildGroupStyle({padding: 2, nestingLevel: 1, collapsib
le: false}); |
| 69 this._headerLevel2 = /** @type {!PerfUI.FlameChart.GroupStyle} */ | 77 this._staticHeader = buildGroupStyle({collapsible: false}); |
| 70 (Object.assign({}, defaultGroupStyle, {padding: 2, nestingLevel: 1, coll
apsible: false})); | 78 this._interactionsHeaderLevel1 = buildGroupStyle({useFirstLineForOverview: t
rue}); |
| 71 this._staticHeader = /** @type {!PerfUI.FlameChart.GroupStyle} */ | 79 this._interactionsHeaderLevel2 = buildGroupStyle({padding: 2, nestingLevel:
1}); |
| 72 (Object.assign({}, defaultGroupStyle, {collapsible: false})); | |
| 73 this._interactionsHeaderLevel1 = /** @type {!PerfUI.FlameChart.GroupStyle} *
/ | |
| 74 (Object.assign({useFirstLineForOverview: true}, defaultGroupStyle)); | |
| 75 this._interactionsHeaderLevel2 = /** @type {!PerfUI.FlameChart.GroupStyle} *
/ | |
| 76 (Object.assign({}, defaultGroupStyle, {padding: 2, nestingLevel: 1})); | |
| 77 | 80 |
| 78 /** @type {!Map<string, number>} */ | 81 /** @type {!Map<string, number>} */ |
| 79 this._flowEventIndexById = new Map(); | 82 this._flowEventIndexById = new Map(); |
| 80 } | 83 } |
| 81 | 84 |
| 82 /** | 85 /** |
| 83 * @param {?Timeline.PerformanceModel} performanceModel | 86 * @param {?Timeline.PerformanceModel} performanceModel |
| 84 */ | 87 */ |
| 85 setModel(performanceModel) { | 88 setModel(performanceModel) { |
| 86 this.reset(); | 89 this.reset(); |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 */ | 913 */ |
| 911 eventByIndex(entryIndex) { | 914 eventByIndex(entryIndex) { |
| 912 return this._entryType(entryIndex) === Timeline.TimelineFlameChartEntryType.
Event ? | 915 return this._entryType(entryIndex) === Timeline.TimelineFlameChartEntryType.
Event ? |
| 913 /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) : | 916 /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) : |
| 914 null; | 917 null; |
| 915 } | 918 } |
| 916 }; | 919 }; |
| 917 | 920 |
| 918 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; | 921 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; |
| 919 Timeline.TimelineFlameChartDataProvider._indexSymbol = Symbol('index'); | 922 Timeline.TimelineFlameChartDataProvider._indexSymbol = Symbol('index'); |
| OLD | NEW |