diff --git a/www/chromium/Makefile b/www/chromium/Makefile index 1b8b5e518c21..761ccbaee13c 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,358 +1,357 @@ PORTNAME= chromium -PORTVERSION= 110.0.5481.177 -PORTREVISION= 1 +PORTVERSION= 111.0.5563.64 CATEGORIES= www wayland MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ https://nerd.hu/distfiles/:external DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ chrome-linux-${PORTVERSION}-llvm13.profdata${EXTRACT_SUFX}:external MAINTAINER= chromium@FreeBSD.org COMMENT= Google web browser based on WebKit WWW= https://www.chromium.org/Home LICENSE= BSD3CLAUSE LGPL21 MPL11 LICENSE_COMB= multi ONLY_FOR_ARCHS= aarch64 amd64 i386 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 \ 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 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+= clang_use_chrome_plugins=false \ enable_backup_ref_ptr_support=false \ enable_hangout_services_extension=true \ enable_js_type_check=false \ enable_nacl=false \ enable_remoting=false \ fatal_linker_warnings=false \ icu_use_data_file=false \ is_clang=true \ optimize_webui=true \ toolkit_views=true \ treat_warnings_as_errors=false \ 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}" # TODO: investigate building with these options: # use_system_minigbm GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles # FreeBSD Chromium Api Key # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . # Note: these are for FreeBSD use ONLY. For your own distribution, # please get your own set of keys. GN_ARGS+= google_api_key="AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8" SUB_FILES= chromium-browser.desktop chrome 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= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX} \ test_fonts-336e775eec536b2d785cc80eff6ac39051931286.tar.gz:external TEST_ALL_TARGET= ${TEST_TARGETS} .include .include .if ${OSREL} == "12.3" IGNORE= does not compile, libc++ too old .endif .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} != 130 LLVM_DEFAULT= 13 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 pre-everything:: @${ECHO_MSG} @${ECHO_MSG} "To build 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-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 \ 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/chrome.1 @${SED} -i "" -e 's,\@\@PACKAGE\@\@,chromium,g;s,\@\@MENUNAME\@\@,Chromium Web Browser,g' \ ${STAGEDIR}${MANPREFIX}/man/man1/chrome.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/chrome.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} cd ${WRKSRC}/out/${BUILDTYPE} && \ ${COPYTREE_SHARE} "locales resources" ${STAGEDIR}${DATADIR} @${MKDIR} ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/chromium-browser.desktop \ ${STAGEDIR}${DESKTOPDIR} ${INSTALL_SCRIPT} ${WRKDIR}/chrome ${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.unstripped \ ${STAGEDIR}${PREFIX}/bin/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/chromium/distinfo b/www/chromium/distinfo index 5aed2d667b40..78f48bfc872c 100644 --- a/www/chromium/distinfo +++ b/www/chromium/distinfo @@ -1,9 +1,9 @@ -TIMESTAMP = 1677095067 -SHA256 (chromium-110.0.5481.177.tar.xz) = 7b2f454d1195270a39f94a9ff6d8d68126be315e0da4e31c20f4ba9183a1c9b7 -SIZE (chromium-110.0.5481.177.tar.xz) = 1703390456 -SHA256 (chrome-linux-110.0.5481.177-llvm13.profdata.tar.xz) = 15110efdd507aea4b7da04331f42bed05d0e883e42d196c1568c5dd4678d68ba -SIZE (chrome-linux-110.0.5481.177-llvm13.profdata.tar.xz) = 26252440 -SHA256 (chromium-110.0.5481.177-testdata.tar.xz) = f8c092b99b1a29cbd6e7deb6868c84ac4e05a276584332971c0a578a7187b06d -SIZE (chromium-110.0.5481.177-testdata.tar.xz) = 265092148 +TIMESTAMP = 1678302648 +SHA256 (chromium-111.0.5563.64.tar.xz) = 7d5ca0e2bdb22a97713e6bfce74c651006d71aa883056c8e2c2a148039fe4074 +SIZE (chromium-111.0.5563.64.tar.xz) = 1740670460 +SHA256 (chrome-linux-111.0.5563.64-llvm13.profdata.tar.xz) = 4cc5876ee99fad5560dc5530aa16d2ac528c5a0b0675fe4390d38de1aabbe837 +SIZE (chrome-linux-111.0.5563.64-llvm13.profdata.tar.xz) = 26296256 +SHA256 (chromium-111.0.5563.64-testdata.tar.xz) = 944ddbc5c47541498d18f0f4d49d8dfe2f38c3553e8d589c1150748c6c7383eb +SIZE (chromium-111.0.5563.64-testdata.tar.xz) = 263698728 SHA256 (test_fonts-336e775eec536b2d785cc80eff6ac39051931286.tar.gz) = a2ca2962daf482a8f943163541e1c73ba4b2694fabcd2510981f2db4eda493c8 SIZE (test_fonts-336e775eec536b2d785cc80eff6ac39051931286.tar.gz) = 32624734 diff --git a/www/chromium/files/patch-BUILD.gn b/www/chromium/files/patch-BUILD.gn index cb1d395e4284..2fe95839e835 100644 --- a/www/chromium/files/patch-BUILD.gn +++ b/www/chromium/files/patch-BUILD.gn @@ -1,89 +1,89 @@ ---- BUILD.gn.orig 2023-02-08 09:03:45 UTC +--- BUILD.gn.orig 2023-03-09 06:31:50 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") { "//codelabs", "//components:components_unittests", "//components/gwp_asan:gwp_asan_unittests", - "//infra/orchestrator:orchestrator_all", "//net:net_unittests", "//sandbox:sandbox_unittests", "//services:services_unittests", -@@ -425,7 +424,7 @@ group("gn_all") { - ] +@@ -417,7 +416,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", -@@ -624,6 +623,15 @@ group("gn_all") { +@@ -616,6 +615,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", -@@ -672,7 +680,7 @@ group("gn_all") { +@@ -664,7 +672,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)" ] } -@@ -1094,7 +1102,7 @@ if (!is_ios) { +@@ -1086,7 +1094,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") { -@@ -1190,7 +1198,7 @@ if (!is_ios) { +@@ -1186,7 +1194,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)" ] } -@@ -1199,7 +1207,7 @@ if (!is_ios) { +@@ -1195,7 +1203,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)" ] } -@@ -1664,7 +1672,7 @@ group("chromium_builder_perf") { +@@ -1661,7 +1669,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/chromium/files/patch-base_BUILD.gn b/www/chromium/files/patch-base_BUILD.gn index 4878977ee27c..1dbc9ff8dbe4 100644 --- a/www/chromium/files/patch-base_BUILD.gn +++ b/www/chromium/files/patch-base_BUILD.gn @@ -1,163 +1,163 @@ ---- base/BUILD.gn.orig 2023-02-08 09:03:45 UTC +--- base/BUILD.gn.orig 2023-03-09 06:31:50 UTC +++ base/BUILD.gn -@@ -162,7 +162,7 @@ buildflag_header("ios_cronet_buildflags") { +@@ -168,7 +168,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" -@@ -1052,7 +1052,7 @@ component("base") { +@@ -1053,7 +1053,7 @@ component("base") { "timer/hi_res_timer_manager_posix.cc", ] - if (!is_nacl && !is_apple) { + if (!is_nacl && !is_apple && !is_bsd) { sources += [ "profiler/stack_base_address_posix.cc", "profiler/stack_base_address_posix.h", -@@ -1063,6 +1063,14 @@ component("base") { +@@ -1064,6 +1064,14 @@ component("base") { "profiler/thread_delegate_posix.h", ] } + + if (is_bsd) { + sources += [ + "profiler/stack_base_address_posix.cc", + "profiler/stack_base_address_posix.h", + "profiler/stack_sampler_posix.cc", + ] + } } if (is_win) { -@@ -1550,11 +1558,23 @@ component("base") { +@@ -1544,11 +1552,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", -@@ -1582,7 +1602,7 @@ component("base") { +@@ -1576,7 +1596,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", -@@ -1623,7 +1643,7 @@ component("base") { +@@ -1617,7 +1637,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" ] } -@@ -2211,6 +2231,39 @@ component("base") { +@@ -2208,6 +2228,39 @@ 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" + ] + 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 -= [ -@@ -2306,7 +2359,7 @@ component("base") { +@@ -2303,7 +2356,7 @@ component("base") { } if (dep_libevent) { - deps += [ "//third_party/libevent" ] + public_deps += [ "//third_party/libevent" ] } if (use_libevent) { -@@ -3560,7 +3613,7 @@ test("base_unittests") { +@@ -3556,7 +3609,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", -@@ -3606,7 +3659,7 @@ test("base_unittests") { +@@ -3602,7 +3655,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", -@@ -3617,7 +3670,7 @@ test("base_unittests") { +@@ -3613,7 +3666,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" ] } -@@ -3827,7 +3880,7 @@ test("base_unittests") { +@@ -3829,7 +3882,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/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h b/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h index f16c9802cfb4..8731ac08d5c9 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h @@ -1,20 +1,20 @@ ---- base/allocator/partition_allocator/address_space_randomization.h.orig 2022-06-17 14:20:10 UTC +--- base/allocator/partition_allocator/address_space_randomization.h.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/address_space_randomization.h @@ -38,7 +38,7 @@ AslrMask(uintptr_t bits) { #if defined(ARCH_CPU_64_BITS) - #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) + #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && !defined(OS_BSD) // We shouldn't allocate system pages at all for sanitizer builds. However, // we do, and if random hint addresses interfere with address ranges -@@ -128,7 +128,7 @@ AslrMask(uintptr_t bits) { +@@ -124,7 +124,7 @@ AslrMask(uintptr_t bits) { return AslrAddress(0x20000000ULL); } - #elif BUILDFLAG(IS_LINUX) + #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Linux on arm64 can use 39, 42, 48, or 52-bit user space, depending on // page size and number of levels of translation pages used. We use diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__address__space.cc b/www/chromium/files/patch-base_allocator_partition__allocator_partition__address__space.cc index 7bf33397cb03..d20b0e1f28b4 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__address__space.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__address__space.cc @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/partition_address_space.cc.orig 2023-02-08 09:03:45 UTC +--- base/allocator/partition_allocator/partition_address_space.cc.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/partition_address_space.cc -@@ -440,7 +440,7 @@ void PartitionAddressSpace::UninitPkeyPoolForTesting() +@@ -416,7 +416,7 @@ void PartitionAddressSpace::UninitPkeyPoolForTesting() } #endif -#if BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64) PageCharacteristics page_characteristics; diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni index 336fa065c293..d033b2bb529b 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.gni @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/partition_alloc.gni.orig 2023-02-08 09:03:45 UTC +--- base/allocator/partition_allocator/partition_alloc.gni.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/partition_alloc.gni -@@ -200,7 +200,7 @@ assert(!use_asan_unowned_ptr || is_asan, - "AsanUnownedPtr requires AddressSanitizer") +@@ -233,7 +233,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/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h index 662c25d52366..a0673b1de88b 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h +++ b/www/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-02-08 09:03:45 UTC +--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/partition_alloc_config.h -@@ -84,7 +84,7 @@ static_assert(sizeof(void*) != 8, ""); - +@@ -120,7 +120,7 @@ static_assert(sizeof(void*) != 8, ""); // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific // features such as futex(2). --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - #define PA_HAS_LINUX_KERNEL - #endif - -@@ -220,7 +220,7 @@ constexpr bool kUseLazyCommit = false; + #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, +@@ -267,7 +267,7 @@ constexpr bool kUseLazyCommit = false; // On these platforms, lock all the partitions before fork(), and unlock after. // This may be required on more platforms in the future. --#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - #define PA_HAS_ATFORK_HANDLER - #endif + #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)) -@@ -264,7 +264,7 @@ constexpr bool kUseLazyCommit = false; - // + // PartitionAlloc uses PartitionRootEnumerator to acquire all + // PartitionRoots at BeforeFork and to release at AfterFork. +@@ -312,7 +312,7 @@ constexpr bool kUseLazyCommit = false; // Also enabled on ARM64 macOS, as the 16kiB pages on this platform lead to // larger slot spans. --#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) -+#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) || BUILDFLAG(IS_BSD) - #define PA_PREFER_SMALLER_SLOT_SPANS - #endif + #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/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h index 62a3285219aa..5d8a2a2b1826 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h +++ b/www/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-02-08 09:03:45 UTC +--- base/allocator/partition_allocator/partition_alloc_constants.h.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/partition_alloc_constants.h @@ -91,7 +91,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 PartitionPageShift() { return PageAllocationGranularityShift() + 2; -@@ -278,7 +278,7 @@ constexpr size_t kNumPools = 3; +@@ -277,7 +277,7 @@ constexpr size_t kNumPools = 3; + // // When pointer compression is enabled, we cannot use large pools (at most // 8GB for each of the glued pools). - #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || \ -- defined(PA_POINTER_COMPRESSION) -+ defined(PA_POINTER_COMPRESSION) || BUILDFLAG(IS_BSD) +-#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/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__forward.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__forward.h index fbaa149594dc..816b59743e8e 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__forward.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__forward.h @@ -1,16 +1,16 @@ ---- base/allocator/partition_allocator/partition_alloc_forward.h.orig 2022-11-06 16:08:29 UTC +--- base/allocator/partition_allocator/partition_alloc_forward.h.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/partition_alloc_forward.h -@@ -25,9 +25,13 @@ namespace internal { +@@ -27,9 +27,13 @@ namespace internal { // the second one 16. We could technically return something different for // malloc() and operator new(), but this would complicate things, and most of // our allocations are presumably coming from operator new() anyway. +#if defined(__i386__) && defined(OS_FREEBSD) +constexpr size_t kAlignment = 8; +#else constexpr size_t kAlignment = std::max(alignof(max_align_t), static_cast(__STDCPP_DEFAULT_NEW_ALIGNMENT__)); +#endif static_assert(kAlignment <= 16, "PartitionAlloc doesn't support a fundamental alignment larger " "than 16 bytes."); diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.cc b/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.cc index e86be6c47792..3888bdcf2004 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.cc @@ -1,38 +1,38 @@ ---- base/allocator/partition_allocator/partition_root.cc.orig 2023-01-11 09:17:16 UTC +--- base/allocator/partition_allocator/partition_root.cc.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/partition_root.cc @@ -42,7 +42,7 @@ #include "wow64apiset.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #endif -@@ -239,7 +239,7 @@ void PartitionAllocMallocInitOnce() { - if (!g_global_init_called.compare_exchange_strong(expected, true)) +@@ -245,7 +245,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. -@@ -332,7 +332,7 @@ static size_t PartitionPurgeSlotSpan( +@@ -339,7 +339,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 -@@ -789,7 +789,7 @@ void PartitionRoot::Init(PartitionOptions +@@ -800,7 +800,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/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc b/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc index 4d89110c7401..4a64c356f7b0 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc @@ -1,47 +1,53 @@ ---- base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-07-22 17:30:31 UTC +--- base/allocator/partition_allocator/spinning_mutex.cc.orig 2023-03-09 06:31:50 UTC +++ base/allocator/partition_allocator/spinning_mutex.cc -@@ -18,7 +18,15 @@ +@@ -18,7 +18,16 @@ - #if defined(PA_HAS_LINUX_KERNEL) + #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 // defined(PA_HAS_LINUX_KERNEL) -@@ -107,8 +115,13 @@ void SpinningMutex::FutexWait() { + #endif // PA_CONFIG(HAS_LINUX_KERNEL) +@@ -107,8 +116,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 +133,14 @@ void SpinningMutex::FutexWait() { +@@ -120,8 +137,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/chromium/files/patch-base_debug_stack__trace.cc b/www/chromium/files/patch-base_debug_stack__trace.cc new file mode 100644 index 000000000000..4b542b972e47 --- /dev/null +++ b/www/chromium/files/patch-base_debug_stack__trace.cc @@ -0,0 +1,21 @@ +--- base/debug/stack_trace.cc.orig 2023-03-09 06:31:50 UTC ++++ base/debug/stack_trace.cc +@@ -273,7 +273,9 @@ void StackTrace::Print() const { + } + + void StackTrace::OutputToStream(std::ostream* os) const { ++#if !BUILDFLAG(IS_BSD) + OutputToStreamWithPrefix(os, nullptr); ++#endif + } + + std::string StackTrace::ToString() const { +@@ -281,7 +283,7 @@ std::string StackTrace::ToString() const { + } + std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const { + std::stringstream stream; +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD) + OutputToStreamWithPrefix(&stream, prefix_string); + #endif + return stream.str(); diff --git a/www/chromium/files/patch-base_debug_stack__trace__posix.cc b/www/chromium/files/patch-base_debug_stack__trace__posix.cc index 89b1d40c7ff3..c9a48bee057f 100644 --- a/www/chromium/files/patch-base_debug_stack__trace__posix.cc +++ b/www/chromium/files/patch-base_debug_stack__trace__posix.cc @@ -1,38 +1,38 @@ ---- base/debug/stack_trace_posix.cc.orig 2023-02-08 09:03:45 UTC +--- base/debug/stack_trace_posix.cc.orig 2023-03-09 06:31:50 UTC +++ base/debug/stack_trace_posix.cc -@@ -39,7 +39,7 @@ +@@ -40,7 +40,7 @@ + // execinfo.h and backtrace(3) are really only present in glibc and in macOS + // libc. + #if BUILDFLAG(IS_APPLE) || \ +- (defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__AIX)) ++ (defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__AIX) && !BUILDFLAG(IS_BSD)) + #define HAVE_BACKTRACE + #include + #endif +@@ -58,7 +58,7 @@ #include #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/debug/proc_maps_linux.h" #endif -@@ -714,6 +714,9 @@ class SandboxSymbolizeHelper { +@@ -761,6 +761,9 @@ class SandboxSymbolizeHelper { // for the modules that are loaded in the current process. // Returns true on success. bool CacheMemoryRegions() { +#if BUILDFLAG(IS_BSD) + return false; +#else // Reads /proc/self/maps. std::string contents; if (!ReadProcMaps(&contents)) { -@@ -731,6 +734,7 @@ class SandboxSymbolizeHelper { +@@ -778,6 +781,7 @@ class SandboxSymbolizeHelper { is_initialized_ = true; return true; +#endif } // Opens all object files and caches their file descriptors. -@@ -887,7 +891,7 @@ size_t CollectStackTrace(void** trace, size_t count) { - // If we do not have unwind tables, then try tracing using frame pointers. - return base::debug::TraceStackFramePointers(const_cast(trace), - count, 0); --#elif !defined(__UCLIBC__) && !defined(_AIX) -+#elif !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD) - // Though the backtrace API man page does not list any possible negative - // return values, we take no chance. - return base::saturated_cast( diff --git a/www/chromium/files/patch-base_files_file__util__unittest.cc b/www/chromium/files/patch-base_files_file__util__unittest.cc index 064f985c43b2..f4c26e9b010c 100644 --- a/www/chromium/files/patch-base_files_file__util__unittest.cc +++ b/www/chromium/files/patch-base_files_file__util__unittest.cc @@ -1,20 +1,20 @@ ---- base/files/file_util_unittest.cc.orig 2023-01-11 09:17:16 UTC +--- base/files/file_util_unittest.cc.orig 2023-03-09 06:31:50 UTC +++ base/files/file_util_unittest.cc -@@ -3558,7 +3558,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) { +@@ -3749,7 +3749,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"; -@@ -4281,7 +4281,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles +@@ -4472,7 +4472,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/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc b/www/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc index b2744d4abb50..6d36a5d31542 100644 --- a/www/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc +++ b/www/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc @@ -1,11 +1,11 @@ ---- base/posix/unix_domain_socket_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- base/posix/unix_domain_socket_unittest.cc.orig 2023-03-09 06:31:50 UTC +++ base/posix/unix_domain_socket_unittest.cc @@ -10,6 +10,8 @@ #include #include +#include + - #include "base/bind.h" - #include "base/callback_helpers.h" #include "base/files/file_util.h" + #include "base/files/scoped_file.h" + #include "base/functional/bind.h" diff --git a/www/chromium/files/patch-base_process_process__metrics.cc b/www/chromium/files/patch-base_process_process__metrics.cc index 3acc49b349d8..85291ccdbdfd 100644 --- a/www/chromium/files/patch-base_process_process__metrics.cc +++ b/www/chromium/files/patch-base_process_process__metrics.cc @@ -1,54 +1,54 @@ ---- base/process/process_metrics.cc.orig 2023-01-11 09:17:16 UTC +--- base/process/process_metrics.cc.orig 2023-03-09 06:31:50 UTC +++ base/process/process_metrics.cc @@ -17,7 +17,7 @@ namespace base { namespace { #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int CalculateEventsPerSecond(uint64_t event_count, uint64_t* last_event_count, base::TimeTicks* last_calculated) { @@ -54,7 +54,7 @@ SystemMetrics SystemMetrics::Sample() { SystemMetrics system_metrics; system_metrics.committed_memory_ = GetSystemCommitCharge(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) GetSystemMemoryInfo(&system_metrics.memory_info_); GetVmStatInfo(&system_metrics.vmstat_info_); GetSystemDiskInfo(&system_metrics.disk_info_); -@@ -73,7 +73,7 @@ Value SystemMetrics::ToValue() const { - Value res(Value::Type::DICTIONARY); +@@ -73,7 +73,7 @@ Value::Dict SystemMetrics::ToDict() const { + Value::Dict res; - res.SetIntKey("committed_memory", static_cast(committed_memory_)); + res.Set("committed_memory", static_cast(committed_memory_)); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - Value meminfo = memory_info_.ToValue(); - Value vmstat = vmstat_info_.ToValue(); - meminfo.MergeDictionary(&vmstat); -@@ -99,7 +99,6 @@ std::unique_ptr ProcessMetrics::Create + Value::Dict meminfo = memory_info_.ToDict(); + meminfo.Merge(vmstat_info_.ToDict()); + res.Set("meminfo", std::move(meminfo)); +@@ -98,7 +98,6 @@ std::unique_ptr ProcessMetrics::Create #endif // !BUILDFLAG(IS_MAC) } -#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX) double ProcessMetrics::GetPlatformIndependentCPUUsage( TimeDelta cumulative_cpu) { TimeTicks time = TimeTicks::Now(); -@@ -125,7 +124,6 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage( +@@ -124,7 +123,6 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage( double ProcessMetrics::GetPlatformIndependentCPUUsage() { return GetPlatformIndependentCPUUsage(GetCumulativeCPUUsage()); } -#endif #if BUILDFLAG(IS_WIN) double ProcessMetrics::GetPreciseCPUUsage(TimeDelta cumulative_cpu) { -@@ -156,7 +154,7 @@ double ProcessMetrics::GetPreciseCPUUsage() { +@@ -155,7 +153,7 @@ double ProcessMetrics::GetPreciseCPUUsage() { #endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int ProcessMetrics::CalculateIdleWakeupsPerSecond( uint64_t absolute_idle_wakeups) { return CalculateEventsPerSecond(absolute_idle_wakeups, diff --git a/www/chromium/files/patch-base_process_process__metrics.h b/www/chromium/files/patch-base_process_process__metrics.h index 76a855e9be6d..aedd549a2c36 100644 --- a/www/chromium/files/patch-base_process_process__metrics.h +++ b/www/chromium/files/patch-base_process_process__metrics.h @@ -1,120 +1,120 @@ ---- base/process/process_metrics.h.orig 2023-01-11 09:17:16 UTC +--- base/process/process_metrics.h.orig 2023-03-09 06:31:50 UTC +++ base/process/process_metrics.h -@@ -36,7 +36,7 @@ +@@ -37,7 +37,7 @@ #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) #include #include #include -@@ -51,7 +51,7 @@ class Value; +@@ -50,7 +50,7 @@ namespace base { // Full declaration is in process_metrics_iocounters.h. struct IoCounters; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Minor and major page fault counts since the process creation. // Both counts are process-wide, and exclude child processes. // -@@ -106,7 +106,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -105,7 +105,7 @@ class BASE_EXPORT ProcessMetrics { // convenience wrapper for CreateProcessMetrics(). static std::unique_ptr CreateCurrentProcessMetrics(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Resident Set Size is a Linux/Android specific memory concept. Do not // attempt to extend this to other platforms. BASE_EXPORT size_t GetResidentSetSize() const; -@@ -164,7 +164,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -163,7 +163,7 @@ class BASE_EXPORT ProcessMetrics { #endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Emits the cumulative CPU usage for all currently active threads since they // were started into the output parameter (replacing its current contents). // Threads that have already terminated will not be reported. Thus, the sum of -@@ -224,7 +224,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -223,7 +223,7 @@ class BASE_EXPORT ProcessMetrics { int GetOpenFdSoftLimit() const; #endif // BUILDFLAG(IS_POSIX) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Bytes of swap as reported by /proc/[pid]/status. uint64_t GetVmSwapBytes() const; -@@ -245,7 +245,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -244,7 +244,7 @@ class BASE_EXPORT ProcessMetrics { #endif // !BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups); #endif #if BUILDFLAG(IS_APPLE) -@@ -264,9 +264,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -263,9 +263,7 @@ class BASE_EXPORT ProcessMetrics { // Used to store the previous times and CPU usage counts so we can // compute the CPU usage between calls. TimeTicks last_cpu_time_; -#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX) TimeDelta last_cumulative_cpu_; -#endif #if BUILDFLAG(IS_WIN) TimeTicks last_cpu_time_for_precise_cpu_usage_; -@@ -274,7 +272,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -273,7 +271,7 @@ class BASE_EXPORT ProcessMetrics { #endif #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Same thing for idle wakeups. TimeTicks last_idle_wakeups_time_; uint64_t last_absolute_idle_wakeups_; -@@ -317,7 +315,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de +@@ -316,7 +314,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Data about system-wide memory consumption. Values are in KB. Available on // Windows, Mac, Linux, Android and Chrome OS. // -@@ -352,7 +350,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { +@@ -351,7 +349,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // This provides an estimate of available memory as described here: // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always -@@ -367,7 +365,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { +@@ -366,7 +364,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { #endif #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) int buffers = 0; int cached = 0; int active_anon = 0; -@@ -404,7 +402,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK +@@ -403,7 +401,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK // BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Parse the data found in /proc//stat and return the sum of the // CPU-related ticks. Returns -1 on parse error. // Exposed for testing. -@@ -592,7 +590,7 @@ class BASE_EXPORT SystemMetrics { +@@ -591,7 +589,7 @@ class BASE_EXPORT SystemMetrics { FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics); size_t committed_memory_; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) SystemMemoryInfoKB memory_info_; VmStatInfo vmstat_info_; SystemDiskInfo disk_info_; diff --git a/www/chromium/files/patch-base_process_process__metrics__freebsd.cc b/www/chromium/files/patch-base_process_process__metrics__freebsd.cc index 395dc9eafc41..4b67feb8885a 100644 --- a/www/chromium/files/patch-base_process_process__metrics__freebsd.cc +++ b/www/chromium/files/patch-base_process_process__metrics__freebsd.cc @@ -1,296 +1,305 @@ ---- base/process/process_metrics_freebsd.cc.orig 2022-10-25 08:25:05 UTC +--- base/process/process_metrics_freebsd.cc.orig 2023-03-09 06:31:50 UTC +++ base/process/process_metrics_freebsd.cc @@ -3,20 +3,39 @@ // found in the LICENSE file. #include "base/process/process_metrics.h" +#include "base/notreached.h" #include +#include #include #include #include +#include /* O_RDONLY */ +#include +#include + #include "base/memory/ptr_util.h" #include "base/process/process_metrics_iocounters.h" +#include "base/values.h" namespace base { +namespace { +int GetPageShift() { + int pagesize = getpagesize(); + int pageshift = 0; + while (pagesize > 1) { + pageshift++; + pagesize >>= 1; + } + + return pageshift; +} +} + ProcessMetrics::ProcessMetrics(ProcessHandle process) - : process_(process), - last_cpu_(0) {} + : process_(process) {} // static std::unique_ptr ProcessMetrics::CreateProcessMetrics( @@ -24,22 +43,19 @@ std::unique_ptr ProcessMetrics::Create return WrapUnique(new ProcessMetrics(process)); } -double ProcessMetrics::GetPlatformIndependentCPUUsage() { +TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { struct kinfo_proc info; - int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_}; - size_t length = sizeof(info); + size_t length = sizeof(struct kinfo_proc); + struct timeval tv; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ }; + if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) - return 0; + return TimeDelta(); - return (info.ki_pctcpu / FSCALE) * 100.0; + return Microseconds(info.ki_runtime); } -TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { - NOTREACHED(); - return TimeDelta(); -} - bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const { return false; } -@@ -67,4 +83,221 @@ size_t GetSystemCommitCharge() { - return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize); - } +@@ -65,6 +81,230 @@ size_t GetSystemCommitCharge() { + pagesize = getpagesize(); + return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize); ++} ++ +int64_t GetNumberOfThreads(ProcessHandle process) { + // Taken from FreeBSD top (usr.bin/top/machine.c) + + kvm_t* kd = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open"); + if (kd == NULL) + return 0; + + struct kinfo_proc* pbase; + int nproc; + pbase = kvm_getprocs(kd, KERN_PROC_PID, process, &nproc); + if (pbase == NULL) + return 0; + + if (kvm_close(kd) == -1) + return 0; + + return nproc; +} + +bool GetSystemMemoryInfo(SystemMemoryInfoKB *meminfo) { + unsigned int mem_total, mem_free, swap_total, swap_used; + size_t length; + int pagesizeKB; + + pagesizeKB = getpagesize() / 1024; + + length = sizeof(mem_total); + if (sysctlbyname("vm.stats.vm.v_page_count", &mem_total, + &length, NULL, 0) != 0 || length != sizeof(mem_total)) + return false; + + length = sizeof(mem_free); + if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &length, NULL, 0) + != 0 || length != sizeof(mem_free)) + return false; + + length = sizeof(swap_total); + if (sysctlbyname("vm.swap_size", &swap_total, &length, NULL, 0) + != 0 || length != sizeof(swap_total)) + return false; + + length = sizeof(swap_used); + if (sysctlbyname("vm.swap_anon_use", &swap_used, &length, NULL, 0) + != 0 || length != sizeof(swap_used)) + return false; + + meminfo->total = mem_total * pagesizeKB; + meminfo->free = mem_free * pagesizeKB; + meminfo->swap_total = swap_total * pagesizeKB; + meminfo->swap_free = (swap_total - swap_used) * pagesizeKB; + + return true; +} + +int ProcessMetrics::GetOpenFdCount() const { + struct kinfo_file * kif; + int cnt; + + if ((kif = kinfo_getfile(process_, &cnt)) == NULL) + return -1; + + free(kif); + + return cnt; +} + +int ProcessMetrics::GetOpenFdSoftLimit() const { + size_t length; + int total_count = 0; + int mib[] = { CTL_KERN, KERN_MAXFILESPERPROC }; + + length = sizeof(total_count); + + if (sysctl(mib, std::size(mib), &total_count, &length, NULL, 0) < 0) { + total_count = -1; + } + + return total_count; +} + +size_t ProcessMetrics::GetResidentSetSize() const { + kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open"); + + if (kd == nullptr) + return 0; + + struct kinfo_proc *pp; + int nproc; + + if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) { + kvm_close(kd); + return 0; + } + + size_t rss; + + if (nproc > 0) { + rss = pp->ki_rssize << GetPageShift(); + } else { + rss = 0; + } + + kvm_close(kd); + return rss; +} + +uint64_t ProcessMetrics::GetVmSwapBytes() const { + kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open"); + + if (kd == nullptr) + return 0; + + struct kinfo_proc *pp; + int nproc; + + if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) { + kvm_close(kd); + return 0; + } + + size_t swrss; + + if (nproc > 0) { + swrss = pp->ki_swrss > pp->ki_rssize + ? (pp->ki_swrss - pp->ki_rssize) << GetPageShift() + : 0; + } else { + swrss = 0; + } + + kvm_close(kd); + return swrss; +} + +int ProcessMetrics::GetIdleWakeupsPerSecond() { + NOTIMPLEMENTED(); + return 0; +} + +bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) { + NOTIMPLEMENTED(); + return false; +} + +bool GetVmStatInfo(VmStatInfo* vmstat) { + NOTIMPLEMENTED(); + return false; +} + +SystemDiskInfo::SystemDiskInfo() { + reads = 0; + reads_merged = 0; + sectors_read = 0; + read_time = 0; + writes = 0; + writes_merged = 0; + sectors_written = 0; + write_time = 0; + io = 0; + io_time = 0; + weighted_io_time = 0; +} + +SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default; + +SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default; + -+Value SystemDiskInfo::ToValue() const { -+ Value res(Value::Type::DICTIONARY); -+ ++Value::Dict SystemDiskInfo::ToDict() const { ++ Value::Dict res; ++ + // Write out uint64_t variables as doubles. + // Note: this may discard some precision, but for JS there's no other option. -+ res.SetDoubleKey("reads", static_cast(reads)); -+ res.SetDoubleKey("reads_merged", static_cast(reads_merged)); -+ res.SetDoubleKey("sectors_read", static_cast(sectors_read)); -+ res.SetDoubleKey("read_time", static_cast(read_time)); -+ res.SetDoubleKey("writes", static_cast(writes)); -+ res.SetDoubleKey("writes_merged", static_cast(writes_merged)); -+ res.SetDoubleKey("sectors_written", static_cast(sectors_written)); -+ res.SetDoubleKey("write_time", static_cast(write_time)); -+ res.SetDoubleKey("io", static_cast(io)); -+ res.SetDoubleKey("io_time", static_cast(io_time)); -+ res.SetDoubleKey("weighted_io_time", static_cast(weighted_io_time)); ++ res.Set("reads", static_cast(reads)); ++ res.Set("reads_merged", static_cast(reads_merged)); ++ res.Set("sectors_read", static_cast(sectors_read)); ++ res.Set("read_time", static_cast(read_time)); ++ res.Set("writes", static_cast(writes)); ++ res.Set("writes_merged", static_cast(writes_merged)); ++ res.Set("sectors_written", static_cast(sectors_written)); ++ res.Set("write_time", static_cast(write_time)); ++ res.Set("io", static_cast(io)); ++ res.Set("io_time", static_cast(io_time)); ++ res.Set("weighted_io_time", static_cast(weighted_io_time)); + ++ NOTIMPLEMENTED(); ++ + return res; +} + -+Value SystemMemoryInfoKB::ToValue() const { -+ Value res(Value::Type::DICTIONARY); -+ -+ res.SetIntKey("total", total); -+ res.SetIntKey("free", free); -+ res.SetIntKey("available", available); -+ res.SetIntKey("buffers", buffers); -+ res.SetIntKey("cached", cached); -+ res.SetIntKey("active_anon", active_anon); -+ res.SetIntKey("inactive_anon", inactive_anon); -+ res.SetIntKey("active_file", active_file); -+ res.SetIntKey("inactive_file", inactive_file); -+ res.SetIntKey("swap_total", swap_total); -+ res.SetIntKey("swap_free", swap_free); -+ res.SetIntKey("swap_used", swap_total - swap_free); -+ res.SetIntKey("dirty", dirty); -+ res.SetIntKey("reclaimable", reclaimable); ++Value::Dict SystemMemoryInfoKB::ToDict() const { ++ Value::Dict res; ++ res.Set("total", total); ++ res.Set("free", free); ++ res.Set("available", available); ++ res.Set("buffers", buffers); ++ res.Set("cached", cached); ++ res.Set("active_anon", active_anon); ++ res.Set("inactive_anon", inactive_anon); ++ res.Set("active_file", active_file); ++ res.Set("inactive_file", inactive_file); ++ res.Set("swap_total", swap_total); ++ res.Set("swap_free", swap_free); ++ res.Set("swap_used", swap_total - swap_free); ++ res.Set("dirty", dirty); ++ res.Set("reclaimable", reclaimable); ++ ++ NOTIMPLEMENTED(); + + return res; +} + -+Value VmStatInfo::ToValue() const { -+ Value res(Value::Type::DICTIONARY); ++Value::Dict VmStatInfo::ToDict() const { ++ Value::Dict res; ++ // TODO(crbug.com/1334256): Make base::Value able to hold uint64_t and remove ++ // casts below. ++ res.Set("pswpin", static_cast(pswpin)); ++ res.Set("pswpout", static_cast(pswpout)); ++ res.Set("pgmajfault", static_cast(pgmajfault)); + -+ res.SetIntKey("pswpin", pswpin); -+ res.SetIntKey("pswpout", pswpout); -+ res.SetIntKey("pgmajfault", pgmajfault); ++ NOTIMPLEMENTED(); + + return res; -+} + } + } // namespace base diff --git a/www/chromium/files/patch-base_process_process__metrics__openbsd.cc b/www/chromium/files/patch-base_process_process__metrics__openbsd.cc index 70b2aa744c6c..1dcc7db4a903 100644 --- a/www/chromium/files/patch-base_process_process__metrics__openbsd.cc +++ b/www/chromium/files/patch-base_process_process__metrics__openbsd.cc @@ -1,215 +1,215 @@ ---- base/process/process_metrics_openbsd.cc.orig 2022-09-24 10:57:32 UTC +--- base/process/process_metrics_openbsd.cc.orig 2023-03-09 06:31:50 UTC +++ base/process/process_metrics_openbsd.cc @@ -6,14 +6,23 @@ #include #include +#include #include #include +#include +#include + #include "base/memory/ptr_util.h" #include "base/process/process_metrics_iocounters.h" +#include "base/values.h" +#include "base/notreached.h" namespace base { +ProcessMetrics::ProcessMetrics(ProcessHandle process) + : process_(process) {} + // static std::unique_ptr ProcessMetrics::CreateProcessMetrics( ProcessHandle process) { @@ -24,49 +33,23 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun return false; } -static int GetProcessCPU(pid_t pid) { +TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { struct kinfo_proc info; - size_t length; - int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, - sizeof(struct kinfo_proc), 0 }; + size_t length = sizeof(struct kinfo_proc); + struct timeval tv; - if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) - return -1; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_, + sizeof(struct kinfo_proc), 1 }; - mib[5] = (length / sizeof(struct kinfo_proc)); - if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) - return 0; + return TimeDelta(); - return info.p_pctcpu; -} + tv.tv_sec = info.p_rtime_sec; + tv.tv_usec = info.p_rtime_usec; -double ProcessMetrics::GetPlatformIndependentCPUUsage() { - TimeTicks time = TimeTicks::Now(); - - if (last_cpu_time_.is_zero()) { - // First call, just set the last values. - last_cpu_time_ = time; - return 0; - } - - int cpu = GetProcessCPU(process_); - - last_cpu_time_ = time; - double percentage = static_cast((cpu * 100.0) / FSCALE); - - return percentage; + return Microseconds(TimeValToMicroseconds(tv)); } -TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { - NOTREACHED(); - return TimeDelta(); -} - -ProcessMetrics::ProcessMetrics(ProcessHandle process) - : process_(process), - last_cpu_(0) {} - size_t GetSystemCommitCharge() { int mib[] = { CTL_VM, VM_METER }; int pagesize; @@ -84,6 +67,129 @@ size_t GetSystemCommitCharge() { pagesize = getpagesize(); return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize); +} + +int ProcessMetrics::GetOpenFdCount() const { + struct kinfo_file *files; + kvm_t *kd = NULL; + int total_count = 0; + char errbuf[_POSIX2_LINE_MAX]; + + if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL) + goto out; + + if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, process_, + sizeof(struct kinfo_file), &total_count)) == NULL) { + total_count = 0; + goto out; + } + + kvm_close(kd); + +out: + return total_count; +} + +int ProcessMetrics::GetOpenFdSoftLimit() const { + return GetMaxFds(); +} + +uint64_t ProcessMetrics::GetVmSwapBytes() const { + NOTIMPLEMENTED(); + return 0; +} + +bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { + NOTIMPLEMENTED_LOG_ONCE(); + return false; +} + -+SystemDiskInfo::SystemDiskInfo() { -+ reads = 0; -+ reads_merged = 0; -+ sectors_read = 0; -+ read_time = 0; -+ writes = 0; -+ writes_merged = 0; -+ sectors_written = 0; -+ write_time = 0; -+ io = 0; -+ io_time = 0; -+ weighted_io_time = 0; -+} -+ -+SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default; -+ +bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) { + NOTIMPLEMENTED(); + return false; +} + +bool GetVmStatInfo(VmStatInfo* vmstat) { + NOTIMPLEMENTED(); + return false; +} + +int ProcessMetrics::GetIdleWakeupsPerSecond() { + NOTIMPLEMENTED(); + return 0; +} + -+Value SystemMemoryInfoKB::ToValue() const { -+ Value res(Value::Type::DICTIONARY); -+ res.SetIntKey("total", total); -+ res.SetIntKey("free", free); -+ res.SetIntKey("available", available); -+ res.SetIntKey("buffers", buffers); -+ res.SetIntKey("cached", cached); -+ res.SetIntKey("active_anon", active_anon); -+ res.SetIntKey("inactive_anon", inactive_anon); -+ res.SetIntKey("active_file", active_file); -+ res.SetIntKey("inactive_file", inactive_file); -+ res.SetIntKey("swap_total", swap_total); -+ res.SetIntKey("swap_free", swap_free); -+ res.SetIntKey("swap_used", swap_total - swap_free); -+ res.SetIntKey("dirty", dirty); -+ res.SetIntKey("reclaimable", reclaimable); ++Value::Dict SystemMemoryInfoKB::ToDict() const { ++ Value::Dict res; ++ res.Set("total", total); ++ res.Set("free", free); ++ res.Set("available", available); ++ res.Set("buffers", buffers); ++ res.Set("cached", cached); ++ res.Set("active_anon", active_anon); ++ res.Set("inactive_anon", inactive_anon); ++ res.Set("active_file", active_file); ++ res.Set("inactive_file", inactive_file); ++ res.Set("swap_total", swap_total); ++ res.Set("swap_free", swap_free); ++ res.Set("swap_used", swap_total - swap_free); ++ res.Set("dirty", dirty); ++ res.Set("reclaimable", reclaimable); + + NOTIMPLEMENTED(); + + return res; +} + -+Value VmStatInfo::ToValue() const { -+ Value res(Value::Type::DICTIONARY); -+ res.SetIntKey("pswpin", pswpin); -+ res.SetIntKey("pswpout", pswpout); -+ res.SetIntKey("pgmajfault", pgmajfault); ++Value::Dict VmStatInfo::ToDict() const { ++ Value::Dict res; ++ res.Set("pswpin", static_cast(pswpin)); ++ res.Set("pswpout", static_cast(pswpout)); ++ res.Set("pgmajfault", static_cast(pgmajfault)); + + NOTIMPLEMENTED(); + + return res; ++} ++ ++SystemDiskInfo::SystemDiskInfo() { ++ reads = 0; ++ reads_merged = 0; ++ sectors_read = 0; ++ read_time = 0; ++ writes = 0; ++ writes_merged = 0; ++ sectors_written = 0; ++ write_time = 0; ++ io = 0; ++ io_time = 0; ++ weighted_io_time = 0; +} + -+SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default; ++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo&) = default; + -+Value SystemDiskInfo::ToValue() const { -+ Value res(Value::Type::DICTIONARY); ++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default; + ++Value::Dict SystemDiskInfo::ToDict() const { ++ Value::Dict res; ++ + // Write out uint64_t variables as doubles. + // Note: this may discard some precision, but for JS there's no other option. -+ res.SetDoubleKey("reads", static_cast(reads)); -+ res.SetDoubleKey("reads_merged", static_cast(reads_merged)); -+ res.SetDoubleKey("sectors_read", static_cast(sectors_read)); -+ res.SetDoubleKey("read_time", static_cast(read_time)); -+ res.SetDoubleKey("writes", static_cast(writes)); -+ res.SetDoubleKey("writes_merged", static_cast(writes_merged)); -+ res.SetDoubleKey("sectors_written", static_cast(sectors_written)); -+ res.SetDoubleKey("write_time", static_cast(write_time)); -+ res.SetDoubleKey("io", static_cast(io)); -+ res.SetDoubleKey("io_time", static_cast(io_time)); -+ res.SetDoubleKey("weighted_io_time", static_cast(weighted_io_time)); ++ res.Set("reads", static_cast(reads)); ++ res.Set("reads_merged", static_cast(reads_merged)); ++ res.Set("sectors_read", static_cast(sectors_read)); ++ res.Set("read_time", static_cast(read_time)); ++ res.Set("writes", static_cast(writes)); ++ res.Set("writes_merged", static_cast(writes_merged)); ++ res.Set("sectors_written", static_cast(sectors_written)); ++ res.Set("write_time", static_cast(write_time)); ++ res.Set("io", static_cast(io)); ++ res.Set("io_time", static_cast(io_time)); ++ res.Set("weighted_io_time", static_cast(weighted_io_time)); + + NOTIMPLEMENTED(); + + return res; } } // namespace base diff --git a/www/chromium/files/patch-base_process_process__unittest.cc b/www/chromium/files/patch-base_process_process__unittest.cc index 7c23a1ea4882..a913f356eadd 100644 --- a/www/chromium/files/patch-base_process_process__unittest.cc +++ b/www/chromium/files/patch-base_process_process__unittest.cc @@ -1,11 +1,11 @@ ---- base/process/process_unittest.cc.orig 2022-07-22 17:30:31 UTC +--- base/process/process_unittest.cc.orig 2023-03-09 06:31:50 UTC +++ base/process/process_unittest.cc -@@ -193,7 +193,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) { +@@ -194,7 +194,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/chromium/files/patch-base_strings_safe__sprintf__unittest.cc b/www/chromium/files/patch-base_strings_safe__sprintf__unittest.cc index 83ee17065193..bc70a714257b 100644 --- a/www/chromium/files/patch-base_strings_safe__sprintf__unittest.cc +++ b/www/chromium/files/patch-base_strings_safe__sprintf__unittest.cc @@ -1,18 +1,18 @@ ---- base/strings/safe_sprintf_unittest.cc.orig 2022-11-30 08:12:58 UTC +--- base/strings/safe_sprintf_unittest.cc.orig 2023-03-09 06:31:50 UTC +++ base/strings/safe_sprintf_unittest.cc -@@ -740,6 +740,7 @@ TEST(SafeSPrintfTest, EmbeddedNul) { +@@ -733,6 +733,7 @@ TEST(SafeSPrintfTest, EmbeddedNul) { #endif } +#if !BUILDFLAG(IS_BSD) TEST(SafeSPrintfTest, EmitNULL) { char buf[40]; #if defined(__GNUC__) -@@ -756,6 +757,7 @@ TEST(SafeSPrintfTest, EmitNULL) { +@@ -749,6 +750,7 @@ TEST(SafeSPrintfTest, EmitNULL) { #pragma GCC diagnostic pop #endif } +#endif TEST(SafeSPrintfTest, PointerSize) { // The internal data representation is a 64bit value, independent of the diff --git a/www/chromium/files/patch-base_system_sys__info.cc b/www/chromium/files/patch-base_system_sys__info.cc index 9433f80d7f28..f030b0307ea8 100644 --- a/www/chromium/files/patch-base_system_sys__info.cc +++ b/www/chromium/files/patch-base_system_sys__info.cc @@ -1,11 +1,11 @@ ---- base/system/sys_info.cc.orig 2023-02-08 09:03:45 UTC +--- base/system/sys_info.cc.orig 2023-03-09 06:31:50 UTC +++ base/system/sys_info.cc -@@ -107,7 +107,7 @@ std::string SysInfo::HardwareModelName() { +@@ -106,7 +106,7 @@ std::string SysInfo::HardwareModelName() { #endif void SysInfo::GetHardwareInfo(base::OnceCallback callback) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) constexpr base::TaskTraits kTraits = {base::MayBlock()}; #else constexpr base::TaskTraits kTraits = {}; diff --git a/www/chromium/files/patch-base_system_sys__info__posix.cc b/www/chromium/files/patch-base_system_sys__info__posix.cc index 26b0654e02ea..18541a4b9001 100644 --- a/www/chromium/files/patch-base_system_sys__info__posix.cc +++ b/www/chromium/files/patch-base_system_sys__info__posix.cc @@ -1,26 +1,26 @@ ---- base/system/sys_info_posix.cc.orig 2023-02-08 09:03:45 UTC +--- base/system/sys_info_posix.cc.orig 2023-03-09 06:31:50 UTC +++ base/system/sys_info_posix.cc -@@ -159,12 +159,12 @@ int NumberOfProcessors() { +@@ -165,12 +165,12 @@ int NumberOfProcessors() { } // namespace internal -#if !BUILDFLAG(IS_OPENBSD) +#if !BUILDFLAG(IS_BSD) int SysInfo::NumberOfProcessors() { static int number_of_processors = internal::NumberOfProcessors(); return number_of_processors; } -#endif // !BUILDFLAG(IS_OPENBSD) +#endif // !BUILDFLAG(IS_BSD) // static uint64_t SysInfo::AmountOfVirtualMemory() { -@@ -254,6 +254,8 @@ std::string SysInfo::OperatingSystemArchitecture() { +@@ -260,6 +260,8 @@ std::string SysInfo::OperatingSystemArchitecture() { arch = "x86"; } else if (arch == "amd64") { arch = "x86_64"; + } else if (arch == "arm64") { + arch = "aarch64"; } else if (std::string(info.sysname) == "AIX") { arch = "ppc64"; } diff --git a/www/chromium/files/patch-base_test_launcher_test__launcher.cc b/www/chromium/files/patch-base_test_launcher_test__launcher.cc index c38d203671cb..7b9cbd580612 100644 --- a/www/chromium/files/patch-base_test_launcher_test__launcher.cc +++ b/www/chromium/files/patch-base_test_launcher_test__launcher.cc @@ -1,10 +1,10 @@ ---- base/test/launcher/test_launcher.cc.orig 2023-02-08 09:03:45 UTC +--- base/test/launcher/test_launcher.cc.orig 2023-03-09 06:31:50 UTC +++ base/test/launcher/test_launcher.cc -@@ -66,6 +66,7 @@ +@@ -67,6 +67,7 @@ #include "third_party/libxml/chromium/libxml_utils.h" #if BUILDFLAG(IS_POSIX) +#include #include #include "base/files/file_descriptor_watcher_posix.h" diff --git a/www/chromium/files/patch-base_threading_platform__thread__posix.cc b/www/chromium/files/patch-base_threading_platform__thread__posix.cc index 0d4b2c3c5e79..0dd910306054 100644 --- a/www/chromium/files/patch-base_threading_platform__thread__posix.cc +++ b/www/chromium/files/patch-base_threading_platform__thread__posix.cc @@ -1,21 +1,21 @@ ---- base/threading/platform_thread_posix.cc.orig 2022-11-30 08:12:58 UTC +--- base/threading/platform_thread_posix.cc.orig 2023-03-09 06:31:50 UTC +++ base/threading/platform_thread_posix.cc -@@ -78,7 +78,7 @@ void* ThreadFunc(void* params) { +@@ -77,7 +77,7 @@ void* ThreadFunc(void* params) { if (!thread_params->joinable) base::DisallowSingleton(); -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) - #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(STARSCAN) + #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN) partition_alloc::internal::PCScan::NotifyThreadCreated( partition_alloc::internal::GetStackPointer()); -@@ -380,6 +380,9 @@ void SetCurrentThreadTypeImpl(ThreadType thread_type, +@@ -379,6 +379,9 @@ void SetCurrentThreadTypeImpl(ThreadType thread_type, MessagePumpType pump_type_hint) { #if BUILDFLAG(IS_NACL) NOTIMPLEMENTED(); +// avoid pledge(2) violation +#elif BUILDFLAG(IS_BSD) + NOTIMPLEMENTED(); #else if (internal::SetCurrentThreadTypeForPlatform(thread_type, pump_type_hint)) return; diff --git a/www/chromium/files/patch-base_threading_platform__thread__unittest.cc b/www/chromium/files/patch-base_threading_platform__thread__unittest.cc index 4058e29c6f7f..888d840be26e 100644 --- a/www/chromium/files/patch-base_threading_platform__thread__unittest.cc +++ b/www/chromium/files/patch-base_threading_platform__thread__unittest.cc @@ -1,38 +1,38 @@ ---- base/threading/platform_thread_unittest.cc.orig 2023-02-08 09:03:45 UTC +--- base/threading/platform_thread_unittest.cc.orig 2023-03-09 06:31:50 UTC +++ base/threading/platform_thread_unittest.cc @@ -31,7 +31,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, // and hardcodes what we know. Please inform scheduler-dev@chromium.org 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; -@@ -696,12 +696,16 @@ INSTANTIATE_TEST_SUITE_P( +@@ -701,12 +701,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/chromium/files/patch-build_config_BUILD.gn b/www/chromium/files/patch-build_config_BUILD.gn index 36a12d51c8be..0b2b20e511f8 100644 --- a/www/chromium/files/patch-build_config_BUILD.gn +++ b/www/chromium/files/patch-build_config_BUILD.gn @@ -1,22 +1,22 @@ ---- build/config/BUILD.gn.orig 2022-09-24 10:57:32 UTC +--- build/config/BUILD.gn.orig 2023-03-09 06:31:50 UTC +++ build/config/BUILD.gn -@@ -215,13 +215,17 @@ config("default_libs") { +@@ -218,13 +218,17 @@ config("default_libs") { "CoreText.framework", "Foundation.framework", ] - } else if (is_linux || is_chromeos) { + } else if ((is_linux && !is_bsd) || is_chromeos) { libs = [ "dl", "pthread", "rt", ] - } + } else if (is_bsd) { + libs = [ + "pthread", + ] + } } group("common_deps") { diff --git a/www/chromium/files/patch-build_config_compiler_BUILD.gn b/www/chromium/files/patch-build_config_compiler_BUILD.gn index efcbfb08d379..36fbf8576cb4 100644 --- a/www/chromium/files/patch-build_config_compiler_BUILD.gn +++ b/www/chromium/files/patch-build_config_compiler_BUILD.gn @@ -1,131 +1,131 @@ ---- build/config/compiler/BUILD.gn.orig 2023-02-08 09:03:45 UTC +--- build/config/compiler/BUILD.gn.orig 2023-03-09 06:31:50 UTC +++ build/config/compiler/BUILD.gn -@@ -224,13 +224,16 @@ config("default_include_dirs") { +@@ -232,13 +232,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 --------------------------------------------------------------------- -@@ -454,6 +457,10 @@ config("compiler") { +@@ -462,6 +465,10 @@ config("compiler") { } } + if (is_openbsd) { + ldflags += [ "-Wl,-z,wxneeded" ] + } + # Linux-specific compiler flags setup. # ------------------------------------ if (use_gold) { -@@ -529,7 +536,7 @@ config("compiler") { +@@ -537,7 +544,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 += [ -@@ -813,7 +820,7 @@ config("compiler") { +@@ -825,7 +832,7 @@ config("compiler") { # lldb doesn't have the needed changes yet. # * Fuchsia isn't supported as zxdb doesn't support simple template names yet. # TODO(crbug.com/1379070): Remove if the upstream default ever changes. - if (is_clang && !is_nacl && !is_win && !is_apple && !is_fuchsia) { + if (is_clang && !is_nacl && !is_win && !is_apple && !is_fuchsia && !is_bsd) { cflags_cc += [ "-gsimple-template-names" ] } -@@ -973,7 +980,7 @@ config("compiler_cpu_abi") { +@@ -1001,7 +1008,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" ] -@@ -988,7 +995,7 @@ config("compiler_cpu_abi") { +@@ -1016,7 +1023,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" ] -@@ -1322,7 +1329,7 @@ config("compiler_deterministic") { +@@ -1350,7 +1357,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", -@@ -1374,7 +1381,7 @@ config("compiler_deterministic") { +@@ -1402,7 +1409,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", -@@ -1615,7 +1622,7 @@ config("default_warnings") { +@@ -1643,7 +1650,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", -@@ -1794,7 +1801,7 @@ config("no_chromium_code") { +@@ -1822,7 +1829,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", -@@ -2302,7 +2309,7 @@ config("afdo_optimize_size") { +@@ -2330,7 +2337,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. -@@ -2318,7 +2325,7 @@ config("afdo") { +@@ -2346,7 +2353,7 @@ config("afdo") { cflags += [ "-fprofile-sample-use=${rebased_clang_sample_profile}" ] inputs = [ _clang_sample_profile ] } - } else if (auto_profile_path != "" && is_a_target_toolchain) { + } else if (auto_profile_path != "" && is_a_target_toolchain && !is_bsd) { cflags = [ "-fauto-profile=${auto_profile_path}" ] inputs = [ auto_profile_path ] } -@@ -2472,7 +2479,8 @@ config("symbols") { +@@ -2501,7 +2508,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/chromium/files/patch-build_config_linux_pkg-config.py b/www/chromium/files/patch-build_config_linux_pkg-config.py index e48b205448bd..aedfccae77da 100644 --- a/www/chromium/files/patch-build_config_linux_pkg-config.py +++ b/www/chromium/files/patch-build_config_linux_pkg-config.py @@ -1,11 +1,11 @@ ---- build/config/linux/pkg-config.py.orig 2022-02-07 13:39:41 UTC +--- build/config/linux/pkg-config.py.orig 2023-03-09 06:31:50 UTC +++ build/config/linux/pkg-config.py -@@ -109,7 +109,7 @@ def main(): +@@ -108,7 +108,7 @@ def main(): # If this is run on non-Linux platforms, just return nothing and indicate # success. This allows us to "kind of emulate" a Linux build from other # platforms. - if "linux" not in sys.platform: + if not sys.platform.startswith(tuple(['linux', 'openbsd', 'freebsd'])): print("[[],[],[],[],[]]") return 0 diff --git a/www/chromium/files/patch-build_config_rust.gni b/www/chromium/files/patch-build_config_rust.gni index ed959f7cf230..5dae4ab6a718 100644 --- a/www/chromium/files/patch-build_config_rust.gni +++ b/www/chromium/files/patch-build_config_rust.gni @@ -1,11 +1,11 @@ ---- build/config/rust.gni.orig 2023-02-08 09:03:45 UTC +--- build/config/rust.gni.orig 2023-03-09 06:31:50 UTC +++ build/config/rust.gni -@@ -128,7 +128,7 @@ if (enable_rust) { +@@ -134,7 +134,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/chromium/files/patch-build_detect__host__arch.py b/www/chromium/files/patch-build_detect__host__arch.py index 9d8ad2c44d2b..8f6db3a275ca 100644 --- a/www/chromium/files/patch-build_detect__host__arch.py +++ b/www/chromium/files/patch-build_detect__host__arch.py @@ -1,11 +1,11 @@ ---- build/detect_host_arch.py.orig 2021-04-14 18:40:48 UTC +--- build/detect_host_arch.py.orig 2023-03-09 06:31:50 UTC +++ build/detect_host_arch.py -@@ -21,6 +21,8 @@ def HostArch(): +@@ -20,6 +20,8 @@ def HostArch(): host_arch = 'ia32' elif host_arch in ['x86_64', 'amd64']: host_arch = 'x64' + elif host_arch.startswith('arm64'): + host_arch = 'arm64' elif host_arch.startswith('arm'): host_arch = 'arm' elif host_arch.startswith('aarch64'): diff --git a/www/chromium/files/patch-build_gn__run__binary.py b/www/chromium/files/patch-build_gn__run__binary.py index cf65b6532d6f..09c4810630ff 100644 --- a/www/chromium/files/patch-build_gn__run__binary.py +++ b/www/chromium/files/patch-build_gn__run__binary.py @@ -1,11 +1,11 @@ ---- build/gn_run_binary.py.orig 2022-02-07 13:39:41 UTC +--- build/gn_run_binary.py.orig 2023-03-09 06:31:50 UTC +++ build/gn_run_binary.py -@@ -24,7 +24,7 @@ if not os.path.isabs(path): +@@ -23,7 +23,7 @@ if not os.path.isabs(path): # The rest of the arguments are passed directly to the executable. args = [path] + sys.argv[2:] -ret = subprocess.call(args) +ret = subprocess.call(args, env={"CHROME_EXE_PATH":"${WRKSRC}/out/Release/chrome","LD_LIBRARY_PATH":"${WRKSRC}/out/Release"}) if ret != 0: if ret <= -100: # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier to diff --git a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni index f5fc81d6968b..f816fc449329 100644 --- a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni +++ b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni @@ -1,44 +1,44 @@ ---- build/toolchain/gcc_toolchain.gni.orig 2023-02-08 09:03:45 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2023-03-09 06:31:50 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). # -@@ -803,22 +810,12 @@ template("gcc_toolchain") { +@@ -832,22 +839,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/chromium/files/patch-cc_BUILD.gn b/www/chromium/files/patch-cc_BUILD.gn index 28c69bf60848..16f75af8bc6a 100644 --- a/www/chromium/files/patch-cc_BUILD.gn +++ b/www/chromium/files/patch-cc_BUILD.gn @@ -1,19 +1,19 @@ ---- cc/BUILD.gn.orig 2023-02-08 09:03:45 UTC +--- cc/BUILD.gn.orig 2023-03-09 06:31:50 UTC +++ cc/BUILD.gn -@@ -665,7 +665,7 @@ cc_test_static_library("test_support") { +@@ -666,7 +666,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" ] } } -@@ -892,7 +892,6 @@ cc_test("cc_unittests") { +@@ -893,7 +893,6 @@ cc_test("cc_unittests") { data = [ "//components/viz/test/data/" ] data_deps = [ "//testing/buildbot/filters:cc_unittests_filters", - "//third_party/mesa_headers", ] if (is_android && enable_chrome_android_internal) { diff --git a/www/chromium/files/patch-chrome_app_chrome__command__ids.h b/www/chromium/files/patch-chrome_app_chrome__command__ids.h index e5fe7eacffed..6f3fcf9ecf07 100644 --- a/www/chromium/files/patch-chrome_app_chrome__command__ids.h +++ b/www/chromium/files/patch-chrome_app_chrome__command__ids.h @@ -1,11 +1,11 @@ ---- chrome/app/chrome_command_ids.h.orig 2022-06-17 14:20:10 UTC +--- chrome/app/chrome_command_ids.h.orig 2023-03-09 06:31:50 UTC +++ chrome/app/chrome_command_ids.h -@@ -67,7 +67,7 @@ - #define IDC_NAME_WINDOW 34049 +@@ -70,7 +70,7 @@ + #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) #define IDC_USE_SYSTEM_TITLE_BAR 34051 #define IDC_RESTORE_WINDOW 34052 #endif diff --git a/www/chromium/files/patch-chrome_app_chrome__main.cc b/www/chromium/files/patch-chrome_app_chrome__main.cc index 67ba7caf74ff..23847ee93aeb 100644 --- a/www/chromium/files/patch-chrome_app_chrome__main.cc +++ b/www/chromium/files/patch-chrome_app_chrome__main.cc @@ -1,20 +1,20 @@ ---- chrome/app/chrome_main.cc.orig 2023-01-11 09:17:16 UTC +--- chrome/app/chrome_main.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/app/chrome_main.cc -@@ -25,7 +25,7 @@ +@@ -27,7 +27,7 @@ #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 -@@ -151,7 +151,7 @@ int ChromeMain(int argc, const char** argv) { +@@ -157,7 +157,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/chromium/files/patch-chrome_app_chrome__main__delegate.cc b/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc index 3e2e1c64b911..62585f961d8c 100644 --- a/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc +++ b/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc @@ -1,121 +1,121 @@ ---- chrome/app/chrome_main_delegate.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/app/chrome_main_delegate.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/app/chrome_main_delegate.cc -@@ -138,7 +138,7 @@ +@@ -137,7 +137,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 -@@ -182,16 +182,16 @@ +@@ -181,16 +181,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 -@@ -351,7 +351,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty +@@ -352,7 +352,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 -@@ -436,7 +436,7 @@ bool HandleVersionSwitches(const base::CommandLine& co +@@ -437,7 +437,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) || -@@ -550,7 +550,7 @@ void InitializeUserDataDir(base::CommandLine* command_ +@@ -551,7 +551,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. -@@ -639,7 +639,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat +@@ -640,7 +640,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( -@@ -927,6 +927,8 @@ void ChromeMainDelegate::CommonEarlyInitialization() { +@@ -928,6 +928,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 -@@ -987,7 +989,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() { +@@ -984,7 +986,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() { base::internal::TimerBase::InitializeFeatures(); 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(); -@@ -1119,7 +1121,7 @@ absl::optional ChromeMainDelegate::BasicStartupCo +@@ -1116,7 +1118,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 -@@ -1149,7 +1151,7 @@ absl::optional ChromeMainDelegate::BasicStartupCo +@@ -1146,7 +1148,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 -@@ -1531,7 +1533,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1528,7 +1530,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)) { -@@ -1611,7 +1613,7 @@ absl::variant Chrome +@@ -1608,7 +1610,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/chromium/files/patch-chrome_app_generated__resources.grd b/www/chromium/files/patch-chrome_app_generated__resources.grd index e8045be257dd..cd59ca98d8e1 100644 --- a/www/chromium/files/patch-chrome_app_generated__resources.grd +++ b/www/chromium/files/patch-chrome_app_generated__resources.grd @@ -1,74 +1,74 @@ ---- chrome/app/generated_resources.grd.orig 2023-02-08 09:03:45 UTC +--- chrome/app/generated_resources.grd.orig 2023-03-09 06:31:50 UTC +++ chrome/app/generated_resources.grd @@ -2,7 +2,7 @@ -@@ -3122,7 +3122,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -3181,7 +3181,7 @@ are declared in tools/grit/grit_rule.gni. - + Device Credentials -@@ -4868,7 +4868,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -4936,7 +4936,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 -@@ -5529,7 +5529,7 @@ Keep your key file in a safe place. You will need it t +@@ -5603,7 +5603,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. -@@ -5575,7 +5575,7 @@ Keep your key file in a safe place. You will need it t +@@ -5649,7 +5649,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. -@@ -9287,7 +9287,7 @@ Check your passwords anytime in - + Use system title bar and borders -@@ -10620,7 +10620,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -10789,7 +10789,7 @@ Please help our engineers fix this problem. Tell us wh Set as default - + Minimize -@@ -12735,7 +12735,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -12904,7 +12904,7 @@ Please help our engineers fix this problem. Tell us wh Open Anyway - + System Signals Utilities diff --git a/www/chromium/files/patch-chrome_app_settings__strings.grdp b/www/chromium/files/patch-chrome_app_settings__strings.grdp index c797668519f7..361f4ab75cb3 100644 --- a/www/chromium/files/patch-chrome_app_settings__strings.grdp +++ b/www/chromium/files/patch-chrome_app_settings__strings.grdp @@ -1,20 +1,20 @@ ---- chrome/app/settings_strings.grdp.orig 2023-02-08 09:03:45 UTC +--- chrome/app/settings_strings.grdp.orig 2023-03-09 06:31:50 UTC +++ chrome/app/settings_strings.grdp -@@ -154,7 +154,7 @@ +@@ -163,7 +163,7 @@ Theme - + GTK -@@ -174,7 +174,7 @@ +@@ -183,7 +183,7 @@ Use Classic - + Reset to default diff --git a/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd b/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd index fa8c0da7d814..98ef6a198a1f 100644 --- a/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd +++ b/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd @@ -1,29 +1,29 @@ ---- chrome/app/theme/chrome_unscaled_resources.grd.orig 2023-02-08 09:03:45 UTC +--- chrome/app/theme/chrome_unscaled_resources.grd.orig 2023-03-09 06:31:50 UTC +++ chrome/app/theme/chrome_unscaled_resources.grd @@ -16,7 +16,7 @@ - + -@@ -61,7 +61,7 @@ +@@ -62,7 +62,7 @@ - + - + -@@ -75,7 +75,7 @@ +@@ -76,7 +76,7 @@ - + - + diff --git a/www/chromium/files/patch-chrome_app_theme_theme__resources.grd b/www/chromium/files/patch-chrome_app_theme_theme__resources.grd index b514eb1bf801..b6a15bca6dc8 100644 --- a/www/chromium/files/patch-chrome_app_theme_theme__resources.grd +++ b/www/chromium/files/patch-chrome_app_theme_theme__resources.grd @@ -1,59 +1,59 @@ ---- chrome/app/theme/theme_resources.grd.orig 2023-02-08 09:03:45 UTC +--- chrome/app/theme/theme_resources.grd.orig 2023-03-09 06:31:50 UTC +++ chrome/app/theme/theme_resources.grd @@ -135,14 +135,14 @@ - + - + @@ -150,7 +150,7 @@ - + @@ -162,7 +162,7 @@ - + - + @@ -171,10 +171,10 @@ - + - + - + @@ -183,7 +183,7 @@ - + - + diff --git a/www/chromium/files/patch-chrome_browser_about__flags.cc b/www/chromium/files/patch-chrome_browser_about__flags.cc index adc30fa90693..38f4ee589987 100644 --- a/www/chromium/files/patch-chrome_browser_about__flags.cc +++ b/www/chromium/files/patch-chrome_browser_about__flags.cc @@ -1,117 +1,126 @@ ---- chrome/browser/about_flags.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/about_flags.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/about_flags.cc -@@ -218,7 +218,7 @@ +@@ -219,7 +219,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 -@@ -294,7 +294,7 @@ - #include "chrome/browser/supervised_user/supervised_user_features/supervised_user_features.h" // nogncheck - #endif // ENABLE_SUPERVISED_USERS +@@ -301,7 +301,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) -@@ -401,7 +401,7 @@ const FeatureEntry::FeatureVariation kDXGIWaitableSwap +@@ -407,7 +407,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, -@@ -1317,7 +1317,7 @@ const FeatureEntry::FeatureVariation kLocalWebApproval +@@ -1322,7 +1322,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"}, -@@ -4479,13 +4479,13 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4375,13 +4375,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, -@@ -4752,7 +4752,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4633,7 +4633,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)}, -@@ -5331,7 +5331,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -5191,7 +5191,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(omnibox::kZeroSuggestInMemoryCaching)}, #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, -@@ -5969,7 +5969,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -5834,7 +5834,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)}, -@@ -6969,7 +6969,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6789,7 +6789,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, -@@ -7737,7 +7737,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7532,7 +7532,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)}, -@@ -7995,7 +7995,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7759,7 +7759,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, +@@ -7809,7 +7809,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, -@@ -8554,7 +8554,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -8346,7 +8346,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/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc b/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc index bea2cd828782..a35891fc20c5 100644 --- a/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc +++ b/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc @@ -1,11 +1,11 @@ ---- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2022-05-19 14:06:27 UTC +--- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc @@ -90,7 +90,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForSch return metrics::OmniboxInputType::QUERY; case ExternalProtocolHandler::UNKNOWN: { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - // Linux impl of GetApplicationNameForProtocol doesn't distinguish + // Linux impl of GetApplicationNameForScheme doesn't distinguish // between URL schemes with handers and those without. This will // make the default behaviour be search on Linux. diff --git a/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc b/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc index fda0b258cd29..0efa589ecfab 100644 --- a/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc +++ b/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc @@ -1,11 +1,11 @@ ---- chrome/browser/background/background_mode_manager.cc.orig 2023-01-11 09:17:16 UTC +--- chrome/browser/background/background_mode_manager.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/background/background_mode_manager.cc -@@ -892,7 +892,7 @@ gfx::ImageSkia GetStatusTrayIcon() { +@@ -889,7 +889,7 @@ gfx::ImageSkia GetStatusTrayIcon() { return gfx::ImageSkia(); return family->CreateExact(size).AsImageSkia(); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( IDR_PRODUCT_LOGO_128); #elif BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-chrome_browser_browser__features.cc b/www/chromium/files/patch-chrome_browser_browser__features.cc index 167ccb912cd1..97d82e9e7c7e 100644 --- a/www/chromium/files/patch-chrome_browser_browser__features.cc +++ b/www/chromium/files/patch-chrome_browser_browser__features.cc @@ -1,11 +1,11 @@ ---- chrome/browser/browser_features.cc.orig 2022-11-30 08:12:58 UTC +--- chrome/browser/browser_features.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/browser_features.cc -@@ -30,7 +30,7 @@ BASE_FEATURE(kColorProviderRedirectionForThemeProvider +@@ -24,7 +24,7 @@ BASE_FEATURE(kClosedTabCache, // the browser exits. BASE_FEATURE(kDestroyProfileOnBrowserClose, "DestroyProfileOnBrowserClose", -#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_ENABLED_BY_DEFAULT); #else base::FEATURE_DISABLED_BY_DEFAULT); diff --git a/www/chromium/files/patch-chrome_browser_browser__process__impl.cc b/www/chromium/files/patch-chrome_browser_browser__process__impl.cc index d4d9ac20cf0f..5f67687f7d49 100644 --- a/www/chromium/files/patch-chrome_browser_browser__process__impl.cc +++ b/www/chromium/files/patch-chrome_browser_browser__process__impl.cc @@ -1,29 +1,29 @@ ---- chrome/browser/browser_process_impl.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/browser_process_impl.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/browser_process_impl.cc -@@ -211,7 +211,7 @@ +@@ -212,7 +212,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 -@@ -1183,7 +1183,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { +@@ -1190,7 +1190,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 -@@ -1443,7 +1443,7 @@ void BrowserProcessImpl::Unpin() { +@@ -1450,7 +1450,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/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc b/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc index 6baafafc10a1..52edbdb6ea92 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc @@ -1,71 +1,71 @@ ---- chrome/browser/chrome_browser_interface_binders.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/chrome_browser_interface_binders.cc.orig 2023-03-09 06:31:50 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 @@ -192,7 +192,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" -@@ -812,7 +812,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)); -@@ -820,7 +820,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 -@@ -885,14 +885,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 -@@ -1303,7 +1303,7 @@ void PopulateChromeWebUIFrameBinders( +@@ -1332,7 +1332,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/chromium/files/patch-chrome_browser_chrome__browser__main.cc b/www/chromium/files/patch-chrome_browser_chrome__browser__main.cc index 0cdea082de9e..ffc9a400dcf9 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__main.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__main.cc @@ -1,43 +1,43 @@ ---- chrome/browser/chrome_browser_main.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/chrome_browser_main.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/chrome_browser_main.cc @@ -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 @@ -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() { +@@ -986,7 +986,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() { +@@ -1042,7 +1042,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/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc index 600447f12330..b1124d1564c8 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc @@ -1,145 +1,163 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/chrome_content_browser_client.cc -@@ -401,7 +401,7 @@ - #include "components/user_manager/user_manager.h" +@@ -412,7 +412,7 @@ #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" -@@ -486,12 +486,12 @@ +@@ -497,12 +497,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 -@@ -500,13 +500,13 @@ +@@ -511,13 +511,13 @@ #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/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) -@@ -535,11 +535,11 @@ +@@ -546,11 +546,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" -@@ -1649,7 +1649,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1559,7 +1559,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) +@@ -1666,7 +1666,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) -@@ -1688,7 +1688,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1705,7 +1705,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 -@@ -1709,7 +1709,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1726,7 +1726,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()); -@@ -1728,7 +1728,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo +@@ -1745,7 +1745,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>()); -@@ -2550,6 +2550,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2578,6 +2578,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin #elif BUILDFLAG(IS_POSIX) #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 +@@ -2949,7 +2951,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)) { -@@ -4416,7 +4418,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +@@ -4442,7 +4444,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, -@@ -4936,14 +4938,14 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4964,14 +4966,14 @@ 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); #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); -@@ -4978,7 +4980,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -5010,7 +5012,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati handle)); } -#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); +@@ -6616,7 +6618,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/chromium/files/patch-chrome_browser_chrome__content__browser__client.h b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h index 729784c58481..464da6aa1af5 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h +++ b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h @@ -1,11 +1,11 @@ ---- chrome/browser/chrome_content_browser_client.h.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/chrome_content_browser_client.h.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/chrome_content_browser_client.h -@@ -441,7 +441,7 @@ class ChromeContentBrowserClient : public content::Con +@@ -444,7 +444,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/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc b/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc index 8b9b9115d38e..9a0d5f0fc543 100644 --- a/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc +++ b/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc @@ -1,11 +1,11 @@ ---- chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc -@@ -69,7 +69,7 @@ void ChromeProtocolHandlerRegistryDelegate::CheckDefau +@@ -68,7 +68,7 @@ void ChromeProtocolHandlerRegistryDelegate::CheckDefau // If true default protocol handlers will be removed if the OS level // registration for a protocol is no longer Chrome. bool ChromeProtocolHandlerRegistryDelegate::ShouldRemoveHandlersNotInOS() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // We don't do this on Linux as the OS registration there is not reliable, // and Chrome OS doesn't have any notion of OS registration. // TODO(benwells): When Linux support is more reliable remove this diff --git a/www/chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc b/www/chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc index 2da502532ccd..36a953dccc3a 100644 --- a/www/chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc +++ b/www/chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc @@ -1,29 +1,29 @@ ---- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/download/chrome_download_manager_delegate.cc -@@ -1568,7 +1568,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1554,7 +1554,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(); } -@@ -1684,7 +1684,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow +@@ -1668,7 +1668,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()) { -@@ -1730,7 +1730,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAl +@@ -1714,7 +1714,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAl DCHECK(download_item->IsSavePackageDownload()); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) absl::optional settings = safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item); diff --git a/www/chromium/files/patch-chrome_browser_download_download__commands.cc b/www/chromium/files/patch-chrome_browser_download_download__commands.cc index 64002dd0fec3..09ef4c28bef4 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__commands.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__commands.cc @@ -1,20 +1,20 @@ ---- chrome/browser/download/download_commands.cc.orig 2022-05-19 14:06:27 UTC +--- chrome/browser/download/download_commands.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/download/download_commands.cc -@@ -26,7 +26,7 @@ +@@ -27,7 +27,7 @@ #include "ui/base/clipboard/scoped_clipboard_writer.h" #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" -@@ -167,7 +167,7 @@ void DownloadCommands::ExecuteCommand(Command command) +@@ -168,7 +168,7 @@ void DownloadCommands::ExecuteCommand(Command command) } #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) Browser* DownloadCommands::GetBrowser() const { if (!model_) diff --git a/www/chromium/files/patch-chrome_browser_download_download__commands.h b/www/chromium/files/patch-chrome_browser_download_download__commands.h index 35050c88691a..f715e5ab6d78 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__commands.h +++ b/www/chromium/files/patch-chrome_browser_download_download__commands.h @@ -1,11 +1,11 @@ ---- chrome/browser/download/download_commands.h.orig 2022-08-31 12:19:35 UTC +--- chrome/browser/download/download_commands.h.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/download/download_commands.h -@@ -55,7 +55,7 @@ class DownloadCommands { +@@ -56,7 +56,7 @@ class DownloadCommands { void ExecuteCommand(Command command); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) bool IsDownloadPdf() const; bool CanOpenPdfInSystemViewer() const; Browser* GetBrowser() const; diff --git a/www/chromium/files/patch-chrome_browser_download_download__item__model.cc b/www/chromium/files/patch-chrome_browser_download_download__item__model.cc index 29f4ae52d4a3..0854915e5833 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__item__model.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__item__model.cc @@ -1,29 +1,29 @@ ---- chrome/browser/download/download_item_model.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/download/download_item_model.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/download/download_item_model.cc -@@ -801,7 +801,7 @@ bool DownloadItemModel::IsCommandChecked( +@@ -756,7 +756,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(); -@@ -844,7 +844,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand +@@ -799,7 +799,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); -@@ -1255,7 +1255,7 @@ void DownloadItemModel::DetermineAndSetShouldPreferOpe +@@ -1210,7 +1210,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/chromium/files/patch-chrome_browser_download_download__prefs.cc b/www/chromium/files/patch-chrome_browser_download_download__prefs.cc index cc12bca0a1aa..385b5e737a46 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__prefs.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__prefs.cc @@ -1,90 +1,90 @@ ---- chrome/browser/download/download_prefs.cc.orig 2022-11-30 08:12:58 UTC +--- chrome/browser/download/download_prefs.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/download/download_prefs.cc -@@ -13,6 +13,7 @@ - #include "base/callback_helpers.h" +@@ -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/no_destructor.h" + #include "base/functional/bind.h" @@ -61,6 +62,10 @@ #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" #endif +#if BUILDFLAG(IS_OPENBSD) +#include "sandbox/policy/openbsd/sandbox_openbsd.h" +#endif + using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; @@ -71,7 +76,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; @@ -182,7 +187,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 @@ -302,7 +307,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) @@ -475,7 +480,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; @@ -507,7 +512,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(); @@ -538,7 +543,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; @@ -662,7 +667,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/chromium/files/patch-chrome_browser_enterprise_connectors_connectors__service.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_connectors__service.cc index a6f918268403..5f8b990302e3 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_connectors__service.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_connectors__service.cc @@ -1,11 +1,11 @@ ---- chrome/browser/enterprise/connectors/connectors_service.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/enterprise/connectors/connectors_service.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/enterprise/connectors/connectors_service.cc -@@ -513,7 +513,7 @@ bool ConnectorsService::ConnectorsEnabled() const { +@@ -507,7 +507,7 @@ bool ConnectorsService::ConnectorsEnabled() const { Profile* profile = Profile::FromBrowserContext(context_); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // On desktop, the guest profile is actually the primary OTR profile of // the "regular" guest profile. The regular guest profile is never used // directly by users. Also, user are not able to create child OTR profiles diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc index 2265e7bf79bc..379ceec2a909 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc @@ -1,43 +1,29 @@ ---- chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc.orig 2022-11-30 08:12:58 UTC +--- chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc -@@ -11,11 +11,11 @@ +@@ -11,7 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/core/keyed_service.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "chrome/browser/browser_process.h" - #if BUILDFLAG(IS_MAC) - #include "chrome/browser/enterprise/connectors/device_trust/browser/mac_device_trust_connector_service.h" --#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/browser/browser_device_trust_connector_service.h" - #endif // BUILDFLAG(IS_MAC) #include "chrome/browser/policy/chrome_browser_policy_connector.h" -@@ -45,7 +45,7 @@ DeviceTrustConnectorService* DeviceTrustConnectorServi +@@ -41,7 +41,7 @@ DeviceTrustConnectorService* DeviceTrustConnectorServi bool DeviceTrustConnectorServiceFactory::ServiceIsCreatedWithBrowserContext() const { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) return IsDeviceTrustConnectorFeatureEnabled(); #else return false; -@@ -81,7 +81,7 @@ KeyedService* DeviceTrustConnectorServiceFactory::Buil +@@ -77,7 +77,7 @@ KeyedService* DeviceTrustConnectorServiceFactory::Buil DeviceTrustConnectorService* service = nullptr; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (IsDeviceTrustConnectorFeatureEnabled()) { auto* key_manager = g_browser_process->browser_policy_connector() ->chrome_browser_cloud_management_controller() -@@ -89,7 +89,7 @@ KeyedService* DeviceTrustConnectorServiceFactory::Buil - #if BUILDFLAG(IS_MAC) - service = new MacDeviceTrustConnectorService( - key_manager, profile->GetPrefs(), g_browser_process->local_state()); --#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) - service = new BrowserDeviceTrustConnectorService(key_manager, - profile->GetPrefs()); - #endif // BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc index 72a03e4cb336..f006b6a7f929 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc @@ -1,20 +1,20 @@ ---- chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc.orig 2022-10-24 13:33:33 UTC +--- chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc -@@ -14,7 +14,7 @@ +@@ -13,7 +13,7 @@ #if BUILDFLAG(IS_WIN) #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/win_key_rotation_command.h" -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/linux_key_rotation_command.h" #elif BUILDFLAG(IS_MAC) #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/mac_key_rotation_command.h" -@@ -47,7 +47,7 @@ std::unique_ptr KeyRotationCommand - PrefService* local_prefs) { +@@ -45,7 +45,7 @@ std::unique_ptr KeyRotationCommand + scoped_refptr url_loader_factory) { #if BUILDFLAG(IS_WIN) return std::make_unique(); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return std::make_unique(url_loader_factory); #elif BUILDFLAG(IS_MAC) - return std::make_unique(url_loader_factory, + return std::make_unique(url_loader_factory); diff --git a/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn b/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn index 33b86d0aabbc..573e4afd38e4 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn +++ b/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn @@ -1,13 +1,13 @@ ---- chrome/browser/extensions/BUILD.gn.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/extensions/BUILD.gn.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/extensions/BUILD.gn -@@ -1328,6 +1328,10 @@ static_library("extensions") { +@@ -1336,6 +1336,10 @@ static_library("extensions") { deps += [ "//chrome/services/printing/public/mojom" ] } + if (is_bsd) { + sources -= [ "api/image_writer_private/removable_storage_provider_linux.cc" ] + } + if (enable_service_discovery) { sources += [ "api/mdns/mdns_api.cc", diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc index 66a357631856..3e59d4d2d5c4 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc +++ b/www/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-01-11 09:17:16 UTC +--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc -@@ -31,7 +31,7 @@ +@@ -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" -@@ -149,7 +149,7 @@ api::enterprise_reporting_private::ContextInfo ToConte +@@ -150,7 +150,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( const std::string& user_id, -@@ -209,7 +209,7 @@ EnterpriseReportingPrivateGetDeviceIdFunction:: +@@ -210,7 +210,7 @@ EnterpriseReportingPrivateGetDeviceIdFunction:: // getPersistentSecret -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) EnterpriseReportingPrivateGetPersistentSecretFunction:: EnterpriseReportingPrivateGetPersistentSecretFunction() = default; -@@ -636,7 +636,7 @@ void EnterpriseReportingPrivateEnqueueRecordFunction:: +@@ -637,7 +637,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/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h index bba2bf2f5f30..048a9551288c 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h +++ b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h @@ -1,29 +1,29 @@ ---- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h.orig 2022-11-30 08:12:58 UTC +--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h -@@ -19,7 +19,7 @@ +@@ -20,7 +20,7 @@ #include "components/reporting/proto/synced/record.pb.h" #include "components/reporting/proto/synced/record_constants.pb.h" #include "components/reporting/util/statusor.h" -#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/time/time.h" #include "components/device_signals/core/browser/signals_types.h" #endif // BUILDFLAG(IS_CHROMEOS) -@@ -55,7 +55,7 @@ class EnterpriseReportingPrivateGetDeviceIdFunction : +@@ -56,7 +56,7 @@ class EnterpriseReportingPrivateGetDeviceIdFunction : ~EnterpriseReportingPrivateGetDeviceIdFunction() override; }; -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) class EnterpriseReportingPrivateGetPersistentSecretFunction : public ExtensionFunction { -@@ -265,7 +265,7 @@ class EnterpriseReportingPrivateEnqueueRecordFunction +@@ -266,7 +266,7 @@ class 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) class EnterpriseReportingPrivateGetFileSystemInfoFunction : public ExtensionFunction { diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc b/www/chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc index 7f1ccaa84855..fd62272262c3 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc +++ b/www/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-02-08 09:03:45 UTC +--- chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc -@@ -518,7 +518,7 @@ void PasswordsPrivateDelegateImpl::OsReauthCall( +@@ -520,7 +520,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/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc b/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc index 907598ae7826..79980cfa35bf 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/extensions/api/settings_private/prefs_util.cc -@@ -185,7 +185,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -189,7 +189,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist // 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) (*s_allowlist)[::prefs::kUseCustomChromeFrame] = settings_api::PrefType::PREF_TYPE_BOOLEAN; #endif -@@ -197,7 +197,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -201,7 +201,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist settings_api::PrefType::PREF_TYPE_STRING; (*s_allowlist)[::prefs::kPolicyThemeColor] = settings_api::PrefType::PREF_TYPE_NUMBER; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) (*s_allowlist)[::prefs::kUsesSystemThemeDeprecated] = settings_api::PrefType::PREF_TYPE_BOOLEAN; (*s_allowlist)[::prefs::kSystemTheme] = diff --git a/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc b/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc index 962691ef1bef..21e1b0bfaea4 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/external_provider_impl.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/extensions/external_provider_impl.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/extensions/external_provider_impl.cc -@@ -825,7 +825,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -819,7 +819,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( -@@ -853,7 +853,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -847,7 +847,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/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc b/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc index 87cbeeea81cd..3c77dec7b834 100644 --- a/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc +++ b/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc @@ -1,11 +1,11 @@ ---- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig 2023-02-16 17:16:19 UTC +--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc -@@ -302,7 +302,7 @@ const struct { - {base::DIR_HOME, FILE_PATH_LITERAL("Library/CloudStorage"), +@@ -309,7 +309,7 @@ const struct { + {base::DIR_HOME, FILE_PATH_LITERAL("Library/Mobile Documents"), kDontBlockChildren}, #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // On Linux also block access to devices via /dev. {kNoBasePathKey, FILE_PATH_LITERAL("/dev"), kBlockAllChildren}, // And security sensitive data in /proc and /sys. diff --git a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc index 6b48189d92c1..89f6b8649997 100644 --- a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc +++ b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc @@ -1,56 +1,65 @@ ---- chrome/browser/flag_descriptions.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/flag_descriptions.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/flag_descriptions.cc -@@ -6339,7 +6339,7 @@ const char kSearchWebInSidePanelDescription[] = +@@ -6087,7 +6087,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 " +@@ -6316,7 +6316,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."; -@@ -6348,7 +6348,7 @@ const char kQuickCommandsDescription[] = +@@ -6325,7 +6325,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."; -@@ -6369,7 +6369,7 @@ const char kWebShareDescription[] = +@@ -6346,7 +6346,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"; -@@ -6389,7 +6389,7 @@ const char kWebBluetoothConfirmPairingSupportDescripti +@@ -6366,7 +6366,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."; -@@ -6403,7 +6403,7 @@ const char kForcePasswordInitialSyncWhenDecryptionFail +@@ -6380,7 +6380,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) -@@ -6496,7 +6496,7 @@ const char kElasticOverscrollDescription[] = +@@ -6481,7 +6481,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/chromium/files/patch-chrome_browser_flag__descriptions.h b/www/chromium/files/patch-chrome_browser_flag__descriptions.h index f891ca6d06ad..22fb60a7631e 100644 --- a/www/chromium/files/patch-chrome_browser_flag__descriptions.h +++ b/www/chromium/files/patch-chrome_browser_flag__descriptions.h @@ -1,62 +1,71 @@ ---- chrome/browser/flag_descriptions.h.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/flag_descriptions.h.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/flag_descriptions.h -@@ -3657,14 +3657,14 @@ extern const char kSearchWebInSidePanelDescription[]; +@@ -3520,7 +3520,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[]; + +@@ -3639,14 +3639,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) -@@ -3674,7 +3674,7 @@ extern const char kWebBluetoothConfirmPairingSupportNa +@@ -3656,7 +3656,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[]; -@@ -3684,7 +3684,7 @@ extern const char kOzonePlatformHintName[]; +@@ -3666,7 +3666,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[]; -@@ -3692,13 +3692,13 @@ extern const char kForcePasswordInitialSyncWhenDecrypt +@@ -3674,13 +3674,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) || -@@ -3773,7 +3773,7 @@ extern const char kElasticOverscrollDescription[]; +@@ -3760,7 +3760,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/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc b/www/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc index e9f738c93ff8..706437f7a112 100644 --- a/www/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc +++ b/www/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc @@ -1,25 +1,25 @@ ---- chrome/browser/headless/headless_mode_util.cc.orig 2023-01-11 09:17:16 UTC +--- chrome/browser/headless/headless_mode_util.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/headless/headless_mode_util.cc @@ -10,11 +10,11 @@ // New headless mode is available on Linux, Windows and Mac platforms. // More platforms will be added later, so avoid function level clutter // by providing stub implementations at the end of the file. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "base/base_switches.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - #include "ui/gl/gl_switches.h" - #include "ui/ozone/public/ozone_switches.h" + #include "ui/gl/gl_switches.h" // nogncheck + #include "ui/ozone/public/ozone_switches.h" // nogncheck #endif // BUILDFLAG(IS_LINUX) @@ -64,7 +64,7 @@ void SetUpCommandLine(const base::CommandLine* command base::CommandLine::ForCurrentProcess()->AppendSwitch( ::switches::kNoErrorDialogs); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Headless mode on Linux relies on ozone/headless platform. base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( ::switches::kOzonePlatform, switches::kHeadless); diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc new file mode 100644 index 000000000000..00c0319ed7b8 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_capture__policy__utils.cc @@ -0,0 +1,20 @@ +--- chrome/browser/media/webrtc/capture_policy_utils.cc.orig 2023-03-09 06:31:50 UTC ++++ chrome/browser/media/webrtc/capture_policy_utils.cc +@@ -118,7 +118,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 + 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/chromium/files/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc new file mode 100644 index 000000000000..ac438f7610fa --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc @@ -0,0 +1,47 @@ +--- chrome/browser/media/webrtc/chrome_screen_enumerator.cc.orig 2023-03-09 06:31:50 UTC ++++ chrome/browser/media/webrtc/chrome_screen_enumerator.cc +@@ -20,7 +20,7 @@ + #if BUILDFLAG(IS_CHROMEOS_ASH) + #include "ash/shell.h" + #include "ui/aura/window.h" +-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "base/functional/callback.h" + #include "content/public/browser/desktop_capture.h" + #endif +@@ -31,7 +31,7 @@ base::LazyInstance>::Destru + root_windows_for_testing_ = LAZY_INSTANCE_INITIALIZER; + } // namespace + +-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + namespace { + base::LazyInstance>::DestructorAtExit + g_desktop_capturer_for_testing = LAZY_INSTANCE_INITIALIZER; +@@ -77,7 +77,7 @@ blink::mojom::StreamDevicesSetPtr EnumerateScreens( + return stream_devices_set; + } + +-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + blink::mojom::StreamDevicesSetPtr EnumerateScreens( + blink::mojom::MediaStreamType stream_type) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); +@@ -128,7 +128,7 @@ void ChromeScreenEnumerator::SetRootWindowsForTesting( + root_windows_for_testing_.Get() = std::move(root_windows); + } + +-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + void ChromeScreenEnumerator::SetDesktopCapturerForTesting( + std::unique_ptr capturer) { + g_desktop_capturer_for_testing.Get() = std::move(capturer); +@@ -144,7 +144,7 @@ void ChromeScreenEnumerator::EnumerateScreens( + DCHECK(base::FeatureList::IsEnabled( + features::kGetDisplayMediaSetAutoSelectAllScreens)); + +-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + content::GetUIThreadTaskRunner({})->PostTaskAndReplyWithResult( + FROM_HERE, base::BindOnce(::EnumerateScreens, stream_type), + base::BindOnce( diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h b/www/chromium/files/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h new file mode 100644 index 000000000000..9f7430e5d302 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h @@ -0,0 +1,20 @@ +--- chrome/browser/media/webrtc/chrome_screen_enumerator.h.orig 2023-03-09 06:31:50 UTC ++++ chrome/browser/media/webrtc/chrome_screen_enumerator.h +@@ -21,7 +21,7 @@ namespace aura { + class Window; + } + +-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + namespace webrtc { + class DesktopCapturer; + } +@@ -42,7 +42,7 @@ class ChromeScreenEnumerator : public media::ScreenEnu + + #if BUILDFLAG(IS_CHROMEOS_ASH) + static void SetRootWindowsForTesting(std::vector root_windows); +-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + static void SetDesktopCapturerForTesting( + std::unique_ptr capturer); + #endif diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc index 5e7159774a61..31c9b5208ea6 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc @@ -1,11 +1,11 @@ ---- chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -@@ -40,7 +40,7 @@ const char kProduct[] = "Chrome"; +@@ -41,7 +41,7 @@ const char kProduct[] = "Chrome"; const char kProduct[] = "Chrome_Mac"; #elif BUILDFLAG(IS_CHROMEOS_ASH) const char kProduct[] = "Chrome_ChromeOS"; -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) const char kProduct[] = "Chrome_Linux"; #elif BUILDFLAG(IS_ANDROID) const char kProduct[] = "Chrome_Android"; diff --git a/www/chromium/files/patch-chrome_browser_memory__details__linux.cc b/www/chromium/files/patch-chrome_browser_memory__details__linux.cc index e174124e6c99..bbd138d501b9 100644 --- a/www/chromium/files/patch-chrome_browser_memory__details__linux.cc +++ b/www/chromium/files/patch-chrome_browser_memory__details__linux.cc @@ -1,37 +1,37 @@ ---- chrome/browser/memory_details_linux.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/memory_details_linux.cc.orig 2023-03-10 06:02:42 UTC +++ chrome/browser/memory_details_linux.cc -@@ -13,6 +13,7 @@ +@@ -12,6 +12,7 @@ + #include #include - #include "base/bind.h" +#include "base/command_line.h" #include "base/files/file_util.h" + #include "base/functional/bind.h" #include "base/process/process_iterator.h" - #include "base/process/process_metrics.h" @@ -27,6 +28,7 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/process_type.h" +#include "sandbox/policy/switches.h" #include "ui/base/l10n/l10n_util.h" using base::ProcessEntry; @@ -70,9 +72,18 @@ ProcessData GetProcessDataMemoryInformation( std::unique_ptr metrics( base::ProcessMetrics::CreateProcessMetrics(pid)); + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (!command_line->HasSwitch(sandbox::policy::switches::kNoSandbox)) { + pmi.num_open_fds = 0; + pmi.open_fds_soft_limit = 0; + goto out; + } + pmi.num_open_fds = metrics->GetOpenFdCount(); pmi.open_fds_soft_limit = metrics->GetOpenFdSoftLimit(); +out: process_data.processes.push_back(pmi); } return process_data; diff --git a/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc b/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc index e19d6f09e1a3..d4d82bbed5f5 100644 --- a/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc +++ b/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc @@ -1,23 +1,23 @@ ---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2022-11-30 08:12:58 UTC +--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc @@ -61,8 +61,10 @@ // 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) +-#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" -@@ -494,7 +496,7 @@ void RecordStartupMetrics() { +@@ -491,7 +493,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, diff --git a/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc b/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc index e35545560868..406de1d698fa 100644 --- a/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc +++ b/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc @@ -1,47 +1,47 @@ ---- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/metrics/chrome_metrics_service_client.cc -@@ -175,7 +175,7 @@ +@@ -174,7 +174,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 +@@ -736,7 +736,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 +@@ -817,7 +817,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()); -@@ -917,7 +917,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -915,7 +915,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) -@@ -1108,7 +1108,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve +@@ -1099,7 +1099,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/chromium/files/patch-chrome_browser_platform__util__linux.cc b/www/chromium/files/patch-chrome_browser_platform__util__linux.cc index 521c822df258..0e7b72ae7ef5 100644 --- a/www/chromium/files/patch-chrome_browser_platform__util__linux.cc +++ b/www/chromium/files/patch-chrome_browser_platform__util__linux.cc @@ -1,12 +1,12 @@ ---- chrome/browser/platform_util_linux.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/platform_util_linux.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/platform_util_linux.cc -@@ -296,7 +296,9 @@ void RunCommand(const std::string& command, +@@ -298,7 +298,9 @@ void RunCommand(const std::string& command, base::LaunchOptions options; options.current_directory = working_directory; +#if !defined(OS_BSD) options.allow_new_privs = true; +#endif // xdg-open can fall back on mailcap which eventually might plumb through // to a command that needs a terminal. Set the environment variable telling // it that we definitely don't have a terminal available and that it should diff --git a/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc b/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc index 8680d2a5ad31..98f9730b8a22 100644 --- a/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc +++ b/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc @@ -1,165 +1,195 @@ ---- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/policy/configuration_policy_handler_list_factory.cc -@@ -200,13 +200,13 @@ +@@ -201,17 +201,17 @@ #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 -@@ -743,14 +743,14 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +-#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) || +@@ -745,14 +745,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 }, -@@ -1380,7 +1380,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1382,7 +1382,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 }, -@@ -1450,18 +1450,18 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1452,18 +1452,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 }, -@@ -1474,7 +1474,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1476,7 +1476,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 }, -@@ -1581,7 +1581,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1583,7 +1583,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 }, -@@ -1668,7 +1668,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1670,13 +1670,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 }, -@@ -1715,7 +1715,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1723,7 +1723,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 }, -@@ -1775,7 +1775,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1783,7 +1783,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { key::kPrefixedStorageInfoEnabled, storage::kPrefixedStorageInfoEnabled, base::Value::Type::BOOLEAN }, -#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 }, -@@ -2025,7 +2025,7 @@ std::unique_ptr BuildH - SimpleSchemaValidatingPolicyHandler::RECOMMENDED_PROHIBITED, - SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED)); +@@ -1828,7 +1828,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 }, +@@ -2092,7 +2092,7 @@ std::unique_ptr BuildH + #endif // BUILDFLAG(IS_ANDROID) --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #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( -@@ -2102,7 +2102,7 @@ std::unique_ptr BuildH +@@ -2150,7 +2150,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) -@@ -2137,7 +2137,7 @@ std::unique_ptr BuildH +@@ -2185,7 +2185,7 @@ std::unique_ptr BuildH std::vector> signin_legacy_policies; #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_LINUX) + BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) signin_legacy_policies.push_back(std::make_unique( key::kForceBrowserSignin, prefs::kForceBrowserSignin, base::Value::Type::BOOLEAN)); -@@ -2478,7 +2478,7 @@ std::unique_ptr BuildH +@@ -2526,7 +2526,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) || -@@ -2491,7 +2491,7 @@ std::unique_ptr BuildH +@@ -2539,7 +2539,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( -@@ -2499,7 +2499,7 @@ std::unique_ptr BuildH +@@ -2547,7 +2547,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)); +@@ -2560,7 +2560,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/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc b/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc index 5085a6174e88..c3160f613576 100644 --- a/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc +++ b/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc @@ -1,69 +1,69 @@ ---- chrome/browser/prefs/browser_prefs.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/prefs/browser_prefs.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/prefs/browser_prefs.cc -@@ -455,14 +455,14 @@ +@@ -458,14 +458,14 @@ #include "components/os_crypt/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 "chrome/browser/web_applications/url_handler_prefs.h" #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 -@@ -495,7 +495,7 @@ +@@ -498,7 +498,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 -@@ -1033,7 +1033,7 @@ void RegisterProfilePrefsForMigration( +@@ -1069,7 +1069,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 -@@ -1292,7 +1292,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -1346,7 +1346,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) web_app::url_handler_prefs::RegisterLocalStatePrefs(registry); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -@@ -1627,11 +1627,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync +@@ -1683,11 +1683,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 -@@ -2015,7 +2015,7 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { +@@ -2086,7 +2086,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/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc b/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc index ea151f20f8b9..6ca6716fc15f 100644 --- a/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc +++ b/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc @@ -1,11 +1,11 @@ ---- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/prefs/pref_service_incognito_allowlist.cc -@@ -138,7 +138,7 @@ const char* const kPersistentPrefNames[] = { +@@ -139,7 +139,7 @@ const char* const kPersistentPrefNames[] = { // 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) // Toggleing custom frames affects all open windows in the profile, hence // should be written to the regular profile when changed in incognito mode. prefs::kUseCustomChromeFrame, diff --git a/www/chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc b/www/chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc index eb0c3b23640b..9a500c81ed73 100644 --- a/www/chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc +++ b/www/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-02-08 09:03:45 UTC +--- chrome/browser/printing/print_backend_service_manager.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/printing/print_backend_service_manager.cc -@@ -513,7 +513,7 @@ absl::optional PrintBackendServiceManager::R +@@ -547,7 +547,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 -@@ -751,7 +751,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate +@@ -811,7 +811,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; -@@ -808,7 +808,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate +@@ -868,7 +868,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 (!query_with_ui_clients_.empty()) + if (HasQueryWithUiClientForRemoteId(remote_id)) { return absl::nullopt; diff --git a/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc b/www/chromium/files/patch-chrome_browser_printing_printer__query.cc similarity index 55% rename from www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc rename to www/chromium/files/patch-chrome_browser_printing_printer__query.cc index 15d39fa7a99e..d291572703e5 100644 --- a/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc +++ b/www/chromium/files/patch-chrome_browser_printing_printer__query.cc @@ -1,11 +1,11 @@ ---- chrome/browser/printing/print_job_worker.cc.orig 2023-02-08 09:03:45 UTC -+++ chrome/browser/printing/print_job_worker.cc -@@ -205,7 +205,7 @@ void PrintJobWorker::SetSettings(base::Value::Dict new +--- chrome/browser/printing/printer_query.cc.orig 2023-03-09 06:31:50 UTC ++++ chrome/browser/printing/printer_query.cc +@@ -284,7 +284,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_LINUX) || BUILDFLAG(IS_BSD)) && 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/chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc b/www/chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc index 862868bf5bf5..b510f43186f1 100644 --- a/www/chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc +++ b/www/chromium/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc @@ -1,25 +1,26 @@ ---- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc -@@ -260,7 +260,7 @@ - #include "chrome/browser/ui/cocoa/screentime/screentime_features.h" +@@ -262,7 +262,7 @@ #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 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 -@@ -444,11 +444,11 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -451,12 +451,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) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #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(); diff --git a/www/chromium/files/patch-chrome_browser_profiles_profile__impl.cc b/www/chromium/files/patch-chrome_browser_profiles_profile__impl.cc index c47e91edd591..9e334b8385f5 100644 --- a/www/chromium/files/patch-chrome_browser_profiles_profile__impl.cc +++ b/www/chromium/files/patch-chrome_browser_profiles_profile__impl.cc @@ -1,31 +1,31 @@ ---- chrome/browser/profiles/profile_impl.cc.orig 2023-02-08 09:03:45 UTC +--- chrome/browser/profiles/profile_impl.cc.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/profiles/profile_impl.cc @@ -257,6 +257,10 @@ #include "chrome/browser/spellchecker/spellcheck_service.h" #endif +#if BUILDFLAG(IS_OPENBSD) +#include "sandbox/policy/openbsd/sandbox_openbsd.h" +#endif + using bookmarks::BookmarkModel; using content::BrowserThread; using content::DownloadManagerDelegate; -@@ -861,7 +865,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) +@@ -863,7 +867,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/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html index e2564e50325d..645e71dd8d1d 100644 --- a/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html +++ b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html @@ -1,29 +1,29 @@ ---- chrome/browser/resources/settings/appearance_page/appearance_page.html.orig 2022-10-24 13:33:33 UTC +--- chrome/browser/resources/settings/appearance_page/appearance_page.html.orig 2023-03-09 06:31:50 UTC +++ chrome/browser/resources/settings/appearance_page/appearance_page.html -@@ -27,7 +27,7 @@ - - + - +