| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Timeline.TimelineDetailsView = class extends UI.VBox { | 8 Timeline.TimelineDetailsView = class extends UI.VBox { |
| 9 /** | 9 /** |
| 10 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters | 10 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 this._setContent(content); | 197 this._setContent(content); |
| 198 if (event.name === TimelineModel.TimelineModel.RecordType.Paint || | 198 if (event.name === TimelineModel.TimelineModel.RecordType.Paint || |
| 199 event.name === TimelineModel.TimelineModel.RecordType.RasterTask) | 199 event.name === TimelineModel.TimelineModel.RecordType.RasterTask) |
| 200 this._showEventInPaintProfiler(event); | 200 this._showEventInPaintProfiler(event); |
| 201 } | 201 } |
| 202 | 202 |
| 203 /** | 203 /** |
| 204 * @param {!SDK.TracingModel.Event} event | 204 * @param {!SDK.TracingModel.Event} event |
| 205 */ | 205 */ |
| 206 _showEventInPaintProfiler(event) { | 206 _showEventInPaintProfiler(event) { |
| 207 const target = SDK.targetManager.mainTarget(); | 207 const paintProfilerModel = SDK.targetManager.models(SDK.PaintProfilerModel)[
0]; |
| 208 if (!target) | 208 if (!paintProfilerModel) |
| 209 return; | 209 return; |
| 210 const paintProfilerView = this._paintProfilerView(); | 210 const paintProfilerView = this._paintProfilerView(); |
| 211 const hasProfileData = paintProfilerView.setEvent(target, event); | 211 const hasProfileData = paintProfilerView.setEvent(paintProfilerModel, event)
; |
| 212 if (!hasProfileData) | 212 if (!hasProfileData) |
| 213 return; | 213 return; |
| 214 if (this._tabbedPane.hasTab(Timeline.TimelineDetailsView.Tab.PaintProfiler)) | 214 if (this._tabbedPane.hasTab(Timeline.TimelineDetailsView.Tab.PaintProfiler)) |
| 215 return; | 215 return; |
| 216 this._appendTab( | 216 this._appendTab( |
| 217 Timeline.TimelineDetailsView.Tab.PaintProfiler, Common.UIString('Paint P
rofiler'), paintProfilerView); | 217 Timeline.TimelineDetailsView.Tab.PaintProfiler, Common.UIString('Paint P
rofiler'), paintProfilerView); |
| 218 } | 218 } |
| 219 | 219 |
| 220 /** | 220 /** |
| 221 * @param {number} startTime | 221 * @param {number} startTime |
| 222 * @param {number} endTime | 222 * @param {number} endTime |
| 223 */ | 223 */ |
| 224 _updateSelectedRangeStats(startTime, endTime) { | 224 _updateSelectedRangeStats(startTime, endTime) { |
| 225 if (this._model) | 225 if (this._model) |
| 226 this._setContent(Timeline.TimelineUIUtils.buildRangeStats(this._model.time
lineModel(), startTime, endTime)); | 226 this._setContent(Timeline.TimelineUIUtils.buildRangeStats(this._model.time
lineModel(), startTime, endTime)); |
| 227 } | 227 } |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 /** | 230 /** |
| 231 * @enum {string} | 231 * @enum {string} |
| 232 */ | 232 */ |
| 233 Timeline.TimelineDetailsView.Tab = { | 233 Timeline.TimelineDetailsView.Tab = { |
| 234 Details: 'Details', | 234 Details: 'Details', |
| 235 EventLog: 'EventLog', | 235 EventLog: 'EventLog', |
| 236 CallTree: 'CallTree', | 236 CallTree: 'CallTree', |
| 237 BottomUp: 'BottomUp', | 237 BottomUp: 'BottomUp', |
| 238 PaintProfiler: 'PaintProfiler', | 238 PaintProfiler: 'PaintProfiler', |
| 239 LayerViewer: 'LayerViewer' | 239 LayerViewer: 'LayerViewer' |
| 240 }; | 240 }; |
| OLD | NEW |