[Webkit-unassigned] [Bug 51914] ElementRareData::m_shadowRoot should not be RefPtr.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 17 18:21:12 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=51914
--- Comment #6 from MORITA Hajime <morrita at google.com> 2011-01-17 18:21:12 PST ---
Hi Dimitri, thank you for your quick review!
I updated the patch could you take the next round?
> > Source/WebCore/dom/Element.cpp:1090
> > void Element::setShadowRoot(PassRefPtr<Node> node)
>
> We're not passing RefPtr anymore, since it'll be stored as a raw ptr. Should we still have PassRefPtr as an argument?
Yes. I once tried to switch a raw pointer and notice that it is inconvenient because
SomeElement::create() returns PassRefPtr.
It looks that arguments for new nodes are declared as PassRefPtr, and raw pointer for existing pointer.
Here is the declaration for Node::insertBefore():
bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode&, bool shouldLazyAttach = false);
>
> > Source/WebCore/dom/Element.cpp:1110
> > + ElementRareData* data = rareData();
> > + if (data->m_shadowRoot) {
>
> Could be written in one line as "if (ElementRareData* data = rareData()) {"
Sure. Fixed.
>
> > Source/WebCore/dom/Element.cpp:1111
> > + RefPtr<Node> oldRoot = adoptRef(data->m_shadowRoot);
>
> adoptRef, are you sure? You actually do want to increment the ref count here.
You are right. Fixed.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list