Bug 78113

Summary: Web Inspector: heap snapshot: implement Distance column in Object's retaining tree.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 78411    
Attachments:
Description Flags
Patch
none
Patch none

Description Ilya Tikhonovsky 2012-02-08 06:41:08 PST
%subj%
Comment 1 Ilya Tikhonovsky 2012-02-08 06:53:51 PST
Created attachment 126076 [details]
Patch
Comment 2 Yury Semikhatsky 2012-02-08 07:10:50 PST
I'm not sure that we need to see this column in the UI. It doesn't provide much additional information about the retainers.
Comment 3 Yury Semikhatsky 2012-02-08 07:13:30 PST
Comment on attachment 126076 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126076&action=review

> Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js:436
> +            distanceToWindow: ["distanceToWindow", sortAscending, "_name", true]

Please make sure sorting by the distance column works if there are expanded entries. r- for this.
Comment 4 Ilya Tikhonovsky 2012-02-08 08:33:30 PST
Created attachment 126087 [details]
Patch
Comment 5 Yury Semikhatsky 2012-02-08 08:56:07 PST
Comment on attachment 126087 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126087&action=review

> Source/WebCore/inspector/front-end/HeapSnapshot.js:946
> +        this._distancesToWindow = new Array(this.nodeCount);

Use {} instead of array?

> Source/WebCore/inspector/front-end/HeapSnapshot.js:969
> +            var node = list[index++]; // shift generates too much garbage.

Why not just use shift here?
Comment 6 Ilya Tikhonovsky 2012-02-08 10:50:16 PST
Comment on attachment 126087 [details]
Patch

Clearing flags on attachment: 126087

Committed r107106: <http://trac.webkit.org/changeset/107106>
Comment 7 Ilya Tikhonovsky 2012-02-08 10:50:26 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Mikhail Naganov 2012-02-09 01:42:59 PST
Comment on attachment 126087 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126087&action=review

> Source/WebCore/inspector/front-end/HeapSnapshot.js:978
> +                if (typeof this._distancesToWindow[childNode.nodeIndex] !== "undefined")

Drive-by: "if (childNode.nodeIndex in this._distancesToWindow)" is shorter