Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Rebasing... Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698