Commit 426d8d1e authored by Ehsan Karamad's avatar Ehsan Karamad Committed by Commit Bot

Fix a crash due to null BrowserPluginDelegate

The HeadlessContentRendererClient does not implement CreateBrowserPluginDelegate
which causes a renderer crash in the headless mode for objects which set their
type to "application/browser-plugin". This CL adds a null check to
RenderFrameImpl to stop the crash.

Bug: 958678
Change-Id: Ic90ecbded86e764fb81eb9796b5d9e2732966fb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1598323Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657570}
parent 58abfd0e
...@@ -3934,6 +3934,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( ...@@ -3934,6 +3934,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
BrowserPluginDelegate* delegate = BrowserPluginDelegate* delegate =
GetContentClient()->renderer()->CreateBrowserPluginDelegate( GetContentClient()->renderer()->CreateBrowserPluginDelegate(
this, WebPluginInfo(), kBrowserPluginMimeType, GURL(params.url)); this, WebPluginInfo(), kBrowserPluginMimeType, GURL(params.url));
if (!delegate)
return nullptr;
return BrowserPluginManager::Get()->CreateBrowserPlugin( return BrowserPluginManager::Get()->CreateBrowserPlugin(
this, delegate->GetWeakPtr()); this, delegate->GetWeakPtr());
} }
......
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