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

Unified Diff: Source/web/WebLocalFrameImpl.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/web/WebLocalFrameImpl.h ('k') | Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index c508c7f825670dc38d164d6192373edcbba25fd8..8988239e1c609aed9246ed6863e6f2a6738c0351 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -205,6 +205,7 @@
#include "web/WebDataSourceImpl.h"
#include "web/WebDevToolsAgentPrivate.h"
#include "web/WebPluginContainerImpl.h"
+#include "web/WebRemoteFrameImpl.h"
#include "web/WebViewImpl.h"
#include "wtf/CurrentTime.h"
#include "wtf/HashMap.h"
@@ -1803,6 +1804,20 @@ void WebLocalFrameImpl::loadJavaScriptURL(const KURL& url)
frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, ownerDocument.get());
}
+void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFrame)
+{
+ Frame* oldFrame = toCoreFrame(oldWebFrame);
+ OwnPtr<FrameOwner> tempOwner = adoptPtr(new PlaceholderFrameOwner());
+ m_frame = LocalFrame::create(&m_frameLoaderClientImpl, oldFrame->host(), tempOwner.get());
+ m_frame->setOwner(oldFrame->owner());
+ m_frame->tree().setName(oldFrame->tree().name());
+ setParent(oldWebFrame->parent());
+ // We must call init() after m_frame is assigned because it is referenced
+ // during init(). Note that this may dispatch JS events; the frame may be
+ // detached after init() returns.
+ m_frame->init();
+}
+
void WebLocalFrameImpl::sendPings(const WebNode& linkNode, const WebURL& destinationURL)
{
ASSERT(frame());
« no previous file with comments | « Source/web/WebLocalFrameImpl.h ('k') | Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698