Don't abort the MimeHandlerStreamManager stream if we receive a RenderProcessHostChanged notification for a null old host.
This indicates that a subframe is being created. If we ignore the old_host here and set
the new host pointer in the MimeHandlerStreamManager::EmbedderObserver class, this causes
the stream to be aborted prematurely leading to embedded PDFs not loading.
This should fix bug 650985
BUG=650985
Review-Url: https://codereview.chromium.org/2418963002
Cr-Commit-Position: refs/heads/master@{#425498}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2d93f2d..964b243 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -309,6 +309,8 @@
WebContents* WebContents::FromFrameTreeNodeId(int frame_tree_node_id) {
FrameTreeNode* frame_tree_node =
FrameTreeNode::GloballyFindByID(frame_tree_node_id);
+ if (!frame_tree_node)
+ return nullptr;
return FromRenderFrameHost(frame_tree_node->current_frame_host());
}