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

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
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index c508c7f825670dc38d164d6192373edcbba25fd8..ade203f748b3ad84d83bbdd4342c1380b02d342b 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,18 @@ void WebLocalFrameImpl::loadJavaScriptURL(const KURL& url)
frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, ownerDocument.get());
}
+void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFrame)
+{
+ Frame* oldFrame = toCoreFrame(oldWebFrame);
+ m_frame = LocalFrame::create(&m_frameLoaderClientImpl, oldFrame->host(), new PlaceholderFrameOwner());
dcheng 2014/10/15 21:14:35 Is PlaceholderFrameOwner the right one? Do we not
Nate Chapin 2014/10/15 21:27:31 I don't think we enforce them in the provisional s
Nate Chapin 2014/10/16 21:45:56 This function now creates the LocalFrame with a Pl
+ 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());

Powered by Google App Engine
This is Rietveld 408576698