Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: Source/core/frame/Frame.cpp

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update OilpanExpectations Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698