Add an owning smart pointer for RenderObjects and start using it.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Dec 2013 01:36:19 +0000 (01:36 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Dec 2013 01:36:19 +0000 (01:36 +0000)
commit28f533c30d4dbd5b4aa316153db4d71a25a75a36
tree63468cfe604bfaffea9dc94302bde48371967ef7
parent0f63c3591671b5f1145121436bab17e187a149a0
Add an owning smart pointer for RenderObjects and start using it.
<https://webkit.org/b/126251>

This patch adds a RenderPtr pointer, essentially an OwnPtr for
RenderObjects. The difference is that RenderPtr destroys the object
by calling destroy() on it.

This is necessary to implement the willBeDestroyed() mechanism in
RenderObject that notifies renderers just before they are about to
be deleted, while they can still do tree traversal, etc.

I also added a make_unique-alike helper so you can write:

    auto renderer = createRenderObject<RenderImage>(...);

Put it all to use by making ContentData::createRenderer() return
RenderPtr<RenderObject> instead of raw RenderObject*.

Reviewed by Antti Koivisto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/PseudoElement.cpp
Source/WebCore/rendering/RenderPtr.h [new file with mode: 0644]
Source/WebCore/rendering/style/ContentData.cpp
Source/WebCore/rendering/style/ContentData.h