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

Unified Diff: Source/devtools/front_end/HeapSnapshotGridNodes.js

Issue 222443003: DevTools: Treat system object distances with less priority (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressing comments. Created 6 years, 9 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/HeapSnapshotGridNodes.js
diff --git a/Source/devtools/front_end/HeapSnapshotGridNodes.js b/Source/devtools/front_end/HeapSnapshotGridNodes.js
index a2e403323677cf552756319f539675db1c4e01a8..bd66651da4eb6cd464253cbdbde299fefa4de84b 100644
--- a/Source/devtools/front_end/HeapSnapshotGridNodes.js
+++ b/Source/devtools/front_end/HeapSnapshotGridNodes.js
@@ -184,12 +184,26 @@ WebInspector.HeapSnapshotGridNode.prototype = {
this._dataGrid.nodeWasDetached(this);
},
+ /**
+ * @param {number} num
+ * @return {string}
+ */
_toPercentString: function(num)
{
return num.toFixed(0) + "\u2009%"; // \u2009 is a thin space.
},
/**
+ * @param {number} distance
+ * @return {string}
+ */
+ _toUIDistance: function(distance)
+ {
+ var baseSystemDistance = WebInspector.HeapSnapshotCommon.baseSystemDistance;
+ return distance >= 0 && distance < baseSystemDistance ? WebInspector.UIString("%d", distance) : WebInspector.UIString("\u2212");
+ },
+
+ /**
* @return {!Array.<!WebInspector.DataGridNode>}
*/
allChildren: function()
@@ -506,7 +520,7 @@ WebInspector.HeapSnapshotGenericObjectNode = function(dataGrid, node)
var shallowSizePercent = this._shallowSize / snapshot.totalSize * 100.0;
var retainedSizePercent = this._retainedSize / snapshot.totalSize * 100.0;
this.data = {
- "distance": this._distance,
+ "distance": this._toUIDistance(this._distance),
"shallowSize": Number.withThousandsSeparator(this._shallowSize),
"retainedSize": Number.withThousandsSeparator(this._retainedSize),
"shallowSize-percent": this._toPercentString(shallowSizePercent),
@@ -905,11 +919,11 @@ WebInspector.HeapSnapshotConstructorNode = function(dataGrid, className, aggrega
this.data = {
"object": className,
- "count": Number.withThousandsSeparator(this._count),
- "distance": this._distance,
+ "count": Number.withThousandsSeparator(this._count),
+ "distance": this._toUIDistance(this._distance),
"shallowSize": Number.withThousandsSeparator(this._shallowSize),
"retainedSize": Number.withThousandsSeparator(this._retainedSize),
- "count-percent": this._toPercentString(countPercent),
+ "count-percent": this._toPercentString(countPercent),
"shallowSize-percent": this._toPercentString(shallowSizePercent),
"retainedSize-percent": this._toPercentString(retainedSizePercent)
};

Powered by Google App Engine
This is Rietveld 408576698