aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-content_gpu_gpu__main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium/files/patch-content_gpu_gpu__main.cc')
-rw-r--r--www/chromium/files/patch-content_gpu_gpu__main.cc89
1 files changed, 53 insertions, 36 deletions
diff --git a/www/chromium/files/patch-content_gpu_gpu__main.cc b/www/chromium/files/patch-content_gpu_gpu__main.cc
index 26a2ecf40168..9e7739c92e9c 100644
--- a/www/chromium/files/patch-content_gpu_gpu__main.cc
+++ b/www/chromium/files/patch-content_gpu_gpu__main.cc
@@ -1,36 +1,33 @@
---- content/gpu/gpu_main.cc.orig 2021-12-31 00:57:32 UTC
+--- content/gpu/gpu_main.cc.orig 2022-02-07 13:39:41 UTC
+++ content/gpu/gpu_main.cc
-@@ -89,6 +89,11 @@
- #include "sandbox/policy/sandbox_type.h"
+@@ -83,7 +83,7 @@
+ #include "sandbox/win/src/sandbox.h"
#endif
-+#if defined(OS_FREEBSD)
-+#include "content/public/common/sandbox_init.h"
-+#include "sandbox/policy/freebsd/sandbox_freebsd.h"
-+#endif
-+
- #if defined(OS_MAC)
- #include "base/message_loop/message_pump_mac.h"
- #include "components/metal_util/device_removal.h"
-@@ -109,6 +114,8 @@ namespace {
+-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
+ #include "content/gpu/gpu_sandbox_hook_linux.h"
+ #include "content/public/common/sandbox_init.h"
+ #include "sandbox/policy/linux/sandbox_linux.h"
+@@ -106,7 +106,7 @@ namespace content {
+
+ namespace {
+
+-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
bool StartSandboxLinux(gpu::GpuWatchdogThread*,
const gpu::GPUInfo*,
const gpu::GpuPreferences&);
-+#elif defined(OS_FREEBSD)
-+bool StartSandboxFreeBSD();
- #elif defined(OS_WIN)
- bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo*);
- #endif
-@@ -169,6 +176,8 @@ class ContentSandboxHelper : public gpu::GpuSandboxHel
+@@ -168,7 +168,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHel
+ bool EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread,
+ const gpu::GPUInfo* gpu_info,
const gpu::GpuPreferences& gpu_prefs) override {
- #if defined(OS_LINUX) || defined(OS_CHROMEOS)
+-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
return StartSandboxLinux(watchdog_thread, gpu_info, gpu_prefs);
-+#elif defined(OS_BSD)
-+ return StartSandboxFreeBSD();
#elif defined(OS_WIN)
return StartSandboxWindows(sandbox_info_);
- #elif defined(OS_MAC)
-@@ -263,7 +272,7 @@ int GpuMain(const MainFunctionParams& parameters) {
+@@ -264,7 +264,7 @@ int GpuMain(MainFunctionParams parameters) {
std::make_unique<base::SingleThreadTaskExecutor>(
gpu_preferences.message_pump_type);
}
@@ -39,18 +36,38 @@
#error "Unsupported Linux platform."
#elif defined(OS_MAC)
// Cross-process CoreAnimation requires a CFRunLoop to function at all, and
-@@ -446,6 +455,14 @@ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdo
+@@ -407,17 +407,19 @@ int GpuMain(MainFunctionParams parameters) {
+
+ namespace {
+
+-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
+ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdog_thread,
+ const gpu::GPUInfo* gpu_info,
+ const gpu::GpuPreferences& gpu_prefs) {
+ TRACE_EVENT0("gpu,startup", "Initialize sandbox");
+
++#if !defined(OS_BSD)
+ if (watchdog_thread) {
+ // SandboxLinux needs to be able to ensure that the thread
+ // has really been stopped.
+ sandbox::policy::SandboxLinux::GetInstance()->StopThread(watchdog_thread);
+ }
++#endif
+
+ // SandboxLinux::InitializeSandbox() must always be called
+ // with only one thread.
+@@ -438,11 +440,13 @@ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdo
+ *base::CommandLine::ForCurrentProcess()),
+ base::BindOnce(GpuProcessPreSandboxHook), sandbox_options);
+
++#if !defined(OS_BSD)
+ if (watchdog_thread) {
+ base::Thread::Options thread_options;
+ thread_options.timer_slack = base::TIMER_SLACK_MAXIMUM;
+ watchdog_thread->StartWithOptions(std::move(thread_options));
+ }
++#endif
+
return res;
}
- #endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
-+
-+#if defined(OS_FREEBSD)
-+bool StartSandboxFreeBSD() {
-+ return sandbox::policy::SandboxFreeBSD::GetInstance()->InitializeSandbox(
-+ sandbox::policy::SandboxTypeFromCommandLine(
-+ *base::CommandLine::ForCurrentProcess()));
-+}
-+#endif // defined(OS_FREEBSD)
-
- #if defined(OS_WIN)
- bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo* sandbox_info) {