diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-06-20 13:31:47 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-06-28 04:31:48 +0000 |
commit | ddc40f835d054e43d83554d804f57fcdfdb17e50 (patch) | |
tree | c857c4457e6144bf382b55a6269838a3426a7c1a /src/core/content_main_delegate_qt.cpp | |
parent | 5bc8671260bc716be9dffe61e84c214ca37ca5f6 (diff) |
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 <allan.jensen@qt.io>
Diffstat (limited to 'src/core/content_main_delegate_qt.cpp')
-rw-r--r-- | src/core/content_main_delegate_qt.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 38f66d641..8284029a0 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -139,10 +139,15 @@ content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClie { #if defined(OS_LINUX) base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess(); - - if (parsedCommandLine->HasSwitch(switches::kLang)) { - const std::string &locale = parsedCommandLine->GetSwitchValueASCII(switches::kLang); - ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale); + std::string process_type = parsedCommandLine->GetSwitchValueASCII(switches::kProcessType); + bool no_sandbox = parsedCommandLine->HasSwitch(switches::kNoSandbox); + + // Reload locale if the renderer process is sandboxed + if (process_type == switches::kRendererProcess && !no_sandbox) { + if (parsedCommandLine->HasSwitch(switches::kLang)) { + const std::string &locale = parsedCommandLine->GetSwitchValueASCII(switches::kLang); + ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale); + } } #endif |