openbsd-ports/www/iridium/patches/patch-content_renderer_renderer_main_cc
2018-05-04 07:14:57 +00:00

55 lines
2.0 KiB
Plaintext

$OpenBSD: patch-content_renderer_renderer_main_cc,v 1.12 2018/05/04 07:14:57 robert Exp $
Index: content/renderer/renderer_main.cc
--- content/renderer/renderer_main.cc.orig
+++ content/renderer/renderer_main.cc
@@ -35,6 +35,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)
@@ -71,6 +72,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
@@ -206,9 +218,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();
@@ -218,7 +234,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));