diff --git a/www/chromium/Makefile b/www/chromium/Makefile index cf4fefea675c..13a3dffcee9c 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,348 +1,348 @@ # Created by: Florent Thoumie PORTNAME= chromium -PORTVERSION= 100.0.4896.127 +PORTVERSION= 101.0.4951.41 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 cacd334731d5..ac55e8ad2b6c 100644 --- a/www/chromium/distinfo +++ b/www/chromium/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1650025280 -SHA256 (chromium-100.0.4896.127.tar.xz) = 4710e3453c972c91e68a21f6b0b76ba73d4d617f299a5208615ed6e41b1af84d -SIZE (chromium-100.0.4896.127.tar.xz) = 1358426108 -SHA256 (chromium-100.0.4896.127-testdata.tar.xz) = ad2d659c4850d9e48b298f192261c795be67e1393a3aecc42c062e6b751ca6a9 -SIZE (chromium-100.0.4896.127-testdata.tar.xz) = 260013080 +TIMESTAMP = 1650566380 +SHA256 (chromium-101.0.4951.41.tar.xz) = 099863882e88b9a035fcb6b63dd5288554f6b27558e0ebce93e0d804465efa37 +SIZE (chromium-101.0.4951.41.tar.xz) = 1414841332 +SHA256 (chromium-101.0.4951.41-testdata.tar.xz) = f172a895533f618369176e04904b6d5eae7dce698b1358d53c985527c4805169 +SIZE (chromium-101.0.4951.41-testdata.tar.xz) = 260727368 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 30303505c930..67d26dc553f0 100644 --- a/www/chromium/files/patch-BUILD.gn +++ b/www/chromium/files/patch-BUILD.gn @@ -1,72 +1,72 @@ ---- BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ BUILD.gn -@@ -53,7 +53,7 @@ declare_args() { +@@ -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) -@@ -452,7 +452,7 @@ group("gn_all") { +@@ -436,7 +436,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", -@@ -636,6 +636,15 @@ group("gn_all") { +@@ -625,6 +625,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", -@@ -685,7 +694,7 @@ group("gn_all") { +@@ -674,7 +683,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)" ] } -@@ -1147,7 +1156,7 @@ if (!is_ios) { +@@ -1141,7 +1150,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)" ] } -@@ -1156,7 +1165,7 @@ if (!is_ios) { +@@ -1150,7 +1159,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)" ] } -@@ -1531,7 +1540,7 @@ group("chromium_builder_perf") { +@@ -1540,7 +1549,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 1ae290e3f1c0..28df7dbb13f1 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-03-25 21:59:56 UTC +--- base/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ base/BUILD.gn -@@ -999,7 +999,7 @@ mixed_component("base") { +@@ -1010,7 +1010,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", -@@ -1010,6 +1010,12 @@ mixed_component("base") { +@@ -1021,6 +1021,12 @@ mixed_component("base") { "profiler/thread_delegate_posix.h", ] } + + if (is_bsd) { + sources += [ + "profiler/stack_sampler_posix.cc", + ] + } } if (is_win) { -@@ -1478,11 +1484,23 @@ mixed_component("base") { +@@ -1492,11 +1498,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", -@@ -1506,7 +1524,7 @@ mixed_component("base") { +@@ -1520,7 +1538,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", -@@ -1563,7 +1581,7 @@ mixed_component("base") { +@@ -1576,7 +1594,7 @@ mixed_component("base") { + # Allow more direct string conversions on platforms with native utf8 # strings - # TODO(crbug/1052397): Consider replacing is_ash with is_chromeos once lacros switches to target_os=chromeos -- if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia) { -+ if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia || is_bsd) { +- if (is_apple || is_chromeos || is_chromecast || is_fuchsia) { ++ if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -2243,6 +2261,42 @@ mixed_component("base") { +@@ -2255,6 +2273,42 @@ mixed_component("base") { } } + if (is_bsd) { + sources -= [ + "files/file_path_watcher_linux.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 -= [ -@@ -3495,7 +3549,7 @@ test("base_unittests") { +@@ -3537,7 +3591,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", -@@ -3543,7 +3597,7 @@ test("base_unittests") { +@@ -3585,7 +3639,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", -@@ -3555,7 +3609,7 @@ test("base_unittests") { +@@ -3596,7 +3650,7 @@ test("base_unittests") { + # Allow more direct string conversions on platforms with native utf8 # strings - # TODO(crbug/1052397): Consider replacing is_ash with is_chromeos once lacros switches to target_os=chromeos -- if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia) { -+ if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia || is_bsd) { +- if (is_apple || is_chromeos || is_chromecast || is_fuchsia) { ++ if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -3724,7 +3778,7 @@ test("base_unittests") { +@@ -3765,7 +3819,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_partition__alloc__config.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__config.h index 454110a15f26..6adb646639f4 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,20 +1,29 @@ ---- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-03-25 21:59:56 UTC +--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-04-21 18:48:31 UTC +++ base/allocator/partition_allocator/partition_alloc_config.h -@@ -59,7 +59,7 @@ static_assert(sizeof(void*) != 8, ""); +@@ -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 -@@ -179,7 +179,7 @@ constexpr bool kUseLazyCommit = false; +@@ -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; + // + // 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) + #define PA_PREFER_SMALLER_SLOT_SPANS + #endif // BUILDFLAG(IS_LINUX) + diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h deleted file mode 100644 index dbd1382fed99..000000000000 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h +++ /dev/null @@ -1,11 +0,0 @@ ---- base/allocator/partition_allocator/partition_root.h.orig 2022-03-25 21:59:56 UTC -+++ base/allocator/partition_allocator/partition_root.h -@@ -1071,7 +1071,7 @@ ALWAYS_INLINE void PartitionRoot::FreeNoH - // essentially). - #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \ - ((BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMECAST)) || \ -- (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_64_BITS))) -+ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_64_BITS))) - PA_CHECK(IsManagedByPartitionAlloc(object_addr)); - #endif - diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc b/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc index 2fa346356669..fc3fa41f6937 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc @@ -1,47 +1,47 @@ ---- base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-04-21 18:48:31 UTC +++ base/allocator/partition_allocator/spinning_mutex.cc @@ -17,7 +17,15 @@ #if defined(PA_HAS_LINUX_KERNEL) #include +#if defined(OS_OPENBSD) +#include +#elif defined(OS_FREEBSD) +#include +#include +#include +#else #include +#endif #include #include #endif // defined(PA_HAS_LINUX_KERNEL) -@@ -85,8 +93,13 @@ void SpinningMutex::FutexWait() { +@@ -116,8 +124,13 @@ void SpinningMutex::FutexWait() { // |kLockedContended| anymore. Note that even without spurious wakeups, the // value of |state_| is not guaranteed when this returns, as another thread // may get the lock before we get to run. +#if defined(OS_FREEBSD) + int err = _umtx_op(&state_, UMTX_OP_WAIT_UINT_PRIVATE, + kLockedContended, nullptr, nullptr); +#else int err = syscall(SYS_futex, &state_, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, kLockedContended, nullptr, nullptr, 0); +#endif if (err) { // These are programming error, check them. -@@ -98,8 +111,14 @@ void SpinningMutex::FutexWait() { +@@ -129,8 +142,14 @@ void SpinningMutex::FutexWait() { void SpinningMutex::FutexWake() { int saved_errno = errno; +#if defined(OS_FREEBSD) + long retval = _umtx_op(&state_, UMTX_OP_WAKE_PRIVATE, + 1 /* wake up a single waiter */, nullptr, nullptr); +#else long retval = syscall(SYS_futex, &state_, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1 /* wake up a single waiter */, nullptr, nullptr, 0); +#endif + PA_CHECK(retval != -1); errno = saved_errno; } diff --git a/www/chromium/files/patch-base_debug_debugger__posix.cc b/www/chromium/files/patch-base_debug_debugger__posix.cc index 01e51311eb4a..447811370c92 100644 --- a/www/chromium/files/patch-base_debug_debugger__posix.cc +++ b/www/chromium/files/patch-base_debug_debugger__posix.cc @@ -1,68 +1,68 @@ ---- base/debug/debugger_posix.cc.orig 2022-02-28 16:54:41 UTC +--- base/debug/debugger_posix.cc.orig 2022-04-21 18:48:31 UTC +++ base/debug/debugger_posix.cc -@@ -36,6 +36,10 @@ +@@ -35,6 +35,10 @@ #include #endif +#if BUILDFLAG(IS_OPENBSD) +#include +#endif + #if BUILDFLAG(IS_FREEBSD) #include #endif -@@ -96,32 +100,51 @@ bool BeingDebugged() { +@@ -95,32 +99,51 @@ bool BeingDebugged() { // Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and // binary interfaces may change. +#if BUILDFLAG(IS_OPENBSD) + struct kinfo_proc *info; + size_t info_size; +#else struct kinfo_proc info; size_t info_size = sizeof(info); +#endif #if BUILDFLAG(IS_OPENBSD) - if (sysctl(mib, base::size(mib), NULL, &info_size, NULL, 0) < 0) + if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0) return -1; mib[5] = (info_size / sizeof(struct kinfo_proc)); + if ((info = reinterpret_cast(malloc(info_size))) == NULL) { + is_set = true; + being_debugged = false; + return being_debugged; + } + -+ int sysctl_result = sysctl(mib, base::size(mib), info, &info_size, NULL, 0); ++ int sysctl_result = sysctl(mib, std::size(mib), info, &info_size, NULL, 0); #endif +#if !BUILDFLAG(IS_OPENBSD) - int sysctl_result = sysctl(mib, base::size(mib), &info, &info_size, NULL, 0); + int sysctl_result = sysctl(mib, std::size(mib), &info, &info_size, NULL, 0); +#endif DCHECK_EQ(sysctl_result, 0); if (sysctl_result != 0) { is_set = true; being_debugged = false; - return being_debugged; + goto out; } // This process is being debugged if the P_TRACED flag is set. is_set = true; #if BUILDFLAG(IS_FREEBSD) being_debugged = (info.ki_flag & P_TRACED) != 0; -#elif BUILDFLAG(IS_BSD) - being_debugged = (info.p_flag & P_TRACED) != 0; +#elif BUILDFLAG(IS_OPENBSD) + being_debugged = (info->p_psflags & PS_TRACED) != 0; #else being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0; +#endif + +out: +#if BUILDFLAG(IS_OPENBSD) + free(info); #endif return being_debugged; } 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 a1831d52549c..acafe295b237 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-02-07 13:39:41 UTC +--- base/files/file_util_posix.cc.orig 2022-04-21 18:48:31 UTC +++ base/files/file_util_posix.cc -@@ -694,32 +694,34 @@ bool CreateDirectoryAndGetError(const FilePath& full_p +@@ -695,32 +695,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 (auto i = subpaths.rbegin(); i != subpaths.rend(); ++i) { -- if (DirectoryExists(*i)) + for (const FilePath& subpath : base::Reversed(subpaths)) { +- if (DirectoryExists(subpath)) - continue; -- if (mkdir(i->value().c_str(), 0700) == 0) +- 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(*i)) { +- if (!DirectoryExists(subpath)) { - if (error) - *error = File::OSErrorToFileError(saved_errno); - return false; -+ if (!PathExists(*i)) { -+ if ((mkdir(i->value().c_str(), 0700) == -1) && -+ ((full_path != *i) ? (errno != ENOENT) : (-1))) { ++ 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(*i)) { ++ } else if (!DirectoryExists(subpath)) { + if (error) + *error = File::OSErrorToFileError(ENOTDIR); + return false; } } return true; diff --git a/www/chromium/files/patch-base_files_file__util__unittest.cc b/www/chromium/files/patch-base_files_file__util__unittest.cc index 4ab8b350d668..7a1b5ff376fb 100644 --- a/www/chromium/files/patch-base_files_file__util__unittest.cc +++ b/www/chromium/files/patch-base_files_file__util__unittest.cc @@ -1,20 +1,20 @@ ---- base/files/file_util_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- base/files/file_util_unittest.cc.orig 2022-04-21 18:48:31 UTC +++ base/files/file_util_unittest.cc -@@ -3524,7 +3524,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) { +@@ -3523,7 +3523,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) { } #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) TEST_F(FileUtilTest, ReadFileToStringWithProcFileSystem) { FilePath file_path("/proc/cpuinfo"); std::string data = "temp"; -@@ -4240,7 +4240,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles +@@ -4239,7 +4239,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles NULL); #else size_t bytes_written = - ::write(::fileno(output_file.get()), content.c_str(), content.length()); + ::write(fileno(output_file.get()), content.c_str(), content.length()); #endif EXPECT_EQ(content.length(), bytes_written); ::fflush(output_file.get()); diff --git a/www/chromium/files/patch-base_i18n_icu__util.cc b/www/chromium/files/patch-base_i18n_icu__util.cc index f5d9b12738d7..efee9094958e 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-02-28 16:54:41 UTC +--- base/i18n/icu_util.cc.orig 2022-04-21 18:48:31 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 -@@ -346,7 +346,7 @@ void InitializeIcuTimeZone() { +@@ -345,7 +345,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_process_process__handle__freebsd.cc b/www/chromium/files/patch-base_process_process__handle__freebsd.cc index 446674518dba..5cc930471cea 100644 --- a/www/chromium/files/patch-base_process_process__handle__freebsd.cc +++ b/www/chromium/files/patch-base_process_process__handle__freebsd.cc @@ -1,23 +1,25 @@ ---- base/process/process_handle_freebsd.cc.orig 2021-09-24 04:25:55 UTC +--- base/process/process_handle_freebsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_handle_freebsd.cc -@@ -12,15 +12,19 @@ - #include +@@ -3,6 +3,7 @@ + // found in the LICENSE file. - #include "base/cxx17_backports.h" -+#include "base/files/file_path.h" + #include "base/process/process_handle.h" ++#include "base/files/file_util.h" - namespace base { + #include + #include +@@ -15,10 +16,13 @@ namespace base { ProcessId GetParentProcessId(ProcessHandle process) { struct kinfo_proc info; - size_t length; + size_t length = sizeof(struct kinfo_proc); int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process }; - if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0) + if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) + return -1; + + if (length < sizeof(struct kinfo_proc)) return -1; return info.ki_ppid; diff --git a/www/chromium/files/patch-base_process_process__handle__openbsd.cc b/www/chromium/files/patch-base_process_process__handle__openbsd.cc index f176993b81b2..f8e318565de3 100644 --- a/www/chromium/files/patch-base_process_process__handle__openbsd.cc +++ b/www/chromium/files/patch-base_process_process__handle__openbsd.cc @@ -1,89 +1,89 @@ ---- base/process/process_handle_openbsd.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/process_handle_openbsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_handle_openbsd.cc @@ -3,8 +3,11 @@ // found in the LICENSE file. #include "base/process/process_handle.h" +#include "base/files/file_util.h" #include +#include +#include #include #include #include -@@ -14,39 +17,59 @@ +@@ -12,39 +15,59 @@ namespace base { ProcessId GetParentProcessId(ProcessHandle process) { - struct kinfo_proc info; + struct kinfo_proc *info; size_t length; + pid_t ppid; int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process, sizeof(struct kinfo_proc), 0 }; - if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) < 0) + if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) return -1; + info = (struct kinfo_proc *)malloc(length); + mib[5] = (length / sizeof(struct kinfo_proc)); -- if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0) +- if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) - return -1; -+ if (sysctl(mib, base::size(mib), info, &length, NULL, 0) < 0) { ++ if (sysctl(mib, std::size(mib), info, &length, NULL, 0) < 0) { + ppid = -1; + goto out; + } - return info.p_ppid; + ppid = info->p_ppid; + +out: + free(info); + return ppid; } FilePath GetProcessExecutablePath(ProcessHandle process) { - struct kinfo_proc kp; - size_t len; + struct kinfo_proc *info; + size_t length; + char *path = NULL; int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process, sizeof(struct kinfo_proc), 0 }; -- if (sysctl(mib, base::size(mib), NULL, &len, NULL, 0) == -1) -+ if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) == -1) +- if (sysctl(mib, std::size(mib), NULL, &len, NULL, 0) == -1) ++ if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) == -1) return FilePath(); - mib[5] = (len / sizeof(struct kinfo_proc)); -- if (sysctl(mib, base::size(mib), &kp, &len, NULL, 0) < 0) +- if (sysctl(mib, std::size(mib), &kp, &len, NULL, 0) < 0) - return FilePath(); - if ((kp.p_flag & P_SYSTEM) != 0) - return FilePath(); - if (strcmp(kp.p_comm, "chrome") == 0) - return FilePath(kp.p_comm); - return FilePath(); + info = (struct kinfo_proc *)malloc(length); + + mib[5] = (length / sizeof(struct kinfo_proc)); + -+ if (sysctl(mib, base::size(mib), info, &length, NULL, 0) < 0) ++ if (sysctl(mib, std::size(mib), info, &length, NULL, 0) < 0) + goto out; + + if ((info->p_flag & P_SYSTEM) != 0) + goto out; + + if (strcmp(info->p_comm, "chrome") == 0) { + path = info->p_comm; + goto out; + } + +out: + free(info); + return FilePath(path); } } // namespace base diff --git a/www/chromium/files/patch-base_process_process__iterator__freebsd.cc b/www/chromium/files/patch-base_process_process__iterator__freebsd.cc index 94c3bb5ddfdd..88715effc731 100644 --- a/www/chromium/files/patch-base_process_process__iterator__freebsd.cc +++ b/www/chromium/files/patch-base_process_process__iterator__freebsd.cc @@ -1,51 +1,51 @@ ---- base/process/process_iterator_freebsd.cc.orig 2021-09-24 04:25:55 UTC +--- base/process/process_iterator_freebsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_iterator_freebsd.cc -@@ -21,7 +21,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* +@@ -20,7 +20,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* : index_of_kinfo_proc_(), filter_(filter) { - int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid() }; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, (int) getuid() }; bool done = false; int try_num = 1; -@@ -40,7 +40,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* +@@ -39,7 +39,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* num_of_kinfo_proc += 16; kinfo_procs_.resize(num_of_kinfo_proc); len = num_of_kinfo_proc * sizeof(struct kinfo_proc); -- if (sysctl(mib, base::size(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) { -+ if (sysctl(mib, base::size(mib), kinfo_procs_.data(), &len, NULL, 0) < 0) { +- if (sysctl(mib, std::size(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) { ++ if (sysctl(mib, std::size(mib), kinfo_procs_.data(), &len, NULL, 0) < 0) { // If we get a mem error, it just means we need a bigger buffer, so // loop around again. Anything else is a real error and give up. if (errno != ENOMEM) { -@@ -50,7 +50,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* +@@ -49,7 +49,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* } } else { // Got the list, just make sure we're sized exactly right - size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc); -+ num_of_kinfo_proc = len / sizeof(struct kinfo_proc); ++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc); kinfo_procs_.resize(num_of_kinfo_proc); done = true; } -@@ -72,18 +72,13 @@ bool ProcessIterator::CheckForNextProcess() { +@@ -71,18 +71,13 @@ bool ProcessIterator::CheckForNextProcess() { for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) { size_t length; struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_]; - int mib[] = { CTL_KERN, KERN_PROC_ARGS, kinfo.ki_pid }; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, kinfo.ki_pid }; if ((kinfo.ki_pid > 0) && (kinfo.ki_stat == SZOMB)) continue; - length = 0; -- if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) < 0) { +- if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) { - LOG(ERROR) << "failed to figure out the buffer size for a command line"; - continue; - } - - data.resize(length); + data.resize(ARG_MAX); + length = ARG_MAX; - if (sysctl(mib, base::size(mib), &data[0], &length, NULL, 0) < 0) { + if (sysctl(mib, std::size(mib), &data[0], &length, NULL, 0) < 0) { LOG(ERROR) << "failed to fetch a commandline"; diff --git a/www/chromium/files/patch-base_process_process__iterator__openbsd.cc b/www/chromium/files/patch-base_process_process__iterator__openbsd.cc index a48483289ff4..5b63c8ddba9d 100644 --- a/www/chromium/files/patch-base_process_process__iterator__openbsd.cc +++ b/www/chromium/files/patch-base_process_process__iterator__openbsd.cc @@ -1,45 +1,45 @@ ---- base/process/process_iterator_openbsd.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/process_iterator_openbsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_iterator_openbsd.cc @@ -6,6 +6,9 @@ #include #include +#include +#include +#include #include - #include "base/cxx17_backports.h" -@@ -19,12 +22,13 @@ ProcessIterator::ProcessIterator(const ProcessFilter* + #include "base/logging.h" +@@ -18,12 +21,13 @@ ProcessIterator::ProcessIterator(const ProcessFilter* : index_of_kinfo_proc_(), filter_(filter) { - int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid(), + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, static_cast(getuid()), sizeof(struct kinfo_proc), 0 }; bool done = false; int try_num = 1; const int max_tries = 10; + size_t num_of_kinfo_proc; do { size_t len = 0; -@@ -33,7 +37,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* +@@ -32,7 +36,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* kinfo_procs_.resize(0); done = true; } else { - size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc); + num_of_kinfo_proc = len / sizeof(struct kinfo_proc); // Leave some spare room for process table growth (more could show up // between when we check and now) num_of_kinfo_proc += 16; -@@ -49,7 +53,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* +@@ -48,7 +52,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* } } else { // Got the list, just make sure we're sized exactly right - size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc); + num_of_kinfo_proc = len / sizeof(struct kinfo_proc); kinfo_procs_.resize(num_of_kinfo_proc); done = true; } diff --git a/www/chromium/files/patch-base_process_process__metrics__freebsd.cc b/www/chromium/files/patch-base_process_process__metrics__freebsd.cc index 052477866871..6e1f650925be 100644 --- a/www/chromium/files/patch-base_process_process__metrics__freebsd.cc +++ b/www/chromium/files/patch-base_process_process__metrics__freebsd.cc @@ -1,292 +1,290 @@ ---- base/process/process_metrics_freebsd.cc.orig 2022-03-25 21:59:56 UTC +--- base/process/process_metrics_freebsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_metrics_freebsd.cc -@@ -3,21 +3,41 @@ +@@ -3,20 +3,39 @@ // found in the LICENSE file. #include "base/process/process_metrics.h" +#include "base/notreached.h" #include +#include #include #include #include +#include /* O_RDONLY */ +#include +#include + - #include "base/cxx17_backports.h" #include "base/memory/ptr_util.h" #include "base/process/process_metrics_iocounters.h" +#include "base/values.h" namespace base { +namespace { - +int GetPageShift() { + int pagesize = getpagesize(); + int pageshift = 0; -+ + + while (pagesize > 1) { + pageshift++; + pagesize >>= 1; + } + + return pageshift; +} +} + ProcessMetrics::ProcessMetrics(ProcessHandle process) - : process_(process), - last_cpu_(0) {} + : process_(process) {} // static std::unique_ptr ProcessMetrics::CreateProcessMetrics( -@@ -27,17 +47,18 @@ std::unique_ptr ProcessMetrics::Create +@@ -26,17 +45,18 @@ std::unique_ptr ProcessMetrics::Create double ProcessMetrics::GetPlatformIndependentCPUUsage() { struct kinfo_proc info; - int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_}; - size_t length = sizeof(info); + size_t length = sizeof(struct kinfo_proc); -+ int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ }; ++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ }; + - if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0) + if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) - return 0; + return 0.0; - return (info.ki_pctcpu / FSCALE) * 100.0; + return static_cast((info.ki_pctcpu * 100.0) / FSCALE); } TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { - NOTREACHED(); + NOTIMPLEMENTED(); return TimeDelta(); } -@@ -68,4 +89,221 @@ size_t GetSystemCommitCharge() { +@@ -67,4 +87,221 @@ size_t GetSystemCommitCharge() { return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize); } +int GetNumberOfThreads(ProcessHandle process) { + // Taken from FreeBSD top (usr.bin/top/machine.c) + + kvm_t* kd = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open"); + if (kd == NULL) + return 0; + + struct kinfo_proc* pbase; + int nproc; + pbase = kvm_getprocs(kd, KERN_PROC_PID, process, &nproc); + if (pbase == NULL) + return 0; + + if (kvm_close(kd) == -1) + return 0; + + return nproc; +} + +bool GetSystemMemoryInfo(SystemMemoryInfoKB *meminfo) { + unsigned int mem_total, mem_free, swap_total, swap_used; + size_t length; + int pagesizeKB; + + pagesizeKB = getpagesize() / 1024; + + length = sizeof(mem_total); + if (sysctlbyname("vm.stats.vm.v_page_count", &mem_total, + &length, NULL, 0) != 0 || length != sizeof(mem_total)) + return false; + + length = sizeof(mem_free); + if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &length, NULL, 0) + != 0 || length != sizeof(mem_free)) + return false; + + length = sizeof(swap_total); + if (sysctlbyname("vm.swap_size", &swap_total, &length, NULL, 0) + != 0 || length != sizeof(swap_total)) + return false; + + length = sizeof(swap_used); + if (sysctlbyname("vm.swap_anon_use", &swap_used, &length, NULL, 0) + != 0 || length != sizeof(swap_used)) + return false; + + meminfo->total = mem_total * pagesizeKB; + meminfo->free = mem_free * pagesizeKB; + meminfo->swap_total = swap_total * pagesizeKB; + meminfo->swap_free = (swap_total - swap_used) * pagesizeKB; + + return true; +} + +int ProcessMetrics::GetOpenFdCount() const { + struct kinfo_file * kif; + int cnt; + + if ((kif = kinfo_getfile(process_, &cnt)) == NULL) + return -1; + + free(kif); + + return cnt; +} + +int ProcessMetrics::GetOpenFdSoftLimit() const { + size_t length; + int total_count = 0; + int mib[] = { CTL_KERN, KERN_MAXFILESPERPROC }; + + length = sizeof(total_count); + -+ if (sysctl(mib, base::size(mib), &total_count, &length, NULL, 0) < 0) { ++ if (sysctl(mib, std::size(mib), &total_count, &length, NULL, 0) < 0) { + total_count = -1; + } + + return total_count; +} + +size_t ProcessMetrics::GetResidentSetSize() const { + kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open"); + + if (kd == nullptr) + return 0; + + struct kinfo_proc *pp; + int nproc; + + if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) { + kvm_close(kd); + return 0; + } + + size_t rss; + + if (nproc > 0) { + rss = pp->ki_rssize << GetPageShift(); + } else { + rss = 0; + } + + kvm_close(kd); + return rss; +} + +uint64_t ProcessMetrics::GetVmSwapBytes() const { + kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open"); + + if (kd == nullptr) + return 0; + + struct kinfo_proc *pp; + int nproc; + + if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) { + kvm_close(kd); + return 0; + } + + size_t swrss; + + if (nproc > 0) { + swrss = pp->ki_swrss > pp->ki_rssize + ? (pp->ki_swrss - pp->ki_rssize) << GetPageShift() + : 0; + } else { + swrss = 0; + } + + kvm_close(kd); + return swrss; +} + +int ProcessMetrics::GetIdleWakeupsPerSecond() { + NOTIMPLEMENTED(); + return 0; +} + +bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) { + NOTIMPLEMENTED(); + return false; +} + +bool GetVmStatInfo(VmStatInfo* vmstat) { + NOTIMPLEMENTED(); + return false; +} + +SystemDiskInfo::SystemDiskInfo() { + reads = 0; + reads_merged = 0; + sectors_read = 0; + read_time = 0; + writes = 0; + writes_merged = 0; + sectors_written = 0; + write_time = 0; + io = 0; + io_time = 0; + weighted_io_time = 0; +} + +SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default; + +SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default; + +Value SystemDiskInfo::ToValue() const { + Value res(Value::Type::DICTIONARY); + + // Write out uint64_t variables as doubles. + // Note: this may discard some precision, but for JS there's no other option. + res.SetDoubleKey("reads", static_cast(reads)); + res.SetDoubleKey("reads_merged", static_cast(reads_merged)); + res.SetDoubleKey("sectors_read", static_cast(sectors_read)); + res.SetDoubleKey("read_time", static_cast(read_time)); + res.SetDoubleKey("writes", static_cast(writes)); + res.SetDoubleKey("writes_merged", static_cast(writes_merged)); + res.SetDoubleKey("sectors_written", static_cast(sectors_written)); + res.SetDoubleKey("write_time", static_cast(write_time)); + res.SetDoubleKey("io", static_cast(io)); + res.SetDoubleKey("io_time", static_cast(io_time)); + res.SetDoubleKey("weighted_io_time", static_cast(weighted_io_time)); + + return res; +} + +Value SystemMemoryInfoKB::ToValue() const { + Value res(Value::Type::DICTIONARY); + + res.SetIntKey("total", total); + res.SetIntKey("free", free); + res.SetIntKey("available", available); + res.SetIntKey("buffers", buffers); + res.SetIntKey("cached", cached); + res.SetIntKey("active_anon", active_anon); + res.SetIntKey("inactive_anon", inactive_anon); + res.SetIntKey("active_file", active_file); + res.SetIntKey("inactive_file", inactive_file); + res.SetIntKey("swap_total", swap_total); + res.SetIntKey("swap_free", swap_free); + res.SetIntKey("swap_used", swap_total - swap_free); + res.SetIntKey("dirty", dirty); + res.SetIntKey("reclaimable", reclaimable); + + return res; +} + +Value VmStatInfo::ToValue() const { + Value res(Value::Type::DICTIONARY); + + res.SetIntKey("pswpin", pswpin); + res.SetIntKey("pswpout", pswpout); + res.SetIntKey("pgmajfault", pgmajfault); + + return res; +} } // namespace base diff --git a/www/chromium/files/patch-base_process_process__metrics__openbsd.cc b/www/chromium/files/patch-base_process_process__metrics__openbsd.cc index 97102c7e4f92..7cf86d373978 100644 --- a/www/chromium/files/patch-base_process_process__metrics__openbsd.cc +++ b/www/chromium/files/patch-base_process_process__metrics__openbsd.cc @@ -1,235 +1,212 @@ ---- base/process/process_metrics_openbsd.cc.orig 2022-03-25 21:59:56 UTC +--- base/process/process_metrics_openbsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_metrics_openbsd.cc -@@ -4,17 +4,36 @@ +@@ -6,14 +6,23 @@ - #include "base/process/process_metrics.h" - -+#include "base/files/file_util.h" -+#include "base/logging.h" -+#include "base/process/internal_linux.h" -+#include "base/strings/string_number_conversions.h" -+#include "base/strings/string_split.h" -+#include "base/strings/string_tokenizer.h" -+#include "base/strings/string_util.h" -+#include "base/system/sys_info.h" -+#include "base/threading/thread_restrictions.h" -+#include "base/notreached.h" -+ #include #include +#include #include #include +#include +#include + - #include "base/cxx17_backports.h" #include "base/memory/ptr_util.h" #include "base/process/process_metrics_iocounters.h" +#include "base/values.h" ++#include "base/notreached.h" namespace base { +ProcessMetrics::ProcessMetrics(ProcessHandle process) + : process_(process) {} + // static std::unique_ptr ProcessMetrics::CreateProcessMetrics( ProcessHandle process) { -@@ -25,49 +44,24 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun +@@ -24,49 +33,24 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun return false; } -static int GetProcessCPU(pid_t pid) { +double ProcessMetrics::GetPlatformIndependentCPUUsage() { struct kinfo_proc info; - size_t length; - int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, - sizeof(struct kinfo_proc), 0 }; + size_t length = sizeof(struct kinfo_proc); -- if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) < 0) +- if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) - return -1; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_, + sizeof(struct kinfo_proc), 1 }; - mib[5] = (length / sizeof(struct kinfo_proc)); -+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) +- + if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) +- return 0; + return 0.0; -- if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0) -- return 0; -- - return info.p_pctcpu; + return static_cast((info.p_pctcpu * 100.0) / FSCALE); } -double ProcessMetrics::GetPlatformIndependentCPUUsage() { - TimeTicks time = TimeTicks::Now(); - - if (last_cpu_time_.is_zero()) { - // First call, just set the last values. - last_cpu_time_ = time; - return 0; - } - - int cpu = GetProcessCPU(process_); - - last_cpu_time_ = time; - double percentage = static_cast((cpu * 100.0) / FSCALE); - - return percentage; -} - TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { NOTREACHED(); return TimeDelta(); } -ProcessMetrics::ProcessMetrics(ProcessHandle process) - : process_(process), - last_cpu_(0) {} - size_t GetSystemCommitCharge() { int mib[] = { CTL_VM, VM_METER }; int pagesize; -@@ -75,7 +69,7 @@ size_t GetSystemCommitCharge() { - unsigned long mem_total, mem_free, mem_inactive; - size_t len = sizeof(vmtotal); - -- if (sysctl(mib, base::size(mib), &vmtotal, &len, NULL, 0) < 0) -+ if (sysctl(mib, std::size(mib), &vmtotal, &len, NULL, 0) < 0) - return 0; - - mem_total = vmtotal.t_vm; -@@ -85,6 +79,129 @@ size_t GetSystemCommitCharge() { +@@ -84,6 +68,129 @@ size_t GetSystemCommitCharge() { pagesize = getpagesize(); return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize); +} + +int ProcessMetrics::GetOpenFdCount() const { + struct kinfo_file *files; + kvm_t *kd = NULL; + int total_count = 0; + char errbuf[_POSIX2_LINE_MAX]; + + if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL) + goto out; + + if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, process_, + sizeof(struct kinfo_file), &total_count)) == NULL) { + total_count = 0; + goto out; + } + + kvm_close(kd); + +out: + return total_count; +} + +int ProcessMetrics::GetOpenFdSoftLimit() const { + return GetMaxFds(); +} + +uint64_t ProcessMetrics::GetVmSwapBytes() const { + NOTIMPLEMENTED(); + return 0; +} + +bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { + NOTIMPLEMENTED_LOG_ONCE(); + return false; +} + +SystemDiskInfo::SystemDiskInfo() { + reads = 0; + reads_merged = 0; + sectors_read = 0; + read_time = 0; + writes = 0; + writes_merged = 0; + sectors_written = 0; + write_time = 0; + io = 0; + io_time = 0; + weighted_io_time = 0; +} + +SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default; + +bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) { + NOTIMPLEMENTED(); + return false; +} + +bool GetVmStatInfo(VmStatInfo* vmstat) { + NOTIMPLEMENTED(); + return false; +} + +int ProcessMetrics::GetIdleWakeupsPerSecond() { + NOTIMPLEMENTED(); + return 0; +} + +Value SystemMemoryInfoKB::ToValue() const { + Value res(Value::Type::DICTIONARY); + res.SetIntKey("total", total); + res.SetIntKey("free", free); + res.SetIntKey("available", available); + res.SetIntKey("buffers", buffers); + res.SetIntKey("cached", cached); + res.SetIntKey("active_anon", active_anon); + res.SetIntKey("inactive_anon", inactive_anon); + res.SetIntKey("active_file", active_file); + res.SetIntKey("inactive_file", inactive_file); + res.SetIntKey("swap_total", swap_total); + res.SetIntKey("swap_free", swap_free); + res.SetIntKey("swap_used", swap_total - swap_free); + res.SetIntKey("dirty", dirty); + res.SetIntKey("reclaimable", reclaimable); + + NOTIMPLEMENTED(); + + return res; +} + +Value VmStatInfo::ToValue() const { + Value res(Value::Type::DICTIONARY); + res.SetIntKey("pswpin", pswpin); + res.SetIntKey("pswpout", pswpout); + res.SetIntKey("pgmajfault", pgmajfault); + + NOTIMPLEMENTED(); + + return res; +} + +SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default; + +Value SystemDiskInfo::ToValue() const { + Value res(Value::Type::DICTIONARY); + + // Write out uint64_t variables as doubles. + // Note: this may discard some precision, but for JS there's no other option. + res.SetDoubleKey("reads", static_cast(reads)); + res.SetDoubleKey("reads_merged", static_cast(reads_merged)); + res.SetDoubleKey("sectors_read", static_cast(sectors_read)); + res.SetDoubleKey("read_time", static_cast(read_time)); + res.SetDoubleKey("writes", static_cast(writes)); + res.SetDoubleKey("writes_merged", static_cast(writes_merged)); + res.SetDoubleKey("sectors_written", static_cast(sectors_written)); + res.SetDoubleKey("write_time", static_cast(write_time)); + res.SetDoubleKey("io", static_cast(io)); + res.SetDoubleKey("io_time", static_cast(io_time)); + res.SetDoubleKey("weighted_io_time", static_cast(weighted_io_time)); + + NOTIMPLEMENTED(); + + return res; } } // namespace base diff --git a/www/chromium/files/patch-base_process_process__posix.cc b/www/chromium/files/patch-base_process_process__posix.cc index 98e1db005454..46fe9bf83464 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-03-25 21:59:56 UTC +--- base/process/process_posix.cc.orig 2022-04-21 18:48:31 UTC +++ base/process/process_posix.cc @@ -23,10 +23,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, 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 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 {} 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, base::size(mib), NULL, &info_size, NULL, 0) < 0) ++ 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, base::size(mib), info, &info_size, NULL, 0) < 0) ++ 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_system_sys__info__freebsd.cc b/www/chromium/files/patch-base_system_sys__info__freebsd.cc index 143fb26b294b..99ff948c012b 100644 --- a/www/chromium/files/patch-base_system_sys__info__freebsd.cc +++ b/www/chromium/files/patch-base_system_sys__info__freebsd.cc @@ -1,113 +1,113 @@ ---- base/system/sys_info_freebsd.cc.orig 2022-03-25 21:59:56 UTC +--- base/system/sys_info_freebsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/system/sys_info_freebsd.cc @@ -9,30 +9,106 @@ #include #include "base/notreached.h" +#include "base/process/process_metrics.h" +#include "base/strings/string_util.h" namespace base { +int SysInfo::NumberOfProcessors() { + int mib[] = {CTL_HW, HW_NCPU}; + int ncpu; + size_t size = sizeof(ncpu); -+ if (sysctl(mib, base::size(mib), &ncpu, &size, NULL, 0) < 0) { ++ if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) { + NOTREACHED(); + return 1; + } + return ncpu; +} + int64_t SysInfo::AmountOfPhysicalMemoryImpl() { - int pages, page_size; + int pages, page_size, r = 0; size_t size = sizeof(pages); - sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0); - sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0); - if (pages == -1 || page_size == -1) { + + if (r == 0) + r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0); + if (r == 0) + r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0); + + if (r == -1) { NOTREACHED(); return 0; } + return static_cast(pages) * page_size; } +int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() { + int page_size, r = 0; + unsigned int pgfree, pginact, pgcache; + size_t size = sizeof(page_size); + size_t szpg = sizeof(pgfree); + + if (r == 0) + r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0); + if (r == 0) + r = sysctlbyname("vm.stats.vm.v_free_count", &pgfree, &szpg, NULL, 0); + if (r == 0) + r = sysctlbyname("vm.stats.vm.v_inactive_count", &pginact, &szpg, NULL, 0); + if (r == 0) + r = sysctlbyname("vm.stats.vm.v_cache_count", &pgcache, &szpg, NULL, 0); + + if (r == -1) { + NOTREACHED(); + return 0; + } + + return static_cast((pgfree + pginact + pgcache) * page_size); +} + // static +int64_t SysInfo::AmountOfAvailablePhysicalMemory(const SystemMemoryInfoKB& info) { + int64_t res_kb = info.available != 0 + ? info.available - info.active_file + : info.free + info.reclaimable + info.inactive_file; + return res_kb * 1024; +} + +// static +std::string SysInfo::CPUModelName() { + int mib[] = { CTL_HW, HW_MODEL }; + char name[256]; -+ size_t size = base::size(name); ++ size_t size = std::size(name); + -+ if (sysctl(mib, base::size(mib), &name, &size, NULL, 0) == 0) { ++ if (sysctl(mib, std::size(mib), &name, &size, NULL, 0) == 0) { + return name; + } + + return std::string(); +} + +// static uint64_t SysInfo::MaxSharedMemorySize() { size_t limit; size_t size = sizeof(limit); + if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) { NOTREACHED(); return 0; } + return static_cast(limit); +} + +SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() { + HardwareInfo info; + + info.manufacturer = "FreeBSD"; + info.model = HardwareModelName(); + + DCHECK(IsStringUTF8(info.manufacturer)); + DCHECK(IsStringUTF8(info.model)); + + return info; } } // namespace base diff --git a/www/chromium/files/patch-base_system_sys__info__openbsd.cc b/www/chromium/files/patch-base_system_sys__info__openbsd.cc index 895f93683f73..54d7442406af 100644 --- a/www/chromium/files/patch-base_system_sys__info__openbsd.cc +++ b/www/chromium/files/patch-base_system_sys__info__openbsd.cc @@ -1,102 +1,94 @@ ---- base/system/sys_info_openbsd.cc.orig 2022-03-25 21:59:56 UTC +--- base/system/sys_info_openbsd.cc.orig 2022-04-21 18:48:31 UTC +++ base/system/sys_info_openbsd.cc -@@ -12,6 +12,7 @@ +@@ -11,6 +11,7 @@ + #include - #include "base/cxx17_backports.h" #include "base/notreached.h" +#include "base/strings/string_util.h" namespace { -@@ -29,9 +30,15 @@ int64_t AmountOfMemory(int pages_name) { +@@ -28,9 +29,15 @@ int64_t AmountOfMemory(int pages_name) { namespace base { +// pledge(2) +int64_t aofpmem = 0; +int64_t aofapmem = 0; +int64_t shmmax = 0; +char cpumodel[256]; + // static int SysInfo::NumberOfProcessors() { - int mib[] = {CTL_HW, HW_NCPU}; + int mib[] = {CTL_HW, HW_NCPUONLINE}; int ncpu; size_t size = sizeof(ncpu); - if (sysctl(mib, base::size(mib), &ncpu, &size, NULL, 0) < 0) { -@@ -43,38 +50,62 @@ int SysInfo::NumberOfProcessors() { + if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) { +@@ -42,10 +49,26 @@ int SysInfo::NumberOfProcessors() { // static int64_t SysInfo::AmountOfPhysicalMemoryImpl() { - return AmountOfMemory(_SC_PHYS_PAGES); + // pledge(2) + if (!aofpmem) + aofpmem = AmountOfMemory(_SC_PHYS_PAGES); + return aofpmem; } - // static - int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() { - // We should add inactive file-backed memory also but there is no such - // information from OpenBSD unfortunately. -- return AmountOfMemory(_SC_AVPHYS_PAGES); -+ // pledge(2) -+ if (!aofapmem) -+ aofapmem = AmountOfMemory(_SC_AVPHYS_PAGES); -+ return aofapmem; - } - // static +std::string SysInfo::CPUModelName() { + int mib[] = {CTL_HW, HW_MODEL}; -+ size_t len = base::size(cpumodel); ++ size_t len = std::size(cpumodel); + + if (cpumodel[0] == '\0') { -+ if (sysctl(mib, base::size(mib), cpumodel, &len, NULL, 0) < 0) ++ if (sysctl(mib, std::size(mib), cpumodel, &len, NULL, 0) < 0) + return std::string(); + } + + return std::string(cpumodel, len - 1); +} + +// static - uint64_t SysInfo::MaxSharedMemorySize() { + int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() { + // We should add inactive file-backed memory also but there is no such + // information from OpenBSD unfortunately. +@@ -57,23 +80,28 @@ uint64_t SysInfo::MaxSharedMemorySize() { int mib[] = {CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX}; size_t limit; size_t size = sizeof(limit); + // pledge(2) + if (shmmax) + goto out; - if (sysctl(mib, base::size(mib), &limit, &size, NULL, 0) < 0) { + if (sysctl(mib, std::size(mib), &limit, &size, NULL, 0) < 0) { NOTREACHED(); return 0; } - return static_cast(limit); + shmmax = static_cast(limit); +out: + return shmmax; } // static -std::string SysInfo::CPUModelName() { - int mib[] = {CTL_HW, HW_MODEL}; - char name[256]; -- size_t len = base::size(name); -- if (sysctl(mib, base::size(mib), name, &len, NULL, 0) < 0) { +- size_t len = std::size(name); +- if (sysctl(mib, std::size(mib), name, &len, NULL, 0) < 0) { - NOTREACHED(); - return std::string(); - } - return name; +SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() { + HardwareInfo info; + // Set the manufacturer to "OpenBSD" and the model to + // an empty string. + info.manufacturer = "OpenBSD"; + info.model = HardwareModelName(); + DCHECK(IsStringUTF8(info.manufacturer)); + DCHECK(IsStringUTF8(info.model)); + return info; } } // namespace base diff --git a/www/chromium/files/patch-build_config_BUILDCONFIG.gn b/www/chromium/files/patch-build_config_BUILDCONFIG.gn index d80e17aa728c..d0508a977723 100644 --- a/www/chromium/files/patch-build_config_BUILDCONFIG.gn +++ b/www/chromium/files/patch-build_config_BUILDCONFIG.gn @@ -1,45 +1,45 @@ ---- build/config/BUILDCONFIG.gn.orig 2022-02-07 13:39:41 UTC +--- build/config/BUILDCONFIG.gn.orig 2022-04-21 18:48:31 UTC +++ build/config/BUILDCONFIG.gn @@ -136,7 +136,8 @@ declare_args() { is_official_build = false # Set to true when compiling with the Clang compiler. - is_clang = current_os != "linux" || + is_clang = current_os != "linux" || current_os == "openbsd" || + current_os == "freebsd" || (current_cpu != "s390x" && current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64" && -@@ -218,6 +219,10 @@ if (host_toolchain == "") { +@@ -220,6 +221,10 @@ if (host_toolchain == "") { host_toolchain = "//build/toolchain/aix:$host_cpu" } else if (host_os == "zos") { host_toolchain = "//build/toolchain/zos:$host_cpu" + } else if (host_os == "openbsd") { + host_toolchain = "//build/toolchain/openbsd:clang_$host_cpu" + } else if (host_os == "freebsd") { + host_toolchain = "//build/toolchain/freebsd:clang_$host_cpu" } else { assert(false, "Unsupported host_os: $host_os") } -@@ -262,6 +267,8 @@ if (target_os == "android") { +@@ -264,6 +269,8 @@ if (target_os == "android") { _default_toolchain = "//build/toolchain/aix:$target_cpu" } else if (target_os == "zos") { _default_toolchain = "//build/toolchain/zos:$target_cpu" +} else if (target_os == "openbsd" || target_os == "freebsd") { + _default_toolchain = host_toolchain } else { assert(false, "Unsupported target_os: $target_os") } -@@ -296,7 +303,11 @@ is_android = current_os == "android" +@@ -298,7 +305,11 @@ is_android = current_os == "android" is_chromeos = current_os == "chromeos" is_fuchsia = current_os == "fuchsia" is_ios = current_os == "ios" -is_linux = current_os == "linux" +is_linux = current_os == "linux" || current_os == "openbsd" || + current_os == "freebsd" +is_openbsd = current_os == "openbsd" +is_freebsd = current_os == "freebsd" +is_bsd = current_os == "openbsd" || current_os == "freebsd" is_mac = current_os == "mac" is_nacl = current_os == "nacl" is_win = current_os == "win" || current_os == "winuwp" diff --git a/www/chromium/files/patch-build_config_compiler_BUILD.gn b/www/chromium/files/patch-build_config_compiler_BUILD.gn index badfeff900d0..8d5e73144bbf 100644 --- a/www/chromium/files/patch-build_config_compiler_BUILD.gn +++ b/www/chromium/files/patch-build_config_compiler_BUILD.gn @@ -1,113 +1,119 @@ ---- build/config/compiler/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- build/config/compiler/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ build/config/compiler/BUILD.gn @@ -236,13 +236,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") { } } + 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") { 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 -@@ -908,7 +915,7 @@ config("compiler_cpu_abi") { +@@ -917,7 +924,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" ] } -@@ -922,7 +929,7 @@ config("compiler_cpu_abi") { +@@ -931,7 +938,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" ] } -@@ -1243,7 +1250,7 @@ config("compiler_deterministic") { +@@ -1252,7 +1259,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", -@@ -1533,7 +1540,7 @@ config("default_warnings") { +@@ -1542,12 +1549,12 @@ 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" ] } -@@ -1725,7 +1732,7 @@ config("no_chromium_code") { +@@ -1740,7 +1747,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", -@@ -2239,7 +2246,7 @@ config("afdo_optimize_size") { +@@ -2254,7 +2261,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. -@@ -2255,7 +2262,7 @@ config("afdo") { +@@ -2270,7 +2277,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 ] } -@@ -2398,7 +2405,8 @@ config("symbols") { +@@ -2413,7 +2420,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_linux_unbundle_libxml.gn b/www/chromium/files/patch-build_linux_unbundle_libxml.gn new file mode 100644 index 000000000000..37cfca7fbd71 --- /dev/null +++ b/www/chromium/files/patch-build_linux_unbundle_libxml.gn @@ -0,0 +1,10 @@ +--- build/linux/unbundle/libxml.gn.orig 2022-04-21 18:48:31 UTC ++++ build/linux/unbundle/libxml.gn +@@ -19,6 +19,7 @@ static_library("libxml_utils") { + ":xml_reader", + ":xml_writer", + "//base/test:test_support", ++ "//services/data_decoder:lib", + "//services/data_decoder:xml_parser_fuzzer_deps", + ] + sources = [ diff --git a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni index 794335e0a1e6..55c8ddbde6d4 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-03-25 21:59:56 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2022-04-21 18:48:31 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). # -@@ -771,13 +778,12 @@ template("gcc_toolchain") { +@@ -780,13 +787,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-cc_BUILD.gn b/www/chromium/files/patch-cc_BUILD.gn index 34a6a620a314..1812b54d7afc 100644 --- a/www/chromium/files/patch-cc_BUILD.gn +++ b/www/chromium/files/patch-cc_BUILD.gn @@ -1,19 +1,19 @@ ---- cc/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- cc/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ cc/BUILD.gn -@@ -664,7 +664,7 @@ cc_test_static_library("test_support") { +@@ -665,7 +665,7 @@ cc_test_static_library("test_support") { if (enable_vulkan) { deps += [ "//gpu/vulkan/init" ] } - if (!is_android) { + if (!is_android && !is_bsd) { data_deps = [ "//third_party/mesa_headers" ] } } -@@ -891,7 +891,6 @@ cc_test("cc_unittests") { +@@ -893,7 +893,6 @@ cc_test("cc_unittests") { data = [ "//components/viz/test/data/" ] data_deps = [ "//testing/buildbot/filters:cc_unittests_filters", - "//third_party/mesa_headers", ] if (is_android && enable_chrome_android_internal) { diff --git a/www/chromium/files/patch-chrome_app_chrome__command__ids.h b/www/chromium/files/patch-chrome_app_chrome__command__ids.h index 34fe446304f1..cf79191cac1c 100644 --- a/www/chromium/files/patch-chrome_app_chrome__command__ids.h +++ b/www/chromium/files/patch-chrome_app_chrome__command__ids.h @@ -1,11 +1,20 @@ ---- chrome/app/chrome_command_ids.h.orig 2022-02-28 16:54:41 UTC +--- chrome/app/chrome_command_ids.h.orig 2022-04-21 18:48:31 UTC +++ chrome/app/chrome_command_ids.h @@ -66,7 +66,7 @@ #define IDC_NAME_WINDOW 34049 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #define IDC_USE_SYSTEM_TITLE_BAR 34051 #define IDC_RESTORE_WINDOW 34052 #endif +@@ -447,7 +447,7 @@ + #define IDC_CONTENT_CONTEXT_QUICK_ANSWERS_INLINE_QUERY 52414 + #endif + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + // Screen AI + #define IDC_RUN_SCREEN_AI 52420 + #endif 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 d8ca4ff70b5a..84dcfc4d098e 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-03-25 21:59:56 UTC +--- chrome/app/chrome_main_delegate.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/app/chrome_main_delegate.cc @@ -114,7 +114,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 @@ #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 -@@ -311,7 +311,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty +@@ -307,7 +307,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 -@@ -351,7 +351,7 @@ bool HandleVersionSwitches(const base::CommandLine& co +@@ -347,7 +347,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) || -@@ -415,7 +415,7 @@ void InitializeUserDataDir(base::CommandLine* command_ +@@ -411,7 +411,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. -@@ -499,7 +499,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat +@@ -495,7 +495,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( -@@ -680,6 +680,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization( +@@ -676,6 +676,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 -@@ -815,7 +817,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -813,7 +815,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 -@@ -846,7 +848,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -844,7 +846,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 -@@ -1161,7 +1163,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1159,7 +1161,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) -@@ -1237,7 +1239,7 @@ absl::variant Chrome +@@ -1229,7 +1231,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 bc279203ed4e..8fe11684dc60 100644 --- a/www/chromium/files/patch-chrome_app_chromium__strings.grd +++ b/www/chromium/files/patch-chrome_app_chromium__strings.grd @@ -1,29 +1,29 @@ ---- chrome/app/chromium_strings.grd.orig 2022-03-25 21:59:56 UTC +--- chrome/app/chromium_strings.grd.orig 2022-04-21 18:48:31 UTC +++ chrome/app/chromium_strings.grd -@@ -298,7 +298,7 @@ If you update this file, be sure also to update google +@@ -294,7 +294,7 @@ If you update this file, be sure also to update google Welcome to Chromium; new browser window opened - + Welcome to Chromium -@@ -818,7 +818,7 @@ Permissions you've already given to websites and apps +@@ -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. -@@ -944,7 +944,7 @@ Permissions you've already given to websites and apps +@@ -941,7 +941,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 55cbf9d5130f..c15631103b44 100644 --- a/www/chromium/files/patch-chrome_app_generated__resources.grd +++ b/www/chromium/files/patch-chrome_app_generated__resources.grd @@ -1,56 +1,56 @@ ---- chrome/app/generated_resources.grd.orig 2022-03-25 21:59:56 UTC +--- chrome/app/generated_resources.grd.orig 2022-04-21 18:48:31 UTC +++ chrome/app/generated_resources.grd @@ -2,7 +2,7 @@ -@@ -298,7 +298,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -293,7 +293,7 @@ are declared in tools/grit/grit_rule.gni. - + -@@ -2833,7 +2833,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -2836,7 +2836,7 @@ are declared in tools/grit/grit_rule.gni. - + Device Credentials -@@ -5686,7 +5686,7 @@ Keep your key file in a safe place. You will need it t +@@ -5728,7 +5728,7 @@ Keep your key file in a safe place. You will need it t - + Legacy Browser Support -@@ -8217,7 +8217,7 @@ Keep your key file in a safe place. You will need it t +@@ -8322,7 +8322,7 @@ Keep your key file in a safe place. You will need it t Google Pay - + Use system title bar and borders -@@ -9372,7 +9372,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -9477,7 +9477,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 953d11ffebcf..a05b2e4cec05 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,29 @@ ---- chrome/app/google_chrome_strings.grd.orig 2022-03-25 21:59:56 UTC +--- chrome/app/google_chrome_strings.grd.orig 2022-04-21 18:48:31 UTC +++ chrome/app/google_chrome_strings.grd -@@ -303,7 +303,7 @@ chromium_strings.grd. --> +@@ -299,7 +299,7 @@ chromium_strings.grd. --> Welcome to Chrome; new browser window opened - + Welcome to Google Chrome -@@ -863,7 +863,7 @@ Permissions you've already given to websites and apps +@@ -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. -@@ -1012,7 +1012,7 @@ Permissions you've already given to websites and apps +@@ -1008,7 +1008,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_theme_chrome__unscaled__resources.grd b/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd index ddf87266e214..77b1c7981089 100644 --- a/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd +++ b/www/chromium/files/patch-chrome_app_theme_chrome__unscaled__resources.grd @@ -1,32 +1,32 @@ ---- chrome/app/theme/chrome_unscaled_resources.grd.orig 2022-03-25 21:59:56 UTC +--- chrome/app/theme/chrome_unscaled_resources.grd.orig 2022-04-21 18:48:31 UTC +++ chrome/app/theme/chrome_unscaled_resources.grd @@ -15,12 +15,12 @@ - + - + -@@ -52,12 +52,12 @@ +@@ -53,12 +53,12 @@ - + - + diff --git a/www/chromium/files/patch-chrome_browser_about__flags.cc b/www/chromium/files/patch-chrome_browser_about__flags.cc index 6fc32f4e0118..127ba1a18a9a 100644 --- a/www/chromium/files/patch-chrome_browser_about__flags.cc +++ b/www/chromium/files/patch-chrome_browser_about__flags.cc @@ -1,128 +1,119 @@ ---- chrome/browser/about_flags.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/about_flags.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/about_flags.cc -@@ -206,7 +206,7 @@ +@@ -205,7 +205,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 -@@ -275,7 +275,7 @@ +@@ -277,7 +277,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) -@@ -362,7 +362,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = { +@@ -364,7 +364,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, -@@ -976,7 +976,7 @@ const FeatureEntry::FeatureVariation kPageContentAnnot +@@ -1047,7 +1047,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"}, -@@ -3424,7 +3424,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3520,7 +3520,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, -@@ -3838,7 +3838,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -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, -@@ -4031,7 +4031,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4138,7 +4138,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, MULTI_VALUE_TYPE(kOzonePlatformHintRuntimeChoices)}, -@@ -4050,7 +4050,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4157,7 +4157,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, -@@ -4760,7 +4760,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4886,7 +4886,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, -@@ -5158,7 +5158,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -5299,7 +5299,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)}, -@@ -6198,7 +6198,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6363,7 +6363,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, -@@ -6912,7 +6912,7 @@ const FeatureEntry kFeatureEntries[] = { - #endif - - #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - {"incognito-clear-browsing-data-dialog-for-desktop", - flag_descriptions::kIncognitoClearBrowsingDataDialogForDesktopName, - flag_descriptions::kIncognitoClearBrowsingDataDialogForDesktopDescription, -@@ -7037,7 +7037,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7230,7 +7230,7 @@ const FeatureEntry kFeatureEntries[] = { #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - {"commander", flag_descriptions::kCommanderName, - flag_descriptions::kCommanderDescription, kOsDesktop, - FEATURE_VALUE_TYPE(features::kCommander)}, -@@ -7291,7 +7291,7 @@ const FeatureEntry kFeatureEntries[] = { + {"quick-commands", flag_descriptions::kQuickCommandsName, + flag_descriptions::kQuickCommandsDescription, kOsDesktop, + FEATURE_VALUE_TYPE(features::kQuickCommands)}, +@@ -7536,7 +7536,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_apps_platform__apps_api_music__manager__private_device__id__linux.cc b/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc index 3b4e28b819a9..44576274c06e 100644 --- a/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc +++ b/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc @@ -1,71 +1,71 @@ ---- chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc @@ -4,6 +4,15 @@ #include "chrome/browser/apps/platform_apps/api/music_manager_private/device_id.h" +#include "build/build_config.h" + +#if defined(OS_BSD) +#include +#include +#include +#include +#endif + #include #include #include -@@ -106,11 +115,33 @@ class MacAddressProcessor { +@@ -105,11 +114,33 @@ class MacAddressProcessor { const char* const prefixes[], size_t prefixes_count) { const int MAC_LENGTH = 6; +#if defined(OS_BSD) + struct ifaddrs *ifap, *ifinfo; +#else struct ifreq ifinfo; +#endif memset(&ifinfo, 0, sizeof(ifinfo)); - strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1); +#if defined(OS_BSD) + int result = getifaddrs(&ifap); + if (result != 0) + return true; + result = 1; // no MAC found yet + for (ifinfo = ifap; ifinfo != NULL; ifinfo = ifinfo->ifa_next) { + struct sockaddr* sa = ifinfo->ifa_addr; + if (sa->sa_family == AF_LINK && + !strncmp(ifinfo->ifa_name, ifaddr->ifa_name, + sizeof(ifinfo->ifa_name) - 1)) { + result = 0; + break; + } + } + + char mac_address[6]; + strncpy(mac_address, (const char*)LLADDR((struct sockaddr_dl*)ifinfo->ifa_addr), sizeof(mac_address)); +#else + strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1); int sd = socket(AF_INET, SOCK_DGRAM, 0); int result = ioctl(sd, SIOCGIFHWADDR, &ifinfo); close(sd); -@@ -120,11 +151,17 @@ class MacAddressProcessor { +@@ -119,11 +150,17 @@ class MacAddressProcessor { const char* mac_address = static_cast(ifinfo.ifr_hwaddr.sa_data); +#endif if (!is_valid_mac_address_.Run(mac_address, MAC_LENGTH)) return true; +#if defined(OS_BSD) + if (!IsValidPrefix(ifinfo->ifa_name, prefixes, prefixes_count)) + return true; +#else if (!IsValidPrefix(ifinfo.ifr_name, prefixes, prefixes_count)) return true; +#endif // Got one! found_mac_address_ = diff --git a/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc b/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc index 914a8f443f2c..6dd743db9c34 100644 --- a/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc +++ b/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc @@ -1,20 +1,20 @@ ---- chrome/browser/apps/platform_apps/platform_app_launch.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/apps/platform_apps/platform_app_launch.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/apps/platform_apps/platform_app_launch.cc -@@ -18,7 +18,7 @@ - #include "extensions/common/constants.h" +@@ -19,7 +19,7 @@ #include "extensions/common/extension.h" --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_window.h" -@@ -121,7 +121,7 @@ bool OpenExtensionApplicationTab(Profile* profile, con - return app_tab != nullptr; +@@ -124,7 +124,7 @@ bool OpenExtensionApplicationTab(Profile* profile, con } --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) bool OpenDeprecatedApplicationPrompt(Profile* profile, const std::string& app_id) { if (!extensions::IsExtensionUnsupportedDeprecatedApp(profile, app_id)) diff --git a/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc b/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc index 9d687d026580..ce52b29e9679 100644 --- a/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc +++ b/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc @@ -1,11 +1,11 @@ ---- chrome/browser/background/background_mode_manager.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/background/background_mode_manager.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/background/background_mode_manager.cc -@@ -899,7 +899,7 @@ gfx::ImageSkia GetStatusTrayIcon() { +@@ -900,7 +900,7 @@ gfx::ImageSkia GetStatusTrayIcon() { return gfx::ImageSkia(); return family->CreateExact(size).AsImageSkia(); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( IDR_PRODUCT_LOGO_128); #elif BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-chrome_browser_browser__process__impl.cc b/www/chromium/files/patch-chrome_browser_browser__process__impl.cc index 3b29a504fb43..0a13c4003a0e 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-03-25 21:59:56 UTC +--- chrome/browser/browser_process_impl.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/browser_process_impl.cc -@@ -208,7 +208,7 @@ +@@ -206,7 +206,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 -@@ -1157,7 +1157,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { +@@ -1155,7 +1155,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 -@@ -1412,7 +1412,7 @@ void BrowserProcessImpl::Unpin() { +@@ -1402,7 +1402,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__process__impl.h b/www/chromium/files/patch-chrome_browser_browser__process__impl.h index bb761eec2995..4b7342b9edb6 100644 --- a/www/chromium/files/patch-chrome_browser_browser__process__impl.h +++ b/www/chromium/files/patch-chrome_browser_browser__process__impl.h @@ -1,11 +1,11 @@ ---- chrome/browser/browser_process_impl.h.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/browser_process_impl.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/browser_process_impl.h -@@ -367,7 +367,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -366,7 +366,7 @@ class BrowserProcessImpl : public BrowserProcess, // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) base::RepeatingTimer autoupdate_timer_; // Gets called by autoupdate timer to see if browser needs restart and can be diff --git a/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc b/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc index d686bc4e03f0..ff340b9e9b9e 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__interface__binders.cc @@ -1,71 +1,98 @@ ---- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/chrome_browser_interface_binders.cc -@@ -96,13 +96,13 @@ +@@ -98,13 +98,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 -@@ -172,7 +172,7 @@ +@@ -174,7 +174,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" -@@ -665,7 +665,7 @@ void PopulateChromeFrameBinders( +@@ -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( #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)); -@@ -673,7 +673,7 @@ void PopulateChromeFrameBinders( +@@ -725,7 +725,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->GetParent()) { + render_frame_host->IsInPrimaryMainFrame()) { map->Add( -@@ -714,14 +714,14 @@ void PopulateChromeWebUIFrameBinders( +@@ -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( 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 -@@ -1040,7 +1040,7 @@ void PopulateChromeWebUIFrameBinders( +@@ -1114,7 +1114,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 829d7ef22170..c2f10d92ec7d 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-03-25 21:59:56 UTC +--- chrome/browser/chrome_browser_main.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/chrome_browser_main.cc -@@ -231,11 +231,11 @@ +@@ -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 -@@ -270,7 +270,7 @@ +@@ -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" -@@ -1007,7 +1007,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1006,7 +1006,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { AddFirstRunNewTabs(browser_creator_.get(), 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 . -@@ -1020,7 +1020,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1019,7 +1019,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( -@@ -1041,7 +1041,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1040,7 +1040,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 39e734ef53d2..6d6fff8f940a 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,159 +1,150 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/chrome_content_browser_client.cc -@@ -374,7 +374,7 @@ +@@ -377,7 +377,7 @@ #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" -@@ -444,17 +444,17 @@ +@@ -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" -@@ -462,12 +462,12 @@ +@@ -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) -@@ -489,11 +489,11 @@ +@@ -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" -@@ -880,7 +880,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo +@@ -883,7 +883,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; -@@ -1376,7 +1376,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1400,7 +1400,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) -@@ -1410,7 +1410,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1434,7 +1434,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 -@@ -1427,7 +1427,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1451,7 +1451,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()); -@@ -2101,7 +2101,7 @@ bool ChromeContentBrowserClient::AreDirectSocketsAllow - Profile* profile = Profile::FromBrowserContext(context); - return profile && profile->GetPrefs()->GetBoolean( - policy::policy_prefs::kEnableDirectSockets); --#elif BUILDFLAG(IS_LINUX) -+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - // There are currently no reliable way to determine managed status on Linux. - return false; - #elif BUILDFLAG(IS_MAC) -@@ -2190,6 +2190,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2200,6 +2200,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()) { -@@ -2498,7 +2500,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2519,7 +2521,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) // 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)) { -@@ -3880,7 +3882,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +@@ -3912,7 +3914,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, -@@ -4292,14 +4294,14 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4318,14 +4320,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); -@@ -4332,7 +4334,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4358,7 +4360,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_download_chrome__download__manager__delegate.cc b/www/chromium/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc index 61865d43000d..90e0d59a8064 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-03-25 21:59:56 UTC +--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/download/chrome_download_manager_delegate.cc -@@ -1541,7 +1541,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1540,7 +1540,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 -@@ -1610,7 +1610,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1609,7 +1609,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(); } -@@ -1718,7 +1718,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow +@@ -1717,7 +1717,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()) { -@@ -1760,7 +1760,7 @@ std::unique_ptr +@@ -1759,7 +1759,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 -@@ -1776,7 +1776,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAl +@@ -1775,7 +1775,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) - if (!base::FeatureList::IsEnabled( - download::features::kAllowSavePackageScanning)) { - std::move(callback).Run(true); + absl::optional settings = + safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item); + diff --git a/www/chromium/files/patch-chrome_browser_download_download__commands.h b/www/chromium/files/patch-chrome_browser_download_download__commands.h index b06c4d936816..39e9bf4a1ce9 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__commands.h +++ b/www/chromium/files/patch-chrome_browser_download_download__commands.h @@ -1,11 +1,11 @@ ---- chrome/browser/download/download_commands.h.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/download/download_commands.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/download/download_commands.h -@@ -54,7 +54,7 @@ class DownloadCommands { +@@ -53,7 +53,7 @@ class DownloadCommands { void ExecuteCommand(Command command); #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) bool IsDownloadPdf() const; bool CanOpenPdfInSystemViewer() const; Browser* GetBrowser() const; diff --git a/www/chromium/files/patch-chrome_browser_download_download__file__picker.cc b/www/chromium/files/patch-chrome_browser_download_download__file__picker.cc new file mode 100644 index 000000000000..6ca1a47ba79b --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_download_download__file__picker.cc @@ -0,0 +1,20 @@ +--- chrome/browser/download/download_file_picker.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/download/download_file_picker.cc +@@ -14,7 +14,7 @@ + #include "content/public/browser/download_manager.h" + #include "content/public/browser/web_contents.h" + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "chrome/browser/ui/browser_finder.h" + #include "chrome/browser/ui/browser_window.h" + #include "ui/aura/window.h" +@@ -74,7 +74,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) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + if (!owning_window || !owning_window->GetHost()) + owning_window = + chrome::FindBrowserWithActiveWindow()->window()->GetNativeWindow(); 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 d7e0e1b8f2a4..3fd0a97eab3e 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-03-25 21:59:56 UTC +--- chrome/browser/download/download_item_model.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/download/download_item_model.cc -@@ -640,7 +640,7 @@ bool DownloadItemModel::IsCommandChecked( +@@ -660,7 +660,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(); -@@ -681,7 +681,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand +@@ -700,7 +700,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 11bfe5f3bdb7..d44f23417418 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-03-20 09:08:36 UTC +--- chrome/browser/download/download_prefs.cc.orig 2022-04-21 18:48:31 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 -@@ -287,7 +292,7 @@ void DownloadPrefs::RegisterProfilePrefs( - registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory, - default_download_path); +@@ -289,7 +294,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) -@@ -421,7 +426,7 @@ bool DownloadPrefs::IsDownloadPathManaged() const { +@@ -432,7 +437,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 -@@ -436,7 +441,7 @@ bool DownloadPrefs::IsAutoOpenEnabled(const GURL& url, +@@ -447,7 +452,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()) -@@ -491,7 +496,7 @@ void DownloadPrefs::DisableAutoOpenByUserBasedOnExtens +@@ -502,7 +507,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; -@@ -513,7 +518,7 @@ bool DownloadPrefs::ShouldOpenPdfInSystemReader() cons +@@ -524,7 +529,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(); -@@ -653,7 +658,14 @@ base::FilePath DownloadPrefs::SanitizeDownloadTargetPa +@@ -664,7 +669,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 7ad6d7876c19..3b9cdcce2bf0 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-02-28 16:54:41 UTC +--- chrome/browser/download/download_prefs.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/download/download_prefs.h -@@ -122,7 +122,7 @@ class DownloadPrefs { +@@ -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); -@@ -181,7 +181,7 @@ class DownloadPrefs { +@@ -184,7 +184,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_enterprise_connectors_device__trust_device__trust__service__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc index 62f759813b08..bec828731e01 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc @@ -1,11 +1,11 @@ ---- chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc -@@ -21,7 +21,7 @@ - #include "components/policy/content/policy_blocklist_service.h" +@@ -23,7 +23,7 @@ + #include "components/policy/core/common/management/management_service.h" #include "content/public/browser/browser_context.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/device_trust/attestation/desktop/desktop_attestation_service.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc new file mode 100644 index 000000000000..40dcf1b73df7 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc @@ -0,0 +1,20 @@ +--- chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc +@@ -13,7 +13,7 @@ + + #if BUILDFLAG(IS_WIN) + #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/win_key_rotation_command.h" +-#elif BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/linux_key_rotation_command.h" + #endif // BUILDFLAG(IS_WIN) + +@@ -43,7 +43,7 @@ std::unique_ptr KeyRotationCommand + scoped_refptr url_loader_factory) { + #if BUILDFLAG(IS_WIN) + return std::make_unique(); +-#elif BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + return std::make_unique( + std::move(url_loader_factory)); + #else diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc index e7c6c5dfc77e..39515bf1e22a 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc @@ -1,20 +1,20 @@ ---- chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc -@@ -14,7 +14,7 @@ - #include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service_impl.h" +@@ -15,7 +15,7 @@ #include "chrome/browser/profiles/profile.h" + #include "components/policy/core/common/management/management_service.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "base/check.h" #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" -@@ -44,7 +44,7 @@ std::unique_ptr CreateSignalsService( +@@ -52,7 +52,7 @@ std::unique_ptr CreateSignalsService( decorators.push_back( std::make_unique(policy_blocklist_service)); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) - policy::ChromeBrowserPolicyConnector* browser_policy_connector = - g_browser_process->browser_policy_connector(); - DCHECK(browser_policy_connector); + policy::CloudPolicyStore* store = nullptr; + + // Managed device. diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc b/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc index 446a4a0e514d..b70742d8aa83 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/extensions/api/settings_private/prefs_util.cc -@@ -182,7 +182,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -183,7 +183,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) (*s_allowlist)[::prefs::kUseCustomChromeFrame] = settings_api::PrefType::PREF_TYPE_BOOLEAN; #endif -@@ -196,7 +196,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -197,7 +197,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist settings_api::PrefType::PREF_TYPE_NUMBER; // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) (*s_allowlist)[::prefs::kUsesSystemTheme] = settings_api::PrefType::PREF_TYPE_BOOLEAN; #endif diff --git a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc index 7083102383fe..ffbb2e4afcf6 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-03-25 21:59:56 UTC +--- chrome/browser/flag_descriptions.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/flag_descriptions.cc -@@ -5508,7 +5508,7 @@ const char kDownloadShelfWebUIDescription[] = +@@ -5688,7 +5688,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[] = -@@ -5519,7 +5519,7 @@ const char kWebuiFeedbackDescription[] = +@@ -5699,7 +5699,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 kCommanderName[] = "Commander"; - const char kCommanderDescription[] = -@@ -5545,7 +5545,7 @@ const char kWebShareDescription[] = + const char kDesktopRestructuredLanguageSettingsName[] = + "Restructured Language Settings (Desktop)"; +@@ -5725,7 +5725,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"; -@@ -5557,7 +5557,7 @@ const char kOzonePlatformHintDescription[] = +@@ -5737,7 +5737,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[] = -@@ -5570,7 +5570,7 @@ const char kForcePasswordInitialSyncWhenDecryptionFail +@@ -5750,7 +5750,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."; -@@ -5687,7 +5687,7 @@ const char kElasticOverscrollDescription[] = +@@ -5867,7 +5867,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 c97e0e3503a5..eb4a09c1b6ac 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-03-25 21:59:56 UTC +--- chrome/browser/flag_descriptions.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/flag_descriptions.h -@@ -3178,7 +3178,7 @@ extern const char kDownloadShelfWebUIDescription[]; +@@ -3276,7 +3276,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[]; -@@ -3187,7 +3187,7 @@ extern const char kWebuiFeedbackDescription[]; +@@ -3285,7 +3285,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 kCommanderName[]; - extern const char kCommanderDescription[]; -@@ -3206,7 +3206,7 @@ extern const char kWebShareName[]; + extern const char kDesktopRestructuredLanguageSettingsName[]; + extern const char kDesktopRestructuredLanguageSettingsDescription[]; +@@ -3304,7 +3304,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[]; -@@ -3222,7 +3222,7 @@ extern const char kForcePasswordInitialSyncWhenDecrypt +@@ -3320,7 +3320,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) -@@ -3304,7 +3304,7 @@ extern const char kElasticOverscrollDescription[]; +@@ -3402,7 +3402,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_metrics_chrome__metrics__service__client.cc b/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc index 5fba581ad52d..00d3ad3d30ca 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-03-25 21:59:56 UTC +--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/metrics/chrome_metrics_service_client.cc -@@ -773,7 +773,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -769,7 +769,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()); -@@ -869,7 +869,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -859,7 +859,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) -@@ -1045,7 +1045,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve +@@ -1039,7 +1039,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 1a0c089e782a..2fb30b298577 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-03-25 21:59:56 UTC +--- chrome/browser/net/system_network_context_manager.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/net/system_network_context_manager.cc -@@ -84,7 +84,7 @@ +@@ -91,7 +91,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" -@@ -144,7 +144,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut +@@ -173,7 +173,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) -@@ -377,7 +377,7 @@ SystemNetworkContextManager::SystemNetworkContextManag +@@ -467,7 +467,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) -@@ -437,7 +437,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe +@@ -534,7 +534,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_performance__monitor_process__monitor.cc b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc index a5d771754212..7eb2ce3c9034 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,11 @@ ---- chrome/browser/performance_monitor/process_monitor.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/performance_monitor/process_monitor.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/performance_monitor/process_monitor.cc -@@ -82,7 +82,7 @@ ProcessMonitor::Metrics& operator+=(ProcessMonitor::Me +@@ -83,7 +83,7 @@ ProcessMonitor::Metrics& operator+=(ProcessMonitor::Me lhs.cpu_usage += rhs.cpu_usage; #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_policy_browser__signin__policy__handler.cc b/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc index 53796a9dfae2..f30a67d6cc52 100644 --- a/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc +++ b/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc @@ -1,11 +1,11 @@ ---- chrome/browser/policy/browser_signin_policy_handler.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/policy/browser_signin_policy_handler.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/policy/browser_signin_policy_handler.cc -@@ -43,7 +43,7 @@ void BrowserSigninPolicyHandler::ApplyPolicySettings(c - const base::Value* value = policies.GetValue(policy_name()); +@@ -44,7 +44,7 @@ void BrowserSigninPolicyHandler::ApplyPolicySettings(c + policies.GetValue(policy_name(), base::Value::Type::INTEGER); switch (static_cast(value->GetInt())) { case BrowserSigninMode::kForced: -#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) prefs->SetValue(prefs::kForceBrowserSignin, base::Value(true)); #endif [[fallthrough]]; 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 4866861223c6..446934d960d9 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,47 @@ ---- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2022-03-25 21:59:56 UTC +--- 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 -@@ -1456,7 +1456,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1473,7 +1473,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 }, -@@ -1565,7 +1565,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1582,7 +1582,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)) -+#if BUILDFLAG(ENABLE_EXTENSIONS) && (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) +-#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 }, -@@ -1885,7 +1885,7 @@ std::unique_ptr BuildH +@@ -1888,7 +1888,7 @@ std::unique_ptr BuildH #endif // BUILDFLAG(IS_ANDROID) #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>( -@@ -2256,7 +2256,7 @@ std::unique_ptr BuildH +@@ -2258,7 +2258,7 @@ std::unique_ptr BuildH SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED)); #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, -@@ -2287,7 +2287,7 @@ std::unique_ptr BuildH +@@ -2289,7 +2289,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( - std::make_unique(key::kAllowNativeNotifications, - prefs::kAllowNativeNotifications, + 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 93107a4cd271..1c10cfa7db70 100644 --- a/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc +++ b/www/chromium/files/patch-chrome_browser_prefs_browser__prefs.cc @@ -1,46 +1,37 @@ ---- chrome/browser/prefs/browser_prefs.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/prefs/browser_prefs.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/prefs/browser_prefs.cc -@@ -418,14 +418,14 @@ +@@ -423,14 +423,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 -@@ -1139,7 +1139,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) - // TODO(crbug/1169547) Remove `BUILDFLAG(IS_CHROMEOS_LACROS)` once the - // migration is complete. - #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ -- BUILDFLAG(IS_CHROMEOS_LACROS) -+ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) - enterprise_connectors::RegisterLocalPrefs(registry); - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) - -@@ -1171,7 +1171,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -1162,7 +1162,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 -@@ -1469,7 +1469,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync +@@ -1466,7 +1466,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_prefs_pref__service__incognito__allowlist.cc b/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc index 832e4f781f80..ea151f20f8b9 100644 --- a/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc +++ b/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc @@ -1,11 +1,11 @@ ---- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/prefs/pref_service_incognito_allowlist.cc -@@ -139,7 +139,7 @@ const char* const kPersistentPrefNames[] = { +@@ -138,7 +138,7 @@ const char* const kPersistentPrefNames[] = { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Toggleing custom frames affects all open windows in the profile, hence // should be written to the regular profile when changed in incognito mode. prefs::kUseCustomChromeFrame, diff --git a/www/chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc b/www/chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc new file mode 100644 index 000000000000..c04a0dd08d38 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_printing_print__backend__service__manager.cc @@ -0,0 +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 +@@ -420,7 +420,7 @@ uint32_t PrintBackendServiceManager::RegisterClient( + 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); + #endif + query_with_ui_clients_.insert(client_id); +@@ -644,7 +644,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 + 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 fbf6389c8630..3a87ff4df601 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-02-28 16:54:41 UTC +--- chrome/browser/printing/print_job_worker.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/printing/print_job_worker.cc -@@ -225,7 +225,7 @@ void PrintJobWorker::UpdatePrintSettings(base::Value n +@@ -220,7 +220,7 @@ void PrintJobWorker::UpdatePrintSettings(base::Value n 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_process__singleton__posix.cc b/www/chromium/files/patch-chrome_browser_process__singleton__posix.cc index dcd99fc83110..a9b497799e69 100644 --- a/www/chromium/files/patch-chrome_browser_process__singleton__posix.cc +++ b/www/chromium/files/patch-chrome_browser_process__singleton__posix.cc @@ -1,35 +1,35 @@ ---- chrome/browser/process_singleton_posix.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/process_singleton_posix.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/process_singleton_posix.cc -@@ -98,12 +98,12 @@ +@@ -96,12 +96,12 @@ #include "net/base/network_interfaces.h" #include "ui/base/l10n/l10n_util.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/process_singleton_dialog_linux.h" #endif #if defined(TOOLKIT_VIEWS) && \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) #include "ui/views/linux_ui/linux_ui.h" #endif -@@ -357,7 +357,7 @@ bool DisplayProfileInUseError(const base::FilePath& lo +@@ -355,7 +355,7 @@ bool DisplayProfileInUseError(const base::FilePath& lo if (g_disable_prompt) return g_user_opted_unlock_in_use_profile; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) std::u16string relaunch_button_text = l10n_util::GetStringUTF16(IDS_PROFILE_IN_USE_LINUX_RELAUNCH); return ShowProcessSingletonDialog(error, relaunch_button_text); -@@ -926,7 +926,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::Notif +@@ -924,7 +924,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::Notif return PROCESS_NONE; - } else if (strncmp(buf, kACKToken, base::size(kACKToken) - 1) == 0) { + } else if (strncmp(buf, kACKToken, std::size(kACKToken) - 1) == 0) { #if defined(TOOLKIT_VIEWS) && \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) // Likely NULL in unit tests. views::LinuxUI* linux_ui = views::LinuxUI::instance(); if (linux_ui) 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 16e823150f14..e6bd2cfbb3f0 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-03-25 21:59:56 UTC +--- 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 -@@ -393,7 +393,7 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -395,7 +395,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 1a9c1a209dd0..bd6ebd137dbb 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-03-25 21:59:56 UTC +--- chrome/browser/profiles/profile_impl.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/profiles/profile_impl.cc -@@ -263,6 +263,10 @@ +@@ -266,6 +266,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; -@@ -854,7 +858,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) +@@ -852,7 +856,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) } base::FilePath ProfileImpl::last_selected_directory() { +#if BUILDFLAG(IS_OPENBSD) + // If unveil(2) is used, force the file dialog directory to something we + // know is available. + auto* sandbox = sandbox::policy::SandboxLinux::GetInstance(); + if (sandbox->unveil_initialized()) + return GetPrefs()->GetFilePath(prefs::kDownloadDefaultDirectory); + else + return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); +#else return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); +#endif } void ProfileImpl::set_last_selected_directory(const base::FilePath& path) { diff --git a/www/chromium/files/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc b/www/chromium/files/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc index a49548e1d673..10916cbe3ae1 100644 --- a/www/chromium/files/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc +++ b/www/chromium/files/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc @@ -1,11 +1,11 @@ ---- chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc -@@ -709,7 +709,7 @@ void IncidentReportingService::OnEnvironmentDataCollec +@@ -708,7 +708,7 @@ void IncidentReportingService::OnEnvironmentDataCollec // Process::Current().CreationTime() is missing on some platforms. #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::TimeDelta uptime = first_incident_time_ - base::Process::Current().CreationTime(); environment_data->mutable_process()->set_uptime_msec(uptime.InMilliseconds()); diff --git a/www/chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc b/www/chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc index 67f14188e656..a3f57960398e 100644 --- a/www/chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc +++ b/www/chromium/files/patch-chrome_browser_sync_chrome__sync__client.cc @@ -1,11 +1,11 @@ ---- chrome/browser/sync/chrome_sync_client.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/sync/chrome_sync_client.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/sync/chrome_sync_client.cc -@@ -412,7 +412,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy +@@ -411,7 +411,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy // Chrome prefers OS provided spell checkers where they exist. So only sync the // custom dictionary on platforms that typically don't provide one. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) - // Dictionary sync is enabled by default. - if (GetPrefService()->GetBoolean(spellcheck::prefs::kSpellCheckEnable)) { - controllers.push_back( + // Dictionary sync is enabled by default. + if (GetPrefService()->GetBoolean(spellcheck::prefs::kSpellCheckEnable)) { + controllers.push_back( diff --git a/www/chromium/files/patch-chrome_browser_sync_device__info__sync__client__impl.cc b/www/chromium/files/patch-chrome_browser_sync_device__info__sync__client__impl.cc index 8b124e3d21f9..c04fa13da6b9 100644 --- a/www/chromium/files/patch-chrome_browser_sync_device__info__sync__client__impl.cc +++ b/www/chromium/files/patch-chrome_browser_sync_device__info__sync__client__impl.cc @@ -1,11 +1,11 @@ ---- chrome/browser/sync/device_info_sync_client_impl.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/sync/device_info_sync_client_impl.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/sync/device_info_sync_client_impl.cc -@@ -38,7 +38,7 @@ std::string DeviceInfoSyncClientImpl::GetSigninScopedD +@@ -40,7 +40,7 @@ std::string DeviceInfoSyncClientImpl::GetSigninScopedD // in lacros-chrome once build flag switch of lacros-chrome is // complete. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) syncer::SyncPrefs prefs(profile_->GetPrefs()); if (prefs.IsLocalSyncEnabled()) { return "local_device"; diff --git a/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc b/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc deleted file mode 100644 index 9c460e043f12..000000000000 --- a/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/themes/theme_helper.cc.orig 2022-03-25 21:59:56 UTC -+++ chrome/browser/themes/theme_helper.cc -@@ -297,7 +297,7 @@ bool ThemeHelper::ShouldUseIncreasedContrastThemeSuppl - ui::NativeTheme* native_theme) const { - // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is - // complete. --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) - // On Linux the GTK system theme provides the high contrast colors, - // so don't use the IncreasedContrastThemeSupplier. - return false; diff --git a/www/chromium/files/patch-chrome_browser_themes_theme__service.cc b/www/chromium/files/patch-chrome_browser_themes_theme__service.cc new file mode 100644 index 000000000000..f5754ce6aece --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_themes_theme__service.cc @@ -0,0 +1,38 @@ +--- chrome/browser/themes/theme_service.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/themes/theme_service.cc +@@ -73,7 +73,7 @@ + #include "extensions/browser/extension_registry_observer.h" + #endif + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "ui/views/linux_ui/linux_ui.h" + #endif + +@@ -512,7 +512,7 @@ ThemeService::BrowserThemeProvider::GetColorProviderCo + native_theme = ui::NativeTheme::GetInstanceForDarkUI(); + } else { + native_theme = ui::NativeTheme::GetInstanceForNativeUi(); +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + if (const auto* linux_ui = views::LinuxUI::instance()) { + native_theme = + linux_ui->GetNativeTheme(delegate_->ShouldUseSystemTheme()); +@@ -632,7 +632,7 @@ CustomThemeSupplier* ThemeService::GetThemeSupplier() + } + + bool ThemeService::ShouldUseSystemTheme() const { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + return profile_->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); + #else + return false; +@@ -640,7 +640,7 @@ bool ThemeService::ShouldUseSystemTheme() const { + } + + bool ThemeService::ShouldUseCustomFrame() const { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + return profile_->GetPrefs()->GetBoolean(prefs::kUseCustomChromeFrame); + #else + return true; diff --git a/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc b/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc index 4af07b967491..a9eb0f08a1b7 100644 --- a/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc +++ b/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc @@ -1,38 +1,65 @@ ---- chrome/browser/ui/browser_command_controller.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/browser_command_controller.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/browser_command_controller.cc -@@ -88,7 +88,7 @@ +@@ -70,7 +70,7 @@ + #include "ui/base/ui_base_features.h" + #include "ui/events/keycodes/keyboard_codes.h" + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "ui/accessibility/accessibility_features.h" + #endif + +@@ -92,7 +92,7 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" #endif -@@ -277,7 +277,7 @@ bool BrowserCommandController::IsReservedCommandOrKey( +@@ -283,7 +283,7 @@ bool BrowserCommandController::IsReservedCommandOrKey( // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // If this key was registered by the user as a content editing hotkey, then // it is not reserved. ui::TextEditKeyBindingsDelegateAuraLinux* delegate = -@@ -513,7 +513,7 @@ bool BrowserCommandController::ExecuteCommandWithDispo +@@ -519,7 +519,7 @@ bool BrowserCommandController::ExecuteCommandWithDispo // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) case IDC_MINIMIZE_WINDOW: browser_->window()->Minimize(); break; -@@ -1040,7 +1040,7 @@ void BrowserCommandController::InitCommandState() { +@@ -888,7 +888,7 @@ bool BrowserCommandController::ExecuteCommandWithDispo + ExecuteUIDebugCommand(id, browser_); + break; + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + case IDC_RUN_SCREEN_AI: + RunScreenAi(browser_); + break; +@@ -1050,7 +1050,7 @@ void BrowserCommandController::InitCommandState() { #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_MAXIMIZE_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_RESTORE_WINDOW, true); +@@ -1431,7 +1431,7 @@ void BrowserCommandController::UpdateCommandsForFullsc + command_updater_.UpdateCommandEnabled( + IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY, main_not_fullscreen); + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + command_updater_.UpdateCommandEnabled(IDC_RUN_SCREEN_AI, + features::IsScreenAIEnabled()); + #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_browser__commands.cc b/www/chromium/files/patch-chrome_browser_ui_browser__commands.cc new file mode 100644 index 000000000000..2a1b21a781b8 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_browser__commands.cc @@ -0,0 +1,20 @@ +--- chrome/browser/ui/browser_commands.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/ui/browser_commands.cc +@@ -176,7 +176,7 @@ + #include "chromeos/lacros/lacros_service.h" + #endif + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "ui/accessibility/ax_action_data.h" + #include "ui/accessibility/ax_enums.mojom.h" + #endif +@@ -1873,7 +1873,7 @@ void FollowSite(Browser* browser, content::WebContents + feed::FollowSite(web_contents); + } + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + void RunScreenAi(Browser* browser) { + ui::AXActionData ad; + ad.action = ax::mojom::Action::kRunScreenAi; diff --git a/www/chromium/files/patch-chrome_browser_ui_browser__commands.h b/www/chromium/files/patch-chrome_browser_ui_browser__commands.h new file mode 100644 index 000000000000..d7065b70f756 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_browser__commands.h @@ -0,0 +1,11 @@ +--- chrome/browser/ui/browser_commands.h.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/ui/browser_commands.h +@@ -250,7 +250,7 @@ void ProcessInterceptedChromeURLNavigationInIncognito( + // Follows a web feed associated with the main frame of specified web contents. + void FollowSite(Browser* browser, content::WebContents* web_contents); + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + // Triggers the Screen AI to be run once on the |browser|. + void RunScreenAi(Browser* browser); + #endif // BUILDFLAG(IS_LINUX) diff --git a/www/chromium/files/patch-chrome_browser_ui_browser__dialogs.h b/www/chromium/files/patch-chrome_browser_ui_browser__dialogs.h index 1480cab7017a..17ca9be374e6 100644 --- a/www/chromium/files/patch-chrome_browser_ui_browser__dialogs.h +++ b/www/chromium/files/patch-chrome_browser_ui_browser__dialogs.h @@ -1,29 +1,11 @@ ---- chrome/browser/ui/browser_dialogs.h.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/browser_dialogs.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/browser_dialogs.h @@ -26,7 +26,7 @@ #include "ui/base/models/dialog_model.h" #include "ui/gfx/native_widget_types.h" -#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/web_app_id.h" #endif -@@ -80,7 +80,7 @@ class WebDialogDelegate; - struct SelectedFileInfo; - } // namespace ui - --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ - (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) - namespace web_app { - struct UrlHandlerLaunchParams; -@@ -207,7 +207,7 @@ void ShowWebAppFileLaunchDialog(const std::vector page. void ShowWebAppSettings(Browser* browser, const std::string& app_id, diff --git a/www/chromium/files/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc b/www/chromium/files/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc index 05d1cac6218b..98ed6d8a3d71 100644 --- a/www/chromium/files/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc +++ b/www/chromium/files/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/color/native_chrome_color_mixer.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/color/native_chrome_color_mixer.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/color/native_chrome_color_mixer.cc -@@ -6,7 +6,7 @@ - +@@ -7,7 +7,7 @@ #include "build/build_config.h" --#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) -+#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD) + #if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && \ +- !BUILDFLAG(IS_WIN) ++ !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD) void AddNativeChromeColorMixer(ui::ColorProvider* provider, const ui::ColorProviderManager::Key& key) {} #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_sad__tab.cc b/www/chromium/files/patch-chrome_browser_ui_sad__tab.cc index 8b4620cbf1c5..4ec56e573922 100644 --- a/www/chromium/files/patch-chrome_browser_ui_sad__tab.cc +++ b/www/chromium/files/patch-chrome_browser_ui_sad__tab.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/sad_tab.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/sad_tab.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/sad_tab.cc -@@ -188,7 +188,7 @@ std::vector SadTab::GetSubMessages() { +@@ -175,7 +175,7 @@ std::vector SadTab::GetSubMessages() { // Only show Incognito suggestion if not already in Incognito mode. if (!web_contents_->GetBrowserContext()->IsOffTheRecord()) message_ids.insert(message_ids.begin(), IDS_SAD_TAB_RELOAD_INCOGNITO); -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Note: on macOS, Linux and ChromeOS, the first bullet is either one of // IDS_SAD_TAB_RELOAD_CLOSE_TABS or IDS_SAD_TAB_RELOAD_CLOSE_NOTABS // followed by one of the above suggestions. diff --git a/www/chromium/files/patch-chrome_browser_ui_startup_bad__flags__prompt.cc b/www/chromium/files/patch-chrome_browser_ui_startup_bad__flags__prompt.cc index 0d83620f6d3c..efe06fd7ba6a 100644 --- a/www/chromium/files/patch-chrome_browser_ui_startup_bad__flags__prompt.cc +++ b/www/chromium/files/patch-chrome_browser_ui_startup_bad__flags__prompt.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/startup/bad_flags_prompt.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/startup/bad_flags_prompt.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/startup/bad_flags_prompt.cc -@@ -90,7 +90,7 @@ static const char* kBadFlags[] = { +@@ -92,7 +92,7 @@ static const char* kBadFlags[] = { // 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) // Speech dispatcher is buggy, it can crash and it can make Chrome freeze. // http://crbug.com/327295 switches::kEnableSpeechDispatcher, diff --git a/www/chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc b/www/chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc index 3e4464ffd50b..7f800b5861c7 100644 --- a/www/chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc +++ b/www/chromium/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc @@ -1,53 +1,29 @@ ---- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/startup/startup_browser_creator.cc -@@ -126,12 +126,12 @@ +@@ -126,7 +126,7 @@ #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) #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)) - #include "chrome/browser/ui/startup/web_app_url_handling_startup_utils.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/startup/web_app_info_recorder_utils.h" #endif -@@ -518,7 +518,7 @@ bool MaybeLaunchAppShortcutWindow(const base::CommandL - return false; - } - --#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 MaybeLaunchUrlHandlerWebAppFromCmd( - const base::CommandLine& command_line, - const base::FilePath& cur_dir, -@@ -989,7 +989,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -948,7 +948,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( silent_launch = true; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Writes open and installed web apps to the specified file without // launching a new browser window or tab. if (base::FeatureList::IsEnabled(features::kListWebAppsSwitch) && -@@ -1181,7 +1181,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -1140,7 +1140,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( CHECK_EQ(profile_info.mode, StartupProfileMode::kBrowserWindow) << "Failed launch with app: couldn't pick a profile"; std::string app_id = command_line.GetSwitchValueASCII(switches::kAppId); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // If Chrome Apps are deprecated and |app_id| is a Chrome App, display the // deprecation UI instead of launching the app. if (apps::OpenDeprecatedApplicationPrompt(privacy_safe_profile, app_id)) -@@ -1220,7 +1220,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( - web_app::startup::MaybeHandleWebAppLaunch( - command_line, cur_dir, privacy_safe_profile, is_first_run); - --#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) - handled_as_app = handled_as_app || - // Give web apps a chance to handle a URL. - MaybeLaunchUrlHandlerWebAppFromCmd( diff --git a/www/chromium/files/patch-chrome_browser_ui_tab__helpers.cc b/www/chromium/files/patch-chrome_browser_ui_tab__helpers.cc index 2fbc462f0e52..e5f83c8bcd8b 100644 --- a/www/chromium/files/patch-chrome_browser_ui_tab__helpers.cc +++ b/www/chromium/files/patch-chrome_browser_ui_tab__helpers.cc @@ -1,36 +1,36 @@ ---- chrome/browser/ui/tab_helpers.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/tab_helpers.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/tab_helpers.cc -@@ -179,7 +179,7 @@ +@@ -181,7 +181,7 @@ #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/blocked_content/framebust_block_tab_helper.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/hats/hats_helper.h" -@@ -500,13 +500,13 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con +@@ -505,13 +505,13 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) metrics::DesktopSessionDurationObserver::CreateForWebContents(web_contents); #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled( features::kHappinessTrackingSurveysForDesktopDemo) || base::FeatureList::IsEnabled(features::kTrustSafetySentimentSurvey) || -@@ -517,7 +517,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con +@@ -522,7 +522,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) SharedHighlightingPromo::CreateForWebContents(web_contents); #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_task__manager_task__manager__columns.cc b/www/chromium/files/patch-chrome_browser_ui_task__manager_task__manager__columns.cc index 2c0f824455ce..410884208108 100644 --- a/www/chromium/files/patch-chrome_browser_ui_task__manager_task__manager__columns.cc +++ b/www/chromium/files/patch-chrome_browser_ui_task__manager_task__manager__columns.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/task_manager/task_manager_columns.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/task_manager/task_manager_columns.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/task_manager/task_manager_columns.cc -@@ -94,7 +94,7 @@ const TableColumnData kColumns[] = { - base::size("100000") * kCharWidth, -1, true, false, false}, +@@ -93,7 +93,7 @@ const TableColumnData kColumns[] = { + std::size("100000") * kCharWidth, -1, true, false, false}, #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) {IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, - base::size("999") * kCharWidth, -1, true, false, false}, + std::size("999") * kCharWidth, -1, true, false, false}, #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-chrome_browser_ui_views_accelerator__table.cc b/www/chromium/files/patch-chrome_browser_ui_views_accelerator__table.cc index d72fbed5d990..b8a56d7afedb 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_accelerator__table.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_accelerator__table.cc @@ -1,29 +1,38 @@ ---- chrome/browser/ui/views/accelerator_table.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/views/accelerator_table.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/accelerator_table.cc -@@ -62,7 +62,7 @@ const AcceleratorMapping kAcceleratorMap[] = { +@@ -61,7 +61,7 @@ const AcceleratorMapping kAcceleratorMap[] = { {ui::VKEY_NUMPAD9, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_LAST_TAB}, // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) {ui::VKEY_9, ui::EF_ALT_DOWN, IDC_SELECT_LAST_TAB}, {ui::VKEY_NUMPAD9, ui::EF_ALT_DOWN, IDC_SELECT_LAST_TAB}, {ui::VKEY_NEXT, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_MOVE_TAB_NEXT}, -@@ -94,7 +94,7 @@ const AcceleratorMapping kAcceleratorMap[] = { +@@ -93,7 +93,7 @@ const AcceleratorMapping kAcceleratorMap[] = { {ui::VKEY_NUMPAD8, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_TAB_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) {ui::VKEY_1, ui::EF_ALT_DOWN, IDC_SELECT_TAB_0}, {ui::VKEY_NUMPAD1, ui::EF_ALT_DOWN, IDC_SELECT_TAB_0}, {ui::VKEY_2, ui::EF_ALT_DOWN, IDC_SELECT_TAB_1}, -@@ -139,7 +139,7 @@ const AcceleratorMapping kAcceleratorMap[] = { +@@ -138,7 +138,7 @@ const AcceleratorMapping kAcceleratorMap[] = { IDC_SHOW_AVATAR_MENU}, // Platform-specific key maps. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) {ui::VKEY_BROWSER_BACK, ui::EF_NONE, IDC_BACK}, {ui::VKEY_BROWSER_FORWARD, ui::EF_NONE, IDC_FORWARD}, {ui::VKEY_BROWSER_HOME, ui::EF_NONE, IDC_HOME}, +@@ -229,7 +229,7 @@ const AcceleratorMapping kAcceleratorMap[] = { + {ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, IDC_TOGGLE_COMMANDER}, + #endif // !BUILDFLAG(IS_CHROMEOS_ASH) + #endif // !BUILDFLAG(IS_MAC) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + {ui::VKEY_S, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_RUN_SCREEN_AI}, + #endif + }; diff --git a/www/chromium/files/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc b/www/chromium/files/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc index 05f95bde60a2..7678829fa636 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc @@ -1,20 +1,20 @@ ---- chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc @@ -19,7 +19,7 @@ #include "ui/gfx/image/image_skia.h" #include "ui/views/widget/widget.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/shell_integration_linux.h" #endif -@@ -56,7 +56,7 @@ void ChromeNativeAppWindowViewsAura::OnBeforeWidgetIni +@@ -50,7 +50,7 @@ void ChromeNativeAppWindowViewsAura::OnBeforeWidgetIni const AppWindow::CreateParams& create_params, views::Widget::InitParams* init_params, views::Widget* widget) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::string app_name = web_app::GenerateApplicationNameFromAppId(app_window()->extension_id()); // Set up a custom WM_CLASS for app windows. This allows task switchers in diff --git a/www/chromium/files/patch-chrome_browser_ui_views_eye__dropper_eye__dropper__view.cc b/www/chromium/files/patch-chrome_browser_ui_views_eye__dropper_eye__dropper__view.cc index 11c440c6a76c..392853ba8894 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_eye__dropper_eye__dropper__view.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_eye__dropper_eye__dropper__view.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc -@@ -155,7 +155,7 @@ EyeDropperView::EyeDropperView(content::RenderFrameHos +@@ -157,7 +157,7 @@ EyeDropperView::EyeDropperView(content::RenderFrameHos // EyeDropper/WidgetDelegate. set_owned_by_client(); SetPreferredSize(GetSize()); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Use TYPE_MENU for Linux to ensure that the eye dropper view is displayed // above the color picker. views::Widget::InitParams params(views::Widget::InitParams::TYPE_MENU); diff --git a/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__desktop__window__tree__host__linux.cc b/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__desktop__window__tree__host__linux.cc index a9b4237c6880..dbd0a894f425 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__desktop__window__tree__host__linux.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__desktop__window__tree__host__linux.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc -@@ -150,7 +150,7 @@ bool BrowserDesktopWindowTreeHostLinux::SupportsClient +@@ -151,7 +151,7 @@ bool BrowserDesktopWindowTreeHostLinux::SupportsClient } void BrowserDesktopWindowTreeHostLinux::UpdateFrameHints() { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto* view = static_cast( native_frame_->browser_frame()->GetFrameView()); auto* layout = view->layout(); diff --git a/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc b/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc index 2028f88f4f13..65f637d362ba 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__frame.cc @@ -1,52 +1,52 @@ ---- chrome/browser/ui/views/frame/browser_frame.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/views/frame/browser_frame.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/frame/browser_frame.cc @@ -49,11 +49,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 "ui/display/screen.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/views/linux_ui/linux_ui.h" #endif @@ -62,7 +62,7 @@ namespace { bool IsUsingGtkTheme(Profile* profile) { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) return ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme(); #else return false; @@ -268,7 +268,7 @@ void BrowserFrame::OnNativeWidgetWorkspaceChanged() { IsVisibleOnAllWorkspaces()); // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // If the window was sent to a different workspace, prioritize it if // it was sent to the current workspace and deprioritize it // otherwise. This is done by MoveBrowsersInWorkspaceToFront() -@@ -381,7 +381,7 @@ void BrowserFrame::SelectNativeTheme() { +@@ -389,7 +389,7 @@ void BrowserFrame::SelectNativeTheme() { return; } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const views::LinuxUI* linux_ui = views::LinuxUI::instance(); // Ignore GTK+ for web apps with window-controls-overlay as the // display_override so the web contents can blend with the overlay by using -@@ -400,7 +400,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( +@@ -408,7 +408,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( bool need_regenerate = false; // 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) // GTK and user theme changes can both change frame buttons, so the frame // always needs to be regenerated on Linux. need_regenerate = true; diff --git a/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc b/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc index 91d32afee5d1..760de2cf1e4e 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_frame_browser__view.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/frame/browser_view.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/views/frame/browser_view.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -1825,7 +1825,7 @@ void BrowserView::TabDraggingStatusChanged(bool is_dra +@@ -1945,7 +1945,7 @@ void BrowserView::TabDraggingStatusChanged(bool is_dra // CrOS cleanup is done. // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) contents_web_view_->SetFastResize(is_dragging); if (!is_dragging) { // When tab dragging is ended, we need to make sure the web contents get diff --git a/www/chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc b/www/chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc index 81ac51b1a358..33ac4384e4fa 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc @@ -1,20 +1,20 @@ ---- chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc -@@ -137,7 +137,7 @@ SigninViewControllerDelegateViews::CreateProfileCustom +@@ -138,7 +138,7 @@ SigninViewControllerDelegateViews::CreateProfileCustom #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // static std::unique_ptr SigninViewControllerDelegateViews::CreateEnterpriseConfirmationWebView( -@@ -413,7 +413,7 @@ SigninViewControllerDelegate::CreateProfileCustomizati +@@ -417,7 +417,7 @@ SigninViewControllerDelegate::CreateProfileCustomizati #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // static SigninViewControllerDelegate* SigninViewControllerDelegate::CreateEnterpriseConfirmationDelegate( diff --git a/www/chromium/files/patch-chrome_browser_ui_views_tab__dialogs__views.cc b/www/chromium/files/patch-chrome_browser_ui_views_tab__dialogs__views.cc new file mode 100644 index 000000000000..78ee24e0f062 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_views_tab__dialogs__views.cc @@ -0,0 +1,20 @@ +--- chrome/browser/ui/views/tab_dialogs_views.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/ui/views/tab_dialogs_views.cc +@@ -15,7 +15,7 @@ + #include "content/public/browser/web_contents.h" + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + #include "chrome/browser/ui/views/web_apps/deprecated_apps_dialog_view.h" + #endif + +@@ -83,7 +83,7 @@ void TabDialogsViews::ShowDeprecatedAppsDialog( + const std::set& deprecated_app_ids, + content::WebContents* web_contents) { + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + DeprecatedAppsDialogView::CreateAndShowDialog(deprecated_app_ids, + web_contents); + #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc b/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc index d5c91c4f6357..f43ac4031aba 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc @@ -1,29 +1,38 @@ ---- chrome/browser/ui/views/tabs/tab_drag_controller.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/views/tabs/tab_drag_controller.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/tabs/tab_drag_controller.cc @@ -480,7 +480,7 @@ void TabDragController::Init(TabDragContext* source_co // synchronous on desktop Linux, so use that. // - Chrome OS // Releasing capture on Ash cancels gestures so avoid it. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) can_release_capture_ = false; #endif start_point_in_screen_ = gfx::Point(source_view_offset, mouse_offset.y()); @@ -1021,7 +1021,7 @@ TabDragController::DragBrowserToNewTabStrip(TabDragCon // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) // EndMoveLoop is going to snap the window back to its original location. // Hide it so users don't see this. Hiding a window in Linux aura causes // it to lose capture so skip it. -@@ -2350,7 +2350,7 @@ TabDragController::Liveness TabDragController::GetLoca +@@ -1977,7 +1977,7 @@ void TabDragController::CompleteDrag() { + } + + // If source window was maximized - maximize the new window as well. +-#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) ++#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) + // Keeping maximized state breaks snap to Grid on Windows when dragging + // tabs from maximized windows. TODO:(crbug.com/727051) Explore doing this + // for other desktop OS's. kMaximizedStateRetainedOnTabDrag in +@@ -2355,7 +2355,7 @@ TabDragController::Liveness TabDragController::GetLoca } // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Exclude windows which are pending deletion via Browser::TabStripEmpty(). // These windows can be returned in the Linux Aura port because the browser // window which was used for dragging is not hidden once all of its tabs are diff --git a/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__controller.cc b/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__controller.cc index 6a00059963ad..a58769788db8 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__controller.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__controller.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/tabs/tab_hover_card_controller.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/views/tabs/tab_hover_card_controller.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/views/tabs/tab_hover_card_controller.cc -@@ -36,7 +36,7 @@ namespace { +@@ -68,7 +68,7 @@ GetMemoryPressureOverride() { // Fetches the Omnibox drop-down widget, or returns null if the drop-down is // not visible. void FixWidgetStackOrder(views::Widget* widget, const Browser* browser) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Ensure the hover card Widget assumes the highest z-order to avoid occlusion // by other secondary UI Widgets (such as the omnibox Widget, see // crbug.com/1226536). diff --git a/www/chromium/files/patch-chrome_browser_ui_web__applications_app__browser__controller.cc b/www/chromium/files/patch-chrome_browser_ui_web__applications_app__browser__controller.cc new file mode 100644 index 000000000000..3c05ffaa72ea --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_web__applications_app__browser__controller.cc @@ -0,0 +1,20 @@ +--- chrome/browser/ui/web_applications/app_browser_controller.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/browser/ui/web_applications/app_browser_controller.cc +@@ -379,7 +379,7 @@ CustomThemeSupplier* AppBrowserController::GetThemeSup + } + + bool AppBrowserController::ShouldUseSystemTheme() const { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + return browser_->profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); + #else + return false; +@@ -387,7 +387,7 @@ bool AppBrowserController::ShouldUseSystemTheme() cons + } + + bool AppBrowserController::ShouldUseCustomFrame() const { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + return browser_->profile()->GetPrefs()->GetBoolean( + prefs::kUseCustomChromeFrame); + #else diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc b/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc index a9339afa548c..45df4b04931f 100644 --- a/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc +++ b/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc @@ -1,20 +1,20 @@ ---- chrome/browser/ui/webui/about_ui.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/webui/about_ui.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/webui/about_ui.cc -@@ -603,7 +603,7 @@ std::string ChromeURLs() { +@@ -619,7 +619,7 @@ std::string ChromeURLs() { return html; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) std::string AboutLinuxProxyConfig() { std::string data; AppendHeader(&data, -@@ -661,7 +661,7 @@ void AboutUIHTMLSource::StartDataRequest( +@@ -677,7 +677,7 @@ void AboutUIHTMLSource::StartDataRequest( response = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(idr); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) } else if (source_name_ == chrome::kChromeUILinuxProxyConfigHost) { response = AboutLinuxProxyConfig(); #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc b/www/chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc index e1a965b96501..8c780073200e 100644 --- a/www/chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc +++ b/www/chromium/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc @@ -1,98 +1,92 @@ ---- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -@@ -296,7 +296,7 @@ +@@ -299,7 +299,7 @@ #include "chrome/browser/ui/webui/app_launcher_page_ui.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/webui/webui_js_error/webui_js_error_ui.h" #endif -@@ -320,22 +320,22 @@ +@@ -324,17 +324,17 @@ #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/webui/discards/discards_ui.h" #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h" #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h" #endif - #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" - #endif - -@@ -661,7 +661,7 @@ bool IsAboutUI(const GURL& url) { +@@ -682,7 +682,7 @@ bool IsAboutUI(const GURL& url) { #if !BUILDFLAG(IS_ANDROID) || url.host_piece() == chrome::kChromeUITermsHost #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) || url.host_piece() == chrome::kChromeUILinuxProxyConfigHost #endif #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -1073,7 +1073,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1098,7 +1098,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we return &NewWebUI; #endif // !defined(OFFICIAL_BUILD) #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (url.host_piece() == chrome::kChromeUIWebUIJsErrorHost) return &NewWebUI; #endif -@@ -1131,7 +1131,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1156,7 +1156,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we if (url.host_piece() == chrome::kChromeUINaClHost) return &NewWebUI; #endif -#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ defined(TOOLKIT_VIEWS)) || \ defined(USE_AURA) if (url.host_piece() == chrome::kChromeUITabModalConfirmDialogHost) -@@ -1187,27 +1187,27 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1212,27 +1212,27 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we } #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) if (url.host_piece() == chrome::kChromeUISandboxHost) { return &NewWebUI; } #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_ASH) + BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) if (url.host_piece() == chrome::kChromeUIConnectorsInternalsHost) return &NewWebUI; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (url.host_piece() == chrome::kChromeUIDiscardsHost) return &NewWebUI; #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (url.host_piece() == chrome::kChromeUIBrowserSwitchHost) return &NewWebUI; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled(features::kDesktopPWAsWebAppSettingsPage) && url.host_piece() == chrome::kChromeUIWebAppSettingsHost) { return &NewWebUI; diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_ntp_app__launcher__handler.cc b/www/chromium/files/patch-chrome_browser_ui_webui_ntp_app__launcher__handler.cc index 7dc963f872dd..e7914b6f84a7 100644 --- a/www/chromium/files/patch-chrome_browser_ui_webui_ntp_app__launcher__handler.cc +++ b/www/chromium/files/patch-chrome_browser_ui_webui_ntp_app__launcher__handler.cc @@ -1,29 +1,20 @@ ---- chrome/browser/ui/webui/ntp/app_launcher_handler.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/webui/ntp/app_launcher_handler.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/webui/ntp/app_launcher_handler.cc -@@ -313,7 +313,7 @@ void AppLauncherHandler::CreateExtensionInfo(const Ext - base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)); +@@ -316,7 +316,7 @@ void AppLauncherHandler::CreateExtensionInfo(const Ext bool is_deprecated_app = false; --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) is_deprecated_app = extensions::IsExtensionUnsupportedDeprecatedApp( extension_service_->GetBrowserContext(), extension->id()); #endif -@@ -756,7 +756,7 @@ void AppLauncherHandler::HandleLaunchApp(const base::L - - Profile* profile = extension_service_->profile(); - --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - if (extensions::IsExtensionUnsupportedDeprecatedApp(profile, extension_id)) { - // TODO(crbug.com/1225779): Show the deprecated apps dialog. - return; -@@ -1348,7 +1348,7 @@ void AppLauncherHandler::InstallOsHooks(const web_app: +@@ -1379,7 +1379,7 @@ void AppLauncherHandler::InstallOsHooks(const web_app: options.os_hooks[web_app::OsHookType::kUninstallationViaOsSettings] = web_app->CanUserUninstallWebApp(); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) options.os_hooks[web_app::OsHookType::kUrlHandlers] = true; #else diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.cc b/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.cc index 2803fbb72c77..9e5a36b8b3a9 100644 --- a/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.cc +++ b/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.cc @@ -1,20 +1,20 @@ ---- chrome/browser/ui/webui/settings/appearance_handler.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/webui/settings/appearance_handler.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/webui/settings/appearance_handler.cc @@ -31,7 +31,7 @@ void AppearanceHandler::RegisterMessages() { base::Unretained(this))); // 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) web_ui()->RegisterMessageCallback( "useSystemTheme", base::BindRepeating(&AppearanceHandler::HandleUseSystemTheme, -@@ -45,7 +45,7 @@ void AppearanceHandler::HandleUseDefaultTheme(base::Va +@@ -45,7 +45,7 @@ void AppearanceHandler::HandleUseDefaultTheme(const ba // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) - void AppearanceHandler::HandleUseSystemTheme(base::Value::ConstListView args) { + void AppearanceHandler::HandleUseSystemTheme(const base::Value::List& args) { if (profile_->IsChild()) NOTREACHED(); diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.h b/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.h index 23be49002df4..3e03fda7292c 100644 --- a/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.h +++ b/www/chromium/files/patch-chrome_browser_ui_webui_settings_appearance__handler.h @@ -1,11 +1,11 @@ ---- chrome/browser/ui/webui/settings/appearance_handler.h.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/webui/settings/appearance_handler.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/webui/settings/appearance_handler.h @@ -40,7 +40,7 @@ class AppearanceHandler : public SettingsPageUIHandler // 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) // Changes the UI theme of the browser to the system (GTK+) theme. - void HandleUseSystemTheme(base::Value::ConstListView args); + void HandleUseSystemTheme(const base::Value::List& args); #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc b/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc index 950e3ff547c5..5ba6ce92d4a6 100644 --- a/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc +++ b/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc @@ -1,47 +1,47 @@ ---- chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -@@ -118,7 +118,7 @@ +@@ -117,7 +117,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h" #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) #include "ui/display/screen.h" #endif @@ -138,7 +138,7 @@ #include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/ozone/public/ozone_platform.h" #endif -@@ -371,7 +371,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -372,7 +372,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht {"huge", IDS_SETTINGS_HUGE_FONT_SIZE}, // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) {"systemTheme", IDS_SETTINGS_SYSTEM_THEME}, {"useSystemTheme", IDS_SETTINGS_USE_SYSTEM_THEME}, {"classicTheme", IDS_SETTINGS_CLASSIC_THEME}, -@@ -379,7 +379,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -380,7 +380,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht #else {"resetToDefaultTheme", IDS_SETTINGS_RESET_TO_DEFAULT_THEME}, #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) {"showWindowDecorations", IDS_SHOW_WINDOW_DECORATIONS}, #endif #if BUILDFLAG(IS_MAC) -@@ -400,7 +400,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -401,7 +401,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) bool show_custom_chrome_frame = ui::OzonePlatform::GetInstance() ->GetPlatformRuntimeProperties() .supports_server_side_window_decorations; diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__ui.cc b/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__ui.cc deleted file mode 100644 index 016bc2901d72..000000000000 --- a/www/chromium/files/patch-chrome_browser_ui_webui_settings_settings__ui.cc +++ /dev/null @@ -1,20 +0,0 @@ ---- chrome/browser/ui/webui/settings/settings_ui.cc.orig 2022-03-25 21:59:56 UTC -+++ chrome/browser/ui/webui/settings/settings_ui.cc -@@ -140,7 +140,7 @@ - #include "chrome/browser/ui/webui/settings/native_certificates_handler.h" - #endif // BUILDFLAG(USE_NSS_CERTS) - --#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/ui/webui/settings/url_handlers_handler.h" - #include "chrome/browser/web_applications/web_app_provider.h" -@@ -243,7 +243,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) - AddSettingsPageUIHandler(std::make_unique(profile)); - #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)) - if (web_app::WebAppProvider::GetForWebApps(profile) != nullptr) { - AddSettingsPageUIHandler(std::make_unique( diff --git a/www/chromium/files/patch-chrome_browser_web__applications_extension__status__utils.h b/www/chromium/files/patch-chrome_browser_web__applications_extension__status__utils.h index 58ee36e0c4f5..f8dd0e3369d0 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_extension__status__utils.h +++ b/www/chromium/files/patch-chrome_browser_web__applications_extension__status__utils.h @@ -1,11 +1,11 @@ ---- chrome/browser/web_applications/extension_status_utils.h.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/web_applications/extension_status_utils.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/web_applications/extension_status_utils.h -@@ -42,7 +42,7 @@ bool IsExtensionDefaultInstalled(content::BrowserConte - bool IsExternalExtensionUninstalled(content::BrowserContext* context, +@@ -43,7 +43,7 @@ bool IsExternalExtensionUninstalled(content::BrowserCo const std::string& extension_id); --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Returns whether |extension_id| is a Chrome App and should be blocked by the // Chrome Apps Deprecation. Policy installed Chrome Apps are still allowed, and // all apps are allowed if the deprecation feature flag is not enabled. diff --git a/www/chromium/files/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc b/www/chromium/files/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc index 5b903976722b..d336ec99bd48 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc +++ b/www/chromium/files/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc @@ -1,11 +1,11 @@ ---- chrome/browser/web_applications/extensions/extension_status_utils.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/web_applications/extensions/extension_status_utils.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/web_applications/extensions/extension_status_utils.cc -@@ -87,7 +87,7 @@ bool IsExternalExtensionUninstalled(content::BrowserCo - return prefs && prefs->IsExternalExtensionUninstalled(extension_id); +@@ -88,7 +88,7 @@ bool IsExternalExtensionUninstalled(content::BrowserCo } --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) bool IsExtensionUnsupportedDeprecatedApp(content::BrowserContext* context, const std::string& extension_id) { if (!base::FeatureList::IsEnabled(features::kChromeAppsDeprecation)) diff --git a/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc index b883934bf2f7..8ed33da82169 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc +++ b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc @@ -1,38 +1,38 @@ ---- chrome/browser/web_applications/os_integration/web_app_shortcut.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/web_applications/os_integration/web_app_shortcut.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/web_applications/os_integration/web_app_shortcut.cc @@ -43,7 +43,7 @@ namespace { #if BUILDFLAG(IS_MAC) const int kDesiredIconSizesForShortcut[] = {16, 32, 128, 256, 512}; -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Linux supports icons of any size. FreeDesktop Icon Theme Specification states // that "Minimally you should install a 48x48 icon in the hicolor theme." const int kDesiredIconSizesForShortcut[] = {16, 32, 48, 128, 256, 512}; @@ -133,7 +133,7 @@ ScopedShortcutOverrideForTesting::~ScopedShortcutOverr } } } -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) directories = {&desktop}; #endif for (base::ScopedTempDir* dir : directories) { @@ -177,7 +177,7 @@ std::unique_ptr Over scoped_override->chrome_apps_folder.CreateUniqueTempDirUnderPath( base_path); DCHECK(success); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool success = scoped_override->desktop.CreateUniqueTempDirUnderPath(base_path); DCHECK(success); -@@ -195,7 +195,7 @@ std::unique_ptr Over +@@ -197,7 +197,7 @@ std::unique_ptr Over #elif BUILDFLAG(IS_MAC) bool success = scoped_override->chrome_apps_folder.CreateUniqueTempDir(); DCHECK(success); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool success = scoped_override->desktop.CreateUniqueTempDir(); DCHECK(success); - #endif + success = scoped_override->startup.CreateUniqueTempDir(); diff --git a/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h index 95ff8d0f3cba..136df987cd17 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h +++ b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h @@ -1,29 +1,29 @@ ---- chrome/browser/web_applications/os_integration/web_app_shortcut.h.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/web_applications/os_integration/web_app_shortcut.h.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/web_applications/os_integration/web_app_shortcut.h @@ -19,7 +19,7 @@ #include "ui/gfx/image/image_family.h" #include "url/gurl.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/web_applications/os_integration/web_app_shortcut_linux.h" #endif // BUILDFLAG(IS_LINUX) @@ -47,7 +47,7 @@ struct ScopedShortcutOverrideForTesting { base::ScopedTempDir startup; #elif BUILDFLAG(IS_MAC) base::ScopedTempDir chrome_apps_folder; -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::ScopedTempDir desktop; + base::ScopedTempDir startup; #endif - }; -@@ -89,7 +89,7 @@ struct ShortcutInfo { +@@ -90,7 +90,7 @@ struct ShortcutInfo { std::set file_handler_extensions; std::set file_handler_mime_types; std::set protocol_handlers; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::set actions; #endif // BUILDFLAG(IS_LINUX) diff --git a/www/chromium/files/patch-chrome_browser_web__applications_web__app__provider.cc b/www/chromium/files/patch-chrome_browser_web__applications_web__app__provider.cc index c8adf7fc3093..4925a4ac61fc 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_web__app__provider.cc +++ b/www/chromium/files/patch-chrome_browser_web__applications_web__app__provider.cc @@ -1,11 +1,11 @@ ---- chrome/browser/web_applications/web_app_provider.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/web_applications/web_app_provider.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/web_applications/web_app_provider.cc -@@ -289,7 +289,7 @@ void WebAppProvider::CreateSubsystems(Profile* profile +@@ -285,7 +285,7 @@ void WebAppProvider::CreateSubsystems(Profile* profile protocol_handler_manager.get()); std::unique_ptr url_handler_manager; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) url_handler_manager = std::make_unique(profile); #endif diff --git a/www/chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc b/www/chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc index dbcce37ca6dd..8c254f6f264d 100644 --- a/www/chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc +++ b/www/chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc @@ -1,11 +1,11 @@ ---- chrome/browser/webauthn/chrome_authenticator_request_delegate.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/browser/webauthn/chrome_authenticator_request_delegate.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/browser/webauthn/chrome_authenticator_request_delegate.cc -@@ -749,7 +749,7 @@ bool ChromeAuthenticatorRequestDelegate::ShouldPermitC +@@ -869,7 +869,7 @@ bool ChromeAuthenticatorRequestDelegate::ShouldPermitC // TODO(crbug.com/1052397): Revisit the macro expression once build flag // switch of lacros-chrome is complete. If updating this, also update // kWebAuthCableServerLink. -#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // caBLEv1 is disabled on these platforms. It never launched on them because // it causes problems in bluez. Rather than disabling caBLE completely, which diff --git a/www/chromium/files/patch-chrome_common_chrome__features.cc b/www/chromium/files/patch-chrome_common_chrome__features.cc index bbc280979435..0255919a2493 100644 --- a/www/chromium/files/patch-chrome_common_chrome__features.cc +++ b/www/chromium/files/patch-chrome_common_chrome__features.cc @@ -1,92 +1,74 @@ ---- chrome/common/chrome_features.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/common/chrome_features.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/common/chrome_features.cc -@@ -105,7 +105,7 @@ const base::Feature kAsyncDns { +@@ -110,7 +110,7 @@ const base::Feature kAsyncDns { }; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Enables or disables the Autofill survey triggered by opening a prompt to // save address info. const base::Feature kAutofillAddressSurvey{"AutofillAddressSurvey", -@@ -120,7 +120,7 @@ const base::Feature kAutofillPasswordSurvey{"AutofillP +@@ -125,7 +125,7 @@ const base::Feature kAutofillPasswordSurvey{"AutofillP base::FEATURE_DISABLED_BY_DEFAULT}; #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Enables the Restart background mode optimization. When all Chrome UI is // closed and it goes in the background, allows to restart the browser to // discard memory. -@@ -142,7 +142,7 @@ const base::Feature kBorealis{"Borealis", base::FEATUR - const base::Feature kChangePictureVideoMode{"ChangePictureVideoMode", - base::FEATURE_ENABLED_BY_DEFAULT}; - --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - // Controls whether Chrome Apps are supported. See https://crbug.com/1221251. - // If the feature is disabled, Chrome Apps continue to work. If enabled, Chrome - // Apps will not launch and will be marked in the UI as deprecated. -@@ -298,7 +298,7 @@ const base::Feature kDesktopPWAsNotificationIconAndTit +@@ -295,7 +295,7 @@ const base::Feature kDesktopPWAsNotificationIconAndTit // Enables or disables Desktop PWAs to be auto-started on OS login. const base::Feature kDesktopPWAsRunOnOsLogin { "DesktopPWAsRunOnOsLogin", -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT -@@ -320,7 +320,7 @@ const base::Feature kDesktopPWAsWebBundles{"DesktopPWA +@@ -317,7 +317,7 @@ const base::Feature kDesktopPWAsWebBundles{"DesktopPWA base::FEATURE_DISABLED_BY_DEFAULT}; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Serves web app settings at chrome://app-settings/. const base::Feature kDesktopPWAsWebAppSettingsPage{ "DesktopPWAsWebAppSettingsPage", base::FEATURE_ENABLED_BY_DEFAULT}; -@@ -330,7 +330,7 @@ const base::Feature kDesktopPWAsWebAppSettingsPage{ +@@ -332,7 +332,7 @@ const base::Feature kChromeAppsDeprecation{"ChromeApps const base::Feature kDnsOverHttps { "DnsOverHttps", #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT -@@ -352,7 +352,7 @@ const base::FeatureParam kDnsOverHttpsFallbackPa +@@ -348,7 +348,7 @@ const base::FeatureParam kDnsOverHttpsFallbackPa const base::FeatureParam kDnsOverHttpsShowUiParam { &kDnsOverHttps, "ShowUi", #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) true #else false -@@ -624,7 +624,7 @@ const base::Feature kIncognitoNtpRevamp{"IncognitoNtpR - base::FEATURE_DISABLED_BY_DEFAULT}; - - #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - // When enabled, removes any theme or background customization done by the user - // on the Incognito UI. - const base::Feature kIncognitoBrandConsistencyForDesktop{ -@@ -658,7 +658,7 @@ const base::Feature kLinkCapturingUiUpdate{"LinkCaptur - base::FEATURE_DISABLED_BY_DEFAULT}; +@@ -639,7 +639,7 @@ const base::Feature kKernelnextVMs{"KernelnextVMs", + base::FEATURE_DISABLED_BY_DEFAULT}; #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) const base::Feature kLinuxLowMemoryMonitor{"LinuxLowMemoryMonitor", base::FEATURE_DISABLED_BY_DEFAULT}; -@@ -671,7 +671,7 @@ constexpr base::FeatureParam kLinuxLowMemoryMonit +@@ -652,7 +652,7 @@ constexpr base::FeatureParam kLinuxLowMemoryMonit &kLinuxLowMemoryMonitor, "critical_level", 255}; #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) const base::Feature kListWebAppsSwitch{"ListWebAppsSwitch", base::FEATURE_DISABLED_BY_DEFAULT}; #endif diff --git a/www/chromium/files/patch-chrome_common_chrome__features.h b/www/chromium/files/patch-chrome_common_chrome__features.h index 3b67fb09a8e2..191bf1960fcd 100644 --- a/www/chromium/files/patch-chrome_common_chrome__features.h +++ b/www/chromium/files/patch-chrome_common_chrome__features.h @@ -1,65 +1,47 @@ ---- chrome/common/chrome_features.h.orig 2022-03-25 21:59:56 UTC +--- chrome/common/chrome_features.h.orig 2022-04-21 18:48:31 UTC +++ chrome/common/chrome_features.h -@@ -90,7 +90,7 @@ extern const base::Feature kArcPiGhostWindow; +@@ -95,7 +95,7 @@ extern const base::Feature kArcPiGhostWindow; COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAsyncDns; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAutofillAddressSurvey; COMPONENT_EXPORT(CHROME_FEATURES) -@@ -99,7 +99,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -104,7 +104,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAutofillPasswordSurvey; #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kBackgroundModeAllowRestart; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -121,7 +121,7 @@ extern const base::Feature kBrowserAppInstanceTracking - COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kChangePictureVideoMode; - --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kChromeAppsDeprecation; - #endif @@ -219,7 +219,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kDesktopPWAsWebBundles; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kDesktopPWAsWebAppSettingsPage; - #endif -@@ -425,7 +425,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kIncognitoNtpRevamp; - - #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kIncognitoBrandConsistencyForDesktop; - -@@ -452,7 +452,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kLinkCapturingUiUpdate; +@@ -440,7 +440,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) + extern const base::Feature kKernelnextVMs; #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) -+#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kLinuxLowMemoryMonitor; COMPONENT_EXPORT(CHROME_FEATURES) -@@ -461,7 +461,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -449,7 +449,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::FeatureParam kLinuxLowMemoryMonitorCriticalLevel; #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kListWebAppsSwitch; #endif diff --git a/www/chromium/files/patch-chrome_common_chrome__paths.cc b/www/chromium/files/patch-chrome_common_chrome__paths.cc index e1f38716831e..1f9c0bc83498 100644 --- a/www/chromium/files/patch-chrome_common_chrome__paths.cc +++ b/www/chromium/files/patch-chrome_common_chrome__paths.cc @@ -1,80 +1,80 @@ ---- chrome/common/chrome_paths.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/common/chrome_paths.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/common/chrome_paths.cc -@@ -44,14 +44,14 @@ +@@ -48,14 +48,14 @@ namespace { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // The path to the external extension .json files. // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ const base::FilePath::CharType kFilepathSinglePrefExtensions[] = #if BUILDFLAG(GOOGLE_CHROME_BRANDING) - FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); + FILE_PATH_LITERAL("/usr/local/share/chromium/extensions"); #else - FILE_PATH_LITERAL("/usr/share/chromium/extensions"); + FILE_PATH_LITERAL("/usr/local/share/chromium/extensions"); #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -178,7 +178,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -182,7 +182,7 @@ bool PathProvider(int key, base::FilePath* result) { return false; break; case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (!GetUserDownloadsDirectorySafe(&cur)) return false; break; -@@ -407,10 +407,12 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -429,10 +429,12 @@ bool PathProvider(int key, base::FilePath* result) { if (!base::PathExists(cur)) // We don't want to create this return false; break; -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) case chrome::DIR_POLICY_FILES: { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) cur = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); +#elif BUILDFLAG(IS_FREEBSD) + cur = base::FilePath(FILE_PATH_LITERAL("/usr/local/etc/chromium/policies")); #else cur = base::FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); #endif -@@ -422,7 +424,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -444,7 +446,7 @@ bool PathProvider(int key, base::FilePath* result) { #if BUILDFLAG(IS_CHROMEOS_ASH) || \ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ BUILDFLAG(CHROMIUM_BRANDING)) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { if (!base::PathService::Get(chrome::DIR_USER_DATA, &cur)) return false; -@@ -430,7 +432,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -452,7 +454,7 @@ bool PathProvider(int key, base::FilePath* result) { break; } #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { cur = base::FilePath(kFilepathSinglePrefExtensions); break; -@@ -475,7 +477,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -496,7 +498,7 @@ bool PathProvider(int key, base::FilePath* result) { break; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) case chrome::DIR_NATIVE_MESSAGING: #if BUILDFLAG(IS_MAC) #if BUILDFLAG(GOOGLE_CHROME_BRANDING) -@@ -489,6 +491,9 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -510,6 +512,9 @@ bool PathProvider(int key, base::FilePath* result) { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) cur = base::FilePath(FILE_PATH_LITERAL( "/etc/opt/chrome/native-messaging-hosts")); +#elif BUILDFLAG(IS_FREEBSD) + cur = base::FilePath(FILE_PATH_LITERAL( + "/usr/local/etc/chromium/native-messaging-hosts")); #else cur = base::FilePath(FILE_PATH_LITERAL( "/etc/chromium/native-messaging-hosts")); diff --git a/www/chromium/files/patch-chrome_common_chrome__paths.h b/www/chromium/files/patch-chrome_common_chrome__paths.h index f46d13f76e3d..1941de84727c 100644 --- a/www/chromium/files/patch-chrome_common_chrome__paths.h +++ b/www/chromium/files/patch-chrome_common_chrome__paths.h @@ -1,29 +1,29 @@ ---- chrome/common/chrome_paths.h.orig 2022-02-28 16:54:41 UTC +--- chrome/common/chrome_paths.h.orig 2022-04-21 18:48:31 UTC +++ chrome/common/chrome_paths.h @@ -56,7 +56,7 @@ enum { #if BUILDFLAG(IS_CHROMEOS_ASH) || \ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ BUILDFLAG(CHROMIUM_BRANDING)) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) DIR_USER_EXTERNAL_EXTENSIONS, // Directory for per-user external extensions // on Chrome Mac and Chromium Linux. // On Chrome OS, this path is used for OEM @@ -64,7 +64,7 @@ enum { // create it. #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) DIR_STANDALONE_EXTERNAL_EXTENSIONS, // Directory for 'per-extension' // definition manifest files that // describe extensions which are to be -@@ -105,7 +105,7 @@ enum { +@@ -114,7 +114,7 @@ enum { DIR_CHROMEOS_CUSTOM_WALLPAPERS, // Directory where custom wallpapers // reside. #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) DIR_NATIVE_MESSAGING, // System directory where native messaging host // manifest files are stored. DIR_USER_NATIVE_MESSAGING, // Directory with Native Messaging Hosts diff --git a/www/chromium/files/patch-chrome_common_chrome__switches.cc b/www/chromium/files/patch-chrome_common_chrome__switches.cc index ab6024cfaf34..ecd8b4312283 100644 --- a/www/chromium/files/patch-chrome_common_chrome__switches.cc +++ b/www/chromium/files/patch-chrome_common_chrome__switches.cc @@ -1,19 +1,19 @@ ---- chrome/common/chrome_switches.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/common/chrome_switches.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/common/chrome_switches.cc -@@ -794,14 +794,14 @@ const char kAllowNaClSocketAPI[] = "allow-n +@@ -802,14 +802,14 @@ const char kAllowNaClSocketAPI[] = "allow-n #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kEnableNewAppMenuIcon[] = "enable-new-app-menu-icon"; // Causes the browser to launch directly in guest mode. const char kGuest[] = "guest"; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Writes open and installed web apps for each profile to the specified file // without launching a new browser window or tab. Pass a absolute file path to // specify where to output the information. Can be used together with optional diff --git a/www/chromium/files/patch-chrome_common_chrome__switches.h b/www/chromium/files/patch-chrome_common_chrome__switches.h index 829297f466f5..44baa2226b06 100644 --- a/www/chromium/files/patch-chrome_common_chrome__switches.h +++ b/www/chromium/files/patch-chrome_common_chrome__switches.h @@ -1,17 +1,17 @@ ---- chrome/common/chrome_switches.h.orig 2022-03-25 21:59:56 UTC +--- chrome/common/chrome_switches.h.orig 2022-04-21 18:48:31 UTC +++ chrome/common/chrome_switches.h -@@ -248,12 +248,12 @@ extern const char kAllowNaClSocketAPI[]; +@@ -249,12 +249,12 @@ extern const char kAllowNaClSocketAPI[]; #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) extern const char kEnableNewAppMenuIcon[]; extern const char kGuest[]; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) extern const char kListApps[]; extern const char kProfileBaseName[]; #endif diff --git a/www/chromium/files/patch-chrome_common_media_cdm__host__file__path.cc b/www/chromium/files/patch-chrome_common_media_cdm__host__file__path.cc index 873a1ba191c0..949e51e76efb 100644 --- a/www/chromium/files/patch-chrome_common_media_cdm__host__file__path.cc +++ b/www/chromium/files/patch-chrome_common_media_cdm__host__file__path.cc @@ -1,11 +1,11 @@ ---- chrome/common/media/cdm_host_file_path.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/common/media/cdm_host_file_path.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/common/media/cdm_host_file_path.cc -@@ -95,7 +95,7 @@ void AddCdmHostFilePaths( +@@ -94,7 +94,7 @@ void AddCdmHostFilePaths( cdm_host_file_paths->emplace_back(chrome_framework_path, chrome_framework_sig_path); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FilePath chrome_exe_dir; if (!base::PathService::Get(base::DIR_EXE, &chrome_exe_dir)) diff --git a/www/chromium/files/patch-chrome_common_pref__names.cc b/www/chromium/files/patch-chrome_common_pref__names.cc index 53d06c28dee5..434ccdd94147 100644 --- a/www/chromium/files/patch-chrome_common_pref__names.cc +++ b/www/chromium/files/patch-chrome_common_pref__names.cc @@ -1,56 +1,56 @@ ---- chrome/common/pref_names.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/common/pref_names.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/common/pref_names.cc -@@ -1188,7 +1188,7 @@ const char kUseAshProxy[] = "lacros.proxy.use_ash_prox +@@ -1189,7 +1189,7 @@ const char kUseAshProxy[] = "lacros.proxy.use_ash_prox // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Linux specific preference on whether we should match the system theme. const char kUsesSystemTheme[] = "extensions.theme.use_system"; #endif -@@ -1291,7 +1291,7 @@ const char kShowUpdatePromotionInfoBar[] = +@@ -1292,7 +1292,7 @@ const char kShowUpdatePromotionInfoBar[] = // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Boolean that is false if we should show window manager decorations. If // true, we draw a custom chrome frame (thicker title bar and blue border). const char kUseCustomChromeFrame[] = "browser.custom_chrome_frame"; -@@ -1780,7 +1780,7 @@ const char kDownloadDefaultDirectory[] = "download.def - const char kDownloadDirUpgraded[] = "download.directory_upgrade"; +@@ -1777,7 +1777,7 @@ const char kDownloadDirUpgraded[] = "download.director + const char kDownloadLastCompleteTime[] = "download.last_complete_time"; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) const char kOpenPdfDownloadInSystemReader[] = "download.open_pdf_in_system_reader"; #endif -@@ -2069,7 +2069,7 @@ const char kWebAppsPreferences[] = "web_apps.web_app_i +@@ -2066,7 +2066,7 @@ const char kWebAppsPreferences[] = "web_apps.web_app_i // its isolation requirements. const char kWebAppsIsolationState[] = "web_apps.isolation_state"; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) // Dictionary that maps origins to web apps that can act as URL handlers. const char kWebAppsUrlHandlerInfo[] = "web_apps.url_handler_info"; -@@ -2199,7 +2199,7 @@ const char kAmbientAuthenticationInPrivateModesEnabled +@@ -2196,7 +2196,7 @@ const char kAmbientAuthenticationInPrivateModesEnabled // requests. const char kBasicAuthOverHttpEnabled[] = "auth.basic_over_http_enabled"; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Boolean that specifies whether OK-AS-DELEGATE flag from KDC is respected // along with kAuthNegotiateDelegateAllowlist. const char kAuthNegotiateDelegateByKdcPolicy[] = -@@ -3129,7 +3129,7 @@ const char kBlockAutoplayEnabled[] = "media.block_auto +@@ -3126,7 +3126,7 @@ const char kBlockAutoplayEnabled[] = "media.block_auto const char kSandboxExternalProtocolBlocked[] = "profile.sandbox_external_protocol_blocked"; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Boolean that indicates if native notifications are allowed to be used in // place of Chrome notifications. Will be replaced by kAllowSystemNotifications. const char kAllowNativeNotifications[] = "native_notifications.allowed"; diff --git a/www/chromium/files/patch-chrome_common_pref__names.h b/www/chromium/files/patch-chrome_common_pref__names.h index fb5c6a3b3159..5df4c8091c2b 100644 --- a/www/chromium/files/patch-chrome_common_pref__names.h +++ b/www/chromium/files/patch-chrome_common_pref__names.h @@ -1,56 +1,56 @@ ---- chrome/common/pref_names.h.orig 2022-03-25 21:59:56 UTC +--- chrome/common/pref_names.h.orig 2022-04-21 18:48:31 UTC +++ chrome/common/pref_names.h @@ -372,7 +372,7 @@ extern const char kUseAshProxy[]; #endif // BUILDFLAG(IS_CHROMEOS_LACROS) // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) extern const char kUsesSystemTheme[]; #endif extern const char kCurrentThemePackFilename[]; @@ -401,7 +401,7 @@ extern const char kShowUpdatePromotionInfoBar[]; #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) extern const char kUseCustomChromeFrame[]; #endif #if BUILDFLAG(ENABLE_PLUGINS) -@@ -584,7 +584,7 @@ extern const char kDownloadExtensionsToOpenByPolicy[]; - extern const char kDownloadAllowedURLsForOpenByPolicy[]; +@@ -585,7 +585,7 @@ extern const char kDownloadAllowedURLsForOpenByPolicy[ extern const char kDownloadDirUpgraded[]; + extern const char kDownloadLastCompleteTime[]; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) extern const char kOpenPdfDownloadInSystemReader[]; #endif #if BUILDFLAG(IS_ANDROID) -@@ -691,7 +691,7 @@ extern const char kWebAppsUninstalledDefaultChromeApps +@@ -692,7 +692,7 @@ extern const char kWebAppsUninstalledDefaultChromeApps extern const char kWebAppsPreferences[]; extern const char kWebAppsIsolationState[]; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) extern const char kWebAppsUrlHandlerInfo[]; #endif -@@ -830,7 +830,7 @@ extern const char kGloballyScopeHTTPAuthCacheEnabled[] +@@ -831,7 +831,7 @@ extern const char kGloballyScopeHTTPAuthCacheEnabled[] extern const char kAmbientAuthenticationInPrivateModesEnabled[]; extern const char kBasicAuthOverHttpEnabled[]; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) extern const char kAuthNegotiateDelegateByKdcPolicy[]; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) -@@ -1068,7 +1068,7 @@ extern const char kBlockAutoplayEnabled[]; +@@ -1069,7 +1069,7 @@ extern const char kBlockAutoplayEnabled[]; #endif extern const char kSandboxExternalProtocolBlocked[]; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kAllowNativeNotifications[]; extern const char kAllowSystemNotifications[]; #endif diff --git a/www/chromium/files/patch-chrome_common_url__constants.cc b/www/chromium/files/patch-chrome_common_url__constants.cc new file mode 100644 index 000000000000..838f406abc82 --- /dev/null +++ b/www/chromium/files/patch-chrome_common_url__constants.cc @@ -0,0 +1,11 @@ +--- chrome/common/url_constants.cc.orig 2022-04-21 18:48:31 UTC ++++ chrome/common/url_constants.cc +@@ -489,7 +489,7 @@ const char kPhoneHubPermissionLearnMoreURL[] = + "https://support.google.com/chromebook/?p=multidevice"; + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + const char kChromeAppsDeprecationLearnMoreURL[] = + "https://support.google.com/chrome/?p=chrome_app_deprecation"; + #endif diff --git a/www/chromium/files/patch-chrome_common_url__constants.h b/www/chromium/files/patch-chrome_common_url__constants.h new file mode 100644 index 000000000000..d785f26f838f --- /dev/null +++ b/www/chromium/files/patch-chrome_common_url__constants.h @@ -0,0 +1,11 @@ +--- chrome/common/url_constants.h.orig 2022-04-21 18:48:31 UTC ++++ chrome/common/url_constants.h +@@ -452,7 +452,7 @@ extern const char kOutdatedPluginLearnMoreURL[]; + extern const char kPhoneHubPermissionLearnMoreURL[]; + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + + // "Learn more" URL for the chrome apps deprecation dialog. + extern const char kChromeAppsDeprecationLearnMoreURL[]; diff --git a/www/chromium/files/patch-chrome_common_webui__url__constants.cc b/www/chromium/files/patch-chrome_common_webui__url__constants.cc index dd1a55383bf2..66b4083e6443 100644 --- a/www/chromium/files/patch-chrome_common_webui__url__constants.cc +++ b/www/chromium/files/patch-chrome_common_webui__url__constants.cc @@ -1,94 +1,68 @@ ---- chrome/common/webui_url_constants.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/common/webui_url_constants.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/common/webui_url_constants.cc -@@ -434,18 +434,18 @@ const char kOsUIFlagsURL[] = "os://flags"; +@@ -440,18 +440,18 @@ const char kOsUIFlagsURL[] = "os://flags"; const char kOsUIVersionURL[] = "os://version"; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const char kChromeUIWebUIJsErrorHost[] = "webuijserror"; const char kChromeUIWebUIJsErrorURL[] = "chrome://webuijserror/"; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) +- BUILDFLAG(IS_CHROMEOS_ASH) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) const char kChromeUIConnectorsInternalsHost[] = "connectors-internals"; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const char kChromeUIDiscardsHost[] = "discards"; const char kChromeUIDiscardsURL[] = "chrome://discards/"; #endif -@@ -460,14 +460,14 @@ const char kChromeUILinuxProxyConfigHost[] = "linux-pr +@@ -466,14 +466,14 @@ const char kChromeUILinuxProxyConfigHost[] = "linux-pr #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) const char kChromeUISandboxHost[] = "sandbox"; #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) const char kChromeUIBrowserSwitchHost[] = "browser-switch"; const char kChromeUIBrowserSwitchURL[] = "chrome://browser-switch/"; const char kChromeUIEnterpriseProfileWelcomeHost[] = -@@ -482,7 +482,7 @@ const char kChromeUIProfilePickerUrl[] = "chrome://pro +@@ -488,7 +488,7 @@ const char kChromeUIProfilePickerUrl[] = "chrome://pro const char kChromeUIProfilePickerStartupQuery[] = "startup"; #endif -#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ defined(TOOLKIT_VIEWS)) || \ defined(USE_AURA) const char kChromeUITabModalConfirmDialogHost[] = "tab-modal-confirm-dialog"; -@@ -554,7 +554,7 @@ const char kPrivacySandboxSubPagePath[] = "/privacySan +@@ -561,7 +561,7 @@ const char kPrivacySandboxSubPagePath[] = "/privacySan #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const char kChromeUIWebAppSettingsURL[] = "chrome://app-settings/"; const char kChromeUIWebAppSettingsHost[] = "app-settings"; #endif -@@ -678,21 +678,21 @@ const char* const kChromeHostURLs[] = { - kChromeUIAssistantOptInHost, - #endif - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - kChromeUIConnectorsInternalsHost, - #endif - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - kChromeUIDiscardsHost, - #endif --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - kChromeUIWebAppSettingsHost, - #endif - #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) - kChromeUILinuxProxyConfigHost, - #endif - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ -- BUILDFLAG(IS_ANDROID) -+ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - kChromeUISandboxHost, - #endif - #if BUILDFLAG(IS_WIN) -@@ -749,7 +749,7 @@ const char* const kChromeDebugURLs[] = { +@@ -758,7 +758,7 @@ const char* const kChromeDebugURLs[] = { blink::kChromeUIGpuJavaCrashURL, kChromeUIJavaCrashURL, #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) kChromeUIWebUIJsErrorURL, #endif kChromeUIQuitURL, diff --git a/www/chromium/files/patch-chrome_common_webui__url__constants.h b/www/chromium/files/patch-chrome_common_webui__url__constants.h index 333baaec3462..2a7f8bc6f0c9 100644 --- a/www/chromium/files/patch-chrome_common_webui__url__constants.h +++ b/www/chromium/files/patch-chrome_common_webui__url__constants.h @@ -1,57 +1,57 @@ ---- chrome/common/webui_url_constants.h.orig 2022-03-25 21:59:56 UTC +--- chrome/common/webui_url_constants.h.orig 2022-04-21 18:48:31 UTC +++ chrome/common/webui_url_constants.h -@@ -371,24 +371,24 @@ extern const char kOsUIFlagsURL[]; +@@ -376,24 +376,24 @@ extern const char kOsUIFlagsURL[]; extern const char kOsUIVersionURL[]; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) extern const char kChromeUIWebUIJsErrorHost[]; extern const char kChromeUIWebUIJsErrorURL[]; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) +- BUILDFLAG(IS_CHROMEOS_ASH) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) extern const char kChromeUIConnectorsInternalsHost[]; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kChromeUIDiscardsHost[]; extern const char kChromeUIDiscardsURL[]; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kChromeUIWebAppSettingsURL[]; extern const char kChromeUIWebAppSettingsHost[]; #endif -@@ -403,14 +403,14 @@ extern const char kChromeUILinuxProxyConfigHost[]; +@@ -408,14 +408,14 @@ extern const char kChromeUILinuxProxyConfigHost[]; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) extern const char kChromeUISandboxHost[]; #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) ++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) extern const char kChromeUIBrowserSwitchHost[]; extern const char kChromeUIBrowserSwitchURL[]; extern const char kChromeUIEnterpriseProfileWelcomeHost[]; -@@ -422,7 +422,7 @@ extern const char kChromeUIProfilePickerUrl[]; +@@ -427,7 +427,7 @@ extern const char kChromeUIProfilePickerUrl[]; extern const char kChromeUIProfilePickerStartupQuery[]; #endif -#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ defined(TOOLKIT_VIEWS)) || \ defined(USE_AURA) extern const char kChromeUITabModalConfirmDialogHost[]; diff --git a/www/chromium/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.cc b/www/chromium/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.cc deleted file mode 100644 index 4d85f8661941..000000000000 --- a/www/chromium/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.cc +++ /dev/null @@ -1,29 +0,0 @@ ---- chrome/renderer/pepper/pepper_flash_font_file_host.cc.orig 2022-02-28 16:54:41 UTC -+++ chrome/renderer/pepper/pepper_flash_font_file_host.cc -@@ -16,7 +16,7 @@ - #include "ppapi/proxy/ppapi_messages.h" - #include "ppapi/proxy/serialized_structs.h" - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - #include "components/services/font/public/cpp/font_loader.h" - #include "pdf/font_table_linux.h" - #elif BUILDFLAG(IS_WIN) -@@ -30,7 +30,7 @@ PepperFlashFontFileHost::PepperFlashFontFileHost( - const ppapi::proxy::SerializedFontDescription& description, - PP_PrivateFontCharset charset) - : ResourceHost(host->GetPpapiHost(), instance, resource) { --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - // The global SkFontConfigInterface is configured and initialized with a - // SkFontconfigInterface compatible font_service::FontLoader in - // RendererBlinkPlatformImpl (called from RenderThreadImpl::Init) at startup -@@ -75,7 +75,7 @@ bool PepperFlashFontFileHost::GetFontData(uint32_t tab - void* buffer, - size_t* length) { - bool result = false; --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - if (font_file_.IsValid()) { - result = - pdf::GetFontTable(font_file_.GetPlatformFile(), table, /*offset=*/0, diff --git a/www/chromium/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.h b/www/chromium/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.h deleted file mode 100644 index 187f57b7afe2..000000000000 --- a/www/chromium/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.h +++ /dev/null @@ -1,20 +0,0 @@ ---- chrome/renderer/pepper/pepper_flash_font_file_host.h.orig 2022-02-28 16:54:41 UTC -+++ chrome/renderer/pepper/pepper_flash_font_file_host.h -@@ -12,7 +12,7 @@ - #include "ppapi/c/private/pp_private_font_charset.h" - #include "ppapi/host/resource_host.h" - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - #include "base/files/file.h" - #elif BUILDFLAG(IS_WIN) - #include "third_party/skia/include/core/SkRefCnt.h" -@@ -52,7 +52,7 @@ class PepperFlashFontFileHost : public ppapi::host::Re - uint32_t table); - bool GetFontData(uint32_t table, void* buffer, size_t* length); - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - base::File font_file_; - #elif BUILDFLAG(IS_WIN) - sk_sp typeface_; diff --git a/www/chromium/files/patch-chrome_services_file__util_public_mojom_safe__document__analyzer__mojom__traits.h b/www/chromium/files/patch-chrome_services_file__util_public_mojom_safe__document__analyzer__mojom__traits.h index 541fef965169..5c518b71e159 100644 --- a/www/chromium/files/patch-chrome_services_file__util_public_mojom_safe__document__analyzer__mojom__traits.h +++ b/www/chromium/files/patch-chrome_services_file__util_public_mojom_safe__document__analyzer__mojom__traits.h @@ -1,11 +1,11 @@ ---- chrome/services/file_util/public/mojom/safe_document_analyzer_mojom_traits.h.orig 2022-02-28 16:54:41 UTC +--- chrome/services/file_util/public/mojom/safe_document_analyzer_mojom_traits.h.orig 2022-04-21 18:48:31 UTC +++ chrome/services/file_util/public/mojom/safe_document_analyzer_mojom_traits.h -@@ -15,7 +15,7 @@ +@@ -16,7 +16,7 @@ #include "mojo/public/cpp/bindings/struct_traits.h" #if !BUILDFLAG(FULL_SAFE_BROWSING) || \ - (!BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_WIN)) + (!BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD)) #error BUILDFLAG(FULL_SAFE_BROWSING) should be set and either OS_LINUX or OS_WIN defined. #endif diff --git a/www/chromium/files/patch-chrome_test_BUILD.gn b/www/chromium/files/patch-chrome_test_BUILD.gn index ef240340c679..51d857c5e702 100644 --- a/www/chromium/files/patch-chrome_test_BUILD.gn +++ b/www/chromium/files/patch-chrome_test_BUILD.gn @@ -1,11 +1,11 @@ ---- chrome/test/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- chrome/test/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ chrome/test/BUILD.gn -@@ -9110,7 +9110,7 @@ test("chrome_app_unittests") { +@@ -9278,7 +9278,7 @@ test("chrome_app_unittests") { + "//components/heap_profiling/in_process", "//components/safe_browsing:buildflags", - "//pdf:pdf_ppapi", ] - if (!is_fuchsia) { + if (!is_fuchsia && !is_bsd) { deps += [ "//third_party/breakpad:client" ] } if (enable_gwp_asan) { diff --git a/www/chromium/files/patch-chrome_test_chromedriver_chrome_chrome__finder.cc b/www/chromium/files/patch-chrome_test_chromedriver_chrome_chrome__finder.cc index f138044f8a19..ce32ad6feb3a 100644 --- a/www/chromium/files/patch-chrome_test_chromedriver_chrome_chrome__finder.cc +++ b/www/chromium/files/patch-chrome_test_chromedriver_chrome_chrome__finder.cc @@ -1,20 +1,20 @@ ---- chrome/test/chromedriver/chrome/chrome_finder.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/test/chromedriver/chrome/chrome_finder.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/test/chromedriver/chrome/chrome_finder.cc -@@ -54,7 +54,7 @@ void GetApplicationDirs(std::vector* l +@@ -53,7 +53,7 @@ void GetApplicationDirs(std::vector* l installation_locations[i].Append(L"Chromium\\Application")); } } -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void GetApplicationDirs(std::vector* locations) { // TODO: Respect users' PATH variables. // Until then, we use an approximation of the most common defaults. -@@ -139,7 +139,7 @@ bool FindChrome(base::FilePath* browser_exe) { +@@ -138,7 +138,7 @@ bool FindChrome(base::FilePath* browser_exe) { base::FilePath browser_exes_array[] = { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) base::FilePath(chrome::kBrowserProcessExecutablePath), -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FilePath("google-chrome"), base::FilePath(chrome::kBrowserProcessExecutablePath), base::FilePath("chromium"), diff --git a/www/chromium/files/patch-chrome_updater_app_app__install.cc b/www/chromium/files/patch-chrome_updater_app_app__install.cc index d423ee18e7ba..19d6a80a76cd 100644 --- a/www/chromium/files/patch-chrome_updater_app_app__install.cc +++ b/www/chromium/files/patch-chrome_updater_app_app__install.cc @@ -1,11 +1,11 @@ ---- chrome/updater/app/app_install.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/updater/app/app_install.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/updater/app/app_install.cc -@@ -166,7 +166,7 @@ void AppInstall::WakeCandidate() { +@@ -188,7 +188,7 @@ void AppInstall::WakeCandidate() { update_service_internal, base::WrapRefCounted(this))); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // TODO(crbug.com/1276114) - implement. void AppInstall::WakeCandidateDone() { NOTIMPLEMENTED(); diff --git a/www/chromium/files/patch-chrome_updater_installer.cc b/www/chromium/files/patch-chrome_updater_installer.cc index 07a35f01a7cd..c175cd231f61 100644 --- a/www/chromium/files/patch-chrome_updater_installer.cc +++ b/www/chromium/files/patch-chrome_updater_installer.cc @@ -1,11 +1,11 @@ ---- chrome/updater/installer.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/updater/installer.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/updater/installer.cc -@@ -225,7 +225,7 @@ absl::optional Installer::GetCurrentIn +@@ -228,7 +228,7 @@ absl::optional Installer::GetCurrentIn return path->AppendASCII(pv_.GetString()); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) Installer::Result Installer::RunApplicationInstaller( const base::FilePath& /*app_installer*/, const std::string& /*arguments*/, diff --git a/www/chromium/files/patch-chrome_updater_util.cc b/www/chromium/files/patch-chrome_updater_util.cc index 9bd0f87d8112..ac5775b8f153 100644 --- a/www/chromium/files/patch-chrome_updater_util.cc +++ b/www/chromium/files/patch-chrome_updater_util.cc @@ -1,11 +1,11 @@ ---- chrome/updater/util.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/updater/util.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/updater/util.cc -@@ -253,7 +253,7 @@ GURL AppendQueryParameter(const GURL& url, +@@ -265,7 +265,7 @@ GURL AppendQueryParameter(const GURL& url, return url.ReplaceComponents(replacements); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // TODO(crbug.com/1276188) - implement the functions below. absl::optional GetUpdaterFolderPath(UpdaterScope scope) { diff --git a/www/chromium/files/patch-chrome_utility_services.cc b/www/chromium/files/patch-chrome_utility_services.cc index 85d42621c26b..f78a75241d29 100644 --- a/www/chromium/files/patch-chrome_utility_services.cc +++ b/www/chromium/files/patch-chrome_utility_services.cc @@ -1,29 +1,56 @@ ---- chrome/utility/services.cc.orig 2022-03-25 21:59:56 UTC +--- chrome/utility/services.cc.orig 2022-04-21 18:48:31 UTC +++ chrome/utility/services.cc -@@ -63,7 +63,7 @@ +@@ -28,7 +28,7 @@ + #include "printing/buildflags/buildflags.h" + #include "ui/accessibility/accessibility_features.h" + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include "components/services/screen_ai/screen_ai_service_impl.h" + #endif + +@@ -67,7 +67,7 @@ #include "chrome/services/file_util/file_util_service.h" // nogncheck #endif -#if BUILDFLAG(FULL_SAFE_BROWSING) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)) +#if BUILDFLAG(FULL_SAFE_BROWSING) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)) #include "chrome/services/file_util/document_analysis_service.h" // nogncheck #endif -@@ -216,7 +216,7 @@ auto RunCupsIppParser( +@@ -213,7 +213,7 @@ auto RunSpeechRecognitionService( + } + #endif // !BUILDFLAG(IS_ANDROID) + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + auto RunScreenAIService( + mojo::PendingReceiver receiver) { + return std::make_unique(std::move(receiver)); +@@ -227,7 +227,7 @@ auto RunCupsIppParser( } #endif -#if BUILDFLAG(FULL_SAFE_BROWSING) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)) +#if BUILDFLAG(FULL_SAFE_BROWSING) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)) auto RunDocumentAnalysis( mojo::PendingReceiver receiver) { return std::make_unique(std::move(receiver)); -@@ -382,7 +382,7 @@ void RegisterMainThreadServices(mojo::ServiceFactory& +@@ -374,7 +374,7 @@ void RegisterMainThreadServices(mojo::ServiceFactory& + services.Add(RunSpeechRecognitionService); + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + if (features::IsScreenAIEnabled()) + services.Add(RunScreenAIService); + #endif +@@ -398,7 +398,7 @@ void RegisterMainThreadServices(mojo::ServiceFactory& services.Add(RunFileUtil); #endif -#if BUILDFLAG(FULL_SAFE_BROWSING) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)) +#if BUILDFLAG(FULL_SAFE_BROWSING) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)) services.Add(RunDocumentAnalysis); #endif diff --git a/www/chromium/files/patch-chromecast_browser_cast__browser__main__parts.cc b/www/chromium/files/patch-chromecast_browser_cast__browser__main__parts.cc index 3ca48b9601e4..5873aa782b6b 100644 --- a/www/chromium/files/patch-chromecast_browser_cast__browser__main__parts.cc +++ b/www/chromium/files/patch-chromecast_browser_cast__browser__main__parts.cc @@ -1,65 +1,65 @@ ---- chromecast/browser/cast_browser_main_parts.cc.orig 2022-03-25 21:59:56 UTC +--- chromecast/browser/cast_browser_main_parts.cc.orig 2022-04-21 18:48:31 UTC +++ chromecast/browser/cast_browser_main_parts.cc -@@ -93,7 +93,7 @@ +@@ -92,7 +92,7 @@ #include "ui/base/ui_base_switches.h" #include "ui/gl/gl_switches.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #include #include -@@ -148,7 +148,7 @@ +@@ -147,7 +147,7 @@ #include "extensions/browser/extension_prefs.h" // nogncheck #endif -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) #include "chromecast/browser/exo/wayland_server_controller.h" #endif -@@ -284,7 +284,7 @@ class CastViewsDelegate : public views::ViewsDelegate +@@ -283,7 +283,7 @@ class CastViewsDelegate : public views::ViewsDelegate #endif // defined(USE_AURA) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FilePath GetApplicationFontsDir() { std::unique_ptr env(base::Environment::Create()); -@@ -330,7 +330,7 @@ const DefaultCommandLineSwitch kDefaultSwitches[] = { +@@ -329,7 +329,7 @@ const DefaultCommandLineSwitch kDefaultSwitches[] = { {cc::switches::kDisableThreadedAnimation, ""}, #endif // BUILDFLAG(IS_ANDROID) #endif // BUILDFLAG(IS_CAST_AUDIO_ONLY) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #if defined(ARCH_CPU_X86_FAMILY) // This is needed for now to enable the x11 Ozone platform to work with // current Linux/NVidia OpenGL drivers. -@@ -522,7 +522,7 @@ void CastBrowserMainParts::ToolkitInitialized() { +@@ -521,7 +521,7 @@ void CastBrowserMainParts::ToolkitInitialized() { views_delegate_ = std::make_unique(); #endif // defined(USE_AURA) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FilePath dir_font = GetApplicationFontsDir(); const FcChar8 *dir_font_char8 = reinterpret_cast(dir_font.value().data()); if (!FcConfigAppFontAddDir(gfx::GetGlobalFontConfig(), dir_font_char8)) { -@@ -753,7 +753,7 @@ int CastBrowserMainParts::PreMainMessageLoopRun() { +@@ -752,7 +752,7 @@ int CastBrowserMainParts::PreMainMessageLoopRun() { cast_browser_process_->browser_context()); #endif -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) wayland_server_controller_ = std::make_unique(window_manager_.get()); #endif -@@ -828,7 +828,7 @@ void CastBrowserMainParts::PostMainMessageLoopRun() { +@@ -827,7 +827,7 @@ void CastBrowserMainParts::PostMainMessageLoopRun() { cast_browser_process_->cast_service()->Stop(); -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) wayland_server_controller_.reset(); #endif #if BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS) diff --git a/www/chromium/files/patch-chromecast_browser_cast__content__browser__client.cc b/www/chromium/files/patch-chromecast_browser_cast__content__browser__client.cc index 5528c5790596..abe79ed7dab4 100644 --- a/www/chromium/files/patch-chromecast_browser_cast__content__browser__client.cc +++ b/www/chromium/files/patch-chromecast_browser_cast__content__browser__client.cc @@ -1,29 +1,29 @@ ---- chromecast/browser/cast_content_browser_client.cc.orig 2022-03-25 21:59:56 UTC +--- chromecast/browser/cast_content_browser_client.cc.orig 2022-04-21 18:48:31 UTC +++ chromecast/browser/cast_content_browser_client.cc -@@ -135,7 +135,7 @@ +@@ -134,7 +134,7 @@ #include "extensions/common/constants.h" // nogncheck #endif -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) #include "chromecast/browser/webview/webview_controller.h" #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) -@@ -476,7 +476,7 @@ void CastContentBrowserClient::AppendExtraCommandLineS +@@ -475,7 +475,7 @@ void CastContentBrowserClient::AppendExtraCommandLineS switches::kAudioOutputChannels)); } } else if (process_type == switches::kGpuProcess) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Necessary for accelerated 2d canvas. By default on Linux, Chromium // assumes GLES2 contexts can be lost to a power-save mode, which breaks GPU // canvas apps. -@@ -872,7 +872,7 @@ CastContentBrowserClient::CreateThrottlesForNavigation +@@ -871,7 +871,7 @@ CastContentBrowserClient::CreateThrottlesForNavigation handle, general_audience_browsing_service_.get())); } -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) auto webview_throttle = WebviewController::MaybeGetNavigationThrottle(handle); if (webview_throttle) { throttles.push_back(std::move(webview_throttle)); diff --git a/www/chromium/files/patch-components_autofill__payments__strings.grdp b/www/chromium/files/patch-components_autofill__payments__strings.grdp index 1de6884e7991..9f6083d67442 100644 --- a/www/chromium/files/patch-components_autofill__payments__strings.grdp +++ b/www/chromium/files/patch-components_autofill__payments__strings.grdp @@ -1,11 +1,11 @@ ---- components/autofill_payments_strings.grdp.orig 2022-02-28 16:54:41 UTC +--- components/autofill_payments_strings.grdp.orig 2022-04-21 18:48:31 UTC +++ components/autofill_payments_strings.grdp -@@ -118,7 +118,7 @@ +@@ -124,7 +124,7 @@ Save card - + Do you want to save this card to your Google Account? diff --git a/www/chromium/files/patch-components_autofill_core_browser_autofill__external__delegate.cc b/www/chromium/files/patch-components_autofill_core_browser_autofill__external__delegate.cc deleted file mode 100644 index 45dda8a49830..000000000000 --- a/www/chromium/files/patch-components_autofill_core_browser_autofill__external__delegate.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- components/autofill/core/browser/autofill_external_delegate.cc.orig 2022-02-28 16:54:41 UTC -+++ components/autofill/core/browser/autofill_external_delegate.cc -@@ -130,7 +130,7 @@ void AutofillExternalDelegate::OnSuggestionsReturned( - // Append the "Hide Suggestions" menu item for only Autofill Address and - // Autocomplete popups. - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || \ -- BUILDFLAG(IS_CHROMEOS) -+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - if (base::FeatureList::IsEnabled( - features::kAutofillEnableHideSuggestionsUI)) { - // If the user has selected a suggestion, it indicates the suggestions are diff --git a/www/chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc b/www/chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc index ad18ab3a2896..e31f9c92af85 100644 --- a/www/chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc +++ b/www/chromium/files/patch-components_autofill_core_browser_personal__data__manager.cc @@ -1,12 +1,12 @@ ---- components/autofill/core/browser/personal_data_manager.cc.orig 2022-03-25 21:59:56 UTC +--- components/autofill/core/browser/personal_data_manager.cc.orig 2022-04-21 18:48:31 UTC +++ components/autofill/core/browser/personal_data_manager.cc -@@ -1986,7 +1986,8 @@ bool PersonalDataManager::ShouldShowCardsFromAccountOp +@@ -1987,7 +1987,8 @@ bool PersonalDataManager::ShouldShowCardsFromAccountOp // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) // This option should only be shown for users that have not enabled the Sync // Feature and that have server credit cards available. if (!sync_service_ || sync_service_->IsSyncFeatureEnabled() || diff --git a/www/chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc b/www/chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc index 43daab06c93c..fcc1c642e53a 100644 --- a/www/chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc +++ b/www/chromium/files/patch-components_autofill_core_common_autofill__payments__features.cc @@ -1,11 +1,11 @@ ---- components/autofill/core/common/autofill_payments_features.cc.orig 2022-03-25 21:59:56 UTC +--- components/autofill/core/common/autofill_payments_features.cc.orig 2022-04-21 18:48:31 UTC +++ components/autofill/core/common/autofill_payments_features.cc -@@ -192,7 +192,7 @@ const base::Feature kAutofillUpstreamAllowAllEmailDoma +@@ -187,7 +187,7 @@ const base::Feature kAutofillUpstreamAllowAllEmailDoma bool ShouldShowImprovedUserConsentForCreditCardSave() { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) // The new user consent UI is fully launched on MacOS, Windows and Linux. return true; diff --git a/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc b/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc index 2104017f79d2..e589ce4ca33e 100644 --- a/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc +++ b/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc @@ -1,21 +1,21 @@ ---- components/feature_engagement/public/feature_list.cc.orig 2022-03-25 21:59:56 UTC +--- components/feature_engagement/public/feature_list.cc.orig 2022-04-21 18:48:31 UTC +++ components/feature_engagement/public/feature_list.cc -@@ -121,7 +121,7 @@ const base::Feature* const kAllFeatures[] = { +@@ -120,7 +120,7 @@ const base::Feature* const kAllFeatures[] = { &kIPHDefaultSiteViewFeature, #endif // BUILDFLAG(IS_IOS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) &kIPHDesktopTabGroupsNewGroupFeature, &kIPHFocusHelpBubbleScreenReaderPromoFeature, &kIPHGMCCastStartStopFeature, -@@ -143,7 +143,8 @@ const base::Feature* const kAllFeatures[] = { +@@ -142,7 +142,8 @@ const base::Feature* const kAllFeatures[] = { // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) &kIPHAutofillVirtualCardSuggestionFeature, #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || diff --git a/www/chromium/files/patch-components_feature__engagement_public_feature__list.h b/www/chromium/files/patch-components_feature__engagement_public_feature__list.h index c69822ee6d85..e7c544fabf01 100644 --- a/www/chromium/files/patch-components_feature__engagement_public_feature__list.h +++ b/www/chromium/files/patch-components_feature__engagement_public_feature__list.h @@ -1,40 +1,40 @@ ---- components/feature_engagement/public/feature_list.h.orig 2022-03-25 21:59:56 UTC +--- components/feature_engagement/public/feature_list.h.orig 2022-04-21 18:48:31 UTC +++ components/feature_engagement/public/feature_list.h -@@ -224,7 +224,7 @@ DEFINE_VARIATION_PARAM(kIPHDefaultSiteViewFeature, "IP +@@ -223,7 +223,7 @@ DEFINE_VARIATION_PARAM(kIPHDefaultSiteViewFeature, "IP #endif // BUILDFLAG(IS_IOS) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) DEFINE_VARIATION_PARAM(kIPHDesktopTabGroupsNewGroupFeature, "IPH_DesktopTabGroupsNewGroup"); DEFINE_VARIATION_PARAM(kIPHFocusModeFeature, "IPH_FocusMode"); -@@ -254,7 +254,8 @@ DEFINE_VARIATION_PARAM(kIPHDesktopSharedHighlightingFe +@@ -253,7 +253,8 @@ DEFINE_VARIATION_PARAM(kIPHDesktopSharedHighlightingFe // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) DEFINE_VARIATION_PARAM(kIPHAutofillVirtualCardSuggestionFeature, "IPH_AutofillVirtualCardSuggestion"); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || -@@ -359,7 +360,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation +@@ -358,7 +359,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation VARIATION_ENTRY(kIPHDiscoverFeedHeaderFeature), VARIATION_ENTRY(kIPHDefaultSiteViewFeature), #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) VARIATION_ENTRY(kIPHDesktopTabGroupsNewGroupFeature), VARIATION_ENTRY(kIPHFocusModeFeature), VARIATION_ENTRY(kIPHGlobalMediaControls), -@@ -382,7 +383,8 @@ constexpr flags_ui::FeatureEntry::FeatureVariation +@@ -381,7 +382,8 @@ constexpr flags_ui::FeatureEntry::FeatureVariation // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) VARIATION_ENTRY(kIPHAutofillVirtualCardSuggestionFeature), #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || diff --git a/www/chromium/files/patch-components_feed_core_v2_proto__util.cc b/www/chromium/files/patch-components_feed_core_v2_proto__util.cc index 823d074da546..e33e80a5cd19 100644 --- a/www/chromium/files/patch-components_feed_core_v2_proto__util.cc +++ b/www/chromium/files/patch-components_feed_core_v2_proto__util.cc @@ -1,24 +1,24 @@ ---- components/feed/core/v2/proto_util.cc.orig 2022-02-28 16:54:41 UTC +--- components/feed/core/v2/proto_util.cc.orig 2022-04-21 18:48:31 UTC +++ components/feed/core/v2/proto_util.cc -@@ -88,8 +88,8 @@ feedwire::Version GetPlatformVersionMessage() { +@@ -90,8 +90,8 @@ feedwire::Version GetPlatformVersionMessage() { int32_t major, minor, revision; base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &revision); - result.set_major(major); - result.set_minor(minor); + result.set_gmajor(major); + result.set_gminor(minor); result.set_revision(revision); #if BUILDFLAG(IS_ANDROID) result.set_api_version(base::android::BuildInfo::GetInstance()->sdk_int()); -@@ -104,8 +104,8 @@ feedwire::Version GetAppVersionMessage(const ChromeInf +@@ -106,8 +106,8 @@ feedwire::Version GetAppVersionMessage(const ChromeInf // Chrome's version is in the format: MAJOR,MINOR,BUILD,PATCH. const std::vector& numbers = chrome_info.version.components(); if (numbers.size() > 3) { - result.set_major(static_cast(numbers[0])); - result.set_minor(static_cast(numbers[1])); + result.set_gmajor(static_cast(numbers[0])); + result.set_gminor(static_cast(numbers[1])); result.set_build(static_cast(numbers[2])); result.set_revision(static_cast(numbers[3])); } diff --git a/www/chromium/files/patch-components_feed_core_v2_test_proto__printer.cc b/www/chromium/files/patch-components_feed_core_v2_test_proto__printer.cc index edb981e358cd..1d67fb207d08 100644 --- a/www/chromium/files/patch-components_feed_core_v2_test_proto__printer.cc +++ b/www/chromium/files/patch-components_feed_core_v2_test_proto__printer.cc @@ -1,13 +1,13 @@ ---- components/feed/core/v2/test/proto_printer.cc.orig 2022-03-25 21:59:56 UTC +--- components/feed/core/v2/test/proto_printer.cc.orig 2022-04-21 18:48:31 UTC +++ components/feed/core/v2/test/proto_printer.cc -@@ -157,8 +157,8 @@ class TextProtoPrinter { +@@ -158,8 +158,8 @@ class TextProtoPrinter { } TextProtoPrinter& operator<<(const feedwire::Version& v) { BeginMessage(); - PRINT_FIELD(major); - PRINT_FIELD(minor); + PRINT_FIELD(gmajor); + PRINT_FIELD(gminor); PRINT_FIELD(build); PRINT_FIELD(revision); PRINT_FIELD(architecture); diff --git a/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc b/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc index 71aa2020a2b9..527fa368114f 100644 --- a/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc +++ b/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator.cc @@ -1,11 +1,11 @@ ---- components/network_session_configurator/browser/network_session_configurator.cc.orig 2022-02-28 16:54:41 UTC +--- components/network_session_configurator/browser/network_session_configurator.cc.orig 2022-04-21 18:48:31 UTC +++ components/network_session_configurator/browser/network_session_configurator.cc -@@ -784,7 +784,7 @@ net::URLRequestContextBuilder::HttpCacheParams::Type C +@@ -822,7 +822,7 @@ net::URLRequestContextBuilder::HttpCacheParams::Type C } #endif // #if !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE; #else return net::URLRequestContextBuilder::HttpCacheParams::DISK_BLOCKFILE; diff --git a/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator__unittest.cc b/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator__unittest.cc index 9eae1a5f4628..e8957e2ee886 100644 --- a/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator__unittest.cc +++ b/www/chromium/files/patch-components_network__session__configurator_browser_network__session__configurator__unittest.cc @@ -1,11 +1,11 @@ ---- components/network_session_configurator/browser/network_session_configurator_unittest.cc.orig 2022-03-25 21:59:56 UTC +--- components/network_session_configurator/browser/network_session_configurator_unittest.cc.orig 2022-04-21 18:48:31 UTC +++ components/network_session_configurator/browser/network_session_configurator_unittest.cc -@@ -776,7 +776,7 @@ TEST_F(NetworkSessionConfiguratorTest, HostRules) { +@@ -820,7 +820,7 @@ TEST_F(NetworkSessionConfiguratorTest, HostRules) { } TEST_F(NetworkSessionConfiguratorTest, DefaultCacheBackend) { -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) EXPECT_EQ(net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE, ChooseCacheType()); #elif BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-components_os__crypt_keyring__util__linux.cc b/www/chromium/files/patch-components_os__crypt_keyring__util__linux.cc index d81e53fa3c1f..cdd0ece66b48 100644 --- a/www/chromium/files/patch-components_os__crypt_keyring__util__linux.cc +++ b/www/chromium/files/patch-components_os__crypt_keyring__util__linux.cc @@ -1,17 +1,17 @@ ---- components/os_crypt/keyring_util_linux.cc.orig 2022-02-07 13:39:41 UTC +--- components/os_crypt/keyring_util_linux.cc.orig 2022-04-21 18:48:31 UTC +++ components/os_crypt/keyring_util_linux.cc -@@ -69,12 +69,12 @@ bool GnomeKeyringLoader::LoadGnomeKeyring() { +@@ -68,12 +68,12 @@ bool GnomeKeyringLoader::LoadGnomeKeyring() { if (keyring_loaded) return true; - void* handle = dlopen("libgnome-keyring.so.0", RTLD_NOW | RTLD_GLOBAL); + void* handle = dlopen("libgnome-keyring.so", RTLD_NOW | RTLD_GLOBAL); if (!handle) { // We wanted to use GNOME Keyring, but we couldn't load it. Warn, because // either the user asked for this, or we autodetected it incorrectly. (Or // the system has broken libraries, which is also good to warn about.) - LOG(WARNING) << "Could not load libgnome-keyring.so.0: " << dlerror(); + LOG(WARNING) << "Could not load libgnome-keyring.so: " << dlerror(); return false; } diff --git a/www/chromium/files/patch-components_os__crypt_os__crypt.h b/www/chromium/files/patch-components_os__crypt_os__crypt.h index 2442b96d31fd..25a8a5a21a60 100644 --- a/www/chromium/files/patch-components_os__crypt_os__crypt.h +++ b/www/chromium/files/patch-components_os__crypt_os__crypt.h @@ -1,29 +1,47 @@ ---- components/os_crypt/os_crypt.h.orig 2022-02-28 16:54:41 UTC +--- components/os_crypt/os_crypt.h.orig 2022-04-21 18:48:31 UTC +++ components/os_crypt/os_crypt.h @@ -14,7 +14,7 @@ #include "build/build_config.h" #include "build/chromecast_buildflags.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) class KeyStorageLinux; #endif // BUILDFLAG(IS_LINUX) -@@ -37,7 +37,7 @@ class OSCrypt { - OSCrypt(const OSCrypt&) = delete; - OSCrypt& operator=(const OSCrypt&) = delete; +@@ -30,7 +30,7 @@ struct Config; + // Temporary interface due to OSCrypt refactor. See OSCryptImpl for descriptions + // of what each function does. + namespace OSCrypt { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + COMPONENT_EXPORT(OS_CRYPT) + void SetConfig(std::unique_ptr config); + #endif // BUILDFLAG(IS_LINUX) +@@ -75,7 +75,7 @@ COMPONENT_EXPORT(OS_CRYPT) void UseMockKeyForTesting(b + COMPONENT_EXPORT(OS_CRYPT) void SetLegacyEncryptionForTesting(bool legacy); + COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting(); + #endif // BUILDFLAG(IS_WIN) +-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) ++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST)) + COMPONENT_EXPORT(OS_CRYPT) + void UseMockKeyStorageForTesting( + std::unique_ptr (*get_key_storage_mock)()); +@@ -95,7 +95,7 @@ class OSCryptImpl { + OSCryptImpl(const OSCryptImpl&) = delete; + OSCryptImpl& operator=(const OSCryptImpl&) = delete; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - // Set the configuration of OSCrypt. + // Set the configuration of OSCryptImpl. // This method, or SetRawEncryptionKey(), must be called before using // EncryptString() and DecryptString(). -@@ -149,7 +149,7 @@ class OSCrypt { - static COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting(); +@@ -200,7 +200,7 @@ class OSCryptImpl { + static void ResetStateForTesting(); #endif -#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) +#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST)) // For unit testing purposes, inject methods to be used. // |get_key_storage_mock| provides the desired |KeyStorage| implementation. // If the provider returns |nullptr|, a hardcoded password will be used. diff --git a/www/chromium/files/patch-components_password__manager_core_browser_login__database.cc b/www/chromium/files/patch-components_password__manager_core_browser_login__database.cc index fa4bd12efa86..990c4482e491 100644 --- a/www/chromium/files/patch-components_password__manager_core_browser_login__database.cc +++ b/www/chromium/files/patch-components_password__manager_core_browser_login__database.cc @@ -1,29 +1,29 @@ ---- components/password_manager/core/browser/login_database.cc.orig 2022-03-25 21:59:56 UTC +--- components/password_manager/core/browser/login_database.cc.orig 2022-04-21 18:48:31 UTC +++ components/password_manager/core/browser/login_database.cc -@@ -664,7 +664,7 @@ std::string GeneratePlaceholders(size_t count) { +@@ -701,7 +701,7 @@ std::string GeneratePlaceholders(size_t count) { return result; } -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Fills |form| with necessary data required to be removed from the database // and returns it. PasswordForm GetFormForRemoval(sql::Statement& statement) { -@@ -681,7 +681,7 @@ PasswordForm GetFormForRemoval(sql::Statement& stateme +@@ -718,7 +718,7 @@ PasswordForm GetFormForRemoval(sql::Statement& stateme // Whether we should try to return the decryptable passwords while the // encryption service fails for some passwords. bool ShouldReturnPartialPasswords() { -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return base::FeatureList::IsEnabled(features::kSkipUndecryptablePasswords); #else return false; -@@ -1488,7 +1488,7 @@ bool LoginDatabase::DeleteAndRecreateDatabaseFile() { +@@ -1547,7 +1547,7 @@ bool LoginDatabase::DeleteAndRecreateDatabaseFile() { } DatabaseCleanupResult LoginDatabase::DeleteUndecryptableLogins() { -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) TRACE_EVENT0("passwords", "LoginDatabase::DeleteUndecryptableLogins"); // If the Keychain in MacOS or the real secret key in Linux is unavailable, // don't delete any logins. diff --git a/www/chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc b/www/chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc index da254f96f7ff..d19ad10e6ae4 100644 --- a/www/chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc +++ b/www/chromium/files/patch-components_password__manager_core_browser_login__database__unittest.cc @@ -1,29 +1,29 @@ ---- components/password_manager/core/browser/login_database_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- components/password_manager/core/browser/login_database_unittest.cc.orig 2022-04-21 18:48:31 UTC +++ components/password_manager/core/browser/login_database_unittest.cc -@@ -2090,7 +2090,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd +@@ -2092,7 +2092,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd base::HistogramTester histogram_tester; ASSERT_TRUE(db.Init()); -#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) +#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) || BUILDFLAG(IS_BSD) // Make sure that we can't get any logins when database is corrupted. // Disabling the checks in chromecast because encryption is unavailable. std::vector> result; -@@ -2116,7 +2116,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd +@@ -2118,7 +2118,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, DeleteUnd #endif // Check histograms. -#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) +#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) || BUILDFLAG(IS_BSD) histogram_tester.ExpectUniqueSample("PasswordManager.CleanedUpPasswords", 2, 1); histogram_tester.ExpectUniqueSample( -@@ -2168,7 +2168,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, KeychainL +@@ -2170,7 +2170,7 @@ TEST_F(LoginDatabaseUndecryptableLoginsTest, KeychainL } #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Test getting auto sign in logins when there are undecryptable ones TEST_F(LoginDatabaseUndecryptableLoginsTest, GetAutoSignInLogins) { PrimaryKeyToFormMap key_to_form_map; diff --git a/www/chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc b/www/chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc index 26498c7c7e42..b4007b63e794 100644 --- a/www/chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc +++ b/www/chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc @@ -1,20 +1,20 @@ ---- components/password_manager/core/browser/sync/password_sync_bridge.cc.orig 2022-03-25 21:59:56 UTC +--- components/password_manager/core/browser/sync/password_sync_bridge.cc.orig 2022-04-21 18:48:31 UTC +++ components/password_manager/core/browser/sync/password_sync_bridge.cc -@@ -185,7 +185,7 @@ bool ShouldRecoverPasswordsDuringMerge() { +@@ -151,7 +151,7 @@ bool ShouldRecoverPasswordsDuringMerge() { // Delete the local undecryptable copy when this is MacOS only. #if BUILDFLAG(IS_MAC) return true; -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return base::FeatureList::IsEnabled( features::kSyncUndecryptablePasswordsLinux); #else -@@ -194,7 +194,7 @@ bool ShouldRecoverPasswordsDuringMerge() { +@@ -160,7 +160,7 @@ bool ShouldRecoverPasswordsDuringMerge() { } bool ShouldCleanSyncMetadataDuringStartupWhenDecryptionFails() { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return ShouldRecoverPasswordsDuringMerge() && base::FeatureList::IsEnabled( features::kForceInitialSyncWhenDecryptionFails); diff --git a/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.cc b/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.cc index e65ec45dff2b..838b0938f3f6 100644 --- a/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.cc +++ b/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.cc @@ -1,29 +1,29 @@ ---- components/password_manager/core/common/password_manager_features.cc.orig 2022-03-25 21:59:56 UTC +--- components/password_manager/core/common/password_manager_features.cc.orig 2022-04-21 18:48:31 UTC +++ components/password_manager/core/common/password_manager_features.cc -@@ -63,7 +63,7 @@ const base::Feature kFillingAcrossAffiliatedWebsites{ +@@ -65,7 +65,7 @@ const base::Feature kFillingAcrossAffiliatedWebsites{ const base::Feature kFillOnAccountSelect = {"fill-on-account-select", base::FEATURE_DISABLED_BY_DEFAULT}; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // When enabled, initial sync will be forced during startup if the password // store has encryption service failures. const base::Feature kForceInitialSyncWhenDecryptionFails = { -@@ -145,7 +145,7 @@ const base::Feature kReparseServerPredictionsFollowing +@@ -151,7 +151,7 @@ const base::Feature kReparseServerPredictionsFollowing const base::Feature kSecondaryServerFieldPredictions = { "SecondaryServerFieldPredictions", base::FEATURE_ENABLED_BY_DEFAULT}; -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Displays at least the decryptable and never saved logins in the password // manager const base::Feature kSkipUndecryptablePasswords = { -@@ -157,7 +157,7 @@ const base::Feature kSkipUndecryptablePasswords = { +@@ -163,7 +163,7 @@ const base::Feature kSkipUndecryptablePasswords = { const base::Feature kSupportForAddPasswordsInSettings = { "SupportForAddPasswordsInSettings", base::FEATURE_DISABLED_BY_DEFAULT}; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // When enabled, all undecryptable passwords are deleted from the local database // during initial sync flow. const base::Feature kSyncUndecryptablePasswordsLinux = { diff --git a/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.h b/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.h index d0cc356e9793..a3c7e4bca11a 100644 --- a/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.h +++ b/www/chromium/files/patch-components_password__manager_core_common_password__manager__features.h @@ -1,25 +1,25 @@ ---- components/password_manager/core/common/password_manager_features.h.orig 2022-03-25 21:59:56 UTC +--- components/password_manager/core/common/password_manager_features.h.orig 2022-04-21 18:48:31 UTC +++ components/password_manager/core/common/password_manager_features.h -@@ -27,7 +27,7 @@ extern const base::Feature kEnablePasswordsAccountStor +@@ -30,7 +30,7 @@ extern const base::Feature kEnablePasswordsAccountStor extern const base::Feature KEnablePasswordGenerationForClearTextFields; extern const base::Feature kFillingAcrossAffiliatedWebsites; extern const base::Feature kFillOnAccountSelect; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const base::Feature kForceInitialSyncWhenDecryptionFails; #endif extern const base::Feature kInferConfirmationPasswordField; -@@ -46,11 +46,11 @@ extern const base::Feature kPasswordScriptsFetching; +@@ -50,11 +50,11 @@ extern const base::Feature kPasswordScriptsFetching; extern const base::Feature kRecoverFromNeverSaveAndroid; extern const base::Feature kReparseServerPredictionsFollowingFormChange; extern const base::Feature kSecondaryServerFieldPredictions; -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const base::Feature kSkipUndecryptablePasswords; #endif extern const base::Feature kSupportForAddPasswordsInSettings; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const base::Feature kSyncUndecryptablePasswordsLinux; #endif #if BUILDFLAG(IS_ANDROID) diff --git a/www/chromium/files/patch-components_policy_resources_policy__templates.json b/www/chromium/files/patch-components_policy_resources_policy__templates.json index 00a3ac1a04ec..d41bcb1d49e9 100644 --- a/www/chromium/files/patch-components_policy_resources_policy__templates.json +++ b/www/chromium/files/patch-components_policy_resources_policy__templates.json @@ -1,191 +1,191 @@ ---- components/policy/resources/policy_templates.json.orig 2022-03-25 21:59:56 UTC +--- components/policy/resources/policy_templates.json.orig 2022-04-21 18:48:31 UTC +++ components/policy/resources/policy_templates.json @@ -1430,7 +1430,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'pastarmovj@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.win7:11-', 'chrome.mac:11-', 'chrome.linux:11-'], + 'supported_on': ['chrome.win7:11-', 'chrome.mac:11-', 'chrome.linux:11-', 'chrome.openbsd:11-', 'chrome.freebsd:11-'], 'features': { 'dynamic_refresh': True, 'per_profile': False, @@ -2534,7 +2534,7 @@ 'owners': ['file://remoting/OWNERS', 'jamiewalch@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.linux:25-', 'chrome.mac:25-'], + 'supported_on': ['chrome.linux:25-', 'chrome.mac:25-', 'chrome.openbsd:25-', 'chrome.freebsd:25-'], 'features': { 'dynamic_refresh': True, 'per_profile': False, @@ -4300,7 +4300,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'pastarmovj@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.win:57-', 'chrome.mac:88-', 'chrome.linux:88-'], + 'supported_on': ['chrome.win:57-', 'chrome.mac:88-', 'chrome.linux:88-', 'chrome.openbsd:88-', 'chrome.freebsd:88-'], 'features': { 'dynamic_refresh': False, 'per_profile': False, @@ -4329,7 +4329,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'pastarmovj@chromium.org'], 'type': 'string', 'schema': { 'type': 'string' }, - 'supported_on': ['chrome.win:57-', 'chrome.mac:88-', 'chrome.linux:88-'], + 'supported_on': ['chrome.win:57-', 'chrome.mac:88-', 'chrome.linux:88-', 'chrome.openbsd:88-', 'chrome.freebsd:88-'], 'features': { 'dynamic_refresh': False, 'per_profile': False, @@ -5262,7 +5262,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'rsorokin@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.linux:74-','chrome.mac:74-','chrome_os:74-'], + 'supported_on': ['chrome.linux:74-','chrome.mac:74-','chrome_os:74-','chrome.openbsd:74-','chrome.freebsd:74-'], 'features': { 'dynamic_refresh': True, 'per_profile': False, @@ -5323,7 +5323,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'rsorokin@chromium.org'], 'type': 'string', 'schema': { 'type': 'string' }, - 'supported_on': ['chrome.linux:9-'], + 'supported_on': ['chrome.linux:9-','chrome.openbsd:9-','chrome.freebsd:9-'], 'features': { 'dynamic_refresh': False, 'per_profile': False, @@ -5389,7 +5389,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'rsorokin@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.linux:63-','chrome.mac:63-','chrome_os:63-','android:63-','webview_android:63-'], + 'supported_on': ['chrome.linux:63-','chrome.mac:63-','chrome_os:63-','android:63-','webview_android:63-','chrome.openbsd:63-','chrome.freebsd:63-'], 'features': { 'dynamic_refresh': True, 'per_profile': False, -@@ -10460,7 +10460,7 @@ +@@ -10493,7 +10493,7 @@ 'owners': ['file://net/cert/OWNERS', 'rsleevi@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome_os:30-', 'chrome.linux:30-', 'chrome.win:30-'], + 'supported_on': ['chrome_os:30-', 'chrome.linux:30-', 'chrome.win:30-', 'chrome.openbsd:30-', 'chrome.freebsd:30-'], 'features': { 'dynamic_refresh': True, 'per_profile': False, -@@ -10554,7 +10554,7 @@ +@@ -10587,7 +10587,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'pmarko@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome_os:77-83', 'chrome.linux:79-83', 'chrome.mac:83-'], + 'supported_on': ['chrome_os:77-83', 'chrome.linux:79-83', 'chrome.mac:83-', 'chrome.openbsd:79-83', 'chrome.freebsd:79-83'], 'features': { 'dynamic_refresh': False, 'per_profile': False, -@@ -12551,7 +12551,7 @@ +@@ -12584,7 +12584,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'pmarko@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.win:19-', 'chrome.linux:19-'], + 'supported_on': ['chrome.win:19-', 'chrome.linux:19-', 'chrome.openbsd:19-', 'chrome.freebsd:19-'], 'features': { 'can_be_recommended': True, 'dynamic_refresh': True, -@@ -13409,7 +13409,7 @@ +@@ -13442,7 +13442,7 @@ 'owners': ['file://components/policy/resources/OWNERS', 'bartfab@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.win:31-', 'chrome.linux:31-', 'chrome_os:31-'], + 'supported_on': ['chrome.win:31-', 'chrome.linux:31-', 'chrome_os:31-', 'chrome.openbsd:31-', 'chrome.freebsd:31-'], 'features': { 'dynamic_refresh': True, 'per_profile': True, -@@ -20284,7 +20284,7 @@ +@@ -20371,7 +20371,7 @@ 'items': { 'type': 'string' } }, # Spell checking is provided by macOS, so can't be controlled on Mac. - 'supported_on': ['chrome.win:65-', 'chrome.linux:65-', 'chrome_os:65-'], + 'supported_on': ['chrome.win:65-', 'chrome.linux:65-', 'chrome_os:65-', 'chrome.openbsd:65-', 'chrome.freebsd:65-'], 'features': { 'can_be_recommended': False, 'dynamic_refresh': True, -@@ -20315,7 +20315,7 @@ +@@ -20402,7 +20402,7 @@ 'items': { 'type': 'string' } }, # Spell checking is provided by macOS, so can't be controlled on Mac. -- 'supported_on': ['chrome.win:75-', 'chrome.linux:75-', 'chrome_os:75-'], -+ 'supported_on': ['chrome.win:75-', 'chrome.linux:75-', 'chrome_os:75-', 'chrome.openbsd:75-', 'chrome.freebsd:75-'], +- 'supported_on': ['chrome.win:75-100', 'chrome.linux:75-100', 'chrome_os:75-100'], ++ 'supported_on': ['chrome.win:75-100', 'chrome.linux:75-100', 'chrome_os:75-100', 'chrome.openbsd:75-100', 'chrome.freebsd:75-100'], 'deprecated': True, 'features': { 'can_be_recommended': False, -@@ -20349,7 +20349,7 @@ +@@ -20436,7 +20436,7 @@ 'items': { 'type': 'string' } }, # Spell checking is provided by macOS, so can't be controlled on Mac. - 'supported_on': ['chrome.win:86-', 'chrome.linux:86-', 'chrome_os:86-'], + 'supported_on': ['chrome.win:86-', 'chrome.linux:86-', 'chrome_os:86-', 'chrome.openbsd:86-', 'chrome.freebsd:86-'], 'features': { 'can_be_recommended': False, 'dynamic_refresh': True, -@@ -21087,7 +21087,7 @@ +@@ -21174,7 +21174,7 @@ 'owners': ['fbeaufort@chromium.org', 'beccahughes@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.win:66-', 'chrome.linux:66-', 'chrome.mac:66-', 'chrome_os:66-'], + 'supported_on': ['chrome.win:66-', 'chrome.linux:66-', 'chrome.mac:66-', 'chrome_os:66-', 'chrome.openbsd:66-', 'chrome.freebsd:66-'], 'features': { 'dynamic_refresh': True, 'per_profile': True, -@@ -25361,7 +25361,7 @@ +@@ -25448,7 +25448,7 @@ 'owners': ['file://services/audio/OWNERS', 'dalecurtis@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.win:79-', 'chrome.linux:79-', 'chrome.mac:79-'], + 'supported_on': ['chrome.win:79-', 'chrome.linux:79-', 'chrome.mac:79-', 'chrome.openbsd:79-', 'chrome.freebsd:79-'], 'features': { 'dynamic_refresh': False, 'per_profile': False, -@@ -26703,7 +26703,7 @@ If this policy is left unset, privacy screen is disabl +@@ -26790,7 +26790,7 @@ If this policy is left unset, privacy screen is disabl 'owners': ['file://chrome/browser/notifications/OWNERS', 'knollr@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, -- 'supported_on': ['chrome.linux:83-'], -+ 'supported_on': ['chrome.linux:83-','chrome.openbsd:83-','chrome.freebsd:83-'], +- 'supported_on': ['chrome.linux:83-100'], ++ 'supported_on': ['chrome.linux:83-100','chrome.openbsd:83-100','chrome.freebsd:83-100'], 'features': { 'dynamic_refresh': True, 'per_profile': True, -@@ -26727,7 +26727,7 @@ If set to False, $1Google +@@ -26814,7 +26814,7 @@ If set to False, $1Google 'owners': ['file://chrome/browser/notifications/OWNERS'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.linux:90-'], + 'supported_on': ['chrome.linux:90-','chrome.openbsd:90-','chrome.freebsd:90-'], 'features': { 'dynamic_refresh': True, 'per_profile': True, -@@ -27796,7 +27796,7 @@ If you disable this policy, web page scrolling to spec +@@ -27883,7 +27883,7 @@ If you disable this policy, web page scrolling to spec 'owners': ['asumaneev@google.com'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.linux:91-92', 'chrome_os:91-'], + 'supported_on': ['chrome.linux:91-92', 'chrome_os:91-', 'chrome.openbsd:91-', 'chrome.freebsd:91-'], 'features': { 'dynamic_refresh': True, 'per_profile': False, -@@ -29032,7 +29032,7 @@ When this policy is set, $2 +@@ -29119,7 +29119,7 @@ When this policy is set, $2 }, ], 'default': True, - 'supported_on': ['chrome.win:93-', 'chrome.linux:93-', 'chrome.mac:93-'], + 'supported_on': ['chrome.win:93-', 'chrome.linux:93-', 'chrome.mac:93-', 'chrome.openbsd:93-', 'chrome.freebsd:93-'], 'features': { 'dynamic_refresh': True, 'per_profile': True, -@@ -29165,7 +29165,7 @@ When this policy is set, $2 +@@ -29252,7 +29252,7 @@ When this policy is set, $2 'owners': ['mattm@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, - 'future_on': ['chrome.win', 'chrome.mac', 'chrome.linux'], + 'future_on': ['chrome.win', 'chrome.mac', 'chrome.linux', 'chrome.openbsd', 'chrome.freebsd'], 'features': { 'dynamic_refresh': True, 'per_profile': True, diff --git a/www/chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc b/www/chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc new file mode 100644 index 000000000000..49d469f73973 --- /dev/null +++ b/www/chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc @@ -0,0 +1,18 @@ +--- components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.cc.orig 2022-04-21 18:48:31 UTC ++++ components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.cc +@@ -30,6 +30,7 @@ bool ScreenAIPreSandboxHook(sandbox::policy::SandboxLi + if (!screen_ai_library) + VLOG(1) << dlerror(); + ++#if !BUILDFLAG(IS_BSD) + auto* instance = sandbox::policy::SandboxLinux::GetInstance(); + + std::vector permissions{ +@@ -41,6 +42,7 @@ bool ScreenAIPreSandboxHook(sandbox::policy::SandboxLi + sandbox::syscall_broker::COMMAND_OPEN}), + permissions, sandbox::policy::SandboxLinux::PreSandboxHook(), options); + instance->EngageNamespaceSandboxIfPossible(); ++#endif + + return true; + } diff --git a/www/chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h b/www/chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h new file mode 100644 index 000000000000..e41dfa6540bc --- /dev/null +++ b/www/chromium/files/patch-components_services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h @@ -0,0 +1,16 @@ +--- components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h.orig 2022-04-21 18:48:31 UTC ++++ components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h +@@ -5,7 +5,13 @@ + #ifndef COMPONENTS_SERVICES_SCREEN_AI_SANDBOX_SCREEN_AI_SANDBOX_HOOK_LINUX_H_ + #define COMPONENTS_SERVICES_SCREEN_AI_SANDBOX_SCREEN_AI_SANDBOX_HOOK_LINUX_H_ + ++#include "build/build_config.h" ++ ++#if BUILDFLAG(IS_BSD) ++#include "sandbox/policy/openbsd/sandbox_openbsd.h" ++#else + #include "sandbox/policy/linux/sandbox_linux.h" ++#endif + + namespace screen_ai { + diff --git a/www/chromium/files/patch-components_sync__device__info_local__device__info__util__linux.cc b/www/chromium/files/patch-components_sync__device__info_local__device__info__util__linux.cc index dc28df719946..29f412422f87 100644 --- a/www/chromium/files/patch-components_sync__device__info_local__device__info__util__linux.cc +++ b/www/chromium/files/patch-components_sync__device__info_local__device__info__util__linux.cc @@ -1,14 +1,14 @@ ---- components/sync_device_info/local_device_info_util_linux.cc.orig 2022-02-07 13:39:41 UTC +--- components/sync_device_info/local_device_info_util_linux.cc.orig 2022-04-21 18:48:31 UTC +++ components/sync_device_info/local_device_info_util_linux.cc @@ -14,6 +14,11 @@ - #include "ash/constants/devicetype.h" + #include "chromeos/constants/devicetype.h" // nogncheck #endif +#if defined(__FreeBSD__) +#include +#define HOST_NAME_MAX MAXHOSTNAMELEN +#endif + namespace syncer { #if BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/www/chromium/files/patch-components_viz_common_features.cc b/www/chromium/files/patch-components_viz_common_features.cc deleted file mode 100644 index b02fcace4727..000000000000 --- a/www/chromium/files/patch-components_viz_common_features.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- components/viz/common/features.cc.orig 2022-03-25 21:59:56 UTC -+++ components/viz/common/features.cc -@@ -67,7 +67,7 @@ const base::Feature kUseSkiaRenderer { - "UseSkiaRenderer", - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_MAC) -+ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) - base::FEATURE_ENABLED_BY_DEFAULT - #else - base::FEATURE_DISABLED_BY_DEFAULT diff --git a/www/chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc b/www/chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc index 469d430a5dbd..181ced8109cf 100644 --- a/www/chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc +++ b/www/chromium/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc @@ -1,11 +1,11 @@ ---- components/viz/service/display_embedder/skia_output_surface_impl.cc.orig 2022-03-25 21:59:56 UTC +--- components/viz/service/display_embedder/skia_output_surface_impl.cc.orig 2022-04-21 18:48:31 UTC +++ components/viz/service/display_embedder/skia_output_surface_impl.cc -@@ -1171,7 +1171,7 @@ GrBackendFormat SkiaOutputSurfaceImpl::GetGrBackendFor +@@ -1193,7 +1193,7 @@ GrBackendFormat SkiaOutputSurfaceImpl::GetGrBackendFor ->GetDeviceQueue() ->GetVulkanPhysicalDevice(), VK_IMAGE_TILING_OPTIMAL, ycbcr_info); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Textures that were allocated _on linux_ with ycbcr info came from // VaapiVideoDecoder, which exports using DRM format modifiers. return GrBackendFormat::MakeVk(gr_ycbcr_info, diff --git a/www/chromium/files/patch-content_app_content__main.cc b/www/chromium/files/patch-content_app_content__main.cc index 55ca38650404..eca4a882dc87 100644 --- a/www/chromium/files/patch-content_app_content__main.cc +++ b/www/chromium/files/patch-content_app_content__main.cc @@ -1,11 +1,11 @@ ---- content/app/content_main.cc.orig 2022-03-25 21:59:56 UTC +--- content/app/content_main.cc.orig 2022-04-21 18:48:31 UTC +++ content/app/content_main.cc -@@ -254,7 +254,7 @@ RunContentProcess(ContentMainParams params, +@@ -260,7 +260,7 @@ RunContentProcess(ContentMainParams params, base::allocator::InstallDanglingRawPtrChecks(); base::EnableTerminationOnOutOfMemory(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // The various desktop environments set this environment variable that // allows the dbus client library to connect directly to the bus. When this // variable is not set (test environments like xvfb-run), the dbus client diff --git a/www/chromium/files/patch-content_browser_BUILD.gn b/www/chromium/files/patch-content_browser_BUILD.gn index 8b8917c871e7..0fe17d6ba4a9 100644 --- a/www/chromium/files/patch-content_browser_BUILD.gn +++ b/www/chromium/files/patch-content_browser_BUILD.gn @@ -1,16 +1,16 @@ ---- content/browser/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- content/browser/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ content/browser/BUILD.gn -@@ -2331,6 +2331,13 @@ source_set("browser") { +@@ -2379,6 +2379,13 @@ source_set("browser") { ] } + if (is_bsd) { + sources -= [ + "sandbox_ipc_linux.cc", + "sandbox_ipc_linux.h", + ] + } + if (is_chromeos) { deps += [ "//components/value_store:value_store" ] sources += [ diff --git a/www/chromium/files/patch-content_browser_browser__main__loop.cc b/www/chromium/files/patch-content_browser_browser__main__loop.cc index 57e2deee4f31..68d07fe69d3e 100644 --- a/www/chromium/files/patch-content_browser_browser__main__loop.cc +++ b/www/chromium/files/patch-content_browser_browser__main__loop.cc @@ -1,46 +1,46 @@ ---- content/browser/browser_main_loop.cc.orig 2022-03-25 21:59:56 UTC +--- content/browser/browser_main_loop.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/browser_main_loop.cc -@@ -240,6 +240,12 @@ +@@ -241,6 +241,12 @@ #include "mojo/public/cpp/bindings/lib/test_random_mojo_delays.h" #endif +#if BUILDFLAG(IS_BSD) +#include "content/browser/sandbox_host_linux.h" +#include "content/public/common/zygote/sandbox_support_linux.h" +#include "sandbox/policy/sandbox.h" +#endif + // One of the linux specific headers defines this as a macro. #ifdef DestroyAll #undef DestroyAll -@@ -547,6 +553,12 @@ int BrowserMainLoop::EarlyInitialization() { +@@ -548,6 +554,12 @@ int BrowserMainLoop::EarlyInitialization() { // by now since a thread to start the ServiceManager has been created // before the browser main loop starts. DCHECK(SandboxHostLinux::GetInstance()->IsInitialized()); +#elif BUILDFLAG(IS_BSD) + base::FileHandleMappingVector additional_remapped_fds; + base::LaunchOptions options; + SandboxHostLinux::GetInstance()->Init(); + const int sfd = SandboxHostLinux::GetInstance()->GetChildSocket(); + options.fds_to_remap.push_back(std::make_pair(sfd, GetSandboxFD())); #endif // GLib's spawning of new processes is buggy, so it's important that at this -@@ -574,7 +586,7 @@ int BrowserMainLoop::EarlyInitialization() { +@@ -575,7 +587,7 @@ int BrowserMainLoop::EarlyInitialization() { // Up the priority of the UI thread unless it was already high (since Mac // and recent versions of Android (O+) do this automatically). -#if !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled( features::kBrowserUseDisplayThreadPriority) && base::PlatformThread::GetCurrentThreadPriority() < -@@ -585,7 +597,7 @@ int BrowserMainLoop::EarlyInitialization() { +@@ -586,7 +598,7 @@ int BrowserMainLoop::EarlyInitialization() { #endif // !BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // We use quite a few file descriptors for our IPC as well as disk the disk // cache,and the default limit on the Mac is low (256), so bump it up. diff --git a/www/chromium/files/patch-content_browser_download_download__manager__impl.cc b/www/chromium/files/patch-content_browser_download_download__manager__impl.cc index 722a9973f0e4..135079c3ef4f 100644 --- a/www/chromium/files/patch-content_browser_download_download__manager__impl.cc +++ b/www/chromium/files/patch-content_browser_download_download__manager__impl.cc @@ -1,29 +1,29 @@ ---- content/browser/download/download_manager_impl.cc.orig 2022-03-25 21:59:56 UTC +--- content/browser/download/download_manager_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/download/download_manager_impl.cc -@@ -89,7 +89,7 @@ +@@ -90,7 +90,7 @@ #include "third_party/blink/public/common/storage_key/storage_key.h" #include "url/origin.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/nix/xdg_util.h" #endif -@@ -217,7 +217,7 @@ class DownloadItemFactoryImpl : public download::Downl +@@ -218,7 +218,7 @@ class DownloadItemFactoryImpl : public download::Downl } }; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) base::FilePath GetTemporaryDownloadDirectory() { std::unique_ptr env(base::Environment::Create()); return base::nix::GetXDGDirectory(env.get(), "XDG_DATA_HOME", ".local/share"); -@@ -653,7 +653,7 @@ bool DownloadManagerImpl::InterceptDownload( +@@ -654,7 +654,7 @@ bool DownloadManagerImpl::InterceptDownload( base::FilePath DownloadManagerImpl::GetDefaultDownloadDirectory() { base::FilePath default_download_directory; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // TODO(thomasanderson,crbug.com/784010): Remove this when all Linux // distros with versions of GTK lower than 3.14.7 are no longer // supported. This should happen when support for Ubuntu Trusty and diff --git a/www/chromium/files/patch-content_browser_gpu_compositor__util.cc b/www/chromium/files/patch-content_browser_gpu_compositor__util.cc index e534bb329be9..8951945c9a53 100644 --- a/www/chromium/files/patch-content_browser_gpu_compositor__util.cc +++ b/www/chromium/files/patch-content_browser_gpu_compositor__util.cc @@ -1,20 +1,20 @@ ---- content/browser/gpu/compositor_util.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/gpu/compositor_util.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/gpu/compositor_util.cc -@@ -145,7 +145,7 @@ const GpuFeatureData GetGpuFeatureData( +@@ -147,7 +147,7 @@ const GpuFeatureData GetGpuFeatureData( {"video_decode", SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) !base::FeatureList::IsEnabled(media::kVaapiVideoDecodeLinux), #else command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), -@@ -157,7 +157,7 @@ const GpuFeatureData GetGpuFeatureData( +@@ -159,7 +159,7 @@ const GpuFeatureData GetGpuFeatureData( {"video_encode", SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE), -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) !base::FeatureList::IsEnabled(media::kVaapiVideoEncodeLinux), #else command_line.HasSwitch(switches::kDisableAcceleratedVideoEncode), diff --git a/www/chromium/files/patch-content_browser_media_media__keys__listener__manager__impl.cc b/www/chromium/files/patch-content_browser_media_media__keys__listener__manager__impl.cc index 38782a596d7c..3646f04d18b3 100644 --- a/www/chromium/files/patch-content_browser_media_media__keys__listener__manager__impl.cc +++ b/www/chromium/files/patch-content_browser_media_media__keys__listener__manager__impl.cc @@ -1,11 +1,11 @@ ---- content/browser/media/media_keys_listener_manager_impl.cc.orig 2022-03-25 21:59:56 UTC +--- content/browser/media/media_keys_listener_manager_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/media/media_keys_listener_manager_impl.cc -@@ -232,7 +232,7 @@ void MediaKeysListenerManagerImpl::StartListeningForMe +@@ -233,7 +233,7 @@ void MediaKeysListenerManagerImpl::StartListeningForMe // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) system_media_controls_ = system_media_controls::SystemMediaControls::Create( media::AudioManager::GetGlobalAppName()); #endif diff --git a/www/chromium/files/patch-content_browser_renderer__host_delegated__frame__host.cc b/www/chromium/files/patch-content_browser_renderer__host_delegated__frame__host.cc index 580bb950cdff..a58bbaf8cf9f 100644 --- a/www/chromium/files/patch-content_browser_renderer__host_delegated__frame__host.cc +++ b/www/chromium/files/patch-content_browser_renderer__host_delegated__frame__host.cc @@ -1,11 +1,11 @@ ---- content/browser/renderer_host/delegated_frame_host.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/renderer_host/delegated_frame_host.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/renderer_host/delegated_frame_host.cc -@@ -288,7 +288,7 @@ void DelegatedFrameHost::EmbedSurface( +@@ -289,7 +289,7 @@ void DelegatedFrameHost::EmbedSurface( if (!primary_surface_id || primary_surface_id->local_surface_id() != local_surface_id_) { -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // On Windows and Linux, we would like to produce new content as soon as // possible or the OS will create an additional black gutter. Until we can // block resize on surface synchronization on these platforms, we will not diff --git a/www/chromium/files/patch-content_browser_renderer__host_render__frame__host__impl.cc b/www/chromium/files/patch-content_browser_renderer__host_render__frame__host__impl.cc new file mode 100644 index 000000000000..106fa9b3d227 --- /dev/null +++ b/www/chromium/files/patch-content_browser_renderer__host_render__frame__host__impl.cc @@ -0,0 +1,29 @@ +--- content/browser/renderer_host/render_frame_host_impl.cc.orig 2022-04-21 18:48:31 UTC ++++ content/browser/renderer_host/render_frame_host_impl.cc +@@ -272,7 +272,7 @@ + #include "content/browser/renderer_host/render_view_host_delegate_view.h" + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include "content/browser/accessibility/ax_screen_ai_annotator.h" + #include "ui/accessibility/accessibility_features.h" + #endif +@@ -2632,7 +2632,7 @@ void RenderFrameHostImpl::AccessibilityPerformAction( + view->SetLastPointerType(ui::EventPointerType::kTouch); + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + if (action_data.action == ax::mojom::Action::kRunScreenAi) { + RunScreenAIAnnotator(); + return; +@@ -2642,7 +2642,7 @@ void RenderFrameHostImpl::AccessibilityPerformAction( + render_accessibility_->PerformAction(action_data); + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + void RenderFrameHostImpl::RunScreenAIAnnotator() { + if (!features::IsScreenAIEnabled()) + return; diff --git a/www/chromium/files/patch-content_browser_renderer__host_render__frame__host__impl.h b/www/chromium/files/patch-content_browser_renderer__host_render__frame__host__impl.h new file mode 100644 index 000000000000..7a01b62370fe --- /dev/null +++ b/www/chromium/files/patch-content_browser_renderer__host_render__frame__host__impl.h @@ -0,0 +1,20 @@ +--- content/browser/renderer_host/render_frame_host_impl.h.orig 2022-04-21 18:48:31 UTC ++++ content/browser/renderer_host/render_frame_host_impl.h +@@ -3314,7 +3314,7 @@ class CONTENT_EXPORT RenderFrameHostImpl + perfetto::protos::pbzero::RenderFrameHost::LifecycleState + LifecycleStateToProto(); + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + void RunScreenAIAnnotator(); + #endif + +@@ -4154,7 +4154,7 @@ class CONTENT_EXPORT RenderFrameHostImpl + BackForwardCacheDisablingFeaturesCallback + back_forward_cache_disabling_features_callback_for_testing_; + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // Manages the snapshot processing by Screen AI, if enabled. + std::unique_ptr ax_screen_ai_annotator_; + #endif diff --git a/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc b/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc index 8ae018274219..0b965b1c2e03 100644 --- a/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc +++ b/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc @@ -1,37 +1,37 @@ ---- content/browser/renderer_host/render_process_host_impl.cc.orig 2022-03-25 21:59:56 UTC +--- content/browser/renderer_host/render_process_host_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -208,7 +208,7 @@ +@@ -209,7 +209,7 @@ #include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck -@@ -1228,7 +1228,7 @@ static constexpr size_t kUnknownPlatformProcessLimit = +@@ -1179,7 +1179,7 @@ static constexpr size_t kUnknownPlatformProcessLimit = // to indicate failure and std::numeric_limits::max() to indicate // unlimited. size_t GetPlatformProcessLimit() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) struct rlimit limit; if (getrlimit(RLIMIT_NPROC, &limit) != 0) return kUnknownPlatformProcessLimit; -@@ -1315,7 +1315,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public +@@ -1266,7 +1266,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public return; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (auto font_receiver = receiver.As()) { ConnectToFontService(std::move(font_receiver)); return; -@@ -3332,6 +3332,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLin +@@ -3261,6 +3261,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLin switches::kDisableSpeechAPI, switches::kDisableThreadedCompositing, switches::kDisableTouchDragDrop, + switches::kDisableUnveil, switches::kDisableV8IdleTasks, switches::kDisableVideoCaptureUseGpuMemoryBuffer, switches::kDisableWebGLImageChromium, diff --git a/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h b/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h index 8a83d054fa11..dd20a9f6a229 100644 --- a/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h +++ b/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.h @@ -1,11 +1,11 @@ ---- content/browser/renderer_host/render_process_host_impl.h.orig 2022-03-25 21:59:56 UTC +--- content/browser/renderer_host/render_process_host_impl.h.orig 2022-04-21 18:48:31 UTC +++ content/browser/renderer_host/render_process_host_impl.h -@@ -465,7 +465,7 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -464,7 +464,7 @@ class CONTENT_EXPORT RenderProcessHostImpl // Sets this RenderProcessHost to be guest only. For Testing only. void SetForGuestsOnlyForTesting(); -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) // Launch the zygote early in the browser startup. static void EarlyZygoteLaunch(); #endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.h b/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.h index fa2816bbcf39..b85531b362fa 100644 --- a/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.h +++ b/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.h @@ -1,11 +1,11 @@ ---- content/browser/renderer_host/render_widget_host_view_aura.h.orig 2022-03-25 21:59:56 UTC +--- content/browser/renderer_host/render_widget_host_view_aura.h.orig 2022-04-21 18:48:31 UTC +++ content/browser/renderer_host/render_widget_host_view_aura.h -@@ -243,7 +243,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura +@@ -247,7 +247,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura ukm::SourceId GetClientSourceForMetrics() const override; bool ShouldDoLearning() override; -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool SetCompositionFromExistingText( const gfx::Range& range, const std::vector& ui_ime_text_spans) override; diff --git a/www/chromium/files/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc b/www/chromium/files/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc index f4d50a32ee42..c409de0c1079 100644 --- a/www/chromium/files/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc +++ b/www/chromium/files/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc @@ -1,11 +1,11 @@ ---- content/browser/scheduler/responsiveness/jank_monitor_impl.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/scheduler/responsiveness/jank_monitor_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/scheduler/responsiveness/jank_monitor_impl.cc -@@ -333,7 +333,7 @@ void JankMonitorImpl::ThreadExecutionState::DidRunTask +@@ -334,7 +334,7 @@ void JankMonitorImpl::ThreadExecutionState::DidRunTask // in context menus, among others). Simply ignore the mismatches for now. // See https://crbug.com/929813 for the details of why the mismatch // happens. -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) task_execution_metadata_.clear(); #endif return; diff --git a/www/chromium/files/patch-content_browser_utility__sandbox__delegate.cc b/www/chromium/files/patch-content_browser_utility__sandbox__delegate.cc index 41aa35e3c883..41b4b6de92bc 100644 --- a/www/chromium/files/patch-content_browser_utility__sandbox__delegate.cc +++ b/www/chromium/files/patch-content_browser_utility__sandbox__delegate.cc @@ -1,11 +1,29 @@ ---- content/browser/utility_sandbox_delegate.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/utility_sandbox_delegate.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/utility_sandbox_delegate.cc @@ -62,7 +62,7 @@ UtilitySandboxedProcessLauncherDelegate:: #if BUILDFLAG(ENABLE_PLUGINS) sandbox_type_ == sandbox::mojom::Sandbox::kPpapi || #endif -#if BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) sandbox_type_ == sandbox::mojom::Sandbox::kVideoCapture || #endif #if BUILDFLAG(IS_CHROMEOS_ASH) +@@ -73,7 +73,7 @@ UtilitySandboxedProcessLauncherDelegate:: + sandbox_type_ == sandbox::mojom::Sandbox::kLibassistant || + #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT) + #endif // BUILDFLAG(IS_CHROMEOS_ASH) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + sandbox_type_ == sandbox::mojom::Sandbox::kScreenAI || + #endif + sandbox_type_ == sandbox::mojom::Sandbox::kAudio || +@@ -118,7 +118,7 @@ ZygoteHandle UtilitySandboxedProcessLauncherDelegate:: + #if BUILDFLAG(ENABLE_OOP_PRINTING) + sandbox_type_ == sandbox::mojom::Sandbox::kPrintBackend || + #endif +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + sandbox_type_ == sandbox::mojom::Sandbox::kScreenAI || + #endif + sandbox_type_ == sandbox::mojom::Sandbox::kSpeechRecognition) { diff --git a/www/chromium/files/patch-content_browser_web__contents_web__contents__view__aura.cc b/www/chromium/files/patch-content_browser_web__contents_web__contents__view__aura.cc index 781760a7f4a7..3179324f9117 100644 --- a/www/chromium/files/patch-content_browser_web__contents_web__contents__view__aura.cc +++ b/www/chromium/files/patch-content_browser_web__contents_web__contents__view__aura.cc @@ -1,29 +1,29 @@ ---- content/browser/web_contents/web_contents_view_aura.cc.orig 2022-03-25 21:59:56 UTC +--- content/browser/web_contents/web_contents_view_aura.cc.orig 2022-04-21 18:48:31 UTC +++ content/browser/web_contents/web_contents_view_aura.cc @@ -159,7 +159,7 @@ class WebDragSourceAura : public content::WebContentsO raw_ptr window_; }; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Fill out the OSExchangeData with a file contents, synthesizing a name if // necessary. void PrepareDragForFileContents(const DropData& drop_data, @@ -242,7 +242,7 @@ void PrepareDragData(const DropData& drop_data, if (!drop_data.download_metadata.empty()) PrepareDragForDownload(drop_data, provider, web_contents); #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // We set the file contents before the URL because the URL also sets file // contents (to a .URL shortcut). We want to prefer file content data over // a shortcut so we add it first. -@@ -1324,7 +1324,7 @@ void WebContentsViewAura::OnMouseEvent(ui::MouseEvent* +@@ -1330,7 +1330,7 @@ void WebContentsViewAura::OnMouseEvent(ui::MouseEvent* // Linux window managers like to handle raise-on-click themselves. If we // raise-on-click manually, this may override user settings that prevent // focus-stealing. -#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) // It is possible for the web-contents to be destroyed while it is being // activated. Use a weak-ptr to track whether that happened or not. // More in https://crbug.com/1040725 diff --git a/www/chromium/files/patch-content_child_child__process.cc b/www/chromium/files/patch-content_child_child__process.cc index 1444db342a4b..40b8b7b384e4 100644 --- a/www/chromium/files/patch-content_child_child__process.cc +++ b/www/chromium/files/patch-content_child_child__process.cc @@ -1,11 +1,11 @@ ---- content/child/child_process.cc.orig 2022-03-25 21:59:56 UTC +--- content/child/child_process.cc.orig 2022-04-21 18:48:31 UTC +++ content/child/child_process.cc -@@ -71,7 +71,7 @@ ChildProcess::ChildProcess(base::ThreadPriority io_thr +@@ -72,7 +72,7 @@ ChildProcess::ChildProcess(base::ThreadPriority io_thr DCHECK(!g_lazy_child_process_tls.Pointer()->Get()); g_lazy_child_process_tls.Pointer()->Set(this); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); const bool is_embedded_in_browser_process = diff --git a/www/chromium/files/patch-content_common_user__agent.cc b/www/chromium/files/patch-content_common_user__agent.cc index 3b82d95948ae..8b753fdd0872 100644 --- a/www/chromium/files/patch-content_common_user__agent.cc +++ b/www/chromium/files/patch-content_common_user__agent.cc @@ -1,19 +1,28 @@ ---- content/common/user_agent.cc.orig 2022-03-25 21:59:56 UTC +--- content/common/user_agent.cc.orig 2022-04-21 18:48:31 UTC +++ content/common/user_agent.cc -@@ -245,6 +245,16 @@ std::string BuildOSCpuInfoFromOSVersionAndCpuType(cons +@@ -33,7 +33,7 @@ std::string GetUserAgentPlatform() { + return ""; + #elif BUILDFLAG(IS_MAC) + return "Macintosh; "; +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + return "X11; "; // strange, but that's what Firefox uses + #elif BUILDFLAG(IS_ANDROID) + return "Linux; "; +@@ -243,6 +243,16 @@ std::string BuildOSCpuInfoFromOSVersionAndCpuType(cons "Android %s", os_version.c_str() #elif BUILDFLAG(IS_FUCHSIA) "Fuchsia" +#elif BUILDFLAG(IS_BSD) +#if defined(__x86_64__) + "Linux x86_64; %s %s", +#elif defined(__aarch64__) + "Linux aarch64; %s %s", +#else + "Linux i686; %s %s", +#endif + unixinfo.sysname, // e.g. Linux + cpu_type.c_str() // e.g. i686 #elif BUILDFLAG(IS_POSIX) "%s %s", unixinfo.sysname, // e.g. Linux diff --git a/www/chromium/files/patch-content_public_common_content__features.cc b/www/chromium/files/patch-content_public_common_content__features.cc index 1a4ee7abc241..6444539c91d1 100644 --- a/www/chromium/files/patch-content_public_common_content__features.cc +++ b/www/chromium/files/patch-content_public_common_content__features.cc @@ -1,50 +1,50 @@ ---- content/public/common/content_features.cc.orig 2022-03-25 21:59:56 UTC +--- content/public/common/content_features.cc.orig 2022-04-21 18:48:31 UTC +++ content/public/common/content_features.cc -@@ -50,7 +50,7 @@ const base::Feature kAudioServiceOutOfProcess { +@@ -43,7 +43,7 @@ const base::Feature kAudioServiceOutOfProcess { "AudioServiceOutOfProcess", // TODO(crbug.com/1052397): Remove !IS_CHROMEOS_LACROS once lacros starts being // built with OS_CHROMEOS instead of OS_LINUX. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) base::FEATURE_ENABLED_BY_DEFAULT #else -@@ -62,7 +62,7 @@ const base::Feature kAudioServiceOutOfProcess { +@@ -55,7 +55,7 @@ const base::Feature kAudioServiceOutOfProcess { // kAudioServiceOutOfProcess feature is enabled. const base::Feature kAudioServiceSandbox { "AudioServiceSandbox", -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT -@@ -1030,7 +1030,7 @@ const base::Feature kWebAssemblyBaseline{"WebAssemblyB +@@ -1051,7 +1051,7 @@ const base::Feature kWebAssemblyBaseline{"WebAssemblyB const base::Feature kWebAssemblyCodeProtection{ "WebAssemblyCodeProtection", base::FEATURE_ENABLED_BY_DEFAULT}; -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64) // Use memory protection keys in userspace (PKU) (if available) to protect code // JITed for WebAssembly. Fall back to traditional memory protection if // WebAssemblyCodeProtection is also enabled. -@@ -1060,7 +1060,7 @@ const base::Feature kWebAssemblyTiering{"WebAssemblyTi +@@ -1081,7 +1081,7 @@ const base::Feature kWebAssemblyTiering{"WebAssemblyTi const base::Feature kWebAssemblyTrapHandler { "WebAssemblyTrapHandler", #if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_MAC)) && \ + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)) && \ defined(ARCH_CPU_X86_64)) || \ (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) base::FEATURE_ENABLED_BY_DEFAULT -@@ -1146,7 +1146,11 @@ const base::Feature kWebUIReportOnlyTrustedTypes{ +@@ -1162,7 +1162,11 @@ const base::Feature kWebUIReportOnlyTrustedTypes{ // Controls whether the WebUSB API is enabled: // https://wicg.github.io/webusb +#if BUILDFLAG(IS_BSD) +const base::Feature kWebUsb{"WebUSB", base::FEATURE_DISABLED_BY_DEFAULT}; +#else const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT}; +#endif // Controls whether the WebXR Device API is enabled. const base::Feature kWebXr{"WebXR", base::FEATURE_ENABLED_BY_DEFAULT}; diff --git a/www/chromium/files/patch-content_public_common_content__features.h b/www/chromium/files/patch-content_public_common_content__features.h index 8d9d438ee1d8..7f0e57cb8300 100644 --- a/www/chromium/files/patch-content_public_common_content__features.h +++ b/www/chromium/files/patch-content_public_common_content__features.h @@ -1,11 +1,11 @@ ---- content/public/common/content_features.h.orig 2022-03-25 21:59:56 UTC +--- content/public/common/content_features.h.orig 2022-04-21 18:48:31 UTC +++ content/public/common/content_features.h -@@ -258,7 +258,7 @@ CONTENT_EXPORT extern const base::Feature kV8VmFuture; +@@ -259,7 +259,7 @@ CONTENT_EXPORT extern const base::Feature kV8VmFuture; CONTENT_EXPORT extern const base::Feature kWebAppWindowControlsOverlay; CONTENT_EXPORT extern const base::Feature kWebAssemblyBaseline; CONTENT_EXPORT extern const base::Feature kWebAssemblyCodeProtection; -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64) CONTENT_EXPORT extern const base::Feature kWebAssemblyCodeProtectionPku; #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && // defined(ARCH_CPU_X86_64) diff --git a/www/chromium/files/patch-content_public_common_content__switches.cc b/www/chromium/files/patch-content_public_common_content__switches.cc index 7b32ea15738e..8f17be4a34e5 100644 --- a/www/chromium/files/patch-content_public_common_content__switches.cc +++ b/www/chromium/files/patch-content_public_common_content__switches.cc @@ -1,20 +1,20 @@ ---- content/public/common/content_switches.cc.orig 2022-03-25 21:59:56 UTC +--- content/public/common/content_switches.cc.orig 2022-04-21 18:48:31 UTC +++ content/public/common/content_switches.cc -@@ -383,6 +383,8 @@ const char kEnableGpuMemoryBufferVideoFrames[] = +@@ -380,6 +380,8 @@ const char kEnableGpuMemoryBufferVideoFrames[] = // builds. const char kEnableLogging[] = "enable-logging"; +const char kDisableUnveil[] = "disable-unveil"; + // Enables the type, downlinkMax attributes of the NetInfo API. Also, enables // triggering of change attribute of the NetInfo API when there is a change in // the connection type. -@@ -981,7 +983,7 @@ const char kEnableAutomation[] = "enable-automation"; +@@ -983,7 +985,7 @@ const char kEnableAutomation[] = "enable-automation"; // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Allows sending text-to-speech requests to speech-dispatcher, a common // Linux speech service. Because it's buggy, the user must explicitly // enable it so that visiting a random webpage can't cause instability. diff --git a/www/chromium/files/patch-content_public_common_content__switches.h b/www/chromium/files/patch-content_public_common_content__switches.h index da40df11d82d..e3a8977c43e8 100644 --- a/www/chromium/files/patch-content_public_common_content__switches.h +++ b/www/chromium/files/patch-content_public_common_content__switches.h @@ -1,19 +1,19 @@ ---- content/public/common/content_switches.h.orig 2022-03-25 21:59:56 UTC +--- content/public/common/content_switches.h.orig 2022-04-21 18:48:31 UTC +++ content/public/common/content_switches.h @@ -120,6 +120,7 @@ CONTENT_EXPORT extern const char kEnableBlinkTestFeatu CONTENT_EXPORT extern const char kEnableGpuMemoryBufferVideoFrames[]; CONTENT_EXPORT extern const char kEnableLCDText[]; CONTENT_EXPORT extern const char kEnableLogging[]; +CONTENT_EXPORT extern const char kDisableUnveil[]; CONTENT_EXPORT extern const char kEnableNetworkInformationDownlinkMax[]; CONTENT_EXPORT extern const char kEnableCanvas2DLayers[]; - CONTENT_EXPORT extern const char kEnableNewCanvas2DAPI[]; + CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[]; @@ -267,7 +268,7 @@ CONTENT_EXPORT extern const char kRendererWaitForJavaD // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) CONTENT_EXPORT extern const char kEnableSpeechDispatcher[]; #endif diff --git a/www/chromium/files/patch-content_renderer_render__process__impl.cc b/www/chromium/files/patch-content_renderer_render__process__impl.cc index da23f9def37b..724870160ef7 100644 --- a/www/chromium/files/patch-content_renderer_render__process__impl.cc +++ b/www/chromium/files/patch-content_renderer_render__process__impl.cc @@ -1,29 +1,29 @@ ---- content/renderer/render_process_impl.cc.orig 2022-02-28 16:54:41 UTC +--- content/renderer/render_process_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/renderer/render_process_impl.cc -@@ -47,7 +47,7 @@ +@@ -48,7 +48,7 @@ #if BUILDFLAG(IS_WIN) #include "base/win/win_util.h" #endif -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64) #include "v8/include/v8-wasm-trap-handler-posix.h" #endif -@@ -146,7 +146,7 @@ RenderProcessImpl::RenderProcessImpl() +@@ -147,7 +147,7 @@ RenderProcessImpl::RenderProcessImpl() SetV8FlagIfNotFeature(features::kWebAssemblyCodeProtection, "--no-wasm-write-protect-code-memory"); -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64) SetV8FlagIfFeature(features::kWebAssemblyCodeProtectionPku, "--wasm-memory-protection-keys"); SetV8FlagIfNotFeature(features::kWebAssemblyCodeProtectionPku, -@@ -227,7 +227,7 @@ RenderProcessImpl::RenderProcessImpl() +@@ -228,7 +228,7 @@ RenderProcessImpl::RenderProcessImpl() SetV8FlagIfFeature(features::kWebAssemblyDynamicTiering, "--wasm-dynamic-tiering"); -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_64) if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) { if (command_line->HasSwitch(switches::kEnableCrashpad) || command_line->HasSwitch(switches::kEnableCrashReporter) || diff --git a/www/chromium/files/patch-content_renderer_render__thread__impl.cc b/www/chromium/files/patch-content_renderer_render__thread__impl.cc index 979c13db3087..65136d444b1b 100644 --- a/www/chromium/files/patch-content_renderer_render__thread__impl.cc +++ b/www/chromium/files/patch-content_renderer_render__thread__impl.cc @@ -1,47 +1,47 @@ ---- content/renderer/render_thread_impl.cc.orig 2022-03-25 21:59:56 UTC +--- content/renderer/render_thread_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/renderer/render_thread_impl.cc -@@ -189,7 +189,7 @@ +@@ -191,7 +191,7 @@ #if BUILDFLAG(IS_MAC) #include -#else +#elif !BUILDFLAG(IS_OPENBSD) #include #endif -@@ -718,7 +718,7 @@ void RenderThreadImpl::Init() { +@@ -720,7 +720,7 @@ void RenderThreadImpl::Init() { DCHECK(parsed_num_raster_threads) << string_value; DCHECK_GT(num_raster_threads, 0); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) categorized_worker_pool_->SetBackgroundingCallback( main_thread_scheduler_->DefaultTaskRunner(), base::BindOnce( -@@ -741,7 +741,7 @@ void RenderThreadImpl::Init() { +@@ -743,7 +743,7 @@ void RenderThreadImpl::Init() { base::DiscardableMemoryAllocator::SetInstance( discardable_memory_allocator_.get()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled( blink::features::kBlinkCompositorUseDisplayThreadPriority)) { render_message_filter()->SetThreadPriority( -@@ -1093,7 +1093,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: +@@ -1095,7 +1095,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: const bool enable_video_decode_accelerator = -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FeatureList::IsEnabled(media::kVaapiVideoDecodeLinux) && #else !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) && -@@ -1104,7 +1104,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: +@@ -1106,7 +1106,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: const bool enable_video_encode_accelerator = -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FeatureList::IsEnabled(media::kVaapiVideoEncodeLinux) && #else !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoEncode) && diff --git a/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc b/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc index 4f2d42d5410a..e87fbf143033 100644 --- a/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc +++ b/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc @@ -1,48 +1,48 @@ ---- content/renderer/renderer_blink_platform_impl.cc.orig 2022-03-25 21:59:56 UTC +--- content/renderer/renderer_blink_platform_impl.cc.orig 2022-04-21 18:48:31 UTC +++ content/renderer/renderer_blink_platform_impl.cc -@@ -109,7 +109,7 @@ +@@ -110,7 +110,7 @@ #if BUILDFLAG(IS_MAC) #include "content/child/child_process_sandbox_support_impl_mac.h" -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "content/child/child_process_sandbox_support_impl_linux.h" #endif -@@ -178,7 +178,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( +@@ -179,7 +179,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( main_thread_scheduler_(main_thread_scheduler) { // RenderThread may not exist in some tests. if (RenderThreadImpl::current()) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) mojo::PendingRemote font_service; RenderThreadImpl::current()->BindHostReceiver( font_service.InitWithNewPipeAndPassReceiver()); -@@ -188,7 +188,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( +@@ -189,7 +189,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( #endif } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (sandboxEnabled()) { #if BUILDFLAG(IS_MAC) sandbox_support_ = std::make_unique(); -@@ -283,7 +283,8 @@ RendererBlinkPlatformImpl::WrapSharedURLLoaderFactory( +@@ -284,7 +284,8 @@ RendererBlinkPlatformImpl::WrapSharedURLLoaderFactory( /*terminate_sync_load_event=*/nullptr); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +// pledge +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD) void RendererBlinkPlatformImpl::SetDisplayThreadPriority( base::PlatformThreadId thread_id) { if (RenderThreadImpl* render_thread = RenderThreadImpl::current()) { -@@ -298,7 +299,7 @@ blink::BlameContext* RendererBlinkPlatformImpl::GetTop +@@ -299,7 +300,7 @@ blink::BlameContext* RendererBlinkPlatformImpl::GetTop } blink::WebSandboxSupport* RendererBlinkPlatformImpl::GetSandboxSupport() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) return sandbox_support_.get(); #else // These platforms do not require sandbox support. diff --git a/www/chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc b/www/chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc index cf39697c5157..9edf00e28c09 100644 --- a/www/chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc +++ b/www/chromium/files/patch-content_shell_browser_shell__browser__main__parts.cc @@ -1,20 +1,20 @@ ---- content/shell/browser/shell_browser_main_parts.cc.orig 2022-02-28 16:54:41 UTC +--- content/shell/browser/shell_browser_main_parts.cc.orig 2022-04-21 18:48:31 UTC +++ content/shell/browser/shell_browser_main_parts.cc -@@ -49,7 +49,7 @@ +@@ -50,7 +50,7 @@ #include "net/base/network_change_notifier.h" #endif -#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) #include "ui/base/ime/init/input_method_initializer.h" #endif -@@ -129,7 +129,7 @@ void ShellBrowserMainParts::PostCreateMainMessageLoop( +@@ -130,7 +130,7 @@ void ShellBrowserMainParts::PostCreateMainMessageLoop( } int ShellBrowserMainParts::PreEarlyInitialization() { -#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) ui::InitializeInputMethodForTesting(); #endif #if BUILDFLAG(IS_ANDROID) diff --git a/www/chromium/files/patch-content_test_BUILD.gn b/www/chromium/files/patch-content_test_BUILD.gn index e2db5223fc7f..49a2afa86665 100644 --- a/www/chromium/files/patch-content_test_BUILD.gn +++ b/www/chromium/files/patch-content_test_BUILD.gn @@ -1,20 +1,20 @@ ---- content/test/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- content/test/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ content/test/BUILD.gn @@ -1914,7 +1914,7 @@ static_library("run_all_unittests") { ":test_support", "//base/test:test_support", ] - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { deps += [ "//content/common:set_process_title_linux" ] } } -@@ -2850,7 +2850,7 @@ test("content_unittests") { +@@ -2866,7 +2866,7 @@ test("content_unittests") { deps += [ "//third_party/boringssl" ] } - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "../common/set_process_title_linux_unittest.cc" ] deps += [ "//content/common:set_process_title_linux" ] } diff --git a/www/chromium/files/patch-content_utility_utility__main.cc b/www/chromium/files/patch-content_utility_utility__main.cc index 52a7fc2d81c4..c45281e29db6 100644 --- a/www/chromium/files/patch-content_utility_utility__main.cc +++ b/www/chromium/files/patch-content_utility_utility__main.cc @@ -1,55 +1,56 @@ ---- content/utility/utility_main.cc.orig 2022-02-28 16:54:41 UTC +--- content/utility/utility_main.cc.orig 2022-04-21 18:48:31 UTC +++ content/utility/utility_main.cc -@@ -32,16 +32,22 @@ +@@ -32,17 +32,23 @@ #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/icu/source/i18n/unicode/timezone.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include "components/services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h" #include "content/utility/speech/speech_recognition_sandbox_hook_linux.h" #if BUILDFLAG(ENABLE_PRINTING) #include "printing/sandbox/print_backend_sandbox_hook_linux.h" #endif +#if !BUILDFLAG(IS_BSD) #include "sandbox/policy/linux/sandbox_linux.h" +#endif #include "services/audio/audio_sandbox_hook_linux.h" #include "services/network/network_sandbox_hook_linux.h" #endif +#if BUILDFLAG(IS_BSD) +#include "sandbox/policy/openbsd/sandbox_openbsd.h" +#endif + #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/services/ime/ime_sandbox_hook.h" #include "chromeos/assistant/buildflags.h" -@@ -135,7 +141,7 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -136,7 +142,7 @@ int UtilityMain(MainFunctionParams parameters) { } } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Initializes the sandbox before any threads are created. // TODO(jorgelo): move this after GTK initialization when we enable a strict // Seccomp-BPF policy. -@@ -179,6 +185,7 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -183,6 +189,7 @@ int UtilityMain(MainFunctionParams parameters) { default: break; } +#if !BUILDFLAG(IS_BSD) if (parameters.zygote_child || !pre_sandbox_hook.is_null()) { sandbox::policy::SandboxLinux::Options sandbox_options; #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -194,6 +201,11 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -198,6 +205,11 @@ int UtilityMain(MainFunctionParams parameters) { sandbox::policy::Sandbox::Initialize( sandbox_type, std::move(pre_sandbox_hook), sandbox_options); } +#else + sandbox::policy::Sandbox::Initialize( + sandbox_type, std::move(pre_sandbox_hook), + sandbox::policy::SandboxLinux::Options()); +#endif #elif BUILDFLAG(IS_WIN) g_utility_target_services = parameters.sandbox_info->target_services; #endif diff --git a/www/chromium/files/patch-extensions_browser_extension__prefs.cc b/www/chromium/files/patch-extensions_browser_extension__prefs.cc index d8cb32174e6f..1328e0884471 100644 --- a/www/chromium/files/patch-extensions_browser_extension__prefs.cc +++ b/www/chromium/files/patch-extensions_browser_extension__prefs.cc @@ -1,11 +1,11 @@ ---- extensions/browser/extension_prefs.cc.orig 2022-03-25 21:59:56 UTC +--- extensions/browser/extension_prefs.cc.orig 2022-04-21 18:48:31 UTC +++ extensions/browser/extension_prefs.cc -@@ -2269,7 +2269,7 @@ void ExtensionPrefs::RegisterProfilePrefs( - registry->RegisterStringPref(pref_names::kLastChromeVersion, std::string()); +@@ -2270,7 +2270,7 @@ void ExtensionPrefs::RegisterProfilePrefs( registry->RegisterDictionaryPref(kInstallSignature); registry->RegisterListPref(kExternalUninstalls); --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(pref_names::kChromeAppsEnabled, false); #endif registry->RegisterBooleanPref(pref_names::kU2fSecurityKeyApiEnabled, false); diff --git a/www/chromium/files/patch-extensions_browser_pref__names.cc b/www/chromium/files/patch-extensions_browser_pref__names.cc index 5797de43685b..7cc9ac98f9f4 100644 --- a/www/chromium/files/patch-extensions_browser_pref__names.cc +++ b/www/chromium/files/patch-extensions_browser_pref__names.cc @@ -1,11 +1,11 @@ ---- extensions/browser/pref_names.cc.orig 2022-02-28 16:54:41 UTC +--- extensions/browser/pref_names.cc.orig 2022-04-21 18:48:31 UTC +++ extensions/browser/pref_names.cc -@@ -48,7 +48,7 @@ const char kStorageGarbageCollect[] = "extensions.stor - const char kToolbar[] = "extensions.toolbar"; +@@ -49,7 +49,7 @@ const char kToolbar[] = "extensions.toolbar"; const char kDeletedComponentExtensions[] = "extensions.deleted_component_extensions"; --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const char kChromeAppsEnabled[] = "extensions.chrome_apps_enabled"; #endif const char kU2fSecurityKeyApiEnabled[] = diff --git a/www/chromium/files/patch-extensions_browser_pref__names.h b/www/chromium/files/patch-extensions_browser_pref__names.h index b4a0fd439d1b..9ad352ae22d0 100644 --- a/www/chromium/files/patch-extensions_browser_pref__names.h +++ b/www/chromium/files/patch-extensions_browser_pref__names.h @@ -1,11 +1,11 @@ ---- extensions/browser/pref_names.h.orig 2022-02-28 16:54:41 UTC +--- extensions/browser/pref_names.h.orig 2022-04-21 18:48:31 UTC +++ extensions/browser/pref_names.h -@@ -101,7 +101,7 @@ extern const char kToolbar[]; - // uninstalled/removed and should not be reloaded. +@@ -102,7 +102,7 @@ extern const char kToolbar[]; extern const char kDeletedComponentExtensions[]; --#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // A preference for whether Chrome Apps should be allowed. The default depends // on the ChromeAppsDeprecation feature flag, and this pref can extend support // for Chrome Apps by enterprise policy. diff --git a/www/chromium/files/patch-gpu_command__buffer_service_external__semaphore.cc b/www/chromium/files/patch-gpu_command__buffer_service_external__semaphore.cc deleted file mode 100644 index 3e8ba0b81e4b..000000000000 --- a/www/chromium/files/patch-gpu_command__buffer_service_external__semaphore.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- gpu/command_buffer/service/external_semaphore.cc.orig 2022-02-28 16:54:41 UTC -+++ gpu/command_buffer/service/external_semaphore.cc -@@ -27,7 +27,7 @@ GLuint ImportSemaphoreHandleToGLSemaphore(SemaphoreHan - if (!handle.is_valid()) - return 0; - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - if (handle.vk_handle_type() != - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) { - DLOG(ERROR) << "Importing semaphore handle of unexpected type:" diff --git a/www/chromium/files/patch-gpu_command__buffer_service_external__vk__image__backing.cc b/www/chromium/files/patch-gpu_command__buffer_service_external__vk__image__backing.cc index da1721a96294..858eaf7fc46f 100644 --- a/www/chromium/files/patch-gpu_command__buffer_service_external__vk__image__backing.cc +++ b/www/chromium/files/patch-gpu_command__buffer_service_external__vk__image__backing.cc @@ -1,29 +1,20 @@ ---- gpu/command_buffer/service/external_vk_image_backing.cc.orig 2022-02-28 16:54:41 UTC +--- gpu/command_buffer/service/external_vk_image_backing.cc.orig 2022-04-21 18:48:31 UTC +++ gpu/command_buffer/service/external_vk_image_backing.cc -@@ -31,7 +31,7 @@ +@@ -30,7 +30,7 @@ #include "ui/gl/gl_version_info.h" #include "ui/gl/scoped_binders.h" -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && BUILDFLAG(USE_DAWN) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN) #include "gpu/command_buffer/service/external_vk_image_dawn_representation.h" #endif -@@ -559,7 +559,7 @@ ExternalVkImageBacking::ProduceDawn(SharedImageManager +@@ -558,7 +558,7 @@ ExternalVkImageBacking::ProduceDawn(SharedImageManager MemoryTypeTracker* tracker, WGPUDevice wgpuDevice, WGPUBackendType backend_type) { -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && BUILDFLAG(USE_DAWN) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN) auto wgpu_format = viz::ToWGPUFormat(format()); if (wgpu_format == WGPUTextureFormat_Undefined) { -@@ -592,7 +592,7 @@ GLuint ExternalVkImageBacking::ProduceGLTextureInterna - gl::GLApi* api = gl::g_current_gl_context; - absl::optional memory_object; - if (!use_separate_gl_texture()) { --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - auto memory_fd = image_->GetMemoryFd(); - if (!memory_fd.is_valid()) - return 0; diff --git a/www/chromium/files/patch-gpu_command__buffer_service_shared__image__factory.cc b/www/chromium/files/patch-gpu_command__buffer_service_shared__image__factory.cc index b12a153e058a..0e9120084ccc 100644 --- a/www/chromium/files/patch-gpu_command__buffer_service_shared__image__factory.cc +++ b/www/chromium/files/patch-gpu_command__buffer_service_shared__image__factory.cc @@ -1,35 +1,34 @@ ---- gpu/command_buffer/service/shared_image_factory.cc.orig 2022-03-25 21:59:56 UTC +--- gpu/command_buffer/service/shared_image_factory.cc.orig 2022-04-21 18:48:31 UTC +++ gpu/command_buffer/service/shared_image_factory.cc -@@ -38,12 +38,12 @@ +@@ -38,11 +38,11 @@ #include "gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.h" #endif -#if BUILDFLAG(IS_LINUX) && defined(USE_OZONE) && BUILDFLAG(ENABLE_VULKAN) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) && BUILDFLAG(ENABLE_VULKAN) #include "ui/ozone/public/ozone_platform.h" #endif - #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN)) && \ -- BUILDFLAG(ENABLE_VULKAN) -+ BUILDFLAG(ENABLE_VULKAN) || BUILDFLAG(IS_BSD) +-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN)) && \ ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)) && \ + BUILDFLAG(ENABLE_VULKAN) #include "gpu/command_buffer/service/external_vk_image_factory.h" #elif BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_VULKAN) - #include "gpu/command_buffer/service/external_vk_image_factory.h" @@ -78,7 +78,7 @@ namespace gpu { -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_ASH) && \ !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMECAST) && \ BUILDFLAG(ENABLE_VULKAN) -@@ -240,7 +240,7 @@ SharedImageFactory::SharedImageFactory( +@@ -241,7 +241,7 @@ SharedImageFactory::SharedImageFactory( factories_.push_back(std::move(external_vk_image_factory)); } #elif defined(USE_OZONE) -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMEOS_ASH) && \ !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMECAST) // Desktop Linux, not ChromeOS. if (gr_context_type_ == GrContextType::kVulkan && diff --git a/www/chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc b/www/chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc index 2b4f5dd1c683..a0d38838323f 100644 --- a/www/chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc +++ b/www/chromium/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2022-03-25 21:59:56 UTC +--- gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2022-04-21 18:48:31 UTC +++ gpu/command_buffer/service/webgpu_decoder_impl.cc -@@ -1498,7 +1498,7 @@ error::Error WebGPUDecoderImpl::HandleRequestAdapter( +@@ -1508,7 +1508,7 @@ error::Error WebGPUDecoderImpl::HandleRequestAdapter( } if (gr_context_type_ != GrContextType::kVulkan) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) SendAdapterProperties(request_adapter_serial, -1, nullptr, "WebGPU on Linux requires command-line flag " "--enable-features=Vulkan,UseSkiaRenderer"); diff --git a/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.cc b/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.cc index b3f2484b9cd8..b33c6ef2cd11 100644 --- a/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.cc +++ b/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.cc @@ -1,20 +1,20 @@ ---- gpu/command_buffer/tests/gl_test_utils.cc.orig 2022-03-25 21:59:56 UTC +--- gpu/command_buffer/tests/gl_test_utils.cc.orig 2022-04-21 18:48:31 UTC +++ gpu/command_buffer/tests/gl_test_utils.cc @@ -24,7 +24,7 @@ #include "ui/gl/gl_version_info.h" #include "ui/gl/init/gl_factory.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "ui/gl/gl_image_native_pixmap.h" #endif -@@ -453,7 +453,7 @@ void GpuCommandBufferTestEGL::RestoreGLDefault() { +@@ -454,7 +454,7 @@ void GpuCommandBufferTestEGL::RestoreGLDefault() { window_system_binding_info_ = gl::GLWindowSystemBindingInfo(); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) scoped_refptr GpuCommandBufferTestEGL::CreateGLImageNativePixmap(gfx::BufferFormat format, gfx::Size size, diff --git a/www/chromium/files/patch-gpu_ipc_common_gpu__memory__buffer__support.h b/www/chromium/files/patch-gpu_ipc_common_gpu__memory__buffer__support.h index 61b45c7dc8e9..ccbf1811d560 100644 --- a/www/chromium/files/patch-gpu_ipc_common_gpu__memory__buffer__support.h +++ b/www/chromium/files/patch-gpu_ipc_common_gpu__memory__buffer__support.h @@ -1,11 +1,11 @@ ---- gpu/ipc/common/gpu_memory_buffer_support.h.orig 2022-02-28 16:54:41 UTC +--- gpu/ipc/common/gpu_memory_buffer_support.h.orig 2022-04-21 18:48:31 UTC +++ gpu/ipc/common/gpu_memory_buffer_support.h -@@ -17,7 +17,7 @@ +@@ -18,7 +18,7 @@ #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE) || BUILDFLAG(IS_BSD) namespace gfx { class ClientNativePixmapFactory; } diff --git a/www/chromium/files/patch-gpu_ipc_service_gpu__init.cc b/www/chromium/files/patch-gpu_ipc_service_gpu__init.cc index 291f1791a3d3..77adcbd2f37f 100644 --- a/www/chromium/files/patch-gpu_ipc_service_gpu__init.cc +++ b/www/chromium/files/patch-gpu_ipc_service_gpu__init.cc @@ -1,65 +1,65 @@ ---- gpu/ipc/service/gpu_init.cc.orig 2022-03-25 21:59:56 UTC +--- gpu/ipc/service/gpu_init.cc.orig 2022-04-21 18:48:31 UTC +++ gpu/ipc/service/gpu_init.cc -@@ -278,7 +278,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -313,7 +313,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL enable_watchdog = false; #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool gpu_sandbox_start_early = gpu_preferences_.gpu_sandbox_start_early; #else // !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) // For some reasons MacOSX's VideoToolbox might crash when called after -@@ -328,7 +328,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -363,7 +363,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL } bool attempted_startsandbox = false; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // On Chrome OS ARM Mali, GPU driver userspace creates threads when // initializing a GL context, so start the sandbox early. // TODO(zmo): Need to collect OS version before this. -@@ -377,7 +377,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -412,7 +412,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL if (gl_initialized && gl_use_swiftshader_ && !gl::IsSoftwareGLImplementation(gl::GetGLImplementationParts())) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly " << "on Linux"; return false; -@@ -410,7 +410,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -445,7 +445,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL } } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // The ContentSandboxHelper is currently the only one implementation of // GpuSandboxHelper and it has no dependency. Except on Linux where // VaapiWrapper checks the GL implementation to determine which display -@@ -469,7 +469,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -504,7 +504,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL command_line, gpu_feature_info_, gpu_preferences_.disable_software_rasterizer, false); if (gl_use_swiftshader_) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly " << "on Linux"; return false; -@@ -591,7 +591,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -627,7 +627,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Driver may create a compatibility profile context when collect graphics // information on Linux platform. Try to collect graphics information // based on core profile context after disabling platform extensions. -@@ -822,7 +822,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c +@@ -860,7 +860,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Driver may create a compatibility profile context when collect graphics // information on Linux platform. Try to collect graphics information // based on core profile context after disabling platform extensions. diff --git a/www/chromium/files/patch-gpu_vulkan_generate__bindings.py b/www/chromium/files/patch-gpu_vulkan_generate__bindings.py index 302d5f1e0418..3ff8eb6ba85b 100644 --- a/www/chromium/files/patch-gpu_vulkan_generate__bindings.py +++ b/www/chromium/files/patch-gpu_vulkan_generate__bindings.py @@ -1,29 +1,11 @@ ---- gpu/vulkan/generate_bindings.py.orig 2022-02-28 16:54:41 UTC +--- gpu/vulkan/generate_bindings.py.orig 2022-04-21 18:48:31 UTC +++ gpu/vulkan/generate_bindings.py -@@ -185,7 +185,7 @@ VULKAN_DEVICE_FUNCTIONS = [ - }, - { - 'ifdef': -- 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)', -+ 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)', - 'extension': 'VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME', - 'functions': [ - 'vkGetSemaphoreFdKHR', -@@ -202,7 +202,7 @@ VULKAN_DEVICE_FUNCTIONS = [ - }, - { - 'ifdef': -- 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)', -+ 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)', - 'extension': 'VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME', - 'functions': [ - 'vkGetMemoryFdKHR', -@@ -253,7 +253,7 @@ VULKAN_DEVICE_FUNCTIONS = [ +@@ -259,7 +259,7 @@ VULKAN_DEVICE_FUNCTIONS = [ ] }, { - 'ifdef': 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)', + 'ifdef': 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)', 'extension': 'VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME', 'functions': [ 'vkGetImageDrmFormatModifierPropertiesEXT', diff --git a/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.cc b/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.cc index 023ecf8bec3a..4fcc6cadaf6d 100644 --- a/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.cc +++ b/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.cc @@ -1,29 +1,11 @@ ---- gpu/vulkan/vulkan_function_pointers.cc.orig 2022-03-25 21:59:56 UTC +--- gpu/vulkan/vulkan_function_pointers.cc.orig 2022-04-21 18:48:31 UTC +++ gpu/vulkan/vulkan_function_pointers.cc -@@ -926,7 +926,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer - } - #endif // BUILDFLAG(IS_ANDROID) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - if (gfx::HasExtension(enabled_extensions, - VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME)) { - vkGetSemaphoreFdKHR = reinterpret_cast( -@@ -971,7 +971,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer - } - #endif // BUILDFLAG(IS_WIN) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - if (gfx::HasExtension(enabled_extensions, - VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME)) { - vkGetMemoryFdKHR = reinterpret_cast( -@@ -1141,7 +1141,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer +@@ -1151,7 +1151,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer } } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (gfx::HasExtension(enabled_extensions, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME)) { vkGetImageDrmFormatModifierPropertiesEXT = diff --git a/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.h b/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.h index af1ea9064200..19b6ee367e23 100644 --- a/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.h +++ b/www/chromium/files/patch-gpu_vulkan_vulkan__function__pointers.h @@ -1,63 +1,27 @@ ---- gpu/vulkan/vulkan_function_pointers.h.orig 2022-03-25 21:59:56 UTC +--- gpu/vulkan/vulkan_function_pointers.h.orig 2022-04-21 18:48:31 UTC +++ gpu/vulkan/vulkan_function_pointers.h -@@ -250,7 +250,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers - vkGetAndroidHardwareBufferPropertiesANDROID; - #endif // BUILDFLAG(IS_ANDROID) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - VulkanFunction vkGetSemaphoreFdKHR; - VulkanFunction vkImportSemaphoreFdKHR; - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || -@@ -262,7 +262,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers - vkImportSemaphoreWin32HandleKHR; - #endif // BUILDFLAG(IS_WIN) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - VulkanFunction vkGetMemoryFdKHR; - VulkanFunction vkGetMemoryFdPropertiesKHR; - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || -@@ -303,7 +303,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers +@@ -305,7 +305,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers VulkanFunction vkGetSwapchainImagesKHR; VulkanFunction vkQueuePresentKHR; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) VulkanFunction vkGetImageDrmFormatModifierPropertiesEXT; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -1033,7 +1033,7 @@ ALWAYS_INLINE VkResult vkGetAndroidHardwareBufferPrope - } - #endif // BUILDFLAG(IS_ANDROID) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - ALWAYS_INLINE VkResult - vkGetSemaphoreFdKHR(VkDevice device, - const VkSemaphoreGetFdInfoKHR* pGetFdInfo, -@@ -1067,7 +1067,7 @@ vkImportSemaphoreWin32HandleKHR(VkDevice device, - } - #endif // BUILDFLAG(IS_WIN) - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) - ALWAYS_INLINE VkResult vkGetMemoryFdKHR(VkDevice device, - const VkMemoryGetFdInfoKHR* pGetFdInfo, - int* pFd) { -@@ -1203,7 +1203,7 @@ ALWAYS_INLINE VkResult vkQueuePresentKHR(VkQueue queue +@@ -1212,7 +1212,7 @@ ALWAYS_INLINE VkResult vkQueuePresentKHR(VkQueue queue pPresentInfo); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierPropertiesEXT( VkDevice device, VkImage image, -@@ -1213,4 +1213,4 @@ ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierProp +@@ -1222,4 +1222,4 @@ ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierProp } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -#endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_ \ No newline at end of file +#endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_ diff --git a/www/chromium/files/patch-media_BUILD.gn b/www/chromium/files/patch-media_BUILD.gn index 30db34ef80e2..0b878f28c0b5 100644 --- a/www/chromium/files/patch-media_BUILD.gn +++ b/www/chromium/files/patch-media_BUILD.gn @@ -1,12 +1,12 @@ ---- media/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- media/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ media/BUILD.gn -@@ -76,6 +76,9 @@ config("media_config") { +@@ -77,6 +77,9 @@ config("media_config") { defines += [ "DLOPEN_PULSEAUDIO" ] } } + if (use_sndio) { + defines += [ "USE_SNDIO" ] + } if (use_cras) { defines += [ "USE_CRAS" ] } diff --git a/www/chromium/files/patch-media_audio_BUILD.gn b/www/chromium/files/patch-media_audio_BUILD.gn index 03b517313c02..c7780eee9e89 100644 --- a/www/chromium/files/patch-media_audio_BUILD.gn +++ b/www/chromium/files/patch-media_audio_BUILD.gn @@ -1,24 +1,24 @@ ---- media/audio/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- media/audio/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ media/audio/BUILD.gn -@@ -245,9 +245,20 @@ source_set("audio") { +@@ -243,9 +243,20 @@ source_set("audio") { ] } - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !use_sndio) { sources += [ "linux/audio_manager_linux.cc" ] } + + if (use_sndio) { + libs += [ "sndio" ] + sources += [ + "sndio/audio_manager_sndio.cc", + "sndio/sndio_input.cc", + "sndio/sndio_input.h", + "sndio/sndio_output.cc", + "sndio/sndio_output.h" + ] + } if (use_alsa) { libs += [ "asound" ] diff --git a/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc b/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc index deb7ec59d8a0..a26dd20d89cf 100644 --- a/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc +++ b/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc @@ -1,54 +1,54 @@ ---- media/audio/alsa/audio_manager_alsa.cc.orig 2022-03-05 18:42:44 UTC +--- media/audio/alsa/audio_manager_alsa.cc.orig 2022-04-21 18:48:31 UTC +++ media/audio/alsa/audio_manager_alsa.cc -@@ -89,7 +89,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType +@@ -88,7 +88,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType int card = -1; // Loop through the sound cards to get ALSA device hints. +#if !BUILDFLAG(IS_BSD) while (!wrapper_->CardNext(&card) && card >= 0) { +#endif void** hints = NULL; int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints); if (!error) { -@@ -101,7 +103,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType +@@ -100,7 +102,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType DLOG(WARNING) << "GetAlsaAudioDevices: unable to get device hints: " << wrapper_->StrError(error); } +#if !BUILDFLAG(IS_BSD) } +#endif } void AudioManagerAlsa::GetAlsaDevicesInfo(AudioManagerAlsa::StreamType type, -@@ -184,7 +188,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvailable( +@@ -183,7 +187,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvailable( // goes through software conversion if needed (e.g. incompatible // sample rate). // TODO(joi): Should we prefer "hw" instead? +#if BUILDFLAG(IS_BSD) + static const char kDeviceTypeDesired[] = "plug"; +#else static const char kDeviceTypeDesired[] = "plughw"; +#endif return strncmp(kDeviceTypeDesired, device_name, - base::size(kDeviceTypeDesired) - 1) == 0; + std::size(kDeviceTypeDesired) - 1) == 0; } -@@ -206,7 +214,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice( +@@ -205,7 +213,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice( // Loop through the sound cards. // Don't use snd_device_name_hint(-1,..) since there is an access violation // inside this ALSA API with libasound.so.2.0.0. +#if !BUILDFLAG(IS_BSD) while (!wrapper_->CardNext(&card) && (card >= 0) && !has_device) { +#endif int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints); if (!error) { for (void** hint_iter = hints; *hint_iter != NULL; hint_iter++) { -@@ -230,7 +240,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice( +@@ -229,7 +239,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice( DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: " << wrapper_->StrError(error); } +#if !BUILDFLAG(IS_BSD) } +#endif return has_device; } diff --git a/www/chromium/files/patch-media_base_media__switches.cc b/www/chromium/files/patch-media_base_media__switches.cc index 5ef1cbdba015..2650100c4948 100644 --- a/www/chromium/files/patch-media_base_media__switches.cc +++ b/www/chromium/files/patch-media_base_media__switches.cc @@ -1,47 +1,47 @@ ---- media/base/media_switches.cc.orig 2022-03-25 21:59:56 UTC +--- media/base/media_switches.cc.orig 2022-04-21 18:48:31 UTC +++ media/base/media_switches.cc -@@ -9,7 +9,7 @@ - #include "build/chromeos_buildflags.h" +@@ -10,7 +10,7 @@ #include "components/system_media_controls/linux/buildflags/buildflags.h" + #include "media/media_buildflags.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/cpu.h" #endif -@@ -402,7 +402,7 @@ const base::Feature kGav1VideoDecoder{"Gav1VideoDecode +@@ -410,7 +410,7 @@ const base::Feature kGav1VideoDecoder{"Gav1VideoDecode const base::Feature kGlobalMediaControls { "GlobalMediaControls", #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT -@@ -434,7 +434,7 @@ constexpr base::FeatureParam GetDefaultLayo +@@ -275,7 +275,7 @@ static absl::optional GetDefaultLayo return VideoFrameLayout::CreateWithPlanes(format, coded_size, planes); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // This class allows us to embed a vector into a scoped_refptr, and // thus to have several VideoFrames share the same set of DMABUF FDs. class VideoFrame::DmabufHolder -@@ -617,7 +617,7 @@ scoped_refptr VideoFrame::WrapExternalGpuM +@@ -614,7 +614,7 @@ scoped_refptr VideoFrame::WrapExternalGpuM for (size_t i = 0; i < num_planes; ++i) planes[i].stride = gpu_memory_buffer->stride(i); uint64_t modifier = gfx::NativePixmapHandle::kNoModifier; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) { const auto gmb_handle = gpu_memory_buffer->CloneHandle(); if (gmb_handle.is_null() || -@@ -663,7 +663,7 @@ scoped_refptr VideoFrame::WrapExternalGpuM +@@ -660,7 +660,7 @@ scoped_refptr VideoFrame::WrapExternalGpuM return frame; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // static scoped_refptr VideoFrame::WrapExternalDmabufs( const VideoFrameLayout& layout, -@@ -887,7 +887,7 @@ scoped_refptr VideoFrame::WrapVideoFrame( +@@ -884,7 +884,7 @@ scoped_refptr VideoFrame::WrapVideoFrame( } } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) DCHECK(frame->dmabuf_fds_); // If there are any |dmabuf_fds_| plugged in, we should refer them too. wrapping_frame->dmabuf_fds_ = frame->dmabuf_fds_; -@@ -1253,7 +1253,7 @@ const gpu::MailboxHolder& VideoFrame::mailbox_holder( +@@ -1250,7 +1250,7 @@ const gpu::MailboxHolder& VideoFrame::mailbox_holder( : mailbox_holders_[texture_index]; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const std::vector& VideoFrame::DmabufFds() const { DCHECK_EQ(storage_type_, STORAGE_DMABUFS); -@@ -1365,7 +1365,7 @@ VideoFrame::VideoFrame(const VideoFrameLayout& layout, +@@ -1362,7 +1362,7 @@ VideoFrame::VideoFrame(const VideoFrameLayout& layout, storage_type_(storage_type), visible_rect_(Intersection(visible_rect, gfx::Rect(layout.coded_size()))), natural_size_(natural_size), -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) dmabuf_fds_(base::MakeRefCounted()), #endif timestamp_(timestamp), diff --git a/www/chromium/files/patch-media_base_video__frame.h b/www/chromium/files/patch-media_base_video__frame.h index 08554c4f9a3a..4635beba1402 100644 --- a/www/chromium/files/patch-media_base_video__frame.h +++ b/www/chromium/files/patch-media_base_video__frame.h @@ -1,47 +1,47 @@ ---- media/base/video_frame.h.orig 2022-03-16 08:38:25 UTC +--- media/base/video_frame.h.orig 2022-04-21 18:48:31 UTC +++ media/base/video_frame.h @@ -40,7 +40,7 @@ #include "base/mac/scoped_cftyperef.h" #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/files/scoped_file.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -82,7 +82,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte STORAGE_UNOWNED_MEMORY = 2, // External, non owned data pointers. STORAGE_OWNED_MEMORY = 3, // VideoFrame has allocated its own data buffer. STORAGE_SHMEM = 4, // Backed by unsafe (writable) shared memory. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // TODO(mcasas): Consider turning this type into STORAGE_NATIVE // based on the idea of using this same enum value for both DMA // buffers on Linux and CVPixelBuffers on Mac (which currently use @@ -280,7 +280,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte ReleaseMailboxAndGpuMemoryBufferCB mailbox_holder_and_gmb_release_cb, base::TimeDelta timestamp); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Wraps provided dmabufs // (https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html) with a // VideoFrame. The frame will take ownership of |dmabuf_fds|, and will @@ -539,7 +539,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte // mailbox, the caller must wait for the included sync point. const gpu::MailboxHolder& mailbox_holder(size_t texture_index) const; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Returns a vector containing the backing DmaBufs for this frame. The number // of returned DmaBufs will be equal or less than the number of planes of // the frame. If there are less, this means that the last FD contains the -@@ -746,7 +746,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte +@@ -743,7 +743,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCounte // GPU memory buffer, if this frame is STORAGE_GPU_MEMORY_BUFFER. std::unique_ptr gpu_memory_buffer_; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) class DmabufHolder; // Dmabufs for the frame, used when storage is STORAGE_DMABUFS. Size is either diff --git a/www/chromium/files/patch-media_gpu_buffer__validation.cc b/www/chromium/files/patch-media_gpu_buffer__validation.cc index d403f80d8f94..75c62880bb07 100644 --- a/www/chromium/files/patch-media_gpu_buffer__validation.cc +++ b/www/chromium/files/patch-media_gpu_buffer__validation.cc @@ -1,29 +1,29 @@ ---- media/gpu/buffer_validation.cc.orig 2022-03-16 08:38:25 UTC +--- media/gpu/buffer_validation.cc.orig 2022-04-21 18:48:31 UTC +++ media/gpu/buffer_validation.cc @@ -15,7 +15,7 @@ #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #include #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -23,7 +23,7 @@ namespace media { bool GetFileSize(const int fd, size_t* size) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (fd < 0) { VLOGF(1) << "Invalid file descriptor"; return false; -@@ -66,7 +66,7 @@ bool VerifyGpuMemoryBufferHandle( - << coded_size.ToString(); +@@ -73,7 +73,7 @@ bool VerifyGpuMemoryBufferHandle( + VLOGF(1) << "Unsupported: " << pixel_format; return false; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format); if (num_planes != gmb_handle.native_pixmap_handle.planes.size() || num_planes == 0) { diff --git a/www/chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc b/www/chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc index 1172bf968237..fc9753486ae9 100644 --- a/www/chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc +++ b/www/chromium/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc @@ -1,11 +1,11 @@ ---- media/gpu/gpu_video_encode_accelerator_factory.cc.orig 2022-02-28 16:54:41 UTC +--- media/gpu/gpu_video_encode_accelerator_factory.cc.orig 2022-04-21 18:48:31 UTC +++ media/gpu/gpu_video_encode_accelerator_factory.cc -@@ -92,7 +92,7 @@ std::vector GetVEAFactoryFunctions +@@ -96,7 +96,7 @@ std::vector GetVEAFactoryFunctions return vea_factory_functions; #if BUILDFLAG(USE_VAAPI) -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled(kVaapiVideoEncodeLinux)) vea_factory_functions.push_back(base::BindRepeating(&CreateVaapiVEA)); #else diff --git a/www/chromium/files/patch-media_gpu_vaapi_vaapi__wrapper.cc b/www/chromium/files/patch-media_gpu_vaapi_vaapi__wrapper.cc index cd48a83fe02c..e8b8aa1b6a2b 100644 --- a/www/chromium/files/patch-media_gpu_vaapi_vaapi__wrapper.cc +++ b/www/chromium/files/patch-media_gpu_vaapi_vaapi__wrapper.cc @@ -1,11 +1,11 @@ ---- media/gpu/vaapi/vaapi_wrapper.cc.orig 2022-03-25 21:59:56 UTC +--- media/gpu/vaapi/vaapi_wrapper.cc.orig 2022-04-21 18:48:31 UTC +++ media/gpu/vaapi/vaapi_wrapper.cc -@@ -587,7 +587,7 @@ VADisplayState::VADisplayState() +@@ -582,7 +582,7 @@ VADisplayState::VADisplayState() bool VADisplayState::Initialize() { base::AutoLock auto_lock(va_lock_); -#if defined(USE_OZONE) && BUILDFLAG(IS_LINUX) +#if defined(USE_OZONE) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi // for more details. This will also require revisiting everything that's diff --git a/www/chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc b/www/chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc index b8c80844e279..81276616f64f 100644 --- a/www/chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc +++ b/www/chromium/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc @@ -1,11 +1,11 @@ ---- media/video/gpu_memory_buffer_video_frame_pool.cc.orig 2022-02-28 16:54:41 UTC +--- media/video/gpu_memory_buffer_video_frame_pool.cc.orig 2022-04-21 18:48:31 UTC +++ media/video/gpu_memory_buffer_video_frame_pool.cc -@@ -720,7 +720,7 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::CreateHa +@@ -788,7 +788,7 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::CreateHa } bool is_software_backed_video_frame = !video_frame->HasTextures(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) is_software_backed_video_frame &= !video_frame->HasDmaBufs(); #endif diff --git a/www/chromium/files/patch-media_video_video__encode__accelerator__adapter.cc b/www/chromium/files/patch-media_video_video__encode__accelerator__adapter.cc index 3ef6e7cd3149..3faff4f3df0e 100644 --- a/www/chromium/files/patch-media_video_video__encode__accelerator__adapter.cc +++ b/www/chromium/files/patch-media_video_video__encode__accelerator__adapter.cc @@ -1,20 +1,20 @@ ---- media/video/video_encode_accelerator_adapter.cc.orig 2022-03-25 21:59:56 UTC +--- media/video/video_encode_accelerator_adapter.cc.orig 2022-04-21 18:48:31 UTC +++ media/video/video_encode_accelerator_adapter.cc -@@ -96,7 +96,7 @@ VideoEncodeAccelerator::Config SetUpVeaConfig( +@@ -97,7 +97,7 @@ VideoEncodeAccelerator::Config SetUpVeaConfig( if (is_rgb) config.input_format = PIXEL_FORMAT_I420; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (storage_type == VideoFrame::STORAGE_DMABUFS || storage_type == VideoFrame::STORAGE_GPU_MEMORY_BUFFER) { if (is_rgb) -@@ -235,7 +235,7 @@ void VideoEncodeAcceleratorAdapter::InitializeInternal +@@ -238,7 +238,7 @@ void VideoEncodeAcceleratorAdapter::InitializeInternal auto vea_config = SetUpVeaConfig(profile_, options_, format, first_frame->storage_type()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Linux/ChromeOS require a special configuration to use dmabuf storage. // We need to keep sending frames the same way the first frame was sent. // Other platforms will happily mix GpuMemoryBuffer storage with regular diff --git a/www/chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc b/www/chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc index 8e7da0c3e3bf..0d11d1823246 100644 --- a/www/chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc +++ b/www/chromium/files/patch-media_video_video__encode__accelerator__adapter__test.cc @@ -1,11 +1,11 @@ ---- media/video/video_encode_accelerator_adapter_test.cc.orig 2022-03-25 21:59:56 UTC +--- media/video/video_encode_accelerator_adapter_test.cc.orig 2022-04-21 18:48:31 UTC +++ media/video/video_encode_accelerator_adapter_test.cc -@@ -350,7 +350,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest, TwoFramesRes +@@ -352,7 +352,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest, TwoFramesRes vea()->SetEncodingCallback(base::BindLambdaForTesting( [&](BitstreamBuffer&, bool keyframe, scoped_refptr frame) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) EXPECT_EQ(frame->format(), IsYuvPlanar(pixel_format) ? pixel_format : PIXEL_FORMAT_I420); #else diff --git a/www/chromium/files/patch-media_webrtc_audio__processor.cc b/www/chromium/files/patch-media_webrtc_audio__processor.cc index 437fff22f41a..64db24c821ab 100644 --- a/www/chromium/files/patch-media_webrtc_audio__processor.cc +++ b/www/chromium/files/patch-media_webrtc_audio__processor.cc @@ -1,11 +1,11 @@ ---- media/webrtc/audio_processor.cc.orig 2022-03-25 21:59:56 UTC +--- media/webrtc/audio_processor.cc.orig 2022-04-21 18:48:31 UTC +++ media/webrtc/audio_processor.cc -@@ -428,7 +428,7 @@ absl::optional AudioProcessor::ProcessData( +@@ -469,7 +469,7 @@ absl::optional AudioProcessor::ProcessData( #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) DCHECK_LE(volume, 1.0); #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ - BUILDFLAG(IS_OPENBSD) + BUILDFLAG(IS_BSD) // We have a special situation on Linux where the microphone volume can be // "higher than maximum". The input volume slider in the sound preference // allows the user to set a scaling that is higher than 100%. It means that diff --git a/www/chromium/files/patch-mojo_core_channel.cc b/www/chromium/files/patch-mojo_core_channel.cc index 6d3394e1b71a..46e38bace3a0 100644 --- a/www/chromium/files/patch-mojo_core_channel.cc +++ b/www/chromium/files/patch-mojo_core_channel.cc @@ -1,14 +1,14 @@ ---- mojo/core/channel.cc.orig 2022-02-07 13:39:41 UTC +--- mojo/core/channel.cc.orig 2022-04-21 18:48:31 UTC +++ mojo/core/channel.cc -@@ -62,7 +62,11 @@ const size_t kMaxUnusedReadBufferCapacity = 4096; +@@ -70,7 +70,11 @@ const size_t kMaxUnusedReadBufferCapacity = 4096; // Fuchsia: The zx_channel_write() API supports up to 64 handles. const size_t kMaxAttachedHandles = 64; +#if defined(__i386__) && defined(OS_FREEBSD) +const size_t kChannelMessageAlignment = 4; +#else static_assert(alignof(std::max_align_t) >= kChannelMessageAlignment, ""); +#endif Channel::AlignedBuffer MakeAlignedBuffer(size_t size) { // Generic allocators (such as malloc) return a pointer that is suitably // aligned for storing any type of object with a fundamental alignment diff --git a/www/chromium/files/patch-mojo_public_c_system_thunks.cc b/www/chromium/files/patch-mojo_public_c_system_thunks.cc index fe26aa1cf5a8..3855011bf92a 100644 --- a/www/chromium/files/patch-mojo_public_c_system_thunks.cc +++ b/www/chromium/files/patch-mojo_public_c_system_thunks.cc @@ -1,38 +1,38 @@ ---- mojo/public/c/system/thunks.cc.orig 2022-03-25 21:59:56 UTC +--- mojo/public/c/system/thunks.cc.orig 2022-04-21 18:48:31 UTC +++ mojo/public/c/system/thunks.cc -@@ -20,7 +20,7 @@ - #include "mojo/public/c/system/macros.h" +@@ -24,7 +24,7 @@ + #include "mojo/public/c/system/message_pipe.h" #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "base/environment.h" #include "base/files/file_path.h" #include "base/scoped_native_library.h" -@@ -69,7 +69,7 @@ class CoreLibraryInitializer { +@@ -73,7 +73,7 @@ class CoreLibraryInitializer { MojoResult LoadLibrary(base::FilePath library_path) { #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) if (library_ && library_->is_valid()) return MOJO_RESULT_OK; -@@ -83,7 +83,7 @@ class CoreLibraryInitializer { +@@ -87,7 +87,7 @@ class CoreLibraryInitializer { if (library_path.empty()) { // Default to looking for the library in the current working directory. -#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const base::FilePath::CharType kDefaultLibraryPathValue[] = FILE_PATH_LITERAL("./libmojo_core.so"); #elif BUILDFLAG(IS_FUCHSIA) -@@ -139,7 +139,7 @@ class CoreLibraryInitializer { +@@ -143,7 +143,7 @@ class CoreLibraryInitializer { private: #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) absl::optional library_; #endif }; diff --git a/www/chromium/files/patch-mojo_public_js_mojo__bindings__resources.grd b/www/chromium/files/patch-mojo_public_js_mojo__bindings__resources.grd index 77435d61975a..534a90c00d99 100644 --- a/www/chromium/files/patch-mojo_public_js_mojo__bindings__resources.grd +++ b/www/chromium/files/patch-mojo_public_js_mojo__bindings__resources.grd @@ -1,11 +1,11 @@ ---- mojo/public/js/mojo_bindings_resources.grd.orig 2022-03-25 21:59:56 UTC +--- mojo/public/js/mojo_bindings_resources.grd.orig 2022-04-21 18:48:31 UTC +++ mojo/public/js/mojo_bindings_resources.grd @@ -126,7 +126,7 @@ use_base_dir="false" resource_path="mojo/mojo/public/mojom/base/unguessable_token.mojom-webui.js" type="BINDATA" /> -- -+ +- ++ NetworkChangeNo +@@ -320,6 +320,9 @@ std::unique_ptr NetworkChangeNo #elif BUILDFLAG(IS_FUCHSIA) return std::make_unique( /*require_wlan=*/false); +#elif BUILDFLAG(IS_BSD) + return std::make_unique( + /*dns_config_notifier*/nullptr); #else NOTIMPLEMENTED(); return NULL; diff --git a/www/chromium/files/patch-net_cert_cert__verify__proc__unittest.cc b/www/chromium/files/patch-net_cert_cert__verify__proc__unittest.cc index 5be4d0055758..eb5b2f1e119a 100644 --- a/www/chromium/files/patch-net_cert_cert__verify__proc__unittest.cc +++ b/www/chromium/files/patch-net_cert_cert__verify__proc__unittest.cc @@ -1,11 +1,11 @@ ---- net/cert/cert_verify_proc_unittest.cc.orig 2022-03-25 21:59:56 UTC +--- net/cert/cert_verify_proc_unittest.cc.orig 2022-04-21 18:48:31 UTC +++ net/cert/cert_verify_proc_unittest.cc -@@ -225,7 +225,7 @@ const std::vector kAllCertVerifier +@@ -231,7 +231,7 @@ const std::vector kAllCertVerifier CERT_VERIFY_PROC_MAC, CERT_VERIFY_PROC_BUILTIN #elif BUILDFLAG(IS_WIN) - CERT_VERIFY_PROC_WIN + CERT_VERIFY_PROC_WIN, CERT_VERIFY_PROC_BUILTIN_CHROME_ROOTS -#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) CERT_VERIFY_PROC_BUILTIN #else #error Unsupported platform diff --git a/www/chromium/files/patch-net_dns_dns__util.cc b/www/chromium/files/patch-net_dns_dns__util.cc index 2b19d06cde92..9001b9322f68 100644 --- a/www/chromium/files/patch-net_dns_dns__util.cc +++ b/www/chromium/files/patch-net_dns_dns__util.cc @@ -1,11 +1,11 @@ ---- net/dns/dns_util.cc.orig 2022-03-25 21:59:56 UTC +--- net/dns/dns_util.cc.orig 2022-04-21 18:48:31 UTC +++ net/dns/dns_util.cc -@@ -27,6 +27,8 @@ +@@ -28,6 +28,8 @@ #include "net/third_party/uri_template/uri_template.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include + #if BUILDFLAG(IS_POSIX) #include #include diff --git a/www/chromium/files/patch-net_dns_host__resolver__manager.cc b/www/chromium/files/patch-net_dns_host__resolver__manager.cc index ada52d2db219..cc373e5b904a 100644 --- a/www/chromium/files/patch-net_dns_host__resolver__manager.cc +++ b/www/chromium/files/patch-net_dns_host__resolver__manager.cc @@ -1,11 +1,11 @@ ---- net/dns/host_resolver_manager.cc.orig 2022-03-25 21:59:56 UTC +--- net/dns/host_resolver_manager.cc.orig 2022-04-21 18:48:31 UTC +++ net/dns/host_resolver_manager.cc -@@ -2979,7 +2979,7 @@ HostResolverManager::HostResolverManager( +@@ -2996,7 +2996,7 @@ HostResolverManager::HostResolverManager( NetworkChangeNotifier::AddConnectionTypeObserver(this); if (system_dns_config_notifier_) system_dns_config_notifier_->AddObserver(this); -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \ +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) && \ !BUILDFLAG(IS_ANDROID) EnsureDnsReloaderInit(); #endif diff --git a/www/chromium/files/patch-net_http_http__auth__gssapi__posix.cc b/www/chromium/files/patch-net_http_http__auth__gssapi__posix.cc index 02ad3249f4c0..11fe27ffa0ba 100644 --- a/www/chromium/files/patch-net_http_http__auth__gssapi__posix.cc +++ b/www/chromium/files/patch-net_http_http__auth__gssapi__posix.cc @@ -1,14 +1,14 @@ ---- net/http/http_auth_gssapi_posix.cc.orig 2022-02-28 16:54:41 UTC +--- net/http/http_auth_gssapi_posix.cc.orig 2022-04-21 18:48:31 UTC +++ net/http/http_auth_gssapi_posix.cc -@@ -370,8 +370,9 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLib +@@ -369,8 +369,9 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLib static const char* const kDefaultLibraryNames[] = { #if BUILDFLAG(IS_APPLE) "/System/Library/Frameworks/GSS.framework/GSS" -#elif BUILDFLAG(IS_OPENBSD) - "libgssapi.so" // Heimdal - OpenBSD +#elif BUILDFLAG(IS_BSD) + "libgssapi_krb5.so.2", // MIT Kerberos - FreeBSD + "libgssapi.so" // Heimdal - OpenBSD, FreeBSD #else "libgssapi_krb5.so.2", // MIT Kerberos - FC, Suse10, Debian "libgssapi.so.4", // Heimdal - Suse10, MDK diff --git a/www/chromium/files/patch-net_socket_socks5__client__socket.cc b/www/chromium/files/patch-net_socket_socks5__client__socket.cc index e0540ad7d701..d80844cdf1be 100644 --- a/www/chromium/files/patch-net_socket_socks5__client__socket.cc +++ b/www/chromium/files/patch-net_socket_socks5__client__socket.cc @@ -1,12 +1,12 @@ ---- net/socket/socks5_client_socket.cc.orig 2022-02-07 13:39:41 UTC +--- net/socket/socks5_client_socket.cc.orig 2022-04-21 18:48:31 UTC +++ net/socket/socks5_client_socket.cc -@@ -20,6 +20,9 @@ +@@ -19,6 +19,9 @@ #include "net/log/net_log_event_type.h" #include "net/traffic_annotation/network_traffic_annotation.h" +#include +#include + namespace net { const unsigned int SOCKS5ClientSocket::kGreetReadHeaderSize = 2; diff --git a/www/chromium/files/patch-net_socket_tcp__socket__posix.cc b/www/chromium/files/patch-net_socket_tcp__socket__posix.cc index f8d2ca748e33..f49f1cb1caa9 100644 --- a/www/chromium/files/patch-net_socket_tcp__socket__posix.cc +++ b/www/chromium/files/patch-net_socket_tcp__socket__posix.cc @@ -1,20 +1,20 @@ ---- net/socket/tcp_socket_posix.cc.orig 2022-03-25 21:59:56 UTC +--- net/socket/tcp_socket_posix.cc.orig 2022-04-21 18:48:31 UTC +++ net/socket/tcp_socket_posix.cc -@@ -96,6 +96,17 @@ bool SetTCPKeepAlive(int fd, bool enable, int delay) { +@@ -97,6 +97,17 @@ bool SetTCPKeepAlive(int fd, bool enable, int delay) { PLOG(ERROR) << "Failed to set TCP_KEEPALIVE on fd: " << fd; return false; } +#elif BUILDFLAG(IS_FREEBSD) + // Set seconds until first TCP keep alive. + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) { + PLOG(ERROR) << "Failed to set TCP_KEEPIDLE on fd: " << fd; + return false; + } + // Set seconds between TCP keep alives. + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &delay, sizeof(delay))) { + PLOG(ERROR) << "Failed to set TCP_KEEPINTVL on fd: " << fd; + return false; + } #endif return true; } diff --git a/www/chromium/files/patch-net_socket_udp__socket__posix.cc b/www/chromium/files/patch-net_socket_udp__socket__posix.cc index e17e93b8a863..c47c7993e711 100644 --- a/www/chromium/files/patch-net_socket_udp__socket__posix.cc +++ b/www/chromium/files/patch-net_socket_udp__socket__posix.cc @@ -1,20 +1,20 @@ ---- net/socket/udp_socket_posix.cc.orig 2022-04-15 05:34:28 UTC +--- net/socket/udp_socket_posix.cc.orig 2022-04-21 18:48:31 UTC +++ net/socket/udp_socket_posix.cc -@@ -574,7 +574,7 @@ int UDPSocketPosix::SetDoNotFragment() { +@@ -620,7 +620,7 @@ int UDPSocketPosix::SetDoNotFragment() { } void UDPSocketPosix::SetMsgConfirm(bool confirm) { -#if !BUILDFLAG(IS_APPLE) +#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) if (confirm) { sendto_flags_ |= MSG_CONFIRM; } else { -@@ -595,7 +595,7 @@ int UDPSocketPosix::SetBroadcast(bool broadcast) { +@@ -641,7 +641,7 @@ int UDPSocketPosix::SetBroadcast(bool broadcast) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); int value = broadcast ? 1 : 0; int rv; -#if BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) // SO_REUSEPORT on OSX permits multiple processes to each receive // UDP multicast or broadcast datagrams destined for the bound // port. diff --git a/www/chromium/files/patch-net_socket_udp__socket__unittest.cc b/www/chromium/files/patch-net_socket_udp__socket__unittest.cc index c4eab5a25a6e..01c181600c2b 100644 --- a/www/chromium/files/patch-net_socket_udp__socket__unittest.cc +++ b/www/chromium/files/patch-net_socket_udp__socket__unittest.cc @@ -1,47 +1,47 @@ ---- net/socket/udp_socket_unittest.cc.orig 2022-03-25 21:59:56 UTC +--- net/socket/udp_socket_unittest.cc.orig 2022-04-21 18:48:31 UTC +++ net/socket/udp_socket_unittest.cc -@@ -324,7 +324,7 @@ TEST_F(UDPSocketTest, PartialRecv) { +@@ -327,7 +327,7 @@ TEST_F(UDPSocketTest, PartialRecv) { EXPECT_EQ(second_packet, received); } -#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // - MacOS: requires root permissions on OSX 10.7+. // - Android: devices attached to testbots don't have default network, so // broadcasting to 255.255.255.255 returns error -109 (Address not reachable). -@@ -584,7 +584,7 @@ TEST_F(UDPSocketTest, ClientSetDoNotFragment) { +@@ -587,7 +587,7 @@ TEST_F(UDPSocketTest, ClientSetDoNotFragment) { EXPECT_THAT(rv, IsOk()); rv = client.SetDoNotFragment(); --#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) -+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) ++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // TODO(crbug.com/945590): IP_MTU_DISCOVER is not implemented on Fuchsia. EXPECT_THAT(rv, IsError(ERR_NOT_IMPLEMENTED)); - #else -@@ -606,7 +606,7 @@ TEST_F(UDPSocketTest, ServerSetDoNotFragment) { + #elif BUILDFLAG(IS_MAC) +@@ -615,7 +615,7 @@ TEST_F(UDPSocketTest, ServerSetDoNotFragment) { EXPECT_THAT(rv, IsOk()); rv = server.SetDoNotFragment(); --#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) -+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) ++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // TODO(crbug.com/945590): IP_MTU_DISCOVER is not implemented on Fuchsia. EXPECT_THAT(rv, IsError(ERR_NOT_IMPLEMENTED)); - #else -@@ -665,7 +665,7 @@ TEST_F(UDPSocketTest, JoinMulticastGroup) { + #elif BUILDFLAG(IS_MAC) +@@ -680,7 +680,7 @@ TEST_F(UDPSocketTest, JoinMulticastGroup) { // TODO(https://crbug.com/947115): failing on device on iOS 12.2. // TODO(https://crbug.com/1227554): flaky on Mac 11. -#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #define MAYBE_SharedMulticastAddress DISABLED_SharedMulticastAddress #else #define MAYBE_SharedMulticastAddress SharedMulticastAddress -@@ -719,7 +719,7 @@ TEST_F(UDPSocketTest, MAYBE_SharedMulticastAddress) { +@@ -734,7 +734,7 @@ TEST_F(UDPSocketTest, MAYBE_SharedMulticastAddress) { NetLogSource()); ASSERT_THAT(client_socket.Connect(send_address), IsOk()); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_BSD) // Send a message via the multicast group. That message is expected be be // received by both receving sockets. // diff --git a/www/chromium/files/patch-net_third__party_quiche_BUILD.gn b/www/chromium/files/patch-net_third__party_quiche_BUILD.gn index 0a679cd903f8..d16740e0ed55 100644 --- a/www/chromium/files/patch-net_third__party_quiche_BUILD.gn +++ b/www/chromium/files/patch-net_third__party_quiche_BUILD.gn @@ -1,33 +1,33 @@ ---- net/third_party/quiche/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- net/third_party/quiche/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ net/third_party/quiche/BUILD.gn -@@ -708,7 +708,7 @@ proto_library("net_quic_test_tools_proto") { +@@ -701,7 +701,7 @@ proto_library("net_quic_test_tools_proto") { extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] } -if (is_linux || is_chromeos) { +if ((is_linux || is_chromeos) && !is_bsd) { source_set("epoll_server_core") { sources = [ "src/epoll_server/platform/api/epoll_bug.h", -@@ -1063,7 +1063,7 @@ source_set("quic_test_tools_core") { +@@ -1059,7 +1059,7 @@ source_set("quic_test_tools_core") { "//third_party/quic_trace:quic_trace_proto", ] - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "src/epoll_server/fake_simple_epoll_server.cc", "src/epoll_server/fake_simple_epoll_server.h", -@@ -1528,10 +1528,10 @@ source_set("quiche_tests") { +@@ -1516,10 +1516,10 @@ source_set("quiche_tests") { ] public_deps = [] - if (is_linux || is_chromeos_lacros) { + if ((is_linux || is_chromeos_lacros) && !is_bsd) { public_deps += [ "//net:epoll_quic_tools" ] } - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "src/epoll_server/simple_epoll_server_test.cc", "src/quic/core/chlo_extractor_test.cc", diff --git a/www/chromium/files/patch-pdf_out__of__process__instance.cc b/www/chromium/files/patch-pdf_out__of__process__instance.cc deleted file mode 100644 index 9a6c556e32fe..000000000000 --- a/www/chromium/files/patch-pdf_out__of__process__instance.cc +++ /dev/null @@ -1,20 +0,0 @@ ---- pdf/out_of_process_instance.cc.orig 2022-02-28 16:54:41 UTC -+++ pdf/out_of_process_instance.cc -@@ -74,7 +74,7 @@ - #include "ui/gfx/geometry/size.h" - #include "url/gurl.h" - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - #include "pdf/ppapi_migration/pdfium_font_linux.h" - #endif - -@@ -734,7 +734,7 @@ void OutOfProcessInstance::RotateCounterclockwise() { - } - - void OutOfProcessInstance::SetLastPluginInstance() { --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - SetLastPepperInstance(this); - #endif - } diff --git a/www/chromium/files/patch-pdf_pdfium_pdfium__engine.cc b/www/chromium/files/patch-pdf_pdfium_pdfium__engine.cc index 2bef5c5b364a..3e69490c010e 100644 --- a/www/chromium/files/patch-pdf_pdfium_pdfium__engine.cc +++ b/www/chromium/files/patch-pdf_pdfium_pdfium__engine.cc @@ -1,20 +1,20 @@ ---- pdf/pdfium/pdfium_engine.cc.orig 2022-02-28 16:54:41 UTC +--- pdf/pdfium/pdfium_engine.cc.orig 2022-04-21 18:48:31 UTC +++ pdf/pdfium/pdfium_engine.cc -@@ -84,7 +84,7 @@ +@@ -82,7 +82,7 @@ #include "gin/public/cppgc.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "pdf/pdfium/pdfium_font_linux.h" #endif -@@ -519,7 +519,7 @@ void InitializeSDK(bool enable_v8, FontMappingMode fon +@@ -517,7 +517,7 @@ void InitializeSDK(bool enable_v8, FontMappingMode fon FPDF_InitLibraryWithConfig(&config); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) g_font_mapping_mode = font_mapping_mode; InitializeLinuxFontMapper(); #endif diff --git a/www/chromium/files/patch-remoting_host_base_switches.cc b/www/chromium/files/patch-remoting_host_base_switches.cc index 8fcb8ff987b5..5bdc44c55b98 100644 --- a/www/chromium/files/patch-remoting_host_base_switches.cc +++ b/www/chromium/files/patch-remoting_host_base_switches.cc @@ -1,11 +1,18 @@ ---- remoting/host/base/switches.cc.orig 2022-02-28 16:54:41 UTC +--- remoting/host/base/switches.cc.orig 2022-04-21 18:48:31 UTC +++ remoting/host/base/switches.cc -@@ -23,7 +23,7 @@ const char kProcessTypeEvaluateCapability[] = "evaluat +@@ -23,13 +23,13 @@ const char kProcessTypeEvaluateCapability[] = "evaluat const char kProcessTypeFileChooser[] = "file_chooser"; const char kProcessTypeUrlForwarderConfigurator[] = "url_forwarder_configurator"; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const char kProcessTypeXSessionChooser[] = "xsession_chooser"; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + const char kEvaluateCapabilitySwitchName[] = "evaluate-type"; + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + const char kEnableUtempter[] = "enable-utempter"; + #endif + diff --git a/www/chromium/files/patch-remoting_host_base_switches.h b/www/chromium/files/patch-remoting_host_base_switches.h index a2dd4f6f3ccd..100a7d5df7ff 100644 --- a/www/chromium/files/patch-remoting_host_base_switches.h +++ b/www/chromium/files/patch-remoting_host_base_switches.h @@ -1,11 +1,18 @@ ---- remoting/host/base/switches.h.orig 2022-02-28 16:54:41 UTC +--- remoting/host/base/switches.h.orig 2022-04-21 18:48:31 UTC +++ remoting/host/base/switches.h -@@ -35,7 +35,7 @@ extern const char kProcessTypeRdpDesktopSession[]; +@@ -35,13 +35,13 @@ extern const char kProcessTypeRdpDesktopSession[]; extern const char kProcessTypeEvaluateCapability[]; extern const char kProcessTypeFileChooser[]; extern const char kProcessTypeUrlForwarderConfigurator[]; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) extern const char kProcessTypeXSessionChooser[]; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + extern const char kEvaluateCapabilitySwitchName[]; + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + // Used to record client sessions to utmp/wtmp. + extern const char kEnableUtempter[]; + #endif diff --git a/www/chromium/files/patch-remoting_host_host__attributes.cc b/www/chromium/files/patch-remoting_host_host__attributes.cc index d78310e15a13..090fa5702b58 100644 --- a/www/chromium/files/patch-remoting_host_host__attributes.cc +++ b/www/chromium/files/patch-remoting_host_host__attributes.cc @@ -1,11 +1,11 @@ ---- remoting/host/host_attributes.cc.orig 2022-02-28 16:54:41 UTC +--- remoting/host/host_attributes.cc.orig 2022-04-21 18:48:31 UTC +++ remoting/host/host_attributes.cc -@@ -122,7 +122,7 @@ std::string GetHostAttributes() { +@@ -121,7 +121,7 @@ std::string GetHostAttributes() { media::InitializeMediaFoundation()) { result.push_back("HWEncoder"); } -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) result.push_back("HWEncoder"); #endif diff --git a/www/chromium/files/patch-remoting_host_host__main.cc b/www/chromium/files/patch-remoting_host_host__main.cc index f058e97d773a..48a9e32db0da 100644 --- a/www/chromium/files/patch-remoting_host_host__main.cc +++ b/www/chromium/files/patch-remoting_host_host__main.cc @@ -1,29 +1,29 @@ ---- remoting/host/host_main.cc.orig 2022-03-25 21:59:56 UTC +--- remoting/host/host_main.cc.orig 2022-04-21 18:48:31 UTC +++ remoting/host/host_main.cc @@ -50,7 +50,7 @@ int FileChooserMain(); int RdpDesktopSessionMain(); int UrlForwarderConfiguratorMain(); #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) int XSessionChooserMain(); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -63,7 +63,7 @@ const char kUsageMessage[] = "\n" "Options:\n" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) " --audio-pipe-name= - Sets the pipe name to capture audio on " "Linux.\n" #endif // BUILDFLAG(IS_LINUX) -@@ -154,7 +154,7 @@ MainRoutineFn SelectMainRoutine(const std::string& pro +@@ -155,7 +155,7 @@ MainRoutineFn SelectMainRoutine(const std::string& pro } else if (process_type == kProcessTypeUrlForwarderConfigurator) { main_routine = &UrlForwarderConfiguratorMain; #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) } else if (process_type == kProcessTypeXSessionChooser) { main_routine = &XSessionChooserMain; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) diff --git a/www/chromium/files/patch-remoting_host_remoting__me2me__host.cc b/www/chromium/files/patch-remoting_host_remoting__me2me__host.cc index 987e63b4bcc6..d23ad854ac24 100644 --- a/www/chromium/files/patch-remoting_host_remoting__me2me__host.cc +++ b/www/chromium/files/patch-remoting_host_remoting__me2me__host.cc @@ -1,92 +1,119 @@ ---- remoting/host/remoting_me2me_host.cc.orig 2022-03-25 21:59:56 UTC +--- remoting/host/remoting_me2me_host.cc.orig 2022-04-21 18:48:31 UTC +++ remoting/host/remoting_me2me_host.cc @@ -124,7 +124,7 @@ #include "remoting/host/mac/permission_utils.h" #endif // BUILDFLAG(IS_APPLE) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #include "base/linux_util.h" -@@ -168,7 +168,7 @@ const char kApplicationName[] = "chromoting"; +@@ -134,7 +134,7 @@ + #include "ui/gfx/x/xlib_support.h" + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "remoting/host/host_utmp_logger.h" + #endif + +@@ -172,7 +172,7 @@ const char kApplicationName[] = "chromoting"; const char kStdinConfigPath[] = "-"; #endif // !defined(REMOTING_MULTI_PROCESS) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // The command line switch used to pass name of the pipe to capture audio on // linux. const char kAudioPipeSwitchName[] = "audio-pipe-name"; -@@ -373,7 +373,7 @@ class HostProcess : public ConfigWatcher::Delegate, +@@ -377,7 +377,7 @@ class HostProcess : public ConfigWatcher::Delegate, std::unique_ptr context_; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Watch for certificate changes and kill the host when changes occur std::unique_ptr cert_watcher_; #endif -@@ -747,7 +747,7 @@ void HostProcess::StartOnNetworkThread() { +@@ -443,7 +443,7 @@ class HostProcess : public ConfigWatcher::Delegate, + + std::unique_ptr host_status_logger_; + std::unique_ptr host_event_logger_; +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + std::unique_ptr host_utmp_logger_; + #endif + std::unique_ptr power_save_blocker_; +@@ -754,7 +754,7 @@ void HostProcess::StartOnNetworkThread() { void HostProcess::ShutdownOnNetworkThread() { DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); config_watcher_.reset(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) cert_watcher_.reset(); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) } -@@ -806,7 +806,7 @@ void HostProcess::CreateAuthenticatorFactory() { +@@ -813,7 +813,7 @@ void HostProcess::CreateAuthenticatorFactory() { DCHECK(third_party_auth_config_.token_url.is_valid()); DCHECK(third_party_auth_config_.token_validation_url.is_valid()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (!cert_watcher_) { cert_watcher_ = std::make_unique( base::BindRepeating(&HostProcess::ShutdownHost, -@@ -916,7 +916,7 @@ void HostProcess::StartOnUiThread() { +@@ -923,7 +923,7 @@ void HostProcess::StartOnUiThread() { base::BindRepeating(&HostProcess::OnPolicyUpdate, base::Unretained(this)), base::BindRepeating(&HostProcess::OnPolicyError, base::Unretained(this))); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // If an audio pipe is specific on the command-line then initialize // AudioCapturerLinux to capture from it. base::FilePath audio_pipe_name = base::CommandLine::ForCurrentProcess()-> -@@ -987,7 +987,7 @@ void HostProcess::ShutdownOnUiThread() { +@@ -994,7 +994,7 @@ void HostProcess::ShutdownOnUiThread() { // It is now safe for the HostProcess to be deleted. self_ = nullptr; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Cause the global AudioPipeReader to be freed, otherwise the audio // thread will remain in-use and prevent the process from exiting. // TODO(wez): DesktopEnvironmentFactory should own the pipe reader. -@@ -1697,7 +1697,7 @@ void HostProcess::StartHost() { +@@ -1704,7 +1704,7 @@ void HostProcess::StartHost() { // The feature is enabled for all Googlers using a supported platform. desktop_environment_options_.set_enable_remote_open_url(is_googler_); --#if BUILDFLAG(IS_LINUX) || !defined(NDEBUG) -+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || !defined(NDEBUG) - // Experimental feature. Enabled on Linux for easier testing. - if (is_googler_) { - desktop_environment_options_.set_enable_remote_webauthn(true); -@@ -1897,7 +1897,7 @@ int HostProcessMain() { +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + desktop_environment_options_.set_enable_remote_webauthn(is_googler_); + #endif + +@@ -1737,7 +1737,7 @@ void HostProcess::StartHost() { + host_status_logger_ = std::make_unique( + host_->status_monitor(), log_to_server_.get()); + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); + if (cmd_line->HasSwitch(kEnableUtempter)) + host_utmp_logger_ = +@@ -1908,7 +1908,7 @@ int HostProcessMain() { HOST_LOG << "Starting host process: version " << STRINGIZE(VERSION); const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Initialize Xlib for multi-threaded use, allowing non-Chromium code to // use X11 safely (such as the WebRTC capturer, GTK ...) x11::InitXlib(); -@@ -1941,7 +1941,7 @@ int HostProcessMain() { +@@ -1952,7 +1952,7 @@ int HostProcessMain() { std::unique_ptr network_change_notifier( net::NetworkChangeNotifier::CreateIfNeeded()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Create an X11EventSource on all UI threads, so the global X11 connection // (x11::Connection::Get()) can dispatch X events. auto event_source = diff --git a/www/chromium/files/patch-remoting_resources_remoting__strings.grd b/www/chromium/files/patch-remoting_resources_remoting__strings.grd index 82f5798580ee..88df1e35a7d7 100644 --- a/www/chromium/files/patch-remoting_resources_remoting__strings.grd +++ b/www/chromium/files/patch-remoting_resources_remoting__strings.grd @@ -1,20 +1,20 @@ ---- remoting/resources/remoting_strings.grd.orig 2022-02-28 16:54:41 UTC +--- remoting/resources/remoting_strings.grd.orig 2022-04-21 18:48:31 UTC +++ remoting/resources/remoting_strings.grd -@@ -936,7 +936,7 @@ If '$3org.chromium. +@@ -948,7 +948,7 @@ If '$3org.chromium. %sChrome Remote Desktop URL Forwarder is not configured correctly. Please choose a different default web browser and then enable URL forwarding again. - + Select a session to launch within your Chrome Remote Desktop environment. (Note that some session types may not support running within Chrome Remote Desktop and on the local console simultaneously.) -@@ -952,7 +952,7 @@ If '$3org.chromium. +@@ -964,7 +964,7 @@ If '$3org.chromium. Launch the default XSession - + diff --git a/www/chromium/files/patch-sandbox_BUILD.gn b/www/chromium/files/patch-sandbox_BUILD.gn index fc1f7ec58a48..108ac6980ab9 100644 --- a/www/chromium/files/patch-sandbox_BUILD.gn +++ b/www/chromium/files/patch-sandbox_BUILD.gn @@ -1,11 +1,11 @@ ---- sandbox/BUILD.gn.orig 2022-02-07 13:39:41 UTC +--- sandbox/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ sandbox/BUILD.gn -@@ -27,7 +27,7 @@ group("sandbox") { +@@ -36,7 +36,7 @@ group("sandbox") { "//sandbox/mac:system_services", "//sandbox/mac/mojom", ] - } else if (is_linux || is_chromeos || is_android) { + } else if ((is_linux && !is_bsd) || is_chromeos || is_android) { public_deps = [ "//sandbox/linux:sandbox" ] } } diff --git a/www/chromium/files/patch-sandbox_policy_BUILD.gn b/www/chromium/files/patch-sandbox_policy_BUILD.gn index 0d0b23c9cfdc..bc11b185025d 100644 --- a/www/chromium/files/patch-sandbox_policy_BUILD.gn +++ b/www/chromium/files/patch-sandbox_policy_BUILD.gn @@ -1,39 +1,39 @@ ---- sandbox/policy/BUILD.gn.orig 2022-02-07 13:39:41 UTC +--- sandbox/policy/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/BUILD.gn -@@ -35,7 +35,7 @@ component("policy") { +@@ -34,7 +34,7 @@ component("policy") { "//sandbox/policy/mojom", ] - public_deps = [] + public_deps = [ "//sandbox:common" ] - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "linux/bpf_audio_policy_linux.cc", "linux/bpf_audio_policy_linux.h", -@@ -88,6 +88,27 @@ component("policy") { +@@ -89,6 +89,27 @@ component("policy") { "//sandbox/linux:sandbox_services", "//sandbox/linux:seccomp_bpf", "//sandbox/linux:suid_sandbox_client", + ] + } + if (is_openbsd) { + sources += [ + "openbsd/sandbox_openbsd.cc", + "openbsd/sandbox_openbsd.h", + ] + deps += [ + "//sandbox:sandbox_buildflags", + "//ui/gfx/x", + ] + libs = [ "util" ] + } + if (is_freebsd) { + sources += [ + "freebsd/sandbox_freebsd.cc", + "freebsd/sandbox_freebsd.h", + ] + deps += [ + "//sandbox:sandbox_buildflags", + "//ui/gfx/x", ] } if (is_chromeos_ash) { diff --git a/www/chromium/files/patch-sandbox_policy_features.cc b/www/chromium/files/patch-sandbox_policy_features.cc index a19b5c10a58e..256b92a6232b 100644 --- a/www/chromium/files/patch-sandbox_policy_features.cc +++ b/www/chromium/files/patch-sandbox_policy_features.cc @@ -1,14 +1,14 @@ ---- sandbox/policy/features.cc.orig 2022-02-28 16:54:41 UTC +--- sandbox/policy/features.cc.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/features.cc -@@ -16,7 +16,11 @@ namespace features { +@@ -14,7 +14,11 @@ namespace sandbox::policy::features { // Enables network service sandbox. // (Only causes an effect when feature kNetworkService is enabled.) const base::Feature kNetworkServiceSandbox{"NetworkServiceSandbox", +#if BUILDFLAG(IS_BSD) + base::FEATURE_ENABLED_BY_DEFAULT}; +#else base::FEATURE_DISABLED_BY_DEFAULT}; +#endif #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_FUCHSIA) #if BUILDFLAG(IS_WIN) diff --git a/www/chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc b/www/chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc index ef0afef1dbd3..b853583c6f47 100644 --- a/www/chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc +++ b/www/chromium/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc @@ -1,250 +1,250 @@ ---- sandbox/policy/freebsd/sandbox_freebsd.cc.orig 2022-02-07 13:39:41 UTC +--- sandbox/policy/freebsd/sandbox_freebsd.cc.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/freebsd/sandbox_freebsd.cc @@ -0,0 +1,247 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sandbox/policy/openbsd/sandbox_openbsd.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/command_line.h" +#include "base/debug/stack_trace.h" +#include "base/feature_list.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_file.h" +#include "base/logging.h" +#include "base/memory/singleton.h" +#include "base/path_service.h" +#include "base/posix/eintr_wrapper.h" +#include "base/strings/string_number_conversions.h" +#include "base/system/sys_info.h" +#include "base/time/time.h" +#include "build/build_config.h" +#include "sandbox/constants.h" +#include "sandbox/linux/services/credentials.h" +#include "sandbox/linux/services/namespace_sandbox.h" +#include "sandbox/linux/services/proc_util.h" +#include "sandbox/linux/services/resource_limits.h" +#include "sandbox/linux/services/thread_helpers.h" +#include "sandbox/linux/syscall_broker/broker_command.h" +#include "sandbox/linux/syscall_broker/broker_process.h" +#include "sandbox/policy/sandbox.h" +#include "sandbox/policy/sandbox_type.h" +#include "sandbox/policy/mojom/sandbox.mojom.h" +#include "sandbox/policy/switches.h" +#include "sandbox/sandbox_buildflags.h" + +#if BUILDFLAG(USING_SANITIZER) +#include +#endif + +#if defined(USE_NSS_CERTS) +#include "crypto/nss_util.h" +#endif + +#include "ui/gfx/x/connection.h" +#include "ui/gfx/font_util.h" + +#include + +#define MAXTOKENS 3 + +#define _UNVEIL_MAIN "/etc/chromium/unveil.main"; +#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer"; +#define _UNVEIL_GPU "/etc/chromium/unveil.gpu"; +#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin"; +#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility"; +#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network"; +#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio"; +#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video"; + +namespace sandbox { +namespace policy { + +SandboxLinux::SandboxLinux() + : sandbox_status_flags_(kInvalid), + pre_initialized_(false), + initialize_sandbox_ran_(false), + broker_process_(nullptr) { +} + +SandboxLinux::~SandboxLinux() { + if (pre_initialized_) { + CHECK(initialize_sandbox_ran_); + } +} + +SandboxLinux* SandboxLinux::GetInstance() { + SandboxLinux* instance = base::Singleton::get(); + CHECK(instance); + return instance; +} + +void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) { + CHECK(!pre_initialized_); +#if BUILDFLAG(USING_SANITIZER) + // Sanitizers need to open some resources before the sandbox is enabled. + // This should not fork, not launch threads, not open a directory. + __sanitizer_sandbox_on_notify(sanitizer_args()); + sanitizer_args_.reset(); +#endif + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + const std::string process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); + + base::SysInfo::AmountOfPhysicalMemory(); + base::SysInfo::NumberOfProcessors(); + +#if defined(USE_NSS_CERTS) + // The main process has to initialize the ~/.pki dir which won't work + // after unveil(2). + if (process_type.empty()) + crypto::EnsureNSSInit(); +#endif + + // cache the XErrorDB by forcing a read on it + { + auto* connection = x11::Connection::Get(); + auto* display = connection->GetXlibDisplay().display(); + + char buf[1]; -+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, base::size(buf)); ++ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf)); + } + + if (process_type.empty()) { + base::FilePath cache_directory, local_directory; + + base::PathService::Get(base::DIR_CACHE, &cache_directory); + base::PathService::Get(base::DIR_HOME, &local_directory); + + cache_directory = cache_directory.AppendASCII("chromium"); + local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications"); + + if (!base::CreateDirectory(cache_directory)) { + LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory."; + } + + if (!base::CreateDirectory(local_directory)) { + LOG(ERROR) << "Failed to create " << local_directory.value() << " directory."; + } + } + + if (process_type == switches::kRendererProcess) + gfx::InitializeFonts(); + + pre_initialized_ = true; +} + +bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type, + SandboxLinux::PreSandboxHook hook, + const Options& options) { + DCHECK(!initialize_sandbox_ran_); + initialize_sandbox_ran_ = true; + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + const std::string process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); + + if (command_line->HasSwitch(switches::kNoSandbox)) + return true; + + VLOG(1) << "SandboxLinux::InitializeSandbox: process_type=" + << process_type << " sandbox_type=" << GetSandboxTypeInEnglish(sandbox_type); + + // Only one thread is running, pre-initialize if not already done. + if (!pre_initialized_) + PreinitializeSandbox(sandbox_type); + + // Attempt to limit the future size of the address space of the process. + int error = 0; + const bool limited_as = LimitAddressSpace(&error); + if (error) { + // Restore errno. Internally to |LimitAddressSpace|, the errno due to + // setrlimit may be lost. + errno = error; + PCHECK(limited_as); + } + + return true; +} + +bool SandboxLinux::LimitAddressSpace(int* error) { +#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \ + !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER) + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) { + return false; + } + + // Unfortunately, it does not appear possible to set RLIMIT_AS such that it + // will both (a) be high enough to support V8's and WebAssembly's address + // space requirements while also (b) being low enough to mitigate exploits + // using integer overflows that require large allocations, heap spray, or + // other memory-hungry attack modes. + + *error = sandbox::ResourceLimits::Lower( + RLIMIT_DATA, static_cast(sandbox::kDataSizeLimit)); + + // Cache the resource limit before turning on the sandbox. + base::SysInfo::AmountOfVirtualMemory(); + base::SysInfo::MaxSharedMemorySize(); + + return *error == 0; +#else + base::SysInfo::AmountOfVirtualMemory(); + return false; +#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && + // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER) +} + +// static +std::string SandboxLinux::GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type) { + switch (sandbox_type) { + case sandbox::mojom::Sandbox::kNoSandbox: + return "Unsandboxed"; + case sandbox::mojom::Sandbox::kRenderer: + return "Renderer"; + case sandbox::mojom::Sandbox::kUtility: + return "Utility"; + case sandbox::mojom::Sandbox::kGpu: + return "GPU"; + case sandbox::mojom::Sandbox::kPpapi: + return "PPAPI"; + case sandbox::mojom::Sandbox::kNetwork: + return "Network"; + case sandbox::mojom::Sandbox::kCdm: + return "CDM"; + case sandbox::mojom::Sandbox::kPrintCompositor: + return "Print Compositor"; + case sandbox::mojom::Sandbox::kAudio: + return "Audio"; + case sandbox::mojom::Sandbox::kSpeechRecognition: + return "Speech Recognition"; + case sandbox::mojom::Sandbox::kService: + return "Service"; + case sandbox::mojom::Sandbox::kVideoCapture: + return "Video Capture"; + default: + return "Unknown"; + } +} + +} // namespace policy +} // namespace sandbox diff --git a/www/chromium/files/patch-sandbox_policy_mojom_sandbox.mojom b/www/chromium/files/patch-sandbox_policy_mojom_sandbox.mojom index 764e8985529b..f90d8902aba2 100644 --- a/www/chromium/files/patch-sandbox_policy_mojom_sandbox.mojom +++ b/www/chromium/files/patch-sandbox_policy_mojom_sandbox.mojom @@ -1,15 +1,15 @@ ---- sandbox/policy/mojom/sandbox.mojom.orig 2022-02-28 16:54:41 UTC +--- sandbox/policy/mojom/sandbox.mojom.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/mojom/sandbox.mojom -@@ -68,6 +68,12 @@ enum Sandbox { +@@ -72,6 +72,12 @@ enum Sandbox { [EnableIf=is_fuchsia] kVideoCapture, + [EnableIf=is_openbsd] + kVideoCapture, + + [EnableIf=is_freebsd] + kVideoCapture, + // Allows access to file contents and Windows APIs for parsing icons from PE // files. [EnableIf=is_win] diff --git a/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc index 6c7f986f32e7..0898af1e5a6c 100644 --- a/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc +++ b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc @@ -1,410 +1,410 @@ ---- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2022-03-25 21:59:56 UTC +--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/openbsd/sandbox_openbsd.cc @@ -0,0 +1,407 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sandbox/policy/openbsd/sandbox_openbsd.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/command_line.h" +#include "base/debug/stack_trace.h" +#include "base/feature_list.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_file.h" +#include "base/logging.h" +#include "base/memory/singleton.h" +#include "base/path_service.h" +#include "base/posix/eintr_wrapper.h" +#include "base/strings/string_number_conversions.h" +#include "base/system/sys_info.h" +#include "base/time/time.h" +#include "build/build_config.h" +#include "sandbox/constants.h" +#include "sandbox/linux/services/credentials.h" +#include "sandbox/linux/services/namespace_sandbox.h" +#include "sandbox/linux/services/proc_util.h" +#include "sandbox/linux/services/resource_limits.h" +#include "sandbox/linux/services/thread_helpers.h" +#include "sandbox/linux/syscall_broker/broker_command.h" +#include "sandbox/linux/syscall_broker/broker_process.h" +#include "sandbox/policy/sandbox.h" +#include "sandbox/policy/sandbox_type.h" +#include "sandbox/policy/mojom/sandbox.mojom.h" +#include "sandbox/policy/switches.h" +#include "sandbox/sandbox_buildflags.h" + +#if BUILDFLAG(USING_SANITIZER) +#include +#endif + +#if defined(USE_NSS_CERTS) +#include "crypto/nss_util.h" +#endif + +#include "third_party/boringssl/src/include/openssl/crypto.h" + +#include "ui/gfx/x/connection.h" +#include "ui/gfx/font_util.h" + +#include + +#define MAXTOKENS 3 + +#define _UNVEIL_MAIN "/etc/chromium/unveil.main"; +#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer"; +#define _UNVEIL_GPU "/etc/chromium/unveil.gpu"; +#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin"; +#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility"; +#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network"; +#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio"; +#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video"; + +namespace sandbox { +namespace policy { + +SandboxLinux::SandboxLinux() + : unveil_initialized_(false), + sandbox_status_flags_(kInvalid), + pre_initialized_(false), + initialize_sandbox_ran_(false), + broker_process_(nullptr) { +} + +SandboxLinux::~SandboxLinux() { + if (pre_initialized_) { + CHECK(initialize_sandbox_ran_); + } +} + +SandboxLinux* SandboxLinux::GetInstance() { + SandboxLinux* instance = base::Singleton::get(); + CHECK(instance); + return instance; +} + +void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) { + CHECK(!pre_initialized_); +#if BUILDFLAG(USING_SANITIZER) + // Sanitizers need to open some resources before the sandbox is enabled. + // This should not fork, not launch threads, not open a directory. + __sanitizer_sandbox_on_notify(sanitizer_args()); + sanitizer_args_.reset(); +#endif + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + const std::string process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); + + base::SysInfo::AmountOfPhysicalMemory(); + base::SysInfo::NumberOfProcessors(); + base::SysInfo::CPUModelName(); + +#if defined(USE_NSS_CERTS) + // The main process has to initialize the ~/.pki dir which won't work + // after unveil(2). + if (process_type.empty()) + crypto::EnsureNSSInit(); +#endif + + if (process_type.empty()) + CRYPTO_pre_sandbox_init(); + + // cache the XErrorDB by forcing a read on it + { + auto* connection = x11::Connection::Get(); + auto* display = connection->GetXlibDisplay().display(); + + char buf[1]; -+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, base::size(buf)); ++ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf)); + } + + if (process_type.empty()) { + base::FilePath cache_directory, local_directory; + + base::PathService::Get(base::DIR_CACHE, &cache_directory); + base::PathService::Get(base::DIR_HOME, &local_directory); + + cache_directory = cache_directory.AppendASCII("chromium"); + local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications"); + + if (!base::CreateDirectory(cache_directory)) { + LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory."; + } + + if (!base::CreateDirectory(local_directory)) { + LOG(ERROR) << "Failed to create " << local_directory.value() << " directory."; + } + } + + if (process_type == switches::kRendererProcess) + gfx::InitializeFonts(); + + if (!command_line->HasSwitch(switches::kDisableUnveil)) + SetUnveil(process_type, sandbox_type); + + pre_initialized_ = true; +} + +bool SandboxLinux::SetPledge(const char *pstring, const char *ppath) { + FILE *fp; + char *s = NULL; + size_t len = 0; + ssize_t read; + + if (pstring != NULL) { + if (pledge(pstring, NULL) == -1) + goto err; + } else if (ppath != NULL) { + fp = fopen(ppath, "r"); + if (fp != NULL) { + while ((read = getline(&s, &len, fp)) != -1 ) { + if (s[strlen(s)-1] == '\n') + s[strlen(s)-1] = '\0'; + if (pledge(s, NULL) == -1) + goto err; + } + fclose(fp); + } else { + LOG(ERROR) << "fopen() failed, errno: " << errno; + return false; + } + } + return true; +err: + LOG(ERROR) << "pledge() failed, errno: " << errno; + return false; +} + +bool SandboxLinux::SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type) { + FILE *fp; + char *s = NULL, *cp = NULL, *home = NULL, **ap, *tokens[MAXTOKENS]; + char path[PATH_MAX]; + const char *ufile; + size_t len = 0, lineno = 0; + + if (process_type.empty()) { + ufile = _UNVEIL_MAIN; + } else if (process_type == switches::kRendererProcess) { + ufile = _UNVEIL_RENDERER; + } else if (process_type == switches::kGpuProcess) { + ufile = _UNVEIL_GPU; + } else if (process_type == switches::kPpapiPluginProcess) { + ufile = _UNVEIL_PLUGIN; + } else if (process_type == switches::kUtilityProcess) { + if (sandbox_type == sandbox::mojom::Sandbox::kNetwork) { + ufile = _UNVEIL_UTILITY_NETWORK; + } else if (sandbox_type == sandbox::mojom::Sandbox::kAudio) { + ufile = _UNVEIL_UTILITY_AUDIO; + } else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture) { + ufile = _UNVEIL_UTILITY_VIDEO; + } else { + ufile = _UNVEIL_UTILITY; + } + } + + fp = fopen(ufile, "r"); + if (fp != NULL) { + while (!feof(fp)) { + if ((s = fparseln(fp, &len, &lineno, NULL, + FPARSELN_UNESCCOMM | FPARSELN_UNESCCONT)) == NULL) { + if (ferror(fp)) { + LOG(ERROR) << "ferror(), errno: " << errno; + _exit(1); + } else { + continue; + } + } + cp = s; + cp += strspn(cp, " \t\n"); /* eat whitespace */ + if (cp[0] == '\0') + continue; + + for (ap = tokens; ap < &tokens[MAXTOKENS - 1] && + (*ap = strsep(&cp, " \t")) != NULL;) { + if (**ap != '\0') + ap++; + } + *ap = NULL; + + if (tokens[1] == NULL) { + LOG(ERROR) << ufile << ": line " << lineno << ": must supply value to " << s; + _exit(1); + } + + if (tokens[0][0] == '~') { + if ((home = getenv("HOME")) == NULL || *home == '\0') { + LOG(ERROR) << "failed to get home"; + _exit(1); + } + memmove(tokens[0], tokens[0] + 1, strlen(tokens[0])); + strncpy(path, home, sizeof(path) - 1); + path[sizeof(path) - 1] = '\0'; + strncat(path, tokens[0], sizeof(path) - 1 - strlen(path)); + } else { + strncpy(path, tokens[0], sizeof(path) - 1); + path[sizeof(path) - 1] = '\0'; + } + + if (unveil(path, tokens[1]) == -1) { + LOG(ERROR) << "failed unveiling " << path << " with permissions " << tokens[1]; + _exit(1); + } else { + VLOG(1) << "unveiling " << path << " with permissions " << tokens[1]; + } + } + fclose(fp); + } else { + LOG(ERROR) << "failed to open " << ufile << " errno: " << errno; + _exit(1); + } + + unveil_initialized_ = true; + + return true; +} + +bool SandboxLinux::unveil_initialized() const { + return unveil_initialized_; +} + +bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type, + SandboxLinux::PreSandboxHook hook, + const Options& options) { + DCHECK(!initialize_sandbox_ran_); + initialize_sandbox_ran_ = true; + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + const std::string process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); + + if (command_line->HasSwitch(switches::kNoSandbox)) + return true; + + VLOG(1) << "SandboxLinux::InitializeSandbox: process_type=" + << process_type << " sandbox_type=" << GetSandboxTypeInEnglish(sandbox_type); + + // Only one thread is running, pre-initialize if not already done. + if (!pre_initialized_) + PreinitializeSandbox(sandbox_type); + + // Attempt to limit the future size of the address space of the process. + int error = 0; + const bool limited_as = LimitAddressSpace(&error); + if (error) { + // Restore errno. Internally to |LimitAddressSpace|, the errno due to + // setrlimit may be lost. + errno = error; + PCHECK(limited_as); + } + + if (process_type.empty()) { + // XXX use a file for listing pledges of the main process for now + // XXX not having the file is not a fatal error + SetPledge(NULL, "/etc/chromium/pledge.main"); + } else if (process_type == switches::kRendererProcess) { + // prot_exec needed by v8 + // flock needed by sqlite3 locking + SetPledge("stdio rpath flock prot_exec recvfd sendfd ps", NULL); + } else if (process_type == switches::kGpuProcess) { + SetPledge("stdio rpath cpath wpath getpw drm prot_exec recvfd sendfd tmppath", NULL); + } else if (process_type == switches::kPpapiPluginProcess) { + // prot_exec needed by v8 + SetPledge("stdio rpath prot_exec recvfd sendfd", NULL); + } else if (process_type == switches::kUtilityProcess) { + if (sandbox_type == sandbox::mojom::Sandbox::kAudio) + SetPledge(NULL, "/etc/chromium/pledge.utility_audio"); + else if (sandbox_type == sandbox::mojom::Sandbox::kNetwork) + SetPledge(NULL, "/etc/chromium/pledge.utility_network"); + else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture) + SetPledge(NULL, "/etc/chromium/pledge.utility_video"); + else + SetPledge("stdio rpath cpath wpath fattr flock sendfd recvfd prot_exec", NULL); + } else { + LOG(ERROR) << "non-pledge()'d process: " << process_type; + return false; + } + + return true; +} + +bool SandboxLinux::LimitAddressSpace(int* error) { +#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \ + !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER) + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) { + return false; + } + + // Unfortunately, it does not appear possible to set RLIMIT_AS such that it + // will both (a) be high enough to support V8's and WebAssembly's address + // space requirements while also (b) being low enough to mitigate exploits + // using integer overflows that require large allocations, heap spray, or + // other memory-hungry attack modes. + + *error = sandbox::ResourceLimits::Lower( + RLIMIT_DATA, static_cast(sandbox::kDataSizeLimit)); + + // Cache the resource limit before turning on the sandbox. + base::SysInfo::AmountOfVirtualMemory(); + base::SysInfo::MaxSharedMemorySize(); + + return *error == 0; +#else + base::SysInfo::AmountOfVirtualMemory(); + return false; +#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && + // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER) +} + +// static +std::string SandboxLinux::GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type) { + switch (sandbox_type) { + case sandbox::mojom::Sandbox::kNoSandbox: + return "Unsandboxed"; + case sandbox::mojom::Sandbox::kRenderer: + return "Renderer"; + case sandbox::mojom::Sandbox::kUtility: + return "Utility"; + case sandbox::mojom::Sandbox::kGpu: + return "GPU"; + case sandbox::mojom::Sandbox::kPpapi: + return "PPAPI"; + case sandbox::mojom::Sandbox::kNetwork: + return "Network"; + case sandbox::mojom::Sandbox::kCdm: + return "CDM"; + case sandbox::mojom::Sandbox::kPrintCompositor: + return "Print Compositor"; + case sandbox::mojom::Sandbox::kAudio: + return "Audio"; + case sandbox::mojom::Sandbox::kSpeechRecognition: + return "Speech Recognition"; + case sandbox::mojom::Sandbox::kService: + return "Service"; + case sandbox::mojom::Sandbox::kVideoCapture: + return "Video Capture"; + default: + return "Unknown"; + } +} + +} // namespace policy +} // namespace sandbox diff --git a/www/chromium/files/patch-sandbox_policy_sandbox__type.cc b/www/chromium/files/patch-sandbox_policy_sandbox__type.cc index 9b9d2fa1656b..49f7577258ab 100644 --- a/www/chromium/files/patch-sandbox_policy_sandbox__type.cc +++ b/www/chromium/files/patch-sandbox_policy_sandbox__type.cc @@ -1,38 +1,73 @@ ---- sandbox/policy/sandbox_type.cc.orig 2022-02-28 16:54:41 UTC +--- sandbox/policy/sandbox_type.cc.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/sandbox_type.cc @@ -39,7 +39,7 @@ bool IsUnsandboxedSandboxType(Sandbox sandbox_type) { #endif case Sandbox::kAudio: return false; -#if BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) case Sandbox::kVideoCapture: return false; #endif -@@ -122,7 +122,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLi +@@ -70,8 +70,10 @@ bool IsUnsandboxedSandboxType(Sandbox sandbox_type) { + case Sandbox::kLibassistant: + #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT) + #endif // // BUILDFLAG(IS_CHROMEOS_ASH) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) ++#if !BUILDFLAG(IS_BSD) + case Sandbox::kZygoteIntermediateSandbox: ++#endif + case Sandbox::kScreenAI: + #endif + case Sandbox::kSpeechRecognition: +@@ -123,7 +125,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLi #endif case Sandbox::kPrintCompositor: case Sandbox::kAudio: -#if BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) case Sandbox::kVideoCapture: #endif #if BUILDFLAG(IS_WIN) -@@ -247,7 +247,7 @@ std::string StringFromUtilitySandboxType(Sandbox sandb +@@ -145,7 +147,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLi + #if BUILDFLAG(IS_MAC) + case Sandbox::kMirroring: + #endif // BUILDFLAG(IS_MAC) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + case Sandbox::kScreenAI: + #endif + case Sandbox::kSpeechRecognition: +@@ -251,7 +253,7 @@ std::string StringFromUtilitySandboxType(Sandbox sandb return switches::kUtilitySandbox; case Sandbox::kAudio: return switches::kAudioSandbox; -#if BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) case Sandbox::kVideoCapture: return switches::kVideoCaptureSandbox; #endif -@@ -355,7 +355,7 @@ sandbox::mojom::Sandbox UtilitySandboxTypeFromString( +@@ -261,7 +263,7 @@ std::string StringFromUtilitySandboxType(Sandbox sandb + return switches::kServiceSandboxWithJit; + case Sandbox::kSpeechRecognition: + return switches::kSpeechRecognitionSandbox; +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + case Sandbox::kScreenAI: + return switches::kScreenAISandbox; + #endif +@@ -363,11 +365,11 @@ sandbox::mojom::Sandbox UtilitySandboxTypeFromString( return Sandbox::kAudio; if (sandbox_string == switches::kSpeechRecognitionSandbox) return Sandbox::kSpeechRecognition; +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + if (sandbox_string == switches::kScreenAISandbox) + return Sandbox::kScreenAI; + #endif -#if BUILDFLAG(IS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) if (sandbox_string == switches::kVideoCaptureSandbox) return Sandbox::kVideoCapture; #endif diff --git a/www/chromium/files/patch-sandbox_policy_switches.cc b/www/chromium/files/patch-sandbox_policy_switches.cc index 8bcc33d0a596..769002c56cb9 100644 --- a/www/chromium/files/patch-sandbox_policy_switches.cc +++ b/www/chromium/files/patch-sandbox_policy_switches.cc @@ -1,13 +1,13 @@ ---- sandbox/policy/switches.cc.orig 2022-02-28 16:54:41 UTC +--- sandbox/policy/switches.cc.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/switches.cc -@@ -95,7 +95,9 @@ const char kGpuSandboxFailuresFatal[] = "gpu-sandbox-f +@@ -96,7 +96,9 @@ const char kGpuSandboxFailuresFatal[] = "gpu-sandbox-f // Meant to be used as a browser-level switch for testing purposes only. const char kNoSandbox[] = "no-sandbox"; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +const char kDisableUnveil[] = "disable-unveil"; + +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Instructs the zygote to launch without a sandbox. Processes forked from this // type of zygote will apply their own custom sandboxes later. const char kNoZygoteSandbox[] = "no-zygote-sandbox"; diff --git a/www/chromium/files/patch-sandbox_policy_switches.h b/www/chromium/files/patch-sandbox_policy_switches.h index dc91e6fc6604..056b7cba3a9e 100644 --- a/www/chromium/files/patch-sandbox_policy_switches.h +++ b/www/chromium/files/patch-sandbox_policy_switches.h @@ -1,12 +1,12 @@ ---- sandbox/policy/switches.h.orig 2022-02-28 16:54:41 UTC +--- sandbox/policy/switches.h.orig 2022-04-21 18:48:31 UTC +++ sandbox/policy/switches.h -@@ -71,7 +71,8 @@ SANDBOX_POLICY_EXPORT extern const char kDisableSetuid +@@ -72,7 +72,8 @@ SANDBOX_POLICY_EXPORT extern const char kDisableSetuid SANDBOX_POLICY_EXPORT extern const char kGpuSandboxAllowSysVShm[]; SANDBOX_POLICY_EXPORT extern const char kGpuSandboxFailuresFatal[]; SANDBOX_POLICY_EXPORT extern const char kNoSandbox[]; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +SANDBOX_POLICY_EXPORT extern const char kDisableUnveil[]; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) SANDBOX_POLICY_EXPORT extern const char kNoZygoteSandbox[]; #endif #if BUILDFLAG(IS_WIN) diff --git a/www/chromium/files/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc b/www/chromium/files/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc index 9eb05649b683..e4ec8aa2cd76 100644 --- a/www/chromium/files/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc +++ b/www/chromium/files/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc @@ -1,14 +1,14 @@ ---- services/device/time_zone_monitor/time_zone_monitor_linux.cc.orig 2022-02-28 16:54:41 UTC +--- services/device/time_zone_monitor/time_zone_monitor_linux.cc.orig 2022-04-21 18:48:31 UTC +++ services/device/time_zone_monitor/time_zone_monitor_linux.cc -@@ -137,7 +137,11 @@ class TimeZoneMonitorLinuxImpl +@@ -136,7 +136,11 @@ class TimeZoneMonitorLinuxImpl // false positives are harmless, assuming the false positive rate is // reasonable. const char* const kFilesToWatch[] = { +#if defined(OS_BSD) + "/etc/localtime", +#else "/etc/localtime", "/etc/timezone", "/etc/TZ", +#endif }; - for (size_t index = 0; index < base::size(kFilesToWatch); ++index) { + for (size_t index = 0; index < std::size(kFilesToWatch); ++index) { file_path_watchers_.push_back(std::make_unique()); diff --git a/www/chromium/files/patch-services_network_BUILD.gn b/www/chromium/files/patch-services_network_BUILD.gn index 44e0956698eb..5624d1d6f884 100644 --- a/www/chromium/files/patch-services_network_BUILD.gn +++ b/www/chromium/files/patch-services_network_BUILD.gn @@ -1,10 +1,10 @@ ---- services/network/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- services/network/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ services/network/BUILD.gn -@@ -323,7 +323,6 @@ if (is_linux || is_chromeos) { +@@ -327,7 +327,6 @@ if (is_linux || is_chromeos) { ] deps = [ "//base:base", - "//sandbox/linux:sandbox_services", "//sandbox/policy:policy", ] } diff --git a/www/chromium/files/patch-third__party_abseil-cpp_absl_base_config.h b/www/chromium/files/patch-third__party_abseil-cpp_absl_base_config.h index 0dc0b171b033..ea41829ef317 100644 --- a/www/chromium/files/patch-third__party_abseil-cpp_absl_base_config.h +++ b/www/chromium/files/patch-third__party_abseil-cpp_absl_base_config.h @@ -1,40 +1,21 @@ ---- third_party/abseil-cpp/absl/base/config.h.orig 2022-02-07 13:39:41 UTC +--- third_party/abseil-cpp/absl/base/config.h.orig 2022-04-21 18:48:31 UTC +++ third_party/abseil-cpp/absl/base/config.h -@@ -414,7 +414,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != - defined(_AIX) || defined(__ros__) || defined(__native_client__) || \ - defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) || \ - defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) || \ -- defined(__HAIKU__) -+ defined(__HAIKU__) || defined(__OpenBSD__) - #define ABSL_HAVE_MMAP 1 - #endif - -@@ -425,7 +425,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != - #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM - #error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set - #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ -- defined(_AIX) || defined(__ros__) -+ defined(_AIX) || defined(__ros__) || defined(__OpenBSD__) - #define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 - #endif - -@@ -444,7 +444,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != +@@ -445,7 +445,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != // POSIX.1-2001. #ifdef ABSL_HAVE_SCHED_YIELD #error ABSL_HAVE_SCHED_YIELD cannot be directly set -#elif defined(__linux__) || defined(__ros__) || defined(__native_client__) +#elif defined(__linux__) || defined(__ros__) || defined(__native_client__) || \ + defined(__OpenBSD__) || defined(__FreeBSD__) #define ABSL_HAVE_SCHED_YIELD 1 #endif -@@ -459,7 +460,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != +@@ -460,7 +461,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != // platforms. #ifdef ABSL_HAVE_SEMAPHORE_H #error ABSL_HAVE_SEMAPHORE_H cannot be directly set -#elif defined(__linux__) || defined(__ros__) -+#elif defined(__linux__) || defined(__ros__) || defined(__OpenBSD__) || \ -+ defined(__FreeBSD__) ++#elif defined(__linux__) || defined(__ros__) || defined(__OpenBSD__) || defined(__FreeBSD__) #define ABSL_HAVE_SEMAPHORE_H 1 #endif diff --git a/www/chromium/files/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h b/www/chromium/files/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h index d8f1b0f67e74..eaad46a8ea8d 100644 --- a/www/chromium/files/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h +++ b/www/chromium/files/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h @@ -1,11 +1,11 @@ ---- third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h.orig 2022-02-07 13:39:41 UTC +--- third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h.orig 2022-04-21 18:48:31 UTC +++ third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h -@@ -32,7 +32,7 @@ +@@ -31,7 +31,7 @@ + #error ABSL_HAVE_ELF_MEM_IMAGE cannot be directly set #endif - #if defined(__ELF__) && !defined(__native_client__) && !defined(__asmjs__) && \ -- !defined(__wasm__) -+ !defined(__wasm__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) +-#if defined(__ELF__) && !defined(__OpenBSD__) && \ ++#if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \ + !defined(__native_client__) && !defined(__asmjs__) && !defined(__wasm__) #define ABSL_HAVE_ELF_MEM_IMAGE 1 #endif - diff --git a/www/chromium/files/patch-third__party_angle_src_libANGLE_Display.cpp b/www/chromium/files/patch-third__party_angle_src_libANGLE_Display.cpp index 12ca6038d0f1..cff97e7bbbb3 100644 --- a/www/chromium/files/patch-third__party_angle_src_libANGLE_Display.cpp +++ b/www/chromium/files/patch-third__party_angle_src_libANGLE_Display.cpp @@ -1,47 +1,47 @@ ---- third_party/angle/src/libANGLE/Display.cpp.orig 2022-03-25 21:59:56 UTC +--- third_party/angle/src/libANGLE/Display.cpp.orig 2022-04-21 18:48:31 UTC +++ third_party/angle/src/libANGLE/Display.cpp @@ -55,7 +55,7 @@ # include "libANGLE/renderer/gl/wgl/DisplayWGL.h" # elif defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_IOS) # include "libANGLE/renderer/gl/apple/DisplayApple_api.h" -# elif defined(ANGLE_PLATFORM_LINUX) +# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD) # include "libANGLE/renderer/gl/egl/DisplayEGL.h" # if defined(ANGLE_USE_GBM) # include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h" -@@ -320,7 +320,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di +@@ -328,7 +328,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di impl = rx::CreateDisplayCGLOrEAGL(state); break; -# elif defined(ANGLE_PLATFORM_LINUX) +# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD) # if defined(ANGLE_USE_GBM) if (platformType == 0) { -@@ -365,7 +365,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di +@@ -373,7 +373,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di #if defined(ANGLE_ENABLE_OPENGL) # if defined(ANGLE_PLATFORM_WINDOWS) impl = new rx::DisplayWGL(state); -# elif defined(ANGLE_PLATFORM_LINUX) +# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD) # if defined(ANGLE_USE_GBM) if (platformType == 0 || platformType == EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE) -@@ -416,7 +416,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di +@@ -424,7 +424,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di impl = rx::CreateVulkanWin32Display(state); } break; -# elif defined(ANGLE_PLATFORM_LINUX) +# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD) # if defined(ANGLE_USE_X11) if (platformType == EGL_PLATFORM_X11_EXT && rx::IsVulkanXcbDisplayAvailable()) { -@@ -1915,7 +1915,7 @@ static ClientExtensions GenerateClientExtensions() +@@ -1926,7 +1926,7 @@ static ClientExtensions GenerateClientExtensions() extensions.x11Visual = true; #endif -#if defined(ANGLE_PLATFORM_LINUX) +#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD) extensions.platformANGLEDeviceTypeEGLANGLE = true; #endif diff --git a/www/chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc b/www/chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc index ff450056d5b0..8c81728bbb1d 100644 --- a/www/chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc +++ b/www/chromium/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc @@ -1,20 +1,20 @@ ---- third_party/blink/renderer/core/exported/web_view_impl.cc.orig 2022-03-25 21:59:56 UTC +--- third_party/blink/renderer/core/exported/web_view_impl.cc.orig 2022-04-21 18:48:31 UTC +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -404,7 +404,7 @@ SkFontHinting RendererPreferencesToSkiaHinting( const blink::RendererPreferences& prefs) { // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) if (!prefs.should_antialias_text) { // When anti-aliasing is off, GTK maps all non-zero hinting settings to // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight' -@@ -3159,7 +3159,7 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs +@@ -3156,7 +3156,7 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs renderer_preferences_.use_subpixel_positioning); // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && \ !BUILDFLAG(IS_ANDROID) if (!renderer_preferences_.system_font_family_name.empty()) { WebFontRenderStyle::SetSystemFontFamily(blink::WebString::FromUTF8( diff --git a/www/chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc b/www/chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc index c414266c3dd9..18e84755c02e 100644 --- a/www/chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc +++ b/www/chromium/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc @@ -1,20 +1,20 @@ ---- third_party/blink/renderer/core/frame/web_frame_test.cc.orig 2022-02-28 16:54:41 UTC +--- third_party/blink/renderer/core/frame/web_frame_test.cc.orig 2022-04-21 18:48:31 UTC +++ third_party/blink/renderer/core/frame/web_frame_test.cc -@@ -6310,7 +6310,7 @@ TEST_F(WebFrameTest, DISABLED_PositionForPointTest) { +@@ -6308,7 +6308,7 @@ TEST_F(WebFrameTest, DISABLED_PositionForPointTest) { EXPECT_EQ(64, ComputeOffset(layout_object, 1000, 1000)); } -#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) TEST_F(WebFrameTest, SelectRangeStaysHorizontallyAlignedWhenMoved) { RegisterMockedHttpURLLoad("move_caret.html"); -@@ -6689,7 +6689,7 @@ TEST_F(CompositedSelectionBoundsTest, SVGBasic) { +@@ -6687,7 +6687,7 @@ TEST_F(CompositedSelectionBoundsTest, SVGBasic) { TEST_F(CompositedSelectionBoundsTest, SVGTextWithFragments) { RunTest("composited_selection_bounds_svg_text_with_fragments.html"); } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #if !BUILDFLAG(IS_ANDROID) TEST_F(CompositedSelectionBoundsTest, Input) { web_view_helper_.GetWebView()->GetSettings()->SetDefaultFontSize(16); diff --git a/www/chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc b/www/chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc index f32b6fc1dbe6..fa7852b69ad7 100644 --- a/www/chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc +++ b/www/chromium/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc @@ -1,11 +1,11 @@ ---- third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc.orig 2022-02-28 16:54:41 UTC +--- third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc.orig 2022-04-21 18:48:31 UTC +++ third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -6102,7 +6102,7 @@ void WebGLRenderingContextBase::TexImageHelperMediaVid +@@ -6109,7 +6109,7 @@ void WebGLRenderingContextBase::TexImageHelperMediaVid constexpr bool kAllowZeroCopyImages = true; #endif -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // TODO(crbug.com/1175907): Only TexImage2D seems to work with the GPU path on // Android M -- appears to work fine on R, but to avoid regressions in - + diff --git a/www/chromium/files/patch-ui_views_controls_textfield_textfield.cc b/www/chromium/files/patch-ui_views_controls_textfield_textfield.cc index 7b7eb8a2a0ef..1dd7a1647da2 100644 --- a/www/chromium/files/patch-ui_views_controls_textfield_textfield.cc +++ b/www/chromium/files/patch-ui_views_controls_textfield_textfield.cc @@ -1,64 +1,64 @@ ---- ui/views/controls/textfield/textfield.cc.orig 2022-03-25 21:59:56 UTC +--- ui/views/controls/textfield/textfield.cc.orig 2022-04-21 18:48:31 UTC +++ ui/views/controls/textfield/textfield.cc @@ -73,7 +73,7 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "ui/base/ime/linux/text_edit_command_auralinux.h" #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" #endif @@ -166,7 +166,7 @@ bool IsControlKeyModifier(int flags) { // Control-modified key combination, but we cannot extend it to other platforms // as Control has different meanings and behaviors. // https://crrev.com/2580483002/#msg46 -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return flags & ui::EF_CONTROL_DOWN; #else return false; @@ -715,7 +715,7 @@ bool Textfield::OnKeyPressed(const ui::KeyEvent& event // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) ui::TextEditKeyBindingsDelegateAuraLinux* delegate = ui::GetTextEditKeyBindingsDelegate(); std::vector commands; @@ -861,7 +861,7 @@ void Textfield::AboutToRequestFocusFromTabTraversal(bo bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Skip any accelerator handling that conflicts with custom keybindings. ui::TextEditKeyBindingsDelegateAuraLinux* delegate = ui::GetTextEditKeyBindingsDelegate(); -@@ -1721,7 +1721,7 @@ bool Textfield::ShouldDoLearning() { +@@ -1723,7 +1723,7 @@ bool Textfield::ShouldDoLearning() { return false; } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // TODO(https://crbug.com/952355): Implement this method to support Korean IME // reconversion feature on native text fields (e.g. find bar). bool Textfield::SetCompositionFromExistingText( -@@ -2220,14 +2220,14 @@ ui::TextEditCommand Textfield::GetCommandForKeyEvent( +@@ -2222,14 +2222,14 @@ ui::TextEditCommand Textfield::GetCommandForKeyEvent( #endif return ui::TextEditCommand::DELETE_BACKWARD; } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Only erase by line break on Linux and ChromeOS. if (shift) return ui::TextEditCommand::DELETE_TO_BEGINNING_OF_LINE; #endif return ui::TextEditCommand::DELETE_WORD_BACKWARD; case ui::VKEY_DELETE: -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Only erase by line break on Linux and ChromeOS. if (shift && control) return ui::TextEditCommand::DELETE_TO_END_OF_LINE; diff --git a/www/chromium/files/patch-ui_views_widget_native__widget__aura.cc b/www/chromium/files/patch-ui_views_widget_native__widget__aura.cc index 861f419e0ed8..dfd6c8a4a1a5 100644 --- a/www/chromium/files/patch-ui_views_widget_native__widget__aura.cc +++ b/www/chromium/files/patch-ui_views_widget_native__widget__aura.cc @@ -1,29 +1,29 @@ ---- ui/views/widget/native_widget_aura.cc.orig 2022-02-28 16:54:41 UTC +--- ui/views/widget/native_widget_aura.cc.orig 2022-04-21 18:48:31 UTC +++ ui/views/widget/native_widget_aura.cc @@ -69,7 +69,7 @@ #endif #if BUILDFLAG(ENABLE_DESKTOP_AURA) && \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" #endif -@@ -1151,7 +1151,7 @@ void NativeWidgetAura::SetInitialFocus(ui::WindowShowS +@@ -1154,7 +1154,7 @@ void NativeWidgetAura::SetInitialFocus(ui::WindowShowS namespace { #if BUILDFLAG(ENABLE_DESKTOP_AURA) && \ - (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) + (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) void CloseWindow(aura::Window* window) { if (window) { Widget* widget = Widget::GetWidgetForNativeView(window); -@@ -1182,7 +1182,7 @@ void Widget::CloseAllSecondaryWidgets() { +@@ -1185,7 +1185,7 @@ void Widget::CloseAllSecondaryWidgets() { #endif #if BUILDFLAG(ENABLE_DESKTOP_AURA) && \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) DesktopWindowTreeHostLinux::CleanUpWindowList(CloseWindow); #endif } diff --git a/www/chromium/files/patch-ui_views_widget_widget.cc b/www/chromium/files/patch-ui_views_widget_widget.cc index 721bb2c80b08..6ea01fb23067 100644 --- a/www/chromium/files/patch-ui_views_widget_widget.cc +++ b/www/chromium/files/patch-ui_views_widget_widget.cc @@ -1,20 +1,20 @@ ---- ui/views/widget/widget.cc.orig 2022-03-25 21:59:56 UTC +--- ui/views/widget/widget.cc.orig 2022-04-21 18:48:31 UTC +++ ui/views/widget/widget.cc @@ -48,7 +48,7 @@ #include "ui/views/window/custom_frame_view.h" #include "ui/views/window/dialog_delegate.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/views/linux_ui/linux_ui.h" #endif -@@ -1791,7 +1791,7 @@ const ui::NativeTheme* Widget::GetNativeTheme() const +@@ -1820,7 +1820,7 @@ const ui::NativeTheme* Widget::GetNativeTheme() const if (parent_) return parent_->GetNativeTheme(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (const views::LinuxUI* linux_ui = views::LinuxUI::instance()) { if (auto* native_theme = linux_ui->GetNativeTheme(GetNativeWindow())) return native_theme; diff --git a/www/chromium/files/patch-v8_BUILD.gn b/www/chromium/files/patch-v8_BUILD.gn index 85681223e9ea..e972dc8bb498 100644 --- a/www/chromium/files/patch-v8_BUILD.gn +++ b/www/chromium/files/patch-v8_BUILD.gn @@ -1,45 +1,45 @@ ---- v8/BUILD.gn.orig 2022-03-25 21:59:56 UTC +--- v8/BUILD.gn.orig 2022-04-21 18:48:31 UTC +++ v8/BUILD.gn -@@ -1217,6 +1217,14 @@ config("toolchain") { +@@ -1223,6 +1223,14 @@ config("toolchain") { } else if (target_os == "win") { defines += [ "V8_HAVE_TARGET_OS" ] defines += [ "V8_TARGET_OS_WIN" ] + } else if (target_os == "openbsd") { + defines += [ "V8_HAVE_TARGET_OS" ] + defines += [ "V8_TARGET_OS_OPENBSD" ] + defines += [ "V8_TARGET_OS_BSD" ] + } else if (target_os == "freebsd") { + defines += [ "V8_HAVE_TARGET_OS" ] + defines += [ "V8_TARGET_OS_FREEBSD" ] + defines += [ "V8_TARGET_OS_BSD" ] } # TODO(infra): Support v8_enable_prof on Windows. -@@ -5156,7 +5164,7 @@ v8_component("v8_libbase") { +@@ -5229,7 +5237,7 @@ v8_component("v8_libbase") { } } - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "src/base/debug/stack_trace_posix.cc", "src/base/platform/platform-linux.cc", -@@ -5166,6 +5174,18 @@ v8_component("v8_libbase") { +@@ -5239,6 +5247,18 @@ v8_component("v8_libbase") { "dl", "rt", ] + } else if (is_openbsd) { + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-openbsd.cc", + ] + libs = [ "execinfo" ] + } else if (is_freebsd) { + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-freebsd.cc", + ] + libs = [ "execinfo" ] } else if (current_os == "aix") { sources += [ "src/base/debug/stack_trace_posix.cc", diff --git a/www/chromium/files/patch-v8_include_v8config.h b/www/chromium/files/patch-v8_include_v8config.h index 687b2fd71f34..1f906768877c 100644 --- a/www/chromium/files/patch-v8_include_v8config.h +++ b/www/chromium/files/patch-v8_include_v8config.h @@ -1,37 +1,37 @@ ---- v8/include/v8config.h.orig 2022-02-07 13:39:41 UTC +--- v8/include/v8config.h.orig 2022-04-21 18:48:31 UTC +++ v8/include/v8config.h -@@ -181,6 +181,8 @@ path. Add it with -I to the command line +@@ -183,6 +183,8 @@ path. Add it with -I to the command line && !defined(V8_TARGET_OS_FUCHSIA) \ && !defined(V8_TARGET_OS_IOS) \ && !defined(V8_TARGET_OS_LINUX) \ + && !defined(V8_TARGET_OS_OPENBSD) \ + && !defined(V8_TARGET_OS_FREEBSD) \ - && !defined(V8_TARGET_OS_MACOSX) \ + && !defined(V8_TARGET_OS_MACOS) \ && !defined(V8_TARGET_OS_WIN) # error No known target OS defined. -@@ -192,6 +194,8 @@ path. Add it with -I to the command line +@@ -194,6 +196,8 @@ path. Add it with -I to the command line || defined(V8_TARGET_OS_FUCHSIA) \ || defined(V8_TARGET_OS_IOS) \ || defined(V8_TARGET_OS_LINUX) \ + || defined(V8_TARGET_OS_OPENBSD) \ + || defined(V8_TARGET_OS_FREEBSD) \ - || defined(V8_TARGET_OS_MACOSX) \ + || defined(V8_TARGET_OS_MACOS) \ || defined(V8_TARGET_OS_WIN) # error A target OS is defined but V8_HAVE_TARGET_OS is unset. -@@ -212,6 +216,16 @@ path. Add it with -I to the command line +@@ -214,6 +218,16 @@ path. Add it with -I to the command line #ifdef V8_OS_LINUX # define V8_TARGET_OS_LINUX +#endif + +#ifdef V8_OS_OPENBSD +# define V8_TARGET_OS_OPENBSD +# define V8_TARGET_OS_BSD +#endif + +#ifdef V8_OS_FREEBSD +# define V8_TARGET_OS_OPENBSD +# define V8_TARGET_OS_BSD #endif - #ifdef V8_OS_MACOSX + #ifdef V8_OS_MACOS diff --git a/www/chromium/files/patch-v8_src_api_api.cc b/www/chromium/files/patch-v8_src_api_api.cc index 4aadc480cd31..8efb22eee271 100644 --- a/www/chromium/files/patch-v8_src_api_api.cc +++ b/www/chromium/files/patch-v8_src_api_api.cc @@ -1,20 +1,20 @@ ---- v8/src/api/api.cc.orig 2022-03-25 21:59:56 UTC +--- v8/src/api/api.cc.orig 2022-04-21 18:48:31 UTC +++ v8/src/api/api.cc @@ -139,7 +139,7 @@ #include "src/wasm/wasm-serialization.h" #endif // V8_ENABLE_WEBASSEMBLY --#if V8_OS_LINUX || V8_OS_MACOSX || V8_OS_FREEBSD -+#if V8_OS_LINUX || V8_OS_MACOSX || V8_OS_FREEBSD || V8_OS_OPENBSD +-#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD ++#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD #include #include "include/v8-wasm-trap-handler-posix.h" #include "src/trap-handler/handler-inside-posix.h" -@@ -6060,7 +6060,7 @@ bool v8::V8::Initialize(const int build_config) { +@@ -6044,7 +6044,7 @@ bool v8::V8::Initialize(const int build_config) { return true; } --#if V8_OS_LINUX || V8_OS_MACOSX -+#if V8_OS_LINUX || V8_OS_MACOSX || V8_OS_FREEBSD || V8_OS_OPENBSD +-#if V8_OS_LINUX || V8_OS_DARWIN ++#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info, void* context) { #if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED diff --git a/www/chromium/files/patch-v8_src_base_atomicops.h b/www/chromium/files/patch-v8_src_base_atomicops.h index 488d69659274..73f06e805e03 100644 --- a/www/chromium/files/patch-v8_src_base_atomicops.h +++ b/www/chromium/files/patch-v8_src_base_atomicops.h @@ -1,33 +1,33 @@ ---- v8/src/base/atomicops.h.orig 2022-02-07 13:39:41 UTC +--- v8/src/base/atomicops.h.orig 2022-04-21 18:48:31 UTC +++ v8/src/base/atomicops.h @@ -57,10 +57,10 @@ using Atomic64 = SbAtomic64; using Atomic8 = char; using Atomic16 = int16_t; using Atomic32 = int32_t; -#if defined(V8_HOST_ARCH_64_BIT) +#if defined(V8_HOST_ARCH_64_BIT) || defined(V8_OS_OPENBSD) // We need to be able to go between Atomic64 and AtomicWord implicitly. This // means Atomic64 and AtomicWord should be the same type on 64-bit. -#if defined(__ILP32__) +#if defined(__ILP32__) && !defined(V8_OS_OPENBSD) using Atomic64 = int64_t; #else using Atomic64 = intptr_t; -@@ -241,7 +241,7 @@ inline Atomic32 Acquire_Load(volatile const Atomic32* - std::memory_order_acquire); +@@ -251,7 +251,7 @@ inline Atomic32 SeqCst_Load(volatile const Atomic32* p + std::memory_order_seq_cst); } -#if defined(V8_HOST_ARCH_64_BIT) +#if defined(V8_HOST_ARCH_64_BIT) || defined(V8_OS_OPENBSD) inline Atomic64 Relaxed_CompareAndSwap(volatile Atomic64* ptr, Atomic64 old_value, Atomic64 new_value) { -@@ -441,7 +441,7 @@ inline int Relaxed_Memcmp(volatile const Atomic8* s1, +@@ -456,7 +456,7 @@ inline int Relaxed_Memcmp(volatile const Atomic8* s1, // On some platforms we need additional declarations to make // AtomicWord compatible with our other Atomic* types. --#if defined(V8_OS_MACOSX) || defined(V8_OS_OPENBSD) || defined(V8_OS_AIX) -+#if defined(V8_OS_MACOSX) || defined(V8_OS_AIX) +-#if defined(V8_OS_DARWIN) || defined(V8_OS_OPENBSD) || defined(V8_OS_AIX) ++#if defined(V8_OS_DARWIN) || defined(V8_OS_AIX) #include "src/base/atomicops_internals_atomicword_compat.h" #endif diff --git a/www/chromium/files/patch-v8_src_base_platform_platform-posix.cc b/www/chromium/files/patch-v8_src_base_platform_platform-posix.cc index a3f4ed349b58..25b00008ef24 100644 --- a/www/chromium/files/patch-v8_src_base_platform_platform-posix.cc +++ b/www/chromium/files/patch-v8_src_base_platform_platform-posix.cc @@ -1,53 +1,53 @@ ---- v8/src/base/platform/platform-posix.cc.orig 2022-03-25 21:59:56 UTC +--- v8/src/base/platform/platform-posix.cc.orig 2022-04-21 18:48:31 UTC +++ v8/src/base/platform/platform-posix.cc -@@ -65,7 +65,7 @@ +@@ -68,7 +68,7 @@ #include #endif --#if V8_OS_FREEBSD || V8_OS_MACOSX || V8_OS_OPENBSD || V8_OS_SOLARIS -+#if V8_OS_FREEBSD || V8_OS_MACOSX || V8_OS_BSD || V8_OS_SOLARIS +-#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_OPENBSD || V8_OS_SOLARIS ++#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_BSD || V8_OS_SOLARIS #define MAP_ANONYMOUS MAP_ANON #endif -@@ -291,8 +291,15 @@ void OS::SetRandomMmapSeed(int64_t seed) { +@@ -294,8 +294,15 @@ void OS::SetRandomMmapSeed(int64_t seed) { } } +#if V8_OS_OPENBSD -+// Allow OpenBSD's mmap to select a random address on OpenBSD ++// Allow OpenBSD's mmap to select a random address on OpenBSD // static void* OS::GetRandomMmapAddr() { + return nullptr; +} +#else +// static +void* OS::GetRandomMmapAddr() { uintptr_t raw_addr; { MutexGuard guard(rng_mutex.Pointer()); -@@ -383,6 +390,7 @@ void* OS::GetRandomMmapAddr() { +@@ -386,6 +393,7 @@ void* OS::GetRandomMmapAddr() { #endif return reinterpret_cast(raw_addr); } +#endif // TODO(bbudge) Move Cygwin and Fuchsia stuff into platform-specific files. #if !V8_OS_CYGWIN && !V8_OS_FUCHSIA -@@ -598,7 +606,7 @@ void OS::DestroySharedMemoryHandle(PlatformSharedMemor +@@ -612,7 +620,7 @@ void OS::DestroySharedMemoryHandle(PlatformSharedMemor // static bool OS::HasLazyCommits() { --#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX -+#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX || V8_OS_BSD +-#if V8_OS_AIX || V8_OS_LINUX || V8_OS_DARWIN ++#if V8_OS_AIX || V8_OS_LINUX || V8_OS_DARWIN || V8_OS_BSD return true; #else // TODO(bbudge) Return true for all POSIX platforms. -@@ -1217,7 +1225,7 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* +@@ -1231,7 +1239,7 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* // keep this version in POSIX as most Linux-compatible derivatives will // support it. MacOS and FreeBSD are different here. - #if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX) && \ + #if !defined(V8_OS_FREEBSD) && !defined(V8_OS_DARWIN) && !defined(_AIX) && \ - !defined(V8_OS_SOLARIS) + !defined(V8_OS_SOLARIS) && !defined(V8_OS_OPENBSD) // static Stack::StackSlot Stack::GetStackStart() { diff --git a/www/chromium/files/patch-v8_src_trap-handler_handler-inside-posix.h b/www/chromium/files/patch-v8_src_trap-handler_handler-inside-posix.h index fc737fc64793..df777a8a205b 100644 --- a/www/chromium/files/patch-v8_src_trap-handler_handler-inside-posix.h +++ b/www/chromium/files/patch-v8_src_trap-handler_handler-inside-posix.h @@ -1,11 +1,11 @@ ---- v8/src/trap-handler/handler-inside-posix.h.orig 2022-02-07 13:39:41 UTC +--- v8/src/trap-handler/handler-inside-posix.h.orig 2022-04-21 18:48:31 UTC +++ v8/src/trap-handler/handler-inside-posix.h @@ -13,7 +13,7 @@ namespace v8 { namespace internal { namespace trap_handler { -#if V8_OS_LINUX || V8_OS_FREEBSD +#if V8_OS_LINUX || V8_OS_FREEBSD || V8_OS_OPENBSD constexpr int kOobSignal = SIGSEGV; - #elif V8_OS_MACOSX + #elif V8_OS_DARWIN constexpr int kOobSignal = SIGBUS; diff --git a/www/chromium/files/patch-v8_src_trap-handler_trap-handler.h b/www/chromium/files/patch-v8_src_trap-handler_trap-handler.h index 4e357cfd419f..4e121b916178 100644 --- a/www/chromium/files/patch-v8_src_trap-handler_trap-handler.h +++ b/www/chromium/files/patch-v8_src_trap-handler_trap-handler.h @@ -1,11 +1,11 @@ ---- v8/src/trap-handler/trap-handler.h.orig 2022-02-07 13:39:41 UTC +--- v8/src/trap-handler/trap-handler.h.orig 2022-04-21 18:48:31 UTC +++ v8/src/trap-handler/trap-handler.h @@ -20,7 +20,7 @@ namespace trap_handler { // X64 on Linux, Windows, MacOS, FreeBSD. #if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \ - ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \ + ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \ - V8_OS_FREEBSD) + V8_OS_FREEBSD || V8_OS_OPENBSD) #define V8_TRAP_HANDLER_SUPPORTED true // Arm64 (non-simulator) on Mac. - #elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX + #elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_DARWIN diff --git a/www/chromium/files/patch-weblayer_browser_browser__main__parts__impl.cc b/www/chromium/files/patch-weblayer_browser_browser__main__parts__impl.cc index 29b4e399f51b..8ee0e3fa42aa 100644 --- a/www/chromium/files/patch-weblayer_browser_browser__main__parts__impl.cc +++ b/www/chromium/files/patch-weblayer_browser_browser__main__parts__impl.cc @@ -1,20 +1,20 @@ ---- weblayer/browser/browser_main_parts_impl.cc.orig 2022-03-25 21:59:56 UTC +--- weblayer/browser/browser_main_parts_impl.cc.orig 2022-04-21 18:48:31 UTC +++ weblayer/browser/browser_main_parts_impl.cc -@@ -78,7 +78,7 @@ +@@ -79,7 +79,7 @@ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) #include "ui/base/ime/init/input_method_initializer.h" #endif -@@ -196,7 +196,7 @@ int BrowserMainPartsImpl::PreEarlyInitialization() { +@@ -198,7 +198,7 @@ int BrowserMainPartsImpl::PreEarlyInitialization() { // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) ui::InitializeInputMethodForTesting(); #endif #if BUILDFLAG(IS_ANDROID) diff --git a/www/chromium/files/patch-weblayer_browser_content__browser__client__impl.cc b/www/chromium/files/patch-weblayer_browser_content__browser__client__impl.cc index 36ab2cdb6c94..4b99c063e1e0 100644 --- a/www/chromium/files/patch-weblayer_browser_content__browser__client__impl.cc +++ b/www/chromium/files/patch-weblayer_browser_content__browser__client__impl.cc @@ -1,20 +1,20 @@ ---- weblayer/browser/content_browser_client_impl.cc.orig 2022-03-25 21:59:56 UTC +--- weblayer/browser/content_browser_client_impl.cc.orig 2022-04-21 18:48:31 UTC +++ weblayer/browser/content_browser_client_impl.cc -@@ -153,7 +153,7 @@ +@@ -154,7 +154,7 @@ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) #include "content/public/common/content_descriptors.h" #endif -@@ -1000,7 +1000,7 @@ SafeBrowsingService* ContentBrowserClientImpl::GetSafe +@@ -1001,7 +1001,7 @@ SafeBrowsingService* ContentBrowserClientImpl::GetSafe // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) void ContentBrowserClientImpl::GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id,