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

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: Return early if process creation failed 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..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,
« 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