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

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

Issue 336373002: Parametrize TimelinePresentationModel with coalescable record types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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
Index: Source/devtools/front_end/timeline/TimelinePresentationModel.js
diff --git a/Source/devtools/front_end/timeline/TimelinePresentationModel.js b/Source/devtools/front_end/timeline/TimelinePresentationModel.js
index 3ffb58165b8aa3b4b50e530e8f40e4d92dc661c3..b1bddb0853f5f1a7cad9eced0fbb4248108e8cd6 100644
--- a/Source/devtools/front_end/timeline/TimelinePresentationModel.js
+++ b/Source/devtools/front_end/timeline/TimelinePresentationModel.js
@@ -33,10 +33,12 @@
* @constructor
* @extends {WebInspector.Object}
* @param {!WebInspector.TimelineModel} model
+ * @param {!Object.<string, number>} coalescableRecordTypes
*/
-WebInspector.TimelinePresentationModel = function(model)
+WebInspector.TimelinePresentationModel = function(model, coalescableRecordTypes)
{
this._model = model;
+ this._coalescableRecordTypes = coalescableRecordTypes;
this._filters = [];
/**
* @type {!Map.<!WebInspector.TimelineModel.Record, !WebInspector.TimelinePresentationModel.Record>}
@@ -45,13 +47,6 @@ WebInspector.TimelinePresentationModel = function(model)
this.reset();
}
-WebInspector.TimelinePresentationModel._coalescingRecords = { };
-WebInspector.TimelinePresentationModel._coalescingRecords[WebInspector.TimelineModel.RecordType.Layout] = 1;
-WebInspector.TimelinePresentationModel._coalescingRecords[WebInspector.TimelineModel.RecordType.Paint] = 1;
-WebInspector.TimelinePresentationModel._coalescingRecords[WebInspector.TimelineModel.RecordType.Rasterize] = 1;
-WebInspector.TimelinePresentationModel._coalescingRecords[WebInspector.TimelineModel.RecordType.DecodeImage] = 1;
-WebInspector.TimelinePresentationModel._coalescingRecords[WebInspector.TimelineModel.RecordType.ResizeImage] = 1;
-
WebInspector.TimelinePresentationModel.prototype = {
/**
* @param {number} startTime
@@ -151,7 +146,7 @@ WebInspector.TimelinePresentationModel.prototype = {
return null;
if (lastRecord.record().type() !== record.type())
return null;
- if (!WebInspector.TimelinePresentationModel._coalescingRecords[record.type()])
+ if (!this._coalescableRecordTypes[record.type()])
return null;
if (lastRecord.record().endTime() + coalescingThresholdMillis < startTime)
return null;
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePanel.js ('k') | Source/devtools/front_end/timeline/TimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698