$OpenBSD: patch-content_renderer_renderer_main_cc,v 1.18 2018/03/12 13:48:34 robert Exp $
Index: content/renderer/renderer_main.cc
--- content/renderer/renderer_main.cc.orig
+++ content/renderer/renderer_main.cc
@@ -33,6 +33,7 @@
 #include "ppapi/features/features.h"
 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h"
 #include "third_party/skia/include/core/SkGraphics.h"
+#include "third_party/skia/include/ports/SkFontConfigInterface.h"
 #include "ui/base/ui_base_switches.h"
 
 #if defined(OS_ANDROID)
@@ -69,6 +70,17 @@
 #include "ui/ozone/public/client_native_pixmap_factory_ozone.h"
 #endif
 
+#if defined(OS_BSD)
+#include "content/browser/sandbox_host_linux.h"
+#include "content/public/common/common_sandbox_support_linux.h"
+#endif
+
+#if defined(OS_BSDD)
+#include "content/browser/sandbox_host_linux.h"
+#include "content/common/font_config_ipc_linux.h"
+#include "content/common/sandbox_linux/sandbox_linux.h"
+#endif
+
 namespace content {
 namespace {
 // This function provides some ways to test crash and assertion handling
@@ -189,9 +201,13 @@ int RendererMain(const MainFunctionParams& parameters)
   // is OK.
   InitializeWebRtcModule();
 #endif
+#if defined(OS_BSD)
+  SkFontConfigInterface::SetGlobal(
+      new FontConfigIPC(GetSandboxFD()))->unref();
+#endif
 
   {
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
     // TODO(markus): Check if it is OK to unconditionally move this
     // instruction down.
     auto render_process = RenderProcessImpl::Create();
@@ -201,7 +217,7 @@ int RendererMain(const MainFunctionParams& parameters)
     bool run_loop = true;
     if (!no_sandbox)
       run_loop = platform.EnableSandbox();
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_BSD)
     auto render_process = RenderProcessImpl::Create();
     RenderThreadImpl::Create(std::move(main_message_loop),
                              std::move(renderer_scheduler));
