From d9a062a876b9309bde6005695504147dcb174c87 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 2 Jul 2020 11:41:47 +0200 Subject: Set application name based on source application name This makes it possible to tell the difference between multiple applications using QtWebEngine. Submodule src/3rdparty 15a42873..87e5a52b: > Pass through a new application name argument to utility processes > Fix libjpeg_turbo for ARM32 > Add missing include in certificate net log Fixes: QTBUG-85363 Change-Id: Ib5426d2e431eb3032f76270885c9cf2d83a75ac8 Reviewed-by: Kirill Burtsev --- src/3rdparty | 2 +- src/core/content_main_delegate_qt.cpp | 9 +++++++++ src/core/web_engine_context.cpp | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 15a42873b..87e5a52b8 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 15a42873b9a4bda657e7a435f25241a05b8bd1c7 +Subproject commit 87e5a52b8860fc35e59e308a3468b015ba4c19ed diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index f93a3c0ea..30bac71af 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -69,6 +69,7 @@ #endif #if defined(OS_LINUX) +#include "media/audio/audio_manager.h" #include "ui/base/ui_base_switches.h" #endif @@ -220,6 +221,14 @@ void ContentMainDelegateQt::PreSandboxStartup() media::InitializeVideoToolbox(); } #endif + + if (parsedCommandLine->HasSwitch(service_manager::switches::kApplicationName)) { + const std::string appName = parsedCommandLine->GetSwitchValueASCII(service_manager::switches::kApplicationName); + QCoreApplication::setApplicationName(QString::fromStdString(appName)); +#if defined(OS_LINUX) + media::AudioManager::SetGlobalAppName(appName); +#endif + } } content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient() diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 1399c0fdc..01d55a5a1 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -568,6 +568,8 @@ WebEngineContext::WebEngineContext() setupProxyPac(parsedCommandLine); parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE)); + parsedCommandLine->AppendSwitchASCII(service_manager::switches::kApplicationName, QCoreApplication::applicationName().toStdString()); + // Enable sandboxing on OS X and Linux (Desktop / Embedded) by default. bool disable_sandbox = qEnvironmentVariableIsSet(kDisableSandboxEnv); if (!disable_sandbox) { -- cgit v1.2.3