$OpenBSD: patch-content_gpu_gpu_main_cc,v 1.16 2017/12/04 13:55:42 robert Exp $

Index: content/gpu/gpu_main.cc
--- content/gpu/gpu_main.cc.orig
+++ content/gpu/gpu_main.cc
@@ -85,6 +85,10 @@
 #include "ui/ozone/public/ozone_platform.h"
 #endif
 
+#if defined(OS_BSD)   
+#include "content/common/sandbox_init_openbsd.h"
+#endif
+
 #if BUILDFLAG(USE_VAAPI)
 #include "media/gpu/vaapi_wrapper.h"
 #endif
@@ -93,7 +97,7 @@ namespace content {
 
 namespace {
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
 bool StartSandboxLinux(gpu::GpuWatchdogThread*);
 #elif defined(OS_WIN)
 bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo*);
@@ -147,7 +151,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHel
 
   bool EnsureSandboxInitialized(
       gpu::GpuWatchdogThread* watchdog_thread) override {
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
     return StartSandboxLinux(watchdog_thread);
 #elif defined(OS_WIN)
     return StartSandboxWindows(sandbox_info_);
@@ -307,12 +311,13 @@ int GpuMain(const MainFunctionParams& parameters) {
 
 namespace {
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
 bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdog_thread) {
   TRACE_EVENT0("gpu,startup", "Initialize sandbox");
 
   bool res = false;
 
+#if !defined(OS_BSD)
   if (watchdog_thread) {
     // LinuxSandbox needs to be able to ensure that the thread
     // has really been stopped.
@@ -327,6 +332,9 @@ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdo
     options.timer_slack = base::TIMER_SLACK_MAXIMUM;
     watchdog_thread->StartWithOptions(options);
   }
+#else
+  res = InitializeSandbox();
+#endif
 
   return res;
 }
