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

Unified Diff: Source/web/WebRemoteFrameImpl.cpp

Issue 346403002: Initialize WebCore::Frame when swapping frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests, less leaks Created 6 years, 6 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/WebRemoteFrameImpl.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebRemoteFrameImpl.cpp
diff --git a/Source/web/WebRemoteFrameImpl.cpp b/Source/web/WebRemoteFrameImpl.cpp
index cf1a3a37e5b05df9d32fdc9f15e32dcc4e7b462e..651793dace5e41d85c4e31ee99f6f6b5b5836eec 100644
--- a/Source/web/WebRemoteFrameImpl.cpp
+++ b/Source/web/WebRemoteFrameImpl.cpp
@@ -130,7 +130,7 @@ WebRemoteFrame* WebRemoteFrameImpl::toWebRemoteFrame()
void WebRemoteFrameImpl::close()
{
- ASSERT_NOT_REACHED();
+ deref();
}
WebString WebRemoteFrameImpl::uniqueName() const
@@ -793,16 +793,17 @@ WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebFr
// result in the browser observing two navigations to about:blank (one from the initial
// frame creation, and one from swapping it into the remote process). FrameLoader might
// need a special initialization function for this case to avoid that duplicate navigation.
- child->initializeAsChildFrame(frame()->host(), result.storedValue->value.get(), name, AtomicString());
+ child->initializeWebCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom);
// Partially related with the above FIXME--the init() call may trigger JS dispatch. However,
// if the parent is remote, it should never be detached synchronously...
ASSERT(child->frame());
return child;
}
-void WebRemoteFrameImpl::initializeAsMainFrame(Page* page)
+void WebRemoteFrameImpl::initializeWebCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name)
{
- setWebCoreFrame(RemoteFrame::create(&m_frameClient, &page->frameHost(), 0));
+ setWebCoreFrame(RemoteFrame::create(&m_frameClient, host, owner));
+ m_frame->tree().setName(name, nullAtom);
}
WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, WebFrameClient* client)
@@ -811,9 +812,7 @@ WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, Web
HashMap<WebFrame*, OwnPtr<FrameOwner> >::AddResult result =
m_ownersForChildren.add(child, adoptPtr(new PlaceholderFrameOwner));
appendChild(child);
- RefPtr<RemoteFrame> childFrame = RemoteFrame::create(&child->m_frameClient, frame()->host(), result.storedValue->value.get());
- child->setWebCoreFrame(childFrame);
- childFrame->tree().setName(name, AtomicString());
+ child->initializeWebCoreFrame(frame()->host(), result.storedValue->value.get(), name);
return child;
}
« no previous file with comments | « Source/web/WebRemoteFrameImpl.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698