Summary: | Web Inspector: each node in a detached DOM tree is shown in its own "detached DOM tree" entry in heap profiler | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yury Semikhatsky <yurys> | ||||||||||
Component: | Web Inspector (Deprecated) | Assignee: | Yury Semikhatsky <yurys> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | abarth, apavlov, haraken, japhet, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, webkit.review.bot, yurys | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Bug Depends on: | 100707 | ||||||||||||
Bug Blocks: | 108202, 108322 | ||||||||||||
Attachments: |
|
Description
Yury Semikhatsky
2013-01-24 06:16:32 PST
Created attachment 184480 [details]
Heap profiler screenshot
Created attachment 184491 [details]
Patch
Comment on attachment 184491 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184491&action=review > Source/WebCore/bindings/v8/V8GCController.cpp:106 > + OwnPtr<RetainedObjectInfo> retainedObjectInfo; > + if (group[0].WrapperClassId() == v8DOMNodeClassId) > + retainedObjectInfo = adoptPtr(new RetainedDOMInfo(static_cast<Node*>(root))); Why is this static cast valid? Comment on attachment 184491 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184491&action=review >> Source/WebCore/bindings/v8/V8GCController.cpp:106 >> + retainedObjectInfo = adoptPtr(new RetainedDOMInfo(static_cast<Node*>(root))); > > Why is this static cast valid? Because V8DOMWrapper::associateObjectWithWrapper will set wrapper class id to v8DOMNodeClassId only if the wrapped object is a DOM node and the opaque root for DOM nodes is always a node. I started with a patch that introduced NodeImplicitConnection and ObjectImplicitConnection derived from ImplicitConnection and made the compiler control that the root is a node. But it looked unnecessarily complicated. Created attachment 184715 [details]
Patch without static_cast<Node*>
Comment on attachment 184715 [details]
Patch without static_cast<Node*>
Yay for no static_cast. Thanks!
Comment on attachment 184491 [details]
Patch
IMHO the later patch is better.
Committed r140949: <http://trac.webkit.org/changeset/140949> |