Page MenuHomeFreeBSD

D37859.id114492.diff
No OneTemporary

D37859.id114492.diff

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: Mk/Uses/qt.mk
===================================================================
--- Mk/Uses/qt.mk
+++ Mk/Uses/qt.mk
@@ -133,7 +133,7 @@
_USE_QT_COMMON= 3d charts datavis3d declarative doc imageformats multimedia \
networkauth quick3d quicktimeline remoteobjects scxml \
sensors serialbus serialport svg virtualkeyboard wayland \
- webchannel websockets
+ webchannel webengine websockets
_USE_QT5_ONLY= assistant buildtools concurrent connectivity core dbus \
declarative-test designer diag examples gamepad \
@@ -142,7 +142,7 @@
qdbus qdbusviewer qdoc qdoc-data qev qmake quickcontrols \
quickcontrols2 script scripttools speech sql sql-mysql sql-odbc \
sql-pgsql sql-sqlite2 sql-sqlite3 sql-tds testlib uiplugin \
- uitools webengine webglplugin webkit websockets-qml webview \
+ uitools webglplugin webkit websockets-qml webview \
widgets x11extras xml xmlpatterns
. if ${ARCH} == amd64 || ${ARCH} == i386
_USE_QT5_ONLY+= sql-ibase
@@ -365,7 +365,12 @@
qt-webchannel_LIB= libQt${_QT_LIBVER}WebChannel.so
qt-webengine_PORT= www/${_QT_RELNAME}-webengine
+
+.if ${_QT_VER} == 5
qt-webengine_LIB= libQt${_QT_LIBVER}WebEngine.so
+.else
+qt-webengine_LIB= libQt${_QT_LIBVER}WebEngineCore.so
+.endif
qt-webglplugin_PORT= www/${_QT_RELNAME}-webglplugin
qt-webglplugin_PATH= ${LOCALBASE}/${QT_PLUGINDIR_REL}/platforms/libqwebgl.so
Index: www/Makefile
===================================================================
--- www/Makefile
+++ www/Makefile
@@ -1814,6 +1814,7 @@
SUBDIR += qt5-websockets-qml
SUBDIR += qt5-webview
SUBDIR += qt6-webchannel
+ SUBDIR += qt6-webengine
SUBDIR += qt6-websockets
SUBDIR += quark
SUBDIR += qutebrowser
Index: www/qt6-webengine/Makefile
===================================================================
--- /dev/null
+++ www/qt6-webengine/Makefile
@@ -0,0 +1,130 @@
+# QtWebEngine itself is a very thin layer of Qt code on top of a large part of
+# Chromium (everything up to the content/ layer). As such, most of the work in
+# this port revolves around taming Chromium and getting it to build on FreeBSD.
+# While it does build at the moment, there are several items that should be
+# investigated or improved:
+# - We are using several stub files, especially in Chromium's base/ and net/
+# layers. We should look at implementing the missing bits instead.
+# - We are currently not using any sandboxing mechanism.
+# - The process of porting QtWebEngine needs to be documented so we can move to
+# newer releases more easily.
+#
+# Also note that, due to the insane amount of patches this port needs, it tends
+# to lag behind the rest of the official Qt6 ones, which is why we set
+# QT6_VERSION and DISTINFO_FILE here.
+
+PORTNAME= webengine
+DISTVERSION= ${QT6_VERSION}
+CATEGORIES= www
+PKGNAMEPREFIX= qt6-
+
+MAINTAINER= kde@FreeBSD.org
+COMMENT= Qt 6 library to render web content
+
+BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat \
+ ${PYTHON_PKGNAMEPREFIX}html5lib>0:www/py-html5lib@${PY_FLAVOR} \
+ ${LOCALBASE}/include/vulkan/vulkan.h:graphics/vulkan-headers
+LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
+ libdbus-1.so:devel/dbus \
+ libevent.so:devel/libevent \
+ libexpat.so:textproc/expat2 \
+ libfontconfig.so:x11-fonts/fontconfig \
+ libfreetype.so:print/freetype2 \
+ libharfbuzz.so:print/harfbuzz \
+ liblcms2.so:graphics/lcms2 \
+ libnspr4.so:devel/nspr \
+ libnss3.so:security/nss \
+ libopenh264.so:multimedia/openh264 \
+ libopus.so:audio/opus \
+ libpci.so:devel/libpci \
+ libpng.so:graphics/png \
+ libre2.so:devel/re2 \
+ libsnappy.so:archivers/snappy \
+ libvpx.so:multimedia/libvpx \
+ libwebp.so:graphics/webp \
+ libxkbcommon.so:x11/libxkbcommon
+
+USES= bison cmake gl gnome gperf jpeg localbase:ldflags minizip ninja:build \
+ nodejs:build,lts pkgconfig python:build qt-dist:6,webengine xorg
+USE_GL= gl
+USE_GNOME= glib20 libxml2 libxslt
+USE_QT= base declarative:run positioning quick3d:build webchannel
+QT_BINARIES= yes
+USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xkbfile \
+ xrandr xrender xscrnsaver xshmfence xtst
+
+CMAKE_ON= QT_FEATURE_webengine_system_ffmpeg QT_FEATURE_webengine_proprietary_codecs
+
+# The build system reads the environment variable $NINJA_PATH to decide whether
+# to boostrap ninja or not (and also to invoke it afterwards). CC and CXX are
+# read by some Chromium code to determine which compiler to invoke when running
+# some configuration tests.
+CONFIGURE_ENV+= NINJAFLAGS="-j${MAKE_JOBS_NUMBER}" \
+ NINJA_PATH="${LOCALBASE}/bin/ninja" \
+ PATH=${CONFIGURE_WRKSRC}/bin:${LOCALBASE}/bin:${PATH}
+MAKE_ENV+= CC="${CC}" CXX="${CXX}" \
+ C_INCLUDE_PATH=${LOCALBASE}/include \
+ CPLUS_INCLUDE_PATH=${LOCALBASE}/include \
+ ${CONFIGURE_ENV}
+
+# Add extra-patch-no-mempcpy-nasm only when there's no mempcpy() in base.
+# Nested variable expansion avoids executing the test when not needed for
+# expanding EXTRA_PATCHES.
+# mempcpy was introduced in ee37f64cf875255338f917a9da76c643cf59786c
+EXTRA_PATCHES+= ${"${:!${GREP} mempcpy ${CROSS_SYSROOT}/usr/include/string.h \
+ || ${TRUE}!}" == "":?${PATCHDIR}/extra-patch-no-mempcpy-nasm:}
+
+
+DISTINFO_FILE= ${.CURDIR}/distinfo
+QT6_VERSION= 6.4.1
+
+OPTIONS_DEFAULT= ALSA
+OPTIONS_SINGLE= AUDIO
+OPTIONS_SINGLE_AUDIO= ALSA PULSEAUDIO SNDIO
+
+AUDIO_DESC= Audio backend
+
+# Need the alsa plugins to get sound at runtime, otherwise messages
+# that the pcm_oss plugin can't be opened.
+ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
+ALSA_RUN_DEPENDS= alsa-plugins>=0:audio/alsa-plugins
+ALSA_CMAKE_ON= -DQT_FEATURE_webengine_system_alsa:BOOL=ON
+ALSA_CMAKE_OFF= -DQT_FEATURE_webengine_system_alsa:BOOL=OFF
+PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
+PULSEAUDIO_CMAKE_ON= -DQT_FEATURE_webengine_system_pulseaudio:BOOL=ON
+PULSEAUDIO_CMAKE_OFF= -DQT_FEATURE_webengine_system_pulseaudio:BOOL=OFF
+SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio
+SNDIO_CMAKE_ON= -DQT_FEATURE_webengine_system_sndio:BOOL=ON
+SNDIO_CMAKE_OFF= -DQT_FEATURE_webengine_system_sndio:BOOL=OFF
+
+post-extract:
+ @${MKDIR} ${WRKSRC}/src/3rdparty/chromium/media/audio/sndio \
+ ${WRKSRC}/src/3rdparty/chromium/sandbox/policy/freebsd \
+ ${WRKSRC}/src/3rdparty/chromium/sandbox/policy/openbsd
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|%%CPPFLAGS%%|${CPPFLAGS}|;s|%%CXXFLAGS%%|${CXXFLAGS}|;s|%%LDFLAGS%%|${LDFLAGS}|' \
+ ${WRKSRC}/src/host/BUILD.toolchain.gn.in
+ @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
+ ${WRKSRC}/src/3rdparty/chromium/third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp \
+ ${WRKSRC}/src/3rdparty/chromium/third_party/wayland/features.gni
+
+pre-configure:
+# Link in ${PYTHON_CMD} to ${CONFIGURE_WRKSRC}/bin -- the scripts hardcode 'python'
+# in too many places to reasonably patch. So just link in ${PYTHON_CMD} to work around
+# $LOCALBASE/bin/python .
+ ${MKDIR} ${CONFIGURE_WRKSRC}/bin && ${LN} -s ${PYTHON_CMD} ${CONFIGURE_WRKSRC}/bin/python
+
+# We used to remove bundled libraries to be sure that webengine uses
+# system libraries and not shipped ones.
+#
+# Leads to missing header errors: icu, libvpx, libwebp, re2, snappy, zlib
+# No-Op: flac
+#
+# cd ${WRKSRC} && ${PYTHON_CMD} \
+# ./build/linux/unbundle/remove_bundled_libraries.py [list of preserved]
+ cd ${WRKSRC}/src/3rdparty/chromium && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
+ ./build/linux/unbundle/replace_gn_files.py --system-libraries \
+ fontconfig freetype harfbuzz-ng libdrm libevent libpng libxml libxslt openh264 opus || ${FALSE}
+
+.include <bsd.port.mk>
Index: www/qt6-webengine/distinfo
===================================================================
--- /dev/null
+++ www/qt6-webengine/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1668634760
+SHA256 (KDE/Qt/6.4.1/qtwebengine-everywhere-src-6.4.1.tar.xz) = 2c59c011d1f39855f8e444f6eaaabd0bb0f560355de125c03456a681fd30a782
+SIZE (KDE/Qt/6.4.1/qtwebengine-everywhere-src-6.4.1.tar.xz) = 440594864
Index: www/qt6-webengine/files/extra-patch-no-mempcpy-nasm
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/extra-patch-no-mempcpy-nasm
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/nasm/config/config-linux.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/third_party/nasm/config/config-linux.h
+@@ -336,7 +336,7 @@
+ #define HAVE_MEMORY_H 1
+
+ /* Define to 1 if you have the `mempcpy' function. */
+-#define HAVE_MEMPCPY 1
++/* #undef HAVE_MEMPCPY */
+
+ /* Define to 1 if you have a working `mmap' system call. */
+ #define HAVE_MMAP 1
Index: www/qt6-webengine/files/patch-cmake_Functions.cmake
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-cmake_Functions.cmake
@@ -0,0 +1,104 @@
+--- cmake/Functions.cmake.orig 2022-11-08 21:18:48 UTC
++++ cmake/Functions.cmake
+@@ -429,7 +429,7 @@ function(add_linker_options target buildDir completeSt
+ set(archives_rsp "${buildDir}/${ninjaTarget}_archives.rsp")
+ set(libs_rsp "${buildDir}/${ninjaTarget}_libs.rsp")
+ set_target_properties(${cmakeTarget} PROPERTIES STATIC_LIBRARY_OPTIONS "@${objects_rsp}")
+- if(LINUX)
++ if(LINUX OR FREEBSD)
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm" AND ${config} STREQUAL "Debug")
+ target_link_options(${cmakeTarget} PRIVATE "LINKER:--long-plt")
+@@ -667,6 +667,8 @@ function(get_gn_os result)
+ set(${result} "mac" PARENT_SCOPE)
+ elseif(IOS)
+ set(${result} "ios" PARENT_SCOPE)
++ elseif(FREEBSD)
++ set(${result} "freebsd" PARENT_SCOPE)
+ else()
+ message(DEBUG "Unrecognized OS")
+ endif()
+@@ -854,7 +856,7 @@ macro(append_build_type_setup)
+
+ extend_gn_list(gnArgArg
+ ARGS enable_precompiled_headers
+- CONDITION BUILD_WITH_PCH AND NOT LINUX
++ CONDITION BUILD_WITH_PCH AND NOT (LINUX OR FREEBSD)
+ )
+ extend_gn_list(gnArgArg
+ ARGS dcheck_always_on
+@@ -902,7 +904,7 @@ macro(append_compiler_linker_sdk_setup)
+ use_libcxx=true
+ )
+ endif()
+- if(DEFINED QT_FEATURE_stdlib_libcpp AND LINUX)
++ if(DEFINED QT_FEATURE_stdlib_libcpp AND (LINUX OR FREEBSD))
+ extend_gn_list(gnArgArg ARGS use_libcxx
+ CONDITION QT_FEATURE_stdlib_libcpp
+ )
+@@ -930,7 +932,7 @@ macro(append_compiler_linker_sdk_setup)
+ )
+ endif()
+ get_gn_arch(cpu ${TEST_architecture_arch})
+- if(LINUX AND CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
++ if((LINUX OR FREEBSD) AND CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
+
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_tune
+@@ -997,7 +999,7 @@ macro(append_toolchain_setup)
+ endmacro()
+
+ macro(append_toolchain_setup)
+- if(LINUX)
++ if(LINUX OR FREEBSD)
+ list(APPEND gnArgArg
+ custom_toolchain="${buildDir}/target_toolchain:target"
+ host_toolchain="${buildDir}/host_toolchain:host"
+@@ -1024,7 +1026,7 @@ macro(append_pkg_config_setup)
+
+
+ macro(append_pkg_config_setup)
+- if(LINUX)
++ if(LINUX OR FREEBSD)
+ list(APPEND gnArgArg
+ pkg_config="${PKG_CONFIG_EXECUTABLE}"
+ host_pkg_config="${PKG_CONFIG_HOST_EXECUTABLE}"
+@@ -1100,6 +1102,20 @@ function(add_gn_build_aritfacts_to_target cmakeTarget
+ set_target_properties(${cmakeTarget} PROPERTIES
+ LINK_DEPENDS ${buildDir}/${config}/${arch}/${ninjaTarget}.stamp
+ )
++ # For some reason when the build of QtWebEngine's "convert_dict" is
++ # completed the "convert_dict.stamp" isn't created.
++ #
++ # Work around this issue by creating "convert_dict.stamp" manually.
++ if(${ninjaTarget} STREQUAL "convert_dict")
++ add_custom_command(
++ POST_BUILD
++ COMMENT "Add workaround for missing ${ninjaTarget}.stamp file after build"
++ COMMAND ${CMAKE_COMMAND} -E touch ${buildDir}/${config}/${arch}/${ninjaTarget}.stamp
++ TARGET ${target}
++ DEPENDS run_${module}_NinjaDone
++ USES_TERMINAL
++ )
++ endif()
+ if(QT_IS_MACOS_UNIVERSAL)
+ add_intermediate_archive(${target} ${buildDir}/${config}/${arch} ${completeStatic})
+ elseif(IOS)
+@@ -1222,7 +1238,7 @@ function(check_for_ulimit)
+
+ function(check_for_ulimit)
+ message("-- Checking 'ulimit -n'")
+- execute_process(COMMAND bash -c "ulimit -n"
++ execute_process(COMMAND sh -c "ulimit -n"
+ OUTPUT_VARIABLE ulimitOutput
+ )
+ string(REGEX MATCHALL "[0-9]+" limit "${ulimitOutput}")
+@@ -1231,7 +1247,7 @@ function(check_for_ulimit)
+ if(NOT ${CMAKE_VERSION} VERSION_LESS "3.21.0")
+ message(" -- Creating linker launcher")
+ file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/linker_ulimit.sh
+- CONTENT "#!/bin/bash\nulimit -n 4096\nexec \"$@\""
++ CONTENT "#!/bin/sh\nulimit -n 4096\nexec \"$@\""
+ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ )
+ set(COIN_BUG_699 ON PARENT_SCOPE)
Index: www/qt6-webengine/files/patch-configure.cmake
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-configure.cmake
@@ -0,0 +1,44 @@
+--- configure.cmake.orig 2022-09-26 10:05:50 UTC
++++ configure.cmake
+@@ -59,7 +59,7 @@ endif()
+ endif()
+
+ #### Tests
+-if(LINUX)
++if(LINUX OR FREEBSD)
+ check_for_ulimit()
+ endif()
+
+@@ -403,7 +403,7 @@ qt_feature("webengine-ozone-x11" PRIVATE
+
+ qt_feature("webengine-ozone-x11" PRIVATE
+ LABEL "Support GLX on qpa-xcb"
+- CONDITION LINUX
++ CONDITION LINUX OR FREEBSD
+ AND TARGET Qt::Gui
+ AND QT_FEATURE_xcb
+ AND X11_FOUND
+@@ -440,12 +440,12 @@ add_check_for_support(
+ )
+ add_check_for_support(
+ MODULES QtWebEngine
+- CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS
++ CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR FREEBSD
+ MESSAGE "Build can be done only on Linux, Windows or macOS."
+ )
+ add_check_for_support(
+ MODULES QtPdf
+- CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS
++ CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS OR FREEBSD
+ MESSAGE "Build can be done only on Linux, Windows, macOS or iOS."
+ )
+ if(LINUX AND CMAKE_CROSSCOMPILING)
+@@ -546,6 +546,8 @@ add_check_for_support(
+ CONDITION
+ (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
+ (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
++ (FREEBSD AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
++ (FREEBSD AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
+ (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL MSVC) OR
+ (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) OR
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_BUILD.gn
@@ -0,0 +1,56 @@
+--- src/3rdparty/chromium/BUILD.gn.orig 2022-11-08 21:18:48 UTC
++++ src/3rdparty/chromium/BUILD.gn
+@@ -55,7 +55,7 @@ declare_args() {
+ qtwebengine_target = "//tools/gn"
+ }
+
+-if (is_official_build) {
++if (is_official_build && !is_bsd) {
+ # An official (maximally optimized!) component (optimized for build times)
+ # build doesn't make sense and usually doesn't work.
+ assert(!is_component_build)
+@@ -451,7 +451,7 @@ group("gn_all") {
+ ]
+ }
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux && !is_bsd) || is_chromeos || is_android) {
+ deps += [
+ "//third_party/breakpad:breakpad_unittests",
+ "//third_party/breakpad:core-2-minidump",
+@@ -696,7 +696,7 @@ group("gn_all") {
+ host_os == "win" && !use_qt) {
+ deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
+ }
+- } else if (!is_android && !is_ios && !is_fuchsia && !is_win) {
++ } else if (!is_android && !is_ios && !is_fuchsia && !is_win && !is_bsd) {
+ deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
+ }
+
+@@ -1172,7 +1172,7 @@ if (!is_ios && !use_qt) {
+ data_deps += [ "//content/web_test:web_test_common_mojom_js_data_deps" ]
+ }
+
+- if (!is_win && !is_android) {
++ if (!is_win && !is_android && !is_bsd) {
+ data_deps +=
+ [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
+ }
+@@ -1181,7 +1181,7 @@ if (!is_ios && !use_qt) {
+ data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux && !is_bsd) || is_chromeos) {
+ data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
+ }
+
+@@ -1580,7 +1580,7 @@ group("chromium_builder_perf") {
+
+ if (is_win) {
+ data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]
+- } else {
++ } else if (!is_bsd) {
+ data_deps +=
+ [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_BUILD.gn
@@ -0,0 +1,148 @@
+--- src/3rdparty/chromium/base/BUILD.gn.orig 2022-11-08 21:18:48 UTC
++++ src/3rdparty/chromium/base/BUILD.gn
+@@ -1000,7 +1000,7 @@ jumbo_component("base") {
+ "timer/hi_res_timer_manager_posix.cc",
+ ]
+
+- if (!is_nacl && !is_apple) {
++ if (!is_nacl && !is_apple && !is_bsd) {
+ sources += [
+ "cpu_affinity_posix.cc",
+ "cpu_affinity_posix.h",
+@@ -1011,6 +1011,12 @@ jumbo_component("base") {
+ "profiler/thread_delegate_posix.h",
+ ]
+ }
++
++ if (is_bsd) {
++ sources += [
++ "profiler/stack_sampler_posix.cc",
++ ]
++ }
+ }
+
+ jumbo_excluded_sources = [
+@@ -1360,7 +1366,6 @@ jumbo_component("base") {
+ "process/process_metrics_linux.cc",
+ "threading/platform_thread_linux.cc",
+ ]
+- jumbo_excluded_sources += [ "process/memory_linux.cc" ]
+ }
+
+ if (is_linux || is_chromeos || is_android || is_fuchsia) {
+@@ -1502,6 +1507,18 @@ jumbo_component("base") {
+ libs += [ "atomic" ]
+ }
+
++ # *BSD needs libkvm
++ if (is_bsd) {
++ libs += [ "kvm" ]
++ }
++
++ if (is_freebsd) {
++ libs += [
++ "execinfo",
++ "util",
++ ]
++ }
++
+ if (use_allocator_shim) {
+ sources += [
+ "allocator/allocator_shim.cc",
+@@ -1529,7 +1546,7 @@ jumbo_component("base") {
+ ]
+ configs += [ "//base/allocator:mac_no_default_new_delete_symbols" ]
+ }
+- if (is_chromeos || is_linux) {
++ if (is_chromeos || (is_linux && !is_bsd)) {
+ sources += [
+ "allocator/allocator_shim_override_cpp_symbols.h",
+ "allocator/allocator_shim_override_glibc_weak_symbols.h",
+@@ -1585,7 +1602,7 @@ jumbo_component("base") {
+
+ # Allow more direct string conversions on platforms with native utf8
+ # strings
+- if (is_apple || is_chromeos || is_chromecast || is_fuchsia) {
++ if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) {
+ defines += [ "SYSTEM_NATIVE_UTF8" ]
+ }
+
+@@ -2163,6 +2180,42 @@ jumbo_component("base") {
+ }
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "files/file_path_watcher_inotify.cc",
++ "files/file_util_linux.cc",
++ "files/scoped_file_linux.cc",
++ "process/memory_linux.cc",
++ "process/process_linux.cc",
++ "system/sys_info_linux.cc",
++ "process/process_iterator_linux.cc",
++ "process/process_metrics_linux.cc",
++ "process/process_handle_linux.cc"
++ ]
++ sources += [
++ "process/memory_stubs.cc",
++ "files/file_path_watcher_kqueue.cc",
++ "files/file_path_watcher_kqueue.h",
++ "files/file_path_watcher_bsd.cc",
++ ]
++ }
++
++ if (is_openbsd) {
++ sources += [
++ "process/process_handle_openbsd.cc",
++ "process/process_iterator_openbsd.cc",
++ "process/process_metrics_openbsd.cc",
++ "system/sys_info_openbsd.cc",
++ ]
++ } else if (is_freebsd) {
++ sources += [
++ "process/process_handle_freebsd.cc",
++ "process/process_iterator_freebsd.cc",
++ "process/process_metrics_freebsd.cc",
++ "system/sys_info_freebsd.cc",
++ ]
++ }
++
+ # iOS
+ if (is_ios) {
+ sources -= [
+@@ -3452,7 +3505,7 @@ test("base_unittests") {
+ }
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "debug/proc_maps_linux_unittest.cc",
+ "files/scoped_file_linux_unittest.cc",
+@@ -3500,7 +3553,7 @@ test("base_unittests") {
+ "posix/unix_domain_socket_unittest.cc",
+ "task/thread_pool/task_tracker_posix_unittest.cc",
+ ]
+- if (!is_nacl && !is_apple) {
++ if (!is_nacl && !is_apple && !is_bsd) {
+ sources += [
+ "cpu_affinity_posix_unittest.cc",
+ "profiler/stack_copier_signal_unittest.cc",
+@@ -3511,7 +3564,7 @@ test("base_unittests") {
+
+ # Allow more direct string conversions on platforms with native utf8
+ # strings
+- if (is_apple || is_chromeos || is_chromecast || is_fuchsia) {
++ if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) {
+ defines += [ "SYSTEM_NATIVE_UTF8" ]
+ }
+
+@@ -3673,7 +3726,7 @@ test("base_unittests") {
+ }
+ }
+
+- if (is_fuchsia || is_linux || is_chromeos) {
++ if ((is_fuchsia || is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "debug/elf_reader_unittest.cc",
+ "debug/test_elf_image_builder.cc",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_address__space__randomization.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_address__space__randomization.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/address_space_randomization.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/address_space_randomization.h
+@@ -38,7 +38,7 @@ AslrMask(uintptr_t bits) {
+
+ #if defined(ARCH_CPU_64_BITS)
+
+- #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
++ #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && !defined(OS_BSD)
+
+ // We shouldn't allocate system pages at all for sanitizer builds. However,
+ // we do, and if random hint addresses interfere with address ranges
+@@ -121,7 +121,7 @@ AslrMask(uintptr_t bits) {
+ return AslrAddress(0x20000000ULL);
+ }
+
+- #elif BUILDFLAG(IS_LINUX)
++ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ // Linux on arm64 can use 39, 42, 48, or 52-bit user space, depending on
+ // page size and number of levels of translation pages used. We use
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_page__allocator.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_page__allocator.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator.h
+@@ -194,7 +194,7 @@ constexpr BASE_EXPORT bool DecommittedMemoryIsAlwaysZe
+ // Whether decommitted memory is guaranteed to be zeroed when it is
+ // recommitted. Do not assume that this will not change over time.
+ constexpr BASE_EXPORT bool DecommittedMemoryIsAlwaysZeroed() {
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_page__allocator__constants.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_page__allocator__constants.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
+@@ -24,7 +24,7 @@
+ // elimination.
+ #define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const))
+
+-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ // This should work for all POSIX (if needed), but currently all other
+ // supported OS/architecture combinations use either hard-coded values
+ // (such as x86) or have means to determine these values without needing
+@@ -79,7 +79,7 @@ PageAllocationGranularityShift() {
+ return 14; // 16kB
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
+ return vm_page_shift;
+-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ // arm64 supports 4kb (shift = 12), 16kb (shift = 14), and 64kb (shift = 16)
+ // page sizes. Retrieve from or initialize cache.
+ int shift = page_characteristics.shift.load(std::memory_order_relaxed);
+@@ -99,7 +99,7 @@ PageAllocationGranularity() {
+ // This is literally equivalent to |1 << PageAllocationGranularityShift()|
+ // below, but was separated out for IS_APPLE to avoid << on a non-constexpr.
+ return vm_page_size;
+-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ // arm64 supports 4kb, 16kb, and 64kb page sizes. Retrieve from or
+ // initialize cache.
+ int size = page_characteristics.size.load(std::memory_order_relaxed);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_page__allocator__internals__posix.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_page__allocator__internals__posix.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h
+@@ -352,8 +352,12 @@ void DiscardSystemPagesInternal(uintptr_t address, siz
+
+ void DiscardSystemPagesInternal(uintptr_t address, size_t length) {
+ void* ptr = reinterpret_cast<void*>(address);
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
++#if BUILDFLAG(IS_BSD)
++ int ret = madvise(ptr, length, MADV_FREE);
++#else
+ int ret = madvise(ptr, length, MADV_FREE_REUSABLE);
++#endif
+ if (ret) {
+ // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED.
+ ret = madvise(ptr, length, MADV_DONTNEED);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__address__space.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__address__space.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_address_space.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_address_space.cc
+@@ -184,7 +184,7 @@ void PartitionAddressSpace::UninitConfigurablePoolForT
+ setup_.configurable_pool_ = 0;
+ }
+
+-#if BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+
+ PageCharacteristics page_characteristics;
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__alloc.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__alloc.cc
@@ -0,0 +1,17 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc.orig 2022-11-06 10:07:10 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
+@@ -63,8 +63,14 @@ void PartitionAllocGlobalInit(OomFunction on_out_of_me
+ "maximum direct mapped allocation");
+
+ // Check that some of our zanier calculations worked out as expected.
++#if defined(__i386__) && defined(OS_FREEBSD)
++ // alignof(std::max_align_t) is only 4 on FreeBSD/i386
++ static_assert(internal::kSmallestBucket >= internal::kAlignment,
++ "generic smallest bucket");
++#else
+ static_assert(internal::kSmallestBucket == internal::kAlignment,
+ "generic smallest bucket");
++#endif
+ static_assert(internal::kMaxBucketed == 917504, "generic max bucketed");
+ STATIC_ASSERT_OR_PA_CHECK(
+ internal::MaxSystemPagesPerRegularSlotSpan() <= 16,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__alloc__config.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__alloc__config.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-11-06 10:11:11 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_config.h
+@@ -66,7 +66,7 @@ static_assert(sizeof(void*) != 8, "");
+
+ // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific
+ // features such as futex(2).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #define PA_HAS_LINUX_KERNEL
+ #endif
+
+@@ -186,7 +186,7 @@ constexpr bool kUseLazyCommit = false;
+
+ // On these platforms, lock all the partitions before fork(), and unlock after.
+ // This may be required on more platforms in the future.
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define PA_HAS_ATFORK_HANDLER
+ #endif
+
+@@ -225,7 +225,7 @@ constexpr bool kUseLazyCommit = false;
+ //
+ // Also enabled on ARM64 macOS, as the 16kiB pages on this platform lead to
+ // larger slot spans.
+-#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64))
++#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) || BUILDFLAG(IS_BSD)
+ #define PA_PREFER_SMALLER_SLOT_SPANS
+ #endif // BUILDFLAG(IS_LINUX)
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__alloc__constants.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__alloc__constants.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
+@@ -80,7 +80,7 @@ PartitionPageShift() {
+ return 18; // 256 KiB
+ }
+ #elif (BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)) || \
+- (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64))
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64))
+ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
+ PartitionPageShift() {
+ return PageAllocationGranularityShift() + 2;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__page.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__page.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_page.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_page.h
+@@ -130,13 +130,14 @@ struct SlotSpanMetadata {
+ PartitionBucket<thread_safe>* const bucket = nullptr;
+
+ // CHECK()ed in AllocNewSlotSpan().
+-#if defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)
++#if (defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)) || \
++ (BUILDFLAG(IS_FREEBSD) && defined(__i386__))
+ // System page size is not a constant on Apple OSes, but is either 4 or 16kiB
+ // (1 << 12 or 1 << 14), as checked in PartitionRoot::Init(). And
+ // PartitionPageSize() is 4 times the OS page size.
+ static constexpr size_t kMaxSlotsPerSlotSpan =
+ 4 * (1 << 14) / kSmallestBucket;
+-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ // System page size can be 4, 16, or 64 kiB on Linux on arm64. 64 kiB is
+ // currently (kMaxSlotsPerSlotSpanBits == 13) not supported by the code,
+ // so we use the 16 kiB maximum (64 kiB will crash).
+@@ -150,7 +151,9 @@ struct SlotSpanMetadata {
+ #endif // defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)
+ // The maximum number of bits needed to cover all currently supported OSes.
+ static constexpr size_t kMaxSlotsPerSlotSpanBits = 13;
++#if !BUILDFLAG(IS_FREEBSD) && defined(__i386__)
+ static_assert(kMaxSlotsPerSlotSpan < (1 << kMaxSlotsPerSlotSpanBits), "");
++#endif
+
+ // |marked_full| isn't equivalent to being full. Slot span is marked as full
+ // iff it isn't on the active slot span list (or any other list).
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__root.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition__root.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_root.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_root.cc
+@@ -29,7 +29,7 @@
+ #include "wow64apiset.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <pthread.h>
+ #endif
+
+@@ -226,7 +226,7 @@ void PartitionAllocMallocInitOnce() {
+ if (!g_global_init_called.compare_exchange_strong(expected, true))
+ return;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // When fork() is called, only the current thread continues to execute in the
+ // child process. If the lock is held, but *not* by this thread when fork() is
+ // called, we have a deadlock.
+@@ -305,7 +305,7 @@ static size_t PartitionPurgeSlotSpan(
+ constexpr size_t kMaxSlotCount =
+ (PartitionPageSize() * kMaxPartitionPagesPerRegularSlotSpan) /
+ SystemPageSize();
+-#elif BUILDFLAG(IS_APPLE) || (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64))
++#elif BUILDFLAG(IS_APPLE) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64))
+ // It's better for slot_usage to be stack-allocated and fixed-size, which
+ // demands that its size be constexpr. On IS_APPLE and Linux on arm64,
+ // PartitionPageSize() is always SystemPageSize() << 2, so regardless of
+@@ -648,7 +648,7 @@ void PartitionRoot<thread_safe>::Init(PartitionOptions
+ // apple OSes.
+ PA_CHECK((internal::SystemPageSize() == (size_t{1} << 12)) ||
+ (internal::SystemPageSize() == (size_t{1} << 14)));
+-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ // Check runtime pagesize. Though the code is currently the same, it is
+ // not merged with the IS_APPLE case above as a 1 << 16 case needs to be
+ // added here in the future, to allow 64 kiB pagesize. That is only
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_spinning__mutex.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_spinning__mutex.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/spinning_mutex.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/spinning_mutex.h
+@@ -114,7 +114,7 @@ class LOCKABLE BASE_EXPORT SpinningMutex {
+
+ #if defined(PA_HAS_FAST_MUTEX)
+
+-#if defined(PA_HAS_LINUX_KERNEL)
++#if defined(PA_HAS_LINUX_KERNEL) || defined(PA_HAS_FREEBSD_KERNEL)
+ void FutexWait();
+ void FutexWake();
+
+@@ -166,7 +166,7 @@ inline constexpr SpinningMutex::SpinningMutex() = defa
+
+ #if defined(PA_HAS_FAST_MUTEX)
+
+-#if defined(PA_HAS_LINUX_KERNEL)
++#if defined(PA_HAS_LINUX_KERNEL) || defined(PA_HAS_FREEBSD_KERNEL)
+
+ ALWAYS_INLINE bool SpinningMutex::Try() {
+ // Using the weak variant of compare_exchange(), which may fail spuriously. On
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_spinning__mutex.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_spinning__mutex.cc
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/spinning_mutex.cc
+@@ -17,7 +17,15 @@
+
+ #if defined(PA_HAS_LINUX_KERNEL)
+ #include <errno.h>
++#if defined(OS_OPENBSD)
++#include <sys/futex.h>
++#elif defined(OS_FREEBSD)
++#include <sys/types.h>
++#include <sys/thr.h>
++#include <sys/umtx.h>
++#else
+ #include <linux/futex.h>
++#endif
+ #include <sys/syscall.h>
+ #include <unistd.h>
+ #endif // defined(PA_HAS_LINUX_KERNEL)
+@@ -116,8 +124,13 @@ void SpinningMutex::FutexWait() {
+ // |kLockedContended| anymore. Note that even without spurious wakeups, the
+ // value of |state_| is not guaranteed when this returns, as another thread
+ // may get the lock before we get to run.
++#if defined(OS_FREEBSD)
++ int err = _umtx_op(&state_, UMTX_OP_WAIT_UINT_PRIVATE,
++ kLockedContended, nullptr, nullptr);
++#else
+ int err = syscall(SYS_futex, &state_, FUTEX_WAIT | FUTEX_PRIVATE_FLAG,
+ kLockedContended, nullptr, nullptr, 0);
++#endif
+
+ if (err) {
+ // These are programming error, check them.
+@@ -129,8 +142,14 @@ void SpinningMutex::FutexWake() {
+
+ void SpinningMutex::FutexWake() {
+ int saved_errno = errno;
++#if defined(OS_FREEBSD)
++ long retval = _umtx_op(&state_, UMTX_OP_WAKE_PRIVATE,
++ 1 /* wake up a single waiter */, nullptr, nullptr);
++#else
+ long retval = syscall(SYS_futex, &state_, FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
+ 1 /* wake up a single waiter */, nullptr, nullptr, 0);
++#endif
++
+ PA_CHECK(retval != -1);
+ errno = saved_errno;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_starscan_stack_stack.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_allocator_partition__allocator_starscan_stack_stack.cc
@@ -0,0 +1,50 @@
+--- src/3rdparty/chromium/base/allocator/partition_allocator/starscan/stack/stack.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/allocator/partition_allocator/starscan/stack/stack.cc
+@@ -17,6 +17,10 @@
+ #include <pthread.h>
+ #endif
+
++#if defined(OS_BSD)
++#include <pthread_np.h>
++#endif
++
+ #if defined(LIBC_GLIBC)
+ extern "C" void* __libc_stack_end;
+ #endif
+@@ -47,6 +51,36 @@ void* GetStackTop() {
+
+ void* GetStackTop() {
+ return pthread_get_stackaddr_np(pthread_self());
++}
++
++#elif defined(OS_OPENBSD)
++
++void* GetStackTop() {
++ stack_t ss;
++ if (pthread_stackseg_np(pthread_self(), &ss) != 0)
++ return nullptr;
++ return reinterpret_cast<uint8_t*>(ss.ss_sp);
++}
++
++#elif defined(OS_FREEBSD)
++
++void* GetStackTop() {
++ pthread_attr_t attr;
++ int error = pthread_attr_init(&attr);
++ if (error) {
++ return nullptr;
++ }
++ error = pthread_attr_get_np(pthread_self(), &attr);
++ if (!error) {
++ void* base;
++ size_t size;
++ error = pthread_attr_getstack(&attr, &base, &size);
++ PA_CHECK(!error);
++ pthread_attr_destroy(&attr);
++ return reinterpret_cast<uint8_t*>(base) + size;
++ }
++ pthread_attr_destroy(&attr);
++ return nullptr;
+ }
+
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_atomicops.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_atomicops.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/base/atomicops.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/atomicops.h
+@@ -56,7 +56,11 @@ typedef intptr_t Atomic64;
+
+ // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
+ // Atomic64 routines below, depending on your architecture.
++#if !defined(OS_OPENBSD) && defined(__i386__)
++typedef Atomic32 AtomicWord;
++#else
+ typedef intptr_t AtomicWord;
++#endif
+
+ // Atomically execute:
+ // result = *ptr;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_base__paths__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_base__paths__posix.cc
@@ -0,0 +1,98 @@
+--- src/3rdparty/chromium/base/base_paths_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/base_paths_posix.cc
+@@ -15,6 +15,7 @@
+ #include <ostream>
+ #include <string>
+
++#include "base/command_line.h"
+ #include "base/environment.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
+@@ -25,9 +26,13 @@
+ #include "base/process/process_metrics.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_BSD)
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
++#if BUILDFLAG(IS_OPENBSD)
++#include <kvm.h>
++#define MAXTOKENS 2
++#endif
+ #elif BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_AIX)
+ #include <stdlib.h>
+ #endif
+@@ -68,13 +73,65 @@ bool PathProviderPosix(int key, FilePath* result) {
+ *result = FilePath(bin_dir);
+ return true;
+ #elif BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_AIX)
+- // There is currently no way to get the executable path on OpenBSD
+- char* cpath;
+- if ((cpath = getenv("CHROME_EXE_PATH")) != NULL)
+- *result = FilePath(cpath);
+- else
+- *result = FilePath("/usr/local/chrome/chrome");
+- return true;
++ char *cpath;
++#if !BUILDFLAG(IS_AIX)
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ char errbuf[_POSIX2_LINE_MAX];
++ static char retval[PATH_MAX];
++ int cnt;
++ struct stat sb;
++ pid_t cpid = getpid();
++ bool ret = false;
++
++ const base::CommandLine* command_line =
++ base::CommandLine::ForCurrentProcess();
++
++ VLOG(1) << "PathProviderPosix argv: " << command_line->argv()[0];
++
++ if (realpath(command_line->argv()[0].c_str(), retval) == NULL)
++ goto out;
++
++ if (stat(command_line->argv()[0].c_str(), &sb) < 0)
++ goto out;
++
++ if (!command_line->HasSwitch("no-sandbox")) {
++ ret = true;
++ *result = FilePath(retval);
++ VLOG(1) << "PathProviderPosix (sandbox) result: " << retval;
++ goto out;
++ }
++
++ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL)
++ goto out;
++
++ if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, cpid,
++ sizeof(struct kinfo_file), &cnt)) == NULL)
++ goto out;
++
++ for (int i = 0; i < cnt; i++) {
++ if (files[i].fd_fd == KERN_FILE_TEXT &&
++ files[i].va_fsid == static_cast<uint32_t>(sb.st_dev) &&
++ files[i].va_fileid == sb.st_ino) {
++ ret = true;
++ *result = FilePath(retval);
++ VLOG(1) << "PathProviderPosix result: " << retval;
++ }
++ }
++out:
++ if (kd)
++ kvm_close(kd);
++ if (!ret) {
++#endif
++ if ((cpath = getenv("CHROME_EXE_PATH")) != NULL)
++ *result = FilePath(cpath);
++ else
++ *result = FilePath("/usr/local/chrome/chrome");
++ return true;
++#if !BUILDFLAG(IS_AIX)
++ }
++ return ret;
++#endif
+ #endif
+ }
+ case DIR_SRC_TEST_DATA_ROOT: {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_base__switches.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_base__switches.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/base_switches.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/base_switches.h
+@@ -60,7 +60,7 @@ extern const char kForceFieldTrialParams[];
+ extern const char kForceFieldTrialParams[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kEnableThreadInstructionCount[];
+
+ // TODO(crbug.com/1176772): Remove kEnableCrashpad and IsCrashpadEnabled() when
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_base__switches.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_base__switches.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/base_switches.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/base_switches.cc
+@@ -170,7 +170,7 @@ const char kForceFieldTrialParams[] = "force-fieldtria
+
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Controls whether or not retired instruction counts are surfaced for threads
+ // in trace events on Linux.
+ //
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_cpu.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_cpu.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/cpu.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/cpu.h
+@@ -108,7 +108,7 @@ class BASE_EXPORT CPU final {
+ const std::string& cpu_brand() const { return cpu_brand_; }
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ enum class CoreType {
+ kUnknown = 0,
+ kOther,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_debugger__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_debugger__posix.cc
@@ -0,0 +1,68 @@
+--- src/3rdparty/chromium/base/debug/debugger_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/debug/debugger_posix.cc
+@@ -35,6 +35,10 @@
+ #include <sys/sysctl.h>
+ #endif
+
++#if BUILDFLAG(IS_OPENBSD)
++#include <sys/proc.h>
++#endif
++
+ #if BUILDFLAG(IS_FREEBSD)
+ #include <sys/user.h>
+ #endif
+@@ -95,32 +99,51 @@ bool BeingDebugged() {
+
+ // Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and
+ // binary interfaces may change.
++#if BUILDFLAG(IS_OPENBSD)
++ struct kinfo_proc *info;
++ size_t info_size;
++#else
+ struct kinfo_proc info;
+ size_t info_size = sizeof(info);
++#endif
+
+ #if BUILDFLAG(IS_OPENBSD)
+ if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0)
+ return -1;
+
+ mib[5] = (info_size / sizeof(struct kinfo_proc));
++ if ((info = reinterpret_cast<kinfo_proc*>(malloc(info_size))) == NULL) {
++ is_set = true;
++ being_debugged = false;
++ return being_debugged;
++ }
++
++ int sysctl_result = sysctl(mib, std::size(mib), info, &info_size, NULL, 0);
+ #endif
+
++#if !BUILDFLAG(IS_OPENBSD)
+ int sysctl_result = sysctl(mib, std::size(mib), &info, &info_size, NULL, 0);
++#endif
+ DCHECK_EQ(sysctl_result, 0);
+ if (sysctl_result != 0) {
+ is_set = true;
+ being_debugged = false;
+- return being_debugged;
++ goto out;
+ }
+
+ // This process is being debugged if the P_TRACED flag is set.
+ is_set = true;
+ #if BUILDFLAG(IS_FREEBSD)
+ being_debugged = (info.ki_flag & P_TRACED) != 0;
+-#elif BUILDFLAG(IS_BSD)
+- being_debugged = (info.p_flag & P_TRACED) != 0;
++#elif BUILDFLAG(IS_OPENBSD)
++ being_debugged = (info->p_psflags & PS_TRACED) != 0;
+ #else
+ being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
++#endif
++
++out:
++#if BUILDFLAG(IS_OPENBSD)
++ free(info);
+ #endif
+ return being_debugged;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_elf__reader.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_elf__reader.cc
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/base/debug/elf_reader.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/debug/elf_reader.cc
+@@ -76,6 +76,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
+ bool found = false;
+ while (current_section < section_end) {
+ current_note = reinterpret_cast<const Nhdr*>(current_section);
++#if !defined(OS_BSD)
+ if (current_note->n_type == NT_GNU_BUILD_ID) {
+ StringPiece note_name(current_section + sizeof(Nhdr),
+ current_note->n_namesz);
+@@ -85,6 +86,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
+ break;
+ }
+ }
++#endif
+
+ size_t section_size = bits::AlignUp(current_note->n_namesz, 4) +
+ bits::AlignUp(current_note->n_descsz, 4) +
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_proc__maps__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_proc__maps__linux.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/debug/proc_maps_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/debug/proc_maps_linux.cc
+@@ -13,7 +13,7 @@
+ #include "base/strings/string_split.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include <inttypes.h>
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_stack__trace__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_debug_stack__trace__posix.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/base/debug/stack_trace_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/debug/stack_trace_posix.cc
+@@ -38,7 +38,7 @@
+ #include <AvailabilityMacros.h>
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/debug/proc_maps_linux.h"
+ #endif
+
+@@ -695,6 +695,9 @@ class SandboxSymbolizeHelper {
+ // for the modules that are loaded in the current process.
+ // Returns true on success.
+ bool CacheMemoryRegions() {
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ // Reads /proc/self/maps.
+ std::string contents;
+ if (!ReadProcMaps(&contents)) {
+@@ -712,6 +715,7 @@ class SandboxSymbolizeHelper {
+
+ is_initialized_ = true;
+ return true;
++#endif
+ }
+
+ // Opens all object files and caches their file descriptors.
+@@ -868,7 +872,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // If we do not have unwind tables, then try tracing using frame pointers.
+ return base::debug::TraceStackFramePointers(const_cast<const void**>(trace),
+ count, 0);
+-#elif !defined(__UCLIBC__) && !defined(_AIX)
++#elif !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__path__watcher__bsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__path__watcher__bsd.cc
@@ -0,0 +1,57 @@
+--- src/3rdparty/chromium/base/files/file_path_watcher_bsd.cc.orig 2022-11-06 10:18:39 UTC
++++ src/3rdparty/chromium/base/files/file_path_watcher_bsd.cc
+@@ -0,0 +1,54 @@
++// Copyright 2021 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include <memory>
++
++#include "base/files/file_path_watcher.h"
++#include "base/files/file_path_watcher_kqueue.h"
++#include "base/memory/ptr_util.h"
++#include "build/build_config.h"
++
++namespace base {
++
++namespace {
++
++class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
++ public:
++ FilePathWatcherImpl() = default;
++ FilePathWatcherImpl(const FilePathWatcherImpl&) = delete;
++ FilePathWatcherImpl& operator=(const FilePathWatcherImpl&) = delete;
++ ~FilePathWatcherImpl() override = default;
++
++ bool Watch(const FilePath& path,
++ Type type,
++ const FilePathWatcher::Callback& callback) override {
++ DCHECK(!impl_.get());
++ if (type == Type::kRecursive) {
++ if (!FilePathWatcher::RecursiveWatchAvailable())
++ return false;
++ } else {
++ impl_ = std::make_unique<FilePathWatcherKQueue>();
++ }
++ DCHECK(impl_.get());
++ return impl_->Watch(path, type, callback);
++ }
++
++ void Cancel() override {
++ if (impl_.get())
++ impl_->Cancel();
++ set_cancelled();
++ }
++
++ private:
++ std::unique_ptr<PlatformDelegate> impl_;
++};
++
++} // namespace
++
++FilePathWatcher::FilePathWatcher() {
++ sequence_checker_.DetachFromSequence();
++ impl_ = std::make_unique<FilePathWatcherImpl>();
++}
++
++} // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__path__watcher__freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__path__watcher__freebsd.cc
@@ -0,0 +1,64 @@
+--- src/3rdparty/chromium/base/files/file_path_watcher_freebsd.cc.orig 2022-08-20 09:01:54 UTC
++++ src/3rdparty/chromium/base/files/file_path_watcher_freebsd.cc
+@@ -0,0 +1,61 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++// This file exists for Unix systems which don't have the inotify headers, and
++// thus cannot build file_watcher_inotify.cc
++
++#include <memory>
++
++#include "base/files/file_path_watcher.h"
++#include "base/files/file_path_watcher_kqueue.h"
++
++#include "base/memory/ptr_util.h"
++#include "build/build_config.h"
++
++namespace base {
++
++namespace {
++
++class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
++ public:
++ FilePathWatcherImpl() = default;
++ FilePathWatcherImpl(const FilePathWatcherImpl&) = delete;
++ FilePathWatcherImpl& operator=(const FilePathWatcherImpl&) = delete;
++ ~FilePathWatcherImpl() override = default;
++
++ bool Watch(const FilePath& path,
++ Type type,
++ const FilePathWatcher::Callback& callback) override {
++ DCHECK(!impl_.get());
++
++ if (type == Type::kRecursive) {
++ return false;
++ } else {
++ impl_ = std::make_unique<FilePathWatcherKQueue>();
++ }
++
++ DCHECK(impl_.get());
++
++ return impl_->Watch(path, type, callback);
++ }
++
++ void Cancel() override {
++ if (impl_.get())
++ impl_->Cancel();
++
++ set_cancelled();
++ }
++
++ private:
++ std::unique_ptr<PlatformDelegate> impl_;
++};
++
++} // namespace
++
++FilePathWatcher::FilePathWatcher() {
++ sequence_checker_.DetachFromSequence();
++ impl_ = std::make_unique<FilePathWatcherImpl>();
++}
++
++} // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__path__watcher__kqueue.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__path__watcher__kqueue.h
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/base/files/file_path_watcher_kqueue.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/files/file_path_watcher_kqueue.h
+@@ -5,6 +5,7 @@
+ #ifndef BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+ #define BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+
++#include <sys/time.h>
+ #include <sys/event.h>
+
+ #include <memory>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__util__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_file__util__posix.cc
@@ -0,0 +1,52 @@
+--- src/3rdparty/chromium/base/files/file_util_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/files/file_util_posix.cc
+@@ -697,32 +697,34 @@ bool CreateDirectoryAndGetError(const FilePath& full_p
+ File::Error* error) {
+ ScopedBlockingCall scoped_blocking_call(
+ FROM_HERE, BlockingType::MAY_BLOCK); // For call to mkdir().
++ const FilePath kFileSystemRoot("/");
+ std::vector<FilePath> subpaths;
+
+ // Collect a list of all parent directories.
+ FilePath last_path = full_path;
+- subpaths.push_back(full_path);
++ if (full_path != kFileSystemRoot)
++ subpaths.push_back(full_path);
+ for (FilePath path = full_path.DirName();
+- path.value() != last_path.value(); path = path.DirName()) {
++ (path.value() != last_path.value() &&
++ (path != kFileSystemRoot)); path = path.DirName()) {
+ subpaths.push_back(path);
+ last_path = path;
+ }
+
+ // Iterate through the parents and create the missing ones.
+ for (const FilePath& subpath : base::Reversed(subpaths)) {
+- if (DirectoryExists(subpath))
+- continue;
+- if (mkdir(subpath.value().c_str(), 0700) == 0)
+- continue;
+- // Mkdir failed, but it might have failed with EEXIST, or some other error
+- // due to the directory appearing out of thin air. This can occur if
+- // two processes are trying to create the same file system tree at the same
+- // time. Check to see if it exists and make sure it is a directory.
+- int saved_errno = errno;
+- if (!DirectoryExists(subpath)) {
+- if (error)
+- *error = File::OSErrorToFileError(saved_errno);
+- return false;
++ if (!PathExists(subpath)) {
++ if ((mkdir(subpath.value().c_str(), 0700) == -1) &&
++ ((full_path != subpath) ? (errno != ENOENT) : (-1))) {
++ int saved_errno = errno;
++ if (error)
++ *error = File::OSErrorToFileError(saved_errno);
++ return false;
++ }
++ } else if (!DirectoryExists(subpath)) {
++ if (error)
++ *error = File::OSErrorToFileError(ENOTDIR);
++ return false;
+ }
+ }
+ return true;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_important__file__writer__cleaner.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_important__file__writer__cleaner.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/base/files/important_file_writer_cleaner.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/files/important_file_writer_cleaner.cc
+@@ -25,7 +25,8 @@ base::Time GetUpperBoundTime() {
+ namespace {
+
+ base::Time GetUpperBoundTime() {
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA)
++// needed because of .CreationTime() pledge
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // If process creation time is not available then use instance creation
+ // time as the upper-bound for old files. Modification times may be
+ // rounded-down to coarse-grained increments, e.g. FAT has 2s granularity,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_scoped__file.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_files_scoped__file.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/files/scoped_file.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/files/scoped_file.cc
+@@ -31,7 +31,7 @@ void ScopedFDCloseTraits::Free(int fd) {
+ int ret = IGNORE_EINTR(close(fd));
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \
+- BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // NB: Some file descriptors can return errors from close() e.g. network
+ // filesystems such as NFS and Linux input devices. On Linux, macOS, and
+ // Fuchsia's POSIX layer, errors from close other than EBADF do not indicate
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_i18n_icu__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_i18n_icu__util.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/i18n/icu_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/i18n/icu_util.cc
+@@ -52,7 +52,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
+- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ !BUILDFLAG(IS_CHROMECAST))
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+ #endif
+@@ -328,7 +328,7 @@ void InitializeIcuTimeZone() {
+ FuchsiaIntlProfileWatcher::GetPrimaryTimeZoneIdForIcuInitialization();
+ icu::TimeZone::adoptDefault(
+ icu::TimeZone::createTimeZone(icu::UnicodeString::fromUTF8(zone_id)));
+-#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ !BUILDFLAG(IS_CHROMECAST)
+ // To respond to the time zone change properly, the default time zone
+ // cache in ICU has to be populated on starting up.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_linux__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_linux__util.cc
@@ -0,0 +1,28 @@
+--- src/3rdparty/chromium/base/linux_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/linux_util.cc
+@@ -15,6 +15,7 @@
+
+ #include <iomanip>
+ #include <memory>
++#include <sstream>
+
+ #include "base/base_export.h"
+ #include "base/files/dir_reader_posix.h"
+@@ -135,6 +136,9 @@ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t
+ }
+
+ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t>* tids) {
++#if defined(OS_BSD)
++ return false;
++#else
+ // 25 > strlen("/proc//task") + strlen(std::to_string(INT_MAX)) + 1 = 22
+ char buf[25];
+ strings::SafeSPrintf(buf, "/proc/%d/task", pid);
+@@ -154,6 +158,7 @@ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t
+ }
+
+ return true;
++#endif
+ }
+
+ pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_discardable__memory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_discardable__memory.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/base/memory/discardable_memory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/memory/discardable_memory.cc
+@@ -25,7 +25,7 @@ const base::Feature kMadvFreeDiscardableMemory{
+ "MadvFreeDiscardableMemory", base::FEATURE_DISABLED_BY_DEFAULT};
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const base::Feature kDiscardableMemoryBackingTrial{
+ "DiscardableMemoryBackingTrial", base::FEATURE_DISABLED_BY_DEFAULT};
+
+@@ -50,7 +50,7 @@ namespace {
+
+ namespace {
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ DiscardableMemoryBacking GetBackingForFieldTrial() {
+ DiscardableMemoryTrialGroup trial_group =
+@@ -69,7 +69,7 @@ DiscardableMemoryBacking GetBackingForFieldTrial() {
+
+ } // namespace
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Probe capabilities of this device to determine whether we should participate
+ // in the discardable memory backing trial.
+@@ -99,7 +99,7 @@ DiscardableMemoryBacking GetDiscardableMemoryBacking()
+ DiscardableMemory::~DiscardableMemory() = default;
+
+ DiscardableMemoryBacking GetDiscardableMemoryBacking() {
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (DiscardableMemoryBackingFieldTrialIsEnabled()) {
+ return GetBackingForFieldTrial();
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_discardable__memory__internal.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_discardable__memory__internal.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/memory/discardable_memory_internal.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/memory/discardable_memory_internal.h
+@@ -10,7 +10,7 @@
+ #include "base/metrics/field_trial_params.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ namespace base {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_madv__free__discardable__memory__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_madv__free__discardable__memory__posix.cc
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/base/memory/madv_free_discardable_memory_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/memory/madv_free_discardable_memory_posix.cc
+@@ -299,6 +299,10 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons
+
+ bool MadvFreeDiscardableMemoryPosix::IsResident() const {
+ DFAKE_SCOPED_RECURSIVE_LOCK(thread_collision_warner_);
++// XXX mincore
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ #if BUILDFLAG(IS_APPLE)
+ std::vector<char> vec(allocated_pages_);
+ #else
+@@ -314,6 +318,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons
+ return false;
+ }
+ return true;
++#endif
+ }
+
+ bool MadvFreeDiscardableMemoryPosix::IsDiscarded() const {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_platform__shared__memory__region.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_platform__shared__memory__region.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/base/memory/platform_shared_memory_region.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/memory/platform_shared_memory_region.h
+@@ -14,7 +14,7 @@
+
+ #include <stdint.h>
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ namespace content {
+ class SandboxIPCHandler;
+ }
+@@ -81,7 +81,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
+ kMaxValue = GET_SHMEM_TEMP_DIR_FAILURE
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Structure to limit access to executable region creation.
+ struct ExecutableRegion {
+ private:
+@@ -211,7 +211,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
+ CheckPlatformHandlePermissionsCorrespondToMode);
+ static PlatformSharedMemoryRegion Create(Mode mode,
+ size_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ bool executable = false
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_platform__shared__memory__region__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_memory_platform__shared__memory__region__posix.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/base/memory/platform_shared_memory_region_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/memory/platform_shared_memory_region_posix.cc
+@@ -55,7 +55,7 @@ bool CheckFDAccessMode(int fd, int expected_mode) {
+
+ } // namespace
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) {
+ PlatformSharedMemoryRegion region =
+@@ -171,7 +171,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion:
+ // static
+ PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode,
+ size_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ bool executable
+ #endif
+@@ -200,7 +200,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion:
+ // flag.
+ FilePath directory;
+ if (!GetShmemTempDir(
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ executable,
+ #else
+ false /* executable */,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_message__loop_message__pump__glib.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_message__loop_message__pump__glib.cc
@@ -0,0 +1,28 @@
+--- src/3rdparty/chromium/base/message_loop/message_pump_glib.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/message_loop/message_pump_glib.cc
+@@ -8,6 +8,11 @@
+ #include <glib.h>
+ #include <math.h>
+
++#if BUILDFLAG(IS_BSD)
++#include <pthread.h>
++#include <pthread_np.h>
++#endif
++
+ #include "base/logging.h"
+ #include "base/notreached.h"
+ #include "base/numerics/safe_conversions.h"
+@@ -50,9 +55,13 @@ bool RunningOnMainThread() {
+ }
+
+ bool RunningOnMainThread() {
++#if BUILDFLAG(IS_BSD)
++ return pthread_main_np();
++#else
+ auto pid = getpid();
+ auto tid = PlatformThread::CurrentId();
+ return pid > 0 && tid > 0 && pid == tid;
++#endif
+ }
+
+ // A brief refresher on GLib:
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_native__library__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_native__library__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/native_library_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/native_library_posix.cc
+@@ -33,7 +33,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP
+ // http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892,
+ // and http://crbug.com/40794.
+ int flags = RTLD_LAZY;
+-#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND)
++#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND) || BUILDFLAG(IS_BSD)
+ // Certain platforms don't define RTLD_DEEPBIND. Android dlopen() requires
+ // further investigation, as it might vary across versions. Crash here to
+ // warn developers that they're trying to rely on uncertain behavior.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_posix_can__lower__nice__to.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_posix_can__lower__nice__to.cc
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/base/posix/can_lower_nice_to.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/posix/can_lower_nice_to.cc
+@@ -11,8 +11,12 @@
+
+ #include "build/build_config.h"
+
++#if BUILDFLAG(IS_FREEBSD)
++#include <sys/param.h>
++#endif
++
+ // Not defined on AIX by default.
+-#if BUILDFLAG(IS_AIX)
++#if BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ #if defined(RLIMIT_NICE)
+ #error Assumption about OS_AIX is incorrect
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_posix_unix__domain__socket.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_posix_unix__domain__socket.cc
@@ -0,0 +1,39 @@
+--- src/3rdparty/chromium/base/posix/unix_domain_socket.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/posix/unix_domain_socket.cc
+@@ -50,7 +50,7 @@ bool UnixDomainSocket::EnableReceiveProcessId(int fd)
+
+ // static
+ bool UnixDomainSocket::EnableReceiveProcessId(int fd) {
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ const int enable = 1;
+ return setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)) == 0;
+ #else
+@@ -140,7 +140,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
+
+ const size_t kControlBufferSize =
+ CMSG_SPACE(sizeof(int) * kMaxFileDescriptors)
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ // macOS does not support ucred.
+ // macOS supports xucred, but this structure is insufficient.
+ + CMSG_SPACE(sizeof(struct ucred))
+@@ -168,7 +168,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
+ wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
+ wire_fds_len = payload_len / sizeof(int);
+ }
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ // macOS does not support SCM_CREDENTIALS.
+ if (cmsg->cmsg_level == SOL_SOCKET &&
+ cmsg->cmsg_type == SCM_CREDENTIALS) {
+@@ -202,6 +202,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
+ socklen_t pid_size = sizeof(pid);
+ if (getsockopt(fd, SOL_LOCAL, LOCAL_PEERPID, &pid, &pid_size) != 0)
+ pid = -1;
++#elif BUILDFLAG(IS_BSD)
++ NOTIMPLEMENTED();
++ pid = -1;
+ #else
+ // |pid| will legitimately be -1 if we read EOF, so only DCHECK if we
+ // actually received a message. Unfortunately, Linux allows sending zero
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_kill.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_kill.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/process/kill.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/kill.h
+@@ -113,7 +113,7 @@ BASE_EXPORT TerminationStatus GetKnownDeadTerminationS
+ BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus(
+ ProcessHandle handle, int* exit_code);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Spawns a thread to wait asynchronously for the child |process| to exit
+ // and then reaps it.
+ BASE_EXPORT void EnsureProcessGetsReaped(Process process);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_kill__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_kill__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/process/kill_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/kill_posix.cc
+@@ -158,7 +158,7 @@ void EnsureProcessTerminated(Process process) {
+ 0, new BackgroundReaper(std::move(process), Seconds(2)));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void EnsureProcessGetsReaped(Process process) {
+ DCHECK(!process.is_current());
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_launch.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_launch.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/process/launch.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/launch.h
+@@ -199,7 +199,7 @@ struct BASE_EXPORT LaunchOptions {
+ bool clear_environment = false;
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // If non-zero, start the process using clone(), using flags as provided.
+ // Unlike in clone, clone_flags may not contain a custom termination signal
+ // that is sent to the parent when the child dies. The termination signal will
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_launch__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_launch__posix.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/base/process/launch_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/launch_posix.cc
+@@ -64,6 +64,9 @@
+ #error "macOS should use launch_mac.cc"
+ #endif
+
++#if defined(OS_FREEBSD)
++#pragma weak environ
++#endif
+ extern char** environ;
+
+ namespace base {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_memory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_memory.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/process/memory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/memory.cc
+@@ -65,14 +65,16 @@ NOINLINE void OnNoMemoryInternal(size_t size) {
+
+ } // namespace internal
+
++#if !BUILDFLAG(IS_BSD)
+ void TerminateBecauseOutOfMemory(size_t size) {
+ internal::OnNoMemoryInternal(size);
+ }
++#endif
+
+ // Defined in memory_mac.mm for macOS + use_allocator="none". In case of
+ // USE_PARTITION_ALLOC_AS_MALLOC, no need to route the call to the system
+ // default calloc of macOS.
+-#if !BUILDFLAG(IS_APPLE) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
++#if (!BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+
+ bool UncheckedCalloc(size_t num_items, size_t size, void** result) {
+ const size_t alloc_size = num_items * size;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/process/process_handle.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_handle.h
+@@ -106,7 +106,7 @@ BASE_EXPORT UniqueProcId GetUniqueIdForProcess();
+ // processes may be reused.
+ BASE_EXPORT UniqueProcId GetUniqueIdForProcess();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // When a process is started in a different PID namespace from the browser
+ // process, this function must be called with the process's PID in the browser's
+ // PID namespace in order to initialize its unique ID. Not thread safe.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/process/process_handle.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_handle.cc
+@@ -30,7 +30,7 @@ UniqueProcId GetUniqueIdForProcess() {
+ : UniqueProcId(GetCurrentProcId());
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_AIX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+
+ void InitUniqueIdForProcessInPidNamespace(ProcessId pid_outside_of_namespace) {
+ DCHECK(pid_outside_of_namespace != kNullProcessId);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle__freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle__freebsd.cc
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/base/process/process_handle_freebsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_handle_freebsd.cc
+@@ -3,6 +3,7 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_handle.h"
++#include "base/files/file_util.h"
+
+ #include <limits.h>
+ #include <stddef.h>
+@@ -15,10 +16,13 @@ ProcessId GetParentProcessId(ProcessHandle process) {
+
+ ProcessId GetParentProcessId(ProcessHandle process) {
+ struct kinfo_proc info;
+- size_t length;
++ size_t length = sizeof(struct kinfo_proc);
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
+
+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
++ return -1;
++
++ if (length < sizeof(struct kinfo_proc))
+ return -1;
+
+ return info.ki_ppid;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle__openbsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__handle__openbsd.cc
@@ -0,0 +1,89 @@
+--- src/3rdparty/chromium/base/process/process_handle_openbsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_handle_openbsd.cc
+@@ -3,8 +3,11 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_handle.h"
++#include "base/files/file_util.h"
+
+ #include <stddef.h>
++#include <sys/param.h>
++#include <sys/proc.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -12,39 +15,59 @@ ProcessId GetParentProcessId(ProcessHandle process) {
+ namespace base {
+
+ ProcessId GetParentProcessId(ProcessHandle process) {
+- struct kinfo_proc info;
++ struct kinfo_proc *info;
+ size_t length;
++ pid_t ppid;
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process,
+ sizeof(struct kinfo_proc), 0 };
+
+ if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0)
+ return -1;
+
++ info = (struct kinfo_proc *)malloc(length);
++
+ mib[5] = (length / sizeof(struct kinfo_proc));
+
+- if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+- return -1;
++ if (sysctl(mib, std::size(mib), info, &length, NULL, 0) < 0) {
++ ppid = -1;
++ goto out;
++ }
+
+- return info.p_ppid;
++ ppid = info->p_ppid;
++
++out:
++ free(info);
++ return ppid;
+ }
+
+ FilePath GetProcessExecutablePath(ProcessHandle process) {
+- struct kinfo_proc kp;
+- size_t len;
++ struct kinfo_proc *info;
++ size_t length;
++ char *path = NULL;
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process,
+ sizeof(struct kinfo_proc), 0 };
+
+- if (sysctl(mib, std::size(mib), NULL, &len, NULL, 0) == -1)
++ if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) == -1)
+ return FilePath();
+- mib[5] = (len / sizeof(struct kinfo_proc));
+- if (sysctl(mib, std::size(mib), &kp, &len, NULL, 0) < 0)
+- return FilePath();
+- if ((kp.p_flag & P_SYSTEM) != 0)
+- return FilePath();
+- if (strcmp(kp.p_comm, "chrome") == 0)
+- return FilePath(kp.p_comm);
+
+- return FilePath();
++ info = (struct kinfo_proc *)malloc(length);
++
++ mib[5] = (length / sizeof(struct kinfo_proc));
++
++ if (sysctl(mib, std::size(mib), info, &length, NULL, 0) < 0)
++ goto out;
++
++ if ((info->p_flag & P_SYSTEM) != 0)
++ goto out;
++
++ if (strcmp(info->p_comm, "chrome") == 0) {
++ path = info->p_comm;
++ goto out;
++ }
++
++out:
++ free(info);
++ return FilePath(path);
+ }
+
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__iterator__freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__iterator__freebsd.cc
@@ -0,0 +1,51 @@
+--- src/3rdparty/chromium/base/process/process_iterator_freebsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_iterator_freebsd.cc
+@@ -20,7 +20,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ : index_of_kinfo_proc_(),
+ filter_(filter) {
+
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid() };
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, (int) getuid() };
+
+ bool done = false;
+ int try_num = 1;
+@@ -39,7 +39,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ num_of_kinfo_proc += 16;
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ len = num_of_kinfo_proc * sizeof(struct kinfo_proc);
+- if (sysctl(mib, std::size(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) {
++ if (sysctl(mib, std::size(mib), kinfo_procs_.data(), &len, NULL, 0) < 0) {
+ // If we get a mem error, it just means we need a bigger buffer, so
+ // loop around again. Anything else is a real error and give up.
+ if (errno != ENOMEM) {
+@@ -49,7 +49,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ }
+ } else {
+ // Got the list, just make sure we're sized exactly right
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ done = true;
+ }
+@@ -71,18 +71,13 @@ bool ProcessIterator::CheckForNextProcess() {
+ for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) {
+ size_t length;
+ struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_];
+- int mib[] = { CTL_KERN, KERN_PROC_ARGS, kinfo.ki_pid };
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, kinfo.ki_pid };
+
+ if ((kinfo.ki_pid > 0) && (kinfo.ki_stat == SZOMB))
+ continue;
+
+- length = 0;
+- if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) {
+- LOG(ERROR) << "failed to figure out the buffer size for a command line";
+- continue;
+- }
+-
+- data.resize(length);
++ data.resize(ARG_MAX);
++ length = ARG_MAX;
+
+ if (sysctl(mib, std::size(mib), &data[0], &length, NULL, 0) < 0) {
+ LOG(ERROR) << "failed to fetch a commandline";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__iterator__openbsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__iterator__openbsd.cc
@@ -0,0 +1,45 @@
+--- src/3rdparty/chromium/base/process/process_iterator_openbsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_iterator_openbsd.cc
+@@ -6,6 +6,9 @@
+
+ #include <errno.h>
+ #include <stddef.h>
++#include <unistd.h>
++#include <sys/param.h>
++#include <sys/proc.h>
+ #include <sys/sysctl.h>
+
+ #include "base/logging.h"
+@@ -18,12 +21,13 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ : index_of_kinfo_proc_(),
+ filter_(filter) {
+
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid(),
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, static_cast<int>(getuid()),
+ sizeof(struct kinfo_proc), 0 };
+
+ bool done = false;
+ int try_num = 1;
+ const int max_tries = 10;
++ size_t num_of_kinfo_proc;
+
+ do {
+ size_t len = 0;
+@@ -32,7 +36,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ kinfo_procs_.resize(0);
+ done = true;
+ } else {
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ // Leave some spare room for process table growth (more could show up
+ // between when we check and now)
+ num_of_kinfo_proc += 16;
+@@ -48,7 +52,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ }
+ } else {
+ // Got the list, just make sure we're sized exactly right
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ done = true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics.h
@@ -0,0 +1,119 @@
+--- src/3rdparty/chromium/base/process/process_metrics.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_metrics.h
+@@ -36,7 +36,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ #include <string>
+ #include <utility>
+ #include <vector>
+@@ -52,7 +52,7 @@ struct IoCounters;
+ // Full declaration is in process_metrics_iocounters.h.
+ struct IoCounters;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Minor and major page fault counts since the process creation.
+ // Both counts are process-wide, and exclude child processes.
+ //
+@@ -107,7 +107,7 @@ class BASE_EXPORT ProcessMetrics {
+ // convenience wrapper for CreateProcessMetrics().
+ static std::unique_ptr<ProcessMetrics> CreateCurrentProcessMetrics();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Resident Set Size is a Linux/Android specific memory concept. Do not
+ // attempt to extend this to other platforms.
+ BASE_EXPORT size_t GetResidentSetSize() const;
+@@ -155,7 +155,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif // BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // Emits the cumulative CPU usage for all currently active threads since they
+ // were started into the output parameter (replacing its current contents).
+ // Threads that have already terminated will not be reported. Thus, the sum of
+@@ -238,7 +238,7 @@ class BASE_EXPORT ProcessMetrics {
+ int GetOpenFdSoftLimit() const;
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Bytes of swap as reported by /proc/[pid]/status.
+ uint64_t GetVmSwapBytes() const;
+
+@@ -259,7 +259,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif // !BUILDFLAG(IS_MAC)
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups);
+ #endif
+ #if BUILDFLAG(IS_APPLE)
+@@ -270,7 +270,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ CPU::CoreType GetCoreType(int core_index);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX)
+@@ -294,7 +294,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // Same thing for idle wakeups.
+ TimeTicks last_idle_wakeups_time_;
+ uint64_t last_absolute_idle_wakeups_;
+@@ -337,7 +337,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Data about system-wide memory consumption. Values are in KB. Available on
+ // Windows, Mac, Linux, Android and Chrome OS.
+ //
+@@ -372,7 +372,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // This provides an estimate of available memory as described here:
+ // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
+ // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
+@@ -387,7 +387,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ int buffers = 0;
+ int cached = 0;
+ int active_anon = 0;
+@@ -424,7 +424,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK
+ // BUILDFLAG(IS_FUCHSIA)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // Parse the data found in /proc/<pid>/stat and return the sum of the
+ // CPU-related ticks. Returns -1 on parse error.
+ // Exposed for testing.
+@@ -611,7 +611,7 @@ class BASE_EXPORT SystemMetrics {
+ FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics);
+
+ size_t committed_memory_;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ SystemMemoryInfoKB memory_info_;
+ VmStatInfo vmstat_info_;
+ SystemDiskInfo disk_info_;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics.cc
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/base/process/process_metrics.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_metrics.cc
+@@ -18,7 +18,7 @@ namespace {
+ namespace {
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int CalculateEventsPerSecond(uint64_t event_count,
+ uint64_t* last_event_count,
+ base::TimeTicks* last_calculated) {
+@@ -55,7 +55,7 @@ SystemMetrics SystemMetrics::Sample() {
+ SystemMetrics system_metrics;
+
+ system_metrics.committed_memory_ = GetSystemCommitCharge();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ GetSystemMemoryInfo(&system_metrics.memory_info_);
+ GetVmStatInfo(&system_metrics.vmstat_info_);
+ GetSystemDiskInfo(&system_metrics.disk_info_);
+@@ -74,7 +74,7 @@ Value SystemMetrics::ToValue() const {
+ Value res(Value::Type::DICTIONARY);
+
+ res.SetIntKey("committed_memory", static_cast<int>(committed_memory_));
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ Value meminfo = memory_info_.ToValue();
+ Value vmstat = vmstat_info_.ToValue();
+ meminfo.MergeDictionary(&vmstat);
+@@ -100,7 +100,7 @@ std::unique_ptr<ProcessMetrics> ProcessMetrics::Create
+ #endif // !BUILDFLAG(IS_MAC)
+ }
+
+-#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX)
++#if !BUILDFLAG(IS_BSD) || !BUILDFLAG(IS_POSIX)
+ double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+ TimeDelta cumulative_cpu = GetCumulativeCPUUsage();
+ TimeTicks time = TimeTicks::Now();
+@@ -151,7 +151,7 @@ double ProcessMetrics::GetPreciseCPUUsage() {
+ #endif // BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int ProcessMetrics::CalculateIdleWakeupsPerSecond(
+ uint64_t absolute_idle_wakeups) {
+ return CalculateEventsPerSecond(absolute_idle_wakeups,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics__freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics__freebsd.cc
@@ -0,0 +1,290 @@
+--- src/3rdparty/chromium/base/process/process_metrics_freebsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_metrics_freebsd.cc
+@@ -3,20 +3,39 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_metrics.h"
++#include "base/notreached.h"
+
+ #include <stddef.h>
++#include <sys/types.h>
+ #include <sys/sysctl.h>
+ #include <sys/user.h>
+ #include <unistd.h>
+
++#include <fcntl.h> /* O_RDONLY */
++#include <kvm.h>
++#include <libutil.h>
++
+ #include "base/memory/ptr_util.h"
+ #include "base/process/process_metrics_iocounters.h"
++#include "base/values.h"
+
+ namespace base {
++namespace {
++int GetPageShift() {
++ int pagesize = getpagesize();
++ int pageshift = 0;
+
++ while (pagesize > 1) {
++ pageshift++;
++ pagesize >>= 1;
++ }
++
++ return pageshift;
++}
++}
++
+ ProcessMetrics::ProcessMetrics(ProcessHandle process)
+- : process_(process),
+- last_cpu_(0) {}
++ : process_(process) {}
+
+ // static
+ std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+@@ -26,17 +45,18 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage(
+
+ double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+ struct kinfo_proc info;
+- int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_};
+- size_t length = sizeof(info);
++ size_t length = sizeof(struct kinfo_proc);
+
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ };
++
+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+- return 0;
++ return 0.0;
+
+- return (info.ki_pctcpu / FSCALE) * 100.0;
++ return static_cast<double>((info.ki_pctcpu * 100.0) / FSCALE);
+ }
+
+ TimeDelta ProcessMetrics::GetCumulativeCPUUsage() {
+- NOTREACHED();
++ NOTIMPLEMENTED();
+ return TimeDelta();
+ }
+
+@@ -67,4 +87,221 @@ size_t GetSystemCommitCharge() {
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
+ }
+
++int GetNumberOfThreads(ProcessHandle process) {
++ // Taken from FreeBSD top (usr.bin/top/machine.c)
++
++ kvm_t* kd = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open");
++ if (kd == NULL)
++ return 0;
++
++ struct kinfo_proc* pbase;
++ int nproc;
++ pbase = kvm_getprocs(kd, KERN_PROC_PID, process, &nproc);
++ if (pbase == NULL)
++ return 0;
++
++ if (kvm_close(kd) == -1)
++ return 0;
++
++ return nproc;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB *meminfo) {
++ unsigned int mem_total, mem_free, swap_total, swap_used;
++ size_t length;
++ int pagesizeKB;
++
++ pagesizeKB = getpagesize() / 1024;
++
++ length = sizeof(mem_total);
++ if (sysctlbyname("vm.stats.vm.v_page_count", &mem_total,
++ &length, NULL, 0) != 0 || length != sizeof(mem_total))
++ return false;
++
++ length = sizeof(mem_free);
++ if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &length, NULL, 0)
++ != 0 || length != sizeof(mem_free))
++ return false;
++
++ length = sizeof(swap_total);
++ if (sysctlbyname("vm.swap_size", &swap_total, &length, NULL, 0)
++ != 0 || length != sizeof(swap_total))
++ return false;
++
++ length = sizeof(swap_used);
++ if (sysctlbyname("vm.swap_anon_use", &swap_used, &length, NULL, 0)
++ != 0 || length != sizeof(swap_used))
++ return false;
++
++ meminfo->total = mem_total * pagesizeKB;
++ meminfo->free = mem_free * pagesizeKB;
++ meminfo->swap_total = swap_total * pagesizeKB;
++ meminfo->swap_free = (swap_total - swap_used) * pagesizeKB;
++
++ return true;
++}
++
++int ProcessMetrics::GetOpenFdCount() const {
++ struct kinfo_file * kif;
++ int cnt;
++
++ if ((kif = kinfo_getfile(process_, &cnt)) == NULL)
++ return -1;
++
++ free(kif);
++
++ return cnt;
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ size_t length;
++ int total_count = 0;
++ int mib[] = { CTL_KERN, KERN_MAXFILESPERPROC };
++
++ length = sizeof(total_count);
++
++ if (sysctl(mib, std::size(mib), &total_count, &length, NULL, 0) < 0) {
++ total_count = -1;
++ }
++
++ return total_count;
++}
++
++size_t ProcessMetrics::GetResidentSetSize() const {
++ kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open");
++
++ if (kd == nullptr)
++ return 0;
++
++ struct kinfo_proc *pp;
++ int nproc;
++
++ if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) {
++ kvm_close(kd);
++ return 0;
++ }
++
++ size_t rss;
++
++ if (nproc > 0) {
++ rss = pp->ki_rssize << GetPageShift();
++ } else {
++ rss = 0;
++ }
++
++ kvm_close(kd);
++ return rss;
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open");
++
++ if (kd == nullptr)
++ return 0;
++
++ struct kinfo_proc *pp;
++ int nproc;
++
++ if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) {
++ kvm_close(kd);
++ return 0;
++ }
++
++ size_t swrss;
++
++ if (nproc > 0) {
++ swrss = pp->ki_swrss > pp->ki_rssize
++ ? (pp->ki_swrss - pp->ki_rssize) << GetPageShift()
++ : 0;
++ } else {
++ swrss = 0;
++ }
++
++ kvm_close(kd);
++ return swrss;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default;
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value SystemDiskInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.SetDoubleKey("reads", static_cast<double>(reads));
++ res.SetDoubleKey("reads_merged", static_cast<double>(reads_merged));
++ res.SetDoubleKey("sectors_read", static_cast<double>(sectors_read));
++ res.SetDoubleKey("read_time", static_cast<double>(read_time));
++ res.SetDoubleKey("writes", static_cast<double>(writes));
++ res.SetDoubleKey("writes_merged", static_cast<double>(writes_merged));
++ res.SetDoubleKey("sectors_written", static_cast<double>(sectors_written));
++ res.SetDoubleKey("write_time", static_cast<double>(write_time));
++ res.SetDoubleKey("io", static_cast<double>(io));
++ res.SetDoubleKey("io_time", static_cast<double>(io_time));
++ res.SetDoubleKey("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ return res;
++}
++
++Value SystemMemoryInfoKB::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ res.SetIntKey("total", total);
++ res.SetIntKey("free", free);
++ res.SetIntKey("available", available);
++ res.SetIntKey("buffers", buffers);
++ res.SetIntKey("cached", cached);
++ res.SetIntKey("active_anon", active_anon);
++ res.SetIntKey("inactive_anon", inactive_anon);
++ res.SetIntKey("active_file", active_file);
++ res.SetIntKey("inactive_file", inactive_file);
++ res.SetIntKey("swap_total", swap_total);
++ res.SetIntKey("swap_free", swap_free);
++ res.SetIntKey("swap_used", swap_total - swap_free);
++ res.SetIntKey("dirty", dirty);
++ res.SetIntKey("reclaimable", reclaimable);
++
++ return res;
++}
++
++Value VmStatInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ res.SetIntKey("pswpin", pswpin);
++ res.SetIntKey("pswpout", pswpout);
++ res.SetIntKey("pgmajfault", pgmajfault);
++
++ return res;
++}
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics__openbsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics__openbsd.cc
@@ -0,0 +1,212 @@
+--- src/3rdparty/chromium/base/process/process_metrics_openbsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_metrics_openbsd.cc
+@@ -6,14 +6,23 @@
+
+ #include <stddef.h>
+ #include <stdint.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
++#include <sys/vmmeter.h>
+
++#include <kvm.h>
++
+ #include "base/memory/ptr_util.h"
+ #include "base/process/process_metrics_iocounters.h"
++#include "base/values.h"
++#include "base/notreached.h"
+
+ namespace base {
+
++ProcessMetrics::ProcessMetrics(ProcessHandle process)
++ : process_(process) {}
++
+ // static
+ std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+ ProcessHandle process) {
+@@ -24,49 +33,24 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun
+ return false;
+ }
+
+-static int GetProcessCPU(pid_t pid) {
++double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+ struct kinfo_proc info;
+- size_t length;
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
+- sizeof(struct kinfo_proc), 0 };
++ size_t length = sizeof(struct kinfo_proc);
+
+- if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0)
+- return -1;
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_,
++ sizeof(struct kinfo_proc), 1 };
+
+- mib[5] = (length / sizeof(struct kinfo_proc));
+-
+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+- return 0;
++ return 0.0;
+
+- return info.p_pctcpu;
++ return static_cast<double>((info.p_pctcpu * 100.0) / FSCALE);
+ }
+
+-double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+- TimeTicks time = TimeTicks::Now();
+-
+- if (last_cpu_time_.is_zero()) {
+- // First call, just set the last values.
+- last_cpu_time_ = time;
+- return 0;
+- }
+-
+- int cpu = GetProcessCPU(process_);
+-
+- last_cpu_time_ = time;
+- double percentage = static_cast<double>((cpu * 100.0) / FSCALE);
+-
+- return percentage;
+-}
+-
+ TimeDelta ProcessMetrics::GetCumulativeCPUUsage() {
+ NOTREACHED();
+ return TimeDelta();
+ }
+
+-ProcessMetrics::ProcessMetrics(ProcessHandle process)
+- : process_(process),
+- last_cpu_(0) {}
+-
+ size_t GetSystemCommitCharge() {
+ int mib[] = { CTL_VM, VM_METER };
+ int pagesize;
+@@ -84,6 +68,129 @@ size_t GetSystemCommitCharge() {
+ pagesize = getpagesize();
+
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
++}
++
++int ProcessMetrics::GetOpenFdCount() const {
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ int total_count = 0;
++ char errbuf[_POSIX2_LINE_MAX];
++
++ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL)
++ goto out;
++
++ if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, process_,
++ sizeof(struct kinfo_file), &total_count)) == NULL) {
++ total_count = 0;
++ goto out;
++ }
++
++ kvm_close(kd);
++
++out:
++ return total_count;
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ return GetMaxFds();
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
++ NOTIMPLEMENTED_LOG_ONCE();
++ return false;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default;
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++Value SystemMemoryInfoKB::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++ res.SetIntKey("total", total);
++ res.SetIntKey("free", free);
++ res.SetIntKey("available", available);
++ res.SetIntKey("buffers", buffers);
++ res.SetIntKey("cached", cached);
++ res.SetIntKey("active_anon", active_anon);
++ res.SetIntKey("inactive_anon", inactive_anon);
++ res.SetIntKey("active_file", active_file);
++ res.SetIntKey("inactive_file", inactive_file);
++ res.SetIntKey("swap_total", swap_total);
++ res.SetIntKey("swap_free", swap_free);
++ res.SetIntKey("swap_used", swap_total - swap_free);
++ res.SetIntKey("dirty", dirty);
++ res.SetIntKey("reclaimable", reclaimable);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++Value VmStatInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++ res.SetIntKey("pswpin", pswpin);
++ res.SetIntKey("pswpout", pswpout);
++ res.SetIntKey("pgmajfault", pgmajfault);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value SystemDiskInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.SetDoubleKey("reads", static_cast<double>(reads));
++ res.SetDoubleKey("reads_merged", static_cast<double>(reads_merged));
++ res.SetDoubleKey("sectors_read", static_cast<double>(sectors_read));
++ res.SetDoubleKey("read_time", static_cast<double>(read_time));
++ res.SetDoubleKey("writes", static_cast<double>(writes));
++ res.SetDoubleKey("writes_merged", static_cast<double>(writes_merged));
++ res.SetDoubleKey("sectors_written", static_cast<double>(sectors_written));
++ res.SetDoubleKey("write_time", static_cast<double>(write_time));
++ res.SetDoubleKey("io", static_cast<double>(io));
++ res.SetDoubleKey("io_time", static_cast<double>(io_time));
++ res.SetDoubleKey("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ NOTIMPLEMENTED();
++
++ return res;
+ }
+
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__metrics__posix.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/process/process_metrics_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_metrics_posix.cc
+@@ -20,6 +20,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif BUILDFLAG(IS_OPENBSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -133,7 +135,7 @@ size_t ProcessMetrics::GetMallocUsage() {
+ return stats.size_in_use;
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ return GetMallocUsageMallinfo();
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_process_process__posix.cc
@@ -0,0 +1,93 @@
+--- src/3rdparty/chromium/base/process/process_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/process/process_posix.cc
+@@ -25,10 +25,15 @@
+ #include "build/build_config.h"
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include <sys/event.h>
+ #endif
+
++#if defined(OS_BSD)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
++
+ #if BUILDFLAG(CLANG_PROFILING)
+ #include "base/test/clang_profiling.h"
+ #endif
+@@ -97,7 +102,7 @@ bool WaitpidWithTimeout(base::ProcessHandle handle,
+ return ret_pid > 0;
+ }
+
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Using kqueue on Mac so that we can wait on non-child processes.
+ // We can't use kqueues on child processes because we need to reap
+ // our own children using wait.
+@@ -202,7 +207,7 @@ bool WaitForExitWithTimeoutImpl(base::ProcessHandle ha
+ const bool exited = (parent_pid < 0);
+
+ if (!exited && parent_pid != our_pid) {
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // On Mac we can wait on non child processes.
+ return WaitForSingleNonChildProcess(handle, timeout);
+ #else
+@@ -358,7 +363,55 @@ int Process::GetPriority() const {
+
+ int Process::GetPriority() const {
+ DCHECK(IsValid());
++// avoid pledge(2) violation
++#if defined(OS_BSD)
++ return 0;
++#else
+ return getpriority(PRIO_PROCESS, process_);
++#endif
++}
++
++Time Process::CreationTime() const {
++// avoid ps pledge in the network process
++#if !defined(OS_BSD)
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(),
++ sizeof(struct kinfo_proc), 0 };
++ struct kinfo_proc *info = nullptr;
++ size_t info_size;
++#endif
++ Time ct = Time();
++
++#if !defined(OS_BSD)
++ if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0)
++ goto out;
++
++ mib[5] = (info_size / sizeof(struct kinfo_proc));
++ if ((info = reinterpret_cast<kinfo_proc*>(malloc(info_size))) == NULL)
++ goto out;
++
++ if (sysctl(mib, std::size(mib), info, &info_size, NULL, 0) < 0)
++ goto out;
++
++ ct = Time::FromTimeT(info->p_ustart_sec);
++
++out:
++ if (info)
++ free(info);
++#endif
++ return ct;
++}
++
++bool Process::IsProcessBackgrounded() const {
++ return false;
++}
++
++bool Process::SetProcessBackgrounded(bool value) {
++ return false;
++}
++
++// static
++bool Process::CanBackgroundProcesses() {
++ return false;
+ }
+
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_profiler_stack__sampling__profiler__test__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_profiler_stack__sampling__profiler__test__util.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/profiler/stack_sampling_profiler_test_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/profiler/stack_sampling_profiler_test_util.cc
+@@ -39,7 +39,7 @@
+ // Fortunately, it provides _alloca, which functions identically.
+ #include <malloc.h>
+ #define alloca _alloca
+-#else
++#elif !BUILDFLAG(IS_BSD)
+ #include <alloca.h>
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_rand__util.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_rand__util.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/rand_util.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/rand_util.h
+@@ -81,7 +81,7 @@ void RandomShuffle(Itr first, Itr last) {
+ std::shuffle(first, last, RandomBitGenerator());
+ }
+
+-#if BUILDFLAG(IS_POSIX)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_OPENBSD)
+ BASE_EXPORT int GetUrandomFD();
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_rand__util__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_rand__util__posix.cc
@@ -0,0 +1,52 @@
+--- src/3rdparty/chromium/base/rand_util_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/rand_util_posix.cc
+@@ -17,7 +17,7 @@
+ #include "base/posix/eintr_wrapper.h"
+ #include "build/build_config.h"
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ #include "third_party/lss/linux_syscall_support.h"
+ #elif BUILDFLAG(IS_MAC)
+ // TODO(crbug.com/995996): Waiting for this header to appear in the iOS SDK.
+@@ -34,6 +34,7 @@ static constexpr int kOpenFlags = O_RDONLY | O_CLOEXEC
+ static constexpr int kOpenFlags = O_RDONLY | O_CLOEXEC;
+ #endif
+
++#if !BUILDFLAG(IS_OPENBSD)
+ // We keep the file descriptor for /dev/urandom around so we don't need to
+ // reopen it (which is expensive), and since we may not even be able to reopen
+ // it if we are later put in a sandbox. This class wraps the file descriptor so
+@@ -51,6 +52,7 @@ class URandomFd {
+ private:
+ const int fd_;
+ };
++#endif
+
+ } // namespace
+
+@@ -62,6 +64,7 @@ void RandBytes(void* output, size_t output_length) {
+ // (https://chromium-review.googlesource.com/c/chromium/src/+/1545096) and land
+ // it or some form of it.
+ void RandBytes(void* output, size_t output_length) {
++#if !BUILDFLAG(IS_OPENBSD)
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL)
+ // We have to call `getrandom` via Linux Syscall Support, rather than through
+ // the libc wrapper, because we might not have an up-to-date libc (e.g. on
+@@ -93,11 +96,16 @@ void RandBytes(void* output, size_t output_length) {
+ const bool success =
+ ReadFromFD(urandom_fd, static_cast<char*>(output), output_length);
+ CHECK(success);
++#else
++ arc4random_buf(static_cast<char*>(output), output_length);
++#endif
+ }
+
++#if !BUILDFLAG(IS_OPENBSD)
+ int GetUrandomFD() {
+ static NoDestructor<URandomFd> urandom_fd;
+ return urandom_fd->fd();
+ }
++#endif
+
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_synchronization_lock__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_synchronization_lock__impl.h
@@ -0,0 +1,23 @@
+--- src/3rdparty/chromium/base/synchronization/lock_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/synchronization/lock_impl.h
+@@ -106,6 +106,10 @@ void LockImpl::Unlock() {
+ }
+
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FREEBSD)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
++#endif
+
+ #if DCHECK_IS_ON()
+ BASE_EXPORT void dcheck_trylock_result(int rv);
+@@ -126,6 +130,9 @@ void LockImpl::Unlock() {
+ dcheck_unlock_result(rv);
+ #endif
+ }
++#if BUILDFLAG(IS_FREEBSD)
++#pragma GCC diagnostic pop
++#endif
+ #endif
+
+ // This is an implementation used for AutoLock templated on the lock type.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_syslog__logging.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_syslog__logging.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/syslog_logging.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/syslog_logging.cc
+@@ -15,7 +15,7 @@
+ #include "base/strings/string_util.h"
+ #include "base/win/scoped_handle.h"
+ #include "base/win/win_util.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // <syslog.h> defines LOG_INFO, LOG_WARNING macros that could conflict with
+ // base::LOG_INFO, base::LOG_WARNING.
+ #include <syslog.h>
+@@ -147,7 +147,7 @@ EventLogMessage::~EventLogMessage() {
+
+ if (user_sid != nullptr)
+ ::LocalFree(user_sid);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kEventSource[] = "chrome";
+ openlog(kEventSource, LOG_NOWAIT | LOG_PID, LOG_USER);
+ // We can't use the defined names for the logging severity from syslog.h
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/system/sys_info.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/system/sys_info.h
+@@ -212,6 +212,8 @@ class BASE_EXPORT SysInfo {
+ // On Desktop this returns true when memory <= 2GB.
+ static bool IsLowEndDevice();
+
++ static uint64_t MaxSharedMemorySize();
++
+ private:
+ FRIEND_TEST_ALL_PREFIXES(SysInfoTest, AmountOfAvailablePhysicalMemory);
+ FRIEND_TEST_ALL_PREFIXES(debug::SystemMetricsTest, ParseMeminfo);
+@@ -222,7 +224,7 @@ class BASE_EXPORT SysInfo {
+ static HardwareInfo GetHardwareInfoSync();
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ static int64_t AmountOfAvailablePhysicalMemory(
+ const SystemMemoryInfoKB& meminfo);
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/system/sys_info.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/system/sys_info.cc
+@@ -104,7 +104,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallback<void(
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, {}, base::BindOnce(&GetHardwareInfoSync), std::move(callback));
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, {base::MayBlock()}, base::BindOnce(&GetHardwareInfoSync),
+ std::move(callback));
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info__freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info__freebsd.cc
@@ -0,0 +1,113 @@
+--- src/3rdparty/chromium/base/system/sys_info_freebsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/system/sys_info_freebsd.cc
+@@ -9,30 +9,106 @@
+ #include <sys/sysctl.h>
+
+ #include "base/notreached.h"
++#include "base/process/process_metrics.h"
++#include "base/strings/string_util.h"
+
+ namespace base {
+
++int SysInfo::NumberOfProcessors() {
++ int mib[] = {CTL_HW, HW_NCPU};
++ int ncpu;
++ size_t size = sizeof(ncpu);
++ if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) {
++ NOTREACHED();
++ return 1;
++ }
++ return ncpu;
++}
++
+ int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+- int pages, page_size;
++ int pages, page_size, r = 0;
+ size_t size = sizeof(pages);
+- sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
+- sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
+- if (pages == -1 || page_size == -1) {
++
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
++
++ if (r == -1) {
+ NOTREACHED();
+ return 0;
+ }
++
+ return static_cast<int64_t>(pages) * page_size;
+ }
+
++int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
++ int page_size, r = 0;
++ unsigned int pgfree, pginact, pgcache;
++ size_t size = sizeof(page_size);
++ size_t szpg = sizeof(pgfree);
++
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_free_count", &pgfree, &szpg, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_inactive_count", &pginact, &szpg, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_cache_count", &pgcache, &szpg, NULL, 0);
++
++ if (r == -1) {
++ NOTREACHED();
++ return 0;
++ }
++
++ return static_cast<int64_t>((pgfree + pginact + pgcache) * page_size);
++}
++
+ // static
++int64_t SysInfo::AmountOfAvailablePhysicalMemory(const SystemMemoryInfoKB& info) {
++ int64_t res_kb = info.available != 0
++ ? info.available - info.active_file
++ : info.free + info.reclaimable + info.inactive_file;
++ return res_kb * 1024;
++}
++
++// static
++std::string SysInfo::CPUModelName() {
++ int mib[] = { CTL_HW, HW_MODEL };
++ char name[256];
++ size_t size = std::size(name);
++
++ if (sysctl(mib, std::size(mib), &name, &size, NULL, 0) == 0) {
++ return name;
++ }
++
++ return std::string();
++}
++
++// static
+ uint64_t SysInfo::MaxSharedMemorySize() {
+ size_t limit;
+ size_t size = sizeof(limit);
++
+ if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ return 0;
+ }
++
+ return static_cast<uint64_t>(limit);
++}
++
++SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
++ HardwareInfo info;
++
++ info.manufacturer = "FreeBSD";
++ info.model = HardwareModelName();
++
++ DCHECK(IsStringUTF8(info.manufacturer));
++ DCHECK(IsStringUTF8(info.model));
++
++ return info;
+ }
+
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info__openbsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info__openbsd.cc
@@ -0,0 +1,94 @@
+--- src/3rdparty/chromium/base/system/sys_info_openbsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/system/sys_info_openbsd.cc
+@@ -11,6 +11,7 @@
+ #include <sys/sysctl.h>
+
+ #include "base/notreached.h"
++#include "base/strings/string_util.h"
+
+ namespace {
+
+@@ -28,9 +29,15 @@ namespace base {
+
+ namespace base {
+
++// pledge(2)
++int64_t aofpmem = 0;
++int64_t aofapmem = 0;
++int64_t shmmax = 0;
++char cpumodel[256];
++
+ // static
+ int SysInfo::NumberOfProcessors() {
+- int mib[] = {CTL_HW, HW_NCPU};
++ int mib[] = {CTL_HW, HW_NCPUONLINE};
+ int ncpu;
+ size_t size = sizeof(ncpu);
+ if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) {
+@@ -42,10 +49,26 @@ int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+
+ // static
+ int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+- return AmountOfMemory(_SC_PHYS_PAGES);
++ // pledge(2)
++ if (!aofpmem)
++ aofpmem = AmountOfMemory(_SC_PHYS_PAGES);
++ return aofpmem;
+ }
+
+ // static
++std::string SysInfo::CPUModelName() {
++ int mib[] = {CTL_HW, HW_MODEL};
++ size_t len = std::size(cpumodel);
++
++ if (cpumodel[0] == '\0') {
++ if (sysctl(mib, std::size(mib), cpumodel, &len, NULL, 0) < 0)
++ return std::string();
++ }
++
++ return std::string(cpumodel, len - 1);
++}
++
++// static
+ int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
+ // We should add inactive file-backed memory also but there is no such
+ // information from OpenBSD unfortunately.
+@@ -57,23 +80,28 @@ uint64_t SysInfo::MaxSharedMemorySize() {
+ int mib[] = {CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX};
+ size_t limit;
+ size_t size = sizeof(limit);
++ // pledge(2)
++ if (shmmax)
++ goto out;
+ if (sysctl(mib, std::size(mib), &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ return 0;
+ }
+- return static_cast<uint64_t>(limit);
++ shmmax = static_cast<uint64_t>(limit);
++out:
++ return shmmax;
+ }
+
+ // static
+-std::string SysInfo::CPUModelName() {
+- int mib[] = {CTL_HW, HW_MODEL};
+- char name[256];
+- size_t len = std::size(name);
+- if (sysctl(mib, std::size(mib), name, &len, NULL, 0) < 0) {
+- NOTREACHED();
+- return std::string();
+- }
+- return name;
++SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
++ HardwareInfo info;
++ // Set the manufacturer to "OpenBSD" and the model to
++ // an empty string.
++ info.manufacturer = "OpenBSD";
++ info.model = HardwareModelName();
++ DCHECK(IsStringUTF8(info.manufacturer));
++ DCHECK(IsStringUTF8(info.model));
++ return info;
+ }
+
+ } // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_system_sys__info__posix.cc
@@ -0,0 +1,43 @@
+--- src/3rdparty/chromium/base/system/sys_info_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/system/sys_info_posix.cc
+@@ -37,7 +37,7 @@ namespace {
+
+ namespace {
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ int NumberOfProcessors() {
+ // sysconf returns the number of "logical" (not "physical") processors on both
+ // Mac and Linux. So we get the number of max available "logical" processors.
+@@ -77,7 +77,7 @@ base::LazyInstance<base::internal::LazySysInfoValue<in
+
+ base::LazyInstance<base::internal::LazySysInfoValue<int, NumberOfProcessors>>::
+ Leaky g_lazy_number_of_processors = LAZY_INSTANCE_INITIALIZER;
+-#endif // !BUILDFLAG(IS_OPENBSD)
++#endif // !BUILDFLAG(IS_BSD)
+
+ int64_t AmountOfVirtualMemory() {
+ struct rlimit limit;
+@@ -143,11 +143,11 @@ namespace base {
+
+ namespace base {
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ int SysInfo::NumberOfProcessors() {
+ return g_lazy_number_of_processors.Get().value();
+ }
+-#endif // !BUILDFLAG(IS_OPENBSD)
++#endif // !BUILDFLAG(IS_BSD)
+
+ // static
+ int64_t SysInfo::AmountOfVirtualMemory() {
+@@ -239,6 +239,8 @@ std::string SysInfo::OperatingSystemArchitecture() {
+ arch = "x86";
+ } else if (arch == "amd64") {
+ arch = "x86_64";
++ } else if (arch == "arm64") {
++ arch = "aarch64";
+ } else if (std::string(info.sysname) == "AIX") {
+ arch = "ppc64";
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_test_test__file__util__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_test_test__file__util__linux.cc
@@ -0,0 +1,13 @@
+--- src/3rdparty/chromium/base/test/test_file_util_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/test/test_file_util_linux.cc
+@@ -54,8 +54,10 @@ bool EvictFileFromSystemCache(const FilePath& file) {
+ return false;
+ if (fdatasync(fd.get()) != 0)
+ return false;
++#if !defined(OS_BSD)
+ if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0)
+ return false;
++#endif
+ return true;
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_test_test__file__util__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_test_test__file__util__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/test/test_file_util_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/test/test_file_util_posix.cc
+@@ -88,7 +88,7 @@ void SyncPageCacheToDisk() {
+ }
+
+ #if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_APPLE) && \
+- !BUILDFLAG(IS_ANDROID)
++ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD)
+ bool EvictFileFromSystemCache(const FilePath& file) {
+ // There doesn't seem to be a POSIX way to cool the disk cache.
+ NOTIMPLEMENTED();
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_third__party_libevent_event.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_third__party_libevent_event.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/base/third_party/libevent/event.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/third_party/libevent/event.h
+@@ -1,3 +1,6 @@
++#if defined(USE_SYSTEM_LIBEVENT)
++#include <event.h>
++#else
+ /*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+@@ -1210,3 +1213,4 @@ int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev
+ #endif
+
+ #endif /* _EVENT_H_ */
++#endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_third__party_symbolize_symbolize.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_third__party_symbolize_symbolize.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/third_party/symbolize/symbolize.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/third_party/symbolize/symbolize.cc
+@@ -114,7 +114,7 @@ _END_GOOGLE_NAMESPACE_
+ #if defined(HAVE_DLFCN_H)
+ #include <dlfcn.h>
+ #endif
+-#if BUILDFLAG(IS_OPENBSD)
++#if defined(__OpenBSD__)
+ #include <sys/exec_elf.h>
+ #else
+ #include <elf.h>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/threading/platform_thread.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/threading/platform_thread.h
+@@ -211,7 +211,7 @@ class BASE_EXPORT PlatformThread {
+ // Returns a realtime period provided by `delegate`.
+ static TimeDelta GetRealtimePeriod(Delegate* delegate);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Toggles a specific thread's priority at runtime. This can be used to
+ // change the priority of a thread in a different process and will fail
+ // if the calling process does not have proper permissions. The
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__linux.cc
@@ -0,0 +1,77 @@
+--- src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/threading/platform_thread_linux.cc
+@@ -30,7 +30,9 @@
+
+ #if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX)
+ #include <pthread.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/resource.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+@@ -133,7 +135,7 @@ int sched_setattr(pid_t pid,
+ #endif // !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX)
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ const FilePath::CharType kCgroupDirectory[] =
+ FILE_PATH_LITERAL("/sys/fs/cgroup");
+
+@@ -287,7 +289,7 @@ namespace {
+ namespace internal {
+
+ namespace {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ const struct sched_param kRealTimePrio = {8};
+ #endif
+ } // namespace
+@@ -300,7 +302,7 @@ bool CanSetThreadPriorityToRealtimeAudio() {
+ };
+
+ bool CanSetThreadPriorityToRealtimeAudio() {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ // A non-zero soft-limit on RLIMIT_RTPRIO is required to be allowed to invoke
+ // pthread_setschedparam in SetCurrentThreadPriorityForPlatform().
+ struct rlimit rlim;
+@@ -311,7 +313,7 @@ bool SetCurrentThreadPriorityForPlatform(ThreadPriorit
+ }
+
+ bool SetCurrentThreadPriorityForPlatform(ThreadPriority priority) {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ // For legacy schedtune interface
+ SetThreadCgroupsForThreadPriority(PlatformThread::CurrentId(), priority);
+
+@@ -329,7 +331,7 @@ absl::optional<ThreadPriority> GetCurrentThreadPriorit
+ }
+
+ absl::optional<ThreadPriority> GetCurrentThreadPriorityForPlatform() {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ int maybe_sched_rr = 0;
+ struct sched_param maybe_realtime_prio = {0};
+ if (pthread_getschedparam(pthread_self(), &maybe_sched_rr,
+@@ -348,7 +350,7 @@ void PlatformThread::SetName(const std::string& name)
+ void PlatformThread::SetName(const std::string& name) {
+ ThreadIdNameManager::GetInstance()->SetName(name);
+
+-#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) && !BUILDFLAG(IS_BSD)
+ // On linux we can get the thread names to show up in the debugger by setting
+ // the process name for the LWP. We don't want to do this for the main
+ // thread because that would rename the process, causing tools like killall
+@@ -378,8 +380,10 @@ void PlatformThread::SetThreadPriority(ProcessId proce
+ // priority.
+ CHECK_NE(thread_id, process_id);
+
++#if !BUILDFLAG(IS_BSD)
+ // For legacy schedtune interface
+ SetThreadCgroupsForThreadPriority(thread_id, priority);
++#endif
+
+ #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ // For upstream uclamp interface. We try both legacy (schedtune, as done
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__posix.cc
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/base/threading/platform_thread_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/threading/platform_thread_posix.cc
+@@ -76,7 +76,7 @@ void* ThreadFunc(void* params) {
+ if (!thread_params->joinable)
+ base::DisallowSingleton();
+
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+ internal::PCScan::NotifyThreadCreated(internal::GetStackPointer());
+ #endif
+@@ -365,6 +365,9 @@ void PlatformThread::SetCurrentThreadPriorityImpl(Thre
+ // static
+ void PlatformThread::SetCurrentThreadPriorityImpl(ThreadPriority priority) {
+ #if BUILDFLAG(IS_NACL)
++ NOTIMPLEMENTED();
++// avoid pledge(2) violation
++#elif BUILDFLAG(IS_BSD)
+ NOTIMPLEMENTED();
+ #else
+ if (internal::SetCurrentThreadPriorityForPlatform(priority))
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_thread__task__runner__handle.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_thread__task__runner__handle.cc
@@ -0,0 +1,26 @@
+--- src/3rdparty/chromium/base/threading/thread_task_runner_handle.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/threading/thread_task_runner_handle.cc
+@@ -8,6 +8,7 @@
+ #include <utility>
+
+ #include "base/bind.h"
++#include "base/callback_helpers.h"
+ #include "base/check_op.h"
+ #include "base/dcheck_is_on.h"
+ #include "base/lazy_instance.h"
+@@ -40,6 +41,7 @@ const scoped_refptr<SingleThreadTaskRunner>& ThreadTas
+ return current->task_runner_;
+ }
+
++#if defined(OS_BSD)
+ // static
+ bool ThreadTaskRunnerHandle::IsSet() {
+ return !!thread_task_runner_tls.Pointer()->Get();
+@@ -89,6 +91,7 @@ ThreadTaskRunnerHandleOverride::ThreadTaskRunnerHandle
+ std::make_unique<ScopedDisallowRunningRunLoop>();
+ }
+ }
++#endif
+
+ ThreadTaskRunnerHandleOverride::~ThreadTaskRunnerHandleOverride() {
+ if (task_runner_to_restore_) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_time_time.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_time_time.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/time/time.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/time/time.cc
+@@ -6,7 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // time.h is a widely included header and its size impacts build time.
+ // Try not to raise this limit unless necessary. See
+ // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_trace__event_malloc__dump__provider.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_trace__event_malloc__dump__provider.cc
@@ -0,0 +1,31 @@
+--- src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
+@@ -23,6 +23,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif defined(OS_BSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -174,7 +176,8 @@ void ReportAppleAllocStats(size_t* total_virtual_size,
+
+ #if (BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_ANDROID)) || \
+ (!BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !BUILDFLAG(IS_WIN) && \
+- !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_FUCHSIA))
++ !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_FUCHSIA) && \
++ !BUILDFLAG(IS_BSD))
+ void ReportMallinfoStats(ProcessMemoryDump* pmd,
+ size_t* total_virtual_size,
+ size_t* resident_size,
+@@ -339,6 +342,9 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDump
+ &allocated_objects_count);
+ #elif BUILDFLAG(IS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
++#elif defined(OS_BSD)
++ total_virtual_size = 0;
++ allocated_objects_size = 0;
+ #else
+ ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size,
+ &allocated_objects_size, &allocated_objects_count);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_trace__event_memory__dump__manager.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_trace__event_memory__dump__manager.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/trace_event/memory_dump_manager.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/trace_event/memory_dump_manager.cc
+@@ -82,7 +82,7 @@ const char* const MemoryDumpManager::kSystemAllocatorP
+ #if defined(MALLOC_MEMORY_TRACING_SUPPORTED)
+ MallocDumpProvider::kAllocatedObjects;
+ #else
+- nullptr;
++ "";
+ #endif
+
+ // static
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_trace__event_process__memory__dump.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_trace__event_process__memory__dump.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/base/trace_event/process_memory_dump.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/trace_event/process_memory_dump.cc
+@@ -105,7 +105,7 @@ absl::optional<size_t> ProcessMemoryDump::CountResiden
+ #if BUILDFLAG(IS_WIN)
+ std::unique_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> vec(
+ new PSAPI_WORKING_SET_EX_INFORMATION[max_vec_size]);
+-#elif BUILDFLAG(IS_APPLE)
++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<char[]> vec(new char[max_vec_size]);
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+ std::unique_ptr<unsigned char[]> vec(new unsigned char[max_vec_size]);
+@@ -130,7 +130,7 @@ absl::optional<size_t> ProcessMemoryDump::CountResiden
+
+ for (size_t i = 0; i < page_count; i++)
+ resident_page_count += vec[i].VirtualAttributes.Valid;
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+ #elif BUILDFLAG(IS_APPLE)
+ // mincore in MAC does not fail with EAGAIN.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_tracing_trace__time.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_tracing_trace__time.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/base/tracing/trace_time.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/tracing/trace_time.h
+@@ -12,7 +12,7 @@ namespace tracing {
+ namespace tracing {
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Linux, Android, and Fuchsia all use CLOCK_MONOTONIC. See crbug.com/166153
+ // about efforts to unify base::TimeTicks across all platforms.
+ constexpr perfetto::protos::pbzero::BuiltinClock kTraceClockId =
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_base_tracing_trace__time.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_base_tracing_trace__time.cc
@@ -0,0 +1,28 @@
+--- src/3rdparty/chromium/base/tracing/trace_time.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/base/tracing/trace_time.cc
+@@ -8,13 +8,17 @@
+ #include "build/build_config.h"
+ #include "third_party/perfetto/include/perfetto/base/time.h"
+
++#if BUILDFLAG(IS_FREEBSD)
++#define CLOCK_BOOTTIME CLOCK_UPTIME
++#endif
++
+ namespace base {
+ namespace tracing {
+
+ int64_t TraceBootTicksNow() {
+ // On Windows and Mac, TRACE_TIME_TICKS_NOW() behaves like boottime already.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ struct timespec ts;
+ int res = clock_gettime(CLOCK_BOOTTIME, &ts);
+ if (res != -1)
+@@ -24,4 +28,4 @@ int64_t TraceBootTicksNow() {
+ }
+
+ } // namespace tracing
+-} // namespace base
+\ No newline at end of file
++} // namespace base
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_BUILD.gn
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/build/config/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/BUILD.gn
+@@ -222,13 +222,17 @@ config("default_libs") {
+ "CoreText.framework",
+ "Foundation.framework",
+ ]
+- } else if (is_linux || is_chromeos) {
++ } else if ((is_linux && !is_bsd) || is_chromeos) {
+ libs = [
+ "dl",
+ "pthread",
+ "rt",
+ ]
+- }
++ } else if (is_bsd) {
++ libs = [
++ "pthread",
++ ]
++ }
+ }
+
+ group("common_deps") {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_BUILDCONFIG.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_BUILDCONFIG.gn
@@ -0,0 +1,45 @@
+--- src/3rdparty/chromium/build/config/BUILDCONFIG.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/BUILDCONFIG.gn
+@@ -136,7 +136,8 @@ declare_args() {
+ is_official_build = false
+
+ # Set to true when compiling with the Clang compiler.
+- is_clang = current_os != "linux" ||
++ is_clang = current_os != "linux" || current_os == "openbsd" ||
++ current_os == "freebsd" ||
+ (current_cpu != "s390x" && current_cpu != "s390" &&
+ current_cpu != "ppc64" && current_cpu != "ppc" &&
+ current_cpu != "mips" && current_cpu != "mips64" &&
+@@ -225,6 +226,10 @@ if (host_toolchain == "") {
+ host_toolchain = "//build/toolchain/aix:$host_cpu"
+ } else if (host_os == "zos") {
+ host_toolchain = "//build/toolchain/zos:$host_cpu"
++ } else if (host_os == "openbsd") {
++ host_toolchain = "//build/toolchain/openbsd:clang_$host_cpu"
++ } else if (host_os == "freebsd") {
++ host_toolchain = "//build/toolchain/freebsd:clang_$host_cpu"
+ } else {
+ assert(false, "Unsupported host_os: $host_os")
+ }
+@@ -269,6 +274,8 @@ if (target_os == "android") {
+ _default_toolchain = "//build/toolchain/aix:$target_cpu"
+ } else if (target_os == "zos") {
+ _default_toolchain = "//build/toolchain/zos:$target_cpu"
++} else if (target_os == "openbsd" || target_os == "freebsd") {
++ _default_toolchain = host_toolchain
+ } else {
+ assert(false, "Unsupported target_os: $target_os")
+ }
+@@ -303,7 +310,11 @@ is_ios = current_os == "ios"
+ is_chromeos = current_os == "chromeos"
+ is_fuchsia = current_os == "fuchsia"
+ is_ios = current_os == "ios"
+-is_linux = current_os == "linux"
++is_linux = current_os == "linux" || current_os == "openbsd" ||
++ current_os == "freebsd"
++is_openbsd = current_os == "openbsd"
++is_freebsd = current_os == "freebsd"
++is_bsd = current_os == "openbsd" || current_os == "freebsd"
+ is_mac = current_os == "mac"
+ is_nacl = current_os == "nacl"
+ is_win = current_os == "win" || current_os == "winuwp"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn
@@ -0,0 +1,94 @@
+--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/compiler/BUILD.gn
+@@ -237,13 +237,16 @@ config("no_unresolved_symbols") {
+ # Compiler instrumentation can introduce dependencies in DSOs to symbols in
+ # the executable they are loaded into, so they are unresolved at link-time.
+ config("no_unresolved_symbols") {
+- if (!using_sanitizer &&
++ if (!using_sanitizer && !is_bsd &&
+ (is_linux || is_chromeos || is_android || is_fuchsia)) {
+ ldflags = [
+ "-Wl,-z,defs",
+ "-Wl,--as-needed",
+ ]
+ }
++ if (current_cpu == "x86" && is_openbsd) {
++ ldflags = [ "-Wl,-z,notext" ]
++ }
+ }
+
+ # compiler ---------------------------------------------------------------------
+@@ -487,6 +490,10 @@ config("compiler") {
+ }
+ }
+
++ if (is_openbsd) {
++ ldflags += [ "-Wl,-z,wxneeded" ]
++ }
++
+ # Linux-specific compiler flags setup.
+ # ------------------------------------
+ if (use_gold) {
+@@ -952,7 +959,7 @@ config("compiler_cpu_abi") {
+ ]
+ }
+ } else if (current_cpu == "arm") {
+- if (is_clang && !is_android && !is_nacl) {
++ if (is_clang && !is_android && !is_nacl && !is_bsd) {
+ cflags += [ "--target=arm-linux-gnueabihf" ]
+ ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
+@@ -969,7 +976,7 @@ config("compiler_cpu_abi") {
+ cflags += [ "-mtune=$arm_tune" ]
+ }
+ } else if (current_cpu == "arm64") {
+- if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
++ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) {
+ cflags += [ "--target=aarch64-linux-gnu" ]
+ ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
+@@ -1290,7 +1297,7 @@ config("compiler_deterministic") {
+ # different build directory like "out/feature_a" and "out/feature_b" if
+ # we build same files with same compile flag.
+ # Other paths are already given in relative, no need to normalize them.
+- if (is_nacl) {
++ if (is_nacl || is_bsd) {
+ # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
+ cflags += [
+ "-Xclang",
+@@ -1745,7 +1752,7 @@ config("default_warnings") {
+ "-Wno-ignored-pragma-optimize",
+ ]
+
+- if (!is_nacl) {
++ if (!is_nacl && !is_bsd) {
+ # TODO(https://crbug.com/1300731) Clean up and enable.
+ cflags += [ "-Wno-unqualified-std-cast-call" ]
+
+@@ -1929,7 +1936,7 @@ config("no_chromium_code") {
+ # third-party libraries.
+ "-Wno-c++11-narrowing",
+ ]
+- if (!is_nacl) {
++ if (!is_nacl && !is_freebsd) {
+ cflags += [
+ # Disabled for similar reasons as -Wunused-variable.
+ "-Wno-unused-but-set-variable",
+@@ -2451,7 +2458,7 @@ config("afdo") {
+ # There are some targeted places that AFDO regresses, so we provide a separate
+ # config to allow AFDO to be disabled per-target.
+ config("afdo") {
+- if (is_clang) {
++ if (is_clang && !is_bsd) {
+ cflags = []
+ if (clang_emit_debug_info_for_profiling) {
+ # Add the following flags to generate debug info for profiling.
+@@ -2467,7 +2474,7 @@ config("afdo") {
+ cflags += [ "-fprofile-sample-use=${rebased_clang_sample_profile}" ]
+ inputs = [ _clang_sample_profile ]
+ }
+- } else if (auto_profile_path != "" && is_a_target_toolchain) {
++ } else if (auto_profile_path != "" && is_a_target_toolchain && !is_bsd) {
+ cflags = [ "-fauto-profile=${auto_profile_path}" ]
+ inputs = [ auto_profile_path ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_pgo_pgo.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_pgo_pgo.gni
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/build/config/compiler/pgo/pgo.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/compiler/pgo/pgo.gni
+@@ -16,7 +16,7 @@ declare_args() {
+ # TODO(crbug.com/1052397): Remove chromeos_is_browser_only once
+ # target_os switch for lacros-chrome is completed.
+ (is_win || is_mac ||
+- (is_linux && !chromeos_is_browser_only && !is_chromecast))) {
++ (is_linux && !chromeos_is_browser_only && !is_chromecast && !is_bsd))) {
+ chrome_pgo_phase = 2
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_linux_pkg-config.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_linux_pkg-config.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/build/config/linux/pkg-config.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/linux/pkg-config.py
+@@ -109,7 +109,7 @@ def main():
+ # If this is run on non-Linux platforms, just return nothing and indicate
+ # success. This allows us to "kind of emulate" a Linux build from other
+ # platforms.
+- if "linux" not in sys.platform:
++ if not sys.platform.startswith(tuple(['linux', 'openbsd', 'freebsd'])):
+ print("[[],[],[],[],[]]")
+ return 0
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_ozone.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_ozone.gni
@@ -0,0 +1,19 @@
+--- src/3rdparty/chromium/build/config/ozone.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/ozone.gni
+@@ -94,7 +94,15 @@ declare_args() {
+ } else if (is_chromeos_lacros) {
+ ozone_platform = "wayland"
+ ozone_platform_wayland = true
+- } else if (is_linux) {
++ } else if (is_linux && !is_bsd) {
++ ozone_platform = "x11"
++ ozone_platform_wayland = true
++ ozone_platform_x11 = true
++ } else if (is_openbsd) {
++ ozone_platform = "x11"
++ ozone_platform_wayland = false
++ ozone_platform_x11 = true
++ } else if (is_freebsd) {
+ ozone_platform = "x11"
+ ozone_platform_wayland = true
+ ozone_platform_x11 = true
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_rust.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_rust.gni
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/build/config/rust.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/rust.gni
+@@ -116,7 +116,7 @@ if (enable_rust) {
+ rust_sysroot = "//third_party/rust-toolchain"
+ use_unverified_rust_toolchain = false
+ } else {
+- if (host_os != "linux") {
++ if (host_os != "linux" && host_os != "openbsd" && host_os != "freebsd") {
+ assert(false,
+ "Attempt to use Android Rust toolchain on an unsupported platform")
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_v8__target__cpu.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_config_v8__target__cpu.gni
@@ -0,0 +1,13 @@
+--- src/3rdparty/chromium/build/config/v8_target_cpu.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/config/v8_target_cpu.gni
+@@ -36,6 +36,10 @@ if (v8_target_cpu == "") {
+ if (v8_target_cpu == "") {
+ if (current_toolchain == "//build/toolchain/linux:clang_x64_v8_arm64") {
+ v8_target_cpu = "arm64"
++ } else if (current_toolchain == "//build/toolchain/openbsd:clang_arm64") {
++ v8_target_cpu = "arm64"
++ } else if (current_toolchain == "//build/toolchain/freebsd:clang_arm64") {
++ v8_target_cpu = "arm64"
+ } else if (current_toolchain == "//build/toolchain/linux:clang_x86_v8_arm") {
+ v8_target_cpu = "arm"
+ } else if (current_toolchain ==
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_detect__host__arch.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_detect__host__arch.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/build/detect_host_arch.py.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/build/detect_host_arch.py
+@@ -21,6 +21,8 @@ def HostArch():
+ host_arch = 'ia32'
+ elif host_arch in ['x86_64', 'amd64']:
+ host_arch = 'x64'
++ elif host_arch.startswith('arm64'):
++ host_arch = 'arm64'
+ elif host_arch.startswith('arm'):
+ host_arch = 'arm'
+ elif host_arch.startswith('aarch64'):
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_gn__run__binary.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_gn__run__binary.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/build/gn_run_binary.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/gn_run_binary.py
+@@ -24,7 +24,7 @@ args = [path] + sys.argv[2:]
+ # The rest of the arguments are passed directly to the executable.
+ args = [path] + sys.argv[2:]
+
+-ret = subprocess.call(args)
++ret = subprocess.call(args, env={"CHROME_EXE_PATH":"${WRKSRC}/out/Release/chrome","LD_LIBRARY_PATH":"${WRKSRC}/out/Release"})
+ if ret != 0:
+ if ret <= -100:
+ # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier to
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_chrome.map
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_chrome.map
@@ -0,0 +1,13 @@
+--- src/3rdparty/chromium/build/linux/chrome.map.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/linux/chrome.map
+@@ -20,6 +20,10 @@ global:
+ # Program entry point.
+ _start;
+
++ # FreeBSD specific variables.
++ __progname;
++ environ;
++
+ # Memory allocation symbols. We want chrome and any libraries to
+ # share the same heap, so it is correct to export these symbols.
+ aligned_alloc;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_libpci_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_libpci_BUILD.gn
@@ -0,0 +1,53 @@
+--- src/3rdparty/chromium/build/linux/libpci/BUILD.gn.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/build/linux/libpci/BUILD.gn
+@@ -3,20 +3,36 @@ import("//tools/generate_library_loader/generate_libra
+ # found in the LICENSE file.
+
+ import("//tools/generate_library_loader/generate_library_loader.gni")
++import("//build/config/linux/pkg_config.gni")
+
+-# This generates a target named "libpci".
+-generate_library_loader("libpci") {
+- name = "LibPciLoader"
+- output_h = "libpci.h"
+- output_cc = "libpci_loader.cc"
+- header = "<pci/pci.h>"
++declare_args() {
++ use_system_libpci = is_bsd
++}
+
+- functions = [
+- "pci_alloc",
+- "pci_init",
+- "pci_cleanup",
+- "pci_scan_bus",
+- "pci_fill_info",
+- "pci_lookup_name",
+- ]
++if (use_system_libpci) {
++ pkg_config("system_libpci") {
++ packages = [ "libpci" ]
++ }
++
++ source_set("libpci") {
++ public_configs = [ ":system_libpci" ]
++ }
++
++} else {
++ # This generates a target named "libpci".
++ generate_library_loader("libpci") {
++ name = "LibPciLoader"
++ output_h = "libpci.h"
++ output_cc = "libpci_loader.cc"
++ header = "<pci/pci.h>"
++
++ functions = [
++ "pci_alloc",
++ "pci_init",
++ "pci_cleanup",
++ "pci_scan_bus",
++ "pci_fill_info",
++ "pci_lookup_name",
++ ]
++ }
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_strip__binary.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_strip__binary.gni
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/build/linux/strip_binary.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/linux/strip_binary.gni
+@@ -20,7 +20,11 @@ template("strip_binary") {
+ "testonly",
+ ])
+ action("${target_name}") {
+- eu_strip_binary = "//buildtools/third_party/eu-strip/bin/eu-strip"
++ if (is_bsd) {
++ eu_strip_binary = "//buildtools/freebsd/strip"
++ } else {
++ eu_strip_binary = "//buildtools/third_party/eu-strip/bin/eu-strip"
++ }
+ script = "//build/linux/strip_binary.py"
+
+ if (defined(invoker.stripped_binary_output)) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_strip__binary.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_strip__binary.py
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/build/linux/strip_binary.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/linux/strip_binary.py
+@@ -10,6 +10,7 @@ def main():
+
+
+ def main():
++ return 0
+ argparser = argparse.ArgumentParser(description='eu-strip binary.')
+
+ argparser.add_argument('--eu-strip-binary-path', help='eu-strip path.')
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_libevent.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_libevent.gn
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/build/linux/unbundle/libevent.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/linux/unbundle/libevent.gn
+@@ -9,7 +9,12 @@ shim_headers("libevent_shim") {
+ headers = [ "event.h" ]
+ }
+
++config("system_libevent") {
++ defines = [ "USE_SYSTEM_LIBEVENT=1" ]
++}
++
+ source_set("libevent") {
+ deps = [ ":libevent_shim" ]
+ libs = [ "event" ]
++ public_configs = [ ":system_libevent" ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_libusb.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_libusb.gn
@@ -0,0 +1,27 @@
+--- src/3rdparty/chromium/build/linux/unbundle/libusb.gn.orig 2022-11-06 11:50:49 UTC
++++ src/3rdparty/chromium/build/linux/unbundle/libusb.gn
+@@ -0,0 +1,24 @@
++# Copyright 2016 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/linux/pkg_config.gni")
++import("//build/shim_headers.gni")
++
++pkg_config("system_libusb") {
++ packages = [ "libusb-1.0" ]
++}
++
++shim_headers("libusb_shim") {
++ root_path = "src/libusb"
++ headers = [
++ "libusb.h",
++ ]
++}
++
++source_set("libusb") {
++ deps = [
++ ":libusb_shim",
++ ]
++ public_configs = [ ":system_libusb" ]
++}
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_libxml.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_libxml.gn
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/build/linux/unbundle/libxml.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/linux/unbundle/libxml.gn
+@@ -19,6 +19,7 @@ static_library("libxml_utils") {
+ ":xml_reader",
+ ":xml_writer",
+ "//base/test:test_support",
++ "//services/data_decoder:lib",
+ "//services/data_decoder:xml_parser_fuzzer_deps",
+ ]
+ sources = [
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_replace__gn__files.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_linux_unbundle_replace__gn__files.py
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/build/linux/unbundle/replace_gn_files.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/linux/unbundle/replace_gn_files.py
+@@ -25,6 +25,7 @@ REPLACEMENTS = {
+ 'libevent': 'base/third_party/libevent/BUILD.gn',
+ 'libjpeg': 'third_party/libjpeg.gni',
+ 'libpng': 'third_party/libpng/BUILD.gn',
++ 'libusb': 'third_party/libusb/BUILD.gn',
+ 'libvpx': 'third_party/libvpx/BUILD.gn',
+ 'libwebp': 'third_party/libwebp/BUILD.gn',
+ 'libxml': 'third_party/libxml/BUILD.gn',
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_toolchain_gcc__solink__wrapper.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_toolchain_gcc__solink__wrapper.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/build/toolchain/gcc_solink_wrapper.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/toolchain/gcc_solink_wrapper.py
+@@ -39,7 +39,7 @@ def CollectDynSym(args):
+ """Replaces: nm --format=posix -g -D -p $sofile | cut -f1-2 -d' '"""
+ toc = ''
+ nm = subprocess.Popen(wrapper_utils.CommandToRun(
+- [args.nm, '--format=posix', '-g', '-D', '-p', args.sofile]),
++ [args.nm, '-g', '-D', '-p', args.sofile]),
+ stdout=subprocess.PIPE,
+ bufsize=-1,
+ universal_newlines=True)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_build_toolchain_gcc__toolchain.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_build_toolchain_gcc__toolchain.gni
@@ -0,0 +1,35 @@
+--- src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni
+@@ -53,6 +53,13 @@ if (enable_resource_allowlist_generation) {
+ "enable_resource_allowlist_generation=true does not work for target_os=$target_os")
+ }
+
++declare_args() {
++ extra_cflags = ""
++ extra_cppflags = ""
++ extra_cxxflags = ""
++ extra_ldflags = ""
++}
++
+ # This template defines a toolchain for something that works like gcc
+ # (including clang).
+ #
+@@ -786,13 +793,12 @@ template("clang_toolchain") {
+ # use_gold too.
+ template("clang_toolchain") {
+ gcc_toolchain(target_name) {
+- prefix = rebase_path("$clang_base_path/bin", root_build_dir)
+- cc = "${prefix}/clang"
+- cxx = "${prefix}/clang++"
++ cc = "cc"
++ cxx = "c++"
+ ld = cxx
+- readelf = "${prefix}/llvm-readelf"
+- ar = "${prefix}/llvm-ar"
+- nm = "${prefix}/llvm-nm"
++ readelf = "readelf"
++ ar = "ar"
++ nm = "nm"
+
+ forward_variables_from(invoker,
+ [
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__event__log__uploader.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__event__log__uploader.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc
+@@ -42,7 +42,7 @@ const char kProduct[] = "Chrome_ChromeOS";
+ const char kProduct[] = "Chrome_Mac";
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ const char kProduct[] = "Chrome_ChromeOS";
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ const char kProduct[] = "Chrome_Linux";
+ #elif BUILDFLAG(IS_ANDROID)
+ const char kProduct[] = "Chrome_Android";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__log__uploader.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__log__uploader.cc
@@ -0,0 +1,13 @@
+--- src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_log_uploader.cc
+@@ -364,6 +364,10 @@ void WebRtcLogUploader::SetupMultipart(
+ const char product[] = "Chrome_ChromeOS";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ const char product[] = "Chrome_Fuchsia";
++#elif defined(OS_OPENBSD)
++ const char product[] = "Chrome_OpenBSD";
++#elif defined(OS_FREEBSD)
++ const char product[] = "Chrome_FreeBSD";
+ #else
+ #error Platform not supported.
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__logging__controller.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__logging__controller.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_logging_controller.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_logging_controller.h
+@@ -136,7 +136,7 @@ class WebRtcLoggingController
+ size_t web_app_id,
+ const StartEventLoggingCallback& callback);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Ensures that the WebRTC Logs directory exists and then grants render
+ // process access to the 'WebRTC Logs' directory, and invokes |callback| with
+ // the ids necessary to create a DirectoryEntry object.
+@@ -195,7 +195,7 @@ class WebRtcLoggingController
+ bool success,
+ const std::string& error_message);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Grants the render process access to the 'WebRTC Logs' directory, and
+ // invokes |callback| with the ids necessary to create a DirectoryEntry
+ // object. If the |logs_path| couldn't be created or found, |error_callback|
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__logging__controller.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_media_webrtc_webrtc__logging__controller.cc
@@ -0,0 +1,33 @@
+--- src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_logging_controller.cc
+@@ -24,10 +24,10 @@
+ #include "content/public/browser/browser_context.h"
+ #include "content/public/browser/render_process_host.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/public/browser/child_process_security_policy.h"
+ #include "storage/browser/file_system/isolated_context.h"
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ using webrtc_event_logging::WebRtcEventLogManager;
+
+@@ -282,7 +282,7 @@ void WebRtcLoggingController::StartEventLogging(
+ web_app_id, callback);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void WebRtcLoggingController::GetLogsDirectory(
+ LogsDirectoryCallback callback,
+ LogsDirectoryErrorCallback error_callback) {
+@@ -328,7 +328,7 @@ void WebRtcLoggingController::GrantLogsDirectoryAccess
+ FROM_HERE,
+ base::BindOnce(std::move(callback), file_system.id(), registered_name));
+ }
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ void WebRtcLoggingController::OnRtpPacket(
+ std::unique_ptr<uint8_t[]> packet_header,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc
@@ -0,0 +1,92 @@
+--- src/3rdparty/chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+@@ -310,7 +310,7 @@
+ #include "chrome/browser/ui/webui/app_launcher_page_ui.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/webui_js_error/webui_js_error_ui.h"
+ #endif
+
+@@ -335,17 +335,17 @@
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/discards/discards_ui.h"
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h"
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h"
+ #endif
+
+@@ -701,7 +701,7 @@ bool IsAboutUI(const GURL& url) {
+ #if !BUILDFLAG(IS_ANDROID)
+ || url.host_piece() == chrome::kChromeUITermsHost
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ || url.host_piece() == chrome::kChromeUILinuxProxyConfigHost
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -1131,7 +1131,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we
+ return &NewWebUI<ash::SampleSystemWebAppUI>;
+ #endif // !defined(OFFICIAL_BUILD)
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (url.host_piece() == chrome::kChromeUIWebUIJsErrorHost)
+ return &NewWebUI<WebUIJsErrorUI>;
+ #endif
+@@ -1189,7 +1189,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we
+ if (url.host_piece() == chrome::kChromeUINaClHost)
+ return &NewWebUI<NaClUI>;
+ #endif
+-#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ defined(TOOLKIT_VIEWS)) || \
+ defined(USE_AURA)
+ if (url.host_piece() == chrome::kChromeUITabModalConfirmDialogHost)
+@@ -1247,27 +1247,27 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we
+ }
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ if (url.host_piece() == chrome::kChromeUISandboxHost) {
+ return &NewWebUI<SandboxInternalsUI>;
+ }
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ if (url.host_piece() == chrome::kChromeUIConnectorsInternalsHost)
+ return &NewWebUI<enterprise_connectors::ConnectorsInternalsUI>;
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (url.host_piece() == chrome::kChromeUIDiscardsHost)
+ return &NewWebUI<DiscardsUI>;
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (url.host_piece() == chrome::kChromeUIBrowserSwitchHost)
+ return &NewWebUI<BrowserSwitchUI>;
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(features::kDesktopPWAsWebAppSettingsPage) &&
+ url.host_piece() == chrome::kChromeUIWebAppSettingsHost) {
+ return &NewWebUI<WebAppSettingsUI>;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_common_webui__url__constants.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_common_webui__url__constants.h
@@ -0,0 +1,57 @@
+--- src/3rdparty/chromium/chrome/common/webui_url_constants.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/common/webui_url_constants.h
+@@ -382,24 +382,24 @@ extern const char kOsUIVersionURL[];
+ extern const char kOsUIVersionURL[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kChromeUIWebUIJsErrorHost[];
+ extern const char kChromeUIWebUIJsErrorURL[];
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ extern const char kChromeUIConnectorsInternalsHost[];
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ extern const char kChromeUIDiscardsHost[];
+ extern const char kChromeUIDiscardsURL[];
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ extern const char kChromeUIWebAppSettingsURL[];
+ extern const char kChromeUIWebAppSettingsHost[];
+ #endif
+@@ -414,14 +414,14 @@ extern const char kChromeUILinuxProxyConfigHost[];
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ extern const char kChromeUISandboxHost[];
+ #endif
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ extern const char kChromeUIBrowserSwitchHost[];
+ extern const char kChromeUIBrowserSwitchURL[];
+ extern const char kChromeUIEnterpriseProfileWelcomeHost[];
+@@ -433,7 +433,7 @@ extern const char kChromeUIProfilePickerStartupQuery[]
+ extern const char kChromeUIProfilePickerStartupQuery[];
+ #endif
+
+-#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ defined(TOOLKIT_VIEWS)) || \
+ defined(USE_AURA)
+ extern const char kChromeUITabModalConfirmDialogHost[];
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_common_webui__url__constants.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_chrome_common_webui__url__constants.cc
@@ -0,0 +1,68 @@
+--- src/3rdparty/chromium/chrome/common/webui_url_constants.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/chrome/common/webui_url_constants.cc
+@@ -455,18 +455,18 @@ const char kOsUIVersionURL[] = "os://version";
+ const char kOsUIVersionURL[] = "os://version";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kChromeUIWebUIJsErrorHost[] = "webuijserror";
+ const char kChromeUIWebUIJsErrorURL[] = "chrome://webuijserror/";
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ const char kChromeUIConnectorsInternalsHost[] = "connectors-internals";
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kChromeUIDiscardsHost[] = "discards";
+ const char kChromeUIDiscardsURL[] = "chrome://discards/";
+ #endif
+@@ -481,14 +481,14 @@ const char kChromeUILinuxProxyConfigHost[] = "linux-pr
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ const char kChromeUISandboxHost[] = "sandbox";
+ #endif
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ const char kChromeUIBrowserSwitchHost[] = "browser-switch";
+ const char kChromeUIBrowserSwitchURL[] = "chrome://browser-switch/";
+ const char kChromeUIEnterpriseProfileWelcomeHost[] =
+@@ -503,7 +503,7 @@ const char kChromeUIProfilePickerStartupQuery[] = "sta
+ const char kChromeUIProfilePickerStartupQuery[] = "startup";
+ #endif
+
+-#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ defined(TOOLKIT_VIEWS)) || \
+ defined(USE_AURA)
+ const char kChromeUITabModalConfirmDialogHost[] = "tab-modal-confirm-dialog";
+@@ -578,7 +578,7 @@ const char kPrivacySandboxSubPagePath[] = "/privacySan
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ const char kChromeUIWebAppSettingsURL[] = "chrome://app-settings/";
+ const char kChromeUIWebAppSettingsHost[] = "app-settings";
+ #endif
+@@ -796,7 +796,7 @@ const char* const kChromeDebugURLs[] = {
+ blink::kChromeUIGpuJavaCrashURL,
+ kChromeUIJavaCrashURL,
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ kChromeUIWebUIJsErrorURL,
+ #endif
+ kChromeUIQuitURL,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_content_browser_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_content_browser_BUILD.gn
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/components/crash/content/browser/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/crash/content/browser/BUILD.gn
+@@ -21,7 +21,7 @@ source_set("browser") {
+ "//content/public/common",
+ ]
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux && !is_bsd) || is_chromeos || is_android) {
+ # Want this file on both Linux and Android.
+ sources += [
+ "crash_handler_host_linux.cc",
+@@ -37,7 +37,7 @@ source_set("browser") {
+
+ # This is not in the GYP build but this target includes breakpad client
+ # headers, so add the dependency here.
+- if ((is_posix && !is_ios) || is_fuchsia) {
++ if ((is_posix && !is_ios && !is_bsd) || is_fuchsia) {
+ configs += [ "//third_party/breakpad:client_config" ]
+ public_configs = [ "//third_party/breakpad:client_config" ]
+ }
+@@ -59,7 +59,7 @@ source_set("browser") {
+ "//components/crash/android:jni_headers",
+ "//mojo/public/cpp/bindings",
+ ]
+- } else {
++ } else if (!is_bsd) {
+ deps += [ "//third_party/breakpad:client" ]
+ }
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_app_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_app_BUILD.gn
@@ -0,0 +1,52 @@
+--- src/3rdparty/chromium/components/crash/core/app/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/crash/core/app/BUILD.gn
+@@ -52,7 +52,7 @@ static_library("app") {
+ "crashpad.h",
+ ]
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "breakpad_linux.cc",
+ "breakpad_linux.h",
+@@ -61,6 +61,10 @@ static_library("app") {
+ ]
+ }
+
++ if (is_bsd) {
++ sources -= [ "crashpad.cc" ]
++ }
++
+ defines = [ "CRASH_IMPLEMENTATION" ]
+
+ public_deps = [ ":lib" ]
+@@ -88,7 +92,7 @@ static_library("app") {
+ libs = [ "log" ]
+ }
+
+- if (is_android || is_linux || is_chromeos) {
++ if ((is_android || is_linux || is_chromeos) && !is_bsd) {
+ deps += [
+ "//base:base_static",
+ "//components/crash/core/common",
+@@ -96,7 +100,7 @@ static_library("app") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ deps += [ "//third_party/breakpad:client" ]
+ }
+
+@@ -216,11 +220,6 @@ if (is_mac || is_android || is_linux || is_chromeos) {
+ # define custom UserStreamDataSources.
+ executable("chrome_crashpad_handler") {
+ sources = [ "chrome_crashpad_handler.cc" ]
+-
+- deps = [
+- ":crashpad_handler_main",
+- "//third_party/crashpad/crashpad/handler",
+- ]
+
+ if (is_mac && (is_component_build || is_asan)) {
+ ldflags = [
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_app_chrome__crashpad__handler.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_app_chrome__crashpad__handler.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/components/crash/core/app/chrome_crashpad_handler.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/crash/core/app/chrome_crashpad_handler.cc
+@@ -6,5 +6,9 @@ int main(int argc, char* argv[]) {
+ extern "C" int CrashpadHandlerMain(int argc, char* argv[]);
+
+ int main(int argc, char* argv[]) {
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++ return -1;
++#else
+ return CrashpadHandlerMain(argc, argv);
++#endif
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_browser_crash__upload__list__crashpad.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_browser_crash__upload__list__crashpad.cc
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/components/crash/core/browser/crash_upload_list_crashpad.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/crash/core/browser/crash_upload_list_crashpad.cc
+@@ -51,9 +51,13 @@ void CrashUploadListCrashpad::ClearUploadList(const ba
+
+ void CrashUploadListCrashpad::ClearUploadList(const base::Time& begin,
+ const base::Time& end) {
++#if !defined(OS_BSD)
+ crash_reporter::ClearReportsBetween(begin, end);
++#endif
+ }
+
+ void CrashUploadListCrashpad::RequestSingleUpload(const std::string& local_id) {
++#if !defined(OS_BSD)
+ crash_reporter::RequestSingleCrashUpload(local_id);
++#endif
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_common_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_crash_core_common_BUILD.gn
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/components/crash/core/common/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/crash/core/common/BUILD.gn
+@@ -8,7 +8,7 @@ declare_args() {
+
+ declare_args() {
+ # If set to true, this will stub out and disable the entire crash key system.
+- use_crash_key_stubs = is_fuchsia
++ use_crash_key_stubs = is_fuchsia || is_bsd
+ }
+
+ group("common") {
+@@ -190,7 +190,7 @@ source_set("unit_tests") {
+ sources += [ "crash_key_breakpad_ios_unittest.cc" ]
+ deps += [ "//third_party/breakpad:client" ]
+ include_dirs = [ "//third_party/breakpad/breakpad/src/" ]
+- } else if (!is_mac && !is_win && !is_fuchsia && !is_android) {
++ } else if (!is_mac && !is_win && !is_fuchsia && !is_android && !is_bsd) {
+ include_dirs = [ "//third_party/breakpad/breakpad/src/" ]
+ sources += [ "crash_key_breakpad_unittest.cc" ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_metrics_drive__metrics__provider__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_metrics_drive__metrics__provider__linux.cc
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/components/metrics/drive_metrics_provider_linux.cc.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/components/metrics/drive_metrics_provider_linux.cc
+@@ -4,7 +4,13 @@
+
+ #include "components/metrics/drive_metrics_provider.h"
+
++#if defined(OS_BSD)
++#include <sys/types.h>
++#define MAJOR(dev) major(dev)
++#define MINOR(dev) minor(dev)
++#else
+ #include <linux/kdev_t.h> // For MAJOR()/MINOR().
++#endif
+ #include <sys/stat.h>
+ #include <string>
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_os__crypt_keyring__util__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_os__crypt_keyring__util__linux.cc
@@ -0,0 +1,17 @@
+--- src/3rdparty/chromium/components/os_crypt/keyring_util_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/os_crypt/keyring_util_linux.cc
+@@ -68,12 +68,12 @@ bool GnomeKeyringLoader::LoadGnomeKeyring() {
+ if (keyring_loaded)
+ return true;
+
+- void* handle = dlopen("libgnome-keyring.so.0", RTLD_NOW | RTLD_GLOBAL);
++ void* handle = dlopen("libgnome-keyring.so", RTLD_NOW | RTLD_GLOBAL);
+ if (!handle) {
+ // We wanted to use GNOME Keyring, but we couldn't load it. Warn, because
+ // either the user asked for this, or we autodetected it incorrectly. (Or
+ // the system has broken libraries, which is also good to warn about.)
+- LOG(WARNING) << "Could not load libgnome-keyring.so.0: " << dlerror();
++ LOG(WARNING) << "Could not load libgnome-keyring.so: " << dlerror();
+ return false;
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_os__crypt_libsecret__util__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_os__crypt_libsecret__util__linux.cc
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/components/os_crypt/libsecret_util_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/os_crypt/libsecret_util_linux.cc
+@@ -101,13 +101,13 @@ bool LibsecretLoader::LoadLibsecret() {
+ if (libsecret_loaded_)
+ return true;
+
+- static void* handle = dlopen("libsecret-1.so.0", RTLD_NOW | RTLD_GLOBAL);
++ static void* handle = dlopen("libsecret-1.so", RTLD_NOW | RTLD_GLOBAL);
+ if (!handle) {
+ // We wanted to use libsecret, but we couldn't load it. Warn, because
+ // either the user asked for this, or we autodetected it incorrectly. (Or
+ // the system has broken libraries, which is also good to warn about.)
+ // TODO(crbug.com/607435): Channel this message to the user-facing log
+- VLOG(1) << "Could not load libsecret-1.so.0: " << dlerror();
++ VLOG(1) << "Could not load libsecret-1.so: " << dlerror();
+ return false;
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_os__crypt_os__crypt.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_os__crypt_os__crypt.h
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/components/os_crypt/os_crypt.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/os_crypt/os_crypt.h
+@@ -14,7 +14,7 @@
+ #include "build/build_config.h"
+ #include "build/chromecast_buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class KeyStorageLinux;
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -30,7 +30,7 @@ namespace OSCrypt {
+ // Temporary interface due to OSCrypt refactor. See OSCryptImpl for descriptions
+ // of what each function does.
+ namespace OSCrypt {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(OS_CRYPT)
+ void SetConfig(std::unique_ptr<os_crypt::Config> config);
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -75,7 +75,7 @@ COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting()
+ COMPONENT_EXPORT(OS_CRYPT) void SetLegacyEncryptionForTesting(bool legacy);
+ COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting();
+ #endif // BUILDFLAG(IS_WIN)
+-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST))
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST))
+ COMPONENT_EXPORT(OS_CRYPT)
+ void UseMockKeyStorageForTesting(
+ std::unique_ptr<KeyStorageLinux> (*get_key_storage_mock)());
+@@ -95,7 +95,7 @@ class OSCryptImpl {
+ OSCryptImpl(const OSCryptImpl&) = delete;
+ OSCryptImpl& operator=(const OSCryptImpl&) = delete;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Set the configuration of OSCryptImpl.
+ // This method, or SetRawEncryptionKey(), must be called before using
+ // EncryptString() and DecryptString().
+@@ -200,7 +200,7 @@ class OSCryptImpl {
+ static void ResetStateForTesting();
+ #endif
+
+-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST))
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST))
+ // For unit testing purposes, inject methods to be used.
+ // |get_key_storage_mock| provides the desired |KeyStorage| implementation.
+ // If the provider returns |nullptr|, a hardcoded password will be used.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef COMPONENTS_SERVICES_SCREEN_AI_SANDBOX_SCREEN_AI_SANDBOX_HOOK_LINUX_H_
+ #define COMPONENTS_SERVICES_SCREEN_AI_SANDBOX_SCREEN_AI_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace screen_ai {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.cc
+@@ -35,6 +35,7 @@ bool ScreenAIPreSandboxHook(sandbox::policy::SandboxLi
+ VLOG(2) << "Screen AI library loaded pre-sandboxing:" << library_path;
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+
+ std::vector<BrokerFilePermission> permissions{
+@@ -46,6 +47,7 @@ bool ScreenAIPreSandboxHook(sandbox::policy::SandboxLi
+ sandbox::syscall_broker::COMMAND_OPEN}),
+ permissions, sandbox::policy::SandboxLinux::PreSandboxHook(), options);
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+
+ return true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/app/content_main.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/app/content_main.cc
+@@ -262,7 +262,7 @@ RunContentProcess(ContentMainParams params,
+ base::EnableTerminationOnOutOfMemory();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The various desktop environments set this environment variable that
+ // allows the dbus client library to connect directly to the bus. When this
+ // variable is not set (test environments like xvfb-run), the dbus client
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_app_content__main__runner__impl.cc
@@ -0,0 +1,123 @@
+--- src/3rdparty/chromium/content/app/content_main_runner_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/app/content_main_runner_impl.cc
+@@ -129,13 +129,13 @@
+ #include "base/posix/global_descriptors.h"
+ #include "content/public/common/content_descriptors.h"
+
+-#if !BUILDFLAG(IS_MAC)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ #include "content/public/common/zygote/zygote_fork_delegate_linux.h"
+ #endif
+
+ #endif // BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/native_library.h"
+ #include "base/rand_util.h"
+ #include "content/public/common/zygote/sandbox_support_linux.h"
+@@ -172,6 +172,13 @@
+ #endif
+ #endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
+
++#if BUILDFLAG(IS_BSD)
++#include "base/system/sys_info.h"
++#if BUILDFLAG(ENABLE_WEBRTC)
++#include "third_party/webrtc_overrides/init_webrtc.h" // nogncheck
++#endif
++#endif
++
+ #if BUILDFLAG(IS_ANDROID)
+ #include "base/system/sys_info.h"
+ #include "content/browser/android/battery_metrics.h"
+@@ -344,7 +351,7 @@ void InitializeZygoteSandboxForBrowserProcess(
+ }
+ #endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ #if BUILDFLAG(ENABLE_PLUGINS)
+ // Loads the (native) libraries but does not initialize them (i.e., does not
+@@ -380,7 +387,7 @@ void PreloadLibraryCdms() {
+ }
+ #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
+
+-#if BUILDFLAG(USE_ZYGOTE_HANDLE)
++#if BUILDFLAG(USE_ZYGOTE_HANDLE) || BUILDFLAG(IS_BSD)
+ void PreSandboxInit() {
+ // Pre-acquire resources needed by BoringSSL. See
+ // https://boringssl.googlesource.com/boringssl/+/HEAD/SANDBOXING.md
+@@ -398,6 +405,11 @@ void PreSandboxInit() {
+ InitializeWebRtcModule();
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++ // "cache" the amount of physical memory before pledge(2)
++ base::SysInfo::AmountOfPhysicalMemoryMB();
++#endif
++
+ // Set the android SkFontMgr for blink. We need to ensure this is done
+ // before the sandbox is initialized to allow the font manager to access
+ // font configuration files on disk.
+@@ -567,7 +579,7 @@ int NO_STACK_PROTECTOR RunZygote(ContentMainDelegate*
+ delegate->ZygoteStarting(&zygote_fork_delegates);
+ media::InitializeMediaLibrary();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ PreSandboxInit();
+ #endif
+
+@@ -753,11 +765,10 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam
+ kFieldTrialDescriptor + base::GlobalDescriptors::kBaseDescriptor);
+ #endif // !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ g_fds->Set(kCrashDumpSignal,
+ kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor);
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+- // BUILDFLAG(IS_OPENBSD)
++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+ #endif // !BUILDFLAG(IS_WIN)
+
+@@ -936,6 +947,16 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam
+ }
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++ if (process_type.empty()) {
++ sandbox::policy::SandboxLinux::Options sandbox_options;
++ sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox(
++ sandbox::policy::SandboxTypeFromCommandLine(
++ *base::CommandLine::ForCurrentProcess()),
++ sandbox::policy::SandboxLinux::PreSandboxHook(), sandbox_options);
++ }
++#endif
++
+ delegate_->SandboxInitialized(process_type);
+
+ #if BUILDFLAG(USE_ZYGOTE_HANDLE)
+@@ -991,7 +1012,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() {
+ mojo::core::InitFeatures();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // If dynamic Mojo Core is being used, ensure that it's loaded very early in
+ // the child/zygote process, before any sandbox is initialized. The library
+ // is not fully initialized with IPC support until a ChildProcess is later
+@@ -1024,6 +1045,11 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() {
+ content_main_params_.reset();
+
+ RegisterMainThreadFactories();
++
++#if BUILDFLAG(IS_BSD)
++ if (!process_type.empty())
++ PreSandboxInit();
++#endif
+
+ if (process_type.empty())
+ return RunBrowser(std::move(main_params), start_minimal_browser);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_BUILD.gn
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/content/browser/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/BUILD.gn
+@@ -2406,6 +2406,13 @@ jumbo_source_set("browser") {
+ }
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "sandbox_ipc_linux.cc",
++ "sandbox_ipc_linux.h",
++ ]
++ }
++
+ if (is_chromeos) {
+ deps += [ "//components/value_store:value_store" ]
+ sources += [
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_browser__child__process__host__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_browser__child__process__host__impl.cc
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/content/browser/browser_child_process_host_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/browser_child_process_host_impl.cc
+@@ -292,6 +292,7 @@ void BrowserChildProcessHostImpl::LaunchWithoutExtraCo
+ switches::kDisableBestEffortTasks,
+ switches::kDisableLogging,
+ switches::kEnableLogging,
++ switches::kDisableUnveil,
+ switches::kIPCConnectionTimeout,
+ switches::kLogBestEffortTasks,
+ switches::kLogFile,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_browser__main__loop.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_browser__main__loop.cc
@@ -0,0 +1,46 @@
+--- src/3rdparty/chromium/content/browser/browser_main_loop.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/browser_main_loop.cc
+@@ -247,6 +247,12 @@
+ #include "mojo/public/cpp/bindings/lib/test_random_mojo_delays.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "content/browser/sandbox_host_linux.h"
++#include "content/public/common/zygote/sandbox_support_linux.h"
++#include "sandbox/policy/sandbox.h"
++#endif
++
+ // One of the linux specific headers defines this as a macro.
+ #ifdef DestroyAll
+ #undef DestroyAll
+@@ -554,6 +560,12 @@ int BrowserMainLoop::EarlyInitialization() {
+ // by now since a thread to start the ServiceManager has been created
+ // before the browser main loop starts.
+ DCHECK(SandboxHostLinux::GetInstance()->IsInitialized());
++#elif BUILDFLAG(IS_BSD)
++ base::FileHandleMappingVector additional_remapped_fds;
++ base::LaunchOptions options;
++ SandboxHostLinux::GetInstance()->Init();
++ const int sfd = SandboxHostLinux::GetInstance()->GetChildSocket();
++ options.fds_to_remap.push_back(std::make_pair(sfd, GetSandboxFD()));
+ #endif
+
+ // GLib's spawning of new processes is buggy, so it's important that at this
+@@ -581,7 +593,7 @@ int BrowserMainLoop::EarlyInitialization() {
+
+ // Up the priority of the UI thread unless it was already high (since Mac
+ // and recent versions of Android (O+) do this automatically).
+-#if !BUILDFLAG(IS_MAC)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(
+ features::kBrowserUseDisplayThreadPriority) &&
+ base::PlatformThread::GetCurrentThreadPriority() <
+@@ -592,7 +604,7 @@ int BrowserMainLoop::EarlyInitialization() {
+ #endif // !BUILDFLAG(IS_MAC)
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // We use quite a few file descriptors for our IPC as well as disk the disk
+ // cache,and the default limit on the Mac is low (256), so bump it up.
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_child__process__launcher__helper__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_child__process__launcher__helper__linux.cc
@@ -0,0 +1,76 @@
+--- src/3rdparty/chromium/content/browser/child_process_launcher_helper_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/child_process_launcher_helper_linux.cc
+@@ -19,7 +19,9 @@
+ #include "content/public/common/result_codes.h"
+ #include "content/public/common/sandboxed_process_launcher_delegate.h"
+ #include "content/public/common/zygote/sandbox_support_linux.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "content/public/common/zygote/zygote_handle.h"
++#endif
+ #include "sandbox/policy/linux/sandbox_linux.h"
+
+ namespace content {
+@@ -68,6 +70,7 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThr
+ int* launch_result) {
+ *is_synchronous_launch = true;
+
++#if !BUILDFLAG(IS_BSD)
+ ZygoteHandle zygote_handle =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
+ ? nullptr
+@@ -81,7 +84,6 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThr
+ GetProcessType());
+ *launch_result = LAUNCH_RESULT_SUCCESS;
+
+-#if !BUILDFLAG(IS_OPENBSD)
+ if (handle) {
+ // It could be a renderer process or an utility process.
+ int oom_score = content::kMiscOomScore;
+@@ -90,13 +92,13 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThr
+ oom_score = content::kLowestRendererOomScore;
+ ZygoteHostImpl::GetInstance()->AdjustRendererOOMScore(handle, oom_score);
+ }
+-#endif
+
+ Process process;
+ process.process = base::Process(handle);
+ process.zygote = zygote_handle;
+ return process;
+ }
++#endif
+
+ Process process;
+ process.process = base::LaunchProcess(*command_line(), options);
+@@ -114,10 +116,14 @@ ChildProcessTerminationInfo ChildProcessLauncherHelper
+ const ChildProcessLauncherHelper::Process& process,
+ bool known_dead) {
+ ChildProcessTerminationInfo info;
++#if !BUILDFLAG(IS_BSD)
+ if (process.zygote) {
+ info.status = process.zygote->GetTerminationStatus(
+ process.process.Handle(), known_dead, &info.exit_code);
+ } else if (known_dead) {
++#else
++ if (known_dead) {
++#endif
+ info.status = base::GetKnownDeadTerminationStatus(process.process.Handle(),
+ &info.exit_code);
+ } else {
+@@ -141,13 +147,17 @@ void ChildProcessLauncherHelper::ForceNormalProcessTer
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+ process.process.Terminate(RESULT_CODE_NORMAL_EXIT, false);
+ // On POSIX, we must additionally reap the child.
++#if !BUILDFLAG(IS_BSD)
+ if (process.zygote) {
+ // If the renderer was created via a zygote, we have to proxy the reaping
+ // through the zygote process.
+ process.zygote->EnsureProcessTerminated(process.process.Handle());
+ } else {
++#endif
+ base::EnsureProcessTerminated(std::move(process.process));
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+ }
+
+ void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_compositor_viz__process__transport__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_compositor_viz__process__transport__factory.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/compositor/viz_process_transport_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/compositor/viz_process_transport_factory.cc
+@@ -112,7 +112,7 @@ class HostDisplayClient : public viz::HostDisplayClien
+ // viz::HostDisplayClient:
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ void DidCompleteSwapWithNewSize(const gfx::Size& size) override {
+ compositor_->OnCompleteSwapWithNewSize(size);
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_compute__pressure_cpu__probe.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_compute__pressure_cpu__probe.cc
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/content/browser/compute_pressure/cpu_probe.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/compute_pressure/cpu_probe.cc
+@@ -53,6 +53,7 @@ std::unique_ptr<CpuProbe> CpuProbe::Create() {
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ return CpuProbeLinux::Create();
+ #else
++ NOTIMPLEMENTED();
+ return std::make_unique<NullCpuProbe>();
+ #endif // BUILDFLAG(IS_ANDROID)
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_devtools_protocol_system__info__handler.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_devtools_protocol_system__info__handler.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/devtools/protocol/system_info_handler.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/devtools/protocol/system_info_handler.cc
+@@ -50,7 +50,7 @@ std::unique_ptr<SystemInfo::Size> GfxSizeToSystemInfoS
+ // Windows builds need more time -- see Issue 873112 and 1004472.
+ // Mac builds need more time - see Issue angleproject:6182.
+ #if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !defined(NDEBUG)) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || defined(USE_OZONE)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ static constexpr int kGPUInfoWatchdogTimeoutMultiplierOS = 3;
+ #else
+ static constexpr int kGPUInfoWatchdogTimeoutMultiplierOS = 1;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_download_download__manager__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_download_download__manager__impl.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/browser/download/download_manager_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/download/download_manager_impl.cc
+@@ -90,7 +90,7 @@
+ #include "third_party/blink/public/common/storage_key/storage_key.h"
+ #include "url/origin.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/nix/xdg_util.h"
+ #endif
+
+@@ -218,7 +218,7 @@ class DownloadItemFactoryImpl : public download::Downl
+ }
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FilePath GetTemporaryDownloadDirectory() {
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
+ return base::nix::GetXDGDirectory(env.get(), "XDG_DATA_HOME", ".local/share");
+@@ -654,7 +654,7 @@ base::FilePath DownloadManagerImpl::GetDefaultDownload
+
+ base::FilePath DownloadManagerImpl::GetDefaultDownloadDirectory() {
+ base::FilePath default_download_directory;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(thomasanderson,crbug.com/784010): Remove this when all Linux
+ // distros with versions of GTK lower than 3.14.7 are no longer
+ // supported. This should happen when support for Ubuntu Trusty and
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_font__access_font__enumeration__data__source.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_font__access_font__enumeration__data__source.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/browser/font_access/font_enumeration_data_source.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/font_access/font_enumeration_data_source.cc
+@@ -16,7 +16,7 @@
+ #include "content/browser/font_access/font_enumeration_data_source_win.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "content/browser/font_access/font_enumeration_data_source_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/browser/font_access/font_enumeration_data_source_linux.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+@@ -61,7 +61,7 @@ std::unique_ptr<FontEnumerationDataSource> FontEnumera
+ return std::make_unique<FontEnumerationDataSourceWin>();
+ #elif BUILDFLAG(IS_MAC)
+ return std::make_unique<FontEnumerationDataSourceMac>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<FontEnumerationDataSourceLinux>();
+ #else
+ return std::make_unique<FontEnumerationDataSourceNull>();
+@@ -76,7 +76,7 @@ bool FontEnumerationDataSource::IsOsSupported() {
+ return true;
+ #elif BUILDFLAG(IS_MAC)
+ return true;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_gpu_compositor__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_gpu_compositor__util.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/gpu/compositor_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/gpu/compositor_util.cc
+@@ -148,7 +148,7 @@ const GpuFeatureData GetGpuFeatureData(
+ {"video_decode",
+ SafeGetFeatureStatus(gpu_feature_info,
+ gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ !base::FeatureList::IsEnabled(media::kVaapiVideoDecodeLinux),
+ #else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
+@@ -160,7 +160,7 @@ const GpuFeatureData GetGpuFeatureData(
+ {"video_encode",
+ SafeGetFeatureStatus(gpu_feature_info,
+ gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE),
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ !base::FeatureList::IsEnabled(media::kVaapiVideoEncodeLinux),
+ #else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoEncode),
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_gpu_gpu__process__host.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_gpu_gpu__process__host.cc
@@ -0,0 +1,28 @@
+--- src/3rdparty/chromium/content/browser/gpu/gpu_process_host.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/gpu/gpu_process_host.cc
+@@ -100,7 +100,7 @@
+ #include "ui/ozone/public/ozone_switches.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/switches.h"
+ #endif
+
+@@ -254,6 +254,7 @@ static const char* const kSwitchNames[] = {
+ switches::kEnableBackgroundThreadPool,
+ switches::kEnableGpuRasterization,
+ switches::kEnableLogging,
++ switches::kDisableUnveil,
+ switches::kEnableDeJelly,
+ switches::kDeJellyScreenWidth,
+ switches::kDocumentTransitionSlowdownFactor,
+@@ -291,7 +292,7 @@ static const char* const kSwitchNames[] = {
+ switches::kOzoneDumpFile,
+ switches::kDisableBufferBWCompression,
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ switches::kX11Display,
+ switches::kNoXshm,
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_media_frameless__media__interface__proxy.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_media_frameless__media__interface__proxy.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/media/frameless_media_interface_proxy.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/media/frameless_media_interface_proxy.cc
+@@ -15,7 +15,7 @@
+ #include "media/mojo/mojom/renderer_extensions.mojom.h"
+ #include "media/mojo/mojom/stable/stable_video_decoder.mojom.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/public/browser/stable_video_decoder_factory.h"
+ #include "media/base/media_switches.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -64,7 +64,7 @@ void FramelessMediaInterfaceProxy::CreateVideoDecoder(
+
+ mojo::PendingRemote<media::stable::mojom::StableVideoDecoder>
+ oop_video_decoder;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(media::kUseOutOfProcessVideoDecoding)) {
+ // TODO(b/195769334): for now, we're using the same
+ // StableVideoDecoderFactory. However, we should be using a separate
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_media_media__interface__proxy.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_media_media__interface__proxy.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/media/media_interface_proxy.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/media/media_interface_proxy.cc
+@@ -73,7 +73,7 @@
+ #include "media/mojo/services/mojo_renderer_service.h" // nogncheck
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/public/browser/stable_video_decoder_factory.h"
+ #include "media/base/media_switches.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -293,7 +293,7 @@ void MediaInterfaceProxy::CreateVideoDecoder(
+
+ mojo::PendingRemote<media::stable::mojom::StableVideoDecoder>
+ oop_video_decoder;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(media::kUseOutOfProcessVideoDecoding)) {
+ // TODO(b/195769334): for now, we're using the same
+ // StableVideoDecoderFactory. However, we should be using a separate
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_media_media__keys__listener__manager__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_media_media__keys__listener__manager__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/media/media_keys_listener_manager_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/media/media_keys_listener_manager_impl.cc
+@@ -233,7 +233,7 @@ void MediaKeysListenerManagerImpl::StartListeningForMe
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ system_media_controls_ = system_media_controls::SystemMediaControls::Create(
+ media::AudioManager::GetGlobalAppName());
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_ppapi__plugin__process__host__receiver__bindings.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_ppapi__plugin__process__host__receiver__bindings.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/ppapi_plugin_process_host_receiver_bindings.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/ppapi_plugin_process_host_receiver_bindings.cc
+@@ -8,7 +8,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck
+ #include "content/browser/font_service.h" // nogncheck
+ #endif
+@@ -17,7 +17,7 @@ void PpapiPluginProcessHost::BindHostReceiver(
+
+ void PpapiPluginProcessHost::BindHostReceiver(
+ mojo::GenericPendingReceiver receiver) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto font_receiver = receiver.As<font_service::mojom::FontService>())
+ ConnectToFontService(std::move(font_receiver));
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_delegated__frame__host.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_delegated__frame__host.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/delegated_frame_host.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/delegated_frame_host.cc
+@@ -289,7 +289,7 @@ void DelegatedFrameHost::EmbedSurface(
+
+ if (!primary_surface_id ||
+ primary_surface_id->local_surface_id() != local_surface_id_) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // On Windows and Linux, we would like to produce new content as soon as
+ // possible or the OS will create an additional black gutter. Until we can
+ // block resize on surface synchronization on these platforms, we will not
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_input_input__device__change__observer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_input_input__device__change__observer.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/input/input_device_change_observer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/input/input_device_change_observer.cc
+@@ -9,7 +9,7 @@
+
+ #if BUILDFLAG(IS_WIN)
+ #include "ui/events/devices/input_device_observer_win.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/events/devices/device_data_manager.h"
+ #elif BUILDFLAG(IS_ANDROID)
+ #include "ui/events/devices/input_device_observer_android.h"
+@@ -21,7 +21,7 @@ InputDeviceChangeObserver::InputDeviceChangeObserver(R
+ render_view_host_impl_ = rvhi;
+ #if BUILDFLAG(IS_WIN)
+ ui::InputDeviceObserverWin::GetInstance()->AddObserver(this);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ui::DeviceDataManager::GetInstance()->AddObserver(this);
+ #elif BUILDFLAG(IS_ANDROID)
+ ui::InputDeviceObserverAndroid::GetInstance()->AddObserver(this);
+@@ -31,7 +31,7 @@ InputDeviceChangeObserver::~InputDeviceChangeObserver(
+ InputDeviceChangeObserver::~InputDeviceChangeObserver() {
+ #if BUILDFLAG(IS_WIN)
+ ui::InputDeviceObserverWin::GetInstance()->RemoveObserver(this);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ui::DeviceDataManager::GetInstance()->RemoveObserver(this);
+ #elif BUILDFLAG(IS_ANDROID)
+ ui::InputDeviceObserverAndroid::GetInstance()->RemoveObserver(this);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_pepper_pepper__file__io__host.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_pepper_pepper__file__io__host.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/pepper/pepper_file_io_host.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/pepper/pepper_file_io_host.cc
+@@ -455,7 +455,7 @@ void PepperFileIOHost::OnLocalFileOpened(
+ ppapi::host::ReplyMessageContext reply_context,
+ const base::FilePath& path,
+ base::File::Error error_code) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Quarantining a file before its contents are available is only supported on
+ // Windows and Linux.
+ if (!FileOpenForWrite(open_flags_) || error_code != base::File::FILE_OK) {
+@@ -489,7 +489,7 @@ void PepperFileIOHost::OnLocalFileOpened(
+ #endif
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void PepperFileIOHost::OnLocalFileQuarantined(
+ ppapi::host::ReplyMessageContext reply_context,
+ const base::FilePath& path,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__message__filter.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__message__filter.h
@@ -0,0 +1,19 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_message_filter.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_message_filter.h
+@@ -78,14 +78,14 @@ class RenderMessageFilter
+ void GenerateRoutingID(GenerateRoutingIDCallback routing_id) override;
+ void GenerateFrameRoutingID(GenerateFrameRoutingIDCallback callback) override;
+ void HasGpuProcess(HasGpuProcessCallback callback) override;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void SetThreadPriority(int32_t ns_tid,
+ base::ThreadPriority priority) override;
+ #endif
+
+ void OnResolveProxy(const GURL& url, IPC::Message* reply_msg);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void SetThreadPriorityOnFileThread(base::PlatformThreadId ns_tid,
+ base::ThreadPriority priority);
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__message__filter.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__message__filter.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_message_filter.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_message_filter.cc
+@@ -66,7 +66,7 @@
+ #if BUILDFLAG(IS_MAC)
+ #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/linux_util.h"
+ #include "base/threading/platform_thread.h"
+ #endif
+@@ -128,7 +128,7 @@ void RenderMessageFilter::GenerateFrameRoutingID(
+ std::move(callback).Run(routing_id, frame_token, devtools_frame_token);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void RenderMessageFilter::SetThreadPriorityOnFileThread(
+ base::PlatformThreadId ns_tid,
+ base::ThreadPriority priority) {
+@@ -149,7 +149,7 @@ void RenderMessageFilter::SetThreadPriorityOnFileThrea
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void RenderMessageFilter::SetThreadPriority(int32_t ns_tid,
+ base::ThreadPriority priority) {
+ constexpr base::TaskTraits kTraits = {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__process__host__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__process__host__impl.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_process_host_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_process_host_impl.h
+@@ -466,7 +466,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
+ // Sets this RenderProcessHost to be guest only. For Testing only.
+ void SetForGuestsOnlyForTesting();
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ // Launch the zygote early in the browser startup.
+ static void EarlyZygoteLaunch();
+ #endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__process__host__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__process__host__impl.cc
@@ -0,0 +1,37 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_process_host_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_process_host_impl.cc
+@@ -208,7 +208,7 @@
+ #include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <sys/resource.h>
+
+ #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck
+@@ -1184,7 +1184,7 @@ size_t GetPlatformProcessLimit() {
+ // to indicate failure and std::numeric_limits<size_t>::max() to indicate
+ // unlimited.
+ size_t GetPlatformProcessLimit() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ struct rlimit limit;
+ if (getrlimit(RLIMIT_NPROC, &limit) != 0)
+ return kUnknownPlatformProcessLimit;
+@@ -1271,7 +1271,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public
+ return;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto font_receiver = receiver.As<font_service::mojom::FontService>()) {
+ ConnectToFontService(std::move(font_receiver));
+ return;
+@@ -3283,6 +3283,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLin
+ switches::kDisableSpeechAPI,
+ switches::kDisableThreadedCompositing,
+ switches::kDisableTouchDragDrop,
++ switches::kDisableUnveil,
+ switches::kDisableV8IdleTasks,
+ switches::kDisableVideoCaptureUseGpuMemoryBuffer,
+ switches::kDisableWebGLImageChromium,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__view__host__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__view__host__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_view_host_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_view_host_impl.cc
+@@ -259,7 +259,7 @@ void RenderViewHostImpl::GetPlatformSpecificPrefs(
+ display::win::ScreenWin::GetSystemMetricsInDIP(SM_CYVSCROLL);
+ prefs->arrow_bitmap_width_horizontal_scroll_bar_in_dips =
+ display::win::ScreenWin::GetSystemMetricsInDIP(SM_CXHSCROLL);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ prefs->system_font_family_name = gfx::Font().GetFontName();
+ #elif BUILDFLAG(IS_FUCHSIA)
+ // Make Blink's "focus ring" invisible. The focus ring is a hairline border
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__widget__host__view__aura.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__widget__host__view__aura.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_widget_host_view_aura.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_widget_host_view_aura.h
+@@ -244,7 +244,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__widget__host__view__aura.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__widget__host__view__aura.cc
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_widget_host_view_aura.cc
+@@ -114,7 +114,7 @@
+ #include "ui/gfx/gdi_util.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "content/browser/accessibility/browser_accessibility_auralinux.h"
+ #include "ui/base/ime/linux/text_edit_command_auralinux.h"
+ #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h"
+@@ -439,7 +439,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewAura::Ge
+ if (manager)
+ return ToBrowserAccessibilityWin(manager->GetRoot())->GetCOM();
+
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BrowserAccessibilityManager* manager =
+ host()->GetOrCreateRootBrowserAccessibilityManager();
+ if (manager && manager->GetRoot())
+@@ -1596,7 +1596,7 @@ bool RenderWidgetHostViewAura::ShouldDoLearning() {
+ return GetTextInputManager() && GetTextInputManager()->should_do_learning();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool RenderWidgetHostViewAura::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
+@@ -2408,7 +2408,7 @@ bool RenderWidgetHostViewAura::NeedsMouseCapture() {
+ }
+
+ bool RenderWidgetHostViewAura::NeedsMouseCapture() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return NeedsInputGrab();
+ #else
+ return false;
+@@ -2585,7 +2585,7 @@ void RenderWidgetHostViewAura::ForwardKeyboardEventWit
+ if (!target_host)
+ return;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ ui::TextEditKeyBindingsDelegateAuraLinux* keybinding_delegate =
+ ui::GetTextEditKeyBindingsDelegate();
+ std::vector<ui::TextEditCommandAuraLinux> commands;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__widget__host__view__event__handler.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_renderer__host_render__widget__host__view__event__handler.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/renderer_host/render_widget_host_view_event_handler.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/renderer_host/render_widget_host_view_event_handler.cc
+@@ -596,7 +596,7 @@ bool RenderWidgetHostViewEventHandler::CanRendererHand
+ if (event->type() == ui::ET_MOUSE_EXITED) {
+ if (mouse_locked || selection_popup)
+ return false;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Don't forward the mouse leave message which is received when the context
+ // menu is displayed by the page. This confuses the page and causes state
+ // changes.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_sandbox__host__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_sandbox__host__linux.cc
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/content/browser/sandbox_host_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/sandbox_host_linux.cc
+@@ -45,6 +45,7 @@ void SandboxHostLinux::Init() {
+ // Instead, it replies on a temporary socket provided by the caller.
+ PCHECK(0 == shutdown(browser_socket, SHUT_WR)) << "shutdown";
+
++#if !defined(OS_BSD)
+ int pipefds[2];
+ CHECK(0 == pipe(pipefds));
+ const int child_lifeline_fd = pipefds[0];
+@@ -55,6 +56,7 @@ void SandboxHostLinux::Init() {
+ ipc_thread_ = std::make_unique<base::DelegateSimpleThread>(
+ ipc_handler_.get(), "sandbox_ipc_thread");
+ ipc_thread_->Start();
++#endif
+ }
+
+ } // namespace content
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_scheduler_responsiveness_jank__monitor__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_scheduler_responsiveness_jank__monitor__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/scheduler/responsiveness/jank_monitor_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/scheduler/responsiveness/jank_monitor_impl.cc
+@@ -334,7 +334,7 @@ void JankMonitorImpl::ThreadExecutionState::DidRunTask
+ // in context menus, among others). Simply ignore the mismatches for now.
+ // See https://crbug.com/929813 for the details of why the mismatch
+ // happens.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && defined(USE_OZONE)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE)
+ task_execution_metadata_.clear();
+ #endif
+ return;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_scheduler_responsiveness_native__event__observer.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_scheduler_responsiveness_native__event__observer.h
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/content/browser/scheduler/responsiveness/native_event_observer.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/scheduler/responsiveness/native_event_observer.h
+@@ -15,7 +15,7 @@
+ #include "content/public/browser/native_event_processor_observer_mac.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/aura/window_event_dispatcher_observer.h"
+ #endif
+
+@@ -40,7 +40,7 @@ class CONTENT_EXPORT NativeEventObserver
+ class CONTENT_EXPORT NativeEventObserver
+ #if BUILDFLAG(IS_MAC)
+ : public NativeEventProcessorObserver
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ : public aura::WindowEventDispatcherObserver
+ #elif BUILDFLAG(IS_WIN)
+ : public base::MessagePumpForUI::Observer
+@@ -57,7 +57,7 @@ class CONTENT_EXPORT NativeEventObserver
+ NativeEventObserver(WillRunEventCallback will_run_event_callback,
+ DidRunEventCallback did_run_event_callback);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ NativeEventObserver(const NativeEventObserver&) = delete;
+ NativeEventObserver& operator=(const NativeEventObserver&) = delete;
+@@ -73,7 +73,7 @@ class CONTENT_EXPORT NativeEventObserver
+ // Exposed for tests.
+ void WillRunNativeEvent(const void* opaque_identifier) override;
+ void DidRunNativeEvent(const void* opaque_identifier) override;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // aura::WindowEventDispatcherObserver overrides:
+ void OnWindowEventDispatcherStartedProcessing(
+ aura::WindowEventDispatcher* dispatcher,
+@@ -90,7 +90,7 @@ class CONTENT_EXPORT NativeEventObserver
+ void RegisterObserver();
+ void DeregisterObserver();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ struct EventInfo {
+ const void* unique_id;
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_scheduler_responsiveness_native__event__observer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_scheduler_responsiveness_native__event__observer.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/scheduler/responsiveness/native_event_observer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/scheduler/responsiveness/native_event_observer.cc
+@@ -15,7 +15,7 @@
+
+ #include "ui/events/platform/platform_event_source.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/aura/env.h"
+ #include "ui/events/event.h"
+ #endif
+@@ -39,7 +39,7 @@ NativeEventObserver::~NativeEventObserver() {
+ DeregisterObserver();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void NativeEventObserver::RegisterObserver() {
+ aura::Env::GetInstance()->AddWindowEventDispatcherObserver(this);
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_utility__process__host__receiver__bindings.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_utility__process__host__receiver__bindings.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/utility_process_host_receiver_bindings.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/utility_process_host_receiver_bindings.cc
+@@ -10,7 +10,7 @@
+ #include "content/public/browser/content_browser_client.h"
+ #include "content/public/common/content_client.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck
+ #include "content/browser/font_service.h" // nogncheck
+ #endif
+@@ -19,7 +19,7 @@ void UtilityProcessHost::BindHostReceiver(
+
+ void UtilityProcessHost::BindHostReceiver(
+ mojo::GenericPendingReceiver receiver) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto font_receiver = receiver.As<font_service::mojom::FontService>()) {
+ ConnectToFontService(std::move(font_receiver));
+ return;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_utility__sandbox__delegate.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_utility__sandbox__delegate.cc
@@ -0,0 +1,42 @@
+--- src/3rdparty/chromium/content/browser/utility_sandbox_delegate.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/utility_sandbox_delegate.cc
+@@ -62,10 +62,10 @@ UtilitySandboxedProcessLauncherDelegate::
+ #if BUILDFLAG(ENABLE_PLUGINS)
+ sandbox_type_ == sandbox::mojom::Sandbox::kPpapi ||
+ #endif
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kVideoCapture ||
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kHardwareVideoDecoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -75,7 +75,7 @@ UtilitySandboxedProcessLauncherDelegate::
+ sandbox_type_ == sandbox::mojom::Sandbox::kLibassistant ||
+ #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT)
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kScreenAI ||
+ #endif
+ sandbox_type_ == sandbox::mojom::Sandbox::kAudio ||
+@@ -108,7 +108,7 @@ ZygoteHandle UtilitySandboxedProcessLauncherDelegate::
+ // unsandboxed zygote and then apply their actual sandboxes in the forked
+ // process upon startup.
+ if (sandbox_type_ == sandbox::mojom::Sandbox::kNetwork ||
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kHardwareVideoDecoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -122,7 +122,7 @@ ZygoteHandle UtilitySandboxedProcessLauncherDelegate::
+ #if BUILDFLAG(ENABLE_OOP_PRINTING)
+ sandbox_type_ == sandbox::mojom::Sandbox::kPrintBackend ||
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kScreenAI ||
+ #endif
+ sandbox_type_ == sandbox::mojom::Sandbox::kSpeechRecognition) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_v8__snapshot__files.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_v8__snapshot__files.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/browser/v8_snapshot_files.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/v8_snapshot_files.cc
+@@ -10,7 +10,7 @@ std::map<std::string, base::FilePath> GetV8SnapshotFil
+ namespace content {
+
+ std::map<std::string, base::FilePath> GetV8SnapshotFilesToPreload() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if defined(USE_V8_CONTEXT_SNAPSHOT)
+ return {{kV8ContextSnapshotDataDescriptor,
+ base::FilePath(FILE_PATH_LITERAL(V8_CONTEXT_SNAPSHOT_FILENAME))}};
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_web__contents_web__contents__view__aura.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_web__contents_web__contents__view__aura.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/browser/web_contents/web_contents_view_aura.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/web_contents/web_contents_view_aura.cc
+@@ -159,7 +159,7 @@ class WebDragSourceAura : public content::WebContentsO
+ raw_ptr<aura::Window> window_;
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Fill out the OSExchangeData with a file contents, synthesizing a name if
+ // necessary.
+ void PrepareDragForFileContents(const DropData& drop_data,
+@@ -242,7 +242,7 @@ void PrepareDragData(const DropData& drop_data,
+ if (!drop_data.download_metadata.empty())
+ PrepareDragForDownload(drop_data, provider, web_contents);
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // We set the file contents before the URL because the URL also sets file
+ // contents (to a .URL shortcut). We want to prefer file content data over
+ // a shortcut so we add it first.
+@@ -1333,7 +1333,7 @@ void WebContentsViewAura::OnMouseEvent(ui::MouseEvent*
+ // Linux window managers like to handle raise-on-click themselves. If we
+ // raise-on-click manually, this may override user settings that prevent
+ // focus-stealing.
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // It is possible for the web-contents to be destroyed while it is being
+ // activated. Use a weak-ptr to track whether that happened or not.
+ // More in https://crbug.com/1040725
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_webui_web__ui__main__frame__observer.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_webui_web__ui__main__frame__observer.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/browser/webui/web_ui_main_frame_observer.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/webui/web_ui_main_frame_observer.h
+@@ -45,7 +45,7 @@ class CONTENT_EXPORT WebUIMainFrameObserver : public W
+
+ // TODO(crbug.com/1129544) This is currently disabled due to Windows DLL
+ // thunking issues. Fix & re-enable.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On official Google builds, capture and report JavaScript error messages on
+ // WebUI surfaces back to Google. This allows us to fix JavaScript errors and
+ // exceptions.
+@@ -61,7 +61,7 @@ class CONTENT_EXPORT WebUIMainFrameObserver : public W
+ void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void MaybeEnableWebUIJavaScriptErrorReporting(
+ NavigationHandle* navigation_handle);
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_webui_web__ui__main__frame__observer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_webui_web__ui__main__frame__observer.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/content/browser/webui/web_ui_main_frame_observer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/webui/web_ui_main_frame_observer.cc
+@@ -13,7 +13,7 @@
+ #include "content/public/browser/navigation_handle.h"
+ #include "content/public/browser/web_ui_controller.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/callback_helpers.h"
+ #include "base/feature_list.h"
+ #include "base/logging.h"
+@@ -31,7 +31,7 @@ namespace {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Remove the pieces of the URL we don't want to send back with the error
+ // reports. In particular, do not send query or fragments as those can have
+ // privacy-sensitive information in them.
+@@ -67,7 +67,7 @@ void WebUIMainFrameObserver::DidFinishNavigation(
+ web_ui_->DisallowJavascriptOnAllHandlers();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void WebUIMainFrameObserver::OnDidAddMessageToConsole(
+ RenderFrameHost* source_frame,
+ blink::mojom::ConsoleMessageLevel log_level,
+@@ -175,7 +175,7 @@ void WebUIMainFrameObserver::ReadyToCommitNavigation(
+
+ // TODO(crbug.com/1129544) This is currently disabled due to Windows DLL
+ // thunking issues. Fix & re-enable.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ MaybeEnableWebUIJavaScriptErrorReporting(navigation_handle);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_zygote__host_zygote__host__impl__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_zygote__host_zygote__host__impl__linux.h
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.h
+@@ -42,8 +42,10 @@ class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHos
+ base::ScopedFD* control_fd,
+ base::FileHandleMappingVector additional_remapped_fds);
+
++#if !defined(OS_BSD)
+ void AdjustRendererOOMScore(base::ProcessHandle process_handle,
+ int score) override;
++#endif
+ bool HasZygote() { return !zygote_pids_.empty(); }
+
+ private:
+@@ -57,9 +59,11 @@ class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHos
+
+ int renderer_sandbox_status_;
+
++#if !defined(OS_BSD)
+ bool use_namespace_sandbox_;
+ bool use_suid_sandbox_;
+ bool use_suid_sandbox_for_adj_oom_score_;
++#endif
+ std::string sandbox_binary_;
+
+ // This lock protects the |zygote_pids_| set.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_zygote__host_zygote__host__impl__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_browser_zygote__host_zygote__host__impl__linux.cc
@@ -0,0 +1,70 @@
+--- src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.cc
+@@ -28,6 +28,7 @@ namespace {
+
+ namespace {
+
++#if !BUILDFLAG(IS_BSD)
+ // Receive a fixed message on fd and return the sender's PID.
+ // Returns true if the message received matches the expected message.
+ bool ReceiveFixedMessage(int fd,
+@@ -49,6 +50,7 @@ bool ReceiveFixedMessage(int fd,
+ return false;
+ return true;
+ }
++#endif
+
+ } // namespace
+
+@@ -58,9 +60,13 @@ ZygoteHostImpl::ZygoteHostImpl()
+ }
+
+ ZygoteHostImpl::ZygoteHostImpl()
++#if !BUILDFLAG(IS_BSD)
+ : use_namespace_sandbox_(false),
+ use_suid_sandbox_(false),
+ use_suid_sandbox_for_adj_oom_score_(false),
++#else
++ :
++#endif
+ sandbox_binary_(),
+ zygote_pids_lock_(),
+ zygote_pids_() {}
+@@ -73,6 +79,7 @@ void ZygoteHostImpl::Init(const base::CommandLine& com
+ }
+
+ void ZygoteHostImpl::Init(const base::CommandLine& command_line) {
++#if !BUILDFLAG(IS_BSD)
+ if (command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) {
+ return;
+ }
+@@ -123,6 +130,7 @@ void ZygoteHostImpl::Init(const base::CommandLine& com
+ "you can try using --"
+ << sandbox::policy::switches::kNoSandbox << ".";
+ }
++#endif
+ }
+
+ void ZygoteHostImpl::AddZygotePid(pid_t pid) {
+@@ -147,6 +155,7 @@ pid_t ZygoteHostImpl::LaunchZygote(
+ base::CommandLine* cmd_line,
+ base::ScopedFD* control_fd,
+ base::FileHandleMappingVector additional_remapped_fds) {
++#if !BUILDFLAG(IS_BSD)
+ int fds[2];
+ CHECK_EQ(0, socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds));
+ CHECK(base::UnixDomainSocket::EnableReceiveProcessId(fds[0]));
+@@ -214,9 +223,12 @@ pid_t ZygoteHostImpl::LaunchZygote(
+
+ AddZygotePid(pid);
+ return pid;
++#else
++ return 0;
++#endif
+ }
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ void ZygoteHostImpl::AdjustRendererOOMScore(base::ProcessHandle pid,
+ int score) {
+ // 1) You can't change the oom_score_adj of a non-dumpable process
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_child_child__process.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_child_child__process.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/child/child_process.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/child/child_process.cc
+@@ -68,7 +68,7 @@ ChildProcess::ChildProcess(base::ThreadPriority io_thr
+ DCHECK(!g_lazy_child_process_tls.Pointer()->Get());
+ g_lazy_child_process_tls.Pointer()->Set(this);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ const bool is_embedded_in_browser_process =
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_BUILD.gn
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/content/common/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/common/BUILD.gn
+@@ -420,6 +420,9 @@ if (is_linux || is_chromeos) {
+ public = [ "set_process_title_linux.h" ]
+ sources = [ "set_process_title_linux.cc" ]
+ deps = [ "//base" ]
++ if (is_bsd) {
++ sources -= [ "set_process_title_linux.cc" ]
++ }
+ }
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_mojo__core__library__support.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_mojo__core__library__support.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/common/mojo_core_library_support.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/common/mojo_core_library_support.cc
+@@ -15,7 +15,7 @@ absl::optional<base::FilePath> GetMojoCoreSharedLibrar
+ }
+
+ absl::optional<base::FilePath> GetMojoCoreSharedLibraryPath() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (!command_line.HasSwitch(switches::kMojoCoreLibraryPath))
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_user__agent.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_user__agent.cc
@@ -0,0 +1,28 @@
+--- src/3rdparty/chromium/content/common/user_agent.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/common/user_agent.cc
+@@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() {
+ return "";
+ #elif BUILDFLAG(IS_MAC)
+ return "Macintosh; ";
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return "X11; "; // strange, but that's what Firefox uses
+ #elif BUILDFLAG(IS_ANDROID)
+ return "Linux; ";
+@@ -260,6 +260,16 @@ std::string BuildOSCpuInfoFromOSVersionAndCpuType(cons
+ "Android %s", os_version.c_str()
+ #elif BUILDFLAG(IS_FUCHSIA)
+ "Fuchsia"
++#elif BUILDFLAG(IS_BSD)
++#if defined(__x86_64__)
++ "Linux x86_64; %s %s",
++#elif defined(__aarch64__)
++ "Linux aarch64; %s %s",
++#else
++ "Linux i686; %s %s",
++#endif
++ unixinfo.sysname, // e.g. Linux
++ cpu_type.c_str() // e.g. i686
+ #elif BUILDFLAG(IS_POSIX)
+ "%s %s",
+ unixinfo.sysname, // e.g. Linux
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_zygote_sandbox__support__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_common_zygote_sandbox__support__linux.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/content/common/zygote/sandbox_support_linux.cc.orig 2022-11-20 10:46:46 UTC
++++ src/3rdparty/chromium/content/common/zygote/sandbox_support_linux.cc
+@@ -8,7 +8,11 @@
+ #include "base/posix/global_descriptors.h"
+ #include "base/posix/unix_domain_socket.h"
+ #include "content/public/common/content_descriptors.h"
++#if defined(OS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace content {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_gpu_gpu__main.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_gpu_gpu__main.cc
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/content/gpu/gpu_main.cc.orig 2022-11-08 21:18:48 UTC
++++ src/3rdparty/chromium/content/gpu/gpu_main.cc
+@@ -87,7 +87,7 @@
+ #include "sandbox/win/src/sandbox.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/gpu/gpu_sandbox_hook_linux.h"
+ #include "sandbox/policy/linux/sandbox_linux.h"
+ #include "sandbox/policy/sandbox_type.h"
+@@ -109,7 +109,7 @@ namespace {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool StartSandboxLinux(gpu::GpuWatchdogThread*,
+ const gpu::GPUInfo*,
+ const gpu::GpuPreferences&);
+@@ -171,7 +171,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHel
+ bool EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread,
+ const gpu::GPUInfo* gpu_info,
+ const gpu::GpuPreferences& gpu_prefs) override {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return StartSandboxLinux(watchdog_thread, gpu_info, gpu_prefs);
+ #elif BUILDFLAG(IS_WIN)
+ return StartSandboxWindows(sandbox_info_);
+@@ -267,7 +267,7 @@ int GpuMain(MainFunctionParams parameters) {
+ std::make_unique<base::SingleThreadTaskExecutor>(
+ gpu_preferences.message_pump_type);
+ }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #error "Unsupported Linux platform."
+ #elif BUILDFLAG(IS_MAC)
+ // Cross-process CoreAnimation requires a CFRunLoop to function at all, and
+@@ -410,7 +410,7 @@ namespace {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdog_thread,
+ const gpu::GPUInfo* gpu_info,
+ const gpu::GpuPreferences& gpu_prefs) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_gpu_gpu__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_gpu_gpu__sandbox__hook__linux.cc
@@ -0,0 +1,70 @@
+--- src/3rdparty/chromium/content/gpu/gpu_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/gpu/gpu_sandbox_hook_linux.cc
+@@ -104,6 +104,7 @@ constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | R
+
+ constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE;
+
++#if !defined(OS_BSD)
+ void AddV4L2GpuPermissions(
+ std::vector<BrokerFilePermission>* permissions,
+ const sandbox::policy::SandboxSeccompBPF::Options& options) {
+@@ -420,8 +421,10 @@ std::vector<BrokerFilePermission> FilePermissionsForGp
+ AddStandardGpuPermissions(&permissions);
+ return permissions;
+ }
++#endif
+
+ void LoadArmGpuLibraries() {
++#if !defined(OS_BSD)
+ // Preload the Mali library.
+ if (UseChromecastSandboxAllowlist()) {
+ for (const char* path : kAllowedChromecastPaths) {
+@@ -463,6 +466,7 @@ void LoadArmGpuLibraries() {
+ dlopen(driver_paths[i], dlopen_flag);
+ }
+ }
++#endif
+ }
+
+ bool LoadAmdGpuLibraries() {
+@@ -528,12 +532,14 @@ void LoadChromecastV4L2Libraries() {
+ }
+
+ void LoadChromecastV4L2Libraries() {
++#if !defined(OS_BSD)
+ for (const char* path : kAllowedChromecastPaths) {
+ const std::string library_path(std::string(path) +
+ std::string("libvpcodec.so"));
+ if (dlopen(library_path.c_str(), dlopen_flag))
+ break;
+ }
++#endif
+ }
+
+ bool LoadLibrariesForGpu(
+@@ -560,6 +566,7 @@ bool LoadLibrariesForGpu(
+ return true;
+ }
+
++#if !defined(OS_BSD)
+ sandbox::syscall_broker::BrokerCommandSet CommandSetForGPU(
+ const sandbox::policy::SandboxLinux::Options& options) {
+ sandbox::syscall_broker::BrokerCommandSet command_set;
+@@ -582,13 +589,17 @@ bool BrokerProcessPreSandboxHook(
+ SetProcessTitleFromCommandLine(nullptr);
+ return true;
+ }
++#endif
+
+ } // namespace
+
+ bool GpuProcessPreSandboxHook(sandbox::policy::SandboxLinux::Options options) {
++ NOTIMPLEMENTED();
++#if !defined(OS_BSD)
+ sandbox::policy::SandboxLinux::GetInstance()->StartBrokerProcess(
+ CommandSetForGPU(options), FilePermissionsForGpu(options),
+ base::BindOnce(BrokerProcessPreSandboxHook), options);
++#endif
+
+ if (!LoadLibrariesForGpu(options))
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_ppapi__plugin_ppapi__blink__platform__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_ppapi__plugin_ppapi__blink__platform__impl.h
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/content/ppapi_plugin/ppapi_blink_platform_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/ppapi_plugin/ppapi_blink_platform_impl.h
+@@ -12,7 +12,7 @@
+ #include "build/build_config.h"
+ #include "content/child/blink_platform_impl.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/cpp/font_loader.h"
+ #include "third_party/skia/include/core/SkRefCnt.h"
+ #endif
+@@ -39,11 +39,11 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImp
+ blink::WebThemeEngine* ThemeEngine() override;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sk_sp<font_service::FontLoader> font_loader_;
+ #endif
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_ppapi__plugin_ppapi__blink__platform__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_ppapi__plugin_ppapi__blink__platform__impl.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/ppapi_plugin/ppapi_blink_platform_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/ppapi_plugin/ppapi_blink_platform_impl.cc
+@@ -20,7 +20,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include "content/child/child_process_sandbox_support_impl_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/child_process_sandbox_support_impl_linux.h"
+ #include "mojo/public/cpp/bindings/pending_remote.h"
+ #endif
+@@ -35,7 +35,7 @@ PpapiBlinkPlatformImpl::PpapiBlinkPlatformImpl() {
+ namespace content {
+
+ PpapiBlinkPlatformImpl::PpapiBlinkPlatformImpl() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ ChildThread::Get()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -53,7 +53,7 @@ blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetS
+ void PpapiBlinkPlatformImpl::Shutdown() {}
+
+ blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetSandboxSupport() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return sandbox_support_.get();
+ #else
+ return nullptr;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_ppapi__plugin_ppapi__plugin__main.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_ppapi__plugin_ppapi__plugin__main.cc
@@ -0,0 +1,23 @@
+--- src/3rdparty/chromium/content/ppapi_plugin/ppapi_plugin_main.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/ppapi_plugin/ppapi_plugin_main.cc
+@@ -53,6 +53,11 @@
+ #include "gin/v8_initializer.h"
+ #endif
+
++#if BUILDFLAG(IS_OPENBSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#include "sandbox/policy/sandbox_type.h"
++#endif
++
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
+ #include <stdlib.h>
+ #endif
+@@ -136,7 +141,7 @@ int PpapiPluginMain(MainFunctionParams parameters) {
+ gin::V8Initializer::LoadV8Snapshot();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
+ sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox(
+ sandbox::policy::SandboxTypeFromCommandLine(command_line),
+ sandbox::policy::SandboxLinux::PreSandboxHook(),
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_browser_zygote__host_zygote__host__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_browser_zygote__host_zygote__host__linux.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/content/public/browser/zygote_host/zygote_host_linux.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/content/public/browser/zygote_host/zygote_host_linux.h
+@@ -30,11 +30,13 @@ class ZygoteHost {
+ // after the first render has been forked.
+ virtual int GetRendererSandboxStatus() = 0;
+
++#if !defined(OS_BSD)
+ // Adjust the OOM score of the given renderer's PID. The allowed
+ // range for the score is [0, 1000], where higher values are more
+ // likely to be killed by the OOM killer.
+ virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle,
+ int score) = 0;
++#endif
+ };
+
+ } // namespace content
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_common__param__traits__macros.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_common__param__traits__macros.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/public/common/common_param_traits_macros.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/public/common/common_param_traits_macros.h
+@@ -128,7 +128,7 @@ IPC_STRUCT_TRAITS_BEGIN(blink::RendererPreferences)
+ IPC_STRUCT_TRAITS_MEMBER(accept_languages)
+ IPC_STRUCT_TRAITS_MEMBER(plugin_fullscreen_allowed)
+ IPC_STRUCT_TRAITS_MEMBER(caret_browsing_enabled)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ IPC_STRUCT_TRAITS_MEMBER(system_font_family_name)
+ #endif
+ #if BUILDFLAG(IS_WIN)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__features.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__features.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/public/common/content_features.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/public/common/content_features.h
+@@ -264,7 +264,7 @@ CONTENT_EXPORT extern const base::Feature kWebAssembly
+ CONTENT_EXPORT extern const base::Feature kWebAppWindowControlsOverlay;
+ CONTENT_EXPORT extern const base::Feature kWebAssemblyBaseline;
+ CONTENT_EXPORT extern const base::Feature kWebAssemblyCodeProtection;
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64)
+ CONTENT_EXPORT extern const base::Feature kWebAssemblyCodeProtectionPku;
+ #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) &&
+ // defined(ARCH_CPU_X86_64)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__features.cc
@@ -0,0 +1,50 @@
+--- src/3rdparty/chromium/content/public/common/content_features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/public/common/content_features.cc
+@@ -43,7 +43,7 @@ const base::Feature kAudioServiceOutOfProcess {
+ "AudioServiceOutOfProcess",
+ // TODO(crbug.com/1052397): Remove !IS_CHROMEOS_LACROS once lacros starts being
+ // built with OS_CHROMEOS instead of OS_LINUX.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS))
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+@@ -55,7 +55,7 @@ const base::Feature kAudioServiceSandbox {
+ // kAudioServiceOutOfProcess feature is enabled.
+ const base::Feature kAudioServiceSandbox {
+ "AudioServiceSandbox",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -1055,7 +1055,7 @@ const base::Feature kWebAssemblyCodeProtection{
+ const base::Feature kWebAssemblyCodeProtection{
+ "WebAssemblyCodeProtection", base::FEATURE_ENABLED_BY_DEFAULT};
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64)
+ // Use memory protection keys in userspace (PKU) (if available) to protect code
+ // JITed for WebAssembly. Fall back to traditional memory protection if
+ // WebAssemblyCodeProtection is also enabled.
+@@ -1085,7 +1085,7 @@ const base::Feature kWebAssemblyTrapHandler {
+ const base::Feature kWebAssemblyTrapHandler {
+ "WebAssemblyTrapHandler",
+ #if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)) && \
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)) && \
+ defined(ARCH_CPU_X86_64)) || \
+ (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64))
+ base::FEATURE_ENABLED_BY_DEFAULT
+@@ -1166,7 +1166,11 @@ const base::Feature kWebUIReportOnlyTrustedTypes{
+
+ // Controls whether the WebUSB API is enabled:
+ // https://wicg.github.io/webusb
++#if BUILDFLAG(IS_BSD)
++const base::Feature kWebUsb{"WebUSB", base::FEATURE_DISABLED_BY_DEFAULT};
++#else
+ const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
++#endif
+
+ // Controls whether the WebXR Device API is enabled.
+ const base::Feature kWebXr{"WebXR", base::FEATURE_ENABLED_BY_DEFAULT};
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__switches.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__switches.h
@@ -0,0 +1,19 @@
+--- src/3rdparty/chromium/content/public/common/content_switches.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/public/common/content_switches.h
+@@ -117,6 +117,7 @@ CONTENT_EXPORT extern const char kEnableLogging[];
+ CONTENT_EXPORT extern const char kEnableGpuMemoryBufferVideoFrames[];
+ CONTENT_EXPORT extern const char kEnableLCDText[];
+ CONTENT_EXPORT extern const char kEnableLogging[];
++CONTENT_EXPORT extern const char kDisableUnveil[];
+ CONTENT_EXPORT extern const char kEnableNetworkInformationDownlinkMax[];
+ CONTENT_EXPORT extern const char kEnableCanvas2DLayers[];
+ CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[];
+@@ -267,7 +268,7 @@ CONTENT_EXPORT extern const char kRendererWaitForJavaD
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ CONTENT_EXPORT extern const char kEnableSpeechDispatcher[];
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__switches.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_content__switches.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/public/common/content_switches.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/public/common/content_switches.cc
+@@ -370,6 +370,8 @@ const char kEnableLogging[] = "enable-
+ // builds.
+ const char kEnableLogging[] = "enable-logging";
+
++const char kDisableUnveil[] = "disable-unveil";
++
+ // Enables the type, downlinkMax attributes of the NetInfo API. Also, enables
+ // triggering of change attribute of the NetInfo API when there is a change in
+ // the connection type.
+@@ -983,7 +985,7 @@ const char kEnableAutomation[] = "enable-automation";
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Allows sending text-to-speech requests to speech-dispatcher, a common
+ // Linux speech service. Because it's buggy, the user must explicitly
+ // enable it so that visiting a random webpage can't cause instability.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_zygote_features.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_public_common_zygote_features.gni
@@ -0,0 +1,8 @@
+--- src/3rdparty/chromium/content/public/common/zygote/features.gni.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/content/public/common/zygote/features.gni
+@@ -2,4 +2,4 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
+-use_zygote_handle = is_posix && !is_android && !is_mac
++use_zygote_handle = is_posix && !is_android && !is_mac && !is_bsd
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_media_render__media__client.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_media_render__media__client.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/renderer/media/render_media_client.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/renderer/media/render_media_client.cc
+@@ -21,7 +21,7 @@ namespace {
+ // it asynchronously ahead of time, but can fallback to a blocking call
+ // when it's needed synchronously.
+ #if BUILDFLAG(ENABLE_PLATFORM_HEVC) && \
+- (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX))
++ (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ #define NEEDS_PROFILE_UPDATER 1
+ #else
+ #define NEEDS_PROFILE_UPDATER 0
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_render__process__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_render__process__impl.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/renderer/render_process_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/renderer/render_process_impl.cc
+@@ -47,7 +47,7 @@
+ #if BUILDFLAG(IS_WIN)
+ #include "base/win/win_util.h"
+ #endif
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64)
+ #include "v8/include/v8-wasm-trap-handler-posix.h"
+ #endif
+
+@@ -146,7 +146,7 @@ RenderProcessImpl::RenderProcessImpl()
+ SetV8FlagIfNotFeature(features::kWebAssemblyCodeProtection,
+ "--no-wasm-write-protect-code-memory");
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64)
+ SetV8FlagIfFeature(features::kWebAssemblyCodeProtectionPku,
+ "--wasm-memory-protection-keys");
+ SetV8FlagIfNotFeature(features::kWebAssemblyCodeProtectionPku,
+@@ -229,7 +229,7 @@ RenderProcessImpl::RenderProcessImpl()
+ SetV8FlagIfNotFeature(features::kWebAssemblyDynamicTiering,
+ "--no-wasm-dynamic-tiering");
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64)
+ if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
+ if (command_line->HasSwitch(switches::kEnableCrashpad) ||
+ command_line->HasSwitch(switches::kEnableCrashReporter) ||
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_render__thread__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_render__thread__impl.cc
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/content/renderer/render_thread_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/renderer/render_thread_impl.cc
+@@ -189,7 +189,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include <malloc/malloc.h>
+-#else
++#elif !BUILDFLAG(IS_OPENBSD)
+ #include <malloc.h>
+ #endif
+
+@@ -716,7 +716,7 @@ void RenderThreadImpl::Init() {
+ DCHECK(parsed_num_raster_threads) << string_value;
+ DCHECK_GT(num_raster_threads, 0);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ categorized_worker_pool_->SetBackgroundingCallback(
+ main_thread_scheduler_->DefaultTaskRunner(),
+ base::BindOnce(
+@@ -739,7 +739,7 @@ void RenderThreadImpl::Init() {
+ base::DiscardableMemoryAllocator::SetInstance(
+ discardable_memory_allocator_.get());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(
+ blink::features::kBlinkCompositorUseDisplayThreadPriority)) {
+ render_message_filter()->SetThreadPriority(
+@@ -1098,7 +1098,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl:
+
+ const bool enable_video_decode_accelerator =
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FeatureList::IsEnabled(media::kVaapiVideoDecodeLinux) &&
+ #else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
+@@ -1109,7 +1109,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl:
+
+ const bool enable_video_encode_accelerator =
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FeatureList::IsEnabled(media::kVaapiVideoEncodeLinux) &&
+ #else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoEncode) &&
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_renderer__blink__platform__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_renderer__blink__platform__impl.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.h
+@@ -31,7 +31,7 @@
+ #include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom.h"
+ #include "third_party/blink/public/mojom/loader/code_cache.mojom.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/cpp/font_loader.h" // nogncheck
+ #include "third_party/skia/include/core/SkRefCnt.h" // nogncheck
+ #endif
+@@ -280,7 +280,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi
+ void Collect3DContextInformation(blink::Platform::GraphicsInfo* gl_info,
+ const gpu::GPUInfo& gpu_info) const;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
+ #endif
+
+@@ -308,7 +308,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi
+ mutable base::WaitableEvent io_thread_id_ready_event_;
+ base::PlatformThreadId io_thread_id_ = base::kInvalidThreadId;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sk_sp<font_service::FontLoader> font_loader_;
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_renderer__blink__platform__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_renderer__blink__platform__impl.cc
@@ -0,0 +1,48 @@
+--- src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
+@@ -109,7 +109,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include "content/child/child_process_sandbox_support_impl_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/child_process_sandbox_support_impl_linux.h"
+ #endif
+
+@@ -178,7 +178,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
+ main_thread_scheduler_(main_thread_scheduler) {
+ // RenderThread may not exist in some tests.
+ if (RenderThreadImpl::current()) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ RenderThreadImpl::current()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -188,7 +188,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (sandboxEnabled()) {
+ #if BUILDFLAG(IS_MAC)
+ sandbox_support_ = std::make_unique<WebSandboxSupportMac>();
+@@ -283,7 +283,8 @@ RendererBlinkPlatformImpl::WrapSharedURLLoaderFactory(
+ /*terminate_sync_load_event=*/nullptr);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++// pledge
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ void RendererBlinkPlatformImpl::SetDisplayThreadPriority(
+ base::PlatformThreadId thread_id) {
+ if (RenderThreadImpl* render_thread = RenderThreadImpl::current()) {
+@@ -298,7 +299,7 @@ blink::WebSandboxSupport* RendererBlinkPlatformImpl::G
+ }
+
+ blink::WebSandboxSupport* RendererBlinkPlatformImpl::GetSandboxSupport() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return sandbox_support_.get();
+ #else
+ // These platforms do not require sandbox support.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_renderer__main__platform__delegate__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_renderer_renderer__main__platform__delegate__linux.cc
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/content/renderer/renderer_main_platform_delegate_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/renderer/renderer_main_platform_delegate_linux.cc
+@@ -44,6 +44,7 @@ bool RendererMainPlatformDelegate::EnableSandbox() {
+ // any renderer has been started.
+ // Here, we test that the status of SeccompBpf in the renderer is consistent
+ // with what SandboxLinux::GetStatus() said we would do.
++#if !defined(OS_BSD)
+ auto* linux_sandbox = sandbox::policy::SandboxLinux::GetInstance();
+ if (linux_sandbox->GetStatus() & sandbox::policy::SandboxLinux::kSeccompBPF) {
+ CHECK(linux_sandbox->seccomp_bpf_started());
+@@ -65,6 +66,7 @@ bool RendererMainPlatformDelegate::EnableSandbox() {
+ CHECK_EQ(errno, EPERM);
+ }
+ #endif // __x86_64__
++#endif
+
+ return true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_shell_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_shell_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/shell/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/shell/BUILD.gn
+@@ -882,7 +882,7 @@ group("content_shell_crash_test") {
+ if (is_win) {
+ data_deps += [ "//build/win:copy_cdb_to_output" ]
+ }
+- if (is_posix) {
++ if (is_posix && !is_bsd) {
+ data_deps += [
+ "//third_party/breakpad:dump_syms",
+ "//third_party/breakpad:minidump_stackwalk",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_shell_app_shell__main__delegate.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_shell_app_shell__main__delegate.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/shell/app/shell_main_delegate.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/shell/app/shell_main_delegate.cc
+@@ -211,7 +211,7 @@ void ShellMainDelegate::PreSandboxStartup() {
+ // Reporting for sub-processes will be initialized in ZygoteForked.
+ if (process_type != switches::kZygoteProcess) {
+ crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ crash_reporter::SetFirstChanceExceptionHandler(
+ v8::TryHandleWebAssemblyTrapPosix);
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_shell_utility_shell__content__utility__client.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_shell_utility_shell__content__utility__client.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/shell/utility/shell_content_utility_client.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/shell/utility/shell_content_utility_client.cc
+@@ -32,7 +32,7 @@
+ #include "sandbox/policy/sandbox.h"
+ #include "services/test/echo/echo_service.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/test/sandbox_status_service.h"
+ #endif
+
+@@ -142,7 +142,7 @@ void ShellContentUtilityClient::ExposeInterfacesToBrow
+ binders->Add<mojom::PowerMonitorTest>(
+ base::BindRepeating(&PowerMonitorTestImpl::MakeSelfOwnedReceiver),
+ base::ThreadTaskRunnerHandle::Get());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (register_sandbox_status_helper_) {
+ binders->Add<content::mojom::SandboxStatusService>(
+ base::BindRepeating(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_test_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_test_BUILD.gn
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/test/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/test/BUILD.gn
+@@ -1969,7 +1969,7 @@ static_library("run_all_unittests") {
+ ":test_support",
+ "//base/test:test_support",
+ ]
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ deps += [ "//content/common:set_process_title_linux" ]
+ }
+ }
+@@ -3000,7 +3000,7 @@ test("content_unittests") {
+ deps += [ "//third_party/boringssl" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "../common/set_process_title_linux_unittest.cc" ]
+ deps += [ "//content/common:set_process_title_linux" ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_services.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_services.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/content/utility/services.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/utility/services.cc
+@@ -67,7 +67,7 @@ extern sandbox::TargetServices* g_utility_target_servi
+ extern sandbox::TargetServices* g_utility_target_services;
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "sandbox/linux/services/libc_interceptor.h"
+ #include "sandbox/policy/mojom/sandbox.mojom.h"
+ #include "sandbox/policy/sandbox_type.h"
+@@ -205,7 +205,7 @@ auto RunAudio(mojo::PendingReceiver<audio::mojom::Audi
+ << "task_policy_set TASK_QOS_POLICY";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ auto* command_line = base::CommandLine::ForCurrentProcess();
+ if (sandbox::policy::SandboxTypeFromCommandLine(*command_line) ==
+ sandbox::mojom::Sandbox::kNoSandbox) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_speech_speech__recognition__sandbox__hook__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_speech_speech__recognition__sandbox__hook__linux.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.h
+@@ -5,7 +5,11 @@
+ #ifndef CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
+ #define CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
+
++#if defined(OS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace speech {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_speech_speech__recognition__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_speech_speech__recognition__sandbox__hook__linux.cc
@@ -0,0 +1,37 @@
+--- src/3rdparty/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc
+@@ -12,11 +12,14 @@
+ #include "sandbox/linux/syscall_broker/broker_command.h"
+ #include "sandbox/linux/syscall_broker/broker_file_permission.h"
+
++#if !defined(OS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
+ using sandbox::syscall_broker::MakeBrokerCommandSet;
++#endif
+
+ namespace speech {
+
++#if !defined(OS_BSD)
+ namespace {
+
+ // Gets the file permissions required by the Speech On-Device API (SODA).
+@@ -50,9 +53,11 @@ std::vector<BrokerFilePermission> GetSodaFilePermissio
+ }
+
+ } // namespace
++#endif
+
+ bool SpeechRecognitionPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !defined(OS_BSD)
+ #if BUILDFLAG(ENABLE_SODA)
+ base::FilePath test_binary_path = GetSodaTestBinaryPath();
+ DVLOG(0) << "SODA test binary path: " << test_binary_path.value().c_str();
+@@ -77,6 +82,7 @@ bool SpeechRecognitionPreSandboxHook(
+ sandbox::policy::SandboxLinux::PreSandboxHook(),
+ options);
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+
+ return true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_utility__blink__platform__with__sandbox__support__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_utility__blink__platform__with__sandbox__support__impl.h
@@ -0,0 +1,24 @@
+--- src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h
+@@ -10,7 +10,7 @@
+ #include "build/build_config.h"
+ #include "third_party/blink/public/platform/platform.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/cpp/font_loader.h" // nogncheck
+ #include "third_party/skia/include/core/SkRefCnt.h" // nogncheck
+ #endif
+@@ -38,10 +38,10 @@ class UtilityBlinkPlatformWithSandboxSupportImpl : pub
+ blink::WebSandboxSupport* GetSandboxSupport() override;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sk_sp<font_service::FontLoader> font_loader_;
+ #endif
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_utility__blink__platform__with__sandbox__support__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_utility__blink__platform__with__sandbox__support__impl.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc
+@@ -9,7 +9,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include "content/child/child_process_sandbox_support_impl_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/child_process_sandbox_support_impl_linux.h"
+ #endif
+
+@@ -17,7 +17,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl::
+
+ UtilityBlinkPlatformWithSandboxSupportImpl::
+ UtilityBlinkPlatformWithSandboxSupportImpl() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ UtilityThread::Get()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -34,7 +34,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl::GetSandbox
+
+ blink::WebSandboxSupport*
+ UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return sandbox_support_.get();
+ #else
+ return nullptr;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_utility__main.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_utility_utility__main.cc
@@ -0,0 +1,79 @@
+--- src/3rdparty/chromium/content/utility/utility_main.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/utility/utility_main.cc
+@@ -32,18 +32,20 @@
+ #include "third_party/icu/source/common/unicode/unistr.h"
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h"
+ #include "content/utility/speech/speech_recognition_sandbox_hook_linux.h"
+ #if BUILDFLAG(ENABLE_PRINTING)
+ #include "printing/sandbox/print_backend_sandbox_hook_linux.h"
+ #endif
++#if !BUILDFLAG(IS_BSD)
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "services/audio/audio_sandbox_hook_linux.h"
+ #include "services/network/network_sandbox_hook_linux.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "gpu/config/gpu_info_collector.h"
+ #include "media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h"
+
+@@ -52,6 +54,10 @@
+ #include "third_party/angle/src/gpu_info_util/SystemInfo.h" // nogncheck
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#endif
++
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ #include "ash/services/ime/ime_sandbox_hook.h"
+ #include "chromeos/assistant/buildflags.h"
+@@ -139,7 +145,7 @@ int UtilityMain(MainFunctionParams parameters) {
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Initializes the sandbox before any threads are created.
+ // TODO(jorgelo): move this after GTK initialization when we enable a strict
+ // Seccomp-BPF policy.
+@@ -169,7 +175,7 @@ int UtilityMain(MainFunctionParams parameters) {
+ pre_sandbox_hook = base::BindOnce(&screen_ai::ScreenAIPreSandboxHook);
+ #endif
+ break;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case sandbox::mojom::Sandbox::kHardwareVideoDecoding:
+ pre_sandbox_hook =
+ base::BindOnce(&media::HardwareVideoDecodingPreSandboxHook);
+@@ -192,10 +198,11 @@ int UtilityMain(MainFunctionParams parameters) {
+ default:
+ break;
+ }
++#if !BUILDFLAG(IS_BSD)
+ if (!sandbox::policy::IsUnsandboxedSandboxType(sandbox_type) &&
+ (parameters.zygote_child || !pre_sandbox_hook.is_null())) {
+ sandbox::policy::SandboxLinux::Options sandbox_options;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ if (sandbox_type == sandbox::mojom::Sandbox::kHardwareVideoDecoding) {
+ // The kHardwareVideoDecoding sandbox needs to know the GPU type in order
+ // to select the right policy.
+@@ -208,6 +215,11 @@ int UtilityMain(MainFunctionParams parameters) {
+ sandbox::policy::Sandbox::Initialize(
+ sandbox_type, std::move(pre_sandbox_hook), sandbox_options);
+ }
++#else
++ sandbox::policy::Sandbox::Initialize(
++ sandbox_type, std::move(pre_sandbox_hook),
++ sandbox::policy::SandboxLinux::Options());
++#endif
+ #elif BUILDFLAG(IS_WIN)
+ g_utility_target_services = parameters.sandbox_info->target_services;
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_zygote_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_zygote_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/content/zygote/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/zygote/BUILD.gn
+@@ -5,7 +5,7 @@ import("//content/public/common/zygote/features.gni")
+ import("//build/config/nacl/config.gni")
+ import("//content/public/common/zygote/features.gni")
+
+-if (is_linux || is_chromeos) {
++if ((is_linux || is_chromeos) && !is_bsd) {
+ source_set("zygote") {
+ sources = [
+ "zygote_linux.cc",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_zygote_zygote__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_zygote_zygote__linux.cc
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/content/zygote/zygote_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/zygote/zygote_linux.cc
+@@ -1,6 +1,7 @@
+ // Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
++#if 0
+
+ #include "content/zygote/zygote_linux.h"
+
+@@ -654,3 +655,4 @@ bool Zygote::HandleGetSandboxStatus(int fd, base::Pick
+ }
+
+ } // namespace content
++#endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_content_zygote_zygote__main__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_content_zygote_zygote__main__linux.cc
@@ -0,0 +1,64 @@
+--- src/3rdparty/chromium/content/zygote/zygote_main_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/content/zygote/zygote_main_linux.cc
+@@ -11,7 +11,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
++#if !defined(OS_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -40,7 +42,9 @@
+ #include "sandbox/linux/services/thread_helpers.h"
+ #include "sandbox/linux/suid/client/setuid_sandbox_client.h"
+ #include "sandbox/policy/linux/sandbox_debug_handling_linux.h"
++#if !defined(OS_BSD)
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "sandbox/policy/sandbox.h"
+ #include "sandbox/policy/switches.h"
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+@@ -49,6 +53,7 @@ namespace {
+
+ namespace {
+
++#if !defined(OS_BSD)
+ void CloseFds(const std::vector<int>& fds) {
+ for (const auto& it : fds) {
+ PCHECK(0 == IGNORE_EINTR(close(it)));
+@@ -66,9 +71,11 @@ base::OnceClosure ClosureFromTwoClosures(base::OnceClo
+ },
+ std::move(one), std::move(two));
+ }
++#endif
+
+ } // namespace
+
++#if !defined(OS_BSD)
+ // This function triggers the static and lazy construction of objects that need
+ // to be created before imposing the sandbox.
+ static void ZygotePreSandboxInit() {
+@@ -175,9 +182,11 @@ static void EnterLayerOneSandbox(sandbox::policy::Sand
+ CHECK(!using_layer1_sandbox);
+ }
+ }
++#endif
+
+ bool ZygoteMain(
+ std::vector<std::unique_ptr<ZygoteForkDelegate>> fork_delegates) {
++#if !defined(OS_BSD)
+ sandbox::SetAmZygoteOrRenderer(true, GetSandboxFD());
+
+ auto* linux_sandbox = sandbox::policy::SandboxLinux::GetInstance();
+@@ -243,6 +252,9 @@ bool ZygoteMain(
+
+ // This function call can return multiple times, once per fork().
+ return zygote.ProcessRequests();
++#else
++ return false;
++#endif
+ }
+
+ } // namespace content
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_common_gpu__memory__buffer__support.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_common_gpu__memory__buffer__support.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc
+@@ -134,7 +134,7 @@ uint32_t GetPlatformSpecificTextureTarget() {
+ #if BUILDFLAG(IS_MAC)
+ return macos_specific_texture_target;
+ #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return GL_TEXTURE_EXTERNAL_OES;
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return GL_TEXTURE_2D;
+@@ -166,7 +166,7 @@ GPU_EXPORT bool NativeBufferNeedsPlatformSpecificTextu
+ gfx::BufferFormat format,
+ gfx::BufferPlane plane) {
+ #if defined(USE_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Always use GL_TEXTURE_2D as the target for RGB textures.
+ // https://crbug.com/916728
+ if (format == gfx::BufferFormat::R_8 || format == gfx::BufferFormat::RG_88 ||
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_external__vk__image__backing.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_external__vk__image__backing.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/command_buffer/service/external_vk_image_backing.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/service/external_vk_image_backing.cc
+@@ -30,7 +30,7 @@
+ #include "ui/gl/gl_version_info.h"
+ #include "ui/gl/scoped_binders.h"
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && BUILDFLAG(USE_DAWN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN)
+ #include "gpu/command_buffer/service/external_vk_image_dawn_representation.h"
+ #endif
+
+@@ -570,7 +570,7 @@ ExternalVkImageBacking::ProduceDawn(SharedImageManager
+ MemoryTypeTracker* tracker,
+ WGPUDevice wgpuDevice,
+ WGPUBackendType backend_type) {
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && BUILDFLAG(USE_DAWN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN)
+ auto wgpu_format = viz::ToWGPUFormat(format());
+
+ if (wgpu_format == WGPUTextureFormat_Undefined) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc
+@@ -577,7 +577,7 @@ bool SharedImageBackingFactoryAngleVulkan::CanUseAngle
+ // TODO(penghuang): verify the scanout is the right usage for video playback.
+ // crbug.com/1280798
+ constexpr auto kSupportedUsages =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ SHARED_IMAGE_USAGE_SCANOUT |
+ #endif
+ SHARED_IMAGE_USAGE_GLES2 | SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT |
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__backing__factory__gl__texture.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__backing__factory__gl__texture.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc
+@@ -145,7 +145,7 @@ bool SharedImageBackingFactoryGLTexture::IsSupported(
+ // Linux and ChromeOS support WebGPU/Compat on GL. All other platforms
+ // do not support WebGPU on GL.
+ if (usage & SHARED_IMAGE_USAGE_WEBGPU) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ if (use_webgpu_adapter_ != WebGPUAdapterName::kCompat) {
+ return false;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__backing__gl__texture.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__backing__gl__texture.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc
+@@ -257,7 +257,7 @@ void SharedImageBackingGLTexture::CreateEGLImage() {
+ }
+
+ void SharedImageBackingGLTexture::CreateEGLImage() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ SharedContextState* shared_context_state = factory()->GetSharedContextState();
+ ui::ScopedMakeCurrent smc(shared_context_state->context(),
+ shared_context_state->surface());
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_shared__image__factory.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/gpu/command_buffer/service/shared_image_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/service/shared_image_factory.cc
+@@ -46,7 +46,7 @@
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(ENABLE_VULKAN)
+ #include "gpu/command_buffer/service/external_vk_image_factory.h"
+ #elif BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_VULKAN)
+@@ -81,7 +81,7 @@ namespace gpu {
+
+ namespace gpu {
+
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
+ !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMECAST) && \
+ BUILDFLAG(ENABLE_VULKAN)
+
+@@ -325,7 +325,7 @@ SharedImageFactory::SharedImageFactory(
+ factories_.push_back(std::move(external_vk_image_factory));
+ }
+ #elif defined(USE_OZONE)
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
+ !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMECAST)
+ // Desktop Linux, not ChromeOS.
+ if (gr_context_type_ == GrContextType::kVulkan &&
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_webgpu__decoder__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_webgpu__decoder__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc
+@@ -1536,7 +1536,7 @@ error::Error WebGPUDecoderImpl::HandleRequestAdapter(
+
+ if (gr_context_type_ != GrContextType::kVulkan &&
+ use_webgpu_adapter_ != WebGPUAdapterName::kCompat) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ SendAdapterProperties(request_adapter_serial, -1, nullptr,
+ "WebGPU on Linux requires command-line flag "
+ "--enable-features=Vulkan,UseSkiaRenderer");
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_config_gpu__control__list.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_config_gpu__control__list.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/config/gpu_control_list.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/config/gpu_control_list.cc
+@@ -261,7 +261,7 @@ GpuControlList::GLType GpuControlList::More::GetDefaul
+ GpuControlList::GLType GpuControlList::More::GetDefaultGLType() {
+ #if BUILDFLAG(IS_CHROMEOS)
+ return kGLTypeGL;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OPENBSD)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return kGLTypeGL;
+ #elif BUILDFLAG(IS_MAC)
+ return kGLTypeGL;
+@@ -784,7 +784,7 @@ GpuControlList::OsType GpuControlList::GetOsType() {
+ return kOsAndroid;
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return kOsFuchsia;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OPENBSD)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return kOsLinux;
+ #elif BUILDFLAG(IS_MAC)
+ return kOsMacosx;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_config_gpu__test__config.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_config_gpu__test__config.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/config/gpu_test_config.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/config/gpu_test_config.cc
+@@ -29,7 +29,7 @@ GPUTestConfig::OS GetCurrentOS() {
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ return GPUTestConfig::kOsChromeOS;
+ #elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_OPENBSD)
++ BUILDFLAG(IS_BSD)
+ return GPUTestConfig::kOsLinux;
+ #elif BUILDFLAG(IS_WIN)
+ int32_t major_version = 0;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_common_gpu__memory__buffer__support.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_common_gpu__memory__buffer__support.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/ipc/common/gpu_memory_buffer_support.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/ipc/common/gpu_memory_buffer_support.h
+@@ -18,7 +18,7 @@
+ #include "ui/gfx/geometry/size.h"
+ #include "ui/gfx/gpu_memory_buffer.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ namespace gfx {
+ class ClientNativePixmapFactory;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_common_gpu__memory__buffer__support.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_common_gpu__memory__buffer__support.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/ipc/common/gpu_memory_buffer_support.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/ipc/common/gpu_memory_buffer_support.cc
+@@ -21,7 +21,7 @@
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif
+
+-#if defined(USE_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if defined(USE_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h"
+ #endif
+
+@@ -50,7 +50,7 @@ GpuMemoryBufferSupport::GetNativeGpuMemoryBufferType()
+ return gfx::IO_SURFACE_BUFFER;
+ #elif BUILDFLAG(IS_ANDROID)
+ return gfx::ANDROID_HARDWARE_BUFFER;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ return gfx::NATIVE_PIXMAP;
+ #elif BUILDFLAG(IS_WIN)
+ return gfx::DXGI_SHARED_HANDLE;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_service_gpu__init.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_service_gpu__init.cc
@@ -0,0 +1,65 @@
+--- src/3rdparty/chromium/gpu/ipc/service/gpu_init.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/ipc/service/gpu_init.cc
+@@ -317,7 +317,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ enable_watchdog = false;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool gpu_sandbox_start_early = gpu_preferences_.gpu_sandbox_start_early;
+ #else // !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
+ // For some reasons MacOSX's VideoToolbox might crash when called after
+@@ -367,7 +367,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ }
+
+ bool attempted_startsandbox = false;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Chrome OS ARM Mali, GPU driver userspace creates threads when
+ // initializing a GL context, so start the sandbox early.
+ // TODO(zmo): Need to collect OS version before this.
+@@ -416,7 +416,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+
+ if (gl_initialized && gl_use_swiftshader_ &&
+ !gl::IsSoftwareGLImplementation(gl::GetGLImplementationParts())) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
+ << "on Linux";
+ return false;
+@@ -449,7 +449,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The ContentSandboxHelper is currently the only one implementation of
+ // GpuSandboxHelper and it has no dependency. Except on Linux where
+ // VaapiWrapper checks the GL implementation to determine which display
+@@ -508,7 +508,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ command_line, gpu_feature_info_,
+ gpu_preferences_.disable_software_rasterizer, false);
+ if (gl_use_swiftshader_) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
+ << "on Linux";
+ return false;
+@@ -631,7 +631,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+
+ InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Driver may create a compatibility profile context when collect graphics
+ // information on Linux platform. Try to collect graphics information
+ // based on core profile context after disabling platform extensions.
+@@ -861,7 +861,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c
+
+ InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Driver may create a compatibility profile context when collect graphics
+ // information on Linux platform. Try to collect graphics information
+ // based on core profile context after disabling platform extensions.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_service_gpu__memory__buffer__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_service_gpu__memory__buffer__factory.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/ipc/service/gpu_memory_buffer_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/ipc/service/gpu_memory_buffer_factory.cc
+@@ -12,7 +12,7 @@
+ #include "gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h"
+ #endif
+
+@@ -34,7 +34,7 @@ GpuMemoryBufferFactory::CreateNativeType(
+ return std::make_unique<GpuMemoryBufferFactoryIOSurface>();
+ #elif BUILDFLAG(IS_ANDROID)
+ return std::make_unique<GpuMemoryBufferFactoryAndroidHardwareBuffer>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ return std::make_unique<GpuMemoryBufferFactoryNativePixmap>(
+ vulkan_context_provider);
+ #elif BUILDFLAG(IS_WIN)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_service_x__util.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_ipc_service_x__util.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/gpu/ipc/service/x_util.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/ipc/service/x_util.h
+@@ -11,11 +11,11 @@
+ #include "build/build_config.h"
+ #include "gpu/ipc/service/gpu_config.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/buildflags.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(OZONE_PLATFORM_X11)
+
+ namespace gpu {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_generate__bindings.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_generate__bindings.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/vulkan/generate_bindings.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/generate_bindings.py
+@@ -259,7 +259,7 @@ VULKAN_DEVICE_FUNCTIONS = [
+ ]
+ },
+ {
+- 'ifdef': 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)',
++ 'ifdef': 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)',
+ 'extension': 'VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME',
+ 'functions': [
+ 'vkGetImageDrmFormatModifierPropertiesEXT',
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__device__queue.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__device__queue.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/vulkan/vulkan_device_queue.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/vulkan_device_queue.h
+@@ -155,7 +155,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanDeviceQueue {
+
+ bool allow_protected_memory_ = false;
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures
+ sampler_ycbcr_conversion_features_{
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES};
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__device__queue.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__device__queue.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/vulkan/vulkan_device_queue.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/vulkan_device_queue.cc
+@@ -85,7 +85,7 @@ bool VulkanDeviceQueue::Initialize(
+
+ // In dual-CPU cases, we cannot detect the active GPU correctly on Linux,
+ // so don't select GPU device based on the |gpu_info|.
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // If gpu_info is provided, the device should match it.
+ if (gpu_info && (device_properties.vendorID != gpu_info->gpu.vendor_id ||
+ device_properties.deviceID != gpu_info->gpu.device_id)) {
+@@ -229,7 +229,7 @@ bool VulkanDeviceQueue::Initialize(
+ enabled_device_features_2_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2};
+
+ // Android, Fuchsia, and Linux(VaapiVideoDecoder) need YCbCr sampler support.
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!physical_device_info.feature_sampler_ycbcr_conversion) {
+ LOG(ERROR) << "samplerYcbcrConversion is not supported.";
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__function__pointers.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__function__pointers.h
@@ -0,0 +1,27 @@
+--- src/3rdparty/chromium/gpu/vulkan/vulkan_function_pointers.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/vulkan_function_pointers.h
+@@ -305,7 +305,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers
+ VulkanFunction<PFN_vkGetSwapchainImagesKHR> vkGetSwapchainImagesKHR;
+ VulkanFunction<PFN_vkQueuePresentKHR> vkQueuePresentKHR;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VulkanFunction<PFN_vkGetImageDrmFormatModifierPropertiesEXT>
+ vkGetImageDrmFormatModifierPropertiesEXT;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -1212,7 +1212,7 @@ ALWAYS_INLINE VkResult vkQueuePresentKHR(VkQueue queue
+ pPresentInfo);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierPropertiesEXT(
+ VkDevice device,
+ VkImage image,
+@@ -1222,4 +1222,4 @@ ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierProp
+ }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
+\ No newline at end of file
++#endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__function__pointers.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__function__pointers.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/vulkan/vulkan_function_pointers.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/vulkan_function_pointers.cc
+@@ -1151,7 +1151,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (gfx::HasExtension(enabled_extensions,
+ VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME)) {
+ vkGetImageDrmFormatModifierPropertiesEXT =
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__image.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__image.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/gpu/vulkan/vulkan_image.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/vulkan_image.h
+@@ -86,7 +86,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanImage {
+ VkImageUsageFlags usage,
+ VkImageCreateFlags flags);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static std::unique_ptr<VulkanImage> CreateWithExternalMemoryAndModifiers(
+ VulkanDeviceQueue* device_queue,
+ const gfx::Size& size,
+@@ -170,7 +170,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanImage {
+ VkImageTiling image_tiling,
+ uint32_t queue_family_index);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool InitializeWithExternalMemoryAndModifiers(VulkanDeviceQueue* device_queue,
+ const gfx::Size& size,
+ VkFormat format,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__image.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_gpu_vulkan_vulkan__image.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/gpu/vulkan/vulkan_image.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/gpu/vulkan/vulkan_image.cc
+@@ -324,7 +324,7 @@ bool VulkanImage::InitializeWithExternalMemory(
+
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ VkPhysicalDeviceImageDrmFormatModifierInfoEXT modifier_info = {
+ .sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__channel.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__channel.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ipc/ipc_channel.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ipc/ipc_channel.h
+@@ -235,7 +235,7 @@ class COMPONENT_EXPORT(IPC) Channel : public Sender {
+ static std::string GenerateUniqueRandomChannelID();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Sandboxed processes live in a PID namespace, so when sending the IPC hello
+ // message from client to server we need to send the PID from the global
+ // PID namespace.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__channel__common.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__channel__common.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ipc/ipc_channel_common.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ipc/ipc_channel_common.cc
+@@ -11,7 +11,7 @@ namespace IPC {
+
+ namespace IPC {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ namespace {
+ int g_global_pid = 0;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__channel__mojo.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__channel__mojo.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ipc/ipc_channel_mojo.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ipc/ipc_channel_mojo.cc
+@@ -112,7 +112,7 @@ base::ProcessId GetSelfPID() {
+ };
+
+ base::ProcessId GetSelfPID() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (int global_pid = Channel::GetGlobalPid())
+ return global_pid;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__message__utils.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__message__utils.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ipc/ipc_message_utils.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ipc/ipc_message_utils.h
+@@ -212,7 +212,7 @@ struct ParamTraits<unsigned int> {
+ // Since we want to support Android 32<>64 bit IPC, as long as we don't have
+ // these traits for 32 bit ARM then that'll catch any errors.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ template <>
+ struct ParamTraits<long> {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__message__utils.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ipc_ipc__message__utils.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ipc/ipc_message_utils.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ipc/ipc_message_utils.cc
+@@ -359,7 +359,7 @@ void ParamTraits<unsigned int>::Log(const param_type&
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ void ParamTraits<long>::Log(const param_type& p, std::string* l) {
+ l->append(base::NumberToString(p));
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_BUILD.gn
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/media/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/BUILD.gn
+@@ -78,6 +78,9 @@ config("media_config") {
+ defines += [ "DLOPEN_PULSEAUDIO" ]
+ }
+ }
++ if (use_sndio) {
++ defines += [ "USE_SNDIO" ]
++ }
+ if (use_cras) {
+ defines += [ "USE_CRAS" ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_BUILD.gn
@@ -0,0 +1,24 @@
+--- src/3rdparty/chromium/media/audio/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/audio/BUILD.gn
+@@ -241,9 +241,20 @@ source_set("audio") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !use_sndio) {
+ sources += [ "linux/audio_manager_linux.cc" ]
+ }
++
++ if (use_sndio) {
++ libs += [ "sndio" ]
++ sources += [
++ "sndio/audio_manager_sndio.cc",
++ "sndio/sndio_input.cc",
++ "sndio/sndio_input.h",
++ "sndio/sndio_output.cc",
++ "sndio/sndio_output.h"
++ ]
++ }
+
+ if (use_alsa) {
+ libs += [ "asound" ]
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_alsa_audio__manager__alsa.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_alsa_audio__manager__alsa.cc
@@ -0,0 +1,54 @@
+--- src/3rdparty/chromium/media/audio/alsa/audio_manager_alsa.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/audio/alsa/audio_manager_alsa.cc
+@@ -88,7 +88,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType
+ int card = -1;
+
+ // Loop through the sound cards to get ALSA device hints.
++#if !BUILDFLAG(IS_BSD)
+ while (!wrapper_->CardNext(&card) && card >= 0) {
++#endif
+ void** hints = NULL;
+ int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
+ if (!error) {
+@@ -100,7 +102,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType
+ DLOG(WARNING) << "GetAlsaAudioDevices: unable to get device hints: "
+ << wrapper_->StrError(error);
+ }
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+ }
+
+ void AudioManagerAlsa::GetAlsaDevicesInfo(AudioManagerAlsa::StreamType type,
+@@ -183,7 +187,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvailable(
+ // goes through software conversion if needed (e.g. incompatible
+ // sample rate).
+ // TODO(joi): Should we prefer "hw" instead?
++#if BUILDFLAG(IS_BSD)
++ static const char kDeviceTypeDesired[] = "plug";
++#else
+ static const char kDeviceTypeDesired[] = "plughw";
++#endif
+ return strncmp(kDeviceTypeDesired, device_name,
+ std::size(kDeviceTypeDesired) - 1) == 0;
+ }
+@@ -205,7 +213,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice(
+ // Loop through the sound cards.
+ // Don't use snd_device_name_hint(-1,..) since there is an access violation
+ // inside this ALSA API with libasound.so.2.0.0.
++#if !BUILDFLAG(IS_BSD)
+ while (!wrapper_->CardNext(&card) && (card >= 0) && !has_device) {
++#endif
+ int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
+ if (!error) {
+ for (void** hint_iter = hints; *hint_iter != NULL; hint_iter++) {
+@@ -229,7 +239,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice(
+ DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: "
+ << wrapper_->StrError(error);
+ }
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+
+ return has_device;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_audio__features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_audio__features.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/audio/audio_features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/audio/audio_features.cc
+@@ -19,7 +19,7 @@ const base::Feature kAudioServiceOutOfProcessKillAtHan
+ const base::Feature kAudioServiceOutOfProcessKillAtHang{
+ "AudioServiceOutOfProcessKillAtHang",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_audio__input__device.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_audio__input__device.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/audio/audio_input_device.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/audio/audio_input_device.cc
+@@ -260,7 +260,7 @@ void AudioInputDevice::OnStreamCreated(
+ // here. See comments in AliveChecker and PowerObserverHelper for details and
+ // todos.
+ if (detect_dead_stream_ == DeadStreamDetection::kEnabled) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const bool stop_at_first_alive_notification = true;
+ const bool pause_check_during_suspend = false;
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_audio__manager__sndio.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_audio__manager__sndio.h
@@ -0,0 +1,69 @@
+--- src/3rdparty/chromium/media/audio/sndio/audio_manager_sndio.h.orig 2022-11-14 07:13:51 UTC
++++ src/3rdparty/chromium/media/audio/sndio/audio_manager_sndio.h
+@@ -0,0 +1,66 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_
++#define MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_
++
++#include <set>
++
++#include "base/compiler_specific.h"
++#include "base/memory/ref_counted.h"
++#include "base/threading/thread.h"
++#include "media/audio/audio_manager_base.h"
++
++namespace media {
++
++class MEDIA_EXPORT AudioManagerSndio : public AudioManagerBase {
++ public:
++ AudioManagerSndio(std::unique_ptr<AudioThread> audio_thread,
++ AudioLogFactory* audio_log_factory);
++
++ AudioManagerSndio(const AudioManagerSndio&) = delete;
++ AudioManagerSndio& operator=(const AudioManagerSndio&) = delete;
++
++ ~AudioManagerSndio() override;
++
++ // Implementation of AudioManager.
++ bool HasAudioOutputDevices() override;
++ bool HasAudioInputDevices() override;
++ void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
++ void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override;
++ AudioParameters GetInputStreamParameters(
++ const std::string& device_id) override;
++ const char* GetName() override;
++
++ // Implementation of AudioManagerBase.
++ AudioOutputStream* MakeLinearOutputStream(
++ const AudioParameters& params,
++ const LogCallback& log_callback) override;
++ AudioOutputStream* MakeLowLatencyOutputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) override;
++ AudioInputStream* MakeLinearInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) override;
++ AudioInputStream* MakeLowLatencyInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) override;
++
++ protected:
++ AudioParameters GetPreferredOutputStreamParameters(
++ const std::string& output_device_id,
++ const AudioParameters& input_params) override;
++
++ private:
++ // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream.
++ AudioOutputStream* MakeOutputStream(const AudioParameters& params);
++ AudioInputStream* MakeInputStream(const AudioParameters& params);
++};
++
++} // namespace media
++
++#endif // MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_audio__manager__sndio.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_audio__manager__sndio.cc
@@ -0,0 +1,184 @@
+--- src/3rdparty/chromium/media/audio/sndio/audio_manager_sndio.cc.orig 2022-11-14 07:13:48 UTC
++++ src/3rdparty/chromium/media/audio/sndio/audio_manager_sndio.cc
+@@ -0,0 +1,181 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/command_line.h"
++#include "base/metrics/histogram_macros.h"
++#include "base/memory/ptr_util.h"
++
++#include "media/audio/sndio/audio_manager_sndio.h"
++
++#include "media/audio/audio_device_description.h"
++#include "media/audio/audio_output_dispatcher.h"
++#if defined(USE_SNDIO)
++#include "media/audio/sndio/sndio_input.h"
++#include "media/audio/sndio/sndio_output.h"
++#endif
++#include "media/audio/fake_audio_manager.h"
++#include "media/base/limits.h"
++#include "media/base/media_switches.h"
++
++namespace media {
++
++enum SndioAudioIO {
++ kPulse,
++ kSndio,
++ kAudioIOMax = kSndio
++};
++
++#if defined(USE_SNDIO)
++// Maximum number of output streams that can be open simultaneously.
++static const int kMaxOutputStreams = 50;
++
++// Default sample rate for input and output streams.
++static const int kDefaultSampleRate = 48000;
++
++void AddDefaultDevice(AudioDeviceNames* device_names) {
++ DCHECK(device_names->empty());
++ device_names->push_front(AudioDeviceName::CreateDefault());
++}
++
++bool AudioManagerSndio::HasAudioOutputDevices() {
++ return true;
++}
++
++bool AudioManagerSndio::HasAudioInputDevices() {
++ return true;
++}
++
++void AudioManagerSndio::GetAudioInputDeviceNames(
++ AudioDeviceNames* device_names) {
++ DCHECK(device_names->empty());
++ AddDefaultDevice(device_names);
++}
++
++void AudioManagerSndio::GetAudioOutputDeviceNames(
++ AudioDeviceNames* device_names) {
++ AddDefaultDevice(device_names);
++}
++
++#if defined(USE_SNDIO)
++const char* AudioManagerSndio::GetName() {
++ return "SNDIO";
++}
++#endif
++
++AudioParameters AudioManagerSndio::GetInputStreamParameters(
++ const std::string& device_id) {
++ static const int kDefaultInputBufferSize = 1024;
++
++ int user_buffer_size = GetUserBufferSize();
++ int buffer_size = user_buffer_size ?
++ user_buffer_size : kDefaultInputBufferSize;
++
++ return AudioParameters(
++ AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO,
++ kDefaultSampleRate, buffer_size);
++}
++
++AudioManagerSndio::AudioManagerSndio(std::unique_ptr<AudioThread> audio_thread,
++ AudioLogFactory* audio_log_factory)
++ : AudioManagerBase(std::move(audio_thread),
++ audio_log_factory) {
++ DLOG(WARNING) << "AudioManagerSndio";
++ SetMaxOutputStreamsAllowed(kMaxOutputStreams);
++}
++
++AudioManagerSndio::~AudioManagerSndio() = default;
++
++AudioOutputStream* AudioManagerSndio::MakeLinearOutputStream(
++ const AudioParameters& params,
++ const LogCallback& log_callback) {
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
++ return MakeOutputStream(params);
++}
++
++AudioOutputStream* AudioManagerSndio::MakeLowLatencyOutputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) {
++ DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!";
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
++ return MakeOutputStream(params);
++}
++
++AudioInputStream* AudioManagerSndio::MakeLinearInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) {
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
++ return MakeInputStream(params);
++}
++
++AudioInputStream* AudioManagerSndio::MakeLowLatencyInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) {
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
++ return MakeInputStream(params);
++}
++
++AudioParameters AudioManagerSndio::GetPreferredOutputStreamParameters(
++ const std::string& output_device_id,
++ const AudioParameters& input_params) {
++ // TODO(tommi): Support |output_device_id|.
++ DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!";
++ static const int kDefaultOutputBufferSize = 2048;
++
++ ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO;
++ int sample_rate = kDefaultSampleRate;
++ int buffer_size = kDefaultOutputBufferSize;
++ if (input_params.IsValid()) {
++ sample_rate = input_params.sample_rate();
++ channel_layout = input_params.channel_layout();
++ buffer_size = std::min(buffer_size, input_params.frames_per_buffer());
++ }
++
++ int user_buffer_size = GetUserBufferSize();
++ if (user_buffer_size)
++ buffer_size = user_buffer_size;
++
++ return AudioParameters(
++ AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
++ sample_rate, buffer_size);
++}
++
++AudioInputStream* AudioManagerSndio::MakeInputStream(
++ const AudioParameters& params) {
++ DLOG(WARNING) << "MakeInputStream";
++ return new SndioAudioInputStream(this,
++ AudioDeviceDescription::kDefaultDeviceId, params);
++}
++
++AudioOutputStream* AudioManagerSndio::MakeOutputStream(
++ const AudioParameters& params) {
++ DLOG(WARNING) << "MakeOutputStream";
++ return new SndioAudioOutputStream(params, this);
++}
++#endif
++
++std::unique_ptr<media::AudioManager> CreateAudioManager(
++ std::unique_ptr<AudioThread> audio_thread,
++ AudioLogFactory* audio_log_factory) {
++ DLOG(WARNING) << "CreateAudioManager";
++ // For testing allow audio output to be disabled.
++ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
++ switches::kDisableAudioOutput)) {
++ return std::make_unique<FakeAudioManager>(std::move(audio_thread),
++ audio_log_factory);
++ }
++#if defined(USE_SNDIO)
++ UMA_HISTOGRAM_ENUMERATION("Media.SndioAudioIO", kSndio, kAudioIOMax + 1);
++ return std::make_unique<AudioManagerSndio>(std::move(audio_thread),
++ audio_log_factory);
++#else
++ return std::make_unique<FakeAudioManager>(std::move(audio_thread),
++ audio_log_factory);
++#endif
++
++}
++
++} // namespace media
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.h
@@ -0,0 +1,94 @@
+--- src/3rdparty/chromium/media/audio/sndio/sndio_input.h.orig 2022-11-14 07:14:36 UTC
++++ src/3rdparty/chromium/media/audio/sndio/sndio_input.h
+@@ -0,0 +1,91 @@
++// Copyright 2013 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_
++#define MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_
++
++#include <stdint.h>
++#include <string>
++#include <sndio.h>
++
++#include "base/compiler_specific.h"
++#include "base/memory/weak_ptr.h"
++#include "base/time/time.h"
++#include "media/audio/agc_audio_stream.h"
++#include "media/audio/audio_io.h"
++#include "media/audio/audio_device_description.h"
++#include "media/base/audio_parameters.h"
++
++namespace media {
++
++class AudioManagerBase;
++
++// Implementation of AudioOutputStream using sndio(7)
++class SndioAudioInputStream : public AgcAudioStream<AudioInputStream> {
++ public:
++ // Pass this to the constructor if you want to attempt auto-selection
++ // of the audio recording device.
++ static const char kAutoSelectDevice[];
++
++ // Create a PCM Output stream for the SNDIO device identified by
++ // |device_name|. If unsure of what to use for |device_name|, use
++ // |kAutoSelectDevice|.
++ SndioAudioInputStream(AudioManagerBase* audio_manager,
++ const std::string& device_name,
++ const AudioParameters& params);
++
++ SndioAudioInputStream(const SndioAudioInputStream&) = delete;
++ SndioAudioInputStream& operator=(const SndioAudioInputStream&) = delete;
++
++ ~SndioAudioInputStream() override;
++
++ // Implementation of AudioInputStream.
++ OpenOutcome Open() override;
++ void Start(AudioInputCallback* callback) override;
++ void Stop() override;
++ void Close() override;
++ double GetMaxVolume() override;
++ void SetVolume(double volume) override;
++ double GetVolume() override;
++ bool IsMuted() override;
++ void SetOutputDeviceForAec(const std::string& output_device_id) override;
++
++ private:
++
++ enum StreamState {
++ kClosed, // Not opened yet
++ kStopped, // Device opened, but not started yet
++ kRunning, // Started, device playing
++ kStopWait // Stopping, waiting for the real-time thread to exit
++ };
++
++ // C-style call-backs
++ static void OnMoveCallback(void *arg, int delta);
++ static void* ThreadEntry(void *arg);
++
++ // Continuously moves data from the device to the consumer
++ void ThreadLoop();
++ // Our creator, the audio manager needs to be notified when we close.
++ AudioManagerBase* manager;
++ // Parameters of the source
++ AudioParameters params;
++ // We store data here for consumer
++ std::unique_ptr<AudioBus> audio_bus;
++ // Call-back that consumes recorded data
++ AudioInputCallback* callback; // Valid during a recording session.
++ // Handle of the audio device
++ struct sio_hdl* hdl;
++ // Current state of the stream
++ enum StreamState state;
++ // High priority thread running ThreadLoop()
++ pthread_t thread;
++ // Number of frames buffered in the hardware
++ int hw_delay;
++ // Temporary buffer where data is stored sndio-compatible format
++ char* buffer;
++};
++
++} // namespace media
++
++#endif // MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc
@@ -0,0 +1,204 @@
+--- src/3rdparty/chromium/media/audio/sndio/sndio_input.cc.orig 2022-11-14 07:14:34 UTC
++++ src/3rdparty/chromium/media/audio/sndio/sndio_input.cc
+@@ -0,0 +1,201 @@
++// Copyright 2013 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/bind.h"
++#include "base/logging.h"
++#include "media/base/audio_timestamp_helper.h"
++#include "media/audio/sndio/audio_manager_sndio.h"
++#include "media/audio/audio_manager.h"
++#include "media/audio/sndio/sndio_input.h"
++
++namespace media {
++
++static const SampleFormat kSampleFormat = kSampleFormatS16;
++
++void SndioAudioInputStream::OnMoveCallback(void *arg, int delta)
++{
++ SndioAudioInputStream* self = static_cast<SndioAudioInputStream*>(arg);
++
++ self->hw_delay += delta;
++}
++
++void *SndioAudioInputStream::ThreadEntry(void *arg) {
++ SndioAudioInputStream* self = static_cast<SndioAudioInputStream*>(arg);
++
++ self->ThreadLoop();
++ return NULL;
++}
++
++SndioAudioInputStream::SndioAudioInputStream(AudioManagerBase* manager,
++ const std::string& device_name,
++ const AudioParameters& params)
++ : manager(manager),
++ params(params),
++ audio_bus(AudioBus::Create(params)),
++ state(kClosed) {
++}
++
++SndioAudioInputStream::~SndioAudioInputStream() {
++ if (state != kClosed)
++ Close();
++}
++
++AudioInputStream::OpenOutcome SndioAudioInputStream::Open() {
++ struct sio_par par;
++ int sig;
++
++ if (state != kClosed)
++ return OpenOutcome::kFailed;
++
++ if (params.format() != AudioParameters::AUDIO_PCM_LINEAR &&
++ params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) {
++ LOG(WARNING) << "Unsupported audio format.";
++ return OpenOutcome::kFailed;
++ }
++
++ sio_initpar(&par);
++ par.rate = params.sample_rate();
++ par.rchan = params.channels();
++ par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
++ par.bps = par.bits / 8;
++ par.sig = sig = par.bits != 8 ? 1 : 0;
++ par.le = SIO_LE_NATIVE;
++ par.appbufsz = params.frames_per_buffer();
++
++ hdl = sio_open(SIO_DEVANY, SIO_REC, 0);
++
++ if (hdl == NULL) {
++ LOG(ERROR) << "Couldn't open audio device.";
++ return OpenOutcome::kFailed;
++ }
++
++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
++ LOG(ERROR) << "Couldn't set audio parameters.";
++ goto bad_close;
++ }
++
++ if (par.rate != (unsigned int)params.sample_rate() ||
++ par.rchan != (unsigned int)params.channels() ||
++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
++ par.sig != (unsigned int)sig ||
++ (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
++ (par.bits != par.bps * 8)) {
++ LOG(ERROR) << "Unsupported audio parameters.";
++ goto bad_close;
++ }
++ state = kStopped;
++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
++ sio_onmove(hdl, &OnMoveCallback, this);
++ return OpenOutcome::kSuccess;
++bad_close:
++ sio_close(hdl);
++ return OpenOutcome::kFailed;
++}
++
++void SndioAudioInputStream::Start(AudioInputCallback* cb) {
++
++ StartAgc();
++
++ state = kRunning;
++ hw_delay = 0;
++ callback = cb;
++ sio_start(hdl);
++ if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) {
++ LOG(ERROR) << "Failed to create real-time thread for recording.";
++ sio_stop(hdl);
++ state = kStopped;
++ }
++}
++
++void SndioAudioInputStream::Stop() {
++
++ if (state == kStopped)
++ return;
++
++ state = kStopWait;
++ pthread_join(thread, NULL);
++ sio_stop(hdl);
++ state = kStopped;
++
++ StopAgc();
++}
++
++void SndioAudioInputStream::Close() {
++
++ if (state == kClosed)
++ goto release;
++
++ if (state == kRunning)
++ Stop();
++
++ state = kClosed;
++ delete [] buffer;
++ sio_close(hdl);
++
++release:
++ manager->ReleaseInputStream(this);
++}
++
++double SndioAudioInputStream::GetMaxVolume() {
++ // Not supported
++ return 0.0;
++}
++
++void SndioAudioInputStream::SetVolume(double volume) {
++ // Not supported. Do nothing.
++}
++
++double SndioAudioInputStream::GetVolume() {
++ // Not supported.
++ return 0.0;
++}
++
++bool SndioAudioInputStream::IsMuted() {
++ // Not supported.
++ return false;
++}
++
++void SndioAudioInputStream::SetOutputDeviceForAec(
++ const std::string& output_device_id) {
++ // Not supported.
++}
++
++void SndioAudioInputStream::ThreadLoop(void) {
++ size_t todo, n;
++ char *data;
++ unsigned int nframes;
++ double normalized_volume = 0.0;
++
++ nframes = audio_bus->frames();
++
++ while (state == kRunning && !sio_eof(hdl)) {
++
++ GetAgcVolume(&normalized_volume);
++
++ // read one block
++ todo = nframes * params.GetBytesPerFrame(kSampleFormat);
++ data = buffer;
++ while (todo > 0) {
++ n = sio_read(hdl, data, todo);
++ if (n == 0)
++ return; // unrecoverable I/O error
++ todo -= n;
++ data += n;
++ }
++ hw_delay -= nframes;
++
++ // convert frames count to TimeDelta
++ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
++ params.sample_rate());
++
++ // push into bus
++ audio_bus->FromInterleaved<SignedInt16SampleTypeTraits>(reinterpret_cast<int16_t*>(buffer), nframes);
++
++
++ // invoke callback
++ callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1.);
++ }
++}
++
++} // namespace media
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.h
@@ -0,0 +1,91 @@
+--- src/3rdparty/chromium/media/audio/sndio/sndio_output.h.orig 2022-11-14 07:14:53 UTC
++++ src/3rdparty/chromium/media/audio/sndio/sndio_output.h
+@@ -0,0 +1,88 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_
++#define MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_
++
++#include <pthread.h>
++#include <sndio.h>
++
++#include "base/time/tick_clock.h"
++#include "base/time/time.h"
++#include "media/audio/audio_io.h"
++
++namespace media {
++
++class AudioManagerBase;
++
++// Implementation of AudioOutputStream using sndio(7)
++class SndioAudioOutputStream : public AudioOutputStream {
++ public:
++ // The manager is creating this object
++ SndioAudioOutputStream(const AudioParameters& params,
++ AudioManagerBase* manager);
++
++ SndioAudioOutputStream(const SndioAudioOutputStream&) = delete;
++ SndioAudioOutputStream& operator=(const SndioAudioOutputStream&) = delete;
++
++ virtual ~SndioAudioOutputStream();
++
++ // Implementation of AudioOutputStream.
++ bool Open() override;
++ void Close() override;
++ void Start(AudioSourceCallback* callback) override;
++ void Stop() override;
++ void SetVolume(double volume) override;
++ void GetVolume(double* volume) override;
++ void Flush() override;
++
++ friend void sndio_onmove(void *arg, int delta);
++ friend void sndio_onvol(void *arg, unsigned int vol);
++ friend void *sndio_threadstart(void *arg);
++
++ private:
++ enum StreamState {
++ kClosed, // Not opened yet
++ kStopped, // Device opened, but not started yet
++ kRunning, // Started, device playing
++ kStopWait // Stopping, waiting for the real-time thread to exit
++ };
++
++ // C-style call-backs
++ static void OnMoveCallback(void *arg, int delta);
++ static void OnVolCallback(void *arg, unsigned int vol);
++ static void* ThreadEntry(void *arg);
++
++ // Continuously moves data from the producer to the device
++ void ThreadLoop(void);
++
++ // Our creator, the audio manager needs to be notified when we close.
++ AudioManagerBase* manager;
++ // Parameters of the source
++ AudioParameters params;
++ // Source stores data here
++ std::unique_ptr<AudioBus> audio_bus;
++ // Call-back that produces data to play
++ AudioSourceCallback* source;
++ // Handle of the audio device
++ struct sio_hdl* hdl;
++ // Current state of the stream
++ enum StreamState state;
++ // High priority thread running ThreadLoop()
++ pthread_t thread;
++ // Protects vol, volpending and hw_delay
++ pthread_mutex_t mutex;
++ // Current volume in the 0..SIO_MAXVOL range
++ int vol;
++ // Set to 1 if volumes must be refreshed in the realtime thread
++ int volpending;
++ // Number of frames buffered in the hardware
++ int hw_delay;
++ // Temporary buffer where data is stored sndio-compatible format
++ char* buffer;
++};
++
++} // namespace media
++
++#endif // MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc
@@ -0,0 +1,190 @@
+--- src/3rdparty/chromium/media/audio/sndio/sndio_output.cc.orig 2022-11-14 07:14:51 UTC
++++ src/3rdparty/chromium/media/audio/sndio/sndio_output.cc
+@@ -0,0 +1,187 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/logging.h"
++#include "base/time/time.h"
++#include "base/time/default_tick_clock.h"
++#include "media/audio/audio_manager_base.h"
++#include "media/base/audio_timestamp_helper.h"
++#include "media/audio/sndio/sndio_output.h"
++
++namespace media {
++
++static const SampleFormat kSampleFormat = kSampleFormatS16;
++
++void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) {
++ SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
++
++ self->hw_delay -= delta;
++}
++
++void SndioAudioOutputStream::OnVolCallback(void *arg, unsigned int vol) {
++ SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
++
++ self->vol = vol;
++}
++
++void *SndioAudioOutputStream::ThreadEntry(void *arg) {
++ SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
++
++ self->ThreadLoop();
++ return NULL;
++}
++
++SndioAudioOutputStream::SndioAudioOutputStream(const AudioParameters& params,
++ AudioManagerBase* manager)
++ : manager(manager),
++ params(params),
++ audio_bus(AudioBus::Create(params)),
++ state(kClosed),
++ mutex(PTHREAD_MUTEX_INITIALIZER) {
++}
++
++SndioAudioOutputStream::~SndioAudioOutputStream() {
++ if (state != kClosed)
++ Close();
++}
++
++bool SndioAudioOutputStream::Open() {
++ if (params.format() != AudioParameters::AUDIO_PCM_LINEAR &&
++ params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) {
++ LOG(WARNING) << "Unsupported audio format.";
++ return false;
++ }
++ state = kStopped;
++ volpending = 0;
++ vol = SIO_MAXVOL;
++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
++ return true;
++}
++
++void SndioAudioOutputStream::Close() {
++ if (state == kClosed)
++ goto release;
++ if (state == kRunning)
++ Stop();
++ state = kClosed;
++ delete [] buffer;
++release:
++ manager->ReleaseOutputStream(this); // Calls the destructor
++}
++
++void SndioAudioOutputStream::Start(AudioSourceCallback* callback) {
++ struct sio_par par;
++ int sig;
++
++ sio_initpar(&par);
++ par.rate = params.sample_rate();
++ par.pchan = params.channels();
++ par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
++ par.bps = par.bits / 8;
++ par.sig = sig = par.bits != 8 ? 1 : 0;
++ par.le = SIO_LE_NATIVE;
++ par.appbufsz = params.frames_per_buffer();
++
++ hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0);
++ if (hdl == NULL) {
++ LOG(ERROR) << "Couldn't open audio device.";
++ return;
++ }
++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
++ LOG(ERROR) << "Couldn't set audio parameters.";
++ sio_close(hdl);
++ return;
++ }
++ if (par.rate != (unsigned int)params.sample_rate() ||
++ par.pchan != (unsigned int)params.channels() ||
++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
++ par.sig != (unsigned int)sig ||
++ (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
++ (par.bits != par.bps * 8)) {
++ LOG(ERROR) << "Unsupported audio parameters.";
++ sio_close(hdl);
++ return;
++ }
++
++ sio_onmove(hdl, &OnMoveCallback, this);
++ sio_onvol(hdl, &OnVolCallback, this);
++
++ state = kRunning;
++ hw_delay = 0;
++ source = callback;
++ sio_start(hdl);
++
++ if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) {
++ LOG(ERROR) << "Failed to create real-time thread.";
++ sio_stop(hdl);
++ sio_close(hdl);
++ state = kStopped;
++ }
++}
++
++void SndioAudioOutputStream::Stop() {
++ if (state == kStopped)
++ return;
++ state = kStopWait;
++ pthread_join(thread, NULL);
++ sio_stop(hdl);
++ sio_close(hdl);
++ state = kStopped;
++}
++
++void SndioAudioOutputStream::SetVolume(double v) {
++ pthread_mutex_lock(&mutex);
++ vol = v * SIO_MAXVOL;
++ volpending = 1;
++ pthread_mutex_unlock(&mutex);
++}
++
++void SndioAudioOutputStream::GetVolume(double* v) {
++ pthread_mutex_lock(&mutex);
++ *v = vol * (1. / SIO_MAXVOL);
++ pthread_mutex_unlock(&mutex);
++}
++
++// This stream is always used with sub second buffer sizes, where it's
++// sufficient to simply always flush upon Start().
++void SndioAudioOutputStream::Flush() {}
++
++void SndioAudioOutputStream::ThreadLoop(void) {
++ int avail, count, result;
++
++ while (state == kRunning) {
++ // Update volume if needed
++ pthread_mutex_lock(&mutex);
++ if (volpending) {
++ volpending = 0;
++ sio_setvol(hdl, vol);
++ }
++ pthread_mutex_unlock(&mutex);
++
++ // Get data to play
++ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
++ params.sample_rate());
++ count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get());
++ audio_bus->ToInterleaved<SignedInt16SampleTypeTraits>(count, reinterpret_cast<int16_t*>(buffer));
++ if (count == 0) {
++ // We have to submit something to the device
++ count = audio_bus->frames();
++ memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat));
++ LOG(WARNING) << "No data to play, running empty cycle.";
++ }
++
++ // Submit data to the device
++ avail = count * params.GetBytesPerFrame(kSampleFormat);
++ result = sio_write(hdl, buffer, avail);
++ if (result == 0) {
++ LOG(WARNING) << "Audio device disconnected.";
++ break;
++ }
++
++ // Update hardware pointer
++ hw_delay += count;
++ }
++}
++
++} // namespace media
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_audio__latency.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_audio__latency.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/base/audio_latency.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/audio_latency.cc
+@@ -135,7 +135,7 @@ int AudioLatency::GetRtcBufferSize(int sample_rate, in
+ }
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // On Linux, MacOS and Fuchsia, the low level IO implementations on the
+ // browser side supports all buffer size the clients want. We use the native
+ // peer connection buffer size (10ms) to achieve best possible performance.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_media__switches.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_media__switches.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/media/base/media_switches.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/media_switches.h
+@@ -195,7 +195,7 @@ MEDIA_EXPORT extern const base::Feature kUseR16Texture
+ MEDIA_EXPORT extern const base::Feature kUseFakeDeviceForMediaStream;
+ MEDIA_EXPORT extern const base::Feature kUseMediaHistoryStore;
+ MEDIA_EXPORT extern const base::Feature kUseR16Texture;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT extern const base::Feature kVaapiVideoDecodeLinux;
+ MEDIA_EXPORT extern const base::Feature kVaapiVideoEncodeLinux;
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -278,7 +278,7 @@ MEDIA_EXPORT extern const base::Feature kDeprecateLowU
+ MEDIA_EXPORT extern const base::Feature kDeprecateLowUsageCodecs;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT extern const base::Feature kUseOutOfProcessVideoDecoding;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_media__switches.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_media__switches.cc
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/media/base/media_switches.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/media_switches.cc
+@@ -10,7 +10,7 @@
+ #include "components/system_media_controls/linux/buildflags/buildflags.h"
+ #include "media/media_buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/cpu.h"
+ #endif
+
+@@ -416,7 +416,7 @@ const base::Feature kGlobalMediaControls {
+ const base::Feature kGlobalMediaControls {
+ "GlobalMediaControls",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -448,7 +448,7 @@ const base::Feature kGlobalMediaControlsPictureInPictu
+ const base::Feature kGlobalMediaControlsPictureInPicture {
+ "GlobalMediaControlsPictureInPicture",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -489,7 +489,7 @@ const base::Feature kUnifiedAutoplay{"UnifiedAutoplay"
+ const base::Feature kUnifiedAutoplay{"UnifiedAutoplay",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enable vaapi video decoding on linux. This is already enabled by default on
+ // chromeos, but needs an experiment on linux.
+ const base::Feature kVaapiVideoDecodeLinux{"VaapiVideoDecoder",
+@@ -863,7 +863,7 @@ const base::Feature MEDIA_EXPORT kDeprecateLowUsageCod
+ "DeprecateLowUsageCodecs", base::FEATURE_ENABLED_BY_DEFAULT};
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Spawn utility processes to perform hardware decode acceleration instead of
+ // using the GPU process.
+ const base::Feature MEDIA_EXPORT kUseOutOfProcessVideoDecoding{
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_scopedfd__helper.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_scopedfd__helper.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/base/scopedfd_helper.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/scopedfd_helper.h
+@@ -15,7 +15,7 @@ namespace media {
+ // but since the only current user is V4L2 we are limiting the scope to OS_LINUX
+ // so the binary size does not inflate on non-using systems. Feel free to adapt
+ // this and BUILD.gn as our needs evolve.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Return a new vector containing duplicates of |fds|, or PCHECKs in case of an
+ // error.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_supported__types.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_supported__types.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/base/supported_types.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/supported_types.cc
+@@ -205,7 +205,7 @@ bool IsHevcProfileSupported(const VideoType& type) {
+ return false;
+
+ #if BUILDFLAG(ENABLE_PLATFORM_HEVC)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return GetSupplementalProfileCache()->IsProfileSupported(type.profile);
+ #else
+ return true;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_vector__math.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_vector__math.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/base/vector_math.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/vector_math.cc
+@@ -18,7 +18,7 @@
+ // better, which is anywhere clang is used.
+ // TODO(pcc): Linux currently uses ThinLTO which has broken auto-vectorization
+ // in clang, so use our intrinsic version for now. http://crbug.com/738085
+-#if !defined(__clang__) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if !defined(__clang__) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define FMAC_FUNC FMAC_SSE
+ #define FMUL_FUNC FMUL_SSE
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_video__frame.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_video__frame.h
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/media/base/video_frame.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/video_frame.h
+@@ -41,7 +41,7 @@
+ #include "base/mac/scoped_cftyperef.h"
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/scoped_file.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -83,7 +83,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte
+ STORAGE_UNOWNED_MEMORY = 2, // External, non owned data pointers.
+ STORAGE_OWNED_MEMORY = 3, // VideoFrame has allocated its own data buffer.
+ STORAGE_SHMEM = 4, // Backed by unsafe (writable) shared memory.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(mcasas): Consider turning this type into STORAGE_NATIVE
+ // based on the idea of using this same enum value for both DMA
+ // buffers on Linux and CVPixelBuffers on Mac (which currently use
+@@ -281,7 +281,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte
+ ReleaseMailboxAndGpuMemoryBufferCB mailbox_holder_and_gmb_release_cb,
+ base::TimeDelta timestamp);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Wraps provided dmabufs
+ // (https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html) with a
+ // VideoFrame. The frame will take ownership of |dmabuf_fds|, and will
+@@ -540,7 +540,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte
+ // mailbox, the caller must wait for the included sync point.
+ const gpu::MailboxHolder& mailbox_holder(size_t texture_index) const;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Returns a vector containing the backing DmaBufs for this frame. The number
+ // of returned DmaBufs will be equal or less than the number of planes of
+ // the frame. If there are less, this means that the last FD contains the
+@@ -744,7 +744,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte
+ // GPU memory buffer, if this frame is STORAGE_GPU_MEMORY_BUFFER.
+ std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer_;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ class DmabufHolder;
+
+ // Dmabufs for the frame, used when storage is STORAGE_DMABUFS. Size is either
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_video__frame.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_base_video__frame.cc
@@ -0,0 +1,74 @@
+--- src/3rdparty/chromium/media/base/video_frame.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/base/video_frame.cc
+@@ -72,7 +72,7 @@ std::string VideoFrame::StorageTypeToString(
+ return "OWNED_MEMORY";
+ case VideoFrame::STORAGE_SHMEM:
+ return "SHMEM";
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case VideoFrame::STORAGE_DMABUFS:
+ return "DMABUFS";
+ #endif
+@@ -89,7 +89,7 @@ bool VideoFrame::IsStorageTypeMappable(VideoFrame::Sto
+ // static
+ bool VideoFrame::IsStorageTypeMappable(VideoFrame::StorageType storage_type) {
+ return
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // This is not strictly needed but makes explicit that, at VideoFrame
+ // level, DmaBufs are not mappable from userspace.
+ storage_type != VideoFrame::STORAGE_DMABUFS &&
+@@ -285,7 +285,7 @@ static absl::optional<VideoFrameLayout> GetDefaultLayo
+ return VideoFrameLayout::CreateWithPlanes(format, coded_size, planes);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // This class allows us to embed a vector<ScopedFD> into a scoped_refptr, and
+ // thus to have several VideoFrames share the same set of DMABUF FDs.
+ class VideoFrame::DmabufHolder
+@@ -624,7 +624,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM
+ for (size_t i = 0; i < num_planes; ++i)
+ planes[i].stride = gpu_memory_buffer->stride(i);
+ uint64_t modifier = gfx::NativePixmapHandle::kNoModifier;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) {
+ const auto gmb_handle = gpu_memory_buffer->CloneHandle();
+ if (gmb_handle.is_null() ||
+@@ -670,7 +670,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM
+ return frame;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ scoped_refptr<VideoFrame> VideoFrame::WrapExternalDmabufs(
+ const VideoFrameLayout& layout,
+@@ -894,7 +894,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame(
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ DCHECK(frame->dmabuf_fds_);
+ // If there are any |dmabuf_fds_| plugged in, we should refer them too.
+ wrapping_frame->dmabuf_fds_ = frame->dmabuf_fds_;
+@@ -1265,7 +1265,7 @@ const gpu::MailboxHolder& VideoFrame::mailbox_holder(
+ : mailbox_holders_[texture_index];
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const std::vector<base::ScopedFD>& VideoFrame::DmabufFds() const {
+ DCHECK_EQ(storage_type_, STORAGE_DMABUFS);
+
+@@ -1377,7 +1377,7 @@ VideoFrame::VideoFrame(const VideoFrameLayout& layout,
+ storage_type_(storage_type),
+ visible_rect_(Intersection(visible_rect, gfx::Rect(layout.coded_size()))),
+ natural_size_(natural_size),
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ dmabuf_fds_(base::MakeRefCounted<DmabufHolder>()),
+ #endif
+ timestamp_(timestamp),
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_create__video__capture__device__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_create__video__capture__device__factory.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/media/capture/video/create_video_capture_device_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/create_video_capture_device_factory.cc
+@@ -12,7 +12,7 @@
+ #include "media/capture/video/fake_video_capture_device_factory.h"
+ #include "media/capture/video/file_video_capture_device_factory.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "media/capture/video/linux/video_capture_device_factory_linux.h"
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ #include "media/capture/video/chromeos/public/cros_features.h"
+@@ -55,7 +55,7 @@ CreatePlatformSpecificVideoCaptureDeviceFactory(
+ std::unique_ptr<VideoCaptureDeviceFactory>
+ CreatePlatformSpecificVideoCaptureDeviceFactory(
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<VideoCaptureDeviceFactoryLinux>(ui_task_runner);
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ if (base::SysInfo::IsRunningOnChromeOS())
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_fake__video__capture__device__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_fake__video__capture__device__factory.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/fake_video_capture_device_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/fake_video_capture_device_factory.cc
+@@ -213,7 +213,7 @@ void FakeVideoCaptureDeviceFactory::GetDevicesInfo(
+ int entry_index = 0;
+ for (const auto& entry : devices_config_) {
+ VideoCaptureApi api =
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE;
+ #elif BUILDFLAG(IS_MAC)
+ VideoCaptureApi::MACOSX_AVFOUNDATION;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_file__video__capture__device__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_file__video__capture__device__factory.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/file_video_capture_device_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/file_video_capture_device_factory.cc
+@@ -52,7 +52,7 @@ void FileVideoCaptureDeviceFactory::GetDevicesInfo(
+ VideoCaptureApi::WIN_DIRECT_SHOW;
+ #elif BUILDFLAG(IS_MAC)
+ VideoCaptureApi::MACOSX_AVFOUNDATION;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE;
+ #else
+ VideoCaptureApi::UNKNOWN;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_fake__v4l2__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_fake__v4l2__impl.h
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/media/capture/video/linux/fake_v4l2_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/fake_v4l2_impl.h
+@@ -8,7 +8,13 @@
+ #include <map>
+ #include <string>
+
++#include "build/build_config.h"
++#if BUILDFLAG(IS_OPENBSD)
++#include <sys/videoio.h>
++typedef __uint32_t __u32;
++#else
+ #include <linux/videodev2.h>
++#endif
+
+ #include "base/synchronization/lock.h"
+ #include "media/capture/capture_export.h"
+@@ -36,7 +42,7 @@ class CAPTURE_EXPORT FakeV4L2Impl : public V4L2Capture
+ // Implementation of V4L2CaptureDevice interface:
+ int open(const char* device_name, int flags) override;
+ int close(int fd) override;
+- int ioctl(int fd, int request, void* argp) override;
++ int ioctl(int fd, unsigned long request, void* argp) override;
+ void* mmap(void* start,
+ size_t length,
+ int prot,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_fake__v4l2__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_fake__v4l2__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/linux/fake_v4l2_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/fake_v4l2_impl.cc
+@@ -425,7 +425,7 @@ int FakeV4L2Impl::close(int fd) {
+ return kSuccessReturnValue;
+ }
+
+-int FakeV4L2Impl::ioctl(int fd, int request, void* argp) {
++int FakeV4L2Impl::ioctl(int fd, unsigned long request, void* argp) {
+ base::AutoLock lock(lock_);
+ auto device_iter = opened_devices_.find(fd);
+ if (device_iter == opened_devices_.end())
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__delegate.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__delegate.h
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_delegate.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_delegate.h
+@@ -85,10 +85,10 @@ class CAPTURE_EXPORT V4L2CaptureDelegate final {
+ // device file descriptor or (re)starting streaming, can fail but works after
+ // retrying (https://crbug.com/670262). Returns false if the |request| ioctl
+ // fails too many times.
+- bool RunIoctl(int request, void* argp);
++ bool RunIoctl(unsigned int request, void* argp);
+
+ // Simple wrapper to do HANDLE_EINTR(v4l2_->ioctl(device_fd_.get(), ...)).
+- int DoIoctl(int request, void* argp);
++ int DoIoctl(unsigned int request, void* argp);
+
+ // Creates a mojom::RangePtr with the (min, max, current, step) values of the
+ // control associated with |control_id|. Returns an empty Range otherwise.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__delegate.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__delegate.cc
@@ -0,0 +1,44 @@
+--- src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_delegate.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_delegate.cc
+@@ -4,8 +4,10 @@
+
+ #include "media/capture/video/linux/v4l2_capture_delegate.h"
+
++#if !defined(OS_BSD)
+ #include <linux/version.h>
+ #include <linux/videodev2.h>
++#endif
+ #include <poll.h>
+ #include <sys/fcntl.h>
+ #include <sys/ioctl.h>
+@@ -25,10 +27,10 @@ using media::mojom::MeteringMode;
+
+ using media::mojom::MeteringMode;
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
++// #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+ // 16 bit depth, Realsense F200.
+ #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ')
+-#endif
++// #endif
+
+ // TODO(aleksandar.stojiljkovic): Wrap this with kernel version check once the
+ // format is introduced to kernel.
+@@ -660,7 +662,7 @@ V4L2CaptureDelegate::~V4L2CaptureDelegate() = default;
+
+ V4L2CaptureDelegate::~V4L2CaptureDelegate() = default;
+
+-bool V4L2CaptureDelegate::RunIoctl(int request, void* argp) {
++bool V4L2CaptureDelegate::RunIoctl(unsigned int request, void* argp) {
+ int num_retries = 0;
+ for (; DoIoctl(request, argp) < 0 && num_retries < kMaxIOCtrlRetries;
+ ++num_retries) {
+@@ -670,7 +672,7 @@ bool V4L2CaptureDelegate::RunIoctl(int request, void*
+ return num_retries != kMaxIOCtrlRetries;
+ }
+
+-int V4L2CaptureDelegate::DoIoctl(int request, void* argp) {
++int V4L2CaptureDelegate::DoIoctl(unsigned int request, void* argp) {
+ return HANDLE_EINTR(v4l2_->ioctl(device_fd_.get(), request, argp));
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__device.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__device.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_device.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_device.h
+@@ -21,7 +21,7 @@ class CAPTURE_EXPORT V4L2CaptureDevice
+ public:
+ virtual int open(const char* device_name, int flags) = 0;
+ virtual int close(int fd) = 0;
+- virtual int ioctl(int fd, int request, void* argp) = 0;
++ virtual int ioctl(int fd, unsigned long request, void* argp) = 0;
+ virtual void* mmap(void* start,
+ size_t length,
+ int prot,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__device__impl.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__device__impl.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_device_impl.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_device_impl.h
+@@ -19,7 +19,7 @@ class CAPTURE_EXPORT V4L2CaptureDeviceImpl : public V4
+ public:
+ int open(const char* device_name, int flags) override;
+ int close(int fd) override;
+- int ioctl(int fd, int request, void* argp) override;
++ int ioctl(int fd, unsigned long request, void* argp) override;
+ void* mmap(void* start,
+ size_t length,
+ int prot,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__device__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_v4l2__capture__device__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_device_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/v4l2_capture_device_impl.cc
+@@ -22,7 +22,7 @@ int V4L2CaptureDeviceImpl::close(int fd) {
+ return ::close(fd);
+ }
+
+-int V4L2CaptureDeviceImpl::ioctl(int fd, int request, void* argp) {
++int V4L2CaptureDeviceImpl::ioctl(int fd, unsigned long request, void* argp) {
+ return ::ioctl(fd, request, argp);
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_video__capture__device__factory__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_video__capture__device__factory__linux.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/linux/video_capture_device_factory_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/video_capture_device_factory_linux.h
+@@ -52,7 +52,7 @@ class CAPTURE_EXPORT VideoCaptureDeviceFactoryLinux
+
+ private:
+ // Simple wrapper to do HANDLE_EINTR(v4l2_->ioctl(fd, ...)).
+- int DoIoctl(int fd, int request, void* argp);
++ int DoIoctl(int fd, unsigned int request, void* argp);
+
+ VideoCaptureControlSupport GetControlSupport(int fd);
+ bool GetControlSupport(int fd, int control_id);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_video__capture__device__factory__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_linux_video__capture__device__factory__linux.cc
@@ -0,0 +1,45 @@
+--- src/3rdparty/chromium/media/capture/video/linux/video_capture_device_factory_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/linux/video_capture_device_factory_linux.cc
+@@ -72,6 +72,9 @@ class DevVideoFilePathsDeviceProvider
+ : public VideoCaptureDeviceFactoryLinux::DeviceProvider {
+ public:
+ void GetDeviceIds(std::vector<std::string>* target_container) override {
++#if defined(OS_OPENBSD)
++ target_container->emplace_back("/dev/video");
++#else
+ const base::FilePath path("/dev/");
+ base::FileEnumerator enumerator(path, false, base::FileEnumerator::FILES,
+ "video*");
+@@ -79,9 +82,13 @@ class DevVideoFilePathsDeviceProvider
+ const base::FileEnumerator::FileInfo info = enumerator.GetInfo();
+ target_container->emplace_back(path.value() + info.GetName().value());
+ }
++#endif
+ }
+
+ std::string GetDeviceModelId(const std::string& device_id) override {
++#if defined(OS_OPENBSD)
++ return std::string();
++#endif
+ const std::string file_name = ExtractFileNameFromDeviceId(device_id);
+ std::string usb_id;
+ const std::string vid_path =
+@@ -99,6 +106,9 @@ class DevVideoFilePathsDeviceProvider
+ }
+
+ std::string GetDeviceDisplayName(const std::string& device_id) override {
++#if defined(OS_OPENBSD)
++ return std::string();
++#endif
+ const std::string file_name = ExtractFileNameFromDeviceId(device_id);
+ const std::string interface_path =
+ base::StringPrintf(kInterfacePathTemplate, file_name.c_str());
+@@ -213,7 +223,7 @@ void VideoCaptureDeviceFactoryLinux::GetDevicesInfo(
+ std::move(callback).Run(std::move(devices_info));
+ }
+
+-int VideoCaptureDeviceFactoryLinux::DoIoctl(int fd, int request, void* argp) {
++int VideoCaptureDeviceFactoryLinux::DoIoctl(int fd, unsigned int request, void* argp) {
+ return HANDLE_EINTR(v4l2_->ioctl(fd, request, argp));
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_video__capture__buffer__pool__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_video__capture__buffer__pool__impl.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/video_capture_buffer_pool_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/video_capture_buffer_pool_impl.cc
+@@ -74,7 +74,7 @@ VideoCaptureBufferPoolImpl::CreateSharedMemoryViaRawFi
+ int buffer_id) {
+ // This requires platforms where base::SharedMemoryHandle is backed by a
+ // file descriptor.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::AutoLock lock(lock_);
+
+ VideoCaptureBufferTracker* tracker = GetTracker(buffer_id);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_video__capture__device__client.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_capture_video_video__capture__device__client.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/capture/video/video_capture_device_client.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/capture/video/video_capture_device_client.cc
+@@ -320,7 +320,7 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData(
+ // see http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html.
+ // Windows RGB24 defines blue at lowest byte,
+ // see https://msdn.microsoft.com/en-us/library/windows/desktop/dd407253
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ fourcc_format = libyuv::FOURCC_RAW;
+ #elif BUILDFLAG(IS_WIN)
+ fourcc_format = libyuv::FOURCC_24BG;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_buffer__validation.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_buffer__validation.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/media/gpu/buffer_validation.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/buffer_validation.cc
+@@ -15,7 +15,7 @@
+ #include "ui/gfx/geometry/size.h"
+ #include "ui/gfx/gpu_memory_buffer.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <sys/types.h>
+ #include <unistd.h>
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -23,7 +23,7 @@ bool GetFileSize(const int fd, size_t* size) {
+ namespace media {
+
+ bool GetFileSize(const int fd, size_t* size) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (fd < 0) {
+ VLOG(1) << "Invalid file descriptor";
+ return false;
+@@ -73,7 +73,7 @@ bool VerifyGpuMemoryBufferHandle(
+ VLOG(1) << "Unsupported: " << pixel_format;
+ return false;
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format);
+ if (num_planes != gmb_handle.native_pixmap_handle.planes.size() ||
+ num_planes == 0) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_chromeos_video__decoder__pipeline.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_chromeos_video__decoder__pipeline.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/media/gpu/chromeos/video_decoder_pipeline.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/chromeos/video_decoder_pipeline.cc
+@@ -647,7 +647,7 @@ VideoDecoderPipeline::PickDecoderOutputFormat(
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Linux should always use a custom allocator (to allocate buffers using
+ // libva) and a PlatformVideoFramePool.
+ CHECK(allocator.has_value());
+@@ -669,7 +669,7 @@ VideoDecoderPipeline::PickDecoderOutputFormat(
+ #error "Unsupported platform"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // viable_candidate should always be set unless using L1 protected content,
+ // which isn't an option on linux or lacros.
+ CHECK(viable_candidate);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_gpu__video__encode__accelerator__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_gpu__video__encode__accelerator__factory.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/gpu/gpu_video_encode_accelerator_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/gpu_video_encode_accelerator_factory.cc
+@@ -96,7 +96,7 @@ std::vector<VEAFactoryFunction> GetVEAFactoryFunctions
+ return vea_factory_functions;
+
+ #if BUILDFLAG(USE_VAAPI)
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(kVaapiVideoEncodeLinux))
+ vea_factory_functions.push_back(base::BindRepeating(&CreateVaapiVEA));
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_DECODING_SANDBOX_HOOK_LINUX_H_
+ #define MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_DECODING_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace media {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc
@@ -0,0 +1,26 @@
+--- src/3rdparty/chromium/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc
+@@ -14,12 +14,15 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #endif
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
++#endif
+
+ namespace media {
+
+ bool HardwareVideoDecodingPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ sandbox::syscall_broker::BrokerCommandSet command_set;
+ std::vector<BrokerFilePermission> permissions;
+
+@@ -121,6 +124,7 @@ bool HardwareVideoDecodingPreSandboxHook(
+ dlopen("/usr/lib/libv4l2.so", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
+ #endif // defined(__aarch64__)
+ #endif // BUILDFLAG(USE_VAAPI)
++#endif
+
+ return true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_vaapi_vaapi__video__decoder.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_vaapi_vaapi__video__decoder.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/gpu/vaapi/vaapi_video_decoder.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/vaapi/vaapi_video_decoder.cc
+@@ -772,7 +772,7 @@ void VaapiVideoDecoder::ApplyResolutionChangeWithScree
+ const gfx::Size decoder_natural_size =
+ aspect_ratio_.GetNaturalSize(decoder_visible_rect);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ absl::optional<DmabufVideoFramePool::CreateFrameCB> allocator =
+ base::BindRepeating(&AllocateCustomFrameProxy, weak_this_);
+ std::vector<ImageProcessor::PixelLayoutCandidate> candidates = {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_vaapi_vaapi__wrapper.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_vaapi_vaapi__wrapper.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/gpu/vaapi/vaapi_wrapper.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -582,7 +582,7 @@ bool VADisplayState::Initialize() {
+ bool VADisplayState::Initialize() {
+ base::AutoLock auto_lock(va_lock_);
+
+-#if defined(USE_OZONE) && BUILDFLAG(IS_LINUX)
++#if defined(USE_OZONE) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
+ // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi
+ // for more details. This will also require revisiting everything that's
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_media__options.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_media__options.gni
@@ -0,0 +1,27 @@
+--- src/3rdparty/chromium/media/media_options.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/media_options.gni
+@@ -133,9 +133,12 @@ declare_args() {
+ # Enables runtime selection of ALSA library for audio.
+ use_alsa = false
+
++ # Enable runtime selection of sndio(7)
++ use_sndio = false
++
+ # Alsa should be used on non-Android, non-Mac POSIX systems.
+ # Alsa should be used on desktop Chromecast and audio-only Chromecast builds.
+- if (is_posix && !is_android && !is_mac &&
++ if (is_posix && !is_android && !is_mac && !is_bsd &&
+ (!is_chromecast || is_cast_desktop_build || is_cast_audio_only)) {
+ use_alsa = true
+
+@@ -150,6 +153,10 @@ declare_args() {
+ if (!use_cras && !is_chromecast && !is_asan && !is_tsan) {
+ use_pulseaudio = true
+ }
++ }
++ if (is_openbsd) {
++ use_sndio = true
++ use_pulseaudio = false
+ }
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.h
+@@ -620,7 +620,7 @@ struct StructTraits<media::stable::mojom::NativeGpuMem
+ static const gfx::GpuMemoryBufferId& id(
+ const gfx::GpuMemoryBufferHandle& input);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static gfx::NativePixmapHandle platform_handle(
+ gfx::GpuMemoryBufferHandle& input);
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.cc
+@@ -42,7 +42,7 @@ media::stable::mojom::VideoFrameDataPtr MakeVideoFrame
+ gfx::GpuMemoryBufferHandle gpu_memory_buffer_handle =
+ input->GetGpuMemoryBuffer()->CloneHandle();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ CHECK_EQ(gpu_memory_buffer_handle.type, gfx::NATIVE_PIXMAP);
+ CHECK(!gpu_memory_buffer_handle.native_pixmap_handle.planes.empty());
+ #else
+@@ -749,7 +749,7 @@ const gfx::GpuMemoryBufferId& StructTraits<
+ return input.id;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ gfx::NativePixmapHandle StructTraits<
+ media::stable::mojom::NativeGpuMemoryBufferHandleDataView,
+@@ -770,7 +770,7 @@ bool StructTraits<media::stable::mojom::NativeGpuMemor
+
+ output->type = gfx::NATIVE_PIXMAP;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!data.ReadPlatformHandle(&output->native_pixmap_handle))
+ return false;
+ return true;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_mojo_mojom_video__frame__mojom__traits.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_mojo_mojom_video__frame__mojom__traits.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/mojo/mojom/video_frame_mojom_traits.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/mojo/mojom/video_frame_mojom_traits.cc
+@@ -23,7 +23,7 @@
+ #include "ui/gfx/mojom/color_space_mojom_traits.h"
+ #include "ui/gfx/mojom/hdr_metadata_mojom_traits.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/posix/eintr_wrapper.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_fake__gpu__memory__buffer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_fake__gpu__memory__buffer.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/media/video/fake_gpu_memory_buffer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/video/fake_gpu_memory_buffer.cc
+@@ -9,7 +9,7 @@
+ #include "media/base/format_utils.h"
+ #include "media/base/video_frame.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+@@ -47,7 +47,7 @@ class FakeGpuMemoryBufferImpl : public gpu::GpuMemoryB
+
+ } // namespace
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::ScopedFD GetDummyFD() {
+ base::ScopedFD fd(open("/dev/zero", O_RDWR));
+ DCHECK(fd.is_valid());
+@@ -77,7 +77,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer(const gfx::Si
+ static base::AtomicSequenceNumber buffer_id_generator;
+ handle_.id = gfx::GpuMemoryBufferId(buffer_id_generator.GetNext());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (size_t i = 0; i < VideoFrame::NumPlanes(video_pixel_format_); i++) {
+ const gfx::Size plane_size_in_bytes =
+ VideoFrame::PlaneSize(video_pixel_format_, i, size_);
+@@ -134,7 +134,7 @@ gfx::GpuMemoryBufferHandle FakeGpuMemoryBuffer::CloneH
+ gfx::GpuMemoryBufferHandle handle;
+ handle.type = gfx::NATIVE_PIXMAP;
+ handle.id = handle_.id;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ handle.native_pixmap_handle =
+ gfx::CloneHandleForIPC(handle_.native_pixmap_handle);
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_gpu__memory__buffer__video__frame__pool.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_gpu__memory__buffer__video__frame__pool.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/video/gpu_memory_buffer_video_frame_pool.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/video/gpu_memory_buffer_video_frame_pool.cc
+@@ -795,7 +795,7 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::CreateHa
+ }
+
+ bool is_software_backed_video_frame = !video_frame->HasTextures();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ is_software_backed_video_frame &= !video_frame->HasDmaBufs();
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_video__encode__accelerator__adapter.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_video__encode__accelerator__adapter.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/media/video/video_encode_accelerator_adapter.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/video/video_encode_accelerator_adapter.cc
+@@ -98,7 +98,7 @@ VideoEncodeAccelerator::Config SetUpVeaConfig(
+ if (is_rgb)
+ config.input_format = PIXEL_FORMAT_I420;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (storage_type == VideoFrame::STORAGE_DMABUFS ||
+ storage_type == VideoFrame::STORAGE_GPU_MEMORY_BUFFER) {
+ if (is_rgb)
+@@ -239,7 +239,7 @@ void VideoEncodeAcceleratorAdapter::InitializeInternal
+ auto vea_config =
+ SetUpVeaConfig(profile_, options_, format, first_frame->storage_type());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Linux/ChromeOS require a special configuration to use dmabuf storage.
+ // We need to keep sending frames the same way the first frame was sent.
+ // Other platforms will happily mix GpuMemoryBuffer storage with regular
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_video__encode__accelerator__adapter__test.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_video_video__encode__accelerator__adapter__test.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/video/video_encode_accelerator_adapter_test.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/video/video_encode_accelerator_adapter_test.cc
+@@ -378,7 +378,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest, TwoFramesRes
+
+ vea()->SetEncodingCallback(base::BindLambdaForTesting(
+ [&](BitstreamBuffer&, bool keyframe, scoped_refptr<VideoFrame> frame) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ EXPECT_EQ(frame->format(),
+ IsYuvPlanar(pixel_format) ? pixel_format : PIXEL_FORMAT_I420);
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_webrtc_audio__processor.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_webrtc_audio__processor.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/webrtc/audio_processor.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/webrtc/audio_processor.cc
+@@ -466,7 +466,7 @@ absl::optional<double> AudioProcessor::ProcessData(
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+ DCHECK_LE(volume, 1.0);
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
+- BUILDFLAG(IS_OPENBSD)
++ BUILDFLAG(IS_BSD)
+ // We have a special situation on Linux where the microphone volume can be
+ // "higher than maximum". The input volume slider in the sound preference
+ // allows the user to set a scaling that is higher than 100%. It means that
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_media_webrtc_webrtc__features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_media_webrtc_webrtc__features.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/media/webrtc/webrtc_features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/media/webrtc/webrtc_features.cc
+@@ -9,7 +9,7 @@ namespace {
+
+ namespace features {
+ namespace {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr base::FeatureState kWebRtcHybridAgcState =
+ base::FEATURE_ENABLED_BY_DEFAULT;
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_core_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_core_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/mojo/core/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/mojo/core/BUILD.gn
+@@ -128,7 +128,7 @@ template("core_impl_source_set") {
+ ]
+ }
+
+- if ((is_linux || is_chromeos || is_android) && !is_nacl) {
++ if ((is_linux || is_chromeos || is_android) && !is_nacl && !is_bsd) {
+ sources += [
+ "channel_linux.cc",
+ "channel_linux.h",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_core_channel.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_core_channel.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/mojo/core/channel.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/mojo/core/channel.cc
+@@ -70,7 +70,11 @@ const size_t kMaxAttachedHandles = 64;
+ // Fuchsia: The zx_channel_write() API supports up to 64 handles.
+ const size_t kMaxAttachedHandles = 64;
+
++#if defined(__i386__) && defined(OS_FREEBSD)
++const size_t kChannelMessageAlignment = 4;
++#else
+ static_assert(alignof(std::max_align_t) >= kChannelMessageAlignment, "");
++#endif
+ Channel::AlignedBuffer MakeAlignedBuffer(size_t size) {
+ // Generic allocators (such as malloc) return a pointer that is suitably
+ // aligned for storing any type of object with a fundamental alignment
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_core_embedder_features.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_core_embedder_features.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/mojo/core/embedder/features.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/mojo/core/embedder/features.h
+@@ -14,7 +14,7 @@ namespace core {
+ namespace core {
+
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_MAC)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(MOJO_CORE_EMBEDDER_FEATURES)
+ extern const base::Feature kMojoLinuxChannelSharedMem;
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_public_c_system_thunks.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_public_c_system_thunks.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/mojo/public/c/system/thunks.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/mojo/public/c/system/thunks.cc
+@@ -24,7 +24,7 @@
+ #include "mojo/public/c/system/message_pipe.h"
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #include "base/files/file_path.h"
+ #include "base/scoped_native_library.h"
+@@ -73,7 +73,7 @@ class CoreLibraryInitializer {
+
+ MojoResult LoadLibrary(base::FilePath library_path) {
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ if (library_ && library_->is_valid())
+ return MOJO_RESULT_OK;
+
+@@ -87,7 +87,7 @@ class CoreLibraryInitializer {
+
+ if (library_path.empty()) {
+ // Default to looking for the library in the current working directory.
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const base::FilePath::CharType kDefaultLibraryPathValue[] =
+ FILE_PATH_LITERAL("./libmojo_core.so");
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -143,7 +143,7 @@ class CoreLibraryInitializer {
+
+ private:
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ absl::optional<base::ScopedNativeLibrary> library_;
+ #endif
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_public_tools_bindings_mojom.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_mojo_public_tools_bindings_mojom.gni
@@ -0,0 +1,19 @@
+--- src/3rdparty/chromium/mojo/public/tools/bindings/mojom.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/mojo/public/tools/bindings/mojom.gni
+@@ -688,6 +688,16 @@ template("mojom") {
+ enabled_features += [ "is_win" ]
+ }
+
++ if (is_openbsd) {
++ enabled_features += [ "is_openbsd" ]
++ enabled_features += [ "is_bsd" ]
++ }
++
++ if (is_freebsd) {
++ enabled_features += [ "is_freebsd" ]
++ enabled_features += [ "is_bsd" ]
++ }
++
+ action(parser_target_name) {
+ script = mojom_parser_script
+ inputs = mojom_parser_sources + [ build_metadata_filename ]
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_BUILD.gn
@@ -0,0 +1,91 @@
+--- src/3rdparty/chromium/net/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/BUILD.gn
+@@ -108,7 +108,7 @@ net_configs = [
+ "//build/config/compiler:wexit_time_destructors",
+ ]
+
+-if (is_linux || is_chromeos) {
++if ((is_linux || is_chromeos) && !is_bsd) {
+ net_configs += [ "//build/config/linux:libresolv" ]
+ }
+
+@@ -1092,6 +1092,7 @@ component("net") {
+ "//net/dns:mdns_client",
+ "//net/dns/public",
+ "//net/third_party/quiche",
++ "//sandbox/policy",
+ ]
+
+ allow_circular_includes_from = [
+@@ -1218,6 +1219,15 @@ component("net") {
+ ]
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "base/address_tracker_linux.cc",
++ "base/address_tracker_linux.h",
++ "base/network_change_notifier_linux.cc",
++ "base/network_interfaces_linux.cc",
++ ]
++ }
++
+ if (is_mac) {
+ sources += [
+ "base/network_notification_thread_mac.cc",
+@@ -1348,7 +1358,7 @@ component("net") {
+ }
+ }
+
+- if (is_android || is_chromeos_ash) {
++ if (is_android || is_chromeos_ash || is_bsd) {
+ sources += [
+ "base/network_change_notifier_posix.cc",
+ "base/network_change_notifier_posix.h",
+@@ -1381,7 +1391,7 @@ component("net") {
+ }
+
+ # Use getifaddrs() on POSIX platforms, except Linux.
+- if (is_posix && !is_linux && !is_chromeos) {
++ if ((is_posix && !is_linux && !is_chromeos) || is_bsd) {
+ sources += [
+ "base/network_interfaces_getifaddrs.cc",
+ "base/network_interfaces_getifaddrs.h",
+@@ -4369,7 +4379,7 @@ test("net_unittests") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "base/address_tracker_linux_unittest.cc",
+ "base/network_interfaces_linux_unittest.cc",
+@@ -4443,6 +4453,10 @@ test("net_unittests") {
+ "//url:buildflags",
+ ]
+
++ if (is_bsd) {
++ deps += [ "//sandbox/policy" ]
++ }
++
+ allow_circular_includes_from = [ "//net/third_party/quiche:quiche_tests" ]
+
+ if (enable_websockets) {
+@@ -4513,7 +4527,7 @@ test("net_unittests") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "quic/platform/impl/quic_flags_test.cc",
+ "tools/quic/quic_http_proxy_backend_stream_test.cc",
+@@ -4660,7 +4674,7 @@ test("net_unittests") {
+ }
+
+ # Use getifaddrs() on POSIX platforms, except Linux.
+- if (is_posix && !is_linux && !is_chromeos) {
++ if (is_posix && !is_linux && !is_chromeos && !is_bsd) {
+ sources += [ "base/network_interfaces_getifaddrs_unittest.cc" ]
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_base_network__change__notifier.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_base_network__change__notifier.cc
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/net/base/network_change_notifier.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/base/network_change_notifier.cc
+@@ -39,7 +39,7 @@
+ #include "net/base/network_change_notifier_linux.h"
+ #elif BUILDFLAG(IS_APPLE)
+ #include "net/base/network_change_notifier_mac.h"
+-#elif BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "net/base/network_change_notifier_posix.h"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include "net/base/network_change_notifier_fuchsia.h"
+@@ -331,6 +331,9 @@ std::unique_ptr<NetworkChangeNotifier> NetworkChangeNo
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return std::make_unique<NetworkChangeNotifierFuchsia>(
+ /*require_wlan=*/false);
++#elif BUILDFLAG(IS_BSD)
++ return std::make_unique<MockNetworkChangeNotifier>(
++ /*dns_config_notifier*/nullptr);
+ #else
+ NOTIMPLEMENTED();
+ return NULL;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_base_network__change__notifier__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_base_network__change__notifier__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/base/network_change_notifier_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/base/network_change_notifier_posix.cc
+@@ -92,7 +92,7 @@ NetworkChangeNotifierPosix::NetworkChangeCalculatorPar
+ NetworkChangeNotifier::NetworkChangeCalculatorParams
+ NetworkChangeNotifierPosix::NetworkChangeCalculatorParamsPosix() {
+ NetworkChangeCalculatorParams params;
+-#if BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_BSD)
+ // Delay values arrived at by simple experimentation and adjusted so as to
+ // produce a single signal when switching between network connections.
+ params.ip_address_offline_delay_ = base::Milliseconds(4000);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_base_network__interfaces__posix.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_base_network__interfaces__posix.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/base/network_interfaces_posix.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/base/network_interfaces_posix.h
+@@ -8,6 +8,8 @@
+ // This file provides some basic functionality shared between
+ // network_interfaces_linux.cc and network_interfaces_getifaddrs.cc.
+
++#include <sys/socket.h>
++
+ #include <string>
+
+ struct sockaddr;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_cert_cert__verifier.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_cert_cert__verifier.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/cert/cert_verifier.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/cert/cert_verifier.cc
+@@ -78,7 +78,7 @@ std::unique_ptr<CertVerifier> CertVerifier::CreateDefa
+ std::unique_ptr<CertVerifier> CertVerifier::CreateDefaultWithoutCaching(
+ scoped_refptr<CertNetFetcher> cert_net_fetcher) {
+ scoped_refptr<CertVerifyProc> verify_proc;
+-#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ verify_proc =
+ CertVerifyProc::CreateBuiltinVerifyProc(std::move(cert_net_fetcher));
+ #elif BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_cert_cert__verify__proc.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_cert_cert__verify__proc.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/cert/cert_verify_proc.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/cert/cert_verify_proc.h
+@@ -79,7 +79,7 @@ class NET_EXPORT CertVerifyProc
+ kMaxValue = kOther
+ };
+
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ // Creates and returns a CertVerifyProc that uses the system verifier.
+ // |cert_net_fetcher| may not be used, depending on the implementation.
+ static scoped_refptr<CertVerifyProc> CreateSystemVerifyProc(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_cert_cert__verify__proc.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_cert_cert__verify__proc.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/cert/cert_verify_proc.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/cert/cert_verify_proc.cc
+@@ -552,7 +552,7 @@ base::Value CertVerifyParams(X509Certificate* cert,
+
+ } // namespace
+
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ // static
+ scoped_refptr<CertVerifyProc> CertVerifyProc::CreateSystemVerifyProc(
+ scoped_refptr<CertNetFetcher> cert_net_fetcher) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_disk__cache_blockfile_disk__format.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_disk__cache_blockfile_disk__format.h
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/net/disk_cache/blockfile/disk_format.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/net/disk_cache/blockfile/disk_format.h
+@@ -149,7 +149,9 @@ struct RankingsNode {
+ };
+ #pragma pack(pop)
+
++#if !defined(OS_BSD)
+ static_assert(sizeof(RankingsNode) == 36, "bad RankingsNode");
++#endif
+
+ } // namespace disk_cache
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_disk__cache_simple_simple__file__tracker.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_disk__cache_simple_simple__file__tracker.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/net/disk_cache/simple/simple_file_tracker.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/disk_cache/simple/simple_file_tracker.cc
+@@ -28,7 +28,17 @@ SimpleFileTracker::SimpleFileTracker(int file_limit)
+ } // namespace
+
+ SimpleFileTracker::SimpleFileTracker(int file_limit)
++#if defined(OS_OPENBSD)
++{
++ // cap the file descriptor limit at 85% of the size of the
++ // file descriptor table and also substract the amount of
++ // currently used file descriptors as this should give us
++ // enough reserve to avoid hitting the limit
++ file_limit_ = (getdtablesize() * 0.85) - getdtablecount();
++}
++#else
+ : file_limit_(file_limit) {}
++#endif
+
+ SimpleFileTracker::~SimpleFileTracker() {
+ DCHECK(lru_.empty());
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_BUILD.gn
@@ -0,0 +1,31 @@
+--- src/3rdparty/chromium/net/dns/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/BUILD.gn
+@@ -112,7 +112,7 @@ source_set("dns") {
+ "dns_config_service_android.cc",
+ "dns_config_service_android.h",
+ ]
+- } else if (is_linux) {
++ } else if (is_linux && !is_bsd) {
+ sources += [
+ "dns_config_service_linux.cc",
+ "dns_config_service_linux.h",
+@@ -153,6 +153,7 @@ source_set("dns") {
+ ":host_resolver_manager",
+ ":mdns_client",
+ "//net:net_public_deps",
++ "//printing/buildflags",
+ ]
+
+ allow_circular_includes_from = [
+@@ -413,9 +414,9 @@ source_set("tests") {
+
+ if (is_android) {
+ sources += [ "dns_config_service_android_unittest.cc" ]
+- } else if (is_linux) {
++ } else if (is_linux && !is_bsd) {
+ sources += [ "dns_config_service_linux_unittest.cc" ]
+- } else if (is_posix) {
++ } else if (is_posix && !is_bsd) {
+ sources += [ "dns_config_service_posix_unittest.cc" ]
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_address__sorter__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_address__sorter__posix.cc
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/net/dns/address_sorter_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/address_sorter_posix.cc
+@@ -18,6 +18,7 @@
+ #include <ifaddrs.h>
+ #include <net/if.h>
+ #include <netinet/in_var.h>
++#include <netinet6/in6_var.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__config__service__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__config__service__posix.cc
@@ -0,0 +1,26 @@
+--- src/3rdparty/chromium/net/dns/dns_config_service_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/dns_config_service_posix.cc
+@@ -33,6 +33,11 @@
+ #include "net/dns/dns_config_watcher_mac.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "base/command_line.h"
++#include "sandbox/policy/switches.h"
++#endif
++
+ namespace net {
+
+ namespace internal {
+@@ -129,6 +134,11 @@ class DnsConfigServicePosix::Watcher : public DnsConfi
+
+ bool Watch() override {
+ CheckOnCorrectSequence();
++
++// pledge + unveil
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (!command_line->HasSwitch(sandbox::policy::switches::kNoSandbox))
++ return false;
+
+ bool success = true;
+ if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__reloader.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__reloader.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/dns/dns_reloader.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/dns_reloader.h
+@@ -7,7 +7,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ namespace net {
+
+ // Call on the network thread before calling DnsReloaderMaybeReload() anywhere.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__reloader.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__reloader.cc
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/net/dns/dns_reloader.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/dns_reloader.cc
+@@ -6,7 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) && \
+ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
+
+ #include <resolv.h>
+@@ -113,5 +113,5 @@ void DnsReloaderMaybeReload() {
+
+ } // namespace net
+
+-#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD)
++#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) &&
+ // && !BUILDFLAG(IS_ANDROID)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_dns__util.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/dns/dns_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/dns_util.cc
+@@ -28,6 +28,8 @@
+ #include "net/third_party/uri_template/uri_template.h"
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+
++#include <sys/socket.h>
++
+ #if BUILDFLAG(IS_POSIX)
+ #include <netinet/in.h>
+ #include <net/if.h>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_host__resolver__manager.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_host__resolver__manager.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/dns/host_resolver_manager.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/host_resolver_manager.cc
+@@ -3157,7 +3157,7 @@ HostResolverManager::HostResolverManager(
+ }
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) && \
+ !BUILDFLAG(IS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_host__resolver__proc.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_host__resolver__proc.cc
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/net/dns/host_resolver_proc.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/host_resolver_proc.cc
+@@ -19,10 +19,6 @@
+ #include "net/dns/dns_util.h"
+ #include "net/dns/host_resolver.h"
+
+-#if BUILDFLAG(IS_OPENBSD)
+-#define AI_ADDRCONFIG 0
+-#endif
+-
+ namespace net {
+
+ HostResolverProc* HostResolverProc::default_proc_ = nullptr;
+@@ -192,7 +188,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::BlockingType::WILL_BLOCK);
+
+ #if BUILDFLAG(IS_POSIX) && \
+- !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++ !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) || BUILDFLAG(IS_ANDROID))
+ DnsReloaderMaybeReload();
+ #endif
+ auto [ai, err, os_error] = AddressInfo::Get(host, hints, nullptr, network);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_public_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_public_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/dns/public/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/public/BUILD.gn
+@@ -74,7 +74,7 @@ source_set("tests") {
+ "doh_provider_entry_unittest.cc",
+ ]
+
+- if (is_posix && !is_android) {
++ if (is_posix && !is_android && !is_bsd) {
+ sources += [ "resolv_reader_unittest.cc" ]
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_public_resolv__reader.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_public_resolv__reader.h
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/net/dns/public/resolv_reader.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/public/resolv_reader.h
+@@ -5,6 +5,7 @@
+ #ifndef NET_DNS_PUBLIC_RESOLV_READER_H_
+ #define NET_DNS_PUBLIC_RESOLV_READER_H_
+
++#include <netinet/in.h>
+ #include <resolv.h>
+
+ #include <memory>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_public_scoped__res__state.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_dns_public_scoped__res__state.h
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/net/dns/public/scoped_res_state.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/dns/public/scoped_res_state.h
+@@ -5,6 +5,7 @@
+ #ifndef NET_DNS_PUBLIC_SCOPED_RES_STATE_H_
+ #define NET_DNS_PUBLIC_SCOPED_RES_STATE_H_
+
++#include <netinet/in.h>
+ #include <resolv.h>
+
+ #include "build/build_config.h"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_http_http__auth__gssapi__posix.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_http_http__auth__gssapi__posix.h
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/net/http/http_auth_gssapi_posix.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/http/http_auth_gssapi_posix.h
+@@ -20,6 +20,9 @@
+ #if BUILDFLAG(IS_APPLE)
+ #include <GSS/gssapi.h>
+ #elif BUILDFLAG(IS_FREEBSD)
++#ifndef GSS_C_DELEG_POLICY_FLAG
++#define GSS_C_DELEG_POLICY_FLAG 32768
++#endif
+ #include <gssapi/gssapi.h>
+ #else
+ #include <gssapi.h>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_http_http__auth__gssapi__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_http_http__auth__gssapi__posix.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/net/http/http_auth_gssapi_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/http/http_auth_gssapi_posix.cc
+@@ -369,8 +369,9 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLib
+ static const char* const kDefaultLibraryNames[] = {
+ #if BUILDFLAG(IS_APPLE)
+ "/System/Library/Frameworks/GSS.framework/GSS"
+-#elif BUILDFLAG(IS_OPENBSD)
+- "libgssapi.so" // Heimdal - OpenBSD
++#elif BUILDFLAG(IS_BSD)
++ "libgssapi_krb5.so.2", // MIT Kerberos - FreeBSD
++ "libgssapi.so" // Heimdal - OpenBSD, FreeBSD
+ #else
+ "libgssapi_krb5.so.2", // MIT Kerberos - FC, Suse10, Debian
+ "libgssapi.so.4", // Heimdal - Suse10, MDK
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_http_http__network__session.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_http_http__network__session.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/net/http/http_network_session.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/http/http_network_session.cc
+@@ -20,7 +20,9 @@
+ #include "build/build_config.h"
+ #include "net/base/features.h"
+ #include "net/dns/host_resolver.h"
++#if defined(USE_KERBEROS)
+ #include "net/http/http_auth_handler_factory.h"
++#endif
+ #include "net/http/http_response_body_drainer.h"
+ #include "net/http/http_stream_factory.h"
+ #include "net/http/url_security_manager.h"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_proxy__resolution_configured__proxy__resolution__service.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_proxy__resolution_configured__proxy__resolution__service.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/net/proxy_resolution/configured_proxy_resolution_service.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/proxy_resolution/configured_proxy_resolution_service.cc
+@@ -53,7 +53,7 @@
+ #elif BUILDFLAG(IS_MAC)
+ #include "net/proxy_resolution/proxy_config_service_mac.h"
+ #include "net/proxy_resolution/proxy_resolver_mac.h"
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "net/proxy_resolution/proxy_config_service_linux.h"
+ #elif BUILDFLAG(IS_ANDROID)
+ #include "net/proxy_resolution/proxy_config_service_android.h"
+@@ -65,7 +65,7 @@ namespace {
+
+ namespace {
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr net::NetworkTrafficAnnotationTag kSystemProxyConfigTrafficAnnotation =
+ net::DefineNetworkTrafficAnnotation("proxy_config_system", R"(
+ semantics {
+@@ -1423,7 +1423,7 @@ ConfiguredProxyResolutionService::CreateSystemProxyCon
+ << "profile_io_data.cc::CreateProxyConfigService and this should "
+ << "be used only for examples.";
+ return std::make_unique<UnsetProxyConfigService>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<ProxyConfigServiceLinux> linux_config_service(
+ new ProxyConfigServiceLinux());
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_proxy__resolution_proxy__config__service__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_proxy__resolution_proxy__config__service__linux.cc
@@ -0,0 +1,40 @@
+--- src/3rdparty/chromium/net/proxy_resolution/proxy_config_service_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/proxy_resolution/proxy_config_service_linux.cc
+@@ -6,7 +6,9 @@
+
+ #include <errno.h>
+ #include <limits.h>
++#if !defined(OS_BSD)
+ #include <sys/inotify.h>
++#endif
+ #include <unistd.h>
+
+ #include <map>
+@@ -506,6 +508,7 @@ bool SettingGetterImplGSettings::CheckVersion(
+ }
+ #endif // defined(USE_GIO)
+
++#if !defined(OS_BSD)
+ // Converts |value| from a decimal string to an int. If there was a failure
+ // parsing, returns |default_value|.
+ int StringToIntOrDefault(base::StringPiece value, int default_value) {
+@@ -1007,6 +1010,7 @@ class SettingGetterImplKDE : public ProxyConfigService
+ // events on.
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
+ };
++#endif
+
+ } // namespace
+
+@@ -1223,9 +1227,11 @@ ProxyConfigServiceLinux::Delegate::Delegate(
+ case base::nix::DESKTOP_ENVIRONMENT_KDE3:
+ case base::nix::DESKTOP_ENVIRONMENT_KDE4:
+ case base::nix::DESKTOP_ENVIRONMENT_KDE5:
++#if !defined(OS_BSD)
+ setting_getter_ =
+ std::make_unique<SettingGetterImplKDE>(env_var_getter_.get());
+ break;
++#endif
+ case base::nix::DESKTOP_ENVIRONMENT_XFCE:
+ case base::nix::DESKTOP_ENVIRONMENT_OTHER:
+ break;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_socket__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_socket__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/socket/socket_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/socket/socket_posix.cc
+@@ -519,7 +519,7 @@ int SocketPosix::DoWrite(IOBuffer* buf, int buf_len) {
+ }
+
+ int SocketPosix::DoWrite(IOBuffer* buf, int buf_len) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Disable SIGPIPE for this write. Although Chromium globally disables
+ // SIGPIPE, the net stack may be used in other consumers which do not do
+ // this. MSG_NOSIGNAL is a Linux-only API. On OS X, this is a setsockopt on
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_socks5__client__socket.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_socks5__client__socket.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/net/socket/socks5_client_socket.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/socket/socks5_client_socket.cc
+@@ -19,6 +19,9 @@
+ #include "net/log/net_log_event_type.h"
+ #include "net/traffic_annotation/network_traffic_annotation.h"
+
++#include <sys/types.h>
++#include <netinet/in.h>
++
+ namespace net {
+
+ const unsigned int SOCKS5ClientSocket::kGreetReadHeaderSize = 2;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_tcp__socket__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_tcp__socket__posix.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/net/socket/tcp_socket_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/socket/tcp_socket_posix.cc
+@@ -97,6 +97,17 @@ bool SetTCPKeepAlive(int fd, bool enable, int delay) {
+ PLOG(ERROR) << "Failed to set TCP_KEEPALIVE on fd: " << fd;
+ return false;
+ }
++#elif BUILDFLAG(IS_FREEBSD)
++ // Set seconds until first TCP keep alive.
++ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) {
++ PLOG(ERROR) << "Failed to set TCP_KEEPIDLE on fd: " << fd;
++ return false;
++ }
++ // Set seconds between TCP keep alives.
++ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &delay, sizeof(delay))) {
++ PLOG(ERROR) << "Failed to set TCP_KEEPINTVL on fd: " << fd;
++ return false;
++ }
+ #endif
+ return true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_udp__socket__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_udp__socket__posix.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/net/socket/udp_socket_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/socket/udp_socket_posix.cc
+@@ -621,7 +621,7 @@ void UDPSocketPosix::SetMsgConfirm(bool confirm) {
+ }
+
+ void UDPSocketPosix::SetMsgConfirm(bool confirm) {
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ if (confirm) {
+ sendto_flags_ |= MSG_CONFIRM;
+ } else {
+@@ -642,7 +642,7 @@ int UDPSocketPosix::SetBroadcast(bool broadcast) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ int value = broadcast ? 1 : 0;
+ int rv;
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // SO_REUSEPORT on OSX permits multiple processes to each receive
+ // UDP multicast or broadcast datagrams destined for the bound
+ // port.
+@@ -955,7 +955,7 @@ int UDPSocketPosix::DoBind(const IPEndPoint& address)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ if (last_error == EINVAL)
+ return ERR_ADDRESS_IN_USE;
+-#elif BUILDFLAG(IS_APPLE)
++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ if (last_error == EADDRNOTAVAIL)
+ return ERR_ADDRESS_IN_USE;
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_unix__domain__client__socket__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_socket_unix__domain__client__socket__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/socket/unix_domain_client_socket_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/socket/unix_domain_client_socket_posix.cc
+@@ -60,7 +60,7 @@ bool UnixDomainClientSocket::FillAddress(const std::st
+ return true;
+ }
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Convert the path given into abstract socket name. It must start with
+ // the '\0' character, so we are adding it. |addr_len| must specify the
+ // length of the structure exactly, as potentially the socket name may
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_third__party_quiche_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_third__party_quiche_BUILD.gn
@@ -0,0 +1,33 @@
+--- src/3rdparty/chromium/net/third_party/quiche/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/third_party/quiche/BUILD.gn
+@@ -713,7 +713,7 @@ proto_library("net_quic_test_tools_proto") {
+ extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
+ }
+
+-if (is_linux || is_chromeos) {
++if ((is_linux || is_chromeos) && !is_bsd) {
+ source_set("epoll_server") {
+ sources = [
+ "overrides/quiche_platform_impl/epoll_bug_impl.h",
+@@ -1104,7 +1104,7 @@ source_set("quic_test_tools_core") {
+ "//third_party/quic_trace:quic_trace_proto",
+ ]
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "src/quiche/epoll_server/fake_simple_epoll_server.cc",
+ "src/quiche/epoll_server/fake_simple_epoll_server.h",
+@@ -1564,10 +1564,10 @@ source_set("quiche_tests") {
+ ]
+ public_deps = []
+
+- if (is_linux || is_chromeos_lacros) {
++ if ((is_linux || is_chromeos_lacros) && !is_bsd) {
+ public_deps += [ ":epoll_quic_tools" ]
+ }
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "overrides/quiche_platform_impl/quiche_command_line_flags_test.cc",
+ "src/quiche/epoll_server/simple_epoll_server_test.cc",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_tools_cert__verify__tool_cert__verify__comparision__tool.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_tools_cert__verify__tool_cert__verify__comparision__tool.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/net/tools/cert_verify_tool/cert_verify_comparision_tool.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/tools/cert_verify_tool/cert_verify_comparision_tool.cc
+@@ -35,7 +35,7 @@
+ #include "net/url_request/url_request_context_builder.h"
+ #include "net/url_request/url_request_context_getter.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "net/proxy_resolution/proxy_config.h"
+ #include "net/proxy_resolution/proxy_config_service_fixed.h"
+ #endif
+@@ -51,7 +51,7 @@ void SetUpOnNetworkThread(
+ base::WaitableEvent* initialization_complete_event) {
+ net::URLRequestContextBuilder url_request_context_builder;
+ url_request_context_builder.set_user_agent(GetUserAgent());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, use a fixed ProxyConfigService, since the default one
+ // depends on glib.
+ //
+@@ -123,7 +123,7 @@ std::unique_ptr<CertVerifyImpl> CreateCertVerifyImplFr
+ std::unique_ptr<CertVerifyImpl> CreateCertVerifyImplFromName(
+ base::StringPiece impl_name,
+ scoped_refptr<net::CertNetFetcher> cert_net_fetcher) {
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ if (impl_name == "platform") {
+ return std::make_unique<CertVerifyImpl>(
+ "CertVerifyProc (system)", net::CertVerifyProc::CreateSystemVerifyProc(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_tools_cert__verify__tool_cert__verify__tool.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_tools_cert__verify__tool_cert__verify__tool.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/net/tools/cert_verify_tool/cert_verify_tool.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/tools/cert_verify_tool/cert_verify_tool.cc
+@@ -30,7 +30,7 @@
+ #include "net/url_request/url_request_context_builder.h"
+ #include "net/url_request/url_request_context_getter.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "net/proxy_resolution/proxy_config.h"
+ #include "net/proxy_resolution/proxy_config_service_fixed.h"
+ #endif
+@@ -56,7 +56,7 @@ void SetUpOnNetworkThread(
+ base::WaitableEvent* initialization_complete_event) {
+ net::URLRequestContextBuilder url_request_context_builder;
+ url_request_context_builder.set_user_agent(GetUserAgent());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, use a fixed ProxyConfigService, since the default one
+ // depends on glib.
+ //
+@@ -206,7 +206,7 @@ std::unique_ptr<CertVerifyImpl> CreateCertVerifyImplFr
+ base::StringPiece impl_name,
+ scoped_refptr<net::CertNetFetcher> cert_net_fetcher,
+ RootStoreType root_store_type) {
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD)
+ if (impl_name == "platform") {
+ if (root_store_type != RootStoreType::kSystem) {
+ std::cerr << "WARNING: platform verifier not supported with "
+@@ -463,7 +463,7 @@ int main(int argc, char** argv) {
+ std::string impls_str = command_line.GetSwitchValueASCII("impls");
+ if (impls_str.empty()) {
+ // Default value.
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD)
+ impls_str = "platform,";
+ #endif
+ impls_str += "builtin,pathbuilder";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_tools_quic_quic__http__proxy__backend.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_tools_quic_quic__http__proxy__backend.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/tools/quic/quic_http_proxy_backend.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/tools/quic/quic_http_proxy_backend.cc
+@@ -161,7 +161,7 @@ void QuicHttpProxyBackend::InitializeURLRequestContext
+ // Enable HTTP2, but disable QUIC on the backend
+ context_builder.SetSpdyAndQuicEnabled(true /* http2 */, false /* quic */);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, use a fixed ProxyConfigService, since the default one
+ // depends on glib.
+ context_builder.set_proxy_config_service(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_traffic__annotation_network__traffic__annotation.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_traffic__annotation_network__traffic__annotation.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/net/traffic_annotation/network_traffic_annotation.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/traffic_annotation/network_traffic_annotation.h
+@@ -371,7 +371,7 @@ struct MutablePartialNetworkTrafficAnnotationTag {
+ } // namespace net
+
+ // Placeholder for unannotated usages.
+-#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ #define TRAFFIC_ANNOTATION_WITHOUT_PROTO(ANNOTATION_ID) \
+ net::DefineNetworkTrafficAnnotation(ANNOTATION_ID, "No proto yet.")
+ #endif
+@@ -385,7 +385,7 @@ struct MutablePartialNetworkTrafficAnnotationTag {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+
+ #define NO_TRAFFIC_ANNOTATION_YET \
+ net::DefineNetworkTrafficAnnotation("undefined", "Nothing here yet.")
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__fetcher.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__fetcher.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/url_request/url_fetcher.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/url_request/url_fetcher.h
+@@ -344,7 +344,7 @@ class NET_EXPORT URLFetcher {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if (!BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))) || \
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))) || \
+ BUILDFLAG(IS_CHROMEOS)
+ // |url| is the URL to send the request to. It must be valid.
+ // |request_type| is the type of request to make.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__fetcher.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__fetcher.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/url_request/url_fetcher.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/url_request/url_fetcher.cc
+@@ -26,7 +26,7 @@ void URLFetcher::SetIgnoreCertificateRequests(bool ign
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ // static
+ std::unique_ptr<URLFetcher> URLFetcher::Create(
+ const GURL& url,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__request__context.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__request__context.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/url_request/url_request_context.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/url_request/url_request_context.h
+@@ -89,7 +89,7 @@ class NET_EXPORT URLRequestContext {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ // This function should not be used in Chromium, please use the version with
+ // NetworkTrafficAnnotationTag in the future.
+ //
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__request__context.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__request__context.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/url_request/url_request_context.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/url_request/url_request_context.cc
+@@ -91,7 +91,7 @@ const HttpNetworkSessionContext* URLRequestContext::Ge
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ std::unique_ptr<URLRequest> URLRequestContext::CreateRequest(
+ const GURL& url,
+ RequestPriority priority,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__request__context__builder.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_net_url__request_url__request__context__builder.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/net/url_request/url_request_context_builder.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/net/url_request/url_request_context_builder.cc
+@@ -498,7 +498,7 @@ std::unique_ptr<URLRequestContext> URLRequestContextBu
+ }
+
+ if (!proxy_resolution_service_) {
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD)
+ // TODO(willchan): Switch to using this code when
+ // ConfiguredProxyResolutionService::CreateSystemProxyConfigService()'s
+ // signature doesn't suck.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_mojom_printing__context__mojom__traits.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_mojom_printing__context__mojom__traits.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/printing/mojom/printing_context_mojom_traits.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/mojom/printing_context_mojom_traits.h
+@@ -168,7 +168,7 @@ struct StructTraits<printing::mojom::PrintSettingsData
+ return s.pages_per_sheet();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static const printing::PrintSettings::AdvancedSettings& advanced_settings(
+ const printing::PrintSettings& s) {
+ return s.advanced_settings();
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_mojom_printing__context__mojom__traits.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_mojom_printing__context__mojom__traits.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/printing/mojom/printing_context_mojom_traits.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/mojom/printing_context_mojom_traits.cc
+@@ -16,7 +16,7 @@
+ #include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
+ #include "ui/gfx/geometry/size.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "mojo/public/mojom/base/values.mojom.h"
+ #endif
+
+@@ -162,7 +162,7 @@ bool StructTraits<
+ }
+
+ out->set_pages_per_sheet(data.pages_per_sheet());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ DCHECK(out->advanced_settings().empty());
+ if (!data.ReadAdvancedSettings(&out->advanced_settings()))
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_print__settings.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_print__settings.h
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/printing/print_settings.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/print_settings.h
+@@ -18,7 +18,7 @@
+ #include "ui/gfx/geometry/rect.h"
+ #include "ui/gfx/geometry/size.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <map>
+
+ #include "base/values.h"
+@@ -66,7 +66,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings {
+ }
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ using AdvancedSettings = std::map<std::string, base::Value>;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -221,7 +221,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings {
+ pages_per_sheet_ = pages_per_sheet;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ AdvancedSettings& advanced_settings() { return advanced_settings_; }
+ const AdvancedSettings& advanced_settings() const {
+ return advanced_settings_;
+@@ -322,7 +322,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings {
+ // Number of pages per sheet.
+ int pages_per_sheet_;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Advanced settings.
+ AdvancedSettings advanced_settings_;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_print__settings.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_print__settings.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/printing/print_settings.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/print_settings.cc
+@@ -272,7 +272,7 @@ PrintSettings& PrintSettings::operator=(const PrintSet
+ #endif
+ is_modifiable_ = settings.is_modifiable_;
+ pages_per_sheet_ = settings.pages_per_sheet_;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (const auto& item : settings.advanced_settings_)
+ advanced_settings_.emplace(item.first, item.second.Clone());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -312,7 +312,7 @@ void PrintSettings::Clear() {
+ #endif
+ is_modifiable_ = true;
+ pages_per_sheet_ = 1;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ advanced_settings_.clear();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ #if BUILDFLAG(IS_CHROMEOS)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_print__settings__conversion.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_print__settings__conversion.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/printing/print_settings_conversion.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/print_settings_conversion.cc
+@@ -215,7 +215,7 @@ std::unique_ptr<PrintSettings> PrintSettingsFromJobSet
+ settings->set_is_modifiable(is_modifiable.value());
+ }
+
+-#if BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && defined(USE_CUPS))
++#if BUILDFLAG(IS_CHROMEOS) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(USE_CUPS))
+ const base::Value::Dict* advanced_settings =
+ job_settings.FindDict(kSettingAdvancedSettings);
+ if (advanced_settings) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_printing__features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_printing__features.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/printing/printing_features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/printing_features.cc
+@@ -8,7 +8,7 @@
+ #include "printing/buildflags/buildflags.h"
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/metrics/field_trial_params.h"
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_sandbox_print__backend__sandbox__hook__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_sandbox_print__backend__sandbox__hook__linux.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/printing/sandbox/print_backend_sandbox_hook_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/sandbox/print_backend_sandbox_hook_linux.h
+@@ -5,8 +5,13 @@
+ #ifndef PRINTING_SANDBOX_PRINT_BACKEND_SANDBOX_HOOK_LINUX_H_
+ #define PRINTING_SANDBOX_PRINT_BACKEND_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
+ #include "base/component_export.h"
++#if defined(OS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace printing {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_sandbox_print__backend__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_printing_sandbox_print__backend__sandbox__hook__linux.cc
@@ -0,0 +1,51 @@
+--- src/3rdparty/chromium/printing/sandbox/print_backend_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/printing/sandbox/print_backend_sandbox_hook_linux.cc
+@@ -9,21 +9,28 @@
+ #include "base/files/file_util.h"
+ #include "base/path_service.h"
+ #include "build/build_config.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "sandbox/linux/syscall_broker/broker_command.h"
+ #include "sandbox/linux/syscall_broker/broker_file_permission.h"
+ #include "sandbox/policy/export.h"
+ #include "sandbox/policy/linux/sandbox_linux.h"
+ #include "services/network/network_sandbox_hook_linux.h"
++#else
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#endif
+
+ #if BUILDFLAG(IS_CHROMEOS) && defined(USE_CUPS)
+ #include "printing/backend/cups_connection_pool.h"
+ #endif
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
+ using sandbox::syscall_broker::MakeBrokerCommandSet;
++#endif
+
+ namespace printing {
+
++#if !BUILDFLAG(IS_BSD)
+ namespace {
+
+ sandbox::syscall_broker::BrokerCommandSet GetPrintBackendBrokerCommandSet() {
+@@ -84,9 +91,11 @@ std::vector<BrokerFilePermission> GetPrintBackendFileP
+ }
+
+ } // namespace
++#endif
+
+ bool PrintBackendPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(IS_CHROMEOS) && defined(USE_CUPS)
+ // Create the socket connections to the CUPS server before engaging the
+ // sandbox, since new connections cannot be made after that.
+@@ -100,6 +109,7 @@ bool PrintBackendPreSandboxHook(
+ sandbox::policy::SandboxLinux::PreSandboxHook(), options);
+
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+ return true;
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/sandbox/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/BUILD.gn
+@@ -36,7 +36,7 @@ group("sandbox") {
+ "//sandbox/mac:system_services",
+ "//sandbox/mac/mojom",
+ ]
+- } else if (is_linux || is_chromeos || is_android) {
++ } else if ((is_linux && !is_bsd) || is_chromeos || is_android) {
+ public_deps = [ "//sandbox/linux:sandbox" ]
+ }
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_features.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_features.gni
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/sandbox/features.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/features.gni
+@@ -6,7 +6,7 @@
+ # currently.
+ # Do not disable seccomp_bpf anywhere without talking to
+ # security@chromium.org!
+-use_seccomp_bpf = (is_linux || is_chromeos || is_android) &&
++use_seccomp_bpf = !is_bsd && (is_linux || is_chromeos || is_android) &&
+ (current_cpu == "x86" || current_cpu == "x64" ||
+ current_cpu == "arm" || current_cpu == "arm64" ||
+ current_cpu == "mipsel" || current_cpu == "mips64el")
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_linux_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_linux_BUILD.gn
@@ -0,0 +1,58 @@
+--- src/3rdparty/chromium/sandbox/linux/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/linux/BUILD.gn
+@@ -12,12 +12,12 @@ declare_args() {
+ }
+
+ declare_args() {
+- compile_suid_client = is_linux || is_chromeos
++ compile_suid_client = (is_linux || is_chromeos) && !is_bsd
+
+- compile_credentials = is_linux || is_chromeos
++ compile_credentials = (is_linux || is_chromeos) && !is_bsd
+
+ # On Android, use plain GTest.
+- use_base_test_suite = is_linux || is_chromeos
++ use_base_test_suite = (is_linux || is_chromeos) && !is_bsd
+ }
+
+ # We have two principal targets: sandbox and sandbox_linux_unittests
+@@ -367,6 +367,39 @@ component("sandbox_services") {
+ sources += [
+ "services/libc_interceptor.cc",
+ "services/libc_interceptor.h",
++ ]
++ }
++
++ if (is_bsd) {
++ sources -= [
++ "services/scoped_process.cc",
++ "services/scoped_process.h",
++ "services/syscall_wrappers.cc",
++ "services/syscall_wrappers.h",
++ "services/yama.cc",
++ "services/yama.h",
++ "syscall_broker/broker_channel.cc",
++ "syscall_broker/broker_channel.h",
++ "syscall_broker/broker_client.cc",
++ "syscall_broker/broker_client.h",
++ "syscall_broker/broker_command.cc",
++ "syscall_broker/broker_command.h",
++ "syscall_broker/broker_file_permission.cc",
++ "syscall_broker/broker_file_permission.h",
++ "syscall_broker/broker_host.cc",
++ "syscall_broker/broker_host.h",
++ "syscall_broker/broker_permission_list.cc",
++ "syscall_broker/broker_permission_list.h",
++ "syscall_broker/broker_process.cc",
++ "syscall_broker/broker_process.h",
++ "syscall_broker/broker_sandbox_config.cc",
++ "syscall_broker/broker_sandbox_config.h",
++ "syscall_broker/broker_simple_message.cc",
++ "syscall_broker/broker_simple_message.h",
++ "syscall_broker/remote_syscall_arg_handler.cc",
++ "syscall_broker/remote_syscall_arg_handler.h",
++ "syscall_broker/syscall_dispatcher.cc",
++ "syscall_broker/syscall_dispatcher.h",
+ ]
+ }
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_linux_services_init__process__reaper.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_linux_services_init__process__reaper.cc
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/sandbox/linux/services/init_process_reaper.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/linux/services/init_process_reaper.cc
+@@ -2,6 +2,7 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+
++#if 0
+ #include "sandbox/linux/services/init_process_reaper.h"
+
+ #include <signal.h>
+@@ -100,3 +101,4 @@ bool CreateInitProcessReaper(base::OnceClosure post_fo
+ }
+
+ } // namespace sandbox.
++#endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_linux_services_libc__interceptor.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_linux_services_libc__interceptor.cc
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/sandbox/linux/services/libc_interceptor.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/linux/services/libc_interceptor.cc
+@@ -11,7 +11,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
++#if !defined(OS_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ #include <time.h>
+@@ -94,7 +96,7 @@ bool ReadTimeStruct(base::PickleIterator* iter,
+ } else {
+ base::AutoLock lock(g_timezones_lock.Get());
+ auto ret_pair = g_timezones.Get().insert(timezone);
+- output->tm_zone = ret_pair.first->c_str();
++ output->tm_zone = (char *)ret_pair.first->c_str();
+ }
+
+ return true;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_BUILD.gn
@@ -0,0 +1,49 @@
+--- src/3rdparty/chromium/sandbox/policy/BUILD.gn.orig 2022-11-08 21:18:48 UTC
++++ src/3rdparty/chromium/sandbox/policy/BUILD.gn
+@@ -5,6 +5,8 @@ import("//build/config/chromeos/ui_mode.gni")
+ import("//build/buildflag_header.gni")
+ import("//build/config/chromecast_build.gni")
+ import("//build/config/chromeos/ui_mode.gni")
++# Required for QtPDF to get a successful build
++import("//build/config/ozone.gni")
+ import("//build/config/sanitizers/sanitizers.gni")
+ import("//chromeos/assistant/assistant.gni")
+ import("//printing/buildflags/buildflags.gni")
+@@ -34,7 +36,7 @@ component("policy") {
+ "//sandbox/policy/mojom",
+ ]
+ public_deps = [ "//sandbox:common" ]
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "linux/bpf_audio_policy_linux.cc",
+ "linux/bpf_audio_policy_linux.h",
+@@ -89,6 +91,28 @@ component("policy") {
+ "//sandbox/linux:sandbox_services",
+ "//sandbox/linux:seccomp_bpf",
+ "//sandbox/linux:suid_sandbox_client",
++ ]
++ }
++ if (is_openbsd) {
++ sources += [
++ "openbsd/sandbox_openbsd.cc",
++ "openbsd/sandbox_openbsd.h",
++ ]
++ deps += [
++ "//sandbox:sandbox_buildflags",
++ "//ui/gfx/x",
++ ]
++ libs = [ "util" ]
++ }
++ # Required to avoid assertion errors during build of QtPDF
++ if (is_freebsd && ozone_platform_x11) {
++ sources += [
++ "freebsd/sandbox_freebsd.cc",
++ "freebsd/sandbox_freebsd.h",
++ ]
++ deps += [
++ "//sandbox:sandbox_buildflags",
++ "//ui/gfx/x",
+ ]
+ }
+ if (is_chromeos_ash) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_features.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/sandbox/policy/features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/features.cc
+@@ -14,7 +14,11 @@ const base::Feature kNetworkServiceSandbox{"NetworkSer
+ // Enables network service sandbox.
+ // (Only causes an effect when feature kNetworkService is enabled.)
+ const base::Feature kNetworkServiceSandbox{"NetworkServiceSandbox",
++#if BUILDFLAG(IS_BSD)
++ base::FEATURE_ENABLED_BY_DEFAULT};
++#else
+ base::FEATURE_DISABLED_BY_DEFAULT};
++#endif
+ #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_FUCHSIA)
+
+ #if BUILDFLAG(IS_WIN)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_freebsd_sandbox__freebsd.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_freebsd_sandbox__freebsd.h
@@ -0,0 +1,281 @@
+--- src/3rdparty/chromium/sandbox/policy/freebsd/sandbox_freebsd.h.orig 2022-11-07 19:58:12 UTC
++++ src/3rdparty/chromium/sandbox/policy/freebsd/sandbox_freebsd.h
+@@ -0,0 +1,278 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++#ifndef SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++#define SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/logging.h"
++#include "base/posix/global_descriptors.h"
++#include "sandbox/policy/export.h"
++#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/sanitizer_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++namespace base {
++template <typename T>
++struct DefaultSingletonTraits;
++class Thread;
++} // namespace base
++
++namespace sandbox {
++namespace syscall_broker {
++class BrokerProcess;
++} // namespace syscall_broker
++} // namespace sandbox
++
++namespace sandbox {
++namespace policy {
++
++// A singleton class to represent and change our sandboxing state for the
++// three main Linux sandboxes.
++// The sandboxing model allows using two layers of sandboxing. The first layer
++// can be implemented either with unprivileged namespaces or with the setuid
++// sandbox. This class provides a way to engage the namespace sandbox, but does
++// not deal with the legacy setuid sandbox directly.
++// The second layer is mainly based on seccomp-bpf and is engaged with
++// InitializeSandbox(). InitializeSandbox() is also responsible for "sealing"
++// the first layer of sandboxing. That is, InitializeSandbox must always be
++// called to have any meaningful sandboxing at all.
++class SANDBOX_POLICY_EXPORT SandboxLinux {
++ public:
++ // This is a list of sandbox IPC methods which the renderer may send to the
++ // sandbox host. See
++ // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md
++ // This isn't the full list, values < 32 are reserved for methods called from
++ // Skia, and values < 64 are reserved for libc_interceptor.cc.
++ enum LinuxSandboxIPCMethods {
++ DEPRECATED_METHOD_GET_FALLBACK_FONT_FOR_CHAR = 64,
++ DEPRECATED_METHOD_GET_CHILD_WITH_INODE,
++ DEPRECATED_METHOD_GET_STYLE_FOR_STRIKE,
++ METHOD_MAKE_SHARED_MEMORY_SEGMENT,
++ DEPRECATED_METHOD_MATCH_WITH_FALLBACK,
++ };
++
++ // These form a bitmask which describes the conditions of the Linux sandbox.
++ // Note: this doesn't strictly give you the current status, it states
++ // what will be enabled when the relevant processes are initialized.
++ enum Status {
++ // SUID sandbox active.
++ kSUID = 1 << 0,
++
++ // Sandbox is using a new PID namespace.
++ kPIDNS = 1 << 1,
++
++ // Sandbox is using a new network namespace.
++ kNetNS = 1 << 2,
++
++ // seccomp-bpf sandbox active.
++ kSeccompBPF = 1 << 3,
++
++ // The Yama LSM module is present and enforcing.
++ kYama = 1 << 4,
++
++ // seccomp-bpf sandbox is active and the kernel supports TSYNC.
++ kSeccompTSYNC = 1 << 5,
++
++ // User namespace sandbox active.
++ kUserNS = 1 << 6,
++
++ // A flag that denotes an invalid sandbox status.
++ kInvalid = 1 << 31,
++ };
++
++ // SandboxLinux Options are a superset of SandboxSecompBPF Options.
++ struct Options : public SandboxSeccompBPF::Options {
++ // When running with a zygote, the namespace sandbox will have already
++ // been engaged prior to initializing SandboxLinux itself, and need not
++ // be done so again. Set to true to indicate that there isn't a zygote
++ // for this process and the step is to be performed here explicitly.
++ bool engage_namespace_sandbox = false;
++
++ // Allow starting the sandbox with multiple threads already running. This
++ // will enable TSYNC for seccomp-BPF, which syncs the seccomp-BPF policy
++ // across all running threads.
++ bool allow_threads_during_sandbox_init = false;
++
++ // Enables the CHECK for open directories. The open directory check is only
++ // useful for the chroot jail (from the semantic layer of the sandbox), and
++ // can safely be disabled if we are only enabling the seccomp-BPF layer.
++ bool check_for_open_directories = true;
++ };
++
++ // Callers can provide this hook to run code right before the policy
++ // is passed to the BPF compiler and the sandbox is engaged. If
++ // pre_sandbox_hook() returns true, the sandbox will be engaged
++ // afterwards, otherwise the process is terminated.
++ using PreSandboxHook = base::OnceCallback<bool(Options)>;
++
++ // Get our singleton instance.
++ static SandboxLinux* GetInstance();
++
++ SandboxLinux(const SandboxLinux&) = delete;
++ SandboxLinux& operator=(const SandboxLinux&) = delete;
++
++ bool SetPledge(const char *pstring, const char *ppath);
++ bool SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type);
++
++ // Do some initialization that can only be done before any of the sandboxes
++ // are enabled. If using the setuid sandbox, this should be called manually
++ // before the setuid sandbox is engaged.
++ // Security: When this runs, it is imperative that either InitializeSandbox()
++ // runs as well or that all file descriptors returned in
++ // GetFileDescriptorsToClose() get closed.
++ // Otherwise file descriptors that bypass the security of the setuid sandbox
++ // would be kept open. One must be particularly careful if a process performs
++ // a fork().
++ void PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type);
++
++ // Check that the current process is the init process of a new PID
++ // namespace and then proceed to drop access to the file system by using
++ // a new unprivileged namespace. This is a layer-1 sandbox.
++ // In order for this sandbox to be effective, it must be "sealed" by calling
++ // InitializeSandbox().
++ void EngageNamespaceSandbox(bool from_zygote);
++
++ // Return a list of file descriptors to close if PreinitializeSandbox() ran
++ // but InitializeSandbox() won't. Avoid using.
++ // TODO(jln): get rid of this hack.
++ std::vector<int> GetFileDescriptorsToClose();
++
++ // Seal an eventual layer-1 sandbox and initialize the layer-2 sandbox with
++ // an adequate policy depending on the process type and command line
++ // arguments.
++ // Currently the layer-2 sandbox is composed of seccomp-bpf and address space
++ // limitations.
++ // This function should only be called without any thread running.
++ bool InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Stop |thread| in a way that can be trusted by the sandbox.
++ void StopThread(base::Thread* thread);
++
++ // Returns the status of the renderer, worker and ppapi sandbox. Can only
++ // be queried after going through PreinitializeSandbox(). This is a bitmask
++ // and uses the constants defined in "enum Status" above. Since the
++ // status needs to be provided before the sandboxes are actually started,
++ // this returns what will actually happen once InitializeSandbox()
++ // is called from inside these processes.
++ int GetStatus();
++
++ static std::string GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type);
++
++ // Returns true if the current process is single-threaded or if the number
++ // of threads cannot be determined.
++ bool IsSingleThreaded() const;
++
++ // Returns true if we started Seccomp BPF.
++ bool seccomp_bpf_started() const;
++
++ // Check the policy and eventually start the seccomp-bpf sandbox. This should
++ // never be called with threads started. If we detect that threads have
++ // started we will crash.
++ bool StartSeccompBPF(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Limit the address space of the current process (and its children) to make
++ // some vulnerabilities harder to exploit. Writes the errno due to setrlimit
++ // (including 0 if no error) into |error|.
++ bool LimitAddressSpace(int* error);
++
++ // Returns a file descriptor to proc. The file descriptor is no longer valid
++ // after the sandbox has been sealed.
++ int proc_fd() const {
++ DCHECK_NE(-1, proc_fd_);
++ return proc_fd_;
++ }
++
++#if BUILDFLAG(USING_SANITIZER)
++ __sanitizer_sandbox_arguments* sanitizer_args() const {
++ return sanitizer_args_.get();
++ };
++#endif
++
++ // A BrokerProcess is a helper that is started before the sandbox is engaged,
++ // typically from a pre-sandbox hook, that will serve requests to access
++ // files over an IPC channel. The client of this runs from a SIGSYS handler
++ // triggered by the seccomp-bpf sandbox.
++ // |client_sandbox_policy| is the policy being run by the client, and is
++ // used to derive the equivalent broker-side policy.
++ // |broker_side_hook| is an alternate pre-sandbox hook to be run before the
++ // broker itself gets sandboxed, to which the broker side policy and
++ // |options| are passed.
++ // Crashes the process if the broker can not be started since continuation
++ // is impossible (and presumably unsafe).
++ // This should never be destroyed, as after the sandbox is started it is
++ // vital to the process.
++#if 0
++ void StartBrokerProcess(
++ const sandbox::syscall_broker::BrokerCommandSet& allowed_command_set,
++ std::vector<sandbox::syscall_broker::BrokerFilePermission> permissions,
++ PreSandboxHook broker_side_hook,
++ const Options& options);
++
++ sandbox::syscall_broker::BrokerProcess* broker_process() const {
++ return broker_process_;
++ }
++#endif
++
++ private:
++ friend struct base::DefaultSingletonTraits<SandboxLinux>;
++
++ SandboxLinux();
++ ~SandboxLinux();
++
++ // We must have been pre_initialized_ before using these.
++ bool seccomp_bpf_supported() const;
++ bool seccomp_bpf_with_tsync_supported() const;
++
++ // Returns true if it can be determined that the current process has open
++ // directories that are not managed by the SandboxLinux class. This would
++ // be a vulnerability as it would allow to bypass the setuid sandbox.
++ bool HasOpenDirectories() const;
++
++ // The last part of the initialization is to make sure any temporary "hole"
++ // in the sandbox is closed. For now, this consists of closing proc_fd_.
++ void SealSandbox();
++
++ // GetStatus() makes promises as to how the sandbox will behave. This
++ // checks that no promises have been broken.
++ void CheckForBrokenPromises(sandbox::mojom::Sandbox sandbox_type);
++
++ // Stop |thread| and make sure it does not appear in /proc/self/tasks/
++ // anymore.
++ void StopThreadAndEnsureNotCounted(base::Thread* thread) const;
++
++ // A file descriptor to /proc. It's dangerous to have it around as it could
++ // allow for sandbox bypasses. It needs to be closed before we consider
++ // ourselves sandboxed.
++ int proc_fd_;
++
++ bool seccomp_bpf_started_;
++ // The value returned by GetStatus(). Gets computed once and then cached.
++ int sandbox_status_flags_;
++ // Did PreinitializeSandbox() run?
++ bool pre_initialized_;
++ bool seccomp_bpf_supported_; // Accurate if pre_initialized_.
++ bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_.
++ bool yama_is_enforcing_; // Accurate if pre_initialized_.
++ bool initialize_sandbox_ran_; // InitializeSandbox() was called.
++#if BUILDFLAG(USING_SANITIZER)
++ std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_;
++#endif
++ sandbox::syscall_broker::BrokerProcess* broker_process_; // Leaked as global.
++};
++
++} // namespace policy
++} // namespace sandbox
++
++#endif // SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_freebsd_sandbox__freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_freebsd_sandbox__freebsd.cc
@@ -0,0 +1,256 @@
+--- src/3rdparty/chromium/sandbox/policy/freebsd/sandbox_freebsd.cc.orig 2022-11-17 06:20:46 UTC
++++ src/3rdparty/chromium/sandbox/policy/freebsd/sandbox_freebsd.cc
+@@ -0,0 +1,253 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++
++#include <dirent.h>
++#include <fcntl.h>
++#include <stdint.h>
++#include <sys/resource.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <unistd.h>
++
++#include <limits>
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/bind.h"
++#include "base/callback_helpers.h"
++#include "base/command_line.h"
++#include "base/debug/stack_trace.h"
++#include "base/feature_list.h"
++#include "base/files/file_path.h"
++#include "base/files/file_util.h"
++#include "base/files/scoped_file.h"
++#include "base/logging.h"
++#include "base/memory/singleton.h"
++#include "base/path_service.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/system/sys_info.h"
++#include "base/threading/thread.h"
++#include "base/time/time.h"
++#include "build/build_config.h"
++#include "sandbox/constants.h"
++#include "sandbox/linux/services/credentials.h"
++#include "sandbox/linux/services/namespace_sandbox.h"
++#include "sandbox/linux/services/proc_util.h"
++#include "sandbox/linux/services/resource_limits.h"
++#include "sandbox/linux/services/thread_helpers.h"
++#include "sandbox/linux/syscall_broker/broker_command.h"
++#include "sandbox/linux/syscall_broker/broker_process.h"
++#include "sandbox/policy/sandbox.h"
++#include "sandbox/policy/sandbox_type.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/switches.h"
++#include "sandbox/sandbox_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++#if defined(USE_NSS_CERTS)
++#include "crypto/nss_util.h"
++#endif
++
++#include "ui/gfx/x/connection.h"
++#include "ui/gfx/font_util.h"
++
++#include <X11/Xlib.h>
++
++#define MAXTOKENS 3
++
++#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
++#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer";
++#define _UNVEIL_GPU "/etc/chromium/unveil.gpu";
++#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin";
++#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility";
++#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network";
++#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio";
++#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video";
++
++namespace sandbox {
++namespace policy {
++
++SandboxLinux::SandboxLinux()
++ : sandbox_status_flags_(kInvalid),
++ pre_initialized_(false),
++ initialize_sandbox_ran_(false),
++ broker_process_(nullptr) {
++}
++
++SandboxLinux::~SandboxLinux() {
++ if (pre_initialized_) {
++ CHECK(initialize_sandbox_ran_);
++ }
++}
++
++SandboxLinux* SandboxLinux::GetInstance() {
++ SandboxLinux* instance = base::Singleton<SandboxLinux>::get();
++ CHECK(instance);
++ return instance;
++}
++
++void SandboxLinux::StopThread(base::Thread* thread) {
++ DCHECK(thread);
++ thread->Stop();
++}
++
++void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) {
++ CHECK(!pre_initialized_);
++#if BUILDFLAG(USING_SANITIZER)
++ // Sanitizers need to open some resources before the sandbox is enabled.
++ // This should not fork, not launch threads, not open a directory.
++ __sanitizer_sandbox_on_notify(sanitizer_args());
++ sanitizer_args_.reset();
++#endif
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ base::SysInfo::AmountOfPhysicalMemory();
++ base::SysInfo::NumberOfProcessors();
++
++#if defined(USE_NSS_CERTS)
++ // The main process has to initialize the ~/.pki dir which won't work
++ // after unveil(2).
++ if (process_type.empty())
++ crypto::EnsureNSSInit();
++#endif
++
++ // cache the XErrorDB by forcing a read on it
++ {
++ auto* connection = x11::Connection::Get();
++ auto* display = connection->GetXlibDisplay().display();
++
++ char buf[1];
++ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
++ }
++
++ if (process_type.empty()) {
++ base::FilePath cache_directory, local_directory;
++
++ base::PathService::Get(base::DIR_CACHE, &cache_directory);
++ base::PathService::Get(base::DIR_HOME, &local_directory);
++
++ cache_directory = cache_directory.AppendASCII("chromium");
++ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
++
++ if (!base::CreateDirectory(cache_directory)) {
++ LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory.";
++ }
++
++ if (!base::CreateDirectory(local_directory)) {
++ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory.";
++ }
++ }
++
++ if (process_type == switches::kRendererProcess)
++ gfx::InitializeFonts();
++
++ pre_initialized_ = true;
++}
++
++bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ SandboxLinux::PreSandboxHook hook,
++ const Options& options) {
++ DCHECK(!initialize_sandbox_ran_);
++ initialize_sandbox_ran_ = true;
++
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ if (command_line->HasSwitch(switches::kNoSandbox))
++ return true;
++
++ VLOG(1) << "SandboxLinux::InitializeSandbox: process_type="
++ << process_type << " sandbox_type=" << GetSandboxTypeInEnglish(sandbox_type);
++
++ // Only one thread is running, pre-initialize if not already done.
++ if (!pre_initialized_)
++ PreinitializeSandbox(sandbox_type);
++
++ // Attempt to limit the future size of the address space of the process.
++ int error = 0;
++ const bool limited_as = LimitAddressSpace(&error);
++ if (error) {
++ // Restore errno. Internally to |LimitAddressSpace|, the errno due to
++ // setrlimit may be lost.
++ errno = error;
++ PCHECK(limited_as);
++ }
++
++ return true;
++}
++
++bool SandboxLinux::LimitAddressSpace(int* error) {
++#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
++ !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) {
++ return false;
++ }
++
++ // Unfortunately, it does not appear possible to set RLIMIT_AS such that it
++ // will both (a) be high enough to support V8's and WebAssembly's address
++ // space requirements while also (b) being low enough to mitigate exploits
++ // using integer overflows that require large allocations, heap spray, or
++ // other memory-hungry attack modes.
++
++ *error = sandbox::ResourceLimits::Lower(
++ RLIMIT_DATA, static_cast<rlim_t>(sandbox::kDataSizeLimit));
++
++ // Cache the resource limit before turning on the sandbox.
++ base::SysInfo::AmountOfVirtualMemory();
++ base::SysInfo::MaxSharedMemorySize();
++
++ return *error == 0;
++#else
++ base::SysInfo::AmountOfVirtualMemory();
++ return false;
++#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) &&
++ // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++}
++
++// static
++std::string SandboxLinux::GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type) {
++ switch (sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ return "Unsandboxed";
++ case sandbox::mojom::Sandbox::kRenderer:
++ return "Renderer";
++ case sandbox::mojom::Sandbox::kUtility:
++ return "Utility";
++ case sandbox::mojom::Sandbox::kGpu:
++ return "GPU";
++ case sandbox::mojom::Sandbox::kPpapi:
++ return "PPAPI";
++ case sandbox::mojom::Sandbox::kNetwork:
++ return "Network";
++ case sandbox::mojom::Sandbox::kCdm:
++ return "CDM";
++ case sandbox::mojom::Sandbox::kPrintCompositor:
++ return "Print Compositor";
++ case sandbox::mojom::Sandbox::kAudio:
++ return "Audio";
++ case sandbox::mojom::Sandbox::kSpeechRecognition:
++ return "Speech Recognition";
++ case sandbox::mojom::Sandbox::kService:
++ return "Service";
++ case sandbox::mojom::Sandbox::kVideoCapture:
++ return "Video Capture";
++ default:
++ return "Unknown";
++ }
++}
++
++} // namespace policy
++} // namespace sandbox
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_mojom_sandbox.mojom
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_mojom_sandbox.mojom
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/sandbox/policy/mojom/sandbox.mojom.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/mojom/sandbox.mojom
+@@ -72,6 +72,12 @@ enum Sandbox {
+ [EnableIf=is_fuchsia]
+ kVideoCapture,
+
++ [EnableIf=is_openbsd]
++ kVideoCapture,
++
++ [EnableIf=is_freebsd]
++ kVideoCapture,
++
+ // Allows access to file contents and Windows APIs for parsing icons from PE
+ // files.
+ [EnableIf=is_win]
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_openbsd_sandbox__openbsd.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_openbsd_sandbox__openbsd.h
@@ -0,0 +1,285 @@
+--- src/3rdparty/chromium/sandbox/policy/openbsd/sandbox_openbsd.h.orig 2022-11-07 19:53:29 UTC
++++ src/3rdparty/chromium/sandbox/policy/openbsd/sandbox_openbsd.h
+@@ -0,0 +1,282 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++#ifndef SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++#define SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/logging.h"
++#include "base/posix/global_descriptors.h"
++#include "sandbox/policy/export.h"
++#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/sanitizer_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++namespace base {
++template <typename T>
++struct DefaultSingletonTraits;
++class Thread;
++} // namespace base
++
++namespace sandbox {
++namespace syscall_broker {
++class BrokerProcess;
++} // namespace syscall_broker
++} // namespace sandbox
++
++namespace sandbox {
++namespace policy {
++
++// A singleton class to represent and change our sandboxing state for the
++// three main Linux sandboxes.
++// The sandboxing model allows using two layers of sandboxing. The first layer
++// can be implemented either with unprivileged namespaces or with the setuid
++// sandbox. This class provides a way to engage the namespace sandbox, but does
++// not deal with the legacy setuid sandbox directly.
++// The second layer is mainly based on seccomp-bpf and is engaged with
++// InitializeSandbox(). InitializeSandbox() is also responsible for "sealing"
++// the first layer of sandboxing. That is, InitializeSandbox must always be
++// called to have any meaningful sandboxing at all.
++class SANDBOX_POLICY_EXPORT SandboxLinux {
++ public:
++ // This is a list of sandbox IPC methods which the renderer may send to the
++ // sandbox host. See
++ // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md
++ // This isn't the full list, values < 32 are reserved for methods called from
++ // Skia, and values < 64 are reserved for libc_interceptor.cc.
++ enum LinuxSandboxIPCMethods {
++ DEPRECATED_METHOD_GET_FALLBACK_FONT_FOR_CHAR = 64,
++ DEPRECATED_METHOD_GET_CHILD_WITH_INODE,
++ DEPRECATED_METHOD_GET_STYLE_FOR_STRIKE,
++ METHOD_MAKE_SHARED_MEMORY_SEGMENT,
++ DEPRECATED_METHOD_MATCH_WITH_FALLBACK,
++ };
++
++ // These form a bitmask which describes the conditions of the Linux sandbox.
++ // Note: this doesn't strictly give you the current status, it states
++ // what will be enabled when the relevant processes are initialized.
++ enum Status {
++ // SUID sandbox active.
++ kSUID = 1 << 0,
++
++ // Sandbox is using a new PID namespace.
++ kPIDNS = 1 << 1,
++
++ // Sandbox is using a new network namespace.
++ kNetNS = 1 << 2,
++
++ // seccomp-bpf sandbox active.
++ kSeccompBPF = 1 << 3,
++
++ // The Yama LSM module is present and enforcing.
++ kYama = 1 << 4,
++
++ // seccomp-bpf sandbox is active and the kernel supports TSYNC.
++ kSeccompTSYNC = 1 << 5,
++
++ // User namespace sandbox active.
++ kUserNS = 1 << 6,
++
++ // A flag that denotes an invalid sandbox status.
++ kInvalid = 1 << 31,
++ };
++
++ // SandboxLinux Options are a superset of SandboxSecompBPF Options.
++ struct Options : public SandboxSeccompBPF::Options {
++ // When running with a zygote, the namespace sandbox will have already
++ // been engaged prior to initializing SandboxLinux itself, and need not
++ // be done so again. Set to true to indicate that there isn't a zygote
++ // for this process and the step is to be performed here explicitly.
++ bool engage_namespace_sandbox = false;
++
++ // Allow starting the sandbox with multiple threads already running. This
++ // will enable TSYNC for seccomp-BPF, which syncs the seccomp-BPF policy
++ // across all running threads.
++ bool allow_threads_during_sandbox_init = false;
++
++ // Enables the CHECK for open directories. The open directory check is only
++ // useful for the chroot jail (from the semantic layer of the sandbox), and
++ // can safely be disabled if we are only enabling the seccomp-BPF layer.
++ bool check_for_open_directories = true;
++ };
++
++ // Callers can provide this hook to run code right before the policy
++ // is passed to the BPF compiler and the sandbox is engaged. If
++ // pre_sandbox_hook() returns true, the sandbox will be engaged
++ // afterwards, otherwise the process is terminated.
++ using PreSandboxHook = base::OnceCallback<bool(Options)>;
++
++ // Get our singleton instance.
++ static SandboxLinux* GetInstance();
++
++ SandboxLinux(const SandboxLinux&) = delete;
++ SandboxLinux& operator=(const SandboxLinux&) = delete;
++
++ bool SetPledge(const char *pstring, const char *ppath);
++ bool SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type);
++
++ // Do some initialization that can only be done before any of the sandboxes
++ // are enabled. If using the setuid sandbox, this should be called manually
++ // before the setuid sandbox is engaged.
++ // Security: When this runs, it is imperative that either InitializeSandbox()
++ // runs as well or that all file descriptors returned in
++ // GetFileDescriptorsToClose() get closed.
++ // Otherwise file descriptors that bypass the security of the setuid sandbox
++ // would be kept open. One must be particularly careful if a process performs
++ // a fork().
++ void PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type);
++
++ // Check that the current process is the init process of a new PID
++ // namespace and then proceed to drop access to the file system by using
++ // a new unprivileged namespace. This is a layer-1 sandbox.
++ // In order for this sandbox to be effective, it must be "sealed" by calling
++ // InitializeSandbox().
++ void EngageNamespaceSandbox(bool from_zygote);
++
++ // Return a list of file descriptors to close if PreinitializeSandbox() ran
++ // but InitializeSandbox() won't. Avoid using.
++ // TODO(jln): get rid of this hack.
++ std::vector<int> GetFileDescriptorsToClose();
++
++ // Seal an eventual layer-1 sandbox and initialize the layer-2 sandbox with
++ // an adequate policy depending on the process type and command line
++ // arguments.
++ // Currently the layer-2 sandbox is composed of seccomp-bpf and address space
++ // limitations.
++ // This function should only be called without any thread running.
++ bool InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Stop |thread| in a way that can be trusted by the sandbox.
++ void StopThread(base::Thread* thread);
++
++ // Returns the status of the renderer, worker and ppapi sandbox. Can only
++ // be queried after going through PreinitializeSandbox(). This is a bitmask
++ // and uses the constants defined in "enum Status" above. Since the
++ // status needs to be provided before the sandboxes are actually started,
++ // this returns what will actually happen once InitializeSandbox()
++ // is called from inside these processes.
++ int GetStatus();
++
++ static std::string GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type);
++
++ // Returns true if the current process is single-threaded or if the number
++ // of threads cannot be determined.
++ bool IsSingleThreaded() const;
++
++ // Returns true if we started Seccomp BPF.
++ bool seccomp_bpf_started() const;
++
++ // Returns true if unveil(2) is used.
++ bool unveil_initialized() const;
++
++ // Check the policy and eventually start the seccomp-bpf sandbox. This should
++ // never be called with threads started. If we detect that threads have
++ // started we will crash.
++ bool StartSeccompBPF(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Limit the address space of the current process (and its children) to make
++ // some vulnerabilities harder to exploit. Writes the errno due to setrlimit
++ // (including 0 if no error) into |error|.
++ bool LimitAddressSpace(int* error);
++
++ // Returns a file descriptor to proc. The file descriptor is no longer valid
++ // after the sandbox has been sealed.
++ int proc_fd() const {
++ DCHECK_NE(-1, proc_fd_);
++ return proc_fd_;
++ }
++
++#if BUILDFLAG(USING_SANITIZER)
++ __sanitizer_sandbox_arguments* sanitizer_args() const {
++ return sanitizer_args_.get();
++ };
++#endif
++
++ // A BrokerProcess is a helper that is started before the sandbox is engaged,
++ // typically from a pre-sandbox hook, that will serve requests to access
++ // files over an IPC channel. The client of this runs from a SIGSYS handler
++ // triggered by the seccomp-bpf sandbox.
++ // |client_sandbox_policy| is the policy being run by the client, and is
++ // used to derive the equivalent broker-side policy.
++ // |broker_side_hook| is an alternate pre-sandbox hook to be run before the
++ // broker itself gets sandboxed, to which the broker side policy and
++ // |options| are passed.
++ // Crashes the process if the broker can not be started since continuation
++ // is impossible (and presumably unsafe).
++ // This should never be destroyed, as after the sandbox is started it is
++ // vital to the process.
++#if 0
++ void StartBrokerProcess(
++ const sandbox::syscall_broker::BrokerCommandSet& allowed_command_set,
++ std::vector<sandbox::syscall_broker::BrokerFilePermission> permissions,
++ PreSandboxHook broker_side_hook,
++ const Options& options);
++
++ sandbox::syscall_broker::BrokerProcess* broker_process() const {
++ return broker_process_;
++ }
++#endif
++
++ private:
++ friend struct base::DefaultSingletonTraits<SandboxLinux>;
++
++ SandboxLinux();
++ ~SandboxLinux();
++
++ // We must have been pre_initialized_ before using these.
++ bool seccomp_bpf_supported() const;
++ bool seccomp_bpf_with_tsync_supported() const;
++
++ // Returns true if it can be determined that the current process has open
++ // directories that are not managed by the SandboxLinux class. This would
++ // be a vulnerability as it would allow to bypass the setuid sandbox.
++ bool HasOpenDirectories() const;
++
++ // The last part of the initialization is to make sure any temporary "hole"
++ // in the sandbox is closed. For now, this consists of closing proc_fd_.
++ void SealSandbox();
++
++ // GetStatus() makes promises as to how the sandbox will behave. This
++ // checks that no promises have been broken.
++ void CheckForBrokenPromises(sandbox::mojom::Sandbox sandbox_type);
++
++ // Stop |thread| and make sure it does not appear in /proc/self/tasks/
++ // anymore.
++ void StopThreadAndEnsureNotCounted(base::Thread* thread) const;
++
++ // A file descriptor to /proc. It's dangerous to have it around as it could
++ // allow for sandbox bypasses. It needs to be closed before we consider
++ // ourselves sandboxed.
++ int proc_fd_;
++
++ bool seccomp_bpf_started_;
++ bool unveil_initialized_;
++ // The value returned by GetStatus(). Gets computed once and then cached.
++ int sandbox_status_flags_;
++ // Did PreinitializeSandbox() run?
++ bool pre_initialized_;
++ bool seccomp_bpf_supported_; // Accurate if pre_initialized_.
++ bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_.
++ bool yama_is_enforcing_; // Accurate if pre_initialized_.
++ bool initialize_sandbox_ran_; // InitializeSandbox() was called.
++#if BUILDFLAG(USING_SANITIZER)
++ std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_;
++#endif
++ sandbox::syscall_broker::BrokerProcess* broker_process_; // Leaked as global.
++};
++
++} // namespace policy
++} // namespace sandbox
++
++#endif // SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_openbsd_sandbox__openbsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_openbsd_sandbox__openbsd.cc
@@ -0,0 +1,416 @@
+--- src/3rdparty/chromium/sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2022-11-17 06:21:59 UTC
++++ src/3rdparty/chromium/sandbox/policy/openbsd/sandbox_openbsd.cc
+@@ -0,0 +1,413 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++
++#include <dirent.h>
++#include <fcntl.h>
++#include <stdint.h>
++#include <sys/resource.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <unistd.h>
++#include <util.h>
++
++#include <limits>
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/bind.h"
++#include "base/callback_helpers.h"
++#include "base/command_line.h"
++#include "base/debug/stack_trace.h"
++#include "base/feature_list.h"
++#include "base/files/file_path.h"
++#include "base/files/file_util.h"
++#include "base/files/scoped_file.h"
++#include "base/logging.h"
++#include "base/memory/singleton.h"
++#include "base/path_service.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/system/sys_info.h"
++#include "base/threading/thread.h"
++#include "base/time/time.h"
++#include "build/build_config.h"
++#include "sandbox/constants.h"
++#include "sandbox/linux/services/credentials.h"
++#include "sandbox/linux/services/namespace_sandbox.h"
++#include "sandbox/linux/services/proc_util.h"
++#include "sandbox/linux/services/resource_limits.h"
++#include "sandbox/linux/services/thread_helpers.h"
++#include "sandbox/linux/syscall_broker/broker_command.h"
++#include "sandbox/linux/syscall_broker/broker_process.h"
++#include "sandbox/policy/sandbox.h"
++#include "sandbox/policy/sandbox_type.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/switches.h"
++#include "sandbox/sandbox_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++#if defined(USE_NSS_CERTS)
++#include "crypto/nss_util.h"
++#endif
++
++#include "third_party/boringssl/src/include/openssl/crypto.h"
++
++#include "ui/gfx/x/connection.h"
++#include "ui/gfx/font_util.h"
++
++#include <X11/Xlib.h>
++
++#define MAXTOKENS 3
++
++#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
++#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer";
++#define _UNVEIL_GPU "/etc/chromium/unveil.gpu";
++#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin";
++#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility";
++#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network";
++#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio";
++#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video";
++
++namespace sandbox {
++namespace policy {
++
++SandboxLinux::SandboxLinux()
++ : unveil_initialized_(false),
++ sandbox_status_flags_(kInvalid),
++ pre_initialized_(false),
++ initialize_sandbox_ran_(false),
++ broker_process_(nullptr) {
++}
++
++SandboxLinux::~SandboxLinux() {
++ if (pre_initialized_) {
++ CHECK(initialize_sandbox_ran_);
++ }
++}
++
++SandboxLinux* SandboxLinux::GetInstance() {
++ SandboxLinux* instance = base::Singleton<SandboxLinux>::get();
++ CHECK(instance);
++ return instance;
++}
++
++void SandboxLinux::StopThread(base::Thread* thread) {
++ DCHECK(thread);
++ thread->Stop();
++}
++
++void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) {
++ CHECK(!pre_initialized_);
++#if BUILDFLAG(USING_SANITIZER)
++ // Sanitizers need to open some resources before the sandbox is enabled.
++ // This should not fork, not launch threads, not open a directory.
++ __sanitizer_sandbox_on_notify(sanitizer_args());
++ sanitizer_args_.reset();
++#endif
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ base::SysInfo::AmountOfPhysicalMemory();
++ base::SysInfo::NumberOfProcessors();
++ base::SysInfo::CPUModelName();
++
++#if defined(USE_NSS_CERTS)
++ // The main process has to initialize the ~/.pki dir which won't work
++ // after unveil(2).
++ if (process_type.empty())
++ crypto::EnsureNSSInit();
++#endif
++
++ if (process_type.empty())
++ CRYPTO_pre_sandbox_init();
++
++ // cache the XErrorDB by forcing a read on it
++ {
++ auto* connection = x11::Connection::Get();
++ auto* display = connection->GetXlibDisplay().display();
++
++ char buf[1];
++ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
++ }
++
++ if (process_type.empty()) {
++ base::FilePath cache_directory, local_directory;
++
++ base::PathService::Get(base::DIR_CACHE, &cache_directory);
++ base::PathService::Get(base::DIR_HOME, &local_directory);
++
++ cache_directory = cache_directory.AppendASCII("chromium");
++ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
++
++ if (!base::CreateDirectory(cache_directory)) {
++ LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory.";
++ }
++
++ if (!base::CreateDirectory(local_directory)) {
++ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory.";
++ }
++ }
++
++ if (process_type == switches::kRendererProcess)
++ gfx::InitializeFonts();
++
++ if (!command_line->HasSwitch(switches::kDisableUnveil))
++ SetUnveil(process_type, sandbox_type);
++
++ pre_initialized_ = true;
++}
++
++bool SandboxLinux::SetPledge(const char *pstring, const char *ppath) {
++ FILE *fp;
++ char *s = NULL;
++ size_t len = 0;
++ ssize_t read;
++
++ if (pstring != NULL) {
++ if (pledge(pstring, NULL) == -1)
++ goto err;
++ } else if (ppath != NULL) {
++ fp = fopen(ppath, "r");
++ if (fp != NULL) {
++ while ((read = getline(&s, &len, fp)) != -1 ) {
++ if (s[strlen(s)-1] == '\n')
++ s[strlen(s)-1] = '\0';
++ if (pledge(s, NULL) == -1)
++ goto err;
++ }
++ fclose(fp);
++ } else {
++ LOG(ERROR) << "fopen() failed, errno: " << errno;
++ return false;
++ }
++ }
++ return true;
++err:
++ LOG(ERROR) << "pledge() failed, errno: " << errno;
++ return false;
++}
++
++bool SandboxLinux::SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type) {
++ FILE *fp;
++ char *s = NULL, *cp = NULL, *home = NULL, **ap, *tokens[MAXTOKENS];
++ char path[PATH_MAX];
++ const char *ufile;
++ size_t len = 0, lineno = 0;
++
++ if (process_type.empty()) {
++ ufile = _UNVEIL_MAIN;
++ } else if (process_type == switches::kRendererProcess) {
++ ufile = _UNVEIL_RENDERER;
++ } else if (process_type == switches::kGpuProcess) {
++ ufile = _UNVEIL_GPU;
++ } else if (process_type == switches::kPpapiPluginProcess) {
++ ufile = _UNVEIL_PLUGIN;
++ } else if (process_type == switches::kUtilityProcess) {
++ if (sandbox_type == sandbox::mojom::Sandbox::kNetwork) {
++ ufile = _UNVEIL_UTILITY_NETWORK;
++ } else if (sandbox_type == sandbox::mojom::Sandbox::kAudio) {
++ ufile = _UNVEIL_UTILITY_AUDIO;
++ } else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture) {
++ ufile = _UNVEIL_UTILITY_VIDEO;
++ } else {
++ ufile = _UNVEIL_UTILITY;
++ }
++ }
++
++ fp = fopen(ufile, "r");
++ if (fp != NULL) {
++ while (!feof(fp)) {
++ if ((s = fparseln(fp, &len, &lineno, NULL,
++ FPARSELN_UNESCCOMM | FPARSELN_UNESCCONT)) == NULL) {
++ if (ferror(fp)) {
++ LOG(ERROR) << "ferror(), errno: " << errno;
++ _exit(1);
++ } else {
++ continue;
++ }
++ }
++ cp = s;
++ cp += strspn(cp, " \t\n"); /* eat whitespace */
++ if (cp[0] == '\0')
++ continue;
++
++ for (ap = tokens; ap < &tokens[MAXTOKENS - 1] &&
++ (*ap = strsep(&cp, " \t")) != NULL;) {
++ if (**ap != '\0')
++ ap++;
++ }
++ *ap = NULL;
++
++ if (tokens[1] == NULL) {
++ LOG(ERROR) << ufile << ": line " << lineno << ": must supply value to " << s;
++ _exit(1);
++ }
++
++ if (tokens[0][0] == '~') {
++ if ((home = getenv("HOME")) == NULL || *home == '\0') {
++ LOG(ERROR) << "failed to get home";
++ _exit(1);
++ }
++ memmove(tokens[0], tokens[0] + 1, strlen(tokens[0]));
++ strncpy(path, home, sizeof(path) - 1);
++ path[sizeof(path) - 1] = '\0';
++ strncat(path, tokens[0], sizeof(path) - 1 - strlen(path));
++ } else {
++ strncpy(path, tokens[0], sizeof(path) - 1);
++ path[sizeof(path) - 1] = '\0';
++ }
++
++ if (unveil(path, tokens[1]) == -1) {
++ LOG(ERROR) << "failed unveiling " << path << " with permissions " << tokens[1];
++ _exit(1);
++ } else {
++ VLOG(1) << "unveiling " << path << " with permissions " << tokens[1];
++ }
++ }
++ fclose(fp);
++ } else {
++ LOG(ERROR) << "failed to open " << ufile << " errno: " << errno;
++ _exit(1);
++ }
++
++ unveil_initialized_ = true;
++
++ return true;
++}
++
++bool SandboxLinux::unveil_initialized() const {
++ return unveil_initialized_;
++}
++
++bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ SandboxLinux::PreSandboxHook hook,
++ const Options& options) {
++ DCHECK(!initialize_sandbox_ran_);
++ initialize_sandbox_ran_ = true;
++
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ if (command_line->HasSwitch(switches::kNoSandbox))
++ return true;
++
++ VLOG(1) << "SandboxLinux::InitializeSandbox: process_type="
++ << process_type << " sandbox_type=" << GetSandboxTypeInEnglish(sandbox_type);
++
++ // Only one thread is running, pre-initialize if not already done.
++ if (!pre_initialized_)
++ PreinitializeSandbox(sandbox_type);
++
++ // Attempt to limit the future size of the address space of the process.
++ int error = 0;
++ const bool limited_as = LimitAddressSpace(&error);
++ if (error) {
++ // Restore errno. Internally to |LimitAddressSpace|, the errno due to
++ // setrlimit may be lost.
++ errno = error;
++ PCHECK(limited_as);
++ }
++
++ if (process_type.empty()) {
++ // XXX use a file for listing pledges of the main process for now
++ // XXX not having the file is not a fatal error
++ SetPledge(NULL, "/etc/chromium/pledge.main");
++ } else if (process_type == switches::kRendererProcess) {
++ // prot_exec needed by v8
++ // flock needed by sqlite3 locking
++ SetPledge("stdio rpath flock prot_exec recvfd sendfd ps", NULL);
++ } else if (process_type == switches::kGpuProcess) {
++ SetPledge("stdio rpath cpath wpath getpw drm prot_exec recvfd sendfd tmppath", NULL);
++ } else if (process_type == switches::kPpapiPluginProcess) {
++ // prot_exec needed by v8
++ SetPledge("stdio rpath prot_exec recvfd sendfd", NULL);
++ } else if (process_type == switches::kUtilityProcess) {
++ if (sandbox_type == sandbox::mojom::Sandbox::kAudio)
++ SetPledge(NULL, "/etc/chromium/pledge.utility_audio");
++ else if (sandbox_type == sandbox::mojom::Sandbox::kNetwork)
++ SetPledge(NULL, "/etc/chromium/pledge.utility_network");
++ else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture)
++ SetPledge(NULL, "/etc/chromium/pledge.utility_video");
++ else
++ SetPledge("stdio rpath cpath wpath fattr flock sendfd recvfd prot_exec", NULL);
++ } else {
++ LOG(ERROR) << "non-pledge()'d process: " << process_type;
++ return false;
++ }
++
++ return true;
++}
++
++bool SandboxLinux::LimitAddressSpace(int* error) {
++#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
++ !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) {
++ return false;
++ }
++
++ // Unfortunately, it does not appear possible to set RLIMIT_AS such that it
++ // will both (a) be high enough to support V8's and WebAssembly's address
++ // space requirements while also (b) being low enough to mitigate exploits
++ // using integer overflows that require large allocations, heap spray, or
++ // other memory-hungry attack modes.
++
++ *error = sandbox::ResourceLimits::Lower(
++ RLIMIT_DATA, static_cast<rlim_t>(sandbox::kDataSizeLimit));
++
++ // Cache the resource limit before turning on the sandbox.
++ base::SysInfo::AmountOfVirtualMemory();
++ base::SysInfo::MaxSharedMemorySize();
++
++ return *error == 0;
++#else
++ base::SysInfo::AmountOfVirtualMemory();
++ return false;
++#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) &&
++ // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++}
++
++// static
++std::string SandboxLinux::GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type) {
++ switch (sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ return "Unsandboxed";
++ case sandbox::mojom::Sandbox::kRenderer:
++ return "Renderer";
++ case sandbox::mojom::Sandbox::kUtility:
++ return "Utility";
++ case sandbox::mojom::Sandbox::kGpu:
++ return "GPU";
++ case sandbox::mojom::Sandbox::kPpapi:
++ return "PPAPI";
++ case sandbox::mojom::Sandbox::kNetwork:
++ return "Network";
++ case sandbox::mojom::Sandbox::kCdm:
++ return "CDM";
++ case sandbox::mojom::Sandbox::kPrintCompositor:
++ return "Print Compositor";
++ case sandbox::mojom::Sandbox::kAudio:
++ return "Audio";
++ case sandbox::mojom::Sandbox::kSpeechRecognition:
++ return "Speech Recognition";
++ case sandbox::mojom::Sandbox::kService:
++ return "Service";
++ case sandbox::mojom::Sandbox::kVideoCapture:
++ return "Video Capture";
++ default:
++ return "Unknown";
++ }
++}
++
++} // namespace policy
++} // namespace sandbox
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_sandbox.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_sandbox.h
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/sandbox/policy/sandbox.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/sandbox.h
+@@ -12,6 +12,10 @@
+ #include "sandbox/policy/linux/sandbox_linux.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#endif
++
+ namespace sandbox {
+ namespace mojom {
+ enum class Sandbox;
+@@ -32,7 +36,7 @@ class SANDBOX_POLICY_EXPORT Sandbox {
+
+ class SANDBOX_POLICY_EXPORT Sandbox {
+ public:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static bool Initialize(sandbox::mojom::Sandbox sandbox_type,
+ SandboxLinux::PreSandboxHook hook,
+ const SandboxLinux::Options& options);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_sandbox.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_sandbox.cc
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/sandbox/policy/sandbox.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/sandbox.cc
+@@ -17,6 +17,10 @@
+ #include "sandbox/policy/linux/sandbox_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#endif // BUILDFLAG(IS_BSD)
++
+ #if BUILDFLAG(IS_MAC)
+ #include "sandbox/mac/seatbelt.h"
+ #endif // BUILDFLAG(IS_MAC)
+@@ -30,7 +34,7 @@ namespace policy {
+ namespace sandbox {
+ namespace policy {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool Sandbox::Initialize(sandbox::mojom::Sandbox sandbox_type,
+ SandboxLinux::PreSandboxHook hook,
+ const SandboxLinux::Options& options) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_sandbox__type.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_sandbox__type.cc
@@ -0,0 +1,105 @@
+--- src/3rdparty/chromium/sandbox/policy/sandbox_type.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/sandbox_type.cc
+@@ -39,7 +39,7 @@ bool IsUnsandboxedSandboxType(Sandbox sandbox_type) {
+ #endif
+ case Sandbox::kAudio:
+ return false;
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoCapture:
+ return false;
+ #endif
+@@ -62,7 +62,7 @@ bool IsUnsandboxedSandboxType(Sandbox sandbox_type) {
+ case Sandbox::kMirroring:
+ case Sandbox::kNaClLoader:
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoDecoding:
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -72,8 +72,10 @@ bool IsUnsandboxedSandboxType(Sandbox sandbox_type) {
+ case Sandbox::kLibassistant:
+ #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT)
+ #endif // // BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
++#if !BUILDFLAG(IS_BSD)
+ case Sandbox::kZygoteIntermediateSandbox:
++#endif
+ case Sandbox::kScreenAI:
+ #endif
+ case Sandbox::kSpeechRecognition:
+@@ -125,7 +127,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLi
+ #endif
+ case Sandbox::kPrintCompositor:
+ case Sandbox::kAudio:
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoCapture:
+ #endif
+ #if BUILDFLAG(IS_WIN)
+@@ -136,7 +138,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLi
+ case Sandbox::kMediaFoundationCdm:
+ case Sandbox::kWindowsSystemProxyResolver:
+ #endif // BUILDFLAG(IS_WIN)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoDecoding:
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -149,7 +151,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLi
+ #if BUILDFLAG(IS_MAC)
+ case Sandbox::kMirroring:
+ #endif // BUILDFLAG(IS_MAC)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case Sandbox::kScreenAI:
+ #endif
+ case Sandbox::kSpeechRecognition:
+@@ -255,7 +257,7 @@ std::string StringFromUtilitySandboxType(Sandbox sandb
+ return switches::kUtilitySandbox;
+ case Sandbox::kAudio:
+ return switches::kAudioSandbox;
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoCapture:
+ return switches::kVideoCaptureSandbox;
+ #endif
+@@ -265,7 +267,7 @@ std::string StringFromUtilitySandboxType(Sandbox sandb
+ return switches::kServiceSandboxWithJit;
+ case Sandbox::kSpeechRecognition:
+ return switches::kSpeechRecognitionSandbox;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case Sandbox::kScreenAI:
+ return switches::kScreenAISandbox;
+ #endif
+@@ -285,7 +287,7 @@ std::string StringFromUtilitySandboxType(Sandbox sandb
+ case Sandbox::kMirroring:
+ return switches::kMirroringSandbox;
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoDecoding:
+ return switches::kHardwareVideoDecodingSandbox;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -369,15 +371,15 @@ sandbox::mojom::Sandbox UtilitySandboxTypeFromString(
+ return Sandbox::kAudio;
+ if (sandbox_string == switches::kSpeechRecognitionSandbox)
+ return Sandbox::kSpeechRecognition;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kScreenAISandbox)
+ return Sandbox::kScreenAI;
+ #endif
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kVideoCaptureSandbox)
+ return Sandbox::kVideoCapture;
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kHardwareVideoDecodingSandbox)
+ return Sandbox::kHardwareVideoDecoding;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_switches.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_switches.h
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/sandbox/policy/switches.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/switches.h
+@@ -53,7 +53,7 @@ SANDBOX_POLICY_EXPORT extern const char kMirroringSand
+ SANDBOX_POLICY_EXPORT extern const char kMirroringSandbox[];
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT extern const char kHardwareVideoDecodingSandbox[];
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+
+@@ -75,7 +75,8 @@ SANDBOX_POLICY_EXPORT extern const char kNoSandbox[];
+ SANDBOX_POLICY_EXPORT extern const char kGpuSandboxAllowSysVShm[];
+ SANDBOX_POLICY_EXPORT extern const char kGpuSandboxFailuresFatal[];
+ SANDBOX_POLICY_EXPORT extern const char kNoSandbox[];
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++SANDBOX_POLICY_EXPORT extern const char kDisableUnveil[];
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT extern const char kNoZygoteSandbox[];
+ #endif
+ #if BUILDFLAG(IS_WIN)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_switches.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_switches.cc
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/sandbox/policy/switches.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/sandbox/policy/switches.cc
+@@ -52,7 +52,7 @@ const char kMirroringSandbox[] = "mirroring";
+ const char kMirroringSandbox[] = "mirroring";
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ const char kHardwareVideoDecodingSandbox[] = "hardware_video_decoding";
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+
+@@ -99,7 +99,9 @@ const char kNoSandbox[] = "no-sandbox";
+ // Meant to be used as a browser-level switch for testing purposes only.
+ const char kNoSandbox[] = "no-sandbox";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++const char kDisableUnveil[] = "disable-unveil";
++
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Instructs the zygote to launch without a sandbox. Processes forked from this
+ // type of zygote will apply their own custom sandboxes later.
+ const char kNoZygoteSandbox[] = "no-zygote-sandbox";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_audio_audio__sandbox__hook__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_audio_audio__sandbox__hook__linux.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/services/audio/audio_sandbox_hook_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/audio/audio_sandbox_hook_linux.h
+@@ -5,7 +5,11 @@
+ #ifndef SERVICES_AUDIO_AUDIO_SANDBOX_HOOK_LINUX_H_
+ #define SERVICES_AUDIO_AUDIO_SANDBOX_HOOK_LINUX_H_
+
++#if defined(OS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace audio {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_audio_audio__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_audio_audio__sandbox__hook__linux.cc
@@ -0,0 +1,31 @@
+--- src/3rdparty/chromium/services/audio/audio_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/audio/audio_sandbox_hook_linux.cc
+@@ -143,6 +143,7 @@ void AddPulseAudioFilePermissions(
+ }
+ #endif
+
++#if !defined(OS_BSD)
+ std::vector<BrokerFilePermission> GetAudioFilePermissions() {
+ std::vector<BrokerFilePermission> permissions{
+ BrokerFilePermission::ReadOnly("/dev/urandom"),
+@@ -171,10 +172,12 @@ void LoadAudioLibraries() {
+ }
+ }
+ }
++#endif
+
+ } // namespace
+
+ bool AudioPreSandboxHook(sandbox::policy::SandboxLinux::Options options) {
++#if !defined(OS_BSD)
+ LoadAudioLibraries();
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+ instance->StartBrokerProcess(MakeBrokerCommandSet({
+@@ -194,6 +197,7 @@ bool AudioPreSandboxHook(sandbox::policy::SandboxLinux
+ // TODO(https://crbug.com/850878) enable namespace sandbox. Currently, if
+ // enabled, connect() on pulse native socket fails with ENOENT (called from
+ // pa_context_connect).
++#endif
+
+ return true;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_cert__verifier_cert__verifier__creation.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_cert__verifier_cert__verifier__creation.cc
@@ -0,0 +1,30 @@
+--- src/3rdparty/chromium/services/cert_verifier/cert_verifier_creation.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/cert_verifier/cert_verifier_creation.cc
+@@ -86,7 +86,7 @@ scoped_refptr<net::CertVerifyProc> CreateOldDefaultWit
+ scoped_refptr<net::CertVerifyProc> CreateOldDefaultWithoutCaching(
+ scoped_refptr<net::CertNetFetcher> cert_net_fetcher) {
+ scoped_refptr<net::CertVerifyProc> verify_proc;
+-#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ verify_proc =
+ net::CertVerifyProc::CreateBuiltinVerifyProc(std::move(cert_net_fetcher));
+ #else
+@@ -104,7 +104,7 @@ scoped_refptr<net::CertVerifyProc> CreateNewDefaultWit
+ scoped_refptr<net::CertNetFetcher> cert_net_fetcher) {
+ scoped_refptr<net::CertVerifyProc> verify_proc;
+ #if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD))
+ verify_proc = net::CreateCertVerifyProcBuiltin(
+ std::move(cert_net_fetcher), net::CreateSslSystemTrustStoreChromeRoot());
+ #elif BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
+@@ -122,7 +122,8 @@ bool IsUsingCertNetFetcher() {
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || \
+ BUILDFLAG(TRIAL_COMPARISON_CERT_VERIFIER_SUPPORTED) || \
+- BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
++ BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED) || \
++ BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_device_geolocation_location__arbitrator.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_device_geolocation_location__arbitrator.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/services/device/geolocation/location_arbitrator.cc.orig 2022-11-08 21:18:48 UTC
++++ src/3rdparty/chromium/services/device/geolocation/location_arbitrator.cc
+@@ -164,7 +164,7 @@ LocationArbitrator::NewSystemLocationProvider() {
+
+ std::unique_ptr<LocationProvider>
+ LocationArbitrator::NewSystemLocationProvider() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ return nullptr;
+ #else
+ return device::NewSystemLocationProvider(main_task_runner_,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_device_usb_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_device_usb_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/services/device/usb/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/device/usb/BUILD.gn
+@@ -152,7 +152,7 @@ static_library("usb") {
+ deps += [ "//device/udev_linux" ]
+ }
+
+- if (is_android || is_chromeos || is_linux) {
++ if ((is_android || is_chromeos || is_linux) && !is_bsd) {
+ sources += [
+ "usb_device_handle_usbfs.cc",
+ "usb_device_handle_usbfs.h",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_network_network__sandbox__hook__linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_network_network__sandbox__hook__linux.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/services/network/network_sandbox_hook_linux.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/network/network_sandbox_hook_linux.h
+@@ -10,7 +10,11 @@
+ #include "base/component_export.h"
+ #include "sandbox/linux/syscall_broker/broker_command.h"
+ #include "sandbox/linux/syscall_broker/broker_file_permission.h"
++#if defined(OS_BSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace network {
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_network_network__sandbox__hook__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_network_network__sandbox__hook__linux.cc
@@ -0,0 +1,26 @@
+--- src/3rdparty/chromium/services/network/network_sandbox_hook_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/network/network_sandbox_hook_linux.cc
+@@ -26,12 +26,15 @@ sandbox::syscall_broker::BrokerCommandSet GetNetworkBr
+ });
+ }
+
++#if !defined(OS_BSD)
+ std::vector<BrokerFilePermission> GetNetworkFilePermissions() {
+ // TODO(tsepez): remove universal permission under filesystem root.
+ return {BrokerFilePermission::ReadWriteCreateRecursive("/")};
+ }
++#endif
+
+ bool NetworkPreSandboxHook(sandbox::policy::SandboxLinux::Options options) {
++#if !defined(OS_BSD)
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+
+ instance->StartBrokerProcess(
+@@ -39,6 +42,7 @@ bool NetworkPreSandboxHook(sandbox::policy::SandboxLin
+ sandbox::policy::SandboxLinux::PreSandboxHook(), options);
+
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+ return true;
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc
@@ -0,0 +1,65 @@
+--- src/3rdparty/chromium/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc
+@@ -52,7 +52,7 @@ uint32_t CalculatePrivateFootprintKb(const mojom::RawO
+ uint32_t shared_resident_kb) {
+ DCHECK(os_dump.platform_private_footprint);
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ uint64_t rss_anon_bytes = os_dump.platform_private_footprint->rss_anon_bytes;
+ uint64_t vm_swap_bytes = os_dump.platform_private_footprint->vm_swap_bytes;
+ return (rss_anon_bytes + vm_swap_bytes) / 1024;
+@@ -91,7 +91,7 @@ memory_instrumentation::mojom::OSMemDumpPtr CreatePubl
+ os_dump->is_peak_rss_resettable = internal_os_dump.is_peak_rss_resettable;
+ os_dump->private_footprint_kb =
+ CalculatePrivateFootprintKb(internal_os_dump, shared_resident_kb);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ os_dump->private_footprint_swap_kb =
+ internal_os_dump.platform_private_footprint->vm_swap_bytes / 1024;
+ #endif
+@@ -270,7 +270,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch(
+
+ // On most platforms each process can dump data about their own process
+ // so ask each process to do so Linux is special see below.
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ request->pending_responses.insert({client_info.pid, ResponseType::kOSDump});
+ client->RequestOSMemoryDump(request->memory_map_option(),
+ {base::kNullProcessId},
+@@ -285,7 +285,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch(
+
+ // In some cases, OS stats can only be dumped from a privileged process to
+ // get around to sandboxing/selinux restrictions (see crbug.com/461788).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::vector<base::ProcessId> pids;
+ mojom::ClientProcess* browser_client = nullptr;
+ base::ProcessId browser_client_pid = base::kNullProcessId;
+@@ -331,7 +331,7 @@ void QueuedRequestDispatcher::SetUpAndDispatchVmRegion
+ const OsCallback& os_callback) {
+ // On Linux, OS stats can only be dumped from a privileged process to
+ // get around to sandboxing/selinux restrictions (see crbug.com/461788).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojom::ClientProcess* browser_client = nullptr;
+ base::ProcessId browser_client_pid = 0;
+ for (const auto& client_info : clients) {
+@@ -382,7 +382,7 @@ QueuedRequestDispatcher::FinalizeVmRegionRequest(
+ // each client process provides 1 OS dump, % the case where the client is
+ // disconnected mid dump.
+ OSMemDumpMap& extra_os_dumps = response.second.os_dumps;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (auto& kv : extra_os_dumps) {
+ auto pid = kv.first == base::kNullProcessId ? original_pid : kv.first;
+ DCHECK(results.find(pid) == results.end());
+@@ -444,7 +444,7 @@ void QueuedRequestDispatcher::Finalize(QueuedRequest*
+ // crash). In the latter case (OS_LINUX) we expect the full map to come
+ // from the browser process response.
+ OSMemDumpMap& extra_os_dumps = response.second.os_dumps;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (const auto& kv : extra_os_dumps) {
+ auto pid = kv.first == base::kNullProcessId ? original_pid : kv.first;
+ DCHECK_EQ(pid_to_os_dump[pid], nullptr);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/BUILD.gn
+@@ -29,8 +29,12 @@ component("memory_instrumentation") {
+ sources += [ "os_metrics_win.cc" ]
+ }
+
+- if (is_android || is_linux || is_chromeos) {
++ if ((is_android || is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "os_metrics_linux.cc" ]
++ }
++
++ if (is_bsd) {
++ sources += [ "os_metrics_bsd.cc" ]
+ }
+
+ if (is_fuchsia) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h
+@@ -45,7 +45,7 @@ class COMPONENT_EXPORT(
+ mojom::RawOSMemDump*);
+ static std::vector<mojom::VmRegionPtr> GetProcessMemoryMaps(base::ProcessId);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ static void SetProcSmapsForTesting(FILE*);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID)
+@@ -62,7 +62,7 @@ class COMPONENT_EXPORT(
+ static std::vector<mojom::VmRegionPtr> GetProcessModules(base::ProcessId);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Provides information on the dump state of resident pages. These values are
+ // written to logs. New enum values can be added, but existing enums must
+ // never be renumbered or deleted and reused.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc
@@ -0,0 +1,61 @@
+--- src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_bsd.cc.orig 2022-11-07 21:32:28 UTC
++++ src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_bsd.cc
+@@ -0,0 +1,58 @@
++// Copyright 2022 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h"
++
++#include "base/memory/page_size.h"
++#include "base/process/process.h"
++#include "base/process/process_handle.h"
++
++#include <sys/sysctl.h>
++
++#include <vector>
++
++#if BUILDFLAG(IS_OPENBSD)
++#define vm_rssize info.p_vm_rssize
++#elif BUILDFLAG(IS_FREEBSD)
++#include <sys/user.h>
++#define vm_rssize info.ki_rssize
++#endif
++
++namespace memory_instrumentation {
++
++// static
++bool OSMetrics::FillOSMemoryDump(base::ProcessId pid,
++ mojom::RawOSMemDump* dump) {
++ base::Process process = pid == base::kNullProcessId
++ ? base::Process::Current()
++ : base::Process::Open(pid);
++ const size_t kPageSize = base::GetPageSize();
++ struct kinfo_proc info;
++ size_t length = sizeof(struct kinfo_proc);
++#if BUILDFLAG(IS_OPENBSD)
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process.Handle(),
++ static_cast<int>(length), 1 };
++#elif BUILDFLAG(IS_FREEBSD)
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process.Handle() };
++#endif
++
++ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
++ return false;
++
++ dump->resident_set_kb = (vm_rssize * kPageSize) / 1024;
++ dump->platform_private_footprint->rss_anon_bytes =
++ vm_rssize * kPageSize;
++ dump->platform_private_footprint->vm_swap_bytes = 0;
++
++ return true;
++}
++
++// static
++std::vector<mojom::VmRegionPtr> OSMetrics::GetProcessMemoryMaps(
++ base::ProcessId) {
++ NOTIMPLEMENTED();
++ return std::vector<mojom::VmRegionPtr>();
++}
++
++} // namespace memory_instrumentation
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_skia_ext_SkMemory__new__handler.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_skia_ext_SkMemory__new__handler.cpp
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/skia/ext/SkMemory_new_handler.cpp.orig 2022-11-06 21:41:22 UTC
++++ src/3rdparty/chromium/skia/ext/SkMemory_new_handler.cpp
+@@ -79,7 +79,7 @@ static void* malloc_nothrow(size_t size) {
+ // TODO(b.kelemen): we should always use UncheckedMalloc but currently it
+ // doesn't work as intended everywhere.
+ void* result;
+-#if BUILDFLAG(IS_IOS)
++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ result = malloc(size);
+ #else
+ // It's the responsibility of the caller to check the return value.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_base_config.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_base_config.h
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/third_party/abseil-cpp/absl/base/config.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/abseil-cpp/absl/base/config.h
+@@ -448,7 +448,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] !=
+ // POSIX.1-2001.
+ #ifdef ABSL_HAVE_SCHED_YIELD
+ #error ABSL_HAVE_SCHED_YIELD cannot be directly set
+-#elif defined(__linux__) || defined(__ros__) || defined(__native_client__)
++#elif defined(__linux__) || defined(__ros__) || defined(__native_client__) || \
++ defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define ABSL_HAVE_SCHED_YIELD 1
+ #endif
+
+@@ -463,7 +464,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] !=
+ // platforms.
+ #ifdef ABSL_HAVE_SEMAPHORE_H
+ #error ABSL_HAVE_SEMAPHORE_H cannot be directly set
+-#elif defined(__linux__) || defined(__ros__)
++#elif defined(__linux__) || defined(__ros__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define ABSL_HAVE_SEMAPHORE_H 1
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_base_internal_sysinfo.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_base_internal_sysinfo.cc
@@ -0,0 +1,23 @@
+--- src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/sysinfo.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
+@@ -30,7 +30,7 @@
+ #include <sys/syscall.h>
+ #endif
+
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ #include <sys/sysctl.h>
+ #endif
+
+@@ -308,9 +308,11 @@ static double GetNominalCPUFrequency() {
+ // a new mode (turbo mode). Essentially, those frequencies cannot
+ // always be relied upon. The same reasons apply to /proc/cpuinfo as
+ // well.
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__) // pledge violation
+ if (ReadLongFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)) {
+ return freq * 1e3; // Value is kHz.
+ }
++#endif
+
+ #if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY)
+ // On these platforms, the TSC frequency is the nominal CPU
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h
+@@ -32,7 +32,8 @@
+ #endif
+
+ #if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
+- !defined(__native_client__) && !defined(__asmjs__) && !defined(__wasm__)
++ !defined(__native_client__) && !defined(__asmjs__) && !defined(__wasm__) && \
++ !defined(__FreeBSD__)
+ #define ABSL_HAVE_ELF_MEM_IMAGE 1
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc
+@@ -19,7 +19,7 @@
+ #endif
+
+ #if defined(HAS_STRPTIME) && HAS_STRPTIME
+-#if !defined(_XOPEN_SOURCE)
++#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
+ #define _XOPEN_SOURCE // Definedness suffices for strptime.
+ #endif
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_BUILD.gn
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/third_party/angle/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/BUILD.gn
+@@ -213,7 +213,6 @@ config("extra_warnings") {
+ "-Wtautological-type-limit-compare",
+ "-Wundefined-reinterpret-cast",
+ "-Wunneeded-internal-declaration",
+- "-Wunused-but-set-variable",
+ "-Wsuggest-destructor-override",
+ "-Wsuggest-override",
+
+@@ -391,7 +390,7 @@ angle_static_library("angle_common") {
+ all_dependent_configs = [ ":angle_disable_pool_alloc" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ libs = [ "dl" ]
+ }
+
+@@ -512,6 +511,9 @@ angle_static_library("angle_gpu_info_util") {
+ "Xi",
+ "Xext",
+ ]
++ if (is_bsd) {
++ libs += [ "GL" ]
++ }
+ }
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_common_platform.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_common_platform.h
@@ -0,0 +1,19 @@
+--- src/3rdparty/chromium/third_party/angle/src/common/platform.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/common/platform.h
+@@ -26,7 +26,15 @@
+ #elif defined(__linux__) || defined(EMSCRIPTEN)
+ # define ANGLE_PLATFORM_LINUX 1
+ # define ANGLE_PLATFORM_POSIX 1
+-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
++#elif defined(__OpenBSD__)
++# define ANGLE_PLATFORM_OPENBSD 1
++# define ANGLE_PLATFORM_POSIX 1
++# define ANGLE_PLATFORM_BSD 1
++#elif defined(__FreeBSD__)
++# define ANGLE_PLATFORM_FREEBSD 1
++# define ANGLE_PLATFORM_POSIX 1
++# define ANGLE_PLATFORM_BSD 1
++#elif defined(__NetBSD__) || \
+ defined(__DragonFly__) || defined(__sun) || defined(__GLIBC__) || defined(__GNU__) || \
+ defined(__QNX__) || defined(__Fuchsia__) || defined(__HAIKU__)
+ # define ANGLE_PLATFORM_POSIX 1
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_common_system__utils__posix.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_common_system__utils__posix.cpp
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/angle/src/common/system_utils_posix.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/common/system_utils_posix.cpp
+@@ -201,7 +201,9 @@ void *OpenSystemLibraryWithExtensionAndGetError(const
+ int extraFlags = 0;
+ if (searchType == SearchType::AlreadyLoaded)
+ {
++#if !defined(__OpenBSD__)
+ extraFlags = RTLD_NOLOAD;
++#endif
+ }
+
+ std::string fullPath = directory + libraryName;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__internal.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__internal.h
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h
+@@ -14,6 +14,13 @@ namespace angle
+ namespace angle
+ {
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++bool CollectMesaCardInfo(std::vector<GPUDeviceInfo> *devices);
++#if defined(__FreeBSD__)
++bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices);
++#endif
++#endif
++
+ // Defined in SystemInfo_libpci when GPU_INFO_USE_LIBPCI is defined.
+ bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices);
+ // Defined in SystemInfo_x11 when GPU_INFO_USE_X11 is defined.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp
@@ -0,0 +1,90 @@
+--- src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp
+@@ -12,6 +12,11 @@
+ #include <pci/pci.h>
+ #include <unistd.h>
+
++#if defined(__FreeBSD__)
++#include <fcntl.h>
++#include <sys/pciio.h>
++#endif
++
+ #include "common/angleutils.h"
+ #include "common/debug.h"
+
+@@ -85,6 +90,75 @@ struct LibPCI : private angle::NonCopyable
+ };
+
+ } // anonymous namespace
++
++#if defined(__FreeBSD__)
++// Adds an entry per PCI GPU found and fills the device and vendor ID.
++bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices)
++{
++ int fd;
++ struct pci_conf_io conf;
++ struct pci_conf *matches;
++ uint32_t offset = 0;
++
++ fd = open("/dev/pci", O_RDONLY);
++ if (fd < 0)
++ return false;
++
++ matches = new struct pci_conf[32];
++ conf.generation = 0;
++ do {
++ conf.pat_buf_len = 0;
++ conf.num_patterns = 0;
++ conf.patterns = NULL;
++ conf.match_buf_len = 32 * sizeof(struct pci_conf);
++ conf.num_matches = 32;
++ conf.matches = matches;
++ conf.offset = offset;
++ conf.status = PCI_GETCONF_ERROR;
++ if (ioctl(fd, PCIOCGETCONF, &conf) < 0) {
++ if (errno == ENODEV)
++ break;
++ }
++ /* PCI_GETCONF_LIST_CHANGED would require us to start over. */
++ if (conf.status == PCI_GETCONF_ERROR || conf.status == PCI_GETCONF_LIST_CHANGED) {
++ break;
++ }
++
++ for (unsigned int i = 0; i < conf.num_matches; i++) {
++ uint16_t device_class = (matches[i].pc_class << 8) | matches[i].pc_subclass;
++
++ // Skip non-GPU devices
++ switch (device_class)
++ {
++ case PCI_CLASS_DISPLAY_VGA:
++ case PCI_CLASS_DISPLAY_XGA:
++ case PCI_CLASS_DISPLAY_3D:
++ break;
++ default:
++ continue;
++ }
++
++ // Skip unknown devices
++ if (matches[i].pc_vendor == 0 || matches[i].pc_device == 0) {
++ continue;
++ }
++
++ GPUDeviceInfo info;
++ info.vendorId = matches[i].pc_vendor;
++ info.deviceId = matches[i].pc_device;
++
++ devices->push_back(info);
++ }
++ offset += conf.num_matches;
++ } while (conf.status == PCI_GETCONF_MORE_DEVS);
++
++ delete[] matches;
++
++ close(fd);
++
++ return true;
++}
++#endif
+
+ // Adds an entry per PCI GPU found and fills the device and vendor ID.
+ bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp
@@ -0,0 +1,35 @@
+--- src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp
+@@ -71,6 +71,24 @@ bool GetSystemInfo(SystemInfo *info)
+
+ bool GetSystemInfo(SystemInfo *info)
+ {
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++ if (!CollectMesaCardInfo(&(info->gpus)))
++ {
++#if defined(__FreeBSD__)
++ if (!GetPCIDevicesFreeBSD(&(info->gpus)))
++ {
++#endif
++#if defined(ANGLE_USE_VULKAN_SYSTEM_INFO)
++ // Try vulkan backend to get GPU info
++ return GetSystemInfoVulkan(info);
++#else
++ return false;
++#endif
++#if defined(__FreeBSD__)
++ }
++#endif
++ }
++#else
+ if (!GetPCIDevicesWithLibPCI(&(info->gpus)))
+ {
+ #if defined(ANGLE_USE_VULKAN_SYSTEM_INFO)
+@@ -85,6 +103,7 @@ bool GetSystemInfo(SystemInfo *info)
+ {
+ return false;
+ }
++#endif
+
+ GetDualGPUInfo(info);
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp
@@ -0,0 +1,60 @@
+--- src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp
+@@ -8,6 +8,10 @@
+
+ #include "gpu_info_util/SystemInfo_internal.h"
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#include <GL/glx.h>
++#include <GL/glxext.h>
++#endif
+ #include <X11/Xlib.h>
+
+ #include "common/debug.h"
+@@ -18,8 +22,46 @@
+ # error SystemInfo_x11.cpp compiled without GPU_INFO_USE_X11
+ #endif
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
++#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
++#endif
++
+ namespace angle
+ {
++
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++bool CollectMesaCardInfo(std::vector<GPUDeviceInfo> *devices)
++{
++ unsigned int vid[3], did[3];
++
++ Display *display = XOpenDisplay(NULL);
++ if (!display) {
++ return false;
++ }
++
++ PFNGLXQUERYRENDERERINTEGERMESAPROC queryInteger =
++ (PFNGLXQUERYRENDERERINTEGERMESAPROC) glXGetProcAddressARB((const GLubyte *)
++ "glXQueryRendererIntegerMESA");
++
++ if (!queryInteger)
++ return false;
++
++ bool vendor_ret =
++ queryInteger(display, 0, 0, GLX_RENDERER_VENDOR_ID_MESA, vid);
++ bool device_ret =
++ queryInteger(display, 0, 0, GLX_RENDERER_DEVICE_ID_MESA, did);
++
++ if (vendor_ret && device_ret) {
++ GPUDeviceInfo info;
++ info.vendorId = vid[0];
++ info.deviceId = did[0];
++ devices->push_back(info);
++ }
++
++ return true;
++}
++#endif
+
+ bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version)
+ {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_Display.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_Display.cpp
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/third_party/angle/src/libANGLE/Display.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/libANGLE/Display.cpp
+@@ -55,7 +55,7 @@
+ # include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
+ # elif defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_IOS)
+ # include "libANGLE/renderer/gl/apple/DisplayApple_api.h"
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # include "libANGLE/renderer/gl/egl/DisplayEGL.h"
+ # if defined(ANGLE_USE_GBM)
+ # include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h"
+@@ -328,7 +328,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di
+ impl = rx::CreateDisplayCGLOrEAGL(state);
+ break;
+
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # if defined(ANGLE_USE_GBM)
+ if (platformType == 0)
+ {
+@@ -373,7 +373,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di
+ #if defined(ANGLE_ENABLE_OPENGL)
+ # if defined(ANGLE_PLATFORM_WINDOWS)
+ impl = new rx::DisplayWGL(state);
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # if defined(ANGLE_USE_GBM)
+ if (platformType == 0 ||
+ platformType == EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE)
+@@ -424,7 +424,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di
+ impl = rx::CreateVulkanWin32Display(state);
+ }
+ break;
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # if defined(ANGLE_USE_X11)
+ if (platformType == EGL_PLATFORM_X11_EXT && rx::IsVulkanXcbDisplayAvailable())
+ {
+@@ -1932,7 +1932,7 @@ static ClientExtensions GenerateClientExtensions()
+ extensions.x11Visual = true;
+ #endif
+
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ extensions.platformANGLEDeviceTypeEGLANGLE = true;
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_formatutils.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_formatutils.cpp
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/angle/src/libANGLE/formatutils.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/libANGLE/formatutils.cpp
+@@ -1393,7 +1393,7 @@ static InternalFormatInfoMap BuildInternalFormatInfoMa
+ AddYUVFormat(&map, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported);
+ AddYUVFormat(&map, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported);
+
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ // From GL_OES_required_internalformat
+ // The |shared| bit shouldn't be 2. But given this hits assertion when bits
+ // are checked, it's fine to have this bit set as 2 as a workaround.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_renderer_driver__utils.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_renderer_driver__utils.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/driver_utils.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/driver_utils.h
+@@ -179,7 +179,7 @@ inline bool IsLinux()
+
+ inline bool IsLinux()
+ {
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ return true;
+ #else
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp
+@@ -144,10 +144,10 @@ bool FunctionsGLX::initialize(Display *xDisplay, int s
+ // which a GLXWindow was ever created.
+ if (!sLibHandle)
+ {
+- sLibHandle = dlopen("libGL.so.1", RTLD_NOW);
++ sLibHandle = dlopen("libGL.so", RTLD_NOW);
+ if (!sLibHandle)
+ {
+- *errorString = std::string("Could not dlopen libGL.so.1: ") + dlerror();
++ *errorString = std::string("Could not dlopen libGL.so: ") + dlerror();
+ return false;
+ }
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/vulkan/DisplayVk_api.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/vulkan/DisplayVk_api.h
+@@ -23,7 +23,7 @@ DisplayImpl *CreateVulkanWin32Display(const egl::Displ
+ DisplayImpl *CreateVulkanWin32Display(const egl::DisplayState &state);
+ #endif // defined(ANGLE_PLATFORM_WINDOWS)
+
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_POSIX)
+ bool IsVulkanXcbDisplayAvailable();
+ DisplayImpl *CreateVulkanXcbDisplay(const egl::DisplayState &state);
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_util_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_util_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/angle/util/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/angle/util/BUILD.gn
+@@ -203,7 +203,7 @@ foreach(is_shared_library,
+ ]
+ libs = []
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ libs += [
+ "rt",
+ "dl",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc
+@@ -64,7 +64,7 @@ bool StructTraits<blink::mojom::RendererPreferencesDat
+ if (!data.ReadAcceptLanguages(&out->accept_languages))
+ return false;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!data.ReadSystemFontFamilyName(&out->system_font_family_name))
+ return false;
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_public_common_renderer__preferences_renderer__preferences.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_public_common_renderer__preferences_renderer__preferences.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/public/common/renderer_preferences/renderer_preferences.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/public/common/renderer_preferences/renderer_preferences.h
+@@ -50,7 +50,7 @@ struct BLINK_COMMON_EXPORT RendererPreferences {
+ bool webrtc_allow_legacy_tls_protocols{false};
+ UserAgentOverride user_agent_override;
+ std::string accept_languages;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::string system_font_family_name;
+ #endif
+ #if BUILDFLAG(IS_WIN)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h
+@@ -157,7 +157,7 @@ struct BLINK_COMMON_EXPORT
+ return data.accept_languages;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static const std::string& system_font_family_name(
+ const ::blink::RendererPreferences& data) {
+ return data.system_font_family_name;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_public_platform_web__vector.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_public_platform_web__vector.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/public/platform/web_vector.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/public/platform/web_vector.h
+@@ -81,7 +81,7 @@ class WebVector {
+ // The vector can be populated using reserve() and emplace_back().
+ WebVector() = default;
+
+-#if defined(ARCH_CPU_64_BITS)
++#if defined(ARCH_CPU_64_BITS) || defined(__OpenBSD__)
+ // Create a vector with |size| default-constructed elements. We define
+ // a constructor with size_t otherwise we'd have a duplicate define.
+ explicit WebVector(size_t size) : data_(size) {}
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
+@@ -28,7 +28,7 @@ def init(root_src_dir, enable_style_format=True):
+ root_src_dir = os.path.abspath(root_src_dir)
+
+ # Determine //buildtools/<platform>/ directory
+- if sys.platform.startswith("linux"):
++ if sys.platform.startswith(("linux","openbsd","freebsd")):
+ platform = "linux64"
+ exe_suffix = ""
+ elif sys.platform.startswith("darwin"):
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_build_scripts_run__with__pythonpath.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_build_scripts_run__with__pythonpath.py
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/run_with_pythonpath.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/run_with_pythonpath.py
+@@ -22,6 +22,7 @@ def main():
+ existing_pp = (
+ os.pathsep + env['PYTHONPATH']) if 'PYTHONPATH' in env else ''
+ env['PYTHONPATH'] = os.pathsep.join(python_paths) + existing_pp
++ env['LD_LIBRARY_PATH'] = "${WRKSRC}/out/Release"
+ sys.exit(subprocess.call([sys.executable] + args, env=env))
+
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_controller_blink__initializer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_controller_blink__initializer.cc
@@ -0,0 +1,35 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/controller/blink_initializer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/controller/blink_initializer.cc
+@@ -71,12 +71,12 @@
+ #include "third_party/blink/renderer/controller/oom_intervention_impl.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/controller/memory_usage_monitor_posix.h"
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/controller/highest_pmf_reporter.h"
+ #include "third_party/blink/renderer/controller/user_level_memory_pressure_signal_generator.h"
+ #endif
+@@ -156,7 +156,7 @@ void InitializeCommon(Platform* platform, mojo::Binder
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Initialize UserLevelMemoryPressureSignalGenerator so it starts monitoring.
+ if (UserLevelMemoryPressureSignalGenerator::Enabled())
+ UserLevelMemoryPressureSignalGenerator::Instance();
+@@ -227,7 +227,7 @@ void BlinkInitializer::RegisterInterfaces(mojo::Binder
+ main_thread->GetTaskRunner());
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ binders.Add(ConvertToBaseRepeatingCallback(
+ CrossThreadBindRepeating(&MemoryUsageMonitorPosix::Bind)),
+ main_thread->GetTaskRunner());
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_controller_memory__usage__monitor__posix.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_controller_memory__usage__monitor__posix.h
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/controller/memory_usage_monitor_posix.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/controller/memory_usage_monitor_posix.h
+@@ -13,7 +13,7 @@
+ #include "third_party/blink/renderer/controller/controller_export.h"
+ #include "third_party/blink/renderer/controller/memory_usage_monitor.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/public/mojom/memory_usage_monitor_linux.mojom-blink.h"
+ #endif
+
+@@ -22,7 +22,7 @@ class CONTROLLER_EXPORT MemoryUsageMonitorPosix
+ // MemoryUsageMonitor implementation for Android and Linux.
+ class CONTROLLER_EXPORT MemoryUsageMonitorPosix
+ : public MemoryUsageMonitor
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ public mojom::blink::MemoryUsageMonitorLinux
+ #endif
+@@ -30,7 +30,7 @@ class CONTROLLER_EXPORT MemoryUsageMonitorPosix
+ public:
+ MemoryUsageMonitorPosix() = default;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static void Bind(
+ mojo::PendingReceiver<mojom::blink::MemoryUsageMonitorLinux> receiver);
+ #endif
+@@ -48,7 +48,7 @@ class CONTROLLER_EXPORT MemoryUsageMonitorPosix
+ uint64_t* vm_size,
+ uint64_t* vm_hwm_size);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // mojom::MemoryUsageMonitorLinux implementations:
+ void SetProcFiles(base::File statm_file, base::File status_file) override;
+ #endif
+@@ -66,7 +66,7 @@ class CONTROLLER_EXPORT MemoryUsageMonitorPosix
+ base::ScopedFD statm_fd_;
+ base::ScopedFD status_fd_;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::Receiver<mojom::blink::MemoryUsageMonitorLinux> receiver_{this};
+ #endif
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_controller_memory__usage__monitor__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_controller_memory__usage__monitor__posix.cc
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/controller/memory_usage_monitor_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/controller/memory_usage_monitor_posix.cc
+@@ -128,15 +128,17 @@ void MemoryUsageMonitorPosix::SetProcFiles(base::File
+
+ void MemoryUsageMonitorPosix::SetProcFiles(base::File statm_file,
+ base::File status_file) {
++#if !BUILDFLAG(IS_BSD)
+ DCHECK(statm_file.IsValid());
+ DCHECK(status_file.IsValid());
+ DCHECK_EQ(-1, statm_fd_.get());
+ DCHECK_EQ(-1, status_fd_.get());
+ statm_fd_.reset(statm_file.TakePlatformFile());
+ status_fd_.reset(status_file.TakePlatformFile());
++#endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ void MemoryUsageMonitorPosix::Bind(
+ mojo::PendingReceiver<mojom::blink::MemoryUsageMonitorLinux> receiver) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_editing_editing__behavior.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_editing_editing__behavior.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/editing/editing_behavior.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/editing/editing_behavior.cc
+@@ -280,7 +280,7 @@ bool EditingBehavior::ShouldInsertCharacter(const Keyb
+ // unexpected behaviour
+ if (ch < ' ')
+ return false;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // According to XKB map no keyboard combinations with ctrl key are mapped to
+ // printable characters, however we need the filter as the DomKey/text could
+ // contain printable characters.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_exported_web__view__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_exported_web__view__impl.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/exported/web_view_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/exported/web_view_impl.cc
+@@ -405,7 +405,7 @@ SkFontHinting RendererPreferencesToSkiaHinting(
+ const blink::RendererPreferences& prefs) {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ if (!prefs.should_antialias_text) {
+ // When anti-aliasing is off, GTK maps all non-zero hinting settings to
+ // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight'
+@@ -3168,7 +3168,7 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs
+ renderer_preferences_.use_subpixel_positioning);
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && \
+ !BUILDFLAG(IS_ANDROID)
+ if (!renderer_preferences_.system_font_family_name.empty()) {
+ WebFontRenderStyle::SetSystemFontFamily(blink::WebString::FromUTF8(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_frame_web__frame__test.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_frame_web__frame__test.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/frame/web_frame_test.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/frame/web_frame_test.cc
+@@ -6281,7 +6281,7 @@ TEST_F(WebFrameTest, DISABLED_PositionForPointTest) {
+ EXPECT_EQ(64, ComputeOffset(layout_object, 1000, 1000));
+ }
+
+-#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ TEST_F(WebFrameTest, SelectRangeStaysHorizontallyAlignedWhenMoved) {
+ RegisterMockedHttpURLLoad("move_caret.html");
+
+@@ -6660,7 +6660,7 @@ TEST_F(CompositedSelectionBoundsTest, SVGTextWithFragm
+ TEST_F(CompositedSelectionBoundsTest, SVGTextWithFragments) {
+ RunTest("composited_selection_bounds_svg_text_with_fragments.html");
+ }
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if !BUILDFLAG(IS_ANDROID)
+ TEST_F(CompositedSelectionBoundsTest, Input) {
+ web_view_helper_.GetWebView()->GetSettings()->SetDefaultFontSize(16);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
+@@ -45,7 +45,7 @@ constexpr base::TimeDelta kEncodeRowSlackBeforeDeadlin
+
+ /* The value is based on user statistics on Nov 2017. */
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN))
++ BUILDFLAG(IS_WIN)) || BUILDFLAG(IS_BSD)
+ const double kIdleTaskStartTimeoutDelayMs = 1000.0;
+ #else
+ const double kIdleTaskStartTimeoutDelayMs = 4000.0; // For ChromeOS, Mobile
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_inspector_inspector__memory__agent.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_inspector_inspector__memory__agent.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/inspector/inspector_memory_agent.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/inspector/inspector_memory_agent.cc
+@@ -186,7 +186,7 @@ Vector<String> InspectorMemoryAgent::Symbolize(
+
+ Vector<String> InspectorMemoryAgent::Symbolize(
+ const WebVector<void*>& addresses) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(alph): Move symbolization to the client.
+ Vector<void*> addresses_to_symbolize;
+ for (size_t i = 0; i < addresses.size(); i++) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_layout_layout__view.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_layout_layout__view.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/layout/layout_view.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/layout/layout_view.cc
+@@ -65,7 +65,7 @@
+ #include "ui/display/screen_info.h"
+ #include "ui/gfx/geometry/quad_f.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/platform/fonts/font_cache.h"
+ #endif
+
+@@ -360,7 +360,7 @@ void LayoutView::UpdateLayout() {
+ DCHECK(!layout_state_);
+ LayoutState root_layout_state(*this);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The font code in FontPlatformData does not have a direct connection to the
+ // document, the frame or anything from which we could retrieve the device
+ // scale factor. After using zoom for DSF, the GraphicsContext does only ever
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_paint_paint__layer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_paint_paint__layer.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/paint/paint_layer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/paint/paint_layer.cc
+@@ -108,7 +108,7 @@ namespace {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ struct SameSizeAsPaintLayer : GarbageCollected<PaintLayer>, DisplayItemClient {
+ // The bit fields may fit into the machine word of DisplayItemClient which
+ // has only 8-bit data.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc
+@@ -151,7 +151,7 @@ bool ScrollbarThemeAura::SupportsDragSnapBack() const
+ // is true for at least GTK and QT apps).
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
+@@ -326,7 +326,7 @@ bool ScrollbarThemeAura::ShouldCenterOnThumb(const Scr
+ const WebMouseEvent& event) {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ if (event.button == WebPointerProperties::Button::kMiddle)
+ return true;
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_media_audio_audio__device__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_media_audio_audio__device__factory.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/modules/media/audio/audio_device_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/modules/media/audio/audio_device_factory.cc
+@@ -34,7 +34,7 @@ namespace {
+ namespace {
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Due to driver deadlock issues on Windows (http://crbug/422522) there is a
+ // chance device authorization response is never received from the browser side.
+ // In this case we will time out, to avoid renderer hang forever waiting for
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc
+@@ -678,7 +678,7 @@ TEST_F(AudioRendererMixerManagerTest, MixerParamsLaten
+ mixer->get_output_params_for_testing().sample_rate());
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Use 10 ms buffer (441 frames per buffer).
+ EXPECT_EQ(output_sample_rate / 100,
+ mixer->get_output_params_for_testing().frames_per_buffer());
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/modules/peerconnection/webrtc_audio_renderer_test.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/modules/peerconnection/webrtc_audio_renderer_test.cc
+@@ -288,7 +288,7 @@ TEST_F(MAYBE_WebRtcAudioRendererTest, DISABLED_VerifyS
+ SetupRenderer(kDefaultOutputDeviceId);
+ renderer_proxy_->Start();
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ static const int kExpectedBufferSize = kHardwareSampleRate / 100;
+ #elif BUILDFLAG(IS_ANDROID)
+ static const int kExpectedBufferSize = 2 * kHardwareSampleRate / 100;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/modules/webaudio/audio_worklet_thread_test.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/modules/webaudio/audio_worklet_thread_test.cc
+@@ -379,7 +379,7 @@ class AudioWorkletThreadPriorityTest
+
+ // TODO(crbug.com/1022888): The worklet thread priority is always NORMAL
+ // on OS_LINUX and OS_CHROMEOS regardless of the thread priority setting.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (expected_priority == base::ThreadPriority::REALTIME_AUDIO ||
+ expected_priority == base::ThreadPriority::DISPLAY) {
+ EXPECT_EQ(actual_priority, base::ThreadPriority::NORMAL);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
+@@ -6070,7 +6070,7 @@ void WebGLRenderingContextBase::TexImageHelperMediaVid
+ constexpr bool kAllowZeroCopyImages = true;
+ #endif
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/1175907): Only TexImage2D seems to work with the GPU path on
+ // Android M -- appears to work fine on R, but to avoid regressions in <video>
+ // limit to TexImage2D only for now. Fails conformance test on Nexus 5X:
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_webgl_webgl__webcodecs__video__frame.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_modules_webgl_webgl__webcodecs__video__frame.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/modules/webgl/webgl_webcodecs_video_frame.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/modules/webgl/webgl_webcodecs_video_frame.cc
+@@ -100,7 +100,7 @@ bool WebGLWebCodecsVideoFrame::Supported(WebGLRenderin
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // TODO(jie.a.chen@intel.com): Add Linux support.
+ return false;
+ #elif BUILDFLAG(IS_MAC)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn
+@@ -1922,7 +1922,7 @@ jumbo_static_library("test_support") {
+ ]
+
+ # fuzzed_data_provider may not work with a custom toolchain.
+- if (custom_toolchain == "" && is_clang) {
++ if ((custom_toolchain == "" && is_clang) && !is_bsd) {
+ sources += [
+ "testing/fuzzed_data_provider.cc",
+ "testing/fuzzed_data_provider.h",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__cache.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__cache.h
@@ -0,0 +1,47 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
+@@ -57,7 +57,7 @@
+ #include "third_party/skia/include/core/SkFontMgr.h"
+ #include "third_party/skia/include/core/SkRefCnt.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/font_fallback_linux.h"
+ #endif
+
+@@ -184,7 +184,7 @@ class PLATFORM_EXPORT FontCache final {
+ static void PrewarmFamily(const AtomicString& family_name) {}
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // These are needed for calling QueryRenderStyleForStrike, since
+ // gfx::GetFontRenderParams makes distinctions based on DSF.
+ static float DeviceScaleFactor() { return device_scale_factor_; }
+@@ -267,7 +267,7 @@ class PLATFORM_EXPORT FontCache final {
+ const char* locale_family_name);
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static bool GetFontForCharacter(UChar32,
+ const char* preferred_locale,
+ gfx::FallbackFontData*);
+@@ -347,7 +347,7 @@ class PLATFORM_EXPORT FontCache final {
+ const FontFaceCreationParams&,
+ std::string& name);
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static AtomicString GetFamilyNameForCharacter(SkFontMgr*,
+ UChar32,
+ const FontDescription&,
+@@ -389,7 +389,7 @@ class PLATFORM_EXPORT FontCache final {
+ std::unique_ptr<FallbackFamilyStyleCache> fallback_params_cache_;
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static float device_scale_factor_;
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__cache.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__cache.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.cc
+@@ -75,7 +75,7 @@ SkFontMgr* FontCache::static_font_manager_ = nullptr;
+
+ SkFontMgr* FontCache::static_font_manager_ = nullptr;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ float FontCache::device_scale_factor_ = 1.0;
+ #endif
+
+@@ -120,7 +120,7 @@ FontPlatformData* FontCache::SystemFontPlatformData(
+ FontPlatformData* FontCache::SystemFontPlatformData(
+ const FontDescription& font_description) {
+ const AtomicString& family = FontCache::SystemFontFamily();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ if (family.IsEmpty() || family == font_family_names::kSystemUi)
+ return nullptr;
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__description.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__description.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_description.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_description.cc
+@@ -39,7 +39,7 @@
+ #include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
+ #include "third_party/blink/renderer/platform/wtf/text/string_hasher.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/platform/fonts/font_cache.h"
+ #endif
+
+@@ -262,7 +262,7 @@ FontCacheKey FontDescription::CacheKey(
+ static_cast<unsigned>(fields_.orientation_) << 1 | // bit 2-3
+ static_cast<unsigned>(fields_.subpixel_text_position_); // bit 1
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ float device_scale_factor_for_key = FontCache::DeviceScaleFactor();
+ #else
+ float device_scale_factor_for_key = 1.0f;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__metrics.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__metrics.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_metrics.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_metrics.cc
+@@ -39,7 +39,7 @@ namespace blink {
+ namespace blink {
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // This is the largest VDMX table which we'll try to load and parse.
+ static const size_t kMaxVDMXTableSize = 1024 * 1024; // 1 MB
+ #endif
+@@ -69,7 +69,7 @@ void FontMetrics::AscentDescentWithHacks(
+ bool is_vdmx_valid = false;
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Manually digging up VDMX metrics is only applicable when bytecode hinting
+ // using FreeType. With DirectWrite or CoreText, no bytecode hinting is ever
+ // done. This code should be pushed into FreeType (hinted font metrics).
+@@ -117,7 +117,7 @@ void FontMetrics::AscentDescentWithHacks(
+ if (descent < metrics.fDescent) {
+ visual_overflow_inflation_for_descent = 1;
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // When subpixel positioning is enabled, if the descent is rounded down,
+ // the descent part of the glyph may be truncated when displayed in a
+ // 'overflow: hidden' container. To avoid that, borrow 1 unit from the
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc
+@@ -9,7 +9,7 @@
+ #if BUILDFLAG(IS_ANDROID)
+ #include "third_party/blink/public/mojom/font_unique_name_lookup/font_unique_name_lookup.mojom-blink.h"
+ #include "third_party/blink/renderer/platform/fonts/android/font_unique_name_lookup_android.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/platform/fonts/linux/font_unique_name_lookup_linux.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "third_party/blink/renderer/platform/fonts/win/font_unique_name_lookup_win.h"
+@@ -24,7 +24,7 @@ FontUniqueNameLookup::GetPlatformUniqueNameLookup() {
+ FontUniqueNameLookup::GetPlatformUniqueNameLookup() {
+ #if BUILDFLAG(IS_ANDROID)
+ return std::make_unique<FontUniqueNameLookupAndroid>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<FontUniqueNameLookupLinux>();
+ #elif BUILDFLAG(IS_WIN)
+ return std::make_unique<FontUniqueNameLookupWin>();
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
+@@ -60,7 +60,7 @@ AtomicString ToAtomicString(const SkString& str) {
+ return AtomicString::FromUTF8(str.c_str(), str.size());
+ }
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // This function is called on android or when we are emulating android fonts on
+ // linux and the embedder has overriden the default fontManager with
+ // WebFontRendering::setSkiaFontMgr.
+@@ -236,7 +236,7 @@ sk_sp<SkTypeface> FontCache::CreateTypeface(
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // On linux if the fontManager has been overridden then we should be calling
+ // the embedder provided font Manager rather than calling
+ // SkTypeface::CreateFromName which may redirect the call to the default font
+@@ -263,7 +263,7 @@ std::unique_ptr<FontPlatformData> FontCache::CreateFon
+ std::string name;
+
+ sk_sp<SkTypeface> typeface;
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool noto_color_emoji_from_gmscore = false;
+ #if BUILDFLAG(IS_ANDROID)
+ // Use the unique local matching pathway for fetching Noto Color Emoji Compat
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_graphics_begin__frame__provider.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_graphics_begin__frame__provider.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/begin_frame_provider.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/begin_frame_provider.cc
+@@ -75,7 +75,11 @@ void BeginFrameProvider::CreateCompositorFrameSinkIfNe
+
+ // Once we are using RAF, this thread is driving Display updates. Update
+ // priority accordingly.
++ // pledge(2)
++ // stop this baloney
++#if !defined(OS_OPENBSD)
+ base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
++#endif
+
+ mojo::Remote<mojom::blink::EmbeddedFrameSinkProvider> provider;
+ Platform::Current()->GetBrowserInterfaceBroker()->GetInterface(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_graphics_video__frame__submitter.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_graphics_video__frame__submitter.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc
+@@ -329,7 +329,7 @@ void VideoFrameSubmitter::OnBeginFrame(
+ continue;
+ auto& feedback =
+ timing_details.find(frame_token)->value.presentation_feedback;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO: On Linux failure flag is unreliable, and perfectly rendered frames
+ // are reported as failures all the time.
+ bool presentation_failure = false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_runtime__enabled__features.json5
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_runtime__enabled__features.json5
@@ -0,0 +1,62 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/runtime_enabled_features.json5.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/runtime_enabled_features.json5
+@@ -33,7 +33,7 @@
+ // shipped stable can have its runtime flag removed soon after.
+ status: {
+ valid_values: ["stable", "experimental", "test"],
+- valid_keys: ["Android", "Win", "ChromeOS_Ash", "ChromeOS_Lacros", "Mac", "Linux"]
++ valid_keys: ["Android", "Win", "ChromeOS_Ash", "ChromeOS_Lacros", "Mac", "Linux", "OpenBSD", "FreeBSD"]
+ },
+
+ // "implied_by" or "depends_on" specifies relationship to other features:
+@@ -1098,7 +1098,7 @@
+ depends_on: ["FileSystemAccess"],
+ status: {"Android": "test", "default": "experimental"},
+ origin_trial_feature_name: "FileHandling",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd"],
+ },
+ {
+ name: "FileHandlingIcons",
+@@ -2366,7 +2366,7 @@
+ {
+ name: "U2FSecurityKeyAPI",
+ origin_trial_feature_name: "U2FSecurityKeyAPI",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd"],
+ origin_trial_type: "deprecation",
+ },
+ {
+@@ -2385,7 +2385,7 @@
+ {
+ name: "UnrestrictedSharedArrayBuffer",
+ origin_trial_feature_name: "UnrestrictedSharedArrayBuffer",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd"],
+ },
+ {
+ name: "URLPattern",
+@@ -2411,7 +2411,7 @@
+ origin_trial_feature_name: "UserAgentReduction",
+ origin_trial_allows_third_party: true,
+ // iOS not included as it should not send a reduced User-Agent string.
+- origin_trial_os: ["android", "chromeos", "fuchsia", "linux", "mac", "win"],
++ origin_trial_os: ["android", "chromeos", "fuchsia", "linux", "mac", "win", "openbsd", "freebsd"],
+ },
+ {
+ name: "UUID",
+@@ -2537,12 +2537,12 @@
+ name: "WebAppUrlHandling",
+ status: "experimental",
+ origin_trial_feature_name: "WebAppUrlHandling",
+- origin_trial_os: ["win", "mac", "linux"],
++ origin_trial_os: ["win", "mac", "linux", "openbsd", "freebsd"],
+ },
+ {
+ name: "WebAppWindowControlsOverlay",
+ origin_trial_feature_name: "WebAppWindowControlsOverlay",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd"],
+ status: "experimental",
+ },
+ {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_scheduler_common_thread.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_scheduler_common_thread.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/scheduler/common/thread.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/scheduler/common/thread.cc
+@@ -99,7 +99,8 @@ void Thread::CreateAndSetCompositorThread() {
+ std::make_unique<scheduler::CompositorThread>(params);
+ compositor_thread->Init();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++// pledge(2)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_OPENBSD)
+ if (base::FeatureList::IsEnabled(
+ features::kBlinkCompositorUseDisplayThreadPriority)) {
+ compositor_thread->GetTaskRunner()->PostTaskAndReplyWithResult(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_container__annotations.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_container__annotations.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/container_annotations.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/container_annotations.h
+@@ -12,7 +12,7 @@
+ // TODO(ochang): Remove the ARCH_CPU_X86_64 condition to enable this for X86
+ // once the crashes there have been fixed: http://crbug.com/461406
+ #if defined(ADDRESS_SANITIZER) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ defined(ARCH_CPU_X86_64)
+
+ // Annotations require buffers to begin on an 8-byte boundary. See
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_math__extras.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_math__extras.h
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/math_extras.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/math_extras.h
+@@ -134,6 +134,9 @@ inline float RoundHalfTowardsPositiveInfinity(float va
+ inline float RoundHalfTowardsPositiveInfinity(float value) {
+ return std::floor(value + 0.5f);
+ }
++#if defined(OS_FREEBSD)
++#pragma clang diagnostic pop
++#endif
+
+ // ClampTo() is implemented by templated helper classes (to allow for partial
+ // template specialization) as well as several helper functions.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_stack__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_stack__util.cc
@@ -0,0 +1,37 @@
+--- src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -18,6 +18,11 @@ extern "C" void* __libc_stack_end; // NOLINT
+ extern "C" void* __libc_stack_end; // NOLINT
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include <sys/signal.h>
++#include <pthread_np.h>
++#endif
++
+ namespace WTF {
+
+ size_t GetUnderestimatedStackSize() {
+@@ -62,6 +67,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#elif BUILDFLAG(IS_OPENBSD)
++ return 512 * 1024;
+ #elif BUILDFLAG(IS_MAC)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -147,6 +154,13 @@ void* GetStackStart() {
+ ::GetCurrentThreadStackLimits(&lowLimit, &highLimit);
+ return reinterpret_cast<void*>(highLimit);
+ #endif
++#elif BUILDFLAG(IS_OPENBSD)
++ stack_t ss;
++ void *base;
++ int error = pthread_stackseg_np(pthread_self(), &ss);
++ CHECK(!error);
++ base = (void*)((size_t) ss.ss_sp - ss.ss_size);
++ return reinterpret_cast<uint8_t*>(base) + ss.ss_size;
+ #else
+ #error Unsupported getStackStart on this platform.
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.generated.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.generated.gni
@@ -0,0 +1,18 @@
+--- src/3rdparty/chromium/third_party/boringssl/BUILD.generated.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/boringssl/BUILD.generated.gni
+@@ -81,6 +81,7 @@ crypto_sources = [
+ "src/crypto/cpu_aarch64_apple.c",
+ "src/crypto/cpu_aarch64_fuchsia.c",
+ "src/crypto/cpu_aarch64_linux.c",
++ "src/crypto/cpu_aarch64_openbsd.c",
+ "src/crypto/cpu_aarch64_win.c",
+ "src/crypto/cpu_arm.c",
+ "src/crypto/cpu_arm_linux.c",
+@@ -186,6 +187,7 @@ crypto_sources = [
+ "src/crypto/rand_extra/deterministic.c",
+ "src/crypto/rand_extra/forkunsafe.c",
+ "src/crypto/rand_extra/fuchsia.c",
++ "src/crypto/rand_extra/arc4random.c",
+ "src/crypto/rand_extra/passive.c",
+ "src/crypto/rand_extra/rand_extra.c",
+ "src/crypto/rand_extra/windows.c",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/boringssl/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/boringssl/BUILD.gn
+@@ -92,7 +92,7 @@ if (is_win && !is_msan && current_cpu != "arm64") {
+ public_configs = [ ":no_asm_config" ]
+ }
+ } else if (current_cpu == "arm64") {
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux || is_chromeos || is_android) && !is_freebsd) {
+ sources += crypto_sources_linux_aarch64
+ } else if (is_apple) {
+ sources += crypto_sources_apple_aarch64
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_cpu__aarch64__openbsd.c
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_cpu__aarch64__openbsd.c
@@ -0,0 +1,60 @@
+--- src/3rdparty/chromium/third_party/boringssl/src/crypto/cpu_aarch64_openbsd.c.orig 2022-11-06 22:06:35 UTC
++++ src/3rdparty/chromium/third_party/boringssl/src/crypto/cpu_aarch64_openbsd.c
+@@ -0,0 +1,57 @@
++/* Copyright (c) 2022, Robert Nagy <robert@openbsd.org>
++ *
++ * Permission to use, copy, modify, and/or distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
++ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
++ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
++ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
++
++#include <openssl/cpu.h>
++
++#if defined(OPENSSL_AARCH64) && defined(OPENSSL_OPENBSD) && \
++ !defined(OPENSSL_STATIC_ARMCAP)
++
++#include <sys/sysctl.h>
++#include <machine/cpu.h>
++#include <machine/armreg.h>
++#include <stdio.h>
++
++#include <openssl/arm_arch.h>
++
++#include "internal.h"
++
++extern uint32_t OPENSSL_armcap_P;
++
++void OPENSSL_cpuid_setup(void) {
++ int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 };
++ size_t len = sizeof(uint64_t);
++ uint64_t cpu_id = 0;
++
++ if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) < 0)
++ return;
++
++ OPENSSL_armcap_P |= ARMV7_NEON;
++
++ if (ID_AA64ISAR0_AES(cpu_id) >= ID_AA64ISAR0_AES_BASE)
++ OPENSSL_armcap_P |= ARMV8_AES;
++
++ if (ID_AA64ISAR0_AES(cpu_id) >= ID_AA64ISAR0_AES_PMULL)
++ OPENSSL_armcap_P |= ARMV8_PMULL;
++
++ if (ID_AA64ISAR0_SHA1(cpu_id) >= ID_AA64ISAR0_SHA1_BASE)
++ OPENSSL_armcap_P |= ARMV8_SHA1;
++
++ if (ID_AA64ISAR0_SHA2(cpu_id) >= ID_AA64ISAR0_SHA2_BASE)
++ OPENSSL_armcap_P |= ARMV8_SHA256;
++
++ if (ID_AA64ISAR0_SHA2(cpu_id) >= ID_AA64ISAR0_SHA2_512)
++ OPENSSL_armcap_P |= ARMV8_SHA512;
++}
++
++#endif // OPENSSL_AARCH64 && OPENSSL_OPENBSD && !OPENSSL_STATIC_ARMCAP
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_fipsmodule_rand_internal.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_fipsmodule_rand_internal.h
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/internal.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/internal.h
+@@ -26,7 +26,8 @@ extern "C" {
+
+
+ #if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_FUCHSIA) && \
+- !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY)
++ !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) && \
++ !defined(OPENSSL_ARC4RANDOM)
+ #define OPENSSL_URANDOM
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_rand__extra_arc4random.c
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_rand__extra_arc4random.c
@@ -0,0 +1,36 @@
+--- src/3rdparty/chromium/third_party/boringssl/src/crypto/rand_extra/arc4random.c.orig 2022-11-06 22:06:35 UTC
++++ src/3rdparty/chromium/third_party/boringssl/src/crypto/rand_extra/arc4random.c
+@@ -0,0 +1,33 @@
++/* Copyright (c) 2018, Robert Nagy <robert@openbsd.org>
++ *
++ * Permission to use, copy, modify, and/or distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
++ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
++ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
++ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
++
++#define _BSD_SOURCE 1
++
++#include <openssl/rand.h>
++
++#if defined(OPENSSL_ARC4RANDOM) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE)
++
++#include <stdlib.h>
++
++#include "../fipsmodule/rand/internal.h"
++
++void CRYPTO_sysrand_for_seed(uint8_t *out, size_t requested) {
++ CRYPTO_sysrand(out, requested);
++}
++
++void CRYPTO_sysrand(uint8_t *out, size_t requested) {
++ arc4random_buf(out, requested);
++}
++
++#endif // OPENSSL_ARC4RANDOM && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_refcount__c11.c
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_refcount__c11.c
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/boringssl/src/crypto/refcount_c11.c.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/boringssl/src/crypto/refcount_c11.c
+@@ -24,6 +24,9 @@
+
+ #include <openssl/type_check.h>
+
++#if !defined(__cplusplus) && !defined(static_assert)
++#define static_assert _Static_assert
++#endif
+
+ // See comment above the typedef of CRYPTO_refcount_t about these tests.
+ static_assert(alignof(CRYPTO_refcount_t) == alignof(_Atomic CRYPTO_refcount_t),
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_base.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_base.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
+@@ -153,6 +153,11 @@ extern "C" {
+ #define OPENSSL_FUCHSIA
+ #endif
+
++#if defined(__OpenBSD__)
++#define OPENSSL_OPENBSD
++#define OPENSSL_ARC4RANDOM
++#endif
++
+ #if defined(__TRUSTY__)
+ #define OPENSSL_TRUSTY
+ #define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_thread.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_thread.h
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/third_party/boringssl/src/include/openssl/thread.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/boringssl/src/include/openssl/thread.h
+@@ -78,6 +78,7 @@ typedef union crypto_mutex_st {
+ void *handle;
+ } CRYPTO_MUTEX;
+ #elif !defined(__GLIBC__)
++#include <pthread.h>
+ typedef pthread_rwlock_t CRYPTO_MUTEX;
+ #else
+ // On glibc, |pthread_rwlock_t| is hidden under feature flags, and we can't
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_build_crashpad__buildconfig.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_build_crashpad__buildconfig.gni
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/build/crashpad_buildconfig.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/build/crashpad_buildconfig.gni
+@@ -58,7 +58,7 @@ if (crashpad_is_in_chromium) {
+ crashpad_is_mac = is_mac
+ crashpad_is_ios = is_ios
+ crashpad_is_win = is_win
+- crashpad_is_linux = is_linux || is_chromeos
++ crashpad_is_linux = (is_linux || is_chromeos) && !is_bsd
+ crashpad_is_android = is_android
+ crashpad_is_fuchsia = is_fuchsia
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_client_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_client_BUILD.gn
@@ -0,0 +1,16 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/client/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/client/BUILD.gn
+@@ -130,6 +130,13 @@ static_library("common") {
+ if (crashpad_is_win) {
+ sources += [ "crash_report_database_win.cc" ]
+ }
++
++ if (crashpad_is_posix) {
++ sources += [
++ "crashpad_client_posix.cc",
++ ]
++ }
++
+ if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
+ sources += [
+ "crash_report_database_generic.cc",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_client_crashpad__client__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_client_crashpad__client__posix.cc
@@ -0,0 +1,43 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/client/crashpad_client_posix.cc.orig 2022-11-08 06:37:22 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/client/crashpad_client_posix.cc
+@@ -0,0 +1,40 @@
++// Copyright 2017 The Crashpad Authors. All rights reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++// http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "client/crashpad_client.h"
++
++#include "base/logging.h"
++#include "base/notreached.h"
++
++namespace crashpad {
++
++CrashpadClient::CrashpadClient() {}
++
++CrashpadClient::~CrashpadClient() {}
++
++bool CrashpadClient::StartHandler(
++ const base::FilePath& handler,
++ const base::FilePath& database,
++ const base::FilePath& metrics_dir,
++ const std::string& url,
++ const std::map<std::string, std::string>& annotations,
++ const std::vector<std::string>& arguments,
++ bool restartable,
++ bool asynchronous_start,
++ const std::vector<base::FilePath>& attachments) {
++ NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
++ return false;
++}
++
++} // namespace crashpad
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc
@@ -0,0 +1,13 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
+@@ -119,6 +119,10 @@ std::string MinidumpMiscInfoDebugBuildString() {
+ static constexpr char kOS[] = "win";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ static constexpr char kOS[] = "fuchsia";
++#elif defined(OS_OPENBSD)
++ static constexpr char kOS[] = "openbsd";
++#elif defined(OS_FREEBSD)
++ static constexpr char kOS[] = "freebsd";
+ #else
+ #error define kOS for this operating system
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_address__types.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_address__types.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/address_types.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/address_types.h
+@@ -25,7 +25,7 @@
+ #include <mach/mach_types.h>
+ #elif BUILDFLAG(IS_WIN)
+ #include "util/win/address_types.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "util/linux/address_types.h"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include <zircon/types.h>
+@@ -55,7 +55,7 @@ using VMSize = WinVMSize;
+ using VMAddress = WinVMAddress;
+ using VMSize = WinVMSize;
+
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+
+ using VMAddress = LinuxVMAddress;
+ using VMSize = LinuxVMSize;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_capture__context.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_capture__context.h
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
+@@ -21,7 +21,8 @@
+ #include <mach/mach.h>
+ #elif BUILDFLAG(IS_WIN)
+ #include <windows.h>
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
++ BUILDFLAG(IS_FREEBSD)
+ #include <ucontext.h>
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include <signal.h>
+@@ -38,7 +39,8 @@ using NativeCPUContext = CONTEXT;
+ #elif BUILDFLAG(IS_WIN)
+ using NativeCPUContext = CONTEXT;
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+ using NativeCPUContext = ucontext_t;
+ #endif // BUILDFLAG(IS_APPLE)
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_metrics.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_metrics.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/metrics.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/metrics.cc
+@@ -25,7 +25,7 @@
+ #define METRICS_OS_NAME "Win"
+ #elif BUILDFLAG(IS_ANDROID)
+ #define METRICS_OS_NAME "Android"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define METRICS_OS_NAME "Linux"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #define METRICS_OS_NAME "Fuchsia"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_uuid.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_misc_uuid.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/uuid.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/uuid.cc
+@@ -101,7 +101,7 @@ bool UUID::InitializeWithNew() {
+ InitializeFromBytes(uuid);
+ return true;
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Linux, Android, and Fuchsia do not provide a UUID generator in a
+ // widely-available system library. On Linux and Android, uuid_generate()
+ // from libuuid is not available everywhere.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_close__multiple.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_close__multiple.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/close_multiple.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/close_multiple.cc
+@@ -72,7 +72,7 @@ bool CloseMultipleNowOrOnExecUsingFDDir(int min_fd, in
+ // This is an advantage over looping over all possible file descriptors, because
+ // no attempt needs to be made to close file descriptors that are not open.
+ bool CloseMultipleNowOrOnExecUsingFDDir(int min_fd, int preserve_fd) {
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ static constexpr char kFDDir[] = "/dev/fd";
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ static constexpr char kFDDir[] = "/proc/self/fd";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_drop__privileges.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_drop__privileges.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/drop_privileges.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/drop_privileges.cc
+@@ -25,7 +25,7 @@ void DropPrivileges() {
+ gid_t gid = getgid();
+ uid_t uid = getuid();
+
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // Based on the POSIX.1-2008 2013 edition documentation for setreuid() and
+ // setregid(), setreuid() and setregid() alone should be sufficient to drop
+ // privileges. The standard specifies that the saved ID should be set to the
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_signals.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_signals.cc
@@ -0,0 +1,33 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals.cc
+@@ -51,7 +51,7 @@ constexpr int kCrashSignals[] = {
+ #if defined(SIGEMT)
+ SIGEMT,
+ #endif // defined(SIGEMT)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SIGXCPU,
+ SIGXFSZ,
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -91,7 +91,7 @@ constexpr int kTerminateSignals[] = {
+ SIGXCPU,
+ SIGXFSZ,
+ #endif // BUILDFLAG(IS_APPLE)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SIGIO,
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ };
+@@ -232,8 +232,12 @@ bool Signals::WillSignalReraiseAutonomously(const sigi
+ // remains. See 10.12.3 xnu-3789.41.3/bsd/kern/kern_sig.c
+ // psignal_internal().
+ (code > 0 &&
++#if defined(SI_ASYNCIO)
+ code != SI_ASYNCIO &&
++#endif
++#if defined(SI_MESGQ)
+ code != SI_MESGQ &&
++#endif
+ code != SI_QUEUE &&
+ code != SI_TIMER &&
+ code != SI_USER &&
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc
+@@ -67,7 +67,7 @@ constexpr const char* kSignalNames[] = {
+ "INFO",
+ "USR1",
+ "USR2",
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #if defined(ARCH_CPU_MIPS_FAMILY)
+ "HUP",
+ "INT",
+@@ -138,7 +138,7 @@ constexpr const char* kSignalNames[] = {
+ #endif // defined(ARCH_CPU_MIPS_FAMILY)
+ #endif
+ };
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // NSIG is 64 to account for real-time signals.
+ static_assert(std::size(kSignalNames) == 32, "kSignalNames length");
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_generator_dawn__version__generator.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_generator_dawn__version__generator.py
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/dawn/generator/dawn_version_generator.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/dawn/generator/dawn_version_generator.py
+@@ -27,11 +27,14 @@ def get_gitHash(dawnDir):
+
+
+ def get_gitHash(dawnDir):
+- result = subprocess.run([get_git(), 'rev-parse', 'HEAD'],
+- stdout=subprocess.PIPE,
+- cwd=dawnDir)
+- if result.returncode == 0:
+- return result.stdout.decode('utf-8').strip()
++ try:
++ result = subprocess.run([get_git(), "rev-parse", "HEAD"],
++ stdout=subprocess.PIPE,
++ cwd=dawnDir)
++ if result.returncode == 0:
++ return result.stdout.decode("utf-8").strip()
++ except Exception:
++ return ""
+ # No hash was available (possibly) because the directory was not a git checkout. Dawn should
+ # explicitly handle its absenece and disable features relying on the hash, i.e. caching.
+ return ''
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_include_dawn_native_VulkanBackend.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_include_dawn_native_VulkanBackend.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/dawn/include/dawn/native/VulkanBackend.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/dawn/include/dawn/native/VulkanBackend.h
+@@ -69,7 +69,7 @@ namespace dawn::native::vulkan {
+ };
+
+ // Can't use DAWN_PLATFORM_LINUX since header included in both Dawn and Chrome
+-#ifdef __linux__
++#if defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+
+ // Common properties of external images represented by FDs. On successful import the file
+ // descriptor's ownership is transferred to the Dawn implementation and they shouldn't be
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_src_dawn_common_Platform.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_src_dawn_common_Platform.h
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/third_party/dawn/src/dawn/common/Platform.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/dawn/src/dawn/common/Platform.h
+@@ -26,6 +26,11 @@
+ # error "Unsupported Windows platform."
+ # endif
+
++#elif defined(__OpenBSD__) || defined(__FreeBSD__)
++# define DAWN_PLATFORM_BSD 1
++# define DAWN_PLATFORM_LINUX 1
++# define DAWN_PLATFORM_POSIX 1
++
+ #elif defined(__linux__)
+ # define DAWN_PLATFORM_LINUX 1
+ # define DAWN_PLATFORM_POSIX 1
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp
+@@ -37,7 +37,7 @@ constexpr char kSwiftshaderLibName[] = "libvk_swiftsha
+ #endif
+
+ #if defined(DAWN_PLATFORM_LINUX)
+-# if defined(DAWN_PLATFORM_ANDROID)
++# if defined(DAWN_PLATFORM_ANDROID) || defined(DAWN_PLATFORM_BSD)
+ constexpr char kVulkanLibName[] = "libvulkan.so";
+ # else
+ constexpr char kVulkanLibName[] = "libvulkan.so.1";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_harfbuzz-ng_harfbuzz.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_harfbuzz-ng_harfbuzz.gni
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/harfbuzz-ng/harfbuzz.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/harfbuzz-ng/harfbuzz.gni
+@@ -3,12 +3,13 @@ declare_args() {
+ # found in the LICENSE file.
+
+ declare_args() {
+- # Blink uses a cutting-edge version of Harfbuzz; most Linux distros do not
+- # contain a new enough version of the code to work correctly. However,
+- # ChromeOS chroots (i.e, real ChromeOS builds for devices) do contain a
+- # new enough version of the library, and so this variable exists so that
+- # ChromeOS can build against the system lib and keep binary sizes smaller.
+- use_system_harfbuzz = false
++ # Blink uses a cutting-edge version of Harfbuzz (version listed in
++ # third_party/harfbuzz-ng/README.chromium); most Linux distros do not contain
++ # a new enough version of the code to work correctly. However, ChromeOS
++ # chroots (i.e. real ChromeOS builds for devices) do contain a new enough
++ # version of the library, and so this variable exists so that ChromeOS can
++ # build against the system lib and keep binary sizes smaller.
++ use_system_harfbuzz = true
+ use_qt_harfbuzz = false
+ qt_harfbuzz_config = ""
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_libsync_src_include_sync_sync.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_libsync_src_include_sync_sync.h
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/libsync/src/include/sync/sync.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/libsync/src/include/sync/sync.h
+@@ -22,7 +22,9 @@
+ #include <sys/cdefs.h>
+ #include <stdint.h>
+
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
+ #include <linux/types.h>
++#endif
+
+ __BEGIN_DECLS
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_libsync_src_sync.c
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_libsync_src_sync.c
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/third_party/libsync/src/sync.c.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/libsync/src/sync.c
+@@ -17,7 +17,9 @@
+ */
+
+ #include <fcntl.h>
++#if !defined(__OpenBSD__)
+ #include <malloc.h>
++#endif
+ #include <stdint.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -29,6 +31,12 @@
+
+ #include <sync/sync.h>
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
++typedef __uint8_t __u8;
++typedef __uint32_t __u32;
++typedef __int32_t __s32;
++#define ETIME ETIMEDOUT
++#endif
+
+ struct sw_sync_create_fence_data {
+ __u32 value;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_nasm_config_config-linux.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_nasm_config_config-linux.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/third_party/nasm/config/config-linux.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
+@@ -183,7 +183,7 @@
+ #define HAVE_DECL_STRSEP 1
+
+ /* Define to 1 if you have the <endian.h> header file. */
+-#define HAVE_ENDIAN_H 1
++/* #undef HAVE_ENDIAN_H */
+
+ /* Define to 1 if you have the `faccessat' function. */
+ #define HAVE_FACCESSAT 1
+@@ -411,7 +411,7 @@
+ #define HAVE_SYSCONF 1
+
+ /* Define to 1 if you have the <sys/endian.h> header file. */
+-/* #undef HAVE_SYS_ENDIAN_H */
++#define HAVE_SYS_ENDIAN_H 1
+
+ /* Define to 1 if you have the <sys/mman.h> header file. */
+ #define HAVE_SYS_MMAN_H 1
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_core_fxcrt_cfx__datetime.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_core_fxcrt_cfx__datetime.cpp
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/pdfium/core/fxcrt/cfx_datetime.cpp.orig 2022-11-06 22:18:10 UTC
++++ src/3rdparty/chromium/third_party/pdfium/core/fxcrt/cfx_datetime.cpp
+@@ -11,7 +11,7 @@
+ #include "third_party/base/check.h"
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_APPLE) || defined(OS_ASMJS)
++ BUILDFLAG(IS_APPLE) || defined(OS_ASMJS) || BUILDFLAG(IS_BSD)
+ #include <sys/time.h>
+ #include <time.h>
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_core_fxge_cfx__fontmapper.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_core_fxge_cfx__fontmapper.cpp
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/pdfium/core/fxge/cfx_fontmapper.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/pdfium/core/fxge/cfx_fontmapper.cpp
+@@ -155,7 +155,7 @@ constexpr AltFontFamily kAltFontFamilies[] = {
+ {"ForteMT", "Forte"},
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(OS_ASMJS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(OS_ASMJS) || BUILDFLAG(IS_BSD)
+ const char kNarrowFamily[] = "LiberationSansNarrow";
+ #elif BUILDFLAG(IS_ANDROID)
+ const char kNarrowFamily[] = "RobotoCondensed";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp
+@@ -18,7 +18,7 @@
+ #include "third_party/base/cxx17_backports.h"
+
+ #if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !defined(OS_FUCHSIA) && \
+- !defined(OS_ASMJS)
++ !defined(OS_ASMJS) && !BUILDFLAG(IS_BSD)
+ #error "Included on the wrong platform"
+ #endif
+
+@@ -166,10 +166,9 @@ class CLinuxPlatform : public CFX_GEModule::PlatformIf
+ std::unique_ptr<SystemFontInfoIface> CreateDefaultSystemFontInfo() override {
+ auto pInfo = std::make_unique<CFX_LinuxFontInfo>();
+ if (!pInfo->ParseFontCfg(CFX_GEModule::Get()->GetUserFontPaths())) {
+- pInfo->AddPath("/usr/share/fonts");
+- pInfo->AddPath("/usr/share/X11/fonts/Type1");
+- pInfo->AddPath("/usr/share/X11/fonts/TTF");
+- pInfo->AddPath("/usr/local/share/fonts");
++ pInfo->AddPath("/usr/X11R6/lib/X11/fonts/Type1");
++ pInfo->AddPath("/usr/X11R6/lib/X11/fonts/TTF");
++ pInfo->AddPath("%%LOCALBASE%%/share/fonts");
+ }
+ return pInfo;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_fxjs_fx__date__helpers.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_fxjs_fx__date__helpers.cpp
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp
+@@ -36,6 +36,11 @@ double GetLocalTZA() {
+ return 0;
+ time_t t = 0;
+ FXSYS_time(&t);
++#ifdef __FreeBSD__
++ struct tm lt;
++ localtime_r(&t, &lt);
++ return (double)(-(lt.tm_gmtoff * 1000));
++#else
+ FXSYS_localtime(&t);
+ #if BUILDFLAG(IS_WIN)
+ // In gcc 'timezone' is a global variable declared in time.h. In VC++, that
+@@ -44,6 +49,7 @@ double GetLocalTZA() {
+ _get_timezone(&timezone);
+ #endif
+ return (double)(-(timezone * 1000));
++#endif // __FreeBSD__
+ }
+
+ int GetDaylightSavingTA(double d) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp
@@ -0,0 +1,41 @@
+--- src/3rdparty/chromium/third_party/pdfium/xfa/fxfa/parser/cxfa_timezoneprovider.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/pdfium/xfa/fxfa/parser/cxfa_timezoneprovider.cpp
+@@ -6,12 +6,16 @@
+
+ #include "xfa/fxfa/parser/cxfa_timezoneprovider.h"
+
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <time.h>
+
+ #include "build/build_config.h"
+
+ static bool g_bProviderTimeZoneSet = false;
++#if defined(OS_FREEBSD)
++static long g_lTimeZoneOffset = 0;
++#endif
+
+ #if BUILDFLAG(IS_WIN)
+ #define TIMEZONE _timezone
+@@ -24,9 +28,21 @@ CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() {
+ CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() {
+ if (!g_bProviderTimeZoneSet) {
+ g_bProviderTimeZoneSet = true;
++#if defined(OS_FREEBSD)
++ time_t now = time(nullptr);
++ struct tm tm = {};
++
++ localtime_r(&now, &tm);
++ g_lTimeZoneOffset = tm.tm_gmtoff;
++#else
+ TZSET();
++#endif
+ }
++#if defined(OS_FREEBSD)
++ tz_minutes_ = static_cast<int8_t>((abs(g_lTimeZoneOffset) % 3600) / 60);
++#else
+ tz_minutes_ = TIMEZONE / -60;
++#endif
+ }
+
+ CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() = default;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_base_build__config.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_base_build__config.h
@@ -0,0 +1,66 @@
+--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/build_config.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/build_config.h
+@@ -27,6 +27,7 @@
+ #if defined(__ANDROID__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -38,6 +39,7 @@
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+@@ -51,9 +53,10 @@
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+ #endif
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 1
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -64,6 +67,8 @@
+ #elif defined(_WIN32)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -74,6 +79,8 @@
+ #elif defined(__EMSCRIPTEN__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -87,6 +94,8 @@
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 1
+@@ -94,6 +103,8 @@
+ #elif defined(__native_client__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_base_thread__utils.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_base_thread__utils.h
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/thread_utils.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/thread_utils.h
+@@ -34,6 +34,7 @@ __declspec(dllimport) unsigned long __stdcall GetCurre
+ #include <sys/syscall.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <pthread.h>
+ #else
+ #include <pthread.h>
+ #endif
+@@ -45,6 +46,11 @@ inline PlatformThreadId GetThreadId() {
+ using PlatformThreadId = pid_t;
+ inline PlatformThreadId GetThreadId() {
+ return gettid();
++}
++#elif PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
++using PlatformThreadId = uint64_t;
++inline PlatformThreadId GetThreadId() {
++ return reinterpret_cast<uint64_t>(pthread_self());
+ }
+ #elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
+ using PlatformThreadId = pid_t;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_base_time.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_base_time.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/time.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/time.h
+@@ -142,6 +142,9 @@ inline TimeNanos GetBootTimeNs() {
+ // Return ns from boot. Conversely to GetWallTimeNs, this clock counts also time
+ // during suspend (when supported).
+ inline TimeNanos GetBootTimeNs() {
++#if defined(__FreeBSD__)
++ return GetTimeInternalNs(kWallTimeClockSource);
++#else
+ // Determine if CLOCK_BOOTTIME is available on the first call.
+ static const clockid_t kBootTimeClockSource = [] {
+ struct timespec ts = {};
+@@ -149,6 +152,7 @@ inline TimeNanos GetBootTimeNs() {
+ return res == 0 ? CLOCK_BOOTTIME : kWallTimeClockSource;
+ }();
+ return GetTimeInternalNs(kBootTimeClockSource);
++#endif
+ }
+
+ inline TimeNanos GetWallTimeNs() {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_event__fd.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_event__fd.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/event_fd.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/event_fd.h
+@@ -55,6 +55,8 @@ class EventFd {
+ // On Mac and other non-Linux UNIX platforms a pipe-based fallback is used.
+ // The write end of the wakeup pipe.
+ ScopedFile write_fd_;
++#else
++ ScopedFile write_fd_;
+ #endif
+ };
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_thread__utils.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_thread__utils.h
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/thread_utils.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -40,9 +40,10 @@ namespace base {
+ namespace perfetto {
+ namespace base {
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++ PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ // Sets the "comm" of the calling thread to the first 15 chars of the given
+ // string.
+ inline bool MaybeSetThreadName(const std::string& name) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_event__fd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_event__fd.cc
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/base/event_fd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/base/event_fd.cc
+@@ -22,7 +22,8 @@
+ #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+ #include <Windows.h>
+ #include <synchapi.h>
+-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#elif (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+ #include <sys/eventfd.h>
+ #include <unistd.h>
+@@ -57,7 +58,8 @@ void EventFd::Clear() {
+ PERFETTO_DFATAL("EventFd::Clear()");
+ }
+
+-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#elif (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+
+ EventFd::EventFd() {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_periodic__task.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_periodic__task.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/base/periodic_task.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/base/periodic_task.cc
+@@ -24,7 +24,7 @@
+ #include "perfetto/base/time.h"
+ #include "perfetto/ext/base/file_utils.h"
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && __ANDROID_API__ >= 19)
+ #include <sys/timerfd.h>
+ #endif
+@@ -34,7 +34,7 @@ base::ScopedPlatformHandle CreateTimerFd(uint32_t peri
+
+ namespace {
+ base::ScopedPlatformHandle CreateTimerFd(uint32_t period_ms) {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && __ANDROID_API__ >= 19)
+ base::ScopedPlatformHandle tfd(
+ timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK));
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_string__utils.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_string__utils.cc
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/base/string_utils.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/base/string_utils.cc
+@@ -36,9 +36,10 @@ double StrToD(const char* nptr, char** endptr) {
+
+ // Locale-independant as possible version of strtod.
+ double StrToD(const char* nptr, char** endptr) {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++ PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ static auto c_locale = newlocale(LC_ALL, "C", nullptr);
+ return strtod_l(nptr, endptr, c_locale);
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_subprocess__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_subprocess__posix.cc
@@ -0,0 +1,22 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/base/subprocess_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/base/subprocess_posix.cc
+@@ -35,7 +35,8 @@
+ #include <thread>
+ #include <tuple>
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+ #include <sys/prctl.h>
+ #endif
+@@ -64,7 +65,8 @@ void __attribute__((noreturn)) ChildProcess(ChildProce
+ // Don't add any dynamic allocation in this function. This will be invoked
+ // under a fork(), potentially in a state where the allocator lock is held.
+ void __attribute__((noreturn)) ChildProcess(ChildProcessArgs* args) {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+ // In no case we want a child process to outlive its parent process. This is
+ // relevant for tests, so that a test failure/crash doesn't leave child
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_thread__task__runner.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_thread__task__runner.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/base/thread_task_runner.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/base/thread_task_runner.cc
+@@ -27,8 +27,9 @@
+ #include "perfetto/ext/base/thread_utils.h"
+ #include "perfetto/ext/base/unix_task_runner.h"
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ #include <sys/prctl.h>
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_unix__socket.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_base_unix__socket.cc
@@ -0,0 +1,26 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/base/unix_socket.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/base/unix_socket.cc
+@@ -42,7 +42,7 @@
+ #include <unistd.h>
+ #endif
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) || defined(__FreeBSD__)
+ #include <sys/ucred.h>
+ #endif
+
+@@ -791,9 +791,13 @@ void UnixSocket::ReadPeerCredentialsPosix() {
+ return;
+ PERFETTO_CHECK(peer_cred_mode_ != SockPeerCredMode::kIgnore);
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if !defined(__FreeBSD__) && PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
++ struct sockpeercred user_cred;
++#else
+ struct ucred user_cred;
++#endif
+ socklen_t len = sizeof(user_cred);
+ int fd = sock_raw_.fd();
+ int res = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &user_cred, &len);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_tracing_core_tracing__service__impl.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_src_tracing_core_tracing__service__impl.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/perfetto/src/tracing/core/tracing_service_impl.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/perfetto/src/tracing/core/tracing_service_impl.cc
+@@ -3040,7 +3040,8 @@ bool TracingServiceImpl::SnapshotClocks(
+
+ #if !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) && \
+ !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+- !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ struct {
+ clockid_t id;
+ protos::pbzero::BuiltinClock type;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_core_SkCpu.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_core_SkCpu.cpp
@@ -0,0 +1,45 @@
+--- src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp
+@@ -73,6 +73,42 @@
+ return features;
+ }
+
++#elif defined(SK_CPU_ARM64) && defined(__OpenBSD__)
++ #include <sys/sysctl.h>
++ #include <machine/cpu.h>
++ #include <machine/armreg.h>
++
++ static uint32_t read_cpu_features() {
++ int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 };
++ size_t len = sizeof(uint64_t);
++ uint64_t cpu_id = 0;
++ uint32_t features = 0;
++
++ if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) == 0) {
++ if (ID_AA64ISAR0_CRC32(cpu_id) >= ID_AA64ISAR0_CRC32_BASE)
++ features |= SkCpu::CRC32;
++ }
++
++ return features;
++ }
++
++#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
++ #include <machine/armreg.h>
++ #ifndef ID_AA64ISAR0_CRC32_VAL
++ #define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
++ #endif
++
++ static uint32_t read_cpu_features() {
++ uint32_t features = 0;
++ uint64_t id_aa64isar0;
++
++ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
++ features |= SkCpu::CRC32;
++ }
++ return features;
++ }
++
+ #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
+ #include <sys/auxv.h>
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_ports_SkOSFile__posix.cpp
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_ports_SkOSFile__posix.cpp
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/skia/src/ports/SkOSFile_posix.cpp.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/skia/src/ports/SkOSFile_posix.cpp
+@@ -25,7 +25,7 @@ void sk_fsync(FILE* f) {
+ #endif
+
+ void sk_fsync(FILE* f) {
+-#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) && !defined(_NEWLIB_VERSION)
++#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) && !defined(_NEWLIB_VERSION) && !defined(__OpenBSD__)
+ int fd = fileno(f);
+ fsync(fd);
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_wayland_features.gni
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_wayland_features.gni
@@ -0,0 +1,17 @@
+--- src/3rdparty/chromium/third_party/wayland/features.gni.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/wayland/features.gni
+@@ -13,8 +13,12 @@ declare_args() {
+ default_toolchain != "//build/toolchain/cros:target"
+
+ # Path to wayland-scanner. Has effect only when the system libwayland is used.
+- assert(host_os == "linux")
+- system_wayland_scanner_path = "/usr/bin/wayland-scanner"
++ assert(host_os == "linux" || host_os == "freebsd")
++ if (is_bsd) {
++ system_wayland_scanner_path = "%%LOCALBASE%%/bin/wayland-scanner"
++ } else {
++ system_wayland_scanner_path = "/usr/bin/wayland-scanner"
++ }
+
+ # This may be set by Chromium packagers who do not wish to use the bundled
+ # wayland scanner.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_BUILD.gn
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/webrtc/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/BUILD.gn
+@@ -203,6 +203,9 @@ config("common_inherited_config") {
+ if (is_linux || is_chromeos) {
+ defines += [ "WEBRTC_LINUX" ]
+ }
++ if (is_bsd) {
++ defines += [ "WEBRTC_BSD" ]
++ }
+ if (is_mac) {
+ defines += [ "WEBRTC_MAC" ]
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_modules_audio__device_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_modules_audio__device_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/webrtc/modules/audio_device/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/modules/audio_device/BUILD.gn
+@@ -287,7 +287,7 @@ rtc_library("audio_device_impl") {
+ if (rtc_use_dummy_audio_file_devices) {
+ defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ]
+ } else {
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "linux/alsasymboltable_linux.cc",
+ "linux/alsasymboltable_linux.h",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc
+@@ -212,6 +212,12 @@ void XServerPixelBuffer::InitShm(const XWindowAttribut
+ void XServerPixelBuffer::InitShm(const XWindowAttributes& attributes) {
+ Visual* default_visual = attributes.visual;
+ int default_depth = attributes.depth;
++#if defined(__OpenBSD__)
++// pledge(2)
++ RTC_LOG(LS_WARNING) << "Unable to use shmget(2) while using pledge(2). "
++ "Performance may be degraded.";
++ return;
++#endif
+
+ int major, minor;
+ Bool have_pixmaps;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/BUILD.gn
+@@ -1106,7 +1106,7 @@ rtc_library("rtc_base") {
+ sources += [ "mac_ifaddrs_converter.cc" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ libs += [
+ "dl",
+ "rt",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_byte__order.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_byte__order.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/byte_order.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/byte_order.h
+@@ -88,6 +88,8 @@
+ #error WEBRTC_ARCH_BIG_ENDIAN or WEBRTC_ARCH_LITTLE_ENDIAN must be defined.
+ #endif // defined(WEBRTC_ARCH_LITTLE_ENDIAN)
+
++#elif defined(WEBRTC_BSD)
++#include <sys/endian.h>
+ #elif defined(WEBRTC_POSIX)
+ #include <endian.h>
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_ip__address.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_ip__address.cc
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/ip_address.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/ip_address.cc
+@@ -13,7 +13,8 @@
+ #include <sys/socket.h>
+
+ #include "absl/strings/string_view.h"
+-#ifdef OPENBSD
++#if defined(WEBRTC_BSD)
++#include <sys/types.h>
+ #include <netinet/in_systm.h>
+ #endif
+ #ifndef __native_client__
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_network.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_network.cc
@@ -0,0 +1,15 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/network.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/network.cc
+@@ -261,7 +261,12 @@ AdapterType GetAdapterTypeFromName(const char* network
+ }
+ #endif
+
++#if defined(WEBRTC_BSD)
++ // Treat all other network interface names as ethernet on BSD
++ return ADAPTER_TYPE_ETHERNET;
++#else
+ return ADAPTER_TYPE_UNKNOWN;
++#endif
+ }
+
+ NetworkManager::NetworkManager() {}
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_physical__socket__server.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_physical__socket__server.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.h
+@@ -11,7 +11,7 @@
+ #ifndef RTC_BASE_PHYSICAL_SOCKET_SERVER_H_
+ #define RTC_BASE_PHYSICAL_SOCKET_SERVER_H_
+
+-#if defined(WEBRTC_POSIX) && defined(WEBRTC_LINUX)
++#if defined(WEBRTC_POSIX) && defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ #include <sys/epoll.h>
+ #define WEBRTC_USE_EPOLL 1
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_physical__socket__server.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_physical__socket__server.cc
@@ -0,0 +1,65 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,7 +51,7 @@
+ #include "rtc_base/synchronization/mutex.h"
+ #include "rtc_base/time_utils.h"
+
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ #include <linux/sockios.h>
+ #endif
+
+@@ -70,7 +70,7 @@ typedef void* SockOptArg;
+
+ #endif // WEBRTC_POSIX
+
+-#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
++#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__) && !defined(WEBRTC_BSD)
+
+ int64_t GetSocketRecvTimestamp(int socket) {
+ struct timeval tv_ioctl;
+@@ -298,7 +298,7 @@ int PhysicalSocket::GetOption(Option opt, int* value)
+ return -1;
+ }
+ if (opt == OPT_DONTFRAGMENT) {
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ *value = (*value != IP_PMTUDISC_DONT) ? 1 : 0;
+ #endif
+ } else if (opt == OPT_DSCP) {
+@@ -316,7 +316,7 @@ int PhysicalSocket::SetOption(Option opt, int value) {
+ if (TranslateOption(opt, &slevel, &sopt) == -1)
+ return -1;
+ if (opt == OPT_DONTFRAGMENT) {
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ value = (value) ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
+ #endif
+ } else if (opt == OPT_DSCP) {
+@@ -344,7 +344,7 @@ int PhysicalSocket::Send(const void* pv, size_t cb) {
+ int PhysicalSocket::Send(const void* pv, size_t cb) {
+ int sent = DoSend(
+ s_, reinterpret_cast<const char*>(pv), static_cast<int>(cb),
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ // Suppress SIGPIPE. Without this, attempting to send on a socket whose
+ // other end is closed will result in a SIGPIPE signal being raised to
+ // our process, which by default will terminate the process, which we
+@@ -373,7 +373,7 @@ int PhysicalSocket::SendTo(const void* buffer,
+ size_t len = addr.ToSockAddrStorage(&saddr);
+ int sent =
+ DoSendTo(s_, static_cast<const char*>(buffer), static_cast<int>(length),
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ // Suppress SIGPIPE. See above for explanation.
+ MSG_NOSIGNAL,
+ #else
+@@ -564,7 +564,7 @@ int PhysicalSocket::TranslateOption(Option opt, int* s
+ *slevel = IPPROTO_IP;
+ *sopt = IP_DONTFRAGMENT;
+ break;
+-#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
++#elif defined(WEBRTC_MAC) || defined(WEBRTC_BSD) || defined(__native_client__)
+ RTC_LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
+ return -1;
+ #elif defined(WEBRTC_POSIX)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_platform__thread__types.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_platform__thread__types.cc
@@ -0,0 +1,40 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/platform_thread_types.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/platform_thread_types.cc
+@@ -11,7 +11,9 @@
+ #include "rtc_base/platform_thread_types.h"
+
+ #if defined(WEBRTC_LINUX)
++#if !defined(WEBRTC_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/syscall.h>
+ #endif
+
+@@ -37,8 +39,10 @@ PlatformThreadId CurrentThreadId() {
+ return gettid();
+ #elif defined(WEBRTC_FUCHSIA)
+ return zx_thread_self();
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ return syscall(__NR_gettid);
++#elif defined(WEBRTC_BSD)
++ return reinterpret_cast<uint64_t>(pthread_self());
+ #elif defined(__EMSCRIPTEN__)
+ return static_cast<PlatformThreadId>(pthread_self());
+ #else
+@@ -67,6 +71,7 @@ void SetCurrentThreadName(const char* name) {
+ }
+
+ void SetCurrentThreadName(const char* name) {
++#if !defined(WEBRTC_BSD)
+ #if defined(WEBRTC_WIN)
+ // The SetThreadDescription API works even if no debugger is attached.
+ // The names set with this API also show up in ETW traces. Very handy.
+@@ -109,6 +114,7 @@ void SetCurrentThreadName(const char* name) {
+ prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); // NOLINT
+ #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
+ pthread_setname_np(name);
++#endif
+ #endif
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h
@@ -0,0 +1,23 @@
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/third_party/sigslot/sigslot.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/third_party/sigslot/sigslot.h
+@@ -178,6 +178,10 @@ class multi_threaded_local {
+ #endif // _SIGSLOT_HAS_WIN32_THREADS
+
+ #ifdef _SIGSLOT_HAS_POSIX_THREADS
++#if defined(OS_FREEBSD)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
++#endif
+ // The multi threading policies only get compiled in if they are enabled.
+ class multi_threaded_global {
+ public:
+@@ -201,6 +205,9 @@ class multi_threaded_local {
+ private:
+ pthread_mutex_t m_mutex;
+ };
++#if defined(OS_FREEBSD)
++#pragma GCC diagnostic pop
++#endif
+ #endif // _SIGSLOT_HAS_POSIX_THREADS
+
+ template <class mt_policy>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_system__wrappers_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_webrtc_system__wrappers_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/third_party/webrtc/system_wrappers/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/third_party/webrtc/system_wrappers/BUILD.gn
+@@ -64,8 +64,6 @@ rtc_library("system_wrappers") {
+ if (!build_with_chromium) {
+ sources += [ "source/cpu_features_linux.cc" ]
+ }
+-
+- libs += [ "rt" ]
+ }
+
+ if (is_win) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_aura_screen__ozone.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_aura_screen__ozone.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/aura/screen_ozone.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/aura/screen_ozone.h
+@@ -62,7 +62,7 @@ class AURA_EXPORT ScreenOzone : public display::Screen
+ protected:
+ ui::PlatformScreen* platform_screen() { return platform_screen_.get(); }
+
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool SetScreenSaverSuspended(bool suspend) override;
+ #endif // BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_aura_screen__ozone.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_aura_screen__ozone.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/aura/screen_ozone.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/aura/screen_ozone.cc
+@@ -99,7 +99,7 @@ display::Display ScreenOzone::GetPrimaryDisplay() cons
+ return platform_screen_->GetPrimaryDisplay();
+ }
+
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool ScreenOzone::SetScreenSaverSuspended(bool suspend) {
+ return platform_screen_->SetScreenSaverSuspended(suspend);
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_clipboard_clipboard__constants.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_clipboard_clipboard__constants.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/clipboard/clipboard_constants.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/clipboard/clipboard_constants.h
+@@ -46,7 +46,7 @@ extern const char kMimeTypeDataTransferEndpoint[];
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+ // Linux-specific MIME type constants (also used in Fuchsia).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES)
+ extern const char kMimeTypeLinuxUtf8String[];
+ COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_clipboard_clipboard__constants.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_clipboard_clipboard__constants.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/clipboard/clipboard_constants.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/clipboard/clipboard_constants.cc
+@@ -24,7 +24,7 @@ const char kMimeTypeWindowDrag[] = "chromium/x-window-
+ // Used for window dragging on some platforms.
+ const char kMimeTypeWindowDrag[] = "chromium/x-window-drag";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ const char kMimeTypeLinuxUtf8String[] = "UTF8_STRING";
+ const char kMimeTypeLinuxString[] = "STRING";
+ const char kMimeTypeLinuxText[] = "TEXT";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_cursor_cursor__factory.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_cursor_cursor__factory.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/cursor/cursor_factory.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/cursor/cursor_factory.h
+@@ -81,7 +81,7 @@ class COMPONENT_EXPORT(UI_BASE_CURSOR) CursorFactory {
+ base::ObserverList<CursorFactoryObserver>::Unchecked observers_;
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE_CURSOR)
+ std::vector<std::string> CursorNamesFromType(mojom::CursorType type);
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_cursor_cursor__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_cursor_cursor__factory.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/cursor/cursor_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/cursor/cursor_factory.cc
+@@ -83,7 +83,7 @@ void CursorFactory::SetDeviceScaleFactor(float scale)
+
+ void CursorFactory::SetDeviceScaleFactor(float scale) {}
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Returns a cursor name compatible with either X11 or the FreeDesktop.org
+ // cursor spec ([1] and [2]), followed by fallbacks that can work as
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_dragdrop_os__exchange__data__provider__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_dragdrop_os__exchange__data__provider__factory.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc
+@@ -7,7 +7,7 @@
+ #include "base/notreached.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "ui/base/dragdrop/os_exchange_data_provider_factory_ozone.h"
+ #include "ui/base/dragdrop/os_exchange_data_provider_non_backed.h"
+ #elif BUILDFLAG(IS_APPLE)
+@@ -22,7 +22,7 @@ OSExchangeDataProviderFactory::CreateProvider() {
+ // static
+ std::unique_ptr<OSExchangeDataProvider>
+ OSExchangeDataProviderFactory::CreateProvider() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The instance can be nullptr in tests that do not instantiate the platform,
+ // or on platforms that do not implement specific drag'n'drop. For them,
+ // falling back to the Aura provider should be fine.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_dragdrop_os__exchange__data__provider__non__backed.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_dragdrop_os__exchange__data__provider__non__backed.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/dragdrop/os_exchange_data_provider_non_backed.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/dragdrop/os_exchange_data_provider_non_backed.cc
+@@ -94,7 +94,7 @@ bool OSExchangeDataProviderNonBacked::GetString(std::u
+ }
+
+ bool OSExchangeDataProviderNonBacked::GetString(std::u16string* data) const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (HasFile()) {
+ // Various Linux file managers both pass a list of file:// URIs and set the
+ // string representation to the URI. We explicitly don't want to return use
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_dummy__text__input__client.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_dummy__text__input__client.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/ime/dummy_text_input_client.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ime/dummy_text_input_client.h
+@@ -63,7 +63,7 @@ class DummyTextInputClient : public TextInputClient {
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_dummy__text__input__client.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_dummy__text__input__client.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/ime/dummy_text_input_client.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ime/dummy_text_input_client.cc
+@@ -151,7 +151,7 @@ bool DummyTextInputClient::ShouldDoLearning() {
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool DummyTextInputClient::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_fake__text__input__client.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_fake__text__input__client.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/ime/fake_text_input_client.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ime/fake_text_input_client.h
+@@ -69,7 +69,7 @@ class FakeTextInputClient : public TextInputClient {
+ void SetTextEditCommandForNextKeyEvent(TextEditCommand command) override;
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_fake__text__input__client.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_fake__text__input__client.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/ime/fake_text_input_client.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ime/fake_text_input_client.cc
+@@ -161,7 +161,7 @@ bool FakeTextInputClient::ShouldDoLearning() {
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool FakeTextInputClient::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_init_input__method__initializer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_init_input__method__initializer.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/ui/base/ime/init/input_method_initializer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ime/init/input_method_initializer.cc
+@@ -10,7 +10,7 @@
+ #include "build/chromeos_buildflags.h"
+
+ #if !BUILDFLAG(IS_CHROMEOS_ASH) && defined(USE_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ #include "base/check.h"
+ #include "ui/base/ime/linux/fake_input_method_context_factory.h"
+ #elif BUILDFLAG(IS_WIN)
+@@ -20,7 +20,7 @@ namespace {
+
+ namespace {
+
+-#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ const ui::LinuxInputMethodContextFactory*
+ g_linux_input_method_context_factory_for_testing;
+ #endif
+@@ -43,7 +43,7 @@ void InitializeInputMethodForTesting() {
+
+ void InitializeInputMethodForTesting() {
+ #if !BUILDFLAG(IS_CHROMEOS_ASH) && defined(USE_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ if (!g_linux_input_method_context_factory_for_testing)
+ g_linux_input_method_context_factory_for_testing =
+ new FakeInputMethodContextFactory();
+@@ -61,7 +61,7 @@ void ShutdownInputMethodForTesting() {
+
+ void ShutdownInputMethodForTesting() {
+ #if !BUILDFLAG(IS_CHROMEOS_ASH) && defined(USE_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ const LinuxInputMethodContextFactory* factory =
+ LinuxInputMethodContextFactory::instance();
+ CHECK(!factory || factory == g_linux_input_method_context_factory_for_testing)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_text__input__client.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ime_text__input__client.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/ime/text_input_client.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ime/text_input_client.h
+@@ -238,7 +238,7 @@ class COMPONENT_EXPORT(UI_BASE_IME) TextInputClient {
+ // fields that are considered 'private' (e.g. in incognito tabs).
+ virtual bool ShouldDoLearning() = 0;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Start composition over a given UTF-16 code range from existing text. This
+ // should only be used for composition scenario when IME wants to start
+ // composition on existing text. Returns whether the operation was successful.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_resource_resource__bundle.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_resource_resource__bundle.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/resource/resource_bundle.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/resource/resource_bundle.cc
+@@ -882,7 +882,7 @@ ResourceScaleFactor ResourceBundle::GetMaxResourceScal
+ }
+
+ ResourceScaleFactor ResourceBundle::GetMaxResourceScaleFactor() const {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return max_scale_factor_;
+ #else
+ return GetSupportedResourceScaleFactors().back();
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ui__base__features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_ui__base__features.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/base/ui_base_features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/ui_base_features.cc
+@@ -179,7 +179,7 @@ const base::Feature kExperimentalFlingAnimation {
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || \
+ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
+- !BUILDFLAG(IS_CHROMEOS_LACROS))
++ !BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -275,7 +275,7 @@ const base::Feature kEyeDropper {
+ // milestones.
+ const base::Feature kEyeDropper {
+ "EyeDropper",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_webui_web__ui__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_webui_web__ui__util.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/base/webui/web_ui_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/webui/web_ui_util.cc
+@@ -228,7 +228,7 @@ std::string GetFontFamily() {
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
+ if (!cmdline->HasSwitch(switches::kSingleProcess)) {
+ std::string font_name = ui::ResourceBundle::GetSharedInstance()
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_x_x11__cursor__loader.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_x_x11__cursor__loader.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/ui/base/x/x11_cursor_loader.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/x/x11_cursor_loader.cc
+@@ -136,7 +136,11 @@ std::string CursorPathFromLibXcursor() {
+ void operator()(void* ptr) const { dlclose(ptr); }
+ };
+
++#if defined(OS_BSD)
++ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so", RTLD_LAZY));
++#else
+ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so.1", RTLD_LAZY));
++#endif
+ if (!lib)
+ return "";
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_x_x11__shm__image__pool.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_base_x_x11__shm__image__pool.cc
@@ -0,0 +1,53 @@
+--- src/3rdparty/chromium/ui/base/x/x11_shm_image_pool.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/base/x/x11_shm_image_pool.cc
+@@ -16,6 +16,7 @@
+ #include "base/environment.h"
+ #include "base/location.h"
+ #include "base/strings/string_util.h"
++#include "base/system/sys_info.h"
+ #include "base/threading/thread_task_runner_handle.h"
+ #include "build/build_config.h"
+ #include "build/chromeos_buildflags.h"
+@@ -46,10 +47,14 @@ std::size_t MaxShmSegmentSizeImpl() {
+ 1.0f / (kShmResizeThreshold * kShmResizeThreshold);
+
+ std::size_t MaxShmSegmentSizeImpl() {
++#if BUILDFLAG(IS_BSD)
++ return base::SysInfo::MaxSharedMemorySize();
++#else
+ struct shminfo info;
+ if (shmctl(0, IPC_INFO, reinterpret_cast<struct shmid_ds*>(&info)) == -1)
+ return 0;
+ return info.shmmax;
++#endif
+ }
+
+ std::size_t MaxShmSegmentSize() {
+@@ -66,6 +71,9 @@ bool ShouldUseMitShm(x11::Connection* connection) {
+ }
+
+ bool ShouldUseMitShm(x11::Connection* connection) {
++#if BUILDFLAG(IS_BSD)
++ return false;
++#endif
+ // MIT-SHM may be available on remote connetions, but it will be unusable. Do
+ // a best-effort check to see if the host is remote to disable the SHM
+ // codepath. It may be possible in contrived cases for there to be a
+@@ -184,7 +192,7 @@ bool XShmImagePool::Resize(const gfx::Size& pixel_size
+ shmctl(state.shmid, IPC_RMID, nullptr);
+ return false;
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, a shmid can still be attached after IPC_RMID if otherwise
+ // kept alive. Detach before XShmAttach to prevent a memory leak in case
+ // the process dies.
+@@ -203,7 +211,7 @@ bool XShmImagePool::Resize(const gfx::Size& pixel_size
+ return false;
+ state.shmseg = shmseg;
+ state.shmem_attached_to_server = true;
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // The Linux-specific shmctl behavior above may not be portable, so we're
+ // forced to do IPC_RMID after the server has attached to the segment.
+ shmctl(state.shmid, IPC_RMID, nullptr);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_color_color__id.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_color_color__id.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/color/color_id.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/color/color_id.h
+@@ -198,7 +198,7 @@
+ E_CPONLY(kColorNativeColor6) \
+ E_CPONLY(kColorNativeBaseColor) \
+ E_CPONLY(kColorNativeSecondaryColor)
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define PLATFORM_SPECIFIC_COLOR_IDS \
+ E_CPONLY(kColorNativeButtonBackground) \
+ E_CPONLY(kColorNativeButtonBackgroundDisabled) \
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_color_native__color__mixers.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_color_native__color__mixers.cc
@@ -0,0 +1,17 @@
+--- src/3rdparty/chromium/ui/color/native_color_mixers.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/color/native_color_mixers.cc
+@@ -10,12 +10,12 @@ namespace ui {
+ namespace ui {
+
+ #if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && \
+- !BUILDFLAG(IS_WIN)
++ !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD)
+ void AddNativeCoreColorMixer(ColorProvider* provider,
+ const ColorProviderManager::Key& key) {}
+ #endif
+
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD)
+ void AddNativeUiColorMixer(ColorProvider* provider,
+ const ColorProviderManager::Key& key) {}
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_compositor_compositor.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_compositor_compositor.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/compositor/compositor.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/compositor/compositor.h
+@@ -409,7 +409,7 @@ class COMPOSITOR_EXPORT Compositor : public base::Powe
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ void OnCompleteSwapWithNewSize(const gfx::Size& size);
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_compositor_compositor.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_compositor_compositor.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/compositor/compositor.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/compositor/compositor.cc
+@@ -852,7 +852,7 @@ void Compositor::OnResume() {
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ void Compositor::OnCompleteSwapWithNewSize(const gfx::Size& size) {
+ for (auto& observer : observer_list_)
+ observer.OnCompositingCompleteSwapWithNewSize(this, size);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_compositor_compositor__observer.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_compositor_compositor__observer.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/compositor/compositor_observer.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/compositor/compositor_observer.h
+@@ -48,7 +48,7 @@ class COMPOSITOR_EXPORT CompositorObserver {
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Called when a swap with new size is completed.
+ virtual void OnCompositingCompleteSwapWithNewSize(ui::Compositor* compositor,
+ const gfx::Size& size) {}
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_display_screen.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_display_screen.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/ui/display/screen.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/display/screen.h
+@@ -119,7 +119,7 @@ class DISPLAY_EXPORT Screen {
+ // (both of which may or may not be `nearest_id`).
+ display::ScreenInfos GetScreenInfosNearestDisplay(int64_t nearest_id) const;
+
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Object which suspends the platform-specific screensaver for the duration of
+ // its existence.
+ class ScreenSaverSuspender {
+@@ -191,7 +191,7 @@ class DISPLAY_EXPORT Screen {
+ const gfx::GpuExtraInfo& gpu_extra_info);
+
+ protected:
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Suspends or un-suspends the platform-specific screensaver, and returns
+ // whether the operation was successful.
+ virtual bool SetScreenSaverSuspended(bool suspend);
+@@ -210,7 +210,7 @@ class DISPLAY_EXPORT Screen {
+ int64_t display_id_for_new_windows_;
+ int64_t scoped_display_id_for_new_windows_ = display::kInvalidDisplayId;
+
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ uint32_t screen_saver_suspension_count_ = 0;
+ #endif // BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_display_screen.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_display_screen.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/display/screen.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/display/screen.cc
+@@ -72,7 +72,7 @@ void Screen::SetDisplayForNewWindows(int64_t display_i
+ display_id_for_new_windows_ = display_id;
+ }
+
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<Screen::ScreenSaverSuspender> Screen::SuspendScreenSaver() {
+ SetScreenSaverSuspended(true);
+ screen_saver_suspension_count_++;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_devices_x11_device__data__manager__x11.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_devices_x11_device__data__manager__x11.cc
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/ui/events/devices/x11/device_data_manager_x11.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/events/devices/x11/device_data_manager_x11.cc
+@@ -874,6 +874,7 @@ void DeviceDataManagerX11::DisableDevice(x11::Input::D
+ }
+
+ void DeviceDataManagerX11::DisableDevice(x11::Input::DeviceId deviceid) {
++ NOTIMPLEMENTED();
+ blocked_devices_.set(static_cast<uint32_t>(deviceid), true);
+ // TODO(rsadam@): Support blocking touchscreen devices.
+ std::vector<InputDevice> keyboards = GetKeyboardDevices();
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_event.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_event.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/events/event.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/events/event.cc
+@@ -453,7 +453,7 @@ MouseEvent::MouseEvent(const PlatformEvent& native_eve
+ MouseEvent::MouseEvent(const PlatformEvent& native_event)
+ : LocatedEvent(native_event),
+ changed_button_flags_(GetChangedMouseButtonFlagsFromNative(native_event)),
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ movement_(GetMouseMovementFromNative(native_event)),
+ #endif
+ pointer_details_(GetMousePointerDetailsFromNative(native_event)) {
+@@ -935,7 +935,7 @@ void KeyEvent::InitializeNative() {
+ if (synthesize_key_repeat_enabled_ && IsRepeated(GetLastKeyEvent()))
+ set_flags(flags() | EF_IS_REPEAT);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ NormalizeFlags();
+ #elif BUILDFLAG(IS_WIN)
+ // Only Windows has native character events.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_event__switches.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_event__switches.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/events/event_switches.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/events/event_switches.h
+@@ -12,7 +12,7 @@ EVENTS_BASE_EXPORT extern const char kCompensateForUns
+
+ EVENTS_BASE_EXPORT extern const char kCompensateForUnstablePinchZoom[];
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ EVENTS_BASE_EXPORT extern const char kTouchDevices[];
+ EVENTS_BASE_EXPORT extern const char kPenDevices[];
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_event__switches.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_event__switches.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/events/event_switches.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/events/event_switches.cc
+@@ -14,7 +14,7 @@ const char kCompensateForUnstablePinchZoom[] =
+ const char kCompensateForUnstablePinchZoom[] =
+ "compensate-for-unstable-pinch-zoom";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Tells chrome to interpret events from these devices as touch events. Only
+ // available with XInput 2 (i.e. X server 1.8 or above). The id's of the
+ // devices can be retrieved from 'xinput list'.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_keycodes_dom_keycode__converter.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_keycodes_dom_keycode__converter.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/events/keycodes/dom/keycode_converter.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/events/keycodes/dom/keycode_converter.h
+@@ -64,7 +64,7 @@ class KeycodeConverter {
+ // Convert a DomCode into a native keycode.
+ static int DomCodeToNativeKeycode(DomCode code);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+ // Convert a XKB keycode into a DomCode.
+ static DomCode XkbKeycodeToDomCode(uint32_t xkb_keycode);
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_keycodes_dom_keycode__converter.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_keycodes_dom_keycode__converter.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/ui/events/keycodes/dom/keycode_converter.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/events/keycodes/dom/keycode_converter.cc
+@@ -11,7 +11,7 @@
+ #include "ui/events/keycodes/dom/dom_code.h"
+ #include "ui/events/keycodes/dom/dom_key.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+ #include <linux/input.h>
+ #endif
+
+@@ -24,7 +24,7 @@ namespace {
+ #if BUILDFLAG(IS_WIN)
+ #define DOM_CODE(usb, evdev, xkb, win, mac, code, id) \
+ { usb, win, code }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define DOM_CODE(usb, evdev, xkb, win, mac, code, id) \
+ { usb, xkb, code }
+ #elif BUILDFLAG(IS_APPLE)
+@@ -58,7 +58,7 @@ struct DomKeyMapEntry {
+ #undef DOM_KEY_MAP
+ #undef DOM_KEY_UNI
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+
+ // The offset between XKB Keycode and evdev code.
+ constexpr int kXkbKeycodeOffset = 8;
+@@ -139,7 +139,7 @@ int KeycodeConverter::DomCodeToNativeKeycode(DomCode c
+ return UsbKeycodeToNativeKeycode(static_cast<uint32_t>(code));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+ // static
+ DomCode KeycodeConverter::XkbKeycodeToDomCode(uint32_t xkb_keycode) {
+ // Currently XKB keycode is the native keycode.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_BUILD.gn
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/BUILD.gn
+@@ -586,7 +586,7 @@ jumbo_source_set("memory_buffer_sources") {
+ deps += [ "//build/config/linux/libdrm" ]
+ }
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux || is_chromeos || is_android) && !is_bsd) {
+ deps += [ "//third_party/libsync" ]
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_canvas__skia.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_canvas__skia.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/canvas_skia.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/canvas_skia.cc
+@@ -200,7 +200,7 @@ void Canvas::DrawStringRectWithFlags(const std::u16str
+ Range range = StripAcceleratorChars(flags, &adjusted_text);
+ bool elide_text = ((flags & NO_ELLIPSIS) == 0);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, eliding really means fading the end of the string. But only
+ // for LTR text. RTL text is still elided (on the left) with "...".
+ if (elide_text) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_codec_png__codec.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_codec_png__codec.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/codec/png_codec.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
+@@ -10,7 +10,7 @@
+ #include "base/memory/raw_ptr.h"
+ #include "base/notreached.h"
+ #include "base/strings/string_util.h"
+-#include "third_party/libpng/png.h"
++#include <png.h>
+ #include "third_party/skia/include/core/SkBitmap.h"
+ #include "third_party/skia/include/core/SkColorPriv.h"
+ #include "third_party/skia/include/core/SkUnPreMultiply.h"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__fallback__linux.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__fallback__linux.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/font_fallback_linux.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/font_fallback_linux.cc
+@@ -25,6 +25,8 @@
+ #include "ui/gfx/linux/fontconfig_util.h"
+ #include "ui/gfx/platform_font.h"
+
++#include <unistd.h>
++
+ namespace gfx {
+
+ namespace {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__list.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__list.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/font_list.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/font_list.cc
+@@ -27,7 +27,7 @@ bool IsFontFamilyAvailable(const std::string& family,
+ bool g_default_impl_initialized = false;
+
+ bool IsFontFamilyAvailable(const std::string& family, SkFontMgr* fontManager) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return !!fontManager->legacyMakeTypeface(family.c_str(), SkFontStyle());
+ #else
+ sk_sp<SkFontStyleSet> set(fontManager->matchFamily(family.c_str()));
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__render__params.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__render__params.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/gfx/font_render_params.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/font_render_params.h
+@@ -109,7 +109,7 @@ GFX_EXPORT FontRenderParams GetFontRenderParams(
+ const FontRenderParamsQuery& query,
+ std::string* family_out);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Clears GetFontRenderParams()'s cache. Intended to be called by tests that are
+ // changing Fontconfig's configuration.
+ GFX_EXPORT void ClearFontRenderParamsCacheForTest();
+@@ -119,7 +119,7 @@ GFX_EXPORT float GetFontRenderParamsDeviceScaleFactor(
+ GFX_EXPORT float GetFontRenderParamsDeviceScaleFactor();
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Sets the device scale factor for FontRenderParams to decide
+ // if it should enable subpixel positioning.
+ GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor(
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_font__util.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/gfx/font_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/font_util.cc
+@@ -6,7 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <fontconfig/fontconfig.h>
+ #include "ui/gfx/linux/fontconfig_util.h"
+ #endif
+@@ -24,7 +24,7 @@ void InitializeFonts() {
+ // background (resources have not yet been granted to cast) since it prevents
+ // the long delay the user would have seen on first rendering.
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Ensures the config is created on this thread.
+ FcConfig* config = GetGlobalFontConfig();
+ DCHECK(config);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_gpu__memory__buffer.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_gpu__memory__buffer.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/gfx/gpu_memory_buffer.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/gpu_memory_buffer.h
+@@ -16,7 +16,7 @@
+ #include "ui/gfx/gfx_export.h"
+ #include "ui/gfx/hdr_metadata.h"
+
+-#if defined(USE_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if defined(USE_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/native_pixmap_handle.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "ui/gfx/mac/io_surface.h"
+@@ -78,7 +78,7 @@ struct GFX_EXPORT GpuMemoryBufferHandle {
+ base::UnsafeSharedMemoryRegion region;
+ uint32_t offset = 0;
+ int32_t stride = 0;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ NativePixmapHandle native_pixmap_handle;
+ #elif BUILDFLAG(IS_MAC)
+ ScopedIOSurface io_surface;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_gpu__memory__buffer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_gpu__memory__buffer.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/gpu_memory_buffer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/gpu_memory_buffer.cc
+@@ -54,7 +54,7 @@ GpuMemoryBufferHandle GpuMemoryBufferHandle::Clone() c
+ handle.region = region.Duplicate();
+ handle.offset = offset;
+ handle.stride = stride;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ handle.native_pixmap_handle = CloneHandleForIPC(native_pixmap_handle);
+ #elif BUILDFLAG(IS_MAC)
+ handle.io_surface = io_surface;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_ipc_gfx__param__traits__macros.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_ipc_gfx__param__traits__macros.h
@@ -0,0 +1,44 @@
+--- src/3rdparty/chromium/ui/gfx/ipc/gfx_param_traits_macros.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/ipc/gfx_param_traits_macros.h
+@@ -18,7 +18,7 @@
+ #include "ui/gfx/selection_bound.h"
+ #include "ui/gfx/swap_result.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/native_pixmap_handle.h"
+ #endif
+
+@@ -48,7 +48,7 @@ IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle)
+ IPC_STRUCT_TRAITS_MEMBER(region)
+ IPC_STRUCT_TRAITS_MEMBER(offset)
+ IPC_STRUCT_TRAITS_MEMBER(stride)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ IPC_STRUCT_TRAITS_MEMBER(native_pixmap_handle)
+ #elif BUILDFLAG(IS_APPLE)
+ IPC_STRUCT_TRAITS_MEMBER(io_surface)
+@@ -63,12 +63,12 @@ IPC_STRUCT_TRAITS_END()
+ IPC_STRUCT_TRAITS_MEMBER(id)
+ IPC_STRUCT_TRAITS_END()
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapPlane)
+ IPC_STRUCT_TRAITS_MEMBER(stride)
+ IPC_STRUCT_TRAITS_MEMBER(offset)
+ IPC_STRUCT_TRAITS_MEMBER(size)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ IPC_STRUCT_TRAITS_MEMBER(fd)
+ #elif BUILDFLAG(IS_FUCHSIA)
+ IPC_STRUCT_TRAITS_MEMBER(vmo)
+@@ -77,7 +77,7 @@ IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapHandle)
+
+ IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapHandle)
+ IPC_STRUCT_TRAITS_MEMBER(planes)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ IPC_STRUCT_TRAITS_MEMBER(modifier)
+ #endif
+ #if BUILDFLAG(IS_FUCHSIA)
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_linux_client__native__pixmap__dmabuf.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_linux_client__native__pixmap__dmabuf.cc
@@ -0,0 +1,25 @@
+--- src/3rdparty/chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc
+@@ -5,7 +5,9 @@
+ #include "ui/gfx/linux/client_native_pixmap_dmabuf.h"
+
+ #include <fcntl.h>
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
+ #include <linux/version.h>
++#endif
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+@@ -27,11 +29,7 @@
+ #include "ui/gfx/buffer_format_util.h"
+ #include "ui/gfx/switches.h"
+
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+-#include <linux/dma-buf.h>
+-#else
+-#include <linux/types.h>
+-
++#if defined(__OpenBSD__) || defined(__FreeBSD__)
+ struct dma_buf_sync {
+ __u64 flags;
+ };
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_mojom_buffer__types__mojom__traits.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_mojom_buffer__types__mojom__traits.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/gfx/mojom/buffer_types_mojom_traits.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/mojom/buffer_types_mojom_traits.cc
+@@ -33,7 +33,7 @@ gfx::mojom::GpuMemoryBufferPlatformHandlePtr StructTra
+ return gfx::mojom::GpuMemoryBufferPlatformHandle::NewSharedMemoryHandle(
+ std::move(handle.region));
+ case gfx::NATIVE_PIXMAP:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ return gfx::mojom::GpuMemoryBufferPlatformHandle::NewNativePixmapHandle(
+ std::move(handle.native_pixmap_handle));
+ #else
+@@ -115,7 +115,7 @@ bool StructTraits<gfx::mojom::GpuMemoryBufferHandleDat
+ out->type = gfx::SHARED_MEMORY_BUFFER;
+ out->region = std::move(platform_handle->get_shared_memory_handle());
+ return true;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ case gfx::mojom::GpuMemoryBufferPlatformHandleDataView::Tag::
+ NATIVE_PIXMAP_HANDLE:
+ out->type = gfx::NATIVE_PIXMAP;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_mojom_native__handle__types__mojom__traits.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_mojom_native__handle__types__mojom__traits.h
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/ui/gfx/mojom/native_handle_types_mojom_traits.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/mojom/native_handle_types_mojom_traits.h
+@@ -15,7 +15,7 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/mojom/native_handle_types.mojom-shared.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/native_pixmap_handle.h"
+ #endif
+
+@@ -25,7 +25,7 @@ namespace mojo {
+
+ namespace mojo {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ template <>
+ struct COMPONENT_EXPORT(GFX_NATIVE_HANDLE_TYPES_SHARED_MOJOM_TRAITS)
+ StructTraits<gfx::mojom::NativePixmapPlaneDataView,
+@@ -53,7 +53,7 @@ struct COMPONENT_EXPORT(GFX_NATIVE_HANDLE_TYPES_SHARED
+ return pixmap_handle.planes;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static uint64_t modifier(const gfx::NativePixmapHandle& pixmap_handle) {
+ return pixmap_handle.modifier;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_mojom_native__handle__types__mojom__traits.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_mojom_native__handle__types__mojom__traits.cc
@@ -0,0 +1,34 @@
+--- src/3rdparty/chromium/ui/gfx/mojom/native_handle_types_mojom_traits.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/mojom/native_handle_types_mojom_traits.cc
+@@ -8,11 +8,11 @@ namespace mojo {
+
+ namespace mojo {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD)
+ mojo::PlatformHandle StructTraits<
+ gfx::mojom::NativePixmapPlaneDataView,
+ gfx::NativePixmapPlane>::buffer_handle(gfx::NativePixmapPlane& plane) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return mojo::PlatformHandle(std::move(plane.fd));
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return mojo::PlatformHandle(std::move(plane.vmo));
+@@ -28,7 +28,7 @@ bool StructTraits<
+ out->size = data.size();
+
+ mojo::PlatformHandle handle = data.TakeBufferHandle();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!handle.is_fd())
+ return false;
+ out->fd = handle.TakeFD();
+@@ -45,7 +45,7 @@ bool StructTraits<
+ gfx::mojom::NativePixmapHandleDataView,
+ gfx::NativePixmapHandle>::Read(gfx::mojom::NativePixmapHandleDataView data,
+ gfx::NativePixmapHandle* out) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ out->modifier = data.modifier();
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_native__pixmap__handle.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_native__pixmap__handle.h
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/ui/gfx/native_pixmap_handle.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/native_pixmap_handle.h
+@@ -15,7 +15,7 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/gfx_export.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/scoped_file.h"
+ #endif
+
+@@ -32,7 +32,7 @@ struct GFX_EXPORT NativePixmapPlane {
+ NativePixmapPlane(int stride,
+ int offset,
+ uint64_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ base::ScopedFD fd
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -53,7 +53,7 @@ struct GFX_EXPORT NativePixmapPlane {
+ // This is necessary to map the buffers.
+ uint64_t size;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // File descriptor for the underlying memory object (usually dmabuf).
+ base::ScopedFD fd;
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -82,7 +82,7 @@ struct GFX_EXPORT NativePixmapHandle {
+
+ std::vector<NativePixmapPlane> planes;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The modifier is retrieved from GBM library and passed to EGL driver.
+ // Generally it's platform specific, and we don't need to modify it in
+ // Chromium code. Also one per plane per entry.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_native__pixmap__handle.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_native__pixmap__handle.cc
@@ -0,0 +1,58 @@
+--- src/3rdparty/chromium/ui/gfx/native_pixmap_handle.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/native_pixmap_handle.cc
+@@ -9,7 +9,7 @@
+ #include "base/logging.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if !defined(TOOLKIT_QT)
+ #include <drm_fourcc.h>
+ #endif
+@@ -23,6 +23,10 @@
+ #include "base/fuchsia/fuchsia_logging.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include <unistd.h>
++#endif
++
+ namespace gfx {
+
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !defined(TOOLKIT_QT)
+@@ -36,7 +40,7 @@ NativePixmapPlane::NativePixmapPlane(int stride,
+ NativePixmapPlane::NativePixmapPlane(int stride,
+ int offset,
+ uint64_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ base::ScopedFD fd
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -47,7 +51,7 @@ NativePixmapPlane::NativePixmapPlane(int stride,
+ : stride(stride),
+ offset(offset),
+ size(size)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ fd(std::move(fd))
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -75,7 +79,7 @@ NativePixmapHandle CloneHandleForIPC(const NativePixma
+ NativePixmapHandle CloneHandleForIPC(const NativePixmapHandle& handle) {
+ NativePixmapHandle clone;
+ for (auto& plane : handle.planes) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ DCHECK(plane.fd.is_valid());
+ // Combining the HANDLE_EINTR and ScopedFD's constructor causes the compiler
+ // to emit some very strange assembly that tends to cause FD ownership
+@@ -105,7 +109,7 @@ NativePixmapHandle CloneHandleForIPC(const NativePixma
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ clone.modifier = handle.modifier;
+ clone.supports_zero_copy_webgpu_import =
+ handle.supports_zero_copy_webgpu_import;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_native__widget__types.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_native__widget__types.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/gfx/native_widget_types.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/native_widget_types.h
+@@ -106,7 +106,7 @@ class SkBitmap;
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ extern "C" {
+ struct _AtkObject;
+ typedef struct _AtkObject AtkObject;
+@@ -209,7 +209,7 @@ typedef id NativeViewAccessible;
+ typedef id NativeViewAccessible;
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Linux doesn't have a native font type.
+ typedef AtkObject* NativeViewAccessible;
+ #else
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_render__text__api__fuzzer.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_render__text__api__fuzzer.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/ui/gfx/render_text_api_fuzzer.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/render_text_api_fuzzer.cc
+@@ -21,7 +21,7 @@
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if BUILDFLAG(IS_ANDROID) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ #include "base/test/test_discardable_memory_allocator.h"
+ #endif
+
+@@ -44,7 +44,7 @@ struct Environment {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if BUILDFLAG(IS_ANDROID) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ // Some platforms require discardable memory to use bitmap fonts.
+ base::DiscardableMemoryAllocator::SetInstance(
+ &discardable_memory_allocator);
+@@ -56,7 +56,7 @@ struct Environment {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if BUILDFLAG(IS_ANDROID) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ base::TestDiscardableMemoryAllocator discardable_memory_allocator;
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_switches.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_switches.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/switches.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/switches.h
+@@ -17,7 +17,7 @@ GFX_SWITCHES_EXPORT extern const char kHeadless[];
+ GFX_SWITCHES_EXPORT extern const char kForcePrefersReducedMotion[];
+ GFX_SWITCHES_EXPORT extern const char kHeadless[];
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ GFX_SWITCHES_EXPORT extern const char kX11Display[];
+ GFX_SWITCHES_EXPORT extern const char kNoXshm[];
+ #endif
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_switches.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_switches.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/switches.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/switches.cc
+@@ -26,7 +26,7 @@ const char kHeadless[] = "headless";
+ // Run in headless mode, i.e., without a UI or display server dependencies.
+ const char kHeadless[] = "headless";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Which X11 display to connect to. Emulates the GTK+ "--display=" command line
+ // argument. In use only with Ozone/X11.
+ const char kX11Display[] = "display";
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_x_generated__protos_dri3.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_x_generated__protos_dri3.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/x/generated_protos/dri3.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/x/generated_protos/dri3.cc
+@@ -44,6 +44,8 @@
+ #include <xcb/xcb.h>
+ #include <xcb/xcbext.h>
+
++#include <unistd.h>
++
+ #include "base/logging.h"
+ #include "base/posix/eintr_wrapper.h"
+ #include "ui/gfx/x/xproto_internal.h"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_x_generated__protos_shm.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_x_generated__protos_shm.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gfx/x/generated_protos/shm.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/x/generated_protos/shm.cc
+@@ -44,6 +44,8 @@
+ #include <xcb/xcb.h>
+ #include <xcb/xcbext.h>
+
++#include <unistd.h>
++
+ #include "base/logging.h"
+ #include "base/posix/eintr_wrapper.h"
+ #include "ui/gfx/x/xproto_internal.h"
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_x_xlib__support.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gfx_x_xlib__support.cc
@@ -0,0 +1,21 @@
+--- src/3rdparty/chromium/ui/gfx/x/xlib_support.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gfx/x/xlib_support.cc
+@@ -42,10 +42,18 @@ void InitXlib() {
+ if (xlib_loader->loaded())
+ return;
+
++#if defined(OS_BSD)
++ CHECK(xlib_loader->Load("libX11.so"));
++#else
+ CHECK(xlib_loader->Load("libX11.so.6"));
++#endif
+
+ auto* xlib_xcb_loader = GetXlibXcbLoader();
++#if defined(OS_BSD)
++ CHECK(xlib_xcb_loader->Load("libX11-xcb.so"));
++#else
+ CHECK(xlib_xcb_loader->Load("libX11-xcb.so.1"));
++#endif
+
+ CHECK(xlib_loader->XInitThreads());
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_BUILD.gn
@@ -0,0 +1,35 @@
+--- src/3rdparty/chromium/ui/gl/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/BUILD.gn
+@@ -165,8 +165,6 @@ jumbo_component("gl") {
+ defines += [ "GPU_ENABLE_SERVICE_LOGGING" ]
+ }
+
+- include_dirs = [ "//third_party/mesa_headers" ]
+-
+ all_dependent_configs = [ ":gl_config" ]
+
+ public_configs = [ "//third_party/khronos:khronos_headers" ]
+@@ -183,7 +181,6 @@ jumbo_component("gl") {
+ ]
+ public_deps = [
+ "//base",
+- "//third_party/mesa_headers",
+ "//ui/events/platform",
+ "//ui/gfx",
+ "//ui/gfx/geometry",
+@@ -437,7 +434,6 @@ jumbo_component("gl") {
+ data_deps += [
+ "//third_party/angle:libEGL",
+ "//third_party/angle:libGLESv2",
+- "//third_party/mesa_headers",
+ ]
+ if (enable_swiftshader) {
+ data_deps += [
+@@ -693,7 +689,6 @@ test("gl_unittests") {
+
+ data_deps = [
+ "//testing/buildbot/filters:gl_unittests_filters",
+- "//third_party/mesa_headers",
+ ]
+
+ # TODO(https://crbug.com/789065): this must be moved to Ozone.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_generate__bindings.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_generate__bindings.py
@@ -0,0 +1,12 @@
+--- src/3rdparty/chromium/ui/gl/generate_bindings.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/generate_bindings.py
+@@ -2951,6 +2951,9 @@ GLX_FUNCTIONS = [
+ 'arguments':
+ 'Display* dpy, GLXDrawable drawable, int32_t* numerator, '
+ 'int32_t* denominator' },
++{ 'return_type': '__GLXextFuncPtr',
++ 'names': ['glXGetProcAddressARB'],
++ 'arguments': 'const GLubyte* procName', },
+ { 'return_type': 'void',
+ 'names': ['glXGetSelectedEvent'],
+ 'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long* mask', },
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__bindings__api__autogen__glx.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__bindings__api__autogen__glx.h
@@ -0,0 +1,10 @@
+--- src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_glx.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_glx.h
+@@ -88,6 +88,7 @@ bool glXGetMscRateOMLFn(Display* dpy,
+ GLXDrawable drawable,
+ int32_t* numerator,
+ int32_t* denominator) override;
++__GLXextFuncPtr glXGetProcAddressARBFn(const GLubyte* procName) override;
+ void glXGetSelectedEventFn(Display* dpy,
+ GLXDrawable drawable,
+ unsigned long* mask) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__bindings__autogen__glx.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__bindings__autogen__glx.h
@@ -0,0 +1,43 @@
+--- src/3rdparty/chromium/ui/gl/gl_bindings_autogen_glx.h.orig 2022-06-08 06:40:31 UTC
++++ src/3rdparty/chromium/ui/gl/gl_bindings_autogen_glx.h
+@@ -104,6 +104,8 @@ typedef bool(GL_BINDING_CALL* glXGetMscRateOMLProc)(Di
+ GLXDrawable drawable,
+ int32_t* numerator,
+ int32_t* denominator);
++typedef __GLXextFuncPtr(GL_BINDING_CALL* glXGetProcAddressARBProc)(
++ const GLubyte* procName);
+ typedef void(GL_BINDING_CALL* glXGetSelectedEventProc)(Display* dpy,
+ GLXDrawable drawable,
+ unsigned long* mask);
+@@ -166,6 +168,7 @@ struct ExtensionsGLX {
+
+ struct ExtensionsGLX {
+ bool b_GLX_ARB_create_context;
++ bool b_GLX_ARB_get_proc_address;
+ bool b_GLX_EXT_swap_control;
+ bool b_GLX_EXT_texture_from_pixmap;
+ bool b_GLX_MESA_copy_sub_buffer;
+@@ -203,6 +206,7 @@ struct ProcsGLX {
+ glXGetFBConfigFromVisualSGIXProc glXGetFBConfigFromVisualSGIXFn;
+ glXGetFBConfigsProc glXGetFBConfigsFn;
+ glXGetMscRateOMLProc glXGetMscRateOMLFn;
++ glXGetProcAddressARBProc glXGetProcAddressARBFn;
+ glXGetSelectedEventProc glXGetSelectedEventFn;
+ glXGetSyncValuesOMLProc glXGetSyncValuesOMLFn;
+ glXGetVisualFromFBConfigProc glXGetVisualFromFBConfigFn;
+@@ -310,6 +314,7 @@ class GL_EXPORT GLXApi {
+ GLXDrawable drawable,
+ int32_t* numerator,
+ int32_t* denominator) = 0;
++ virtual __GLXextFuncPtr glXGetProcAddressARBFn(const GLubyte* procName) = 0;
+ virtual void glXGetSelectedEventFn(Display* dpy,
+ GLXDrawable drawable,
+ unsigned long* mask) = 0;
+@@ -394,6 +399,7 @@ class GL_EXPORT GLXApi {
+ ::gl::g_current_glx_context->glXGetFBConfigFromVisualSGIXFn
+ #define glXGetFBConfigs ::gl::g_current_glx_context->glXGetFBConfigsFn
+ #define glXGetMscRateOML ::gl::g_current_glx_context->glXGetMscRateOMLFn
++#define glXGetProcAddressARB ::gl::g_current_glx_context->glXGetProcAddressARBFn
+ #define glXGetSelectedEvent ::gl::g_current_glx_context->glXGetSelectedEventFn
+ #define glXGetSyncValuesOML ::gl::g_current_glx_context->glXGetSyncValuesOMLFn
+ #define glXGetVisualFromFBConfig \
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__bindings__autogen__glx.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__bindings__autogen__glx.cc
@@ -0,0 +1,61 @@
+--- src/3rdparty/chromium/ui/gl/gl_bindings_autogen_glx.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/gl_bindings_autogen_glx.cc
+@@ -119,6 +119,8 @@ void DriverGLX::InitializeExtensionBindings() {
+
+ ext.b_GLX_ARB_create_context =
+ gfx::HasExtension(extensions, "GLX_ARB_create_context");
++ ext.b_GLX_ARB_get_proc_address =
++ gfx::HasExtension(extensions, "GLX_ARB_get_proc_address");
+ ext.b_GLX_EXT_swap_control =
+ gfx::HasExtension(extensions, "GLX_EXT_swap_control");
+ ext.b_GLX_EXT_texture_from_pixmap =
+@@ -160,6 +162,11 @@ void DriverGLX::InitializeExtensionBindings() {
+ GetGLProcAddress("glXGetMscRateOML"));
+ }
+
++ if (ext.b_GLX_ARB_get_proc_address) {
++ fn.glXGetProcAddressARBFn = reinterpret_cast<glXGetProcAddressARBProc>(
++ GetGLProcAddress("glXGetProcAddressARB"));
++ }
++
+ if (ext.b_GLX_OML_sync_control) {
+ fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>(
+ GetGLProcAddress("glXGetSyncValuesOML"));
+@@ -350,6 +357,10 @@ bool GLXApiBase::glXGetMscRateOMLFn(Display* dpy,
+ return driver_->fn.glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
+ }
+
++__GLXextFuncPtr GLXApiBase::glXGetProcAddressARBFn(const GLubyte* procName) {
++ return driver_->fn.glXGetProcAddressARBFn(procName);
++}
++
+ void GLXApiBase::glXGetSelectedEventFn(Display* dpy,
+ GLXDrawable drawable,
+ unsigned long* mask) {
+@@ -652,6 +663,11 @@ bool TraceGLXApi::glXGetMscRateOMLFn(Display* dpy,
+ return glx_api_->glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
+ }
+
++__GLXextFuncPtr TraceGLXApi::glXGetProcAddressARBFn(const GLubyte* procName) {
++ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetProcAddressARB")
++ return glx_api_->glXGetProcAddressARBFn(procName);
++}
++
+ void TraceGLXApi::glXGetSelectedEventFn(Display* dpy,
+ GLXDrawable drawable,
+ unsigned long* mask) {
+@@ -1073,6 +1089,14 @@ bool LogGLXApi::glXGetMscRateOMLFn(Display* dpy,
+ << static_cast<const void*>(denominator) << ")");
+ bool result =
+ glx_api_->glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
++ GL_SERVICE_LOG("GL_RESULT: " << result);
++ return result;
++}
++
++__GLXextFuncPtr LogGLXApi::glXGetProcAddressARBFn(const GLubyte* procName) {
++ GL_SERVICE_LOG("glXGetProcAddressARB"
++ << "(" << static_cast<const void*>(procName) << ")");
++ __GLXextFuncPtr result = glx_api_->glXGetProcAddressARBFn(procName);
+ GL_SERVICE_LOG("GL_RESULT: " << result);
+ return result;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__context.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__context.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gl/gl_context.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/gl_context.cc
+@@ -415,7 +415,7 @@ bool GLContext::MakeVirtuallyCurrent(
+ DCHECK(virtual_context->IsCurrent(surface));
+
+ if (switched_real_contexts || virtual_context != current_virtual_context_) {
+-#if DCHECK_IS_ON()
++#if DCHECK_IS_ON() && !BUILDFLAG(IS_BSD)
+ GLenum error = glGetError();
+ // Accepting a context loss error here enables using debug mode to work on
+ // context loss handling in virtual context mode.
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__features.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__features.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gl/gl_features.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/gl_features.cc
+@@ -83,7 +83,7 @@ const base::Feature kDefaultPassthroughCommandDecoder
+ const base::Feature kDefaultPassthroughCommandDecoder {
+ "DefaultPassthroughCommandDecoder",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || \
+- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && \
+ !defined(CHROMECAST_BUILD)) || \
+ BUILDFLAG(IS_MAC)
+ base::FEATURE_ENABLED_BY_DEFAULT
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__image__glx__native__pixmap.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_gl__image__glx__native__pixmap.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gl/gl_image_glx_native_pixmap.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/gl_image_glx_native_pixmap.cc
+@@ -16,6 +16,8 @@
+ #include "ui/gl/buffer_format_utils.h"
+ #include "ui/gl/gl_bindings.h"
+
++#include <unistd.h>
++
+ namespace gl {
+
+ namespace {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_sync__control__vsync__provider.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_sync__control__vsync__provider.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/gl/sync_control_vsync_provider.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/sync_control_vsync_provider.h
+@@ -31,7 +31,7 @@ class SyncControlVSyncProvider : public gfx::VSyncProv
+ bool SupportGetVSyncParametersIfAvailable() const override;
+
+ static constexpr bool IsSupported() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
+@@ -46,7 +46,7 @@ class SyncControlVSyncProvider : public gfx::VSyncProv
+ virtual bool GetMscRate(int32_t* numerator, int32_t* denominator) = 0;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::TimeTicks last_timebase_;
+ uint64_t last_media_stream_counter_ = 0;
+ base::TimeDelta last_good_interval_;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_sync__control__vsync__provider.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gl_sync__control__vsync__provider.cc
@@ -0,0 +1,38 @@
+--- src/3rdparty/chromium/ui/gl/sync_control_vsync_provider.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gl/sync_control_vsync_provider.cc
+@@ -11,7 +11,7 @@
+ #include "base/trace_event/trace_event.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // These constants define a reasonable range for a calculated refresh interval.
+ // Calculating refreshes out of this range will be considered a fatal error.
+ const int64_t kMinVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 400;
+@@ -26,7 +26,7 @@ SyncControlVSyncProvider::SyncControlVSyncProvider() :
+ namespace gl {
+
+ SyncControlVSyncProvider::SyncControlVSyncProvider() : gfx::VSyncProvider() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On platforms where we can't get an accurate reading on the refresh
+ // rate we fall back to the assumption that we're displaying 60 frames
+ // per second.
+@@ -48,7 +48,7 @@ bool SyncControlVSyncProvider::GetVSyncParametersIfAva
+ base::TimeTicks* timebase_out,
+ base::TimeDelta* interval_out) {
+ TRACE_EVENT0("gpu", "SyncControlVSyncProvider::GetVSyncParameters");
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The actual clock used for the system time returned by glXGetSyncValuesOML
+ // is unspecified. In practice, the clock used is likely to be either
+ // CLOCK_REALTIME or CLOCK_MONOTONIC, so we compare the returned time to the
+@@ -159,7 +159,7 @@ bool SyncControlVSyncProvider::SupportGetVSyncParamete
+ }
+
+ bool SyncControlVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gtk_gtk__compat.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gtk_gtk__compat.cc
@@ -0,0 +1,50 @@
+--- src/3rdparty/chromium/ui/gtk/gtk_compat.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gtk/gtk_compat.cc
+@@ -62,27 +62,47 @@ void* GetLibGio() {
+ }
+
+ void* GetLibGio() {
++#if defined(OS_BSD)
++ static void* libgio = DlOpen("libgio-2.0.so");
++#else
+ static void* libgio = DlOpen("libgio-2.0.so.0");
++#endif
+ return libgio;
+ }
+
+ void* GetLibGdkPixbuf() {
++#if defined(OS_BSD)
++ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so");
++#else
+ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0");
++#endif
+ return libgdk_pixbuf;
+ }
+
+ void* GetLibGdk3() {
++#if defined(OS_BSD)
++ static void* libgdk3 = DlOpen("libgdk-3.so");
++#else
+ static void* libgdk3 = DlOpen("libgdk-3.so.0");
++#endif
+ return libgdk3;
+ }
+
+ void* GetLibGtk3(bool check = true) {
++#if defined(OS_BSD)
++ static void* libgtk3 = DlOpen("libgtk-3.so", check);
++#else
+ static void* libgtk3 = DlOpen("libgtk-3.so.0", check);
++#endif
+ return libgtk3;
+ }
+
+ void* GetLibGtk4(bool check = true) {
++#if defined(OS_BSD)
++ static void* libgtk4 = DlOpen("libgtk-4.so", check);
++#else
+ static void* libgtk4 = DlOpen("libgtk-4.so.1", check);
++#endif
+ return libgtk4;
+ }
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gtk_printing_print__dialog__gtk.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_gtk_printing_print__dialog__gtk.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/gtk/printing/print_dialog_gtk.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/gtk/printing/print_dialog_gtk.cc
+@@ -394,7 +394,7 @@ void PrintDialogGtk::ShowDialog(
+ GtkPrintCapabilities cap = static_cast<GtkPrintCapabilities>(
+ GTK_PRINT_CAPABILITY_GENERATE_PDF | GTK_PRINT_CAPABILITY_PAGE_SET |
+ GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE |
+- GTK_PRINT_CAPABILITY_REVERSE);
++ GTK_PRINT_CAPABILITY_REVERSE | GTK_PRINT_CAPABILITY_GENERATE_PS);
+ gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(dialog_),
+ cap);
+ gtk_print_unix_dialog_set_embed_page_setup(GTK_PRINT_UNIX_DIALOG(dialog_),
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_message__center_views_message__popup__view.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_message__center_views_message__popup__view.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/message_center/views/message_popup_view.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/message_center/views/message_popup_view.cc
+@@ -123,7 +123,7 @@ void MessagePopupView::Show() {
+ params.z_order = ui::ZOrderLevel::kFloatingWindow;
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Make the widget explicitly activatable as TYPE_POPUP is not activatable by
+ // default but we need focus for the inline reply textarea.
+ params.activatable = views::Widget::InitParams::Activatable::kYes;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_native__theme_native__theme.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_native__theme_native__theme.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/native_theme/native_theme.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/native_theme/native_theme.h
+@@ -59,7 +59,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
+ kCheckbox,
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ kFrameTopArea,
+ #endif
+ kInnerSpinButton,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_native__theme_native__theme__base.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_native__theme_native__theme__base.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/native_theme/native_theme_base.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/native_theme/native_theme_base.cc
+@@ -269,7 +269,7 @@ void NativeThemeBase::Paint(cc::PaintCanvas* canvas,
+ break;
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ case kFrameTopArea:
+ PaintFrameTopArea(canvas, state, rect, extra.frame_top_area,
+ color_scheme);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_common_egl__util.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_common_egl__util.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/ui/ozone/common/egl_util.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/common/egl_util.cc
+@@ -36,9 +36,9 @@ const base::FilePath::CharType kDefaultEglSoname[] =
+ FILE_PATH_LITERAL("libGLESv2.so");
+ #else // BUILDFLAG(IS_FUCHSIA)
+ const base::FilePath::CharType kDefaultEglSoname[] =
+- FILE_PATH_LITERAL("libEGL.so.1");
++ FILE_PATH_LITERAL("libEGL.so");
+ const base::FilePath::CharType kDefaultGlesSoname[] =
+- FILE_PATH_LITERAL("libGLESv2.so.2");
++ FILE_PATH_LITERAL("libGLESv2.so");
+ #endif
+ const base::FilePath::CharType kAngleEglSoname[] =
+ FILE_PATH_LITERAL("libEGL.so");
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_headless_headless__surface__factory.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_headless_headless__surface__factory.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/ozone/platform/headless/headless_surface_factory.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/platform/headless/headless_surface_factory.h
+@@ -26,7 +26,7 @@ class HeadlessSurfaceFactory : public SurfaceFactoryOz
+ // SurfaceFactoryOzone:
+ std::vector<gl::GLImplementationParts> GetAllowedGLImplementations() override;
+ GLOzone* GetGLOzone(const gl::GLImplementationParts& implementation) override;
+-#if BUILDFLAG(ENABLE_VULKAN) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ std::unique_ptr<gpu::VulkanImplementation> CreateVulkanImplementation(
+ bool use_swiftshader,
+ bool allow_protected_memory) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_headless_headless__surface__factory.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_headless_headless__surface__factory.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/ozone/platform/headless/headless_surface_factory.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/platform/headless/headless_surface_factory.cc
+@@ -34,7 +34,7 @@
+ #include "ui/ozone/platform/headless/headless_window_manager.h"
+ #include "ui/ozone/public/surface_ozone_canvas.h"
+
+-#if BUILDFLAG(ENABLE_VULKAN) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ #include "ui/ozone/platform/headless/vulkan_implementation_headless.h"
+ #endif
+
+@@ -280,7 +280,7 @@ void HeadlessSurfaceFactory::CheckBasePath() const {
+ PLOG(FATAL) << "Unable to write to output location";
+ }
+
+-#if BUILDFLAG(ENABLE_VULKAN) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ std::unique_ptr<gpu::VulkanImplementation>
+ HeadlessSurfaceFactory::CreateVulkanImplementation(
+ bool use_swiftshader,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_headless_ozone__platform__headless.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_headless_ozone__platform__headless.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/ozone/platform/headless/ozone_platform_headless.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/platform/headless/ozone_platform_headless.cc
+@@ -102,7 +102,7 @@ class OzonePlatformHeadless : public OzonePlatform {
+ }
+
+ // Desktop Linux, not ChromeOS.
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
+ !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMECAST)
+ const PlatformProperties& GetPlatformProperties() override {
+ static base::NoDestructor<OzonePlatform::PlatformProperties> properties;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/ui/ozone/platform/wayland/gpu/vulkan_implementation_wayland.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/platform/wayland/gpu/vulkan_implementation_wayland.cc
+@@ -38,7 +38,11 @@ bool VulkanImplementationWayland::InitializeVulkanInst
+
+ path = path.Append("libvk_swiftshader.so");
+ } else {
++#if BUILDFLAG(IS_BSD)
++ path = base::FilePath("libvulkan.so");
++#else
+ path = base::FilePath("libvulkan.so.1");
++#endif
+ }
+
+ return vulkan_instance_.Initialize(path, required_extensions, {});
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_x11_ozone__platform__x11.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_x11_ozone__platform__x11.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/ozone/platform/x11/ozone_platform_x11.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -204,7 +204,7 @@ class OzonePlatformX11 : public OzonePlatform,
+ properties->supports_global_application_menus = true;
+ properties->app_modal_dialogs_use_event_blocker = true;
+ properties->fetch_buffer_formats_for_gmb_on_gpu = true;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ properties->supports_vaapi = true;
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_x11_vulkan__implementation__x11.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_platform_x11_vulkan__implementation__x11.cc
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/ui/ozone/platform/x11/vulkan_implementation_x11.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/platform/x11/vulkan_implementation_x11.cc
+@@ -58,7 +58,11 @@ bool VulkanImplementationX11::InitializeVulkanInstance
+
+ path = path.Append("libvk_swiftshader.so");
+ } else {
++#if BUILDFLAG(IS_BSD)
++ path = base::FilePath("libvulkan.so");
++#else
+ path = base::FilePath("libvulkan.so.1");
++#endif
+ }
+
+ return vulkan_instance_.Initialize(path, required_extensions, {});
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_public_ozone__platform.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_ozone_public_ozone__platform.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/ozone/public/ozone_platform.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/ozone/public/ozone_platform.h
+@@ -151,7 +151,7 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+ // back via gpu extra info.
+ bool fetch_buffer_formats_for_gmb_on_gpu = false;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
+ // Linux. At the moment, VA-API Linux implementation supports only X11
+ // backend. This implementation must be refactored to support Ozone
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_platform__window_platform__window__init__properties.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_platform__window_platform__window__init__properties.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/platform_window/platform_window_init_properties.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/platform_window/platform_window_init_properties.h
+@@ -54,7 +54,7 @@ class ScenicWindowDelegate;
+ class ScenicWindowDelegate;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ class X11ExtensionDelegate;
+ #endif
+
+@@ -114,7 +114,7 @@ struct COMPONENT_EXPORT(PLATFORM_WINDOW) PlatformWindo
+
+ PlatformWindowShadowType shadow_type = PlatformWindowShadowType::kDefault;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool prefer_dark_theme = false;
+ gfx::ImageSkia* icon = nullptr;
+ absl::optional<int> background_color;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_app__locale__settings.grd
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_app__locale__settings.grd
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/app_locale_settings.grd.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/app_locale_settings.grd
+@@ -218,7 +218,7 @@
+ 75%
+ </message>
+ </if>
+- <if expr="(is_linux or is_android or is_bsd or is_fuchsia) and not (chromeos_ash or chromeos_lacros)">
++ <if expr="(is_posix or is_android or is_bsd or is_fuchsia) and not (chromeos_ash or chromeos_lacros)">
+ <!-- The font used in Web UI (e.g. History). Note that these are only
+ backups. We try to use the system font if possible. -->
+ <message name="IDS_WEB_FONT_FAMILY" use_name_for_id="true">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__bn.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__bn.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_bn.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_bn.xtb
+@@ -10,7 +10,7 @@
+ <translation id="IDS_WEB_FONT_FAMILY">Vrinda</translation>
+ <translation id="IDS_WEB_FONT_FAMILY_XP">Vrinda</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">Lohit Bengali</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__ja.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__ja.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_ja.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_ja.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,Hiragino Kaku Gothic ProN,sans-serif</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">VL PGothic,Sazanami Gothic,Kochi Gothic,sans-serif</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__ko.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__ko.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_ko.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_ko.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,Apple SD Gothic Neo,AppleGothic,sans-serif</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">Noto Sans CJK KR,NanumGothic,UnDotum,Baekmuk Gulim,sans-serif</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__ml.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__ml.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_ml.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_ml.xtb
+@@ -9,7 +9,7 @@
+ <translation id="IDS_WEB_FONT_FAMILY">'Segoe UI',Arial,AnjaliOldLipi,Rachana,Kartika</translation>
+ <translation id="IDS_WEB_FONT_FAMILY_XP">Arial,AnjaliOldLipi,Rachana,Kartika</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">Arial,AnjaliOldLipi,Rachana,Kartika,sans-serif</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__th.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__th.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_th.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_th.xtb
+@@ -6,7 +6,7 @@
+ <translation id="IDS_WEB_FONT_FAMILY">Tahoma,sans-serif</translation>
+ <translation id="IDS_WEB_FONT_FAMILY_XP">Tahoma,sans-serif</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">Norasi,Waree,Garuda,Loma,sans-serif</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__zh-CN.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__zh-CN.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_zh-CN.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_zh-CN.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,PingFang SC,STHeiti,sans-serif</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">Noto Sans CJK SC, WenQuanYi Zen Hei, sans-serif</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__zh-TW.xtb
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_strings_translations_app__locale__settings__zh-TW.xtb
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/strings/translations/app_locale_settings_zh-TW.xtb.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/strings/translations/app_locale_settings_zh-TW.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,PingFang TC,Heiti TC,sans-serif</translation>
+ </if>
+-<if expr="is_linux and not chromeos_ash or chromeos_lacros">
++<if expr="is_posix and not chromeos_ash or chromeos_lacros">
+ <translation id="IDS_WEB_FONT_FAMILY">Noto Sans CJK SC, WenQuanYi Zen Hei, sans-serif</translation>
+ </if>
+ <if expr="chromeos_ash">
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_prefix__selector.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_prefix__selector.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/controls/prefix_selector.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/controls/prefix_selector.h
+@@ -81,7 +81,7 @@ class VIEWS_EXPORT PrefixSelector : public ui::TextInp
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_prefix__selector.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_prefix__selector.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/controls/prefix_selector.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/controls/prefix_selector.cc
+@@ -171,7 +171,7 @@ bool PrefixSelector::ShouldDoLearning() {
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool PrefixSelector::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_textfield_textfield.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_textfield_textfield.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/controls/textfield/textfield.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/controls/textfield/textfield.h
+@@ -443,7 +443,7 @@ class VIEWS_EXPORT Textfield : public View,
+ // Set whether the text should be used to improve typing suggestions.
+ void SetShouldDoLearning(bool value) { should_do_learning_ = value; }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_textfield_textfield.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_controls_textfield_textfield.cc
@@ -0,0 +1,64 @@
+--- src/3rdparty/chromium/ui/views/controls/textfield/textfield.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/controls/textfield/textfield.cc
+@@ -73,7 +73,7 @@
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "ui/base/ime/linux/text_edit_command_auralinux.h"
+ #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h"
+ #endif
+@@ -166,7 +166,7 @@ bool IsControlKeyModifier(int flags) {
+ // Control-modified key combination, but we cannot extend it to other platforms
+ // as Control has different meanings and behaviors.
+ // https://crrev.com/2580483002/#msg46
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return flags & ui::EF_CONTROL_DOWN;
+ #else
+ return false;
+@@ -720,7 +720,7 @@ bool Textfield::OnKeyPressed(const ui::KeyEvent& event
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
+ ui::GetTextEditKeyBindingsDelegate();
+ std::vector<ui::TextEditCommandAuraLinux> commands;
+@@ -866,7 +866,7 @@ bool Textfield::SkipDefaultKeyEventProcessing(const ui
+ bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Skip any accelerator handling that conflicts with custom keybindings.
+ ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
+ ui::GetTextEditKeyBindingsDelegate();
+@@ -1728,7 +1728,7 @@ bool Textfield::ShouldDoLearning() {
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(https://crbug.com/952355): Implement this method to support Korean IME
+ // reconversion feature on native text fields (e.g. find bar).
+ bool Textfield::SetCompositionFromExistingText(
+@@ -2227,14 +2227,14 @@ ui::TextEditCommand Textfield::GetCommandForKeyEvent(
+ #endif
+ return ui::TextEditCommand::DELETE_BACKWARD;
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Only erase by line break on Linux and ChromeOS.
+ if (shift)
+ return ui::TextEditCommand::DELETE_TO_BEGINNING_OF_LINE;
+ #endif
+ return ui::TextEditCommand::DELETE_WORD_BACKWARD;
+ case ui::VKEY_DELETE:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Only erase by line break on Linux and ChromeOS.
+ if (shift && control)
+ return ui::TextEditCommand::DELETE_TO_END_OF_LINE;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_corewm_tooltip__aura.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_corewm_tooltip__aura.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/corewm/tooltip_aura.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/corewm/tooltip_aura.cc
+@@ -50,7 +50,7 @@ bool CanUseTranslucentTooltipWidget() {
+ bool CanUseTranslucentTooltipWidget() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_WIN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_examples_widget__example.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_examples_widget__example.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/examples/widget_example.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/examples/widget_example.cc
+@@ -49,7 +49,7 @@ void WidgetExample::CreateExampleView(View* container)
+ modal_button->SetCallback(
+ base::BindRepeating(&WidgetExample::CreateDialogWidget,
+ base::Unretained(this), modal_button, true));
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Windows does not support TYPE_CONTROL top-level widgets.
+ LabelButton* control_button = BuildButton(
+ container, GetStringUTF16(IDS_WIDGET_CHILD_WIDGET_BUTTON_LABEL));
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_focus_focus__manager.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_focus_focus__manager.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/views/focus/focus_manager.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/focus/focus_manager.cc
+@@ -635,7 +635,7 @@ bool FocusManager::RedirectAcceleratorToBubbleAnchorWi
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Processing an accelerator can delete things. Because we
+ // need these objects afterwards on Linux, save widget_ as weak pointer and
+ // save the close_on_deactivate property value of widget_delegate in a
+@@ -652,7 +652,7 @@ bool FocusManager::RedirectAcceleratorToBubbleAnchorWi
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Need to manually close the bubble widget on Linux. On Linux when the
+ // bubble is shown, the main widget remains active. Because of that when
+ // focus is set to the main widget to process accelerator, the main widget
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_linux__ui_linux__ui.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_linux__ui_linux__ui.h
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/views/linux_ui/linux_ui.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/linux_ui/linux_ui.h
+@@ -21,7 +21,7 @@
+ #include "ui/views/controls/button/button.h"
+ #include "ui/views/views_export.h"
+
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST)
+ #include "ui/shell_dialogs/shell_dialog_linux.h"
+ #endif
+
+@@ -57,7 +57,7 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMeth
+ // project that wants to do linux desktop native rendering.
+ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory,
+ public gfx::SkiaFontDelegate,
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST)
+ public ui::ShellDialogLinux,
+ #endif
+ public ui::TextEditKeyBindingsDelegateAuraLinux,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_linux__ui_linux__ui.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_linux__ui_linux__ui.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/linux_ui/linux_ui.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/linux_ui/linux_ui.cc
+@@ -21,7 +21,7 @@ void LinuxUI::SetInstance(std::unique_ptr<LinuxUI> ins
+ g_linux_ui = instance.release();
+
+ SkiaFontDelegate::SetInstance(g_linux_ui);
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST)
+ ShellDialogLinux::SetInstance(g_linux_ui);
+ #endif
+ ui::SetTextEditKeyBindingsDelegate(g_linux_ui);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_style_platform__style.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_style_platform__style.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/views/style/platform_style.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/style/platform_style.cc
+@@ -52,7 +52,7 @@ const bool PlatformStyle::kAdjustBubbleIfOffscreen =
+ const bool PlatformStyle::kAdjustBubbleIfOffscreen =
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ false;
+ #else
+ true;
+@@ -82,7 +82,7 @@ gfx::Range PlatformStyle::RangeToDeleteBackwards(const
+ #endif // !BUILDFLAG(IS_MAC)
+
+ #if !BUILDFLAG(ENABLE_DESKTOP_AURA) || \
+- (!BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS))
++ (!BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD))
+ // static
+ std::unique_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder(
+ LabelButton* button) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_test_ui__controls__factory__desktop__aura__ozone.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_test_ui__controls__factory__desktop__aura__ozone.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/views/test/ui_controls_factory_desktop_aura_ozone.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/test/ui_controls_factory_desktop_aura_ozone.cc
+@@ -25,7 +25,7 @@
+ #include "ui/ozone/public/ozone_ui_controls_test_helper.h"
+ #include "ui/views/test/test_desktop_screen_ozone.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
+ #else
+ #include "ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h"
+@@ -157,7 +157,7 @@ class UIControlsDesktopOzone : public UIControlsAura {
+
+ private:
+ aura::Window* RootWindowForPoint(const gfx::Point& point) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Most interactive_ui_tests run inside of the aura_test_helper
+ // environment. This means that we can't rely on display::Screen and several
+ // other things to work properly. Therefore we hack around this by
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_views__delegate.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_views__delegate.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/views_delegate.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/views_delegate.h
+@@ -139,7 +139,7 @@ class VIEWS_EXPORT ViewsDelegate {
+ // environment.
+ virtual bool IsWindowInMetro(gfx::NativeWindow window) const;
+ #elif BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ virtual gfx::ImageSkia* GetDefaultWindowIcon() const;
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_views__delegate.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_views__delegate.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/views_delegate.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/views_delegate.cc
+@@ -95,7 +95,7 @@ bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow
+ return false;
+ }
+ #elif BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
+ return nullptr;
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_desktop__aura_desktop__screen__ozone.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_desktop__aura_desktop__screen__ozone.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/widget/desktop_aura/desktop_screen_ozone.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/widget/desktop_aura/desktop_screen_ozone.cc
+@@ -25,7 +25,7 @@ gfx::NativeWindow DesktopScreenOzone::GetNativeWindowF
+ widget);
+ }
+
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ std::unique_ptr<display::Screen> CreateDesktopScreen() {
+ auto screen = std::make_unique<aura::ScreenOzone>();
+ screen->Initialize();
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+@@ -907,7 +907,7 @@ display::Display DesktopWindowTreeHostPlatform::GetDis
+ // DesktopWindowTreeHost:
+
+ // Linux subclasses this host and adds some Linux specific bits.
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // static
+ DesktopWindowTreeHost* DesktopWindowTreeHost::Create(
+ internal::NativeWidgetDelegate* native_widget_delegate,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_native__widget__aura.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_native__widget__aura.cc
@@ -0,0 +1,29 @@
+--- src/3rdparty/chromium/ui/views/widget/native_widget_aura.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/widget/native_widget_aura.cc
+@@ -69,7 +69,7 @@
+ #endif
+
+ #if BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
+ #endif
+
+@@ -1154,7 +1154,7 @@ namespace {
+
+ namespace {
+ #if BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ void CloseWindow(aura::Window* window) {
+ if (window) {
+ Widget* widget = Widget::GetWidgetForNativeView(window);
+@@ -1185,7 +1185,7 @@ void Widget::CloseAllSecondaryWidgets() {
+ #endif
+
+ #if BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ DesktopWindowTreeHostLinux::CleanUpWindowList(CloseWindow);
+ #endif
+ }
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_widget.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_widget_widget.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/views/widget/widget.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/widget/widget.cc
+@@ -48,7 +48,7 @@
+ #include "ui/views/window/custom_frame_view.h"
+ #include "ui/views/window/dialog_delegate.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/views/linux_ui/linux_ui.h"
+ #endif
+
+@@ -1821,7 +1821,7 @@ const ui::NativeTheme* Widget::GetNativeTheme() const
+ if (parent_)
+ return parent_->GetNativeTheme();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (const views::LinuxUI* linux_ui = views::LinuxUI::instance()) {
+ if (auto* native_theme = linux_ui->GetNativeTheme(GetNativeWindow()))
+ return native_theme;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_window_custom__frame__view.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_window_custom__frame__view.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/window/custom_frame_view.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/window/custom_frame_view.cc
+@@ -265,7 +265,7 @@ int CustomFrameView::CaptionButtonY() const {
+ // drawn flush with the screen edge, they still obey Fitts' Law.
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return FrameBorderThickness();
+ #else
+ return frame_->IsMaximized() ? FrameBorderThickness() : kFrameShadowThickness;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_window_dialog__delegate.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_window_dialog__delegate.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/window/dialog_delegate.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/window/dialog_delegate.cc
+@@ -79,7 +79,7 @@ bool DialogDelegate::CanSupportCustomFrame(gfx::Native
+
+ // static
+ bool DialogDelegate::CanSupportCustomFrame(gfx::NativeView parent) {
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(ENABLE_DESKTOP_AURA)
+ // The new style doesn't support unparented dialogs on Linux desktop.
+ return parent != nullptr;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_window_frame__background.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_views_window_frame__background.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/ui/views/window/frame_background.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/views/window/frame_background.cc
+@@ -110,7 +110,7 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canv
+ int width) const {
+ // Fill the top with the frame color first so we have a constant background
+ // for areas not covered by the theme image.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(ENABLE_DESKTOP_AURA)
+ ui::NativeTheme::ExtraParams params;
+ params.frame_top_area.use_custom_frame = use_custom_frame_;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_webui_resources_js_cr.js
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_webui_resources_js_cr.js
@@ -0,0 +1,14 @@
+--- src/3rdparty/chromium/ui/webui/resources/js/cr.js.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/ui/webui/resources/js/cr.js
+@@ -438,6 +438,11 @@ var cr = cr || function(global) {
+ return returnValue;
+ },
+
++ /** Whether this is on *BSD. */
++ get isBSD() {
++ return /BSD/.test(navigator.userAgent);
++ },
++
+ /** Whether this is on vanilla Linux (not chromeOS). */
+ get isLinux() {
+ return /Linux/.test(navigator.userAgent);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_BUILD.gn
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_BUILD.gn
@@ -0,0 +1,45 @@
+--- src/3rdparty/chromium/v8/BUILD.gn.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/BUILD.gn
+@@ -1227,6 +1227,14 @@ config("toolchain") {
+ } else if (target_os == "win") {
+ defines += [ "V8_HAVE_TARGET_OS" ]
+ defines += [ "V8_TARGET_OS_WIN" ]
++ } else if (target_os == "openbsd") {
++ defines += [ "V8_HAVE_TARGET_OS" ]
++ defines += [ "V8_TARGET_OS_OPENBSD" ]
++ defines += [ "V8_TARGET_OS_BSD" ]
++ } else if (target_os == "freebsd") {
++ defines += [ "V8_HAVE_TARGET_OS" ]
++ defines += [ "V8_TARGET_OS_FREEBSD" ]
++ defines += [ "V8_TARGET_OS_BSD" ]
+ }
+
+ # TODO(infra): Support v8_enable_prof on Windows.
+@@ -5275,7 +5283,7 @@ v8_component("v8_libbase") {
+ }
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
+ "src/base/platform/platform-linux.cc",
+@@ -5285,6 +5293,18 @@ v8_component("v8_libbase") {
+ "dl",
+ "rt",
+ ]
++ } else if (is_openbsd) {
++ sources += [
++ "src/base/debug/stack_trace_posix.cc",
++ "src/base/platform/platform-openbsd.cc",
++ ]
++ libs = [ "execinfo" ]
++ } else if (is_freebsd) {
++ sources += [
++ "src/base/debug/stack_trace_posix.cc",
++ "src/base/platform/platform-freebsd.cc",
++ ]
++ libs = [ "execinfo" ]
+ } else if (current_os == "aix") {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_include_v8config.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_include_v8config.h
@@ -0,0 +1,37 @@
+--- src/3rdparty/chromium/v8/include/v8config.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/include/v8config.h
+@@ -183,6 +183,8 @@ path. Add it with -I<path> to the command line
+ && !defined(V8_TARGET_OS_FUCHSIA) \
+ && !defined(V8_TARGET_OS_IOS) \
+ && !defined(V8_TARGET_OS_LINUX) \
++ && !defined(V8_TARGET_OS_OPENBSD) \
++ && !defined(V8_TARGET_OS_FREEBSD) \
+ && !defined(V8_TARGET_OS_MACOS) \
+ && !defined(V8_TARGET_OS_WIN)
+ # error No known target OS defined.
+@@ -194,6 +196,8 @@ path. Add it with -I<path> to the command line
+ || defined(V8_TARGET_OS_FUCHSIA) \
+ || defined(V8_TARGET_OS_IOS) \
+ || defined(V8_TARGET_OS_LINUX) \
++ || defined(V8_TARGET_OS_OPENBSD) \
++ || defined(V8_TARGET_OS_FREEBSD) \
+ || defined(V8_TARGET_OS_MACOS) \
+ || defined(V8_TARGET_OS_WIN)
+ # error A target OS is defined but V8_HAVE_TARGET_OS is unset.
+@@ -214,6 +218,16 @@ path. Add it with -I<path> to the command line
+
+ #ifdef V8_OS_LINUX
+ # define V8_TARGET_OS_LINUX
++#endif
++
++#ifdef V8_OS_OPENBSD
++# define V8_TARGET_OS_OPENBSD
++# define V8_TARGET_OS_BSD
++#endif
++
++#ifdef V8_OS_FREEBSD
++# define V8_TARGET_OS_OPENBSD
++# define V8_TARGET_OS_BSD
+ #endif
+
+ #ifdef V8_OS_MACOS
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_api_api.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_api_api.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/v8/src/api/api.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/api/api.cc
+@@ -138,7 +138,7 @@
+ #include "src/wasm/wasm-serialization.h"
+ #endif // V8_ENABLE_WEBASSEMBLY
+
+-#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD
++#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD
+ #include <signal.h>
+ #include "include/v8-wasm-trap-handler-posix.h"
+ #include "src/trap-handler/handler-inside-posix.h"
+@@ -6064,7 +6064,7 @@ bool v8::V8::Initialize(const int build_config) {
+ return true;
+ }
+
+-#if V8_OS_LINUX || V8_OS_DARWIN
++#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD
+ bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info,
+ void* context) {
+ #if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_atomicops.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_atomicops.h
@@ -0,0 +1,33 @@
+--- src/3rdparty/chromium/v8/src/base/atomicops.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/base/atomicops.h
+@@ -57,10 +57,10 @@ using Atomic32 = int32_t;
+ using Atomic8 = char;
+ using Atomic16 = int16_t;
+ using Atomic32 = int32_t;
+-#if defined(V8_HOST_ARCH_64_BIT)
++#if defined(V8_HOST_ARCH_64_BIT) || defined(V8_OS_OPENBSD)
+ // We need to be able to go between Atomic64 and AtomicWord implicitly. This
+ // means Atomic64 and AtomicWord should be the same type on 64-bit.
+-#if defined(__ILP32__)
++#if defined(__ILP32__) && !defined(V8_OS_OPENBSD)
+ using Atomic64 = int64_t;
+ #else
+ using Atomic64 = intptr_t;
+@@ -257,7 +257,7 @@ inline Atomic32 SeqCst_Load(volatile const Atomic32* p
+ std::memory_order_seq_cst);
+ }
+
+-#if defined(V8_HOST_ARCH_64_BIT)
++#if defined(V8_HOST_ARCH_64_BIT) || defined(V8_OS_OPENBSD)
+
+ inline Atomic64 Relaxed_CompareAndSwap(volatile Atomic64* ptr,
+ Atomic64 old_value, Atomic64 new_value) {
+@@ -468,7 +468,7 @@ inline int Relaxed_Memcmp(volatile const Atomic8* s1,
+
+ // On some platforms we need additional declarations to make
+ // AtomicWord compatible with our other Atomic* types.
+-#if defined(V8_OS_DARWIN) || defined(V8_OS_OPENBSD) || defined(V8_OS_AIX)
++#if defined(V8_OS_DARWIN) || defined(V8_OS_AIX)
+ #include "src/base/atomicops_internals_atomicword_compat.h"
+ #endif
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc
@@ -0,0 +1,32 @@
+--- src/3rdparty/chromium/v8/src/base/platform/platform-freebsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/base/platform/platform-freebsd.cc
+@@ -43,14 +43,10 @@ TimezoneCache* OS::CreateTimezoneCache() {
+ return new PosixDefaultTimezoneCache();
+ }
+
+-static unsigned StringToLong(char* buffer) {
+- return static_cast<unsigned>(strtol(buffer, nullptr, 16));
+-}
+-
+ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
+ std::vector<SharedLibraryAddress> result;
+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid()};
+- size_t miblen = sizeof(mib) / sizeof(mib[0]);
++ unsigned int miblen = sizeof(mib) / sizeof(mib[0]);
+ size_t buffer_size;
+ if (sysctl(mib, miblen, nullptr, &buffer_size, nullptr, 0) == 0) {
+ // Overallocate the buffer by 1/3 to account for concurrent
+@@ -82,8 +78,13 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLib
+ lib_name = std::string(path);
+ }
+ result.push_back(SharedLibraryAddress(
++#if defined(__i386__) || defined(OS_FREEBSD)
++ lib_name, static_cast<uintptr_t>(map->kve_start),
++ static_cast<uintptr_t>(map->kve_end)));
++#else
+ lib_name, reinterpret_cast<uintptr_t>(map->kve_start),
+ reinterpret_cast<uintptr_t>(map->kve_end)));
++#endif
+ }
+
+ start += ssize;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-openbsd.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-openbsd.cc
@@ -0,0 +1,28 @@
+--- src/3rdparty/chromium/v8/src/base/platform/platform-openbsd.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/base/platform/platform-openbsd.cc
+@@ -6,6 +6,7 @@
+ // POSIX-compatible parts, the implementation is in platform-posix.cc.
+
+ #include <pthread.h>
++#include <pthread_np.h>
+ #include <semaphore.h>
+ #include <signal.h>
+ #include <stdlib.h>
+@@ -121,6 +122,17 @@ void OS::AdjustSchedulingParams() {}
+ }
+
+ void OS::AdjustSchedulingParams() {}
++
++// static
++Stack::StackSlot Stack::GetStackStart() {
++ stack_t ss;
++ void *base;
++ if (pthread_stackseg_np(pthread_self(), &ss) != 0)
++ return nullptr;
++
++ base = (void*)((size_t) ss.ss_sp - ss.ss_size);
++ return reinterpret_cast<uint8_t*>(base) + ss.ss_size;
++}
+
+ std::vector<OS::MemoryRange> OS::GetFreeMemoryRangesWithin(
+ OS::Address boundary_start, OS::Address boundary_end, size_t minimum_size,
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-posix.cc
@@ -0,0 +1,53 @@
+--- src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -68,7 +68,7 @@
+ #include <sys/syscall.h>
+ #endif
+
+-#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_OPENBSD || V8_OS_SOLARIS
++#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_BSD || V8_OS_SOLARIS
+ #define MAP_ANONYMOUS MAP_ANON
+ #endif
+
+@@ -294,8 +294,15 @@ void OS::SetRandomMmapSeed(int64_t seed) {
+ }
+ }
+
++#if V8_OS_OPENBSD
++// Allow OpenBSD's mmap to select a random address on OpenBSD
+ // static
+ void* OS::GetRandomMmapAddr() {
++ return nullptr;
++}
++#else
++// static
++void* OS::GetRandomMmapAddr() {
+ uintptr_t raw_addr;
+ {
+ MutexGuard guard(rng_mutex.Pointer());
+@@ -386,6 +393,7 @@ void* OS::GetRandomMmapAddr() {
+ #endif
+ return reinterpret_cast<void*>(raw_addr);
+ }
++#endif
+
+ // TODO(bbudge) Move Cygwin and Fuchsia stuff into platform-specific files.
+ #if !V8_OS_CYGWIN && !V8_OS_FUCHSIA
+@@ -612,7 +620,7 @@ bool OS::HasLazyCommits() {
+
+ // static
+ bool OS::HasLazyCommits() {
+-#if V8_OS_AIX || V8_OS_LINUX || V8_OS_DARWIN
++#if V8_OS_AIX || V8_OS_LINUX || V8_OS_DARWIN || V8_OS_BSD
+ return true;
+ #else
+ // TODO(bbudge) Return true for all POSIX platforms.
+@@ -1231,7 +1239,7 @@ void Thread::SetThreadLocal(LocalStorageKey key, void*
+ // keep this version in POSIX as most Linux-compatible derivatives will
+ // support it. MacOS and FreeBSD are different here.
+ #if !defined(V8_OS_FREEBSD) && !defined(V8_OS_DARWIN) && !defined(_AIX) && \
+- !defined(V8_OS_SOLARIS)
++ !defined(V8_OS_SOLARIS) && !defined(V8_OS_OPENBSD)
+
+ // static
+ Stack::StackSlot Stack::GetStackStart() {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_sys-info.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_sys-info.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/v8/src/base/sys-info.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/base/sys-info.cc
+@@ -38,7 +38,7 @@ int SysInfo::NumberOfProcessors() {
+ // static
+ int SysInfo::NumberOfProcessors() {
+ #if V8_OS_OPENBSD
+- int mib[2] = {CTL_HW, HW_NCPU};
++ int mib[2] = {CTL_HW, HW_NCPUONLINE};
+ int ncpu = 0;
+ size_t len = sizeof(ncpu);
+ if (sysctl(mib, arraysize(mib), &ncpu, &len, nullptr, 0) != 0) {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_compiler_backend_ia32_instruction-selector-ia32.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_compiler_backend_ia32_instruction-selector-ia32.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc
+@@ -3021,6 +3021,7 @@ void InstructionSelector::VisitI8x16Shuffle(Node* node
+ Emit(opcode, 1, &dst, input_count, inputs, temp_count, temps);
+ }
+
++#if V8_ENABLE_WEBASSEMBLY
+ void InstructionSelector::VisitI8x16Swizzle(Node* node) {
+ InstructionCode op = kIA32I8x16Swizzle;
+
+@@ -3074,6 +3075,9 @@ void InstructionSelector::VisitF32x4Pmin(Node* node) {
+ void InstructionSelector::VisitF32x4Pmin(Node* node) {
+ VisitMinOrMax(this, node, kIA32Minps, true);
+ }
++#else
++void InstructionSelector::VisitI8x16Swizzle(Node* node) { UNREACHABLE(); }
++#endif // V8_ENABLE_WEBASSEMBLY
+
+ void InstructionSelector::VisitF32x4Pmax(Node* node) {
+ VisitMinOrMax(this, node, kIA32Maxps, true);
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_diagnostics_perf-jit.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_diagnostics_perf-jit.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/v8/src/diagnostics/perf-jit.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/diagnostics/perf-jit.h
+@@ -31,7 +31,7 @@
+ #include "include/v8config.h"
+
+ // {PerfJitLogger} is only implemented on Linux.
+-#if V8_OS_LINUX
++#if defined(V8_OS_LINUX) || defined(V8_OS_BSD)
+
+ #include "src/logging/log.h"
+
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_diagnostics_perf-jit.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_diagnostics_perf-jit.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/v8/src/diagnostics/perf-jit.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/diagnostics/perf-jit.cc
+@@ -30,7 +30,7 @@
+ #include "src/common/assert-scope.h"
+
+ // Only compile the {PerfJitLogger} on Linux.
+-#if V8_OS_LINUX
++#if defined(V8_OS_LINUX) || defined(V8_OS_BSD)
+
+ #include <fcntl.h>
+ #include <sys/mman.h>
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_trap-handler_handler-inside-posix.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_trap-handler_handler-inside-posix.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/v8/src/trap-handler/handler-inside-posix.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/trap-handler/handler-inside-posix.h
+@@ -13,7 +13,7 @@ namespace trap_handler {
+ namespace internal {
+ namespace trap_handler {
+
+-#if V8_OS_LINUX || V8_OS_FREEBSD
++#if V8_OS_LINUX || V8_OS_FREEBSD || V8_OS_OPENBSD
+ constexpr int kOobSignal = SIGSEGV;
+ #elif V8_OS_DARWIN
+ constexpr int kOobSignal = SIGBUS;
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_trap-handler_handler-inside-posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_trap-handler_handler-inside-posix.cc
@@ -0,0 +1,26 @@
+--- src/3rdparty/chromium/v8/src/trap-handler/handler-inside-posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/trap-handler/handler-inside-posix.cc
+@@ -53,6 +53,8 @@ namespace trap_handler {
+ #define CONTEXT_REG(reg, REG) &uc->uc_mcontext->__ss.__##reg
+ #elif V8_OS_FREEBSD
+ #define CONTEXT_REG(reg, REG) &uc->uc_mcontext.mc_##reg
++#elif V8_OS_OPENBSD
++#define CONTEXT_REG(reg, REG) &uc->sc_##reg
+ #else
+ #error "Unsupported platform."
+ #endif
+@@ -62,8 +64,12 @@ bool IsKernelGeneratedSignal(siginfo_t* info) {
+ // si_code at its default of 0 for signals that don’t originate in hardware.
+ // The other conditions are only relevant for Linux.
+ return info->si_code > 0 && info->si_code != SI_USER &&
+- info->si_code != SI_QUEUE && info->si_code != SI_TIMER &&
+- info->si_code != SI_ASYNCIO && info->si_code != SI_MESGQ;
++ info->si_code != SI_QUEUE && info->si_code != SI_TIMER
++#ifdef V8_OS_OPENBSD
++ ;
++#else
++ && info->si_code != SI_ASYNCIO && info->si_code != SI_MESGQ;
++#endif
+ }
+
+ class UnmaskOobSignalScope {
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_trap-handler_trap-handler.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_trap-handler_trap-handler.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/v8/src/trap-handler/trap-handler.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/trap-handler/trap-handler.h
+@@ -20,7 +20,7 @@ namespace trap_handler {
+ // X64 on Linux, Windows, MacOS, FreeBSD.
+ #if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
+ ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \
+- V8_OS_FREEBSD)
++ V8_OS_FREEBSD || V8_OS_OPENBSD)
+ #define V8_TRAP_HANDLER_SUPPORTED true
+ // Arm64 (non-simulator) on Mac.
+ #elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_DARWIN
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_wasm_baseline_ia32_liftoff-assembler-ia32.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_wasm_baseline_ia32_liftoff-assembler-ia32.h
@@ -0,0 +1,101 @@
+--- src/3rdparty/chromium/v8/src/wasm/baseline/ia32/liftoff-assembler-ia32.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/src/wasm/baseline/ia32/liftoff-assembler-ia32.h
+@@ -434,7 +434,7 @@ void LiftoffAssembler::Load(LiftoffRegister dst, Regis
+ }
+
+ void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
+- Register offset_reg, uint32_t offset_imm,
++ Register offset_reg, uintptr_t offset_imm,
+ LoadType type, LiftoffRegList pinned,
+ uint32_t* protected_load_pc, bool is_load_mem,
+ bool i64_offset) {
+@@ -511,7 +511,7 @@ void LiftoffAssembler::Store(Register dst_addr, Regist
+ }
+
+ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister src,
++ uintptr_t offset_imm, LiftoffRegister src,
+ StoreType type, LiftoffRegList pinned,
+ uint32_t* protected_store_pc, bool is_store_mem) {
+ DCHECK_EQ(type.value_type() == kWasmI64, src.is_gp_pair());
+@@ -579,7 +579,7 @@ void LiftoffAssembler::AtomicLoad(LiftoffRegister dst,
+ }
+
+ void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
+- Register offset_reg, uint32_t offset_imm,
++ Register offset_reg, uintptr_t offset_imm,
+ LoadType type, LiftoffRegList pinned) {
+ if (type.value() != LoadType::kI64Load) {
+ Load(dst, src_addr, offset_reg, offset_imm, type, pinned, nullptr, true);
+@@ -598,7 +598,7 @@ void LiftoffAssembler::AtomicStore(Register dst_addr,
+ }
+
+ void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister src,
++ uintptr_t offset_imm, LiftoffRegister src,
+ StoreType type, LiftoffRegList pinned) {
+ DCHECK_NE(offset_reg, no_reg);
+ DCHECK_LE(offset_imm, std::numeric_limits<int32_t>::max());
+@@ -938,7 +938,7 @@ void LiftoffAssembler::AtomicAdd(Register dst_addr, Re
+ } // namespace liftoff
+
+ void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ if (type.value() == StoreType::kI64Store) {
+ liftoff::AtomicBinop64(this, liftoff::kAdd, dst_addr, offset_reg,
+@@ -951,7 +951,7 @@ void LiftoffAssembler::AtomicSub(Register dst_addr, Re
+ }
+
+ void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ if (type.value() == StoreType::kI64Store) {
+ liftoff::AtomicBinop64(this, liftoff::kSub, dst_addr, offset_reg,
+@@ -963,7 +963,7 @@ void LiftoffAssembler::AtomicAnd(Register dst_addr, Re
+ }
+
+ void LiftoffAssembler::AtomicAnd(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ if (type.value() == StoreType::kI64Store) {
+ liftoff::AtomicBinop64(this, liftoff::kAnd, dst_addr, offset_reg,
+@@ -976,7 +976,7 @@ void LiftoffAssembler::AtomicOr(Register dst_addr, Reg
+ }
+
+ void LiftoffAssembler::AtomicOr(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ if (type.value() == StoreType::kI64Store) {
+ liftoff::AtomicBinop64(this, liftoff::kOr, dst_addr, offset_reg, offset_imm,
+@@ -989,7 +989,7 @@ void LiftoffAssembler::AtomicXor(Register dst_addr, Re
+ }
+
+ void LiftoffAssembler::AtomicXor(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ if (type.value() == StoreType::kI64Store) {
+ liftoff::AtomicBinop64(this, liftoff::kXor, dst_addr, offset_reg,
+@@ -1002,7 +1002,7 @@ void LiftoffAssembler::AtomicExchange(Register dst_add
+ }
+
+ void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm,
++ uintptr_t offset_imm,
+ LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ if (type.value() == StoreType::kI64Store) {
+@@ -1016,7 +1016,7 @@ void LiftoffAssembler::AtomicCompareExchange(
+ }
+
+ void LiftoffAssembler::AtomicCompareExchange(
+- Register dst_addr, Register offset_reg, uint32_t offset_imm,
++ Register dst_addr, Register offset_reg, uintptr_t offset_imm,
+ LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result,
+ StoreType type) {
+ // We expect that the offset has already been added to {dst_addr}, and no
Index: www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_tools_run.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_tools_run.py
@@ -0,0 +1,11 @@
+--- src/3rdparty/chromium/v8/tools/run.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/chromium/v8/tools/run.py
+@@ -9,7 +9,7 @@ import sys
+ import subprocess
+ import sys
+
+-result = subprocess.call(sys.argv[1:])
++sys.exit(subprocess.call(sys.argv[1:], env={"LD_LIBRARY_PATH":"${WRKSRC}/out/Release"}))
+ if result != 0:
+ # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier
+ # to recognize and differentiate in hex.
Index: www/qt6-webengine/files/patch-src_3rdparty_gn_build_build__linux.ninja.template
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_gn_build_build__linux.ninja.template
@@ -0,0 +1,11 @@
+--- src/3rdparty/gn/build/build_linux.ninja.template.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/gn/build/build_linux.ninja.template
+@@ -5,7 +5,7 @@ rule alink_thin
+ deps = gcc
+
+ rule alink_thin
+- command = rm -f $out && $ar rcsT $out $in
++ command = rm -f $out && $ar rcs $out $in
+ description = AR $out
+
+ rule link
Index: www/qt6-webengine/files/patch-src_3rdparty_gn_build_gen.py
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_gn_build_gen.py
@@ -0,0 +1,34 @@
+--- src/3rdparty/gn/build/gen.py.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/gn/build/gen.py
+@@ -92,6 +92,12 @@ class Platform(object):
+ def is_solaris(self):
+ return self._platform == 'solaris'
+
++ def is_openbsd(self):
++ return self._platform == 'openbsd'
++
++ def is_freebsd(self):
++ return self._platform == 'freebsd'
++
+ def is_posix(self):
+ return self._platform in ['linux', 'freebsd', 'darwin', 'aix', 'openbsd', 'haiku', 'solaris', 'msys', 'netbsd']
+
+@@ -291,7 +297,7 @@ def WriteGenericNinja(path, static_libraries, executab
+ 'linux': 'build_linux.ninja.template',
+ 'freebsd': 'build_linux.ninja.template',
+ 'aix': 'build_aix.ninja.template',
+- 'openbsd': 'build_openbsd.ninja.template',
++ 'openbsd': 'build_linux.ninja.template',
+ 'haiku': 'build_haiku.ninja.template',
+ 'solaris': 'build_linux.ninja.template',
+ 'netbsd': 'build_linux.ninja.template',
+@@ -514,6 +520,9 @@ def WriteGNNinja(path, platform, host, options, args_l
+
+ if platform.is_posix() and not platform.is_haiku():
+ ldflags.append('-pthread')
++
++ if platform.is_openbsd():
++ libs.append('-lkvm')
+
+ if platform.is_mingw() or platform.is_msys():
+ cflags.extend(['-DUNICODE',
Index: www/qt6-webengine/files/patch-src_3rdparty_gn_src_base_files_file__posix.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_gn_src_base_files_file__posix.cc
@@ -0,0 +1,11 @@
+--- src/3rdparty/gn/src/base/files/file_posix.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/gn/src/base/files/file_posix.cc
+@@ -369,7 +369,7 @@ bool File::Flush() {
+ bool File::Flush() {
+ DCHECK(IsValid());
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ return !HANDLE_EINTR(fdatasync(file_.get()));
+ #else
+ return !HANDLE_EINTR(fsync(file_.get()));
Index: www/qt6-webengine/files/patch-src_3rdparty_gn_src_gn_version.h
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_gn_src_gn_version.h
@@ -0,0 +1,15 @@
+--- src/3rdparty/gn/src/gn/version.h.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/gn/src/gn/version.h
+@@ -22,9 +22,9 @@ class Version {
+
+ static std::optional<Version> FromString(std::string s);
+
+- int major() const { return major_; }
+- int minor() const { return minor_; }
+- int patch() const { return patch_; }
++ int gmajor() const { return major_; }
++ int gminor() const { return minor_; }
++ int gpatch() const { return patch_; }
+
+ bool operator==(const Version& other) const;
+ bool operator<(const Version& other) const;
Index: www/qt6-webengine/files/patch-src_3rdparty_gn_src_util_exe__path.cc
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_3rdparty_gn_src_util_exe__path.cc
@@ -0,0 +1,90 @@
+--- src/3rdparty/gn/src/util/exe_path.cc.orig 2022-09-26 10:05:50 UTC
++++ src/3rdparty/gn/src/util/exe_path.cc
+@@ -15,7 +15,7 @@
+ #include <windows.h>
+
+ #include "base/win/win_util.h"
+-#elif defined(OS_FREEBSD) || defined(OS_NETBSD)
++#elif defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD)
+ #include <limits.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+@@ -26,6 +26,10 @@
+ #include <stdlib.h>
+ #endif
+
++#if defined(OS_OPENBSD)
++#include <kvm.h>
++#endif
++
+ #if defined(OS_MACOSX)
+
+ base::FilePath GetExePath() {
+@@ -102,6 +106,67 @@ base::FilePath GetExePath() {
+ return base::FilePath();
+ }
+ return base::FilePath(raw);
++}
++
++#elif defined(OS_OPENBSD)
++
++base::FilePath GetExePath() {
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ char errbuf[_POSIX2_LINE_MAX];
++ char **retvalargs;
++#define MAXTOKENS 2
++ char *tokens[MAXTOKENS];
++ static char retval[PATH_MAX];
++ int cnt;
++ size_t len;
++ struct stat sb;
++ pid_t cpid = getpid();
++
++ int mib[] = { CTL_KERN, KERN_PROC_ARGS, cpid, KERN_PROC_ARGV };
++
++ if (sysctl(mib, 4, NULL, &len, NULL, 0) != -1) {
++ retvalargs = static_cast<char**>(malloc(len));
++ if (!retvalargs)
++ goto out;
++
++ if (sysctl(mib, 4, retvalargs, &len, NULL, 0) < 0)
++ goto out;
++
++ char *cr = strdup(retvalargs[0]);
++ free(retvalargs);
++
++ *tokens = strtok(cr, ":");
++ if (tokens[0] == NULL)
++ goto out;
++
++ if (realpath(tokens[0], retval) == NULL)
++ goto out;
++
++ if (stat(retval, &sb) < 0)
++ goto out;
++
++ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL)
++ goto out;
++
++ if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, cpid,
++ sizeof(struct kinfo_file), &cnt)) == NULL) {
++ kvm_close(kd);
++ goto out;
++ }
++
++ for (int i = 0; i < cnt; i++) {
++ if (files[i].fd_fd == KERN_FILE_TEXT &&
++ files[i].va_fsid == static_cast<uint32_t>(sb.st_dev) &&
++ files[i].va_fileid == sb.st_ino) {
++ kvm_close(kd);
++ return base::FilePath(retval);
++ }
++ }
++ }
++
++out:
++ return base::FilePath();
+ }
+
+ #elif defined(OS_ZOS)
Index: www/qt6-webengine/files/patch-src_core_CMakeLists.txt
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_core_CMakeLists.txt
@@ -0,0 +1,37 @@
+--- src/core/CMakeLists.txt.orig 2022-11-08 21:18:48 UTC
++++ src/core/CMakeLists.txt
+@@ -16,7 +16,7 @@ add_subdirectory(tools)
+ # TOOLCHAIN SETUP
+ ##
+
+-if(LINUX)
++if(LINUX OR FREEBSD)
+ setup_toolchains()
+ endif()
+
+@@ -366,12 +366,12 @@ foreach(arch ${archs})
+ CONDITION QT_FEATURE_webengine_embedded_build
+ )
+
+- if(LINUX)
++ if(LINUX OR FREEBSD)
+ list(APPEND gnArgArg
+ use_cups=false
+ use_gio=false
+ use_gnome_keyring=false
+- use_udev=true
++ use_udev=false
+ use_bundled_fontconfig=false
+ enable_session_service=false
+ is_cfi=false
+@@ -425,6 +425,10 @@ foreach(arch ${archs})
+ extend_gn_list(gnArgArg
+ ARGS use_pulseaudio
+ CONDITION QT_FEATURE_webengine_system_pulseaudio
++ )
++ extend_gn_list(gnArgArg
++ ARGS use_sndio
++ CONDITION QT_FEATURE_webengine_system_sndio
+ )
+ extend_gn_list(gnArgArg
+ ARGS ozone_platform_x11 use_xkbcommon
Index: www/qt6-webengine/files/patch-src_core_api_configure.cmake
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_core_api_configure.cmake
@@ -0,0 +1,33 @@
+--- src/core/api/configure.cmake.orig 2022-09-26 10:05:50 UTC
++++ src/core/api/configure.cmake
+@@ -7,6 +7,7 @@ if(NOT QT_CONFIGURE_RUNNING)
+ if(PkgConfig_FOUND)
+ pkg_check_modules(ALSA alsa IMPORTED_TARGET)
+ pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
++ pkg_check_modules(SNDIO libsndio)
+ pkg_check_modules(XDAMAGE xdamage)
+ pkg_check_modules(POPPLER_CPP poppler-cpp IMPORTED_TARGET)
+ if(NOT GIO_FOUND)
+@@ -79,6 +80,11 @@ qt_feature("webengine-printing-and-pdf" PRIVATE
+ CONDITION TARGET Qt::PrintSupport AND QT_FEATURE_printer AND
+ (CUPS_FOUND OR WIN32)
+ )
++qt_feature("webengine-system-sndio" PRIVATE
++ LABEL "Use sndio"
++ AUTODETECT UNIX
++ CONDITION SNDIO_FOUND
++)
+ qt_feature("webengine-pepper-plugins" PRIVATE
+ LABEL "Pepper Plugins"
+ PURPOSE "Enables use of Pepper plugins."
+@@ -184,6 +190,10 @@ qt_configure_add_summary_entry(
+ )
+ qt_configure_add_summary_entry(
+ ARGS "webengine-system-pulseaudio"
++ CONDITION UNIX
++)
++qt_configure_add_summary_entry(
++ ARGS "webengine-system-sndio"
+ CONDITION UNIX
+ )
+ qt_configure_end_summary_section() # end of "Qt WebEngineCore" section
Index: www/qt6-webengine/files/patch-src_core_api_qt__cmdline.cmake
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_core_api_qt__cmdline.cmake
@@ -0,0 +1,11 @@
+--- src/core/api/qt_cmdline.cmake.orig 2022-06-08 06:40:31 UTC
++++ src/core/api/qt_cmdline.cmake
+@@ -25,7 +25,7 @@ set(systemLibs alsa ffmpeg freetype harfbuzz icu lcms2
+ endfunction()
+
+ set(systemLibs alsa ffmpeg freetype harfbuzz icu lcms2 libevent libjpeg
+- libpng libvpx libxml libwebp minizip opus pulseaudio re2 snappy zlib)
++ libpng libvpx libxml libwebp minizip opus pulseaudio re2 snappy sndio zlib)
+ foreach(slib ${systemLibs})
+ qt_commandline_option(webengine-${slib} TYPE enum NAME webengine-system-${slib} VALUES yes no system)
+ endforeach()
Index: www/qt6-webengine/files/patch-src_core_configure.json
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_core_configure.json
@@ -0,0 +1,56 @@
+--- src/core/configure.json.orig 2022-06-08 06:40:31 UTC
++++ src/core/configure.json
+@@ -21,6 +21,7 @@
+ "webengine-printing-and-pdf": "boolean",
+ "webengine-proprietary-codecs": "boolean",
+ "webengine-pulseaudio": "boolean",
++ "webengine-sndio": "boolean",
+ "webengine-spellchecker": "boolean",
+ "webengine-native-spellchecker": "boolean",
+ "webengine-extensions": "boolean",
+@@ -31,6 +32,7 @@
+ "webengine-kerberos": "boolean",
+ "alsa": { "type": "boolean", "name": "webengine-alsa" },
+ "pulseaudio": { "type": "boolean", "name": "webengine-pulseaudio" },
++ "sndio": { "type": "boolean", "name": "webengine-sndio" },
+ "ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } },
+ "opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } },
+ "webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } },
+@@ -69,6 +71,12 @@
+ { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" }
+ ]
+ },
++ "webengine-sndio": {
++ "label": "sndio",
++ "sources": [
++ { "type": "pkgConfig", "args": "libsndio" }
++ ]
++ },
+ "webengine-gio": {
+ "label": "gio",
+ "sources": [
+@@ -122,6 +130,12 @@
+ "condition": "libs.webengine-pulseaudio",
+ "output": [ "privateFeature" ]
+ },
++ "webengine-sndio": {
++ "label": "Use sndio",
++ "autoDetect": "config.unix",
++ "condition": "libs.webengine-sndio",
++ "output": [ "privateFeature" ]
++ },
+ "webengine-pepper-plugins": {
+ "label": "Pepper Plugins",
+ "purpose": "Enables use of Pepper Flash plugins.",
+@@ -265,6 +279,11 @@
+ {
+ "type": "feature",
+ "args": "webengine-pulseaudio",
++ "condition": "config.unix"
++ },
++ {
++ "type": "feature",
++ "args": "webengine-sndio",
+ "condition": "config.unix"
+ },
+ {
Index: www/qt6-webengine/files/patch-src_host_BUILD.toolchain.gn.in
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_host_BUILD.toolchain.gn.in
@@ -0,0 +1,13 @@
+--- src/host/BUILD.toolchain.gn.in.orig 2022-11-08 21:18:48 UTC
++++ src/host/BUILD.toolchain.gn.in
+@@ -6,7 +6,9 @@ gcc_toolchain("@GN_TOOLCHAIN@") {
+ ld = "@CMAKE_CXX_COMPILER@"
+ ar = "@CMAKE_AR@"
+ nm = "@CMAKE_NM@"
+- extra_cppflags = ""
++ extra_cppflags = "%%CPPFLAGS%%"
++ extra_cxxflags = "%%CXXFLAGS%%"
++ extra_ldflags = "%%LDFLAGS%%"
+ toolchain_args = {
+ current_os = "@GN_OS@"
+ current_cpu = "@GN_CPU@"
Index: www/qt6-webengine/files/patch-src_pdf_CMakeLists.txt
===================================================================
--- /dev/null
+++ www/qt6-webengine/files/patch-src_pdf_CMakeLists.txt
@@ -0,0 +1,20 @@
+--- src/pdf/CMakeLists.txt.orig 2022-09-26 10:05:50 UTC
++++ src/pdf/CMakeLists.txt
+@@ -53,7 +53,7 @@ qt_internal_add_docs(Pdf
+ # TOOLCHAIN SETUP
+ ##
+
+-if(LINUX)
++if(LINUX OR FREEBSD)
+ setup_toolchains()
+ endif()
+
+@@ -111,7 +111,7 @@ foreach(arch ${archs})
+ strip_absolute_paths_from_debug_symbols=false
+ )
+
+- if(LINUX)
++ if(LINUX OR FREEBSD)
+ list(APPEND gnArgArg
+ is_cfi=false
+ ozone_auto_platforms=false
Index: www/qt6-webengine/pkg-descr
===================================================================
--- /dev/null
+++ www/qt6-webengine/pkg-descr
@@ -0,0 +1,8 @@
+The Qt WebEngine module provides a web browser engine that makes it easy to
+embed content from the World Wide Web into your Qt application on platforms
+that do not have a native web engine.
+
+Qt WebEngine provides C++ classes and QML types for rendering HTML, XHTML, and
+SVG documents, styled using Cascading Style Sheets (CSS) and scripted with
+JavaScript. HTML documents can be made fully editable by the user through the
+use of the contenteditable attribute on HTML elements.
Index: www/qt6-webengine/pkg-plist
===================================================================
--- /dev/null
+++ www/qt6-webengine/pkg-plist
@@ -0,0 +1,411 @@
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdfdocument_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdffile_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdfiohandler_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdflink_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdflinkmodel_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdflinkmodel_p_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdfsearchmodel_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qpdfselection_p.h
+%%QT_INCDIR%%/QtPdf/%%FULLVER%%/QtPdf/private/qtpdf-config_p.h
+%%QT_INCDIR%%/QtPdf/QPdfBookmarkModel
+%%QT_INCDIR%%/QtPdf/QPdfDocument
+%%QT_INCDIR%%/QtPdf/QPdfDocumentRenderOptions
+%%QT_INCDIR%%/QtPdf/QPdfLink
+%%QT_INCDIR%%/QtPdf/QPdfPageNavigator
+%%QT_INCDIR%%/QtPdf/QPdfPageRenderer
+%%QT_INCDIR%%/QtPdf/QPdfSearchModel
+%%QT_INCDIR%%/QtPdf/QPdfSelection
+%%QT_INCDIR%%/QtPdf/QtPdf
+%%QT_INCDIR%%/QtPdf/QtPdfDepends
+%%QT_INCDIR%%/QtPdf/QtPdfVersion
+%%QT_INCDIR%%/QtPdf/qpdfbookmarkmodel.h
+%%QT_INCDIR%%/QtPdf/qpdfdocument.h
+%%QT_INCDIR%%/QtPdf/qpdfdocumentrenderoptions.h
+%%QT_INCDIR%%/QtPdf/qpdflink.h
+%%QT_INCDIR%%/QtPdf/qpdfpagenavigator.h
+%%QT_INCDIR%%/QtPdf/qpdfpagerenderer.h
+%%QT_INCDIR%%/QtPdf/qpdfsearchmodel.h
+%%QT_INCDIR%%/QtPdf/qpdfselection.h
+%%QT_INCDIR%%/QtPdf/qtpdf-config.h
+%%QT_INCDIR%%/QtPdf/qtpdfglobal.h
+%%QT_INCDIR%%/QtPdf/qtpdfversion.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdfbookmarkmodel_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdfdocument_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdflinkmodel_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdfpageimage_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdfpagenavigator_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdfsearchmodel_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qquickpdfselection_p.h
+%%QT_INCDIR%%/QtPdfQuick/%%FULLVER%%/QtPdfQuick/private/qtpdfquickglobal_p.h
+%%QT_INCDIR%%/QtPdfQuick/QtPdfQuick
+%%QT_INCDIR%%/QtPdfQuick/QtPdfQuickDepends
+%%QT_INCDIR%%/QtPdfQuick/QtPdfQuickVersion
+%%QT_INCDIR%%/QtPdfQuick/qtpdfquickversion.h
+%%QT_INCDIR%%/QtPdfWidgets/%%FULLVER%%/QtPdfWidgets/private/qpdfview_p.h
+%%QT_INCDIR%%/QtPdfWidgets/QPdfView
+%%QT_INCDIR%%/QtPdfWidgets/QtPdfWidgets
+%%QT_INCDIR%%/QtPdfWidgets/QtPdfWidgetsDepends
+%%QT_INCDIR%%/QtPdfWidgets/QtPdfWidgetsVersion
+%%QT_INCDIR%%/QtPdfWidgets/qpdfview.h
+%%QT_INCDIR%%/QtPdfWidgets/qtpdfwidgetsglobal.h
+%%QT_INCDIR%%/QtPdfWidgets/qtpdfwidgetsversion.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qtwebenginecore-config_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qtwebenginecoreglobal_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginecontextmenurequest_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginecookiestore_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginedownloadrequest_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginehistory_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginemessagepumpscheduler_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginenewwindowrequest_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginepage_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebengineprofile_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebenginescriptcollection_p.h
+%%QT_INCDIR%%/QtWebEngineCore/%%FULLVER%%/QtWebEngineCore/private/qwebengineurlrequestinfo_p.h
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineCertificateError
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineClientCertificateSelection
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineClientCertificateStore
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineContextMenuRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineCookieStore
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineDownloadRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineFileSystemAccessRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineFindTextResult
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineFullScreenRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineHistory
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineHistoryItem
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineHistoryModel
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineHttpRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineLoadingInfo
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineNavigationRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineNewWindowRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineNotification
+%%QT_INCDIR%%/QtWebEngineCore/QWebEnginePage
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineProfile
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineQuotaRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineRegisterProtocolHandlerRequest
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineScript
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineScriptCollection
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineSettings
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineUrlRequestInfo
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineUrlRequestInterceptor
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineUrlRequestJob
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineUrlScheme
+%%QT_INCDIR%%/QtWebEngineCore/QWebEngineUrlSchemeHandler
+%%QT_INCDIR%%/QtWebEngineCore/QtWebEngineCore
+%%QT_INCDIR%%/QtWebEngineCore/QtWebEngineCoreDepends
+%%QT_INCDIR%%/QtWebEngineCore/QtWebEngineCoreVersion
+%%QT_INCDIR%%/QtWebEngineCore/qtwebenginecore-config.h
+%%QT_INCDIR%%/QtWebEngineCore/qtwebenginecoreglobal.h
+%%QT_INCDIR%%/QtWebEngineCore/qtwebenginecoreversion.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginecertificateerror.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineclientcertificateselection.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineclientcertificatestore.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginecontextmenurequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginecookiestore.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginedownloadrequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginefilesystemaccessrequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginefindtextresult.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginefullscreenrequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginehistory.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginehttprequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineloadinginfo.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginenavigationrequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginenewwindowrequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginenotification.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginepage.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineprofile.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginequotarequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginescript.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginescriptcollection.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebenginesettings.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineurlrequestinfo.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineurlrequestinterceptor.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineurlrequestjob.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineurlscheme.h
+%%QT_INCDIR%%/QtWebEngineCore/qwebengineurlschemehandler.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineaction_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineaction_p_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineclientcertificateselection_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginedialogrequests_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginedownloadrequest_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginefaviconprovider_p_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineforeigntypes_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginenewwindowrequest_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineprofile_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginescriptcollection_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginescriptcollection_p_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginesettings_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginesingleton_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginetouchhandle_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginetouchhandleprovider_p_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginetouchselectionmenurequest_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebenginetouchselectionmenurequest_p_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineview_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qquickwebengineview_p_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qtwebenginequick-config_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/%%FULLVER%%/QtWebEngineQuick/private/qtwebenginequickglobal_p.h
+%%QT_INCDIR%%/QtWebEngineQuick/QQuickWebEngineProfile
+%%QT_INCDIR%%/QtWebEngineQuick/QtWebEngineQuick
+%%QT_INCDIR%%/QtWebEngineQuick/QtWebEngineQuickDepends
+%%QT_INCDIR%%/QtWebEngineQuick/QtWebEngineQuickVersion
+%%QT_INCDIR%%/QtWebEngineQuick/qquickwebengineprofile.h
+%%QT_INCDIR%%/QtWebEngineQuick/qtwebenginequick-config.h
+%%QT_INCDIR%%/QtWebEngineQuick/qtwebenginequickglobal.h
+%%QT_INCDIR%%/QtWebEngineQuick/qtwebenginequickversion.h
+%%QT_INCDIR%%/QtWebEngineWidgets/%%FULLVER%%/QtWebEngineWidgets/private/qwebenginenotificationpresenter_p.h
+%%QT_INCDIR%%/QtWebEngineWidgets/%%FULLVER%%/QtWebEngineWidgets/private/qwebengineview_p.h
+%%QT_INCDIR%%/QtWebEngineWidgets/QWebEngineView
+%%QT_INCDIR%%/QtWebEngineWidgets/QtWebEngineWidgets
+%%QT_INCDIR%%/QtWebEngineWidgets/QtWebEngineWidgetsDepends
+%%QT_INCDIR%%/QtWebEngineWidgets/QtWebEngineWidgetsVersion
+%%QT_INCDIR%%/QtWebEngineWidgets/qtwebenginewidgetsglobal.h
+%%QT_INCDIR%%/QtWebEngineWidgets/qtwebenginewidgetsversion.h
+%%QT_INCDIR%%/QtWebEngineWidgets/qwebengineview.h
+lib/cmake/Qt6/FindGPerf.cmake
+lib/cmake/Qt6/FindGn.cmake
+lib/cmake/Qt6/FindNinja.cmake
+lib/cmake/Qt6/FindNodejs.cmake
+lib/cmake/Qt6/FindPkgConfigHost.cmake
+lib/cmake/Qt6/FindSnappy.cmake
+lib/cmake/Qt6BuildInternals/StandaloneTests/QtWebEngineTestsConfig.cmake
+lib/cmake/Qt6Gui/Qt6QPdfPluginAdditionalTargetInfo.cmake
+lib/cmake/Qt6Gui/Qt6QPdfPluginConfig.cmake
+lib/cmake/Qt6Gui/Qt6QPdfPluginConfigVersion.cmake
+lib/cmake/Qt6Gui/Qt6QPdfPluginConfigVersionImpl.cmake
+lib/cmake/Qt6Gui/Qt6QPdfPluginTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6Gui/Qt6QPdfPluginTargets.cmake
+lib/cmake/Qt6Pdf/Qt6PdfAdditionalTargetInfo.cmake
+lib/cmake/Qt6Pdf/Qt6PdfConfig.cmake
+lib/cmake/Qt6Pdf/Qt6PdfConfigVersion.cmake
+lib/cmake/Qt6Pdf/Qt6PdfConfigVersionImpl.cmake
+lib/cmake/Qt6Pdf/Qt6PdfDependencies.cmake
+lib/cmake/Qt6Pdf/Qt6PdfTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6Pdf/Qt6PdfTargets.cmake
+lib/cmake/Qt6Pdf/Qt6PdfVersionlessTargets.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickAdditionalTargetInfo.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickConfig.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickConfigVersion.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickConfigVersionImpl.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickDependencies.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickTargets.cmake
+lib/cmake/Qt6PdfQuick/Qt6PdfQuickVersionlessTargets.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsAdditionalTargetInfo.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsConfig.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsConfigVersion.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsConfigVersionImpl.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsDependencies.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsTargets.cmake
+lib/cmake/Qt6PdfWidgets/Qt6PdfWidgetsVersionlessTargets.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6PdfQuickpluginAdditionalTargetInfo.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6PdfQuickpluginConfig.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6PdfQuickpluginConfigVersion.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6PdfQuickpluginConfigVersionImpl.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6PdfQuickpluginTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6PdfQuickpluginTargets.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickdelegatespluginAdditionalTargetInfo.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickdelegatespluginConfig.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickdelegatespluginConfigVersion.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickdelegatespluginConfigVersionImpl.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickdelegatespluginTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickdelegatespluginTargets.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickpluginAdditionalTargetInfo.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickpluginConfig.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickpluginConfigVersion.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickpluginConfigVersionImpl.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickpluginTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6Qml/QmlPlugins/Qt6qtwebenginequickpluginTargets.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreAdditionalTargetInfo.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreConfig.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreConfigVersion.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreConfigVersionImpl.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreDependencies.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreMacros.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreTargets.cmake
+lib/cmake/Qt6WebEngineCore/Qt6WebEngineCoreVersionlessTargets.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsAdditionalTargetInfo.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsConfig.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsConfigVersion.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsConfigVersionImpl.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsDependencies.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsTargets.cmake
+lib/cmake/Qt6WebEngineCoreTools/Qt6WebEngineCoreToolsVersionlessTargets.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickAdditionalTargetInfo.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickConfig.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickConfigVersion.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickConfigVersionImpl.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickDependencies.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickTargets.cmake
+lib/cmake/Qt6WebEngineQuick/Qt6WebEngineQuickVersionlessTargets.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlAdditionalTargetInfo.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlConfig.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlConfigVersion.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlConfigVersionImpl.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlTargets.cmake
+lib/cmake/Qt6WebEngineQuickDelegatesQml/Qt6WebEngineQuickDelegatesQmlVersionlessTargets.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsAdditionalTargetInfo.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfig.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfigVersion.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfigVersionImpl.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsDependencies.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsTargets.cmake
+lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsVersionlessTargets.cmake
+%%QT_LIBDIR%%/libQt6Pdf.prl
+%%QT_LIBDIR%%/libQt6Pdf.so
+%%QT_LIBDIR%%/libQt6Pdf.so.6
+%%QT_LIBDIR%%/libQt6Pdf.so.%%FULLVER%%
+%%QT_LIBDIR%%/libQt6PdfQuick.prl
+%%QT_LIBDIR%%/libQt6PdfQuick.so
+%%QT_LIBDIR%%/libQt6PdfQuick.so.6
+%%QT_LIBDIR%%/libQt6PdfQuick.so.%%FULLVER%%
+%%QT_LIBDIR%%/libQt6PdfWidgets.prl
+%%QT_LIBDIR%%/libQt6PdfWidgets.so
+%%QT_LIBDIR%%/libQt6PdfWidgets.so.6
+%%QT_LIBDIR%%/libQt6PdfWidgets.so.%%FULLVER%%
+%%QT_LIBDIR%%/libQt6WebEngineCore.prl
+%%QT_LIBDIR%%/libQt6WebEngineCore.so
+%%QT_LIBDIR%%/libQt6WebEngineCore.so.6
+%%QT_LIBDIR%%/libQt6WebEngineCore.so.%%FULLVER%%
+%%QT_LIBDIR%%/libQt6WebEngineQuick.prl
+%%QT_LIBDIR%%/libQt6WebEngineQuick.so
+%%QT_LIBDIR%%/libQt6WebEngineQuick.so.6
+%%QT_LIBDIR%%/libQt6WebEngineQuick.so.%%FULLVER%%
+%%QT_LIBDIR%%/libQt6WebEngineQuickDelegatesQml.prl
+%%QT_LIBDIR%%/libQt6WebEngineQuickDelegatesQml.so
+%%QT_LIBDIR%%/libQt6WebEngineQuickDelegatesQml.so.6
+%%QT_LIBDIR%%/libQt6WebEngineQuickDelegatesQml.so.%%FULLVER%%
+%%QT_LIBDIR%%/libQt6WebEngineWidgets.prl
+%%QT_LIBDIR%%/libQt6WebEngineWidgets.so
+%%QT_LIBDIR%%/libQt6WebEngineWidgets.so.6
+%%QT_LIBDIR%%/libQt6WebEngineWidgets.so.%%FULLVER%%
+%%QT_LIBDIR%%/metatypes/qt6pdf_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_LIBDIR%%/metatypes/qt6pdfquick_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_LIBDIR%%/metatypes/qt6pdfwidgets_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_LIBDIR%%/metatypes/qt6webenginecore_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_LIBDIR%%/metatypes/qt6webenginequick_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_LIBDIR%%/metatypes/qt6webenginequickdelegatesqml_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_LIBDIR%%/metatypes/qt6webenginewidgets_%%CMAKE_BUILD_TYPE%%_metatypes.json
+%%QT_MKSPECDIR%%/modules/qt_lib_pdf.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_pdf_private.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_pdfquick.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_pdfquick_private.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_pdfwidgets.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_pdfwidgets_private.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginecore.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginecore_private.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginequick.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginequick_private.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginequickdelegatesqml.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginequickdelegatesqml_private.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginewidgets.pri
+%%QT_MKSPECDIR%%/modules/qt_lib_webenginewidgets_private.pri
+%%QT_PLUGINDIR%%/imageformats/libqpdf.so
+%%QT_QMLDIR%%/QtQuick/Pdf/+Material/PdfStyle.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/+Universal/PdfStyle.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/PdfLinkDelegate.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/PdfMultiPageView.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/PdfPageView.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/PdfScrollablePageView.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/PdfStyle.qml
+%%QT_QMLDIR%%/QtQuick/Pdf/libpdfquickplugin.so
+%%QT_QMLDIR%%/QtQuick/Pdf/plugins.qmltypes
+%%QT_QMLDIR%%/QtQuick/Pdf/qmldir
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/AlertDialog.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/AuthenticationDialog.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/AutofillPopup.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/ColorDialog.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/ConfirmDialog.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/FilePicker.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/Menu.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/MenuItem.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/MenuSeparator.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/PromptDialog.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/ToolTip.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/TouchHandle.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/TouchSelectionMenu.qml
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/WebEngineQuickDelegatesQml.qmltypes
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/libqtwebenginequickdelegatesplugin.so
+%%QT_QMLDIR%%/QtWebEngine/ControlsDelegates/qmldir
+%%QT_QMLDIR%%/QtWebEngine/libqtwebenginequickplugin.so
+%%QT_QMLDIR%%/QtWebEngine/plugins.qmltypes
+%%QT_QMLDIR%%/QtWebEngine/qmldir
+libdata/pkgconfig/Qt6Pdf.pc
+libdata/pkgconfig/Qt6PdfQuick.pc
+libdata/pkgconfig/Qt6PdfWidgets.pc
+libdata/pkgconfig/Qt6WebEngineCore.pc
+libdata/pkgconfig/Qt6WebEngineQuick.pc
+libdata/pkgconfig/Qt6WebEngineQuickDelegatesQml.pc
+libdata/pkgconfig/Qt6WebEngineWidgets.pc
+%%QT_TOOLDIR%%/QtWebEngineProcess
+%%QT_TOOLDIR%%/qwebengine_convert_dict
+%%QT_DATADIR%%/modules/Pdf.json
+%%QT_DATADIR%%/modules/PdfQuick.json
+%%QT_DATADIR%%/modules/PdfWidgets.json
+%%QT_DATADIR%%/modules/WebEngineCore.json
+%%QT_DATADIR%%/modules/WebEngineQuick.json
+%%QT_DATADIR%%/modules/WebEngineQuickDelegatesQml.json
+%%QT_DATADIR%%/modules/WebEngineWidgets.json
+%%QT_DATADIR%%/resources/icudtl.dat
+%%QT_DATADIR%%/resources/qtwebengine_devtools_resources.pak
+%%QT_DATADIR%%/resources/qtwebengine_resources.pak
+%%QT_DATADIR%%/resources/qtwebengine_resources_100p.pak
+%%QT_DATADIR%%/resources/qtwebengine_resources_200p.pak
+%%QT_L10NDIR%%/qtwebengine_locales/am.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ar.pak
+%%QT_L10NDIR%%/qtwebengine_locales/bg.pak
+%%QT_L10NDIR%%/qtwebengine_locales/bn.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ca.pak
+%%QT_L10NDIR%%/qtwebengine_locales/cs.pak
+%%QT_L10NDIR%%/qtwebengine_locales/da.pak
+%%QT_L10NDIR%%/qtwebengine_locales/de.pak
+%%QT_L10NDIR%%/qtwebengine_locales/el.pak
+%%QT_L10NDIR%%/qtwebengine_locales/en-GB.pak
+%%QT_L10NDIR%%/qtwebengine_locales/en-US.pak
+%%QT_L10NDIR%%/qtwebengine_locales/es-419.pak
+%%QT_L10NDIR%%/qtwebengine_locales/es.pak
+%%QT_L10NDIR%%/qtwebengine_locales/et.pak
+%%QT_L10NDIR%%/qtwebengine_locales/fa.pak
+%%QT_L10NDIR%%/qtwebengine_locales/fi.pak
+%%QT_L10NDIR%%/qtwebengine_locales/fil.pak
+%%QT_L10NDIR%%/qtwebengine_locales/fr.pak
+%%QT_L10NDIR%%/qtwebengine_locales/gu.pak
+%%QT_L10NDIR%%/qtwebengine_locales/he.pak
+%%QT_L10NDIR%%/qtwebengine_locales/hi.pak
+%%QT_L10NDIR%%/qtwebengine_locales/hr.pak
+%%QT_L10NDIR%%/qtwebengine_locales/hu.pak
+%%QT_L10NDIR%%/qtwebengine_locales/id.pak
+%%QT_L10NDIR%%/qtwebengine_locales/it.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ja.pak
+%%QT_L10NDIR%%/qtwebengine_locales/kn.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ko.pak
+%%QT_L10NDIR%%/qtwebengine_locales/lt.pak
+%%QT_L10NDIR%%/qtwebengine_locales/lv.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ml.pak
+%%QT_L10NDIR%%/qtwebengine_locales/mr.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ms.pak
+%%QT_L10NDIR%%/qtwebengine_locales/nb.pak
+%%QT_L10NDIR%%/qtwebengine_locales/nl.pak
+%%QT_L10NDIR%%/qtwebengine_locales/pl.pak
+%%QT_L10NDIR%%/qtwebengine_locales/pt-BR.pak
+%%QT_L10NDIR%%/qtwebengine_locales/pt-PT.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ro.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ru.pak
+%%QT_L10NDIR%%/qtwebengine_locales/sk.pak
+%%QT_L10NDIR%%/qtwebengine_locales/sl.pak
+%%QT_L10NDIR%%/qtwebengine_locales/sr.pak
+%%QT_L10NDIR%%/qtwebengine_locales/sv.pak
+%%QT_L10NDIR%%/qtwebengine_locales/sw.pak
+%%QT_L10NDIR%%/qtwebengine_locales/ta.pak
+%%QT_L10NDIR%%/qtwebengine_locales/te.pak
+%%QT_L10NDIR%%/qtwebengine_locales/th.pak
+%%QT_L10NDIR%%/qtwebengine_locales/tr.pak
+%%QT_L10NDIR%%/qtwebengine_locales/uk.pak
+%%QT_L10NDIR%%/qtwebengine_locales/vi.pak
+%%QT_L10NDIR%%/qtwebengine_locales/zh-CN.pak
+%%QT_L10NDIR%%/qtwebengine_locales/zh-TW.pak

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 12:26 PM (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14697611
Default Alt Text
D37859.id114492.diff (884 KB)

Event Timeline