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

Unified Diff: Source/web/WebFrame.cpp

Issue 643333002: Prepare for remote->local frame swap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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/web/WebLocalFrameImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFrame.cpp
diff --git a/Source/web/WebFrame.cpp b/Source/web/WebFrame.cpp
index d5498208d7dba748d3c4232433bc605c5315dd42..e5eb22bacb679fc1c1f139ebd6ea93b9d47fc6bf 100644
--- a/Source/web/WebFrame.cpp
+++ b/Source/web/WebFrame.cpp
@@ -42,10 +42,6 @@ bool WebFrame::swap(WebFrame* frame)
if (!oldFrame->host())
return false;
- // The frame being swapped in should not have a Frame associated
- // with it yet.
- ASSERT(!toCoreFrame(frame));
-
if (m_parent) {
if (m_parent->m_firstChild == this)
m_parent->m_firstChild = frame;
@@ -79,7 +75,11 @@ bool WebFrame::swap(WebFrame* frame)
// increments of connected subframes.
FrameOwner* owner = oldFrame->owner();
oldFrame->disconnectOwnerElement();
- if (frame->isWebLocalFrame()) {
+ if (toCoreFrame(frame)) {
+ ASSERT(owner == toCoreFrame(frame)->owner());
+ if (owner->isLocal())
+ toHTMLFrameOwnerElement(owner)->setContentFrame(*toCoreFrame(frame));
+ } else if (frame->isWebLocalFrame()) {
toWebLocalFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name(), nullAtom);
} else {
toWebRemoteFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name());
@@ -146,6 +146,11 @@ void WebFrame::removeChild(WebFrame* child)
toCoreFrame(this)->host()->decrementSubframeCount();
}
+void WebFrame::setParent(WebFrame* parent)
+{
+ m_parent = parent;
+}
+
WebFrame* WebFrame::parent() const
{
return m_parent;
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698