| Index: Source/core/frame/Frame.cpp
|
| diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
|
| index f647b3e5988b5ed202236a17a12183a39112612d..3ffd98811ceb4180b61749304dcc81c28d2b6deb 100644
|
| --- a/Source/core/frame/Frame.cpp
|
| +++ b/Source/core/frame/Frame.cpp
|
| @@ -63,6 +63,10 @@ Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
|
| , m_owner(owner)
|
| , m_client(client)
|
| , m_remotePlatformLayer(0)
|
| +#if ENABLE(OILPAN)
|
| + , m_disposeProtectionCount(0)
|
| + , m_hasBeenDisposed(false)
|
| +#endif
|
| {
|
| ASSERT(page());
|
|
|
| @@ -81,19 +85,51 @@ Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
|
|
|
| Frame::~Frame()
|
| {
|
| +#if ENABLE(OILPAN)
|
| + // With Oilpan, we depend on the Frame owner explicitly disposing it first.
|
| + // FIXME: consider also insisting on this non-Oilpan.
|
| + ASSERT(m_hasBeenDisposed);
|
| +#else
|
| + // FIXME: We should not be doing all this work inside the destructor
|
| + dispose();
|
| +#endif
|
| +}
|
| +
|
| +#if ENABLE(OILPAN)
|
| +void Frame::willBeDestroyed()
|
| +{
|
| + if (m_disposeProtectionCount > 0) {
|
| + setHasBeenDisposed();
|
| + return;
|
| + }
|
| + if (hasBeenDisposed())
|
| + return;
|
| +
|
| + setHasBeenDisposed();
|
| + dispose();
|
| +}
|
| +#endif
|
| +
|
| +void Frame::dispose()
|
| +{
|
| disconnectOwnerElement();
|
| setDOMWindow(nullptr);
|
|
|
| - // FIXME: We should not be doing all this work inside the destructor
|
| -
|
| #ifndef NDEBUG
|
| frameCounter.decrement();
|
| #endif
|
| }
|
|
|
| +void Frame::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_treeNode);
|
| + visitor->trace(m_owner);
|
| + visitor->trace(m_domWindow);
|
| +}
|
| +
|
| void Frame::detachChildren()
|
| {
|
| - typedef Vector<RefPtr<Frame> > FrameVector;
|
| + typedef WillBeHeapVector<RefPtrWillBeMember<Frame> > FrameVector;
|
| FrameVector childrenToDetach;
|
| childrenToDetach.reserveCapacity(tree().childCount());
|
| for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling())
|
| @@ -158,7 +194,7 @@ RenderPart* Frame::ownerRenderer() const
|
| return toRenderPart(object);
|
| }
|
|
|
| -void Frame::setRemotePlatformLayer(blink::WebLayer* layer)
|
| +void Frame::setRemotePlatformLayer(WebLayer* layer)
|
| {
|
| if (m_remotePlatformLayer)
|
| GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer);
|
| @@ -197,7 +233,7 @@ void Frame::disconnectOwnerElement()
|
| if (page())
|
| page()->decrementSubframeCount();
|
| }
|
| - m_owner = 0;
|
| + m_owner = nullptr;
|
| }
|
|
|
| HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const
|
|
|