Make JSNodeFilterCondition handle its lifetime correctly
Created attachment 89713 [details]
Attachment 89713 [details] did not build on win:
Build output: http://queues.webkit.org/results/8442029
Created attachment 89733 [details]
Comment on attachment 89733 [details]
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.
> + WeakOwner m_weakOwner;
I would call this m_filterWeakOwner, to specify what it owns.
(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.
Committed r84021: <http://trac.webkit.org/changeset/84021>