Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1646)

Unified Diff: Source/devtools/front_end/timeline/TimelineFrameModel.js

Issue 709423002: DevTools: remove old Timeline front-end implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated LayoutTests/inspector/layers/layer-canvas-log.html Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/sdk/module.json ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelineFrameModel.js
diff --git a/Source/devtools/front_end/timeline/TimelineFrameModel.js b/Source/devtools/front_end/timeline/TimelineFrameModel.js
index 90c1d6afa722163010b1cc6c33b452fb6d55416a..714f844832fc8a0f6f2e6eac99e34c60ced38366 100644
--- a/Source/devtools/front_end/timeline/TimelineFrameModel.js
+++ b/Source/devtools/front_end/timeline/TimelineFrameModel.js
@@ -217,147 +217,6 @@ WebInspector.TimelineFrameModelBase.prototype = {
* @constructor
* @extends {WebInspector.TimelineFrameModelBase}
*/
-WebInspector.TimelineFrameModel = function()
-{
- WebInspector.TimelineFrameModelBase.call(this);
-}
-
-WebInspector.TimelineFrameModel._mainFrameMarkers = [
- WebInspector.TimelineModel.RecordType.ScheduleStyleRecalculation,
- WebInspector.TimelineModel.RecordType.InvalidateLayout,
- WebInspector.TimelineModel.RecordType.BeginFrame,
- WebInspector.TimelineModel.RecordType.ScrollLayer
-];
-
-WebInspector.TimelineFrameModel.prototype = {
- reset: function()
- {
- this._mergeRecords = true;
- this._mergingBuffer = new WebInspector.TimelineMergingRecordBuffer();
- WebInspector.TimelineFrameModelBase.prototype.reset.call(this);
- },
-
- /**
- * @param {boolean} value
- */
- setMergeRecords: function(value)
- {
- this._mergeRecords = value;
- },
-
- /**
- * @param {!Array.<!WebInspector.TimelineModel.Record>} records
- */
- addRecords: function(records)
- {
- if (!records.length)
- return;
- if (records[0].startTime() < this._minimumRecordTime)
- this._minimumRecordTime = records[0].startTime();
- for (var i = 0; i < records.length; ++i)
- this.addRecord(records[i]);
- },
-
- /**
- * @param {!WebInspector.TimelineModel.Record} record
- */
- addRecord: function(record)
- {
- var recordTypes = WebInspector.TimelineModel.RecordType;
- var programRecord = record.type() === recordTypes.Program ? record : null;
-
- // Start collecting main frame
- if (programRecord) {
- if (!this._framePendingCommit && this._findRecordRecursively(WebInspector.TimelineFrameModel._mainFrameMarkers, programRecord))
- this._framePendingCommit = new WebInspector.PendingFrame();
- }
- /** type {Array.<!WebInspector.TimelineModel.Record>} */
- var records = [];
- if (!this._mergeRecords)
- records = [record];
- else
- records = this._mergingBuffer.process(record.thread(), /** type {Array.<!WebInspector.TimelineModel.Record>} */(programRecord ? record.children() || [] : [record]));
- for (var i = 0; i < records.length; ++i) {
- if (records[i].thread() === WebInspector.TimelineModel.MainThreadName)
- this._addMainThreadRecord(programRecord, records[i]);
- else
- this._addBackgroundRecord(records[i]);
- }
- },
-
- /**
- * @param {!WebInspector.TimelineModel.Record} record
- */
- _addBackgroundRecord: function(record)
- {
- var recordTypes = WebInspector.TimelineModel.RecordType;
- if (record.type() === recordTypes.BeginFrame)
- this.handleBeginFrame(record.startTime());
- else if (record.type() === recordTypes.DrawFrame)
- this.handleDrawFrame(record.startTime());
- else if (record.type() === recordTypes.RequestMainThreadFrame)
- this.handleRequestMainThreadFrame();
- else if (record.type() === recordTypes.ActivateLayerTree)
- this.handleActivateLayerTree();
-
- if (this._lastFrame)
- this._lastFrame._addTimeFromRecord(record);
- },
-
- /**
- * @param {?WebInspector.TimelineModel.Record} programRecord
- * @param {!WebInspector.TimelineModel.Record} record
- */
- _addMainThreadRecord: function(programRecord, record)
- {
- var recordTypes = WebInspector.TimelineModel.RecordType;
- if (record.type() === recordTypes.UpdateLayerTree && record.data()["layerTree"])
- this.handleLayerTreeSnapshot(new WebInspector.DeferredAgentLayerTree(record.target(), record.data()["layerTree"]));
- if (!this._hasThreadedCompositing) {
- if (record.type() === recordTypes.BeginFrame)
- this._startMainThreadFrame(record.startTime());
-
- if (!this._lastFrame)
- return;
-
- this._lastFrame._addTimeFromRecord(record);
-
- // Account for "other" time at the same time as the first child.
- if (programRecord.children()[0] === record)
- this._lastFrame._addTimeForCategory("other", this._deriveOtherTime(programRecord));
- return;
- }
-
- if (!this._framePendingCommit)
- return;
-
- WebInspector.TimelineUIUtilsImpl.aggregateTimeForRecord(this._framePendingCommit.timeByCategory, record);
- if (programRecord.children()[0] === record)
- this._framePendingCommit.timeByCategory["other"] = (this._framePendingCommit.timeByCategory["other"] || 0) + this._deriveOtherTime(programRecord);
-
- if (record.type() === recordTypes.CompositeLayers)
- this.handleCompositeLayers();
- },
-
- /**
- * @param {!WebInspector.TimelineModel.Record} programRecord
- * @return {number}
- */
- _deriveOtherTime: function(programRecord)
- {
- var accounted = 0;
- for (var i = 0; i < programRecord.children().length; ++i)
- accounted += programRecord.children()[i].endTime() - programRecord.children()[i].startTime();
- return programRecord.endTime() - programRecord.startTime() - accounted;
- },
-
- __proto__: WebInspector.TimelineFrameModelBase.prototype,
-};
-
-/**
- * @constructor
- * @extends {WebInspector.TimelineFrameModelBase}
- */
WebInspector.TracingTimelineFrameModel = function()
{
WebInspector.TimelineFrameModelBase.call(this);
@@ -590,18 +449,6 @@ WebInspector.TimelineFrame.prototype = {
},
/**
- * @param {!WebInspector.TimelineModel.Record} record
- */
- _addTimeFromRecord: function(record)
- {
- if (!record.endTime())
- return;
- var timeByCategory = {};
- WebInspector.TimelineUIUtilsImpl.aggregateTimeForRecord(timeByCategory, record);
- this._addTimeForCategories(timeByCategory);
- },
-
- /**
* @param {!Object} timeByCategory
*/
_addTimeForCategories: function(timeByCategory)
« no previous file with comments | « Source/devtools/front_end/sdk/module.json ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698