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

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

Issue 1141553006: Update Blink to use the tree scope info on WebFrame for scoping checks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 7 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 | Annotate | Revision Log
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 "config.h" 5 #include "config.h"
6 #include "web/WebRemoteFrameImpl.h" 6 #include "web/WebRemoteFrameImpl.h"
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/RemoteFrame.h" 9 #include "core/frame/RemoteFrame.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
11 #include "core/page/Page.h" 11 #include "core/page/Page.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "public/platform/WebFloatRect.h" 13 #include "public/platform/WebFloatRect.h"
14 #include "public/platform/WebRect.h" 14 #include "public/platform/WebRect.h"
15 #include "public/web/WebDocument.h" 15 #include "public/web/WebDocument.h"
16 #include "public/web/WebPerformance.h" 16 #include "public/web/WebPerformance.h"
17 #include "public/web/WebRange.h" 17 #include "public/web/WebRange.h"
18 #include "public/web/WebTreeScopeType.h" 18 #include "public/web/WebTreeScopeType.h"
19 #include "web/RemoteBridgeFrameOwner.h" 19 #include "web/RemoteBridgeFrameOwner.h"
20 #include "web/WebViewImpl.h" 20 #include "web/WebViewImpl.h"
21 #include <v8/include/v8.h> 21 #include <v8/include/v8.h>
22 22
23 namespace blink { 23 namespace blink {
24 24
25 WebRemoteFrame* WebRemoteFrame::create(WebRemoteFrameClient* client)
26 {
27 return WebRemoteFrame::create(WebTreeScopeType::Document, client);
28 }
29
30 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, WebRemoteFrameCli ent* client) 25 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, WebRemoteFrameCli ent* client)
31 { 26 {
32 return WebRemoteFrameImpl::create(scope, client); 27 return WebRemoteFrameImpl::create(scope, client);
33 } 28 }
34 29
35 WebRemoteFrame* WebRemoteFrameImpl::create(WebTreeScopeType scope, WebRemoteFram eClient* client) 30 WebRemoteFrame* WebRemoteFrameImpl::create(WebTreeScopeType scope, WebRemoteFram eClient* client)
36 { 31 {
37 WebRemoteFrameImpl* frame = new WebRemoteFrameImpl(scope, client); 32 WebRemoteFrameImpl* frame = new WebRemoteFrameImpl(scope, client);
38 #if ENABLE(OILPAN) 33 #if ENABLE(OILPAN)
39 return frame; 34 return frame;
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 ASSERT_NOT_REACHED(); 706 ASSERT_NOT_REACHED();
712 return false; 707 return false;
713 } 708 }
714 709
715 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const 710 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const
716 { 711 {
717 ASSERT_NOT_REACHED(); 712 ASSERT_NOT_REACHED();
718 return WebString(); 713 return WebString();
719 } 714 }
720 715
721 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebSa ndboxFlags sandboxFlags, WebFrameClient* client, WebFrame* previousSibling)
722 {
723 return createLocalChild(WebTreeScopeType::Document, name, sandboxFlags, clie nt, previousSibling);
724 }
725
726 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons t WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFram e* previousSibling) 716 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons t WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFram e* previousSibling)
727 { 717 {
728 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope, client)); 718 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope, client));
729 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt = 719 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt =
730 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, sta tic_cast<SandboxFlags>(sandboxFlags))); 720 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, sta tic_cast<SandboxFlags>(sandboxFlags)));
731 insertAfter(child, previousSibling); 721 insertAfter(child, previousSibling);
732 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may 722 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may
733 // result in the browser observing two navigations to about:blank (one from the initial 723 // result in the browser observing two navigations to about:blank (one from the initial
734 // frame creation, and one from swapping it into the remote process). FrameL oader might 724 // frame creation, and one from swapping it into the remote process). FrameL oader might
735 // need a special initialization function for this case to avoid that duplic ate navigation. 725 // need a special initialization function for this case to avoid that duplic ate navigation.
736 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom); 726 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom);
737 // Partially related with the above FIXME--the init() call may trigger JS di spatch. However, 727 // Partially related with the above FIXME--the init() call may trigger JS di spatch. However,
738 // if the parent is remote, it should never be detached synchronously... 728 // if the parent is remote, it should never be detached synchronously...
739 ASSERT(child->frame()); 729 ASSERT(child->frame());
740 return child; 730 return child;
741 } 731 }
742 732
743 733
744 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name) 734 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name)
745 { 735 {
746 setCoreFrame(RemoteFrame::create(&m_frameClient, host, owner)); 736 setCoreFrame(RemoteFrame::create(&m_frameClient, host, owner));
747 frame()->createView(); 737 frame()->createView();
748 m_frame->tree().setName(name, nullAtom); 738 m_frame->tree().setName(name, nullAtom);
749 } 739 }
750 740
751 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, Web SandboxFlags sandboxFlags, WebRemoteFrameClient* client)
752 {
753 return createRemoteChild(WebTreeScopeType::Document, name, sandboxFlags, cli ent);
754 }
755
756 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) 741 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client)
757 { 742 {
758 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop e, client)); 743 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop e, client));
759 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt = 744 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu lt =
760 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s tatic_cast<SandboxFlags>(sandboxFlags))); 745 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s tatic_cast<SandboxFlags>(sandboxFlags)));
761 appendChild(child); 746 appendChild(child);
762 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name); 747 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name);
763 return child; 748 return child;
764 } 749 }
765 750
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 : WebRemoteFrame(scope) 812 : WebRemoteFrame(scope)
828 , m_frameClient(this) 813 , m_frameClient(this)
829 , m_client(client) 814 , m_client(client)
830 #if ENABLE(OILPAN) 815 #if ENABLE(OILPAN)
831 , m_selfKeepAlive(this) 816 , m_selfKeepAlive(this)
832 #endif 817 #endif
833 { 818 {
834 } 819 }
835 820
836 } // namespace blink 821 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698