[webkit-reviews] review granted: [Bug 129058] Move to using std::unique_ptr for Element, Node and related classes : [Attachment 224672] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 24 08:34:41 PST 2014


Anders Carlsson <andersca at apple.com> has granted Zan Dobersek
<zandobersek at gmail.com>'s request for review:
Bug 129058: Move to using std::unique_ptr for Element, Node and related classes
https://bugs.webkit.org/show_bug.cgi?id=129058

Attachment 224672: Patch
https://bugs.webkit.org/attachment.cgi?id=224672&action=review

------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=224672&action=review


> Source/WebCore/dom/Node.cpp:344
> -	   data =
ElementRareData::create(toRenderElement(m_data.m_renderer)).leakPtr();
> +	   data = new ElementRareData(toRenderElement(m_data.m_renderer));
>      else
> -	   data = NodeRareData::create(m_data.m_renderer).leakPtr();
> +	   data = new NodeRareData(m_data.m_renderer);

I think you should use std::make_unique with release() here to avoid the ugly
new expressions.


More information about the webkit-reviews mailing list