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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 ASSERT_NOT_REACHED(); | 600 ASSERT_NOT_REACHED(); |
601 return false; | 601 return false; |
602 } | 602 } |
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, const WebString& uniqueName, WebSandboxFlags sandboxFlags, We
bFrameClient* client, WebFrame* 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 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = |
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, uniqueName); |
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 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) |
628 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& fallbackName) | |
629 { | 628 { |
630 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 629 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
631 frame()->createView(); | 630 frame()->createView(); |
632 m_frame->tree().setName(name, fallbackName); | 631 m_frame->tree().setPrecalculatedName(name, uniqueName); |
633 } | 632 } |
634 | 633 |
635 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) | 634 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags,
WebRemoteFrameClient* client) |
636 { | 635 { |
637 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); | 636 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); |
638 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = | 637 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = |
639 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); | 638 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); |
640 appendChild(child); | 639 appendChild(child); |
641 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); | 640 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, uniqueName); |
642 return child; | 641 return child; |
643 } | 642 } |
644 | 643 |
645 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) | 644 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) |
646 { | 645 { |
647 m_frame = frame; | 646 m_frame = frame; |
648 } | 647 } |
649 | 648 |
650 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 649 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
651 { | 650 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 cache->childrenChanged(ownerElement); | 682 cache->childrenChanged(ownerElement); |
684 } | 683 } |
685 } | 684 } |
686 | 685 |
687 void WebRemoteFrameImpl::setReplicatedSandboxFlags(WebSandboxFlags flags) const | 686 void WebRemoteFrameImpl::setReplicatedSandboxFlags(WebSandboxFlags flags) const |
688 { | 687 { |
689 ASSERT(frame()); | 688 ASSERT(frame()); |
690 frame()->securityContext()->enforceSandboxFlags(static_cast<SandboxFlags>(fl
ags)); | 689 frame()->securityContext()->enforceSandboxFlags(static_cast<SandboxFlags>(fl
ags)); |
691 } | 690 } |
692 | 691 |
693 void WebRemoteFrameImpl::setReplicatedName(const WebString& name) const | 692 void WebRemoteFrameImpl::setReplicatedName(const WebString& name, const WebStrin
g& uniqueName) const |
694 { | 693 { |
695 ASSERT(frame()); | 694 ASSERT(frame()); |
696 frame()->tree().setName(name, nullAtom); | 695 frame()->tree().setPrecalculatedName(name, uniqueName); |
697 } | 696 } |
698 | 697 |
699 void WebRemoteFrameImpl::setReplicatedShouldEnforceStrictMixedContentChecking(bo
ol shouldEnforce) const | 698 void WebRemoteFrameImpl::setReplicatedShouldEnforceStrictMixedContentChecking(bo
ol shouldEnforce) const |
700 { | 699 { |
701 ASSERT(frame()); | 700 ASSERT(frame()); |
702 frame()->securityContext()->setShouldEnforceStrictMixedContentChecking(shoul
dEnforce); | 701 frame()->securityContext()->setShouldEnforceStrictMixedContentChecking(shoul
dEnforce); |
703 } | 702 } |
704 | 703 |
705 void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const | 704 void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const |
706 { | 705 { |
(...skipping 28 matching lines...) Expand all Loading... |
735 : WebRemoteFrame(scope) | 734 : WebRemoteFrame(scope) |
736 , m_frameClient(RemoteFrameClientImpl::create(this)) | 735 , m_frameClient(RemoteFrameClientImpl::create(this)) |
737 , m_client(client) | 736 , m_client(client) |
738 #if ENABLE(OILPAN) | 737 #if ENABLE(OILPAN) |
739 , m_selfKeepAlive(this) | 738 , m_selfKeepAlive(this) |
740 #endif | 739 #endif |
741 { | 740 { |
742 } | 741 } |
743 | 742 |
744 } // namespace blink | 743 } // namespace blink |
OLD | NEW |