aboutsummaryrefslogtreecommitdiff
path: root/www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc')
-rw-r--r--www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc83
1 files changed, 35 insertions, 48 deletions
diff --git a/www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc b/www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc
index 453c8ae225c4..242f9043efcc 100644
--- a/www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc
+++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc
@@ -1,6 +1,6 @@
---- src/3rdparty/chromium/content/app/content_main_runner_impl.cc.orig 2023-08-16 19:50:41 UTC
+--- src/3rdparty/chromium/content/app/content_main_runner_impl.cc.orig 2023-12-12 22:08:45 UTC
+++ src/3rdparty/chromium/content/app/content_main_runner_impl.cc
-@@ -139,13 +139,13 @@
+@@ -142,13 +142,13 @@
#include "content/browser/posix_file_descriptor_info_impl.h"
#include "content/public/common/content_descriptors.h"
@@ -16,21 +16,16 @@
#include "base/files/file_path_watcher_inotify.h"
#include "base/native_library.h"
#include "base/rand_util.h"
-@@ -170,6 +170,11 @@
- #include "content/public/common/content_client.h"
+@@ -183,12 +183,16 @@
+ #include "content/public/common/zygote/zygote_handle.h"
+ #include "content/zygote/zygote_main.h"
+ #include "media/base/media_switches.h"
++#endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
+
+ #if BUILDFLAG(ENABLE_WEBRTC)
+ #include "third_party/webrtc_overrides/init_webrtc.h" // nogncheck
#endif
-
-+//XXX
-+#if BUILDFLAG(ENABLE_WEBRTC)
-+#include "third_party/webrtc_overrides/init_webrtc.h" // nogncheck
-+#endif
-+
- #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
-
- #if BUILDFLAG(USE_ZYGOTE)
-@@ -189,6 +194,10 @@
- #endif
- #endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
+-#endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
+#if BUILDFLAG(IS_BSD)
+#include "base/system/sys_info.h"
@@ -39,7 +34,7 @@
#if BUILDFLAG(IS_ANDROID)
#include "base/system/sys_info.h"
#include "content/browser/android/battery_metrics.h"
-@@ -377,7 +386,7 @@ void InitializeZygoteSandboxForBrowserProcess(
+@@ -378,7 +382,7 @@ void InitializeZygoteSandboxForBrowserProcess(
}
#endif // BUILDFLAG(USE_ZYGOTE)
@@ -48,17 +43,26 @@
#if BUILDFLAG(ENABLE_PPAPI)
// Loads the (native) libraries but does not initialize them (i.e., does not
-@@ -413,15 +422,17 @@ void PreloadLibraryCdms() {
- }
- #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
+@@ -416,7 +420,10 @@ void PreSandboxInit() {
--#if BUILDFLAG(USE_ZYGOTE)
-+#if BUILDFLAG(USE_ZYGOTE) || BUILDFLAG(IS_BSD)
void PreSandboxInit() {
- // Pre-acquire resources needed by BoringSSL. See
+ // Ensure the /dev/urandom is opened.
++ // we use arc4random
++#if !BUILDFLAG(IS_BSD)
+ base::GetUrandomFD();
++#endif
+
+ // May use sysinfo(), sched_getaffinity(), and open various /sys/ and /proc/
+ // files.
+@@ -427,9 +434,16 @@ void PreSandboxInit() {
// https://boringssl.googlesource.com/boringssl/+/HEAD/SANDBOXING.md
CRYPTO_pre_sandbox_init();
++#if BUILDFLAG(IS_BSD)
++ // "cache" the amount of physical memory before pledge(2)
++ base::SysInfo::AmountOfPhysicalMemoryMB();
++#endif
++
+#if !BUILDFLAG(IS_BSD)
// Pre-read /proc/sys/fs/inotify/max_user_watches so it doesn't have to be
// allowed by the sandbox.
@@ -67,28 +71,7 @@
#if BUILDFLAG(ENABLE_PPAPI)
// Ensure access to the Pepper plugins before the sandbox is turned on.
-@@ -442,6 +453,11 @@ void PreSandboxInit() {
- }
- #endif
-
-+#if BUILDFLAG(IS_BSD)
-+ // "cache" the amount of physical memory before pledge(2)
-+ base::SysInfo::AmountOfPhysicalMemoryMB();
-+#endif
-+
- // Set the android SkFontMgr for blink. We need to ensure this is done
- // before the sandbox is initialized to allow the font manager to access
- // font configuration files on disk.
-@@ -629,7 +645,7 @@ int NO_STACK_PROTECTOR RunZygote(ContentMainDelegate*
- delegate->ZygoteStarting(&zygote_fork_delegates);
- media::InitializeMediaLibrary();
-
--#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
-+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
- PreSandboxInit();
- #endif
-
-@@ -832,11 +848,10 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam
+@@ -838,11 +852,10 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam
kFieldTrialDescriptor + base::GlobalDescriptors::kBaseDescriptor);
#endif // !BUILDFLAG(IS_ANDROID)
@@ -102,8 +85,12 @@
#endif // !BUILDFLAG(IS_WIN)
-@@ -1033,6 +1048,16 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam
+@@ -1039,8 +1052,20 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam
+ process_type == switches::kZygoteProcess) {
+ PreSandboxInit();
}
++#elif BUILDFLAG(IS_BSD)
++ PreSandboxInit();
#endif
+#if BUILDFLAG(IS_BSD)
@@ -119,7 +106,7 @@
delegate_->SandboxInitialized(process_type);
#if BUILDFLAG(USE_ZYGOTE)
-@@ -1100,7 +1125,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() {
+@@ -1108,7 +1133,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() {
->ReconfigureAfterFeatureListInit(process_type);
}
@@ -128,7 +115,7 @@
// If dynamic Mojo Core is being used, ensure that it's loaded very early in
// the child/zygote process, before any sandbox is initialized. The library
// is not fully initialized with IPC support until a ChildProcess is later
-@@ -1138,6 +1163,11 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() {
+@@ -1143,6 +1168,11 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() {
content_main_params_.reset();
RegisterMainThreadFactories();