Bug 1260260 - Add comments documenting members of `CensusTreeNode`; r=jsantell
authorNick Fitzgerald <fitzgen@gmail.com>
Mon, 28 Mar 2016 14:31:00 +0200
changeset 290855 5a79fb92dd005dbf7bcc250635c55cbcfab7d470
parent 290854 078fb73f17c26edffad5a5051991771e14f94d35
child 290856 f3ea2fdec3196f6a498c7fe8c1e48e460331f602
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell
bugs1260260
milestone48.0a1
Bug 1260260 - Add comments documenting members of `CensusTreeNode`; r=jsantell
devtools/shared/heapsnapshot/census-tree-node.js
--- a/devtools/shared/heapsnapshot/census-tree-node.js
+++ b/devtools/shared/heapsnapshot/census-tree-node.js
@@ -392,23 +392,43 @@ CensusTreeNodeVisitor.prototype.root = f
 };
 
 /**
  * Create a single, uninitialized CensusTreeNode.
  *
  * @param {null|String|SavedFrame} name
  */
 function CensusTreeNode(name) {
+  // Display name for this CensusTreeNode. Either null, a string, or a
+  // SavedFrame.
   this.name = name;
+
+  // The number of bytes occupied by matching things in the heap snapshot.
   this.bytes = 0;
+
+  // The sum of `this.bytes` and `child.totalBytes` for each child in
+  // `this.children`.
   this.totalBytes = 0;
+
+  // The number of things in the heap snapshot that match this node in the
+  // census tree.
   this.count = 0;
+
+  // The sum of `this.count` and `child.totalCount` for each child in
+  // `this.children`.
   this.totalCount = 0;
+
+  // An array of this node's children, or undefined if it has no children.
   this.children = undefined;
+
+  // The unique ID of this node.
   this.id = ++censusTreeNodeIdCounter;
+
+  // If present, the unique ID of this node's parent. If this node does not have
+  // a parent, then undefined.
   this.parent = undefined;
 }
 
 CensusTreeNode.prototype = null;
 
 /**
  * Compare the given nodes by their `totalBytes` properties, and breaking ties
  * with the `totalCount`, `bytes`, and `count` properties (in that order).