Web Inspector: DetailedHeapSnapshot: adjust node name cell format for the retainers...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 12:25:42 +0000 (12:25 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 12:25:42 +0000 (12:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76989

Reviewed by Pavel Feldman.

* English.lproj/localizedStrings.js:
* inspector/front-end/DetailedHeapshotGridNodes.js:
(WebInspector.HeapSnapshotGenericObjectNode.prototype._createObjectCell):
(WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
(WebInspector.HeapSnapshotObjectNode):
(WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
(WebInspector.HeapSnapshotObjectNode.prototype._postfixObjectCell):
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshotEdgesProvider.prototype._serialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105865 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js
Source/WebCore/inspector/front-end/HeapSnapshot.js

index c4478612f5966f4bbdd785e942f71408b92424aa..3422d4f8d4e843344283bc4228315862349170a2 100644 (file)
@@ -1,3 +1,20 @@
+2012-01-25  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: DetailedHeapSnapshot: adjust node name cell format for the retainers tree.
+        https://bugs.webkit.org/show_bug.cgi?id=76989
+
+        Reviewed by Pavel Feldman.
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/DetailedHeapshotGridNodes.js:
+        (WebInspector.HeapSnapshotGenericObjectNode.prototype._createObjectCell):
+        (WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
+        (WebInspector.HeapSnapshotObjectNode):
+        (WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
+        (WebInspector.HeapSnapshotObjectNode.prototype._postfixObjectCell):
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshotEdgesProvider.prototype._serialize):
+
 2012-01-25  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: [InspectorIndexedDB] Pass Database, object stores and indexes meta information to frontend.
 2012-01-25  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: [InspectorIndexedDB] Pass Database, object stores and indexes meta information to frontend.
index 03bfa4f33a6c45d040454ee35f7957fd4d235e9f..97d23f7368ecc25ff7daef2075a6726fe8f1dcfb 100644 (file)
Binary files a/Source/WebCore/English.lproj/localizedStrings.js and b/Source/WebCore/English.lproj/localizedStrings.js differ
index 58530c2c761120f17fb30ed9dedd1a23df8cce25..36e51b076d82179eb6702298f448cd17cb1442e3 100644 (file)
@@ -207,7 +207,7 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
         cell.className = "object-column";
         var div = document.createElement("div");
         div.className = "source-code event-properties";
         cell.className = "object-column";
         var div = document.createElement("div");
         div.className = "source-code event-properties";
-        div.style.overflow = "hidden";
+        div.style.overflow = "visible";
         var data = this.data["object"];
         if (this._prefixObjectCell)
             this._prefixObjectCell(div, data);
         var data = this.data["object"];
         if (this._prefixObjectCell)
             this._prefixObjectCell(div, data);
@@ -215,6 +215,8 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
         valueSpan.className = "value console-formatted-" + data.valueStyle;
         valueSpan.textContent = data.value;
         div.appendChild(valueSpan);
         valueSpan.className = "value console-formatted-" + data.valueStyle;
         valueSpan.textContent = data.value;
         div.appendChild(valueSpan);
+        if (this._postfixObjectCell)
+            this._postfixObjectCell(div, data);
         cell.appendChild(div);
         cell.addStyleClass("disclosure");
         if (this.depth)
         cell.appendChild(div);
         cell.addStyleClass("disclosure");
         if (this.depth)
@@ -263,7 +265,7 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
             valueStyle += " highlight";
         if (this.detachedDOMTreeNode)
             valueStyle += " detached-dom-tree-node";
             valueStyle += " highlight";
         if (this.detachedDOMTreeNode)
             valueStyle += " detached-dom-tree-node";
-        data["object"] = { valueStyle: valueStyle, value: value + " @" + this.snapshotNodeId };
+        data["object"] = { valueStyle: valueStyle, value: value + ": @" + this.snapshotNodeId };
 
         var view = this.dataGrid.snapshotView;
         data["shallowSize"] = view.showShallowSizeAsPercent ? WebInspector.UIString("%.2f%%", this._shallowSizePercent) : Number.bytesToString(this._shallowSize);
 
         var view = this.dataGrid.snapshotView;
         data["shallowSize"] = view.showShallowSizeAsPercent ? WebInspector.UIString("%.2f%%", this._shallowSizePercent) : Number.bytesToString(this._shallowSize);
@@ -334,6 +336,8 @@ WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge)
     WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, edge.node);
     this._referenceName = edge.name;
     this._referenceType = edge.type;
     WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, edge.node);
     this._referenceName = edge.name;
     this._referenceType = edge.type;
+    this._propertyAccessor = edge.propertyAccessor;
+    this._retainerNode = tree.showRetainingEdges;
     this._isFromBaseSnapshot = isFromBaseSnapshot;
     this._provider = this._createProvider(!isFromBaseSnapshot ? tree.snapshot : tree.baseSnapshot, edge.nodeIndex, tree);
     this._updateHasChildren();
     this._isFromBaseSnapshot = isFromBaseSnapshot;
     this._provider = this._createProvider(!isFromBaseSnapshot ? tree.snapshot : tree.baseSnapshot, edge.nodeIndex, tree);
     this._updateHasChildren();
@@ -407,14 +411,32 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
 
     _prefixObjectCell: function(div, data)
     {
 
     _prefixObjectCell: function(div, data)
     {
+        if (this._retainerNode) {
+            var prefixSpan = document.createElement("span");
+            prefixSpan.textContent = WebInspector.UIString("retained by ");
+            div.appendChild(prefixSpan);
+            return;
+        }
+
         var nameSpan = document.createElement("span");
         nameSpan.className = data.nameClass;
         nameSpan.textContent = data.name;
         var nameSpan = document.createElement("span");
         nameSpan.className = data.nameClass;
         nameSpan.textContent = data.name;
+        div.appendChild(nameSpan);
+
         var separatorSpan = document.createElement("span");
         separatorSpan.className = "separator";
         separatorSpan.textContent = ": ";
         var separatorSpan = document.createElement("span");
         separatorSpan.className = "separator";
         separatorSpan.textContent = ": ";
-        div.appendChild(nameSpan);
         div.appendChild(separatorSpan);
         div.appendChild(separatorSpan);
+    },
+
+    _postfixObjectCell: function(div, data)
+    {
+        if (this._retainerNode) {
+            var referenceTypeSpan = document.createElement("span");
+            referenceTypeSpan.className = "console-formatted-object";
+            referenceTypeSpan.textContent = this._propertyAccessor;
+            div.appendChild(referenceTypeSpan);
+        }
     }
 }
 
     }
 }
 
index 8b1a71924b8f7cd2e8d661ca90a138e79c65f445..1a33ee3ec1b39fc74f06b940c1dad811a4458b57 100644 (file)
@@ -1318,7 +1318,7 @@ WebInspector.HeapSnapshotEdgesProvider = function(snapshot, nodeIndex, filter, i
 WebInspector.HeapSnapshotEdgesProvider.prototype = {
     _serialize: function(edge)
     {
 WebInspector.HeapSnapshotEdgesProvider.prototype = {
     _serialize: function(edge)
     {
-        return {name: edge.name, node: WebInspector.HeapSnapshotNodesProvider.prototype._serialize(edge.node), nodeIndex: edge.nodeIndex, type: edge.type};
+        return {name: edge.name, propertyAccessor: edge.toString(), node: WebInspector.HeapSnapshotNodesProvider.prototype._serialize(edge.node), nodeIndex: edge.nodeIndex, type: edge.type};
     },
 
     sort: function(comparator, leftBound, rightBound, count)
     },
 
     sort: function(comparator, leftBound, rightBound, count)