Bug 99309

Summary: Web Inspector: convert manual size calculation of different WebKit things into MemoryInstrumentation.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: alph, apavlov, bweinstein, caseq, giles_joplin, keishi, loislo, pfeldman, pmuellr, vsevik, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
buildbot: commit-queue-
[please ignore] none

Ilya Tikhonovsky
Reported 2012-10-15 04:49:35 PDT
MemoryInstrumentation is our primary method for WebCore internal classes. But due to historical reasons sizes for some objects were calculated manually. I think we could fix this.
Attachments
Patch (42.91 KB, patch)
2012-10-15 05:20 PDT, Ilya Tikhonovsky
no flags
Patch (42.86 KB, patch)
2012-10-15 05:26 PDT, Ilya Tikhonovsky
buildbot: commit-queue-
[please ignore] (6.11 KB, text/plain)
2012-10-15 10:33 PDT, Hans Muller
no flags
Ilya Tikhonovsky
Comment 1 2012-10-15 05:20:14 PDT
Ilya Tikhonovsky
Comment 2 2012-10-15 05:26:04 PDT
Build Bot
Comment 3 2012-10-15 05:58:13 PDT
Early Warning System Bot
Comment 4 2012-10-15 06:06:01 PDT
Yury Semikhatsky
Comment 5 2012-10-15 06:07:00 PDT
Comment on attachment 168685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168685&action=review > Source/WebCore/inspector/InspectorMemoryAgent.cpp:156 > +static String nodeName(Node* node) No need to make it static as it is already in anonymous namespace.
Alexei Filippov
Comment 6 2012-10-15 06:08:01 PDT
Comment on attachment 168685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168685&action=review > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:-479 > - unusedSize -= child.children[j].size; Why do you need this *.Unused record? What's wrong with calculating it? What's if *.Unused is not present? It seems that unusedSize will be zero, e.g. for JSHeap.
Build Bot
Comment 7 2012-10-15 06:08:49 PDT
Early Warning System Bot
Comment 8 2012-10-15 06:13:41 PDT
Gyuyoung Kim
Comment 9 2012-10-15 06:15:23 PDT
Ilya Tikhonovsky
Comment 10 2012-10-15 06:52:01 PDT
Ilya Tikhonovsky
Comment 11 2012-10-15 07:09:55 PDT
(In reply to comment #6) > (From update of attachment 168685 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=168685&action=review > > > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:-479 > > - unusedSize -= child.children[j].size; > > Why do you need this *.Unused record? What's wrong with calculating it? What's if *.Unused is not present? It seems that unusedSize will be zero, e.g. for JSHeap. This patch flips the code from manual block building to the automatic builder. The builder builds parent MemoryBlocks on the fly and calculates their sizes. As a result when I use automatic builder code for JSHeap I need to add two blocks, JSHeap.Used and JSHeap.Unused. The builder makes parent JSHeap block automatically and assigns the right size to it. Latter, on the front end size, we use JSHeap size as the allocated size and JSHeap.Unused as unused size for JSHeap.
Hans Muller
Comment 12 2012-10-15 10:33:00 PDT
Created attachment 168737 [details] [please ignore] Added FloatRect::extend() to simplify writing loops that accumulate the bounding box for a sequence of vertices. For example: FloatRect box(vertices[0], FloatSize(0,0)); for (unsigned i = 1; i < vertices.length; i++) box.extend(vertices[i]); ExclusionShape and ExclusionPolygon now use FloatRect::extend().
Hans Muller
Comment 13 2012-10-15 10:35:18 PDT
(In reply to comment #12) > Created an attachment (id=168737) [details] My apologies for accidentally attaching this patch/comment to the wrong bug.
Note You need to log in before you can comment on or make changes to this bug.