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

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

Issue 344443007: Encapsulate implementation-specific timeline record handling in TimelineUIUtils (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/TracingTimelineUIUtils.js
diff --git a/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js b/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
index 6a520128df98be6bfdcd1a136568f0429bc8dfd7..2f62674d03deb26a683e0f2145c897e9c865bb04 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
@@ -3,8 +3,62 @@
// found in the LICENSE file.
/**
+ * @constructor
+ * @extends {WebInspector.TimelineUIUtils}
*/
-WebInspector.TracingTimelineUIUtils = function() { }
+WebInspector.TracingTimelineUIUtils = function()
+{
+ WebInspector.TimelineUIUtils.call(this);
+}
+
+WebInspector.TracingTimelineUIUtils.prototype = {
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @return {boolean}
+ */
+ isBeginFrame: function(record)
+ {
+ return record.type() === WebInspector.TracingTimelineModel.RecordType.BeginFrame;
+ },
+
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @return {boolean}
+ */
+ isProgram: function(record)
+ {
+ return record.type() === WebInspector.TracingTimelineModel.RecordType.Program;
+ },
+
+ /**
+ * @param {string} recordType
+ * @return {boolean}
+ */
+ isCoalescable: function(recordType)
+ {
+ return !!WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[recordType];
+ },
+
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @return {?Object}
+ */
+ countersForRecord: function(record)
+ {
+ return record.type() === WebInspector.TracingTimelineModel.RecordType.UpdateCounters ? record.data() : null;
+ },
+
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @return {?Object}
+ */
+ highlightQuadForRecord: function(record)
+ {
+ return record.traceEvent().highlightQuad || null;
+ },
+
+ __proto__: WebInspector.TimelineUIUtils.prototype
+}
/**
* @constructor
@@ -80,12 +134,12 @@ WebInspector.TracingTimelineUIUtils._initEventStyles = function()
return eventStyles;
}
-WebInspector.TracingTimelineUIUtils.coalescableRecordTypes = {};
-WebInspector.TracingTimelineUIUtils.coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Layout] = 1;
-WebInspector.TracingTimelineUIUtils.coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Paint] = 1;
-WebInspector.TracingTimelineUIUtils.coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Rasterize] = 1;
-WebInspector.TracingTimelineUIUtils.coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.DecodeImage] = 1;
-WebInspector.TracingTimelineUIUtils.coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.ResizeImage] = 1;
+WebInspector.TracingTimelineUIUtils._coalescableRecordTypes = {};
+WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Layout] = 1;
+WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Paint] = 1;
+WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Rasterize] = 1;
+WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.DecodeImage] = 1;
+WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.ResizeImage] = 1;
/**
* @param {!WebInspector.TracingModel.Event} event
« no previous file with comments | « Source/devtools/front_end/timeline/TracingTimelineModel.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698