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..ada40990456861e75769fdf77a680a6e63c87c1e 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -1346,6 +1346,12 @@ void RenderFrameHostManager::CreatePendingRenderFrameHost( |
if (delegate_->IsHidden()) |
create_render_frame_flags |= CREATE_RF_HIDDEN; |
+ // 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 old process crashed) have been initialized. Calling Init |
nasko
2015/05/14 22:10:52
nit: s/old/existing/
alexmos
2015/05/14 22:54:16
Done.
|
+ // multiple times will be ignored, so this is safe. |
+ new_instance->GetProcess()->Init(); |
alexmos
2015/05/14 22:02:50
Should I also return early here if this fails? Cr
nasko
2015/05/14 22:10:52
Returning early is probably desired. Looking at th
alexmos
2015/05/14 22:54:15
I added the early return and moved CancelPending t
|
+ |
int opener_route_id = CreateOpenerRenderViewsIfNeeded( |
old_instance, new_instance, &create_render_frame_flags); |
@@ -1435,6 +1441,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 old 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, |