Chromium Code Reviews| 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 ASSERT_NOT_REACHED(); | 687 ASSERT_NOT_REACHED(); |
| 688 return false; | 688 return false; |
| 689 } | 689 } |
| 690 | 690 |
| 691 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const | 691 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const |
| 692 { | 692 { |
| 693 ASSERT_NOT_REACHED(); | 693 ASSERT_NOT_REACHED(); |
| 694 return WebString(); | 694 return WebString(); |
| 695 } | 695 } |
| 696 | 696 |
| 697 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons t WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFram e* previousSibling, const WebFrameOwnerProperties& frameOwnerProperties) | 697 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons t WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, We bFrameClient* client, WebFrame* previousSibling, const WebFrameOwnerProperties& frameOwnerProperties) |
| 698 { | 698 { |
| 699 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope, client)); | 699 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope, client)); |
| 700 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt = | 700 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt = |
| 701 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, sta tic_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties)); | 701 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, sta tic_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties)); |
| 702 insertAfter(child, previousSibling); | 702 insertAfter(child, previousSibling); |
| 703 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may | 703 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may |
| 704 // result in the browser observing two navigations to about:blank (one from the initial | 704 // result in the browser observing two navigations to about:blank (one from the initial |
| 705 // frame creation, and one from swapping it into the remote process). FrameL oader might | 705 // frame creation, and one from swapping it into the remote process). FrameL oader might |
| 706 // need a special initialization function for this case to avoid that duplic ate navigation. | 706 // need a special initialization function for this case to avoid that duplic ate navigation. |
| 707 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom); | 707 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom, uniqueName); |
| 708 // Partially related with the above FIXME--the init() call may trigger JS di spatch. However, | 708 // Partially related with the above FIXME--the init() call may trigger JS di spatch. However, |
| 709 // if the parent is remote, it should never be detached synchronously... | 709 // if the parent is remote, it should never be detached synchronously... |
| 710 ASSERT(child->frame()); | 710 ASSERT(child->frame()); |
| 711 return child; | 711 return child; |
| 712 } | 712 } |
| 713 | 713 |
| 714 | 714 |
| 715 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName) | 715 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName, const AtomicString& uniqueName) |
| 716 { | 716 { |
| 717 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 717 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
| 718 frame()->createView(); | 718 frame()->createView(); |
| 719 m_frame->tree().setName(name, fallbackName); | 719 if (uniqueName.isEmpty()) { |
| 720 m_frame->tree().setName(name, fallbackName); | |
| 721 } else { | |
| 722 m_frame->tree().setNameForReplacementFrame(name, uniqueName); | |
| 723 } | |
| 720 } | 724 } |
| 721 | 725 |
| 722 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) | 726 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co nst WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) |
| 723 { | 727 { |
| 724 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop e, client)); | 728 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop e, client)); |
| 725 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt = | 729 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt = |
| 726 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); | 730 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); |
| 727 appendChild(child); | 731 appendChild(child); |
| 728 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom); | 732 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom, nullAtom); |
|
alexmos
2016/02/10 00:46:46
Should this be uniqueName?
Łukasz Anforowicz
2016/02/10 22:10:51
Done. Thanks for catching this. Not sure how I m
| |
| 729 return child; | 733 return child; |
| 730 } | 734 } |
| 731 | 735 |
| 732 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) | 736 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) |
| 733 { | 737 { |
| 734 m_frame = frame; | 738 m_frame = frame; |
| 735 } | 739 } |
| 736 | 740 |
| 737 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 741 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 738 { | 742 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 770 cache->childrenChanged(ownerElement); | 774 cache->childrenChanged(ownerElement); |
| 771 } | 775 } |
| 772 } | 776 } |
| 773 | 777 |
| 774 void WebRemoteFrameImpl::setReplicatedSandboxFlags(WebSandboxFlags flags) const | 778 void WebRemoteFrameImpl::setReplicatedSandboxFlags(WebSandboxFlags flags) const |
| 775 { | 779 { |
| 776 ASSERT(frame()); | 780 ASSERT(frame()); |
| 777 frame()->securityContext()->enforceSandboxFlags(static_cast<SandboxFlags>(fl ags)); | 781 frame()->securityContext()->enforceSandboxFlags(static_cast<SandboxFlags>(fl ags)); |
| 778 } | 782 } |
| 779 | 783 |
| 780 void WebRemoteFrameImpl::setReplicatedName(const WebString& name) const | 784 void WebRemoteFrameImpl::setReplicatedName(const WebString& name, const WebStrin g& uniqueName) const |
| 781 { | 785 { |
| 782 ASSERT(frame()); | 786 ASSERT(frame()); |
| 783 frame()->tree().setName(name, nullAtom); | 787 frame()->tree().setNameForReplacementFrame(name, uniqueName); |
|
alexmos
2016/02/10 00:46:46
Hmm, the comment for that function says: "Should o
Łukasz Anforowicz
2016/02/10 22:10:51
Done. Good point. I did think about it when writ
| |
| 784 } | 788 } |
| 785 | 789 |
| 786 void WebRemoteFrameImpl::setReplicatedShouldEnforceStrictMixedContentChecking(bo ol shouldEnforce) const | 790 void WebRemoteFrameImpl::setReplicatedShouldEnforceStrictMixedContentChecking(bo ol shouldEnforce) const |
| 787 { | 791 { |
| 788 ASSERT(frame()); | 792 ASSERT(frame()); |
| 789 frame()->securityContext()->setShouldEnforceStrictMixedContentChecking(shoul dEnforce); | 793 frame()->securityContext()->setShouldEnforceStrictMixedContentChecking(shoul dEnforce); |
| 790 } | 794 } |
| 791 | 795 |
| 792 void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const | 796 void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const |
| 793 { | 797 { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 820 : WebRemoteFrame(scope) | 824 : WebRemoteFrame(scope) |
| 821 , m_frameClient(RemoteFrameClientImpl::create(this)) | 825 , m_frameClient(RemoteFrameClientImpl::create(this)) |
| 822 , m_client(client) | 826 , m_client(client) |
| 823 #if ENABLE(OILPAN) | 827 #if ENABLE(OILPAN) |
| 824 , m_selfKeepAlive(this) | 828 , m_selfKeepAlive(this) |
| 825 #endif | 829 #endif |
| 826 { | 830 { |
| 827 } | 831 } |
| 828 | 832 |
| 829 } // namespace blink | 833 } // namespace blink |
| OLD | NEW |