$OpenBSD: patch-content_utility_utility_main_cc,v 1.11 2019/04/17 11:48:54 robert Exp $

Index: content/utility/utility_main.cc
--- content/utility/utility_main.cc.orig
+++ content/utility/utility_main.cc
@@ -33,6 +33,10 @@
 #include "base/message_loop/message_pump_mac.h"
 #endif
 
+#if defined(OS_OPENBSD)
+#include "services/service_manager/sandbox/openbsd/sandbox_openbsd.h"
+#endif
+
 #if defined(OS_WIN)
 #include "base/rand_util.h"
 #include "sandbox/win/src/sandbox.h"
@@ -69,12 +73,13 @@ int UtilityMain(const MainFunctionParams& parameters) 
   if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog))
     WaitForDebugger("Utility");
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD) 
   // Initializes the sandbox before any threads are created.
   // TODO(jorgelo): move this after GTK initialization when we enable a strict
   // Seccomp-BPF policy.
   auto sandbox_type =
       service_manager::SandboxTypeFromCommandLine(parameters.command_line);
+#if !defined(OS_BSD)
   if (parameters.zygote_child ||
       sandbox_type == service_manager::SANDBOX_TYPE_NETWORK ||
 #if defined(OS_CHROMEOS)
@@ -95,6 +100,12 @@ int UtilityMain(const MainFunctionParams& parameters) 
         sandbox_type, std::move(pre_sandbox_hook),
         service_manager::SandboxLinux::Options());
   }
+#else
+    service_manager::SandboxLinux::PreSandboxHook pre_sandbox_hook;
+    service_manager::Sandbox::Initialize(
+        sandbox_type, std::move(pre_sandbox_hook),
+        service_manager::SandboxLinux::Options());
+#endif
 #elif defined(OS_WIN)
   g_utility_target_services = parameters.sandbox_info->target_services;
 #endif
