| 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
|
|
|