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

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: fix RFPH::OnDispatch, remove dispatcher.cc changes, use new container, rename ACK IPC Created 5 years, 6 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/bad_message.h" 8 #include "content/browser/bad_message.h"
9 #include "content/browser/frame_host/cross_process_frame_connector.h" 9 #include "content/browser/frame_host/cross_process_frame_connector.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 render_frame_proxy_created_(false), 53 render_frame_proxy_created_(false),
54 render_view_host_(render_view_host) { 54 render_view_host_(render_view_host) {
55 GetProcess()->AddRoute(routing_id_, this); 55 GetProcess()->AddRoute(routing_id_, this);
56 CHECK(g_routing_id_frame_proxy_map.Get().insert( 56 CHECK(g_routing_id_frame_proxy_map.Get().insert(
57 std::make_pair( 57 std::make_pair(
58 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_), 58 RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_),
59 this)).second); 59 this)).second);
60 CHECK(render_view_host_); 60 CHECK(render_view_host_);
61 frame_tree_node_->frame_tree()->AddRenderViewHostRef(render_view_host_); 61 frame_tree_node_->frame_tree()->AddRenderViewHostRef(render_view_host_);
62 62
63 if (!frame_tree_node_->IsMainFrame() && 63 bool is_proxy_to_parent = !frame_tree_node_->IsMainFrame() &&
64 frame_tree_node_->parent() 64 frame_tree_node_->parent()
65 ->render_manager() 65 ->render_manager()
66 ->current_frame_host() 66 ->current_frame_host()
67 ->GetSiteInstance() == site_instance) { 67 ->GetSiteInstance() == site_instance;
68
69 // If this is a proxy to parent frame or this proxy is for the inner
70 // WebContents's FrameTreeNode in outer WebContents's process, then we need a
71 // CrossProcessFrameConnector.
72 if (is_proxy_to_parent ||
73 frame_tree_node_->render_manager()->ForInnerDelegate()) {
68 // The RenderFrameHost navigating cross-process is destroyed and a proxy for 74 // The RenderFrameHost navigating cross-process is destroyed and a proxy for
69 // it is created in the parent's process. CrossProcessFrameConnector 75 // it is created in the parent's process. CrossProcessFrameConnector
70 // initialization only needs to happen on an initial cross-process 76 // initialization only needs to happen on an initial cross-process
71 // navigation, when the RenderFrameHost leaves the same process as its 77 // navigation, when the RenderFrameHost leaves the same process as its
72 // parent. The same CrossProcessFrameConnector is used for subsequent cross- 78 // parent. The same CrossProcessFrameConnector is used for subsequent cross-
73 // process navigations, but it will be destroyed if the frame is 79 // process navigations, but it will be destroyed if the frame is
74 // navigated back to the same SiteInstance as its parent. 80 // navigated back to the same SiteInstance as its parent.
75 cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this)); 81 cross_process_frame_connector_.reset(new CrossProcessFrameConnector(this));
76 } 82 }
77 } 83 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 179
174 render_frame_proxy_created_ = true; 180 render_frame_proxy_created_ = true;
175 return true; 181 return true;
176 } 182 }
177 183
178 void RenderFrameProxyHost::DisownOpener() { 184 void RenderFrameProxyHost::DisownOpener() {
179 Send(new FrameMsg_DisownOpener(GetRoutingID())); 185 Send(new FrameMsg_DisownOpener(GetRoutingID()));
180 } 186 }
181 187
182 void RenderFrameProxyHost::OnDetach() { 188 void RenderFrameProxyHost::OnDetach() {
189 if (frame_tree_node_->render_manager()->ForInnerDelegate()) {
lazyboy 2015/06/03 22:32:27 I've fixed the proxy detached issue. The scenario
190 frame_tree_node_->render_manager()->RemoveOuterDelegateFrame();
191 return;
192 }
193
183 // This message should only be received for subframes. Note that we can't 194 // This message should only be received for subframes. Note that we can't
184 // restrict it to just the current SiteInstances of the ancestors of this 195 // restrict it to just the current SiteInstances of the ancestors of this
185 // frame, because another frame in the tree may be able to detach this frame 196 // frame, because another frame in the tree may be able to detach this frame
186 // by navigating its parent. 197 // by navigating its parent.
187 if (frame_tree_node_->IsMainFrame()) { 198 if (frame_tree_node_->IsMainFrame()) {
188 bad_message::ReceivedBadMessage(GetProcess(), bad_message::RFPH_DETACH); 199 bad_message::ReceivedBadMessage(GetProcess(), bad_message::RFPH_DETACH);
189 return; 200 return;
190 } 201 }
191 frame_tree_node_->frame_tree()->RemoveFrame(frame_tree_node_); 202 frame_tree_node_->frame_tree()->RemoveFrame(frame_tree_node_);
192 } 203 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 base::Bind(&MessagePortMessageFilter::RouteMessageEventWithMessagePorts, 284 base::Bind(&MessagePortMessageFilter::RouteMessageEventWithMessagePorts,
274 message_port_message_filter, target_rfh->GetRoutingID(), 285 message_port_message_filter, target_rfh->GetRoutingID(),
275 new_params)); 286 new_params));
276 } else { 287 } else {
277 target_rfh->Send( 288 target_rfh->Send(
278 new FrameMsg_PostMessageEvent(target_rfh->GetRoutingID(), new_params)); 289 new FrameMsg_PostMessageEvent(target_rfh->GetRoutingID(), new_params));
279 } 290 }
280 } 291 }
281 292
282 } // namespace content 293 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698