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 0d2041a48951ef321daa021b8d59bae10d69deab..eb8af334f58a6660c20584d09f0a06ff729b43e1 100644 |
--- a/content/browser/web_contents/render_view_host_manager.cc |
+++ b/content/browser/web_contents/render_view_host_manager.cc |
@@ -84,7 +84,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_->AttachToFrameTree(); |
// Keep track of renderer processes as they start to shut down or are |
// crashed/killed. |
@@ -737,10 +739,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_->AttachToFrameTree(); |
// The process will no longer try to exit, so we can decrement the count. |
render_view_host_->GetProcess()->RemovePendingView(); |