Commit 101f015e authored by marshall's avatar marshall Committed by Commit bot

Fix MojoApplicationHost assertion when navigating from RenderProcessGone.

Termination of a renderer process results in a call to
WebContentsObserver::RenderProcessGone. Navigating from
RenderProcessGone using NavigationControllerImpl::Reload or LoadURL
results in an assertion due to MojoApplicationHost::Init() being called
again on an already initialized host. Reset |mojo_application_host_| in
RenderProcessHostImpl::ProcessDied before calling
ViewHostMsg_RenderProcessGone message handlers to avoid this problem.

BUG=448435

Review URL: https://codereview.chromium.org/848073002

Cr-Commit-Position: refs/heads/master@{#314435}
parent 021afc1b
......@@ -2068,6 +2068,10 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
#endif
RemoveUserData(kSessionStorageHolderKey);
// RenderProcessGone handlers might navigate or perform other actions that
// require a connection. Ensure that there is one before calling them.
mojo_application_host_.reset(new MojoApplicationHost);
IDMap<IPC::Listener>::iterator iter(&listeners_);
while (!iter.IsAtEnd()) {
iter.GetCurrentValue()->OnMessageReceived(
......@@ -2077,8 +2081,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
iter.Advance();
}
mojo_application_host_.reset(new MojoApplicationHost);
// It's possible that one of the calls out to the observers might have caused
// this object to be no longer needed.
if (delayed_cleanup_needed_)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment