diff --git a/www/chromium/Makefile b/www/chromium/Makefile index 3d4429ee6d80..0f1af3a86296 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,348 +1,343 @@ # Created by: Florent Thoumie PORTNAME= chromium -PORTVERSION= 101.0.4951.67 +PORTVERSION= 102.0.5005.61 CATEGORIES= www MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ https://nerd.hu/distfiles/:fonts DISTFILES= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= chromium@FreeBSD.org COMMENT= Google web browser based on WebKit 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 LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \ 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 \ 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 jpeg localbase:ldflags \ ninja perl5 pkgconfig python:3.7+,build 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 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} # 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_hangout_services_extension=true \ enable_js_type_check=false \ enable_nacl=false \ enable_one_click_signin=true \ enable_remoting=false \ enable_wmax_tokens=false \ fatal_linker_warnings=false \ is_clang=true \ optimize_webui=true \ toolkit_views=true \ treat_warnings_as_errors=false \ use_allocator="none" \ use_allocator_shim=false \ use_aura=true \ use_custom_libcxx=false \ use_gnome_keyring=false \ use_lld=true \ use_sysroot=false \ use_system_freetype=false \ use_system_harfbuzz=true \ use_system_libjpeg=true \ use_system_wayland_scanner=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-cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb.tar.gz:fonts TEST_ALL_TARGET= ${TEST_TARGETS} .include .include .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 libusb libdrm libpng 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 icudtl.dat 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 - @${MKDIR} ${STAGEDIR}${DATADIR}/swiftshader ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvk_swiftshader.so ${STAGEDIR}${DATADIR} -.for g in libEGL.so libGLESv2.so - ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/swiftshader/${g} \ - ${STAGEDIR}${DATADIR}/swiftshader -.endfor .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 0e418263b579..9056d6f260f6 100644 --- a/www/chromium/distinfo +++ b/www/chromium/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1652513853 -SHA256 (chromium-101.0.4951.67.tar.xz) = d419af6fd170d02008b7f78086af11d8e0980618584dc6267ac20e97a4e6e361 -SIZE (chromium-101.0.4951.67.tar.xz) = 1414904488 -SHA256 (chromium-101.0.4951.67-testdata.tar.xz) = 271f168770dc1a09f8aac194abdf8c53b8fffe3ca7cb03472a04b37146aad462 -SIZE (chromium-101.0.4951.67-testdata.tar.xz) = 260656956 +TIMESTAMP = 1652962621 +SHA256 (chromium-102.0.5005.61.tar.xz) = 1a3797d36901fa3ba63744b9a870b65a8890c9a850442c160196bc64df886b1f +SIZE (chromium-102.0.5005.61.tar.xz) = 1433350708 +SHA256 (chromium-102.0.5005.61-testdata.tar.xz) = 463cd2d0fb101d16bd931814037625d092a65ed4a3b99249d2948201b2fe5805 +SIZE (chromium-102.0.5005.61-testdata.tar.xz) = 260757092 SHA256 (test_fonts-cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb.tar.gz) = ec973eccd669d417fbf2d0a4dac730744a3174268ff062db5451b55c82bc3492 SIZE (test_fonts-cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb.tar.gz) = 26759650 diff --git a/www/chromium/files/patch-BUILD.gn b/www/chromium/files/patch-BUILD.gn index 67d26dc553f0..98eca15f4c7c 100644 --- a/www/chromium/files/patch-BUILD.gn +++ b/www/chromium/files/patch-BUILD.gn @@ -1,72 +1,80 @@ ---- BUILD.gn.orig 2022-04-21 18:48:31 UTC +--- BUILD.gn.orig 2022-05-19 14:06:27 UTC +++ BUILD.gn @@ -54,7 +54,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) -@@ -436,7 +436,7 @@ group("gn_all") { +@@ -86,7 +86,6 @@ group("gn_all") { + "//codelabs", + "//components:components_unittests", + "//components/gwp_asan:gwp_asan_unittests", +- "//infra/orchestrator:orchestrator_all", + "//net:net_unittests", + "//services:services_unittests", + "//services/service_manager/public/cpp", +@@ -450,7 +449,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", -@@ -625,6 +625,15 @@ group("gn_all") { +@@ -635,6 +634,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", -@@ -674,7 +683,7 @@ group("gn_all") { +@@ -683,7 +691,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)" ] } -@@ -1141,7 +1150,7 @@ if (!is_ios) { +@@ -1159,7 +1167,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)" ] } -@@ -1150,7 +1159,7 @@ if (!is_ios) { +@@ -1168,7 +1176,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)" ] } -@@ -1540,7 +1549,7 @@ group("chromium_builder_perf") { +@@ -1565,7 +1573,7 @@ group("chromium_builder_perf") { if (is_win) { data_deps += [ "//chrome/installer/mini_installer:mini_installer" ] - } else { + } else if (!is_bsd) { data_deps += [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ] } diff --git a/www/chromium/files/patch-base_BUILD.gn b/www/chromium/files/patch-base_BUILD.gn index 28df7dbb13f1..7f88a789793f 100644 --- a/www/chromium/files/patch-base_BUILD.gn +++ b/www/chromium/files/patch-base_BUILD.gn @@ -1,146 +1,146 @@ ---- base/BUILD.gn.orig 2022-04-21 18:48:31 UTC +--- base/BUILD.gn.orig 2022-05-19 14:06:27 UTC +++ base/BUILD.gn -@@ -1010,7 +1010,7 @@ mixed_component("base") { +@@ -998,7 +998,7 @@ mixed_component("base") { "timer/hi_res_timer_manager_posix.cc", ] - if (!is_nacl && !is_apple) { + if (!is_nacl && !is_apple && !is_bsd) { sources += [ "cpu_affinity_posix.cc", "cpu_affinity_posix.h", -@@ -1021,6 +1021,12 @@ mixed_component("base") { +@@ -1009,6 +1009,12 @@ mixed_component("base") { "profiler/thread_delegate_posix.h", ] } + + if (is_bsd) { + sources += [ + "profiler/stack_sampler_posix.cc", + ] + } } if (is_win) { -@@ -1492,11 +1498,23 @@ mixed_component("base") { +@@ -1486,11 +1492,23 @@ mixed_component("base") { # building inside the cros_sdk environment - use host_toolchain as a # more robust check for this. if (!use_sysroot && - (is_android || ((is_linux || is_chromeos) && !is_chromecast)) && + (is_android || ((is_linux || is_chromeos) && !is_chromecast && !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/allocator_shim.cc", -@@ -1520,7 +1538,7 @@ mixed_component("base") { +@@ -1518,7 +1536,7 @@ mixed_component("base") { ] configs += [ "//base/allocator:mac_no_default_new_delete_symbols" ] } - if (is_chromeos || is_linux) { + if (is_chromeos || (is_linux && !is_bsd)) { sources += [ "allocator/allocator_shim_override_cpp_symbols.h", "allocator/allocator_shim_override_glibc_weak_symbols.h", -@@ -1576,7 +1594,7 @@ mixed_component("base") { +@@ -1574,7 +1592,7 @@ mixed_component("base") { # Allow more direct string conversions on platforms with native utf8 # strings - if (is_apple || is_chromeos || is_chromecast || is_fuchsia) { + if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -2255,6 +2273,42 @@ mixed_component("base") { +@@ -2147,6 +2165,42 @@ mixed_component("base") { } } + if (is_bsd) { + sources -= [ -+ "files/file_path_watcher_linux.cc", ++ "files/file_path_watcher_inotify.cc", + "files/file_util_linux.cc", + "files/scoped_file_linux.cc", + "process/memory_linux.cc", + "process/process_linux.cc", + "system/sys_info_linux.cc", + "process/process_iterator_linux.cc", + "process/process_metrics_linux.cc", + "process/process_handle_linux.cc" + ] + sources += [ + "process/memory_stubs.cc", + "files/file_path_watcher_kqueue.cc", + "files/file_path_watcher_kqueue.h", + "files/file_path_watcher_bsd.cc", + ] + } + + if (is_openbsd) { + sources += [ + "process/process_handle_openbsd.cc", + "process/process_iterator_openbsd.cc", + "process/process_metrics_openbsd.cc", + "system/sys_info_openbsd.cc", + ] + } else if (is_freebsd) { + sources += [ + "process/process_handle_freebsd.cc", + "process/process_iterator_freebsd.cc", + "process/process_metrics_freebsd.cc", + "system/sys_info_freebsd.cc", + ] + } + # iOS if (is_ios) { sources -= [ -@@ -3537,7 +3591,7 @@ test("base_unittests") { +@@ -3436,7 +3490,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", -@@ -3585,7 +3639,7 @@ test("base_unittests") { +@@ -3484,7 +3538,7 @@ test("base_unittests") { "posix/unix_domain_socket_unittest.cc", "task/thread_pool/task_tracker_posix_unittest.cc", ] - if (!is_nacl && !is_apple) { + if (!is_nacl && !is_apple && !is_bsd) { sources += [ "cpu_affinity_posix_unittest.cc", "profiler/stack_copier_signal_unittest.cc", -@@ -3596,7 +3650,7 @@ test("base_unittests") { +@@ -3495,7 +3549,7 @@ test("base_unittests") { # Allow more direct string conversions on platforms with native utf8 # strings - if (is_apple || is_chromeos || is_chromecast || is_fuchsia) { + if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -3765,7 +3819,7 @@ test("base_unittests") { +@@ -3657,7 +3711,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 3f03f54ad491..b92553d33536 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,11 +1,20 @@ ---- base/allocator/partition_allocator/address_space_randomization.h.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/address_space_randomization.h.orig 2022-05-19 14:06:27 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 +@@ -121,7 +121,7 @@ AslrMask(uintptr_t bits) { + return AslrAddress(0x20000000ULL); + } + +- #elif BUILDFLAG(IS_LINUX) ++ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + + // Linux on arm64 can use 39, 42, 48, or 52-bit user space, depending on + // page size and number of levels of translation pages used. We use diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h b/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h new file mode 100644 index 000000000000..bd41b2b9b998 --- /dev/null +++ b/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator__constants.h @@ -0,0 +1,29 @@ +--- base/allocator/partition_allocator/page_allocator_constants.h.orig 2022-05-19 14:06:27 UTC ++++ base/allocator/partition_allocator/page_allocator_constants.h +@@ -24,7 +24,7 @@ + // elimination. + #define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const)) + +-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64) ++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64) + // This should work for all POSIX (if needed), but currently all other + // supported OS/architecture combinations use either hard-coded values + // (such as x86) or have means to determine these values without needing +@@ -79,7 +79,7 @@ PageAllocationGranularityShift() { + return 14; // 16kB + #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS) + return vm_page_shift; +-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64) ++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64) + // arm64 supports 4kb (shift = 12), 16kb (shift = 14), and 64kb (shift = 16) + // page sizes. Retrieve from or initialize cache. + int shift = page_characteristics.shift.load(std::memory_order_relaxed); +@@ -99,7 +99,7 @@ PageAllocationGranularity() { + // This is literally equivalent to |1 << PageAllocationGranularityShift()| + // below, but was separated out for IS_APPLE to avoid << on a non-constexpr. + return vm_page_size; +-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64) ++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64) + // arm64 supports 4kb, 16kb, and 64kb page sizes. Retrieve from or + // initialize cache. + int size = page_characteristics.size.load(std::memory_order_relaxed); 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 new file mode 100644 index 000000000000..6b2c32c5ae86 --- /dev/null +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__address__space.cc @@ -0,0 +1,11 @@ +--- base/allocator/partition_allocator/partition_address_space.cc.orig 2022-05-19 14:06:27 UTC ++++ base/allocator/partition_allocator/partition_address_space.cc +@@ -184,7 +184,7 @@ void PartitionAddressSpace::UninitConfigurablePoolForT + setup_.configurable_pool_ = 0; + } + +-#if BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64) + + PageCharacteristics page_characteristics; + diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.cc b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.cc index eea69f0eebf4..6da50c163beb 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc.cc @@ -1,15 +1,17 @@ ---- base/allocator/partition_allocator/partition_alloc.cc.orig 2021-12-31 00:57:18 UTC +--- base/allocator/partition_allocator/partition_alloc.cc.orig 2022-05-19 14:06:27 UTC +++ base/allocator/partition_allocator/partition_alloc.cc -@@ -56,7 +56,12 @@ void PartitionAllocGlobalInit(OomFunction on_out_of_me +@@ -63,8 +63,14 @@ void PartitionAllocGlobalInit(OomFunction on_out_of_me "maximum direct mapped allocation"); // Check that some of our zanier calculations worked out as expected. +#if defined(__i386__) && defined(OS_FREEBSD) + // alignof(std::max_align_t) is only 4 on FreeBSD/i386 -+ static_assert(kSmallestBucket >= kAlignment, "generic smallest bucket"); ++ static_assert(internal::kSmallestBucket >= internal::kAlignment, ++ "generic smallest bucket"); +#else - static_assert(kSmallestBucket == kAlignment, "generic smallest bucket"); + static_assert(internal::kSmallestBucket == internal::kAlignment, + "generic smallest bucket"); +#endif - static_assert(kMaxBucketed == 917504, "generic max bucketed"); + static_assert(internal::kMaxBucketed == 917504, "generic max bucketed"); STATIC_ASSERT_OR_PA_CHECK( - MaxSystemPagesPerRegularSlotSpan() <= 16, + internal::MaxSystemPagesPerRegularSlotSpan() <= 16, 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 6adb646639f4..ae70ea5b47aa 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 2022-04-21 18:48:31 UTC +--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-05-19 14:06:27 UTC +++ base/allocator/partition_allocator/partition_alloc_config.h @@ -66,7 +66,7 @@ static_assert(sizeof(void*) != 8, ""); // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific // features such as futex(2). -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) #define PA_HAS_LINUX_KERNEL #endif @@ -186,7 +186,7 @@ constexpr bool kUseLazyCommit = false; // On these platforms, lock all the partitions before fork(), and unlock after. // This may be required on more platforms in the future. -#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #define PA_HAS_ATFORK_HANDLER #endif -@@ -212,7 +212,7 @@ constexpr bool kUseLazyCommit = false; +@@ -225,7 +225,7 @@ constexpr bool kUseLazyCommit = false; // - // This is intended to roll out more broadly, but only enabled on Linux for now - // to get performance bot and real-world data pre-A/B experiment. --#if BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + // Also enabled on ARM64 macOS, as the 16kiB pages on this platform lead to + // larger slot spans. +-#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) ++#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) || BUILDFLAG(IS_BSD) #define PA_PREFER_SMALLER_SLOT_SPANS #endif // BUILDFLAG(IS_LINUX) 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 new file mode 100644 index 000000000000..380fe64d6f07 --- /dev/null +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h @@ -0,0 +1,11 @@ +--- base/allocator/partition_allocator/partition_alloc_constants.h.orig 2022-05-19 14:06:27 UTC ++++ base/allocator/partition_allocator/partition_alloc_constants.h +@@ -80,7 +80,7 @@ PartitionPageShift() { + return 18; // 256 KiB + } + #elif (BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)) || \ +- (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)) ++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)) + PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t + PartitionPageShift() { + return PageAllocationGranularityShift() + 2; diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h index c7c476112b95..294bfc737221 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h @@ -1,22 +1,29 @@ ---- base/allocator/partition_allocator/partition_page.h.orig 2022-03-25 21:59:56 UTC +--- base/allocator/partition_allocator/partition_page.h.orig 2022-05-19 14:06:27 UTC +++ base/allocator/partition_allocator/partition_page.h -@@ -128,7 +128,8 @@ struct __attribute__((packed)) SlotSpanMetadata { +@@ -129,13 +129,14 @@ struct __attribute__((packed)) SlotSpanMetadata { PartitionBucket* const bucket = nullptr; // CHECK()ed in AllocNewSlotSpan(). -#if defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE) +#if (defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)) || \ + (BUILDFLAG(IS_FREEBSD) && defined(__i386__)) // System page size is not a constant on Apple OSes, but is either 4 or 16kiB // (1 << 12 or 1 << 14), as checked in PartitionRoot::Init(). And // PartitionPageSize() is 4 times the OS page size. -@@ -142,7 +143,9 @@ struct __attribute__((packed)) SlotSpanMetadata { + static constexpr size_t kMaxSlotsPerSlotSpan = + 4 * (1 << 14) / kSmallestBucket; +-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64) ++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64) + // System page size can be 4, 16, or 64 kiB on Linux on arm64. 64 kiB is + // currently (kMaxSlotsPerSlotSpanBits == 13) not supported by the code, + // so we use the 16 kiB maximum (64 kiB will crash). +@@ -149,7 +150,9 @@ struct __attribute__((packed)) SlotSpanMetadata { #endif // defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE) // The maximum number of bits needed to cover all currently supported OSes. static constexpr size_t kMaxSlotsPerSlotSpanBits = 13; +#if !BUILDFLAG(IS_FREEBSD) && defined(__i386__) static_assert(kMaxSlotsPerSlotSpan < (1 << kMaxSlotsPerSlotSpanBits), ""); +#endif // |marked_full| isn't equivalent to being full. Slot span is marked as full // iff it isn't on the active slot span list (or any other list). 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 new file mode 100644 index 000000000000..6461c1678b28 --- /dev/null +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.cc @@ -0,0 +1,38 @@ +--- base/allocator/partition_allocator/partition_root.cc.orig 2022-05-19 14:06:27 UTC ++++ base/allocator/partition_allocator/partition_root.cc +@@ -29,7 +29,7 @@ + #include "wow64apiset.h" + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include + #endif + +@@ -226,7 +226,7 @@ void PartitionAllocMallocInitOnce() { + if (!g_global_init_called.compare_exchange_strong(expected, true)) + return; + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // When fork() is called, only the current thread continues to execute in the + // child process. If the lock is held, but *not* by this thread when fork() is + // called, we have a deadlock. +@@ -305,7 +305,7 @@ static size_t PartitionPurgeSlotSpan( + constexpr size_t kMaxSlotCount = + (PartitionPageSize() * kMaxPartitionPagesPerRegularSlotSpan) / + SystemPageSize(); +-#elif BUILDFLAG(IS_APPLE) || (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)) ++#elif BUILDFLAG(IS_APPLE) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)) + // It's better for slot_usage to be stack-allocated and fixed-size, which + // demands that its size be constexpr. On IS_APPLE and Linux on arm64, + // PartitionPageSize() is always SystemPageSize() << 2, so regardless of +@@ -648,7 +648,7 @@ void PartitionRoot::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_starscan_stack_stack.cc b/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc index 54cc31592590..33a9abe63075 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc @@ -1,50 +1,50 @@ ---- base/allocator/partition_allocator/starscan/stack/stack.cc.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/starscan/stack/stack.cc.orig 2022-05-19 14:06:27 UTC +++ base/allocator/partition_allocator/starscan/stack/stack.cc @@ -17,6 +17,10 @@ #include #endif +#if defined(OS_BSD) +#include +#endif + #if defined(LIBC_GLIBC) extern "C" void* __libc_stack_end; #endif -@@ -48,6 +52,36 @@ void* GetStackTop() { +@@ -47,6 +51,36 @@ void* GetStackTop() { void* GetStackTop() { return pthread_get_stackaddr_np(pthread_self()); +} + +#elif defined(OS_OPENBSD) + +void* GetStackTop() { + stack_t ss; + if (pthread_stackseg_np(pthread_self(), &ss) != 0) + return nullptr; + return reinterpret_cast(ss.ss_sp); +} + +#elif defined(OS_FREEBSD) + +void* GetStackTop() { + pthread_attr_t attr; + int error = pthread_attr_init(&attr); + if (error) { + return nullptr; + } + error = pthread_attr_get_np(pthread_self(), &attr); + if (!error) { + void* base; + size_t size; + error = pthread_attr_getstack(&attr, &base, &size); + PA_CHECK(!error); + pthread_attr_destroy(&attr); + return reinterpret_cast(base) + size; + } + pthread_attr_destroy(&attr); + return nullptr; } #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) diff --git a/www/chromium/files/patch-base_atomicops.h b/www/chromium/files/patch-base_atomicops.h index 2001ce228478..2f8478b40e8d 100644 --- a/www/chromium/files/patch-base_atomicops.h +++ b/www/chromium/files/patch-base_atomicops.h @@ -1,14 +1,14 @@ ---- base/atomicops.h.orig 2022-02-07 13:39:41 UTC +--- base/atomicops.h.orig 2022-05-19 14:06:27 UTC +++ base/atomicops.h -@@ -57,7 +57,11 @@ typedef intptr_t Atomic64; +@@ -56,7 +56,11 @@ typedef intptr_t Atomic64; // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or // Atomic64 routines below, depending on your architecture. +#if !defined(OS_OPENBSD) && defined(__i386__) +typedef Atomic32 AtomicWord; +#else typedef intptr_t AtomicWord; +#endif // Atomically execute: // result = *ptr; diff --git a/www/chromium/files/patch-base_files_file__path__watcher__unittest.cc b/www/chromium/files/patch-base_files_file__path__watcher__unittest.cc index e0978f8b9384..3bd1d03cc820 100644 --- a/www/chromium/files/patch-base_files_file__path__watcher__unittest.cc +++ b/www/chromium/files/patch-base_files_file__path__watcher__unittest.cc @@ -1,29 +1,29 @@ ---- base/files/file_path_watcher_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- base/files/file_path_watcher_unittest.cc.orig 2022-05-19 14:06:27 UTC +++ base/files/file_path_watcher_unittest.cc -@@ -450,7 +450,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) { +@@ -498,7 +498,7 @@ TEST_F(FilePathWatcherTest, MAYBE_WatchDirectory) { VLOG(1) << "Waiting for file1 creation"; ASSERT_TRUE(WaitForEvents()); -#if !BUILDFLAG(IS_APPLE) +#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) // Mac implementation does not detect files modified in a directory. ASSERT_TRUE(WriteFile(file1, "content v2")); VLOG(1) << "Waiting for file1 modification"; -@@ -1038,7 +1038,7 @@ enum Permission { +@@ -1108,7 +1108,7 @@ enum Permission { Execute }; -#if BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) bool ChangeFilePermissions(const FilePath& path, Permission perm, bool allow) { struct stat stat_buf; -@@ -1069,7 +1069,7 @@ bool ChangeFilePermissions(const FilePath& path, Permi +@@ -1139,7 +1139,7 @@ bool ChangeFilePermissions(const FilePath& path, Permi } #endif // BUILDFLAG(IS_APPLE) -#if BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) // Linux implementation of FilePathWatcher doesn't catch attribute changes. // http://crbug.com/78043 // Windows implementation of FilePathWatcher catches attribute changes that diff --git a/www/chromium/files/patch-base_files_file__util__posix.cc b/www/chromium/files/patch-base_files_file__util__posix.cc index acafe295b237..058f7033f6a9 100644 --- a/www/chromium/files/patch-base_files_file__util__posix.cc +++ b/www/chromium/files/patch-base_files_file__util__posix.cc @@ -1,52 +1,52 @@ ---- base/files/file_util_posix.cc.orig 2022-04-21 18:48:31 UTC +--- base/files/file_util_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/files/file_util_posix.cc -@@ -695,32 +695,34 @@ bool CreateDirectoryAndGetError(const FilePath& full_p +@@ -697,32 +697,34 @@ bool CreateDirectoryAndGetError(const FilePath& full_p File::Error* error) { ScopedBlockingCall scoped_blocking_call( FROM_HERE, BlockingType::MAY_BLOCK); // For call to mkdir(). + const FilePath kFileSystemRoot("/"); std::vector subpaths; // Collect a list of all parent directories. FilePath last_path = full_path; - subpaths.push_back(full_path); + if (full_path != kFileSystemRoot) + subpaths.push_back(full_path); for (FilePath path = full_path.DirName(); - path.value() != last_path.value(); path = path.DirName()) { + (path.value() != last_path.value() && + (path != kFileSystemRoot)); path = path.DirName()) { subpaths.push_back(path); last_path = path; } // Iterate through the parents and create the missing ones. for (const FilePath& subpath : base::Reversed(subpaths)) { - if (DirectoryExists(subpath)) - continue; - if (mkdir(subpath.value().c_str(), 0700) == 0) - continue; - // Mkdir failed, but it might have failed with EEXIST, or some other error - // due to the directory appearing out of thin air. This can occur if - // two processes are trying to create the same file system tree at the same - // time. Check to see if it exists and make sure it is a directory. - int saved_errno = errno; - if (!DirectoryExists(subpath)) { - if (error) - *error = File::OSErrorToFileError(saved_errno); - return false; + if (!PathExists(subpath)) { + if ((mkdir(subpath.value().c_str(), 0700) == -1) && + ((full_path != subpath) ? (errno != ENOENT) : (-1))) { + int saved_errno = errno; + if (error) + *error = File::OSErrorToFileError(saved_errno); + return false; + } + } else if (!DirectoryExists(subpath)) { + if (error) + *error = File::OSErrorToFileError(ENOTDIR); + return false; } } return true; diff --git a/www/chromium/files/patch-base_i18n_icu__util.cc b/www/chromium/files/patch-base_i18n_icu__util.cc index efee9094958e..9f649aad1cf1 100644 --- a/www/chromium/files/patch-base_i18n_icu__util.cc +++ b/www/chromium/files/patch-base_i18n_icu__util.cc @@ -1,20 +1,20 @@ ---- base/i18n/icu_util.cc.orig 2022-04-21 18:48:31 UTC +--- base/i18n/icu_util.cc.orig 2022-05-19 14:06:27 UTC +++ base/i18n/icu_util.cc @@ -52,7 +52,7 @@ #endif #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ - ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ + ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ !BUILDFLAG(IS_CHROMECAST)) #include "third_party/icu/source/i18n/unicode/timezone.h" #endif -@@ -345,7 +345,7 @@ void InitializeIcuTimeZone() { +@@ -324,7 +324,7 @@ void InitializeIcuTimeZone() { FuchsiaIntlProfileWatcher::GetPrimaryTimeZoneIdForIcuInitialization(); icu::TimeZone::adoptDefault( icu::TimeZone::createTimeZone(icu::UnicodeString::fromUTF8(zone_id))); -#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ !BUILDFLAG(IS_CHROMECAST) // To respond to the time zone change properly, the default time zone // cache in ICU has to be populated on starting up. diff --git a/www/chromium/files/patch-base_linux__util.cc b/www/chromium/files/patch-base_linux__util.cc index 853eb881f872..1f949df12ab0 100644 --- a/www/chromium/files/patch-base_linux__util.cc +++ b/www/chromium/files/patch-base_linux__util.cc @@ -1,28 +1,28 @@ ---- base/linux_util.cc.orig 2022-02-07 13:39:41 UTC +--- base/linux_util.cc.orig 2022-05-19 14:06:27 UTC +++ base/linux_util.cc @@ -15,6 +15,7 @@ #include #include +#include + #include "base/base_export.h" #include "base/files/dir_reader_posix.h" - #include "base/files/file_util.h" -@@ -134,6 +135,9 @@ void SetLinuxDistro(const std::string& distro) { +@@ -135,6 +136,9 @@ void SetLinuxDistro(const std::string& distro) { } bool GetThreadsForProcess(pid_t pid, std::vector* tids) { +#if defined(OS_BSD) + return false; +#else // 25 > strlen("/proc//task") + strlen(std::to_string(INT_MAX)) + 1 = 22 char buf[25]; strings::SafeSPrintf(buf, "/proc/%d/task", pid); -@@ -153,6 +157,7 @@ bool GetThreadsForProcess(pid_t pid, std::vector +@@ -50,7 +50,7 @@ const base::FeatureParam namespace { -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) DiscardableMemoryBacking GetBackingForFieldTrial() { DiscardableMemoryTrialGroup trial_group = -@@ -68,7 +68,7 @@ DiscardableMemoryBacking GetBackingForFieldTrial() { +@@ -69,7 +69,7 @@ DiscardableMemoryBacking GetBackingForFieldTrial() { } // namespace -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Probe capabilities of this device to determine whether we should participate // in the discardable memory backing trial. -@@ -98,7 +98,7 @@ DiscardableMemory::DiscardableMemory() = default; +@@ -99,7 +99,7 @@ DiscardableMemory::DiscardableMemory() = default; DiscardableMemory::~DiscardableMemory() = default; DiscardableMemoryBacking GetDiscardableMemoryBacking() { -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (DiscardableMemoryBackingFieldTrialIsEnabled()) { return GetBackingForFieldTrial(); } diff --git a/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc b/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc index 1f2283b19981..ead3fe5472be 100644 --- a/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc +++ b/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc @@ -1,21 +1,21 @@ ---- base/memory/madv_free_discardable_memory_posix.cc.orig 2022-02-28 16:54:41 UTC +--- base/memory/madv_free_discardable_memory_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/memory/madv_free_discardable_memory_posix.cc -@@ -294,6 +294,10 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT +@@ -295,6 +295,10 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT bool MadvFreeDiscardableMemoryPosix::IsResident() const { DFAKE_SCOPED_RECURSIVE_LOCK(thread_collision_warner_); +// XXX mincore +#if BUILDFLAG(IS_BSD) + return false; +#else #if BUILDFLAG(IS_APPLE) std::vector vec(allocated_pages_); #else -@@ -309,6 +313,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons +@@ -310,6 +314,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons return false; } return true; +#endif } bool MadvFreeDiscardableMemoryPosix::IsDiscarded() const { diff --git a/www/chromium/files/patch-base_memory_platform__shared__memory__region.h b/www/chromium/files/patch-base_memory_platform__shared__memory__region.h index 002915dba49c..8bc7dfe4b8ec 100644 --- a/www/chromium/files/patch-base_memory_platform__shared__memory__region.h +++ b/www/chromium/files/patch-base_memory_platform__shared__memory__region.h @@ -1,29 +1,29 @@ ---- base/memory/platform_shared_memory_region.h.orig 2022-02-28 16:54:41 UTC +--- base/memory/platform_shared_memory_region.h.orig 2022-05-19 14:06:27 UTC +++ base/memory/platform_shared_memory_region.h -@@ -23,7 +23,7 @@ - #include "base/files/scoped_file.h" - #endif +@@ -14,7 +14,7 @@ + + #include -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) namespace content { class SandboxIPCHandler; } -@@ -116,7 +116,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { +@@ -81,7 +81,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { kMaxValue = GET_SHMEM_TEMP_DIR_FAILURE }; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Structure to limit access to executable region creation. struct ExecutableRegion { private: -@@ -263,7 +263,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { +@@ -211,7 +211,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { CheckPlatformHandlePermissionsCorrespondToMode); static PlatformSharedMemoryRegion Create(Mode mode, size_t size -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) , bool executable = false #endif diff --git a/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc b/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc index dc7c81b3ea39..558d0e7c7b15 100644 --- a/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc +++ b/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc @@ -1,29 +1,29 @@ ---- base/memory/platform_shared_memory_region_posix.cc.orig 2022-02-28 16:54:41 UTC +--- base/memory/platform_shared_memory_region_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/memory/platform_shared_memory_region_posix.cc -@@ -70,7 +70,7 @@ FDPair ScopedFDPair::get() const { - return {fd.get(), readonly_fd.get()}; - } +@@ -55,7 +55,7 @@ bool CheckFDAccessMode(int fd, int expected_mode) { + + } // namespace -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // static ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) { PlatformSharedMemoryRegion region = -@@ -204,7 +204,7 @@ bool PlatformSharedMemoryRegion::MapAtInternal(off_t o +@@ -171,7 +171,7 @@ bool PlatformSharedMemoryRegion::ConvertToUnsafe() { // static PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode, size_t size -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) , bool executable #endif -@@ -233,7 +233,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion: +@@ -200,7 +200,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion: // flag. FilePath directory; if (!GetShmemTempDir( -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) executable, #else false /* executable */, diff --git a/www/chromium/files/patch-base_native__library__posix.cc b/www/chromium/files/patch-base_native__library__posix.cc index 1aca9e8e282e..c2b8d0e5e970 100644 --- a/www/chromium/files/patch-base_native__library__posix.cc +++ b/www/chromium/files/patch-base_native__library__posix.cc @@ -1,11 +1,11 @@ ---- base/native_library_posix.cc.orig 2022-02-28 16:54:41 UTC +--- base/native_library_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/native_library_posix.cc -@@ -32,7 +32,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP +@@ -33,7 +33,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP // http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892, // and http://crbug.com/40794. int flags = RTLD_LAZY; -#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND) +#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND) || BUILDFLAG(IS_BSD) // Certain platforms don't define RTLD_DEEPBIND. Android dlopen() requires // further investigation, as it might vary across versions. Crash here to // warn developers that they're trying to rely on uncertain behavior. diff --git a/www/chromium/files/patch-base_process_kill.h b/www/chromium/files/patch-base_process_kill.h index df8eb9fb5f9c..1463ba9ed811 100644 --- a/www/chromium/files/patch-base_process_kill.h +++ b/www/chromium/files/patch-base_process_kill.h @@ -1,11 +1,11 @@ ---- base/process/kill.h.orig 2022-02-28 16:54:41 UTC +--- base/process/kill.h.orig 2022-05-19 14:06:27 UTC +++ base/process/kill.h -@@ -112,7 +112,7 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro +@@ -113,7 +113,7 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus( ProcessHandle handle, int* exit_code); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Spawns a thread to wait asynchronously for the child |process| to exit // and then reaps it. BASE_EXPORT void EnsureProcessGetsReaped(Process process); diff --git a/www/chromium/files/patch-base_process_kill__posix.cc b/www/chromium/files/patch-base_process_kill__posix.cc index f2229616fa15..e9446679c97c 100644 --- a/www/chromium/files/patch-base_process_kill__posix.cc +++ b/www/chromium/files/patch-base_process_kill__posix.cc @@ -1,11 +1,11 @@ ---- base/process/kill_posix.cc.orig 2022-02-28 16:54:41 UTC +--- base/process/kill_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/process/kill_posix.cc -@@ -159,7 +159,7 @@ void EnsureProcessTerminated(Process process) { +@@ -158,7 +158,7 @@ void EnsureProcessTerminated(Process process) { 0, new BackgroundReaper(std::move(process), Seconds(2))); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void EnsureProcessGetsReaped(Process process) { DCHECK(!process.is_current()); diff --git a/www/chromium/files/patch-base_process_launch.h b/www/chromium/files/patch-base_process_launch.h index 61716eeeb3f4..5ad4c6605f88 100644 --- a/www/chromium/files/patch-base_process_launch.h +++ b/www/chromium/files/patch-base_process_launch.h @@ -1,11 +1,11 @@ ---- base/process/launch.h.orig 2022-02-28 16:54:41 UTC +--- base/process/launch.h.orig 2022-05-19 14:06:27 UTC +++ base/process/launch.h -@@ -195,7 +195,7 @@ struct BASE_EXPORT LaunchOptions { +@@ -199,7 +199,7 @@ struct BASE_EXPORT LaunchOptions { bool clear_environment = false; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // If non-zero, start the process using clone(), using flags as provided. // Unlike in clone, clone_flags may not contain a custom termination signal // that is sent to the parent when the child dies. The termination signal will diff --git a/www/chromium/files/patch-base_process_process__metrics.cc b/www/chromium/files/patch-base_process_process__metrics.cc index 00d7bf404371..504425708f12 100644 --- a/www/chromium/files/patch-base_process_process__metrics.cc +++ b/www/chromium/files/patch-base_process_process__metrics.cc @@ -1,47 +1,47 @@ ---- base/process/process_metrics.cc.orig 2022-03-25 21:59:56 UTC +--- base/process/process_metrics.cc.orig 2022-05-19 14:06:27 UTC +++ base/process/process_metrics.cc @@ -18,7 +18,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) { @@ -55,7 +55,7 @@ SystemMetrics SystemMetrics::Sample() { SystemMetrics system_metrics; system_metrics.committed_memory_ = GetSystemCommitCharge(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) GetSystemMemoryInfo(&system_metrics.memory_info_); GetVmStatInfo(&system_metrics.vmstat_info_); GetSystemDiskInfo(&system_metrics.disk_info_); @@ -74,7 +74,7 @@ Value SystemMetrics::ToValue() const { Value res(Value::Type::DICTIONARY); res.SetIntKey("committed_memory", static_cast(committed_memory_)); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) Value meminfo = memory_info_.ToValue(); Value vmstat = vmstat_info_.ToValue(); meminfo.MergeDictionary(&vmstat); @@ -100,7 +100,7 @@ std::unique_ptr ProcessMetrics::Create #endif // !BUILDFLAG(IS_MAC) } -#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX) +#if !BUILDFLAG(IS_BSD) || !BUILDFLAG(IS_POSIX) double ProcessMetrics::GetPlatformIndependentCPUUsage() { TimeDelta cumulative_cpu = GetCumulativeCPUUsage(); TimeTicks time = TimeTicks::Now(); -@@ -126,7 +126,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage( - #endif +@@ -151,7 +151,7 @@ double ProcessMetrics::GetPreciseCPUUsage() { + #endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int ProcessMetrics::CalculateIdleWakeupsPerSecond( uint64_t absolute_idle_wakeups) { return CalculateEventsPerSecond(absolute_idle_wakeups, diff --git a/www/chromium/files/patch-base_process_process__metrics.h b/www/chromium/files/patch-base_process_process__metrics.h index 940559196a29..c6d856e7598b 100644 --- a/www/chromium/files/patch-base_process_process__metrics.h +++ b/www/chromium/files/patch-base_process_process__metrics.h @@ -1,119 +1,119 @@ ---- base/process/process_metrics.h.orig 2022-02-28 16:54:41 UTC +--- base/process/process_metrics.h.orig 2022-05-19 14:06:27 UTC +++ base/process/process_metrics.h @@ -36,7 +36,7 @@ #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) #include #include #include @@ -52,7 +52,7 @@ class Value; // Full declaration is in process_metrics_iocounters.h. struct IoCounters; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Minor and major page fault counts since the process creation. // Both counts are process-wide, and exclude child processes. // @@ -107,7 +107,7 @@ class BASE_EXPORT ProcessMetrics { // convenience wrapper for CreateProcessMetrics(). static std::unique_ptr 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; -@@ -134,7 +134,7 @@ class BASE_EXPORT ProcessMetrics { - [[nodiscard]] TimeDelta GetCumulativeCPUUsage(); +@@ -155,7 +155,7 @@ class BASE_EXPORT ProcessMetrics { + #endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Emits the cumulative CPU usage for all currently active threads since they // were started into the output parameter (replacing its current contents). // Threads that have already terminated will not be reported. Thus, the sum of -@@ -217,7 +217,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -238,7 +238,7 @@ class BASE_EXPORT ProcessMetrics { int GetOpenFdSoftLimit() const; #endif // BUILDFLAG(IS_POSIX) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Bytes of swap as reported by /proc/[pid]/status. uint64_t GetVmSwapBytes() const; -@@ -238,7 +238,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -259,7 +259,7 @@ class BASE_EXPORT ProcessMetrics { #endif // !BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups); #endif #if BUILDFLAG(IS_APPLE) -@@ -249,7 +249,7 @@ class BASE_EXPORT ProcessMetrics { +@@ -270,7 +270,7 @@ class BASE_EXPORT ProcessMetrics { #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) CPU::CoreType GetCoreType(int core_index); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) -@@ -274,7 +274,7 @@ class BASE_EXPORT ProcessMetrics { - uint64_t last_cumulative_disk_usage_ = 0; +@@ -294,7 +294,7 @@ class BASE_EXPORT ProcessMetrics { + #endif #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Same thing for idle wakeups. TimeTicks last_idle_wakeups_time_; uint64_t last_absolute_idle_wakeups_; -@@ -317,7 +317,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de +@@ -337,7 +337,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Data about system-wide memory consumption. Values are in KB. Available on // Windows, Mac, Linux, Android and Chrome OS. // -@@ -352,7 +352,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { +@@ -372,7 +372,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // This provides an estimate of available memory as described here: // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always -@@ -367,7 +367,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { +@@ -387,7 +387,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { #endif #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) int buffers = 0; int cached = 0; int active_anon = 0; -@@ -404,7 +404,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK +@@ -424,7 +424,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK // BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Parse the data found in /proc//stat and return the sum of the // CPU-related ticks. Returns -1 on parse error. // Exposed for testing. -@@ -591,7 +591,7 @@ class BASE_EXPORT SystemMetrics { +@@ -611,7 +611,7 @@ class BASE_EXPORT SystemMetrics { FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics); size_t committed_memory_; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) SystemMemoryInfoKB memory_info_; VmStatInfo vmstat_info_; SystemDiskInfo disk_info_; diff --git a/www/chromium/files/patch-base_process_process__posix.cc b/www/chromium/files/patch-base_process_process__posix.cc index 46fe9bf83464..5154b3028c57 100644 --- a/www/chromium/files/patch-base_process_process__posix.cc +++ b/www/chromium/files/patch-base_process_process__posix.cc @@ -1,93 +1,93 @@ ---- base/process/process_posix.cc.orig 2022-04-21 18:48:31 UTC +--- base/process/process_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/process/process_posix.cc -@@ -23,10 +23,15 @@ +@@ -25,10 +25,15 @@ #include "build/build_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" -#if BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include #endif +#if defined(OS_BSD) +#include +#include +#endif + #if BUILDFLAG(CLANG_PROFILING) #include "base/test/clang_profiling.h" #endif -@@ -95,7 +100,7 @@ bool WaitpidWithTimeout(base::ProcessHandle handle, +@@ -97,7 +102,7 @@ bool WaitpidWithTimeout(base::ProcessHandle handle, return ret_pid > 0; } -#if BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) // Using kqueue on Mac so that we can wait on non-child processes. // We can't use kqueues on child processes because we need to reap // our own children using wait. -@@ -200,7 +205,7 @@ bool WaitForExitWithTimeoutImpl(base::ProcessHandle ha +@@ -202,7 +207,7 @@ bool WaitForExitWithTimeoutImpl(base::ProcessHandle ha const bool exited = (parent_pid < 0); if (!exited && parent_pid != our_pid) { -#if BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) // On Mac we can wait on non child processes. return WaitForSingleNonChildProcess(handle, timeout); #else -@@ -356,7 +361,55 @@ void Process::Exited(int exit_code) const {} +@@ -358,7 +363,55 @@ void Process::Exited(int exit_code) const {} int Process::GetPriority() const { DCHECK(IsValid()); +// avoid pledge(2) violation +#if defined(OS_BSD) + return 0; +#else return getpriority(PRIO_PROCESS, process_); +#endif +} + +Time Process::CreationTime() const { +// avoid ps pledge in the network process +#if !defined(OS_BSD) + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), + sizeof(struct kinfo_proc), 0 }; + struct kinfo_proc *info = nullptr; + size_t info_size; +#endif + Time ct = Time(); + +#if !defined(OS_BSD) + if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0) + goto out; + + mib[5] = (info_size / sizeof(struct kinfo_proc)); + if ((info = reinterpret_cast(malloc(info_size))) == NULL) + goto out; + + if (sysctl(mib, std::size(mib), info, &info_size, NULL, 0) < 0) + goto out; + + ct = Time::FromTimeT(info->p_ustart_sec); + +out: + if (info) + free(info); +#endif + return ct; +} + +bool Process::IsProcessBackgrounded() const { + return false; +} + +bool Process::SetProcessBackgrounded(bool value) { + return false; +} + +// static +bool Process::CanBackgroundProcesses() { + return false; } } // namespace base diff --git a/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc b/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc index 3fd7776ba195..9b71690b5fad 100644 --- a/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc +++ b/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc @@ -1,11 +1,11 @@ ---- base/profiler/stack_sampling_profiler_test_util.cc.orig 2022-02-28 16:54:41 UTC +--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2022-05-19 14:06:27 UTC +++ base/profiler/stack_sampling_profiler_test_util.cc -@@ -32,7 +32,7 @@ +@@ -39,7 +39,7 @@ // Fortunately, it provides _alloca, which functions identically. #include #define alloca _alloca -#else +#elif !BUILDFLAG(IS_BSD) #include #endif diff --git a/www/chromium/files/patch-base_synchronization_lock__impl.h b/www/chromium/files/patch-base_synchronization_lock__impl.h index f9f875ee3934..4c06c2a54589 100644 --- a/www/chromium/files/patch-base_synchronization_lock__impl.h +++ b/www/chromium/files/patch-base_synchronization_lock__impl.h @@ -1,23 +1,23 @@ ---- base/synchronization/lock_impl.h.orig 2022-02-28 16:54:41 UTC +--- base/synchronization/lock_impl.h.orig 2022-05-19 14:06:27 UTC +++ base/synchronization/lock_impl.h -@@ -107,6 +107,10 @@ void LockImpl::Unlock() { +@@ -106,6 +106,10 @@ void LockImpl::Unlock() { } #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_FREEBSD) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wthread-safety-analysis" +#endif - BASE_EXPORT std::string SystemErrorCodeToString(int error_code); - -@@ -121,6 +125,9 @@ void LockImpl::Unlock() { - int rv = pthread_mutex_unlock(&native_handle_); - DCHECK_EQ(rv, 0) << ". " << strerror(rv); + #if DCHECK_IS_ON() + BASE_EXPORT void dcheck_trylock_result(int rv); +@@ -126,6 +130,9 @@ void LockImpl::Unlock() { + dcheck_unlock_result(rv); + #endif } +#if BUILDFLAG(IS_FREEBSD) +#pragma GCC diagnostic pop +#endif #endif // This is an implementation used for AutoLock templated on the lock type. diff --git a/www/chromium/files/patch-base_system_sys__info.cc b/www/chromium/files/patch-base_system_sys__info.cc index f991071fe48a..9c2c95db0407 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 2022-02-28 16:54:41 UTC +--- base/system/sys_info.cc.orig 2022-05-19 14:06:27 UTC +++ base/system/sys_info.cc -@@ -100,7 +100,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallback +#if !BUILDFLAG(IS_BSD) #include +#endif #include #include #include -@@ -132,7 +134,7 @@ int sched_setattr(pid_t pid, +@@ -133,7 +135,7 @@ int sched_setattr(pid_t pid, #endif // !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) const FilePath::CharType kCgroupDirectory[] = FILE_PATH_LITERAL("/sys/fs/cgroup"); -@@ -286,7 +288,7 @@ void SetThreadCgroupsForThreadPriority(PlatformThreadI +@@ -287,7 +289,7 @@ void SetThreadCgroupsForThreadPriority(PlatformThreadI namespace internal { namespace { -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) const struct sched_param kRealTimePrio = {8}; #endif } // namespace -@@ -299,7 +301,7 @@ const ThreadPriorityToNiceValuePair kThreadPriorityToN +@@ -300,7 +302,7 @@ const ThreadPriorityToNiceValuePair kThreadPriorityToN }; bool CanSetThreadPriorityToRealtimeAudio() { -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) // A non-zero soft-limit on RLIMIT_RTPRIO is required to be allowed to invoke // pthread_setschedparam in SetCurrentThreadPriorityForPlatform(). struct rlimit rlim; -@@ -310,7 +312,7 @@ bool CanSetThreadPriorityToRealtimeAudio() { +@@ -311,7 +313,7 @@ bool CanSetThreadPriorityToRealtimeAudio() { } bool SetCurrentThreadPriorityForPlatform(ThreadPriority priority) { -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) // For legacy schedtune interface SetThreadCgroupsForThreadPriority(PlatformThread::CurrentId(), priority); -@@ -328,7 +330,7 @@ bool SetCurrentThreadPriorityForPlatform(ThreadPriorit +@@ -329,7 +331,7 @@ bool SetCurrentThreadPriorityForPlatform(ThreadPriorit } absl::optional GetCurrentThreadPriorityForPlatform() { -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) int maybe_sched_rr = 0; struct sched_param maybe_realtime_prio = {0}; if (pthread_getschedparam(pthread_self(), &maybe_sched_rr, -@@ -347,7 +349,7 @@ absl::optional GetCurrentThreadPriorit +@@ -348,7 +350,7 @@ absl::optional GetCurrentThreadPriorit void PlatformThread::SetName(const std::string& name) { ThreadIdNameManager::GetInstance()->SetName(name); -#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) && !BUILDFLAG(IS_BSD) // On linux we can get the thread names to show up in the debugger by setting // the process name for the LWP. We don't want to do this for the main // thread because that would rename the process, causing tools like killall -@@ -377,8 +379,10 @@ void PlatformThread::SetThreadPriority(ProcessId proce +@@ -378,8 +380,10 @@ void PlatformThread::SetThreadPriority(ProcessId proce // priority. CHECK_NE(thread_id, process_id); +#if !BUILDFLAG(IS_BSD) // For legacy schedtune interface SetThreadCgroupsForThreadPriority(thread_id, priority); +#endif #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) // For upstream uclamp interface. We try both legacy (schedtune, as done 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 3eda63205158..393a2d1be773 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-02-28 16:54:41 UTC +--- base/threading/platform_thread_posix.cc.orig 2022-05-19 14:06:27 UTC +++ base/threading/platform_thread_posix.cc -@@ -75,7 +75,7 @@ void* ThreadFunc(void* params) { +@@ -76,7 +76,7 @@ void* ThreadFunc(void* params) { if (!thread_params->joinable) base::DisallowSingleton(); -#if !BUILDFLAG(IS_NACL) +#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) internal::PCScan::NotifyThreadCreated(internal::GetStackPointer()); #endif -@@ -362,6 +362,9 @@ bool PlatformThread::CanChangeThreadPriority(ThreadPri +@@ -365,6 +365,9 @@ bool PlatformThread::CanChangeThreadPriority(ThreadPri // static void PlatformThread::SetCurrentThreadPriorityImpl(ThreadPriority priority) { #if BUILDFLAG(IS_NACL) + NOTIMPLEMENTED(); +// avoid pledge(2) violation +#elif BUILDFLAG(IS_BSD) NOTIMPLEMENTED(); #else if (internal::SetCurrentThreadPriorityForPlatform(priority)) diff --git a/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc b/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc index 42b6b8e0f162..630217b469e1 100644 --- a/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc +++ b/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc @@ -1,21 +1,31 @@ ---- base/trace_event/malloc_dump_provider.cc.orig 2022-02-28 16:54:41 UTC +--- base/trace_event/malloc_dump_provider.cc.orig 2022-05-19 14:06:27 UTC +++ base/trace_event/malloc_dump_provider.cc @@ -23,6 +23,8 @@ #if BUILDFLAG(IS_APPLE) #include +#elif defined(OS_BSD) +#include #else #include #endif -@@ -220,6 +222,9 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDump +@@ -174,7 +176,8 @@ void ReportAppleAllocStats(size_t* total_virtual_size, + + #if (BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_ANDROID)) || \ + (!BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !BUILDFLAG(IS_WIN) && \ +- !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_FUCHSIA)) ++ !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_FUCHSIA) && \ ++ !BUILDFLAG(IS_BSD)) + void ReportMallinfoStats(ProcessMemoryDump* pmd, + size_t* total_virtual_size, + size_t* resident_size, +@@ -339,6 +342,9 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDump &allocated_objects_count); #elif BUILDFLAG(IS_FUCHSIA) // TODO(fuchsia): Port, see https://crbug.com/706592. +#elif defined(OS_BSD) + total_virtual_size = 0; + allocated_objects_size = 0; #else - #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 33) + ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size, + &allocated_objects_size, &allocated_objects_count); diff --git a/www/chromium/files/patch-build_config_compiler_BUILD.gn b/www/chromium/files/patch-build_config_compiler_BUILD.gn index 8d5e73144bbf..890458560e59 100644 --- a/www/chromium/files/patch-build_config_compiler_BUILD.gn +++ b/www/chromium/files/patch-build_config_compiler_BUILD.gn @@ -1,119 +1,122 @@ ---- build/config/compiler/BUILD.gn.orig 2022-04-21 18:48:31 UTC +--- build/config/compiler/BUILD.gn.orig 2022-05-19 14:06:27 UTC +++ build/config/compiler/BUILD.gn -@@ -236,13 +236,16 @@ config("default_include_dirs") { +@@ -231,13 +231,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 --------------------------------------------------------------------- -@@ -452,6 +455,10 @@ config("compiler") { +@@ -447,6 +450,10 @@ config("compiler") { } } + if (is_openbsd) { + ldflags += [ "-Wl,-z,wxneeded" ] + } + # Linux-specific compiler flags setup. # ------------------------------------ - if ((is_posix || is_fuchsia) && !is_apple && use_lld) { -@@ -534,7 +541,7 @@ config("compiler") { + if (use_gold) { +@@ -522,7 +529,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 ] # TODO(hans): Remove this once Clang generates better optimized debug info -@@ -917,7 +924,7 @@ config("compiler_cpu_abi") { +@@ -904,7 +911,7 @@ config("compiler_cpu_abi") { ] } } else if (current_cpu == "arm") { - if (is_clang && !is_android && !is_nacl) { + if (is_clang && !is_android && !is_nacl && !is_bsd) { cflags += [ "--target=arm-linux-gnueabihf" ] ldflags += [ "--target=arm-linux-gnueabihf" ] } -@@ -931,7 +938,7 @@ config("compiler_cpu_abi") { +@@ -918,7 +925,7 @@ config("compiler_cpu_abi") { cflags += [ "-mtune=$arm_tune" ] } } else if (current_cpu == "arm64") { - if (is_clang && !is_android && !is_nacl && !is_fuchsia) { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] } -@@ -1252,7 +1259,7 @@ config("compiler_deterministic") { +@@ -1239,7 +1246,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", -@@ -1542,12 +1549,12 @@ config("default_warnings") { +@@ -1530,7 +1537,7 @@ config("default_warnings") { "-Wno-ignored-pragma-optimize", ] - if (!is_nacl) { + if (!is_nacl && !is_bsd) { # TODO(https://crbug.com/1300731) Clean up and enable. cflags += [ "-Wno-unqualified-std-cast-call" ] - } -- if (is_chromeos || default_toolchain == "//build/toolchain/cros:target") { -+ if (is_chromeos || default_toolchain == "//build/toolchain/cros:target" || is_bsd) { - # TODO(https://crbug.com/1016945): Re-enable once ChromeOS toolchain is up to date - cflags += [ "-Wno-builtin-assume-aligned-alignment" ] +@@ -1538,7 +1545,7 @@ config("default_warnings") { + cflags += [ "-Wno-deprecated-non-prototype" ] } -@@ -1740,7 +1747,7 @@ config("no_chromium_code") { + +- if (!is_nacl && !(is_chromeos || ++ if (!is_nacl && !is_bsd && !(is_chromeos || + default_toolchain == "//build/toolchain/cros:target")) { + # TODO(https://crbug.com/1316298): Re-enable once test failure is figured out + cflags += [ +@@ -1723,7 +1730,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", -@@ -2254,7 +2261,7 @@ config("afdo_optimize_size") { +@@ -2237,7 +2244,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. -@@ -2270,7 +2277,7 @@ config("afdo") { +@@ -2253,7 +2260,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 ] } -@@ -2413,7 +2420,8 @@ config("symbols") { +@@ -2396,7 +2403,8 @@ config("symbols") { } } - 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_BUILD.gn b/www/chromium/files/patch-build_config_linux_BUILD.gn index f73ef24f032a..2e93980f3e50 100644 --- a/www/chromium/files/patch-build_config_linux_BUILD.gn +++ b/www/chromium/files/patch-build_config_linux_BUILD.gn @@ -1,11 +1,11 @@ ---- build/config/linux/BUILD.gn.orig 2022-02-07 13:39:41 UTC +--- build/config/linux/BUILD.gn.orig 2022-05-19 14:06:27 UTC +++ build/config/linux/BUILD.gn -@@ -42,7 +42,7 @@ config("runtime_library") { +@@ -41,7 +41,7 @@ config("runtime_library") { + } - if ((!(is_chromeos_ash || is_chromeos_lacros) || - default_toolchain != "//build/toolchain/cros:target") && + if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") && - (!use_custom_libcxx || current_cpu == "mipsel")) { + (!use_custom_libcxx || current_cpu == "mipsel") && !is_bsd) { libs = [ "atomic" ] } } diff --git a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni index 55c8ddbde6d4..b60fac0078ef 100644 --- a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni +++ b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni @@ -1,35 +1,35 @@ ---- build/toolchain/gcc_toolchain.gni.orig 2022-04-21 18:48:31 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2022-05-19 14:06:27 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). # -@@ -780,13 +787,12 @@ template("gcc_toolchain") { +@@ -786,13 +793,12 @@ template("gcc_toolchain") { # use_gold too. template("clang_toolchain") { gcc_toolchain(target_name) { - prefix = rebase_path("$clang_base_path/bin", root_build_dir) - cc = "${prefix}/clang" - cxx = "${prefix}/clang++" + cc = "cc" + cxx = "c++" ld = cxx - readelf = "${prefix}/llvm-readelf" - ar = "${prefix}/llvm-ar" - nm = "${prefix}/llvm-nm" + readelf = "readelf" + ar = "ar" + nm = "nm" forward_variables_from(invoker, [ diff --git a/www/chromium/files/patch-chrome_app_app__management__strings.grdp b/www/chromium/files/patch-chrome_app_app__management__strings.grdp new file mode 100644 index 000000000000..b7638925e9e3 --- /dev/null +++ b/www/chromium/files/patch-chrome_app_app__management__strings.grdp @@ -0,0 +1,11 @@ +--- chrome/app/app_management_strings.grdp.orig 2022-05-19 14:06:27 UTC ++++ chrome/app/app_management_strings.grdp +@@ -165,7 +165,7 @@ + + + +- ++ + + You can open and edit supported files with this app from your file browser or other apps. To control which files open this app by default, <a href="#">learn how to set default apps on your device</a>. + 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 84dcfc4d098e..e2579407f457 100644 --- a/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc +++ b/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc @@ -1,107 +1,107 @@ ---- chrome/app/chrome_main_delegate.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/app/chrome_main_delegate.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/app/chrome_main_delegate.cc -@@ -114,7 +114,7 @@ +@@ -116,7 +116,7 @@ #include "chrome/app/chrome_crash_reporter_client.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 -@@ -158,12 +158,12 @@ +@@ -159,12 +159,12 @@ #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_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 -@@ -307,7 +307,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty +@@ -308,7 +308,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 -@@ -347,7 +347,7 @@ bool HandleVersionSwitches(const base::CommandLine& co +@@ -348,7 +348,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) || -@@ -411,7 +411,7 @@ void InitializeUserDataDir(base::CommandLine* command_ +@@ -412,7 +412,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. -@@ -495,7 +495,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat +@@ -496,7 +496,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( -@@ -676,6 +676,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization( +@@ -669,6 +669,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization( // not always enabled on Linux/ChromeOS. #if BUILDFLAG(IS_LINUX) || 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 -@@ -813,7 +815,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -807,7 +809,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi } // 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 -@@ -844,7 +846,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -838,7 +840,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) 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 -@@ -1159,7 +1161,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1153,7 +1155,7 @@ void ChromeMainDelegate::PreSandboxStartup() { 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 BUILDFLAG(IS_ANDROID) -@@ -1229,7 +1231,7 @@ absl::variant Chrome +@@ -1223,7 +1225,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_chromium__strings.grd b/www/chromium/files/patch-chrome_app_chromium__strings.grd index 8fe11684dc60..aa755102c0fe 100644 --- a/www/chromium/files/patch-chrome_app_chromium__strings.grd +++ b/www/chromium/files/patch-chrome_app_chromium__strings.grd @@ -1,29 +1,20 @@ ---- chrome/app/chromium_strings.grd.orig 2022-04-21 18:48:31 UTC +--- chrome/app/chromium_strings.grd.orig 2022-05-19 14:06:27 UTC +++ chrome/app/chromium_strings.grd -@@ -294,7 +294,7 @@ If you update this file, be sure also to update google +@@ -296,7 +296,7 @@ If you update this file, be sure also to update google Welcome to Chromium; new browser window opened - + Welcome to Chromium -@@ -815,7 +815,7 @@ Permissions you've already given to websites and apps - - - -- -+ - - Your system administrator has configured Chromium to open an alternative browser to access $1example.com. - -@@ -941,7 +941,7 @@ Permissions you've already given to websites and apps +@@ -981,7 +981,7 @@ Permissions you've already given to websites and apps - + The profile appears to be in use by another Chromium process ($112345) on another computer ($2example.com). Chromium has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium. diff --git a/www/chromium/files/patch-chrome_app_generated__resources.grd b/www/chromium/files/patch-chrome_app_generated__resources.grd index c15631103b44..b1dbb1741e2e 100644 --- a/www/chromium/files/patch-chrome_app_generated__resources.grd +++ b/www/chromium/files/patch-chrome_app_generated__resources.grd @@ -1,56 +1,38 @@ ---- chrome/app/generated_resources.grd.orig 2022-04-21 18:48:31 UTC +--- chrome/app/generated_resources.grd.orig 2022-05-19 14:06:27 UTC +++ chrome/app/generated_resources.grd @@ -2,7 +2,7 @@ -@@ -293,7 +293,7 @@ are declared in tools/grit/grit_rule.gni. - - - -- -+ - - - -@@ -2836,7 +2836,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -3013,7 +3013,7 @@ are declared in tools/grit/grit_rule.gni. - + Device Credentials -@@ -5728,7 +5728,7 @@ Keep your key file in a safe place. You will need it t - - - -- -+ - - Legacy Browser Support - -@@ -8322,7 +8322,7 @@ Keep your key file in a safe place. You will need it t +@@ -8670,7 +8670,7 @@ Keep your key file in a safe place. You will need it t Google Pay -- -+ +- ++ Use system title bar and borders -@@ -9477,7 +9477,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -9821,7 +9821,7 @@ Please help our engineers fix this problem. Tell us wh Set as default -- -+ +- ++ Minimize diff --git a/www/chromium/files/patch-chrome_app_google__chrome__strings.grd b/www/chromium/files/patch-chrome_app_google__chrome__strings.grd index a05b2e4cec05..4202f42e44a1 100644 --- a/www/chromium/files/patch-chrome_app_google__chrome__strings.grd +++ b/www/chromium/files/patch-chrome_app_google__chrome__strings.grd @@ -1,29 +1,20 @@ ---- chrome/app/google_chrome_strings.grd.orig 2022-04-21 18:48:31 UTC +--- chrome/app/google_chrome_strings.grd.orig 2022-05-19 14:06:27 UTC +++ chrome/app/google_chrome_strings.grd -@@ -299,7 +299,7 @@ chromium_strings.grd. --> +@@ -301,7 +301,7 @@ chromium_strings.grd. --> Welcome to Chrome; new browser window opened - + Welcome to Google Chrome -@@ -859,7 +859,7 @@ Permissions you've already given to websites and apps - - - -- -+ - - Your system administrator has configured Google Chrome to open an alternative browser to access $1example.com. - -@@ -1008,7 +1008,7 @@ Permissions you've already given to websites and apps +@@ -1048,7 +1048,7 @@ Permissions you've already given to websites and apps - + The profile appears to be in use by another Google Chrome process ($112345) on another computer ($2example.com). Chrome has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chrome. diff --git a/www/chromium/files/patch-chrome_app_settings__strings.grdp b/www/chromium/files/patch-chrome_app_settings__strings.grdp index 017a675fc6cd..3aa6d8d7d939 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 2022-02-28 16:54:41 UTC +--- chrome/app/settings_strings.grdp.orig 2022-05-19 14:06:27 UTC +++ chrome/app/settings_strings.grdp @@ -131,7 +131,7 @@ Theme -- -+ +- ++ GTK+ @@ -145,7 +145,7 @@ Use Classic - + Reset to default 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 c060bac563b8..959a0c285ffa 100644 --- a/www/chromium/files/patch-chrome_app_theme_theme__resources.grd +++ b/www/chromium/files/patch-chrome_app_theme_theme__resources.grd @@ -1,11 +1,34 @@ ---- chrome/app/theme/theme_resources.grd.orig 2021-04-14 18:40:52 UTC +--- chrome/app/theme/theme_resources.grd.orig 2022-05-19 14:06:27 UTC +++ chrome/app/theme/theme_resources.grd -@@ -25,7 +25,7 @@ - -- -+ - +@@ -128,11 +128,11 @@ + - + +- ++ + + + +- ++ + + + +@@ -140,7 +140,7 @@ + + + +- ++ + + + +@@ -148,7 +148,7 @@ + + + +- ++ + + + diff --git a/www/chromium/files/patch-chrome_browser_about__flags.cc b/www/chromium/files/patch-chrome_browser_about__flags.cc index 127ba1a18a9a..b4582e90b40e 100644 --- a/www/chromium/files/patch-chrome_browser_about__flags.cc +++ b/www/chromium/files/patch-chrome_browser_about__flags.cc @@ -1,119 +1,110 @@ ---- chrome/browser/about_flags.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/about_flags.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/about_flags.cc -@@ -205,7 +205,7 @@ +@@ -202,7 +202,7 @@ #include "ui/native_theme/native_theme_features.h" #include "ui/ui_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 -@@ -277,7 +277,7 @@ +@@ -274,7 +274,7 @@ #include "chrome/browser/supervised_user/supervised_user_features/supervised_user_features.h" #endif // ENABLE_SUPERVISED_USERS -#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) -@@ -364,7 +364,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = { +@@ -363,7 +363,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = { gl::kANGLEImplementationMetalName}}; #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const FeatureEntry::Choice kOzonePlatformHintRuntimeChoices[] = { {flag_descriptions::kOzonePlatformHintChoiceDefault, "", ""}, {flag_descriptions::kOzonePlatformHintChoiceAuto, -@@ -1047,7 +1047,7 @@ const FeatureEntry::FeatureVariation kJourneysOnDevice +@@ -1055,7 +1055,7 @@ const FeatureEntry::FeatureVariation kJourneysOnDevice }; #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 kOmniboxDocumentProviderServerScoring[] = { {"DocumentUseServerScore", "true"}, {"DocumentUseClientScore", "false"}, -@@ -3520,7 +3520,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3668,7 +3668,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(chromeos::kLacrosTtsSupport)}, #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { "enable-accelerated-video-decode", flag_descriptions::kAcceleratedVideoDecodeName, -@@ -3938,7 +3938,7 @@ const FeatureEntry kFeatureEntries[] = { - {"enable-login-detection", flag_descriptions::kEnableLoginDetectionName, - flag_descriptions::kEnableLoginDetectionDescription, kOsAll, - FEATURE_VALUE_TYPE(login_detection::kLoginDetection)}, --#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - {"enable-navigation-predictor", - flag_descriptions::kEnableNavigationPredictorName, - flag_descriptions::kEnableNavigationPredictorDescription, -@@ -4138,7 +4138,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4271,7 +4271,7 @@ 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, + flag_descriptions::kOzonePlatformHintDescription, kOsLinux | kOsLacros, MULTI_VALUE_TYPE(kOzonePlatformHintRuntimeChoices)}, -@@ -4157,7 +4157,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4291,7 +4291,7 @@ const FeatureEntry kFeatureEntries[] = { password_manager::features::kForceInitialSyncWhenDecryptionFails)}, #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, -@@ -4886,7 +4886,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4986,7 +4986,7 @@ const FeatureEntry kFeatureEntries[] = { "OmniboxBundledExperimentV1")}, #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, -@@ -5299,7 +5299,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -5375,7 +5375,7 @@ const FeatureEntry kFeatureEntries[] = { #endif // BUILDFLAG(IS_ANDROID) #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) {"webui-feedback", flag_descriptions::kWebuiFeedbackName, flag_descriptions::kWebuiFeedbackDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kWebUIFeedback)}, -@@ -6363,7 +6363,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6396,7 +6396,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kMouseSubframeNoImplicitCapture)}, #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, -@@ -7230,7 +7230,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7260,7 +7260,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)}, -@@ -7536,7 +7536,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7551,7 +7551,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, 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 7d62b3c9c226..bea2cd828782 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-02-28 16:54:41 UTC +--- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -@@ -89,7 +89,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForSch +@@ -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 // 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_browser__process__impl.cc b/www/chromium/files/patch-chrome_browser_browser__process__impl.cc index 0a13c4003a0e..ddb257f073dc 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 2022-04-21 18:48:31 UTC +--- chrome/browser/browser_process_impl.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/browser_process_impl.cc -@@ -206,7 +206,7 @@ +@@ -209,7 +209,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 -@@ -1155,7 +1155,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { +@@ -1158,7 +1158,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 -@@ -1402,7 +1402,7 @@ void BrowserProcessImpl::Unpin() { +@@ -1415,7 +1415,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_browser__resources.grd b/www/chromium/files/patch-chrome_browser_browser__resources.grd new file mode 100644 index 000000000000..b340908a4530 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_browser__resources.grd @@ -0,0 +1,11 @@ +--- chrome/browser/browser_resources.grd.orig 2022-05-19 14:06:27 UTC ++++ chrome/browser/browser_resources.grd +@@ -119,7 +119,7 @@ + + + +- ++ + + + 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 ff340b9e9b9e..4e550f8411c9 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,98 +1,71 @@ ---- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/chrome_browser_interface_binders.cc -@@ -98,13 +98,13 @@ +@@ -100,13 +100,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 -@@ -174,7 +174,7 @@ +@@ -177,7 +177,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" -@@ -272,7 +272,7 @@ - #include "chrome/browser/apps/digital_goods/digital_goods_factory_stub.h" - #endif // BUILDFLAG(IS_CHROMEOS_LACROS) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - #include "components/services/screen_ai/public/cpp/screen_ai_service_router.h" - #include "components/services/screen_ai/public/cpp/screen_ai_service_router_factory.h" - #endif -@@ -585,7 +585,7 @@ void BindSpeechRecognitionRecognizerClientHandler( - } - #endif - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - void BindScreenAIAnnotator( - content::RenderFrameHost* frame_host, - mojo::PendingReceiver receiver) { -@@ -717,7 +717,7 @@ void PopulateChromeFrameBinders( +@@ -726,7 +726,7 @@ void PopulateChromeFrameBinders( #endif #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)); -@@ -725,7 +725,7 @@ void PopulateChromeFrameBinders( +@@ -734,7 +734,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->IsInPrimaryMainFrame()) { map->Add( -@@ -733,7 +733,7 @@ void PopulateChromeFrameBinders( - } - #endif - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - if (base::FeatureList::IsEnabled(features::kScreenAI)) { - map->Add( - base::BindRepeating(&BindScreenAIAnnotator)); -@@ -779,14 +779,14 @@ void PopulateChromeWebUIFrameBinders( +@@ -781,14 +781,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 -@@ -1114,7 +1114,7 @@ void PopulateChromeWebUIFrameBinders( +@@ -1111,7 +1111,7 @@ void PopulateChromeWebUIFrameBinders( #endif #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 c2f10d92ec7d..71cba7c6a9bf 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__main.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__main.cc @@ -1,52 +1,52 @@ ---- chrome/browser/chrome_browser_main.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/chrome_browser_main.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/chrome_browser_main.cc @@ -230,11 +230,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/breakpad_linux.h" #include "components/crash/core/app/crashpad.h" #endif @@ -269,7 +269,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) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) #include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h" #include "chrome/browser/metrics/desktop_session_duration/touch_mode_stats_tracker.h" -@@ -1006,7 +1006,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { - AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs); +@@ -1009,7 +1009,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 . -@@ -1019,7 +1019,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1022,7 +1022,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // Set the product channel for crash reports. if (!crash_reporter::IsCrashpadEnabled()) { breakpad::SetChannelCrashKey( -@@ -1040,7 +1040,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1043,7 +1043,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) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) metrics::DesktopSessionDurationTracker::Initialize(); ProfileActivityMetricsRecorder::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 6d6fff8f940a..668295937676 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,150 +1,150 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/chrome_content_browser_client.cc -@@ -377,7 +377,7 @@ +@@ -378,7 +378,7 @@ + #include "components/user_manager/user_manager.h" #include "services/service_manager/public/mojom/interface_provider_spec.mojom.h" #include "storage/browser/file_system/external_mount_points.h" - #include "third_party/cros_system_api/switches/chrome_switches.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" @@ -448,17 +448,17 @@ // 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 -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) #if !BUILDFLAG(IS_ANDROID) #include "base/debug/leak_annotations.h" #include "components/crash/core/app/breakpad_linux.h" @@ -466,12 +466,12 @@ #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/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) @@ -493,11 +493,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 defined(USE_OZONE) #include "chrome/browser/chrome_browser_main_extra_parts_ozone.h" -@@ -883,7 +883,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo +@@ -889,7 +889,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo int GetCrashSignalFD(const base::CommandLine& command_line) { return crashpad::CrashHandlerHost::Get()->GetDeathSignalSocket(); } -#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( const std::string& process_type) { base::FilePath dumps_path; -@@ -1400,7 +1400,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1406,7 +1406,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( #elif BUILDFLAG(IS_CHROMEOS_LACROS) main_parts = std::make_unique( std::move(parameters), &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( std::move(parameters), &startup_data_); #elif BUILDFLAG(IS_ANDROID) -@@ -1434,7 +1434,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1440,7 +1440,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( 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 -@@ -1451,7 +1451,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1457,7 +1457,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( 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 defined(USE_OZONE) main_parts->AddParts(std::make_unique()); -@@ -2200,6 +2200,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2206,6 +2206,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; #else bool enable_crash_reporter = false; if (crash_reporter::IsCrashpadEnabled()) { -@@ -2519,7 +2521,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2513,7 +2515,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin ThreadProfilerConfiguration::Get()->AppendCommandLineSwitchForChildProcess( command_line); --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) + // TODO(https://crbug.com/1316129): Re-enable for Lacros. // Processes may only query perf_event_open with the BPF sandbox disabled. if (browser_command_line.HasSwitch(switches::kEnableThreadInstructionCount) && - command_line->HasSwitch(sandbox::policy::switches::kNoSandbox)) { -@@ -3912,7 +3914,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +@@ -3903,7 +3905,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, -@@ -4318,14 +4320,14 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4310,14 +4312,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); -@@ -4358,7 +4360,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4350,7 +4352,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati // 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)) MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle:: MaybeCreateThrottleFor(handle), 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 89820124902a..b2959c6b4fed 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 2022-03-25 21:59:56 UTC +--- chrome/browser/chrome_content_browser_client.h.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/chrome_content_browser_client.h -@@ -417,7 +417,7 @@ class ChromeContentBrowserClient : public content::Con +@@ -414,7 +414,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_component__updater_registration.cc b/www/chromium/files/patch-chrome_browser_component__updater_registration.cc new file mode 100644 index 000000000000..782c92a32dab --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_component__updater_registration.cc @@ -0,0 +1,20 @@ +--- chrome/browser/component_updater/registration.cc.orig 2022-05-19 14:06:27 UTC ++++ chrome/browser/component_updater/registration.cc +@@ -90,7 +90,7 @@ + #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" + #endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "chrome/browser/component_updater/screen_ai_component_installer.h" + #endif // BUILDFLAG(IS_LINUX) + +@@ -214,7 +214,7 @@ void RegisterComponentsForUpdate() { + + RegisterClientSidePhishingComponent(cus); + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + RegisterScreenAIComponent(cus, g_browser_process->local_state()); + #endif // BUILDFLAG(IS_LINUX) + diff --git a/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd b/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd index 4b0f3ecbf844..b548b1227e0e 100644 --- a/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd +++ b/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd @@ -1,11 +1,11 @@ ---- chrome/browser/dev_ui_browser_resources.grd.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/dev_ui_browser_resources.grd.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/dev_ui_browser_resources.grd -@@ -46,7 +46,7 @@ This file specifies browser resources for developer-fa - +@@ -50,7 +50,7 @@ This file specifies browser resources for developer-fa + - + 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 90e0d59a8064..c08101b188a1 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,47 +1,47 @@ ---- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/download/chrome_download_manager_delegate.cc -@@ -1540,7 +1540,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1533,7 +1533,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe target_info->is_filetype_handled_safely) DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (item->GetOriginalMimeType() == "application/x-x509-user-cert") DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); #endif -@@ -1609,7 +1609,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1585,7 +1585,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(); } -@@ -1717,7 +1717,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow +@@ -1693,7 +1693,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()) { -@@ -1759,7 +1759,7 @@ std::unique_ptr +@@ -1735,7 +1735,7 @@ std::unique_ptr ChromeDownloadManagerDelegate::GetRenameHandlerForDownload( download::DownloadItem* download_item) { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) return enterprise_connectors::FileSystemRenameHandler::CreateIfNeeded( download_item); #else -@@ -1775,7 +1775,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAl +@@ -1751,7 +1751,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 7322bb2b635c..64002dd0fec3 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-02-28 16:54:41 UTC +--- chrome/browser/download/download_commands.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/download/download_commands.cc -@@ -27,7 +27,7 @@ +@@ -26,7 +26,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" -@@ -168,7 +168,7 @@ void DownloadCommands::ExecuteCommand(Command command) +@@ -167,7 +167,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__file__picker.cc b/www/chromium/files/patch-chrome_browser_download_download__file__picker.cc index bbd456e9bf0d..571caf3b35c3 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__file__picker.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__file__picker.cc @@ -1,20 +1,20 @@ ---- chrome/browser/download/download_file_picker.cc.orig 2022-05-02 18:33:07 UTC +--- chrome/browser/download/download_file_picker.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/download/download_file_picker.cc -@@ -14,7 +14,7 @@ +@@ -16,7 +16,7 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/web_contents.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "ui/aura/window.h" -@@ -74,7 +74,7 @@ DownloadFilePicker::DownloadFilePicker(DownloadItem* i +@@ -76,7 +76,7 @@ DownloadFilePicker::DownloadFilePicker(DownloadItem* i // dialog in Linux. See SelectFileImpl() in select_file_dialog_linux_gtk.cc. // Here we make owning_window host to browser current active window // if it is null. https://crbug.com/1301898 -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) if (!owning_window || !owning_window->GetHost()) { owning_window = BrowserList::GetInstance() ->GetLastActive() 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 3fd0a97eab3e..22ae1dedb0e4 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,20 +1,20 @@ ---- chrome/browser/download/download_item_model.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/download/download_item_model.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/download/download_item_model.cc -@@ -660,7 +660,7 @@ bool DownloadItemModel::IsCommandChecked( +@@ -678,7 +678,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(); -@@ -700,7 +700,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand +@@ -718,7 +718,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand DownloadCommands::ALWAYS_OPEN_TYPE); 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); 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 d44f23417418..1191fd54aa79 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__prefs.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__prefs.cc @@ -1,99 +1,99 @@ ---- chrome/browser/download/download_prefs.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/download/download_prefs.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/download/download_prefs.cc @@ -13,6 +13,7 @@ #include "base/callback_helpers.h" #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" @@ -60,6 +61,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; @@ -70,7 +75,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; @@ -168,7 +173,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 -@@ -289,7 +294,7 @@ void DownloadPrefs::RegisterProfilePrefs( +@@ -291,7 +296,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) -@@ -432,7 +437,7 @@ bool DownloadPrefs::IsDownloadPathManaged() const { +@@ -434,7 +439,7 @@ bool DownloadPrefs::IsDownloadPathManaged() const { bool DownloadPrefs::IsAutoOpenByUserUsed() const { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (ShouldOpenPdfInSystemReader()) return true; #endif -@@ -447,7 +452,7 @@ bool DownloadPrefs::IsAutoOpenEnabled(const GURL& url, +@@ -449,7 +454,7 @@ bool DownloadPrefs::IsAutoOpenEnabled(const GURL& url, DCHECK(extension[0] == base::FilePath::kExtensionSeparator); extension.erase(0, 1); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (base::FilePath::CompareEqualIgnoreCase(extension, FILE_PATH_LITERAL("pdf")) && ShouldOpenPdfInSystemReader()) -@@ -502,7 +507,7 @@ void DownloadPrefs::DisableAutoOpenByUserBasedOnExtens +@@ -504,7 +509,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; -@@ -524,7 +529,7 @@ bool DownloadPrefs::ShouldOpenPdfInSystemReader() cons +@@ -526,7 +531,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(); -@@ -664,7 +669,14 @@ base::FilePath DownloadPrefs::SanitizeDownloadTargetPa +@@ -666,7 +671,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_download_download__prefs.h b/www/chromium/files/patch-chrome_browser_download_download__prefs.h index 3b9cdcce2bf0..7bc29b44a5a3 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__prefs.h +++ b/www/chromium/files/patch-chrome_browser_download_download__prefs.h @@ -1,20 +1,20 @@ ---- chrome/browser/download/download_prefs.h.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/download/download_prefs.h.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/download/download_prefs.h @@ -125,7 +125,7 @@ class DownloadPrefs { void DisableAutoOpenByUserBasedOnExtension(const base::FilePath& file_name); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) // Store the user preference to disk. If |should_open| is true, also disable // the built-in PDF plugin. If |should_open| is false, enable the PDF plugin. void SetShouldOpenPdfInSystemReader(bool should_open); -@@ -184,7 +184,7 @@ class DownloadPrefs { +@@ -185,7 +185,7 @@ class DownloadPrefs { std::unique_ptr auto_open_allowed_by_urls_; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) bool should_open_pdf_in_system_reader_; #endif diff --git a/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn b/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn index 7f9cc0d5ca15..12a4cc805196 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 2022-03-25 21:59:56 UTC +--- chrome/browser/extensions/BUILD.gn.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/extensions/BUILD.gn -@@ -1299,6 +1299,10 @@ static_library("extensions") { +@@ -1302,6 +1302,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_image__writer__private_removable__storage__provider.cc b/www/chromium/files/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc index cec9c02cb102..86eb1466c079 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc.orig 2021-04-14 18:40:53 UTC +--- chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc -@@ -22,6 +22,7 @@ static base::LazyInstancePostTask( FROM_HERE, -@@ -35,6 +36,9 @@ void RemovableStorageProvider::GetAllDevices(DeviceLis +@@ -34,6 +35,9 @@ void RemovableStorageProvider::GetAllDevices(DeviceLis base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, base::BindOnce(&RemovableStorageProvider::PopulateDeviceList), std::move(callback)); +#else + NOTIMPLEMENTED(); +#endif } // static diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc b/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc index 8e814e8a9a64..c70ae09c36a8 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc @@ -1,29 +1,29 @@ ---- chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc -@@ -30,7 +30,7 @@ +@@ -29,7 +29,7 @@ #include "extensions/browser/process_manager.h" #include "extensions/common/error_utils.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "extensions/common/permissions/permissions_data.h" #endif -@@ -39,7 +39,7 @@ namespace { +@@ -38,7 +38,7 @@ namespace { bool CanEnableAudioDebugRecordingsFromExtension( const extensions::Extension* extension) { bool enabled_by_permissions = false; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (extension) { enabled_by_permissions = extension->permissions_data()->active_permissions().HasAPIPermission( -@@ -580,7 +580,7 @@ void WebrtcLoggingPrivateStartEventLoggingFunction::Fi +@@ -579,7 +579,7 @@ void WebrtcLoggingPrivateStartEventLoggingFunction::Fi ExtensionFunction::ResponseAction WebrtcLoggingPrivateGetLogsDirectoryFunction::Run() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Unlike other WebrtcLoggingPrivate functions that take a RequestInfo object, // this function shouldn't be called by a component extension on behalf of // some web code. It returns a DirectoryEntry for use directly in the calling diff --git a/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc b/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc index ccfb84227366..ae603afe7673 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/browser_context_keyed_service_factories.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/extensions/browser_context_keyed_service_factories.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/extensions/browser_context_keyed_service_factories.cc -@@ -52,7 +52,7 @@ +@@ -53,7 +53,7 @@ #include "extensions/browser/api/networking_private/networking_private_delegate_factory.h" #include "ppapi/buildflags/buildflags.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h" #endif -@@ -124,7 +124,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() +@@ -133,7 +133,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() extensions::SettingsPrivateEventRouterFactory::GetInstance(); extensions::SettingsOverridesAPI::GetFactoryInstance(); extensions::SignedInDevicesManager::GetFactoryInstance(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) extensions::SystemIndicatorManagerFactory::GetInstance(); #endif extensions::TabGroupsEventRouterFactory::GetInstance(); diff --git a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc index ffbb2e4afcf6..67486d5f9f47 100644 --- a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc +++ b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc @@ -1,56 +1,56 @@ ---- chrome/browser/flag_descriptions.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/flag_descriptions.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/flag_descriptions.cc -@@ -5688,7 +5688,7 @@ const char kDownloadShelfWebUIDescription[] = +@@ -5639,7 +5639,7 @@ const char kDownloadShelfWebUIDescription[] = // Random platform combinations ----------------------------------------------- #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) const char kWebuiFeedbackName[] = "WebUI Feedback"; const char kWebuiFeedbackDescription[] = -@@ -5699,7 +5699,7 @@ const char kWebuiFeedbackDescription[] = +@@ -5650,7 +5650,7 @@ const char kWebuiFeedbackDescription[] = // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kDesktopRestructuredLanguageSettingsName[] = "Restructured Language Settings (Desktop)"; -@@ -5725,7 +5725,7 @@ const char kWebShareDescription[] = +@@ -5676,7 +5676,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"; -@@ -5737,7 +5737,7 @@ const char kOzonePlatformHintDescription[] = +@@ -5688,7 +5688,7 @@ const char kOzonePlatformHintDescription[] = "\"X11\". \"Auto\" selects Wayland if possible, X11 otherwise. "; #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const char kCleanUndecryptablePasswordsLinuxName[] = "Cleanup local undecryptable passwords during initial sync flow"; const char kCleanUndecryptablePasswordsLinuxDescription[] = -@@ -5750,7 +5750,7 @@ const char kForcePasswordInitialSyncWhenDecryptionFail +@@ -5701,7 +5701,7 @@ const char kForcePasswordInitialSyncWhenDecryptionFail "storage and requests initial sync."; #endif // 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."; -@@ -5867,7 +5867,7 @@ const char kElasticOverscrollDescription[] = +@@ -5832,7 +5832,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 eb4a09c1b6ac..c15792e97796 100644 --- a/www/chromium/files/patch-chrome_browser_flag__descriptions.h +++ b/www/chromium/files/patch-chrome_browser_flag__descriptions.h @@ -1,47 +1,47 @@ ---- chrome/browser/flag_descriptions.h.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/flag_descriptions.h.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/flag_descriptions.h -@@ -3276,7 +3276,7 @@ extern const char kDownloadShelfWebUIDescription[]; +@@ -3241,7 +3241,7 @@ extern const char kDownloadShelfWebUIDescription[]; // Random platform combinations ----------------------------------------------- #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kWebuiFeedbackName[]; extern const char kWebuiFeedbackDescription[]; -@@ -3285,7 +3285,7 @@ extern const char kWebuiFeedbackDescription[]; +@@ -3250,7 +3250,7 @@ extern const char kWebuiFeedbackDescription[]; // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kDesktopRestructuredLanguageSettingsName[]; extern const char kDesktopRestructuredLanguageSettingsDescription[]; -@@ -3304,7 +3304,7 @@ extern const char kWebShareName[]; +@@ -3269,7 +3269,7 @@ extern const char kWebShareName[]; extern const char kWebShareDescription[]; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kOzonePlatformHintChoiceDefault[]; extern const char kOzonePlatformHintChoiceAuto[]; extern const char kOzonePlatformHintChoiceX11[]; -@@ -3320,7 +3320,7 @@ extern const char kForcePasswordInitialSyncWhenDecrypt +@@ -3285,7 +3285,7 @@ extern const char kForcePasswordInitialSyncWhenDecrypt extern const char kForcePasswordInitialSyncWhenDecryptionFailsDescription[]; #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[]; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) -@@ -3402,7 +3402,7 @@ extern const char kElasticOverscrollDescription[]; +@@ -3377,7 +3377,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[]; #endif diff --git a/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc b/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc index be8233631306..4713f329eb17 100644 --- a/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc +++ b/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc @@ -1,20 +1,20 @@ ---- chrome/browser/media/audio_service_util.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/media/audio_service_util.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/media/audio_service_util.cc @@ -21,7 +21,7 @@ namespace { -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) bool GetPolicyOrFeature(const char* policy_name, const base::Feature& feature) { const policy::PolicyMap& policies = -@@ -41,7 +41,7 @@ bool GetPolicyOrFeature(const char* policy_name, const +@@ -40,7 +40,7 @@ bool GetPolicyOrFeature(const char* policy_name, const bool IsAudioServiceSandboxEnabled() { // TODO(crbug.com/1052397): Remove !IS_CHROMEOS_LACROS once lacros starts being // built with OS_CHROMEOS instead of OS_LINUX. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) return GetPolicyOrFeature(policy::key::kAudioSandboxEnabled, features::kAudioServiceSandbox); diff --git a/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn b/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn index 174848de2493..f92ee97ce131 100644 --- a/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn +++ b/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn @@ -1,11 +1,11 @@ ---- chrome/browser/media/router/discovery/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/media/router/discovery/BUILD.gn.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/media/router/discovery/BUILD.gn -@@ -94,7 +94,7 @@ static_library("discovery") { +@@ -79,7 +79,7 @@ static_library("discovery") { "media_sink_discovery_metrics.h", ] - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "discovery_network_list_wifi_linux.cc" ] } diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc index 0d84ec44ea96..be4c6b83e83f 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc @@ -1,13 +1,13 @@ ---- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/media/webrtc/webrtc_log_uploader.cc -@@ -363,6 +363,10 @@ void WebRtcLogUploader::SetupMultipart( +@@ -362,6 +362,10 @@ void WebRtcLogUploader::SetupMultipart( const char product[] = "Chrome_ChromeOS"; #elif BUILDFLAG(IS_FUCHSIA) const char product[] = "Chrome_Fuchsia"; +#elif defined(OS_OPENBSD) + const char product[] = "Chrome_OpenBSD"; +#elif defined(OS_FREEBSD) + const char product[] = "Chrome_FreeBSD"; #else #error Platform not supported. #endif diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc index 5266ccb476a1..6d56e2f1ab3a 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc @@ -1,33 +1,33 @@ ---- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/media/webrtc/webrtc_logging_controller.cc -@@ -25,10 +25,10 @@ +@@ -24,10 +24,10 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/render_process_host.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "content/public/browser/child_process_security_policy.h" #include "storage/browser/file_system/isolated_context.h" -#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) using webrtc_event_logging::WebRtcEventLogManager; -@@ -282,7 +282,7 @@ void WebRtcLoggingController::StartEventLogging( +@@ -281,7 +281,7 @@ void WebRtcLoggingController::StartEventLogging( web_app_id, callback); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void WebRtcLoggingController::GetLogsDirectory( LogsDirectoryCallback callback, LogsDirectoryErrorCallback error_callback) { -@@ -328,7 +328,7 @@ void WebRtcLoggingController::GrantLogsDirectoryAccess +@@ -327,7 +327,7 @@ void WebRtcLoggingController::GrantLogsDirectoryAccess FROM_HERE, base::BindOnce(std::move(callback), file_system.id(), registered_name)); } -#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void WebRtcLoggingController::OnRtpPacket( std::unique_ptr packet_header, diff --git a/www/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 00d3ad3d30ca..912d6984b293 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,29 +1,29 @@ ---- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/metrics/chrome_metrics_service_client.cc -@@ -769,7 +769,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -784,7 +784,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()); -@@ -859,7 +859,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -874,7 +874,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) -@@ -1039,7 +1039,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve + metrics_service_->RegisterMetricsProvider( +@@ -1053,7 +1053,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_net_system__network__context__manager.cc b/www/chromium/files/patch-chrome_browser_net_system__network__context__manager.cc index 2fb30b298577..2c8698541206 100644 --- a/www/chromium/files/patch-chrome_browser_net_system__network__context__manager.cc +++ b/www/chromium/files/patch-chrome_browser_net_system__network__context__manager.cc @@ -1,38 +1,38 @@ ---- chrome/browser/net/system_network_context_manager.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/net/system_network_context_manager.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/net/system_network_context_manager.cc -@@ -91,7 +91,7 @@ +@@ -90,7 +90,7 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "chrome/common/chrome_paths_internal.h" #include "chrome/grit/chromium_strings.h" #include "ui/base/l10n/l10n_util.h" -@@ -173,7 +173,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut +@@ -172,7 +172,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut auth_dynamic_params->basic_over_http_enabled = local_state->GetBoolean(prefs::kBasicAuthOverHttpEnabled); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) auth_dynamic_params->delegate_by_kdc_policy = local_state->GetBoolean(prefs::kAuthNegotiateDelegateByKdcPolicy); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) -@@ -467,7 +467,7 @@ SystemNetworkContextManager::SystemNetworkContextManag +@@ -466,7 +466,7 @@ SystemNetworkContextManager::SystemNetworkContextManag pref_change_registrar_.Add(prefs::kAllHttpAuthSchemesAllowedForOrigins, auth_pref_callback); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) pref_change_registrar_.Add(prefs::kAuthNegotiateDelegateByKdcPolicy, auth_pref_callback); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) -@@ -534,7 +534,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe +@@ -533,7 +533,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe registry->RegisterStringPref(prefs::kAuthServerAllowlist, std::string()); registry->RegisterStringPref(prefs::kAuthNegotiateDelegateAllowlist, std::string()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kAuthNegotiateDelegateByKdcPolicy, false); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) diff --git a/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc b/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc index 7c7584a02130..cf7943370f20 100644 --- a/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc +++ b/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc @@ -1,38 +1,38 @@ ---- chrome/browser/notifications/notification_display_service_impl.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/notifications/notification_display_service_impl.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/notifications/notification_display_service_impl.cc @@ -32,7 +32,7 @@ #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) #include "chrome/browser/send_tab_to_self/desktop_notification_handler.h" #include "chrome/browser/sharing/sharing_notification_handler.h" #endif @@ -65,7 +65,7 @@ NotificationDisplayServiceImpl* NotificationDisplaySer // static void NotificationDisplayServiceImpl::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - registry->RegisterBooleanPref(prefs::kAllowNativeNotifications, true); registry->RegisterBooleanPref(prefs::kAllowSystemNotifications, true); #endif -@@ -82,7 +82,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer + } +@@ -81,7 +81,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer std::make_unique()); #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) AddNotificationHandler( NotificationHandler::Type::SEND_TAB_TO_SELF, std::make_unique( -@@ -90,7 +90,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer +@@ -89,7 +89,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) AddNotificationHandler( NotificationHandler::Type::TAILORED_SECURITY, std::make_unique()); diff --git a/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc b/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc index b76fb7634ea3..cc6e40bebaa5 100644 --- a/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc +++ b/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc @@ -1,20 +1,20 @@ ---- chrome/browser/performance_manager/policies/high_pmf_discard_policy.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/performance_manager/policies/high_pmf_discard_policy.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/performance_manager/policies/high_pmf_discard_policy.cc -@@ -17,7 +17,7 @@ +@@ -16,7 +16,7 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) #include "base/memory/memory_pressure_monitor.h" #endif -@@ -122,7 +122,7 @@ void HighPMFDiscardPolicy::OnProcessMemoryMetricsAvail +@@ -121,7 +121,7 @@ void HighPMFDiscardPolicy::OnProcessMemoryMetricsAvail if (should_discard) { discard_attempt_in_progress_ = true; -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) // Record the memory pressure level before discarding a tab. content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce([]() { diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc b/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc index 66e4c89e08ee..c88046d4002e 100644 --- a/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc +++ b/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc @@ -1,11 +1,11 @@ ---- chrome/browser/performance_monitor/process_metrics_recorder_util.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/performance_monitor/process_metrics_recorder_util.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/performance_monitor/process_metrics_recorder_util.cc -@@ -39,7 +39,7 @@ void RecordProcessHistograms(const char* histogram_suf - metrics.cpu_usage * kCPUUsageFactor, kCPUUsageHistogramMin, +@@ -43,7 +43,7 @@ void RecordProcessHistograms(const char* histogram_suf kCPUUsageHistogramMax, kCPUUsageHistogramBucketCount); + #endif #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) base::UmaHistogramCounts10000( - base::JoinString({"PerformanceMonitor.IdleWakeups.", histogram_suffix}, - ""), + base::StrCat({"PerformanceMonitor.IdleWakeups.", histogram_suffix}), + metrics.idle_wakeups); diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc index 7eb2ce3c9034..d4341d8d8ff2 100644 --- a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc +++ b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc @@ -1,11 +1,20 @@ ---- chrome/browser/performance_monitor/process_monitor.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/performance_monitor/process_monitor.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/performance_monitor/process_monitor.cc -@@ -83,7 +83,7 @@ ProcessMonitor::Metrics& operator+=(ProcessMonitor::Me - lhs.cpu_usage += rhs.cpu_usage; +@@ -64,7 +64,7 @@ ProcessMonitor::Metrics SampleMetrics(base::ProcessMet + metrics.precise_cpu_usage = process_metrics.GetPreciseCPUUsage(); + #endif + #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) + metrics.idle_wakeups = process_metrics.GetIdleWakeupsPerSecond(); + #endif + #if BUILDFLAG(IS_MAC) +@@ -119,7 +119,7 @@ ProcessMonitor::Metrics& operator+=(ProcessMonitor::Me + #endif #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) lhs.idle_wakeups += rhs.idle_wakeups; #endif diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h index 026781f76c1e..7e90761af238 100644 --- a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h +++ b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h @@ -1,11 +1,11 @@ ---- chrome/browser/performance_monitor/process_monitor.h.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/performance_monitor/process_monitor.h.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/performance_monitor/process_monitor.h -@@ -52,7 +52,7 @@ class ProcessMonitor { - double cpu_usage = 0.0; +@@ -78,7 +78,7 @@ class ProcessMonitor : public content::BrowserChildPro + #endif #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Returns the number of average idle cpu wakeups per second since the last // time the metric was sampled. int idle_wakeups = 0; diff --git a/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc b/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc index 15c89668c143..3a6b435d8c1b 100644 --- a/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc +++ b/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc @@ -1,38 +1,38 @@ ---- chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc -@@ -46,7 +46,7 @@ +@@ -47,7 +47,7 @@ #include "chrome/browser/policy/browser_dm_token_storage_mac.h" #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "chrome/browser/policy/browser_dm_token_storage_linux.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -55,7 +55,7 @@ +@@ -56,7 +56,7 @@ #include "chrome/install_static/install_util.h" #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/device_trust_features.h" #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/device_trust_key_manager_impl.h" #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/key_rotation_launcher.h" -@@ -88,7 +88,7 @@ void ChromeBrowserCloudManagementControllerDesktop:: +@@ -89,7 +89,7 @@ void ChromeBrowserCloudManagementControllerDesktop:: #if BUILDFLAG(IS_MAC) storage_delegate = std::make_unique(); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) storage_delegate = std::make_unique(); #elif BUILDFLAG(IS_WIN) storage_delegate = std::make_unique(); -@@ -243,7 +243,7 @@ ChromeBrowserCloudManagementControllerDesktop::CreateC +@@ -244,7 +244,7 @@ ChromeBrowserCloudManagementControllerDesktop::CreateC std::unique_ptr ChromeBrowserCloudManagementControllerDesktop::CreateDeviceTrustKeyManager() { -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (enterprise_connectors::IsDeviceTrustConnectorFeatureEnabled()) { auto key_rotation_launcher = enterprise_connectors::KeyRotationLauncher::Create( 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 446934d960d9..c5533c6b1ade 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,47 +1,56 @@ ---- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/policy/configuration_policy_handler_list_factory.cc -@@ -1473,7 +1473,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -187,7 +187,7 @@ + #endif // BUILDFLAG(ENABLE_SIDE_SEARCH) + + #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 + +@@ -1557,7 +1557,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = base::Value::Type::BOOLEAN }, #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CHROMEOS) -#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 }, -@@ -1582,7 +1582,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1624,7 +1624,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(ENABLE_EXTENSIONS) && (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA)) +#if BUILDFLAG(ENABLE_EXTENSIONS) && (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)) { key::kChromeAppsEnabled, extensions::pref_names::kChromeAppsEnabled, base::Value::Type::BOOLEAN }, -@@ -1888,7 +1888,7 @@ std::unique_ptr BuildH - #endif // BUILDFLAG(IS_ANDROID) +@@ -1940,7 +1940,7 @@ std::unique_ptr BuildH + key::kBrowsingDataLifetime, browsing_data::prefs::kBrowsingDataLifetime, + chrome_schema)); - #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ -- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - handlers->AddHandler( - std::make_unique< - enterprise_connectors::EnterpriseConnectorsPolicyHandler>( -@@ -2258,7 +2258,7 @@ std::unique_ptr BuildH - SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED)); +-#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) +@@ -2294,7 +2294,7 @@ std::unique_ptr BuildH + static_cast(variations::RestrictionPolicy::ALL), 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( - key::kWebAppSettings, prefs::kWebAppSettings, chrome_schema, - SCHEMA_ALLOW_UNKNOWN, -@@ -2289,7 +2289,7 @@ std::unique_ptr BuildH + handlers->AddHandler( + std::make_unique(chrome_schema)); + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || +@@ -2313,7 +2313,7 @@ std::unique_ptr BuildH policy::key::kSpellcheckLanguageBlocklist)); #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)); 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 1c10cfa7db70..db49d7358c07 100644 --- a/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc +++ b/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc @@ -1,37 +1,46 @@ ---- chrome/browser/prefs/browser_prefs.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/prefs/browser_prefs.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/prefs/browser_prefs.cc -@@ -423,14 +423,14 @@ +@@ -430,14 +430,14 @@ #include "components/os_crypt/os_crypt.h" #endif -#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/web_applications/url_handler_prefs.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 -@@ -1162,7 +1162,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -1191,7 +1191,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) web_app::url_handler_prefs::RegisterLocalStatePrefs(registry); #endif -@@ -1466,7 +1466,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync +@@ -1205,7 +1205,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) + registry->RegisterBooleanPref( + policy::policy_prefs::kSetTimeoutWithout1MsClampEnabled, false); + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + screen_ai::RegisterLocalStatePrefs(registry); + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + +@@ -1504,7 +1504,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync // 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)) browser_switcher::BrowserSwitcherPrefs::RegisterProfilePrefs(registry); #endif 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 c04a0dd08d38..8374e8b2683c 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 2022-04-21 18:48:31 UTC +--- chrome/browser/printing/print_backend_service_manager.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/printing/print_backend_service_manager.cc -@@ -420,7 +420,7 @@ uint32_t PrintBackendServiceManager::RegisterClient( +@@ -480,7 +480,7 @@ absl::optional PrintBackendServiceManager::R query_clients_.insert(client_id); break; case ClientType::kQueryWithUi: -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) - DCHECK_EQ(query_with_ui_clients_.size(), 0u); + if (!query_with_ui_clients_.empty()) + return absl::nullopt; #endif - query_with_ui_clients_.insert(client_id); -@@ -644,7 +644,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate +@@ -705,7 +705,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; -@@ -701,7 +701,7 @@ PrintBackendServiceManager::DetermineIdleTimeoutUpdate +@@ -762,7 +762,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()) 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_print__job__worker.cc index 3a87ff4df601..7bcb6159f42c 100644 --- a/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc +++ b/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc @@ -1,11 +1,11 @@ ---- chrome/browser/printing/print_job_worker.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/printing/print_job_worker.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/printing/print_job_worker.cc -@@ -220,7 +220,7 @@ void PrintJobWorker::UpdatePrintSettings(base::Value n +@@ -216,7 +216,7 @@ void PrintJobWorker::UpdatePrintSettings(base::Value:: crash_key = std::make_unique( print_backend->GetPrinterDriverInfo(printer_name)); -#if BUILDFLAG(IS_LINUX) && defined(USE_CUPS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(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 e6bd2cfbb3f0..a59897bf8a89 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,11 +1,11 @@ ---- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2022-04-21 18:48:31 UTC +--- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc -@@ -395,7 +395,7 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -400,7 +400,7 @@ 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 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 bd6ebd137dbb..841292078166 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 2022-04-21 18:48:31 UTC +--- chrome/browser/profiles/profile_impl.cc.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/profiles/profile_impl.cc -@@ -266,6 +266,10 @@ +@@ -264,6 +264,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; -@@ -852,7 +856,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) +@@ -844,7 +848,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__browser__proxy.ts b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__browser__proxy.ts index 6a9f629650d7..503b3d11307a 100644 --- a/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__browser__proxy.ts +++ b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__browser__proxy.ts @@ -1,20 +1,20 @@ ---- chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.ts.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.ts.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.ts @@ -16,7 +16,7 @@ export interface AppearanceBrowserProxy { useDefaultTheme(): void; -- // -+ // +- // ++ // useSystemTheme(): void; // @@ -44,7 +44,7 @@ export class AppearanceBrowserProxyImpl implements App chrome.send('useDefaultTheme'); } -- // -+ // +- // ++ // useSystemTheme() { chrome.send('useSystemTheme'); } 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 522102aa1e38..7990e1a34ff0 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-02-28 16:54:41 UTC +--- chrome/browser/resources/settings/appearance_page/appearance_page.html.orig 2022-05-19 14:06:27 UTC +++ chrome/browser/resources/settings/appearance_page/appearance_page.html @@ -27,7 +27,7 @@ - + -- -+ +- ++