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

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

Issue 219903002: Revert 170347 "Convert HTMLFrameOwnerElement and FocusController..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1917/
Patch Set: Created 6 years, 9 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/LocalFrame.h ('k') | Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalFrame.cpp
===================================================================
--- Source/core/frame/LocalFrame.cpp (revision 170478)
+++ Source/core/frame/LocalFrame.cpp (working copy)
@@ -102,6 +102,10 @@
, m_orientation(0)
, m_inViewSourceMode(false)
{
+ if (this->ownerElement()) {
+ page()->incrementSubframeCount();
+ this->ownerElement()->setContentFrame(*this);
+ }
}
PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost* host, HTMLFrameOwnerElement* ownerElement)
@@ -118,6 +122,8 @@
setView(nullptr);
loader().clear();
setDOMWindow(nullptr);
+
+ disconnectOwnerElement();
}
bool LocalFrame::inScope(TreeScope* scope) const
@@ -258,6 +264,18 @@
Frame::detachFromFrameHost();
}
+void LocalFrame::disconnectOwnerElement()
+{
+ if (ownerElement()) {
+ if (Document* doc = document())
+ doc->topDocument().clearAXObjectCache();
+ ownerElement()->clearContentFrame();
+ if (page())
+ page()->decrementSubframeCount();
+ }
+ m_ownerElement = 0;
+}
+
String LocalFrame::documentTypeString() const
{
if (DocumentType* doctype = document()->doctype())
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698