Index: content/browser/frame_host/render_frame_host_manager.cc |
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
index 769bc4a9d52cc10c45ccf87c8e0ad1d0135fbed2..0a266c26309a36aa07578947dc5958185a92b842 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -1346,12 +1346,19 @@ void RenderFrameHostManager::CreatePendingRenderFrameHost( |
if (delegate_->IsHidden()) |
create_render_frame_flags |= CREATE_RF_HIDDEN; |
- int opener_route_id = CreateOpenerRenderViewsIfNeeded( |
- old_instance, new_instance, &create_render_frame_flags); |
- |
if (pending_render_frame_host_) |
CancelPending(); |
+ // The process for the new SiteInstance may (if we're sharing a process with |
+ // another host that already initialized it) or may not (we have our own |
+ // process or the existing process crashed) have been initialized. Calling |
+ // Init multiple times will be ignored, so this is safe. |
+ if (!new_instance->GetProcess()->Init()) |
+ return; |
+ |
+ int opener_route_id = CreateOpenerRenderViewsIfNeeded( |
+ old_instance, new_instance, &create_render_frame_flags); |
+ |
// Create a non-swapped-out RFH with the given opener. |
pending_render_frame_host_ = |
CreateRenderFrame(new_instance, pending_web_ui(), opener_route_id, |
@@ -1435,6 +1442,13 @@ bool RenderFrameHostManager::CreateSpeculativeRenderFrameHost( |
// won't be properly initialized. |
speculative_web_ui_ = CreateWebUI(url, bindings); |
+ // The process for the new SiteInstance may (if we're sharing a process with |
+ // another host that already initialized it) or may not (we have our own |
+ // process or the existing process crashed) have been initialized. Calling |
+ // Init multiple times will be ignored, so this is safe. |
+ if (!new_instance->GetProcess()->Init()) |
+ return false; |
+ |
int create_render_frame_flags = 0; |
int opener_route_id = |
CreateOpenerRenderViewsIfNeeded(old_instance, new_instance, |