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

Side by Side Diff: content/browser/frame_host/render_frame_proxy_host.cc

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: Revert unused changes from previous attempt + more cleanup. Created 5 years, 9 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 "content/browser/frame_host/render_frame_proxy_host.h" 5 #include "content/browser/frame_host/render_frame_proxy_host.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "content/browser/frame_host/cross_process_frame_connector.h" 8 #include "content/browser/frame_host/cross_process_frame_connector.h"
9 #include "content/browser/frame_host/frame_tree.h" 9 #include "content/browser/frame_host/frame_tree.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 10 #include "content/browser/frame_host/frame_tree_node.h"
(...skipping 28 matching lines...) Expand all
39 RenderFrameProxyHostID(process_id, routing_id)); 39 RenderFrameProxyHostID(process_id, routing_id));
40 return it == frames->end() ? NULL : it->second; 40 return it == frames->end() ? NULL : it->second;
41 } 41 }
42 42
43 RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance, 43 RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance,
44 FrameTreeNode* frame_tree_node) 44 FrameTreeNode* frame_tree_node)
45 : routing_id_(site_instance->GetProcess()->GetNextRoutingID()), 45 : routing_id_(site_instance->GetProcess()->GetNextRoutingID()),
46 site_instance_(site_instance), 46 site_instance_(site_instance),
47 process_(site_instance->GetProcess()), 47 process_(site_instance->GetProcess()),
48 frame_tree_node_(frame_tree_node), 48 frame_tree_node_(frame_tree_node),
49 render_frame_proxy_created_(false) { 49 render_frame_proxy_created_(false),
50 pseudo_parent_frame_tree_node_id_(-1) {
50 GetProcess()->AddRoute(routing_id_, this); 51 GetProcess()->AddRoute(routing_id_, this);
51 CHECK(g_routing_id_frame_proxy_map.Get().insert( 52 CHECK(g_routing_id_frame_proxy_map.Get().insert(
52 std::make_pair( 53 std::make_pair(
53 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_), 54 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_),
54 this)).second); 55 this)).second);
55 56
56 if (!frame_tree_node_->IsMainFrame() && 57 bool is_proxy_to_embedder_for_guest =
58 frame_tree_node_->IsMainFrame() &&
59 frame_tree_node_->render_manager()->current_frame_host()
60 ->GetSiteInstance()->GetSiteURL().SchemeIs("chrome-guest");
Fady Samuel 2015/03/04 22:21:06 This is not feasible for guests that are not isola
Charlie Reis 2015/03/10 04:09:44 Tangent: what does "not isolated" mean here?
61 if ((!frame_tree_node_->IsMainFrame() &&
57 frame_tree_node_->parent() 62 frame_tree_node_->parent()
58 ->render_manager() 63 ->render_manager()
59 ->current_frame_host() 64 ->current_frame_host()
60 ->GetSiteInstance() == site_instance) { 65 ->GetSiteInstance() == site_instance) ||
66 is_proxy_to_embedder_for_guest) {
61 // The RenderFrameHost navigating cross-process is destroyed and a proxy for 67 // The RenderFrameHost navigating cross-process is destroyed and a proxy for
62 // it is created in the parent's process. CrossProcessFrameConnector 68 // it is created in the parent's process. CrossProcessFrameConnector
63 // initialization only needs to happen on an initial cross-process 69 // initialization only needs to happen on an initial cross-process
64 // navigation, when the RenderFrameHost leaves the same process as its 70 // navigation, when the RenderFrameHost leaves the same process as its
65 // parent. The same CrossProcessFrameConnector is used for subsequent cross- 71 // parent. The same CrossProcessFrameConnector is used for subsequent cross-
66 // process navigations, but it will be destroyed if the frame is 72 // process navigations, but it will be destroyed if the frame is
67 // navigated back to the same SiteInstance as its parent. 73 // navigated back to the same SiteInstance as its parent.
68 cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this)); 74 cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this));
69 } 75 }
70 } 76 }
(...skipping 11 matching lines...) Expand all
82 GetProcess()->RemoveRoute(routing_id_); 88 GetProcess()->RemoveRoute(routing_id_);
83 g_routing_id_frame_proxy_map.Get().erase( 89 g_routing_id_frame_proxy_map.Get().erase(
84 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_)); 90 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_));
85 } 91 }
86 92
87 void RenderFrameProxyHost::SetChildRWHView(RenderWidgetHostView* view) { 93 void RenderFrameProxyHost::SetChildRWHView(RenderWidgetHostView* view) {
88 cross_process_frame_connector_->set_view( 94 cross_process_frame_connector_->set_view(
89 static_cast<RenderWidgetHostViewChildFrame*>(view)); 95 static_cast<RenderWidgetHostViewChildFrame*>(view));
90 } 96 }
91 97
98 void RenderFrameProxyHost::SetOverriddenParentFTNID(
99 int64 pseudo_parent_frame_tree_node_id) {
100 pseudo_parent_frame_tree_node_id_ =
Charlie Reis 2015/03/10 04:09:44 embedder_frame_tree_node_id_
lazyboy 2015/04/01 21:47:57 Obsolete now.
101 pseudo_parent_frame_tree_node_id;
102 }
103
92 RenderViewHostImpl* RenderFrameProxyHost::GetRenderViewHost() { 104 RenderViewHostImpl* RenderFrameProxyHost::GetRenderViewHost() {
Charlie Reis 2015/03/10 04:09:44 Note: We could probably just cache a pointer to th
lazyboy 2015/04/01 21:47:57 Added a TODO since we're not tracking embedder's F
93 return frame_tree_node_->frame_tree()->GetRenderViewHost( 105 FrameTree* ft = NULL;
Charlie Reis 2015/03/10 04:09:44 embedder_frame_tree = nullptr;
94 site_instance_.get()); 106 if (pseudo_parent_frame_tree_node_id_ >= 0) {
107 ft = FrameTree::GloballyFindByID(
108 pseudo_parent_frame_tree_node_id_)->frame_tree();
109 } else {
110 ft = frame_tree_node_->frame_tree();
111 }
112 return ft->GetRenderViewHost(site_instance_.get());
95 } 113 }
96 114
97 void RenderFrameProxyHost::TakeFrameHostOwnership( 115 void RenderFrameProxyHost::TakeFrameHostOwnership(
98 scoped_ptr<RenderFrameHostImpl> render_frame_host) { 116 scoped_ptr<RenderFrameHostImpl> render_frame_host) {
99 render_frame_host_ = render_frame_host.Pass(); 117 render_frame_host_ = render_frame_host.Pass();
100 render_frame_host_->set_render_frame_proxy_host(this); 118 render_frame_host_->set_render_frame_proxy_host(this);
101 } 119 }
102 120
103 scoped_ptr<RenderFrameHostImpl> RenderFrameProxyHost::PassFrameHostOwnership() { 121 scoped_ptr<RenderFrameHostImpl> RenderFrameProxyHost::PassFrameHostOwnership() {
104 render_frame_host_->set_render_frame_proxy_host(NULL); 122 render_frame_host_->set_render_frame_proxy_host(NULL);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 void RenderFrameProxyHost::DisownOpener() { 174 void RenderFrameProxyHost::DisownOpener() {
157 Send(new FrameMsg_DisownOpener(GetRoutingID())); 175 Send(new FrameMsg_DisownOpener(GetRoutingID()));
158 } 176 }
159 177
160 void RenderFrameProxyHost::OnOpenURL( 178 void RenderFrameProxyHost::OnOpenURL(
161 const FrameHostMsg_OpenURL_Params& params) { 179 const FrameHostMsg_OpenURL_Params& params) {
162 frame_tree_node_->current_frame_host()->OpenURL(params, site_instance_.get()); 180 frame_tree_node_->current_frame_host()->OpenURL(params, site_instance_.get());
163 } 181 }
164 182
165 } // namespace content 183 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698