[webkit-dev] Rename of selfOnlyRef to guardRef - ok if I change it back? (was Re: DOM tree traversal on detached nodes)

Maciej Stachowiak mjs at apple.com
Fri Jun 15 12:40:43 PDT 2012


On Jun 15, 2012, at 12:22 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> On Fri, Jun 15, 2012 at 12:14 PM, Maciej Stachowiak <mjs at apple.com> wrote:
> I am not sure how to get the key points across without being accurate or misleading. A version that I think explains the complete design without saying anything false or misleading:
> 
> refTheDocumentItselfButUnlikeTheRegularRefDontPreventTheDocumentsChildrenFromBeingRemovedToAvoidCyclesWhenRefingTheOwnerDocument
> 
> To make a reasonable name we probably need to focus on one of these aspects. Perhaps one approach is to focus on when and why you should use this call, rather than what it does:
> 
> refAsOwnerDocument() / m_refCountAsOwnerDocument (or m_ownerDocumentRefCount)
> refAvoidingCycles() (or cycleAvoidingRef()) / m_cycleAvoidingRefCount
> 
> We probably need to qualify kinds of cycles we're avoiding: ones through descendents (or subtree); e.g. this doesn't avoid cycles with JSC/V8 objects.

That's one reason I like refAsOwnerDocument() slightly better. It tells you when to use it, and when Node.cpp does m_document->refAsOwnerDocument(), it will make sense in context.

However, if you wanted to make the other version more exactingly precise, you could say something like refAvodingCyclesWithDescendents().

Regards,
Maciej


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120615/ded1963d/attachment.html>


More information about the webkit-dev mailing list