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

Unified Diff: third_party/WebKit/Source/web/WebFrame.cpp

Issue 1802953003: RemoteBridgeFrameOwner: keep better track of the attached frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Doing work in constructors is evil. Created 4 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
Index: third_party/WebKit/Source/web/WebFrame.cpp
diff --git a/third_party/WebKit/Source/web/WebFrame.cpp b/third_party/WebKit/Source/web/WebFrame.cpp
index 8f185679f5004756b27b28c4b10bb6ca20d7c6b5..959255bdd566ce3b4819674c92d5bbfb0dc1dfc8 100644
--- a/third_party/WebKit/Source/web/WebFrame.cpp
+++ b/third_party/WebKit/Source/web/WebFrame.cpp
@@ -72,7 +72,6 @@ bool WebFrame::swap(WebFrame* frame)
AtomicString name = oldFrame->tree().name();
AtomicString uniqueName = oldFrame->tree().uniqueName();
FrameOwner* owner = oldFrame->owner();
- oldFrame->disconnectOwnerElement();
v8::HandleScope handleScope(v8::Isolate::GetCurrent());
HashMap<DOMWrapperWorld*, v8::Local<v8::Object>> globals;
@@ -83,21 +82,22 @@ bool WebFrame::swap(WebFrame* frame)
// associated with the frame itself have not yet been freed yet.
oldFrame->detach(FrameDetachType::Swap);
- // Finally, clone the state of the current Frame into one matching
- // the type of the passed in WebFrame.
+ // Clone the state of the current Frame into the one being swapped in.
// FIXME: This is a bit clunky; this results in pointless decrements and
// increments of connected subframes.
if (frame->isWebLocalFrame()) {
+ // TODO(dcheng): in an ideal world, both branches would just use
+ // WebFrameImplBase's initializeCoreFrame() helper. However, Blink
+ // currently requires a 'provisional' local frame to serve as a
+ // placeholder for loading state when swapping to a local frame.
+ // In this case, the core LocalFrame is already initialized, so just
+ // update a bit of state.
LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame();
ASSERT(owner == localFrame.owner());
if (owner) {
- if (owner->isLocal()) {
- HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
- ownerElement->setContentFrame(localFrame);
- ownerElement->setWidget(localFrame.view());
- } else {
- toRemoteBridgeFrameOwner(owner)->setContentFrame(toWebLocalFrameImpl(frame));
- }
+ owner->setContentFrame(localFrame);
+ if (owner->isLocal())
+ toHTMLFrameOwnerElement(owner)->setWidget(localFrame.view());
} else {
localFrame.page()->setMainFrame(&localFrame);
}
« no previous file with comments | « third_party/WebKit/Source/web/RemoteBridgeFrameOwner.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698