| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "web/WebRemoteFrameImpl.h" | 6 #include "web/WebRemoteFrameImpl.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameOwner.h" | 8 #include "core/frame/FrameOwner.h" |
| 9 #include "core/frame/RemoteFrame.h" | 9 #include "core/frame/RemoteFrame.h" |
| 10 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebFr
ameClient* client) | 791 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebFr
ameClient* client) |
| 792 { | 792 { |
| 793 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(client)
); | 793 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(client)
); |
| 794 HashMap<WebFrame*, OwnPtr<FrameOwner> >::AddResult result = | 794 HashMap<WebFrame*, OwnPtr<FrameOwner> >::AddResult result = |
| 795 m_ownersForChildren.add(child, adoptPtr(new RemoteBridgeFrameOwner(child
))); | 795 m_ownersForChildren.add(child, adoptPtr(new RemoteBridgeFrameOwner(child
))); |
| 796 appendChild(child); | 796 appendChild(child); |
| 797 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may | 797 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may |
| 798 // result in the browser observing two navigations to about:blank (one from
the initial | 798 // result in the browser observing two navigations to about:blank (one from
the initial |
| 799 // frame creation, and one from swapping it into the remote process). FrameL
oader might | 799 // frame creation, and one from swapping it into the remote process). FrameL
oader might |
| 800 // need a special initialization function for this case to avoid that duplic
ate navigation. | 800 // need a special initialization function for this case to avoid that duplic
ate navigation. |
| 801 child->initializeWebCoreFrame(frame()->host(), result.storedValue->value.get
(), name, nullAtom); | 801 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 802 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, | 802 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, |
| 803 // if the parent is remote, it should never be detached synchronously... | 803 // if the parent is remote, it should never be detached synchronously... |
| 804 ASSERT(child->frame()); | 804 ASSERT(child->frame()); |
| 805 return child; | 805 return child; |
| 806 } | 806 } |
| 807 | 807 |
| 808 void WebRemoteFrameImpl::initializeWebCoreFrame(FrameHost* host, FrameOwner* own
er, const AtomicString& name) | 808 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name) |
| 809 { | 809 { |
| 810 setWebCoreFrame(RemoteFrame::create(&m_frameClient, host, owner)); | 810 setCoreFrame(RemoteFrame::create(&m_frameClient, host, owner)); |
| 811 m_frame->tree().setName(name, nullAtom); | 811 m_frame->tree().setName(name, nullAtom); |
| 812 } | 812 } |
| 813 | 813 |
| 814 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, Web
FrameClient* client) | 814 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, Web
FrameClient* client) |
| 815 { | 815 { |
| 816 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(clie
nt)); | 816 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(clie
nt)); |
| 817 HashMap<WebFrame*, OwnPtr<FrameOwner> >::AddResult result = | 817 HashMap<WebFrame*, OwnPtr<FrameOwner> >::AddResult result = |
| 818 m_ownersForChildren.add(child, adoptPtr(new PlaceholderFrameOwner)); | 818 m_ownersForChildren.add(child, adoptPtr(new PlaceholderFrameOwner)); |
| 819 appendChild(child); | 819 appendChild(child); |
| 820 child->initializeWebCoreFrame(frame()->host(), result.storedValue->value.get
(), name); | 820 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name); |
| 821 return child; | 821 return child; |
| 822 } | 822 } |
| 823 | 823 |
| 824 void WebRemoteFrameImpl::setWebCoreFrame(PassRefPtr<RemoteFrame> frame) | 824 void WebRemoteFrameImpl::setCoreFrame(PassRefPtr<RemoteFrame> frame) |
| 825 { | 825 { |
| 826 m_frame = frame; | 826 m_frame = frame; |
| 827 } | 827 } |
| 828 | 828 |
| 829 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 829 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 830 { | 830 { |
| 831 if (!frame.client()) | 831 if (!frame.client()) |
| 832 return 0; | 832 return 0; |
| 833 return static_cast<RemoteFrameClient*>(frame.client())->webFrame(); | 833 return static_cast<RemoteFrameClient*>(frame.client())->webFrame(); |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace blink | 836 } // namespace blink |
| 837 | 837 |
| OLD | NEW |