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

Unified Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 23841002: Create a new RenderFrameHost per child frame when --site-per-process is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and add some comments. Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/render_view_host_manager.cc
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index 2f62591814f21fca5d39ed0202999e12709158d5..fa2b45cec9314a15558de363bbeaddb46b5ce296 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -83,7 +83,9 @@ void RenderViewHostManager::Init(BrowserContext* browser_context,
render_view_host_ = static_cast<RenderViewHostImpl*>(
RenderViewHostFactory::Create(
site_instance, render_view_delegate_, render_widget_delegate_,
- routing_id, main_frame_routing_id, false, delegate_->IsHidden()));
+ routing_id, main_frame_routing_id, false,
+ delegate_->IsHidden()));
+ render_view_host_->SwapIntoFrameTree(NULL);
// Keep track of renderer processes as they start to shut down or are
// crashed/killed.
@@ -736,10 +738,12 @@ void RenderViewHostManager::CommitPending() {
bool focus_render_view = !will_focus_location_bar &&
render_view_host_->GetView() && render_view_host_->GetView()->HasFocus();
- // Swap in the pending view and make it active.
+ // Swap in the pending view and make it active. Also ensure the FrameTree
+ // stays in sync.
RenderViewHostImpl* old_render_view_host = render_view_host_;
render_view_host_ = pending_render_view_host_;
pending_render_view_host_ = NULL;
+ render_view_host_->SwapIntoFrameTree(old_render_view_host);
// The process will no longer try to exit, so we can decrement the count.
render_view_host_->GetProcess()->RemovePendingView();

Powered by Google App Engine
This is Rietveld 408576698