From ddc40f835d054e43d83554d804f57fcdfdb17e50 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Tue, 20 Jun 2017 13:31:47 +0200 Subject: Fix crash with --no-zygote on Linux Zygote process is responsible for initializing ResourceBundle on Linux. Thus it is expected to be initialized in Renderer process. When zygote is disabled the Renderer process can't reload locale resources since the ResourceBundle hasn't been initialized yet. However, there is no need for reload because without zygote, Renderer Process initializes ResourceBundle for itself. Pulls in Chromium changes: 5352138 [Backport] Initialize RenderSandboxHostLinux in --no-zygote mode to not crash. Change-Id: Iace3585e23b4f18850783a813b1466a3ff5fe12f Reviewed-by: Allan Sandfeld Jensen --- src/core/resource_bundle_qt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/resource_bundle_qt.cpp') diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp index 5f5cead96..cc3c1de06 100644 --- a/src/core/resource_bundle_qt.cpp +++ b/src/core/resource_bundle_qt.cpp @@ -75,7 +75,8 @@ bool ResourceBundle::LocaleDataPakExists(const std::string& locale) #if defined(OS_LINUX) base::CommandLine *parsed_command_line = base::CommandLine::ForCurrentProcess(); std::string process_type = parsed_command_line->GetSwitchValueASCII(switches::kProcessType); - if (process_type == switches::kRendererProcess) { + bool no_sandbox = parsed_command_line->HasSwitch(switches::kNoSandbox); + if (process_type == switches::kRendererProcess && !no_sandbox) { // The Renderer Process is sandboxed thus only one locale is available in it. // The particular one is passed by the --lang command line option. if (!parsed_command_line->HasSwitch(switches::kLang) || parsed_command_line->GetSwitchValueASCII(switches::kLang) != locale) -- cgit v1.2.3