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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase past r181245 conflict 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/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index 4ed3d84b79ed8cf92ccbfbf500873526525e86f2..8f02b7672cee0883e9d97a22ead70bbccc92bc9d 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -496,7 +496,12 @@ void WebLocalFrameImpl::close()
{
m_client = 0;
+#if ENABLE(OILPAN)
+ if (m_frame)
+ m_frame->willBeDestroyed();
+#else
deref(); // Balances ref() acquired in WebFrame::create
+#endif
}
WebString WebLocalFrameImpl::uniqueName() const
@@ -1514,7 +1519,12 @@ WebLocalFrame* WebLocalFrame::create(WebFrameClient* client)
WebLocalFrameImpl* WebLocalFrameImpl::create(WebFrameClient* client)
{
- return adoptRef(new WebLocalFrameImpl(client)).leakRef();
+ WebLocalFrameImpl* frame = new WebLocalFrameImpl(client);
+#if ENABLE(OILPAN)
+ return frame;
+#else
+ return adoptRef(frame).leakRef();
+#endif
}
WebLocalFrameImpl::WebLocalFrameImpl(WebFrameClient* client)
@@ -1537,8 +1547,21 @@ WebLocalFrameImpl::~WebLocalFrameImpl()
cancelPendingScopingEffort();
}
-void WebLocalFrameImpl::setCoreFrame(PassRefPtr<LocalFrame> frame)
+void WebLocalFrameImpl::trace(Visitor* visitor)
{
+ visitor->trace(m_frame);
+ visitor->trace(m_printContext);
+ visitor->trace(m_geolocationClientProxy);
+
+ WebFrame::trace(visitor, this);
+}
+
+void WebLocalFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<LocalFrame> frame)
+{
+#if ENABLE(OILPAN)
+ if (!frame && m_frame)
Mads Ager (chromium) 2014/09/03 10:07:54 Why the !frame check? If we lose the reference to
+ m_frame->willBeDestroyed();
+#endif
m_frame = frame;
// FIXME: we shouldn't add overhead to every frame by registering these objects when they're not used.
@@ -1560,9 +1583,9 @@ void WebLocalFrameImpl::setCoreFrame(PassRefPtr<LocalFrame> frame)
}
}
-PassRefPtr<LocalFrame> WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName)
+PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName)
{
- RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host, owner);
+ RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host, owner);
setCoreFrame(frame);
frame->tree().setName(name, fallbackName);
// We must call init() after m_frame is assigned because it is referenced
@@ -1572,7 +1595,7 @@ PassRefPtr<LocalFrame> WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, F
return frame;
}
-PassRefPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& request, HTMLFrameOwnerElement* ownerElement)
+PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& request, HTMLFrameOwnerElement* ownerElement)
{
ASSERT(m_client);
WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChildFrame(this, request.frameName()));
@@ -1583,7 +1606,7 @@ PassRefPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadReques
// solution. subResourceAttributeName returns just one attribute name. The
// element might not have the attribute, and there might be other attributes
// which can identify the element.
- RefPtr<LocalFrame> child = webframeChild->initializeCoreFrame(frame()->host(), ownerElement, request.frameName(), ownerElement->getAttribute(ownerElement->subResourceAttributeName()));
+ RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(frame()->host(), ownerElement, request.frameName(), ownerElement->getAttribute(ownerElement->subResourceAttributeName()));
// Initializing the core frame may cause the new child to be detached, since
// it may dispatch a load event in the parent.
if (!child->tree().parent())

Powered by Google App Engine
This is Rietveld 408576698