From e50d6e47c4ee95148de166473fc40a4ef742b9c0 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 21 Sep 2020 04:08:15 +0200 Subject: [PATCH] fix: NOTREACHED in content::ChildProcessHost::GetChildPath when enable_plugins=false (#25525) --- shell/browser/electron_browser_client.cc | 9 +++++++-- .../electron_component_extension_resource_manager.cc | 2 +- shell/browser/extensions/electron_extension_system.cc | 2 +- .../browser/extensions/electron_extensions_api_client.cc | 2 +- shell/renderer/renderer_client_base.cc | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 463d663f14da..5334da4d46e2 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -701,10 +701,15 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches( content::ChildProcessHost::CHILD_RENDERER); auto gpu_child_path = content::ChildProcessHost::GetChildPath( content::ChildProcessHost::CHILD_GPU); +#if BUILDFLAG(ENABLE_PLUGINS) auto plugin_child_path = content::ChildProcessHost::GetChildPath( content::ChildProcessHost::CHILD_PLUGIN); - if (program != renderer_child_path && program != gpu_child_path && - program != plugin_child_path) { +#endif + if (program != renderer_child_path && program != gpu_child_path +#if BUILDFLAG(ENABLE_PLUGINS) + && program != plugin_child_path +#endif + ) { child_path = content::ChildProcessHost::GetChildPath( content::ChildProcessHost::CHILD_NORMAL); CHECK_EQ(program, child_path) diff --git a/shell/browser/extensions/electron_component_extension_resource_manager.cc b/shell/browser/extensions/electron_component_extension_resource_manager.cc index 7e1c140f0d5c..7b140e93e085 100644 --- a/shell/browser/extensions/electron_component_extension_resource_manager.cc +++ b/shell/browser/extensions/electron_component_extension_resource_manager.cc @@ -17,7 +17,7 @@ #include "electron/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "chrome/browser/pdf/pdf_extension_util.h" +#include "chrome/browser/pdf/pdf_extension_util.h" // nogncheck #include "extensions/common/constants.h" #endif diff --git a/shell/browser/extensions/electron_extension_system.cc b/shell/browser/extensions/electron_extension_system.cc index 5efedc00e23b..9c3abdb5842c 100644 --- a/shell/browser/extensions/electron_extension_system.cc +++ b/shell/browser/extensions/electron_extension_system.cc @@ -38,7 +38,7 @@ #include "shell/browser/extensions/electron_extension_loader.h" #if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "chrome/browser/pdf/pdf_extension_util.h" +#include "chrome/browser/pdf/pdf_extension_util.h" // nogncheck #endif using content::BrowserContext; diff --git a/shell/browser/extensions/electron_extensions_api_client.cc b/shell/browser/extensions/electron_extensions_api_client.cc index dd276ba794f1..b6873f523cc1 100644 --- a/shell/browser/extensions/electron_extensions_api_client.cc +++ b/shell/browser/extensions/electron_extensions_api_client.cc @@ -15,7 +15,7 @@ #include "shell/browser/extensions/electron_messaging_delegate.h" #if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "components/pdf/browser/pdf_web_contents_helper.h" +#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck #include "shell/browser/electron_pdf_web_contents_helper_client.h" #endif diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 1e7fe6f88048..7bfe6dc73d79 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -54,7 +54,7 @@ #endif #if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "chrome/renderer/pepper/chrome_pdf_print_client.h" +#include "chrome/renderer/pepper/chrome_pdf_print_client.h" // nogncheck #include "shell/common/electron_constants.h" #endif // BUILDFLAG(ENABLE_PDF_VIEWER)