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

Ryosuke Niwa rniwa at webkit.org
Fri Jun 15 13:18:31 PDT 2012

On Fri, Jun 15, 2012 at 12:40 PM, Maciej Stachowiak <mjs at apple.com> wrote:

> 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.

Yeah, refAsOwnerDocument() sounds good to me.

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

Coincidentally, that's one of suggestions I made so I'm fine with that
version as well :)

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

More information about the webkit-dev mailing list