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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 348833005: [DO NOT COMMIT] Random hacks to unblock work on replication. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More random hacks, including also dcheng's https://codereview.chromium.org/346403002 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/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 e06ecff1eafe1df066479e45aa3588a14eeb1793..bf285a59a1cf8c6c24766505c55268c9e38ac4d1 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1587,13 +1587,16 @@ void WebLocalFrameImpl::setWebCoreFrame(PassRefPtr<WebCore::LocalFrame> frame)
}
}
-void WebLocalFrameImpl::initializeAsMainFrame(WebCore::Page* page)
+PassRefPtr<LocalFrame> WebLocalFrameImpl::initializeWebCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName)
{
- setWebCoreFrame(LocalFrame::create(&m_frameLoaderClientImpl, &page->frameHost(), 0));
-
+ RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host, owner);
+ setWebCoreFrame(frame);
+ frame->tree().setName(name, fallbackName);
// We must call init() after m_frame is assigned because it is referenced
- // during init().
- m_frame->init();
+ // during init(). Note that this may dispatch JS events; the frame may be
+ // detached after init() returns.
+ frame->init();
+ return frame;
}
PassRefPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& request, HTMLFrameOwnerElement* ownerElement)
@@ -1607,7 +1610,7 @@ PassRefPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadReques
// solution. subResourceAttributeName returns just one attribute name. The
// element might not have the attribute, and there might be other attributes
// which can identify the element.
- RefPtr<LocalFrame> child = webframeChild->initializeAsChildFrame(frame()->host(), ownerElement, request.frameName(), ownerElement->getAttribute(ownerElement->subResourceAttributeName()));
+ RefPtr<LocalFrame> child = webframeChild->initializeWebCoreFrame(frame()->host(), ownerElement, request.frameName(), ownerElement->getAttribute(ownerElement->subResourceAttributeName()));
// Initializing the WebCore frame may cause the new child to be detached, since it may dispatch a load event in the parent.
if (!child->tree().parent())
return nullptr;
@@ -1643,11 +1646,12 @@ void WebLocalFrameImpl::didChangeContentsSize(const IntSize& size)
void WebLocalFrameImpl::createFrameView()
{
TRACE_EVENT0("blink", "WebLocalFrameImpl::createFrameView");
+ printf("WebLocalFrameImpl::createFrameView\n");
ASSERT(frame()); // If frame() doesn't exist, we probably didn't init properly.
WebViewImpl* webView = viewImpl();
- bool isMainFrame = webView->mainFrameImpl()->frame() == frame();
+ bool isMainFrame = frame()->isLocalRoot();
if (isMainFrame)
webView->suppressInvalidations(true);
@@ -1890,14 +1894,4 @@ void WebLocalFrameImpl::invalidateAll() const
invalidateScrollbar();
}
-PassRefPtr<LocalFrame> WebLocalFrameImpl::initializeAsChildFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName)
-{
- RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host, owner);
- setWebCoreFrame(frame);
- frame->tree().setName(name, fallbackName);
- // May dispatch JS events; frame may be detached after this.
- frame->init();
- return frame;
-}
-
} // namespace blink
« 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