| 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 "web/WebRemoteFrameImpl.h" | 5 #include "web/WebRemoteFrameImpl.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "core/layout/LayoutObject.h" | 10 #include "core/layout/LayoutObject.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 603 |
| 604 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const | 604 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const |
| 605 { | 605 { |
| 606 ASSERT_NOT_REACHED(); | 606 ASSERT_NOT_REACHED(); |
| 607 return WebString(); | 607 return WebString(); |
| 608 } | 608 } |
| 609 | 609 |
| 610 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons
t WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFram
e* previousSibling, const WebFrameOwnerProperties& frameOwnerProperties) | 610 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons
t WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFram
e* previousSibling, const WebFrameOwnerProperties& frameOwnerProperties) |
| 611 { | 611 { |
| 612 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope,
client)); | 612 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope,
client)); |
| 613 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = | 613 HeapHashMap<WebFrame*, Member<FrameOwner>>::AddResult result = |
| 614 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, sta
tic_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties)); | 614 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, sta
tic_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties)); |
| 615 insertAfter(child, previousSibling); | 615 insertAfter(child, previousSibling); |
| 616 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may | 616 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may |
| 617 // result in the browser observing two navigations to about:blank (one from
the initial | 617 // result in the browser observing two navigations to about:blank (one from
the initial |
| 618 // frame creation, and one from swapping it into the remote process). FrameL
oader might | 618 // frame creation, and one from swapping it into the remote process). FrameL
oader might |
| 619 // need a special initialization function for this case to avoid that duplic
ate navigation. | 619 // need a special initialization function for this case to avoid that duplic
ate navigation. |
| 620 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); | 620 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 621 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, | 621 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, |
| 622 // if the parent is remote, it should never be detached synchronously... | 622 // if the parent is remote, it should never be detached synchronously... |
| 623 ASSERT(child->frame()); | 623 ASSERT(child->frame()); |
| 624 return child; | 624 return child; |
| 625 } | 625 } |
| 626 | 626 |
| 627 | 627 |
| 628 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& fallbackName) | 628 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& fallbackName) |
| 629 { | 629 { |
| 630 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 630 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
| 631 frame()->createView(); | 631 frame()->createView(); |
| 632 m_frame->tree().setName(name, fallbackName); | 632 m_frame->tree().setName(name, fallbackName); |
| 633 } | 633 } |
| 634 | 634 |
| 635 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) | 635 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) |
| 636 { | 636 { |
| 637 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); | 637 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); |
| 638 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = | 638 HeapHashMap<WebFrame*, Member<FrameOwner>>::AddResult result = |
| 639 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); | 639 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); |
| 640 appendChild(child); | 640 appendChild(child); |
| 641 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); | 641 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 642 return child; | 642 return child; |
| 643 } | 643 } |
| 644 | 644 |
| 645 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) | 645 void WebRemoteFrameImpl::setCoreFrame(RawPtr<RemoteFrame> frame) |
| 646 { | 646 { |
| 647 m_frame = frame; | 647 m_frame = frame; |
| 648 } | 648 } |
| 649 | 649 |
| 650 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 650 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 651 { | 651 { |
| 652 if (!frame.client()) | 652 if (!frame.client()) |
| 653 return nullptr; | 653 return nullptr; |
| 654 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); | 654 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); |
| 655 } | 655 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 : WebRemoteFrame(scope) | 735 : WebRemoteFrame(scope) |
| 736 , m_frameClient(RemoteFrameClientImpl::create(this)) | 736 , m_frameClient(RemoteFrameClientImpl::create(this)) |
| 737 , m_client(client) | 737 , m_client(client) |
| 738 #if ENABLE(OILPAN) | 738 #if ENABLE(OILPAN) |
| 739 , m_selfKeepAlive(this) | 739 , m_selfKeepAlive(this) |
| 740 #endif | 740 #endif |
| 741 { | 741 { |
| 742 } | 742 } |
| 743 | 743 |
| 744 } // namespace blink | 744 } // namespace blink |
| OLD | NEW |