Bug 1166494 - Re-add console timestamp and style markers' metadata. r=vp, a=sledru
authorJordan Santell <jsantell@mozilla.com>
Wed, 20 May 2015 08:43:23 -0700
changeset 274855 500cd2821bceacab9dc7dd58e386b2585411d721
parent 274854 f8f7e83e4a1d54dd94c0ce4b364f25d0829412cf
child 274856 bdcdadeb595c5a99b9062179052ef6fe98dc0f10
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvp, sledru
bugs1166494
milestone40.0a2
Bug 1166494 - Re-add console timestamp and style markers' metadata. r=vp, a=sledru
browser/devtools/shared/timeline/global.js
--- a/browser/devtools/shared/timeline/global.js
+++ b/browser/devtools/shared/timeline/global.js
@@ -145,11 +145,27 @@ function getGCLabel (marker={}) {
 
 function getJSLabel (marker={}) {
   if ("causeName" in marker) {
     return marker.causeName;
   }
   return L10N.getStr("timeline.label.javascript2");
 }
 
+function getStylesFields (marker) {
+  if ("restyleHint" in marker) {
+    return { "Restyle Hint": marker.restyleHint.replace(/eRestyle_/g, "") };
+  }
+}
+
+/**
+ * Takes a main label (like "Timestamp") and a property,
+ * and returns a marker that will print out the property
+ * value for a marker if it exists ("Timestamp (rendering)"),
+ * or just the main label if it does not.
+ */
+function sublabelForProperty (mainLabel, prop) {
+  return (marker={}) => marker[prop] ? `${mainLabel} (${marker[prop]})` : mainLabel;
+}
+
 // Exported symbols.
 exports.L10N = L10N;
 exports.TIMELINE_BLUEPRINT = TIMELINE_BLUEPRINT;