From 98de8e79dbd44955bd0440c30b9832ad81680383 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 12 Feb 2018 16:22:51 -0500 Subject: [PATCH] Fix crash when plugin is not found (issue #2379) --- patch/patches/chrome_plugins.patch | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 4a65f3dc3..5cd1aad13 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index 1afbaf86ac40..e2edec854ca7 100644 +index 1afbaf86ac40..c80a499d4dc2 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -18,6 +18,7 @@ @@ -82,7 +82,26 @@ index 1afbaf86ac40..e2edec854ca7 100644 allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated, profile->GetPrefs()); allow_outdated_plugins_.MoveToThread( -@@ -325,6 +344,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( +@@ -264,6 +283,7 @@ void PluginInfoHostImpl::PluginsLoaded( + plugin_metadata->identifier(), &output->status); + } + ++#if !BUILDFLAG(ENABLE_CEF) + if (output->status == chrome::mojom::PluginStatus::kNotFound) { + // Check to see if the component updater can fetch an implementation. + base::PostTaskAndReplyWithResult( +@@ -275,7 +295,9 @@ void PluginInfoHostImpl::PluginsLoaded( + base::BindOnce(&PluginInfoHostImpl::ComponentPluginLookupDone, this, + params, std::move(output), std::move(callback), + std::move(plugin_metadata))); +- } else { ++ } else ++#endif // !BUILDFLAG(ENABLE_CEF) ++ { + GetPluginInfoFinish(params, std::move(output), std::move(callback), + std::move(plugin_metadata)); + } +@@ -325,6 +347,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( PluginMetadata::SecurityStatus security_status, const std::string& plugin_identifier, chrome::mojom::PluginStatus* status) const { @@ -97,7 +116,7 @@ index 1afbaf86ac40..e2edec854ca7 100644 if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) { *status = chrome::mojom::PluginStatus::kAllowed; return; -@@ -450,16 +477,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( +@@ -450,16 +480,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( return false; }