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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1138413002: OOPIF: Don't resurrect a dead process just to create proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Nasko's feedback Created 5 years, 7 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
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698