diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2020-01-17 18:09:51 +0100 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@qt.io> | 2020-01-17 18:09:51 +0100 |
commit | 956a2d2b099fabd06c8277da108ebb9056dc6d6e (patch) | |
tree | a93eb2f4744999115bd1ccdce5a0551617488fc2 /src/core/web_engine_context.cpp | |
parent | b94c74290d6b45c56860b0d8d391c73b3f774ceb (diff) | |
parent | 32c763f30baecad053f73bb15b4df2200306959c (diff) |
Merge remote-tracking branch 'origin/5.14.1' into 5.15
Conflicts:
.qmake.conf
Change-Id: I2f035e56cc23bdb600f93d601f0c1163ba32a1d5
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r-- | src/core/web_engine_context.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 6e805fa67..e84844fdb 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -183,6 +183,18 @@ void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&) namespace QtWebEngineCore { +#if defined(Q_OS_WIN) +sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info) +{ + static sandbox::SandboxInterfaceInfo *g_info = nullptr; + if (info) { + Q_ASSERT(g_info == nullptr); + g_info = info; + } + return g_info; +} +#endif + extern std::unique_ptr<base::MessagePump> messagePumpFactory(); bool usingSoftwareDynamicGL() @@ -456,9 +468,7 @@ WebEngineContext::WebEngineContext() // Enable sandboxing on OS X and Linux (Desktop / Embedded) by default. bool disable_sandbox = qEnvironmentVariableIsSet(kDisableSandboxEnv); if (!disable_sandbox) { -#if defined(Q_OS_WIN) - parsedCommandLine->AppendSwitch(service_manager::switches::kNoSandbox); -#elif defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSetuidSandbox); #endif } else { @@ -661,9 +671,12 @@ WebEngineContext::WebEngineContext() content::ContentMainParams contentMainParams(m_mainDelegate.get()); #if defined(OS_WIN) + contentMainParams.sandbox_info = staticSandboxInterfaceInfo(); sandbox::SandboxInterfaceInfo sandbox_info = {0}; - content::InitializeSandboxInfo(&sandbox_info); - contentMainParams.sandbox_info = &sandbox_info; + if (!contentMainParams.sandbox_info) { + content::InitializeSandboxInfo(&sandbox_info); + contentMainParams.sandbox_info = &sandbox_info; + } #endif m_contentRunner->Initialize(contentMainParams); |