diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-03-23 10:58:26 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-05-22 14:10:19 +0200 |
commit | e6a7c6548f15cb158c1a5a2ac97fadaecb54f1ee (patch) | |
tree | 7d50d6df4904590e6fa2edafd78ffb8ac439d2e8 /src/process | |
parent | 6d6037be24bcbff5efada34ed39331c7c8b28f3b (diff) | |
download | qtwebengine-e6a7c6548f15cb158c1a5a2ac97fadaecb54f1ee.tar.gz |
Add windows to the cmake build
Fix cmake for windows builds and add QtWebEngineSandbox target.
Task-number: QTBUG-91760
Change-Id: If962a81ddfb509d104ad8ffbfbf34f1150ae82ce
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/process')
-rw-r--r-- | src/process/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/process/QtWebEngineProcess.exe.manifest (renamed from src/process/process.exe.manifest) | 0 | ||||
-rw-r--r-- | src/process/main.cpp | 14 | ||||
-rw-r--r-- | src/process/support_win.cpp | 44 |
4 files changed, 11 insertions, 52 deletions
diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt index 7f1b40b90..3b0ee588f 100644 --- a/src/process/CMakeLists.txt +++ b/src/process/CMakeLists.txt @@ -10,6 +10,11 @@ get_target_property(isFramework WebEngineCore FRAMEWORK) qt_internal_add_executable(${qtWebEngineProcessName} SOURCES main.cpp) +if(WIN32) + target_sources(${qtWebEngineProcessName} PRIVATE support_win.cpp) + target_link_libraries(${qtWebEngineProcessName} PRIVATE WebEngineCoreSandbox) +endif() + target_link_libraries(${qtWebEngineProcessName} PUBLIC Qt::Gui diff --git a/src/process/process.exe.manifest b/src/process/QtWebEngineProcess.exe.manifest index 181a0e13e..181a0e13e 100644 --- a/src/process/process.exe.manifest +++ b/src/process/QtWebEngineProcess.exe.manifest diff --git a/src/process/main.cpp b/src/process/main.cpp index 53596d0ee..7cdc4f4ab 100644 --- a/src/process/main.cpp +++ b/src/process/main.cpp @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#include "process_main.h" - +#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h> #include <QCoreApplication> #include <stdio.h> #include <memory> @@ -88,17 +87,16 @@ struct tm* localtime64_r_proxy(const time_t* timep, struct tm* result) #endif // defined(OS_LINUX) -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN32) namespace QtWebEngineProcess { void initDpiAwareness(); -void initializeStaticCopy(int argc, const char **argv); -} // namespace -#endif // defined(Q_OS_WIN) +} +#endif // defined(Q_OS_WIN32) int main(int argc, const char **argv) { -#ifdef Q_OS_WIN - QtWebEngineProcess::initializeStaticCopy(argc, argv); +#if defined(Q_OS_WIN32) + QtWebEngineSandbox::initializeStaticCopy(argc, argv); QtWebEngineProcess::initDpiAwareness(); #endif diff --git a/src/process/support_win.cpp b/src/process/support_win.cpp index b415dc2a5..c2ff2d838 100644 --- a/src/process/support_win.cpp +++ b/src/process/support_win.cpp @@ -42,13 +42,6 @@ #include <qsysinfo.h> #include <qt_windows.h> #include <TlHelp32.h> -#include "../3rdparty/chromium/sandbox/win/src/process_mitigations.h" -#include "../3rdparty/chromium/sandbox/win/src/sandbox_factory.h" - -#ifndef NDEBUG -#include "../3rdparty/chromium/base/command_line.h" -#include "../3rdparty/chromium/base/logging.h" -#endif class User32DLL { public: @@ -141,45 +134,8 @@ static DWORD getParentProcessId() return parentPid; } -namespace QtWebEngineCore { -extern __declspec(dllimport) sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info = nullptr); -} - namespace QtWebEngineProcess { -// A duplicate of the function by same name in startup_helper_win.cc -static void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo *info) -{ - info->broker_services = sandbox::SandboxFactory::GetBrokerServices(); - if (!info->broker_services) { - info->target_services = sandbox::SandboxFactory::GetTargetServices(); - } else { - // Ensure the proper mitigations are enforced for the browser process. - sandbox::ApplyProcessMitigationsToCurrentProcess( - sandbox::MITIGATION_DEP | sandbox::MITIGATION_DEP_NO_ATL_THUNK | - sandbox::MITIGATION_HARDEN_TOKEN_IL_POLICY); - // Note: these mitigations are "post-startup". Some mitigations that need - // to be enabled sooner (e.g. MITIGATION_EXTENSION_POINT_DISABLE) are done - // so in Chrome_ELF. - } -} - -// Initializes the staticlib copy of //base and //sandbox used for Windows sandboxing -void initializeStaticCopy(int argc, const char **argv) -{ -#ifndef NDEBUG - // Initialize //base for debugging - base::CommandLine::Init(argc, argv); - logging::LoggingSettings settings; - settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; - logging::InitLogging(settings); -#endif - sandbox::SandboxInterfaceInfo *info = new sandbox::SandboxInterfaceInfo(); - memset(info, 0, sizeof(sandbox::SandboxInterfaceInfo)); - InitializeSandboxInfo(info); - QtWebEngineCore::staticSandboxInterfaceInfo(info); -} - void initDpiAwareness() { ShcoreDLL shcore; |