Changeset 106738 in webkit


Ignore:
Timestamp:
Feb 4, 2012 2:20:07 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: get rid of cycles in retaining tree
https://bugs.webkit.org/show_bug.cgi?id=77801

Drive by fix: 'retained by' prefix was removed.

Reviewed by Yury Semikhatsky.

  • inspector/front-end/DetailedHeapshotGridNodes.js:

(WebInspector.HeapSnapshotObjectNode):
(WebInspector.HeapSnapshotObjectNode.prototype._updateHasChildren):
(WebInspector.HeapSnapshotObjectNode.prototype._createChildNode):
(WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):

  • inspector/front-end/profilesPanel.css:

(.cycled-ancessor-node):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106737 r106738  
     12012-02-03  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: get rid of cycles in retaining tree
     4        https://bugs.webkit.org/show_bug.cgi?id=77801
     5
     6        Drive by fix: 'retained by' prefix was removed.
     7
     8        Reviewed by Yury Semikhatsky.
     9
     10        * inspector/front-end/DetailedHeapshotGridNodes.js:
     11        (WebInspector.HeapSnapshotObjectNode):
     12        (WebInspector.HeapSnapshotObjectNode.prototype._updateHasChildren):
     13        (WebInspector.HeapSnapshotObjectNode.prototype._createChildNode):
     14        (WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
     15        * inspector/front-end/profilesPanel.css:
     16        (.cycled-ancessor-node):
     17
    1182012-02-04  Kentaro Hara  <haraken@chromium.org>
    219
  • trunk/Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js

    r106665 r106738  
    329329    },
    330330
    331     _updateHasChildren: function()
     331    updateHasChildren: function()
    332332    {
    333333        function isEmptyCallback(isEmpty)
     
    360360WebInspector.HeapSnapshotGenericObjectNode.prototype.__proto__ = WebInspector.HeapSnapshotGridNode.prototype;
    361361
    362 WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge)
     362WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge, parentGridNode)
    363363{
    364364    WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, edge.node);
     
    369369    this._isFromBaseSnapshot = isFromBaseSnapshot;
    370370    this._provider = this._createProvider(!isFromBaseSnapshot ? tree.snapshot : tree.baseSnapshot, edge.nodeIndex, tree);
    371     this._updateHasChildren();
     371    this.updateHasChildren(parentGridNode);
    372372}
    373373
    374374WebInspector.HeapSnapshotObjectNode.prototype = {
     375    updateHasChildren: function(parentGridNode)
     376    {
     377        if (this._retainerNode) {
     378            this._parentGridNode = parentGridNode;
     379            var ancestor = parentGridNode;
     380            while (ancestor) {
     381                if (ancestor.snapshotNodeId === this.snapshotNodeId) {
     382                    this._cycledWithAncestorGridNode = ancestor;
     383                    return;
     384                }
     385                ancestor = ancestor._parentGridNode;
     386            }
     387        }
     388        WebInspector.HeapSnapshotGenericObjectNode.prototype.updateHasChildren.call(this);
     389    },
     390
    375391    _createChildNode: function(item)
    376392    {
    377         return new WebInspector.HeapSnapshotObjectNode(this.dataGrid, this._isFromBaseSnapshot, item);
     393        return new WebInspector.HeapSnapshotObjectNode(this.dataGrid, this._isFromBaseSnapshot, item, this);
    378394    },
    379395
     
    441457    {
    442458        if (this._retainerNode) {
    443             var prefixSpan = document.createElement("span");
    444             prefixSpan.textContent = WebInspector.UIString("retained by ");
    445             div.appendChild(prefixSpan);
     459            if (this._cycledWithAncestorGridNode)
     460                div.className += " cycled-ancessor-node";
    446461            return;
    447462        }
     
    476491    this._isDeletedNode = !!baseSnapshot;
    477492    this._provider = this._createProvider(baseSnapshot || snapshot, node.nodeIndex);
    478     this._updateHasChildren();
     493    this.updateHasChildren();
    479494};
    480495
     
    806821    WebInspector.HeapSnapshotGenericObjectNode.call(this, tree, node);
    807822    this._provider = this._createProvider(tree.snapshot, node.nodeIndex);
    808     this._updateHasChildren();
     823    this.updateHasChildren();
    809824};
    810825
  • trunk/Source/WebCore/inspector/front-end/profilesPanel.css

    r103803 r106738  
    175175}
    176176
     177.cycled-ancessor-node {
     178    color: lightgray;
     179}
     180
    177181.panel-enabler-view.profile-launcher-view button:not(.status-bar-item) {
    178182    color: rgb(6, 6, 6);
Note: See TracChangeset for help on using the changeset viewer.