| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 * @type {?WebInspector.FlameChart.TimelineData} | 124 * @type {?WebInspector.FlameChart.TimelineData} |
| 125 */ | 125 */ |
| 126 this._timelineData = { | 126 this._timelineData = { |
| 127 entryLevels: [], | 127 entryLevels: [], |
| 128 entryTotalTimes: [], | 128 entryTotalTimes: [], |
| 129 entryStartTimes: [] | 129 entryStartTimes: [] |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 this._records = []; | 132 this._records = []; |
| 133 this._entryThreadDepths = {}; | 133 this._entryThreadDepths = {}; |
| 134 this._minimumBoundary = Math.max(0, this._model.minimumRecordTime()); | 134 this._minimumBoundary = this._model.minimumRecordTime(); |
| 135 | 135 |
| 136 var cpuThreadRecordPayload = { type: WebInspector.TimelineModel.RecordTy
pe.Program }; | 136 var cpuThreadRecordPayload = { type: WebInspector.TimelineModel.RecordTy
pe.Program }; |
| 137 this._cpuThreadRecord = new WebInspector.TimelineModel.RecordImpl(this._
model, /** @type {!TimelineAgent.TimelineEvent} */ (cpuThreadRecordPayload), nul
l); | 137 this._cpuThreadRecord = new WebInspector.TimelineModel.RecordImpl(this._
model, /** @type {!TimelineAgent.TimelineEvent} */ (cpuThreadRecordPayload), nul
l); |
| 138 this._pushRecord(this._cpuThreadRecord, 0, this.minimumBoundary(), Math.
max(this._model.maximumRecordTime(), this.totalTime() + this.minimumBoundary()))
; | 138 this._pushRecord(this._cpuThreadRecord, 0, this.minimumBoundary(), Math.
max(this._model.maximumRecordTime(), this.totalTime() + this.minimumBoundary()))
; |
| 139 | 139 |
| 140 this._gpuThreadRecord = null; | 140 this._gpuThreadRecord = null; |
| 141 | 141 |
| 142 var records = this._model.records(); | 142 var records = this._model.records(); |
| 143 for (var i = 0; i < records.length; ++i) { | 143 for (var i = 0; i < records.length; ++i) { |
| 144 var record = records[i]; | 144 var record = records[i]; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 /** | 542 /** |
| 543 * @type {?WebInspector.FlameChart.TimelineData} | 543 * @type {?WebInspector.FlameChart.TimelineData} |
| 544 */ | 544 */ |
| 545 this._timelineData = { | 545 this._timelineData = { |
| 546 entryLevels: [], | 546 entryLevels: [], |
| 547 entryTotalTimes: [], | 547 entryTotalTimes: [], |
| 548 entryStartTimes: [] | 548 entryStartTimes: [] |
| 549 }; | 549 }; |
| 550 | 550 |
| 551 this._currentLevel = 0; | 551 this._currentLevel = 0; |
| 552 this._minimumBoundary = this._model.minimumRecordTime() || 0; | 552 this._minimumBoundary = this._model.minimumRecordTime(); |
| 553 this._timeSpan = Math.max((this._model.maximumRecordTime() || 0) - this.
_minimumBoundary, 1000000); | 553 this._timeSpan = Math.max(this._model.maximumRecordTime() - this._minimu
mBoundary, 1000); |
| 554 this._appendHeaderRecord("CPU"); | 554 this._appendHeaderRecord("CPU"); |
| 555 var events = this._model.mainThreadEvents(); | 555 var events = this._model.mainThreadEvents(); |
| 556 var maxStackDepth = 0; | 556 var maxStackDepth = 0; |
| 557 for (var eventIndex = 0; eventIndex < events.length; ++eventIndex) { | 557 for (var eventIndex = 0; eventIndex < events.length; ++eventIndex) { |
| 558 var event = events[eventIndex]; | 558 var event = events[eventIndex]; |
| 559 var category = event.category; | 559 var category = event.category; |
| 560 if (category !== "disabled-by-default-devtools.timeline" && category
!== "devtools") | 560 if (category !== "disabled-by-default-devtools.timeline" && category
!== "devtools") |
| 561 continue; | 561 continue; |
| 562 if (event.duration || event.phase === WebInspector.TracingModel.Phas
e.Instant) { | 562 if (event.duration || event.phase === WebInspector.TracingModel.Phas
e.Instant) { |
| 563 this._appendEvent(event); | 563 this._appendEvent(event); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 * @param {number} entryIndex | 971 * @param {number} entryIndex |
| 972 * @return {?WebInspector.TimelineSelection} | 972 * @return {?WebInspector.TimelineSelection} |
| 973 */ | 973 */ |
| 974 createSelection: function(entryIndex) { }, | 974 createSelection: function(entryIndex) { }, |
| 975 /** | 975 /** |
| 976 * @param {?WebInspector.TimelineSelection} selection | 976 * @param {?WebInspector.TimelineSelection} selection |
| 977 * @return {number} | 977 * @return {number} |
| 978 */ | 978 */ |
| 979 entryIndexForSelection: function(selection) { } | 979 entryIndexForSelection: function(selection) { } |
| 980 } | 980 } |
| OLD | NEW |