diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-02 11:41:47 +0200 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2020-07-02 16:43:08 +0000 |
commit | d9a062a876b9309bde6005695504147dcb174c87 (patch) | |
tree | b773d58cdb447f21984adb0e3aa86f380fb03cbe /src/core | |
parent | 2dfc9e98a98979fc6d0d99a2ae0d805fd50ebb25 (diff) |
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 <kirill.burtsev@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/content_main_delegate_qt.cpp | 9 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 2 |
2 files changed, 11 insertions, 0 deletions
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) { |