Chromium Code Reviews| 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 * @unrestricted | 31 * @unrestricted |
| 32 */ | 32 */ |
| 33 Timeline.TimelineFlameChartDataProvider = class extends Timeline.TimelineFlameCh artDataProviderBase { | 33 Timeline.TimelineFlameChartDataProvider = class extends Timeline.TimelineFlameCh artDataProviderBase { |
| 34 /** | 34 /** |
| 35 * @param {!TimelineModel.TimelineModel} model | 35 * @param {!TimelineModel.TimelineModel} model |
| 36 * @param {!TimelineModel.TimelineFrameModel} frameModel | 36 * @param {!TimelineModel.TimelineFrameModel} frameModel |
| 37 * @param {!TimelineModel.TimelineIRModel} irModel | 37 * @param {!TimelineModel.TimelineIRModel} irModel |
| 38 * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters | 38 * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters |
| 39 */ | 39 */ |
| 40 constructor(model, frameModel, irModel, filters) { | 40 constructor(model, frameModel, irModel, filters) { |
| 41 super(model, filters); | 41 super(); |
| 42 this._model = model; | |
| 43 this._filters = filters; | |
| 44 /** @type {?UI.FlameChart.TimelineData} */ | |
| 45 this._timelineData = null; | |
| 42 this._frameModel = frameModel; | 46 this._frameModel = frameModel; |
| 43 this._irModel = irModel; | 47 this._irModel = irModel; |
| 44 this._consoleColorGenerator = | 48 this._consoleColorGenerator = |
| 45 new UI.FlameChart.ColorGenerator({min: 30, max: 55}, {min: 70, max: 100, count: 6}, 50, 0.7); | 49 new UI.FlameChart.ColorGenerator({min: 30, max: 55}, {min: 70, max: 100, count: 6}, 50, 0.7); |
| 50 const font = this.font(); | |
| 46 | 51 |
| 47 this._headerLevel1 = { | 52 this._headerLevel1 = { |
| 48 padding: 4, | 53 padding: 4, |
| 49 height: 17, | 54 height: 17, |
| 50 collapsible: true, | 55 collapsible: true, |
| 51 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), | 56 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), |
| 52 font: this._font, | 57 font: font, |
| 53 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), | 58 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), |
| 54 nestingLevel: 0 | 59 nestingLevel: 0 |
| 55 }; | 60 }; |
| 56 | 61 |
| 57 this._headerLevel2 = { | 62 this._headerLevel2 = { |
| 58 padding: 2, | 63 padding: 2, |
| 59 height: 17, | 64 height: 17, |
| 60 collapsible: false, | 65 collapsible: false, |
| 61 font: this._font, | 66 font: font, |
| 62 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), | 67 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), |
| 63 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), | 68 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), |
| 64 nestingLevel: 1, | 69 nestingLevel: 1, |
| 65 shareHeaderLine: true | 70 shareHeaderLine: true |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 this._interactionsHeaderLevel1 = { | 73 this._interactionsHeaderLevel1 = { |
| 69 padding: 4, | 74 padding: 4, |
| 70 height: 17, | 75 height: 17, |
| 71 collapsible: true, | 76 collapsible: true, |
| 72 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), | 77 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), |
| 73 font: this._font, | 78 font: font, |
| 74 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), | 79 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), |
| 75 nestingLevel: 0, | 80 nestingLevel: 0, |
| 76 useFirstLineForOverview: true, | 81 useFirstLineForOverview: true, |
| 77 shareHeaderLine: true | 82 shareHeaderLine: true |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 this._interactionsHeaderLevel2 = { | 85 this._interactionsHeaderLevel2 = { |
| 81 padding: 2, | 86 padding: 2, |
| 82 height: 17, | 87 height: 17, |
| 83 collapsible: true, | 88 collapsible: true, |
| 84 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), | 89 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), |
| 85 font: this._font, | 90 font: font, |
| 86 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), | 91 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), |
| 87 nestingLevel: 1, | 92 nestingLevel: 1, |
| 88 shareHeaderLine: true | 93 shareHeaderLine: true |
| 89 }; | 94 }; |
| 90 } | 95 } |
| 91 | 96 |
| 92 /** | 97 /** |
| 93 * @override | 98 * @override |
| 94 * @param {number} entryIndex | 99 * @param {number} entryIndex |
| 95 * @return {?string} | 100 * @return {?string} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 return '#888'; | 133 return '#888'; |
| 129 else | 134 else |
| 130 return super.textColor(index); | 135 return super.textColor(index); |
| 131 } | 136 } |
| 132 | 137 |
| 133 /** | 138 /** |
| 134 * @override | 139 * @override |
| 135 */ | 140 */ |
| 136 reset() { | 141 reset() { |
| 137 super.reset(); | 142 super.reset(); |
| 143 this._timelineData = null; | |
| 138 /** @type {!Array<!SDK.TracingModel.Event|!TimelineModel.TimelineFrame|!Time lineModel.TimelineIRModel.Phases>} */ | 144 /** @type {!Array<!SDK.TracingModel.Event|!TimelineModel.TimelineFrame|!Time lineModel.TimelineIRModel.Phases>} */ |
| 139 this._entryData = []; | 145 this._entryData = []; |
| 140 /** @type {!Array<!Timeline.TimelineFlameChartEntryType>} */ | 146 /** @type {!Array<!Timeline.TimelineFlameChartEntryType>} */ |
| 141 this._entryTypeByLevel = []; | 147 this._entryTypeByLevel = []; |
| 142 /** @type {!Array<string>} */ | 148 /** @type {!Array<string>} */ |
| 143 this._entryIndexToTitle = []; | 149 this._entryIndexToTitle = []; |
| 144 /** @type {!Array<!Timeline.TimelineFlameChartMarker>} */ | 150 /** @type {!Array<!Timeline.TimelineFlameChartMarker>} */ |
| 145 this._markers = []; | 151 this._markers = []; |
| 146 /** @type {!Map<!Timeline.TimelineCategory, string>} */ | 152 /** @type {!Map<!Timeline.TimelineCategory, string>} */ |
| 147 this._asyncColorByCategory = new Map(); | 153 this._asyncColorByCategory = new Map(); |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 } | 693 } |
| 688 | 694 |
| 689 /** | 695 /** |
| 690 * @param {!SDK.TracingModel.Event} event | 696 * @param {!SDK.TracingModel.Event} event |
| 691 * @return {?Timeline.TimelineSelection} selection | 697 * @return {?Timeline.TimelineSelection} selection |
| 692 */ | 698 */ |
| 693 selectionForEvent(event) { | 699 selectionForEvent(event) { |
| 694 var entryIndex = this._entryData.indexOf(event); | 700 var entryIndex = this._entryData.indexOf(event); |
| 695 return this.createSelection(entryIndex); | 701 return this.createSelection(entryIndex); |
| 696 } | 702 } |
| 703 | |
| 704 /** | |
| 705 * @param {!SDK.TracingModel.Event} event | |
| 706 * @return {boolean} | |
| 707 */ | |
| 708 _isVisible(event) { | |
| 709 return this._filters.every(function(filter) { | |
|
alph
2016/12/09 05:53:37
arrow function plz
| |
| 710 return filter.accept(event); | |
| 711 }); | |
| 712 } | |
| 697 }; | 713 }; |
| 698 | 714 |
| 699 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; | 715 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; |
| OLD | NEW |