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

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: Experiment: also clear FrameView and FrameLoader during owner disconnect for non-Oilpan 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
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/FrameConsole.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Frame.cpp
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
index f647b3e5988b5ed202236a17a12183a39112612d..f1becba59eaa117bf99fd668489c93fcbd2f35a9 100644
--- a/Source/core/frame/Frame.cpp
+++ b/Source/core/frame/Frame.cpp
@@ -81,26 +81,37 @@ Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
Frame::~Frame()
{
+ // FIXME: We should not be doing all this work inside the destructor
+#if !ENABLE(OILPAN)
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_host);
+ 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())
childrenToDetach.append(child);
FrameVector::iterator end = childrenToDetach.end();
- for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it)
+ for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it) {
(*it)->detach();
+ (*it)->disconnectOwnerElement();
+ }
}
FrameHost* Frame::host() const
@@ -126,6 +137,7 @@ void Frame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow)
{
if (m_domWindow)
m_domWindow->reset();
+
m_domWindow = domWindow;
}
@@ -158,7 +170,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 +209,7 @@ void Frame::disconnectOwnerElement()
if (page())
page()->decrementSubframeCount();
}
- m_owner = 0;
+ m_owner = nullptr;
}
HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/FrameConsole.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698