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

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

Issue 339493006: Move divider detection and creation onto TimelineUIUtils instance (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
« no previous file with comments | « Source/devtools/front_end/timeline/TracingTimelineModel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 571942273573601cbe92eee0adc1cc2f9588aebb..50cf0d35039c83db4dcd323798233cdd0df5d118 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
@@ -41,6 +41,15 @@ WebInspector.TracingTimelineUIUtils.prototype = {
/**
* @param {!WebInspector.TimelineModel.Record} record
+ * @return {boolean}
+ */
+ isEventDivider: function(record)
+ {
+ return WebInspector.TracingTimelineUIUtils.isEventDivider(record);
+ },
+
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
* @return {?Object}
*/
countersForRecord: function(record)
@@ -83,6 +92,16 @@ WebInspector.TracingTimelineUIUtils.prototype = {
WebInspector.TracingTimelineUIUtils.buildTraceEventDetails(record.traceEvent(), tracingTimelineModel, linkifier, callback, loadedFromFile, record.target());
},
+ /**
+ * @param {string} recordType
+ * @param {string=} title
+ * @return {!Element}
+ */
+ createEventDivider: function(recordType, title)
+ {
+ return WebInspector.TracingTimelineUIUtils._createEventDivider(recordType, title);
+ },
+
__proto__: WebInspector.TimelineUIUtils.prototype
}
@@ -192,6 +211,22 @@ WebInspector.TracingTimelineUIUtils.styleForTraceEvent = function(name)
}
/**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @return {boolean}
+ */
+WebInspector.TracingTimelineUIUtils.isEventDivider = function(record)
+{
+ var recordTypes = WebInspector.TracingTimelineModel.RecordType;
+ if (record.type() === recordTypes.TimeStamp)
+ return true;
+ if (record.type() === recordTypes.MarkFirstPaint)
+ return true;
+ if (record.type() === recordTypes.MarkDOMContent || record.type() === recordTypes.MarkLoad)
+ return record.data()["isMainFrame"];
+ return false;
+}
+
+/**
* @param {!WebInspector.TracingModel.Event} event
* @param {!WebInspector.Linkifier} linkifier
* @param {boolean} loadedFromFile
@@ -629,3 +664,31 @@ WebInspector.TracingTimelineUIUtils._buildPicturePreviewContent = function(encod
callback(container);
}
}
+
+/**
+ * @param {string} recordType
+ * @param {string=} title
+ * @return {!Element}
+ */
+WebInspector.TracingTimelineUIUtils._createEventDivider = function(recordType, title)
+{
+ var eventDivider = document.createElement("div");
+ eventDivider.className = "resources-event-divider";
+ var recordTypes = WebInspector.TracingTimelineModel.RecordType;
+
+ if (recordType === recordTypes.MarkDOMContent)
+ eventDivider.className += " resources-blue-divider";
+ else if (recordType === recordTypes.MarkLoad)
+ eventDivider.className += " resources-red-divider";
+ else if (recordType === recordTypes.MarkFirstPaint)
+ eventDivider.className += " resources-green-divider";
+ else if (recordType === recordTypes.TimeStamp)
+ eventDivider.className += " resources-orange-divider";
+ else if (recordType === recordTypes.BeginFrame)
+ eventDivider.className += " timeline-frame-divider";
+
+ if (title)
+ eventDivider.title = title;
+
+ return eventDivider;
+}
« no previous file with comments | « Source/devtools/front_end/timeline/TracingTimelineModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698