Diff
Modified: trunk/LayoutTests/ChangeLog (138527 => 138528)
--- trunk/LayoutTests/ChangeLog 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/LayoutTests/ChangeLog 2012-12-28 09:26:02 UTC (rev 138528)
@@ -1,3 +1,16 @@
+2012-12-28 Yury Semikhatsky <[email protected]>
+
+ Web Inspector: rename distanceToWindow to distance
+ https://bugs.webkit.org/show_bug.cgi?id=105823
+
+ Reviewed by Pavel Feldman.
+
+ Updated tests after renaming distanceToWindow to distance.
+
+ * inspector/profiler/heap-snapshot-summary-sorting-fields.html:
+ * inspector/profiler/heap-snapshot-summary-sorting-instances.html:
+ * inspector/profiler/heap-snapshot-summary-sorting.html:
+
2012-12-28 Andrey Lushnikov <[email protected]>
Web Inspector: refactor DefaultTextEditor's private methods
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting-fields.html (138527 => 138528)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting-fields.html 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting-fields.html 2012-12-28 09:26:02 UTC (rev 138528)
@@ -65,7 +65,7 @@
var columnName = columns[currentColumn].identifier;
var contents = windowRow.children.map(function(obj) { return JSON.stringify(obj.data[columnName]); });
InspectorTest.assertEquals(instanceCount, contents.length, "column contents");
- var sortTypes = { object: "text", distanceToWindow: "number", count: "number", shallowSize: "size", retainedSize: "size" };
+ var sortTypes = { object: "text", distance: "number", count: "number", shallowSize: "size", retainedSize: "size" };
InspectorTest.assertEquals(true, !!sortTypes[columns[currentColumn].identifier], "sort by identifier");
InspectorTest.checkArrayIsSorted(contents, sortTypes[columns[currentColumn].identifier], columns[currentColumn].sort);
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting-instances.html (138527 => 138528)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting-instances.html 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting-instances.html 2012-12-28 09:26:02 UTC (rev 138528)
@@ -59,7 +59,7 @@
InspectorTest.assertEquals(true, !!row, "\"B\" row");
var contents = row.children.map(function(obj) { return JSON.stringify(obj.data[columnName]); });
InspectorTest.assertEquals(instanceCount, contents.length, "column contents");
- var sortTypes = { object: "text", distanceToWindow: "number", count: "number", shallowSize: "size", retainedSize: "size" };
+ var sortTypes = { object: "text", distance: "number", count: "number", shallowSize: "size", retainedSize: "size" };
InspectorTest.assertEquals(true, !!sortTypes[columns[currentColumn].identifier], "sort by identifier");
InspectorTest.checkArrayIsSorted(contents, sortTypes[columns[currentColumn].identifier], columns[currentColumn].sort);
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting.html (138527 => 138528)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting.html 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-sorting.html 2012-12-28 09:26:02 UTC (rev 138528)
@@ -49,7 +49,7 @@
columns[currentColumn] = newColumnState;
var contents = InspectorTest.columnContents(columns[currentColumn]);
InspectorTest.assertEquals(true, !!contents.length, "column contents");
- var sortTypes = { object: "text", distanceToWindow: "number", count: "number", shallowSize: "size", retainedSize: "size" };
+ var sortTypes = { object: "text", distance: "number", count: "number", shallowSize: "size", retainedSize: "size" };
InspectorTest.assertEquals(true, !!sortTypes[columns[currentColumn].identifier], "sort by identifier");
InspectorTest.checkArrayIsSorted(contents, sortTypes[columns[currentColumn].identifier], columns[currentColumn].sort);
Modified: trunk/PerformanceTests/ChangeLog (138527 => 138528)
--- trunk/PerformanceTests/ChangeLog 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/PerformanceTests/ChangeLog 2012-12-28 09:26:02 UTC (rev 138528)
@@ -1,3 +1,14 @@
+2012-12-28 Yury Semikhatsky <[email protected]>
+
+ Web Inspector: rename distanceToWindow to distance
+ https://bugs.webkit.org/show_bug.cgi?id=105823
+
+ Reviewed by Pavel Feldman.
+
+ Updated heap profiler performance test after renaming distanceToWindow to distance.
+
+ * inspector/heap-snapshot-performance-test.js:
+
2012-12-18 Hayato Ito <[email protected]>
Use element.webkitCreateShadowRoot instead of WebKitShadowRoot in PerformanceTests.
Modified: trunk/PerformanceTests/inspector/heap-snapshot-performance-test.js (138527 => 138528)
--- trunk/PerformanceTests/inspector/heap-snapshot-performance-test.js 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/PerformanceTests/inspector/heap-snapshot-performance-test.js 2012-12-28 09:26:02 UTC (rev 138528)
@@ -7,7 +7,7 @@
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateFlags");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_buildAggregates");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateClassesRetainedSize");
- InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateObjectToWindowDistance");
+ InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateDistances");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateRetainedSizes");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markDetachedDOMTreeNodes");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markQueriableHeapObjects");
Modified: trunk/Source/WebCore/ChangeLog (138527 => 138528)
--- trunk/Source/WebCore/ChangeLog 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/Source/WebCore/ChangeLog 2012-12-28 09:26:02 UTC (rev 138528)
@@ -1,3 +1,43 @@
+2012-12-28 Yury Semikhatsky <[email protected]>
+
+ Web Inspector: rename distanceToWindow to distance
+ https://bugs.webkit.org/show_bug.cgi?id=105823
+
+ Reviewed by Pavel Feldman.
+
+ Renamed distanceToWindow to distance. Introduced a method on HeapSnapshot
+ that allows to check if given node should be displayed to the user as having
+ distance 1.
+
+ * inspector/front-end/HeapSnapshot.js:
+ (WebInspector.HeapSnapshotEdge.prototype.serialize):
+ (WebInspector.HeapSnapshotRetainerEdge.prototype.serialize):
+ (WebInspector.HeapSnapshotNode.prototype.distance):
+ (WebInspector.HeapSnapshotNode.prototype.serialize):
+ (WebInspector.HeapSnapshot.prototype._init):
+ (WebInspector.HeapSnapshot.prototype.dispose):
+ (WebInspector.HeapSnapshot.prototype.canHaveDistanceOne):
+ (WebInspector.HeapSnapshot.prototype._calculateDistances):
+ (WebInspector.HeapSnapshot.prototype._bfs):
+ (WebInspector.HeapSnapshot.prototype._buildAggregates):
+ * inspector/front-end/HeapSnapshotDataGrids.js:
+ (WebInspector.HeapSnapshotRetainmentDataGrid):
+ (WebInspector.HeapSnapshotRetainmentDataGrid.prototype._sortFields):
+ (WebInspector.HeapSnapshotConstructorsDataGrid):
+ (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._sortFields):
+ * inspector/front-end/HeapSnapshotGridNodes.js:
+ (WebInspector.HeapSnapshotGenericObjectNode):
+ (WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
+ (WebInspector.HeapSnapshotObjectNode):
+ (WebInspector.HeapSnapshotObjectNode.prototype.comparator):
+ (WebInspector.HeapSnapshotObjectNode.prototype._enhanceData):
+ (WebInspector.HeapSnapshotInstanceNode.prototype.comparator):
+ (WebInspector.HeapSnapshotConstructorNode):
+ (WebInspector.HeapSnapshotConstructorNode.prototype.comparator):
+ (WebInspector.HeapSnapshotConstructorNode.prototype.get data):
+ * inspector/front-end/JSHeapSnapshot.js:
+ (WebInspector.JSHeapSnapshot.prototype.canHaveDistanceOne):
+
2012-12-28 Andrey Lushnikov <[email protected]>
Web Inspector: refactor DefaultTextEditor's private methods
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js (138527 => 138528)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js 2012-12-28 09:26:02 UTC (rev 138528)
@@ -112,7 +112,7 @@
node: node.serialize(),
nodeIndex: this.nodeIndex(),
type: this.type(),
- distanceToWindow: node.distanceToWindow()
+ distance: node.distance()
};
},
@@ -254,7 +254,7 @@
node: node.serialize(),
nodeIndex: this.nodeIndex(),
type: this.type(),
- distanceToWindow: node.distanceToWindow()
+ distance: node.distance()
};
},
@@ -321,9 +321,9 @@
return true;
},
- distanceToWindow: function()
+ distance: function()
{
- return this._snapshot._distancesToWindow[this.nodeIndex / this._snapshot._nodeFieldCount];
+ return this._snapshot._nodeDistances[this.nodeIndex / this._snapshot._nodeFieldCount];
},
className: function()
@@ -399,7 +399,7 @@
return {
id: this.id(),
name: this.name(),
- distanceToWindow: this.distanceToWindow(),
+ distance: this.distance(),
nodeIndex: this.nodeIndex,
retainedSize: this.retainedSize(),
selfSize: this.selfSize(),
@@ -569,7 +569,7 @@
this._markInvisibleEdges();
this._buildRetainers();
this._calculateFlags();
- this._calculateObjectToWindowDistance();
+ this._calculateDistances();
var result = this._buildPostOrderIndex();
// Actually it is array that maps node ordinal number to dominator node ordinal number.
this._dominatorsTree = this._buildDominatorTree(result.postOrderIndex2NodeOrdinal, result.nodeOrdinal2PostOrderIndex);
@@ -670,7 +670,7 @@
}
delete this._dominatedNodes;
delete this._firstDominatedNodeIndex;
- delete this._distancesToWindow;
+ delete this._nodeDistances;
delete this._dominatorsTree;
},
@@ -775,8 +775,13 @@
return this._aggregatesForDiff;
},
- _calculateObjectToWindowDistance: function()
+ canHaveDistanceOne: function(node)
{
+ return true;
+ },
+
+ _calculateDistances: function()
+ {
var nodeFieldCount = this._nodeFieldCount;
var distances = new Uint32Array(this.nodeCount);
@@ -785,7 +790,7 @@
var nodesToVisitLength = 0;
for (var iter = this.rootNode().edges(); iter.hasNext(); iter.next()) {
var node = iter.edge.node();
- if (node.isWindow()) {
+ if (this.canHaveDistanceOne(node)) {
nodesToVisit[nodesToVisitLength++] = node.nodeIndex;
distances[node.nodeIndex / nodeFieldCount] = 1;
}
@@ -797,7 +802,7 @@
nodesToVisit[nodesToVisitLength++] = this._rootNodeIndex;
distances[this._rootNodeIndex / nodeFieldCount] = 1;
this._bfs(nodesToVisit, nodesToVisitLength, distances);
- this._distancesToWindow = distances;
+ this._nodeDistances = distances;
},
_bfs: function(nodesToVisit, nodesToVisitLength, distances)
@@ -813,7 +818,6 @@
var nodeCount = this.nodeCount;
var containmentEdgesLength = containmentEdges.length;
var edgeWeakType = this._edgeWeakType;
- var edgeShortcutType = this._edgeShortcutType;
var index = 0;
while (index < nodesToVisitLength) {
@@ -853,7 +857,7 @@
var selfSizeOffset = this._nodeSelfSizeOffset;
var nodeTypeOffset = this._nodeTypeOffset;
var node = this.rootNode();
- var distancesToWindow = this._distancesToWindow;
+ var nodeDistances = this._nodeDistances;
for (var nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) {
var nodeOrdinal = nodeIndex / nodeFieldCount;
@@ -871,7 +875,7 @@
var nameMatters = nodeType === "object" || nodeType === "native";
var value = {
count: 1,
- distanceToWindow: distancesToWindow[nodeOrdinal],
+ distance: nodeDistances[nodeOrdinal],
self: selfSize,
maxRet: 0,
type: nodeType,
@@ -883,7 +887,7 @@
aggregatesByClassName[node.className()] = value;
} else {
var clss = aggregates[classIndex];
- clss.distanceToWindow = Math.min(clss.distanceToWindow, distancesToWindow[nodeOrdinal]);
+ clss.distance = Math.min(clss.distance, nodeDistances[nodeOrdinal]);
++clss.count;
clss.self += selfSize;
clss.idxs.push(nodeIndex);
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js (138527 => 138528)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js 2012-12-28 09:26:02 UTC (rev 138528)
@@ -467,7 +467,7 @@
object: { title: WebInspector.UIString("Object"), disclosure: true, sortable: true },
shallowSize: { title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true },
retainedSize: { title: WebInspector.UIString("Retained Size"), width: "120px", sortable: true },
- distanceToWindow: { title: WebInspector.UIString("Distance"), width: "80px", sortable: true, sort: "ascending" }
+ distance: { title: WebInspector.UIString("Distance"), width: "80px", sortable: true, sort: "ascending" }
};
WebInspector.HeapSnapshotContainmentDataGrid.call(this, columns);
}
@@ -480,7 +480,7 @@
count: ["_count", sortAscending, "_name", true],
shallowSize: ["_shallowSize", sortAscending, "_name", true],
retainedSize: ["_retainedSize", sortAscending, "_name", true],
- distanceToWindow: ["_distanceToWindow", sortAscending, "_name", true]
+ distance: ["_distance", sortAscending, "_name", true]
}[sortColumn];
},
@@ -502,7 +502,7 @@
{
var columns = {
object: { title: WebInspector.UIString("Constructor"), disclosure: true, sortable: true },
- distanceToWindow: { title: WebInspector.UIString("Distance"), width: "90px", sortable: true },
+ distance: { title: WebInspector.UIString("Distance"), width: "90px", sortable: true },
count: { title: WebInspector.UIString("Objects Count"), width: "90px", sortable: true },
shallowSize: { title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true },
retainedSize: { title: WebInspector.UIString("Retained Size"), width: "120px", sort: "descending", sortable: true }
@@ -519,7 +519,7 @@
{
return {
object: ["_name", sortAscending, "_count", false],
- distanceToWindow: ["_distanceToWindow", sortAscending, "_retainedSize", true],
+ distance: ["_distance", sortAscending, "_retainedSize", true],
count: ["_count", sortAscending, "_name", true],
shallowSize: ["_shallowSize", sortAscending, "_name", true],
retainedSize: ["_retainedSize", sortAscending, "_name", true]
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js (138527 => 138528)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js 2012-12-28 09:26:02 UTC (rev 138528)
@@ -351,7 +351,7 @@
return;
this._name = node.name;
this._type = node.type;
- this._distanceToWindow = node.distanceToWindow;
+ this._distance = node.distance;
this._shallowSize = node.selfSize;
this._retainedSize = node.retainedSize;
this.snapshotNodeId = node.id;
@@ -444,7 +444,7 @@
valueStyle += " detached-dom-tree-node";
data["object"] = { valueStyle: valueStyle, value: value, nodeId: this.snapshotNodeId };
- data["distanceToWindow"] = this._distanceToWindow;
+ data["distance"] = this._distance;
data["shallowSize"] = Number.withThousandsSeparator(this._shallowSize);
data["retainedSize"] = Number.withThousandsSeparator(this._retainedSize);
data["shallowSize-percent"] = this._toPercentString(this._shallowSizePercent);
@@ -521,7 +521,7 @@
WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, edge.node);
this._referenceName = edge.name;
this._referenceType = edge.type;
- this._distanceToWindow = edge.distanceToWindow;
+ this._distance = edge.distance;
this.showRetainingEdges = tree.showRetainingEdges;
this._isFromBaseSnapshot = isFromBaseSnapshot;
@@ -588,7 +588,7 @@
count: ["!edgeName", true, "retainedSize", false],
shallowSize: ["selfSize", sortAscending, "!edgeName", true],
retainedSize: ["retainedSize", sortAscending, "!edgeName", true],
- distanceToWindow: ["distanceToWindow", sortAscending, "_name", true]
+ distance: ["distance", sortAscending, "_name", true]
}[sortColumnIdentifier] || ["!edgeName", true, "retainedSize", false];
return WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.createComparator(sortFields);
},
@@ -617,7 +617,7 @@
}
data["object"].nameClass = nameClass;
data["object"].name = name;
- data["distanceToWindow"] = this._distanceToWindow;
+ data["distance"] = this._distance;
return data;
},
@@ -685,7 +685,7 @@
var sortColumnIdentifier = this._dataGrid.sortColumnIdentifier;
var sortFields = {
object: ["!edgeName", sortAscending, "retainedSize", false],
- distanceToWindow: ["distanceToWindow", sortAscending, "retainedSize", false],
+ distance: ["distance", sortAscending, "retainedSize", false],
count: ["!edgeName", true, "retainedSize", false],
addedSize: ["selfSize", sortAscending, "!edgeName", true],
removedSize: ["selfSize", sortAscending, "!edgeName", true],
@@ -733,7 +733,7 @@
WebInspector.HeapSnapshotGridNode.call(this, tree, aggregate.count > 0);
this._name = className;
this._aggregatesKey = aggregatesKey;
- this._distanceToWindow = aggregate.distanceToWindow;
+ this._distance = aggregate.distance;
this._count = aggregate.count;
this._shallowSize = aggregate.self;
this._retainedSize = aggregate.maxRet;
@@ -804,7 +804,7 @@
var sortColumnIdentifier = this._dataGrid.sortColumnIdentifier;
var sortFields = {
object: ["id", sortAscending, "retainedSize", false],
- distanceToWindow: ["distanceToWindow", true, "retainedSize", false],
+ distance: ["distance", true, "retainedSize", false],
count: ["id", true, "retainedSize", false],
shallowSize: ["selfSize", sortAscending, "id", true],
retainedSize: ["retainedSize", sortAscending, "id", true]
@@ -826,7 +826,7 @@
{
var data = { object: this._name };
data["count"] = Number.withThousandsSeparator(this._count);
- data["distanceToWindow"] = this._distanceToWindow;
+ data["distance"] = this._distance;
data["shallowSize"] = Number.withThousandsSeparator(this._shallowSize);
data["retainedSize"] = Number.withThousandsSeparator(this._retainedSize);
data["count-percent"] = this._toPercentString(this._countPercent);
Modified: trunk/Source/WebCore/inspector/front-end/JSHeapSnapshot.js (138527 => 138528)
--- trunk/Source/WebCore/inspector/front-end/JSHeapSnapshot.js 2012-12-28 09:08:19 UTC (rev 138527)
+++ trunk/Source/WebCore/inspector/front-end/JSHeapSnapshot.js 2012-12-28 09:26:02 UTC (rev 138528)
@@ -102,6 +102,11 @@
this._markPageOwnedNodes();
},
+ canHaveDistanceOne: function(node)
+ {
+ return node.isWindow();
+ },
+
userObjectsMapAndFlag: function()
{
return {
@@ -267,11 +272,6 @@
return !!(flags & this._snapshot._nodeFlags.pageObject);
},
- distanceToWindow: function()
- {
- return this._snapshot._distancesToWindow[this.nodeIndex / this._snapshot._nodeFieldCount];
- },
-
className: function()
{
var type = this.type();