RESOLVED FIXED 58622
Make JSNodeFilterCondition handle its lifetime correctly
https://bugs.webkit.org/show_bug.cgi?id=58622
Summary Make JSNodeFilterCondition handle its lifetime correctly
Oliver Hunt
Reported 2011-04-14 18:23:04 PDT
Make JSNodeFilterCondition handle its lifetime correctly
Attachments
Patch (8.18 KB, patch)
2011-04-14 18:24 PDT, Oliver Hunt
no flags
Patch (8.12 KB, patch)
2011-04-14 21:39 PDT, Oliver Hunt
ggaren: review+
Oliver Hunt
Comment 1 2011-04-14 18:24:58 PDT
Build Bot
Comment 2 2011-04-14 20:06:17 PDT
Oliver Hunt
Comment 3 2011-04-14 21:39:07 PDT
Geoffrey Garen
Comment 4 2011-04-15 09:04:40 PDT
Comment on attachment 89733 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=89733&action=review Though it works, it seems a little strange to treat the filter condition's weak owner data member as the filter's opaque root. The idea of an opaque root is that it's the root of the DOM data structure that owns the weak handle. But here, you're using an internal data member of a leaf in the data structure. I think it would be a little clearer if JSNodeFilterCondition took its NodeFilter owner as a constructor argument, and used that as its opaque root. Then, you could remove the markAggregate function from JSNodeFilterCondition, and just have NodeFilter's markAggregate add itself as an opaque root. I'll say r+ because this patch works as is, but I think you should make that change before landing. > Source/WebCore/bindings/js/JSNodeFilterCondition.h:48 > + WeakOwner m_weakOwner; I would call this m_filterWeakOwner, to specify what it owns.
Geoffrey Garen
Comment 5 2011-04-15 09:11:05 PDT
(In reply to comment #4) > Then, you could remove the markAggregate function from JSNodeFilterCondition, and just have NodeFilter's markAggregate add itself as an opaque root. Taking this a step further, you could even remove the markAggregate function from NodeFilter, and just have the NodeFilter owners (TreeWalker and NodeIterator) add the NodeFilter as an opaque root. Yeah, I'm starting to like that idea even more.
Oliver Hunt
Comment 6 2011-04-15 12:56:31 PDT
Note You need to log in before you can comment on or make changes to this bug.