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

Unified Diff: Source/web/WebFrame.cpp

Issue 668963002: Delay calling FrameOwner::setWidget when doing a remote->local frame transition (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/LocalFrame.cpp ('k') | no next file » | 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 e5eb22bacb679fc1c1f139ebd6ea93b9d47fc6bf..85054aad547e8a42316697e9837078b31d4d1204 100644
--- a/Source/web/WebFrame.cpp
+++ b/Source/web/WebFrame.cpp
@@ -6,6 +6,7 @@
#include "public/web/WebFrame.h"
#include "core/frame/FrameHost.h"
+#include "core/frame/FrameView.h"
#include "core/frame/RemoteFrame.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "platform/UserGestureIndicator.h"
@@ -75,10 +76,14 @@ bool WebFrame::swap(WebFrame* frame)
// increments of connected subframes.
FrameOwner* owner = oldFrame->owner();
oldFrame->disconnectOwnerElement();
- if (toCoreFrame(frame)) {
- ASSERT(owner == toCoreFrame(frame)->owner());
- if (owner->isLocal())
- toHTMLFrameOwnerElement(owner)->setContentFrame(*toCoreFrame(frame));
+ if (Frame* newFrame = toCoreFrame(frame)) {
+ ASSERT(owner == newFrame->owner());
+ if (owner->isLocal()) {
+ HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
+ ownerElement->setContentFrame(*newFrame);
+ if (newFrame->isLocalFrame())
+ ownerElement->setWidget(toLocalFrame(newFrame)->view());
+ }
} else if (frame->isWebLocalFrame()) {
toWebLocalFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name(), nullAtom);
} else {
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698