Chromium Code Reviews| Index: Source/core/frame/Frame.cpp |
| diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp |
| index f647b3e5988b5ed202236a17a12183a39112612d..d65ccdb7dc5f8195db5325fa528af768a95ee7f6 100644 |
| --- a/Source/core/frame/Frame.cpp |
| +++ b/Source/core/frame/Frame.cpp |
| @@ -63,6 +63,9 @@ Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
| , m_owner(owner) |
| , m_client(client) |
| , m_remotePlatformLayer(0) |
| +#if ENABLE(OILPAN) |
| + , m_hasBeenClosed(false) |
| +#endif |
| { |
| ASSERT(page()); |
| @@ -81,19 +84,32 @@ Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
| Frame::~Frame() |
| { |
| + // FIXME: We should not be doing all this work inside the destructor |
| + dispose(); |
|
haraken
2014/09/08 07:25:58
Shall we rewrite this to:
#if ENABLE(OILPAN)
AS
sof
2014/09/08 21:17:45
I've added that as an Oilpan assert (in dispose())
sof
2014/09/11 13:27:05
This turned out a step too far -- "non local" Fram
|
| +} |
| + |
| +void Frame::dispose() |
| +{ |
| +#if !ENABLE(OILPAN) |
|
dcheng
2014/09/07 22:26:33
Why is this block no longer needed with Oilpan? It
sof
2014/09/08 21:17:45
It is handled implicitly upon the next GC; LocalDO
|
| disconnectOwnerElement(); |
| setDOMWindow(nullptr); |
| - |
| - // FIXME: We should not be doing all this work inside the destructor |
| +#endif |
| #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()) |
| @@ -126,6 +142,7 @@ void Frame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow) |
| { |
| if (m_domWindow) |
| m_domWindow->reset(); |
| + |
| m_domWindow = domWindow; |
| } |
| @@ -158,7 +175,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 +214,7 @@ void Frame::disconnectOwnerElement() |
| if (page()) |
| page()->decrementSubframeCount(); |
| } |
| - m_owner = 0; |
| + m_owner = nullptr; |
| } |
| HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const |