diff --git a/www/ungoogled-chromium/Makefile b/www/ungoogled-chromium/Makefile index 5dd0257a82f4..ebb64c866879 100644 --- a/www/ungoogled-chromium/Makefile +++ b/www/ungoogled-chromium/Makefile @@ -1,379 +1,379 @@ PORTNAME= ungoogled-chromium -PORTVERSION= 112.0.5615.165 +PORTVERSION= 113.0.5672.63 UGVERSION= ${DISTVERSION}-1 -PORTREVISION= 3 CATEGORIES= www wayland MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ https://nerd.hu/distfiles/:external DISTFILES= chromium-${DISTVERSION}${EXTRACT_SUFX} \ ungoogled-chromium-${UGVERSION}.tar.gz:external MAINTAINER= chromium@FreeBSD.org COMMENT= Google web browser based on WebKit sans integration with Google WWW= https://github.com/ungoogled-software/ungoogled-chromium LICENSE= BSD3CLAUSE LGPL21 MPL11 LICENSE_COMB= multi ONLY_FOR_ARCHS= aarch64 amd64 i386 PATCH_DEPENDS= gpatch:devel/patch \ ${PYTHON_VERSION}:lang/python${PYTHON_SUFFIX} BUILD_DEPENDS= bash:shells/bash \ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} \ gperf:devel/gperf \ flock:sysutils/flock \ node:www/node \ xcb-proto>0:x11/xcb-proto \ ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat \ ${LOCALBASE}/share/usbids/usb.ids:misc/usbids \ ${PYTHON_PKGNAMEPREFIX}html5lib>0:www/py-html5lib@${PY_FLAVOR} \ ${LOCALBASE}/include/va/va.h:multimedia/libva \ ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri \ ${LOCALBASE}/libdata/pkgconfig/Qt5Core.pc:devel/qt5-core \ ${LOCALBASE}/libdata/pkgconfig/Qt5Widgets.pc:x11-toolkits/qt5-widgets LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-core \ libatspi.so:accessibility/at-spi2-core \ libspeechd.so:accessibility/speech-dispatcher \ libsnappy.so:archivers/snappy \ libFLAC.so:audio/flac \ libopus.so:audio/opus \ libspeex.so:audio/speex \ libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ libepoll-shim.so:devel/libepoll-shim \ libevent.so:devel/libevent \ libffi.so:devel/libffi \ libicuuc.so:devel/icu \ libjsoncpp.so:devel/jsoncpp \ libpci.so:devel/libpci \ libnspr4.so:devel/nspr \ libre2.so:devel/re2 \ libcairo.so:graphics/cairo \ libdrm.so:graphics/libdrm \ libexif.so:graphics/libexif \ libpng.so:graphics/png \ libwebp.so:graphics/webp \ + libdav1d.so:multimedia/dav1d \ libopenh264.so:multimedia/openh264 \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libharfbuzz-icu.so:print/harfbuzz-icu \ libgcrypt.so:security/libgcrypt \ libsecret-1.so:security/libsecret \ libnss3.so:security/nss \ libexpat.so:textproc/expat2 \ libfontconfig.so:x11-fonts/fontconfig \ libwayland-client.so:graphics/wayland \ libxkbcommon.so:x11/libxkbcommon \ libxshmfence.so:x11/libxshmfence RUN_DEPENDS= xdg-open:devel/xdg-utils \ noto-basic>0:x11-fonts/noto-basic USES= bison compiler:c++17-lang cpe desktop-file-utils gl gnome iconv:wchar_t jpeg \ localbase:ldflags ninja perl5 pkgconfig python:3.7+,build qt:5 shebangfix \ tar:xz xorg CPE_VENDOR= google CPE_PRODUCT= chrome USE_GL= gbm gl USE_GNOME= atk dconf gdkpixbuf2 glib20 gtk30 libxml2 libxslt USE_LDCONFIG= ${DATADIR} USE_PERL5= build USE_XORG= x11 xcb xcomposite xcursor xext xdamage xfixes xi \ xorgproto xrandr xrender xscrnsaver xtst USE_QT= buildtools:build SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper buildtools/linux64/clang-format MAKE_ARGS= -C out/${BUILDTYPE} ALL_TARGET= chrome BINARY_ALIAS= python3=${PYTHON_CMD} \ moc=${PREFIX}/bin/moc-qt5 # TODO bz@ : install libwidevinecdm.so (see third_party/widevine/cdm/BUILD.gn) # # Run "./out/${BUILDTYPE}/gn args out/${BUILDTYPE} --list" for all variables. # Some parts don't have use_system_* flag, and can be turned on/off by using # replace_gn_files.py script, some parts just turned on/off for target host # OS "target_os == is_bsd", like libusb, libpci. GN_ARGS+= fatal_linker_warnings=false \ icu_use_data_file=false \ is_clang=true \ optimize_webui=true \ toolkit_views=true \ use_allocator_shim=false \ use_aura=true \ use_custom_libcxx=false \ use_gnome_keyring=false \ use_lld=true \ use_partition_alloc=true \ use_partition_alloc_as_malloc=false \ use_sysroot=false \ use_system_freetype=false \ use_system_harfbuzz=true \ use_system_libffi=true \ use_system_libjpeg=true \ use_udev=false \ extra_cxxflags="${CXXFLAGS}" \ extra_ldflags="${LDFLAGS}" # sync with flags.gni GN_ARGS+= build_with_tflite_lib=false \ chrome_pgo_phase=0 \ clang_use_chrome_plugins=false \ disable_fieldtrial_testing_config=true \ enable_backup_ref_ptr_support=false \ enable_hangout_services_extension=false \ enable_mdns=false \ enable_mse_mpeg2ts_stream_parser=true \ enable_nacl=false \ enable_reading_list=false \ enable_remoting=false \ enable_reporting=false \ enable_service_discovery=false \ exclude_unwind_tables=true \ google_api_key="" \ google_default_client_id="" \ google_default_client_secret="" \ safe_browsing_mode=0 \ treat_warnings_as_errors=false \ use_official_google_api_keys=false \ use_unofficial_version_number=false # TODO: investigate building with these options: # use_system_minigbm GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles SUB_FILES= ungoogled-chromium.desktop ungoogled-chromium SUB_LIST+= COMMENT="${COMMENT}" OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS LTO TEST OPTIONS_DEFAULT= CODECS CUPS DRIVER KERBEROS SNDIO OPTIONS_EXCLUDE_aarch64=LTO OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO OPTIONS_RADIO= KERBEROS OPTIONS_RADIO_KERBEROS= HEIMDAL HEIMDAL_BASE MIT OPTIONS_SUB= yes CODECS_DESC= Compile and enable patented codecs like H.264 DRIVER_DESC= Install chromedriver HEIMDAL_BASE_DESC= Heimdal Kerberos (base) HEIMDAL_DESC= Heimdal Kerberos (security/heimdal) MIT_DESC= MIT Kerberos (security/krb5) ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \ alsa-lib>=1.1.1_1:audio/alsa-lib ALSA_VARS= GN_ARGS+=use_alsa=true ALSA_VARS_OFF= GN_ARGS+=use_alsa=false CODECS_VARS= GN_ARGS+=ffmpeg_branding="Chrome" \ GN_ARGS+=proprietary_codecs=true CODECS_VARS_OFF= GN_ARGS+=ffmpeg_branding="Chromium" \ GN_ARGS+=proprietary_codecs=false CUPS_LIB_DEPENDS= libcups.so:print/cups CUPS_VARS= GN_ARGS+=use_cups=true CUPS_VARS_OFF= GN_ARGS+=use_cups=false DEBUG_BUILD_DEPENDS= esbuild:devel/esbuild DEBUG_VARS= BUILDTYPE=Debug \ GN_ARGS+=is_debug=true \ GN_ARGS+=is_component_build=false \ GN_ARGS+=symbol_level=1 \ GN_BOOTSTRAP_FLAGS+=--debug \ WANTSPACE="21 GB" DEBUG_VARS_OFF= BUILDTYPE=Release \ GN_ARGS+=blink_symbol_level=0 \ GN_ARGS+=is_debug=false \ GN_ARGS+=is_official_build=true \ GN_ARGS+=symbol_level=0 \ WANTSPACE="14 GB" DRIVER_MAKE_ARGS= chromedriver HEIMDAL_LIB_DEPENDS= libkrb.so.26:security/heimdal KERBEROS_VARS= GN_ARGS+=use_kerberos=true KERBEROS_VARS_OFF= GN_ARGS+=use_kerberos=false LTO_VARS= GN_ARGS+=use_thin_lto=true \ GN_ARGS+=thin_lto_enable_optimizations=true \ WANTSPACE="14 GB" LTO_VARS_OFF= GN_ARGS+=use_thin_lto=false MIT_LIB_DEPENDS= libkrb.so.3:security/krb5 PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false # With SNDIO=on we exclude audio_manager_linux from the build (see # media/audio/BUILD.gn) and use audio_manager_openbsd which does not # support falling back to ALSA or PulseAudio. SNDIO_PREVENTS= ALSA PULSEAUDIO SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_VARS= GN_ARGS+=use_sndio=true SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false .include "Makefile.tests" TEST_DISTFILES= chromium-${DISTVERSION}-testdata${EXTRACT_SUFX} \ test_fonts-336e775eec536b2d785cc80eff6ac39051931286.tar.gz:external TEST_ALL_TARGET= ${TEST_TARGETS} .include .include # for COMPILER_VERSION .if ${PORT_OPTIONS:MHEIMDAL_BASE} && !exists(/usr/lib/libkrb5.so) IGNORE= you have selected HEIMDAL_BASE but do not have Heimdal installed in base .endif .if ${COMPILER_VERSION} < 150 LLVM_DEFAULT= 15 BUILD_DEPENDS+= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} BINARY_ALIAS+= cpp=${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} \ cc=${LOCALBASE}/bin/clang${LLVM_DEFAULT} \ c++=${LOCALBASE}/bin/clang++${LLVM_DEFAULT} \ ar=${LOCALBASE}/bin/llvm-ar${LLVM_DEFAULT} \ nm=${LOCALBASE}/bin/llvm-nm${LLVM_DEFAULT} \ ld=${LOCALBASE}/bin/ld.lld${LLVM_DEFAULT} .else BINARY_ALIAS+= ar=/usr/bin/llvm-ar \ nm=/usr/bin/llvm-nm .endif # swiftshader/lib/{libEGL.so,libGLESv2.so} is x86 only .if ${ARCH} == aarch64 PLIST_SUB+= NOT_AARCH64="@comment " .else PLIST_SUB+= NOT_AARCH64="" .endif # Allow relocations against read-only segments (override lld default) LDFLAGS_i386= -Wl,-znotext # TODO: -isystem, would be just as ugly as this approach, but more reliably # build would fail without C_INCLUDE_PATH/CPLUS_INCLUDE_PATH env var set. MAKE_ENV+= C_INCLUDE_PATH=${LOCALBASE}/include \ CPLUS_INCLUDE_PATH=${LOCALBASE}/include WRKSRC= ${WRKDIR}/chromium-${DISTVERSION} pre-everything:: @${ECHO_MSG} @${ECHO_MSG} "To build Ungoogled Chromium, you should have around 2GB of memory" @${ECHO_MSG} "and around ${WANTSPACE} of free disk space." @${ECHO_MSG} post-extract-TEST-on: @${MKDIR} ${WRKSRC}/third_party/test_fonts/test_fonts @${MV} ${WRKDIR}/test_fonts ${WRKSRC}/third_party/test_fonts/ pre-patch: cd ${WRKDIR}/ungoogled-chromium-${UGVERSION} && ${PYTHON_CMD} \ utils/prune_binaries.py ${WRKSRC} pruning.list cd ${WRKDIR}/ungoogled-chromium-${UGVERSION} && PATCH_BIN=gpatch \ ${PYTHON_CMD} utils/patches.py apply ${WRKSRC} patches cd ${WRKDIR}/ungoogled-chromium-${UGVERSION} && ${PYTHON_CMD} \ utils/domain_substitution.py apply -r domain_regex.list -f \ domain_substitution.list -c ${WRKSRC}/domsubcache.tar.gz ${WRKSRC} pre-configure: # We used to remove bundled libraries to be sure that chromium uses # system libraries and not shipped ones. # cd ${WRKSRC} && ${PYTHON_CMD} \ #./build/linux/unbundle/remove_bundled_libraries.py [list of preserved] cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \ ./build/linux/unbundle/replace_gn_files.py --system-libraries \ - flac fontconfig freetype harfbuzz-ng icu libdrm libevent libpng \ + dav1d flac fontconfig freetype harfbuzz-ng icu libdrm libevent libpng \ libusb libwebp libxml libxslt openh264 opus snappy || ${FALSE} # Chromium uses an unreleased version of FFmpeg, so configure it .for brand in Chrome Chromium ${CP} -R \ ${WRKSRC}/third_party/ffmpeg/chromium/config/${brand}/linux/ \ ${WRKSRC}/third_party/ffmpeg/chromium/config/${brand}/freebsd .endfor do-configure: # GN generator bootstrapping and generating ninja files cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} CC=${CC} CXX=${CXX} LD=${CXX} \ READELF=${READELF} AR=${AR} NM=${NM} ${PYTHON_CMD} \ ./tools/gn/bootstrap/bootstrap.py ${GN_BOOTSTRAP_FLAGS} cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./out/${BUILDTYPE}/gn \ gen --args='${GN_ARGS}' out/${BUILDTYPE} # Setup nodejs dependency @${MKDIR} ${WRKSRC}/third_party/node/freebsd/node-freebsd/bin ${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/freebsd/node-freebsd/bin/node # Setup buildtools/freebsd @${MKDIR} ${WRKSRC}/buildtools/freebsd ${LN} -sf ${WRKSRC}/buildtools/linux64/clang-format ${WRKSRC}/buildtools/freebsd ${LN} -sf ${WRKSRC}/out/${BUILDTYPE}/gn ${WRKSRC}/buildtools/freebsd ${LN} -sf /usr/bin/strip ${WRKSRC}/buildtools/freebsd/strip do-install: @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_MAN} ${WRKSRC}/chrome/app/resources/manpage.1.in \ ${STAGEDIR}${MANPREFIX}/man/man1/ungoogled-chromium.1 @${SED} -i "" -e 's,\@\@PACKAGE\@\@,chromium,g;s,\@\@MENUNAME\@\@,Chromium Web Browser,g' \ ${STAGEDIR}${MANPREFIX}/man/man1/ungoogled-chromium.1 ${CP} ${WRKSRC}/chrome/app/theme/chromium/product_logo_22_mono.png ${WRKSRC}/chrome/app/theme/chromium/product_logo_22.png .for s in 22 24 48 64 128 256 @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps ${INSTALL_DATA} ${WRKSRC}/chrome/app/theme/chromium/product_logo_${s}.png \ ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps/ungoogled-chromium.png .endfor ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.png ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.pak ${STAGEDIR}${DATADIR} .for d in protoc mksnapshot ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/${d} ${STAGEDIR}${DATADIR} .endfor .for d in snapshot_blob.bin v8_context_snapshot.bin ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${d} ${STAGEDIR}${DATADIR} .endfor ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chrome \ ${STAGEDIR}${DATADIR}/ungoogled-chromium cd ${WRKSRC}/out/${BUILDTYPE} && \ ${COPYTREE_SHARE} "locales resources" ${STAGEDIR}${DATADIR} @${MKDIR} ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/ungoogled-chromium.desktop \ ${STAGEDIR}${DESKTOPDIR} ${INSTALL_SCRIPT} ${WRKDIR}/ungoogled-chromium ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${WRKSRC}/chrome/tools/build/linux/chrome-wrapper \ ${STAGEDIR}${DATADIR} # ANGLE, EGL, Vk .for f in libEGL.so libGLESv2.so libVkICD_mock_icd.so ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR} .endfor ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvulkan.so.1 \ ${STAGEDIR}${DATADIR}/libvulkan.so .if ${BUILDTYPE} == Debug ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libVkLayer_khronos_validation.so ${STAGEDIR}${DATADIR} .endif # SwiftShader .if ${ARCH} != aarch64 ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvk_swiftshader.so ${STAGEDIR}${DATADIR} .endif post-install-DEBUG-on: ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/*.so \ ${STAGEDIR}${DATADIR} ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/character_data_generator \ ${STAGEDIR}${DATADIR} post-install-DRIVER-on: ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chromedriver \ ${STAGEDIR}${PREFIX}/bin/ungoogled-chromedriver do-test-TEST-on: .for t in ${TEST_TARGETS} cd ${WRKSRC}/out/${BUILDTYPE} && ${SETENV} LC_ALL=en_US.UTF-8 \ ./${t} --gtest_filter=-${EXCLUDE_${t}:ts:} || ${TRUE} .endfor .include diff --git a/www/ungoogled-chromium/distinfo b/www/ungoogled-chromium/distinfo index 5fbfa52a990c..744e6c9d0c77 100644 --- a/www/ungoogled-chromium/distinfo +++ b/www/ungoogled-chromium/distinfo @@ -1,9 +1,9 @@ -TIMESTAMP = 1681996510 -SHA256 (chromium-112.0.5615.165.tar.xz) = 168c62fea9f428f99fbf967f36a75ee5da160429e3a5b86bf02188c5fe7c79fd -SIZE (chromium-112.0.5615.165.tar.xz) = 1730146076 -SHA256 (ungoogled-chromium-112.0.5615.165-1.tar.gz) = 3e28fa0a5988be4086993e483bd031ac6d2f3284ffbebdf1f7954c7ef2b86398 -SIZE (ungoogled-chromium-112.0.5615.165-1.tar.gz) = 674815 -SHA256 (chromium-112.0.5615.165-testdata.tar.xz) = d10ec115c80ffa9a07af737cdfc976a7f092f16f777c2c42dcaa9e3648831d96 -SIZE (chromium-112.0.5615.165-testdata.tar.xz) = 256178092 +TIMESTAMP = 1683288940 +SHA256 (chromium-113.0.5672.63.tar.xz) = 76cec11dc13abe6703305b0300e1fe24c8f547c1ff313f7be09db0e23d12ee1e +SIZE (chromium-113.0.5672.63.tar.xz) = 1556641240 +SHA256 (ungoogled-chromium-113.0.5672.63-1.tar.gz) = ad7a3169d95f182df748940349e2c25868a201949486257829fdb42c69a83a51 +SIZE (ungoogled-chromium-113.0.5672.63-1.tar.gz) = 672552 +SHA256 (chromium-113.0.5672.63-testdata.tar.xz) = 707ebc13e231cb303fc84d11a8c1a43ea514f958eeec155205d2b5c7754bc2cd +SIZE (chromium-113.0.5672.63-testdata.tar.xz) = 264055676 SHA256 (test_fonts-336e775eec536b2d785cc80eff6ac39051931286.tar.gz) = a2ca2962daf482a8f943163541e1c73ba4b2694fabcd2510981f2db4eda493c8 SIZE (test_fonts-336e775eec536b2d785cc80eff6ac39051931286.tar.gz) = 32624734 diff --git a/www/ungoogled-chromium/files/patch-BUILD.gn b/www/ungoogled-chromium/files/patch-BUILD.gn index d83294086a3e..58d02bbd3662 100644 --- a/www/ungoogled-chromium/files/patch-BUILD.gn +++ b/www/ungoogled-chromium/files/patch-BUILD.gn @@ -1,89 +1,89 @@ ---- BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ BUILD.gn @@ -60,7 +60,7 @@ declare_args() { root_extra_deps = [] } -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) -@@ -90,7 +90,6 @@ group("gn_all") { +@@ -85,7 +85,6 @@ group("gn_all") { "//codelabs", "//components:components_unittests", "//components/gwp_asan:gwp_asan_unittests", - "//infra/orchestrator:orchestrator_all", "//net:net_unittests", "//sandbox:sandbox_unittests", "//services:services_unittests", -@@ -423,7 +422,7 @@ group("gn_all") { +@@ -426,7 +425,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", -@@ -614,6 +613,15 @@ group("gn_all") { +@@ -622,6 +621,15 @@ group("gn_all") { } } + if (is_bsd) { + deps -= [ + "//third_party/breakpad:dump_syms($host_toolchain)", + "//third_party/breakpad:microdump_stackwalk($host_toolchain)", + "//third_party/breakpad:minidump_dump($host_toolchain)", + "//third_party/breakpad:minidump_stackwalk($host_toolchain)", + ] + } + if (is_mac) { deps += [ - "//third_party/breakpad:crash_inspector", -@@ -662,7 +670,7 @@ group("gn_all") { + "//third_party/breakpad:dump_syms", +@@ -669,7 +677,7 @@ group("gn_all") { host_os == "win") { deps += [ "//chrome/test/mini_installer:mini_installer_tests" ] } - } else if (!is_android && !is_ios && !is_fuchsia) { + } else if (!is_android && !is_ios && !is_fuchsia && !is_bsd) { deps += [ "//third_party/breakpad:symupload($host_toolchain)" ] } -@@ -1085,7 +1093,7 @@ if (!is_ios) { +@@ -1092,7 +1100,7 @@ if (!is_ios) { ] } - if (!is_chromeos_ash && !is_ios && !is_fuchsia && !is_android && !is_castos) { + if (!is_chromeos_ash && !is_ios && !is_fuchsia && !is_android && !is_castos && !is_bsd) { # WPT Webdriver tests runner # chrome/test/chromedriver/test/run_webdriver_tests.py script_test("webdriver_wpt_tests") { -@@ -1185,7 +1193,7 @@ if (!is_ios) { +@@ -1192,7 +1200,7 @@ if (!is_ios) { 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)" ] } -@@ -1194,7 +1202,7 @@ if (!is_ios) { +@@ -1201,7 +1209,7 @@ if (!is_ios) { 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)" ] } -@@ -1662,7 +1670,7 @@ group("chromium_builder_perf") { +@@ -1669,7 +1677,7 @@ group("chromium_builder_perf") { data_deps += [ "//chrome/test:performance_browser_tests" ] } - if (!is_win) { + if (!is_win && !is_bsd) { data_deps += [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ] } diff --git a/www/ungoogled-chromium/files/patch-base_BUILD.gn b/www/ungoogled-chromium/files/patch-base_BUILD.gn index f341d8c5a068..ed38e02a0524 100644 --- a/www/ungoogled-chromium/files/patch-base_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-base_BUILD.gn @@ -1,143 +1,143 @@ ---- base/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- base/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ base/BUILD.gn -@@ -188,7 +188,7 @@ buildflag_header("ios_cronet_buildflags") { +@@ -198,7 +198,7 @@ buildflag_header("ios_cronet_buildflags") { flags = [ "CRONET_BUILD=$is_cronet_build" ] } -enable_message_pump_epoll = is_linux || is_chromeos || is_android +enable_message_pump_epoll = (is_linux || is_chromeos || is_android) && !is_bsd buildflag_header("message_pump_buildflags") { header = "message_pump_buildflags.h" header_dir = "base/message_loop" -@@ -1093,11 +1093,23 @@ component("base") { +@@ -1105,11 +1105,23 @@ component("base") { # Needed for if using newer C++ library than sysroot, except if # building inside the cros_sdk environment - use host_toolchain as a # more robust check for this. - if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos)) && + if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos && !is_bsd)) && host_toolchain != "//build/toolchain/cros:host") { libs += [ "atomic" ] } + # *BSD needs libkvm + if (is_bsd) { + libs += [ "kvm" ] + } + + if (is_freebsd) { + libs += [ + "execinfo", + "util", + ] + } + if (use_allocator_shim) { sources += [ "allocator/partition_allocator/shim/allocator_shim.cc", -@@ -1125,7 +1137,7 @@ component("base") { +@@ -1137,7 +1149,7 @@ 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/partition_allocator/shim/allocator_shim_override_cpp_symbols.h", "allocator/partition_allocator/shim/allocator_shim_override_glibc_weak_symbols.h", -@@ -1166,7 +1178,7 @@ component("base") { +@@ -1178,7 +1190,7 @@ component("base") { # Allow more direct string conversions on platforms with native utf8 # strings - if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) { + if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia || is_bsd) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -2107,6 +2119,43 @@ component("base") { +@@ -2135,6 +2147,43 @@ component("base") { } } + if (is_bsd) { + sources -= [ + "files/file_path_watcher_inotify.cc", + "files/scoped_file_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", + "profiler/stack_copier_signal.cc", + "profiler/stack_copier_signal.h", + "profiler/thread_delegate_posix.cc", + "profiler/thread_delegate_posix.h", + ] + sources += [ + "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 += [ -@@ -2202,7 +2251,7 @@ component("base") { +@@ -2244,7 +2293,7 @@ component("base") { } if (dep_libevent) { - deps += [ "//third_party/libevent" ] + public_deps += [ "//third_party/libevent" ] } if (use_libevent) { -@@ -3470,7 +3519,7 @@ test("base_unittests") { +@@ -3562,7 +3611,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", -@@ -3519,7 +3568,7 @@ test("base_unittests") { +@@ -3611,7 +3660,7 @@ test("base_unittests") { "posix/file_descriptor_shuffle_unittest.cc", "posix/unix_domain_socket_unittest.cc", ] - if (!is_nacl && !is_apple) { + if (!is_nacl && !is_apple && !is_bsd) { sources += [ "profiler/stack_base_address_posix_unittest.cc", "profiler/stack_copier_signal_unittest.cc", -@@ -3530,7 +3579,7 @@ test("base_unittests") { +@@ -3622,7 +3671,7 @@ test("base_unittests") { # Allow more direct string conversions on platforms with native utf8 # strings - if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) { + if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia || is_bsd) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -3751,7 +3800,7 @@ test("base_unittests") { +@@ -3848,7 +3897,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", diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h index c8db5e5a3584..a028ac797af0 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h @@ -1,38 +1,38 @@ ---- base/allocator/partition_allocator/page_allocator_constants.h.orig 2022-10-01 07:40:07 UTC +--- base/allocator/partition_allocator/page_allocator_constants.h.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/page_allocator_constants.h @@ -25,7 +25,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 @@ -81,7 +81,7 @@ PageAllocationGranularityShift() { return 14; // 16kB #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS) return static_cast(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. size_t shift = page_characteristics.shift.load(std::memory_order_relaxed); @@ -102,7 +102,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. size_t size = page_characteristics.size.load(std::memory_order_relaxed); @@ -141,7 +141,7 @@ SystemPageShift() { - PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR PA_ALWAYS_INLINE size_t + PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t SystemPageSize() { #if (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)) // This is literally equivalent to |1 << SystemPageShift()| below, but was // separated out for 64-bit IS_APPLE and arm64 on Linux to avoid << on a // non-constexpr. diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h index b54c3205c162..4bea35599953 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h @@ -1,16 +1,16 @@ ---- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2023-04-08 11:38:38 UTC +--- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/page_allocator_internals_posix.h -@@ -380,8 +380,12 @@ bool TryRecommitSystemPagesInternal( +@@ -383,8 +383,12 @@ bool TryRecommitSystemPagesInternal( void DiscardSystemPagesInternal(uintptr_t address, size_t length) { void* ptr = reinterpret_cast(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); diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni index 63c6fe91fad6..2b195ed5dcf6 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/partition_alloc.gni.orig 2023-04-08 11:38:38 UTC +--- base/allocator/partition_allocator/partition_alloc.gni.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/partition_alloc.gni -@@ -276,7 +276,7 @@ assert(!use_asan_backup_ref_ptr || use_hookable_raw_pt +@@ -285,7 +285,7 @@ assert(!use_asan_backup_ref_ptr || use_hookable_raw_pt "AsanBackupRefPtr requires RawPtrHookableImpl") declare_args() { - enable_pkeys = is_linux && target_cpu == "x64" + enable_pkeys = (is_linux && !is_bsd) && target_cpu == "x64" } assert(!enable_pkeys || (is_linux && target_cpu == "x64"), "Pkeys are only supported on x64 linux") diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__base_compiler__specific.h b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__base_compiler__specific.h new file mode 100644 index 000000000000..2f6869ec88fd --- /dev/null +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__base_compiler__specific.h @@ -0,0 +1,32 @@ +--- base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h.orig 2023-05-05 12:12:41 UTC ++++ base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h +@@ -24,9 +24,9 @@ + // Annotate a function indicating it should not be inlined. + // Use like: + // NOINLINE void DoStuff() { ... } +-#if defined(__clang__) && PA_HAS_ATTRIBUTE(noinline) ++#if defined(__clang__) && (__clang_major__ >= 15) && PA_HAS_ATTRIBUTE(noinline) + #define PA_NOINLINE [[clang::noinline]] +-#elif defined(COMPILER_GCC) && PA_HAS_ATTRIBUTE(noinline) ++#elif (defined(COMPILER_GCC) || defined(__clang__)) && PA_HAS_ATTRIBUTE(noinline) + #define PA_NOINLINE __attribute__((noinline)) + #elif defined(COMPILER_MSVC) + #define PA_NOINLINE __declspec(noinline) +@@ -34,7 +34,7 @@ + #define PA_NOINLINE + #endif + +-#if defined(__clang__) && defined(NDEBUG) && PA_HAS_ATTRIBUTE(always_inline) ++#if defined(__clang__) && (__clang_major__ >= 15) && defined(NDEBUG) && PA_HAS_ATTRIBUTE(always_inline) + #define PA_ALWAYS_INLINE [[clang::always_inline]] inline + #elif defined(COMPILER_GCC) && defined(NDEBUG) && \ + PA_HAS_ATTRIBUTE(always_inline) +@@ -53,7 +53,7 @@ + // prevent code folding, see NO_CODE_FOLDING() in base/debug/alias.h. + // Use like: + // void NOT_TAIL_CALLED FooBar(); +-#if defined(__clang__) && PA_HAS_ATTRIBUTE(not_tail_called) ++#if defined(__clang__) && (__clang_major__ >= 15) && PA_HAS_ATTRIBUTE(not_tail_called) + #define PA_NOT_TAIL_CALLED [[clang::not_tail_called]] + #else + #define PA_NOT_TAIL_CALLED diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h index a92644c3162c..6cde1ad43350 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h @@ -1,29 +1,29 @@ ---- base/allocator/partition_allocator/partition_alloc_config.h.orig 2023-04-08 11:38:38 UTC +--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/partition_alloc_config.h @@ -104,7 +104,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). #define PA_CONFIG_HAS_LINUX_KERNEL() \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)) // On some platforms, we implement locking by spinning in userspace, then going // into the kernel only if there is contention. This requires platform support, -@@ -251,7 +251,7 @@ constexpr bool kUseLazyCommit = false; +@@ -232,7 +232,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. #define PA_CONFIG_HAS_ATFORK_HANDLER() \ - (BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) + (BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) // PartitionAlloc uses PartitionRootEnumerator to acquire all // PartitionRoots at BeforeFork and to release at AfterFork. -@@ -296,7 +296,7 @@ constexpr bool kUseLazyCommit = false; +@@ -277,7 +277,7 @@ constexpr bool kUseLazyCommit = false; // Also enabled on ARM64 macOS, as the 16kiB pages on this platform lead to // larger slot spans. #define PA_CONFIG_PREFER_SMALLER_SLOT_SPANS() \ - (BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64))) + (BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) || BUILDFLAG(IS_BSD)) // Enable shadow metadata. // diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h index c1c944754520..8596ccf06f5c 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h @@ -1,20 +1,20 @@ ---- base/allocator/partition_allocator/partition_alloc_constants.h.orig 2023-04-08 11:38:38 UTC +--- base/allocator/partition_allocator/partition_alloc_constants.h.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/partition_alloc_constants.h @@ -92,7 +92,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 PA_ALWAYS_INLINE size_t + PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t PartitionPageShift() { return PageAllocationGranularityShift() + 2; -@@ -296,7 +296,7 @@ constexpr size_t kNumPools = kMaxPoolHandle - 1; +@@ -293,7 +293,7 @@ constexpr size_t kNumPools = kMaxPoolHandle - 1; // When pointer compression is enabled, we cannot use large pools (at most // 8GB for each of the glued pools). #if BUILDFLAG(HAS_64_BIT_POINTERS) -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || PA_CONFIG(POINTER_COMPRESSION) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || PA_CONFIG(POINTER_COMPRESSION) || BUILDFLAG(IS_BSD) constexpr size_t kPoolMaxSize = 8 * kGiB; #else constexpr size_t kPoolMaxSize = 16 * kGiB; diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__page.h b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__page.h index e82d4e1f542c..1f9a8548a9eb 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__page.h +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__page.h @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/partition_page.h.orig 2023-04-08 11:38:38 UTC +--- base/allocator/partition_allocator/partition_page.h.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/partition_page.h -@@ -143,7 +143,7 @@ struct SlotSpanMetadata { +@@ -141,7 +141,7 @@ struct SlotSpanMetadata { // 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). diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__root.cc b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__root.cc index a69dea01087c..03593e710a3d 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__root.cc +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_partition__root.cc @@ -1,38 +1,38 @@ ---- base/allocator/partition_allocator/partition_root.cc.orig 2023-04-08 11:38:38 UTC +--- base/allocator/partition_allocator/partition_root.cc.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/partition_root.cc -@@ -42,7 +42,7 @@ +@@ -43,7 +43,7 @@ #include "wow64apiset.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #endif -@@ -245,7 +245,7 @@ void PartitionAllocMallocInitOnce() { +@@ -284,7 +284,7 @@ void PartitionAllocMallocInitOnce() { 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. -@@ -339,7 +339,7 @@ static size_t PartitionPurgeSlotSpan( +@@ -378,7 +378,7 @@ static size_t PartitionPurgeSlotSpan( constexpr size_t kMaxSlotCount = (PartitionPageSize() * kMaxPartitionPagesPerRegularSlotSpan) / MinPurgeableSlotSize(); -#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 -@@ -811,7 +811,7 @@ void PartitionRoot::Init(PartitionOptions +@@ -850,7 +850,7 @@ void PartitionRoot::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 diff --git a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc index 284fcc7a5542..2b6b22d395d5 100644 --- a/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc +++ b/www/ungoogled-chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc @@ -1,53 +1,53 @@ ---- base/allocator/partition_allocator/spinning_mutex.cc.orig 2023-03-10 11:01:21 UTC +--- base/allocator/partition_allocator/spinning_mutex.cc.orig 2023-05-05 12:12:41 UTC +++ base/allocator/partition_allocator/spinning_mutex.cc @@ -18,7 +18,16 @@ #if PA_CONFIG(HAS_LINUX_KERNEL) #include +#if defined(OS_OPENBSD) +#include +#include +#elif defined(OS_FREEBSD) +#include +#include +#include +#else #include +#endif #include #include #endif // PA_CONFIG(HAS_LINUX_KERNEL) -@@ -107,8 +116,16 @@ void SpinningMutex::FutexWait() { +@@ -108,8 +117,16 @@ 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); +#elif defined(OS_OPENBSD) + int err = futex(reinterpret_cast(&state_), FUTEX_WAIT | FUTEX_PRIVATE_FLAG, + 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. -@@ -120,8 +137,16 @@ void SpinningMutex::FutexWait() { +@@ -121,8 +138,16 @@ void SpinningMutex::FutexWait() { 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); +#elif defined(OS_OPENBSD) + long retval = futex(reinterpret_cast(&state_), FUTEX_WAKE | FUTEX_PRIVATE_FLAG, + 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; } diff --git a/www/ungoogled-chromium/files/patch-base_base__switches.cc b/www/ungoogled-chromium/files/patch-base_base__switches.cc index a5d89d37a139..c9196b403a8d 100644 --- a/www/ungoogled-chromium/files/patch-base_base__switches.cc +++ b/www/ungoogled-chromium/files/patch-base_base__switches.cc @@ -1,11 +1,11 @@ ---- base/base_switches.cc.orig 2022-10-01 07:40:07 UTC +--- base/base_switches.cc.orig 2023-05-05 12:12:41 UTC +++ base/base_switches.cc -@@ -170,7 +170,7 @@ const char kForceFieldTrialParams[] = "force-fieldtria +@@ -167,7 +167,7 @@ const char kForceFieldTrialParams[] = "force-fieldtria #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // TODO(crbug.com/1176772): Remove kEnableCrashpad and IsCrashpadEnabled() when // Crashpad is fully enabled on Linux. Indicates that Crashpad should be // enabled. diff --git a/www/ungoogled-chromium/files/patch-base_base__switches.h b/www/ungoogled-chromium/files/patch-base_base__switches.h index 71316c4d96ef..461d1b033c5a 100644 --- a/www/ungoogled-chromium/files/patch-base_base__switches.h +++ b/www/ungoogled-chromium/files/patch-base_base__switches.h @@ -1,11 +1,11 @@ ---- base/base_switches.h.orig 2022-10-01 07:40:07 UTC +--- base/base_switches.h.orig 2023-05-05 12:12:41 UTC +++ base/base_switches.h -@@ -60,7 +60,7 @@ extern const char kEnableIdleTracing[]; +@@ -57,7 +57,7 @@ extern const char kEnableIdleTracing[]; extern const char kForceFieldTrialParams[]; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // TODO(crbug.com/1176772): Remove kEnableCrashpad and IsCrashpadEnabled() when // Crashpad is fully enabled on Linux. extern const char kEnableCrashpad[]; diff --git a/www/ungoogled-chromium/files/patch-base_compiler__specific.h b/www/ungoogled-chromium/files/patch-base_compiler__specific.h new file mode 100644 index 000000000000..97e912d487ba --- /dev/null +++ b/www/ungoogled-chromium/files/patch-base_compiler__specific.h @@ -0,0 +1,35 @@ +--- base/compiler_specific.h.orig 2023-05-05 12:12:41 UTC ++++ base/compiler_specific.h +@@ -41,9 +41,9 @@ + // Annotate a function indicating it should not be inlined. + // Use like: + // NOINLINE void DoStuff() { ... } +-#if defined(__clang__) && HAS_ATTRIBUTE(noinline) ++#if defined(__clang__) && (__clang_major__ >= 15) && HAS_ATTRIBUTE(noinline) + #define NOINLINE [[clang::noinline]] +-#elif defined(COMPILER_GCC) && HAS_ATTRIBUTE(noinline) ++#elif (defined(COMPILER_GCC) || defined(__clang__)) && HAS_ATTRIBUTE(noinline) + #define NOINLINE __attribute__((noinline)) + #elif defined(COMPILER_MSVC) + #define NOINLINE __declspec(noinline) +@@ -51,9 +51,9 @@ + #define NOINLINE + #endif + +-#if defined(__clang__) && defined(NDEBUG) && HAS_ATTRIBUTE(always_inline) ++#if defined(__clang__) && (__clang_major__ >= 15) && defined(NDEBUG) && HAS_ATTRIBUTE(always_inline) + #define ALWAYS_INLINE [[clang::always_inline]] inline +-#elif defined(COMPILER_GCC) && defined(NDEBUG) && HAS_ATTRIBUTE(always_inline) ++#elif (defined(COMPILER_GCC) || defined(__clang__)) && defined(NDEBUG) && HAS_ATTRIBUTE(always_inline) + #define ALWAYS_INLINE inline __attribute__((__always_inline__)) + #elif defined(COMPILER_MSVC) && defined(NDEBUG) + #define ALWAYS_INLINE __forceinline +@@ -69,7 +69,7 @@ + // prevent code folding, see NO_CODE_FOLDING() in base/debug/alias.h. + // Use like: + // NOT_TAIL_CALLED void FooBar(); +-#if defined(__clang__) && HAS_ATTRIBUTE(not_tail_called) ++#if defined(__clang__) && (__clang_major__ >= 15) && HAS_ATTRIBUTE(not_tail_called) + #define NOT_TAIL_CALLED [[clang::not_tail_called]] + #else + #define NOT_TAIL_CALLED diff --git a/www/ungoogled-chromium/files/patch-base_files_file__util__posix.cc b/www/ungoogled-chromium/files/patch-base_files_file__util__posix.cc index 50b63ab9e370..0f2476efd374 100644 --- a/www/ungoogled-chromium/files/patch-base_files_file__util__posix.cc +++ b/www/ungoogled-chromium/files/patch-base_files_file__util__posix.cc @@ -1,52 +1,52 @@ ---- base/files/file_util_posix.cc.orig 2022-10-01 07:40:07 UTC +--- base/files/file_util_posix.cc.orig 2023-05-05 12:12:41 UTC +++ base/files/file_util_posix.cc -@@ -700,32 +700,34 @@ bool CreateDirectoryAndGetError(const FilePath& full_p +@@ -756,32 +756,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 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; diff --git a/www/ungoogled-chromium/files/patch-base_files_file__util__unittest.cc b/www/ungoogled-chromium/files/patch-base_files_file__util__unittest.cc index b53006827443..23afe7fc269e 100644 --- a/www/ungoogled-chromium/files/patch-base_files_file__util__unittest.cc +++ b/www/ungoogled-chromium/files/patch-base_files_file__util__unittest.cc @@ -1,20 +1,20 @@ ---- base/files/file_util_unittest.cc.orig 2023-03-10 11:01:21 UTC +--- base/files/file_util_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ base/files/file_util_unittest.cc -@@ -3749,7 +3749,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) { +@@ -3853,7 +3853,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) { } #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) TEST_F(FileUtilTest, ReadFileToStringWithProcFileSystem) { FilePath file_path("/proc/cpuinfo"); std::string data = "temp"; -@@ -4472,7 +4472,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles +@@ -4576,7 +4576,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles NULL); #else size_t bytes_written = - ::write(::fileno(output_file.get()), content.c_str(), content.length()); + ::write(fileno(output_file.get()), content.c_str(), content.length()); #endif EXPECT_EQ(content.length(), bytes_written); ::fflush(output_file.get()); diff --git a/www/ungoogled-chromium/files/patch-base_process_launch.h b/www/ungoogled-chromium/files/patch-base_process_launch.h index f77e6e9d9143..4d798ddb2b35 100644 --- a/www/ungoogled-chromium/files/patch-base_process_launch.h +++ b/www/ungoogled-chromium/files/patch-base_process_launch.h @@ -1,11 +1,11 @@ ---- base/process/launch.h.orig 2022-10-01 07:40:07 UTC +--- base/process/launch.h.orig 2023-05-05 12:12:41 UTC +++ base/process/launch.h -@@ -198,7 +198,7 @@ struct BASE_EXPORT LaunchOptions { +@@ -200,7 +200,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 diff --git a/www/ungoogled-chromium/files/patch-base_process_process__unittest.cc b/www/ungoogled-chromium/files/patch-base_process_process__unittest.cc index 754c10a4cbed..04a4a227d43b 100644 --- a/www/ungoogled-chromium/files/patch-base_process_process__unittest.cc +++ b/www/ungoogled-chromium/files/patch-base_process_process__unittest.cc @@ -1,11 +1,11 @@ ---- base/process/process_unittest.cc.orig 2023-03-10 11:01:21 UTC +--- base/process/process_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ base/process/process_unittest.cc -@@ -194,7 +194,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) { +@@ -195,7 +195,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) { // was spawned and a time recorded after it was spawned. However, since the // base::Time and process creation clocks don't match, tolerate some error. constexpr base::TimeDelta kTolerance = -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // On Linux, process creation time is relative to boot time which has a // 1-second resolution. Tolerate 1 second for the imprecise boot time and // 100 ms for the imprecise clock. diff --git a/www/ungoogled-chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc b/www/ungoogled-chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc index 06bf26e62c2c..e7729a1c6aef 100644 --- a/www/ungoogled-chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc +++ b/www/ungoogled-chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc @@ -1,11 +1,11 @@ ---- base/profiler/stack_sampling_profiler_test_util.cc.orig 2023-02-11 09:11:04 UTC +--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2023-05-05 12:12:41 UTC +++ base/profiler/stack_sampling_profiler_test_util.cc -@@ -33,7 +33,7 @@ +@@ -36,7 +36,7 @@ // Fortunately, it provides _alloca, which functions identically. #include #define alloca _alloca -#else +#elif !BUILDFLAG(IS_BSD) #include #endif diff --git a/www/ungoogled-chromium/files/patch-base_threading_platform__thread__unittest.cc b/www/ungoogled-chromium/files/patch-base_threading_platform__thread__unittest.cc index d16fbe34a5bc..b25e60f14fd8 100644 --- a/www/ungoogled-chromium/files/patch-base_threading_platform__thread__unittest.cc +++ b/www/ungoogled-chromium/files/patch-base_threading_platform__thread__unittest.cc @@ -1,38 +1,38 @@ ---- base/threading/platform_thread_unittest.cc.orig 2023-03-10 11:01:21 UTC +--- base/threading/platform_thread_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ base/threading/platform_thread_unittest.cc -@@ -31,7 +31,7 @@ +@@ -32,7 +32,7 @@ #include "base/time/time.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #include #include -@@ -422,7 +422,7 @@ TEST(PlatformThreadTest, +@@ -423,7 +423,7 @@ TEST(PlatformThreadTest, // and hardcodes what we know. Please inform scheduler-dev@ch40m1um.qjz9zk if this // proprerty changes for a given platform. TEST(PlatformThreadTest, CanChangeThreadType) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // On Ubuntu, RLIMIT_NICE and RLIMIT_RTPRIO are 0 by default, so we won't be // able to increase priority to any level. constexpr bool kCanIncreasePriority = false; -@@ -701,12 +701,16 @@ INSTANTIATE_TEST_SUITE_P( +@@ -704,12 +704,16 @@ INSTANTIATE_TEST_SUITE_P( #endif // BUILDFLAG(IS_APPLE) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) namespace { bool IsTidCacheCorrect() { +#if BUILDFLAG(IS_BSD) + return PlatformThread::CurrentId() == reinterpret_cast(pthread_self()); +#else return PlatformThread::CurrentId() == syscall(__NR_gettid); +#endif } void* CheckTidCacheCorrectWrapper(void*) { diff --git a/www/ungoogled-chromium/files/patch-build_config_compiler_BUILD.gn b/www/ungoogled-chromium/files/patch-build_config_compiler_BUILD.gn index a8e5eccaf053..db9f66592f8d 100644 --- a/www/ungoogled-chromium/files/patch-build_config_compiler_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-build_config_compiler_BUILD.gn @@ -1,131 +1,131 @@ ---- build/config/compiler/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- build/config/compiler/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ build/config/compiler/BUILD.gn @@ -237,13 +237,16 @@ config("default_include_dirs") { # 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 --------------------------------------------------------------------- @@ -467,6 +470,10 @@ config("compiler") { } } + if (is_openbsd) { + ldflags += [ "-Wl,-z,wxneeded" ] + } + # Linux-specific compiler flags setup. # ------------------------------------ if (use_gold) { @@ -542,7 +549,7 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } - if (is_clang && !is_nacl && current_os != "zos") { + if (is_clang && !is_nacl && current_os != "zos" && !is_bsd) { cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] if (save_reproducers_on_lld_crash && use_lld) { ldflags += [ -@@ -826,7 +833,7 @@ config("compiler") { +@@ -816,7 +823,7 @@ config("compiler") { # * Apple platforms (e.g. MacOS, iPhone, iPad) aren't supported because xcode # lldb doesn't have the needed changes yet. # TODO(crbug.com/1379070): Remove if the upstream default ever changes. - if (is_clang && !is_nacl && !is_win && !is_apple) { + if (is_clang && !is_nacl && !is_win && !is_apple && !is_bsd) { cflags_cc += [ "-gsimple-template-names" ] } -@@ -1009,7 +1016,7 @@ config("compiler_cpu_abi") { +@@ -996,7 +1003,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 && !(is_chromeos_lacros && is_chromeos_device)) { cflags += [ "--target=arm-linux-gnueabihf" ] ldflags += [ "--target=arm-linux-gnueabihf" ] -@@ -1024,7 +1031,7 @@ config("compiler_cpu_abi") { +@@ -1011,7 +1018,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 && !(is_chromeos_lacros && is_chromeos_device)) { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] -@@ -1359,7 +1366,7 @@ config("compiler_deterministic") { +@@ -1346,7 +1353,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", -@@ -1411,7 +1418,7 @@ config("compiler_deterministic") { +@@ -1398,7 +1405,7 @@ config("compiler_deterministic") { } config("clang_revision") { - if (is_clang && clang_base_path == default_clang_base_path) { + if (is_clang && !is_bsd && clang_base_path == default_clang_base_path) { update_args = [ "--print-revision", "--verify-version=$clang_version", -@@ -1649,7 +1656,7 @@ config("default_warnings") { +@@ -1636,7 +1643,7 @@ config("default_warnings") { "-Wno-ignored-pragma-optimize", ] - if (!is_nacl) { + if (!is_nacl && !is_bsd) { cflags += [ # TODO(crbug.com/1343975) Evaluate and possibly enable. "-Wno-deprecated-builtins", -@@ -1831,7 +1838,7 @@ config("no_chromium_code") { +@@ -1827,7 +1834,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", -@@ -2339,7 +2346,7 @@ config("afdo_optimize_size") { +@@ -2337,7 +2344,7 @@ config("afdo_optimize_size") { # 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. -@@ -2358,7 +2365,7 @@ config("afdo") { +@@ -2356,7 +2363,7 @@ config("afdo") { } 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 ] } -@@ -2513,7 +2520,8 @@ config("symbols") { +@@ -2511,7 +2518,8 @@ config("symbols") { configs += [ "//build/config:compress_debug_sections" ] } - if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") { + if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos" && + !is_bsd) { if (is_apple) { # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. # Make sure we don't use constructor homing on mac. diff --git a/www/ungoogled-chromium/files/patch-build_config_rust.gni b/www/ungoogled-chromium/files/patch-build_config_rust.gni index 9e7b94f5e08a..029cf9d5d85c 100644 --- a/www/ungoogled-chromium/files/patch-build_config_rust.gni +++ b/www/ungoogled-chromium/files/patch-build_config_rust.gni @@ -1,11 +1,11 @@ ---- build/config/rust.gni.orig 2023-04-08 11:38:38 UTC +--- build/config/rust.gni.orig 2023-05-05 12:12:41 UTC +++ build/config/rust.gni -@@ -135,7 +135,7 @@ if (enable_rust) { +@@ -157,7 +157,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") } diff --git a/www/ungoogled-chromium/files/patch-build_toolchain_gcc__toolchain.gni b/www/ungoogled-chromium/files/patch-build_toolchain_gcc__toolchain.gni index 15d5102bb035..01636b7f5176 100644 --- a/www/ungoogled-chromium/files/patch-build_toolchain_gcc__toolchain.gni +++ b/www/ungoogled-chromium/files/patch-build_toolchain_gcc__toolchain.gni @@ -1,44 +1,44 @@ ---- build/toolchain/gcc_toolchain.gni.orig 2023-04-08 11:38:38 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2023-05-05 12:12:41 UTC +++ 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). # -@@ -825,22 +832,12 @@ template("gcc_toolchain") { +@@ -837,22 +844,12 @@ template("gcc_toolchain") { # use_gold too. template("clang_toolchain") { gcc_toolchain(target_name) { - _path = "$clang_base_path/bin" - _is_path_absolute = get_path_info(_path, "abspath") == _path - - # Preserve absolute paths for tools like distcc. - if (_is_path_absolute && filter_include([ _path ], [ "//*" ]) == []) { - prefix = _path - } else { - prefix = rebase_path(_path, 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, [ diff --git a/www/ungoogled-chromium/files/patch-cc_BUILD.gn b/www/ungoogled-chromium/files/patch-cc_BUILD.gn index 6499308d99a1..825fa28f527c 100644 --- a/www/ungoogled-chromium/files/patch-cc_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-cc_BUILD.gn @@ -1,19 +1,19 @@ ---- cc/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- cc/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ cc/BUILD.gn -@@ -668,7 +668,7 @@ cc_test_static_library("test_support") { +@@ -664,7 +664,7 @@ cc_test_static_library("test_support") { if (enable_vulkan) { deps += [ "//gpu/vulkan/init" ] } - if (!is_android) { + if (!is_android && !is_bsd) { data_deps = [ "//third_party/mesa_headers" ] } } -@@ -913,7 +913,6 @@ cc_test("cc_unittests") { - data = [ "//components/viz/test/data/" ] +@@ -911,7 +911,6 @@ cc_test("cc_unittests") { + data = [ "//components/test/data/viz/" ] data_deps = [ "//testing/buildbot/filters:cc_unittests_filters", - "//third_party/mesa_headers", ] if (is_android && enable_chrome_android_internal) { diff --git a/www/ungoogled-chromium/files/patch-chrome_app_chrome__main.cc b/www/ungoogled-chromium/files/patch-chrome_app_chrome__main.cc index 56706ef69fa7..7cc5ce4e9faf 100644 --- a/www/ungoogled-chromium/files/patch-chrome_app_chrome__main.cc +++ b/www/ungoogled-chromium/files/patch-chrome_app_chrome__main.cc @@ -1,20 +1,34 @@ ---- chrome/app/chrome_main.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/app/chrome_main.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/app/chrome_main.cc -@@ -28,7 +28,7 @@ +@@ -28,11 +28,11 @@ #include "chrome/app/notification_metrics.h" #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/base_switches.h" #endif -@@ -167,7 +167,7 @@ int ChromeMain(int argc, const char** argv) { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "chrome/app/chrome_main_linux.h" + #endif + +@@ -147,7 +147,7 @@ int ChromeMain(int argc, const char** argv) { + SetUpBundleOverrides(); + #endif + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + AppendExtraArgumentsToCommandLine(command_line); + #endif + +@@ -175,7 +175,7 @@ int ChromeMain(int argc, const char** argv) { headless::SetUpCommandLine(command_line); } else { #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) if (headless::IsOldHeadlessMode()) { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) command_line->AppendSwitch(::headless::switches::kEnableCrashReporter); diff --git a/www/ungoogled-chromium/files/patch-chrome_app_chrome__main__delegate.cc b/www/ungoogled-chromium/files/patch-chrome_app_chrome__main__delegate.cc index 51334270f419..8ee33d024c92 100644 --- a/www/ungoogled-chromium/files/patch-chrome_app_chrome__main__delegate.cc +++ b/www/ungoogled-chromium/files/patch-chrome_app_chrome__main__delegate.cc @@ -1,121 +1,112 @@ ---- chrome/app/chrome_main_delegate.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/app/chrome_main_delegate.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/app/chrome_main_delegate.cc -@@ -136,7 +136,7 @@ +@@ -135,7 +135,7 @@ #include "components/about_ui/credit_utils.h" #endif -#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) +#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD) #include "components/nacl/common/nacl_paths.h" #include "components/nacl/zygote/nacl_fork_delegate_linux.h" #endif -@@ -180,16 +180,16 @@ +@@ -179,16 +179,16 @@ #include "v8/include/v8.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/environment.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) #include "base/message_loop/message_pump_libevent.h" #endif #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "chrome/browser/policy/policy_path_parser.h" #include "components/crash/core/app/crashpad.h" #endif -@@ -328,7 +328,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty +@@ -323,7 +323,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty // and resources loaded. bool SubprocessNeedsResourceBundle(const std::string& process_type) { return -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // The zygote process opens the resources for the renderers. process_type == switches::kZygoteProcess || #endif -@@ -413,7 +413,7 @@ bool HandleVersionSwitches(const base::CommandLine& co +@@ -408,7 +408,7 @@ bool HandleVersionSwitches(const base::CommandLine& co // 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) // Show the man page if --help or -h is on the command line. void HandleHelpSwitches(const base::CommandLine& command_line) { if (command_line.HasSwitch(switches::kHelp) || -@@ -527,7 +527,7 @@ void InitializeUserDataDir(base::CommandLine* command_ +@@ -522,7 +522,7 @@ void InitializeUserDataDir(base::CommandLine* command_ std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // On Linux, Chrome does not support running multiple copies under different // DISPLAYs, so the profile directory can be specified in the environment to // support the virtual desktop use-case. -@@ -616,7 +616,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat +@@ -611,7 +611,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat #endif #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Record the startup process creation time on supported platforms. On Android // this is recorded in ChromeMainDelegateAndroid. startup_metric_utils::RecordStartupProcessCreationTime( -@@ -915,6 +915,8 @@ void ChromeMainDelegate::CommonEarlyInitialization() { - // not always enabled on ChromeOS. - #if BUILDFLAG(IS_CHROMEOS) - bool enable_gwp_asan = crash_reporter::IsCrashpadEnabled(); -+#elif BUILDFLAG(IS_BSD) -+ bool enable_gwp_asan = false; - #else - bool enable_gwp_asan = true; - #endif -@@ -970,7 +972,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() { - base::internal::TimerBase::InitializeFeatures(); +@@ -941,7 +941,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() { + base::InitializeCpuReductionExperiment(); base::sequence_manager::internal::SequenceManagerImpl::InitializeFeatures(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) base::MessagePumpLibevent::InitializeFeatures(); #elif BUILDFLAG(IS_MAC) base::PlatformThread::InitFeaturesPostFieldTrial(); -@@ -1102,7 +1104,7 @@ absl::optional ChromeMainDelegate::BasicStartupCo +@@ -1080,7 +1080,7 @@ absl::optional ChromeMainDelegate::BasicStartupCo // 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) // This will directly exit if the user asked for help. HandleHelpSwitches(command_line); #endif -@@ -1132,7 +1134,7 @@ absl::optional ChromeMainDelegate::BasicStartupCo +@@ -1110,7 +1110,7 @@ absl::optional ChromeMainDelegate::BasicStartupCo #if BUILDFLAG(IS_CHROMEOS) chromeos::dbus_paths::RegisterPathProvider(); #endif -#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) +#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) nacl::RegisterPathProvider(); #endif -@@ -1514,7 +1516,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1484,7 +1484,7 @@ void ChromeMainDelegate::PreSandboxStartup() { CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; } -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { if (command_line.HasSwitch(switches::kPreCrashpadCrashTest)) { -@@ -1616,7 +1618,7 @@ absl::variant Chrome +@@ -1586,7 +1586,7 @@ absl::variant Chrome // This entry is not needed on Linux, where the NaCl loader // process is launched via nacl_helper instead. -#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) {switches::kNaClLoaderProcess, NaClMain}, #else {"", nullptr}, // To avoid constant array of size 0 diff --git a/www/ungoogled-chromium/files/patch-chrome_app_chromium__strings.grd b/www/ungoogled-chromium/files/patch-chrome_app_chromium__strings.grd index 5fed98fc1f09..4b93b42033ee 100644 --- a/www/ungoogled-chromium/files/patch-chrome_app_chromium__strings.grd +++ b/www/ungoogled-chromium/files/patch-chrome_app_chromium__strings.grd @@ -1,20 +1,20 @@ ---- chrome/app/chromium_strings.grd.orig 2022-12-02 17:56:32 UTC +--- chrome/app/chromium_strings.grd.orig 2023-05-05 12:12:41 UTC +++ chrome/app/chromium_strings.grd @@ -296,7 +296,7 @@ If you update this file, be sure also to update google Welcome to Chromium; new browser window opened - + Welcome to Chromium -@@ -425,7 +425,7 @@ If you update this file, be sure also to update google +@@ -437,7 +437,7 @@ If you update this file, be sure also to update google To get future Chromium updates, you'll need Windows 10 or later. This computer is using Windows 8.1. - + Chromium may not function correctly because it is no longer supported on this Linux distribution diff --git a/www/ungoogled-chromium/files/patch-chrome_app_generated__resources.grd b/www/ungoogled-chromium/files/patch-chrome_app_generated__resources.grd index b6329beb9173..d01351922a60 100644 --- a/www/ungoogled-chromium/files/patch-chrome_app_generated__resources.grd +++ b/www/ungoogled-chromium/files/patch-chrome_app_generated__resources.grd @@ -1,74 +1,74 @@ ---- chrome/app/generated_resources.grd.orig 2023-04-08 11:38:38 UTC +--- chrome/app/generated_resources.grd.orig 2023-05-05 12:12:41 UTC +++ chrome/app/generated_resources.grd @@ -2,7 +2,7 @@ -@@ -3187,7 +3187,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -3219,7 +3219,7 @@ are declared in tools/grit/grit_rule.gni. - + Device Credentials -@@ -4942,7 +4942,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -4974,7 +4974,7 @@ are declared in tools/grit/grit_rule.gni. Read information about your browser, OS, device, installed software, registry values and files - + Read information about your browser, OS, device, installed software and files -@@ -5612,7 +5612,7 @@ Keep your key file in a safe place. You will need it t +@@ -5644,7 +5644,7 @@ Keep your key file in a safe place. You will need it t Old versions of Chrome Apps won't open on Windows devices after December 2022. Contact your administrator to update to a new version or remove this app. - + Old versions of Chrome Apps won't open on Linux devices after December 2022. Contact your administrator to update to a new version or remove this app. -@@ -5658,7 +5658,7 @@ Keep your key file in a safe place. You will need it t +@@ -5690,7 +5690,7 @@ Keep your key file in a safe place. You will need it t Old versions of Chrome apps won't open on Windows devices after December 2022. You can check if there's a new version available. - + Old versions of Chrome apps won't open on Linux devices after December 2022. You can check if there's a new version available. -@@ -9551,7 +9551,7 @@ Check your passwords anytime in - + Use system title bar and borders -@@ -10892,7 +10892,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -11048,7 +11048,7 @@ Please help our engineers fix this problem. Tell us wh Set as default - + Minimize -@@ -13004,7 +13004,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -13184,7 +13184,7 @@ Please help our engineers fix this problem. Tell us wh Open Anyway - + System Signals Utilities diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_about__flags.cc b/www/ungoogled-chromium/files/patch-chrome_browser_about__flags.cc index 6295876c94a5..f4c9b4ae44bc 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_about__flags.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_about__flags.cc @@ -1,126 +1,126 @@ ---- chrome/browser/about_flags.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/about_flags.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/about_flags.cc -@@ -217,7 +217,7 @@ +@@ -221,7 +221,7 @@ #include "ui/ui_features.h" #include "url/url_features.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/allocator/buildflags.h" #endif -@@ -304,7 +304,7 @@ +@@ -313,7 +313,7 @@ #include "device/vr/public/cpp/features.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) #include "ui/ozone/buildflags.h" #include "ui/ozone/public/ozone_switches.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) -@@ -410,7 +410,7 @@ const FeatureEntry::FeatureVariation kDXGIWaitableSwap +@@ -419,7 +419,7 @@ const FeatureEntry::FeatureVariation kDXGIWaitableSwap {"Max 3 Frames", &kDXGIWaitableSwapChain3Frames, 1, nullptr}}; #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const FeatureEntry::Choice kOzonePlatformHintRuntimeChoices[] = { {flag_descriptions::kOzonePlatformHintChoiceDefault, "", ""}, {flag_descriptions::kOzonePlatformHintChoiceAuto, -@@ -1351,7 +1351,7 @@ const FeatureEntry::FeatureVariation kLocalWebApproval +@@ -1448,7 +1448,7 @@ const FeatureEntry::FeatureVariation kLocalWebApproval #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const FeatureEntry::FeatureParam kOmniboxDocumentProviderCapLowQualitySuggestionsTo1[] = { {"DocumentProviderMaxLowQualitySuggestions", "1"}, -@@ -4404,13 +4404,13 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4644,13 +4644,13 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kWebShare)}, #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) {"ozone-platform-hint", flag_descriptions::kOzonePlatformHintName, flag_descriptions::kOzonePlatformHintDescription, kOsLinux, MULTI_VALUE_TYPE(kOzonePlatformHintRuntimeChoices)}, #endif // BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) {"skip-undecryptable-passwords", flag_descriptions::kSkipUndecryptablePasswordsName, flag_descriptions::kSkipUndecryptablePasswordsDescription, -@@ -4674,7 +4674,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4924,7 +4924,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(feed::kDiscoFeedEndpoint)}, #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) {"following-feed-sidepanel", flag_descriptions::kFollowingFeedSidepanelName, flag_descriptions::kFollowingFeedSidepanelDescription, kOsDesktop, FEATURE_VALUE_TYPE(feed::kWebUiFeed)}, -@@ -5278,7 +5278,7 @@ const FeatureEntry kFeatureEntries[] = { - FEATURE_VALUE_TYPE(omnibox::kZeroSuggestInMemoryCaching)}, +@@ -5544,7 +5544,7 @@ const FeatureEntry kFeatureEntries[] = { + kOsAll, FEATURE_VALUE_TYPE(omnibox::kUseExistingAutocompleteClient)}, #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) {"omnibox-experimental-keyword-mode", flag_descriptions::kOmniboxExperimentalKeywordModeName, flag_descriptions::kOmniboxExperimentalKeywordModeDescription, kOsDesktop, -@@ -5922,7 +5922,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6259,7 +6259,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kPointerLockOptionsDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kPointerLockOptions)}, -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) {"enable-async-dns", flag_descriptions::kAsyncDnsName, flag_descriptions::kAsyncDnsDescription, kOsWin | kOsLinux, FEATURE_VALUE_TYPE(features::kAsyncDns)}, -@@ -6845,7 +6845,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7152,7 +7152,7 @@ const FeatureEntry kFeatureEntries[] = { #endif // BUILDFLAG(IS_CHROMEOS) #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) {"global-media-controls-modern-ui", flag_descriptions::kGlobalMediaControlsModernUIName, flag_descriptions::kGlobalMediaControlsModernUIDescription, -@@ -7580,7 +7580,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7890,7 +7890,7 @@ const FeatureEntry kFeatureEntries[] = { #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) {"quick-commands", flag_descriptions::kQuickCommandsName, flag_descriptions::kQuickCommandsDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kQuickCommands)}, -@@ -7796,7 +7796,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -8115,7 +8115,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(ash::features::kWallpaperPerDesk)}, #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) {"enable-get-display-media-set", flag_descriptions::kGetDisplayMediaSetName, flag_descriptions::kGetDisplayMediaSetDescription, kOsCrOS | kOsLacros | kOsLinux, -@@ -7855,7 +7855,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -8176,7 +8176,7 @@ const FeatureEntry kFeatureEntries[] = { #if BUILDFLAG(IS_WIN) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) { "ui-debug-tools", flag_descriptions::kUIDebugToolsName, -@@ -8388,7 +8388,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -8729,7 +8729,7 @@ const FeatureEntry kFeatureEntries[] = { #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) {"document-picture-in-picture-api", flag_descriptions::kDocumentPictureInPictureApiName, flag_descriptions::kDocumentPictureInPictureApiDescription, diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc b/www/ungoogled-chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc index f897e9da0058..d5d1a484dfaa 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc @@ -1,11 +1,11 @@ ---- chrome/browser/background/background_mode_optimizer.cc.orig 2022-10-01 07:40:07 UTC +--- chrome/browser/background/background_mode_optimizer.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/background/background_mode_optimizer.cc @@ -31,7 +31,7 @@ std::unique_ptr BackgroundMod - switches::kKeepAliveForTest)) return nullptr; + } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - if (base::FeatureList::IsEnabled(features::kBackgroundModeAllowRestart)) + if (base::FeatureList::IsEnabled(features::kBackgroundModeAllowRestart)) { return base::WrapUnique(new BackgroundModeOptimizer()); - #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + } diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.cc b/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.cc index af68a7f2a7d5..2a13a34cd101 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.cc @@ -1,29 +1,29 @@ ---- chrome/browser/browser_process_impl.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/browser_process_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/browser_process_impl.cc -@@ -215,7 +215,7 @@ +@@ -216,7 +216,7 @@ #include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "chrome/browser/error_reporting/chrome_js_error_report_processor.h" // nogncheck #endif -@@ -1195,7 +1195,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { +@@ -1227,7 +1227,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { ApplyMetricsReportingPolicy(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) ChromeJsErrorReportProcessor::Create(); #endif -@@ -1435,7 +1435,7 @@ void BrowserProcessImpl::Unpin() { +@@ -1460,7 +1460,7 @@ void BrowserProcessImpl::Unpin() { // Mac is currently not supported. // 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)) +#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) bool BrowserProcessImpl::IsRunningInBackground() const { // Check if browser is in the background. diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.h b/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.h index 2915d1375c9c..d5cf53338944 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_browser__process__impl.h @@ -1,11 +1,11 @@ ---- chrome/browser/browser_process_impl.h.orig 2023-02-11 09:11:04 UTC +--- chrome/browser/browser_process_impl.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/browser_process_impl.h -@@ -360,7 +360,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -362,7 +362,7 @@ class BrowserProcessImpl : public BrowserProcess, // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#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) base::RepeatingTimer autoupdate_timer_; // Gets called by autoupdate timer to see if browser needs restart and can be diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc index 58a4f0eca2b6..e36d681774db 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc @@ -1,71 +1,71 @@ ---- chrome/browser/chrome_browser_interface_binders.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/chrome_browser_interface_binders.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/chrome_browser_interface_binders.cc -@@ -114,13 +114,13 @@ +@@ -113,13 +113,13 @@ #endif // BUILDFLAG(FULL_SAFE_BROWSING) #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.mojom.h" #include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h" #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/webui/app_settings/web_app_settings_ui.h" #include "ui/webui/resources/cr_components/app_management/app_management.mojom.h" #endif -@@ -194,7 +194,7 @@ +@@ -193,7 +193,7 @@ #endif // BUILDFLAG(IS_ANDROID) #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.mojom.h" #include "chrome/browser/ui/webui/discards/discards_ui.h" #include "chrome/browser/ui/webui/discards/site_data.mojom.h" -@@ -859,7 +859,7 @@ void PopulateChromeFrameBinders( +@@ -853,7 +853,7 @@ void PopulateChromeFrameBinders( #endif // BUILDFLAG(ENABLE_SPEECH_SERVICE) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (!render_frame_host->GetParent()) { map->Add( base::BindRepeating(&DraggableRegionsHostImpl::CreateIfAllowed)); -@@ -867,7 +867,7 @@ void PopulateChromeFrameBinders( +@@ -861,7 +861,7 @@ void PopulateChromeFrameBinders( #endif #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled(blink::features::kDesktopPWAsSubApps) && !render_frame_host->GetParentOrOuterDocument()) { // The service binder will reject non-primary main frames, but we still need -@@ -932,14 +932,14 @@ void PopulateChromeWebUIFrameBinders( +@@ -926,14 +926,14 @@ void PopulateChromeWebUIFrameBinders( SegmentationInternalsUI>(map); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) RegisterWebUIControllerInterfaceBinder< connectors_internals::mojom::PageHandler, enterprise_connectors::ConnectorsInternalsUI>(map); #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) RegisterWebUIControllerInterfaceBinder< app_management::mojom::PageHandlerFactory, WebAppSettingsUI>(map); #endif -@@ -1375,7 +1375,7 @@ void PopulateChromeWebUIFrameBinders( +@@ -1377,7 +1377,7 @@ void PopulateChromeWebUIFrameBinders( #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) RegisterWebUIControllerInterfaceBinder(map); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main.cc b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main.cc index 6be38cdb1bfc..b7bf021e5a48 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main.cc @@ -1,43 +1,43 @@ ---- chrome/browser/chrome_browser_main.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/chrome_browser_main.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/chrome_browser_main.cc -@@ -239,11 +239,11 @@ +@@ -240,11 +240,11 @@ // 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 "chrome/browser/first_run/upgrade_util_linux.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "components/crash/core/app/crashpad.h" #endif -@@ -278,7 +278,7 @@ +@@ -279,7 +279,7 @@ // 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_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h" #include "chrome/browser/metrics/desktop_session_duration/touch_mode_stats_tracker.h" #include "chrome/browser/profiles/profile_activity_metrics_recorder.h" -@@ -988,7 +988,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -991,7 +991,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { browser_creator_->AddFirstRunTabs(master_prefs_->new_tabs); } -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Create directory for user-level Native Messaging manifest files. This // makes it less likely that the directory will be created by third-party // software with incorrect owner or permission. See crbug.com/725513 . -@@ -1044,7 +1044,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1047,7 +1047,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { // 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_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) metrics::DesktopSessionDurationTracker::Initialize(); ProfileActivityMetricsRecorder::Initialize(); TouchModeStatsTracker::Initialize( diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc index eb438de0f8ad..9e4a4a3ade92 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc @@ -1,28 +1,28 @@ ---- chrome/browser/chrome_browser_main_linux.cc.orig 2022-10-01 07:40:07 UTC +--- chrome/browser/chrome_browser_main_linux.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/chrome_browser_main_linux.cc -@@ -57,13 +57,15 @@ ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLi +@@ -54,13 +54,15 @@ ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLi } void ChromeBrowserMainPartsLinux::PostCreateMainMessageLoop() { -#if BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // No-op: Ash and Lacros Bluetooth DBusManager initialization depend on // FeatureList, and is done elsewhere. #endif // BUILDFLAG(IS_CHROMEOS) #if !BUILDFLAG(IS_CHROMEOS) +#if !BUILDFLAG(IS_BSD) bluez::BluezDBusManager::Initialize(nullptr /* system_bus */); +#endif // Set up crypt config. This needs to be done before anything starts the // network service, as the raw encryption key needs to be shared with the -@@ -123,7 +125,7 @@ void ChromeBrowserMainPartsLinux::PostBrowserStart() { +@@ -120,7 +122,7 @@ void ChromeBrowserMainPartsLinux::PostBrowserStart() { #endif // defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS) void ChromeBrowserMainPartsLinux::PostDestroyThreads() { -#if BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // No-op; per PostBrowserStart() comment, this is done elsewhere. #else bluez::BluezDBusManager::Shutdown(); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.cc b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.cc index b60e66ade7b7..b5df7a4f49c3 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.cc @@ -1,163 +1,165 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/chrome_content_browser_client.cc -@@ -416,7 +416,7 @@ +@@ -419,7 +419,7 @@ + #include "components/user_manager/user_manager.h" #include "services/service_manager/public/mojom/interface_provider_spec.mojom.h" #include "storage/browser/file_system/external_mount_points.h" - #include "ui/display/screen.h" -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "chrome/browser/chrome_browser_main_linux.h" #elif BUILDFLAG(IS_ANDROID) #include "base/android/application_status_listener.h" @@ -502,12 +502,12 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) #include "chrome/browser/browser_switcher/browser_switcher_navigation_throttle.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "components/crash/core/app/crash_switches.h" #include "components/crash/core/app/crashpad.h" #endif -@@ -516,13 +516,13 @@ +@@ -516,14 +516,14 @@ #include "components/crash/content/browser/crash_handler_host_linux.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/chrome_browser_main_extra_parts_enterprise.h" + #include "chrome/browser/enterprise/profile_token_management/profile_token_navigation_throttle.h" #include "chrome/browser/ui/webui/app_settings/web_app_settings_navigation_throttle.h" #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || // BUILDFLAG(IS_CHROMEOS_ASH) -@@ -551,11 +551,11 @@ +@@ -552,11 +552,11 @@ // 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 "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/chrome_browser_main_extra_parts_linux.h" #elif BUILDFLAG(IS_OZONE) #include "chrome/browser/chrome_browser_main_extra_parts_ozone.h" -@@ -1546,7 +1546,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePre +@@ -1542,7 +1542,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePre policy::policy_prefs::kPPAPISharedImagesSwapChainAllowed, true); registry->RegisterBooleanPref( policy::policy_prefs::kForceEnablePepperVideoDecoderDevAPI, false); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kOutOfProcessSystemDnsResolutionEnabled, true); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) -@@ -1653,7 +1653,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1655,7 +1655,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo #elif BUILDFLAG(IS_CHROMEOS_LACROS) main_parts = std::make_unique( is_integration_test, &startup_data_); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) main_parts = std::make_unique( is_integration_test, &startup_data_); #elif BUILDFLAG(IS_ANDROID) -@@ -1692,7 +1692,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1694,7 +1694,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo std::make_unique()); // 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) main_parts->AddParts( std::make_unique()); #else -@@ -1713,7 +1713,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1715,7 +1715,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo main_parts->AddParts(std::make_unique()); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) main_parts->AddParts(std::make_unique()); #elif BUILDFLAG(IS_OZONE) main_parts->AddParts(std::make_unique()); -@@ -1732,7 +1732,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1734,7 +1734,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo chrome::AddMetricsExtraParts(main_parts.get()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) main_parts->AddParts( std::make_unique< chrome::enterprise_util::ChromeBrowserMainExtraPartsEnterprise>()); -@@ -2552,6 +2552,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2558,6 +2558,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin #if(0) #if BUILDFLAG(IS_ANDROID) bool enable_crash_reporter = true; +#elif BUILDFLAG(IS_BSD) + bool enable_crash_reporter = false; #elif BUILDFLAG(IS_CHROMEOS) bool enable_crash_reporter = false; if (crash_reporter::IsCrashpadEnabled()) { -@@ -2933,7 +2935,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2927,7 +2929,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin ThreadProfilerConfiguration::Get()->AppendCommandLineSwitchForChildProcess( command_line); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) // Opt into a hardened stack canary mitigation if it hasn't already been // force-disabled. if (!browser_command_line.HasSwitch(switches::kChangeStackGuardOnFork)) { -@@ -4451,7 +4453,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +@@ -4480,7 +4482,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst } } -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, -@@ -4968,14 +4970,14 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4994,7 +4996,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati &throttles); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) MaybeAddThrottle( WebAppSettingsNavigationThrottle::MaybeCreateThrottleFor(handle), &throttles); +@@ -5004,7 +5006,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) MaybeAddThrottle(enterprise_connectors::DeviceTrustNavigationThrottle:: MaybeCreateThrottleFor(handle), &throttles); -@@ -5006,7 +5008,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -5035,7 +5037,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati } #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle:: MaybeCreateThrottleFor(handle), &throttles); -@@ -6607,7 +6609,7 @@ bool ChromeContentBrowserClient::ShouldSandboxNetworkS +@@ -6640,7 +6642,7 @@ bool ChromeContentBrowserClient::ShouldSandboxNetworkS } bool ChromeContentBrowserClient::ShouldRunOutOfProcessSystemDnsResolution() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // This is possibly called before `g_browser_process` is initialized. PrefService* local_state; if (g_browser_process) { diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.h b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.h index 71865180e708..ea9f1c83efa0 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_chrome__content__browser__client.h @@ -1,11 +1,11 @@ ---- chrome/browser/chrome_content_browser_client.h.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/chrome_content_browser_client.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/chrome_content_browser_client.h -@@ -444,7 +444,7 @@ class ChromeContentBrowserClient : public content::Con +@@ -458,7 +458,7 @@ class ChromeContentBrowserClient : public content::Con void OverridePageVisibilityState( content::RenderFrameHost* render_frame_host, content::PageVisibilityState* visibility_state) override; -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) void GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc b/www/ungoogled-chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc deleted file mode 100644 index ec64d1b973b7..000000000000 --- a/www/ungoogled-chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/devtools/devtools_eye_dropper.cc.orig 2023-04-08 11:38:38 UTC -+++ chrome/browser/devtools/devtools_eye_dropper.cc -@@ -185,7 +185,7 @@ void DevToolsEyeDropper::UpdateCursor() { - // magnified projection only with centered hotspot. - // Mac Retina requires cursor to be > 120px in order to render smoothly. - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - const float kCursorSize = 63; - const float kDiameter = 63; - const float kHotspotOffset = 32; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_download_bubble_download__bubble__update__service.cc b/www/ungoogled-chromium/files/patch-chrome_browser_download_bubble_download__bubble__update__service.cc new file mode 100644 index 000000000000..d66fe1b3f362 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-chrome_browser_download_bubble_download__bubble__update__service.cc @@ -0,0 +1,32 @@ +--- chrome/browser/download/bubble/download_bubble_update_service.cc.orig 2023-05-05 12:12:41 UTC ++++ chrome/browser/download/bubble/download_bubble_update_service.cc +@@ -87,7 +87,11 @@ ItemSortKey GetSortKey(const Item& item) { + // Helper to get an iterator to the last element in the cache. The cache + // must not be empty. + template ++#if defined(__clang__) && (__clang_major__ >= 16) + SortedItems::iterator GetLastIter(SortedItems& cache) { ++#else ++typename SortedItems::iterator GetLastIter(SortedItems& cache) { ++#endif + CHECK(!cache.empty()); + auto it = cache.end(); + return std::prev(it); +@@ -789,9 +793,17 @@ bool DownloadBubbleUpdateService::RemoveItemFromCacheI + } + + template ++#if defined(__clang__) && (__clang_major__ >= 16) + SortedItems::iterator ++#else ++typename SortedItems::iterator ++#endif + DownloadBubbleUpdateService::RemoveItemFromCacheByIter( ++#if defined(__clang__) && (__clang_major__ >= 16) + SortedItems::iterator iter, ++#else ++ typename SortedItems::iterator iter, ++#endif + SortedItems& cache, + IterMap& iter_map) { + CHECK(iter != cache.end()); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_download_bubble_download__bubble__update__service.h b/www/ungoogled-chromium/files/patch-chrome_browser_download_bubble_download__bubble__update__service.h new file mode 100644 index 000000000000..9798fcd0299b --- /dev/null +++ b/www/ungoogled-chromium/files/patch-chrome_browser_download_bubble_download__bubble__update__service.h @@ -0,0 +1,13 @@ +--- chrome/browser/download/bubble/download_bubble_update_service.h.orig 2023-05-05 12:12:41 UTC ++++ chrome/browser/download/bubble/download_bubble_update_service.h +@@ -208,8 +208,8 @@ class DownloadBubbleUpdateService + + // Removes item if we already have the iterator to it. Returns next iterator. + template +- SortedItems::iterator RemoveItemFromCacheByIter( +- SortedItems::iterator iter, ++ typename SortedItems::iterator RemoveItemFromCacheByIter( ++ typename SortedItems::iterator iter, + SortedItems& cache, + IterMap& iter_map); + diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc b/www/ungoogled-chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc index 77d1c97bbd26..bf86d7d0ef18 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc @@ -1,20 +1,20 @@ ---- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/download/chrome_download_manager_delegate.cc -@@ -1541,7 +1541,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1545,7 +1545,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile( const base::FilePath& path) { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) { return !download_prefs_->ShouldOpenPdfInSystemReader(); } -@@ -1607,7 +1607,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow +@@ -1611,7 +1611,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow content::CheckDownloadAllowedCallback check_download_allowed_cb) { DCHECK_CURRENTLY_ON(BrowserThread::UI); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) // Don't download pdf if it is a file URL, as that might cause an infinite // download loop if Chrome is not the system pdf viewer. if (url.SchemeIsFile() && download_prefs_->ShouldOpenPdfInSystemReader()) { diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_download_download__item__model.cc b/www/ungoogled-chromium/files/patch-chrome_browser_download_download__item__model.cc index 236d5dca9776..1939ad58e4e7 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_download_download__item__model.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_download_download__item__model.cc @@ -1,29 +1,29 @@ ---- chrome/browser/download/download_item_model.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/download/download_item_model.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/download/download_item_model.cc -@@ -762,7 +762,7 @@ bool DownloadItemModel::IsCommandChecked( +@@ -763,7 +763,7 @@ bool DownloadItemModel::IsCommandChecked( download_crx_util::IsExtensionDownload(*download_); case DownloadCommands::ALWAYS_OPEN_TYPE: #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (download_commands->CanOpenPdfInSystemViewer()) { DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile()); return prefs->ShouldOpenPdfInSystemReader(); -@@ -805,7 +805,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand +@@ -806,7 +806,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand base::UmaHistogramBoolean("Download.SetAlwaysOpenTo", !is_checked); DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile()); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (download_commands->CanOpenPdfInSystemViewer()) { prefs->SetShouldOpenPdfInSystemReader(!is_checked); SetShouldPreferOpeningInBrowser(is_checked); -@@ -1128,7 +1128,7 @@ void DownloadItemModel::DetermineAndSetShouldPreferOpe +@@ -1129,7 +1129,7 @@ void DownloadItemModel::DetermineAndSetShouldPreferOpe return; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (download_->GetOriginalMimeType() == "application/x-x509-user-cert") { SetShouldPreferOpeningInBrowser(true); return; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_download_download__prefs.cc b/www/ungoogled-chromium/files/patch-chrome_browser_download_download__prefs.cc index f256c0e3fde4..45d3800ec203 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_download_download__prefs.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_download_download__prefs.cc @@ -1,90 +1,90 @@ ---- chrome/browser/download/download_prefs.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/download/download_prefs.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/download/download_prefs.cc @@ -11,6 +11,7 @@ #include "base/check.h" #include "base/cxx17_backports.h" +#include "base/command_line.h" #include "base/feature_list.h" #include "base/files/file_util.h" #include "base/functional/bind.h" @@ -64,6 +65,10 @@ #include "chrome/browser/download/bubble/download_bubble_prefs.h" #endif -+#if BUILDFLAG(IS_OPENBSD) -+#include "sandbox/policy/openbsd/sandbox_openbsd.h" ++#if BUILDFLAG(IS_BSD) ++#include "sandbox/policy/sandbox.h" +#endif + using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; @@ -74,7 +79,7 @@ namespace { // Consider downloads 'dangerous' if they go to the home directory on Linux and // to the desktop on any platform. bool DownloadPathIsDangerous(const base::FilePath& download_path) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FilePath home_dir = base::GetHomeDir(); if (download_path == home_dir) { return true; @@ -185,7 +190,7 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profi #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) should_open_pdf_in_system_reader_ = prefs->GetBoolean(prefs::kOpenPdfDownloadInSystemReader); #endif @@ -305,7 +310,7 @@ void DownloadPrefs::RegisterProfilePrefs( registry->RegisterTimePref(prefs::kDownloadLastCompleteTime, /*default_value=*/base::Time()); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kOpenPdfDownloadInSystemReader, false); #endif #if BUILDFLAG(IS_ANDROID) @@ -474,7 +479,7 @@ void DownloadPrefs::DisableAutoOpenByUserBasedOnExtens } #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) void DownloadPrefs::SetShouldOpenPdfInSystemReader(bool should_open) { if (should_open_pdf_in_system_reader_ == should_open) return; @@ -506,7 +511,7 @@ bool DownloadPrefs::ShouldOpenPdfInSystemReader() cons void DownloadPrefs::ResetAutoOpenByUser() { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) SetShouldOpenPdfInSystemReader(false); #endif auto_open_by_user_.clear(); @@ -537,7 +542,7 @@ void DownloadPrefs::SaveAutoOpenState() { bool DownloadPrefs::CanPlatformEnableAutoOpenForPdf() const { #if BUILDFLAG(IS_CHROMEOS) return false; // There is no UI for auto-open on ChromeOS. -#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) return ShouldOpenPdfInSystemReader(); #else return false; @@ -661,7 +666,14 @@ base::FilePath DownloadPrefs::SanitizeDownloadTargetPa #else // If the stored download directory is an absolute path, we presume it's // correct; there's not really much more validation we can do here. +#if BUILDFLAG(IS_OPENBSD) + // If unveil(2) is used, force the file dialog directory to something we + // know is available. + auto* sandbox = sandbox::policy::SandboxLinux::GetInstance(); + if (!sandbox->unveil_initialized() && path.IsAbsolute()) +#else if (path.IsAbsolute()) +#endif return path; // When the default download directory is *not* an absolute path, we use the diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_enterprise_connectors_connectors__prefs.cc b/www/ungoogled-chromium/files/patch-chrome_browser_enterprise_connectors_connectors__prefs.cc deleted file mode 100644 index 5d6ed3438284..000000000000 --- a/www/ungoogled-chromium/files/patch-chrome_browser_enterprise_connectors_connectors__prefs.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/enterprise/connectors/connectors_prefs.cc.orig 2023-04-08 11:38:38 UTC -+++ chrome/browser/enterprise/connectors/connectors_prefs.cc -@@ -69,7 +69,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry - } - - void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { --#if !BUILDFLAG(IS_FUCHSIA) -+#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_BSD) - registry->RegisterInt64Pref(kLatestCrashReportCreationTime, 0); - #endif - } diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.h b/www/ungoogled-chromium/files/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.h deleted file mode 100644 index e5c13cb829cf..000000000000 --- a/www/ungoogled-chromium/files/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.h +++ /dev/null @@ -1,29 +0,0 @@ ---- chrome/browser/enterprise/connectors/reporting/crash_reporting_context.h.orig 2023-04-08 11:38:38 UTC -+++ chrome/browser/enterprise/connectors/reporting/crash_reporting_context.h -@@ -10,7 +10,7 @@ - #include "chrome/browser/enterprise/connectors/reporting/browser_crash_event_router.h" - #include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h" - --#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_CHROMEOS_ASH) -+#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_BSD) - #include "third_party/crashpad/crashpad/client/crash_report_database.h" - #endif - -@@ -29,7 +29,7 @@ class CrashReportingContext - CrashReportingContext operator=(CrashReportingContext&&) = delete; - ~CrashReportingContext() override; - --#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_CHROMEOS_ASH) -+#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_BSD) - static CrashReportingContext* GetInstance(); - - void AddProfile(BrowserCrashEventRouter* router, Profile* profile); -@@ -51,7 +51,7 @@ class CrashReportingContext - #endif - }; - --#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_CHROMEOS_ASH) -+#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_BSD) - - // Utility function to parse reports from a crash database that were - // created past a given timestamp. Included in header for testing. diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc index c6334b760345..377e19324738 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/api/api_browser_context_keyed_service_factories.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/extensions/api/api_browser_context_keyed_service_factories.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/extensions/api/api_browser_context_keyed_service_factories.cc -@@ -41,7 +41,7 @@ +@@ -42,7 +42,7 @@ #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h" #include "extensions/browser/api/networking_private/networking_private_delegate_factory.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h" #endif -@@ -99,7 +99,7 @@ void EnsureApiBrowserContextKeyedServiceFactoriesBuilt +@@ -101,7 +101,7 @@ void EnsureApiBrowserContextKeyedServiceFactoriesBuilt extensions::SettingsPrivateEventRouterFactory::GetInstance(); extensions::SettingsOverridesAPI::GetFactoryInstance(); extensions::SidePanelService::GetFactoryInstance(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) extensions::SystemIndicatorManagerFactory::GetInstance(); #endif extensions::TabGroupsEventRouterFactory::GetInstance(); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc index e49217bd8af6..e3f255d946ae 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc @@ -1,38 +1,38 @@ ---- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc @@ -32,7 +32,7 @@ #include "components/reporting/util/statusor.h" #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/strings/string_util.h" #include "chrome/browser/enterprise/signals/signals_aggregator_factory.h" #include "chrome/browser/extensions/api/enterprise_reporting_private/conversion_utils.h" -@@ -106,7 +106,7 @@ api::enterprise_reporting_private::ContextInfo ToConte +@@ -105,7 +105,7 @@ api::enterprise_reporting_private::ContextInfo ToConte return info; } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) device_signals::SignalsAggregationRequest CreateAggregationRequest( device_signals::SignalName signal_name) { -@@ -167,7 +167,7 @@ EnterpriseReportingPrivateGetDeviceIdFunction:: +@@ -166,7 +166,7 @@ EnterpriseReportingPrivateGetDeviceIdFunction:: // getPersistentSecret -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) EnterpriseReportingPrivateGetPersistentSecretFunction:: EnterpriseReportingPrivateGetPersistentSecretFunction() = default; -@@ -594,7 +594,7 @@ void EnterpriseReportingPrivateEnqueueRecordFunction:: +@@ -593,7 +593,7 @@ void EnterpriseReportingPrivateEnqueueRecordFunction:: } #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // getFileSystemInfo diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc index 14c589da1562..7ab04d37526a 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc @@ -1,11 +1,11 @@ ---- chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc -@@ -523,7 +523,7 @@ void PasswordsPrivateDelegateImpl::OsReauthCall( +@@ -517,7 +517,7 @@ void PasswordsPrivateDelegateImpl::OsReauthCall( } void PasswordsPrivateDelegateImpl::OsReauthTimeoutCall() { -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) PasswordsPrivateEventRouter* router = PasswordsPrivateEventRouterFactory::GetForProfile(profile_); if (router) diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc index be1fd8dea655..cd633db9e347 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/external_provider_impl.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/extensions/external_provider_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/extensions/external_provider_impl.cc -@@ -819,7 +819,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -828,7 +828,7 @@ void ExternalProviderImpl::CreateExternalProviders( if (!profile->GetPrefs()->GetBoolean(pref_names::kBlockExternalExtensions)) { // 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) provider_list->push_back(std::make_unique( service, base::MakeRefCounted( -@@ -847,7 +847,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -856,7 +856,7 @@ void ExternalProviderImpl::CreateExternalProviders( bundled_extension_creation_flags)); // Define a per-user source of external extensions. -#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ BUILDFLAG(CHROMIUM_BRANDING)) provider_list->push_back(std::make_unique( service, diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.cc b/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.cc index 15fd88b5d9d3..cafed2f4f559 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.cc @@ -1,65 +1,65 @@ ---- chrome/browser/flag_descriptions.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/flag_descriptions.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/flag_descriptions.cc -@@ -6170,7 +6170,7 @@ const char kLibAssistantV2MigrationDescription[] = +@@ -6315,7 +6315,7 @@ const char kLibAssistantV2MigrationDescription[] = #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const char kGetDisplayMediaSetName[] = "GetDisplayMediaSet API"; const char kGetDisplayMediaSetDescription[] = "When enabled, the getDisplayMediaSet API for capturing multiple surfaces " -@@ -6406,7 +6406,7 @@ const char kSearchWebInSidePanelDescription[] = +@@ -6563,7 +6563,7 @@ const char kSearchWebInSidePanelDescription[] = // Random platform combinations ----------------------------------------------- #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kQuickCommandsName[] = "Quick Commands"; const char kQuickCommandsDescription[] = "Enable a text interface to browser features. Invoke with Ctrl-Space."; -@@ -6415,7 +6415,7 @@ const char kQuickCommandsDescription[] = +@@ -6572,7 +6572,7 @@ const char kQuickCommandsDescription[] = // BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const char kFollowingFeedSidepanelName[] = "Following feed in the sidepanel"; const char kFollowingFeedSidepanelDescription[] = "Enables the following feed in the sidepanel."; -@@ -6436,7 +6436,7 @@ const char kWebShareDescription[] = +@@ -6593,7 +6593,7 @@ const char kWebShareDescription[] = "platforms."; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD) const char kOzonePlatformHintChoiceDefault[] = "Default"; const char kOzonePlatformHintChoiceAuto[] = "Auto"; const char kOzonePlatformHintChoiceX11[] = "X11"; -@@ -6456,7 +6456,7 @@ const char kWebBluetoothConfirmPairingSupportDescripti +@@ -6613,7 +6613,7 @@ const char kWebBluetoothConfirmPairingSupportDescripti "Bluetooth"; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) const char kSkipUndecryptablePasswordsName[] = "Skip undecryptable passwords to use the available decryptable " "passwords."; -@@ -6470,7 +6470,7 @@ const char kForcePasswordInitialSyncWhenDecryptionFail +@@ -6627,7 +6627,7 @@ const char kForcePasswordInitialSyncWhenDecryptionFail "storage and requests initial sync."; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const char kAsyncDnsName[] = "Async DNS resolver"; const char kAsyncDnsDescription[] = "Enables the built-in DNS resolver."; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) -@@ -6571,7 +6571,7 @@ const char kElasticOverscrollDescription[] = +@@ -6728,7 +6728,7 @@ const char kElasticOverscrollDescription[] = #if BUILDFLAG(IS_WIN) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kUIDebugToolsName[] = "Debugging tools for UI"; const char kUIDebugToolsDescription[] = "Enables additional keyboard shortcuts to help debugging."; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.h b/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.h index 705e0592be1d..c0addb30e95d 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_flag__descriptions.h @@ -1,71 +1,71 @@ ---- chrome/browser/flag_descriptions.h.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/flag_descriptions.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/flag_descriptions.h -@@ -3571,7 +3571,7 @@ extern const char kLacrosScreenCoordinatesEnabledName[ +@@ -3663,7 +3663,7 @@ extern const char kLacrosScreenCoordinatesEnabledName[ extern const char kLacrosScreenCoordinatesEnabledDescription[]; #endif // #if BUILDFLAG(IS_CHROMEOS_LACROS) -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kGetDisplayMediaSetName[]; extern const char kGetDisplayMediaSetDescription[]; -@@ -3693,14 +3693,14 @@ extern const char kSearchWebInSidePanelDescription[]; +@@ -3790,14 +3790,14 @@ extern const char kSearchWebInSidePanelDescription[]; // Random platform combinations ----------------------------------------------- #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kQuickCommandsName[]; extern const char kQuickCommandsDescription[]; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || // defined (OS_FUCHSIA) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) extern const char kWebShareName[]; extern const char kWebShareDescription[]; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) -@@ -3710,7 +3710,7 @@ extern const char kWebBluetoothConfirmPairingSupportNa +@@ -3807,7 +3807,7 @@ extern const char kWebBluetoothConfirmPairingSupportNa extern const char kWebBluetoothConfirmPairingSupportDescription[]; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kOzonePlatformHintChoiceDefault[]; extern const char kOzonePlatformHintChoiceAuto[]; extern const char kOzonePlatformHintChoiceX11[]; -@@ -3720,7 +3720,7 @@ extern const char kOzonePlatformHintName[]; +@@ -3817,7 +3817,7 @@ extern const char kOzonePlatformHintName[]; extern const char kOzonePlatformHintDescription[]; #endif // BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) extern const char kSkipUndecryptablePasswordsName[]; extern const char kSkipUndecryptablePasswordsDescription[]; -@@ -3728,13 +3728,13 @@ extern const char kForcePasswordInitialSyncWhenDecrypt +@@ -3825,13 +3825,13 @@ extern const char kForcePasswordInitialSyncWhenDecrypt extern const char kForcePasswordInitialSyncWhenDecryptionFailsDescription[]; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kAsyncDnsName[]; extern const char kAsyncDnsDescription[]; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) extern const char kFollowingFeedSidepanelName[]; extern const char kFollowingFeedSidepanelDescription[]; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || -@@ -3814,7 +3814,7 @@ extern const char kElasticOverscrollDescription[]; +@@ -3911,7 +3911,7 @@ extern const char kElasticOverscrollDescription[]; #if BUILDFLAG(IS_WIN) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kUIDebugToolsName[]; extern const char kUIDebugToolsDescription[]; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc index 566ab5bb1311..575bfb02bf39 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc @@ -1,20 +1,20 @@ ---- chrome/browser/media/webrtc/capture_policy_utils.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/media/webrtc/capture_policy_utils.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/media/webrtc/capture_policy_utils.cc -@@ -118,7 +118,7 @@ AllowedScreenCaptureLevel GetAllowedCaptureLevel(const +@@ -121,7 +121,7 @@ AllowedScreenCaptureLevel GetAllowedCaptureLevel(const bool IsGetDisplayMediaSetSelectAllScreensAllowedForAnySite( content::BrowserContext* context) { -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) Profile* profile = Profile::FromBrowserContext(context); if (!profile) { return false; -@@ -145,7 +145,7 @@ bool IsGetDisplayMediaSetSelectAllScreensAllowedForAny +@@ -148,7 +148,7 @@ bool IsGetDisplayMediaSetSelectAllScreensAllowedForAny bool IsGetDisplayMediaSetSelectAllScreensAllowed( content::BrowserContext* context, const GURL& url) { -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) Profile* profile = Profile::FromBrowserContext(context); if (!profile) return false; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc index 97aab9b5cb52..210a1ea2525e 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc @@ -1,13 +1,13 @@ ---- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2022-10-01 07:40:07 UTC +--- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/media/webrtc/webrtc_log_uploader.cc -@@ -281,6 +281,10 @@ void WebRtcLogUploader::SetupMultipart( +@@ -290,6 +290,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 diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc index 7a23ff1710c5..81e65df077ef 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc @@ -1,33 +1,33 @@ ---- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2023-02-11 09:11:04 UTC +--- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/media/webrtc/webrtc_logging_controller.cc -@@ -23,10 +23,10 @@ - #include "content/public/browser/browser_context.h" +@@ -25,10 +25,10 @@ + #include "components/webrtc_logging/browser/text_log_list.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; -@@ -277,7 +277,7 @@ void WebRtcLoggingController::StartEventLogging( +@@ -284,7 +284,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) { -@@ -322,7 +322,7 @@ void WebRtcLoggingController::GrantLogsDirectoryAccess +@@ -329,7 +329,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 packet_header, diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h index 22d90bdc3729..c7248c4978bf 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h @@ -1,20 +1,20 @@ ---- chrome/browser/media/webrtc/webrtc_logging_controller.h.orig 2022-10-29 17:50:56 UTC +--- chrome/browser/media/webrtc/webrtc_logging_controller.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/media/webrtc/webrtc_logging_controller.h -@@ -133,7 +133,7 @@ class WebRtcLoggingController +@@ -134,7 +134,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. -@@ -192,7 +192,7 @@ class WebRtcLoggingController - bool success, - const std::string& error_message); +@@ -199,7 +199,7 @@ class WebRtcLoggingController + + content::BrowserContext* GetBrowserContext() const; -#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| diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc b/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc index e19e33d22c05..52f76875fe8f 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc @@ -1,41 +1,41 @@ ---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc -@@ -61,8 +61,10 @@ +@@ -65,8 +65,10 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if defined(__GLIBC__) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if defined(__GLIBC__) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) +#if !BUILDFLAG(IS_BSD) #include +#endif #include "base/linux_util.h" #include "base/strings/string_split.h" -@@ -92,7 +94,7 @@ - #include "chromeos/crosapi/cpp/crosapi_constants.h" - #endif // BUILDFLAG(IS_CHROMEOS_LACROS) +@@ -100,7 +102,7 @@ + #include "chromeos/startup/startup_switches.h" + #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/metrics/pressure/pressure_metrics_reporter.h" #endif // BUILDFLAG(IS_LINUX) -@@ -495,7 +497,7 @@ void RecordStartupMetrics() { +@@ -512,7 +514,7 @@ void RecordStartupMetrics() { // Record whether Chrome is the default browser or not. // Disabled on Linux due to hanging browser tests, see crbug.com/1216328. -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) shell_integration::DefaultWebClientState default_state = shell_integration::GetDefaultBrowser(); base::UmaHistogramEnumeration("DefaultBrowser.State", default_state, -@@ -685,7 +687,7 @@ void ChromeBrowserMainExtraPartsMetrics::PostBrowserSt +@@ -712,7 +714,7 @@ void ChromeBrowserMainExtraPartsMetrics::PostBrowserSt } #endif // !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) pressure_metrics_reporter_ = std::make_unique(); #endif // BUILDFLAG(IS_LINUX) - } + diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h b/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h index 1620f785962f..4510633cf502 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h @@ -1,20 +1,20 @@ ---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h -@@ -22,7 +22,7 @@ class PowerMetricsReporter; +@@ -32,7 +32,7 @@ class PowerMetricsReporter; class ProcessMonitor; #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) class PressureMetricsReporter; #endif // BUILDFLAG(IS_LINUX) -@@ -88,7 +88,7 @@ class ChromeBrowserMainExtraPartsMetrics : public Chro +@@ -132,7 +132,7 @@ class ChromeBrowserMainExtraPartsMetrics : public Chro std::unique_ptr battery_discharge_reporter_; #endif // !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Reports pressure metrics. std::unique_ptr pressure_metrics_reporter_; #endif // BUILDFLAG(IS_LINUX) diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc b/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc index 5e3da9efe575..c5b07e861eff 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc @@ -1,47 +1,65 @@ ---- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/metrics/chrome_metrics_service_client.cc @@ -176,7 +176,7 @@ #include "chrome/notification_helper/notification_helper_constants.h" #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "components/metrics/motherboard_metrics_provider.h" #endif -@@ -738,7 +738,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -202,7 +202,7 @@ + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_ANDROID) ++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) + #include "chrome/browser/metrics/family_link_user_metrics_provider.h" + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS_LACROS))||BUILDFLAG(IS_ANDROID)) +@@ -764,7 +764,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic metrics_service_->RegisterMetricsProvider( std::make_unique()); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) metrics_service_->RegisterMetricsProvider( std::make_unique()); #endif -@@ -819,7 +819,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -843,7 +843,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) metrics_service_->RegisterMetricsProvider( std::make_unique()); -@@ -919,7 +919,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -852,7 +852,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic + + #if BUILDFLAG(ENABLE_SUPERVISED_USERS) && \ + (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_CHROMEOS_LACROS)) ++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) + if (base::FeatureList::IsEnabled( + kExtendFamilyLinkUserLogSegmentToAllPlatforms)) { + metrics_service_->RegisterMetricsProvider( +@@ -960,7 +960,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic std::make_unique()); #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) metrics_service_->RegisterMetricsProvider( metrics::CreateDesktopSessionMetricsProvider()); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) -@@ -1103,7 +1103,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve +@@ -1144,7 +1144,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve #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) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) // This creates the DesktopProfileSessionDurationsServices if it didn't exist // already. diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_net_system__network__context__manager.cc b/www/ungoogled-chromium/files/patch-chrome_browser_net_system__network__context__manager.cc index aa3a55bc3143..675caf0fe752 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_net_system__network__context__manager.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_net_system__network__context__manager.cc @@ -1,65 +1,65 @@ ---- chrome/browser/net/system_network_context_manager.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/net/system_network_context_manager.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/net/system_network_context_manager.cc @@ -93,7 +93,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 "chrome/common/chrome_paths_internal.h" #include "chrome/grit/chromium_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -178,7 +178,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut auth_dynamic_params->basic_over_http_enabled = local_state->GetBoolean(prefs::kBasicAuthOverHttpEnabled); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) auth_dynamic_params->delegate_by_kdc_policy = local_state->GetBoolean(prefs::kAuthNegotiateDelegateByKdcPolicy); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) @@ -456,7 +456,7 @@ SystemNetworkContextManager::SystemNetworkContextManag pref_change_registrar_.Add(prefs::kAllHttpAuthSchemesAllowedForOrigins, auth_pref_callback); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) pref_change_registrar_.Add(prefs::kAuthNegotiateDelegateByKdcPolicy, auth_pref_callback); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) @@ -489,7 +489,7 @@ SystemNetworkContextManager::SystemNetworkContextManag base::Unretained(this))); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) pref_change_registrar_.Add( prefs::kEnforceLocalAnchorConstraintsEnabled, base::BindRepeating(&SystemNetworkContextManager:: @@ -539,7 +539,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe registry->RegisterBooleanPref(prefs::kKerberosEnabled, false); #endif // BUILDFLAG(IS_CHROMEOS_LACROS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kAuthNegotiateDelegateByKdcPolicy, false); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) @@ -568,7 +568,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe registry->RegisterBooleanPref(prefs::kChromeRootStoreEnabled, false); #endif // BUILDFLAG(CHROME_ROOT_STORE_POLICY_SUPPORTED) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Note that the default value is not relevant because the pref is only // evaluated when it is managed. registry->RegisterBooleanPref(prefs::kEnforceLocalAnchorConstraintsEnabled, -@@ -944,7 +944,7 @@ void SystemNetworkContextManager::UpdateExplicitlyAllo +@@ -959,7 +959,7 @@ void SystemNetworkContextManager::UpdateExplicitlyAllo } #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) void SystemNetworkContextManager::UpdateEnforceLocalAnchorConstraintsEnabled() { const PrefService::Preference* enforce_local_anchor_constraints_enabled_pref = local_state_->FindPreference( diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc b/www/ungoogled-chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc index dcf60cac900d..415ead87cf71 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc @@ -1,195 +1,180 @@ ---- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/policy/configuration_policy_handler_list_factory.cc -@@ -200,17 +200,17 @@ +@@ -203,12 +203,12 @@ #include "components/spellcheck/browser/pref_names.h" #endif // BUILDFLAG(ENABLE_SPELLCHECK) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/idle/action.h" #include "components/device_signals/core/browser/pref_names.h" #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - #include "chrome/browser/web_applications/policy/web_app_settings_policy_handler.h" - #endif - -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) #include "chrome/browser/privacy_sandbox/privacy_sandbox_policy_handler.h" #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || -@@ -729,14 +729,14 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -740,14 +740,14 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = prefs::kManagedDefaultGeolocationSetting, base::Value::Type::INTEGER }, #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) \ - || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_MAC) + || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) { key::kRequireOnlineRevocationChecksForLocalAnchors, prefs::kCertRevocationCheckingRequiredLocalAnchors, base::Value::Type::BOOLEAN }, #endif // #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) // || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) \ - || BUILDFLAG(IS_FUCHSIA) + || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) { key::kFullscreenAllowed, prefs::kFullscreenAllowed, base::Value::Type::BOOLEAN }, -@@ -1373,7 +1373,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = - +@@ -1407,7 +1407,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = + base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { key::kGSSAPILibraryName, prefs::kGSSAPILibraryName, base::Value::Type::STRING }, -@@ -1443,18 +1443,18 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1477,18 +1477,18 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = prefs::kTotalMemoryLimitMb, base::Value::Type::INTEGER }, #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { key::kBackgroundModeEnabled, prefs::kBackgroundModeEnabled, base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { key::kUnmanagedDeviceSignalsConsentFlowEnabled, device_signals::prefs::kUnmanagedDeviceSignalsConsentFlowEnabled, base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) \ - || BUILDFLAG(IS_FUCHSIA) + || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) { key::kDefaultBrowserSettingEnabled, prefs::kDefaultBrowserSettingEnabled, base::Value::Type::BOOLEAN }, -@@ -1467,7 +1467,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1501,7 +1501,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) // || BUILDFLAG(IS_FUCHSIA) #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) { key::kAutoplayAllowed, prefs::kAutoplayAllowed, base::Value::Type::BOOLEAN }, -@@ -1568,7 +1568,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1602,7 +1602,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = base::Value::Type::BOOLEAN }, #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) { key::kAlternativeBrowserPath, browser_switcher::prefs::kAlternativeBrowserPath, base::Value::Type::STRING }, -@@ -1655,13 +1655,13 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1689,13 +1689,13 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { key::kGetDisplayMediaSetSelectAllScreensAllowedForUrls, prefs::kManagedGetDisplayMediaSetSelectAllScreensAllowedForUrls, base::Value::Type::LIST }, #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) { key::kAuthNegotiateDelegateByKdcPolicy, prefs::kAuthNegotiateDelegateByKdcPolicy, base::Value::Type::BOOLEAN }, -@@ -1692,7 +1692,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1726,7 +1726,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = #endif // BUILDFLAG(CHROME_ROOT_STORE_POLICY_SUPPORTED) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) { key::kEnforceLocalAnchorConstraintsEnabled, prefs::kEnforceLocalAnchorConstraintsEnabled, base::Value::Type::BOOLEAN }, -@@ -1721,7 +1721,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1755,7 +1755,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(ENABLE_EXTENSIONS) && (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) \ - || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA)) + || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)) { key::kChromeAppsEnabled, extensions::pref_names::kChromeAppsEnabled, base::Value::Type::BOOLEAN }, -@@ -1781,7 +1781,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1815,7 +1815,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = ash::prefs::kUrlParameterToAutofillSAMLUsername, base::Value::Type::STRING }, #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) { key::kHighEfficiencyModeEnabled, performance_manager::user_tuning::prefs::kHighEfficiencyModeEnabled, base::Value::Type::BOOLEAN }, -@@ -1826,7 +1826,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1860,7 +1860,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = policy::policy_prefs::kForceEnablePepperVideoDecoderDevAPI, base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(ENABLE_PPAPI) -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { key::kOutOfProcessSystemDnsResolutionEnabled, prefs::kOutOfProcessSystemDnsResolutionEnabled, base::Value::Type::BOOLEAN }, -@@ -2075,7 +2075,7 @@ std::unique_ptr BuildH +@@ -2112,7 +2112,7 @@ std::unique_ptr BuildH #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) handlers->AddHandler( std::make_unique()); handlers->AddHandler( -@@ -2133,7 +2133,7 @@ std::unique_ptr BuildH +@@ -2169,7 +2169,7 @@ std::unique_ptr BuildH key::kBrowsingDataLifetime, browsing_data::prefs::kBrowsingDataLifetime, chrome_schema)); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) handlers->AddHandler(std::make_unique()); handlers->AddHandler(std::make_unique()); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) -@@ -2497,7 +2497,7 @@ std::unique_ptr BuildH - extensions::pref_names::kManifestV2Availability, /*min=*/0, /*max=*/3, - /*clamp=*/false)); - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - handlers->AddHandler( - std::make_unique(chrome_schema)); - #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || -@@ -2510,7 +2510,7 @@ std::unique_ptr BuildH +@@ -2540,7 +2540,7 @@ std::unique_ptr BuildH #endif #if BUILDFLAG(ENABLE_SPELLCHECK) -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) handlers->AddHandler(std::make_unique()); handlers->AddHandler( std::make_unique( -@@ -2518,7 +2518,7 @@ std::unique_ptr BuildH +@@ -2548,7 +2548,7 @@ std::unique_ptr BuildH #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) #endif // BUILDFLAG(ENABLE_SPELLCHECK) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) handlers->AddHandler(std::make_unique( key::kAllowSystemNotifications, prefs::kAllowSystemNotifications, base::Value::Type::BOOLEAN)); -@@ -2531,7 +2531,7 @@ std::unique_ptr BuildH +@@ -2561,7 +2561,7 @@ std::unique_ptr BuildH handlers->AddHandler( std::make_unique( chrome_schema)); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) handlers->AddHandler(std::make_unique()); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_prefs_browser__prefs.cc b/www/ungoogled-chromium/files/patch-chrome_browser_prefs_browser__prefs.cc index 2388286b050d..18c6d171edf3 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_prefs_browser__prefs.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_prefs_browser__prefs.cc @@ -1,86 +1,86 @@ ---- chrome/browser/prefs/browser_prefs.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/prefs/browser_prefs.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/prefs/browser_prefs.cc -@@ -455,13 +455,13 @@ - #include "components/os_crypt/os_crypt.h" +@@ -461,13 +461,13 @@ + #include "components/os_crypt/sync/os_crypt.h" #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "components/device_signals/core/browser/pref_names.h" #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) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) #include "chrome/browser/browser_switcher/browser_switcher_prefs.h" #endif -@@ -494,7 +494,7 @@ +@@ -500,7 +500,7 @@ #include "chrome/browser/sessions/session_service_log.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/color/system_theme.h" #endif -@@ -787,7 +787,7 @@ const char kPluginsPluginsList[] = "plugins.plugins_li +@@ -797,7 +797,7 @@ const char kPluginsPluginsList[] = "plugins.plugins_li const char kPluginsShowDetails[] = "plugins.show_details"; // Deprecated 02/2023. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const char kWebAppsUrlHandlerInfo[] = "web_apps.url_handler_info"; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -@@ -869,7 +869,7 @@ void RegisterLocalStatePrefsForMigration(PrefRegistryS +@@ -901,7 +901,7 @@ void RegisterLocalStatePrefsForMigration(PrefRegistryS #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Deprecated 02/2023. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) registry->RegisterDictionaryPref(kWebAppsUrlHandlerInfo); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) - } -@@ -982,7 +982,7 @@ void RegisterProfilePrefsForMigration( + +@@ -1030,7 +1030,7 @@ void RegisterProfilePrefsForMigration( registry->RegisterIntegerPref(kProfileAvatarTutorialShown, 0); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Deprecated 08/2022. registry->RegisterBooleanPref(prefs::kUsesSystemThemeDeprecated, false); #endif -@@ -1616,11 +1616,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync +@@ -1679,11 +1679,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync safe_browsing::PostCleanupSettingsResetter::RegisterProfilePrefs(registry); #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) device_signals::RegisterProfilePrefs(registry); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) browser_switcher::BrowserSwitcherPrefs::RegisterProfilePrefs(registry); #endif -@@ -1817,7 +1817,7 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local +@@ -1871,7 +1871,7 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Added 02/2023 -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) local_state->ClearPref(kWebAppsUrlHandlerInfo); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -@@ -1962,7 +1962,7 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { +@@ -2031,7 +2031,7 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { profile_prefs->ClearPref(kProfileAvatarTutorialShown); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Added 08/2022. if (profile_prefs->HasPrefPath(prefs::kUsesSystemThemeDeprecated)) { auto migrated_theme = diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc b/www/ungoogled-chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc index 8e5922a636ec..36303f9d22ec 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc @@ -1,29 +1,29 @@ ---- chrome/browser/printing/print_backend_service_manager.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/printing/print_backend_service_manager.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/printing/print_backend_service_manager.cc -@@ -547,7 +547,7 @@ PrintBackendServiceManager::RegisterClient( +@@ -602,7 +602,7 @@ PrintBackendServiceManager::RegisterClient( query_clients_.insert(client_id); break; case ClientType::kQueryWithUi: -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) if (!query_with_ui_clients_.empty()) return absl::nullopt; #endif -@@ -813,7 +813,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate +@@ -868,7 +868,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate break; case ClientType::kQueryWithUi: -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // No need to update if there were other query with UI clients. if (query_with_ui_clients_.size() > 1) return absl::nullopt; -@@ -870,7 +870,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate +@@ -925,7 +925,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate return kNoClientsRegisteredResetOnIdleTimeout; case ClientType::kQueryWithUi: -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // No need to update if there were other query with UI clients. if (HasQueryWithUiClientForRemoteId(remote_id)) { return absl::nullopt; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_printing_printer__query.cc b/www/ungoogled-chromium/files/patch-chrome_browser_printing_printer__query.cc index e7d9c570e7b3..9898326e7bbf 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_printing_printer__query.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_printing_printer__query.cc @@ -1,11 +1,11 @@ ---- chrome/browser/printing/printer_query.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/printing/printer_query.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/printing/printer_query.cc -@@ -284,7 +284,7 @@ void PrinterQuery::UpdatePrintSettings(base::Value::Di +@@ -339,7 +339,7 @@ void PrinterQuery::UpdatePrintSettings(base::Value::Di crash_key = std::make_unique( print_backend->GetPrinterDriverInfo(printer_name)); -#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_CUPS) +#if (BUILDFLAG(IS_BSD) || BUILDFLAG(IS_LINUX)) && BUILDFLAG(USE_CUPS) PrinterBasicInfo basic_info; if (print_backend->GetPrinterBasicInfo(printer_name, &basic_info) == mojom::ResultCode::kSuccess) { diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc b/www/ungoogled-chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc index 25e9eab654b8..4a0485ca3525 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc @@ -1,62 +1,71 @@ ---- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc -@@ -338,17 +338,17 @@ +@@ -361,17 +361,17 @@ #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/enterprise/connectors/device_trust/device_trust_connector_service_factory.h" #include "chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.h" #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/idle/idle_service_factory.h" #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/browser_switcher/browser_switcher_service_factory.h" + #include "chrome/browser/enterprise/connectors/analysis/local_binary_upload_service_factory.h" #include "chrome/browser/enterprise/signals/signals_aggregator_factory.h" - #endif -@@ -495,7 +495,7 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -535,7 +535,7 @@ void ChromeBrowserMainExtraPartsProfiles:: BreadcrumbManagerKeyedServiceFactory::GetInstance(); } browser_sync::UserEventServiceFactory::GetInstance(); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) browser_switcher::BrowserSwitcherServiceFactory::GetInstance(); #endif BrowsingDataHistoryObserverService::Factory::GetInstance(); -@@ -557,12 +557,12 @@ void ChromeBrowserMainExtraPartsProfiles:: - DomainDiversityReporterFactory::GetInstance(); - dom_distiller::DomDistillerServiceFactory::GetInstance(); - DownloadCoreServiceFactory::GetInstance(); +@@ -606,12 +606,12 @@ void ChromeBrowserMainExtraPartsProfiles:: + #if !BUILDFLAG(IS_ANDROID) + DriveServiceFactory::GetInstance(); + #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) enterprise_signals::SignalsAggregatorFactory::GetInstance(); #endif enterprise::ProfileIdServiceFactory::GetInstance(); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) enterprise_connectors::DeviceTrustServiceFactory::GetInstance(); enterprise_connectors::DeviceTrustConnectorServiceFactory::GetInstance(); #endif -@@ -660,12 +660,12 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -715,12 +715,12 @@ void ChromeBrowserMainExtraPartsProfiles:: #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) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) metrics::DesktopProfileSessionDurationsServiceFactory::GetInstance(); #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) enterprise_idle::IdleServiceFactory::GetInstance(); #endif ModelTypeStoreServiceFactory::GetInstance(); +@@ -783,7 +783,7 @@ void ChromeBrowserMainExtraPartsProfiles:: + PolicyBlocklistFactory::GetInstance(); + PredictionServiceFactory::GetInstance(); + PrimaryAccountPolicyManagerFactory::GetInstance(); +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + ProfileTokenWebSigninInterceptorFactory::GetInstance(); + #endif + #if !BUILDFLAG(IS_ANDROID) diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_profiles_profile__impl.cc b/www/ungoogled-chromium/files/patch-chrome_browser_profiles_profile__impl.cc index d5ba7d4a11ec..be204fba344e 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_profiles_profile__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_profiles_profile__impl.cc @@ -1,31 +1,31 @@ ---- chrome/browser/profiles/profile_impl.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/profiles/profile_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/profiles/profile_impl.cc -@@ -259,6 +259,10 @@ +@@ -258,6 +258,10 @@ #include "chrome/browser/spellchecker/spellcheck_service.h" #endif -+#if BUILDFLAG(IS_OPENBSD) -+#include "sandbox/policy/openbsd/sandbox_openbsd.h" ++#if BUILDFLAG(IS_BSD) ++#include "sandbox/policy/sandbox.h" +#endif + using bookmarks::BookmarkModel; using content::BrowserThread; using content::DownloadManagerDelegate; -@@ -855,7 +859,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) +@@ -852,7 +856,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) } base::FilePath ProfileImpl::last_selected_directory() { +#if BUILDFLAG(IS_OPENBSD) + // If unveil(2) is used, force the file dialog directory to something we + // know is available. + auto* sandbox = sandbox::policy::SandboxLinux::GetInstance(); + if (sandbox->unveil_initialized()) + return GetPrefs()->GetFilePath(prefs::kDownloadDefaultDirectory); + else + return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); +#else return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); +#endif } void ProfileImpl::set_last_selected_directory(const base::FilePath& path) { diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_resources_signin_sync__confirmation_sync__confirmation__app.html b/www/ungoogled-chromium/files/patch-chrome_browser_resources_signin_sync__confirmation_sync__confirmation__app.html index 95bcb6cb5ec6..c9ef6c59606b 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_resources_signin_sync__confirmation_sync__confirmation__app.html +++ b/www/ungoogled-chromium/files/patch-chrome_browser_resources_signin_sync__confirmation_sync__confirmation__app.html @@ -1,38 +1,38 @@ ---- chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html -@@ -556,7 +556,7 @@ +@@ -492,7 +492,7 @@ consent-confirmation autofocus> $i18n{syncConfirmationConfirmLabel} - + $i18n{syncConfirmationSettingsLabel} -@@ -566,7 +566,7 @@ +@@ -502,7 +502,7 @@ disabled="[[anyButtonClicked_]]"> $i18n{syncConfirmationUndoLabel} - + $i18n{syncConfirmationSettingsLabel} -@@ -609,7 +609,7 @@ +@@ -546,7 +546,7 @@ consent-confirmation> $i18n{syncConfirmationConfirmLabel} - + $i18n{syncConfirmationSettingsLabel} -@@ -619,7 +619,7 @@ - disabled="[[anyButtonClicked_]]"> +@@ -556,7 +556,7 @@ + disabled="[[anyButtonClicked_]]"> $i18n{syncConfirmationUndoLabel} - + $i18n{syncConfirmationSettingsLabel} diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc b/www/ungoogled-chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc index 48a1792082be..4c99714faef4 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc @@ -1,29 +1,29 @@ ---- chrome/browser/safe_browsing/download_protection/file_analyzer.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/safe_browsing/download_protection/file_analyzer.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/safe_browsing/download_protection/file_analyzer.cc -@@ -20,7 +20,7 @@ +@@ -21,7 +21,7 @@ #include "content/public/browser/browser_thread.h" #include "url/gurl.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/safe_browsing/download_protection/document_analysis_service.h" #endif -@@ -100,7 +100,7 @@ void FileAnalyzer::Start(const base::FilePath& target_ +@@ -83,7 +83,7 @@ void FileAnalyzer::Start(const base::FilePath& target_ } else if (inspection_type == DownloadFileType::DMG) { StartExtractDmgFeatures(); #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) } else if (inspection_type == DownloadFileType::OFFICE_DOCUMENT) { StartExtractDocumentFeatures(); #endif -@@ -325,7 +325,7 @@ void FileAnalyzer::OnDmgAnalysisFinished( +@@ -308,7 +308,7 @@ void FileAnalyzer::OnDmgAnalysisFinished( } #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) void FileAnalyzer::StartExtractDocumentFeatures() { DCHECK_CURRENTLY_ON(BrowserThread::UI); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc b/www/ungoogled-chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc index f6f26165bc66..1f1da116ed92 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc @@ -1,38 +1,38 @@ ---- chrome/browser/sync/chrome_sync_client.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/sync/chrome_sync_client.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/sync/chrome_sync_client.cc @@ -127,7 +127,7 @@ #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h" #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h" #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || -@@ -469,7 +469,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy +@@ -473,7 +473,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy #endif // !BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) - if (features::kTabGroupsSaveSyncIntegration.Get()) { + if (base::FeatureList::IsEnabled(features::kTabGroupsSaveSyncIntegration)) { controllers.push_back(std::make_unique( syncer::SAVED_TAB_GROUP, -@@ -482,7 +482,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy +@@ -486,7 +486,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy // Chrome prefers OS provided spell checkers where they exist. So only sync the // custom dictionary on platforms that typically don't provide one. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Dictionary sync is enabled by default. if (GetPrefService()->GetBoolean(spellcheck::prefs::kSpellCheckEnable)) { controllers.push_back( -@@ -641,7 +641,7 @@ base::WeakPtr +@@ -653,7 +653,7 @@ base::WeakPtr ChromeSyncClient::GetControllerDelegateForModelType(syncer::ModelType type) { switch (type) { #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) case syncer::SAVED_TAB_GROUP: { - DCHECK(features::kTabGroupsSaveSyncIntegration.Get()); - return SavedTabGroupServiceFactory::GetForProfile(profile_) + DCHECK(base::FeatureList::IsEnabled( + features::kTabGroupsSaveSyncIntegration)); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_sync_sync__service__factory.cc b/www/ungoogled-chromium/files/patch-chrome_browser_sync_sync__service__factory.cc index d091ad286dd7..fb4b25ccf6c0 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_sync_sync__service__factory.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_sync_sync__service__factory.cc @@ -1,29 +1,29 @@ ---- chrome/browser/sync/sync_service_factory.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/sync/sync_service_factory.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/sync/sync_service_factory.cc @@ -76,7 +76,7 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h" #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || // BUILDFLAG(IS_WIN) @@ -117,7 +117,7 @@ std::unique_ptr BuildSyncService( // TODO(crbug.com/1052397): Reassess whether the following block needs to be // included in lacros-chrome once build flag switch of lacros-chrome is // complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) syncer::SyncPrefs prefs(profile->GetPrefs()); local_sync_backend_enabled = prefs.IsLocalSyncEnabled(); -@@ -251,7 +251,7 @@ SyncServiceFactory::SyncServiceFactory() +@@ -258,7 +258,7 @@ SyncServiceFactory::SyncServiceFactory() DependsOn(ThemeServiceFactory::GetInstance()); #endif // !BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) DependsOn(SavedTabGroupServiceFactory::GetInstance()); #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || // BUILDFLAG(IS_WIN) diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc b/www/ungoogled-chromium/files/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc index 5d44e9b5c4b8..7de4cffef870 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc @@ -1,11 +1,11 @@ ---- chrome/browser/task_manager/sampling/task_manager_impl.cc.orig 2022-10-01 07:40:07 UTC +--- chrome/browser/task_manager/sampling/task_manager_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/task_manager/sampling/task_manager_impl.cc -@@ -216,7 +216,7 @@ void TaskManagerImpl::GetUSERHandles(TaskId task_id, +@@ -217,7 +217,7 @@ void TaskManagerImpl::GetUSERHandles(TaskId task_id, } int TaskManagerImpl::GetOpenFdCount(TaskId task_id) const { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) return GetTaskGroupByTaskId(task_id)->open_fd_count(); #else return -1; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_browser__command__controller.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_browser__command__controller.cc index 7e471e3880dc..906a4179efa8 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_browser__command__controller.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_browser__command__controller.cc @@ -1,38 +1,38 @@ ---- chrome/browser/ui/browser_command_controller.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/browser_command_controller.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/browser_command_controller.cc -@@ -103,7 +103,7 @@ +@@ -104,7 +104,7 @@ #include "components/user_manager/user_manager.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/linux/linux_ui.h" #endif @@ -288,7 +288,7 @@ bool BrowserCommandController::IsReservedCommandOrKey( #endif } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // If this key was registered by the user as a content editing hotkey, then // it is not reserved. auto* linux_ui = ui::LinuxUi::instance(); @@ -540,7 +540,7 @@ bool BrowserCommandController::ExecuteCommandWithDispo // 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 IDC_MINIMIZE_WINDOW: browser_->window()->Minimize(); break; -@@ -1099,7 +1099,7 @@ void BrowserCommandController::InitCommandState() { +@@ -1107,7 +1107,7 @@ void BrowserCommandController::InitCommandState() { #endif // 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) command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_MAXIMIZE_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_RESTORE_WINDOW, true); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc index 5412addf90d0..347736c0fc48 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc @@ -1,38 +1,38 @@ ---- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/startup/startup_browser_creator.cc @@ -132,7 +132,7 @@ #include "chrome/credential_provider/common/gcp_strings.h" #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/headless/headless_mode_util.h" #include "chrome/browser/ui/startup/web_app_info_recorder_utils.h" #include "components/headless/policy/headless_mode_policy.h" -@@ -918,7 +918,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -957,7 +957,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( TRACE_EVENT0("startup", "StartupBrowserCreator::ProcessCmdLineImpl"); ComputeAndRecordLaunchMode(command_line); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) if (headless::IsHeadlessMode() && headless::HeadlessModePolicy::IsHeadlessModeDisabled( g_browser_process->local_state())) { -@@ -1022,7 +1022,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -1061,7 +1061,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( silent_launch = true; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Writes open and installed web apps to the specified file without // launching a new browser window or tab. if (base::FeatureList::IsEnabled(features::kListWebAppsSwitch) && -@@ -1214,7 +1214,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -1253,7 +1253,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( CHECK_EQ(profile_info.mode, StartupProfileMode::kBrowserWindow) << "Failed launch with app: couldn't pick a profile"; std::string app_id = command_line.GetSwitchValueASCII(switches::kAppId); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // If Chrome Apps are deprecated and |app_id| is a Chrome App, display the // deprecation UI instead of launching the app. if (apps::OpenDeprecatedApplicationPrompt(privacy_safe_profile, app_id)) diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc index d822e82b1e2d..8edcd0fc3439 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/startup/startup_browser_creator_impl.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/browser/ui/startup/startup_browser_creator_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/startup/startup_browser_creator_impl.cc -@@ -260,7 +260,7 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser( +@@ -263,7 +263,7 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser( // at the state of the MessageLoop. Browser::CreateParams params = Browser::CreateParams(profile_, false); params.creation_source = Browser::CreationSource::kStartupCreator; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) params.startup_id = command_line_->GetSwitchValueASCII("desktop-startup-id"); #endif diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_tab__helpers.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_tab__helpers.cc index 691ed2b83367..738f9842411c 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_tab__helpers.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_tab__helpers.cc @@ -1,26 +1,26 @@ ---- chrome/browser/ui/tab_helpers.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/tab_helpers.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/tab_helpers.cc -@@ -203,7 +203,7 @@ +@@ -204,7 +204,7 @@ #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) #include "chrome/browser/ui/blocked_content/framebust_block_tab_helper.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/hats/hats_helper.h" -@@ -526,12 +526,12 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con +@@ -522,12 +522,12 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con // 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_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) metrics::DesktopSessionDurationObserver::CreateForWebContents(web_contents); #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled( features::kHappinessTrackingSurveysForDesktopDemo) || base::FeatureList::IsEnabled(features::kTrustSafetySentimentSurvey) || diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc index d3c48a6ee74f..23fbaf77a97d 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc @@ -1,47 +1,47 @@ ---- chrome/browser/ui/views/frame/browser_frame.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/frame/browser_frame.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/frame/browser_frame.cc -@@ -47,7 +47,7 @@ +@@ -51,7 +51,7 @@ #include "components/user_manager/user_manager.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/display/screen.h" #include "ui/linux/linux_ui.h" #endif -@@ -55,7 +55,7 @@ +@@ -59,7 +59,7 @@ namespace { bool IsUsingLinuxSystemTheme(Profile* profile) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme(); #else return false; -@@ -290,7 +290,7 @@ void BrowserFrame::OnNativeWidgetWorkspaceChanged() { +@@ -294,7 +294,7 @@ void BrowserFrame::OnNativeWidgetWorkspaceChanged() { chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(), IsVisibleOnAllWorkspaces()); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // If the window was sent to a different workspace, prioritize it if // it was sent to the current workspace and deprioritize it // otherwise. This is done by MoveBrowsersInWorkspaceToFront() -@@ -413,7 +413,7 @@ void BrowserFrame::SelectNativeTheme() { +@@ -442,7 +442,7 @@ void BrowserFrame::SelectNativeTheme() { return; } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const auto* linux_ui_theme = ui::LinuxUiTheme::GetForWindow(GetNativeWindow()); // Ignore the system theme for web apps with window-controls-overlay as the -@@ -430,7 +430,7 @@ void BrowserFrame::SelectNativeTheme() { +@@ -459,7 +459,7 @@ void BrowserFrame::SelectNativeTheme() { bool BrowserFrame::RegenerateFrameOnThemeChange( BrowserThemeChangeType theme_change_type) { bool need_regenerate = false; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // System and user theme changes can both change frame buttons, so the frame // always needs to be regenerated on Linux. need_regenerate = true; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.h b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.h index 8280adf32c3e..c121c00dacea 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.h @@ -1,29 +1,29 @@ ---- chrome/browser/ui/views/frame/browser_frame.h.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/frame/browser_frame.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/frame/browser_frame.h @@ -12,7 +12,7 @@ #include "ui/views/context_menu_controller.h" #include "ui/views/widget/widget.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "ui/base/ui_base_types.h" #endif -@@ -64,7 +64,7 @@ class BrowserFrame : public views::Widget, public view +@@ -68,7 +68,7 @@ class BrowserFrame : public views::Widget, public view ~BrowserFrame() override; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Returns which edges of the frame are tiled. const ui::WindowTiledEdges& tiled_edges() const { return tiled_edges_; } void set_tiled_edges(ui::WindowTiledEdges tiled_edges) { -@@ -223,7 +223,7 @@ class BrowserFrame : public views::Widget, public view +@@ -228,7 +228,7 @@ class BrowserFrame : public views::Widget, public view // contents for smoother dragging. TabDragKind tab_drag_kind_ = TabDragKind::kNone; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) ui::WindowTiledEdges tiled_edges_; #endif diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc index 3b10f662e5bf..386120afae89 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc @@ -1,29 +1,29 @@ ---- chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc.orig 2023-02-11 09:11:04 UTC +--- chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc @@ -16,7 +16,7 @@ - #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" + #include "chrome/browser/ui/views/frame/browser_frame_view_win.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux.h" #include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native.h" #include "chrome/browser/ui/views/frame/browser_frame_view_linux_native.h" @@ -33,7 +33,7 @@ namespace { std::unique_ptr CreateOpaqueBrowserFrameView( BrowserFrame* frame, BrowserView* browser_view) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto* profile = browser_view->browser()->profile(); auto* linux_ui_theme = ui::LinuxUiTheme::GetForProfile(profile); auto* theme_service_factory = ThemeServiceFactory::GetForProfile(profile); -@@ -75,7 +75,7 @@ std::unique_ptr CreateBrows +@@ -81,7 +81,7 @@ std::unique_ptr CreateBrows if (browser_view->browser()->is_type_picture_in_picture()) { auto view = std::make_unique(frame, browser_view); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto* profile = browser_view->browser()->profile(); auto* linux_ui_theme = ui::LinuxUiTheme::GetForProfile(profile); auto* theme_service_factory = ThemeServiceFactory::GetForProfile(profile); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc index 5dfa67c91be6..68df5e74bed4 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/frame/browser_view.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/frame/browser_view.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -2096,7 +2096,7 @@ void BrowserView::TabDraggingStatusChanged(bool is_dra +@@ -1998,7 +1998,7 @@ void BrowserView::TabDraggingStatusChanged(bool is_dra // CrOS cleanup is done. // 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)) contents_web_view_->SetFastResize(is_dragging); if (!is_dragging) { // When tab dragging is ended, we need to make sure the web contents get diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc index 9f4ad29b8b96..e6e982800866 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc @@ -1,38 +1,38 @@ ---- chrome/browser/ui/views/frame/opaque_browser_frame_view.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/frame/opaque_browser_frame_view.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/frame/opaque_browser_frame_view.cc -@@ -56,7 +56,7 @@ +@@ -54,7 +54,7 @@ #include "ui/views/window/vector_icons/vector_icons.h" #include "ui/views/window/window_shape.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "ui/views/controls/menu/menu_runner.h" #endif -@@ -585,7 +585,7 @@ OpaqueBrowserFrameView::FrameButtonStyle +@@ -572,7 +572,7 @@ OpaqueBrowserFrameView::FrameButtonStyle OpaqueBrowserFrameView::GetFrameButtonStyle() const { // 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 FrameButtonStyle::kMdButton; #else return FrameButtonStyle::kImageButton; -@@ -608,7 +608,7 @@ bool OpaqueBrowserFrameView::ShouldDrawRestoredFrameSh +@@ -595,7 +595,7 @@ bool OpaqueBrowserFrameView::ShouldDrawRestoredFrameSh return false; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) ui::WindowTiledEdges OpaqueBrowserFrameView::GetTiledEdges() const { return frame()->tiled_edges(); } -@@ -810,7 +810,7 @@ gfx::Rect OpaqueBrowserFrameView::GetIconBounds() cons +@@ -796,7 +796,7 @@ gfx::Rect OpaqueBrowserFrameView::GetIconBounds() cons } void OpaqueBrowserFrameView::WindowIconPressed() { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Chrome OS doesn't show the window icon, and Windows handles this on its own // due to the hit test being HTSYSMENU. menu_runner_ = std::make_unique( diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc index 5299bb30610c..573b85680ab4 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc @@ -1,92 +1,92 @@ ---- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc @@ -40,7 +40,7 @@ #include "ui/aura/window.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.h" #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura_linux.h" #endif @@ -61,7 +61,7 @@ constexpr int kBackToTabImageSize = 16; // The height of the controls bar at the top of the window. constexpr int kTopControlsHeight = 30; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Frame border when window shadow is not drawn. constexpr int kFrameBorderThickness = 4; #endif @@ -151,7 +151,7 @@ class WindowEventObserver : public ui::EventObserver { gfx::Rect input_bounds = pip_browser_frame_view_->GetLocalBounds(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Calculate input bounds for Linux. This is needed because the input bounds // is not necessary the same as the local bounds on Linux. if (pip_browser_frame_view_->ShouldDrawFrameShadow()) { @@ -341,7 +341,7 @@ PictureInPictureBrowserFrameView::PictureInPictureBrow hide_close_button_animation_.set_continuous(false); hide_close_button_animation_.set_delegate(this); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) frame_background_ = std::make_unique(); #endif @@ -469,7 +469,7 @@ void PictureInPictureBrowserFrameView::OnThemeChanged( for (ContentSettingImageView* view : content_setting_views_) view->SetIconColor(color_provider->GetColor(kColorPipWindowForeground)); -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) // On Linux the top bar background will be drawn in OnPaint(). top_bar_container_view_->SetBackground(views::CreateSolidBackground( color_provider->GetColor(kColorPipWindowTopBarBackground))); @@ -514,7 +514,7 @@ void PictureInPictureBrowserFrameView::RemovedFromWidg BrowserNonClientFrameView::RemovedFromWidget(); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) gfx::Insets PictureInPictureBrowserFrameView::MirroredFrameBorderInsets() const { auto border = FrameBorderInsets(); -@@ -719,7 +719,7 @@ void PictureInPictureBrowserFrameView::AnimationProgre +@@ -715,7 +715,7 @@ void PictureInPictureBrowserFrameView::AnimationProgre // views::View implementations: void PictureInPictureBrowserFrameView::OnPaint(gfx::Canvas* canvas) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Draw the PiP window frame borders and shadows, including the top bar // background. if (window_frame_provider_) { -@@ -842,7 +842,7 @@ void PictureInPictureBrowserFrameView::UpdateTopBarVie +@@ -838,7 +838,7 @@ void PictureInPictureBrowserFrameView::UpdateTopBarVie } gfx::Insets PictureInPictureBrowserFrameView::FrameBorderInsets() const { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (window_frame_provider_) { const auto insets = window_frame_provider_->GetFrameThicknessDip(); const auto tiled_edges = frame()->tiled_edges(); -@@ -863,7 +863,7 @@ gfx::Insets PictureInPictureBrowserFrameView::FrameBor +@@ -859,7 +859,7 @@ gfx::Insets PictureInPictureBrowserFrameView::FrameBor } gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return FrameBorderInsets(); #else return gfx::Insets(kResizeBorder); -@@ -874,7 +874,7 @@ int PictureInPictureBrowserFrameView::GetTopAreaHeight +@@ -870,7 +870,7 @@ int PictureInPictureBrowserFrameView::GetTopAreaHeight return FrameBorderInsets().top() + kTopControlsHeight; } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) void PictureInPictureBrowserFrameView::SetWindowFrameProvider( ui::WindowFrameProvider* window_frame_provider) { DCHECK(window_frame_provider); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc index 5375cf95c1ee..9beba82c59fa 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc @@ -1,29 +1,29 @@ ---- chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc.orig 2023-02-11 09:11:04 UTC +--- chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc @@ -50,7 +50,7 @@ namespace { const int kModalDialogWidth = 448; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) const int kEnterpriseConfirmationDialogWidth = 512; const int kEnterpriseConfirmationDialogHeight = 576; #endif @@ -170,7 +170,7 @@ SigninViewControllerDelegateViews::CreateProfileCustom #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // static std::unique_ptr SigninViewControllerDelegateViews::CreateEnterpriseConfirmationWebView( -@@ -447,7 +447,7 @@ SigninViewControllerDelegate::CreateProfileCustomizati +@@ -448,7 +448,7 @@ SigninViewControllerDelegate::CreateProfileCustomizati #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // static SigninViewControllerDelegate* SigninViewControllerDelegate::CreateEnterpriseConfirmationDelegate( diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc index 2e12735c9cbf..8a8e3da91c7e 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/tabs/tab.cc.orig 2022-12-02 17:56:32 UTC +--- chrome/browser/ui/views/tabs/tab.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/tabs/tab.cc -@@ -582,7 +582,7 @@ void Tab::MaybeUpdateHoverStatus(const ui::MouseEvent& +@@ -581,7 +581,7 @@ void Tab::MaybeUpdateHoverStatus(const ui::MouseEvent& if (mouse_hovered_ || !GetWidget()->IsMouseEventsEnabled()) return; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Move the hit test area for hovering up so that it is not overlapped by tab // hover cards when they are shown. // TODO(crbug.com/978134): Once Linux/CrOS widget transparency is solved, diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc index 9fb4d066b0b8..8d40ebf3df7d 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc @@ -1,56 +1,56 @@ ---- chrome/browser/ui/views/tabs/tab_drag_controller.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/tabs/tab_drag_controller.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/tabs/tab_drag_controller.cc -@@ -82,7 +82,7 @@ +@@ -79,7 +79,7 @@ #include "components/remote_cocoa/browser/window.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/aura/client/drag_drop_client.h" #endif -@@ -260,7 +260,7 @@ bool IsWindowDragUsingSystemDragDropAllowed() { +@@ -187,7 +187,7 @@ bool IsWindowDragUsingSystemDragDropAllowed() { void UpdateSystemDnDDragImage(TabDragContext* attached_context, const gfx::ImageSkia& image) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) aura::Window* root_window = attached_context->GetWidget()->GetNativeWindow()->GetRootWindow(); if (aura::client::GetDragDropClient(root_window)) { -@@ -512,7 +512,7 @@ void TabDragController::Init(TabDragContext* source_co +@@ -361,7 +361,7 @@ void TabDragController::Init(TabDragContext* source_co // synchronous on desktop Linux, so use that. // - ChromeOS Ash // Releasing capture on Ash cancels gestures so avoid it. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) can_release_capture_ = false; #endif start_point_in_screen_ = gfx::Point(source_view_offset, mouse_offset.y()); -@@ -1151,7 +1151,7 @@ TabDragController::DragBrowserToNewTabStrip(TabDragCon +@@ -957,7 +957,7 @@ TabDragController::DragBrowserToNewTabStrip(TabDragCon // 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)) // EndMoveLoop is going to snap the window back to its original location. // Hide it so users don't see this. Hiding a window in Linux aura causes // it to lose capture so skip it. -@@ -2202,7 +2202,7 @@ void TabDragController::CompleteDrag() { +@@ -1957,7 +1957,7 @@ void TabDragController::CompleteDrag() { } // If source window was maximized - maximize the new window as well. -#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) // Keeping maximized state breaks snap to Grid on Windows when dragging // tabs from maximized windows. TODO:(crbug.com/727051) Explore doing this // for other desktop OS's. kMaximizedStateRetainedOnTabDrag in -@@ -2596,7 +2596,7 @@ TabDragController::Liveness TabDragController::GetLoca +@@ -2340,7 +2340,7 @@ TabDragController::Liveness TabDragController::GetLoca } // 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) // Exclude windows which are pending deletion via Browser::TabStripEmpty(). // These windows can be returned in the Linux Aura port because the browser // window which was used for dragging is not hidden once all of its tabs are diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc new file mode 100644 index 000000000000..c8dd6fd00d79 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc @@ -0,0 +1,11 @@ +--- chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc.orig 2023-05-05 12:12:41 UTC ++++ chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +@@ -749,7 +749,7 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* ta + // not become active. Setting this to false creates the need to explicitly + // hide the hovercard on press, touch, and keyboard events. + SetCanActivate(false); +-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + set_accept_events(false); + #endif + diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc index 905346b9da8f..c47bb9ef615b 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc @@ -1,110 +1,92 @@ ---- chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc -@@ -401,7 +401,7 @@ std::string GetFileExtension(FileExtension file_extens +@@ -406,7 +406,7 @@ std::string GetFileExtension(FileExtension file_extens } #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) SiteConfig GetSiteConfigurationFromAppName(const std::string& app_name) { SiteConfig config; bool is_app_found = false; -@@ -582,7 +582,7 @@ std::vector GetFileExtensionsForProgId( - } - #endif - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - bool IconManagerCheckIconTopLeftColor(WebAppIconManager& icon_manager, - const AppId& app_id, - std::vector sizes_px, -@@ -917,7 +917,7 @@ void WebAppIntegrationTestDriver::TearDownOnMainThread +@@ -869,7 +869,7 @@ void WebAppIntegrationTestDriver::TearDownOnMainThread LOG(INFO) << "TearDownOnMainThread: Deleting dangling shortcuts."; // TODO(crbug.com/1273568): Investigate the true source of flakiness instead // of papering over it here. -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ASSERT_TRUE(override_registration_->test_override->ForceDeleteAllShortcuts()); #endif LOG(INFO) -@@ -1715,7 +1715,7 @@ void WebAppIntegrationTestDriver::DeletePlatformShortc +@@ -1740,7 +1740,7 @@ void WebAppIntegrationTestDriver::DeletePlatformShortc if (app_name.empty()) { app_name = GetSiteConfiguration(site).app_name; } -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ASSERT_TRUE(override_registration_->test_override->IsShortcutCreated( profile(), app_id, app_name)); ASSERT_TRUE( -@@ -2749,7 +2749,7 @@ void WebAppIntegrationTestDriver::CheckRunOnOsLoginEna +@@ -2905,7 +2905,7 @@ void WebAppIntegrationTestDriver::CheckRunOnOsLoginEna app_state->id, app_state->name); ASSERT_TRUE(icon_color.has_value()); ASSERT_THAT(site_config.icon_color, testing::Eq(icon_color.value())); -#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ASSERT_TRUE(override_registration_->test_override->IsRunOnOsLoginEnabled( profile(), app_state->id, app_state->name)); #endif -@@ -2764,7 +2764,7 @@ void WebAppIntegrationTestDriver::CheckRunOnOsLoginDis +@@ -2920,7 +2920,7 @@ void WebAppIntegrationTestDriver::CheckRunOnOsLoginDis GetAppBySiteMode(after_state_change_action_state_.get(), profile(), site); ASSERT_TRUE(app_state); base::ScopedAllowBlockingForTesting allow_blocking; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ASSERT_FALSE(override_registration_->test_override->IsRunOnOsLoginEnabled( profile(), app_state->id, app_state->name)); #endif -@@ -2774,7 +2774,7 @@ void WebAppIntegrationTestDriver::CheckRunOnOsLoginDis +@@ -2930,7 +2930,7 @@ void WebAppIntegrationTestDriver::CheckRunOnOsLoginDis void WebAppIntegrationTestDriver::CheckSiteHandlesFile( Site site, FileExtension file_extension) { -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (!BeforeStateCheckAction(__FUNCTION__)) { return; } -@@ -2786,7 +2786,7 @@ void WebAppIntegrationTestDriver::CheckSiteHandlesFile +@@ -2946,7 +2946,7 @@ void WebAppIntegrationTestDriver::CheckSiteHandlesFile void WebAppIntegrationTestDriver::CheckSiteNotHandlesFile( Site site, FileExtension file_extension) { -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (!BeforeStateCheckAction(__FUNCTION__)) { return; } -@@ -3362,7 +3362,7 @@ base::FilePath WebAppIntegrationTestDriver::GetShortcu +@@ -3565,7 +3565,7 @@ base::FilePath WebAppIntegrationTestDriver::GetShortcu base::FilePath shortcut_dir, const std::string& app_name, const AppId& app_id) { -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) return override_registration_->test_override->GetShortcutPath( profile(), shortcut_dir, app_id, app_name); #else -@@ -3537,7 +3537,7 @@ bool WebAppIntegrationTestDriver::IsShortcutAndIconCre +@@ -3740,7 +3740,7 @@ bool WebAppIntegrationTestDriver::IsShortcutAndIconCre const AppId& id) { base::ScopedAllowBlockingForTesting allow_blocking; bool is_shortcut_and_icon_correct = false; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool is_shortcut_correct = override_registration_->test_override->IsShortcutCreated(profile, id, name); -@@ -3581,7 +3581,7 @@ bool WebAppIntegrationTestDriver::DoIconColorsMatch(Pr +@@ -3784,7 +3784,7 @@ bool WebAppIntegrationTestDriver::DoIconColorsMatch(Pr do_icon_colors_match = (expected_icon_pixel_color == shortcut_pixel_color_apps_folder.value()); } -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) SkColor expected_icon_pixel_color = GetSiteConfigurationFromAppName(name).icon_color; - do_icon_colors_match = IconManagerCheckIconTopLeftColor( -@@ -3634,7 +3634,7 @@ bool WebAppIntegrationTestDriver::IsFileHandledBySite( - app_id); - is_file_handled = - shell_integration::CanApplicationHandleURL(app_path, test_file_url); --#elif BUILDFLAG(IS_LINUX) -+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - AppId app_id = GetAppIdBySiteMode(site); - for (const LinuxFileRegistration& command : - override_registration_->test_override->linux_file_registration()) { + absl::optional actual_color_install_icon_size = diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc index ce5574a753b7..24f7cf34e319 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc @@ -1,20 +1,20 @@ ---- chrome/browser/ui/webui/app_home/app_home_page_handler.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/webui/app_home/app_home_page_handler.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/webui/app_home/app_home_page_handler.cc -@@ -353,7 +353,7 @@ app_home::mojom::AppInfoPtr AppHomePageHandler::Create +@@ -362,7 +362,7 @@ app_home::mojom::AppInfoPtr AppHomePageHandler::Create bool deprecated_app = false; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) auto* context = extension_system_->extension_service()->GetBrowserContext(); deprecated_app = extensions::IsExtensionUnsupportedDeprecatedApp(context, extension->id()); -@@ -419,7 +419,7 @@ void AppHomePageHandler::FillExtensionInfoList( - bool is_deprecated_app = false; - auto* context = extension_system_->extension_service()->GetBrowserContext(); +@@ -425,7 +425,7 @@ void AppHomePageHandler::FillExtensionInfoList( + } + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - is_deprecated_app = extensions::IsExtensionUnsupportedDeprecatedApp( - context, extension->id()); - #endif + auto* context = extension_system_->extension_service()->GetBrowserContext(); + const bool is_deprecated_app = + extensions::IsExtensionUnsupportedDeprecatedApp(context, diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc index 2c729bce7c40..928317dfbcf5 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc @@ -1,92 +1,92 @@ ---- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -@@ -329,7 +329,7 @@ +@@ -330,7 +330,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 -@@ -355,17 +355,17 @@ +@@ -356,17 +356,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 -@@ -735,7 +735,7 @@ bool IsAboutUI(const GURL& url) { +@@ -746,7 +746,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) -@@ -1037,7 +1037,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we - return &NewWebUI; +@@ -1054,7 +1054,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we + return &NewWebUI; } #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; #endif -@@ -1092,7 +1092,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1109,7 +1109,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we if (url.host_piece() == chrome::kChromeUINaClHost) return &NewWebUI; #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) -@@ -1159,27 +1159,27 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1177,27 +1177,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; } #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; #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; #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; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) if (url.host_piece() == chrome::kChromeUIWebAppSettingsHost) return &NewWebUI; #endif diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc b/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc index bcd141b4f67b..10c3a53a7dfc 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc @@ -1,56 +1,56 @@ ---- chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -@@ -124,7 +124,7 @@ +@@ -126,7 +126,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h" #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) #include "ui/display/screen.h" #endif -@@ -144,7 +144,7 @@ +@@ -146,7 +146,7 @@ #include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/linux/linux_ui_factory.h" #include "ui/ozone/public/ozone_platform.h" #endif -@@ -233,7 +233,7 @@ void AddCommonStrings(content::WebUIDataSource* html_s +@@ -235,7 +235,7 @@ void AddCommonStrings(content::WebUIDataSource* html_s #endif html_source->AddBoolean("isChildAccount", profile->IsChild()); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool allow_qt_theme = base::FeatureList::IsEnabled(ui::kAllowQt); #else bool allow_qt_theme = false; -@@ -379,7 +379,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -388,7 +388,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht {"huge", IDS_SETTINGS_HUGE_FONT_SIZE}, {"sidePanelAlignLeft", IDS_SETTINGS_SIDE_PANEL_ALIGN_LEFT}, {"sidePanelAlignRight", IDS_SETTINGS_SIDE_PANEL_ALIGN_RIGHT}, -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) {"gtkTheme", IDS_SETTINGS_GTK_THEME}, {"useGtkTheme", IDS_SETTINGS_USE_GTK_THEME}, {"qtTheme", IDS_SETTINGS_QT_THEME}, -@@ -389,7 +389,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -398,7 +398,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht #else {"resetToDefaultTheme", IDS_SETTINGS_RESET_TO_DEFAULT_THEME}, #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) {"showWindowDecorations", IDS_SHOW_WINDOW_DECORATIONS}, #endif #if BUILDFLAG(IS_MAC) -@@ -411,7 +411,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -420,7 +420,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht // 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_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) bool show_custom_chrome_frame = ui::OzonePlatform::GetInstance() ->GetPlatformRuntimeProperties() .supports_server_side_window_decorations; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.cc b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.cc index f2907d5bc6dc..b26b0a5f8673 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.cc @@ -1,92 +1,92 @@ ---- chrome/browser/web_applications/os_integration/os_integration_test_override.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/web_applications/os_integration/os_integration_test_override.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/web_applications/os_integration/os_integration_test_override.cc -@@ -179,7 +179,7 @@ bool OsIntegrationTestOverride::IsRunOnOsLoginEnabled( +@@ -214,7 +214,7 @@ bool OsIntegrationTestOverride::IsRunOnOsLoginEnabled( Profile* profile, const AppId& app_id, const std::string& app_name) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::string shortcut_filename = "chrome-" + app_id + "-" + profile->GetBaseName().value() + ".desktop"; return base::PathExists(startup().Append(shortcut_filename)); -@@ -349,7 +349,7 @@ base::FilePath OsIntegrationTestOverride::GetShortcutP +@@ -491,7 +491,7 @@ base::FilePath OsIntegrationTestOverride::GetShortcutP app_installed_profiles.end()) { return shortcut_path; } -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::string shortcut_filename = "chrome-" + app_id + "-" + profile->GetBaseName().value() + ".desktop"; base::FilePath shortcut_path = shortcut_dir.Append(shortcut_filename); -@@ -374,7 +374,7 @@ bool OsIntegrationTestOverride::IsShortcutCreated(Prof +@@ -516,7 +516,7 @@ bool OsIntegrationTestOverride::IsShortcutCreated(Prof base::FilePath app_shortcut_path = GetShortcutPath(profile, chrome_apps_folder(), app_id, app_name); return base::PathExists(app_shortcut_path); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FilePath desktop_shortcut_path = GetShortcutPath(profile, desktop(), app_id, app_name); return base::PathExists(desktop_shortcut_path); -@@ -402,7 +402,7 @@ bool OsIntegrationTestOverride::SimulateDeleteShortcut +@@ -544,7 +544,7 @@ bool OsIntegrationTestOverride::SimulateDeleteShortcut GetShortcutPath(profile, chrome_apps_folder(), app_id, app_name); DCHECK(base::PathExists(app_folder_shortcut_path)); return base::DeletePathRecursively(app_folder_shortcut_path); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FilePath desktop_shortcut_path = GetShortcutPath(profile, desktop(), app_id, app_name); LOG(INFO) << desktop_shortcut_path; -@@ -419,7 +419,7 @@ bool OsIntegrationTestOverride::ForceDeleteAllShortcut +@@ -561,7 +561,7 @@ bool OsIntegrationTestOverride::ForceDeleteAllShortcut return DeleteDesktopDirOnWin() && DeleteApplicationMenuDirOnWin(); #elif BUILDFLAG(IS_MAC) return DeleteChromeAppsDir(); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return DeleteDesktopDirOnLinux(); #else NOTREACHED() << "Not implemented on ChromeOS/Fuchsia "; -@@ -459,7 +459,7 @@ void OsIntegrationTestOverride::EnableOrDisablePathOnL +@@ -601,7 +601,7 @@ void OsIntegrationTestOverride::EnableOrDisablePathOnL startup_enabled_[file_path] = enable_on_login; } -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool OsIntegrationTestOverride::DeleteDesktopDirOnLinux() { if (desktop_.IsValid()) { return desktop_.Delete(); -@@ -492,7 +492,7 @@ OsIntegrationTestOverride::OsIntegrationTestOverride( +@@ -634,7 +634,7 @@ OsIntegrationTestOverride::OsIntegrationTestOverride( #elif BUILDFLAG(IS_MAC) bool success = chrome_apps_folder_.CreateUniqueTempDirUnderPath(base_path); DCHECK(success); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool success = desktop_.CreateUniqueTempDirUnderPath(base_path); DCHECK(success); success = startup_.CreateUniqueTempDirUnderPath(base_path); -@@ -511,7 +511,7 @@ OsIntegrationTestOverride::OsIntegrationTestOverride( +@@ -653,7 +653,7 @@ OsIntegrationTestOverride::OsIntegrationTestOverride( #elif BUILDFLAG(IS_MAC) bool success = chrome_apps_folder_.CreateUniqueTempDir(); DCHECK(success); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool success = desktop_.CreateUniqueTempDir(); DCHECK(success); success = startup_.CreateUniqueTempDir(); -@@ -519,7 +519,7 @@ OsIntegrationTestOverride::OsIntegrationTestOverride( +@@ -661,7 +661,7 @@ OsIntegrationTestOverride::OsIntegrationTestOverride( #endif } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto callback = base::BindRepeating([](base::FilePath filename, std::string xdg_command, std::string file_contents) { -@@ -553,7 +553,7 @@ OsIntegrationTestOverride::~OsIntegrationTestOverride( +@@ -695,7 +695,7 @@ OsIntegrationTestOverride::~OsIntegrationTestOverride( } } } -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Reset the file handling callback. SetUpdateMimeInfoDatabaseOnLinuxCallbackForTesting( UpdateMimeInfoDatabaseOnLinuxCallback()); diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h index f3bcfebc4dd3..a56ab2ef951a 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h @@ -1,29 +1,29 @@ ---- chrome/browser/web_applications/os_integration/os_integration_test_override.h.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/web_applications/os_integration/os_integration_test_override.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/web_applications/os_integration/os_integration_test_override.h -@@ -33,7 +33,7 @@ class ShellLinkItem; +@@ -36,7 +36,7 @@ class ShellLinkItem; namespace web_app { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) struct LinuxFileRegistration { std::string xdg_command; std::string file_contents; -@@ -183,7 +183,7 @@ class OsIntegrationTestOverride +@@ -201,7 +201,7 @@ class OsIntegrationTestOverride } void EnableOrDisablePathOnLogin(const base::FilePath& file_path, bool enable_on_login); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool DeleteDesktopDirOnLinux(); const base::FilePath& desktop() { return desktop_.GetPath(); } const base::FilePath& startup() { return startup_.GetPath(); } -@@ -230,7 +230,7 @@ class OsIntegrationTestOverride - #elif BUILDFLAG(IS_MAC) +@@ -250,7 +250,7 @@ class OsIntegrationTestOverride base::ScopedTempDir chrome_apps_folder_; std::map startup_enabled_; + -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::ScopedTempDir desktop_; base::ScopedTempDir startup_; std::vector linux_file_registration_; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc new file mode 100644 index 000000000000..5c170af061fe --- /dev/null +++ b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc @@ -0,0 +1,11 @@ +--- chrome/browser/web_applications/os_integration/run_on_os_login_sub_manager.cc.orig 2023-05-05 12:12:41 UTC ++++ chrome/browser/web_applications/os_integration/run_on_os_login_sub_manager.cc +@@ -53,7 +53,7 @@ proto::RunOnOsLoginMode ConvertWebAppRunOnOsLoginModeT + // different from other platforms, see web_app_run_on_os_login_manager.h for + // more info. + bool DoesRunOnOsLoginRequireExecution() { +-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + return base::FeatureList::IsEnabled(features::kDesktopPWAsRunOnOsLogin); + #else + return false; diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h index 1fd5602a772c..5a0abb9bb5ea 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h +++ b/www/ungoogled-chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h @@ -1,20 +1,20 @@ ---- chrome/browser/web_applications/os_integration/web_app_shortcut.h.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/web_applications/os_integration/web_app_shortcut.h.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/web_applications/os_integration/web_app_shortcut.h @@ -21,7 +21,7 @@ #include "ui/gfx/image/image_family.h" #include "url/gurl.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/web_applications/os_integration/web_app_shortcut_linux.h" #endif // BUILDFLAG(IS_LINUX) -@@ -70,7 +70,7 @@ struct ShortcutInfo { +@@ -69,7 +69,7 @@ struct ShortcutInfo { std::set file_handler_extensions; std::set file_handler_mime_types; std::set protocol_handlers; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::set actions; #endif // BUILDFLAG(IS_LINUX) diff --git a/www/ungoogled-chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc b/www/ungoogled-chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc index 4d8aa476986b..c105c6c9bb56 100644 --- a/www/ungoogled-chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc +++ b/www/ungoogled-chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc @@ -1,11 +1,11 @@ ---- chrome/browser/webauthn/chrome_authenticator_request_delegate.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/browser/webauthn/chrome_authenticator_request_delegate.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/browser/webauthn/chrome_authenticator_request_delegate.cc -@@ -587,7 +587,7 @@ void ChromeAuthenticatorRequestDelegate::ConfigureCabl +@@ -590,7 +590,7 @@ void ChromeAuthenticatorRequestDelegate::ConfigureCabl g_observer->ConfiguringCable(request_type); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // No caBLEv1 on Linux. It tends to crash bluez. if (base::Contains(pairings_from_extension, device::CableDiscoveryData::Version::V1, diff --git a/www/ungoogled-chromium/files/patch-chrome_common_channel__info.h b/www/ungoogled-chromium/files/patch-chrome_common_channel__info.h index 5a179988a615..a77108da13a9 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_channel__info.h +++ b/www/ungoogled-chromium/files/patch-chrome_common_channel__info.h @@ -1,11 +1,18 @@ ---- chrome/common/channel_info.h.orig 2022-10-01 07:40:07 UTC +--- chrome/common/channel_info.h.orig 2023-05-05 12:12:41 UTC +++ chrome/common/channel_info.h -@@ -106,7 +106,7 @@ std::string GetChannelSuffixForDataDir(); +@@ -104,13 +104,13 @@ void ClearChannelForTesting(); + std::string GetChannelSuffixForDataDir(); + #endif + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + std::string GetChannelSuffixForExtraFlagsEnvVarName(); + #endif // 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) // Returns the channel-specific filename of the desktop shortcut used to launch // the browser. std::string GetDesktopName(base::Environment* env); diff --git a/www/ungoogled-chromium/files/patch-chrome_common_channel__info__posix.cc b/www/ungoogled-chromium/files/patch-chrome_common_channel__info__posix.cc index c001cb0cc1b1..9662e94e0c59 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_channel__info__posix.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_channel__info__posix.cc @@ -1,11 +1,20 @@ ---- chrome/common/channel_info_posix.cc.orig 2022-10-01 07:40:07 UTC +--- chrome/common/channel_info_posix.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/channel_info_posix.cc -@@ -93,7 +93,7 @@ std::string GetChannelSuffixForDataDir() { +@@ -92,7 +92,7 @@ std::string GetChannelSuffixForDataDir() { + } + } + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + std::string GetChannelSuffixForExtraFlagsEnvVarName() { + #if BUILDFLAG(GOOGLE_CHROME_BRANDING) + const auto channel_state = GetChannelImpl(); +@@ -118,7 +118,7 @@ std::string GetChannelSuffixForExtraFlagsEnvVarName() // 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) std::string GetDesktopName(base::Environment* env) { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Google Chrome packaged as a snap is a special case: the application name diff --git a/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.cc b/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.cc index 2b9719210a24..12a9aaaf7f67 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.cc @@ -1,65 +1,65 @@ ---- chrome/common/chrome_features.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/common/chrome_features.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/chrome_features.cc @@ -82,7 +82,7 @@ BASE_FEATURE(kAsyncDns, ); #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) // Enables or disables the Autofill survey triggered by opening a prompt to // save address info. BASE_FEATURE(kAutofillAddressSurvey, @@ -100,7 +100,7 @@ BASE_FEATURE(kAutofillPasswordSurvey, base::FEATURE_DISABLED_BY_DEFAULT); #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Enables the Restart background mode optimization. When all Chrome UI is // closed and it goes in the background, allows to restart the browser to // discard memory. @@ -284,7 +284,7 @@ BASE_FEATURE(kDesktopPWAsEnforceWebAppSettingsPolicy, // Enables or disables Desktop PWAs to be auto-started on OS login. BASE_FEATURE(kDesktopPWAsRunOnOsLogin, "DesktopPWAsRunOnOsLogin", -#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 @@ -308,7 +308,7 @@ BASE_FEATURE(kDesktopPWAsWebBundles, base::FEATURE_DISABLED_BY_DEFAULT); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Controls whether Chrome Apps are supported. See https://crbug.com/1221251. // If the feature is disabled, Chrome Apps continue to work. If enabled, Chrome // Apps will not launch and will be marked in the UI as deprecated. @@ -346,7 +346,7 @@ const base::FeatureParam kDnsOverHttpsFallbackPa const base::FeatureParam kDnsOverHttpsShowUiParam { &kDnsOverHttps, "ShowUi", #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) true #else false -@@ -740,7 +740,7 @@ BASE_FEATURE(kKAnonymityServiceStorage, +@@ -747,7 +747,7 @@ BASE_FEATURE(kKAnonymityServiceStorage, "KAnonymityServiceStorage", base::FEATURE_DISABLED_BY_DEFAULT); -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD) BASE_FEATURE(kLinuxLowMemoryMonitor, "LinuxLowMemoryMonitor", base::FEATURE_DISABLED_BY_DEFAULT); -@@ -753,7 +753,7 @@ constexpr base::FeatureParam kLinuxLowMemoryMonit +@@ -760,7 +760,7 @@ constexpr base::FeatureParam kLinuxLowMemoryMonit &kLinuxLowMemoryMonitor, "critical_level", 255}; #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) BASE_FEATURE(kListWebAppsSwitch, "ListWebAppsSwitch", base::FEATURE_DISABLED_BY_DEFAULT); diff --git a/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.h b/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.h index 0fcb032e884b..3cb086400864 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.h +++ b/www/ungoogled-chromium/files/patch-chrome_common_chrome__features.h @@ -1,45 +1,45 @@ ---- chrome/common/chrome_features.h.orig 2023-04-08 11:38:38 UTC +--- chrome/common/chrome_features.h.orig 2023-05-05 12:12:41 UTC +++ chrome/common/chrome_features.h @@ -64,13 +64,13 @@ BASE_DECLARE_FEATURE(kAppShimNewCloseBehavior); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAsyncDns); #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) COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAutofillAddressSurvey); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAutofillCardSurvey); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAutofillPasswordSurvey); #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kBackgroundModeAllowRestart); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -192,7 +192,7 @@ BASE_DECLARE_FEATURE(kDesktopPWAsTabStripSettings); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kDesktopPWAsWebBundles); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kChromeAppsDeprecation); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kKeepForceInstalledPreinstalledApps); -@@ -439,7 +439,7 @@ BASE_DECLARE_FEATURE(kKAnonymityServiceOHTTPRequests); +@@ -441,7 +441,7 @@ BASE_DECLARE_FEATURE(kKAnonymityServiceOHTTPRequests); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kKAnonymityServiceStorage); -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kLinuxLowMemoryMonitor); COMPONENT_EXPORT(CHROME_FEATURES) extern const base::FeatureParam kLinuxLowMemoryMonitorModerateLevel; -@@ -447,7 +447,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -449,7 +449,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::FeatureParam kLinuxLowMemoryMonitorCriticalLevel; #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kListWebAppsSwitch); #endif diff --git a/www/ungoogled-chromium/files/patch-chrome_common_chrome__paths.cc b/www/ungoogled-chromium/files/patch-chrome_common_chrome__paths.cc index bc3e5cc73b7f..dab40b711ddd 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_chrome__paths.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_chrome__paths.cc @@ -1,87 +1,87 @@ ---- chrome/common/chrome_paths.cc.orig 2022-12-02 17:56:32 UTC +--- chrome/common/chrome_paths.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/chrome_paths.cc -@@ -49,14 +49,14 @@ +@@ -48,14 +48,14 @@ namespace { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // The path to the external extension .json files. // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ const base::FilePath::CharType kFilepathSinglePrefExtensions[] = #if BUILDFLAG(GOOGLE_CHROME_BRANDING) - FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); + FILE_PATH_LITERAL("/usr/local/share/ungoogled-chromium/extensions"); #else - FILE_PATH_LITERAL("/usr/share/chromium/extensions"); + FILE_PATH_LITERAL("/usr/local/share/ungoogled-chromium/extensions"); #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -178,7 +178,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -176,7 +176,7 @@ bool PathProvider(int key, base::FilePath* result) { return false; break; case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (!GetUserDownloadsDirectorySafe(&cur)) return false; break; -@@ -421,12 +421,14 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -418,12 +418,14 @@ bool PathProvider(int key, base::FilePath* result) { if (!base::PathExists(cur)) // We don't want to create this return false; break; -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) case chrome::DIR_POLICY_FILES: { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) cur = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); +#elif BUILDFLAG(IS_FREEBSD) + cur = base::FilePath(FILE_PATH_LITERAL("/usr/local/etc/ungoogled-chromium/policies")); #else - cur = base::FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); + cur = base::FilePath(FILE_PATH_LITERAL("/etc/ungoogled-chromium/policies")); #endif break; } -@@ -436,7 +438,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -433,7 +435,7 @@ bool PathProvider(int key, base::FilePath* result) { #if BUILDFLAG(IS_CHROMEOS_ASH) || \ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ BUILDFLAG(CHROMIUM_BRANDING)) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { if (!base::PathService::Get(chrome::DIR_USER_DATA, &cur)) return false; -@@ -444,7 +446,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -441,7 +443,7 @@ bool PathProvider(int key, base::FilePath* result) { break; } #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { cur = base::FilePath(kFilepathSinglePrefExtensions); break; -@@ -488,7 +490,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -485,7 +487,7 @@ bool PathProvider(int key, base::FilePath* result) { break; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) case chrome::DIR_NATIVE_MESSAGING: #if BUILDFLAG(IS_MAC) #if BUILDFLAG(GOOGLE_CHROME_BRANDING) -@@ -502,9 +504,12 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -499,9 +501,12 @@ bool PathProvider(int key, base::FilePath* result) { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) cur = base::FilePath(FILE_PATH_LITERAL( "/etc/opt/chrome/native-messaging-hosts")); +#elif BUILDFLAG(IS_FREEBSD) + cur = base::FilePath(FILE_PATH_LITERAL( + "/usr/local/etc/ungoogled-chromium/native-messaging-hosts")); #else cur = base::FilePath(FILE_PATH_LITERAL( - "/etc/chromium/native-messaging-hosts")); + "/etc/ungoogled-chromium/native-messaging-hosts")); #endif #endif // !BUILDFLAG(IS_MAC) break; diff --git a/www/ungoogled-chromium/files/patch-chrome_common_chrome__switches.cc b/www/ungoogled-chromium/files/patch-chrome_common_chrome__switches.cc index 420b31132890..b5eb86e46e07 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_chrome__switches.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_chrome__switches.cc @@ -1,19 +1,19 @@ ---- chrome/common/chrome_switches.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/common/chrome_switches.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/chrome_switches.cc -@@ -860,14 +860,14 @@ const char kAllowNaClSocketAPI[] = "allow-nacl-socket- +@@ -852,14 +852,14 @@ const char kAllowNaClSocketAPI[] = "allow-nacl-socket- #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kEnableNewAppMenuIcon[] = "enable-new-app-menu-icon"; // Causes the browser to launch directly in guest mode. const char kGuest[] = "guest"; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Writes open and installed web apps for each profile to the specified file // without launching a new browser window or tab. Pass a absolute file path to // specify where to output the information. Can be used together with optional diff --git a/www/ungoogled-chromium/files/patch-chrome_common_pref__names.cc b/www/ungoogled-chromium/files/patch-chrome_common_pref__names.cc index d33307fc760c..715069e81ea5 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_pref__names.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_pref__names.cc @@ -1,65 +1,65 @@ ---- chrome/common/pref_names.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/common/pref_names.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/pref_names.cc -@@ -1213,7 +1213,7 @@ const char kUseAshProxy[] = "lacros.proxy.use_ash_prox +@@ -1151,7 +1151,7 @@ const char kUseAshProxy[] = "lacros.proxy.use_ash_prox // 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) // Linux specific preference on whether we should match the system theme. const char kUsesSystemThemeDeprecated[] = "extensions.theme.use_system"; const char kSystemTheme[] = "extensions.theme.system_theme"; -@@ -1317,7 +1317,7 @@ const char kShowUpdatePromotionInfoBar[] = +@@ -1255,7 +1255,7 @@ const char kShowUpdatePromotionInfoBar[] = // 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) // Boolean that is false if we should show window manager decorations. If // true, we draw a custom chrome frame (thicker title bar and blue border). const char kUseCustomChromeFrame[] = "browser.custom_chrome_frame"; -@@ -1828,7 +1828,7 @@ const char kDownloadDirUpgraded[] = "download.director +@@ -1759,7 +1759,7 @@ const char kDownloadDirUpgraded[] = "download.director const char kDownloadLastCompleteTime[] = "download.last_complete_time"; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) const char kOpenPdfDownloadInSystemReader[] = "download.open_pdf_in_system_reader"; #endif -@@ -2244,7 +2244,7 @@ const char kAmbientAuthenticationInPrivateModesEnabled +@@ -2179,7 +2179,7 @@ const char kAmbientAuthenticationInPrivateModesEnabled // requests. const char kBasicAuthOverHttpEnabled[] = "auth.basic_over_http_enabled"; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Boolean that specifies whether OK-AS-DELEGATE flag from KDC is respected // along with kAuthNegotiateDelegateAllowlist. const char kAuthNegotiateDelegateByKdcPolicy[] = -@@ -3274,7 +3274,7 @@ const char kBlockAutoplayEnabled[] = "media.block_auto +@@ -3209,7 +3209,7 @@ const char kFileOrDirectoryPickerWithoutGestureAllowed const char kSandboxExternalProtocolBlocked[] = "profile.sandbox_external_protocol_blocked"; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Boolean that indicates if system notifications are allowed to be used in // place of Chrome notifications. const char kAllowSystemNotifications[] = "system_notifications.allowed"; -@@ -3327,7 +3327,7 @@ const char kCACertificateManagementAllowed[] = +@@ -3262,7 +3262,7 @@ const char kCACertificateManagementAllowed[] = const char kChromeRootStoreEnabled[] = "chrome_root_store_enabled"; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) const char kEnforceLocalAnchorConstraintsEnabled[] = "enforce_local_anchor_constraints_enabled"; #endif -@@ -3650,7 +3650,7 @@ const char kThrottleNonVisibleCrossOriginIframesAllowe +@@ -3585,7 +3585,7 @@ const char kThrottleNonVisibleCrossOriginIframesAllowe const char kNewBaseUrlInheritanceBehaviorAllowed[] = "new_base_url_inheritance_behavior_allowed"; -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // If this exists and is true, Chrome may run system DNS resolution out of the // network process. If false, Chrome will run system DNS resolution in the // network process. If non-existent, Chrome will decide where to run system DNS diff --git a/www/ungoogled-chromium/files/patch-chrome_common_pref__names.h b/www/ungoogled-chromium/files/patch-chrome_common_pref__names.h index f6949c8c8959..c4409eab2e2e 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_pref__names.h +++ b/www/ungoogled-chromium/files/patch-chrome_common_pref__names.h @@ -1,74 +1,74 @@ ---- chrome/common/pref_names.h.orig 2023-04-08 11:38:38 UTC +--- chrome/common/pref_names.h.orig 2023-05-05 12:12:41 UTC +++ chrome/common/pref_names.h -@@ -388,7 +388,7 @@ extern const char kUseAshProxy[]; +@@ -372,7 +372,7 @@ extern const char kUseAshProxy[]; #endif // BUILDFLAG(IS_CHROMEOS_LACROS) // 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) // TODO(https://crbug.com/1317782): Remove in M110. extern const char kUsesSystemThemeDeprecated[]; extern const char kSystemTheme[]; -@@ -409,7 +409,7 @@ extern const char kShowUpdatePromotionInfoBar[]; +@@ -393,7 +393,7 @@ extern const char kShowUpdatePromotionInfoBar[]; #endif // 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 const char kUseCustomChromeFrame[]; #endif extern const char kPartitionDefaultZoomLevel[]; -@@ -599,7 +599,7 @@ extern const char kDownloadAllowedURLsForOpenByPolicy[ +@@ -580,7 +580,7 @@ extern const char kDownloadAllowedURLsForOpenByPolicy[ extern const char kDownloadDirUpgraded[]; extern const char kDownloadLastCompleteTime[]; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) extern const char kOpenPdfDownloadInSystemReader[]; #endif #if BUILDFLAG(IS_ANDROID) -@@ -716,7 +716,7 @@ extern const char kWebAppsUninstalledDefaultChromeApps +@@ -698,7 +698,7 @@ extern const char kWebAppsUninstalledDefaultChromeApps extern const char kWebAppsPreferences[]; extern const char kWebAppsIsolationState[]; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) extern const char kWebAppsUrlHandlerInfo[]; #endif -@@ -845,7 +845,7 @@ extern const char kGloballyScopeHTTPAuthCacheEnabled[] +@@ -827,7 +827,7 @@ extern const char kGloballyScopeHTTPAuthCacheEnabled[] extern const char kAmbientAuthenticationInPrivateModesEnabled[]; extern const char kBasicAuthOverHttpEnabled[]; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) extern const char kAuthNegotiateDelegateByKdcPolicy[]; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) -@@ -1124,7 +1124,7 @@ extern const char kBlockAutoplayEnabled[]; +@@ -1106,7 +1106,7 @@ extern const char kFileOrDirectoryPickerWithoutGesture #endif extern const char kSandboxExternalProtocolBlocked[]; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kAllowSystemNotifications[]; #endif -@@ -1150,7 +1150,7 @@ extern const char kCACertificateManagementAllowed[]; +@@ -1132,7 +1132,7 @@ extern const char kCACertificateManagementAllowed[]; extern const char kChromeRootStoreEnabled[]; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // TODO(https://crbug.com/1406103): delete this after a few milestones. extern const char kEnforceLocalAnchorConstraintsEnabled[]; #endif -@@ -1299,7 +1299,7 @@ extern const char kDIPSTimerLastUpdate[]; +@@ -1282,7 +1282,7 @@ extern const char kDIPSTimerLastUpdate[]; extern const char kThrottleNonVisibleCrossOriginIframesAllowed[]; extern const char kNewBaseUrlInheritanceBehaviorAllowed[]; -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kOutOfProcessSystemDnsResolutionEnabled[]; #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) diff --git a/www/ungoogled-chromium/files/patch-chrome_common_url__constants.cc b/www/ungoogled-chromium/files/patch-chrome_common_url__constants.cc index 0e46d54cd6b8..fd6f97ff08d0 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_url__constants.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_url__constants.cc @@ -1,11 +1,11 @@ ---- chrome/common/url_constants.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/common/url_constants.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/url_constants.cc -@@ -513,7 +513,7 @@ const char kPhoneHubPermissionLearnMoreURL[] = +@@ -522,7 +522,7 @@ const char kPhoneHubPermissionLearnMoreURL[] = "https://support.9oo91e.qjz9zk/chromebook/?p=multidevice"; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kChromeAppsDeprecationLearnMoreURL[] = "https://support.9oo91e.qjz9zk/chrome/?p=chrome_app_deprecation"; #endif diff --git a/www/ungoogled-chromium/files/patch-chrome_common_url__constants.h b/www/ungoogled-chromium/files/patch-chrome_common_url__constants.h index b12959545114..668a9a648324 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_url__constants.h +++ b/www/ungoogled-chromium/files/patch-chrome_common_url__constants.h @@ -1,11 +1,11 @@ ---- chrome/common/url_constants.h.orig 2023-03-10 11:01:21 UTC +--- chrome/common/url_constants.h.orig 2023-05-05 12:12:41 UTC +++ chrome/common/url_constants.h -@@ -488,7 +488,7 @@ extern const char kOutdatedPluginLearnMoreURL[]; +@@ -497,7 +497,7 @@ extern const char kOutdatedPluginLearnMoreURL[]; extern const char kPhoneHubPermissionLearnMoreURL[]; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // "Learn more" URL for the chrome apps deprecation dialog. extern const char kChromeAppsDeprecationLearnMoreURL[]; diff --git a/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.cc b/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.cc index ff2be724151c..d66378869463 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.cc +++ b/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.cc @@ -1,68 +1,68 @@ ---- chrome/common/webui_url_constants.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/common/webui_url_constants.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/common/webui_url_constants.cc -@@ -510,18 +510,18 @@ const char kOsUIShortcutCustomizationAppURL[] = "os:// +@@ -514,18 +514,18 @@ const char kOsUIShortcutCustomizationAppURL[] = "os:// 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 -@@ -536,14 +536,14 @@ const char kChromeUILinuxProxyConfigHost[] = "linux-pr +@@ -540,14 +540,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[] = -@@ -560,7 +560,7 @@ const char kChromeUIProfilePickerUrl[] = "chrome://pro +@@ -564,7 +564,7 @@ const char kChromeUIProfilePickerUrl[] = "chrome://pro 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"; -@@ -638,7 +638,7 @@ const char kPrivacySandboxSubPagePath[] = "/privacySan +@@ -642,7 +642,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 -@@ -859,7 +859,7 @@ const char* const kChromeDebugURLs[] = { +@@ -864,7 +864,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, diff --git a/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.h b/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.h index 952820212f64..3ee9d1ec010c 100644 --- a/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.h +++ b/www/ungoogled-chromium/files/patch-chrome_common_webui__url__constants.h @@ -1,57 +1,57 @@ ---- chrome/common/webui_url_constants.h.orig 2023-04-08 11:38:38 UTC +--- chrome/common/webui_url_constants.h.orig 2023-05-05 12:12:41 UTC +++ chrome/common/webui_url_constants.h -@@ -432,24 +432,24 @@ extern const char kOsUIShortcutCustomizationAppURL[]; +@@ -435,24 +435,24 @@ extern const char kOsUIShortcutCustomizationAppURL[]; 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 -@@ -464,14 +464,14 @@ extern const char kChromeUILinuxProxyConfigHost[]; +@@ -467,14 +467,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[]; -@@ -485,7 +485,7 @@ extern const char kChromeUIProfilePickerUrl[]; +@@ -488,7 +488,7 @@ extern const char kChromeUIProfilePickerUrl[]; 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[]; diff --git a/www/ungoogled-chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc b/www/ungoogled-chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc index 9381af6f6f2b..bb87427ed85f 100644 --- a/www/ungoogled-chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc @@ -1,38 +1,38 @@ ---- chrome/services/printing/print_backend_service_impl.cc.orig 2023-04-08 11:38:38 UTC +--- chrome/services/printing/print_backend_service_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/services/printing/print_backend_service_impl.cc @@ -43,7 +43,7 @@ #include "printing/backend/cups_connection_pool.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/no_destructor.h" #include "ui/linux/linux_ui.h" #include "ui/linux/linux_ui_delegate_stub.h" @@ -70,7 +70,7 @@ namespace printing { namespace { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) void InstantiateLinuxUiDelegate() { // TODO(crbug.com/809738) Until a real UI can be used in a utility process, // need to use the stub version. -@@ -490,7 +490,7 @@ void PrintBackendServiceImpl::Init( +@@ -503,7 +503,7 @@ void PrintBackendServiceImpl::Init( // `InitCommon()`. InitializeProcessForPrinting(); print_backend_ = PrintBackend::CreateInstance(locale); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Test framework already initializes the UI, so this should not go in // `InitCommon()`. Additionally, low-level Linux UI is not needed when tests // are using `TestPrintingContext`. -@@ -679,7 +679,7 @@ void PrintBackendServiceImpl::UpdatePrintSettings( +@@ -714,7 +714,7 @@ void PrintBackendServiceImpl::UpdatePrintSettings( crash_keys_ = std::make_unique( print_backend_->GetPrinterDriverInfo(*printer_name)); -#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_CUPS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_CUPS) // Try to fill in advanced settings based upon basic info options. PrinterBasicInfo basic_info; if (print_backend_->GetPrinterBasicInfo(*printer_name, &basic_info) == diff --git a/www/ungoogled-chromium/files/patch-chrome_services_speech_audio__source__fetcher__impl.cc b/www/ungoogled-chromium/files/patch-chrome_services_speech_audio__source__fetcher__impl.cc index 9f351174ed23..b1d2833748f6 100644 --- a/www/ungoogled-chromium/files/patch-chrome_services_speech_audio__source__fetcher__impl.cc +++ b/www/ungoogled-chromium/files/patch-chrome_services_speech_audio__source__fetcher__impl.cc @@ -1,11 +1,11 @@ ---- chrome/services/speech/audio_source_fetcher_impl.cc.orig 2023-01-13 08:56:02 UTC +--- chrome/services/speech/audio_source_fetcher_impl.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/services/speech/audio_source_fetcher_impl.cc -@@ -121,7 +121,7 @@ void AudioSourceFetcherImpl::Start( +@@ -132,7 +132,7 @@ void AudioSourceFetcherImpl::Start( // TODO(crbug.com/1185978): Check implementation / sandbox policy on Mac and // Windows. -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) is_started_ = true; // Initialize the AudioCapturerSource with |this| as the CaptureCallback, // get the parameters for the device ID, then start audio capture. diff --git a/www/ungoogled-chromium/files/patch-chrome_test_BUILD.gn b/www/ungoogled-chromium/files/patch-chrome_test_BUILD.gn index d73590241505..a4960acd96a9 100644 --- a/www/ungoogled-chromium/files/patch-chrome_test_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-chrome_test_BUILD.gn @@ -1,11 +1,11 @@ ---- chrome/test/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- chrome/test/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ chrome/test/BUILD.gn -@@ -10150,7 +10150,7 @@ test("chrome_app_unittests") { +@@ -10283,7 +10283,7 @@ test("chrome_app_unittests") { "//components/heap_profiling/in_process", "//components/safe_browsing:buildflags", ] -- if (!is_fuchsia) { -+ if (!is_fuchsia && !is_bsd) { +- if (!is_fuchsia && !is_mac) { ++ if (!is_fuchsia && !is_mac && !is_bsd) { deps += [ "//third_party/breakpad:client" ] } - if (enable_gwp_asan) { + if (is_android) { diff --git a/www/ungoogled-chromium/files/patch-chrome_updater_configurator.cc b/www/ungoogled-chromium/files/patch-chrome_updater_configurator.cc index b66ecbdcf690..0efd1901e4d3 100644 --- a/www/ungoogled-chromium/files/patch-chrome_updater_configurator.cc +++ b/www/ungoogled-chromium/files/patch-chrome_updater_configurator.cc @@ -1,11 +1,11 @@ ---- chrome/updater/configurator.cc.orig 2023-02-11 09:11:04 UTC +--- chrome/updater/configurator.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/updater/configurator.cc -@@ -57,7 +57,7 @@ Configurator::Configurator(scoped_refptr - base::MakeRefCounted()), - patch_factory_( - base::MakeRefCounted()) { +@@ -64,7 +64,7 @@ Configurator::Configurator(scoped_refptr + return absl::nullopt; + #endif + }()) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // On Linux creating the NetworkFetcherFactory requires performing blocking IO // to load an external library. This should be done when the configurator is // created. diff --git a/www/ungoogled-chromium/files/patch-chrome_updater_util_posix__util.cc b/www/ungoogled-chromium/files/patch-chrome_updater_util_posix__util.cc index 025720460096..c9cee8818b99 100644 --- a/www/ungoogled-chromium/files/patch-chrome_updater_util_posix__util.cc +++ b/www/ungoogled-chromium/files/patch-chrome_updater_util_posix__util.cc @@ -1,11 +1,11 @@ ---- chrome/updater/util/posix_util.cc.orig 2023-03-10 11:01:21 UTC +--- chrome/updater/util/posix_util.cc.orig 2023-05-05 12:12:41 UTC +++ chrome/updater/util/posix_util.cc -@@ -10,7 +10,7 @@ +@@ -16,7 +16,7 @@ #include "chrome/updater/updater_branding.h" #include "chrome/updater/util/util.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/updater/util/linux_util.h" #endif diff --git a/www/ungoogled-chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc b/www/ungoogled-chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc index 362c3f95db05..d650c679fa0e 100644 --- a/www/ungoogled-chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc +++ b/www/ungoogled-chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc @@ -1,12 +1,12 @@ ---- components/autofill/core/browser/personal_data_manager.cc.orig 2023-04-08 11:38:38 UTC +--- components/autofill/core/browser/personal_data_manager.cc.orig 2023-05-05 12:12:41 UTC +++ components/autofill/core/browser/personal_data_manager.cc -@@ -2253,7 +2253,8 @@ bool PersonalDataManager::ShouldShowCardsFromAccountOp +@@ -2260,7 +2260,8 @@ bool PersonalDataManager::ShouldShowCardsFromAccountOp // 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) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) // This option should only be shown for users that have not enabled the Sync // Feature and that have server credit cards available. if (!sync_service_ || sync_service_->IsSyncFeatureEnabled() || diff --git a/www/ungoogled-chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc b/www/ungoogled-chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc index ad569a148dec..42946c338cd2 100644 --- a/www/ungoogled-chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc +++ b/www/ungoogled-chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc @@ -1,11 +1,11 @@ ---- components/autofill/core/common/autofill_payments_features.cc.orig 2023-04-08 11:38:38 UTC +--- components/autofill/core/common/autofill_payments_features.cc.orig 2023-05-05 12:12:41 UTC +++ components/autofill/core/common/autofill_payments_features.cc -@@ -270,7 +270,7 @@ const base::FeatureParam +@@ -267,7 +267,7 @@ const base::FeatureParam bool ShouldShowImprovedUserConsentForCreditCardSave() { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) // The new user consent UI is fully launched on MacOS, Windows and Linux. return true; diff --git a/www/ungoogled-chromium/files/patch-components_crash_core_browser_crash__upload__list__crashpad.cc b/www/ungoogled-chromium/files/patch-components_crash_core_browser_crash__upload__list__crashpad.cc index 0d8c4d476ddd..4535cd1f9f67 100644 --- a/www/ungoogled-chromium/files/patch-components_crash_core_browser_crash__upload__list__crashpad.cc +++ b/www/ungoogled-chromium/files/patch-components_crash_core_browser_crash__upload__list__crashpad.cc @@ -1,26 +1,26 @@ ---- components/crash/core/browser/crash_upload_list_crashpad.cc.orig 2022-12-02 17:56:32 UTC +--- components/crash/core/browser/crash_upload_list_crashpad.cc.orig 2023-05-05 12:12:41 UTC +++ components/crash/core/browser/crash_upload_list_crashpad.cc -@@ -37,7 +37,9 @@ CrashUploadListCrashpad::~CrashUploadListCrashpad() = - - std::vector CrashUploadListCrashpad::LoadUploadList() { +@@ -38,7 +38,9 @@ CrashUploadListCrashpad::~CrashUploadListCrashpad() = + std::vector> + CrashUploadListCrashpad::LoadUploadList() { std::vector reports; +#if !defined(OS_BSD) crash_reporter::GetReports(&reports); +#endif - std::vector uploads; + std::vector> uploads; for (const crash_reporter::Report& report : reports) { -@@ -51,9 +53,13 @@ std::vector CrashUploadListCra +@@ -52,9 +54,13 @@ CrashUploadListCrashpad::LoadUploadList() { 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 } diff --git a/www/ungoogled-chromium/files/patch-components_device__signals_test_signals__contract.cc b/www/ungoogled-chromium/files/patch-components_device__signals_test_signals__contract.cc index 636fd696eb19..321ffd09102c 100644 --- a/www/ungoogled-chromium/files/patch-components_device__signals_test_signals__contract.cc +++ b/www/ungoogled-chromium/files/patch-components_device__signals_test_signals__contract.cc @@ -1,11 +1,11 @@ ---- components/device_signals/test/signals_contract.cc.orig 2023-01-13 08:56:02 UTC +--- components/device_signals/test/signals_contract.cc.orig 2023-05-05 12:12:41 UTC +++ components/device_signals/test/signals_contract.cc -@@ -190,7 +190,7 @@ GetSignalsContract() { +@@ -186,7 +186,7 @@ GetSignalsContract() { base::BindRepeating(VerifyUnset, names::kCrowdStrike); #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUIDLFLAG(IS_BSD) contract[names::kAllowScreenLock] = base::BindRepeating(VerifyUnset, names::kAllowScreenLock); contract[names::kImei] = base::BindRepeating(VerifyUnset, names::kImei); diff --git a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__configurations.cc b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__configurations.cc index 002d20865e0d..111abd22a4df 100644 --- a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__configurations.cc +++ b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__configurations.cc @@ -1,21 +1,21 @@ ---- components/feature_engagement/public/feature_configurations.cc.orig 2023-04-08 11:38:38 UTC +--- components/feature_engagement/public/feature_configurations.cc.orig 2023-05-05 12:12:41 UTC +++ components/feature_engagement/public/feature_configurations.cc @@ -39,7 +39,7 @@ FeatureConfig CreateAlwaysTriggerConfig(const base::Fe absl::optional GetClientSideFeatureConfig( const base::Feature* feature) { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (kIPHPasswordsAccountStorageFeature.name == feature->name) { absl::optional config = FeatureConfig(); config->valid = true; -@@ -1070,7 +1070,8 @@ absl::optional GetClientSideFeatureConf +@@ -1150,7 +1150,8 @@ absl::optional GetClientSideFeatureConf #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) if (kIPHAutofillVirtualCardSuggestionFeature.name == feature->name) { // A config that allows the virtual card credit card suggestion IPH to be // shown when: diff --git a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.cc b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.cc index 86a6082e9237..c45d575c1be6 100644 --- a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.cc +++ b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.cc @@ -1,21 +1,21 @@ ---- components/feature_engagement/public/feature_constants.cc.orig 2023-04-08 11:38:38 UTC +--- components/feature_engagement/public/feature_constants.cc.orig 2023-05-05 12:12:41 UTC +++ components/feature_engagement/public/feature_constants.cc @@ -19,7 +19,7 @@ BASE_FEATURE(kUseClientConfigIPH, BASE_FEATURE(kIPHDummyFeature, "IPH_Dummy", base::FEATURE_DISABLED_BY_DEFAULT); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) BASE_FEATURE(kIPHBatterySaverModeFeature, "IPH_BatterySaverMode", - base::FEATURE_DISABLED_BY_DEFAULT); -@@ -437,7 +437,8 @@ BASE_FEATURE(kIPHiOSAppStorePromoFeature, + base::FEATURE_ENABLED_BY_DEFAULT); +@@ -472,7 +472,8 @@ BASE_FEATURE(kIPHiOSPromoCredentialProviderExtensionFe #endif // BUILDFLAG(IS_IOS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) BASE_FEATURE(kIPHAutofillVirtualCardSuggestionFeature, "IPH_AutofillVirtualCardSuggestion", base::FEATURE_ENABLED_BY_DEFAULT); diff --git a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.h b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.h index 5a233a19520f..5cb039ba6c5b 100644 --- a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.h +++ b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__constants.h @@ -1,21 +1,21 @@ ---- components/feature_engagement/public/feature_constants.h.orig 2023-04-08 11:38:38 UTC +--- components/feature_engagement/public/feature_constants.h.orig 2023-05-05 12:12:41 UTC +++ components/feature_engagement/public/feature_constants.h @@ -22,7 +22,7 @@ BASE_DECLARE_FEATURE(kUseClientConfigIPH); BASE_DECLARE_FEATURE(kIPHDummyFeature); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) BASE_DECLARE_FEATURE(kIPHBatterySaverModeFeature); BASE_DECLARE_FEATURE(kIPHDesktopSharedHighlightingFeature); BASE_DECLARE_FEATURE(kIPHDesktopTabGroupsNewGroupFeature); -@@ -181,7 +181,8 @@ BASE_DECLARE_FEATURE(kIPHiOSAppStorePromoFeature); +@@ -194,7 +194,8 @@ BASE_DECLARE_FEATURE(kIPHiOSPromoCredentialProviderExt #endif // BUILDFLAG(IS_IOS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) BASE_DECLARE_FEATURE(kIPHAutofillVirtualCardSuggestionFeature); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || diff --git a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.cc b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.cc index 883d9d83cd72..97d866e2e3ff 100644 --- a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.cc +++ b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.cc @@ -1,21 +1,21 @@ ---- components/feature_engagement/public/feature_list.cc.orig 2023-04-08 11:38:38 UTC +--- components/feature_engagement/public/feature_list.cc.orig 2023-05-05 12:12:41 UTC +++ components/feature_engagement/public/feature_list.cc -@@ -128,7 +128,7 @@ const base::Feature* const kAllFeatures[] = { - &kIPHiOSAppStorePromoFeature, +@@ -133,7 +133,7 @@ const base::Feature* const kAllFeatures[] = { + &kIPHiOSPromoCredentialProviderExtensionFeature, #endif // BUILDFLAG(IS_IOS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) &kIPHBatterySaverModeFeature, &kIPHDesktopTabGroupsNewGroupFeature, - &kIPHExtensionsMenuFeature, -@@ -160,7 +160,8 @@ const base::Feature* const kAllFeatures[] = { + &kIPHDesktopCustomizeChromeFeature, +@@ -171,7 +171,8 @@ const base::Feature* const kAllFeatures[] = { // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) &kIPHAutofillVirtualCardSuggestionFeature, #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || diff --git a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.h b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.h index 76b4b20ddc20..d787c85758e7 100644 --- a/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.h +++ b/www/ungoogled-chromium/files/patch-components_feature__engagement_public_feature__list.h @@ -1,40 +1,40 @@ ---- components/feature_engagement/public/feature_list.h.orig 2023-04-08 11:38:38 UTC +--- components/feature_engagement/public/feature_list.h.orig 2023-05-05 12:12:41 UTC +++ components/feature_engagement/public/feature_list.h -@@ -233,7 +233,7 @@ DEFINE_VARIATION_PARAM(kIPHiOSAppStorePromoFeature, "I +@@ -244,7 +244,7 @@ DEFINE_VARIATION_PARAM(kIPHiOSPromoCredentialProviderE #endif // BUILDFLAG(IS_IOS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) DEFINE_VARIATION_PARAM(kIPHBatterySaverModeFeature, "IPH_BatterySaverMode"); - DEFINE_VARIATION_PARAM(kIPHDesktopTabGroupsNewGroupFeature, - "IPH_DesktopTabGroupsNewGroup"); -@@ -279,7 +279,8 @@ DEFINE_VARIATION_PARAM(kIPHPriceTrackingInSidePanelFea + DEFINE_VARIATION_PARAM(kIPHDesktopCustomizeChromeFeature, + "IPH_DesktopCustomizeChrome"); +@@ -302,7 +302,8 @@ DEFINE_VARIATION_PARAM(kIPHPriceTrackingInSidePanelFea // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) DEFINE_VARIATION_PARAM(kIPHAutofillVirtualCardSuggestionFeature, "IPH_AutofillVirtualCardSuggestion"); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || -@@ -398,7 +399,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation - VARIATION_ENTRY(kIPHiOSDefaultBrowserSettingsBadgeFeature), - VARIATION_ENTRY(kIPHiOSAppStorePromoFeature), +@@ -428,7 +429,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation + VARIATION_ENTRY(kIPHiOSPromoPostRestoreFeature), + VARIATION_ENTRY(kIPHiOSPromoCredentialProviderExtensionFeature), #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) VARIATION_ENTRY(kIPHBatterySaverModeFeature), + VARIATION_ENTRY(kIPHDesktopCustomizeChromeFeature), VARIATION_ENTRY(kIPHDesktopTabGroupsNewGroupFeature), - VARIATION_ENTRY(kIPHExtensionsMenuFeature), -@@ -431,7 +432,8 @@ constexpr flags_ui::FeatureEntry::FeatureVariation +@@ -467,7 +468,8 @@ constexpr flags_ui::FeatureEntry::FeatureVariation // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) VARIATION_ENTRY(kIPHAutofillVirtualCardSuggestionFeature), #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || diff --git a/www/ungoogled-chromium/files/patch-components_gwp__asan_crash__handler_crash__analyzer.cc b/www/ungoogled-chromium/files/patch-components_gwp__asan_crash__handler_crash__analyzer.cc index c8b955c2a8e6..88015956d8f4 100644 --- a/www/ungoogled-chromium/files/patch-components_gwp__asan_crash__handler_crash__analyzer.cc +++ b/www/ungoogled-chromium/files/patch-components_gwp__asan_crash__handler_crash__analyzer.cc @@ -1,20 +1,20 @@ ---- components/gwp_asan/crash_handler/crash_analyzer.cc.orig 2022-10-01 07:40:07 UTC +--- components/gwp_asan/crash_handler/crash_analyzer.cc.orig 2023-05-05 12:12:41 UTC +++ components/gwp_asan/crash_handler/crash_analyzer.cc -@@ -26,7 +26,7 @@ +@@ -30,7 +30,7 @@ #include "third_party/crashpad/crashpad/snapshot/process_snapshot.h" #include "third_party/crashpad/crashpad/util/process/process_memory.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 #elif BUILDFLAG(IS_APPLE) #include -@@ -81,7 +81,7 @@ bool CrashAnalyzer::GetExceptionInfo( +@@ -65,7 +65,7 @@ bool CrashAnalyzer::GetExceptionInfo( crashpad::VMAddress CrashAnalyzer::GetAccessAddress( const crashpad::ExceptionSnapshot& exception) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) if (exception.Exception() == SIGSEGV || exception.Exception() == SIGBUS) return exception.ExceptionAddress(); #elif BUILDFLAG(IS_APPLE) diff --git a/www/ungoogled-chromium/files/patch-components_metrics_metrics__log.cc b/www/ungoogled-chromium/files/patch-components_metrics_metrics__log.cc index 6205305d86c3..fb1c460651d7 100644 --- a/www/ungoogled-chromium/files/patch-components_metrics_metrics__log.cc +++ b/www/ungoogled-chromium/files/patch-components_metrics_metrics__log.cc @@ -1,38 +1,38 @@ ---- components/metrics/metrics_log.cc.orig 2023-01-13 08:56:02 UTC +--- components/metrics/metrics_log.cc.orig 2023-05-05 12:12:41 UTC +++ components/metrics/metrics_log.cc @@ -53,7 +53,7 @@ #include "base/win/current_module.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/environment.h" #include "base/nix/xdg_util.h" #endif -@@ -123,7 +123,7 @@ void RecordCurrentTime( +@@ -131,7 +131,7 @@ void RecordCurrentTime( } } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) metrics::SystemProfileProto::OS::XdgSessionType ToProtoSessionType( base::nix::SessionType session_type) { switch (session_type) { -@@ -375,7 +375,7 @@ void MetricsLog::RecordCoreSystemProfile( +@@ -390,7 +390,7 @@ void MetricsLog::RecordCoreSystemProfile( // OperatingSystemVersion refers to the ChromeOS release version. #if BUILDFLAG(IS_CHROMEOS_ASH) os->set_kernel_version(base::SysInfo::KernelVersion()); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Linux operating system version is copied over into kernel version to be // consistent. os->set_kernel_version(base::SysInfo::OperatingSystemVersion()); -@@ -392,7 +392,7 @@ void MetricsLog::RecordCoreSystemProfile( +@@ -407,7 +407,7 @@ void MetricsLog::RecordCoreSystemProfile( os->set_build_number(base::SysInfo::GetIOSBuildNumber()); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::unique_ptr env = base::Environment::Create(); os->set_xdg_session_type(ToProtoSessionType(base::nix::GetSessionType(*env))); os->set_xdg_current_desktop( diff --git a/www/ungoogled-chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc b/www/ungoogled-chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc index e137e8d4a32e..fc4175ba1c8a 100644 --- a/www/ungoogled-chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc +++ b/www/ungoogled-chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc @@ -1,11 +1,11 @@ ---- components/network_session_configurator/browser/network_session_configurator.cc.orig 2023-04-08 11:38:38 UTC +--- components/network_session_configurator/browser/network_session_configurator.cc.orig 2023-05-05 12:12:41 UTC +++ components/network_session_configurator/browser/network_session_configurator.cc -@@ -807,7 +807,7 @@ net::URLRequestContextBuilder::HttpCacheParams::Type C +@@ -808,7 +808,7 @@ net::URLRequestContextBuilder::HttpCacheParams::Type C } #endif // #if !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE; #else return net::URLRequestContextBuilder::HttpCacheParams::DISK_BLOCKFILE; diff --git a/www/ungoogled-chromium/files/patch-components_os__crypt_keyring__util__linux.cc b/www/ungoogled-chromium/files/patch-components_os__crypt_keyring__util__linux.cc deleted file mode 100644 index 924b5ad9cf95..000000000000 --- a/www/ungoogled-chromium/files/patch-components_os__crypt_keyring__util__linux.cc +++ /dev/null @@ -1,17 +0,0 @@ ---- components/os_crypt/keyring_util_linux.cc.orig 2022-10-01 07:40:07 UTC -+++ 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; - } - diff --git a/www/ungoogled-chromium/files/patch-components_os__crypt_sync_keyring__util__linux.cc b/www/ungoogled-chromium/files/patch-components_os__crypt_sync_keyring__util__linux.cc new file mode 100644 index 000000000000..29f12c7fcfe9 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-components_os__crypt_sync_keyring__util__linux.cc @@ -0,0 +1,26 @@ +--- components/os_crypt/sync/keyring_util_linux.cc.orig 2023-05-05 12:12:41 UTC ++++ components/os_crypt/sync/keyring_util_linux.cc +@@ -65,15 +65,21 @@ const GnomeKeyringLoader::FunctionInfo GnomeKeyringLoa + + /* Load the library and initialize the function pointers. */ + bool GnomeKeyringLoader::LoadGnomeKeyring() { ++#if BUILDFLAG(IS_BSD) ++ const char* kGkr = "libgnome-keyring.so"; ++#else ++ const char* kGkr = "libgnome-keyring.so.0"; ++#endif ++ + if (keyring_loaded) + return true; + +- void* handle = dlopen("libgnome-keyring.so.0", RTLD_NOW | RTLD_GLOBAL); ++ void* handle = dlopen(kGkr, 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 " << kGkr << ": " << dlerror(); + return false; + } + diff --git a/www/ungoogled-chromium/files/patch-components_os__crypt_libsecret__util__linux.cc b/www/ungoogled-chromium/files/patch-components_os__crypt_sync_libsecret__util__linux.cc similarity index 50% rename from www/ungoogled-chromium/files/patch-components_os__crypt_libsecret__util__linux.cc rename to www/ungoogled-chromium/files/patch-components_os__crypt_sync_libsecret__util__linux.cc index c1580cd34c36..284da3550cb7 100644 --- a/www/ungoogled-chromium/files/patch-components_os__crypt_libsecret__util__linux.cc +++ b/www/ungoogled-chromium/files/patch-components_os__crypt_sync_libsecret__util__linux.cc @@ -1,18 +1,27 @@ ---- components/os_crypt/libsecret_util_linux.cc.orig 2022-10-01 07:40:07 UTC -+++ components/os_crypt/libsecret_util_linux.cc -@@ -102,13 +102,13 @@ bool LibsecretLoader::LoadLibsecret() { +--- components/os_crypt/sync/libsecret_util_linux.cc.orig 2023-05-05 12:12:41 UTC ++++ components/os_crypt/sync/libsecret_util_linux.cc +@@ -99,16 +99,22 @@ bool LibsecretLoader::EnsureLibsecretLoaded() { + + // static + bool LibsecretLoader::LoadLibsecret() { ++#if BUILDFLAG(IS_BSD) ++ const char* kSecretLib = "libsecret-1.so"; ++#else ++ const char* kSecretLib = "libsecret-1.so.0"; ++#endif ++ 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); ++ static void* handle = dlopen(kSecretLib, 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(); ++ VLOG(1) << "Could not load << " << kSecretLib << ": " << dlerror(); return false; } diff --git a/www/ungoogled-chromium/files/patch-components_os__crypt_os__crypt.h b/www/ungoogled-chromium/files/patch-components_os__crypt_sync_os__crypt.h similarity index 96% rename from www/ungoogled-chromium/files/patch-components_os__crypt_os__crypt.h rename to www/ungoogled-chromium/files/patch-components_os__crypt_sync_os__crypt.h index 6e34f417f717..cff4fcd4f98e 100644 --- a/www/ungoogled-chromium/files/patch-components_os__crypt_os__crypt.h +++ b/www/ungoogled-chromium/files/patch-components_os__crypt_sync_os__crypt.h @@ -1,72 +1,72 @@ ---- components/os_crypt/os_crypt.h.orig 2023-01-13 08:56:02 UTC -+++ components/os_crypt/os_crypt.h +--- components/os_crypt/sync/os_crypt.h.orig 2023-05-05 12:12:41 UTC ++++ components/os_crypt/sync/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) @@ -23,7 +23,7 @@ class PrefRegistrySimple; class PrefService; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) namespace crypto { class SymmetricKey; } @@ -36,7 +36,7 @@ struct Config; // 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 config); #endif // BUILDFLAG(IS_LINUX) @@ -81,7 +81,7 @@ COMPONENT_EXPORT(OS_CRYPT) void UseMockKeyForTesting(b COMPONENT_EXPORT(OS_CRYPT) void SetLegacyEncryptionForTesting(bool legacy); COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting(); #endif // BUILDFLAG(IS_WIN) -#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(OS_CRYPT) void UseMockKeyStorageForTesting( base::OnceCallback()> @@ -108,7 +108,7 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCryptImpl { // Returns singleton instance of OSCryptImpl. static OSCryptImpl* GetInstance(); -#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 COMPONENT_EXPORT(OS_CRYPT) OSCryptImpl { void ResetStateForTesting(); #endif -#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD) // For unit testing purposes, inject methods to be used. // |storage_provider_factory| provides the desired |KeyStorage| // implementation. If the provider returns |nullptr|, a hardcoded password @@ -225,13 +225,13 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCryptImpl { crypto::SymmetricKey* GetEncryptionKey(); #endif // BUILDFLAG(IS_APPLE) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) // This lock is used to make the GetEncryptionKey and // GetRawEncryptionKey methods thread-safe. static base::Lock& GetLock(); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Create the KeyStorage. Will be null if no service is found. A Config must // be set before every call to this method. std::unique_ptr CreateKeyStorage(); diff --git a/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc b/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc index 1b50b51021b7..1235ee26bb6b 100644 --- a/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc +++ b/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc @@ -1,29 +1,29 @@ ---- components/password_manager/core/browser/login_database_unittest.cc.orig 2023-03-10 11:01:21 UTC +--- components/password_manager/core/browser/login_database_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ components/password_manager/core/browser/login_database_unittest.cc -@@ -2108,7 +2108,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd +@@ -2115,7 +2115,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd base::HistogramTester histogram_tester; ASSERT_TRUE(db.Init()); -#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) +#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD) // Make sure that we can't get any logins when database is corrupted. // Disabling the checks in chromecast because encryption is unavailable. std::vector> result; -@@ -2135,7 +2135,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd +@@ -2142,7 +2142,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd #endif // Check histograms. -#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) +#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD) histogram_tester.ExpectUniqueSample( "PasswordManager.DeleteUndecryptableLoginsReturnValue", metrics_util::DeleteCorruptedPasswordsResult::kSuccessPasswordsDeleted, -@@ -2178,7 +2178,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, KeychainL +@@ -2185,7 +2185,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, KeychainL } #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Test getting auto sign in logins when there are undecryptable ones TEST_F(LoginDatabaseUndecryptableLoginsTest, GetAutoSignInLogins) { std::vector> forms; diff --git a/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc b/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc index 1ec1e31a76c5..43136d8320cd 100644 --- a/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc +++ b/www/ungoogled-chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc @@ -1,20 +1,20 @@ ---- components/password_manager/core/browser/sync/password_sync_bridge.cc.orig 2023-02-11 09:11:04 UTC +--- components/password_manager/core/browser/sync/password_sync_bridge.cc.orig 2023-05-05 12:12:41 UTC +++ components/password_manager/core/browser/sync/password_sync_bridge.cc -@@ -185,7 +185,7 @@ bool IsCredentialPhished(const sync_pb::PasswordSpecif +@@ -186,7 +186,7 @@ bool IsCredentialPhished(const sync_pb::PasswordSpecif // merge. bool ShouldRecoverPasswordsDuringMerge() { // Delete the local undecryptable copy when this is MacOS or Linux only. -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return true; #else return false; -@@ -193,7 +193,7 @@ bool ShouldRecoverPasswordsDuringMerge() { +@@ -194,7 +194,7 @@ bool ShouldRecoverPasswordsDuringMerge() { } bool ShouldCleanSyncMetadataDuringStartupWhenDecryptionFails() { -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return ShouldRecoverPasswordsDuringMerge() && base::FeatureList::IsEnabled( features::kForceInitialSyncWhenDecryptionFails); diff --git a/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.cc b/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.cc index 91d4b57ad9b3..eab9f9bec086 100644 --- a/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.cc +++ b/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.cc @@ -1,20 +1,20 @@ ---- components/password_manager/core/common/password_manager_features.cc.orig 2023-04-08 11:38:38 UTC +--- components/password_manager/core/common/password_manager_features.cc.orig 2023-05-05 12:12:41 UTC +++ components/password_manager/core/common/password_manager_features.cc -@@ -76,7 +76,7 @@ BASE_FEATURE(kFillOnAccountSelect, - "fill-on-account-select", +@@ -82,7 +82,7 @@ BASE_FEATURE(kPasswordManagerLogToTerminal, + "PasswordManagerLogToTerminal", base::FEATURE_DISABLED_BY_DEFAULT); -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // When enabled, initial sync will be forced during startup if the password // store has encryption service failures. BASE_FEATURE(kForceInitialSyncWhenDecryptionFails, -@@ -197,7 +197,7 @@ BASE_FEATURE(kPasswordStrengthIndicator, +@@ -210,7 +210,7 @@ BASE_FEATURE(kPasswordStrengthIndicator, "PasswordStrengthIndicator", base::FEATURE_DISABLED_BY_DEFAULT); -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Displays at least the decryptable and never saved logins in the password // manager BASE_FEATURE(kSkipUndecryptablePasswords, diff --git a/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.h b/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.h index eea34ad1ea4d..af5f22ab6cfe 100644 --- a/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.h +++ b/www/ungoogled-chromium/files/patch-components_password__manager_core_common_password__manager__features.h @@ -1,20 +1,20 @@ ---- components/password_manager/core/common/password_manager_features.h.orig 2023-04-08 11:38:38 UTC +--- components/password_manager/core/common/password_manager_features.h.orig 2023-05-05 12:12:41 UTC +++ components/password_manager/core/common/password_manager_features.h -@@ -35,7 +35,7 @@ BASE_DECLARE_FEATURE(kEnablePasswordGenerationForClear - BASE_DECLARE_FEATURE(kEnablePasswordManagerWithinFencedFrame); +@@ -42,7 +42,7 @@ BASE_DECLARE_FEATURE(kEnablePasswordManagerWithinFence BASE_DECLARE_FEATURE(kFillingAcrossAffiliatedWebsites); BASE_DECLARE_FEATURE(kFillOnAccountSelect); + BASE_DECLARE_FEATURE(kPasswordManagerLogToTerminal); -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) BASE_DECLARE_FEATURE(kForceInitialSyncWhenDecryptionFails); #endif BASE_DECLARE_FEATURE(kInferConfirmationPasswordField); -@@ -67,7 +67,7 @@ BASE_DECLARE_FEATURE(kRecoverFromNeverSaveAndroid); +@@ -75,7 +75,7 @@ BASE_DECLARE_FEATURE(kRecoverFromNeverSaveAndroid); #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) // Desktop BASE_DECLARE_FEATURE(kRevampedPasswordManagementBubble); #endif -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) BASE_DECLARE_FEATURE(kSkipUndecryptablePasswords); #endif #if BUILDFLAG(IS_ANDROID) diff --git a/www/ungoogled-chromium/files/patch-components_performance__manager_public_features.h b/www/ungoogled-chromium/files/patch-components_performance__manager_public_features.h index c5a9578df14d..b4f033874d9b 100644 --- a/www/ungoogled-chromium/files/patch-components_performance__manager_public_features.h +++ b/www/ungoogled-chromium/files/patch-components_performance__manager_public_features.h @@ -1,11 +1,11 @@ ---- components/performance_manager/public/features.h.orig 2022-12-02 17:56:32 UTC +--- components/performance_manager/public/features.h.orig 2023-05-05 12:12:41 UTC +++ components/performance_manager/public/features.h -@@ -20,7 +20,7 @@ BASE_DECLARE_FEATURE(kRunOnMainThread); +@@ -28,7 +28,7 @@ BASE_DECLARE_FEATURE(kRunOnDedicatedThreadPoolThread); #if !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #define URGENT_DISCARDING_FROM_PERFORMANCE_MANAGER() false #else #define URGENT_DISCARDING_FROM_PERFORMANCE_MANAGER() true diff --git a/www/ungoogled-chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc b/www/ungoogled-chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc index 92fae2bc5f6a..2a01a193027f 100644 --- a/www/ungoogled-chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc +++ b/www/ungoogled-chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc @@ -1,11 +1,11 @@ ---- components/policy/core/browser/policy_pref_mapping_test.cc.orig 2023-03-10 11:01:21 UTC +--- components/policy/core/browser/policy_pref_mapping_test.cc.orig 2023-05-05 12:12:41 UTC +++ components/policy/core/browser/policy_pref_mapping_test.cc -@@ -326,7 +326,7 @@ class PolicyTestCase { +@@ -327,7 +327,7 @@ class PolicyTestCase { const std::string os("chromeos_lacros"); #elif BUILDFLAG(IS_IOS) const std::string os("ios"); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const std::string os("linux"); #elif BUILDFLAG(IS_MAC) const std::string os("mac"); diff --git a/www/ungoogled-chromium/files/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc b/www/ungoogled-chromium/files/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc index 525ac7d1c7c2..4c7662e124e1 100644 --- a/www/ungoogled-chromium/files/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc +++ b/www/ungoogled-chromium/files/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc @@ -1,11 +1,11 @@ ---- components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc.orig 2022-10-01 07:40:07 UTC +--- components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc.orig 2023-05-05 12:12:41 UTC +++ components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc -@@ -113,7 +113,7 @@ std::ostream& operator<<(std::ostream& os, const ListI +@@ -114,7 +114,7 @@ std::ostream& operator<<(std::ostream& os, const ListI PlatformType GetCurrentPlatformType() { #if BUILDFLAG(IS_WIN) return WINDOWS_PLATFORM; -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return LINUX_PLATFORM; #elif BUILDFLAG(IS_IOS) return IOS_PLATFORM; diff --git a/www/ungoogled-chromium/files/patch-components_services_screen__ai_public_cpp_screen__ai__install__state.cc b/www/ungoogled-chromium/files/patch-components_services_screen__ai_public_cpp_screen__ai__install__state.cc new file mode 100644 index 000000000000..915ec75e97c0 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-components_services_screen__ai_public_cpp_screen__ai__install__state.cc @@ -0,0 +1,20 @@ +--- components/services/screen_ai/public/cpp/screen_ai_install_state.cc.orig 2023-05-05 12:12:41 UTC ++++ components/services/screen_ai/public/cpp/screen_ai_install_state.cc +@@ -17,7 +17,7 @@ + #include "components/services/screen_ai/public/cpp/utilities.h" + #include "ui/accessibility/accessibility_features.h" + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "base/cpu.h" + #endif + +@@ -31,7 +31,7 @@ namespace { + bool IsDeviceCompatible() { + // Check if the CPU has the required instruction set to run the Screen AI + // library. +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + if (!base::CPU().has_sse41()) { + return false; + } diff --git a/www/ungoogled-chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h index 69f6c508cfc3..f06a30eb3986 100644 --- a/www/ungoogled-chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h @@ -1,16 +1,16 @@ ---- components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h.orig 2022-10-01 07:40:07 UTC +--- components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ 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" ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace screen_ai { diff --git a/www/ungoogled-chromium/files/patch-components_translate_core_browser_translate__ui__languages__manager.h b/www/ungoogled-chromium/files/patch-components_translate_core_browser_translate__ui__languages__manager.h new file mode 100644 index 000000000000..66dbc6ce8f2b --- /dev/null +++ b/www/ungoogled-chromium/files/patch-components_translate_core_browser_translate__ui__languages__manager.h @@ -0,0 +1,10 @@ +--- components/translate/core/browser/translate_ui_languages_manager.h.orig 2023-05-05 12:12:41 UTC ++++ components/translate/core/browser/translate_ui_languages_manager.h +@@ -8,6 +8,7 @@ + #include + + #include ++#include + + #include "base/memory/weak_ptr.h" + #include "third_party/icu/source/i18n/unicode/coll.h" diff --git a/www/ungoogled-chromium/files/patch-components_variations_service_variations__service.cc b/www/ungoogled-chromium/files/patch-components_variations_service_variations__service.cc index 5d7aca221358..0754bd72840f 100644 --- a/www/ungoogled-chromium/files/patch-components_variations_service_variations__service.cc +++ b/www/ungoogled-chromium/files/patch-components_variations_service_variations__service.cc @@ -1,11 +1,11 @@ ---- components/variations/service/variations_service.cc.orig 2022-12-02 17:56:32 UTC +--- components/variations/service/variations_service.cc.orig 2023-05-05 12:12:41 UTC +++ components/variations/service/variations_service.cc -@@ -95,7 +95,7 @@ std::string GetPlatformString() { +@@ -94,7 +94,7 @@ std::string GetPlatformString() { return "android"; #elif BUILDFLAG(IS_FUCHSIA) return "fuchsia"; -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || BUILDFLAG(IS_SOLARIS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_BSD) // Default BSD and SOLARIS to Linux to not break those builds, although these // platforms are not officially supported by Chrome. return "linux"; diff --git a/www/ungoogled-chromium/files/patch-components_version__info_version__info.cc b/www/ungoogled-chromium/files/patch-components_version__info_version__info.cc new file mode 100644 index 000000000000..a75c7b4b969a --- /dev/null +++ b/www/ungoogled-chromium/files/patch-components_version__info_version__info.cc @@ -0,0 +1,131 @@ +--- components/version_info/version_info.cc.orig 2023-05-05 12:12:41 UTC ++++ components/version_info/version_info.cc +@@ -4,15 +4,26 @@ + + #include "components/version_info/version_info.h" + +-#include +- ++#include "base/check.h" + #include "base/no_destructor.h" ++#include "base/notreached.h" ++#include "base/sanitizer_buildflags.h" + #include "base/strings/strcat.h" + #include "base/strings/string_number_conversions.h" + #include "base/version.h" ++#include "build/branding_buildflags.h" ++#include "build/build_config.h" ++#include "build/chromeos_buildflags.h" ++#include "components/version_info/version_info_values.h" + + namespace version_info { + ++const std::string& GetProductNameAndVersionForUserAgent() { ++ static const base::NoDestructor product_and_version( ++ "Chrome/" + GetVersionNumber()); ++ return *product_and_version; ++} ++ + const std::string GetProductNameAndVersionForReducedUserAgent( + const std::string& build_version) { + std::string product_and_version; +@@ -21,6 +32,14 @@ const std::string GetProductNameAndVersionForReducedUs + return product_and_version; + } + ++std::string GetProductName() { ++ return PRODUCT_NAME; ++} ++ ++std::string GetVersionNumber() { ++ return PRODUCT_VERSION; ++} ++ + int GetMajorVersionNumberAsInt() { + DCHECK(GetVersion().IsValid()); + return GetVersion().components()[0]; +@@ -33,6 +52,84 @@ std::string GetMajorVersionNumber() { + const base::Version& GetVersion() { + static const base::NoDestructor version(GetVersionNumber()); + return *version; ++} ++ ++std::string GetLastChange() { ++ return LAST_CHANGE; ++} ++ ++bool IsOfficialBuild() { ++ return IS_OFFICIAL_BUILD; ++} ++ ++std::string GetOSType() { ++#if BUILDFLAG(IS_WIN) ++ return "Windows"; ++#elif BUILDFLAG(IS_IOS) ++ return "iOS"; ++#elif BUILDFLAG(IS_MAC) ++ return "Mac OS X"; ++#elif BUILDFLAG(IS_CHROMEOS) ++# if BUILDFLAG(GOOGLE_CHROME_BRANDING) ++ return "ChromeOS"; ++# else ++ return "ChromiumOS"; ++# endif ++#elif BUILDFLAG(IS_ANDROID) ++ return "Android"; ++#elif BUILDFLAG(IS_LINUX) ++ return "Linux"; ++#elif BUILDFLAG(IS_FREEBSD) ++ return "FreeBSD"; ++#elif BUILDFLAG(IS_OPENBSD) ++ return "OpenBSD"; ++#elif BUILDFLAG(IS_SOLARIS) ++ return "Solaris"; ++#elif BUILDFLAG(IS_FUCHSIA) ++ return "Fuchsia"; ++#else ++ return "Unknown"; ++#endif ++} ++ ++std::string GetChannelString(Channel channel) { ++ switch (channel) { ++ case Channel::STABLE: ++ return "stable"; ++ case Channel::BETA: ++ return "beta"; ++ case Channel::DEV: ++ return "dev"; ++ case Channel::CANARY: ++ return "canary"; ++ case Channel::UNKNOWN: ++ return "unknown"; ++ } ++ NOTREACHED(); ++ return std::string(); ++} ++ ++std::string GetSanitizerList() { ++ std::string sanitizers; ++#if defined(ADDRESS_SANITIZER) ++ sanitizers += "address "; ++#endif ++#if BUILDFLAG(IS_HWASAN) ++ sanitizers += "hwaddress "; ++#endif ++#if defined(LEAK_SANITIZER) ++ sanitizers += "leak "; ++#endif ++#if defined(MEMORY_SANITIZER) ++ sanitizers += "memory "; ++#endif ++#if defined(THREAD_SANITIZER) ++ sanitizers += "thread "; ++#endif ++#if defined(UNDEFINED_SANITIZER) ++ sanitizers += "undefined "; ++#endif ++ return sanitizers; + } + + } // namespace version_info diff --git a/www/ungoogled-chromium/files/patch-components_version__info_version__info.h b/www/ungoogled-chromium/files/patch-components_version__info_version__info.h new file mode 100644 index 000000000000..335d9e3557d6 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-components_version__info_version__info.h @@ -0,0 +1,145 @@ +--- components/version_info/version_info.h.orig 2023-05-05 12:12:41 UTC ++++ components/version_info/version_info.h +@@ -7,12 +7,7 @@ + + #include + +-#include "base/notreached.h" +-#include "base/sanitizer_buildflags.h" +-#include "build/branding_buildflags.h" +-#include "build/build_config.h" + #include "components/version_info/channel.h" +-#include "components/version_info/version_info_values.h" + + namespace base { + class Version; +@@ -20,6 +15,10 @@ class Version; + + namespace version_info { + ++// Returns the product name and version information for the User-Agent header, ++// in the format: Chrome/.... ++const std::string& GetProductNameAndVersionForUserAgent(); ++ + // Returns the product name and reduced version information for the User-Agent + // header, in the format: Chrome/.0.build_version.0, where + // `build_version` is a frozen BUILD number. +@@ -27,21 +26,11 @@ const std::string GetProductNameAndVersionForReducedUs + const std::string& build_version); + + // Returns the product name, e.g. "Chromium" or "Google Chrome". +-constexpr std::string GetProductName() { +- return PRODUCT_NAME; +-} ++std::string GetProductName(); + + // Returns the version number, e.g. "6.0.490.1". +-constexpr std::string GetVersionNumber() { +- return PRODUCT_VERSION; +-} ++std::string GetVersionNumber(); + +-// Returns the product name and version information for the User-Agent header, +-// in the format: Chrome/.... +-constexpr std::string GetProductNameAndVersionForUserAgent() { +- return "Chrome/" + GetVersionNumber(); +-} +- + // Returns the major component (aka the milestone) of the version as an int, + // e.g. 6 when the version is "6.0.490.1". + int GetMajorVersionNumberAsInt(); +@@ -53,89 +42,22 @@ std::string GetMajorVersionNumber(); + const base::Version& GetVersion(); + + // Returns a version control specific identifier of this release. +-constexpr std::string GetLastChange() { +- return LAST_CHANGE; +-} ++std::string GetLastChange(); + + // Returns whether this is an "official" release of the current version, i.e. + // whether knowing GetVersionNumber() is enough to completely determine what + // GetLastChange() is. +-constexpr bool IsOfficialBuild() { +- return IS_OFFICIAL_BUILD; +-} ++bool IsOfficialBuild(); + + // Returns the OS type, e.g. "Windows", "Linux", "FreeBSD", ... +-constexpr std::string GetOSType() { +-#if BUILDFLAG(IS_WIN) +- return "Windows"; +-#elif BUILDFLAG(IS_IOS) +- return "iOS"; +-#elif BUILDFLAG(IS_MAC) +- return "Mac OS X"; +-#elif BUILDFLAG(IS_CHROMEOS) +-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) +- return "ChromeOS"; +-#else +- return "ChromiumOS"; +-#endif +-#elif BUILDFLAG(IS_ANDROID) +- return "Android"; +-#elif BUILDFLAG(IS_LINUX) +- return "Linux"; +-#elif BUILDFLAG(IS_FREEBSD) +- return "FreeBSD"; +-#elif BUILDFLAG(IS_OPENBSD) +- return "OpenBSD"; +-#elif BUILDFLAG(IS_SOLARIS) +- return "Solaris"; +-#elif BUILDFLAG(IS_FUCHSIA) +- return "Fuchsia"; +-#else +- return "Unknown"; +-#endif +-} ++std::string GetOSType(); + + // Returns a string equivalent of |channel|, independent of whether the build + // is branded or not and without any additional modifiers. +-constexpr std::string GetChannelString(Channel channel) { +- switch (channel) { +- case Channel::STABLE: +- return "stable"; +- case Channel::BETA: +- return "beta"; +- case Channel::DEV: +- return "dev"; +- case Channel::CANARY: +- return "canary"; +- case Channel::UNKNOWN: +- return "unknown"; +- } +- NOTREACHED_NORETURN(); +-} ++std::string GetChannelString(Channel channel); + + // Returns a list of sanitizers enabled in this build. +-constexpr std::string GetSanitizerList() { +- return "" +-#if defined(ADDRESS_SANITIZER) +- "address " +-#endif +-#if BUILDFLAG(IS_HWASAN) +- "hwaddress " +-#endif +-#if defined(LEAK_SANITIZER) +- "leak " +-#endif +-#if defined(MEMORY_SANITIZER) +- "memory " +-#endif +-#if defined(THREAD_SANITIZER) +- "thread " +-#endif +-#if defined(UNDEFINED_SANITIZER) +- "undefined " +-#endif +- ; +-} ++std::string GetSanitizerList(); + + } // namespace version_info + diff --git a/www/ungoogled-chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc b/www/ungoogled-chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc index 8a2edf4e9da5..1382d9d0fe91 100644 --- a/www/ungoogled-chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc +++ b/www/ungoogled-chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc @@ -1,11 +1,11 @@ ---- components/viz/service/display_embedder/skia_output_surface_impl.cc.orig 2023-03-10 11:01:21 UTC +--- components/viz/service/display_embedder/skia_output_surface_impl.cc.orig 2023-05-05 12:12:41 UTC +++ components/viz/service/display_embedder/skia_output_surface_impl.cc -@@ -1259,7 +1259,7 @@ GrBackendFormat SkiaOutputSurfaceImpl::GetGrBackendFor +@@ -1279,7 +1279,7 @@ GrBackendFormat SkiaOutputSurfaceImpl::GetGrBackendFor ->GetDeviceQueue() ->GetVulkanPhysicalDevice(), VK_IMAGE_TILING_OPTIMAL, ycbcr_info); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Textures that were allocated _on linux_ with ycbcr info came from // VaapiVideoDecoder, which exports using DRM format modifiers. return GrBackendFormat::MakeVk(gr_ycbcr_info, diff --git a/www/ungoogled-chromium/files/patch-components_viz_service_display_skia__renderer.cc b/www/ungoogled-chromium/files/patch-components_viz_service_display_skia__renderer.cc index ac069492ab4e..fc18439b5828 100644 --- a/www/ungoogled-chromium/files/patch-components_viz_service_display_skia__renderer.cc +++ b/www/ungoogled-chromium/files/patch-components_viz_service_display_skia__renderer.cc @@ -1,11 +1,11 @@ ---- components/viz/service/display/skia_renderer.cc.orig 2023-03-10 11:01:21 UTC +--- components/viz/service/display/skia_renderer.cc.orig 2023-05-05 12:12:41 UTC +++ components/viz/service/display/skia_renderer.cc -@@ -1149,7 +1149,7 @@ void SkiaRenderer::ClearFramebuffer() { +@@ -1158,7 +1158,7 @@ void SkiaRenderer::ClearFramebuffer() { if (current_frame()->current_render_pass->has_transparent_background) { ClearCanvas(SkColors::kTransparent); } else { -#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX) +#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) // On DEBUG builds, opaque render passes are cleared to blue // to easily see regions that were not drawn on the screen. // ClearCavas() call causes slight pixel difference, so linux-ref and diff --git a/www/ungoogled-chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc b/www/ungoogled-chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc index 3d300dd50d18..de04d91abac2 100644 --- a/www/ungoogled-chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc +++ b/www/ungoogled-chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc @@ -1,20 +1,20 @@ ---- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc.orig 2023-03-10 11:01:21 UTC +--- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc.orig 2023-05-05 12:12:41 UTC +++ components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc -@@ -98,7 +98,7 @@ RootCompositorFrameSinkImpl::Create( +@@ -102,7 +102,7 @@ RootCompositorFrameSinkImpl::Create( // 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) // For X11, we need notify client about swap completion after resizing, so the // client can use it for synchronize with X11 WM. output_surface->SetNeedsSwapSizeNotifications(true); -@@ -585,7 +585,7 @@ void RootCompositorFrameSinkImpl::DisplayDidCompleteSw +@@ -607,7 +607,7 @@ void RootCompositorFrameSinkImpl::DisplayDidCompleteSw display_client_->DidCompleteSwapWithSize(pixel_size); // 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) if (display_client_ && pixel_size != last_swap_pixel_size_) { last_swap_pixel_size_ = pixel_size; display_client_->DidCompleteSwapWithNewSize(last_swap_pixel_size_); diff --git a/www/ungoogled-chromium/files/patch-content_app_content__main__runner__impl.cc b/www/ungoogled-chromium/files/patch-content_app_content__main__runner__impl.cc index 26313b5dc065..0b4ba508373d 100644 --- a/www/ungoogled-chromium/files/patch-content_app_content__main__runner__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_app_content__main__runner__impl.cc @@ -1,130 +1,122 @@ ---- content/app/content_main_runner_impl.cc.orig 2023-04-08 11:38:38 UTC +--- content/app/content_main_runner_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/app/content_main_runner_impl.cc @@ -139,13 +139,13 @@ #include "content/browser/posix_file_descriptor_info_impl.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/files/file_path_watcher_inotify.h" #include "base/native_library.h" #include "base/rand_util.h" -@@ -186,6 +186,10 @@ - #include "media/base/media_switches.h" +@@ -188,6 +188,10 @@ + #include "chromeos/startup/startup_switches.h" #endif +#if BUILDFLAG(IS_BSD) +#include "base/system/sys_info.h" +#endif + #if BUILDFLAG(IS_ANDROID) #include "base/system/sys_info.h" #include "content/browser/android/battery_metrics.h" -@@ -371,7 +375,7 @@ void InitializeZygoteSandboxForBrowserProcess( +@@ -389,7 +393,7 @@ void InitializeZygoteSandboxForBrowserProcess( } #endif // BUILDFLAG(USE_ZYGOTE) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #if BUILDFLAG(ENABLE_PPAPI) // Loads the (native) libraries but does not initialize them (i.e., does not -@@ -407,15 +411,17 @@ void PreloadLibraryCdms() { - } - #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) +@@ -427,7 +431,10 @@ void PreloadLibraryCdms() { --#if BUILDFLAG(USE_ZYGOTE) -+#if BUILDFLAG(USE_ZYGOTE) || BUILDFLAG(IS_BSD) void PreSandboxInit() { - // Pre-acquire resources needed by BoringSSL. See + // Ensure the /dev/urandom is opened. ++ // we use arc4random ++#if !BUILDFLAG(IS_BSD) + base::GetUrandomFD(); ++#endif + + // May use sysinfo(), sched_getaffinity(), and open various /sys/ and /proc/ + // files. +@@ -438,9 +445,16 @@ void PreSandboxInit() { // https://boringssl.9oo91esource.qjz9zk/boringssl/+/HEAD/SANDBOXING.md CRYPTO_pre_sandbox_init(); ++#if BUILDFLAG(IS_BSD) ++ // "cache" the amount of physical memory before pledge(2) ++ base::SysInfo::AmountOfPhysicalMemoryMB(); ++#endif ++ +#if !BUILDFLAG(IS_BSD) // Pre-read /proc/sys/fs/inotify/max_user_watches so it doesn't have to be // allowed by the sandbox. base::GetMaxNumberOfInotifyWatches(); +#endif #if BUILDFLAG(ENABLE_PPAPI) // Ensure access to the Pepper plugins before the sandbox is turned on. -@@ -434,6 +440,11 @@ void PreSandboxInit() { - } - #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. -@@ -621,7 +632,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 - -@@ -824,11 +835,10 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam +@@ -810,11 +824,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) -@@ -1023,6 +1033,16 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam +@@ -1002,8 +1015,20 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam + process_type == switches::kZygoteProcess) { + PreSandboxInit(); } ++#elif BUILDFLAG(IS_BSD) ++ PreSandboxInit(); #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) -@@ -1090,7 +1110,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { +@@ -1071,7 +1096,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { ->ReconfigureAfterFeatureListInit(process_type); } -#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 -@@ -1128,6 +1148,11 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { +@@ -1106,6 +1131,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); diff --git a/www/ungoogled-chromium/files/patch-content_browser_BUILD.gn b/www/ungoogled-chromium/files/patch-content_browser_BUILD.gn index c62e7f7d5c31..90c746766136 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-content_browser_BUILD.gn @@ -1,16 +1,16 @@ ---- content/browser/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- content/browser/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ content/browser/BUILD.gn -@@ -2360,6 +2360,13 @@ source_set("browser") { +@@ -2366,6 +2366,13 @@ source_set("browser") { ] } + if (is_bsd) { + sources -= [ + "sandbox_ipc_linux.cc", + "sandbox_ipc_linux.h", + ] + } + if (is_chromeos) { sources += [ "handwriting/handwriting_recognition_service_impl_cros.cc", diff --git a/www/ungoogled-chromium/files/patch-content_browser_browser__child__process__host__impl.cc b/www/ungoogled-chromium/files/patch-content_browser_browser__child__process__host__impl.cc index 629fffe50f60..4260c6e32f40 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_browser__child__process__host__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_browser_browser__child__process__host__impl.cc @@ -1,10 +1,10 @@ ---- content/browser/browser_child_process_host_impl.cc.orig 2022-12-02 17:56:32 UTC +--- content/browser/browser_child_process_host_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/browser/browser_child_process_host_impl.cc -@@ -316,6 +316,7 @@ void BrowserChildProcessHostImpl::LaunchWithoutExtraCo +@@ -319,6 +319,7 @@ void BrowserChildProcessHostImpl::LaunchWithoutExtraCo switches::kDisableBestEffortTasks, switches::kDisableLogging, switches::kEnableLogging, + switches::kDisableUnveil, switches::kIPCConnectionTimeout, switches::kLogBestEffortTasks, switches::kLogFile, diff --git a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl.cc b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl.cc new file mode 100644 index 000000000000..b2bec303cd20 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl.cc @@ -0,0 +1,11 @@ +--- content/browser/gpu/gpu_data_manager_impl.cc.orig 2023-05-05 12:12:41 UTC ++++ content/browser/gpu/gpu_data_manager_impl.cc +@@ -405,7 +405,7 @@ void GpuDataManagerImpl::OnDisplayMetricsChanged( + private_->OnDisplayMetricsChanged(display, changed_metrics); + } + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + bool GpuDataManagerImpl::IsGpuMemoryBufferNV12Supported() { + base::AutoLock auto_lock(lock_); + return private_->IsGpuMemoryBufferNV12Supported(); diff --git a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl.h b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl.h new file mode 100644 index 000000000000..cd96ff8634a3 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl.h @@ -0,0 +1,11 @@ +--- content/browser/gpu/gpu_data_manager_impl.h.orig 2023-05-05 12:12:41 UTC ++++ content/browser/gpu/gpu_data_manager_impl.h +@@ -221,7 +221,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDa + void OnDisplayMetricsChanged(const display::Display& display, + uint32_t changed_metrics) override; + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + bool IsGpuMemoryBufferNV12Supported(); + void SetGpuMemoryBufferNV12Supported(bool supported); + #endif // BUILDFLAG(IS_LINUX) diff --git a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc new file mode 100644 index 000000000000..69787cf00f46 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc @@ -0,0 +1,11 @@ +--- content/browser/gpu/gpu_data_manager_impl_private.cc.orig 2023-05-05 12:12:41 UTC ++++ content/browser/gpu/gpu_data_manager_impl_private.cc +@@ -1723,7 +1723,7 @@ void GpuDataManagerImplPrivate::RecordCompositingMode( + UMA_HISTOGRAM_ENUMERATION("GPU.CompositingMode", compositing_mode); + } + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + bool GpuDataManagerImplPrivate::IsGpuMemoryBufferNV12Supported() { + return is_gpu_memory_buffer_NV12_supported_; + } diff --git a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.h b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.h new file mode 100644 index 000000000000..20760fd7294f --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.h @@ -0,0 +1,20 @@ +--- content/browser/gpu/gpu_data_manager_impl_private.h.orig 2023-05-05 12:12:41 UTC ++++ content/browser/gpu/gpu_data_manager_impl_private.h +@@ -151,7 +151,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { + void OnDisplayMetricsChanged(const display::Display& display, + uint32_t changed_metrics); + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + bool IsGpuMemoryBufferNV12Supported(); + void SetGpuMemoryBufferNV12Supported(bool supported); + #endif // BUILDFLAG(IS_LINUX) +@@ -307,7 +307,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { + bool application_is_visible_ = true; + + bool disable_gpu_compositing_ = false; +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + bool is_gpu_memory_buffer_NV12_supported_ = false; + #endif // BUILDFLAG(IS_LINUX) + }; diff --git a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc new file mode 100644 index 000000000000..9d1337f16cbb --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc @@ -0,0 +1,20 @@ +--- content/browser/gpu/gpu_memory_buffer_manager_singleton.cc.orig 2023-05-05 12:12:41 UTC ++++ content/browser/gpu/gpu_memory_buffer_manager_singleton.cc +@@ -53,7 +53,7 @@ scoped_refptr GetTaskRun + #endif + } + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + bool IsGpuMemoryBufferNV12Supported() { + static bool is_computed = false; + static bool supported = false; +@@ -116,7 +116,7 @@ void GpuMemoryBufferManagerSingleton::OnGpuExtraInfoUp + SetNativeConfigurations(std::move(configs)); + } + #endif +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + // Dynamic check whether the NV12 format is supported as it may be + // inconsistent between the system GBM (Generic Buffer Management) and + // chromium miniGBM. diff --git a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__process__host.cc b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__process__host.cc index e6be318f7e82..68cdd01790a8 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__process__host.cc +++ b/www/ungoogled-chromium/files/patch-content_browser_gpu_gpu__process__host.cc @@ -1,19 +1,19 @@ ---- content/browser/gpu/gpu_process_host.cc.orig 2023-04-08 11:38:38 UTC +--- content/browser/gpu/gpu_process_host.cc.orig 2023-05-05 12:12:41 UTC +++ content/browser/gpu/gpu_process_host.cc -@@ -250,6 +250,7 @@ static const char* const kSwitchNames[] = { +@@ -252,6 +252,7 @@ static const char* const kSwitchNames[] = { switches::kEnableBackgroundThreadPool, switches::kEnableGpuRasterization, switches::kEnableLogging, + switches::kDisableUnveil, switches::kDoubleBufferCompositing, switches::kHeadless, switches::kLoggingLevel, -@@ -281,7 +282,7 @@ static const char* const kSwitchNames[] = { +@@ -285,7 +286,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 diff --git a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_back__forward__cache__impl.cc b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_back__forward__cache__impl.cc index e1361991b3b4..a41a6aea5248 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_back__forward__cache__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_back__forward__cache__impl.cc @@ -1,11 +1,11 @@ ---- content/browser/renderer_host/back_forward_cache_impl.cc.orig 2023-03-10 11:01:21 UTC +--- content/browser/renderer_host/back_forward_cache_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/browser/renderer_host/back_forward_cache_impl.cc -@@ -56,7 +56,7 @@ BASE_FEATURE(kBackForwardCacheSize, +@@ -57,7 +57,7 @@ BASE_FEATURE(kBackForwardCacheSize, // Sets the BackForwardCache size for desktop. // See crbug.com/1291435. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT diff --git a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc index 8fe1e595026b..e11b0425e748 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc @@ -1,64 +1,64 @@ ---- content/browser/renderer_host/render_process_host_impl.cc.orig 2023-04-08 11:38:38 UTC +--- content/browser/renderer_host/render_process_host_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -215,7 +215,7 @@ +@@ -216,7 +216,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 #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck -@@ -1145,7 +1145,7 @@ static constexpr size_t kUnknownPlatformProcessLimit = +@@ -1150,7 +1150,7 @@ static constexpr size_t kUnknownPlatformProcessLimit = // to indicate failure and std::numeric_limits::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; -@@ -1237,7 +1237,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public +@@ -1242,7 +1242,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()) { ConnectToFontService(std::move(font_receiver)); return; -@@ -1326,7 +1326,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public +@@ -1331,7 +1331,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public std::unique_ptr binders_; mojo::Receiver receiver_{this}; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) mojo::Remote video_encode_accelerator_factory_remote_; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -2155,7 +2155,7 @@ void RenderProcessHostImpl::ReinitializeLogging( +@@ -2157,7 +2157,7 @@ void RenderProcessHostImpl::ReinitializeLogging( } #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void RenderProcessHostImpl::CreateStableVideoDecoder( mojo::PendingReceiver receiver) { DCHECK_CURRENTLY_ON(BrowserThread::UI); -@@ -3331,6 +3331,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLin +@@ -3356,6 +3356,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLin switches::kDisableSpeechAPI, switches::kDisableThreadedCompositing, switches::kDisableTouchDragDrop, + switches::kDisableUnveil, switches::kDisableUseMojoVideoDecoderForPepper, switches::kDisableV8IdleTasks, switches::kDisableVideoCaptureUseGpuMemoryBuffer, -@@ -4814,7 +4815,7 @@ void RenderProcessHostImpl::ResetIPC() { +@@ -4859,7 +4860,7 @@ void RenderProcessHostImpl::ResetIPC() { coordinator_connector_receiver_.reset(); tracing_registration_.reset(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) stable_video_decoder_factory_remote_.reset(); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) diff --git a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h index c413d4f88997..7a029d44e6bd 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h +++ b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h @@ -1,38 +1,38 @@ ---- content/browser/renderer_host/render_process_host_impl.h.orig 2023-03-10 11:01:21 UTC +--- content/browser/renderer_host/render_process_host_impl.h.orig 2023-05-05 12:12:41 UTC +++ content/browser/renderer_host/render_process_host_impl.h @@ -85,7 +85,7 @@ #include "content/public/browser/android/child_process_importance.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "media/mojo/mojom/stable/stable_video_decoder.mojom.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -490,7 +490,7 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -498,7 +498,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) -@@ -699,7 +699,7 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -707,7 +707,7 @@ class CONTENT_EXPORT RenderProcessHostImpl mojo::PendingReceiver receiver) override; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void CreateStableVideoDecoder( mojo::PendingReceiver receiver) override; -@@ -1171,7 +1171,7 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -1182,7 +1182,7 @@ class CONTENT_EXPORT RenderProcessHostImpl // RenderProcessHost. This is destroyed early in ResetIPC() method. std::unique_ptr permission_service_context_; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Connection to the StableVideoDecoderFactory that lives in a utility // process. This is only used for out-of-process video decoding. mojo::Remote diff --git a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc index 75273f8c55f4..2fb0506b2936 100644 --- a/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc +++ b/www/ungoogled-chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc @@ -1,47 +1,47 @@ ---- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2023-04-08 11:38:38 UTC +--- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2023-05-05 12:12:41 UTC +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -119,7 +119,7 @@ #include "ui/gfx/gdi_util.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "content/browser/accessibility/browser_accessibility_auralinux.h" #include "ui/base/ime/linux/text_edit_command_auralinux.h" #include "ui/linux/linux_ui.h" @@ -452,7 +452,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewAura::Ge return ToBrowserAccessibilityWin(manager->GetBrowserAccessibilityRoot()) ->GetCOM(); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) BrowserAccessibilityManager* manager = host()->GetOrCreateRootBrowserAccessibilityManager(); if (manager && manager->GetBrowserAccessibilityRoot()) -@@ -1588,7 +1588,7 @@ bool RenderWidgetHostViewAura::ShouldDoLearning() { +@@ -1597,7 +1597,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_ime_text_spans) { -@@ -2420,7 +2420,7 @@ bool RenderWidgetHostViewAura::NeedsInputGrab() { +@@ -2429,7 +2429,7 @@ bool RenderWidgetHostViewAura::NeedsInputGrab() { } 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; -@@ -2597,7 +2597,7 @@ void RenderWidgetHostViewAura::ForwardKeyboardEventWit +@@ -2606,7 +2606,7 @@ void RenderWidgetHostViewAura::ForwardKeyboardEventWit if (!target_host) return; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto* linux_ui = ui::LinuxUi::instance(); std::vector commands; if (!event.skip_in_browser && linux_ui && event.os_event && diff --git a/www/ungoogled-chromium/files/patch-content_child_child__process.cc b/www/ungoogled-chromium/files/patch-content_child_child__process.cc index 549d9c537bf5..45e9ff86901b 100644 --- a/www/ungoogled-chromium/files/patch-content_child_child__process.cc +++ b/www/ungoogled-chromium/files/patch-content_child_child__process.cc @@ -1,11 +1,11 @@ ---- content/child/child_process.cc.orig 2022-10-01 07:40:07 UTC +--- content/child/child_process.cc.orig 2023-05-05 12:12:41 UTC +++ content/child/child_process.cc -@@ -68,7 +68,7 @@ ChildProcess::ChildProcess(base::ThreadType io_thread_ - DCHECK(!g_lazy_child_process_tls.Pointer()->Get()); - g_lazy_child_process_tls.Pointer()->Set(this); - +@@ -63,7 +63,7 @@ ChildProcess::ChildProcess(base::ThreadType io_thread_ + thread_pool_init_params) + : resetter_(&child_process, this, nullptr), + io_thread_(std::make_unique()) { -#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 = diff --git a/www/ungoogled-chromium/files/patch-content_common_BUILD.gn b/www/ungoogled-chromium/files/patch-content_common_BUILD.gn index 52836d0a0a38..a0a1c2246642 100644 --- a/www/ungoogled-chromium/files/patch-content_common_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-content_common_BUILD.gn @@ -1,21 +1,21 @@ ---- content/common/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- content/common/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ content/common/BUILD.gn -@@ -432,6 +432,9 @@ if (is_linux || is_chromeos) { +@@ -430,6 +430,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" ] + } } } -@@ -480,7 +483,7 @@ mojom("mojo_bindings") { +@@ -475,7 +478,7 @@ mojom("mojo_bindings") { if (enable_ipc_logging) { enabled_features += [ "ipc_logging" ] } - if (is_linux || is_chromeos) { + if (!is_bsd && (is_linux || is_chromeos)) { enabled_features += [ "supports_thread_types" ] } if (use_clang_profiling_inside_sandbox) { diff --git a/www/ungoogled-chromium/files/patch-content_gpu_BUILD.gn b/www/ungoogled-chromium/files/patch-content_gpu_BUILD.gn new file mode 100644 index 000000000000..cb6eda53fcdc --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_gpu_BUILD.gn @@ -0,0 +1,20 @@ +--- content/gpu/BUILD.gn.orig 2023-05-05 12:12:41 UTC ++++ content/gpu/BUILD.gn +@@ -102,6 +102,17 @@ target(link_target_type, "gpu_sources") { + } + } + ++ if (is_bsd) { ++ sources -= [ ++ "gpu_sandbox_hook_linux.cc", ++ "gpu_sandbox_hook_linux.h", ++ ] ++ sources += [ ++ "gpu_sandbox_hook_bsd.cc", ++ "gpu_sandbox_hook_bsd.h", ++ ] ++ } ++ + if (is_chromeos_ash) { + deps += [ + "//components/services/font/public/cpp", diff --git a/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__bsd.cc b/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__bsd.cc new file mode 100644 index 000000000000..6cb80ac48962 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__bsd.cc @@ -0,0 +1,72 @@ +--- content/gpu/gpu_sandbox_hook_bsd.cc.orig 2023-05-05 12:12:41 UTC ++++ content/gpu/gpu_sandbox_hook_bsd.cc +@@ -0,0 +1,69 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "content/gpu/gpu_sandbox_hook_bsd.h" ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "base/base_paths.h" ++#include "base/files/file_enumerator.h" ++#include "base/files/file_path.h" ++#include "base/files/scoped_file.h" ++#include "base/functional/bind.h" ++#include "base/logging.h" ++#include "base/path_service.h" ++#include "base/strings/stringprintf.h" ++#include "build/build_config.h" ++#include "build/buildflag.h" ++#include "build/chromeos_buildflags.h" ++#include "content/common/set_process_title.h" ++#include "content/public/common/content_switches.h" ++#include "media/gpu/buildflags.h" ++ ++namespace content { ++namespace { ++ ++constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE; ++ ++void LoadVulkanLibraries() { ++ // Try to preload Vulkan libraries. Failure is not an error as not all may be ++ // present. ++ const char* kLibraries[] = { ++ "libvulkan.so", ++ "libvulkan_intel.so", ++ "libvulkan_intel_hasvk.so", ++ "libvulkan_radeon.so", ++ }; ++ for (const auto* library : kLibraries) { ++ dlopen(library, dlopen_flag); ++ } ++} ++ ++bool LoadLibrariesForGpu( ++ const sandbox::policy::SandboxSeccompBPF::Options& options) { ++ LoadVulkanLibraries(); ++ ++ return true; ++} ++ ++} // namespace ++ ++bool GpuProcessPreSandboxHook(sandbox::policy::SandboxLinux::Options options) { ++ if (!LoadLibrariesForGpu(options)) ++ return false; ++ ++ // TODO(tsepez): enable namspace sandbox here once crashes are understood. ++ ++ errno = 0; ++ return true; ++} ++ ++} // namespace content diff --git a/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__bsd.h b/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__bsd.h new file mode 100644 index 000000000000..253d32561200 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__bsd.h @@ -0,0 +1,19 @@ +--- content/gpu/gpu_sandbox_hook_bsd.h.orig 2023-05-05 12:12:41 UTC ++++ content/gpu/gpu_sandbox_hook_bsd.h +@@ -0,0 +1,16 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef CONTENT_GPU_GPU_SANDBOX_HOOK_BSD_H_ ++#define CONTENT_GPU_GPU_SANDBOX_HOOK_BSD_H_ ++ ++#include "sandbox/policy/sandbox.h" ++ ++namespace content { ++ ++bool GpuProcessPreSandboxHook(sandbox::policy::SandboxLinux::Options options); ++ ++} // namespace content ++ ++#endif // CONTENT_GPU_GPU_SANDBOX_HOOK_BSD_H_ diff --git a/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc b/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc deleted file mode 100644 index f53b9d8c2154..000000000000 --- a/www/ungoogled-chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc +++ /dev/null @@ -1,70 +0,0 @@ ---- content/gpu/gpu_sandbox_hook_linux.cc.orig 2023-04-08 11:38:38 UTC -+++ content/gpu/gpu_sandbox_hook_linux.cc -@@ -126,6 +126,7 @@ void AddStandardChromeOsPermissions( - } - } - -+#if !defined(OS_BSD) - void AddV4L2GpuPermissions( - std::vector* permissions, - const sandbox::policy::SandboxSeccompBPF::Options& options) { -@@ -484,8 +485,10 @@ std::vector FilePermissionsForGp - AddStandardGpuPermissions(&permissions); - return permissions; - } -+#endif - - void LoadArmGpuLibraries() { -+#if !defined(OS_BSD) - // Preload the Mali library. - if (UseChromecastSandboxAllowlist()) { - for (const char* path : kAllowedChromecastPaths) { -@@ -530,6 +533,7 @@ void LoadArmGpuLibraries() { - dlopen(driver_paths[i], dlopen_flag); - } - } -+#endif - } - - bool LoadAmdGpuLibraries() { -@@ -597,12 +601,14 @@ void LoadV4L2Libraries( - } - - 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( -@@ -629,6 +635,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; -@@ -652,13 +659,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; diff --git a/www/ungoogled-chromium/files/patch-content_ppapi__plugin_ppapi__plugin__main.cc b/www/ungoogled-chromium/files/patch-content_ppapi__plugin_ppapi__plugin__main.cc index e0494472ed22..9b62f7412c07 100644 --- a/www/ungoogled-chromium/files/patch-content_ppapi__plugin_ppapi__plugin__main.cc +++ b/www/ungoogled-chromium/files/patch-content_ppapi__plugin_ppapi__plugin__main.cc @@ -1,23 +1,23 @@ ---- content/ppapi_plugin/ppapi_plugin_main.cc.orig 2023-02-11 09:11:04 UTC +--- content/ppapi_plugin/ppapi_plugin_main.cc.orig 2023-05-05 12:12:41 UTC +++ content/ppapi_plugin/ppapi_plugin_main.cc @@ -54,6 +54,11 @@ #include "gin/v8_initializer.h" #endif -+#if BUILDFLAG(IS_OPENBSD) -+#include "sandbox/policy/openbsd/sandbox_openbsd.h" ++#if BUILDFLAG(IS_BSD) ++#include "sandbox/policy/sandbox.h" +#include "sandbox/policy/sandbox_type.h" +#endif + #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) #include #endif @@ -148,7 +153,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(), diff --git a/www/ungoogled-chromium/files/patch-content_public_browser_render__process__host.h b/www/ungoogled-chromium/files/patch-content_public_browser_render__process__host.h index 034ec37c101a..78bc6c9e9a16 100644 --- a/www/ungoogled-chromium/files/patch-content_public_browser_render__process__host.h +++ b/www/ungoogled-chromium/files/patch-content_public_browser_render__process__host.h @@ -1,20 +1,20 @@ ---- content/public/browser/render_process_host.h.orig 2023-03-10 11:01:21 UTC +--- content/public/browser/render_process_host.h.orig 2023-05-05 12:12:41 UTC +++ content/public/browser/render_process_host.h -@@ -53,7 +53,7 @@ +@@ -54,7 +54,7 @@ #include "content/public/browser/android/child_process_importance.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "media/mojo/mojom/stable/stable_video_decoder.mojom-forward.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -641,7 +641,7 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::S +@@ -651,7 +651,7 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::S const blink::StorageKey& storage_key, mojo::PendingReceiver receiver) = 0; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) virtual void CreateStableVideoDecoder( mojo::PendingReceiver receiver) = 0; diff --git a/www/ungoogled-chromium/files/patch-content_public_common_content__features.cc b/www/ungoogled-chromium/files/patch-content_public_common_content__features.cc index 8ee366cd5758..7dc3ade1b6f0 100644 --- a/www/ungoogled-chromium/files/patch-content_public_common_content__features.cc +++ b/www/ungoogled-chromium/files/patch-content_public_common_content__features.cc @@ -1,50 +1,50 @@ ---- content/public/common/content_features.cc.orig 2023-04-08 11:38:38 UTC +--- content/public/common/content_features.cc.orig 2023-05-05 12:12:41 UTC +++ content/public/common/content_features.cc @@ -39,7 +39,7 @@ 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 @@ -51,7 +51,7 @@ BASE_FEATURE(kAudioServiceOutOfProcess, // kAudioServiceOutOfProcess feature is enabled. 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 -@@ -547,7 +547,7 @@ BASE_FEATURE(kGetDisplayMediaSetAutoSelectAllScreens, +@@ -541,7 +541,7 @@ BASE_FEATURE(kGetDisplayMediaSetAutoSelectAllScreens, // (activated by kUserAgentClientHint) BASE_FEATURE(kGreaseUACH, "GreaseUACH", base::FEATURE_ENABLED_BY_DEFAULT); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Supports proxying thread type changes of renderer processes to browser // process and having browser process handle adjusting thread properties (nice // value, c-group, latency sensitivity...) for renderers which have sandbox -@@ -1367,7 +1367,7 @@ BASE_FEATURE(kWebAssemblyTiering, +@@ -1392,7 +1392,7 @@ BASE_FEATURE(kWebAssemblyTiering, 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 -@@ -1425,7 +1425,11 @@ BASE_FEATURE(kWebUICodeCache, +@@ -1450,7 +1450,11 @@ BASE_FEATURE(kWebUICodeCache, // Controls whether the WebUSB API is enabled: // https://wicg.github.io/webusb +#if BUILDFLAG(IS_BSD) +BASE_FEATURE(kWebUsb, "WebUSB", base::FEATURE_DISABLED_BY_DEFAULT); +#else BASE_FEATURE(kWebUsb, "WebUSB", base::FEATURE_ENABLED_BY_DEFAULT); +#endif // Controls whether the WebXR Device API is enabled. BASE_FEATURE(kWebXr, "WebXR", base::FEATURE_ENABLED_BY_DEFAULT); diff --git a/www/ungoogled-chromium/files/patch-content_public_common_content__switches.cc b/www/ungoogled-chromium/files/patch-content_public_common_content__switches.cc index 4bd4e3725eb6..a4fb7f7699d0 100644 --- a/www/ungoogled-chromium/files/patch-content_public_common_content__switches.cc +++ b/www/ungoogled-chromium/files/patch-content_public_common_content__switches.cc @@ -1,20 +1,20 @@ ---- content/public/common/content_switches.cc.orig 2023-04-08 11:38:38 UTC +--- content/public/common/content_switches.cc.orig 2023-05-05 12:12:41 UTC +++ content/public/common/content_switches.cc -@@ -368,6 +368,8 @@ const char kEnableIsolatedWebAppsInRenderer[] = +@@ -371,6 +371,8 @@ const char kEnableIsolatedWebAppsInRenderer[] = // 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. -@@ -995,7 +997,7 @@ const char kEnableAutomation[] = "enable-automation"; +@@ -1003,7 +1005,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. diff --git a/www/ungoogled-chromium/files/patch-content_public_common_content__switches.h b/www/ungoogled-chromium/files/patch-content_public_common_content__switches.h index 8fb55d464ff6..78b56a1dcaae 100644 --- a/www/ungoogled-chromium/files/patch-content_public_common_content__switches.h +++ b/www/ungoogled-chromium/files/patch-content_public_common_content__switches.h @@ -1,19 +1,19 @@ ---- content/public/common/content_switches.h.orig 2023-04-08 11:38:38 UTC +--- content/public/common/content_switches.h.orig 2023-05-05 12:12:41 UTC +++ content/public/common/content_switches.h @@ -117,6 +117,7 @@ CONTENT_EXPORT extern const char kEnableGpuMemoryBuffe CONTENT_EXPORT extern const char kEnableIsolatedWebAppsInRenderer[]; 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 +@@ -268,7 +269,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[]; + CONTENT_EXPORT extern const char kLLVMProfileFile[]; #endif - diff --git a/www/ungoogled-chromium/files/patch-content_public_test_mock__render__process__host.h b/www/ungoogled-chromium/files/patch-content_public_test_mock__render__process__host.h index d570e7102ba4..529933ea04ca 100644 --- a/www/ungoogled-chromium/files/patch-content_public_test_mock__render__process__host.h +++ b/www/ungoogled-chromium/files/patch-content_public_test_mock__render__process__host.h @@ -1,11 +1,11 @@ ---- content/public/test/mock_render_process_host.h.orig 2023-02-11 09:11:04 UTC +--- content/public/test/mock_render_process_host.h.orig 2023-05-05 12:12:41 UTC +++ content/public/test/mock_render_process_host.h -@@ -276,7 +276,7 @@ class MockRenderProcessHost : public RenderProcessHost +@@ -278,7 +278,7 @@ class MockRenderProcessHost : public RenderProcessHost const blink::StorageKey& storage_key, mojo::PendingReceiver receiver) override {} -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void CreateStableVideoDecoder( mojo::PendingReceiver receiver) override {} diff --git a/www/ungoogled-chromium/files/patch-content_renderer_render__process__impl.cc b/www/ungoogled-chromium/files/patch-content_renderer_render__process__impl.cc index 05f421812aa2..13e938797246 100644 --- a/www/ungoogled-chromium/files/patch-content_renderer_render__process__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_renderer_render__process__impl.cc @@ -1,20 +1,20 @@ ---- content/renderer/render_process_impl.cc.orig 2023-03-10 11:01:21 UTC +--- content/renderer/render_process_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/renderer/render_process_impl.cc @@ -46,7 +46,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 -@@ -223,7 +223,7 @@ RenderProcessImpl::RenderProcessImpl() - SetV8FlagIfNotFeature(features::kWebAssemblyDynamicTiering, - "--no-wasm-dynamic-tiering"); +@@ -231,7 +231,7 @@ RenderProcessImpl::RenderProcessImpl() + v8::V8::SetFlagsFromString(kSABPerContextFlag, sizeof(kSABPerContextFlag)); + } -#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)) { base::CommandLine* const command_line = base::CommandLine::ForCurrentProcess(); diff --git a/www/ungoogled-chromium/files/patch-content_renderer_render__thread__impl.cc b/www/ungoogled-chromium/files/patch-content_renderer_render__thread__impl.cc index a944bc251e96..4c6f7f88c9a1 100644 --- a/www/ungoogled-chromium/files/patch-content_renderer_render__thread__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_renderer_render__thread__impl.cc @@ -1,38 +1,38 @@ ---- content/renderer/render_thread_impl.cc.orig 2023-04-08 11:38:38 UTC +--- content/renderer/render_thread_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/renderer/render_thread_impl.cc -@@ -201,6 +201,8 @@ +@@ -202,6 +202,8 @@ #if BUILDFLAG(IS_APPLE) #include +#elif BUILDFLAG(IS_BSD) +#include #else #include #endif -@@ -1069,7 +1071,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: +@@ -1059,7 +1061,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: kGpuStreamPriorityMedia); const bool enable_video_decode_accelerator = -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FeatureList::IsEnabled(media::kVaapiVideoDecodeLinux) && #endif // BUILDFLAG(IS_LINUX) !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) && -@@ -1078,7 +1080,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: +@@ -1068,7 +1070,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: gpu::kGpuFeatureStatusEnabled); 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) && -@@ -1863,7 +1865,7 @@ std::unique_ptr RenderThreadImpl::Create +@@ -1856,7 +1858,7 @@ std::unique_ptr RenderThreadImpl::Create bool enable_video_encode_accelerator) { mojo::PendingRemote vea_provider; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled(media::kUseOutOfProcessVideoEncoding)) { BindHostReceiver(vea_provider.InitWithNewPipeAndPassReceiver()); } else { diff --git a/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc b/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc index bf2bc4940164..61a2f1c090c0 100644 --- a/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc +++ b/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc @@ -1,38 +1,38 @@ ---- content/renderer/renderer_blink_platform_impl.cc.orig 2023-04-08 11:38:38 UTC +--- content/renderer/renderer_blink_platform_impl.cc.orig 2023-05-05 12:12:41 UTC +++ content/renderer/renderer_blink_platform_impl.cc -@@ -111,7 +111,7 @@ +@@ -114,7 +114,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 -@@ -177,7 +177,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( +@@ -180,7 +180,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; RenderThreadImpl::current()->BindHostReceiver( font_service.InitWithNewPipeAndPassReceiver()); -@@ -187,7 +187,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( +@@ -190,7 +190,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(); -@@ -245,7 +245,7 @@ void RendererBlinkPlatformImpl::SetThreadType(base::Pl +@@ -248,7 +248,7 @@ void RendererBlinkPlatformImpl::SetThreadType(base::Pl #endif 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. diff --git a/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.h b/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.h index a9b961a1730c..946157f30eb4 100644 --- a/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.h +++ b/www/ungoogled-chromium/files/patch-content_renderer_renderer__blink__platform__impl.h @@ -1,29 +1,29 @@ ---- content/renderer/renderer_blink_platform_impl.h.orig 2023-04-08 11:38:38 UTC +--- content/renderer/renderer_blink_platform_impl.h.orig 2023-05-05 12:12:41 UTC +++ content/renderer/renderer_blink_platform_impl.h @@ -31,7 +31,7 @@ #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "third_party/blink/public/mojom/cache_storage/cache_storage.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 -@@ -241,7 +241,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi +@@ -242,7 +242,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 sandbox_support_; #endif -@@ -261,7 +261,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi +@@ -262,7 +262,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_loader_; #endif diff --git a/www/ungoogled-chromium/files/patch-content_shell_BUILD.gn b/www/ungoogled-chromium/files/patch-content_shell_BUILD.gn index 24f6d0334706..e6f89cd16bbe 100644 --- a/www/ungoogled-chromium/files/patch-content_shell_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-content_shell_BUILD.gn @@ -1,11 +1,11 @@ ---- content/shell/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- content/shell/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ content/shell/BUILD.gn -@@ -966,7 +966,7 @@ group("content_shell_crash_test") { +@@ -981,7 +981,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", diff --git a/www/ungoogled-chromium/files/patch-content_shell_app_shell__main__delegate.cc b/www/ungoogled-chromium/files/patch-content_shell_app_shell__main__delegate.cc index ce1dc3764bac..ee8115209db3 100644 --- a/www/ungoogled-chromium/files/patch-content_shell_app_shell__main__delegate.cc +++ b/www/ungoogled-chromium/files/patch-content_shell_app_shell__main__delegate.cc @@ -1,11 +1,11 @@ ---- content/shell/app/shell_main_delegate.cc.orig 2023-04-08 11:38:38 UTC +--- content/shell/app/shell_main_delegate.cc.orig 2023-05-05 12:12:41 UTC +++ content/shell/app/shell_main_delegate.cc -@@ -221,7 +221,7 @@ void ShellMainDelegate::PreSandboxStartup() { +@@ -223,7 +223,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 diff --git a/www/ungoogled-chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc b/www/ungoogled-chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc index f7e2c8aa4243..6564f418ad7b 100644 --- a/www/ungoogled-chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc +++ b/www/ungoogled-chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc @@ -1,47 +1,47 @@ ---- content/shell/browser/shell_browser_main_parts.cc.orig 2023-04-08 11:38:38 UTC +--- content/shell/browser/shell_browser_main_parts.cc.orig 2023-05-05 12:12:41 UTC +++ content/shell/browser/shell_browser_main_parts.cc @@ -50,7 +50,7 @@ #include "net/base/network_change_notifier.h" #endif -#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)) #include "ui/base/ime/init/input_method_initializer.h" #endif @@ -67,7 +67,7 @@ #include "chromeos/lacros/dbus/lacros_dbus_thread_manager.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/linux/linux_ui.h" // nogncheck #include "ui/linux/linux_ui_factory.h" // nogncheck #endif -@@ -136,7 +136,7 @@ void ShellBrowserMainParts::PostCreateMainMessageLoop( +@@ -138,7 +138,7 @@ void ShellBrowserMainParts::PostCreateMainMessageLoop( } int ShellBrowserMainParts::PreEarlyInitialization() { -#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)) ui::InitializeInputMethodForTesting(); #endif #if BUILDFLAG(IS_ANDROID) @@ -167,7 +167,7 @@ void ShellBrowserMainParts::ToolkitInitialized() { if (switches::IsRunWebTestsSwitchPresent()) return; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ui::LinuxUi::SetInstance(ui::GetDefaultLinuxUi()); #endif } -@@ -210,7 +210,7 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { +@@ -214,7 +214,7 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { ShellDevToolsManagerDelegate::StopHttpHandler(); browser_context_.reset(); off_the_record_browser_context_.reset(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ui::LinuxUi::SetInstance(nullptr); #endif performance_manager_lifetime_.reset(); diff --git a/www/ungoogled-chromium/files/patch-content_test_BUILD.gn b/www/ungoogled-chromium/files/patch-content_test_BUILD.gn index f3d3f9efeb3b..b185b25ee8cb 100644 --- a/www/ungoogled-chromium/files/patch-content_test_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-content_test_BUILD.gn @@ -1,20 +1,20 @@ ---- content/test/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- content/test/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ content/test/BUILD.gn -@@ -2119,7 +2119,7 @@ static_library("run_all_unittests") { +@@ -2149,7 +2149,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" ] } } -@@ -3159,7 +3159,7 @@ test("content_unittests") { +@@ -3194,7 +3194,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" ] } diff --git a/www/ungoogled-chromium/files/patch-content_utility_services.cc b/www/ungoogled-chromium/files/patch-content_utility_services.cc index 9cdfbad975fd..6106c0112de9 100644 --- a/www/ungoogled-chromium/files/patch-content_utility_services.cc +++ b/www/ungoogled-chromium/files/patch-content_utility_services.cc @@ -1,63 +1,63 @@ ---- content/utility/services.cc.orig 2023-04-08 11:38:38 UTC +--- content/utility/services.cc.orig 2023-05-05 12:12:41 UTC +++ content/utility/services.cc -@@ -64,7 +64,7 @@ +@@ -65,7 +65,7 @@ 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 "media/mojo/services/mojo_video_encode_accelerator_provider_factory.h" #include "sandbox/linux/services/libc_interceptor.h" #include "sandbox/policy/mojom/sandbox.mojom.h" -@@ -87,7 +87,7 @@ extern sandbox::TargetServices* g_utility_target_servi +@@ -88,7 +88,7 @@ extern sandbox::TargetServices* g_utility_target_servi #endif // BUILDFLAG(IS_CHROMEOS_ASH) && (BUILDFLAG(USE_VAAPI) || // BUILDFLAG(USE_V4L2_CODEC)) -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)) && \ (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC)) #include "media/mojo/services/stable_video_decoder_factory_process_service.h" // nogncheck #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && -@@ -215,7 +215,7 @@ auto RunAudio(mojo::PendingReceiver receiver) { -@@ -388,13 +388,13 @@ void RegisterMainThreadServices(mojo::ServiceFactory& +@@ -389,13 +389,13 @@ void RegisterMainThreadServices(mojo::ServiceFactory& #endif // BUILDFLAG(IS_CHROMEOS_ASH) && (BUILDFLAG(USE_VAAPI) || // BUILDFLAG(USE_V4L2_CODEC)) -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)) && \ (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC)) services.Add(RunStableVideoDecoderFactoryProcessService); #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && // (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC)) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) services.Add(RunVideoEncodeAcceleratorProviderFactory); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) diff --git a/www/ungoogled-chromium/files/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h index 7c25d4ed6d69..460bc37e979d 100644 --- a/www/ungoogled-chromium/files/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h @@ -1,14 +1,14 @@ ---- content/utility/speech/speech_recognition_sandbox_hook_linux.h.orig 2022-10-01 07:40:07 UTC +--- content/utility/speech/speech_recognition_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ 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" ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace speech { diff --git a/www/ungoogled-chromium/files/patch-content_utility_utility__main.cc b/www/ungoogled-chromium/files/patch-content_utility_utility__main.cc index 0441ee4c3fbc..26f77e6c5054 100644 --- a/www/ungoogled-chromium/files/patch-content_utility_utility__main.cc +++ b/www/ungoogled-chromium/files/patch-content_utility_utility__main.cc @@ -1,94 +1,94 @@ ---- content/utility/utility_main.cc.orig 2023-03-10 11:01:21 UTC +--- content/utility/utility_main.cc.orig 2023-05-05 12:12:41 UTC +++ content/utility/utility_main.cc @@ -31,7 +31,7 @@ #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 "content/utility/speech/speech_recognition_sandbox_hook_linux.h" #include "gpu/config/gpu_info_collector.h" #include "media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h" @@ -42,15 +42,21 @@ #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 "media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_BSD) -+#include "sandbox/policy/openbsd/sandbox_openbsd.h" ++#include "sandbox/policy/sandbox.h" +#endif + #if BUILDFLAG(IS_CHROMEOS_ASH) #include "chromeos/ash/components/assistant/buildflags.h" #include "chromeos/ash/services/ime/ime_sandbox_hook.h" @@ -62,7 +68,7 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if (BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) && \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))) #include "components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h" // nogncheck #endif @@ -83,10 +89,10 @@ namespace content { namespace { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool ShouldUseAmdGpuPolicy(sandbox::mojom::Sandbox sandbox_type) { const bool obtain_gpu_info = -#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) sandbox_type == sandbox::mojom::Sandbox::kHardwareVideoEncoding; @@ -168,7 +174,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. @@ -196,7 +202,7 @@ int UtilityMain(MainFunctionParams parameters) { pre_sandbox_hook = base::BindOnce(&screen_ai::ScreenAIPreSandboxHook); break; #endif -#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); @@ -223,6 +229,7 @@ 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; @@ -231,6 +238,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 diff --git a/www/ungoogled-chromium/files/patch-content_zygote_zygote__main__linux.cc b/www/ungoogled-chromium/files/patch-content_zygote_zygote__main__linux.cc index c6e110086632..d019074cae22 100644 --- a/www/ungoogled-chromium/files/patch-content_zygote_zygote__main__linux.cc +++ b/www/ungoogled-chromium/files/patch-content_zygote_zygote__main__linux.cc @@ -1,64 +1,58 @@ ---- content/zygote/zygote_main_linux.cc.orig 2022-10-01 07:40:07 UTC +--- content/zygote/zygote_main_linux.cc.orig 2023-05-05 12:12:41 UTC +++ content/zygote/zygote_main_linux.cc @@ -11,7 +11,9 @@ #include #include #include +#if !defined(OS_BSD) #include +#endif #include #include #include @@ -41,7 +43,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" -@@ -50,6 +54,7 @@ namespace content { +@@ -50,11 +54,13 @@ namespace content { namespace { +#if !defined(OS_BSD) void CloseFds(const std::vector& fds) { for (const auto& it : fds) { PCHECK(0 == IGNORE_EINTR(close(it))); -@@ -67,9 +72,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() { -@@ -174,9 +181,11 @@ static void EnterLayerOneSandbox(sandbox::policy::Sand + base::OnceClosure ClosureFromTwoClosures(base::OnceClosure one, + base::OnceClosure two) { +@@ -157,9 +163,11 @@ static void EnterLayerOneSandbox(sandbox::policy::Sand CHECK(!using_layer1_sandbox); } } +#endif bool ZygoteMain( std::vector> fork_delegates) { +#if !defined(OS_BSD) sandbox::SetAmZygoteOrRenderer(true, GetSandboxFD()); auto* linux_sandbox = sandbox::policy::SandboxLinux::GetInstance(); -@@ -241,6 +250,9 @@ bool ZygoteMain( +@@ -224,6 +232,9 @@ bool ZygoteMain( // This function call can return multiple times, once per fork(). return zygote.ProcessRequests(); +#else + return false; +#endif } } // namespace content diff --git a/www/ungoogled-chromium/files/patch-device_bluetooth_bluetooth__adapter.cc b/www/ungoogled-chromium/files/patch-device_bluetooth_bluetooth__adapter.cc index 41c046cc1d8e..d800422855ad 100644 --- a/www/ungoogled-chromium/files/patch-device_bluetooth_bluetooth__adapter.cc +++ b/www/ungoogled-chromium/files/patch-device_bluetooth_bluetooth__adapter.cc @@ -1,11 +1,11 @@ ---- device/bluetooth/bluetooth_adapter.cc.orig 2022-10-01 07:40:07 UTC +--- device/bluetooth/bluetooth_adapter.cc.orig 2023-05-05 12:12:41 UTC +++ device/bluetooth/bluetooth_adapter.cc -@@ -32,7 +32,7 @@ BluetoothAdapter::ServiceOptions::ServiceOptions() = d +@@ -31,7 +31,7 @@ namespace device { + BluetoothAdapter::ServiceOptions::ServiceOptions() = default; BluetoothAdapter::ServiceOptions::~ServiceOptions() = default; - #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_MAC) && \ -- !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) -+ !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) +-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) && \ ++#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) && \ + !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) // static scoped_refptr BluetoothAdapter::CreateAdapter() { - return nullptr; diff --git a/www/ungoogled-chromium/files/patch-extensions_common_api___permission__features.json b/www/ungoogled-chromium/files/patch-extensions_common_api___permission__features.json index 872b7840f2ea..e1c808da33f8 100644 --- a/www/ungoogled-chromium/files/patch-extensions_common_api___permission__features.json +++ b/www/ungoogled-chromium/files/patch-extensions_common_api___permission__features.json @@ -1,29 +1,29 @@ ---- extensions/common/api/_permission_features.json.orig 2023-03-10 11:01:21 UTC +--- extensions/common/api/_permission_features.json.orig 2023-05-05 12:12:41 UTC +++ extensions/common/api/_permission_features.json -@@ -134,7 +134,7 @@ +@@ -138,7 +138,7 @@ { "channel": "stable", "extension_types": ["platform_app"], - "platforms": ["chromeos", "win", "mac", "linux"], + "platforms": ["chromeos", "win", "mac", "linux", "openbsd", "freebsd"], "allowlist": [ "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/387169 "A3BC37E2148AC4E99BE4B16AF9D42DD1E592BBBE", // http://crbug.com/387169 -@@ -427,7 +427,7 @@ +@@ -431,7 +431,7 @@ }, { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], - "platforms": ["chromeos", "mac", "win", "linux", "fuchsia"], + "platforms": ["chromeos", "mac", "win", "linux", "fuchsia", "openbsd", "freebsd"], "allowlist": [ "0DE0F05680A4A056BCEC864ED8DDA84296F82B40", // http://crbug.com/434651 "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/293683 -@@ -469,7 +469,7 @@ +@@ -473,7 +473,7 @@ "networkingPrivate": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], - "platforms": ["chromeos", "lacros", "mac", "win", "linux", "fuchsia"], + "platforms": ["chromeos", "lacros", "mac", "win", "linux", "fuchsia", "openbsd", "freebsd"], "allowlist": [ // DO NOT ADD ANY MORE ENTRIES HERE. // networkingPrivate is being migrated to networking.onc. diff --git a/www/ungoogled-chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc b/www/ungoogled-chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc index 4958ec119670..c6bd22eb01c4 100644 --- a/www/ungoogled-chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc +++ b/www/ungoogled-chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc @@ -1,29 +1,29 @@ ---- google_apis/gcm/engine/heartbeat_manager.cc.orig 2023-03-10 11:01:21 UTC +--- google_apis/gcm/engine/heartbeat_manager.cc.orig 2023-05-05 12:12:41 UTC +++ google_apis/gcm/engine/heartbeat_manager.cc -@@ -33,7 +33,7 @@ const int kMinClientHeartbeatIntervalMs = 1000 * 30; +@@ -32,7 +32,7 @@ const int kMinClientHeartbeatIntervalMs = 1000 * 30; // Minimum time spent sleeping before we force a new heartbeat. const int kMinSuspendTimeMs = 1000 * 10; // 10 seconds. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // The period at which to check if the heartbeat time has passed. Used to // protect against platforms where the timer is delayed by the system being // suspended. Only needed on linux because the other OSes provide a standard -@@ -193,7 +193,7 @@ void HeartbeatManager::RestartTimer() { +@@ -191,7 +191,7 @@ void HeartbeatManager::RestartTimer() { base::BindRepeating(&HeartbeatManager::OnHeartbeatTriggered, weak_ptr_factory_.GetWeakPtr())); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Windows, Mac, Android, iOS, and Chrome OS all provide a way to be notified // when the system is suspending or resuming. The only one that does not is // Linux so we need to poll to check for missed heartbeats. -@@ -218,7 +218,7 @@ void HeartbeatManager::CheckForMissedHeartbeat() { +@@ -214,7 +214,7 @@ void HeartbeatManager::CheckForMissedHeartbeat() { return; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Otherwise check again later. io_task_runner_->PostDelayedTask( FROM_HERE, diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_common_gpu__memory__buffer__support.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_common_gpu__memory__buffer__support.cc index 1e0bf6e2edc3..00e1e027f4da 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_common_gpu__memory__buffer__support.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_common_gpu__memory__buffer__support.cc @@ -1,20 +1,20 @@ ---- gpu/command_buffer/common/gpu_memory_buffer_support.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/common/gpu_memory_buffer_support.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/common/gpu_memory_buffer_support.cc -@@ -173,7 +173,7 @@ uint32_t GetPlatformSpecificTextureTarget() { +@@ -174,7 +174,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_IOS) return GL_TEXTURE_2D; -@@ -208,7 +208,7 @@ GPU_EXPORT bool NativeBufferNeedsPlatformSpecificTextu +@@ -209,7 +209,7 @@ GPU_EXPORT bool NativeBufferNeedsPlatformSpecificTextu gfx::BufferFormat format, gfx::BufferPlane plane) { #if BUILDFLAG(IS_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 || diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc index dd301f92dda8..5dd5d8c5504b 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/gles2_cmd_decoder.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/gles2_cmd_decoder.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/gles2_cmd_decoder.cc -@@ -3460,7 +3460,7 @@ GLES2Decoder* GLES2Decoder::Create( +@@ -3491,7 +3491,7 @@ GLES2Decoder* GLES2Decoder::Create( } // Allow linux to run fuzzers. -#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return new GLES2DecoderImpl(client, command_buffer_service, outputter, group); #else LOG(FATAL) << "Validating command decoder is not supported."; diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc index db8eb794f207..62e3c6395e68 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/shared_image/angle_vulkan_image_backing_factory.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/shared_image/angle_vulkan_image_backing_factory.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/shared_image/angle_vulkan_image_backing_factory.cc -@@ -20,7 +20,7 @@ namespace { +@@ -21,7 +21,7 @@ namespace { // TODO(penghuang): verify the scanout is the right usage for video playback. // crbug.com/1280798 constexpr uint32_t kSupportedUsage = -#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 | diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc index cc7128eb3bd5..8fe737572c80 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc @@ -1,20 +1,20 @@ ---- gpu/command_buffer/service/shared_image/external_vk_image_backing.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/shared_image/external_vk_image_backing.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/shared_image/external_vk_image_backing.cc -@@ -36,7 +36,7 @@ +@@ -39,7 +39,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/shared_image/external_vk_image_dawn_representation.h" #endif -@@ -534,7 +534,7 @@ std::unique_ptr ExternalVkIma +@@ -573,7 +573,7 @@ std::unique_ptr ExternalVkIma WGPUDevice wgpuDevice, WGPUBackendType backend_type, std::vector view_formats) { -#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 = ToWGPUFormat(format()); if (wgpu_format == WGPUTextureFormat_Undefined) { diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc index 5c86009a7c51..80b265ba5a04 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/shared_image/external_vk_image_backing_factory.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/shared_image/external_vk_image_backing_factory.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/shared_image/external_vk_image_backing_factory.cc -@@ -191,7 +191,7 @@ bool ExternalVkImageBackingFactory::IsSupported( +@@ -192,7 +192,7 @@ bool ExternalVkImageBackingFactory::IsSupported( // TODO: remove it when below formats are converted to multi plane shared // image formats. -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) switch (format.resource_format()) { case viz::YUV_420_BIPLANAR: case viz::YUVA_420_TRIPLANAR: diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc index 0d02d8322ba1..300ffba72cd1 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/shared_image/shared_image_manager.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/shared_image/shared_image_manager.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/shared_image/shared_image_manager.cc -@@ -481,7 +481,7 @@ bool SharedImageManager::SupportsScanoutImages() { +@@ -499,7 +499,7 @@ bool SharedImageManager::SupportsScanoutImages() { return true; #elif BUILDFLAG(IS_ANDROID) return base::AndroidHardwareBufferCompat::IsSupportAvailable(); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) return ui::OzonePlatform::GetInstance() ->GetPlatformRuntimeProperties() .supports_native_pixmaps; diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc index e77b2c7cc630..7fabfb4d1bd8 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc -@@ -181,7 +181,7 @@ bool WrappedSkImageBacking::Initialize() { - for (int plane = 0; plane < num_planes; ++plane) { - auto& texture = textures_[plane]; - gfx::Size plane_size = format().GetPlaneSize(plane, size()); +@@ -198,7 +198,7 @@ bool WrappedSkImageBacking::Initialize() { + + constexpr GrRenderable is_renderable = GrRenderable::kYes; + constexpr GrProtected is_protected = GrProtected::kNo; -#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX) +#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) // Blue for single-planar and magenta-ish for multi-planar. SkColor4f fallback_color = format().is_single_plane() ? SkColors::kBlue : SkColors::kWhite; diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc index 0f465b387d7f..850d6a5bfd81 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/service/webgpu_decoder_impl.cc -@@ -1225,7 +1225,7 @@ void WebGPUDecoderImpl::RequestAdapterImpl( +@@ -1238,7 +1238,7 @@ void WebGPUDecoderImpl::RequestAdapterImpl( if (gr_context_type_ != GrContextType::kVulkan && use_webgpu_adapter_ != WebGPUAdapterName::kCompat) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) callback(WGPURequestAdapterStatus_Unavailable, nullptr, "WebGPU on Linux requires command-line flag " "--enable-features=Vulkan", diff --git a/www/ungoogled-chromium/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc b/www/ungoogled-chromium/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc index 08649ce1a6af..f3eec286ec83 100644 --- a/www/ungoogled-chromium/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc +++ b/www/ungoogled-chromium/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc @@ -1,20 +1,20 @@ ---- gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc -@@ -28,7 +28,7 @@ - #include "ui/gl/gl_image.h" +@@ -27,7 +27,7 @@ + #include "ui/gfx/half_float.h" #include "ui/gl/test/gl_test_support.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h" #include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h" #endif -@@ -71,7 +71,7 @@ class GpuMemoryBufferTest : public testing::TestWithPa +@@ -70,7 +70,7 @@ class GpuMemoryBufferTest : public testing::TestWithPa GLManager gl_; }; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) class GpuMemoryBufferTestEGL : public testing::Test, public gpu::GpuCommandBufferTestEGL { public: diff --git a/www/ungoogled-chromium/files/patch-gpu_config_gpu__finch__features.cc b/www/ungoogled-chromium/files/patch-gpu_config_gpu__finch__features.cc index 324788baf116..5c017f1e01bb 100644 --- a/www/ungoogled-chromium/files/patch-gpu_config_gpu__finch__features.cc +++ b/www/ungoogled-chromium/files/patch-gpu_config_gpu__finch__features.cc @@ -1,21 +1,21 @@ ---- gpu/config/gpu_finch_features.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/config/gpu_finch_features.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/config/gpu_finch_features.cc -@@ -57,7 +57,7 @@ bool IsDeviceBlocked(const char* field, const std::str +@@ -58,7 +58,7 @@ bool IsDeviceBlocked(const char* field, const std::str BASE_FEATURE(kUseGles2ForOopR, "UseGles2ForOopR", #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FEATURE_DISABLED_BY_DEFAULT #else base::FEATURE_ENABLED_BY_DEFAULT -@@ -135,7 +135,8 @@ const base::FeatureParam +@@ -136,7 +136,8 @@ const base::FeatureParam BASE_FEATURE(kDefaultEnableGpuRasterization, "DefaultEnableGpuRasterization", #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT diff --git a/www/ungoogled-chromium/files/patch-gpu_ipc_service_gpu__init.cc b/www/ungoogled-chromium/files/patch-gpu_ipc_service_gpu__init.cc index ebf7cde0a422..68f6a1750744 100644 --- a/www/ungoogled-chromium/files/patch-gpu_ipc_service_gpu__init.cc +++ b/www/ungoogled-chromium/files/patch-gpu_ipc_service_gpu__init.cc @@ -1,83 +1,74 @@ ---- gpu/ipc/service/gpu_init.cc.orig 2023-04-08 11:38:38 UTC +--- gpu/ipc/service/gpu_init.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/ipc/service/gpu_init.cc -@@ -353,7 +353,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -330,7 +330,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 -@@ -389,7 +389,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -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. -@@ -438,7 +438,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; -@@ -489,7 +489,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -444,7 +444,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 -@@ -575,7 +575,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -530,7 +530,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; -@@ -703,7 +703,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -665,7 +665,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. -@@ -755,7 +755,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL - gl_use_swiftshader_ = true; +@@ -719,7 +719,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL + } } } -#if BUILDFLAG(IS_LINUX) || \ +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE)) if (!gl_disabled && !gl_use_swiftshader_ && std::getenv("RUNNING_UNDER_RR")) { // https://rr-project.org/ is a Linux-only record-and-replay debugger that -@@ -899,7 +899,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c +@@ -869,7 +869,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c } bool gl_disabled = gl::GetGLImplementation() == gl::kGLImplementationDisabled; -#if BUILDFLAG(IS_LINUX) || \ +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE)) if (!gl_disabled && !gl_use_swiftshader_ && std::getenv("RUNNING_UNDER_RR")) { // https://rr-project.org/ is a Linux-only record-and-replay debugger that -@@ -963,7 +963,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c +@@ -933,7 +933,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. diff --git a/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc b/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc index 475f7a6cfd9c..4f3186c6cbd6 100644 --- a/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc +++ b/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc @@ -1,20 +1,20 @@ ---- gpu/vulkan/vulkan_device_queue.cc.orig 2022-12-02 17:56:32 UTC +--- gpu/vulkan/vulkan_device_queue.cc.orig 2023-05-05 12:12:41 UTC +++ gpu/vulkan/vulkan_device_queue.cc -@@ -89,7 +89,7 @@ bool VulkanDeviceQueue::Initialize( +@@ -93,7 +93,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( +@@ -233,7 +233,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; diff --git a/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.h b/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.h index b37a100c2cba..ca929da1810d 100644 --- a/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.h +++ b/www/ungoogled-chromium/files/patch-gpu_vulkan_vulkan__device__queue.h @@ -1,11 +1,11 @@ ---- gpu/vulkan/vulkan_device_queue.h.orig 2022-10-01 07:40:07 UTC +--- gpu/vulkan/vulkan_device_queue.h.orig 2023-05-05 12:12:41 UTC +++ gpu/vulkan/vulkan_device_queue.h -@@ -158,7 +158,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanDeviceQueue { +@@ -165,7 +165,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}; diff --git a/www/ungoogled-chromium/files/patch-headless_lib_browser_headless__browser__main__parts__posix.cc b/www/ungoogled-chromium/files/patch-headless_lib_browser_headless__browser__main__parts__posix.cc index 3855d5ec68bb..03659bd6f337 100644 --- a/www/ungoogled-chromium/files/patch-headless_lib_browser_headless__browser__main__parts__posix.cc +++ b/www/ungoogled-chromium/files/patch-headless_lib_browser_headless__browser__main__parts__posix.cc @@ -1,39 +1,39 @@ ---- headless/lib/browser/headless_browser_main_parts_posix.cc.orig 2023-04-08 11:38:38 UTC +--- headless/lib/browser/headless_browser_main_parts_posix.cc.orig 2023-05-05 12:12:41 UTC +++ headless/lib/browser/headless_browser_main_parts_posix.cc @@ -19,13 +19,13 @@ #include "content/public/browser/browser_thread.h" #include "headless/lib/browser/headless_browser_impl.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/command_line.h" - #include "components/os_crypt/key_storage_config_linux.h" - #include "components/os_crypt/os_crypt.h" + #include "components/os_crypt/sync/key_storage_config_linux.h" + #include "components/os_crypt/sync/os_crypt.h" #include "headless/public/switches.h" -#if defined(USE_DBUS) +#if defined(USE_DBUS) && !BUILDFLAG(IS_BSD) #include "device/bluetooth/dbus/bluez_dbus_manager.h" #endif -@@ -120,7 +120,7 @@ class BrowserShutdownHandler { +@@ -123,7 +123,7 @@ class BrowserShutdownHandler { } // namespace -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) constexpr char kProductName[] = "HeadlessChrome"; #endif -@@ -128,9 +128,9 @@ void HeadlessBrowserMainParts::PostCreateMainMessageLo - BrowserShutdownHandler::Install( - base::BindOnce(&HeadlessBrowserImpl::Shutdown, browser_->GetWeakPtr())); +@@ -131,9 +131,9 @@ void HeadlessBrowserMainParts::PostCreateMainMessageLo + BrowserShutdownHandler::Install(base::BindOnce( + &HeadlessBrowserImpl::ShutdownWithExitCode, browser_->GetWeakPtr())); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) -#if defined(USE_DBUS) +#if defined(USE_DBUS) && !BUILDFLAG(IS_BSD) bluez::BluezDBusManager::Initialize(/*system_bus=*/nullptr); #endif diff --git a/www/ungoogled-chromium/files/patch-headless_lib_headless__content__main__delegate.cc b/www/ungoogled-chromium/files/patch-headless_lib_headless__content__main__delegate.cc index 52f9c37e231e..a55572df9a31 100644 --- a/www/ungoogled-chromium/files/patch-headless_lib_headless__content__main__delegate.cc +++ b/www/ungoogled-chromium/files/patch-headless_lib_headless__content__main__delegate.cc @@ -1,11 +1,11 @@ ---- headless/lib/headless_content_main_delegate.cc.orig 2023-04-08 11:38:38 UTC +--- headless/lib/headless_content_main_delegate.cc.orig 2023-05-05 12:12:41 UTC +++ headless/lib/headless_content_main_delegate.cc -@@ -327,7 +327,7 @@ void HeadlessContentMainDelegate::InitCrashReporter( +@@ -337,7 +337,7 @@ void HeadlessContentMainDelegate::InitCrashReporter( if (process_type != ::switches::kZygoteProcess) { g_headless_crash_client.Pointer()->set_crash_dumps_dir( command_line.GetSwitchValuePath(switches::kCrashDumpsDir)); -#if !BUILDFLAG(IS_WIN) +#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD) crash_reporter::InitializeCrashpad(process_type.empty(), process_type); #endif // !BUILDFLAG(IS_WIN) crash_keys::SetSwitchesFromCommandLine(command_line, nullptr); diff --git a/www/ungoogled-chromium/files/patch-ipc_ipc__message__utils.cc b/www/ungoogled-chromium/files/patch-ipc_ipc__message__utils.cc index 19144413fa7e..3e1f4f230a58 100644 --- a/www/ungoogled-chromium/files/patch-ipc_ipc__message__utils.cc +++ b/www/ungoogled-chromium/files/patch-ipc_ipc__message__utils.cc @@ -1,11 +1,11 @@ ---- ipc/ipc_message_utils.cc.orig 2022-10-01 07:40:07 UTC +--- ipc/ipc_message_utils.cc.orig 2023-05-05 12:12:41 UTC +++ ipc/ipc_message_utils.cc -@@ -359,7 +359,7 @@ void ParamTraits::Log(const param_type& +@@ -360,7 +360,7 @@ void ParamTraits::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::Log(const param_type& p, std::string* l) { l->append(base::NumberToString(p)); diff --git a/www/ungoogled-chromium/files/patch-media_audio_audio__input__device.cc b/www/ungoogled-chromium/files/patch-media_audio_audio__input__device.cc index 2bf8edebea82..ac0ac28742e0 100644 --- a/www/ungoogled-chromium/files/patch-media_audio_audio__input__device.cc +++ b/www/ungoogled-chromium/files/patch-media_audio_audio__input__device.cc @@ -1,11 +1,11 @@ ---- media/audio/audio_input_device.cc.orig 2022-10-01 07:40:07 UTC +--- media/audio/audio_input_device.cc.orig 2023-05-05 12:12:41 UTC +++ media/audio/audio_input_device.cc -@@ -259,7 +259,7 @@ void AudioInputDevice::OnStreamCreated( +@@ -262,7 +262,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 diff --git a/www/ungoogled-chromium/files/patch-media_audio_sndio_sndio__input.cc b/www/ungoogled-chromium/files/patch-media_audio_sndio_sndio__input.cc index 0cc2a5f7aa4e..445ce5cd16d7 100644 --- a/www/ungoogled-chromium/files/patch-media_audio_sndio_sndio__input.cc +++ b/www/ungoogled-chromium/files/patch-media_audio_sndio_sndio__input.cc @@ -1,203 +1,203 @@ ---- media/audio/sndio/sndio_input.cc.orig 2023-03-10 11:01:21 UTC +--- media/audio/sndio/sndio_input.cc.orig 2023-05-05 12:12:41 UTC +++ media/audio/sndio/sndio_input.cc @@ -0,0 +1,200 @@ +// 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/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(arg); + + self->hw_delay += delta; +} + +void *SndioAudioInputStream::ThreadEntry(void *arg) { + SndioAudioInputStream* self = static_cast(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(reinterpret_cast(buffer), nframes); + + + // invoke callback -+ callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1.); ++ callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1., {}); + } +} + +} // namespace media diff --git a/www/ungoogled-chromium/files/patch-media_base_media__switches.cc b/www/ungoogled-chromium/files/patch-media_base_media__switches.cc index 33e2ec358535..4faeaae1e4c9 100644 --- a/www/ungoogled-chromium/files/patch-media_base_media__switches.cc +++ b/www/ungoogled-chromium/files/patch-media_base_media__switches.cc @@ -1,55 +1,55 @@ ---- media/base/media_switches.cc.orig 2023-04-08 11:38:38 UTC +--- media/base/media_switches.cc.orig 2023-05-05 12:12:41 UTC +++ media/base/media_switches.cc @@ -12,7 +12,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 -@@ -586,7 +586,7 @@ BASE_FEATURE(kFallbackAfterDecodeError, +@@ -604,7 +604,7 @@ BASE_FEATURE(kFallbackAfterDecodeError, // Show toolbar button that opens dialog for controlling media sessions. BASE_FEATURE(kGlobalMediaControls, "GlobalMediaControls", -#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 -@@ -634,7 +634,7 @@ constexpr base::FeatureParam 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 diff --git a/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc b/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc index e081a554f13d..e083f8725773 100644 --- a/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc +++ b/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc @@ -1,358 +1,88 @@ ---- media/capture/video/linux/v4l2_capture_delegate.cc.orig 2023-05-02 13:12:51 UTC +--- media/capture/video/linux/v4l2_capture_delegate.cc.orig 2023-05-05 12:12:41 UTC +++ media/capture/video/linux/v4l2_capture_delegate.cc @@ -4,8 +4,10 @@ #include "media/capture/video/linux/v4l2_capture_delegate.h" +#if !BUILDFLAG(IS_BSD) #include #include +#endif #include #include #include -@@ -20,7 +22,6 @@ - #include "base/task/single_thread_task_runner.h" - #include "base/trace_event/trace_event.h" - #include "build/build_config.h" --#include "media/base/bind_to_current_loop.h" - #include "media/base/video_frame.h" - #include "media/base/video_types.h" - #include "media/capture/mojom/image_capture_types.h" -@@ -29,10 +30,12 @@ +@@ -28,10 +30,12 @@ using media::mojom::MeteringMode; +#if !BUILDFLAG(IS_BSD) #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. -@@ -139,47 +142,6 @@ int GetControllingSpecialControl(int control_id) { - return 0; - } - --// Determines if |control_id| is special, i.e. controls another one's state. --bool IsSpecialControl(int control_id) { -- switch (control_id) { -- case V4L2_CID_AUTO_WHITE_BALANCE: -- case V4L2_CID_EXPOSURE_AUTO: -- case V4L2_CID_EXPOSURE_AUTO_PRIORITY: -- case V4L2_CID_FOCUS_AUTO: -- return true; -- } -- return false; --} -- --// Determines if |control_id| should be skipped, https://crbug.com/697885. --#if !defined(V4L2_CID_PAN_SPEED) --#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32) --#endif --#if !defined(V4L2_CID_TILT_SPEED) --#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33) --#endif --#if !defined(V4L2_CID_PANTILT_CMD) --#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34) --#endif --bool IsBlockedControl(int control_id) { -- switch (control_id) { -- case V4L2_CID_PAN_RELATIVE: -- case V4L2_CID_TILT_RELATIVE: -- case V4L2_CID_PAN_RESET: -- case V4L2_CID_TILT_RESET: -- case V4L2_CID_PAN_ABSOLUTE: -- case V4L2_CID_TILT_ABSOLUTE: -- case V4L2_CID_ZOOM_ABSOLUTE: -- case V4L2_CID_ZOOM_RELATIVE: -- case V4L2_CID_ZOOM_CONTINUOUS: -- case V4L2_CID_PAN_SPEED: -- case V4L2_CID_TILT_SPEED: -- case V4L2_CID_PANTILT_CMD: -- return true; -- } -- return false; --} -- - bool IsNonEmptyRange(const mojom::RangePtr& range) { - return range->min < range->max; - } -@@ -253,6 +215,49 @@ std::vector V4L2CaptureDelegate::GetListOfUs - return supported_formats; - } - -+// Determines if |control_id| is special, i.e. controls another one's state. -+// static -+bool V4L2CaptureDelegate::IsSpecialControl(int control_id) { -+ switch (control_id) { -+ case V4L2_CID_AUTO_WHITE_BALANCE: -+ case V4L2_CID_EXPOSURE_AUTO: -+ case V4L2_CID_EXPOSURE_AUTO_PRIORITY: -+ case V4L2_CID_FOCUS_AUTO: -+ return true; -+ } -+ return false; -+} -+ -+// Determines if |control_id| should be skipped, https://crbug.com/697885. -+#if !defined(V4L2_CID_PAN_SPEED) -+#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32) -+#endif -+#if !defined(V4L2_CID_TILT_SPEED) -+#define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33) -+#endif -+#if !defined(V4L2_CID_PANTILT_CMD) -+#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34) -+#endif -+// static -+bool V4L2CaptureDelegate::IsBlockedControl(int control_id) { -+ switch (control_id) { -+ case V4L2_CID_PAN_RELATIVE: -+ case V4L2_CID_TILT_RELATIVE: -+ case V4L2_CID_PAN_RESET: -+ case V4L2_CID_TILT_RESET: -+ case V4L2_CID_PAN_ABSOLUTE: -+ case V4L2_CID_TILT_ABSOLUTE: -+ case V4L2_CID_ZOOM_ABSOLUTE: -+ case V4L2_CID_ZOOM_RELATIVE: -+ case V4L2_CID_ZOOM_CONTINUOUS: -+ case V4L2_CID_PAN_SPEED: -+ case V4L2_CID_TILT_SPEED: -+ case V4L2_CID_PANTILT_CMD: -+ return true; -+ } -+ return false; -+} -+ - V4L2CaptureDelegate::V4L2CaptureDelegate( - V4L2CaptureDevice* v4l2, - const VideoCaptureDeviceDescriptor& device_descriptor, -@@ -728,7 +733,7 @@ base::WeakPtr V4L2CaptureDelegate +@@ -729,7 +733,7 @@ base::WeakPtr V4L2CaptureDelegate 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) { -@@ -738,7 +743,7 @@ bool V4L2CaptureDelegate::RunIoctl(int request, void* +@@ -739,7 +743,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)); } -@@ -778,6 +783,7 @@ bool V4L2CaptureDelegate::IsControllableControl(int co +@@ -779,6 +783,7 @@ bool V4L2CaptureDelegate::IsControllableControl(int co } void V4L2CaptureDelegate::ReplaceControlEventSubscriptions() { +#if !BUILDFLAG(IS_BSD) constexpr uint32_t kControlIds[] = {V4L2_CID_AUTO_EXPOSURE_BIAS, V4L2_CID_AUTO_WHITE_BALANCE, V4L2_CID_BRIGHTNESS, -@@ -805,6 +811,7 @@ void V4L2CaptureDelegate::ReplaceControlEventSubscript +@@ -806,6 +811,7 @@ void V4L2CaptureDelegate::ReplaceControlEventSubscript << ", {type = V4L2_EVENT_CTRL, id = " << control_id << "}"; } } +#endif } mojom::RangePtr V4L2CaptureDelegate::RetrieveUserControlRange(int control_id) { -@@ -829,100 +836,89 @@ mojom::RangePtr V4L2CaptureDelegate::RetrieveUserContr - } - - void V4L2CaptureDelegate::ResetUserAndCameraControlsToDefault() { -- // Set V4L2_CID_AUTO_WHITE_BALANCE to false first. -- v4l2_control auto_white_balance = {}; -- auto_white_balance.id = V4L2_CID_AUTO_WHITE_BALANCE; -- auto_white_balance.value = false; -- if (!RunIoctl(VIDIOC_S_CTRL, &auto_white_balance)) -- return; -- -- std::vector special_camera_controls; -- // Set V4L2_CID_EXPOSURE_AUTO to V4L2_EXPOSURE_MANUAL. -- v4l2_ext_control auto_exposure = {}; -- auto_exposure.id = V4L2_CID_EXPOSURE_AUTO; -- auto_exposure.value = V4L2_EXPOSURE_MANUAL; -- special_camera_controls.push_back(auto_exposure); -- // Set V4L2_CID_EXPOSURE_AUTO_PRIORITY to false. -- v4l2_ext_control priority_auto_exposure = {}; -- priority_auto_exposure.id = V4L2_CID_EXPOSURE_AUTO_PRIORITY; -- priority_auto_exposure.value = false; -- special_camera_controls.push_back(priority_auto_exposure); -- // Set V4L2_CID_FOCUS_AUTO to false. -- v4l2_ext_control auto_focus = {}; -- auto_focus.id = V4L2_CID_FOCUS_AUTO; -- auto_focus.value = false; -- special_camera_controls.push_back(auto_focus); -- - struct v4l2_ext_controls ext_controls = {}; -- ext_controls.ctrl_class = V4L2_CID_CAMERA_CLASS; -- ext_controls.count = special_camera_controls.size(); -- ext_controls.controls = special_camera_controls.data(); -- if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) -- DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS"; -+ ext_controls.which = V4L2_CTRL_WHICH_CUR_VAL; -+ ext_controls.count = 0; -+ const bool use_modern_s_ext_ctrls = -+ DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) == 0; - - for (const auto& control : kControls) { - std::vector camera_controls; -+ std::vector manual_special_camera_controls; -+ std::vector special_camera_controls; - - v4l2_queryctrl range = {}; -- range.id = control.control_base | V4L2_CTRL_FLAG_NEXT_CTRL; -+ // Start right below the base so that the first next retrieved control ID -+ // is always the first available control ID within the class even if that -+ // control ID is equal to the base (V4L2_CID_BRIGHTNESS equals to -+ // V4L2_CID_USER_BASE). -+ range.id = (control.control_base - 1) | V4L2_CTRL_FLAG_NEXT_CTRL; - while (0 == DoIoctl(VIDIOC_QUERYCTRL, &range)) { - if (V4L2_CTRL_ID2CLASS(range.id) != V4L2_CTRL_ID2CLASS(control.class_id)) - break; -+ -+ v4l2_ext_control ext_control = {}; -+ ext_control.id = range.id; -+ ext_control.value = range.default_value; -+ -+ // Prepare to query for the next control as `range` is an in-out -+ // parameter. - range.id |= V4L2_CTRL_FLAG_NEXT_CTRL; - -- if (IsSpecialControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL)) -+ if (range.flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_READ_ONLY)) { -+ // Permanently disabled or permanently read-only. - continue; -- if (IsBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL)) -+ } -+ if (IsBlockedControl(ext_control.id)) { - continue; -+ } - -- struct v4l2_ext_control ext_control = {}; -- ext_control.id = range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL; -- ext_control.value = range.default_value; -- camera_controls.push_back(ext_control); -+ if (IsSpecialControl(ext_control.id)) { -+ special_camera_controls.push_back(ext_control); -+ if (ext_control.id == V4L2_CID_EXPOSURE_AUTO) { -+ ext_control.value = V4L2_EXPOSURE_MANUAL; -+ } else { -+ ext_control.value = false; // Not automatic but manual. -+ } -+ manual_special_camera_controls.push_back(ext_control); -+ } else { -+ camera_controls.push_back(ext_control); -+ } - } - - if (!camera_controls.empty()) { -- struct v4l2_ext_controls ext_controls2 = {}; -- ext_controls2.ctrl_class = control.class_id; -- ext_controls2.count = camera_controls.size(); -- ext_controls2.controls = camera_controls.data(); -- if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls2) < 0) -+ // Set special controls to manual modes first. -+ if (!manual_special_camera_controls.empty()) { -+ ext_controls.which = -+ use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id; -+ ext_controls.count = manual_special_camera_controls.size(); -+ ext_controls.controls = manual_special_camera_controls.data(); -+ if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) { -+ DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS"; -+ } -+ } -+ -+ // Set non-special controls to the default values. -+ ext_controls.which = -+ use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id; -+ ext_controls.count = camera_controls.size(); -+ ext_controls.controls = camera_controls.data(); -+ if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) { - DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS"; -+ } - } -- } - -- // Now set the special flags to the default values -- v4l2_queryctrl range = {}; -- range.id = V4L2_CID_AUTO_WHITE_BALANCE; -- DoIoctl(VIDIOC_QUERYCTRL, &range); -- auto_white_balance.value = range.default_value; -- DoIoctl(VIDIOC_S_CTRL, &auto_white_balance); -- -- special_camera_controls.clear(); -- memset(&range, 0, sizeof(range)); -- range.id = V4L2_CID_EXPOSURE_AUTO; -- DoIoctl(VIDIOC_QUERYCTRL, &range); -- auto_exposure.value = range.default_value; -- special_camera_controls.push_back(auto_exposure); -- -- memset(&range, 0, sizeof(range)); -- range.id = V4L2_CID_EXPOSURE_AUTO_PRIORITY; -- DoIoctl(VIDIOC_QUERYCTRL, &range); -- priority_auto_exposure.value = range.default_value; -- special_camera_controls.push_back(priority_auto_exposure); -- -- memset(&range, 0, sizeof(range)); -- range.id = V4L2_CID_FOCUS_AUTO; -- DoIoctl(VIDIOC_QUERYCTRL, &range); -- auto_focus.value = range.default_value; -- special_camera_controls.push_back(auto_focus); -- -- memset(&ext_controls, 0, sizeof(ext_controls)); -- ext_controls.ctrl_class = V4L2_CID_CAMERA_CLASS; -- ext_controls.count = special_camera_controls.size(); -- ext_controls.controls = special_camera_controls.data(); -- if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) -- DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS"; -+ // Set special controls to the default values. -+ if (!special_camera_controls.empty()) { -+ ext_controls.which = -+ use_modern_s_ext_ctrls ? V4L2_CTRL_WHICH_CUR_VAL : control.class_id; -+ ext_controls.count = special_camera_controls.size(); -+ ext_controls.controls = special_camera_controls.data(); -+ if (DoIoctl(VIDIOC_S_EXT_CTRLS, &ext_controls) < 0) { -+ DPLOG(INFO) << "VIDIOC_S_EXT_CTRLS"; -+ } -+ } -+ } - } - - bool V4L2CaptureDelegate::MapAndQueueBuffer(int index) { -@@ -985,7 +981,11 @@ void V4L2CaptureDelegate::DoCapture() { +@@ -975,7 +981,11 @@ void V4L2CaptureDelegate::DoCapture() { pollfd device_pfd = {}; device_pfd.fd = device_fd_.get(); +#if !BUILDFLAG(IS_BSD) device_pfd.events = POLLIN | POLLPRI; +#else + device_pfd.events = POLLIN; +#endif const int result = HANDLE_EINTR(v4l2_->poll(&device_pfd, 1, kCaptureTimeoutMs)); -@@ -1023,6 +1023,7 @@ void V4L2CaptureDelegate::DoCapture() { +@@ -1013,6 +1023,7 @@ void V4L2CaptureDelegate::DoCapture() { timeout_count_ = 0; } +#if !BUILDFLAG(IS_BSD) // Dequeue events if the driver has filled in some. if (device_pfd.revents & POLLPRI) { bool controls_changed = false; -@@ -1057,6 +1058,7 @@ void V4L2CaptureDelegate::DoCapture() { +@@ -1047,6 +1058,7 @@ void V4L2CaptureDelegate::DoCapture() { client_->OnCaptureConfigurationChanged(); } } +#endif // Deenqueue, send and reenqueue a buffer if the driver has filled one in. if (device_pfd.revents & POLLIN) { diff --git a/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.h b/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.h index c784c58db5f6..62c3bec3708f 100644 --- a/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.h +++ b/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.h @@ -1,15 +1,15 @@ ---- media/capture/video/linux/v4l2_capture_delegate.h.orig 2023-04-08 11:38:38 UTC +--- media/capture/video/linux/v4l2_capture_delegate.h.orig 2023-05-05 12:12:41 UTC +++ media/capture/video/linux/v4l2_capture_delegate.h -@@ -87,10 +87,10 @@ class CAPTURE_EXPORT V4L2CaptureDelegate final { +@@ -90,10 +90,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); // Check whether the control is controllable (and not changed automatically). bool IsControllableControl(int control_id); diff --git a/www/ungoogled-chromium/files/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc b/www/ungoogled-chromium/files/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc index a6d19ea160df..144a43e09215 100644 --- a/www/ungoogled-chromium/files/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc +++ b/www/ungoogled-chromium/files/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc @@ -1,45 +1,45 @@ ---- media/capture/video/linux/video_capture_device_factory_v4l2.cc.orig 2023-04-08 11:38:38 UTC +--- media/capture/video/linux/video_capture_device_factory_v4l2.cc.orig 2023-05-05 12:12:41 UTC +++ media/capture/video/linux/video_capture_device_factory_v4l2.cc @@ -75,6 +75,9 @@ class DevVideoFilePathsDeviceProvider : public VideoCaptureDeviceFactoryV4L2::DeviceProvider { public: void GetDeviceIds(std::vector* target_container) override { -+#if defined(OS_OPENBSD) ++#if BUILDFLAG(IS_OPENBSD) + target_container->emplace_back("/dev/video"); +#else const base::FilePath path("/dev/"); base::FileEnumerator enumerator(path, false, base::FileEnumerator::FILES, "video*"); @@ -82,9 +85,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) ++#if BUILDFLAG(IS_OPENBSD) + return std::string(); +#endif const std::string file_name = ExtractFileNameFromDeviceId(device_id); std::string usb_id; const std::string vid_path = @@ -104,6 +111,9 @@ class DevVideoFilePathsDeviceProvider } std::string GetDeviceDisplayName(const std::string& device_id) override { -+#if defined(OS_OPENBSD) ++#if BUILDFLAG(IS_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()); @@ -219,7 +229,7 @@ void VideoCaptureDeviceFactoryV4L2::GetDevicesInfo( std::move(callback).Run(std::move(devices_info)); } -int VideoCaptureDeviceFactoryV4L2::DoIoctl(int fd, int request, void* argp) { +int VideoCaptureDeviceFactoryV4L2::DoIoctl(int fd, unsigned int request, void* argp) { return HANDLE_EINTR(v4l2_->ioctl(fd, request, argp)); } diff --git a/www/ungoogled-chromium/files/patch-media_capture_video_video__capture__device__client.cc b/www/ungoogled-chromium/files/patch-media_capture_video_video__capture__device__client.cc index 46423f60d61a..b3284b085096 100644 --- a/www/ungoogled-chromium/files/patch-media_capture_video_video__capture__device__client.cc +++ b/www/ungoogled-chromium/files/patch-media_capture_video_video__capture__device__client.cc @@ -1,11 +1,11 @@ ---- media/capture/video/video_capture_device_client.cc.orig 2023-04-08 11:38:38 UTC +--- media/capture/video/video_capture_device_client.cc.orig 2023-05-05 12:12:41 UTC +++ media/capture/video/video_capture_device_client.cc -@@ -322,7 +322,7 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData( +@@ -321,7 +321,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.m1cr050ft.qjz9zk/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; diff --git a/www/ungoogled-chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc b/www/ungoogled-chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc index 88529b21fc8b..80cdaaa42163 100644 --- a/www/ungoogled-chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc +++ b/www/ungoogled-chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc @@ -1,11 +1,11 @@ ---- media/gpu/gpu_video_encode_accelerator_factory.cc.orig 2023-02-11 09:11:04 UTC +--- media/gpu/gpu_video_encode_accelerator_factory.cc.orig 2023-05-05 12:12:41 UTC +++ media/gpu/gpu_video_encode_accelerator_factory.cc -@@ -121,7 +121,7 @@ std::vector GetVEAFactoryFunctions +@@ -122,7 +122,7 @@ std::vector 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 diff --git a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc index 4207035f9995..c5719c3c2db9 100644 --- a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc +++ b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc @@ -1,44 +1,44 @@ ---- media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc.orig 2023-02-11 09:11:04 UTC +--- media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc.orig 2023-05-05 12:12:41 UTC +++ media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc @@ -15,7 +15,9 @@ #include "media/gpu/vaapi/vaapi_wrapper.h" #endif +#if !BUILDFLAG(IS_BSD) using sandbox::syscall_broker::BrokerFilePermission; +#endif // TODO(b/195769334): the hardware video decoding sandbox is really only useful // when building with VA-API or V4L2 (otherwise, we're not really doing hardware @@ -31,6 +33,7 @@ using sandbox::syscall_broker::BrokerFilePermission; namespace media { namespace { +#if !BUILDFLAG(IS_BSD) void AllowAccessToRenderNodes(std::vector& permissions, bool include_sys_dev_char, bool read_write) { -@@ -160,6 +163,7 @@ bool HardwareVideoDecodingPreSandboxHookForV4L2( +@@ -168,6 +171,7 @@ bool HardwareVideoDecodingPreSandboxHookForV4L2( return false; #endif // BUILDFLAG(USE_V4L2_CODEC) } +#endif } // namespace -@@ -175,6 +179,7 @@ bool HardwareVideoDecodingPreSandboxHookForV4L2( +@@ -183,6 +187,7 @@ bool HardwareVideoDecodingPreSandboxHookForV4L2( // (at least). bool HardwareVideoDecodingPreSandboxHook( sandbox::policy::SandboxLinux::Options options) { +#if !BUILDFLAG(IS_BSD) using HardwareVideoDecodingProcessPolicy = sandbox::policy::HardwareVideoDecodingProcessPolicy; using PolicyType = -@@ -212,6 +217,7 @@ bool HardwareVideoDecodingPreSandboxHook( +@@ -220,6 +225,7 @@ bool HardwareVideoDecodingPreSandboxHook( sandbox::policy::SandboxLinux::GetInstance()->StartBrokerProcess( command_set, permissions, sandbox::policy::SandboxLinux::PreSandboxHook(), options); +#endif return true; } diff --git a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h index 6e96950da798..53054f9d9790 100644 --- a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h @@ -1,16 +1,16 @@ ---- media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h.orig 2022-10-01 07:40:07 UTC +--- media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ 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" ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace media { diff --git a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc index 94368b2311fe..341435acb9c7 100644 --- a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc +++ b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc @@ -1,30 +1,27 @@ ---- media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.cc.orig 2023-01-13 08:56:02 UTC +--- media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.cc.orig 2023-05-05 12:12:41 UTC +++ media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.cc @@ -18,12 +18,15 @@ #include "media/gpu/v4l2/v4l2_device.h" #endif +#if !BUILDFLAG(IS_BSD) using sandbox::syscall_broker::BrokerFilePermission; +#endif namespace media { bool HardwareVideoEncodingPreSandboxHook( sandbox::policy::SandboxLinux::Options options) { +#if !BUILDFLAG(IS_BSD) sandbox::syscall_broker::BrokerCommandSet command_set; std::vector permissions; -@@ -125,8 +128,8 @@ bool HardwareVideoEncodingPreSandboxHook( +@@ -134,7 +137,7 @@ bool HardwareVideoEncodingPreSandboxHook( #endif // defined(__aarch64__) } #endif - +#endif return true; } --} // namespace media -\ No newline at end of file -+} // namespace media diff --git a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h index 84edb0a2c930..d63e9528fea6 100644 --- a/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h @@ -1,23 +1,23 @@ ---- media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h.orig 2023-01-13 08:56:02 UTC +--- media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h @@ -5,7 +5,13 @@ #ifndef MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_ #define MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_ +#include "build/build_config.h" + +#if BUILDFLAG(IS_BSD) -+#include "sandbox/policy/openbsd/sandbox_openbsd.h" ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace media { @@ -14,4 +20,4 @@ bool HardwareVideoEncodingPreSandboxHook( } // namespace media -#endif // MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_ \ No newline at end of file +#endif // MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_ diff --git a/www/ungoogled-chromium/files/patch-media_gpu_vaapi_vaapi__video__decoder.cc b/www/ungoogled-chromium/files/patch-media_gpu_vaapi_vaapi__video__decoder.cc index ae257a61a813..7badccbeb805 100644 --- a/www/ungoogled-chromium/files/patch-media_gpu_vaapi_vaapi__video__decoder.cc +++ b/www/ungoogled-chromium/files/patch-media_gpu_vaapi_vaapi__video__decoder.cc @@ -1,11 +1,11 @@ ---- media/gpu/vaapi/vaapi_video_decoder.cc.orig 2023-04-08 11:38:38 UTC +--- media/gpu/vaapi/vaapi_video_decoder.cc.orig 2023-05-05 12:12:41 UTC +++ media/gpu/vaapi/vaapi_video_decoder.cc -@@ -769,7 +769,7 @@ void VaapiVideoDecoder::ApplyResolutionChangeWithScree +@@ -771,7 +771,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 allocator = base::BindRepeating(&AllocateCustomFrameProxy, weak_this_); std::vector candidates = { diff --git a/www/ungoogled-chromium/files/patch-media_media__options.gni b/www/ungoogled-chromium/files/patch-media_media__options.gni index d5156904fe29..7c4b0c992874 100644 --- a/www/ungoogled-chromium/files/patch-media_media__options.gni +++ b/www/ungoogled-chromium/files/patch-media_media__options.gni @@ -1,30 +1,30 @@ ---- media/media_options.gni.orig 2023-04-08 11:38:38 UTC +--- media/media_options.gni.orig 2023-05-05 12:12:41 UTC +++ media/media_options.gni -@@ -188,12 +188,15 @@ declare_args() { +@@ -186,12 +186,15 @@ 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 all non-Android, non-Mac POSIX systems - with the # exception of CastOS desktop builds. # # TODO(crbug.com/1336055): Remove legacy target_cpu hack used for targeting # desktop Chromecast builds. - if (is_posix && !is_android && !is_apple && + if (is_posix && !is_android && !is_apple && !is_bsd && (!is_castos || (target_cpu == "x86" || target_cpu == "x64") || is_cast_audio_only)) { use_alsa = true -@@ -209,6 +212,10 @@ declare_args() { +@@ -207,6 +210,10 @@ declare_args() { if (!use_cras && !is_castos && !is_asan && !is_tsan) { use_pulseaudio = true } + } + if (is_openbsd) { + use_sndio = true + use_pulseaudio = false } } diff --git a/www/ungoogled-chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc b/www/ungoogled-chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc index 9752b300b2c1..de8e14e6fa21 100644 --- a/www/ungoogled-chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc +++ b/www/ungoogled-chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc @@ -1,29 +1,29 @@ ---- media/video/gpu_memory_buffer_video_frame_pool.cc.orig 2023-03-10 11:01:21 UTC +--- media/video/gpu_memory_buffer_video_frame_pool.cc.orig 2023-05-05 12:12:41 UTC +++ media/video/gpu_memory_buffer_video_frame_pool.cc -@@ -727,7 +727,7 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::CreateHa +@@ -726,7 +726,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 -@@ -1158,7 +1158,7 @@ scoped_refptr GpuMemoryBufferVideoFramePoo +@@ -1157,7 +1157,7 @@ scoped_refptr GpuMemoryBufferVideoFramePoo is_webgpu_compatible = (gpu_memory_buffer != nullptr); #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) is_webgpu_compatible = (gpu_memory_buffer != nullptr); if (is_webgpu_compatible) { is_webgpu_compatible &= -@@ -1177,7 +1177,7 @@ scoped_refptr GpuMemoryBufferVideoFramePoo +@@ -1176,7 +1176,7 @@ scoped_refptr GpuMemoryBufferVideoFramePoo gpu::SHARED_IMAGE_USAGE_DISPLAY_READ | gpu::SHARED_IMAGE_USAGE_SCANOUT; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) // TODO(crbug.com/1241537): Always add the flag once the // OzoneImageBacking is by default turned on. if (base::CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter.cc b/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter.cc index 847b05d43a97..ebc911296695 100644 --- a/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter.cc +++ b/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter.cc @@ -1,20 +1,20 @@ ---- media/video/video_encode_accelerator_adapter.cc.orig 2023-04-08 11:38:38 UTC +--- media/video/video_encode_accelerator_adapter.cc.orig 2023-05-05 12:12:41 UTC +++ media/video/video_encode_accelerator_adapter.cc @@ -140,7 +140,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 (format != PIXEL_FORMAT_I420 || !VideoFrame::IsStorageTypeMappable(storage_type)) { // ChromeOS/Linux hardware video encoders supports I420 on-memory -@@ -465,7 +465,7 @@ void VideoEncodeAcceleratorAdapter::InitializeInternal +@@ -473,7 +473,7 @@ void VideoEncodeAcceleratorAdapter::InitializeInternal SetUpVeaConfig(profile_, options_, format, first_frame->storage_type(), supported_rc_modes_, required_encoder_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 diff --git a/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc b/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc index 5ea9a9f0aad2..7f654d7e4fc8 100644 --- a/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc +++ b/www/ungoogled-chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc @@ -1,11 +1,11 @@ ---- media/video/video_encode_accelerator_adapter_test.cc.orig 2023-03-10 11:01:21 UTC +--- media/video/video_encode_accelerator_adapter_test.cc.orig 2023-05-05 12:12:41 UTC +++ media/video/video_encode_accelerator_adapter_test.cc -@@ -449,7 +449,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest, TwoFramesRes +@@ -458,7 +458,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest, TwoFramesRes CreateGreenFrame(large_size, pixel_format, base::Milliseconds(2)); VideoPixelFormat expected_input_format = PIXEL_FORMAT_I420; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (pixel_format != PIXEL_FORMAT_I420 || !small_frame->IsMappable()) expected_input_format = PIXEL_FORMAT_NV12; #endif diff --git a/www/ungoogled-chromium/files/patch-mojo_core_BUILD.gn b/www/ungoogled-chromium/files/patch-mojo_core_BUILD.gn index 9136e5fbf640..a106683122dd 100644 --- a/www/ungoogled-chromium/files/patch-mojo_core_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-mojo_core_BUILD.gn @@ -1,11 +1,11 @@ ---- mojo/core/BUILD.gn.orig 2023-02-11 09:11:04 UTC +--- mojo/core/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ mojo/core/BUILD.gn -@@ -164,7 +164,7 @@ template("core_impl_source_set") { +@@ -166,7 +166,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", diff --git a/www/ungoogled-chromium/files/patch-mojo_core_embedder_features.h b/www/ungoogled-chromium/files/patch-mojo_core_embedder_features.h index 3be83a1b6869..ee84f21cd3fd 100644 --- a/www/ungoogled-chromium/files/patch-mojo_core_embedder_features.h +++ b/www/ungoogled-chromium/files/patch-mojo_core_embedder_features.h @@ -1,11 +1,11 @@ ---- mojo/core/embedder/features.h.orig 2022-12-02 17:56:32 UTC +--- mojo/core/embedder/features.h.orig 2023-05-05 12:12:41 UTC +++ mojo/core/embedder/features.h -@@ -14,7 +14,7 @@ namespace mojo { - namespace core { +@@ -16,7 +16,7 @@ namespace core { - #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_MAC) + #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && \ + !BUILDFLAG(MOJO_USE_APPLE_CHANNEL) -#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) BASE_DECLARE_FEATURE(kMojoLinuxChannelSharedMem); diff --git a/www/ungoogled-chromium/files/patch-mojo_public_tools_bindings_mojom.gni b/www/ungoogled-chromium/files/patch-mojo_public_tools_bindings_mojom.gni index eb80b15ca119..4505f05623ce 100644 --- a/www/ungoogled-chromium/files/patch-mojo_public_tools_bindings_mojom.gni +++ b/www/ungoogled-chromium/files/patch-mojo_public_tools_bindings_mojom.gni @@ -1,19 +1,19 @@ ---- mojo/public/tools/bindings/mojom.gni.orig 2023-04-08 11:38:38 UTC +--- mojo/public/tools/bindings/mojom.gni.orig 2023-05-05 12:12:41 UTC +++ mojo/public/tools/bindings/mojom.gni -@@ -723,6 +723,16 @@ template("mojom") { +@@ -732,6 +732,16 @@ template("mojom") { enabled_features += [ "is_apple" ] } + 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) { allow_remote = true custom_processor = "mojom_parser" diff --git a/www/ungoogled-chromium/files/patch-net_BUILD.gn b/www/ungoogled-chromium/files/patch-net_BUILD.gn index a853d6a2a3fa..002b228eec99 100644 --- a/www/ungoogled-chromium/files/patch-net_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-net_BUILD.gn @@ -1,83 +1,83 @@ ---- net/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- net/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ net/BUILD.gn -@@ -104,7 +104,7 @@ net_configs = [ +@@ -107,7 +107,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" ] } -@@ -1219,6 +1219,15 @@ component("net") { +@@ -1221,6 +1221,15 @@ component("net") { deps += [ "//third_party/xdg_shared_mime_info" ] } + 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", -@@ -1351,7 +1360,7 @@ component("net") { +@@ -1347,7 +1356,7 @@ component("net") { } } - if (is_android || is_chromeos) { + if (is_android || is_chromeos || is_bsd) { sources += [ "base/network_change_notifier_posix.cc", "base/network_change_notifier_posix.h", -@@ -1384,7 +1393,7 @@ component("net") { +@@ -1380,7 +1389,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", -@@ -2828,7 +2837,7 @@ test("net_unittests") { +@@ -2824,7 +2833,7 @@ test("net_unittests") { sources += [ "proxy_resolution/proxy_config_service_linux_unittest.cc" ] } - 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", -@@ -2900,6 +2909,10 @@ test("net_unittests") { +@@ -2895,6 +2904,10 @@ test("net_unittests") { "//url:buildflags", ] + if (is_bsd) { + deps += [ "//sandbox/policy" ] + } + if (enable_websockets) { deps += [ "//net/server:tests" ] } -@@ -2967,7 +2980,7 @@ test("net_unittests") { +@@ -2962,7 +2975,7 @@ test("net_unittests") { ] } - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "tools/quic/quic_simple_server_test.cc" ] } -@@ -3092,7 +3105,7 @@ test("net_unittests") { +@@ -3090,7 +3103,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" ] } diff --git a/www/ungoogled-chromium/files/patch-net_cert_cert__verifier.cc b/www/ungoogled-chromium/files/patch-net_cert_cert__verifier.cc index 74ff6690d851..17fbb34a2730 100644 --- a/www/ungoogled-chromium/files/patch-net_cert_cert__verifier.cc +++ b/www/ungoogled-chromium/files/patch-net_cert_cert__verifier.cc @@ -1,11 +1,11 @@ ---- net/cert/cert_verifier.cc.orig 2022-12-02 17:56:32 UTC +--- net/cert/cert_verifier.cc.orig 2023-05-05 12:12:41 UTC +++ net/cert/cert_verifier.cc -@@ -87,7 +87,7 @@ std::unique_ptr CertVerifier::CreateDefa - } - #endif - if (!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) +@@ -91,7 +91,7 @@ std::unique_ptr CertVerifier::CreateDefa + #if BUILDFLAG(CHROME_ROOT_STORE_ONLY) + verify_proc = CertVerifyProc::CreateBuiltinWithChromeRootStore( + std::move(cert_net_fetcher)); +-#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) verify_proc = CertVerifyProc::CreateBuiltinVerifyProc(std::move(cert_net_fetcher)); #else diff --git a/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.cc b/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.cc index 2c30bcbe8c93..4f90ccc1aff7 100644 --- a/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.cc +++ b/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.cc @@ -1,11 +1,11 @@ ---- net/cert/cert_verify_proc.cc.orig 2023-04-08 11:38:38 UTC +--- net/cert/cert_verify_proc.cc.orig 2023-05-05 12:12:41 UTC +++ net/cert/cert_verify_proc.cc -@@ -414,7 +414,7 @@ base::Value CertVerifyParams(X509Certificate* cert, +@@ -413,7 +413,7 @@ base::Value::Dict CertVerifyParams( } // namespace --#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) -+#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) +-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \ ++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY)) // static scoped_refptr CertVerifyProc::CreateSystemVerifyProc( - scoped_refptr cert_net_fetcher) { diff --git a/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.h b/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.h index dd4ed8126889..70e76620a1db 100644 --- a/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.h +++ b/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc.h @@ -1,11 +1,11 @@ ---- net/cert/cert_verify_proc.h.orig 2023-04-08 11:38:38 UTC +--- net/cert/cert_verify_proc.h.orig 2023-05-05 12:12:41 UTC +++ net/cert/cert_verify_proc.h @@ -68,7 +68,7 @@ class NET_EXPORT CertVerifyProc kMaxValue = kChainLengthOne }; --#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) -+#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) +-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \ ++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY)) // Creates and returns a CertVerifyProc that uses the system verifier. // |cert_net_fetcher| may not be used, depending on the implementation. - static scoped_refptr CreateSystemVerifyProc( diff --git a/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc__unittest.cc b/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc__unittest.cc index 7e9f355c83ba..ccc2cec06b46 100644 --- a/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc__unittest.cc +++ b/www/ungoogled-chromium/files/patch-net_cert_cert__verify__proc__unittest.cc @@ -1,11 +1,20 @@ ---- net/cert/cert_verify_proc_unittest.cc.orig 2023-03-10 11:01:21 UTC +--- net/cert/cert_verify_proc_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ net/cert/cert_verify_proc_unittest.cc -@@ -270,7 +270,7 @@ const std::vector kAllCertVerifier - #if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) - CERT_VERIFY_PROC_BUILTIN_CHROME_ROOTS +@@ -222,7 +222,7 @@ scoped_refptr CreateCertVerifyProc( + case CERT_VERIFY_PROC_WIN: + return base::MakeRefCounted(); #endif +-#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + case CERT_VERIFY_PROC_BUILTIN: + return CreateCertVerifyProcBuiltin(std::move(cert_net_fetcher), + CreateSslSystemTrustStore()); +@@ -252,7 +252,7 @@ constexpr CertVerifyProcType kAllCertVerifiers[] = { + CERT_VERIFY_PROC_IOS, + #elif BUILDFLAG(IS_WIN) + CERT_VERIFY_PROC_WIN, -#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - CERT_VERIFY_PROC_BUILTIN - #else - #error Unsupported platform + CERT_VERIFY_PROC_BUILTIN, + #endif + #if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) diff --git a/www/ungoogled-chromium/files/patch-net_cert_test__root__certs__unittest.cc b/www/ungoogled-chromium/files/patch-net_cert_test__root__certs__unittest.cc index cbe88f4cf3eb..8951f4c4c9ee 100644 --- a/www/ungoogled-chromium/files/patch-net_cert_test__root__certs__unittest.cc +++ b/www/ungoogled-chromium/files/patch-net_cert_test__root__certs__unittest.cc @@ -1,11 +1,11 @@ ---- net/cert/test_root_certs_unittest.cc.orig 2022-12-02 17:56:32 UTC +--- net/cert/test_root_certs_unittest.cc.orig 2023-05-05 12:12:41 UTC +++ net/cert/test_root_certs_unittest.cc -@@ -39,7 +39,7 @@ scoped_refptr CreateCertVerifyProc() { - /*cert_net_fetcher=*/nullptr); - } - #endif --#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) +@@ -43,7 +43,7 @@ scoped_refptr CreateCertVerifyProc() { + #if BUILDFLAG(CHROME_ROOT_STORE_ONLY) + return CertVerifyProc::CreateBuiltinWithChromeRootStore( + /*cert_net_fetcher=*/nullptr); +-#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return CertVerifyProc::CreateBuiltinVerifyProc(/*cert_net_fetcher=*/nullptr); #else return CertVerifyProc::CreateSystemVerifyProc(/*cert_net_fetcher=*/nullptr); diff --git a/www/ungoogled-chromium/files/patch-net_dns_address__sorter__posix.cc b/www/ungoogled-chromium/files/patch-net_dns_address__sorter__posix.cc index 9b3d626f289c..11d0b1ad62c4 100644 --- a/www/ungoogled-chromium/files/patch-net_dns_address__sorter__posix.cc +++ b/www/ungoogled-chromium/files/patch-net_dns_address__sorter__posix.cc @@ -1,10 +1,10 @@ ---- net/dns/address_sorter_posix.cc.orig 2022-10-01 07:40:07 UTC +--- net/dns/address_sorter_posix.cc.orig 2023-05-05 12:12:41 UTC +++ net/dns/address_sorter_posix.cc -@@ -18,6 +18,7 @@ - #include - #include +@@ -27,6 +27,7 @@ + #include "net/dns/netinet_in_var_ios.h" + #else #include +#include - #include - #include + #endif // BUILDFLAG(IS_IOS) #endif + diff --git a/www/ungoogled-chromium/files/patch-net_http_http__auth__gssapi__posix.cc b/www/ungoogled-chromium/files/patch-net_http_http__auth__gssapi__posix.cc index b459a051430f..7a224eb0718b 100644 --- a/www/ungoogled-chromium/files/patch-net_http_http__auth__gssapi__posix.cc +++ b/www/ungoogled-chromium/files/patch-net_http_http__auth__gssapi__posix.cc @@ -1,14 +1,14 @@ ---- net/http/http_auth_gssapi_posix.cc.orig 2022-10-01 07:40:07 UTC +--- net/http/http_auth_gssapi_posix.cc.orig 2023-05-05 12:12:41 UTC +++ net/http/http_auth_gssapi_posix.cc -@@ -368,8 +368,9 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLib +@@ -370,8 +370,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 diff --git a/www/ungoogled-chromium/files/patch-net_socket_udp__socket__posix.cc b/www/ungoogled-chromium/files/patch-net_socket_udp__socket__posix.cc index bb0cdf7de45b..86f069e2a1cd 100644 --- a/www/ungoogled-chromium/files/patch-net_socket_udp__socket__posix.cc +++ b/www/ungoogled-chromium/files/patch-net_socket_udp__socket__posix.cc @@ -1,29 +1,29 @@ ---- net/socket/udp_socket_posix.cc.orig 2023-04-08 11:38:38 UTC +--- net/socket/udp_socket_posix.cc.orig 2023-05-05 12:12:41 UTC +++ net/socket/udp_socket_posix.cc -@@ -577,7 +577,7 @@ int UDPSocketPosix::SetDoNotFragment() { +@@ -576,7 +576,7 @@ int UDPSocketPosix::SetDoNotFragment() { } void UDPSocketPosix::SetMsgConfirm(bool confirm) { -#if !BUILDFLAG(IS_APPLE) +#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) if (confirm) { sendto_flags_ |= MSG_CONFIRM; } else { -@@ -598,7 +598,7 @@ int UDPSocketPosix::SetBroadcast(bool broadcast) { +@@ -597,7 +597,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. -@@ -911,7 +911,7 @@ int UDPSocketPosix::DoBind(const IPEndPoint& address) +@@ -910,7 +910,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 diff --git a/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__comparision__tool.cc b/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__comparision__tool.cc index b723e3281491..479760338c97 100644 --- a/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__comparision__tool.cc +++ b/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__comparision__tool.cc @@ -1,29 +1,29 @@ ---- net/tools/cert_verify_tool/cert_verify_comparision_tool.cc.orig 2022-10-01 07:40:07 UTC +--- net/tools/cert_verify_tool/cert_verify_comparision_tool.cc.orig 2023-05-05 12:12:41 UTC +++ 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 @@ -55,7 +55,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. // @@ -127,7 +127,7 @@ class CertVerifyImpl { std::unique_ptr CreateCertVerifyImplFromName( base::StringPiece impl_name, scoped_refptr 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 !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \ ++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY)) if (impl_name == "platform") { return std::make_unique( - "CertVerifyProc (system)", net::CertVerifyProc::CreateSystemVerifyProc( diff --git a/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__tool.cc b/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__tool.cc index 23d9adf12f58..0ebcd42b7dac 100644 --- a/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__tool.cc +++ b/www/ungoogled-chromium/files/patch-net_tools_cert__verify__tool_cert__verify__tool.cc @@ -1,38 +1,38 @@ ---- net/tools/cert_verify_tool/cert_verify_tool.cc.orig 2023-03-10 11:01:21 UTC +--- net/tools/cert_verify_tool/cert_verify_tool.cc.orig 2023-05-05 12:12:41 UTC +++ net/tools/cert_verify_tool/cert_verify_tool.cc @@ -31,7 +31,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 @@ -61,7 +61,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. // @@ -222,7 +222,7 @@ std::unique_ptr CreateCertVerifyImplFr base::StringPiece impl_name, scoped_refptr 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 !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \ ++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY)) if (impl_name == "platform") { if (root_store_type != RootStoreType::kSystem) { - std::cerr << "WARNING: platform verifier not supported with " -@@ -534,7 +534,7 @@ int main(int argc, char** argv) { +@@ -535,7 +535,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) +-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \ ++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY)) impls_str = "platform,"; #endif - impls_str += "builtin,pathbuilder"; diff --git a/www/ungoogled-chromium/files/patch-printing_backend_cups__ipp__helper.cc b/www/ungoogled-chromium/files/patch-printing_backend_cups__ipp__helper.cc index 2a44962b58a7..09e23e22069e 100644 --- a/www/ungoogled-chromium/files/patch-printing_backend_cups__ipp__helper.cc +++ b/www/ungoogled-chromium/files/patch-printing_backend_cups__ipp__helper.cc @@ -1,11 +1,11 @@ ---- printing/backend/cups_ipp_helper.cc.orig 2023-04-08 11:38:38 UTC +--- printing/backend/cups_ipp_helper.cc.orig 2023-05-05 12:12:41 UTC +++ printing/backend/cups_ipp_helper.cc -@@ -210,7 +210,7 @@ void ExtractResolutions(const CupsOptionProvider& prin +@@ -211,7 +211,7 @@ void ExtractResolutions(const CupsOptionProvider& prin // Provide a default DPI if no valid DPI is found. #if BUILDFLAG(IS_MAC) constexpr gfx::Size kDefaultMissingDpi(kDefaultMacDpi, kDefaultMacDpi); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) constexpr gfx::Size kDefaultMissingDpi(kPixelsPerInch, kPixelsPerInch); #else constexpr gfx::Size kDefaultMissingDpi(kDefaultPdfDpi, kDefaultPdfDpi); diff --git a/www/ungoogled-chromium/files/patch-printing_print__settings.h b/www/ungoogled-chromium/files/patch-printing_print__settings.h index b390894b4f49..10149fac8dc4 100644 --- a/www/ungoogled-chromium/files/patch-printing_print__settings.h +++ b/www/ungoogled-chromium/files/patch-printing_print__settings.h @@ -1,38 +1,38 @@ ---- printing/print_settings.h.orig 2023-04-08 11:38:38 UTC +--- printing/print_settings.h.orig 2023-05-05 12:12:41 UTC +++ printing/print_settings.h @@ -21,7 +21,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 #include "base/values.h" @@ -74,7 +74,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings { std::string vendor_id; }; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) using AdvancedSettings = std::map; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -241,7 +241,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings { +@@ -246,7 +246,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_; -@@ -372,7 +372,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings { +@@ -377,7 +377,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) diff --git a/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc b/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc index 04d165dae608..9b907cd7a180 100644 --- a/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc +++ b/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc @@ -1,51 +1,50 @@ ---- printing/sandbox/print_backend_sandbox_hook_linux.cc.orig 2023-02-11 09:11:04 UTC +--- printing/sandbox/print_backend_sandbox_hook_linux.cc.orig 2023-05-05 12:12:41 UTC +++ printing/sandbox/print_backend_sandbox_hook_linux.cc -@@ -10,21 +10,28 @@ +@@ -10,20 +10,27 @@ #include "base/path_service.h" #include "build/build_config.h" #include "printing/buildflags/buildflags.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" ++#include "sandbox/policy/sandbox.h" +#endif #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(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() { -@@ -85,9 +92,11 @@ std::vector GetPrintBackendFileP +@@ -76,9 +83,11 @@ std::vector GetPrintBackendFileP } } // namespace +#endif bool PrintBackendPreSandboxHook( sandbox::policy::SandboxLinux::Options options) { +#if !BUILDFLAG(IS_BSD) #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(USE_CUPS) // Create the socket connections to the CUPS server before engaging the // sandbox, since new connections cannot be made after that. -@@ -101,6 +110,7 @@ bool PrintBackendPreSandboxHook( +@@ -92,6 +101,7 @@ bool PrintBackendPreSandboxHook( sandbox::policy::SandboxLinux::PreSandboxHook(), options); instance->EngageNamespaceSandboxIfPossible(); +#endif return true; } diff --git a/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.h index 03de177e84ce..02d5caba3fe8 100644 --- a/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.h @@ -1,16 +1,16 @@ ---- printing/sandbox/print_backend_sandbox_hook_linux.h.orig 2022-10-01 07:40:07 UTC +--- printing/sandbox/print_backend_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ 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" ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace printing { diff --git a/www/ungoogled-chromium/files/patch-remoting_base_mojo__util.cc b/www/ungoogled-chromium/files/patch-remoting_base_mojo__util.cc new file mode 100644 index 000000000000..734eda48e62c --- /dev/null +++ b/www/ungoogled-chromium/files/patch-remoting_base_mojo__util.cc @@ -0,0 +1,11 @@ +--- remoting/base/mojo_util.cc.orig 2023-05-05 12:12:41 UTC ++++ remoting/base/mojo_util.cc +@@ -12,7 +12,7 @@ namespace remoting { + + void InitializeMojo(const mojo::core::Configuration& config) { + mojo::core::Configuration new_config = config; +-#if !BUILDFLAG(IS_LINUX) ++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) + // MojoIpcz has only been tested and verified on Linux. The Windows + // multi-process architecture doesn't support MojoIpcz yet. + new_config.disable_ipcz = true; diff --git a/www/ungoogled-chromium/files/patch-remoting_host_basic__desktop__environment.cc b/www/ungoogled-chromium/files/patch-remoting_host_basic__desktop__environment.cc index 8a79dd7ebc9a..1e3766a21447 100644 --- a/www/ungoogled-chromium/files/patch-remoting_host_basic__desktop__environment.cc +++ b/www/ungoogled-chromium/files/patch-remoting_host_basic__desktop__environment.cc @@ -1,11 +1,11 @@ ---- remoting/host/basic_desktop_environment.cc.orig 2023-03-10 11:01:21 UTC +--- remoting/host/basic_desktop_environment.cc.orig 2023-05-05 12:12:41 UTC +++ remoting/host/basic_desktop_environment.cc -@@ -182,7 +182,7 @@ BasicDesktopEnvironment::CreateVideoCapturer() { +@@ -188,7 +188,7 @@ BasicDesktopEnvironment::CreateVideoCapturer() { scoped_refptr capture_task_runner; #if BUILDFLAG(IS_CHROMEOS_ASH) capture_task_runner = ui_task_runner_; -#elif BUILDFLAG(IS_LINUX) && defined(REMOTING_USE_WAYLAND) +#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_WAYLAND) // Each capturer instance should get its own thread so the capturers don't // compete with each other in multistream mode. capture_task_runner = base::ThreadPool::CreateSingleThreadTaskRunner( diff --git a/www/ungoogled-chromium/files/patch-remoting_host_policy__watcher.cc b/www/ungoogled-chromium/files/patch-remoting_host_policy__watcher.cc index 50f86d9c94e7..d1910e382b95 100644 --- a/www/ungoogled-chromium/files/patch-remoting_host_policy__watcher.cc +++ b/www/ungoogled-chromium/files/patch-remoting_host_policy__watcher.cc @@ -1,11 +1,11 @@ ---- remoting/host/policy_watcher.cc.orig 2022-10-29 17:50:56 UTC +--- remoting/host/policy_watcher.cc.orig 2023-05-05 12:12:41 UTC +++ remoting/host/policy_watcher.cc -@@ -179,7 +179,7 @@ base::Value::Dict PolicyWatcher::GetDefaultPolicies() - result.Set(key::kRemoteAccessHostUdpPortRange, ""); - result.Set(key::kRemoteAccessHostClipboardSizeBytes, -1); - result.Set(key::kRemoteAccessHostAllowRemoteSupportConnections, true); +@@ -183,7 +183,7 @@ base::Value::Dict PolicyWatcher::GetDefaultPolicies() + result.Set(key::kRemoteAccessHostAllowEnterpriseRemoteSupportConnections, + true); + #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) result.Set(key::kRemoteAccessHostMatchUsername, false); #endif #if !BUILDFLAG(IS_CHROMEOS) diff --git a/www/ungoogled-chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc b/www/ungoogled-chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc index e99f8571bd62..5cbf1dc9bed9 100644 --- a/www/ungoogled-chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc +++ b/www/ungoogled-chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc @@ -1,242 +1,248 @@ ---- sandbox/policy/freebsd/sandbox_freebsd.cc.orig 2023-03-10 11:01:21 UTC +--- sandbox/policy/freebsd/sandbox_freebsd.cc.orig 2023-05-05 12:12:41 UTC +++ sandbox/policy/freebsd/sandbox_freebsd.cc -@@ -0,0 +1,239 @@ +@@ -0,0 +1,245 @@ +// 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 "sandbox/policy/freebsd/sandbox_freebsd.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#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 "crypto/crypto_buildflags.h" ++#include "ppapi/buildflags/buildflags.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 +#endif + -+#if defined(USE_NSS_CERTS) ++#if BUILDFLAG(USE_NSS_CERTS) +#include "crypto/nss_util.h" +#endif + -+#include "ui/gfx/font_util.h" -+ -+#define MAXTOKENS 3 ++#include "third_party/boringssl/src/include/openssl/crypto.h" + -+#define _UNVEIL_MAIN "/etc/ungoogled-chromium/unveil.main"; -+#define _UNVEIL_RENDERER "/etc/ungoogled-chromium/unveil.renderer"; -+#define _UNVEIL_GPU "/etc/ungoogled-chromium/unveil.gpu"; -+#define _UNVEIL_PLUGIN "/etc/ungoogled-chromium/unveil.plugin"; -+#define _UNVEIL_UTILITY "/etc/ungoogled-chromium/unveil.utility"; -+#define _UNVEIL_UTILITY_NETWORK "/etc/ungoogled-chromium/unveil.utility_network"; -+#define _UNVEIL_UTILITY_AUDIO "/etc/ungoogled-chromium/unveil.utility_audio"; -+#define _UNVEIL_UTILITY_VIDEO "/etc/ungoogled-chromium/unveil.utility_video"; ++#include "ui/gfx/font_util.h" + +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::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(); ++ switch (sandbox_type) { ++ case sandbox::mojom::Sandbox::kNoSandbox: ++ { ++#if BUILDFLAG(USE_NSS_CERTS) ++ // The main process has to initialize the ~/.pki dir which won't work ++ // after unveil(2). ++ crypto::EnsureNSSInit(); +#endif ++ CRYPTO_pre_sandbox_init(); + -+ if (process_type.empty()) { -+ base::FilePath cache_directory, local_directory; ++ base::FilePath cache_directory, local_directory; + -+ base::PathService::Get(base::DIR_CACHE, &cache_directory); -+ base::PathService::Get(base::DIR_HOME, &local_directory); ++ base::PathService::Get(base::DIR_CACHE, &cache_directory); ++ base::PathService::Get(base::DIR_HOME, &local_directory); + -+ cache_directory = cache_directory.AppendASCII("ungoogled-chromium"); -+ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications"); ++ cache_directory = cache_directory.AppendASCII("ungoogled-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(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 (!base::CreateDirectory(local_directory)) { ++ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory."; ++ } ++ ++ break; + } ++ case sandbox::mojom::Sandbox::kRenderer: ++ gfx::InitializeFonts(); ++ break; ++ default: ++ break; + } + -+ 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); + } + ++ if (hook) ++ CHECK(std::move(hook).Run(options)); ++ + 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(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"; ++#if BUILDFLAG(ENABLE_PPAPI) + case sandbox::mojom::Sandbox::kPpapi: + return "PPAPI"; ++#endif + 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 diff --git a/www/ungoogled-chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc b/www/ungoogled-chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc index 44d658475810..85df21fa903f 100644 --- a/www/ungoogled-chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc +++ b/www/ungoogled-chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc @@ -1,402 +1,423 @@ ---- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2023-03-10 11:01:21 UTC +--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2023-05-05 12:12:41 UTC +++ sandbox/policy/openbsd/sandbox_openbsd.cc -@@ -0,0 +1,399 @@ +@@ -0,0 +1,420 @@ +// 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#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 "crypto/crypto_buildflags.h" ++#include "ppapi/buildflags/buildflags.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 +#endif + -+#if defined(USE_NSS_CERTS) ++#if BUILDFLAG(USE_NSS_CERTS) +#include "crypto/nss_util.h" +#endif + +#include "third_party/boringssl/src/include/openssl/crypto.h" + +#include "ui/gfx/font_util.h" + +#define MAXTOKENS 3 + +#define _UNVEIL_MAIN "/etc/ungoogled-chromium/unveil.main"; -+#define _UNVEIL_RENDERER "/etc/ungoogled-chromium/unveil.renderer"; +#define _UNVEIL_GPU "/etc/ungoogled-chromium/unveil.gpu"; -+#define _UNVEIL_PLUGIN "/etc/ungoogled-chromium/unveil.plugin"; -+#define _UNVEIL_UTILITY "/etc/ungoogled-chromium/unveil.utility"; +#define _UNVEIL_UTILITY_NETWORK "/etc/ungoogled-chromium/unveil.utility_network"; +#define _UNVEIL_UTILITY_AUDIO "/etc/ungoogled-chromium/unveil.utility_audio"; +#define _UNVEIL_UTILITY_VIDEO "/etc/ungoogled-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::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(); ++ switch (sandbox_type) { ++ case sandbox::mojom::Sandbox::kNoSandbox: ++ { ++#if BUILDFLAG(USE_NSS_CERTS) ++ // The main process has to initialize the ~/.pki dir which won't work ++ // after unveil(2). ++ crypto::EnsureNSSInit(); +#endif ++ CRYPTO_pre_sandbox_init(); + -+ if (process_type.empty()) -+ CRYPTO_pre_sandbox_init(); ++ base::FilePath cache_directory, local_directory; + -+ 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); + -+ base::PathService::Get(base::DIR_CACHE, &cache_directory); -+ base::PathService::Get(base::DIR_HOME, &local_directory); ++ cache_directory = cache_directory.AppendASCII("ungoogled-chromium"); ++ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications"); + -+ cache_directory = cache_directory.AppendASCII("ungoogled-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(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 (!base::CreateDirectory(local_directory)) { -+ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory."; ++ break; + } ++ case sandbox::mojom::Sandbox::kRenderer: ++ gfx::InitializeFonts(); ++ break; ++ default: ++ break; + } + -+ 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; ++ VLOG(5) << "pledge " << pstring; + } 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; ++ VLOG(5) << "pledge " << s; + } + fclose(fp); + } else { -+ LOG(ERROR) << "fopen() failed, errno: " << errno; ++ LOG(ERROR) << "fopen(" << ppath << ") 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) { ++ switch (sandbox_type) { ++ case sandbox::mojom::Sandbox::kNoSandbox: ++ ufile = _UNVEIL_MAIN; ++ break; ++ case sandbox::mojom::Sandbox::kGpu: ++ ufile = _UNVEIL_GPU; ++ break; ++ case sandbox::mojom::Sandbox::kNetwork: + ufile = _UNVEIL_UTILITY_NETWORK; -+ } else if (sandbox_type == sandbox::mojom::Sandbox::kAudio) { ++ break; ++ case sandbox::mojom::Sandbox::kAudio: + ufile = _UNVEIL_UTILITY_AUDIO; -+ } else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture) { ++ break; ++ case sandbox::mojom::Sandbox::kVideoCapture: + ufile = _UNVEIL_UTILITY_VIDEO; -+ } else { -+ ufile = _UNVEIL_UTILITY; -+ } ++ break; ++ default: ++ unveil("/dev/null", "r"); ++ goto done; + } + + 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]; ++ VLOG(5) << "unveiling " << path << " with permissions " << tokens[1]; + } + } + fclose(fp); + } else { + LOG(ERROR) << "failed to open " << ufile << " errno: " << errno; + _exit(1); + } + ++done: + 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/ungoogled-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 flock 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) ++ if (hook) ++ CHECK(std::move(hook).Run(options)); ++ ++ if (!command_line->HasSwitch(switches::kDisableUnveil)) ++ SetUnveil(process_type, sandbox_type); ++ ++ switch(sandbox_type) { ++ case sandbox::mojom::Sandbox::kNoSandbox: ++ SetPledge(NULL, "/etc/ungoogled-chromium/pledge.main"); ++ break; ++ case sandbox::mojom::Sandbox::kRenderer: ++ // prot_exec needed by v8 ++ // flock needed by sqlite3 locking ++ SetPledge("stdio rpath flock prot_exec recvfd sendfd ps", NULL); ++ break; ++ case sandbox::mojom::Sandbox::kGpu: ++ SetPledge("stdio drm rpath flock cpath wpath prot_exec recvfd sendfd tmppath", NULL); ++ break; ++#if BUILDFLAG(ENABLE_PPAPI) ++ case sandbox::mojom::Sandbox::kPpapi: ++ // prot_exec needed by v8 ++ SetPledge("stdio rpath prot_exec recvfd sendfd", NULL); ++ break; ++#endif ++ case sandbox::mojom::Sandbox::kAudio: + SetPledge(NULL, "/etc/ungoogled-chromium/pledge.utility_audio"); -+ else if (sandbox_type == sandbox::mojom::Sandbox::kNetwork) ++ break; ++ case sandbox::mojom::Sandbox::kNetwork: + SetPledge(NULL, "/etc/ungoogled-chromium/pledge.utility_network"); -+ else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture) ++ break; ++ case sandbox::mojom::Sandbox::kVideoCapture: + SetPledge(NULL, "/etc/ungoogled-chromium/pledge.utility_video"); -+ else ++ break; ++ case sandbox::mojom::Sandbox::kUtility: ++ case sandbox::mojom::Sandbox::kService: + SetPledge("stdio rpath cpath wpath fattr flock sendfd recvfd prot_exec", NULL); -+ } else { -+ LOG(ERROR) << "non-pledge()'d process: " << process_type; -+ return false; ++ break; ++ default: ++ LOG(ERROR) << "non-pledge()'d process: " << GetSandboxTypeInEnglish(sandbox_type); ++ break; + } + + 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(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"; ++#if BUILDFLAG(ENABLE_PPAPI) + case sandbox::mojom::Sandbox::kPpapi: + return "PPAPI"; ++#endif + 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 diff --git a/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.cc b/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.cc index fcbaa052b6dd..c751373466db 100644 --- a/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.cc +++ b/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.cc @@ -1,22 +1,22 @@ ---- sandbox/policy/sandbox.cc.orig 2022-12-02 17:56:32 UTC +--- sandbox/policy/sandbox.cc.orig 2023-05-05 12:12:41 UTC +++ sandbox/policy/sandbox.cc @@ -18,6 +18,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" ++#include "sandbox/policy/sandbox.h" +#endif // BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_MAC) #include "sandbox/mac/seatbelt.h" #endif // BUILDFLAG(IS_MAC) @@ -31,7 +35,7 @@ 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) { diff --git a/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.h b/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.h index c07461683129..0f01c7128f5c 100644 --- a/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.h +++ b/www/ungoogled-chromium/files/patch-sandbox_policy_sandbox.h @@ -1,22 +1,24 @@ ---- sandbox/policy/sandbox.h.orig 2022-10-01 07:40:07 UTC +--- sandbox/policy/sandbox.h.orig 2023-05-05 12:12:41 UTC +++ sandbox/policy/sandbox.h -@@ -12,6 +12,10 @@ +@@ -12,6 +12,12 @@ #include "sandbox/policy/linux/sandbox_linux.h" #endif -+#if BUILDFLAG(IS_BSD) ++#if BUILDFLAG(IS_OPENBSD) +#include "sandbox/policy/openbsd/sandbox_openbsd.h" -+#endif ++#elif BUILDFLAG(IS_FREEBSD) ++#include "sandbox/policy/freebsd/sandbox_freebsd.h" ++#endif + namespace sandbox { namespace mojom { enum class Sandbox; -@@ -32,7 +36,7 @@ namespace policy { +@@ -32,7 +38,7 @@ namespace policy { 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); diff --git a/www/ungoogled-chromium/files/patch-services_audio_audio__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-services_audio_audio__sandbox__hook__linux.h index 2ec0dba49476..c671b6df4055 100644 --- a/www/ungoogled-chromium/files/patch-services_audio_audio__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-services_audio_audio__sandbox__hook__linux.h @@ -1,14 +1,14 @@ ---- services/audio/audio_sandbox_hook_linux.h.orig 2022-10-01 07:40:07 UTC +--- services/audio/audio_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ 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" ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace audio { diff --git a/www/ungoogled-chromium/files/patch-services_cert__verifier_cert__verifier__creation.cc b/www/ungoogled-chromium/files/patch-services_cert__verifier_cert__verifier__creation.cc index 9418b2e8085c..341635383b90 100644 --- a/www/ungoogled-chromium/files/patch-services_cert__verifier_cert__verifier__creation.cc +++ b/www/ungoogled-chromium/files/patch-services_cert__verifier_cert__verifier__creation.cc @@ -1,28 +1,28 @@ ---- services/cert_verifier/cert_verifier_creation.cc.orig 2023-04-08 11:38:38 UTC +--- services/cert_verifier/cert_verifier_creation.cc.orig 2023-05-05 12:12:41 UTC +++ services/cert_verifier/cert_verifier_creation.cc @@ -12,7 +12,7 @@ #include "net/cert_net/cert_net_fetcher_url_request.h" #include "net/net_buildflags.h" -#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "net/cert/cert_verify_proc_builtin.h" #include "net/cert/internal/system_trust_store.h" #endif -@@ -89,7 +89,7 @@ class OldDefaultCertVerifyProcFactory : public net::Ce +@@ -90,7 +90,7 @@ class OldDefaultCertVerifyProcFactory : public net::Ce user_slot_restriction_ ? crypto::ScopedPK11Slot(PK11_ReferenceSlot( user_slot_restriction_.get())) : nullptr)); -#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) verify_proc = net::CreateCertVerifyProcBuiltin( std::move(cert_net_fetcher), net::CreateSslSystemTrustStore()); #else -@@ -226,6 +226,7 @@ std::unique_ptr Cr +@@ -225,6 +225,7 @@ std::unique_ptr Cr bool IsUsingCertNetFetcher() { #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_BSD) || \ BUILDFLAG(TRIAL_COMPARISON_CERT_VERIFIER_SUPPORTED) || \ BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) return true; diff --git a/www/ungoogled-chromium/files/patch-services_device_compute__pressure_cpu__probe.cc b/www/ungoogled-chromium/files/patch-services_device_compute__pressure_cpu__probe.cc index f04aeb629198..1378a2940b46 100644 --- a/www/ungoogled-chromium/files/patch-services_device_compute__pressure_cpu__probe.cc +++ b/www/ungoogled-chromium/files/patch-services_device_compute__pressure_cpu__probe.cc @@ -1,10 +1,10 @@ ---- services/device/compute_pressure/cpu_probe.cc.orig 2022-12-02 17:56:32 UTC +--- services/device/compute_pressure/cpu_probe.cc.orig 2023-05-05 12:12:41 UTC +++ services/device/compute_pressure/cpu_probe.cc -@@ -29,6 +29,7 @@ std::unique_ptr CpuProbe::Create() { +@@ -44,6 +44,7 @@ std::unique_ptr CpuProbe::Create( #elif BUILDFLAG(IS_MAC) - return CpuProbeMac::Create(); + return CpuProbeMac::Create(sampling_interval, std::move(sampling_callback)); #else + NOTIMPLEMENTED(); return nullptr; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) } diff --git a/www/ungoogled-chromium/files/patch-services_device_public_mojom_BUILD.gn b/www/ungoogled-chromium/files/patch-services_device_public_mojom_BUILD.gn index 7873b2f6c96a..b511720d5f6f 100644 --- a/www/ungoogled-chromium/files/patch-services_device_public_mojom_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-services_device_public_mojom_BUILD.gn @@ -1,11 +1,11 @@ ---- services/device/public/mojom/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- services/device/public/mojom/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ services/device/public/mojom/BUILD.gn -@@ -90,7 +90,7 @@ mojom("device_service") { - cpp_only = true +@@ -97,7 +97,7 @@ mojom("device_service") { + enable_js_fuzzing = false enabled_features = [] - if ((is_linux || is_chromeos) && use_udev) { + if ((is_linux || is_chromeos) && !is_bsd && use_udev) { enabled_features += [ "enable_input_device_manager" ] } diff --git a/www/ungoogled-chromium/files/patch-services_network_BUILD.gn b/www/ungoogled-chromium/files/patch-services_network_BUILD.gn index cb7cc199b15b..cd776ec0d661 100644 --- a/www/ungoogled-chromium/files/patch-services_network_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-services_network_BUILD.gn @@ -1,10 +1,10 @@ ---- services/network/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- services/network/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ services/network/BUILD.gn -@@ -338,7 +338,6 @@ if (is_linux || is_chromeos) { +@@ -333,7 +333,6 @@ if (is_linux || is_chromeos) { ] deps = [ "//base:base", - "//sandbox/linux:sandbox_services", "//sandbox/policy:policy", ] } diff --git a/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.cc b/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.cc index b573a006b604..5874a1c894e5 100644 --- a/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.cc +++ b/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.cc @@ -1,26 +1,36 @@ ---- services/network/network_sandbox_hook_linux.cc.orig 2022-10-01 07:40:07 UTC +--- services/network/network_sandbox_hook_linux.cc.orig 2023-05-05 12:12:41 UTC +++ services/network/network_sandbox_hook_linux.cc -@@ -26,12 +26,15 @@ sandbox::syscall_broker::BrokerCommandSet GetNetworkBr - }); - } +@@ -8,11 +8,14 @@ + #include "base/rand_util.h" + #include "base/system/sys_info.h" + ++#if !defined(OS_BSD) + using sandbox::syscall_broker::BrokerFilePermission; + using sandbox::syscall_broker::MakeBrokerCommandSet; ++#endif + + namespace network { +#if !defined(OS_BSD) - std::vector GetNetworkFilePermissions() { + sandbox::syscall_broker::BrokerCommandSet GetNetworkBrokerCommandSet() { + return MakeBrokerCommandSet({ + sandbox::syscall_broker::COMMAND_ACCESS, +@@ -30,8 +33,10 @@ std::vector GetNetworkFilePermis // 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 +@@ -39,6 +44,7 @@ bool NetworkPreSandboxHook(sandbox::policy::SandboxLin sandbox::policy::SandboxLinux::PreSandboxHook(), options); instance->EngageNamespaceSandboxIfPossible(); +#endif return true; } diff --git a/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.h b/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.h index 03f716e23fea..15a6819078b2 100644 --- a/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.h +++ b/www/ungoogled-chromium/files/patch-services_network_network__sandbox__hook__linux.h @@ -1,14 +1,14 @@ ---- services/network/network_sandbox_hook_linux.h.orig 2022-10-01 07:40:07 UTC +--- services/network/network_sandbox_hook_linux.h.orig 2023-05-05 12:12:41 UTC +++ services/network/network_sandbox_hook_linux.h -@@ -10,7 +10,11 @@ +@@ -6,7 +6,11 @@ + #define SERVICES_NETWORK_NETWORK_SANDBOX_HOOK_LINUX_H_ + #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" ++#if defined(__OpenBSD__) || defined(__FreeBSD__) ++#include "sandbox/policy/sandbox.h" +#else #include "sandbox/policy/linux/sandbox_linux.h" +#endif namespace network { diff --git a/www/ungoogled-chromium/files/patch-services_network_network__service.cc b/www/ungoogled-chromium/files/patch-services_network_network__service.cc index 7c55179a4464..13927ece4195 100644 --- a/www/ungoogled-chromium/files/patch-services_network_network__service.cc +++ b/www/ungoogled-chromium/files/patch-services_network_network__service.cc @@ -1,11 +1,11 @@ ---- services/network/network_service.cc.orig 2023-04-08 11:38:38 UTC +--- services/network/network_service.cc.orig 2023-05-05 12:12:41 UTC +++ services/network/network_service.cc @@ -89,7 +89,7 @@ #include "third_party/boringssl/src/include/openssl/cpu.h" #endif -#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || \ +#if ((BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD)) || \ BUILDFLAG(IS_CHROMEOS_LACROS) - #include "components/os_crypt/key_storage_config_linux.h" + #include "components/os_crypt/sync/key_storage_config_linux.h" diff --git a/www/ungoogled-chromium/files/patch-skia_ext_SkMemory__new__handler.cpp b/www/ungoogled-chromium/files/patch-skia_ext_SkMemory__new__handler.cpp index c5d5605f89f8..61f6c9aceade 100644 --- a/www/ungoogled-chromium/files/patch-skia_ext_SkMemory__new__handler.cpp +++ b/www/ungoogled-chromium/files/patch-skia_ext_SkMemory__new__handler.cpp @@ -1,11 +1,11 @@ ---- skia/ext/SkMemory_new_handler.cpp.orig 2022-10-01 07:40:07 UTC +--- skia/ext/SkMemory_new_handler.cpp.orig 2023-05-05 12:12:41 UTC +++ skia/ext/SkMemory_new_handler.cpp -@@ -79,7 +79,7 @@ static void* malloc_nothrow(size_t size) { +@@ -86,7 +86,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. diff --git a/www/ungoogled-chromium/files/patch-third__party_abseil-cpp_absl_base_config.h b/www/ungoogled-chromium/files/patch-third__party_abseil-cpp_absl_base_config.h index b27739a7e3a0..c46960b65c49 100644 --- a/www/ungoogled-chromium/files/patch-third__party_abseil-cpp_absl_base_config.h +++ b/www/ungoogled-chromium/files/patch-third__party_abseil-cpp_absl_base_config.h @@ -1,21 +1,21 @@ ---- third_party/abseil-cpp/absl/base/config.h.orig 2022-12-02 17:56:32 UTC +--- third_party/abseil-cpp/absl/base/config.h.orig 2023-05-05 12:12:41 UTC +++ third_party/abseil-cpp/absl/base/config.h -@@ -460,7 +460,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != +@@ -443,7 +443,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 -@@ -475,7 +476,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != +@@ -458,7 +459,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 diff --git a/www/ungoogled-chromium/files/patch-third__party_angle_BUILD.gn b/www/ungoogled-chromium/files/patch-third__party_angle_BUILD.gn index 6667a50e7cd8..4e9e9ab1e63b 100644 --- a/www/ungoogled-chromium/files/patch-third__party_angle_BUILD.gn +++ b/www/ungoogled-chromium/files/patch-third__party_angle_BUILD.gn @@ -1,29 +1,29 @@ ---- third_party/angle/BUILD.gn.orig 2023-04-08 11:38:38 UTC +--- third_party/angle/BUILD.gn.orig 2023-05-05 12:12:41 UTC +++ third_party/angle/BUILD.gn -@@ -280,7 +280,6 @@ config("extra_warnings") { +@@ -286,7 +286,6 @@ config("extra_warnings") { "-Wtautological-type-limit-compare", "-Wundefined-reinterpret-cast", "-Wunneeded-internal-declaration", - "-Wunused-but-set-variable", "-Wsuggest-destructor-override", "-Wsuggest-override", -@@ -451,7 +450,7 @@ template("angle_common_lib") { +@@ -457,7 +456,7 @@ template("angle_common_lib") { all_dependent_configs = [ ":angle_disable_pool_alloc" ] } - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { libs = [ "dl" ] } -@@ -606,6 +605,9 @@ angle_static_library("angle_gpu_info_util") { +@@ -612,6 +611,9 @@ angle_static_library("angle_gpu_info_util") { "Xi", "Xext", ] + if (is_bsd) { + libs += [ "GL" ] + } } if (angle_use_wayland && angle_has_build) { diff --git a/www/ungoogled-chromium/files/patch-third__party_angle_src_libANGLE_formatutils.cpp b/www/ungoogled-chromium/files/patch-third__party_angle_src_libANGLE_formatutils.cpp index c824e07997df..2c12397f7975 100644 --- a/www/ungoogled-chromium/files/patch-third__party_angle_src_libANGLE_formatutils.cpp +++ b/www/ungoogled-chromium/files/patch-third__party_angle_src_libANGLE_formatutils.cpp @@ -1,11 +1,11 @@ ---- third_party/angle/src/libANGLE/formatutils.cpp.orig 2023-04-20 13:16:39 UTC +--- third_party/angle/src/libANGLE/formatutils.cpp.orig 2023-05-05 12:12:41 UTC +++ third_party/angle/src/libANGLE/formatutils.cpp -@@ -1486,7 +1486,7 @@ static InternalFormatInfoMap BuildInternalFormatInfoMa +@@ -1485,7 +1485,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. diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_common_privacy__budget_active__sampling.cc b/www/ungoogled-chromium/files/patch-third__party_blink_common_privacy__budget_active__sampling.cc deleted file mode 100644 index af6268fdd5d7..000000000000 --- a/www/ungoogled-chromium/files/patch-third__party_blink_common_privacy__budget_active__sampling.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- third_party/blink/common/privacy_budget/active_sampling.cc.orig 2022-10-01 07:40:07 UTC -+++ third_party/blink/common/privacy_budget/active_sampling.cc -@@ -24,7 +24,7 @@ namespace blink { - bool IdentifiabilityActiveSampler::IsFontFamilyAvailable(const char* family, - SkFontMgr* fm) { - base::ScopedAllowBaseSyncPrimitives allow; --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - return !!fm->legacyMakeTypeface(family, SkFontStyle()); - #else - sk_sp set(fm->matchFamily(family)); diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_public_platform_platform.h b/www/ungoogled-chromium/files/patch-third__party_blink_public_platform_platform.h index 10e0564d1954..a4de03788b01 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_public_platform_platform.h +++ b/www/ungoogled-chromium/files/patch-third__party_blink_public_platform_platform.h @@ -1,11 +1,11 @@ ---- third_party/blink/public/platform/platform.h.orig 2023-04-08 11:38:38 UTC +--- third_party/blink/public/platform/platform.h.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/public/platform/platform.h -@@ -349,7 +349,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -343,7 +343,7 @@ class BLINK_PLATFORM_EXPORT Platform { return nullptr; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // This is called after the thread is created, so the embedder // can initiate an IPC to change its thread type (on Linux we can't // increase the nice value, so we need to ask the browser process). This diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_controller_blink__initializer.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_controller_blink__initializer.cc index 1f8b8b3a9d42..9eba5fcc5466 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_controller_blink__initializer.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_controller_blink__initializer.cc @@ -1,35 +1,35 @@ ---- third_party/blink/renderer/controller/blink_initializer.cc.orig 2023-04-08 11:38:38 UTC +--- third_party/blink/renderer/controller/blink_initializer.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/controller/blink_initializer.cc -@@ -74,12 +74,12 @@ +@@ -78,12 +78,12 @@ #include "third_party/blink/renderer/controller/private_memory_footprint_provider.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 -@@ -222,7 +222,7 @@ void BlinkInitializer::RegisterInterfaces(mojo::Binder +@@ -231,7 +231,7 @@ void BlinkInitializer::RegisterInterfaces(mojo::Binder main_thread_task_runner); #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) binders.Add( ConvertToBaseRepeatingCallback( CrossThreadBindRepeating(&MemoryUsageMonitorPosix::Bind)), -@@ -255,7 +255,7 @@ void BlinkInitializer::RegisterMemoryWatchers() { +@@ -270,7 +270,7 @@ void BlinkInitializer::RegisterMemoryWatchers(Platform #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. - UserLevelMemoryPressureSignalGenerator::Initialize(main_thread_task_runner); - + // Start reporting the highest private memory footprint after the first + // navigation. + HighestPmfReporter::Initialize(main_thread_task_runner); diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc index b34f2904f825..baf00c630849 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc @@ -1,20 +1,20 @@ ---- third_party/blink/renderer/core/exported/web_view_impl.cc.orig 2023-04-08 11:38:38 UTC +--- third_party/blink/renderer/core/exported/web_view_impl.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -408,7 +408,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' -@@ -3344,7 +3344,7 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs +@@ -3348,7 +3348,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( diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc index 0c2b556ff887..437d68cf18d9 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc @@ -1,20 +1,20 @@ ---- third_party/blink/renderer/core/frame/web_frame_test.cc.orig 2023-04-08 11:38:38 UTC +--- third_party/blink/renderer/core/frame/web_frame_test.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/core/frame/web_frame_test.cc -@@ -6439,7 +6439,7 @@ TEST_F(WebFrameTest, DISABLED_PositionForPointTest) { +@@ -6458,7 +6458,7 @@ TEST_F(WebFrameTest, DISABLED_PositionForPointTest) { } #if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) // TODO(crbug.com/1090246): Fix these tests on Fuchsia and re-enable. // TODO(crbug.com/1317375): Build these tests on all platforms. #define MAYBE_SelectRangeStaysHorizontallyAlignedWhenMoved \ -@@ -6847,7 +6847,7 @@ TEST_F(CompositedSelectionBoundsTest, LargeSelectionSc +@@ -6866,7 +6866,7 @@ TEST_F(CompositedSelectionBoundsTest, LargeSelectionSc TEST_F(CompositedSelectionBoundsTest, LargeSelectionNoScroll) { RunTest("composited_selection_bounds_large_selection_noscroll.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); diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_layout_ng_grid_ng__grid__layout__algorithm.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_layout_ng_grid_ng__grid__layout__algorithm.cc new file mode 100644 index 000000000000..646d58eec798 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_layout_ng_grid_ng__grid__layout__algorithm.cc @@ -0,0 +1,34 @@ +--- third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.orig 2023-05-05 12:12:41 UTC ++++ third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +@@ -516,8 +516,15 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtr + row_auto_repetitions); + + bool has_nested_subgrid = false; ++#if defined(__clang__) && (__clang_major__ >= 16) + auto& [grid_items, layout_data, subtree_size] = + sizing_tree->CreateSizingData(); ++#else ++ auto& sizing_data = sizing_tree->CreateSizingData(); ++ auto& layout_data = sizing_data.layout_data; ++ auto& grid_items = sizing_data.grid_items; ++ auto& subtree_size = sizing_data.subtree_size; ++#endif + + if (!must_ignore_children) { + // Construct grid items that are not subgridded. +@@ -1540,8 +1547,15 @@ void NGGridLayoutAlgorithm::InitializeTrackSizes( + NGGridSizingTree* sizing_tree) const { + DCHECK(sizing_tree && current_grid_index < sizing_tree->Size()); + ++#if defined(__clang__) && (__clang_major__ >= 16) + auto& [grid_items, layout_data, subtree_size] = + sizing_tree->At(current_grid_index); ++#else ++ auto& sizing_data = sizing_tree->At(current_grid_index); ++ auto& layout_data = sizing_data.layout_data; ++ auto& grid_items = sizing_data.grid_items; ++ auto& subtree_size = sizing_data.subtree_size; ++#endif + + auto InitAndCacheTrackSizes = [&](GridTrackSizingDirection track_direction) { + InitializeTrackCollection(opt_subgrid_data, track_direction, &layout_data); diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_paint_paint__layer.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_paint_paint__layer.cc index d24e65ace991..07e7eaa225f4 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_paint_paint__layer.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_core_paint_paint__layer.cc @@ -1,11 +1,11 @@ ---- third_party/blink/renderer/core/paint/paint_layer.cc.orig 2023-02-11 09:11:04 UTC +--- third_party/blink/renderer/core/paint/paint_layer.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/core/paint/paint_layer.cc -@@ -114,7 +114,7 @@ namespace blink { +@@ -115,7 +115,7 @@ namespace blink { namespace { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) struct SameSizeAsPaintLayer : GarbageCollected, DisplayItemClient { // The bit fields may fit into the machine word of DisplayItemClient which // has only 8-bit data. diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc index 9f76c3ba087f..144c1fd2fdfc 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc @@ -1,11 +1,11 @@ ---- third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc.orig 2022-12-02 17:56:32 UTC +--- third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc @@ -722,7 +722,7 @@ TEST_F(AudioRendererMixerManagerTest, MixerParamsLaten mixer->get_output_params_for_testing().sample_rate()); - #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \ - 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()); diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_features.gni b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_features.gni index 759f906af4b1..6cf7643628ce 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_features.gni +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_features.gni @@ -1,9 +1,9 @@ ---- third_party/blink/renderer/modules/ml/webnn/features.gni.orig 2023-04-08 11:38:38 UTC +--- third_party/blink/renderer/modules/ml/webnn/features.gni.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/modules/ml/webnn/features.gni @@ -7,5 +7,5 @@ declare_args() { # This enables building WebNN with XNNPACK. Currently only available for - # Windows on x64 or x86. + # Windows and Linux on x64 or x86. build_webnn_with_xnnpack = -- is_win && (current_cpu == "x64" || current_cpu == "x86") +- (is_linux || is_win) && (current_cpu == "x64" || current_cpu == "x86") + !is_bsd && (is_win && (current_cpu == "x64" || current_cpu == "x86")) } diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_ml__graph__xnnpack.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_ml__graph__xnnpack.cc index facde13fc734..17d35c07c938 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_ml__graph__xnnpack.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_ml_webnn_ml__graph__xnnpack.cc @@ -1,11 +1,11 @@ ---- third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc.orig 2023-04-08 11:38:38 UTC +--- third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc -@@ -177,7 +177,7 @@ class SharedXnnpackContext : public ThreadSafeRefCount +@@ -180,7 +180,7 @@ class SharedXnnpackContext : public ThreadSafeRefCount ~SharedXnnpackContext() { base::AutoLock auto_lock(SharedXnnpackContextLock()); -#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) +#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) // For Linux and ChromeOS, cpuinfo needs to parse /proc/cpuinfo to // initialize in pre sandbox stage. Calling xnn_deinitialize() here will // deinitialize cpuinfo within sandbox and cannot access /proc/cpuinfo diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc index 4365febd7b6c..254698e2c935 100644 --- a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc +++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc @@ -1,11 +1,11 @@ ---- third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc.orig 2023-03-10 11:01:21 UTC +--- third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc.orig 2023-05-05 12:12:41 UTC +++ third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -6229,7 +6229,7 @@ void WebGLRenderingContextBase::TexImageHelperMediaVid +@@ -6233,7 +6233,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