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

Unified Diff: Source/web/WebFrame.cpp

Issue 948143002: Remove unused WebFrame::swap() path for local frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nullptr Created 5 years, 10 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 | « no previous file | Source/web/WebLocalFrameImpl.cpp » ('j') | Source/web/WebLocalFrameImpl.cpp » ('J')
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 9371cffe9ecd4b93bc45e5e75c0a583046667ea3..3ea39a30aaec41bfac9b2ce26ca073a0aed4fb3c 100644
--- a/Source/web/WebFrame.cpp
+++ b/Source/web/WebFrame.cpp
@@ -7,8 +7,10 @@
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
+#include "core/frame/LocalFrame.h"
#include "core/frame/RemoteFrame.h"
#include "core/html/HTMLFrameOwnerElement.h"
+#include "core/page/Page.h"
#include "platform/UserGestureIndicator.h"
#include "platform/heap/Handle.h"
#include "web/OpenedFrameTracker.h"
@@ -81,16 +83,16 @@ bool WebFrame::swap(WebFrame* frame)
// increments of connected subframes.
FrameOwner* owner = oldFrame->owner();
oldFrame->disconnectOwnerElement();
- if (Frame* newFrame = toCoreFrame(frame)) {
- ASSERT(owner == newFrame->owner());
- if (owner->isLocal()) {
+ if (frame->isWebLocalFrame()) {
+ LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame();
+ ASSERT(owner == localFrame.owner());
+ if (owner && owner->isLocal()) {
HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
- ownerElement->setContentFrame(*newFrame);
- if (newFrame->isLocalFrame())
- ownerElement->setWidget(toLocalFrame(newFrame)->view());
+ ownerElement->setContentFrame(localFrame);
+ ownerElement->setWidget(localFrame.view());
+ } else {
+ localFrame.page()->setMainFrame(&localFrame);
}
- } else if (frame->isWebLocalFrame()) {
- toWebLocalFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name(), nullAtom);
} else {
toWebRemoteFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name());
}
« no previous file with comments | « no previous file | Source/web/WebLocalFrameImpl.cpp » ('j') | Source/web/WebLocalFrameImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698