diff --git a/www/chromium/Makefile b/www/chromium/Makefile index 736010d5416d..34b4f0f659c3 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,345 +1,346 @@ # Created by: Florent Thoumie PORTNAME= chromium -PORTVERSION= 99.0.4844.84 +PORTVERSION= 100.0.4896.60 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 \ 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.6-3.9,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_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 && ${PORT_OPTIONS:MLTO} +.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/Makefile.tests b/www/chromium/Makefile.tests index aea948673823..a635e949f167 100644 --- a/www/chromium/Makefile.tests +++ b/www/chromium/Makefile.tests @@ -1,12 +1,16 @@ TEST_TARGETS= base_unittests \ blink_unittests \ chromedriver_unittests \ components_unittests \ content_unittests \ crypto_unittests \ + gl_tests \ + gpu_unittests \ headless_unittests \ media_unittests \ mojo_unittests \ net_unittests \ printing_unittests \ - url_unittests + skia_unittests \ + url_unittests \ + wm_unittests diff --git a/www/chromium/distinfo b/www/chromium/distinfo index e70f0b8e14f9..a192e0735092 100644 --- a/www/chromium/distinfo +++ b/www/chromium/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1648281454 -SHA256 (chromium-99.0.4844.84.tar.xz) = 20ec184ed34bdc7e660ccf6c007b2db37007de423b3a5a51698a96aa29527515 -SIZE (chromium-99.0.4844.84.tar.xz) = 1326587000 -SHA256 (chromium-99.0.4844.84-testdata.tar.xz) = 682715d5058c6289cdfcc3795ef65b7d757f3f9b4773a8ebcf22a869b6aa3940 -SIZE (chromium-99.0.4844.84-testdata.tar.xz) = 259949040 +TIMESTAMP = 1648585637 +SHA256 (chromium-100.0.4896.60.tar.xz) = 0e5ea5f3061ad090cf6bd57ca037496d95ea8956de021aff902f7d0ded7bffdc +SIZE (chromium-100.0.4896.60.tar.xz) = 1357922968 +SHA256 (chromium-100.0.4896.60-testdata.tar.xz) = d242f678bb37976baad0f246f6d5025c29c14efbf74efb2c2e4140b5f08b884c +SIZE (chromium-100.0.4896.60-testdata.tar.xz) = 260020208 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 e6324afdb6fc..30303505c930 100644 --- a/www/chromium/files/patch-BUILD.gn +++ b/www/chromium/files/patch-BUILD.gn @@ -1,72 +1,72 @@ ---- BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ BUILD.gn -@@ -52,7 +52,7 @@ declare_args() { +@@ -53,7 +53,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) -@@ -454,7 +454,7 @@ group("gn_all") { +@@ -452,7 +452,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") { } } + 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", -@@ -686,7 +695,7 @@ group("gn_all") { +@@ -685,7 +694,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)" ] } -@@ -1137,7 +1146,7 @@ if (!is_ios) { +@@ -1147,7 +1156,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)" ] } -@@ -1146,7 +1155,7 @@ if (!is_ios) { +@@ -1156,7 +1165,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)" ] } -@@ -1521,7 +1530,7 @@ group("chromium_builder_perf") { +@@ -1531,7 +1540,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-ash_display_mirror__window__controller.cc b/www/chromium/files/patch-ash_display_mirror__window__controller.cc index aae659dabc3b..b3983d74627a 100644 --- a/www/chromium/files/patch-ash_display_mirror__window__controller.cc +++ b/www/chromium/files/patch-ash_display_mirror__window__controller.cc @@ -1,14 +1,14 @@ ---- ash/display/mirror_window_controller.cc.orig 2022-02-07 13:39:41 UTC +--- ash/display/mirror_window_controller.cc.orig 2022-03-25 21:59:56 UTC +++ ash/display/mirror_window_controller.cc -@@ -297,7 +297,11 @@ void MirrorWindowController::UpdateWindow( +@@ -296,7 +296,11 @@ void MirrorWindowController::UpdateWindow( return info.id() == iter->first; }) == display_info_list.end()) { CloseAndDeleteHost(iter->second, true); +#if defined(__llvm__) + mirroring_host_info_map_.erase(iter++); +#else iter = mirroring_host_info_map_.erase(iter); +#endif } else { ++iter; } diff --git a/www/chromium/files/patch-base_BUILD.gn b/www/chromium/files/patch-base_BUILD.gn index 72069cf118ab..1ae290e3f1c0 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-02-28 16:54:41 UTC +--- base/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ base/BUILD.gn -@@ -993,7 +993,7 @@ mixed_component("base") { +@@ -999,7 +999,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", -@@ -1004,6 +1004,12 @@ mixed_component("base") { +@@ -1010,6 +1010,12 @@ mixed_component("base") { "profiler/thread_delegate_posix.h", ] } + + if (is_bsd) { + sources += [ + "profiler/stack_sampler_posix.cc", + ] + } } if (is_win) { -@@ -1462,11 +1468,23 @@ mixed_component("base") { +@@ -1478,11 +1484,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", -@@ -1490,7 +1508,7 @@ mixed_component("base") { +@@ -1506,7 +1524,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", -@@ -1550,7 +1568,7 @@ mixed_component("base") { +@@ -1563,7 +1581,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) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -2222,6 +2240,42 @@ mixed_component("base") { +@@ -2243,6 +2261,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 -= [ -@@ -3465,7 +3519,7 @@ test("base_unittests") { +@@ -3495,7 +3549,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", -@@ -3513,7 +3567,7 @@ test("base_unittests") { +@@ -3543,7 +3597,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", -@@ -3525,7 +3579,7 @@ test("base_unittests") { +@@ -3555,7 +3609,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) { defines += [ "SYSTEM_NATIVE_UTF8" ] } -@@ -3689,7 +3743,7 @@ test("base_unittests") { +@@ -3724,7 +3778,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_page__allocator__internals__posix.h b/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h index 700bf383a007..483bda5e796f 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h @@ -1,16 +1,16 @@ ---- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2022-03-25 21:59:56 UTC +++ base/allocator/partition_allocator/page_allocator_internals_posix.h -@@ -346,8 +346,12 @@ bool TryRecommitSystemPagesInternal( +@@ -352,8 +352,12 @@ bool TryRecommitSystemPagesInternal( void DiscardSystemPagesInternal(uintptr_t address, size_t length) { void* ptr = reinterpret_cast(address); -#if BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) +#if BUILDFLAG(IS_BSD) + int ret = madvise(ptr, length, MADV_FREE); +#else int ret = madvise(ptr, length, MADV_FREE_REUSABLE); +#endif if (ret) { // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED. ret = madvise(ptr, length, MADV_DONTNEED); diff --git a/www/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 011bdf1a8e7b..454110a15f26 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,11 +1,20 @@ ---- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-03-25 21:59:56 UTC +++ base/allocator/partition_allocator/partition_alloc_config.h @@ -59,7 +59,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; + + // 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 + diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h index 138e9832363f..c7c476112b95 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__page.h @@ -1,22 +1,22 @@ ---- base/allocator/partition_allocator/partition_page.h.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/partition_page.h.orig 2022-03-25 21:59:56 UTC +++ base/allocator/partition_allocator/partition_page.h -@@ -129,7 +129,8 @@ struct __attribute__((packed)) SlotSpanMetadata { +@@ -128,7 +128,8 @@ struct __attribute__((packed)) SlotSpanMetadata { PartitionBucket* const bucket = nullptr; // CHECK()ed in AllocNewSlotSpan(). -#if defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE) +#if (defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)) || \ + (BUILDFLAG(IS_FREEBSD) && defined(__i386__)) // System page size is not a constant on Apple OSes, but is either 4 or 16kiB // (1 << 12 or 1 << 14), as checked in PartitionRoot::Init(). And // PartitionPageSize() is 4 times the OS page size. -@@ -143,7 +144,9 @@ struct __attribute__((packed)) SlotSpanMetadata { +@@ -142,7 +143,9 @@ struct __attribute__((packed)) SlotSpanMetadata { #endif // defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE) // The maximum number of bits needed to cover all currently supported OSes. static constexpr size_t kMaxSlotsPerSlotSpanBits = 13; +#if !BUILDFLAG(IS_FREEBSD) && defined(__i386__) static_assert(kMaxSlotsPerSlotSpan < (1 << kMaxSlotsPerSlotSpanBits), ""); +#endif // |marked_full| isn't equivalent to being full. Slot span is marked as full // iff it isn't on the active slot span list (or any other list). diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h index a53eb22b38b2..dbd1382fed99 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_partition__root.h @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/partition_root.h.orig 2022-02-28 16:54:41 UTC +--- base/allocator/partition_allocator/partition_root.h.orig 2022-03-25 21:59:56 UTC +++ base/allocator/partition_allocator/partition_root.h -@@ -1019,7 +1019,7 @@ ALWAYS_INLINE void PartitionRoot::FreeNoH +@@ -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(address)); + PA_CHECK(IsManagedByPartitionAlloc(object_addr)); #endif diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_starscan_state__bitmap.h b/www/chromium/files/patch-base_allocator_partition__allocator_starscan_state__bitmap.h deleted file mode 100644 index b1d0d8621c7a..000000000000 --- a/www/chromium/files/patch-base_allocator_partition__allocator_starscan_state__bitmap.h +++ /dev/null @@ -1,20 +0,0 @@ ---- base/allocator/partition_allocator/starscan/state_bitmap.h.orig 2022-02-21 11:33:24.834416000 +0100 -+++ base/allocator/partition_allocator/starscan/state_bitmap.h -@@ -393,7 +393,7 @@ template -+ bool ClearBits> - inline void - StateBitmap::IterateImpl( - size_t epoch, -@@ -423,7 +423,7 @@ StateBitmap #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/debug/proc_maps_linux.h" #endif @@ -695,6 +695,9 @@ class SandboxSymbolizeHelper { // for the modules that are loaded in the current process. // Returns true on success. bool CacheMemoryRegions() { +#if BUILDFLAG(IS_BSD) + return false; +#else // Reads /proc/self/maps. std::string contents; if (!ReadProcMaps(&contents)) { @@ -712,6 +715,7 @@ class SandboxSymbolizeHelper { is_initialized_ = true; return true; +#endif } // Opens all object files and caches their file descriptors. @@ -868,7 +872,7 @@ size_t CollectStackTrace(void** trace, size_t count) { // If we do not have unwind tables, then try tracing using frame pointers. return base::debug::TraceStackFramePointers(const_cast(trace), count, 0); -#elif !defined(__UCLIBC__) && !defined(_AIX) +#elif !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD) // Though the backtrace API man page does not list any possible negative // return values, we take no chance. return base::saturated_cast(backtrace(trace, count)); diff --git a/www/chromium/files/patch-base_process_process__metrics.cc b/www/chromium/files/patch-base_process_process__metrics.cc index a20644fcc0a1..00d7bf404371 100644 --- a/www/chromium/files/patch-base_process_process__metrics.cc +++ b/www/chromium/files/patch-base_process_process__metrics.cc @@ -1,38 +1,47 @@ ---- base/process/process_metrics.cc.orig 2022-02-28 16:54:41 UTC +--- base/process/process_metrics.cc.orig 2022-03-25 21:59:56 UTC +++ base/process/process_metrics.cc @@ -18,7 +18,7 @@ namespace base { namespace { #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int CalculateEventsPerSecond(uint64_t event_count, uint64_t* last_event_count, base::TimeTicks* last_calculated) { @@ -55,7 +55,7 @@ SystemMetrics SystemMetrics::Sample() { SystemMetrics system_metrics; system_metrics.committed_memory_ = GetSystemCommitCharge(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) GetSystemMemoryInfo(&system_metrics.memory_info_); GetVmStatInfo(&system_metrics.vmstat_info_); GetSystemDiskInfo(&system_metrics.disk_info_); @@ -74,7 +74,7 @@ Value SystemMetrics::ToValue() const { Value res(Value::Type::DICTIONARY); res.SetIntKey("committed_memory", static_cast(committed_memory_)); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) Value meminfo = memory_info_.ToValue(); Value vmstat = vmstat_info_.ToValue(); meminfo.MergeDictionary(&vmstat); +@@ -100,7 +100,7 @@ std::unique_ptr ProcessMetrics::Create + #endif // !BUILDFLAG(IS_MAC) + } + +-#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX) ++#if !BUILDFLAG(IS_BSD) || !BUILDFLAG(IS_POSIX) + double ProcessMetrics::GetPlatformIndependentCPUUsage() { + TimeDelta cumulative_cpu = GetCumulativeCPUUsage(); + TimeTicks time = TimeTicks::Now(); @@ -126,7 +126,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage( #endif #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int ProcessMetrics::CalculateIdleWakeupsPerSecond( uint64_t absolute_idle_wakeups) { return CalculateEventsPerSecond(absolute_idle_wakeups, diff --git a/www/chromium/files/patch-base_process_process__metrics__freebsd.cc b/www/chromium/files/patch-base_process_process__metrics__freebsd.cc index 3e8eb45662f0..052477866871 100644 --- a/www/chromium/files/patch-base_process_process__metrics__freebsd.cc +++ b/www/chromium/files/patch-base_process_process__metrics__freebsd.cc @@ -1,277 +1,292 @@ ---- base/process/process_metrics_freebsd.cc.orig 2021-10-01 01:36:37 UTC +--- base/process/process_metrics_freebsd.cc.orig 2022-03-25 21:59:56 UTC +++ base/process/process_metrics_freebsd.cc @@ -3,21 +3,41 @@ // 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( -@@ -37,7 +57,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage( +@@ -27,17 +47,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_ }; ++ + if (sysctl(mib, base::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 +88,221 @@ size_t GetSystemCommitCharge() { +@@ -68,4 +89,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) { + 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 1cc46d52fa55..97102c7e4f92 100644 --- a/www/chromium/files/patch-base_process_process__metrics__openbsd.cc +++ b/www/chromium/files/patch-base_process_process__metrics__openbsd.cc @@ -1,213 +1,235 @@ ---- base/process/process_metrics_openbsd.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/process_metrics_openbsd.cc.orig 2022-03-25 21:59:56 UTC +++ base/process/process_metrics_openbsd.cc -@@ -4,14 +4,30 @@ +@@ -4,17 +4,36 @@ #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" namespace base { -@@ -25,48 +41,13 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun ++ProcessMetrics::ProcessMetrics(ProcessHandle process) ++ : process_(process) {} ++ + // static + std::unique_ptr ProcessMetrics::CreateProcessMetrics( + ProcessHandle process) { +@@ -25,49 +44,24 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun return false; } -static int GetProcessCPU(pid_t pid) { -- struct kinfo_proc info; ++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) - return -1; -- ++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_, ++ sizeof(struct kinfo_proc), 1 }; + - mib[5] = (length / sizeof(struct kinfo_proc)); -- ++ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) ++ return 0.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) +-ProcessMetrics::ProcessMetrics(ProcessHandle process) - : process_(process), - last_cpu_(0) {} -+ : process_(process) {} - +- size_t GetSystemCommitCharge() { int mib[] = { CTL_VM, VM_METER }; -@@ -85,6 +66,129 @@ size_t GetSystemCommitCharge() { + 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() { 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 8a7b5721a4a7..98e1db005454 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-02-28 16:54:41 UTC +--- base/process/process_posix.cc.orig 2022-03-25 21:59:56 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 -@@ -358,7 +363,55 @@ void Process::Exited(int exit_code) const {} +@@ -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) + 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) + 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_rand__util.h b/www/chromium/files/patch-base_rand__util.h index 7afa38819627..7dbf39ebe0ba 100644 --- a/www/chromium/files/patch-base_rand__util.h +++ b/www/chromium/files/patch-base_rand__util.h @@ -1,11 +1,11 @@ ---- base/rand_util.h.orig 2022-02-28 16:54:41 UTC +--- base/rand_util.h.orig 2022-03-25 21:59:56 UTC +++ base/rand_util.h -@@ -77,7 +77,7 @@ void RandomShuffle(Itr first, Itr last) { +@@ -81,7 +81,7 @@ void RandomShuffle(Itr first, Itr last) { std::shuffle(first, last, RandomBitGenerator()); } -#if BUILDFLAG(IS_POSIX) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_OPENBSD) BASE_EXPORT int GetUrandomFD(); #endif 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 1dceaec008cd..143fb26b294b 100644 --- a/www/chromium/files/patch-base_system_sys__info__freebsd.cc +++ b/www/chromium/files/patch-base_system_sys__info__freebsd.cc @@ -1,102 +1,113 @@ ---- base/system/sys_info_freebsd.cc.orig 2021-04-14 18:40:48 UTC +--- base/system/sys_info_freebsd.cc.orig 2022-03-25 21:59:56 UTC +++ base/system/sys_info_freebsd.cc -@@ -9,30 +9,95 @@ +@@ -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) { ++ 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); + + if (sysctl(mib, base::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 9da562746469..895f93683f73 100644 --- a/www/chromium/files/patch-base_system_sys__info__openbsd.cc +++ b/www/chromium/files/patch-base_system_sys__info__openbsd.cc @@ -1,100 +1,102 @@ ---- base/system/sys_info_openbsd.cc.orig 2022-02-07 13:39:41 UTC +--- base/system/sys_info_openbsd.cc.orig 2022-03-25 21:59:56 UTC +++ base/system/sys_info_openbsd.cc @@ -12,6 +12,7 @@ #include "base/cxx17_backports.h" #include "base/notreached.h" +#include "base/strings/string_util.h" namespace { -@@ -29,9 +30,14 @@ int64_t AmountOfMemory(int pages_name) { +@@ -29,9 +30,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 +49,61 @@ int SysInfo::NumberOfProcessors() { +@@ -43,38 +50,62 @@ 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}; -+ char name[256]; -+ size_t len = base::size(name); -+ if (sysctl(mib, base::size(mib), name, &len, NULL, 0) < 0) { -+ NOTREACHED(); -+ return std::string(); ++ size_t len = base::size(cpumodel); ++ ++ if (cpumodel[0] == '\0') { ++ if (sysctl(mib, base::size(mib), cpumodel, &len, NULL, 0) < 0) ++ return std::string(); + } -+ return name; ++ ++ return std::string(cpumodel, len - 1); +} + +// static 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) { 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) { - 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-base_system_sys__info__posix.cc b/www/chromium/files/patch-base_system_sys__info__posix.cc index 28bbf3b3559f..42ceb1fda2dd 100644 --- a/www/chromium/files/patch-base_system_sys__info__posix.cc +++ b/www/chromium/files/patch-base_system_sys__info__posix.cc @@ -1,11 +1,43 @@ ---- base/system/sys_info_posix.cc.orig 2022-03-16 08:38:25 UTC +--- base/system/sys_info_posix.cc.orig 2022-03-25 21:59:56 UTC +++ base/system/sys_info_posix.cc +@@ -37,7 +37,7 @@ + + namespace { + +-#if !BUILDFLAG(IS_OPENBSD) ++#if !BUILDFLAG(IS_BSD) + int NumberOfProcessors() { + // sysconf returns the number of "logical" (not "physical") processors on both + // Mac and Linux. So we get the number of max available "logical" processors. +@@ -77,7 +77,7 @@ int NumberOfProcessors() { + + base::LazyInstance>:: + Leaky g_lazy_number_of_processors = LAZY_INSTANCE_INITIALIZER; +-#endif // !BUILDFLAG(IS_OPENBSD) ++#endif // !BUILDFLAG(IS_BSD) + + int64_t AmountOfVirtualMemory() { + struct rlimit limit; +@@ -143,11 +143,11 @@ bool GetDiskSpaceInfo(const base::FilePath& path, + + namespace base { + +-#if !BUILDFLAG(IS_OPENBSD) ++#if !BUILDFLAG(IS_BSD) + int SysInfo::NumberOfProcessors() { + return g_lazy_number_of_processors.Get().value(); + } +-#endif // !BUILDFLAG(IS_OPENBSD) ++#endif // !BUILDFLAG(IS_BSD) + + // static + int64_t SysInfo::AmountOfVirtualMemory() { @@ -239,6 +239,8 @@ std::string SysInfo::OperatingSystemArchitecture() { arch = "x86"; } else if (arch == "amd64") { arch = "x86_64"; + } else if (arch == "arm64") { + arch = "aarch64"; } else if (std::string(info.sysname) == "AIX") { arch = "ppc64"; } diff --git a/www/chromium/files/patch-base_system_sys__info__unittest.cc b/www/chromium/files/patch-base_system_sys__info__unittest.cc index 590b817eaf49..2d9da201de79 100644 --- a/www/chromium/files/patch-base_system_sys__info__unittest.cc +++ b/www/chromium/files/patch-base_system_sys__info__unittest.cc @@ -1,19 +1,19 @@ ---- base/system/sys_info_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- base/system/sys_info_unittest.cc.orig 2022-03-25 21:59:56 UTC +++ base/system/sys_info_unittest.cc -@@ -228,12 +228,15 @@ TEST_F(SysInfoTest, GetHardwareInfo) { +@@ -234,12 +234,15 @@ TEST_F(SysInfoTest, GetHardwareInfo) { EXPECT_TRUE(IsStringUTF8(hardware_info->model)); bool empty_result_expected = #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) false; #else true; #endif EXPECT_EQ(hardware_info->manufacturer.empty(), empty_result_expected); +#if BUILDFLAG(IS_BSD) + empty_result_expected = true; +#endif EXPECT_EQ(hardware_info->model.empty(), empty_result_expected); } diff --git a/www/chromium/files/patch-base_threading_thread__local__storage__unittest.cc b/www/chromium/files/patch-base_threading_thread__local__storage__unittest.cc deleted file mode 100644 index 6ea93f8745fd..000000000000 --- a/www/chromium/files/patch-base_threading_thread__local__storage__unittest.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- base/threading/thread_local_storage_unittest.cc.orig 2022-02-28 16:54:41 UTC -+++ base/threading/thread_local_storage_unittest.cc -@@ -90,7 +90,7 @@ class ThreadLocalStorageRunner : public DelegateSimple - void ThreadLocalStorageCleanup(void *value) { - int *ptr = reinterpret_cast(value); - // Destructors should never be called with a NULL. -- ASSERT_NE(reinterpret_cast(NULL), ptr); -+ ASSERT_NE(NULL, ptr); - if (*ptr == kFinalTlsValue) - return; // We've been called enough times. - ASSERT_LT(kFinalTlsValue, *ptr); diff --git a/www/chromium/files/patch-base_trace__event_memory__dump__manager.cc b/www/chromium/files/patch-base_trace__event_memory__dump__manager.cc index 45c5ecd63a91..f1f228e38e7b 100644 --- a/www/chromium/files/patch-base_trace__event_memory__dump__manager.cc +++ b/www/chromium/files/patch-base_trace__event_memory__dump__manager.cc @@ -1,11 +1,11 @@ ---- base/trace_event/memory_dump_manager.cc.orig 2022-02-07 13:39:41 UTC +--- base/trace_event/memory_dump_manager.cc.orig 2022-03-25 21:59:56 UTC +++ base/trace_event/memory_dump_manager.cc -@@ -78,7 +78,7 @@ const char* const MemoryDumpManager::kSystemAllocatorP +@@ -82,7 +82,7 @@ const char* const MemoryDumpManager::kSystemAllocatorP #if defined(MALLOC_MEMORY_TRACING_SUPPORTED) MallocDumpProvider::kAllocatedObjects; #else - nullptr; + ""; #endif // static diff --git a/www/chromium/files/patch-build_config_compiler_BUILD.gn b/www/chromium/files/patch-build_config_compiler_BUILD.gn index 1c9d854a4148..badfeff900d0 100644 --- a/www/chromium/files/patch-build_config_compiler_BUILD.gn +++ b/www/chromium/files/patch-build_config_compiler_BUILD.gn @@ -1,113 +1,113 @@ ---- build/config/compiler/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- build/config/compiler/BUILD.gn.orig 2022-03-25 21:59:56 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 -@@ -902,7 +909,7 @@ config("compiler_cpu_abi") { +@@ -908,7 +915,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" ] } -@@ -916,7 +923,7 @@ config("compiler_cpu_abi") { +@@ -922,7 +929,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" ] } -@@ -1237,7 +1244,7 @@ config("compiler_deterministic") { +@@ -1243,7 +1250,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", -@@ -1524,7 +1531,7 @@ config("default_warnings") { +@@ -1533,7 +1540,7 @@ config("default_warnings") { "-Wno-ignored-pragma-optimize", ] - 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" ] } -@@ -1709,7 +1716,7 @@ config("no_chromium_code") { +@@ -1725,7 +1732,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", -@@ -2224,7 +2231,7 @@ config("afdo_optimize_size") { - # between //base/allocator:tcmalloc and AFDO on GCC), so we provide a separate +@@ -2239,7 +2246,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. -@@ -2240,7 +2247,7 @@ config("afdo") { +@@ -2255,7 +2262,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 ] } -@@ -2379,7 +2386,8 @@ config("symbols") { +@@ -2398,7 +2405,8 @@ config("symbols") { } } - if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") { + if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos" && + !is_bsd) { if (is_apple) { # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. # Make sure we don't use constructor homing on mac. diff --git a/www/chromium/files/patch-build_config_rust.gni b/www/chromium/files/patch-build_config_rust.gni index 5dd7ad561eef..88a93d14ee6d 100644 --- a/www/chromium/files/patch-build_config_rust.gni +++ b/www/chromium/files/patch-build_config_rust.gni @@ -1,11 +1,11 @@ ---- build/config/rust.gni.orig 2022-02-07 13:39:41 UTC +--- build/config/rust.gni.orig 2022-03-25 21:59:56 UTC +++ build/config/rust.gni -@@ -84,7 +84,7 @@ if (enable_rust) { - rust_sysroot = get_path_info(rust_sysroot_absolute, "abspath") - use_unverified_rust_toolchain = true +@@ -116,7 +116,7 @@ if (enable_rust) { + rust_sysroot = "//third_party/rust-toolchain" + use_unverified_rust_toolchain = false } else { - if (host_os != "linux") { + if (host_os != "linux" && host_os != "openbsd" && host_os != "freebsd") { - assert( - false, - "Attempt to use standard Rust toolchain on an unsupported platform") + assert(false, + "Attempt to use Android Rust toolchain on an unsupported platform") + } diff --git a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni index e941d6a67687..794335e0a1e6 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-16 08:38:25 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2022-03-25 21:59:56 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). # -@@ -747,13 +754,12 @@ template("gcc_toolchain") { +@@ -771,13 +778,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 88c78da6873d..34a6a620a314 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-02-28 16:54:41 UTC +--- cc/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ cc/BUILD.gn -@@ -660,7 +660,7 @@ cc_test_static_library("test_support") { +@@ -664,7 +664,7 @@ cc_test_static_library("test_support") { if (enable_vulkan) { deps += [ "//gpu/vulkan/init" ] } - if (!is_android) { + if (!is_android && !is_bsd) { data_deps = [ "//third_party/mesa_headers" ] } } -@@ -886,7 +886,6 @@ cc_test("cc_unittests") { +@@ -891,7 +891,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__main__delegate.cc b/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc index 9935801ef7b3..d8ca4ff70b5a 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-02-28 16:54:41 UTC +--- chrome/app/chrome_main_delegate.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/app/chrome_main_delegate.cc -@@ -113,7 +113,7 @@ +@@ -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 -@@ -157,12 +157,12 @@ +@@ -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 -@@ -310,7 +310,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty +@@ -311,7 +311,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 -@@ -350,7 +350,7 @@ bool HandleVersionSwitches(const base::CommandLine& co +@@ -351,7 +351,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) || -@@ -414,7 +414,7 @@ void InitializeUserDataDir(base::CommandLine* command_ +@@ -415,7 +415,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. -@@ -498,7 +498,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat +@@ -499,7 +499,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( -@@ -679,6 +679,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization( +@@ -680,6 +680,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 -@@ -801,7 +803,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -815,7 +817,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 -@@ -832,7 +834,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -846,7 +848,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 -@@ -1146,7 +1148,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1161,7 +1163,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) -@@ -1222,7 +1224,7 @@ absl::variant Chrome +@@ -1237,7 +1239,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 c7410f592b87..bc279203ed4e 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-02-28 16:54:41 UTC +--- chrome/app/chromium_strings.grd.orig 2022-03-25 21:59:56 UTC +++ chrome/app/chromium_strings.grd @@ -298,7 +298,7 @@ If you update this file, be sure also to update google Welcome to Chromium; new browser window opened - + Welcome to Chromium -@@ -810,7 +810,7 @@ Chromium is unable to recover your settings. +@@ -818,7 +818,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. -@@ -936,7 +936,7 @@ Chromium is unable to recover your settings. +@@ -944,7 +944,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 31e633027c98..55cbf9d5130f 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-02-28 16:54:41 UTC +--- chrome/app/generated_resources.grd.orig 2022-03-25 21:59:56 UTC +++ chrome/app/generated_resources.grd @@ -2,7 +2,7 @@ @@ -298,7 +298,7 @@ are declared in tools/grit/grit_rule.gni. - + -@@ -2813,7 +2813,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -2833,7 +2833,7 @@ are declared in tools/grit/grit_rule.gni. - + Device Credentials -@@ -5568,7 +5568,7 @@ Keep your key file in a safe place. You will need it t +@@ -5686,7 +5686,7 @@ Keep your key file in a safe place. You will need it t - + Legacy Browser Support -@@ -8043,7 +8043,7 @@ Keep your key file in a safe place. You will need it t +@@ -8217,7 +8217,7 @@ Keep your key file in a safe place. You will need it t Google Pay - + Use system title bar and borders -@@ -9134,7 +9134,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -9372,7 +9372,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 c257a13fb957..953d11ffebcf 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-02-28 16:54:41 UTC +--- chrome/app/google_chrome_strings.grd.orig 2022-03-25 21:59:56 UTC +++ chrome/app/google_chrome_strings.grd @@ -303,7 +303,7 @@ chromium_strings.grd. --> Welcome to Chrome; new browser window opened - + Welcome to Google Chrome -@@ -818,7 +818,7 @@ Google Chrome is unable to recover your settings. +@@ -863,7 +863,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. -@@ -944,7 +944,7 @@ Google Chrome is unable to recover your settings. +@@ -1012,7 +1012,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 bdec0f7504f8..ddf87266e214 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,11 +1,32 @@ ---- chrome/app/theme/chrome_unscaled_resources.grd.orig 2021-04-14 18:40:52 UTC +--- chrome/app/theme/chrome_unscaled_resources.grd.orig 2022-03-25 21:59:56 UTC +++ chrome/app/theme/chrome_unscaled_resources.grd -@@ -18,7 +18,7 @@ - - - +@@ -15,12 +15,12 @@ + + + +- ++ + + + + - + - - + + + +@@ -52,12 +52,12 @@ + + + +- ++ + + + +- ++ + + + diff --git a/www/chromium/files/patch-chrome_browser_about__flags.cc b/www/chromium/files/patch-chrome_browser_about__flags.cc index e0474b9664a0..6fc32f4e0118 100644 --- a/www/chromium/files/patch-chrome_browser_about__flags.cc +++ b/www/chromium/files/patch-chrome_browser_about__flags.cc @@ -1,137 +1,128 @@ ---- chrome/browser/about_flags.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/about_flags.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/about_flags.cc -@@ -205,7 +205,7 @@ +@@ -206,7 +206,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 -@@ -273,7 +273,7 @@ +@@ -275,7 +275,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) -@@ -360,7 +360,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = { +@@ -362,7 +362,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, -@@ -966,7 +966,7 @@ const FeatureEntry::FeatureVariation kPageContentAnnot +@@ -976,7 +976,7 @@ const FeatureEntry::FeatureVariation kPageContentAnnot }; #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"}, -@@ -3243,7 +3243,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3424,7 +3424,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, -@@ -3648,7 +3648,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3838,7 +3838,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-save-data", flag_descriptions::kEnableSaveDataName, - flag_descriptions::kEnableSaveDataDescription, kOsCrOS | kOsLinux, - SINGLE_VALUE_TYPE( -@@ -3835,7 +3835,7 @@ const FeatureEntry kFeatureEntries[] = { + {"enable-navigation-predictor", + flag_descriptions::kEnableNavigationPredictorName, + flag_descriptions::kEnableNavigationPredictorDescription, +@@ -4031,7 +4031,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kWebShare)}, - #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) + #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)}, -@@ -4518,7 +4518,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4050,7 +4050,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[] = { "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, -@@ -4887,7 +4887,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -5158,7 +5158,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)}, -@@ -5897,7 +5897,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6198,7 +6198,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, -@@ -6607,7 +6607,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -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-brand-consistency-for-desktop", - flag_descriptions::kIncognitoBrandConsistencyForDesktopName, - flag_descriptions::kIncognitoBrandConsistencyForDesktopDescription, -@@ -6740,7 +6740,7 @@ const FeatureEntry kFeatureEntries[] = { + {"incognito-clear-browsing-data-dialog-for-desktop", + flag_descriptions::kIncognitoClearBrowsingDataDialogForDesktopName, + flag_descriptions::kIncognitoClearBrowsingDataDialogForDesktopDescription, +@@ -7037,7 +7037,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)}, -@@ -6985,7 +6985,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7291,7 +7291,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, -@@ -7129,7 +7129,7 @@ const FeatureEntry kFeatureEntries[] = { - #endif - - #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - {"enable-desktop-pwas-app-icon-shortcuts-menu-ui", - flag_descriptions::kDesktopPWAsAppIconShortcutsMenuUIName, - flag_descriptions::kDesktopPWAsAppIconShortcutsMenuUIDescription, -@@ -7685,7 +7685,7 @@ const FeatureEntry kFeatureEntries[] = { - SINGLE_VALUE_TYPE(switches::kPervasiveSystemAccentColor)}, - #endif - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - {"improve-accessibility-tree-using-local-ml", - flag_descriptions::kImproveAccessibilityTreeUsingLocalMLName, - flag_descriptions::kImproveAccessibilityTreeUsingLocalMLDescription, 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 c3e6446c375d..9d687d026580 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-02-28 16:54:41 UTC +--- chrome/browser/background/background_mode_manager.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/background/background_mode_manager.cc -@@ -892,7 +892,7 @@ gfx::ImageSkia GetStatusTrayIcon() { +@@ -899,7 +899,7 @@ gfx::ImageSkia GetStatusTrayIcon() { return gfx::ImageSkia(); return family->CreateExact(size).AsImageSkia(); -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( IDR_PRODUCT_LOGO_128); #elif BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-chrome_browser_browser__features.cc b/www/chromium/files/patch-chrome_browser_browser__features.cc new file mode 100644 index 000000000000..f752e5299fe7 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_browser__features.cc @@ -0,0 +1,11 @@ +--- chrome/browser/browser_features.cc.orig 2022-03-25 21:59:56 UTC ++++ chrome/browser/browser_features.cc +@@ -29,7 +29,7 @@ const base::Feature kColorProviderRedirectionForThemeP + // the browser exits. + const base::Feature kDestroyProfileOnBrowserClose{ + "DestroyProfileOnBrowserClose", +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + base::FEATURE_ENABLED_BY_DEFAULT + }; + #else 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 88bf739e9f2e..3b29a504fb43 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-02-28 16:54:41 UTC +--- chrome/browser/browser_process_impl.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/browser_process_impl.cc -@@ -209,7 +209,7 @@ +@@ -208,7 +208,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() { ApplyMetricsReportingPolicy(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) ChromeJsErrorReportProcessor::Create(); #endif -@@ -1418,7 +1418,7 @@ void BrowserProcessImpl::Unpin() { +@@ -1412,7 +1412,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 14ccde8270cd..bb761eec2995 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-02-28 16:54:41 UTC +--- chrome/browser/browser_process_impl.h.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/browser_process_impl.h -@@ -373,7 +373,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -367,7 +367,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 1d3a0cb745bf..d686bc4e03f0 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,56 +1,71 @@ ---- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/chrome_browser_interface_binders.cc -@@ -97,7 +97,7 @@ +@@ -96,13 +96,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 -@@ -165,7 +165,7 @@ + + #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 @@ #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" -@@ -658,7 +658,7 @@ void PopulateChromeFrameBinders( +@@ -665,7 +665,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)); -@@ -666,7 +666,7 @@ void PopulateChromeFrameBinders( +@@ -673,7 +673,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()) { map->Add( -@@ -706,7 +706,7 @@ void PopulateChromeWebUIFrameBinders( +@@ -714,14 +714,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); -@@ -1013,7 +1013,7 @@ void PopulateChromeWebUIFrameBinders( + #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( #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 ee6b20867dee..829d7ef22170 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-02-28 16:54:41 UTC +--- chrome/browser/chrome_browser_main.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/chrome_browser_main.cc -@@ -228,11 +228,11 @@ +@@ -231,11 +231,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 -@@ -267,7 +267,7 @@ +@@ -270,7 +270,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() { 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() { } #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() { // 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 e7e35569e08c..39e734ef53d2 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,136 +1,159 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/chrome_content_browser_client.cc -@@ -373,7 +373,7 @@ +@@ -374,7 +374,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" -@@ -442,17 +442,17 @@ +@@ -444,17 +444,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" -@@ -461,7 +461,7 @@ +@@ -462,12 +462,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) -@@ -483,11 +483,11 @@ +@@ -489,11 +489,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" -@@ -870,7 +870,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo +@@ -880,7 +880,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; -@@ -1370,7 +1370,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1376,7 +1376,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) -@@ -1404,7 +1404,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1410,7 +1410,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 -@@ -1421,7 +1421,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1427,7 +1427,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()); -@@ -2161,6 +2161,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -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 #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()) { -@@ -2474,7 +2476,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2498,7 +2500,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)) { -@@ -3846,7 +3848,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +@@ -3880,7 +3882,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, -@@ -4258,7 +4260,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4292,14 +4294,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); -@@ -4291,7 +4293,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4332,7 +4334,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle:: MaybeCreateThrottleFor(handle), diff --git a/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h index ff16b8c5387c..89820124902a 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h +++ b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.h @@ -1,11 +1,11 @@ ---- chrome/browser/chrome_content_browser_client.h.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/chrome_content_browser_client.h.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/chrome_content_browser_client.h -@@ -410,7 +410,7 @@ class ChromeContentBrowserClient : public content::Con +@@ -417,7 +417,7 @@ class ChromeContentBrowserClient : public content::Con void OverridePageVisibilityState( content::RenderFrameHost* render_frame_host, content::PageVisibilityState* visibility_state) override; -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) void GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, diff --git a/www/chromium/files/patch-chrome_browser_defaults.cc b/www/chromium/files/patch-chrome_browser_defaults.cc index f7270b716bdd..95e8a8dd3414 100644 --- a/www/chromium/files/patch-chrome_browser_defaults.cc +++ b/www/chromium/files/patch-chrome_browser_defaults.cc @@ -1,11 +1,11 @@ ---- chrome/browser/defaults.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/defaults.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/defaults.cc -@@ -50,7 +50,7 @@ const bool kSyncAutoStarts = false; +@@ -48,7 +48,7 @@ const bool kSyncAutoStarts = true; + const bool kSyncAutoStarts = false; + #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) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const bool kScrollEventChangesTab = true; #else const bool kScrollEventChangesTab = false; 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 e50b9ab03679..61865d43000d 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-02-28 16:54:41 UTC +--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/download/chrome_download_manager_delegate.cc -@@ -1539,7 +1539,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1541,7 +1541,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 -@@ -1608,7 +1608,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe +@@ -1610,7 +1610,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(); } -@@ -1716,7 +1716,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow +@@ -1718,7 +1718,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()) { -@@ -1758,7 +1758,7 @@ std::unique_ptr +@@ -1760,7 +1760,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 -@@ -1774,7 +1774,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAl +@@ -1776,7 +1776,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); 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 de6f03b8595d..d7e0e1b8f2a4 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-02-28 16:54:41 UTC +--- chrome/browser/download/download_item_model.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/download/download_item_model.cc -@@ -636,7 +636,7 @@ bool DownloadItemModel::IsCommandChecked( +@@ -640,7 +640,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(); -@@ -677,7 +677,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand +@@ -681,7 +681,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_extensions_BUILD.gn b/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn index c415a0336962..7f9cc0d5ca15 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn +++ b/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn @@ -1,13 +1,13 @@ ---- chrome/browser/extensions/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/extensions/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/extensions/BUILD.gn -@@ -1298,6 +1298,10 @@ static_library("extensions") { +@@ -1299,6 +1299,10 @@ static_library("extensions") { deps += [ "//chrome/services/printing/public/mojom" ] } + if (is_bsd) { + sources -= [ "api/image_writer_private/removable_storage_provider_linux.cc" ] + } + if (enable_service_discovery) { sources += [ "api/mdns/mdns_api.cc", diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc b/www/chromium/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc index 5e1c8a8a0917..446a4a0e514d 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-02-28 16:54:41 UTC +--- 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 -@@ -181,7 +181,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -182,7 +182,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 -@@ -195,7 +195,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -196,7 +196,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_extensions_external__provider__impl.cc b/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc index ef8769083bb5..ced8d597037c 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/external_provider_impl.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/extensions/external_provider_impl.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/extensions/external_provider_impl.cc -@@ -816,7 +816,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -818,7 +818,7 @@ void ExternalProviderImpl::CreateExternalProviders( if (!profile->GetPrefs()->GetBoolean(pref_names::kBlockExternalExtensions)) { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) provider_list->push_back(std::make_unique( service, base::MakeRefCounted( -@@ -844,7 +844,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -846,7 +846,7 @@ void ExternalProviderImpl::CreateExternalProviders( bundled_extension_creation_flags)); // Define a per-user source of external extensions. -#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ BUILDFLAG(CHROMIUM_BRANDING)) provider_list->push_back(std::make_unique( service, diff --git a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc index 6338e2b7acaa..7083102383fe 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-02-28 16:54:41 UTC +--- chrome/browser/flag_descriptions.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/flag_descriptions.cc -@@ -5323,7 +5323,7 @@ const char kDownloadShelfWebUIDescription[] = +@@ -5508,7 +5508,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 kWebUIBrandingUpdateName[] = "WebUI Branding Update"; - const char kWebUIBrandingUpdateDescription[] = -@@ -5338,7 +5338,7 @@ const char kWebuiFeedbackDescription[] = + const char kWebuiFeedbackName[] = "WebUI Feedback"; + const char kWebuiFeedbackDescription[] = +@@ -5519,7 +5519,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[] = -@@ -5357,7 +5357,7 @@ const char kDesktopDetailedLanguageSettingsDescription - #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || - // BUILDFLAG(IS_FUCHSIA) - --#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - const char kImproveAccessibilityTreeUsingLocalMLName[] = - "Enable improving accessibility tree using local machine learning library."; - const char kImproveAccessibilityTreeUsingLocalMLDescription[] = -@@ -5372,7 +5372,7 @@ const char kWebShareDescription[] = +@@ -5545,7 +5545,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"; -@@ -5384,7 +5384,7 @@ const char kOzonePlatformHintDescription[] = +@@ -5557,7 +5557,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[] = -@@ -5500,7 +5500,7 @@ const char kElasticOverscrollDescription[] = +@@ -5570,7 +5570,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[] = #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 0772dee1e296..c97e0e3503a5 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-02-28 16:54:41 UTC +--- chrome/browser/flag_descriptions.h.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/flag_descriptions.h -@@ -3070,7 +3070,7 @@ extern const char kDownloadShelfWebUIDescription[]; +@@ -3178,7 +3178,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 kWebUIBrandingUpdateName[]; - extern const char kWebUIBrandingUpdateDescription[]; -@@ -3082,7 +3082,7 @@ extern const char kWebuiFeedbackDescription[]; + extern const char kWebuiFeedbackName[]; + extern const char kWebuiFeedbackDescription[]; +@@ -3187,7 +3187,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[]; -@@ -3096,7 +3096,7 @@ extern const char kDesktopDetailedLanguageSettingsDesc - #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || - // defined (OS_FUCHSIA) - --#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) - - extern const char kImproveAccessibilityTreeUsingLocalMLName[]; - extern const char kImproveAccessibilityTreeUsingLocalMLDescription[]; -@@ -3107,7 +3107,7 @@ extern const char kWebShareName[]; +@@ -3206,7 +3206,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[]; -@@ -3197,7 +3197,7 @@ extern const char kElasticOverscrollDescription[]; +@@ -3222,7 +3222,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[]; #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_headless_headless__mode__util.cc b/www/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc index dd8f461c2568..5cc3b96d020b 100644 --- a/www/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc +++ b/www/chromium/files/patch-chrome_browser_headless_headless__mode__util.cc @@ -1,29 +1,29 @@ ---- chrome/browser/headless/headless_mode_util.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/headless/headless_mode_util.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/headless/headless_mode_util.cc @@ -9,7 +9,7 @@ - // Native headless is currently available only on Linux and Windows platforms. + // Native headless is currently available on Linux, Windows and Mac platforms. // More platforms will be added later, so avoid function level clutter by // providing stub implementations at the end of the file. --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include #include @@ -17,7 +17,7 @@ #include "base/base_switches.h" #include "ui/gfx/switches.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/ozone/public/ozone_switches.h" #endif // BUILDFLAG(IS_LINUX) @@ -51,7 +51,7 @@ void SetUpCommandLine(const base::CommandLine* command base::CommandLine::ForCurrentProcess()->AppendSwitch( ::switches::kNoErrorDialogs); } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Native headless chrome on Linux relies on ozone/headless platform. base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( ::switches::kOzonePlatform, switches::kHeadless); diff --git a/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn b/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn index 2d1225b3ad1a..174848de2493 100644 --- a/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn +++ b/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn @@ -1,11 +1,11 @@ ---- chrome/browser/media/router/discovery/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/media/router/discovery/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/media/router/discovery/BUILD.gn -@@ -93,7 +93,7 @@ static_library("discovery") { +@@ -94,7 +94,7 @@ static_library("discovery") { "media_sink_discovery_metrics.h", ] - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !is_bsd) { sources += [ "discovery_network_list_wifi_linux.cc" ] } diff --git a/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc b/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc index e1174816f336..7e2720742be7 100644 --- a/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc +++ b/www/chromium/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc @@ -1,23 +1,23 @@ ---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc -@@ -58,8 +58,10 @@ +@@ -57,8 +57,10 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) +#if !BUILDFLAG(IS_BSD) #include +#endif #include "base/linux_util.h" #include "base/strings/string_split.h" -@@ -224,7 +226,7 @@ void RecordStartupMetrics() { +@@ -223,7 +225,7 @@ void RecordStartupMetrics() { // Record whether Chrome is the default browser or not. // Disabled on Linux due to hanging browser tests, see crbug.com/1216328. -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) shell_integration::DefaultWebClientState default_state = shell_integration::GetDefaultBrowser(); base::UmaHistogramEnumeration("DefaultBrowser.State", default_state, diff --git a/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc b/www/chromium/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc index ec09b0349062..5fba581ad52d 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-02-28 16:54:41 UTC +--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/metrics/chrome_metrics_service_client.cc -@@ -752,7 +752,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -773,7 +773,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()); -@@ -848,7 +848,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -869,7 +869,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) -@@ -1024,7 +1024,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve +@@ -1045,7 +1045,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 58b38715d304..1a0c089e782a 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-02-28 16:54:41 UTC +--- chrome/browser/net/system_network_context_manager.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/net/system_network_context_manager.cc @@ -84,7 +84,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" -@@ -137,7 +137,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut +@@ -144,7 +144,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) -@@ -369,7 +369,7 @@ SystemNetworkContextManager::SystemNetworkContextManag - pref_change_registrar_.Add(prefs::kBasicAuthOverHttpEnabled, +@@ -377,7 +377,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) -@@ -427,7 +427,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe +@@ -437,7 +437,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe registry->RegisterStringPref(prefs::kAuthServerAllowlist, std::string()); registry->RegisterStringPref(prefs::kAuthNegotiateDelegateAllowlist, std::string()); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kAuthNegotiateDelegateByKdcPolicy, false); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) diff --git a/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc b/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc index d57ebf908539..7c7584a02130 100644 --- a/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc +++ b/www/chromium/files/patch-chrome_browser_notifications_notification__display__service__impl.cc @@ -1,38 +1,38 @@ ---- chrome/browser/notifications/notification_display_service_impl.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/notifications/notification_display_service_impl.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/notifications/notification_display_service_impl.cc -@@ -31,7 +31,7 @@ +@@ -32,7 +32,7 @@ #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/send_tab_to_self/desktop_notification_handler.h" #include "chrome/browser/sharing/sharing_notification_handler.h" #endif -@@ -64,7 +64,7 @@ NotificationDisplayServiceImpl* NotificationDisplaySer +@@ -65,7 +65,7 @@ NotificationDisplayServiceImpl* NotificationDisplaySer // static void NotificationDisplayServiceImpl::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kAllowNativeNotifications, true); registry->RegisterBooleanPref(prefs::kAllowSystemNotifications, true); #endif -@@ -81,7 +81,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer +@@ -82,7 +82,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer std::make_unique()); #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) AddNotificationHandler( NotificationHandler::Type::SEND_TAB_TO_SELF, std::make_unique( -@@ -89,7 +89,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer +@@ -90,7 +90,7 @@ NotificationDisplayServiceImpl::NotificationDisplaySer #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) AddNotificationHandler( NotificationHandler::Type::TAILORED_SECURITY, std::make_unique()); diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc b/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc index a70e5774afa5..66e4c89e08ee 100644 --- a/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc +++ b/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc @@ -1,11 +1,11 @@ ---- chrome/browser/performance_monitor/process_metrics_recorder_util.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/performance_monitor/process_metrics_recorder_util.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/performance_monitor/process_metrics_recorder_util.cc -@@ -42,7 +42,7 @@ void RecordProcessHistograms(const char* histogram_suf +@@ -39,7 +39,7 @@ void RecordProcessHistograms(const char* histogram_suf metrics.cpu_usage * kCPUUsageFactor, kCPUUsageHistogramMin, kCPUUsageHistogramMax, kCPUUsageHistogramBucketCount); #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) base::UmaHistogramCounts10000( base::JoinString({"PerformanceMonitor.IdleWakeups.", histogram_suffix}, ""), diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h index d3867265beed..026781f76c1e 100644 --- a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h +++ b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h @@ -1,11 +1,11 @@ ---- chrome/browser/performance_monitor/process_monitor.h.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/performance_monitor/process_monitor.h.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/performance_monitor/process_monitor.h -@@ -56,7 +56,7 @@ class ProcessMonitor { +@@ -52,7 +52,7 @@ class ProcessMonitor { double cpu_usage = 0.0; #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_AIX) + BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Returns the number of average idle cpu wakeups per second since the last // time the metric was sampled. int idle_wakeups = 0; diff --git a/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc b/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc index 17638cef1e0f..4866861223c6 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-02-28 16:54:41 UTC +--- 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 -@@ -1443,7 +1443,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1456,7 +1456,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 }, -@@ -1552,7 +1552,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1565,7 +1565,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)) { key::kChromeAppsEnabled, extensions::pref_names::kChromeAppsEnabled, base::Value::Type::BOOLEAN }, -@@ -1848,7 +1848,7 @@ std::unique_ptr BuildH +@@ -1885,7 +1885,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>( -@@ -2213,7 +2213,7 @@ std::unique_ptr BuildH +@@ -2256,7 +2256,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, -@@ -2244,7 +2244,7 @@ std::unique_ptr BuildH +@@ -2287,7 +2287,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, 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 765d014c725f..93107a4cd271 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,46 @@ ---- chrome/browser/prefs/browser_prefs.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/prefs/browser_prefs.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/prefs/browser_prefs.cc @@ -418,14 +418,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 -@@ -1133,7 +1133,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -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) -@@ -1165,7 +1165,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -1171,7 +1171,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 -@@ -1462,7 +1462,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync +@@ -1469,7 +1469,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_process__singleton__posix.cc b/www/chromium/files/patch-chrome_browser_process__singleton__posix.cc index 66ce87c56787..dcd99fc83110 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-02-28 16:54:41 UTC +--- chrome/browser/process_singleton_posix.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/process_singleton_posix.cc -@@ -97,12 +97,12 @@ +@@ -98,12 +98,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 -@@ -356,7 +356,7 @@ bool DisplayProfileInUseError(const base::FilePath& lo +@@ -357,7 +357,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); -@@ -935,7 +935,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::Notif +@@ -926,7 +926,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::Notif return PROCESS_NONE; } else if (strncmp(buf, kACKToken, base::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 83a59c11089e..16e823150f14 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-02-28 16:54:41 UTC +--- 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 -@@ -385,7 +385,7 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -393,7 +393,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 fad03295c3f7..1a9c1a209dd0 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-20 09:08:36 UTC +--- chrome/browser/profiles/profile_impl.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/profiles/profile_impl.cc -@@ -264,6 +264,10 @@ +@@ -263,6 +263,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; -@@ -850,7 +854,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) +@@ -854,7 +858,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_renderer__preferences__util.cc b/www/chromium/files/patch-chrome_browser_renderer__preferences__util.cc index b85855ca3911..4e1a5b590127 100644 --- a/www/chromium/files/patch-chrome_browser_renderer__preferences__util.cc +++ b/www/chromium/files/patch-chrome_browser_renderer__preferences__util.cc @@ -1,29 +1,29 @@ ---- chrome/browser/renderer_preferences_util.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/renderer_preferences_util.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/renderer_preferences_util.cc -@@ -41,7 +41,7 @@ - #include "ui/base/cocoa/defaults_utils.h" +@@ -37,7 +37,7 @@ + #include "ui/views/controls/textfield/textfield.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 "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "ui/views/linux_ui/linux_ui.h" -@@ -169,7 +169,7 @@ void UpdateFromSystemSettings(blink::RendererPreferenc - prefs->caret_blink_interval = interval; +@@ -159,7 +159,7 @@ void UpdateFromSystemSettings(blink::RendererPreferenc + prefs->caret_blink_interval = views::Textfield::GetCaretBlinkInterval(); #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)) views::LinuxUI* linux_ui = views::LinuxUI::instance(); if (linux_ui) { if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) { -@@ -189,7 +189,7 @@ void UpdateFromSystemSettings(blink::RendererPreferenc +@@ -179,7 +179,7 @@ void UpdateFromSystemSettings(blink::RendererPreferenc #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ - BUILDFLAG(IS_WIN) + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) content::UpdateFontRendererPreferencesFromSystemSettings(prefs); #endif diff --git a/www/chromium/files/patch-chrome_browser_resources_new__tab__page_new__tab__page.js b/www/chromium/files/patch-chrome_browser_resources_new__tab__page_new__tab__page.js deleted file mode 100644 index e82d989ae51f..000000000000 --- a/www/chromium/files/patch-chrome_browser_resources_new__tab__page_new__tab__page.js +++ /dev/null @@ -1,13 +0,0 @@ ---- chrome/browser/resources/new_tab_page/new_tab_page.js.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/resources/new_tab_page/new_tab_page.js -@@ -21,10 +21,6 @@ export {chromeCartDescriptor as chromeCartV2Descriptor - export {DriveProxy} from './modules/drive/drive_module_proxy.js'; - export {driveDescriptor} from './modules/drive/module.js'; - export {driveDescriptor as driveV2Descriptor} from './modules/drive_v2/module.js'; --// --export {FooProxy} from './modules/dummy_v2/foo_proxy.js'; --export {dummyV2Descriptor} from './modules/dummy_v2/module.js'; --// - export {InfoDialogElement} from './modules/info_dialog.js'; - export {InitializeModuleCallback, Module, ModuleDescriptor, ModuleDescriptorV2, ModuleHeight} from './modules/module_descriptor.js'; - export {ModuleHeaderElement} from './modules/module_header.js'; diff --git a/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.ts b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.ts index e928508bc496..39444d6681b1 100644 --- a/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.ts +++ b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.ts @@ -1,51 +1,51 @@ ---- chrome/browser/resources/settings/appearance_page/appearance_page.ts.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/resources/settings/appearance_page/appearance_page.ts.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/resources/settings/appearance_page/appearance_page.ts -@@ -145,7 +145,7 @@ export class SettingsAppearancePageElement extends +@@ -146,7 +146,7 @@ export class SettingsAppearancePageElement extends 'prefs.autogenerated.theme.policy.color.controlledBy)', }, - // + // /** * Whether to show the "Custom Chrome Frame" setting. */ -@@ -167,7 +167,7 @@ export class SettingsAppearancePageElement extends +@@ -168,7 +168,7 @@ export class SettingsAppearancePageElement extends 'themeChanged_(' + 'prefs.extensions.theme.id.value, useSystemTheme_, isForcedTheme_)', - // + // // NOTE: this pref only exists on Linux. 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)', // -@@ -186,7 +186,7 @@ export class SettingsAppearancePageElement extends +@@ -187,7 +187,7 @@ export class SettingsAppearancePageElement extends private showReaderModeOption_: boolean; private isForcedTheme_: boolean; - // + // private showCustomChromeFrame_: boolean; // -@@ -264,7 +264,7 @@ export class SettingsAppearancePageElement extends +@@ -265,7 +265,7 @@ export class SettingsAppearancePageElement extends this.appearanceBrowserProxy_.useDefaultTheme(); } - // + // private useSystemThemePrefChanged_(useSystemTheme: boolean) { this.useSystemTheme_ = useSystemTheme; } -@@ -325,10 +325,10 @@ export class SettingsAppearancePageElement extends +@@ -326,10 +326,10 @@ export class SettingsAppearancePageElement extends } let i18nId; - // + // i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme'; // - // + // i18nId = 'chooseFromWebStore'; // this.themeSublabel_ = this.i18n(i18nId); diff --git a/www/chromium/files/patch-chrome_browser_resources_settings_route.ts b/www/chromium/files/patch-chrome_browser_resources_settings_route.ts index 239ee4522709..65eeddfba783 100644 --- a/www/chromium/files/patch-chrome_browser_resources_settings_route.ts +++ b/www/chromium/files/patch-chrome_browser_resources_settings_route.ts @@ -1,11 +1,11 @@ ---- chrome/browser/resources/settings/route.ts.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/resources/settings/route.ts.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/resources/settings/route.ts -@@ -179,7 +179,7 @@ function createBrowserSettingsRoutes(): SettingsRoutes +@@ -185,7 +185,7 @@ function createBrowserSettingsRoutes(): SettingsRoutes r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); - // + // r.CAPTIONS = r.ACCESSIBILITY.createChild('/captions'); // diff --git a/www/chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc b/www/chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc index 2fa19a4b6262..6d6d4fe52a48 100644 --- a/www/chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc +++ b/www/chromium/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc @@ -1,29 +1,29 @@ ---- chrome/browser/safe_browsing/download_protection/file_analyzer.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/safe_browsing/download_protection/file_analyzer.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/safe_browsing/download_protection/file_analyzer.cc -@@ -20,7 +20,7 @@ - #include "components/safe_browsing/core/common/features.h" +@@ -21,7 +21,7 @@ #include "content/public/browser/browser_thread.h" + #include "url/gurl.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) | BUILDFLAG(IS_BSD) #include "chrome/browser/safe_browsing/download_protection/document_analysis_service.h" #endif -@@ -101,7 +101,7 @@ void FileAnalyzer::Start(const base::FilePath& target_ +@@ -102,7 +102,7 @@ void FileAnalyzer::Start(const base::FilePath& target_ } else if (inspection_type == DownloadFileType::DMG) { StartExtractDmgFeatures(); #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) } else if (base::FeatureList::IsEnabled( safe_browsing::kClientSideDetectionDocumentScanning) && inspection_type == DownloadFileType::OFFICE_DOCUMENT) { -@@ -285,7 +285,7 @@ void FileAnalyzer::OnDmgAnalysisFinished( +@@ -286,7 +286,7 @@ void FileAnalyzer::OnDmgAnalysisFinished( } #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) void FileAnalyzer::StartExtractDocumentFeatures() { DCHECK_CURRENTLY_ON(BrowserThread::UI); diff --git a/www/chromium/files/patch-chrome_browser_signin_signin__util.cc b/www/chromium/files/patch-chrome_browser_signin_signin__util.cc index 7498200c5c59..155a3866bc82 100644 --- a/www/chromium/files/patch-chrome_browser_signin_signin__util.cc +++ b/www/chromium/files/patch-chrome_browser_signin_signin__util.cc @@ -1,11 +1,11 @@ ---- chrome/browser/signin/signin_util.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/signin/signin_util.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/signin/signin_util.cc -@@ -41,7 +41,7 @@ +@@ -39,7 +39,7 @@ #include "ui/base/l10n/l10n_util.h" #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list_observer.h" 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 e2c334970d8b..67f14188e656 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-02-28 16:54:41 UTC +--- chrome/browser/sync/chrome_sync_client.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/sync/chrome_sync_client.cc -@@ -420,7 +420,7 @@ ChromeSyncClient::CreateDataTypeControllers(syncer::Sy +@@ -412,7 +412,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( diff --git a/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc b/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc index d54f4fe80196..9c460e043f12 100644 --- a/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc +++ b/www/chromium/files/patch-chrome_browser_themes_theme__helper.cc @@ -1,11 +1,11 @@ ---- chrome/browser/themes/theme_helper.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/themes/theme_helper.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/themes/theme_helper.cc -@@ -334,7 +334,7 @@ bool ThemeHelper::ShouldUseIncreasedContrastThemeSuppl +@@ -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_ui_browser__command__controller.cc b/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc index c7a539c74fcd..4af07b967491 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,38 @@ ---- chrome/browser/ui/browser_command_controller.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/browser_command_controller.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/browser_command_controller.cc @@ -88,7 +88,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 -@@ -274,7 +274,7 @@ bool BrowserCommandController::IsReservedCommandOrKey( +@@ -277,7 +277,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 = -@@ -510,7 +510,7 @@ bool BrowserCommandController::ExecuteCommandWithDispo +@@ -513,7 +513,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; -@@ -1026,7 +1026,7 @@ void BrowserCommandController::InitCommandState() { +@@ -1040,7 +1040,7 @@ void BrowserCommandController::InitCommandState() { #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_MAXIMIZE_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_RESTORE_WINDOW, true); diff --git a/www/chromium/files/patch-chrome_browser_ui_chrome__pages.cc b/www/chromium/files/patch-chrome_browser_ui_chrome__pages.cc new file mode 100644 index 000000000000..00681b177e21 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_chrome__pages.cc @@ -0,0 +1,11 @@ +--- chrome/browser/ui/chrome_pages.cc.orig 2022-03-25 21:59:56 UTC ++++ chrome/browser/ui/chrome_pages.cc +@@ -550,7 +550,7 @@ void ShowBrowserSigninOrSettings(Browser* browser, + #endif + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + void ShowWebAppSettings(Browser* browser, + const std::string& app_id, + web_app::AppSettingsPageEntryPoint entry_point) { diff --git a/www/chromium/files/patch-chrome_browser_ui_chrome__pages.h b/www/chromium/files/patch-chrome_browser_ui_chrome__pages.h new file mode 100644 index 000000000000..e6adadd0d937 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_chrome__pages.h @@ -0,0 +1,20 @@ +--- chrome/browser/ui/chrome_pages.h.orig 2022-03-25 21:59:56 UTC ++++ chrome/browser/ui/chrome_pages.h +@@ -26,7 +26,7 @@ + #endif + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + #include "chrome/browser/web_applications/web_app_utils.h" + #endif + +@@ -201,7 +201,7 @@ void ShowBrowserSigninOrSettings(Browser* browser, + #endif + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + // Show chrome://app-settings/ 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 new file mode 100644 index 000000000000..05d1cac6218b --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc @@ -0,0 +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 +@@ -6,7 +6,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) + void AddNativeChromeColorMixer(ui::ColorProvider* provider, + const ui::ColorProviderManager::Key& key) {} + #endif diff --git a/www/chromium/files/patch-chrome_browser_ui_signin__view__controller.cc b/www/chromium/files/patch-chrome_browser_ui_signin__view__controller.cc index ee0af9eba9ff..b8873227ec81 100644 --- a/www/chromium/files/patch-chrome_browser_ui_signin__view__controller.cc +++ b/www/chromium/files/patch-chrome_browser_ui_signin__view__controller.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/signin_view_controller.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/signin_view_controller.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/signin_view_controller.cc -@@ -253,7 +253,7 @@ void SigninViewController::ShowModalEnterpriseConfirma +@@ -259,7 +259,7 @@ void SigninViewController::ShowModalEnterpriseConfirma SkColor profile_color, base::OnceCallback callback) { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) + BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) CloseModalSignin(); dialog_ = std::make_unique( SigninViewControllerDelegate::CreateEnterpriseConfirmationDelegate( diff --git a/www/chromium/files/patch-chrome_browser_ui_signin_dice__web__signin__interceptor__delegate.cc b/www/chromium/files/patch-chrome_browser_ui_signin_dice__web__signin__interceptor__delegate.cc deleted file mode 100644 index 8b528e8d6035..000000000000 --- a/www/chromium/files/patch-chrome_browser_ui_signin_dice__web__signin__interceptor__delegate.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/ui/signin/dice_web_signin_interceptor_delegate.cc.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/ui/signin/dice_web_signin_interceptor_delegate.cc -@@ -66,7 +66,7 @@ class ForcedEnterpriseSigninInterceptionHandle - void ShowEnterpriseProfileInterceptionDialog(const AccountInfo& account_info, - SkColor profile_color) { - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_CHROMEOS_LACROS) -+ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) - if (base::FeatureList::IsEnabled(kAccountPoliciesLoadedWithoutSync)) { - browser_->signin_view_controller()->ShowModalEnterpriseConfirmationDialog( - account_info, profile_color, 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 2ab25d68304d..3e4464ffd50b 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,53 @@ ---- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/startup/startup_browser_creator.cc -@@ -124,12 +124,12 @@ +@@ -126,12 +126,12 @@ #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 -@@ -414,7 +414,7 @@ bool MaybeLaunchAppShortcutWindow(const base::CommandL +@@ -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, -@@ -908,7 +908,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -989,7 +989,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) && -@@ -1057,7 +1057,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( - - if (command_line.HasSwitch(switches::kAppId)) { +@@ -1181,7 +1181,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)) -@@ -1094,7 +1094,7 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( +@@ -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 cbc3b83a1620..2fbc462f0e52 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-02-28 16:54:41 UTC +--- chrome/browser/ui/tab_helpers.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/tab_helpers.cc -@@ -178,7 +178,7 @@ +@@ -179,7 +179,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" -@@ -495,13 +495,13 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con +@@ -500,13 +500,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) || -@@ -512,7 +512,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_con +@@ -517,7 +517,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) - if (Browser* browser = chrome::FindBrowserWithProfile(profile)) { - SharedHighlightingPromo::CreateForWebContents(web_contents, browser); - } + SharedHighlightingPromo::CreateForWebContents(web_contents); + #endif + 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 ac49ba40e61b..a9b4237c6880 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-02-28 16:54:41 UTC +--- 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 -@@ -146,7 +146,7 @@ bool BrowserDesktopWindowTreeHostLinux::SupportsClient +@@ -150,7 +150,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 09d242c51b33..2028f88f4f13 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-02-28 16:54:41 UTC +--- chrome/browser/ui/views/frame/browser_frame.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/views/frame/browser_frame.cc -@@ -48,11 +48,11 @@ +@@ -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 -@@ -61,7 +61,7 @@ namespace { +@@ -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; -@@ -263,7 +263,7 @@ void BrowserFrame::OnNativeWidgetWorkspaceChanged() { +@@ -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() -@@ -386,7 +386,7 @@ void BrowserFrame::SelectNativeTheme() { - } +@@ -381,7 +381,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 -@@ -405,7 +405,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( +@@ -400,7 +400,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 df9a5321a462..91d32afee5d1 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-02-28 16:54:41 UTC +--- chrome/browser/ui/views/frame/browser_view.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -1750,7 +1750,7 @@ void BrowserView::TabDraggingStatusChanged(bool is_dra +@@ -1825,7 +1825,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_profile__menu__view__base.cc b/www/chromium/files/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc index d24d754243c8..c0e369a2dd4b 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/profiles/profile_menu_view_base.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -612,7 +612,7 @@ void ProfileMenuViewBase::SetProfileIdentityInfo( +@@ -611,7 +611,7 @@ void ProfileMenuViewBase::SetProfileIdentityInfo( // 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) // crbug.com/1161166: Orca does not read the accessible window title of the // bubble, so we duplicate it in the top-level menu item. To be revisited // after considering other options, including fixes on the AT side. 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 addcc9063f22..81ac51b1a358 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-02-28 16:54:41 UTC +--- 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 -@@ -117,7 +117,7 @@ SigninViewControllerDelegateViews::CreateProfileCustom +@@ -137,7 +137,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( -@@ -392,7 +392,7 @@ SigninViewControllerDelegate::CreateProfileCustomizati +@@ -413,7 +413,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_tabs_tab.cc b/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc index 801819e17c4e..f80771e5ce24 100644 --- a/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc +++ b/www/chromium/files/patch-chrome_browser_ui_views_tabs_tab.cc @@ -1,11 +1,11 @@ ---- chrome/browser/ui/views/tabs/tab.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/views/tabs/tab.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/views/tabs/tab.cc -@@ -576,7 +576,7 @@ void Tab::MaybeUpdateHoverStatus(const ui::MouseEvent& +@@ -580,7 +580,7 @@ void Tab::MaybeUpdateHoverStatus(const ui::MouseEvent& if (mouse_hovered_ || !GetWidget()->IsMouseEventsEnabled()) return; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Move the hit test area for hovering up so that it is not overlapped by tab // hover cards when they are shown. // TODO(crbug.com/978134): Once Linux/CrOS widget transparency is solved, diff --git a/www/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 79840ce9979a..d5c91c4f6357 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,29 @@ ---- chrome/browser/ui/views/tabs/tab_drag_controller.cc.orig 2022-02-28 16:54:41 UTC +--- 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 -@@ -468,7 +468,7 @@ void TabDragController::Init(TabDragContext* source_co +@@ -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()); -@@ -916,7 +916,7 @@ TabDragController::DragBrowserToNewTabStrip(TabDragCon +@@ -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. -@@ -2128,7 +2128,7 @@ TabDragController::Liveness TabDragController::GetLoca +@@ -2350,7 +2350,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_webui_about__ui.cc b/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc index 462a0554c9df..a9339afa548c 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-02-28 16:54:41 UTC +--- chrome/browser/ui/webui/about_ui.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/webui/about_ui.cc -@@ -656,7 +656,7 @@ std::string ChromeURLs() { +@@ -603,7 +603,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, -@@ -712,7 +712,7 @@ void AboutUIHTMLSource::StartDataRequest( +@@ -661,7 +661,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 24ef0bb1f1df..e1a965b96501 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,86 +1,98 @@ ---- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2022-02-28 16:54:41 UTC +--- 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 -@@ -284,7 +284,7 @@ +@@ -296,7 +296,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 -@@ -308,17 +308,17 @@ +@@ -320,22 +320,22 @@ #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 -@@ -611,7 +611,7 @@ bool IsAboutUI(const GURL& url) { + #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) { #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) -@@ -1003,7 +1003,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1073,7 +1073,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 -@@ -1061,7 +1061,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1131,7 +1131,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) -@@ -1117,22 +1117,22 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* we +@@ -1187,27 +1187,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 1c770743ed20..7dc963f872dd 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,29 @@ ---- chrome/browser/ui/webui/ntp/app_launcher_handler.cc.orig 2022-03-16 08:38:25 UTC +--- 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 -@@ -310,7 +310,7 @@ void AppLauncherHandler::CreateExtensionInfo(const Ext +@@ -313,7 +313,7 @@ void AppLauncherHandler::CreateExtensionInfo(const Ext base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)); 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) is_deprecated_app = extensions::IsExtensionUnsupportedDeprecatedApp( extension_service_->GetBrowserContext(), extension->id()); #endif -@@ -739,7 +739,7 @@ void AppLauncherHandler::HandleLaunchApp(const base::L +@@ -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; -@@ -1332,7 +1332,7 @@ void AppLauncherHandler::InstallOsHooks(const web_app: +@@ -1348,7 +1348,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 782c04267d74..2803fbb72c77 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-02-28 16:54:41 UTC +--- chrome/browser/ui/webui/settings/appearance_handler.cc.orig 2022-03-25 21:59:56 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_BSD)) && !BUILDFLAG(IS_CHROMEOS_LACROS) - web_ui()->RegisterDeprecatedMessageCallback( ++#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(const ba +@@ -45,7 +45,7 @@ void AppearanceHandler::HandleUseDefaultTheme(base::Va // 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) - void AppearanceHandler::HandleUseSystemTheme(const base::ListValue* args) { ++#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) + void AppearanceHandler::HandleUseSystemTheme(base::Value::ConstListView 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 f0f8a86ec04f..23be49002df4 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-02-28 16:54:41 UTC +--- chrome/browser/ui/webui/settings/appearance_handler.h.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/webui/settings/appearance_handler.h -@@ -44,7 +44,7 @@ class AppearanceHandler : public SettingsPageUIHandler +@@ -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(const base::ListValue* args); + void HandleUseSystemTheme(base::Value::ConstListView 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 9e7eb20c1b60..950e3ff547c5 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-02-28 16:54:41 UTC +--- 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 -@@ -117,7 +117,7 @@ +@@ -118,7 +118,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 -@@ -137,7 +137,7 @@ +@@ -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 -@@ -370,7 +370,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -371,7 +371,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}, -@@ -378,7 +378,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -379,7 +379,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) -@@ -399,7 +399,7 @@ void AddAppearanceStrings(content::WebUIDataSource* ht +@@ -400,7 +400,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 index 5177cb1f8fb5..016bc2901d72 100644 --- 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 @@ -1,20 +1,20 @@ ---- chrome/browser/ui/webui/settings/settings_ui.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/browser/ui/webui/settings/settings_ui.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/ui/webui/settings/settings_ui.cc -@@ -141,7 +141,7 @@ +@@ -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" -@@ -245,7 +245,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) +@@ -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_externally__managed__app__install__task.cc b/www/chromium/files/patch-chrome_browser_web__applications_externally__managed__app__install__task.cc deleted file mode 100644 index 8a5cd71c584c..000000000000 --- a/www/chromium/files/patch-chrome_browser_web__applications_externally__managed__app__install__task.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/web_applications/externally_managed_app_install_task.cc.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/web_applications/externally_managed_app_install_task.cc -@@ -363,7 +363,7 @@ void ExternallyManagedAppInstallTask::OnWebAppInstalle - const WebApp* web_app = registrar_->GetAppById(app_id); - options.os_hooks[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[OsHookType::kUrlHandlers] = true; - #else diff --git a/www/chromium/files/patch-chrome_browser_web__applications_web__app__file__handler__registration.h b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h similarity index 69% rename from www/chromium/files/patch-chrome_browser_web__applications_web__app__file__handler__registration.h rename to www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h index 0e4ff5c7c04c..a1594b05528e 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_web__app__file__handler__registration.h +++ b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h @@ -1,11 +1,11 @@ ---- chrome/browser/web_applications/web_app_file_handler_registration.h.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/web_applications/web_app_file_handler_registration.h +--- chrome/browser/web_applications/os_integration/web_app_file_handler_registration.h.orig 2022-03-25 21:59:56 UTC ++++ chrome/browser/web_applications/os_integration/web_app_file_handler_registration.h @@ -44,7 +44,7 @@ void UnregisterFileHandlersWithOs(const AppId& app_id, Profile* profile, ResultCallback callback); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Exposed for testing purposes. Register the set of // MIME-type-to-file-extensions mappings corresponding to |file_handlers|. File // I/O and a a callout to the Linux shell are performed asynchronously. diff --git a/www/chromium/files/patch-chrome_browser_web__applications_web__app__shortcut.cc b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc similarity index 89% rename from www/chromium/files/patch-chrome_browser_web__applications_web__app__shortcut.cc rename to www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc index 8bfe2aad8808..b883934bf2f7 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_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/web_app_shortcut.cc.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/web_applications/web_app_shortcut.cc +--- 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 @@ -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 #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 diff --git a/www/chromium/files/patch-chrome_browser_web__applications_web__app__shortcut.h b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h similarity index 75% rename from www/chromium/files/patch-chrome_browser_web__applications_web__app__shortcut.h rename to www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h index e4c212a51b62..95ff8d0f3cba 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_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/web_app_shortcut.h.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/web_applications/web_app_shortcut.h +--- 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 @@ -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/web_app_shortcut_linux.h" + #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; #endif }; @@ -89,7 +89,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__shortcut__manager.cc b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut__manager.cc similarity index 77% rename from www/chromium/files/patch-chrome_browser_web__applications_web__app__shortcut__manager.cc rename to www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut__manager.cc index edf893e6ed24..5ecbbf680c84 100644 --- a/www/chromium/files/patch-chrome_browser_web__applications_web__app__shortcut__manager.cc +++ b/www/chromium/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut__manager.cc @@ -1,20 +1,20 @@ ---- chrome/browser/web_applications/web_app_shortcut_manager.cc.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/web_applications/web_app_shortcut_manager.cc +--- chrome/browser/web_applications/os_integration/web_app_shortcut_manager.cc.orig 2022-03-25 21:59:56 UTC ++++ chrome/browser/web_applications/os_integration/web_app_shortcut_manager.cc @@ -35,7 +35,7 @@ namespace web_app { namespace { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Aligns with other platform implementations that only support 10 items. constexpr int kMaxApplicationDockMenuItems = 10; #endif // BUILDFLAG(IS_LINUX) @@ -382,7 +382,7 @@ std::unique_ptr WebAppShortcutManager::B } } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const std::vector& shortcuts_menu_item_infos = app->shortcuts_menu_item_infos(); int num_entries = std::min(static_cast(shortcuts_menu_item_infos.size()), diff --git a/www/chromium/files/patch-chrome_browser_web__applications_web__app__install__task.cc b/www/chromium/files/patch-chrome_browser_web__applications_web__app__install__task.cc deleted file mode 100644 index 967e60092ef1..000000000000 --- a/www/chromium/files/patch-chrome_browser_web__applications_web__app__install__task.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/web_applications/web_app_install_task.cc.orig 2022-02-28 16:54:41 UTC -+++ chrome/browser/web_applications/web_app_install_task.cc -@@ -915,7 +915,7 @@ void WebAppInstallTask::OnInstallFinalizedCreateShortc - 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[OsHookType::kUrlHandlers] = true; - #else 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 883bdc4cb29b..c8adf7fc3093 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-02-28 16:54:41 UTC +--- chrome/browser/web_applications/web_app_provider.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/browser/web_applications/web_app_provider.cc -@@ -281,7 +281,7 @@ void WebAppProvider::CreateSubsystems(Profile* profile +@@ -289,7 +289,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 new file mode 100644 index 000000000000..dbcce37ca6dd --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc @@ -0,0 +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 +@@ -749,7 +749,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 687a0039eb93..bbc280979435 100644 --- a/www/chromium/files/patch-chrome_common_chrome__features.cc +++ b/www/chromium/files/patch-chrome_common_chrome__features.cc @@ -1,101 +1,92 @@ ---- chrome/common/chrome_features.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/common/chrome_features.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/common/chrome_features.cc -@@ -113,7 +113,7 @@ const base::Feature kAsyncDns { +@@ -105,7 +105,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", -@@ -128,7 +128,7 @@ const base::Feature kAutofillPasswordSurvey{"AutofillP +@@ -120,7 +120,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. -@@ -145,7 +145,7 @@ const base::Feature kBorealis{"Borealis", base::FEATUR +@@ -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. -@@ -258,7 +258,7 @@ const base::Feature kPreinstalledWebAppInstallation{ - #endif - - #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ -- BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - // Enables Desktop PWAs shortcuts menu to be visible and executable in ChromeOS, - // MacOS and Linux. - const base::Feature kDesktopPWAsAppIconShortcutsMenuUI{ -@@ -305,7 +305,7 @@ const base::Feature kDesktopPWAsNotificationIconAndTit +@@ -298,7 +298,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 -@@ -339,7 +339,7 @@ const base::FeatureParam kDisableHttpDiskCacheMem +@@ -320,7 +320,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{ 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 -@@ -361,7 +361,7 @@ const base::FeatureParam kDnsOverHttpsFallbackPa +@@ -352,7 +352,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 -@@ -608,7 +608,7 @@ const base::Feature kImmersiveFullscreen{"ImmersiveFul - base::FEATURE_DISABLED_BY_DEFAULT}; - #endif - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - const base::Feature kImproveAccessibilityTreeUsingLocalML{ - "ImproveAccessibilityTreeUsingLocalML", base::FEATURE_DISABLED_BY_DEFAULT}; - #endif -@@ -645,7 +645,7 @@ const base::Feature kIncognitoNtpRevamp{"IncognitoNtpR +@@ -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{ -@@ -681,7 +681,7 @@ const base::Feature kLinkCapturingUiUpdate{"LinkCaptur +@@ -658,7 +658,7 @@ const base::Feature kLinkCapturingUiUpdate{"LinkCaptur 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}; -@@ -694,7 +694,7 @@ constexpr base::FeatureParam kLinuxLowMemoryMonit +@@ -671,7 +671,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 d4dd4115b750..3b67fb09a8e2 100644 --- a/www/chromium/files/patch-chrome_common_chrome__features.h +++ b/www/chromium/files/patch-chrome_common_chrome__features.h @@ -1,74 +1,65 @@ ---- chrome/common/chrome_features.h.orig 2022-02-28 16:54:41 UTC +--- chrome/common/chrome_features.h.orig 2022-03-25 21:59:56 UTC +++ chrome/common/chrome_features.h -@@ -95,7 +95,7 @@ extern const base::Feature kArcPiGhostWindow; +@@ -90,7 +90,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) -@@ -104,7 +104,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -99,7 +99,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 -@@ -186,7 +186,7 @@ extern const base::Feature kPreinstalledWebAppInstalla - #endif +@@ -219,7 +219,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) + extern const base::Feature kDesktopPWAsWebBundles; - #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kDesktopPWAsAppIconShortcutsMenuUI; - #endif -@@ -410,7 +410,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kImmersiveFullscreen; - #endif - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) - COMPONENT_EXPORT(CHROME_FEATURES) - extern const base::Feature kImproveAccessibilityTreeUsingLocalML; + extern const base::Feature kDesktopPWAsWebAppSettingsPage; #endif -@@ -435,7 +435,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -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; -@@ -462,7 +462,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -452,7 +452,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kLinkCapturingUiUpdate; #endif -#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) +#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kLinuxLowMemoryMonitor; COMPONENT_EXPORT(CHROME_FEATURES) -@@ -471,7 +471,7 @@ COMPONENT_EXPORT(CHROME_FEATURES) +@@ -461,7 +461,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 b4e70028f87d..e1f38716831e 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-02-28 16:54:41 UTC +--- chrome/common/chrome_paths.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/common/chrome_paths.cc @@ -44,14 +44,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) { 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; -@@ -411,10 +411,12 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -407,10 +407,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 -@@ -426,7 +428,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -422,7 +424,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; -@@ -434,7 +436,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -430,7 +432,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; -@@ -479,7 +481,7 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -475,7 +477,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) -@@ -493,6 +495,9 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -489,6 +491,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__switches.cc b/www/chromium/files/patch-chrome_common_chrome__switches.cc index d210de79a0fa..ab6024cfaf34 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-02-28 16:54:41 UTC +--- chrome/common/chrome_switches.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/common/chrome_switches.cc -@@ -790,14 +790,14 @@ const char kAllowNaClSocketAPI[] = "allow-n +@@ -794,14 +794,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 ad091d68a2c5..829297f466f5 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-02-28 16:54:41 UTC +--- chrome/common/chrome_switches.h.orig 2022-03-25 21:59:56 UTC +++ chrome/common/chrome_switches.h -@@ -247,12 +247,12 @@ extern const char kAllowNaClSocketAPI[]; +@@ -248,12 +248,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_extensions_command.cc b/www/chromium/files/patch-chrome_common_extensions_command.cc index 1bfcbdc3573a..aeafe29aa10f 100644 --- a/www/chromium/files/patch-chrome_common_extensions_command.cc +++ b/www/chromium/files/patch-chrome_common_extensions_command.cc @@ -1,11 +1,11 @@ ---- chrome/common/extensions/command.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/common/extensions/command.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/common/extensions/command.cc -@@ -294,7 +294,7 @@ std::string Command::CommandPlatform() { +@@ -295,7 +295,7 @@ std::string Command::CommandPlatform() { return values::kKeybindingPlatformMac; #elif BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) return values::kKeybindingPlatformChromeOs; -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return values::kKeybindingPlatformLinux; #else return ""; diff --git a/www/chromium/files/patch-chrome_common_pref__names.cc b/www/chromium/files/patch-chrome_common_pref__names.cc index 5a5f6a362d4f..53d06c28dee5 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-02-28 16:54:41 UTC +--- chrome/common/pref_names.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/common/pref_names.cc -@@ -1194,7 +1194,7 @@ const char kUseAshProxy[] = "lacros.proxy.use_ash_prox +@@ -1188,7 +1188,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 -@@ -1297,7 +1297,7 @@ const char kShowUpdatePromotionInfoBar[] = +@@ -1291,7 +1291,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"; -@@ -1776,7 +1776,7 @@ const char kDownloadDefaultDirectory[] = "download.def +@@ -1780,7 +1780,7 @@ const char kDownloadDefaultDirectory[] = "download.def const char kDownloadDirUpgraded[] = "download.directory_upgrade"; #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 -@@ -2065,7 +2065,7 @@ const char kWebAppsPreferences[] = "web_apps.web_app_i +@@ -2069,7 +2069,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"; -@@ -2193,7 +2193,7 @@ const char kAmbientAuthenticationInPrivateModesEnabled +@@ -2199,7 +2199,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[] = -@@ -3117,7 +3117,7 @@ const char kBlockAutoplayEnabled[] = "media.block_auto +@@ -3129,7 +3129,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 357f824911bc..fb5c6a3b3159 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-02-28 16:54:41 UTC +--- chrome/common/pref_names.h.orig 2022-03-25 21:59:56 UTC +++ chrome/common/pref_names.h -@@ -375,7 +375,7 @@ extern const char kUseAshProxy[]; +@@ -372,7 +372,7 @@ extern const char kUseAshProxy[]; #endif // BUILDFLAG(IS_CHROMEOS_LACROS) // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) extern const char kUsesSystemTheme[]; #endif extern const char kCurrentThemePackFilename[]; -@@ -404,7 +404,7 @@ extern const char kShowUpdatePromotionInfoBar[]; +@@ -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) -@@ -587,7 +587,7 @@ extern const char kDownloadExtensionsToOpenByPolicy[]; +@@ -584,7 +584,7 @@ extern const char kDownloadExtensionsToOpenByPolicy[]; extern const char kDownloadAllowedURLsForOpenByPolicy[]; extern const char kDownloadDirUpgraded[]; #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) -@@ -694,7 +694,7 @@ extern const char kWebAppsUninstalledDefaultChromeApps +@@ -691,7 +691,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 -@@ -834,7 +834,7 @@ extern const char kGloballyScopeHTTPAuthCacheEnabled[] +@@ -830,7 +830,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[]; #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_webui__url__constants.cc b/www/chromium/files/patch-chrome_common_webui__url__constants.cc index d4d4fff2e595..dd1a55383bf2 100644 --- a/www/chromium/files/patch-chrome_common_webui__url__constants.cc +++ b/www/chromium/files/patch-chrome_common_webui__url__constants.cc @@ -1,81 +1,94 @@ ---- chrome/common/webui_url_constants.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/common/webui_url_constants.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/common/webui_url_constants.cc -@@ -428,18 +428,18 @@ const char kOsUIFlagsURL[] = "os://flags"; +@@ -434,18 +434,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) 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 -@@ -454,14 +454,14 @@ const char kChromeUILinuxProxyConfigHost[] = "linux-pr +@@ -460,14 +460,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[] = -@@ -476,7 +476,7 @@ const char kChromeUIProfilePickerUrl[] = "chrome://pro +@@ -482,7 +482,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"; -@@ -668,18 +668,18 @@ const char* const kChromeHostURLs[] = { +@@ -554,7 +554,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) -@@ -736,7 +736,7 @@ const char* const kChromeDebugURLs[] = { +@@ -749,7 +749,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 2c6b78cbd6b5..333baaec3462 100644 --- a/www/chromium/files/patch-chrome_common_webui__url__constants.h +++ b/www/chromium/files/patch-chrome_common_webui__url__constants.h @@ -1,50 +1,57 @@ ---- chrome/common/webui_url_constants.h.orig 2022-02-28 16:54:41 UTC +--- chrome/common/webui_url_constants.h.orig 2022-03-25 21:59:56 UTC +++ chrome/common/webui_url_constants.h -@@ -371,18 +371,18 @@ extern const char kOsUIFlagsURL[]; +@@ -371,24 +371,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) 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 -@@ -397,14 +397,14 @@ extern const char kChromeUILinuxProxyConfigHost[]; + + #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[]; #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID) + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) extern const char kChromeUISandboxHost[]; #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || \ - (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) extern const char kChromeUIBrowserSwitchHost[]; extern const char kChromeUIBrowserSwitchURL[]; extern const char kChromeUIEnterpriseProfileWelcomeHost[]; -@@ -416,7 +416,7 @@ extern const char kChromeUIProfilePickerUrl[]; +@@ -422,7 +422,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_services_printing_print__backend__service__impl.cc b/www/chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc index 1aea771027f4..09b6a65ee30b 100644 --- a/www/chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc +++ b/www/chromium/files/patch-chrome_services_printing_print__backend__service__impl.cc @@ -1,11 +1,11 @@ ---- chrome/services/printing/print_backend_service_impl.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/services/printing/print_backend_service_impl.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/services/printing/print_backend_service_impl.cc -@@ -484,7 +484,7 @@ void PrintBackendServiceImpl::UpdatePrintSettings( +@@ -510,7 +510,7 @@ void PrintBackendServiceImpl::UpdatePrintSettings( crash_keys_ = 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) // Try to fill in advanced settings based upon basic info options. PrinterBasicInfo basic_info; if (print_backend_->GetPrinterBasicInfo(printer_name, &basic_info) == diff --git a/www/chromium/files/patch-chrome_test_BUILD.gn b/www/chromium/files/patch-chrome_test_BUILD.gn index 37cdecf1bd06..ef240340c679 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-02-28 16:54:41 UTC +--- chrome/test/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ chrome/test/BUILD.gn -@@ -8875,7 +8875,7 @@ test("chrome_app_unittests") { +@@ -9110,7 +9110,7 @@ test("chrome_app_unittests") { "//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__launcher.cc b/www/chromium/files/patch-chrome_test_chromedriver_chrome__launcher.cc index a920f49fe691..59ffc8813111 100644 --- a/www/chromium/files/patch-chrome_test_chromedriver_chrome__launcher.cc +++ b/www/chromium/files/patch-chrome_test_chromedriver_chrome__launcher.cc @@ -1,10 +1,10 @@ ---- chrome/test/chromedriver/chrome_launcher.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/test/chromedriver/chrome_launcher.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/test/chromedriver/chrome_launcher.cc @@ -65,6 +65,7 @@ #include #include #include +#include #include - #elif defined(OS_WIN) + #elif BUILDFLAG(IS_WIN) #include "chrome/test/chromedriver/keycode_text_conversion.h" 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 d41492804116..f138044f8a19 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-02-07 13:39:41 UTC +--- chrome/test/chromedriver/chrome/chrome_finder.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/test/chromedriver/chrome/chrome_finder.cc @@ -54,7 +54,7 @@ void GetApplicationDirs(std::vector* l installation_locations[i].Append(L"Chromium\\Application")); } } --#elif defined(OS_LINUX) || defined(OS_CHROMEOS) -+#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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) { base::FilePath browser_exes_array[] = { - #if defined(OS_WIN) || defined(OS_MAC) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) base::FilePath(chrome::kBrowserProcessExecutablePath), --#elif defined(OS_LINUX) || defined(OS_CHROMEOS) -+#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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_test_chromedriver_key__converter__unittest.cc b/www/chromium/files/patch-chrome_test_chromedriver_key__converter__unittest.cc index 8ddfbfa1ce14..656e8e79e233 100644 --- a/www/chromium/files/patch-chrome_test_chromedriver_key__converter__unittest.cc +++ b/www/chromium/files/patch-chrome_test_chromedriver_key__converter__unittest.cc @@ -1,20 +1,20 @@ ---- chrome/test/chromedriver/key_converter_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/test/chromedriver/key_converter_unittest.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/test/chromedriver/key_converter_unittest.cc @@ -246,7 +246,7 @@ TEST(KeyConverter, ToggleModifiers) { CheckEventsReleaseModifiers(keys, key_events); } --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Fails on bots: crbug.com/174962 #define MAYBE_AllEnglishKeyboardSymbols DISABLED_AllEnglishKeyboardSymbols #else @@ -303,7 +303,7 @@ TEST(KeyConverter, AllEnglishKeyboardTextChars) { TEST(KeyConverter, AllSpecialWebDriverKeysOnEnglishKeyboard) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); const char kTextForKeys[] = { --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) 0, 0, 0, 0, '\t', 0, '\r', '\r', 0, 0, 0, 0, 0, #else 0, 0, 0, 0, 0, 0, '\r', '\r', 0, 0, 0, 0, 0, diff --git a/www/chromium/files/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc b/www/chromium/files/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc index c0bf08adb434..1f0b694f1ee4 100644 --- a/www/chromium/files/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc +++ b/www/chromium/files/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc @@ -1,20 +1,20 @@ ---- chrome/test/chromedriver/keycode_text_conversion_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/test/chromedriver/keycode_text_conversion_unittest.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/test/chromedriver/keycode_text_conversion_unittest.cc @@ -64,7 +64,7 @@ std::string ConvertKeyCodeToTextNoError(ui::KeyboardCo // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Fails on bots: crbug.com/174962 #define MAYBE_KeyCodeToText DISABLED_KeyCodeToText #else @@ -101,7 +101,7 @@ TEST(KeycodeTextConversionTest, MAYBE_KeyCodeToText) { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Fails on bots: crbug.com/174962 #define MAYBE_CharToKeyCode DISABLED_CharToKeyCode #else 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 5918f61e7b11..d423ee18e7ba 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-02-28 16:54:41 UTC +--- chrome/updater/app/app_install.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/updater/app/app_install.cc -@@ -155,7 +155,7 @@ void AppInstall::WakeCandidate() { +@@ -166,7 +166,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_configurator.cc b/www/chromium/files/patch-chrome_updater_configurator.cc index b7adbc5066fc..2802860a344c 100644 --- a/www/chromium/files/patch-chrome_updater_configurator.cc +++ b/www/chromium/files/patch-chrome_updater_configurator.cc @@ -1,11 +1,11 @@ ---- chrome/updater/configurator.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/updater/configurator.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/updater/configurator.cc -@@ -37,7 +37,7 @@ +@@ -39,7 +39,7 @@ #include "chrome/updater/win/net/network.h" #elif BUILDFLAG(IS_MAC) #include "chrome/updater/mac/net/network.h" -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/updater/linux/net/network.h" #endif diff --git a/www/chromium/files/patch-chrome_updater_updater.cc b/www/chromium/files/patch-chrome_updater_updater.cc index a584273c3288..ef2077e3a396 100644 --- a/www/chromium/files/patch-chrome_updater_updater.cc +++ b/www/chromium/files/patch-chrome_updater_updater.cc @@ -1,11 +1,11 @@ ---- chrome/updater/updater.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/updater/updater.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/updater/updater.cc -@@ -38,7 +38,7 @@ +@@ -41,7 +41,7 @@ #include "chrome/updater/win/win_util.h" #elif BUILDFLAG(IS_MAC) #include "chrome/updater/app/server/mac/server.h" -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/updater/app/server/linux/server.h" #endif diff --git a/www/chromium/files/patch-chrome_updater_util.cc b/www/chromium/files/patch-chrome_updater_util.cc index aecad70b06c4..9bd0f87d8112 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-02-28 16:54:41 UTC +--- chrome/updater/util.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/updater/util.cc -@@ -219,7 +219,7 @@ GURL AppendQueryParameter(const GURL& url, +@@ -253,7 +253,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 a39bda018943..85d42621c26b 100644 --- a/www/chromium/files/patch-chrome_utility_services.cc +++ b/www/chromium/files/patch-chrome_utility_services.cc @@ -1,29 +1,29 @@ ---- chrome/utility/services.cc.orig 2022-02-28 16:54:41 UTC +--- chrome/utility/services.cc.orig 2022-03-25 21:59:56 UTC +++ chrome/utility/services.cc -@@ -64,7 +64,7 @@ +@@ -63,7 +63,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 -@@ -218,7 +218,7 @@ auto RunCupsIppParser( +@@ -216,7 +216,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& 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 8d74b6fbcf89..3ca48b9601e4 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-02-28 16:54:41 UTC +--- chromecast/browser/cast_browser_main_parts.cc.orig 2022-03-25 21:59:56 UTC +++ chromecast/browser/cast_browser_main_parts.cc -@@ -94,7 +94,7 @@ +@@ -93,7 +93,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 -@@ -149,7 +149,7 @@ +@@ -148,7 +148,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 -@@ -285,7 +285,7 @@ class CastViewsDelegate : public views::ViewsDelegate +@@ -284,7 +284,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()); -@@ -331,7 +331,7 @@ const DefaultCommandLineSwitch kDefaultSwitches[] = { +@@ -330,7 +330,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. -@@ -523,7 +523,7 @@ void CastBrowserMainParts::ToolkitInitialized() { +@@ -522,7 +522,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)) { -@@ -757,7 +757,7 @@ int CastBrowserMainParts::PreMainMessageLoopRun() { +@@ -753,7 +753,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 -@@ -832,7 +832,7 @@ void CastBrowserMainParts::PostMainMessageLoopRun() { +@@ -828,7 +828,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 143f7dc5e906..5528c5790596 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-02-28 16:54:41 UTC +--- chromecast/browser/cast_content_browser_client.cc.orig 2022-03-25 21:59:56 UTC +++ chromecast/browser/cast_content_browser_client.cc -@@ -133,7 +133,7 @@ +@@ -135,7 +135,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 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 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-chromecast_browser_cast__content__browser__client__receiver__bindings.cc b/www/chromium/files/patch-chromecast_browser_cast__content__browser__client__receiver__bindings.cc index cc85c5c0e2da..c93e5a2299f5 100644 --- a/www/chromium/files/patch-chromecast_browser_cast__content__browser__client__receiver__bindings.cc +++ b/www/chromium/files/patch-chromecast_browser_cast__content__browser__client__receiver__bindings.cc @@ -1,20 +1,20 @@ ---- chromecast/browser/cast_content_browser_client_receiver_bindings.cc.orig 2022-02-28 16:54:41 UTC +--- chromecast/browser/cast_content_browser_client_receiver_bindings.cc.orig 2022-03-25 21:59:56 UTC +++ chromecast/browser/cast_content_browser_client_receiver_bindings.cc @@ -35,7 +35,7 @@ #include "media/mojo/services/media_service.h" // nogncheck #endif // BUILDFLAG(ENABLE_CAST_RENDERER) -#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/js_channel_service.h" #include "chromecast/common/mojom/js_channel.mojom.h" #endif -@@ -227,7 +227,7 @@ void CastContentBrowserClient::RunServiceInstance( +@@ -234,7 +234,7 @@ void CastContentBrowserClient::RunServiceInstance( void CastContentBrowserClient::BindHostReceiverForRenderer( content::RenderProcessHost* render_process_host, mojo::GenericPendingReceiver receiver) { -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) if (auto r = receiver.As<::chromecast::mojom::JsChannelBindingProvider>()) { JsChannelService::Create(render_process_host, std::move(r), base::ThreadTaskRunnerHandle::Get()); diff --git a/www/chromium/files/patch-chromecast_renderer_cast__content__renderer__client.cc b/www/chromium/files/patch-chromecast_renderer_cast__content__renderer__client.cc index 24d77aa10902..f9aa34f1cb55 100644 --- a/www/chromium/files/patch-chromecast_renderer_cast__content__renderer__client.cc +++ b/www/chromium/files/patch-chromecast_renderer_cast__content__renderer__client.cc @@ -1,11 +1,11 @@ ---- chromecast/renderer/cast_content_renderer_client.cc.orig 2022-02-28 16:54:41 UTC +--- chromecast/renderer/cast_content_renderer_client.cc.orig 2022-03-25 21:59:56 UTC +++ chromecast/renderer/cast_content_renderer_client.cc -@@ -193,7 +193,7 @@ void CastContentRendererClient::RenderFrameCreated( +@@ -194,7 +194,7 @@ void CastContentRendererClient::RenderFrameCreated( dispatcher->OnRenderFrameCreated(render_frame); #endif -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_OZONE) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(USE_OZONE) // JsChannelBindings destroys itself when the RenderFrame is destroyed. JsChannelBindings::Create(render_frame); #endif 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 0eb22282bd0e..ad18ab3a2896 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-02-28 16:54:41 UTC +--- components/autofill/core/browser/personal_data_manager.cc.orig 2022-03-25 21:59:56 UTC +++ components/autofill/core/browser/personal_data_manager.cc -@@ -2107,7 +2107,8 @@ bool PersonalDataManager::ShouldShowCardsFromAccountOp +@@ -1986,7 +1986,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 086f5b3bfaa3..43daab06c93c 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-02-28 16:54:41 UTC +--- components/autofill/core/common/autofill_payments_features.cc.orig 2022-03-25 21:59:56 UTC +++ components/autofill/core/common/autofill_payments_features.cc -@@ -180,7 +180,7 @@ const base::Feature kAutofillUpstreamAllowAllEmailDoma +@@ -192,7 +192,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__configurations.cc b/www/chromium/files/patch-components_feature__engagement_public_feature__configurations.cc index e06c94beb79b..1209be8e6a89 100644 --- a/www/chromium/files/patch-components_feature__engagement_public_feature__configurations.cc +++ b/www/chromium/files/patch-components_feature__engagement_public_feature__configurations.cc @@ -1,21 +1,21 @@ ---- components/feature_engagement/public/feature_configurations.cc.orig 2022-02-28 16:54:41 UTC +--- components/feature_engagement/public/feature_configurations.cc.orig 2022-03-25 21:59:56 UTC +++ components/feature_engagement/public/feature_configurations.cc @@ -35,7 +35,7 @@ FeatureConfig CreateAlwaysTriggerConfig(const base::Fe absl::optional GetClientSideFeatureConfig( const base::Feature* feature) { #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (kIPHPasswordsAccountStorageFeature.name == feature->name) { absl::optional config = FeatureConfig(); config->valid = true; -@@ -721,7 +721,8 @@ absl::optional GetClientSideFeatureConf +@@ -834,7 +834,8 @@ absl::optional GetClientSideFeatureConf #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_BSD) if (kIPHAutofillVirtualCardSuggestionFeature.name == feature->name) { // A config that allows the virtual card credit card suggestion IPH to be // shown when: diff --git a/www/chromium/files/patch-components_feature__engagement_public_feature__constants.cc b/www/chromium/files/patch-components_feature__engagement_public_feature__constants.cc index b99b22929ef7..045eadf3725f 100644 --- a/www/chromium/files/patch-components_feature__engagement_public_feature__constants.cc +++ b/www/chromium/files/patch-components_feature__engagement_public_feature__constants.cc @@ -1,20 +1,20 @@ ---- components/feature_engagement/public/feature_constants.cc.orig 2022-02-28 16:54:41 UTC +--- components/feature_engagement/public/feature_constants.cc.orig 2022-03-25 21:59:56 UTC +++ components/feature_engagement/public/feature_constants.cc @@ -22,7 +22,7 @@ const base::Feature kIPHDummyFeature{"IPH_Dummy", base::FEATURE_DISABLED_BY_DEFAULT}; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) const base::Feature kIPHDesktopSharedHighlightingFeature{ "IPH_DesktopSharedHighlighting", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kIPHDesktopTabGroupsNewGroupFeature{ -@@ -274,7 +274,7 @@ const base::Feature kIPHDiscoverFeedHeaderFeature{ - "IPH_DiscoverFeedHeaderMenu", base::FEATURE_DISABLED_BY_DEFAULT}; +@@ -286,7 +286,7 @@ const base::Feature kIPHDefaultSiteViewFeature{ + "IPH_DefaultSiteView", base::FEATURE_DISABLED_BY_DEFAULT}; #endif // BUILDFLAG(IS_IOS) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) const base::Feature kIPHAutofillVirtualCardSuggestionFeature{ "IPH_AutofillVirtualCardSuggestion", base::FEATURE_ENABLED_BY_DEFAULT}; diff --git a/www/chromium/files/patch-components_feature__engagement_public_feature__constants.h b/www/chromium/files/patch-components_feature__engagement_public_feature__constants.h index bdd278b1f3b3..bece36b428e3 100644 --- a/www/chromium/files/patch-components_feature__engagement_public_feature__constants.h +++ b/www/chromium/files/patch-components_feature__engagement_public_feature__constants.h @@ -1,20 +1,20 @@ ---- components/feature_engagement/public/feature_constants.h.orig 2022-02-28 16:54:41 UTC +--- components/feature_engagement/public/feature_constants.h.orig 2022-03-25 21:59:56 UTC +++ components/feature_engagement/public/feature_constants.h @@ -30,7 +30,7 @@ extern const base::Feature kUseClientConfigIPH; extern const base::Feature kIPHDummyFeature; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) extern const base::Feature kIPHDesktopSharedHighlightingFeature; extern const base::Feature kIPHDesktopTabGroupsNewGroupFeature; extern const base::Feature kIPHFocusHelpBubbleScreenReaderPromoFeature; -@@ -169,7 +169,7 @@ extern const base::Feature kIPHBadgedTranslateManualTr - extern const base::Feature kIPHDiscoverFeedHeaderFeature; +@@ -174,7 +174,7 @@ extern const base::Feature kIPHDiscoverFeedHeaderFeatu + extern const base::Feature kIPHDefaultSiteViewFeature; #endif // BUILDFLAG(IS_IOS) -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) extern const base::Feature kIPHAutofillVirtualCardSuggestionFeature; extern const base::Feature kIPHUpdatedConnectionSecurityIndicatorsFeature; 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 66db364cfcf7..2104017f79d2 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-02-28 16:54:41 UTC +--- components/feature_engagement/public/feature_list.cc.orig 2022-03-25 21:59:56 UTC +++ components/feature_engagement/public/feature_list.cc -@@ -117,7 +117,7 @@ const base::Feature* const kAllFeatures[] = { - &kIPHDiscoverFeedHeaderFeature, +@@ -121,7 +121,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, -@@ -138,7 +138,8 @@ const base::Feature* const kAllFeatures[] = { +@@ -143,7 +143,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 c037ef9cd66f..c69822ee6d85 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-02-28 16:54:41 UTC +--- components/feature_engagement/public/feature_list.h.orig 2022-03-25 21:59:56 UTC +++ components/feature_engagement/public/feature_list.h -@@ -223,7 +223,7 @@ DEFINE_VARIATION_PARAM(kIPHDiscoverFeedHeaderFeature, +@@ -224,7 +224,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"); -@@ -252,7 +252,8 @@ DEFINE_VARIATION_PARAM(kIPHDesktopSharedHighlightingFe +@@ -254,7 +254,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) || -@@ -356,7 +357,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation - VARIATION_ENTRY(kIPHBadgedTranslateManualTriggerFeature), +@@ -359,7 +360,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), -@@ -378,7 +379,8 @@ constexpr flags_ui::FeatureEntry::FeatureVariation +@@ -382,7 +383,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_feed__network__impl__unittest.cc b/www/chromium/files/patch-components_feed_core_v2_feed__network__impl__unittest.cc new file mode 100644 index 000000000000..fe893d3cd63c --- /dev/null +++ b/www/chromium/files/patch-components_feed_core_v2_feed__network__impl__unittest.cc @@ -0,0 +1,13 @@ +--- components/feed/core/v2/feed_network_impl_unittest.cc.orig 2022-03-25 21:59:56 UTC ++++ components/feed/core/v2/feed_network_impl_unittest.cc +@@ -678,8 +678,8 @@ TEST_F(FeedNetworkTest, SendApiRequest_DecodesClientIn + + EXPECT_EQ(feedwire::ClientInfo::CHROME_ANDROID, client_info.app_type()); + EXPECT_EQ(feedwire::Version::RELEASE, client_info.app_version().build_type()); +- EXPECT_EQ(1, client_info.app_version().major()); +- EXPECT_EQ(2, client_info.app_version().minor()); ++ EXPECT_EQ(1, client_info.app_version().gmajor()); ++ EXPECT_EQ(2, client_info.app_version().gminor()); + EXPECT_EQ(3, client_info.app_version().build()); + EXPECT_EQ(4, client_info.app_version().revision()); + EXPECT_FALSE(client_info.chrome_client_info().start_surface()); 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 1417eaed0cb7..edb981e358cd 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-02-28 16:54:41 UTC +--- components/feed/core/v2/test/proto_printer.cc.orig 2022-03-25 21:59:56 UTC +++ components/feed/core/v2/test/proto_printer.cc -@@ -158,8 +158,8 @@ class TextProtoPrinter { +@@ -157,8 +157,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_flags__ui_flags__state.cc b/www/chromium/files/patch-components_flags__ui_flags__state.cc index 565a4fa973a8..9883288acc3f 100644 --- a/www/chromium/files/patch-components_flags__ui_flags__state.cc +++ b/www/chromium/files/patch-components_flags__ui_flags__state.cc @@ -1,11 +1,11 @@ ---- components/flags_ui/flags_state.cc.orig 2022-02-28 16:54:41 UTC +--- components/flags_ui/flags_state.cc.orig 2022-03-25 21:59:56 UTC +++ components/flags_ui/flags_state.cc -@@ -654,7 +654,7 @@ unsigned short FlagsState::GetCurrentPlatform() { +@@ -622,7 +622,7 @@ unsigned short FlagsState::GetCurrentPlatform() { #elif BUILDFLAG(IS_CHROMEOS_ASH) return kOsCrOS; #elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ - BUILDFLAG(IS_OPENBSD) + BUILDFLAG(IS_BSD) return kOsLinux; #elif BUILDFLAG(IS_ANDROID) return kOsAndroid; 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 efed2428c33e..9eae1a5f4628 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-02-28 16:54:41 UTC +--- 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 -@@ -775,7 +775,7 @@ TEST_F(NetworkSessionConfiguratorTest, HostRules) { +@@ -776,7 +776,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_password__manager_core_browser_login__database.cc b/www/chromium/files/patch-components_password__manager_core_browser_login__database.cc index 29b53c8ff4a1..fa4bd12efa86 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-02-28 16:54:41 UTC +--- components/password_manager/core/browser/login_database.cc.orig 2022-03-25 21:59:56 UTC +++ components/password_manager/core/browser/login_database.cc -@@ -645,7 +645,7 @@ std::string GeneratePlaceholders(size_t count) { +@@ -664,7 +664,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) { -@@ -662,7 +662,7 @@ PasswordForm GetFormForRemoval(sql::Statement& stateme +@@ -681,7 +681,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; -@@ -1473,7 +1473,7 @@ bool LoginDatabase::DeleteAndRecreateDatabaseFile() { +@@ -1488,7 +1488,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_sync_password__sync__bridge.cc b/www/chromium/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc index d69fe4423148..26498c7c7e42 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,11 +1,20 @@ ---- components/password_manager/core/browser/sync/password_sync_bridge.cc.orig 2022-02-28 16:54:41 UTC +--- 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 -@@ -181,7 +181,7 @@ bool ShouldRecoverPasswordsDuringMerge() { +@@ -185,7 +185,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() { + } + + 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 90c56fa6a632..e65ec45dff2b 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,20 +1,29 @@ ---- components/password_manager/core/common/password_manager_features.cc.orig 2022-02-28 16:54:41 UTC +--- 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 -@@ -133,7 +133,7 @@ const base::Feature kReparseServerPredictionsFollowing +@@ -63,7 +63,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 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 = { -@@ -145,7 +145,7 @@ const base::Feature kSkipUndecryptablePasswords = { +@@ -157,7 +157,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 7015043a1e54..d0cc356e9793 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,16 +1,25 @@ ---- components/password_manager/core/common/password_manager_features.h.orig 2022-02-28 16:54:41 UTC +--- 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 -@@ -41,11 +41,11 @@ extern const base::Feature kPasswordScriptsFetching; +@@ -27,7 +27,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; 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 - extern const base::Feature kTreatNewPasswordHeuristicsAsReliable; + #if BUILDFLAG(IS_ANDROID) diff --git a/www/chromium/files/patch-components_performance__manager_features.cc b/www/chromium/files/patch-components_performance__manager_features.cc index 2fe2b7ab26f1..7b2cf0e5cd42 100644 --- a/www/chromium/files/patch-components_performance__manager_features.cc +++ b/www/chromium/files/patch-components_performance__manager_features.cc @@ -1,11 +1,11 @@ ---- components/performance_manager/features.cc.orig 2022-02-28 16:54:41 UTC +--- components/performance_manager/features.cc.orig 2022-03-25 21:59:56 UTC +++ components/performance_manager/features.cc -@@ -22,7 +22,7 @@ const base::Feature kUrgentDiscardingFromPerformanceMa +@@ -21,7 +21,7 @@ const base::Feature kUrgentDiscardingFromPerformanceMa "UrgentDiscardingFromPerformanceManager", // Ash Chrome uses memory pressure evaluator instead of performance manager to // discard tabs. -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) base::FEATURE_DISABLED_BY_DEFAULT #else base::FEATURE_ENABLED_BY_DEFAULT diff --git a/www/chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc b/www/chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc index bc5c13d1421c..0a9241a18d31 100644 --- a/www/chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc +++ b/www/chromium/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc @@ -1,11 +1,11 @@ ---- components/policy/core/browser/policy_pref_mapping_test.cc.orig 2022-02-28 16:54:41 UTC +--- components/policy/core/browser/policy_pref_mapping_test.cc.orig 2022-03-25 21:59:56 UTC +++ components/policy/core/browser/policy_pref_mapping_test.cc -@@ -340,7 +340,7 @@ class PolicyTestCase { +@@ -342,7 +342,7 @@ class PolicyTestCase { const std::string os("chromeos_lacros"); #elif BUILDFLAG(IS_IOS) const std::string os("ios"); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const std::string os("linux"); #elif BUILDFLAG(IS_MAC) const std::string os("mac"); diff --git a/www/chromium/files/patch-components_policy_core_common_cloud_cloud__policy__client.cc b/www/chromium/files/patch-components_policy_core_common_cloud_cloud__policy__client.cc index 65851aa0cb0a..2e38c9d03cc8 100644 --- a/www/chromium/files/patch-components_policy_core_common_cloud_cloud__policy__client.cc +++ b/www/chromium/files/patch-components_policy_core_common_cloud_cloud__policy__client.cc @@ -1,11 +1,11 @@ ---- components/policy/core/common/cloud/cloud_policy_client.cc.orig 2022-02-28 16:54:41 UTC +--- components/policy/core/common/cloud/cloud_policy_client.cc.orig 2022-03-25 21:59:56 UTC +++ components/policy/core/common/cloud/cloud_policy_client.cc -@@ -419,7 +419,7 @@ void CloudPolicyClient::FetchPolicy() { +@@ -417,7 +417,7 @@ void CloudPolicyClient::FetchPolicy() { fetch_request->set_invalidation_payload(invalidation_payload_); } } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Only set browser device identifier for CBCM Chrome cloud policy on // desktop. if (base::FeatureList::IsEnabled( 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 2bf0187772d6..00a3ac1a04ec 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-02-28 16:54:41 UTC +--- components/policy/resources/policy_templates.json.orig 2022-03-25 21:59:56 UTC +++ components/policy/resources/policy_templates.json -@@ -1410,7 +1410,7 @@ +@@ -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, -@@ -2512,7 +2512,7 @@ +@@ -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, -@@ -4244,7 +4244,7 @@ +@@ -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, -@@ -4273,7 +4273,7 @@ +@@ -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, -@@ -5187,7 +5187,7 @@ +@@ -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, -@@ -5248,7 +5248,7 @@ +@@ -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, -@@ -5314,7 +5314,7 @@ +@@ -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, -@@ -10099,7 +10099,7 @@ +@@ -10460,7 +10460,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, -@@ -10193,7 +10193,7 @@ +@@ -10554,7 +10554,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, -@@ -12163,7 +12163,7 @@ +@@ -12551,7 +12551,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, -@@ -13021,7 +13021,7 @@ +@@ -13409,7 +13409,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, -@@ -19891,7 +19891,7 @@ +@@ -20284,7 +20284,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, -@@ -19922,7 +19922,7 @@ +@@ -20315,7 +20315,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-'], 'deprecated': True, 'features': { 'can_be_recommended': False, -@@ -19956,7 +19956,7 @@ +@@ -20349,7 +20349,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, -@@ -20694,7 +20694,7 @@ +@@ -21087,7 +21087,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, -@@ -24924,7 +24924,7 @@ +@@ -25361,7 +25361,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, -@@ -26266,7 +26266,7 @@ If this policy is left unset, privacy screen is disabl +@@ -26703,7 +26703,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-'], 'features': { 'dynamic_refresh': True, 'per_profile': True, -@@ -26290,7 +26290,7 @@ If set to False, $1Google +@@ -26727,7 +26727,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, -@@ -27357,7 +27357,7 @@ If you disable this policy, web page scrolling to spec +@@ -27796,7 +27796,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, -@@ -28593,7 +28593,7 @@ When this policy is set, $2 +@@ -29032,7 +29032,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, -@@ -28726,7 +28726,7 @@ When this policy is set, $2 +@@ -29165,7 +29165,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_policy_tools_generate__policy__source.py b/www/chromium/files/patch-components_policy_tools_generate__policy__source.py index 59fcf22771d0..c73eaa782933 100644 --- a/www/chromium/files/patch-components_policy_tools_generate__policy__source.py +++ b/www/chromium/files/patch-components_policy_tools_generate__policy__source.py @@ -1,14 +1,14 @@ ---- components/policy/tools/generate_policy_source.py.orig 2022-02-28 16:54:41 UTC +--- components/policy/tools/generate_policy_source.py.orig 2022-03-25 21:59:56 UTC +++ components/policy/tools/generate_policy_source.py -@@ -48,8 +48,10 @@ PLATFORM_STRINGS = { +@@ -49,8 +49,10 @@ PLATFORM_STRINGS = { 'ios': ['ios'], 'chrome.win': ['win'], 'chrome.linux': ['linux'], + 'chrome.openbsd': ['openbsd'], + 'chrome.freebsd': ['freebsd'], 'chrome.mac': ['mac'], - 'chrome.*': ['win', 'mac', 'linux', 'fuchsia'], + 'chrome.*': ['win', 'mac', 'linux', 'fuchsia', 'openbsd', 'freebsd'], 'chrome.win7': ['win'], } diff --git a/www/chromium/files/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc b/www/chromium/files/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc index 99528878ff75..92f539f394ef 100644 --- a/www/chromium/files/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc +++ b/www/chromium/files/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc @@ -1,11 +1,11 @@ ---- components/safe_browsing/content/common/file_type_policies_unittest.cc.orig 2022-02-28 16:54:41 UTC +--- components/safe_browsing/content/common/file_type_policies_unittest.cc.orig 2022-03-25 21:59:56 UTC +++ components/safe_browsing/content/common/file_type_policies_unittest.cc -@@ -137,7 +137,7 @@ TEST_F(FileTypePoliciesTest, UnpackResourceBundle) { +@@ -139,7 +139,7 @@ TEST_F(FileTypePoliciesTest, UnpackResourceBundle) { EXPECT_EQ(DownloadFileType::FULL_PING, file_type.ping_setting()); // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) EXPECT_EQ(DownloadFileType::ALLOW_ON_USER_GESTURE, file_type.platform_settings(0).danger_level()); EXPECT_EQ(DownloadFileType::DISALLOW_AUTO_OPEN, diff --git a/www/chromium/files/patch-components_translate_core_common_translate__util.cc b/www/chromium/files/patch-components_translate_core_common_translate__util.cc index a3eb057ee635..4900fdacbfee 100644 --- a/www/chromium/files/patch-components_translate_core_common_translate__util.cc +++ b/www/chromium/files/patch-components_translate_core_common_translate__util.cc @@ -1,11 +1,11 @@ ---- components/translate/core/common/translate_util.cc.orig 2022-02-28 16:54:41 UTC +--- components/translate/core/common/translate_util.cc.orig 2022-03-25 21:59:56 UTC +++ components/translate/core/common/translate_util.cc -@@ -29,7 +29,7 @@ const base::Feature kTranslateSubFrames{"TranslateSubF +@@ -34,7 +34,7 @@ const base::Feature kTranslateSubFrames{"TranslateSubF const base::Feature kTFLiteLanguageDetectionEnabled{ "TFLiteLanguageDetectionEnabled", #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \ -- BUILDFLAG(IS_MAC) -+ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) +- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT diff --git a/www/chromium/files/patch-components_viz_common_features.cc b/www/chromium/files/patch-components_viz_common_features.cc index 932c678c81ce..b02fcace4727 100644 --- a/www/chromium/files/patch-components_viz_common_features.cc +++ b/www/chromium/files/patch-components_viz_common_features.cc @@ -1,11 +1,11 @@ ---- components/viz/common/features.cc.orig 2022-02-28 16:54:41 UTC +--- components/viz/common/features.cc.orig 2022-03-25 21:59:56 UTC +++ components/viz/common/features.cc -@@ -64,7 +64,7 @@ const base::Feature kUseSkiaRenderer { +@@ -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 bbc943db0a0b..469d430a5dbd 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-02-28 16:54:41 UTC +--- 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 -@@ -1162,7 +1162,7 @@ GrBackendFormat SkiaOutputSurfaceImpl::GetGrBackendFor +@@ -1171,7 +1171,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-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc b/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc index 766f57bd5ff3..c517b2b3498c 100644 --- a/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc +++ b/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc @@ -1,20 +1,20 @@ ---- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc.orig 2022-03-16 08:38:25 UTC +--- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc.orig 2022-03-25 21:59:56 UTC +++ components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc -@@ -61,7 +61,7 @@ RootCompositorFrameSinkImpl::Create( +@@ -97,7 +97,7 @@ RootCompositorFrameSinkImpl::Create( // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // For X11, we need notify client about swap completion after resizing, so the // client can use it for synchronize with X11 WM. output_surface->SetNeedsSwapSizeNotifications(true); -@@ -526,7 +526,7 @@ void RootCompositorFrameSinkImpl::DisplayDidCompleteSw +@@ -569,7 +569,7 @@ void RootCompositorFrameSinkImpl::DisplayDidCompleteSw display_client_->DidCompleteSwapWithSize(pixel_size); // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) if (display_client_ && pixel_size != last_swap_pixel_size_) { last_swap_pixel_size_ = pixel_size; display_client_->DidCompleteSwapWithNewSize(last_swap_pixel_size_); diff --git a/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h b/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h index de2571e33adf..d7edfe42c46e 100644 --- a/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h +++ b/www/chromium/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h @@ -1,11 +1,11 @@ ---- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h.orig 2022-02-28 16:54:41 UTC +--- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h.orig 2022-03-25 21:59:56 UTC +++ components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h -@@ -189,7 +189,7 @@ class VIZ_SERVICE_EXPORT RootCompositorFrameSinkImpl +@@ -196,7 +196,7 @@ class VIZ_SERVICE_EXPORT RootCompositorFrameSinkImpl // 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) gfx::Size last_swap_pixel_size_; #endif diff --git a/www/chromium/files/patch-content_app_content__main.cc b/www/chromium/files/patch-content_app_content__main.cc index eab8b277ef8a..55ca38650404 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-02-28 16:54:41 UTC +--- content/app/content_main.cc.orig 2022-03-25 21:59:56 UTC +++ content/app/content_main.cc -@@ -252,7 +252,7 @@ RunContentProcess(ContentMainParams params, - #endif +@@ -254,7 +254,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_app_content__main__runner__impl.cc b/www/chromium/files/patch-content_app_content__main__runner__impl.cc index e948fb0ebca3..a7f2d06d96eb 100644 --- a/www/chromium/files/patch-content_app_content__main__runner__impl.cc +++ b/www/chromium/files/patch-content_app_content__main__runner__impl.cc @@ -1,127 +1,120 @@ ---- content/app/content_main_runner_impl.cc.orig 2022-02-28 16:54:41 UTC +--- content/app/content_main_runner_impl.cc.orig 2022-03-25 21:59:56 UTC +++ content/app/content_main_runner_impl.cc @@ -130,13 +130,13 @@ #include "base/posix/global_descriptors.h" #include "content/public/common/content_descriptors.h" -#if !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) #include "content/public/common/zygote/zygote_fork_delegate_linux.h" #endif #endif // BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "base/native_library.h" #include "base/rand_util.h" #include "content/public/common/zygote/sandbox_support_linux.h" @@ -170,6 +170,10 @@ #include "media/base/media_switches.h" #endif +#if BUILDFLAG(IS_BSD) +#include "base/system/sys_info.h" +#endif + #if BUILDFLAG(IS_ANDROID) #include "base/system/sys_info.h" #include "components/power_scheduler/power_scheduler.h" -@@ -335,7 +339,7 @@ void InitializeZygoteSandboxForBrowserProcess( +@@ -340,7 +344,7 @@ void InitializeZygoteSandboxForBrowserProcess( } #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #if BUILDFLAG(ENABLE_PLUGINS) // Loads the (native) libraries but does not initialize them (i.e., does not -@@ -371,11 +375,14 @@ void PreloadLibraryCdms() { +@@ -376,7 +380,7 @@ void PreloadLibraryCdms() { } #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) -#if BUILDFLAG(USE_ZYGOTE_HANDLE) +#if BUILDFLAG(USE_ZYGOTE_HANDLE) || BUILDFLAG(IS_BSD) void PreSandboxInit() { -+ // arc4random -+#if !BUILDFLAG(IS_BSD) // Pre-acquire resources needed by BoringSSL. See // https://boringssl.googlesource.com/boringssl/+/HEAD/SANDBOXING.md - CRYPTO_pre_sandbox_init(); -+#endif - - #if BUILDFLAG(ENABLE_PLUGINS) - // Ensure access to the Pepper plugins before the sandbox is turned on. -@@ -387,6 +394,11 @@ void PreSandboxInit() { +@@ -392,6 +396,11 @@ void PreSandboxInit() { #endif InitializeWebRtcModule(); +#if BUILDFLAG(IS_BSD) + // "cache" the amount of physical memory before pledge(2) + base::SysInfo::AmountOfPhysicalMemoryMB(); +#endif + // Set the android SkFontMgr for blink. We need to ensure this is done // before the sandbox is initialized to allow the font manager to access // font configuration files on disk. -@@ -556,7 +568,7 @@ int NO_STACK_PROTECTOR RunZygote(ContentMainDelegate* +@@ -561,7 +570,7 @@ int NO_STACK_PROTECTOR RunZygote(ContentMainDelegate* delegate->ZygoteStarting(&zygote_fork_delegates); media::InitializeMediaLibrary(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) PreSandboxInit(); #endif -@@ -732,11 +744,10 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam +@@ -747,11 +756,10 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam kFieldTrialDescriptor + base::GlobalDescriptors::kBaseDescriptor); #endif // !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) g_fds->Set(kCrashDumpSignal, kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); -#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || - // BUILDFLAG(IS_OPENBSD) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #endif // !BUILDFLAG(IS_WIN) -@@ -925,6 +936,16 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam +@@ -949,6 +957,16 @@ int ContentMainRunnerImpl::Initialize(ContentMainParam } #endif +#if BUILDFLAG(IS_BSD) + if (process_type.empty()) { + sandbox::policy::SandboxLinux::Options sandbox_options; + sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox( + sandbox::policy::SandboxTypeFromCommandLine( + *base::CommandLine::ForCurrentProcess()), + sandbox::policy::SandboxLinux::PreSandboxHook(), sandbox_options); + } +#endif + delegate_->SandboxInitialized(process_type); #if BUILDFLAG(USE_ZYGOTE_HANDLE) -@@ -980,7 +1001,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { +@@ -1004,7 +1022,7 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { mojo::core::InitFeatures(); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // If dynamic Mojo Core is being used, ensure that it's loaded very early in // the child/zygote process, before any sandbox is initialized. The library // is not fully initialized with IPC support until a ChildProcess is later -@@ -1013,6 +1034,11 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { +@@ -1037,6 +1055,11 @@ int NO_STACK_PROTECTOR ContentMainRunnerImpl::Run() { content_main_params_.reset(); RegisterMainThreadFactories(); + +#if BUILDFLAG(IS_BSD) + if (!process_type.empty()) + PreSandboxInit(); +#endif if (process_type.empty()) return RunBrowser(std::move(main_params), start_minimal_browser); diff --git a/www/chromium/files/patch-content_browser_BUILD.gn b/www/chromium/files/patch-content_browser_BUILD.gn index 945f6dd7e7a9..8b8917c871e7 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-02-28 16:54:41 UTC +--- content/browser/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ content/browser/BUILD.gn -@@ -2318,6 +2318,13 @@ source_set("browser") { +@@ -2331,6 +2331,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__child__process__host__impl.cc b/www/chromium/files/patch-content_browser_browser__child__process__host__impl.cc index 3296411f0ee5..e599a1e02682 100644 --- a/www/chromium/files/patch-content_browser_browser__child__process__host__impl.cc +++ b/www/chromium/files/patch-content_browser_browser__child__process__host__impl.cc @@ -1,10 +1,10 @@ ---- content/browser/browser_child_process_host_impl.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/browser_child_process_host_impl.cc.orig 2022-03-25 21:59:56 UTC +++ content/browser/browser_child_process_host_impl.cc -@@ -293,6 +293,7 @@ void BrowserChildProcessHostImpl::LaunchWithoutExtraCo +@@ -292,6 +292,7 @@ void BrowserChildProcessHostImpl::LaunchWithoutExtraCo switches::kDisableBestEffortTasks, switches::kDisableLogging, switches::kEnableLogging, + switches::kDisableUnveil, switches::kIPCConnectionTimeout, switches::kLogBestEffortTasks, switches::kLogFile, 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 416938efc96e..57e2deee4f31 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-02-28 16:54:41 UTC +--- content/browser/browser_main_loop.cc.orig 2022-03-25 21:59:56 UTC +++ content/browser/browser_main_loop.cc -@@ -239,6 +239,12 @@ +@@ -240,6 +240,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 -@@ -546,6 +552,12 @@ int BrowserMainLoop::EarlyInitialization() { +@@ -547,6 +553,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 -@@ -573,7 +585,7 @@ int BrowserMainLoop::EarlyInitialization() { +@@ -574,7 +586,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() < -@@ -584,7 +596,7 @@ int BrowserMainLoop::EarlyInitialization() { +@@ -585,7 +597,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_compute__pressure_cpu__probe.cc b/www/chromium/files/patch-content_browser_compute__pressure_cpu__probe.cc index e19941607612..8ea22305922e 100644 --- a/www/chromium/files/patch-content_browser_compute__pressure_cpu__probe.cc +++ b/www/chromium/files/patch-content_browser_compute__pressure_cpu__probe.cc @@ -1,10 +1,10 @@ ---- content/browser/compute_pressure/cpu_probe.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/compute_pressure/cpu_probe.cc.orig 2022-03-25 21:59:56 UTC +++ content/browser/compute_pressure/cpu_probe.cc -@@ -52,6 +52,7 @@ std::unique_ptr CpuProbe::Create() { +@@ -53,6 +53,7 @@ std::unique_ptr CpuProbe::Create() { #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) return CpuProbeLinux::Create(); #else + NOTIMPLEMENTED(); return std::make_unique(); #endif // BUILDFLAG(IS_ANDROID) } 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 6c0935abc37e..722a9973f0e4 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-02-28 16:54:41 UTC +--- content/browser/download/download_manager_impl.cc.orig 2022-03-25 21:59:56 UTC +++ content/browser/download/download_manager_impl.cc -@@ -88,7 +88,7 @@ +@@ -89,7 +89,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 -@@ -235,7 +235,7 @@ class DownloadItemFactoryImpl : public download::Downl +@@ -217,7 +217,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"); -@@ -591,7 +591,7 @@ bool DownloadManagerImpl::InterceptDownload( +@@ -653,7 +653,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_font__access_font__enumeration__cache.h b/www/chromium/files/patch-content_browser_font__access_font__enumeration__cache.h deleted file mode 100644 index 49353a16e924..000000000000 --- a/www/chromium/files/patch-content_browser_font__access_font__enumeration__cache.h +++ /dev/null @@ -1,11 +0,0 @@ ---- content/browser/font_access/font_enumeration_cache.h.orig 2022-02-28 16:54:41 UTC -+++ content/browser/font_access/font_enumeration_cache.h -@@ -24,7 +24,7 @@ - #include "third_party/blink/public/mojom/font_access/font_access.mojom.h" - - #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ -- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) -+ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) - #define PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL 1 - #endif - diff --git a/www/chromium/files/patch-content_browser_font__access_font__enumeration__data__source.cc b/www/chromium/files/patch-content_browser_font__access_font__enumeration__data__source.cc new file mode 100644 index 000000000000..17bc66a73cb3 --- /dev/null +++ b/www/chromium/files/patch-content_browser_font__access_font__enumeration__data__source.cc @@ -0,0 +1,29 @@ +--- content/browser/font_access/font_enumeration_data_source.cc.orig 2022-03-25 21:59:56 UTC ++++ content/browser/font_access/font_enumeration_data_source.cc +@@ -16,7 +16,7 @@ + #include "content/browser/font_access/font_enumeration_data_source_win.h" + #elif BUILDFLAG(IS_MAC) + #include "content/browser/font_access/font_enumeration_data_source_mac.h" +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include "content/browser/font_access/font_enumeration_data_source_linux.h" + #endif // BUILDFLAG(IS_WIN) + +@@ -61,7 +61,7 @@ std::unique_ptr FontEnumera + return std::make_unique(); + #elif BUILDFLAG(IS_MAC) + return std::make_unique(); +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + return std::make_unique(); + #else + return std::make_unique(); +@@ -76,7 +76,7 @@ bool FontEnumerationDataSource::IsOsSupportedForTestin + return true; + #elif BUILDFLAG(IS_MAC) + return true; +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + return true; + #else + return false; diff --git a/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc b/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc deleted file mode 100644 index 0315e9024c30..000000000000 --- a/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- content/browser/gpu/gpu_data_manager_impl_private.cc.orig 2022-02-28 16:54:41 UTC -+++ content/browser/gpu/gpu_data_manager_impl_private.cc -@@ -1340,7 +1340,7 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( - break; - case gpu::GpuMode::SWIFTSHADER: { - bool legacy_software_gl = true; --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) - // This setting makes WebGL run on SwANGLE instead of SwiftShader GL. - legacy_software_gl = false; - #endif 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 243da28c2a93..38782a596d7c 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-02-28 16:54:41 UTC +--- 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 -@@ -226,7 +226,7 @@ void MediaKeysListenerManagerImpl::StartListeningForMe +@@ -232,7 +232,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_memory_swap__metrics__driver__impl__linux.cc b/www/chromium/files/patch-content_browser_memory_swap__metrics__driver__impl__linux.cc deleted file mode 100644 index 0ff52eb54e68..000000000000 --- a/www/chromium/files/patch-content_browser_memory_swap__metrics__driver__impl__linux.cc +++ /dev/null @@ -1,16 +0,0 @@ ---- content/browser/memory/swap_metrics_driver_impl_linux.cc.orig 2022-02-07 13:39:41 UTC -+++ content/browser/memory/swap_metrics_driver_impl_linux.cc -@@ -44,9 +44,13 @@ SwapMetricsDriverImplLinux::~SwapMetricsDriverImplLinu - SwapMetricsDriver::SwapMetricsUpdateResult - SwapMetricsDriverImplLinux::UpdateMetricsInternal(base::TimeDelta interval) { - base::VmStatInfo vmstat; -+#if !defined(OS_BSD) - if (!base::GetVmStatInfo(&vmstat)) { - return SwapMetricsDriver::SwapMetricsUpdateResult::kSwapMetricsUpdateFailed; - } -+#else -+ return SwapMetricsDriver::SwapMetricsUpdateResult::kSwapMetricsUpdateFailed; -+#endif - - uint64_t in_counts = vmstat.pswpin - last_pswpin_; - uint64_t out_counts = vmstat.pswpout - last_pswpout_; 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 1fd360656992..8ae018274219 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-02-28 16:54:41 UTC +--- 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 -@@ -206,7 +206,7 @@ +@@ -208,7 +208,7 @@ #include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck -@@ -1226,7 +1226,7 @@ static constexpr size_t kUnknownPlatformProcessLimit = +@@ -1228,7 +1228,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; -@@ -1313,7 +1313,7 @@ class RenderProcessHostImpl::IOThreadHostImpl : public +@@ -1315,7 +1315,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; -@@ -3321,6 +3321,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLin +@@ -3332,6 +3332,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 cb3119b35d04..8a83d054fa11 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-02-28 16:54:41 UTC +--- 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 -@@ -464,7 +464,7 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -465,7 +465,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.cc b/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc index 9158f197433d..4bab4e2ebd84 100644 --- a/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc +++ b/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc @@ -1,47 +1,47 @@ ---- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2022-02-28 16:54:41 UTC +--- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2022-03-25 21:59:56 UTC +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -115,7 +115,7 @@ #include "ui/gfx/gdi_util.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "content/browser/accessibility/browser_accessibility_auralinux.h" #include "ui/base/ime/linux/text_edit_command_auralinux.h" #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" -@@ -429,7 +429,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewAura::Ge +@@ -453,7 +453,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewAura::Ge if (manager) return ToBrowserAccessibilityWin(manager->GetRoot())->GetCOM(); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) BrowserAccessibilityManager* manager = host()->GetOrCreateRootBrowserAccessibilityManager(); if (manager && manager->GetRoot()) -@@ -1552,7 +1552,7 @@ bool RenderWidgetHostViewAura::ShouldDoLearning() { +@@ -1576,7 +1576,7 @@ bool RenderWidgetHostViewAura::ShouldDoLearning() { return GetTextInputManager() && GetTextInputManager()->should_do_learning(); } -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool RenderWidgetHostViewAura::SetCompositionFromExistingText( const gfx::Range& range, const std::vector& ui_ime_text_spans) { -@@ -2369,7 +2369,7 @@ bool RenderWidgetHostViewAura::NeedsInputGrab() { +@@ -2412,7 +2412,7 @@ bool RenderWidgetHostViewAura::NeedsInputGrab() { } bool RenderWidgetHostViewAura::NeedsMouseCapture() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) return NeedsInputGrab(); #else return false; -@@ -2546,7 +2546,7 @@ void RenderWidgetHostViewAura::ForwardKeyboardEventWit +@@ -2604,7 +2604,7 @@ void RenderWidgetHostViewAura::ForwardKeyboardEventWit if (!target_host) return; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) ui::TextEditKeyBindingsDelegateAuraLinux* keybinding_delegate = ui::GetTextEditKeyBindingsDelegate(); std::vector commands; 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 2402532468e0..fa2816bbcf39 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-02-28 16:54:41 UTC +--- 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 -@@ -240,7 +240,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura +@@ -243,7 +243,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_web__contents_web__contents__view__aura.cc b/www/chromium/files/patch-content_browser_web__contents_web__contents__view__aura.cc index 18a0445bf99f..781760a7f4a7 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-02-28 16:54:41 UTC +--- 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 @@ -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. -@@ -1312,7 +1312,7 @@ void WebContentsViewAura::OnMouseEvent(ui::MouseEvent* +@@ -1324,7 +1324,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 90c3fb35a396..1444db342a4b 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-02-28 16:54:41 UTC +--- content/child/child_process.cc.orig 2022-03-25 21:59:56 UTC +++ content/child/child_process.cc -@@ -52,7 +52,7 @@ ChildProcess::ChildProcess(base::ThreadPriority io_thr +@@ -71,7 +71,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 4935bfa93679..3b82d95948ae 100644 --- a/www/chromium/files/patch-content_common_user__agent.cc +++ b/www/chromium/files/patch-content_common_user__agent.cc @@ -1,19 +1,19 @@ ---- content/common/user_agent.cc.orig 2022-02-28 16:54:41 UTC +--- content/common/user_agent.cc.orig 2022-03-25 21:59:56 UTC +++ content/common/user_agent.cc -@@ -244,6 +244,16 @@ std::string BuildOSCpuInfoFromOSVersionAndCpuType(cons +@@ -245,6 +245,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_gpu_gpu__main.cc b/www/chromium/files/patch-content_gpu_gpu__main.cc index 95666e2f0bee..62bc81021cf9 100644 --- a/www/chromium/files/patch-content_gpu_gpu__main.cc +++ b/www/chromium/files/patch-content_gpu_gpu__main.cc @@ -1,73 +1,73 @@ ---- content/gpu/gpu_main.cc.orig 2022-02-28 16:54:41 UTC +--- content/gpu/gpu_main.cc.orig 2022-03-25 21:59:56 UTC +++ content/gpu/gpu_main.cc -@@ -83,7 +83,7 @@ +@@ -86,7 +86,7 @@ #include "sandbox/win/src/sandbox.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "content/gpu/gpu_sandbox_hook_linux.h" #include "sandbox/policy/linux/sandbox_linux.h" #include "sandbox/policy/sandbox_type.h" -@@ -105,7 +105,7 @@ namespace content { +@@ -108,7 +108,7 @@ namespace content { namespace { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool StartSandboxLinux(gpu::GpuWatchdogThread*, const gpu::GPUInfo*, const gpu::GpuPreferences&); -@@ -167,7 +167,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHel +@@ -170,7 +170,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHel bool EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread, const gpu::GPUInfo* gpu_info, const gpu::GpuPreferences& gpu_prefs) override { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) return StartSandboxLinux(watchdog_thread, gpu_info, gpu_prefs); #elif BUILDFLAG(IS_WIN) return StartSandboxWindows(sandbox_info_); -@@ -263,7 +263,7 @@ int GpuMain(MainFunctionParams parameters) { +@@ -266,7 +266,7 @@ int GpuMain(MainFunctionParams parameters) { std::make_unique( gpu_preferences.message_pump_type); } -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #error "Unsupported Linux platform." #elif BUILDFLAG(IS_MAC) // Cross-process CoreAnimation requires a CFRunLoop to function at all, and -@@ -406,17 +406,19 @@ int GpuMain(MainFunctionParams parameters) { +@@ -409,17 +409,19 @@ int GpuMain(MainFunctionParams parameters) { namespace { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdog_thread, const gpu::GPUInfo* gpu_info, const gpu::GpuPreferences& gpu_prefs) { TRACE_EVENT0("gpu,startup", "Initialize sandbox"); +#if !BUILDFLAG(IS_BSD) if (watchdog_thread) { // SandboxLinux needs to be able to ensure that the thread // has really been stopped. sandbox::policy::SandboxLinux::GetInstance()->StopThread(watchdog_thread); } +#endif // SandboxLinux::InitializeSandbox() must always be called // with only one thread. -@@ -437,11 +439,13 @@ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdo +@@ -454,11 +456,13 @@ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdo *base::CommandLine::ForCurrentProcess()), base::BindOnce(GpuProcessPreSandboxHook), sandbox_options); +#if !BUILDFLAG(IS_BSD) if (watchdog_thread) { base::Thread::Options thread_options; thread_options.timer_slack = base::TIMER_SLACK_MAXIMUM; watchdog_thread->StartWithOptions(std::move(thread_options)); } +#endif return res; } diff --git a/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc b/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc index 3a9a8f76b38a..88e68fd7a3c3 100644 --- a/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc +++ b/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc @@ -1,70 +1,70 @@ ---- content/gpu/gpu_sandbox_hook_linux.cc.orig 2022-02-28 16:54:41 UTC +--- content/gpu/gpu_sandbox_hook_linux.cc.orig 2022-03-25 21:59:56 UTC +++ content/gpu/gpu_sandbox_hook_linux.cc -@@ -101,6 +101,7 @@ static const char kLibV4lEncPluginPath[] = +@@ -104,6 +104,7 @@ static const char kLibV4lEncPluginPath[] = constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE; +#if !defined(OS_BSD) void AddV4L2GpuPermissions( std::vector* permissions, const sandbox::policy::SandboxSeccompBPF::Options& options) { -@@ -407,8 +408,10 @@ std::vector FilePermissionsForGp +@@ -420,8 +421,10 @@ std::vector FilePermissionsForGp AddStandardGpuPermissions(&permissions); return permissions; } +#endif void LoadArmGpuLibraries() { +#if !defined(OS_BSD) // Preload the Mali library. if (UseChromecastSandboxAllowlist()) { for (const char* path : kAllowedChromecastPaths) { -@@ -450,6 +453,7 @@ void LoadArmGpuLibraries() { +@@ -463,6 +466,7 @@ void LoadArmGpuLibraries() { dlopen(driver_paths[i], dlopen_flag); } } +#endif } bool LoadAmdGpuLibraries() { -@@ -513,12 +517,14 @@ void LoadV4L2Libraries( +@@ -526,12 +530,14 @@ void LoadV4L2Libraries( } void LoadChromecastV4L2Libraries() { +#if !defined(OS_BSD) for (const char* path : kAllowedChromecastPaths) { const std::string library_path(std::string(path) + std::string("libvpcodec.so")); if (dlopen(library_path.c_str(), dlopen_flag)) break; } +#endif } bool LoadLibrariesForGpu( -@@ -545,6 +551,7 @@ bool LoadLibrariesForGpu( +@@ -558,6 +564,7 @@ bool LoadLibrariesForGpu( return true; } +#if !defined(OS_BSD) sandbox::syscall_broker::BrokerCommandSet CommandSetForGPU( const sandbox::policy::SandboxLinux::Options& options) { sandbox::syscall_broker::BrokerCommandSet command_set; -@@ -567,13 +574,17 @@ bool BrokerProcessPreSandboxHook( +@@ -580,13 +587,17 @@ bool BrokerProcessPreSandboxHook( SetProcessTitleFromCommandLine(nullptr); return true; } +#endif } // namespace bool GpuProcessPreSandboxHook(sandbox::policy::SandboxLinux::Options options) { + NOTIMPLEMENTED(); +#if !defined(OS_BSD) sandbox::policy::SandboxLinux::GetInstance()->StartBrokerProcess( CommandSetForGPU(options), FilePermissionsForGpu(options), base::BindOnce(BrokerProcessPreSandboxHook), options); +#endif if (!LoadLibrariesForGpu(options)) return false; diff --git a/www/chromium/files/patch-content_public_common_common__param__traits__macros.h b/www/chromium/files/patch-content_public_common_common__param__traits__macros.h index 520813b67267..3aa00d157916 100644 --- a/www/chromium/files/patch-content_public_common_common__param__traits__macros.h +++ b/www/chromium/files/patch-content_public_common_common__param__traits__macros.h @@ -1,11 +1,11 @@ ---- content/public/common/common_param_traits_macros.h.orig 2022-02-28 16:54:41 UTC +--- content/public/common/common_param_traits_macros.h.orig 2022-03-25 21:59:56 UTC +++ content/public/common/common_param_traits_macros.h -@@ -127,7 +127,7 @@ IPC_STRUCT_TRAITS_BEGIN(blink::RendererPreferences) +@@ -128,7 +128,7 @@ IPC_STRUCT_TRAITS_BEGIN(blink::RendererPreferences) IPC_STRUCT_TRAITS_MEMBER(accept_languages) IPC_STRUCT_TRAITS_MEMBER(plugin_fullscreen_allowed) IPC_STRUCT_TRAITS_MEMBER(caret_browsing_enabled) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) IPC_STRUCT_TRAITS_MEMBER(system_font_family_name) #endif #if BUILDFLAG(IS_WIN) 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 9e34ea4a102a..1a4ee7abc241 100644 --- a/www/chromium/files/patch-content_public_common_content__features.cc +++ b/www/chromium/files/patch-content_public_common_content__features.cc @@ -1,59 +1,50 @@ ---- content/public/common/content_features.cc.orig 2022-02-28 16:54:41 UTC +--- content/public/common/content_features.cc.orig 2022-03-25 21:59:56 UTC +++ content/public/common/content_features.cc @@ -50,7 +50,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 { // 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 -@@ -987,7 +987,7 @@ const base::Feature kWebAssemblyBaseline{"WebAssemblyB +@@ -1030,7 +1030,7 @@ const base::Feature kWebAssemblyBaseline{"WebAssemblyB const base::Feature kWebAssemblyCodeProtection{ - "WebAssemblyCodeProtection", base::FEATURE_DISABLED_BY_DEFAULT}; + "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. -@@ -1017,7 +1017,7 @@ const base::Feature kWebAssemblyTiering{"WebAssemblyTi +@@ -1060,7 +1060,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 -@@ -1039,7 +1039,7 @@ const base::Feature kWebAuthCable { - // 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) - base::FEATURE_DISABLED_BY_DEFAULT - #else - base::FEATURE_ENABLED_BY_DEFAULT -@@ -1107,7 +1107,11 @@ const base::Feature kWebUIReportOnlyTrustedTypes{ +@@ -1146,7 +1146,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 c21d582cb4ef..8d9d438ee1d8 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-02-28 16:54:41 UTC +--- content/public/common/content_features.h.orig 2022-03-25 21:59:56 UTC +++ content/public/common/content_features.h -@@ -249,7 +249,7 @@ CONTENT_EXPORT extern const base::Feature +@@ -258,7 +258,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 aac07c5a0777..7b32ea15738e 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-02-28 16:54:41 UTC +--- content/public/common/content_switches.cc.orig 2022-03-25 21:59:56 UTC +++ content/public/common/content_switches.cc @@ -383,6 +383,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. -@@ -991,7 +993,7 @@ const char kEnableAutomation[] = "enable-automation"; +@@ -981,7 +983,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 6ce03c2ade27..da40df11d82d 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-02-28 16:54:41 UTC +--- content/public/common/content_switches.h.orig 2022-03-25 21:59:56 UTC +++ content/public/common/content_switches.h -@@ -114,6 +114,7 @@ CONTENT_EXPORT extern const char kEnableBlinkTestFeatu +@@ -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 kEnableCanvasContextLostInBackground[]; -@@ -272,7 +273,7 @@ CONTENT_EXPORT extern const char kRendererWaitForJavaD + CONTENT_EXPORT extern const char kEnableNewCanvas2DAPI[]; +@@ -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__thread__impl.cc b/www/chromium/files/patch-content_renderer_render__thread__impl.cc index 6f325abf06dd..979c13db3087 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-02-28 16:54:41 UTC +--- content/renderer/render_thread_impl.cc.orig 2022-03-25 21:59:56 UTC +++ content/renderer/render_thread_impl.cc @@ -189,7 +189,7 @@ #if BUILDFLAG(IS_MAC) #include -#else +#elif !BUILDFLAG(IS_OPENBSD) #include #endif @@ -718,7 +718,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() { 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( -@@ -1075,7 +1075,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: +@@ -1093,7 +1093,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) && -@@ -1086,7 +1086,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl: +@@ -1104,7 +1104,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 40ba7f66c1fb..4f2d42d5410a 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-02-28 16:54:41 UTC +--- content/renderer/renderer_blink_platform_impl.cc.orig 2022-03-25 21:59:56 UTC +++ content/renderer/renderer_blink_platform_impl.cc -@@ -108,7 +108,7 @@ +@@ -109,7 +109,7 @@ #if BUILDFLAG(IS_MAC) #include "content/child/child_process_sandbox_support_impl_mac.h" -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "content/child/child_process_sandbox_support_impl_linux.h" #endif -@@ -177,7 +177,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( +@@ -178,7 +178,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( main_thread_scheduler_(main_thread_scheduler) { // RenderThread may not exist in some tests. if (RenderThreadImpl::current()) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) mojo::PendingRemote font_service; RenderThreadImpl::current()->BindHostReceiver( font_service.InitWithNewPipeAndPassReceiver()); -@@ -187,7 +187,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( +@@ -188,7 +188,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( #endif } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (sandboxEnabled()) { #if BUILDFLAG(IS_MAC) sandbox_support_ = std::make_unique(); -@@ -261,7 +261,8 @@ RendererBlinkPlatformImpl::WrapSharedURLLoaderFactory( +@@ -283,7 +283,8 @@ RendererBlinkPlatformImpl::WrapSharedURLLoaderFactory( /*terminate_sync_load_event=*/nullptr); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +// pledge +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD) void RendererBlinkPlatformImpl::SetDisplayThreadPriority( base::PlatformThreadId thread_id) { if (RenderThreadImpl* render_thread = RenderThreadImpl::current()) { -@@ -276,7 +277,7 @@ blink::BlameContext* RendererBlinkPlatformImpl::GetTop +@@ -298,7 +299,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_renderer_renderer__blink__platform__impl.h b/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.h index aee599a1807f..ec0508ae1454 100644 --- a/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.h +++ b/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.h @@ -1,29 +1,29 @@ ---- content/renderer/renderer_blink_platform_impl.h.orig 2022-02-28 16:54:41 UTC +--- content/renderer/renderer_blink_platform_impl.h.orig 2022-03-25 21:59:56 UTC +++ content/renderer/renderer_blink_platform_impl.h -@@ -29,7 +29,7 @@ +@@ -30,7 +30,7 @@ #include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom.h" #include "third_party/blink/public/mojom/loader/code_cache.mojom.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) #include "components/services/font/public/cpp/font_loader.h" // nogncheck #include "third_party/skia/include/core/SkRefCnt.h" // nogncheck #endif -@@ -274,7 +274,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi +@@ -276,7 +276,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi void Collect3DContextInformation(blink::Platform::GraphicsInfo* gl_info, const gpu::GPUInfo& gpu_info) const; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) std::unique_ptr sandbox_support_; #endif -@@ -298,7 +298,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi - mojo::SharedRemote code_cache_host_ - GUARDED_BY(code_cache_host_lock_); +@@ -304,7 +304,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : publi + mutable base::WaitableEvent io_thread_id_ready_event_; + base::PlatformThreadId io_thread_id_ = base::kInvalidThreadId; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) sk_sp font_loader_; #endif diff --git a/www/chromium/files/patch-content_shell_BUILD.gn b/www/chromium/files/patch-content_shell_BUILD.gn index f261c872642e..aea21185750b 100644 --- a/www/chromium/files/patch-content_shell_BUILD.gn +++ b/www/chromium/files/patch-content_shell_BUILD.gn @@ -1,11 +1,11 @@ ---- content/shell/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- content/shell/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ content/shell/BUILD.gn -@@ -872,7 +872,7 @@ group("content_shell_crash_test") { +@@ -882,7 +882,7 @@ group("content_shell_crash_test") { if (is_win) { data_deps += [ "//build/win:copy_cdb_to_output" ] } - if (is_posix) { + if (is_posix && !is_bsd) { data_deps += [ "//third_party/breakpad:dump_syms", "//third_party/breakpad:minidump_stackwalk", diff --git a/www/chromium/files/patch-content_test_BUILD.gn b/www/chromium/files/patch-content_test_BUILD.gn index e65dae313f21..e2db5223fc7f 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-02-28 16:54:41 UTC +--- content/test/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ content/test/BUILD.gn -@@ -1900,7 +1900,7 @@ static_library("run_all_unittests") { +@@ -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" ] } } -@@ -2828,7 +2828,7 @@ test("content_unittests") { +@@ -2850,7 +2850,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-device_fido_features.cc b/www/chromium/files/patch-device_fido_features.cc deleted file mode 100644 index 028d19e45e69..000000000000 --- a/www/chromium/files/patch-device_fido_features.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- device/fido/features.cc.orig 2022-02-28 16:54:41 UTC -+++ device/fido/features.cc -@@ -24,7 +24,7 @@ extern const base::Feature kWebAuthCableSecondFactor { - // 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) - base::FEATURE_DISABLED_BY_DEFAULT - #else - base::FEATURE_ENABLED_BY_DEFAULT diff --git a/www/chromium/files/patch-extensions_browser_api_messaging_message__service.cc b/www/chromium/files/patch-extensions_browser_api_messaging_message__service.cc index 6c557c1bb4f8..f10bd9435db8 100644 --- a/www/chromium/files/patch-extensions_browser_api_messaging_message__service.cc +++ b/www/chromium/files/patch-extensions_browser_api_messaging_message__service.cc @@ -1,20 +1,20 @@ ---- extensions/browser/api/messaging/message_service.cc.orig 2022-02-28 16:54:41 UTC +--- extensions/browser/api/messaging/message_service.cc.orig 2022-03-25 21:59:56 UTC +++ extensions/browser/api/messaging/message_service.cc @@ -74,7 +74,7 @@ namespace { const char kReceivingEndDoesntExistError[] = "Could not establish connection. Receiving end does not exist."; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const char kMissingPermissionError[] = "Access to native messaging requires nativeMessaging permission."; const char kProhibitedByPoliciesError[] = -@@ -439,7 +439,7 @@ void MessageService::OpenChannelToNativeApp( +@@ -447,7 +447,7 @@ void MessageService::OpenChannelToNativeApp( return; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS) + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) bool has_permission = extension->permissions_data()->HasAPIPermission( mojom::APIPermissionID::kNativeMessaging); if (!has_permission) { diff --git a/www/chromium/files/patch-extensions_browser_browser__context__keyed__service__factories.cc b/www/chromium/files/patch-extensions_browser_browser__context__keyed__service__factories.cc index aa4d6c376ebd..24266e335de2 100644 --- a/www/chromium/files/patch-extensions_browser_browser__context__keyed__service__factories.cc +++ b/www/chromium/files/patch-extensions_browser_browser__context__keyed__service__factories.cc @@ -1,11 +1,11 @@ ---- extensions/browser/browser_context_keyed_service_factories.cc.orig 2022-02-28 16:54:41 UTC +--- extensions/browser/browser_context_keyed_service_factories.cc.orig 2022-03-25 21:59:56 UTC +++ extensions/browser/browser_context_keyed_service_factories.cc -@@ -91,7 +91,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() +@@ -89,7 +89,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() IdleManagerFactory::GetInstance(); ManagementAPI::GetFactoryInstance(); #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_MAC) + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) NetworkingPrivateEventRouterFactory::GetInstance(); #endif PowerAPI::GetFactoryInstance(); diff --git a/www/chromium/files/patch-extensions_browser_extension__prefs.cc b/www/chromium/files/patch-extensions_browser_extension__prefs.cc index a8d0b2849b64..d8cb32174e6f 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-02-28 16:54:41 UTC +--- extensions/browser/extension_prefs.cc.orig 2022-03-25 21:59:56 UTC +++ extensions/browser/extension_prefs.cc -@@ -2265,7 +2265,7 @@ void ExtensionPrefs::RegisterProfilePrefs( +@@ -2269,7 +2269,7 @@ void ExtensionPrefs::RegisterProfilePrefs( registry->RegisterStringPref(pref_names::kLastChromeVersion, std::string()); 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) registry->RegisterBooleanPref(pref_names::kChromeAppsEnabled, false); #endif registry->RegisterBooleanPref(pref_names::kU2fSecurityKeyApiEnabled, false); diff --git a/www/chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc b/www/chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc index f02440d40794..2b9ce2494bab 100644 --- a/www/chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc +++ b/www/chromium/files/patch-google__apis_gcm_engine_heartbeat__manager.cc @@ -1,29 +1,29 @@ ---- google_apis/gcm/engine/heartbeat_manager.cc.orig 2022-02-07 13:39:41 UTC +--- google_apis/gcm/engine/heartbeat_manager.cc.orig 2022-03-25 21:59:56 UTC +++ google_apis/gcm/engine/heartbeat_manager.cc @@ -32,7 +32,7 @@ const int kMinClientHeartbeatIntervalMs = 1000 * 30; // Minimum time spent sleeping before we force a new heartbeat. const int kMinSuspendTimeMs = 1000 * 10; // 10 seconds. --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // The period at which to check if the heartbeat time has passed. Used to // protect against platforms where the timer is delayed by the system being // suspended. Only needed on linux because the other OSes provide a standard @@ -192,7 +192,7 @@ void HeartbeatManager::RestartTimer() { base::BindRepeating(&HeartbeatManager::OnHeartbeatTriggered, weak_ptr_factory_.GetWeakPtr())); --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Windows, Mac, Android, iOS, and Chrome OS all provide a way to be notified // when the system is suspending or resuming. The only one that does not is // Linux so we need to poll to check for missed heartbeats. @@ -217,7 +217,7 @@ void HeartbeatManager::CheckForMissedHeartbeat() { return; } --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Otherwise check again later. io_task_runner_->PostDelayedTask( FROM_HERE, diff --git a/www/chromium/files/patch-gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc b/www/chromium/files/patch-gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc index 3b49ed72e30f..ef674e1c8f71 100644 --- a/www/chromium/files/patch-gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc +++ b/www/chromium/files/patch-gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc @@ -1,11 +1,11 @@ ---- gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc.orig 2022-02-28 16:54:41 UTC +--- gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc.orig 2022-03-25 21:59:56 UTC +++ gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc -@@ -573,7 +573,7 @@ bool SharedImageBackingFactoryAngleVulkan::CanUseAngle +@@ -574,7 +574,7 @@ bool SharedImageBackingFactoryAngleVulkan::CanUseAngle // TODO(penghuang): verify the scanout is the right usage for video playback. // crbug.com/1280798 constexpr auto kSupportedUsages = -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) SHARED_IMAGE_USAGE_SCANOUT | #endif SHARED_IMAGE_USAGE_GLES2 | SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT | 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 ac36bf032db2..b12a153e058a 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,34 +1,35 @@ ---- gpu/command_buffer/service/shared_image_factory.cc.orig 2022-02-28 16:54:41 UTC +--- gpu/command_buffer/service/shared_image_factory.cc.orig 2022-03-25 21:59:56 UTC +++ gpu/command_buffer/service/shared_image_factory.cc -@@ -34,11 +34,11 @@ - #include "ui/gl/gl_switches.h" - #include "ui/gl/trace_util.h" +@@ -38,12 +38,12 @@ + #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)) && \ -+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)) && \ - BUILDFLAG(ENABLE_VULKAN) + #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN)) && \ +- BUILDFLAG(ENABLE_VULKAN) ++ BUILDFLAG(ENABLE_VULKAN) || BUILDFLAG(IS_BSD) #include "gpu/command_buffer/service/external_vk_image_factory.h" - #include "gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.h" -@@ -75,7 +75,7 @@ + #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) -@@ -200,7 +200,7 @@ SharedImageFactory::SharedImageFactory( - // |gr_context_type|. - if (gr_context_type_ == GrContextType::kVulkan) { - #if BUILDFLAG(ENABLE_VULKAN) +@@ -240,7 +240,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 (base::FeatureList::IsEnabled(features::kVulkanFromANGLE)) { + // 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 0c10f6fd150b..2b4f5dd1c683 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-02-28 16:54:41 UTC +--- gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2022-03-25 21:59:56 UTC +++ gpu/command_buffer/service/webgpu_decoder_impl.cc -@@ -1010,7 +1010,7 @@ error::Error WebGPUDecoderImpl::HandleRequestAdapter( +@@ -1498,7 +1498,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__gpu__memory__buffer__unittest.cc b/www/chromium/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc new file mode 100644 index 000000000000..fa8050758e8d --- /dev/null +++ b/www/chromium/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc @@ -0,0 +1,29 @@ +--- gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc.orig 2022-03-25 21:59:56 UTC ++++ gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc +@@ -29,7 +29,7 @@ + #include "ui/gl/gl_image.h" + #include "ui/gl/test/gl_image_test_support.h" + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h" + #include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h" + #endif +@@ -72,7 +72,7 @@ class GpuMemoryBufferTest : public testing::TestWithPa + GLManager gl_; + }; + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + class GpuMemoryBufferTestEGL : public testing::Test, + public gpu::GpuCommandBufferTestEGL { + public: +@@ -364,7 +364,7 @@ TEST_P(GpuMemoryBufferTest, Lifecycle) { + glDeleteTextures(1, &texture_id); + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // Test glCreateImageCHROMIUM with gfx::NATIVE_PIXMAP. Basically the test + // reproduces the situation where some dmabuf fds are available outside the + // gpu process and the user wants to import them using glCreateImageCHROMIUM. diff --git a/www/chromium/files/patch-gpu_command__buffer_tests_gl__oes__egl__image__unittest.cc b/www/chromium/files/patch-gpu_command__buffer_tests_gl__oes__egl__image__unittest.cc new file mode 100644 index 000000000000..9e331c6eb5b2 --- /dev/null +++ b/www/chromium/files/patch-gpu_command__buffer_tests_gl__oes__egl__image__unittest.cc @@ -0,0 +1,20 @@ +--- gpu/command_buffer/tests/gl_oes_egl_image_unittest.cc.orig 2022-03-25 21:59:56 UTC ++++ gpu/command_buffer/tests/gl_oes_egl_image_unittest.cc +@@ -14,7 +14,7 @@ + #include "ui/gl/gl_image.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 + +@@ -43,7 +43,7 @@ class GpuOESEGLImageTest : public testing::Test, + bool egl_initialized_{false}; + }; + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // TODO(crbug.com/835072): re-enable this test on ASAN once bugs are fixed. + #if !defined(ADDRESS_SANITIZER) + 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 new file mode 100644 index 000000000000..b3f2484b9cd8 --- /dev/null +++ b/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.cc @@ -0,0 +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 +@@ -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() { + 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_command__buffer_tests_gl__test__utils.h b/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.h new file mode 100644 index 000000000000..6afa4605bfc9 --- /dev/null +++ b/www/chromium/files/patch-gpu_command__buffer_tests_gl__test__utils.h @@ -0,0 +1,11 @@ +--- gpu/command_buffer/tests/gl_test_utils.h.orig 2022-03-25 21:59:56 UTC ++++ gpu/command_buffer/tests/gl_test_utils.h +@@ -120,7 +120,7 @@ class GpuCommandBufferTestEGL { + return gfx::HasExtension(gl_extensions_, extension); + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // Create GLImageNativePixmap filled in with the given pixels. + scoped_refptr CreateGLImageNativePixmap( + gfx::BufferFormat format, diff --git a/www/chromium/files/patch-gpu_config_gpu__util.cc b/www/chromium/files/patch-gpu_config_gpu__util.cc deleted file mode 100644 index 5e7ba288dd6a..000000000000 --- a/www/chromium/files/patch-gpu_config_gpu__util.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- gpu/config/gpu_util.cc.orig 2022-02-28 16:54:41 UTC -+++ gpu/config/gpu_util.cc -@@ -754,7 +754,7 @@ bool EnableSwiftShaderIfNeeded(base::CommandLine* comm - gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] != - kGpuFeatureStatusEnabled) { - bool legacy_software_gl = true; --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) - // This setting makes WebGL run on SwANGLE instead of SwiftShader GL. - legacy_software_gl = false; - #endif 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 6ea83eae1ce1..291f1791a3d3 100644 --- a/www/chromium/files/patch-gpu_ipc_service_gpu__init.cc +++ b/www/chromium/files/patch-gpu_ipc_service_gpu__init.cc @@ -1,83 +1,65 @@ ---- gpu/ipc/service/gpu_init.cc.orig 2022-02-28 16:54:41 UTC +--- gpu/ipc/service/gpu_init.cc.orig 2022-03-25 21:59:56 UTC +++ gpu/ipc/service/gpu_init.cc -@@ -122,7 +122,7 @@ void InitializePlatformOverlaySettings(GPUInfo* gpu_in - } - - #if BUILDFLAG(IS_CHROMEOS_LACROS) || \ -- (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) -+ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) && !BUILDFLAG(IS_BSD) - bool CanAccessNvidiaDeviceFile() { - bool res = true; - base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, -@@ -220,7 +220,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL - device_perf_info_ = device_perf_info; - } - --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_BSD) - if (gpu_info_.gpu.vendor_id == 0x10de && // NVIDIA - gpu_info_.gpu.driver_vendor == "NVIDIA" && !CanAccessNvidiaDeviceFile()) - return false; -@@ -284,7 +284,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL - delayed_watchdog_enable = true; +@@ -278,7 +278,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) - // PreSandbox is mainly for resource handling and not related to the GPU - // driver, it doesn't need the GPU watchdog. The loadLibrary may take long - // time that killing and restarting the GPU process will not help. -@@ -324,7 +324,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL + 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 } 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. -@@ -373,7 +373,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL - } +@@ -377,7 +377,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; -@@ -407,7 +407,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -410,7 +410,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 -@@ -460,7 +460,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -469,7 +469,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; -@@ -566,7 +566,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL +@@ -591,7 +591,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. -@@ -799,7 +799,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c +@@ -822,7 +822,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_vulkan__device__queue.cc b/www/chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc index 8ff12aaa1b82..33814398b3d0 100644 --- a/www/chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc +++ b/www/chromium/files/patch-gpu_vulkan_vulkan__device__queue.cc @@ -1,20 +1,20 @@ ---- gpu/vulkan/vulkan_device_queue.cc.orig 2022-02-28 16:54:41 UTC +--- gpu/vulkan/vulkan_device_queue.cc.orig 2022-03-25 21:59:56 UTC +++ gpu/vulkan/vulkan_device_queue.cc @@ -85,7 +85,7 @@ bool VulkanDeviceQueue::Initialize( // In dual-CPU cases, we cannot detect the active GPU correctly on Linux, // so don't select GPU device based on the |gpu_info|. -#if !BUILDFLAG(IS_LINUX) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) // If gpu_info is provided, the device should match it. if (gpu_info && (device_properties.vendorID != gpu_info->gpu.vendor_id || device_properties.deviceID != gpu_info->gpu.device_id)) { -@@ -230,7 +230,7 @@ bool VulkanDeviceQueue::Initialize( +@@ -229,7 +229,7 @@ bool VulkanDeviceQueue::Initialize( enabled_device_features_2_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2}; // Android, Fuchsia, and Linux(VaapiVideoDecoder) need YCbCr sampler support. -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (!physical_device_info.feature_sampler_ycbcr_conversion) { LOG(ERROR) << "samplerYcbcrConversion is not supported."; return false; 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 af378f5b9e53..023ecf8bec3a 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,29 @@ ---- gpu/vulkan/vulkan_function_pointers.cc.orig 2022-02-28 16:54:41 UTC +--- gpu/vulkan/vulkan_function_pointers.cc.orig 2022-03-25 21:59:56 UTC +++ gpu/vulkan/vulkan_function_pointers.cc -@@ -916,7 +916,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer +@@ -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( -@@ -961,7 +961,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer +@@ -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( -@@ -1131,7 +1131,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointer +@@ -1141,7 +1141,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 35d6ff42d006..af1ea9064200 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,63 @@ ---- gpu/vulkan/vulkan_function_pointers.h.orig 2022-02-28 16:54:41 UTC +--- gpu/vulkan/vulkan_function_pointers.h.orig 2022-03-25 21:59:56 UTC +++ gpu/vulkan/vulkan_function_pointers.h -@@ -256,7 +256,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers +@@ -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) || -@@ -268,7 +268,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers +@@ -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) || -@@ -309,7 +309,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers +@@ -303,7 +303,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) -@@ -1030,7 +1030,7 @@ ALWAYS_INLINE VkResult vkGetAndroidHardwareBufferPrope +@@ -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, -@@ -1064,7 +1064,7 @@ vkImportSemaphoreWin32HandleKHR(VkDevice device, +@@ -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) { -@@ -1200,7 +1200,7 @@ ALWAYS_INLINE VkResult vkQueuePresentKHR(VkQueue queue +@@ -1203,7 +1203,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, -@@ -1210,4 +1210,4 @@ ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierProp +@@ -1213,4 +1213,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-gpu_vulkan_x_vulkan__implementation__x11.cc b/www/chromium/files/patch-gpu_vulkan_x_vulkan__implementation__x11.cc deleted file mode 100644 index 07cb63f7e4e8..000000000000 --- a/www/chromium/files/patch-gpu_vulkan_x_vulkan__implementation__x11.cc +++ /dev/null @@ -1,14 +0,0 @@ ---- gpu/vulkan/x/vulkan_implementation_x11.cc.orig 2022-02-07 13:39:41 UTC -+++ gpu/vulkan/x/vulkan_implementation_x11.cc -@@ -72,7 +72,11 @@ bool VulkanImplementationX11::InitializeVulkanInstance - - path = path.Append("libvk_swiftshader.so"); - } else { -+#if defined(OS_BSD) -+ path = base::FilePath("libvulkan.so"); -+#else - path = base::FilePath("libvulkan.so.1"); -+#endif - } - - VulkanFunctionPointers* vulkan_function_pointers = diff --git a/www/chromium/files/patch-headless_lib_browser_headless__web__contents__impl.cc b/www/chromium/files/patch-headless_lib_browser_headless__web__contents__impl.cc index 13249594cb90..350201e1fb4c 100644 --- a/www/chromium/files/patch-headless_lib_browser_headless__web__contents__impl.cc +++ b/www/chromium/files/patch-headless_lib_browser_headless__web__contents__impl.cc @@ -1,11 +1,11 @@ ---- headless/lib/browser/headless_web_contents_impl.cc.orig 2022-02-28 16:54:41 UTC +--- headless/lib/browser/headless_web_contents_impl.cc.orig 2022-03-25 21:59:56 UTC +++ headless/lib/browser/headless_web_contents_impl.cc -@@ -57,7 +57,7 @@ namespace headless { +@@ -56,7 +56,7 @@ namespace headless { namespace { void UpdatePrefsFromSystemSettings(blink::RendererPreferences* prefs) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) content::UpdateFontRendererPreferencesFromSystemSettings(prefs); #endif diff --git a/www/chromium/files/patch-headless_lib_headless__content__main__delegate.cc b/www/chromium/files/patch-headless_lib_headless__content__main__delegate.cc index a0273cc9be72..cec690e3e992 100644 --- a/www/chromium/files/patch-headless_lib_headless__content__main__delegate.cc +++ b/www/chromium/files/patch-headless_lib_headless__content__main__delegate.cc @@ -1,11 +1,11 @@ ---- headless/lib/headless_content_main_delegate.cc.orig 2022-02-28 16:54:41 UTC +--- headless/lib/headless_content_main_delegate.cc.orig 2022-03-25 21:59:56 UTC +++ headless/lib/headless_content_main_delegate.cc -@@ -331,7 +331,7 @@ void HeadlessContentMainDelegate::InitCrashReporter( +@@ -336,7 +336,7 @@ void HeadlessContentMainDelegate::InitCrashReporter( if (process_type != switches::kZygoteProcess) { g_headless_crash_client.Pointer()->set_crash_dumps_dir( options()->crash_dumps_dir); -#if !BUILDFLAG(IS_WIN) +#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD) crash_reporter::InitializeCrashpad(process_type.empty(), process_type); #endif // !BUILDFLAG(IS_WIN) crash_keys::SetSwitchesFromCommandLine(command_line, nullptr); diff --git a/www/chromium/files/patch-headless_public_headless__browser.cc b/www/chromium/files/patch-headless_public_headless__browser.cc index f770a11b6fe0..fcecc9f8ea61 100644 --- a/www/chromium/files/patch-headless_public_headless__browser.cc +++ b/www/chromium/files/patch-headless_public_headless__browser.cc @@ -1,11 +1,11 @@ ---- headless/public/headless_browser.cc.orig 2022-02-28 16:54:41 UTC +--- headless/public/headless_browser.cc.orig 2022-03-25 21:59:56 UTC +++ headless/public/headless_browser.cc @@ -42,7 +42,7 @@ Options::Options(int argc, const char** argv) user_agent(content::BuildUserAgentFromProduct(product_name_and_version)), window_size(kDefaultWindowSize), font_render_hinting(kDefaultFontRenderHinting) { --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) gl_implementation = gl::kGLImplementationANGLEName; angle_implementation = gl::kANGLEImplementationSwiftShaderForWebGLName; #endif diff --git a/www/chromium/files/patch-ipc_ipc__message__utils.cc b/www/chromium/files/patch-ipc_ipc__message__utils.cc index 2ca87a761a4b..c56681bc15b7 100644 --- a/www/chromium/files/patch-ipc_ipc__message__utils.cc +++ b/www/chromium/files/patch-ipc_ipc__message__utils.cc @@ -1,11 +1,11 @@ ---- ipc/ipc_message_utils.cc.orig 2022-02-28 16:54:41 UTC +--- ipc/ipc_message_utils.cc.orig 2022-03-25 21:59:56 UTC +++ ipc/ipc_message_utils.cc -@@ -349,7 +349,7 @@ void ParamTraits::Log(const param_type& +@@ -350,7 +350,7 @@ void ParamTraits::Log(const param_type& } #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS)) void ParamTraits::Log(const param_type& p, std::string* l) { l->append(base::NumberToString(p)); diff --git a/www/chromium/files/patch-ipc_ipc__message__utils.h b/www/chromium/files/patch-ipc_ipc__message__utils.h index d00e3395df55..0056c08eeec3 100644 --- a/www/chromium/files/patch-ipc_ipc__message__utils.h +++ b/www/chromium/files/patch-ipc_ipc__message__utils.h @@ -1,11 +1,11 @@ ---- ipc/ipc_message_utils.h.orig 2022-02-28 16:54:41 UTC +--- ipc/ipc_message_utils.h.orig 2022-03-25 21:59:56 UTC +++ ipc/ipc_message_utils.h -@@ -205,7 +205,7 @@ struct ParamTraits { +@@ -214,7 +214,7 @@ struct ParamTraits { // Since we want to support Android 32<>64 bit IPC, as long as we don't have // these traits for 32 bit ARM then that'll catch any errors. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS)) template <> struct ParamTraits { diff --git a/www/chromium/files/patch-media_audio_BUILD.gn b/www/chromium/files/patch-media_audio_BUILD.gn index a36f2fe174eb..03b517313c02 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-02-07 13:39:41 UTC +--- media/audio/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ media/audio/BUILD.gn -@@ -237,9 +237,20 @@ source_set("audio") { +@@ -245,9 +245,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_base_media__switches.cc b/www/chromium/files/patch-media_base_media__switches.cc index 0bb0fb3f113c..5ef1cbdba015 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-02-28 16:54:41 UTC +--- media/base/media_switches.cc.orig 2022-03-25 21:59:56 UTC +++ media/base/media_switches.cc @@ -9,7 +9,7 @@ #include "build/chromeos_buildflags.h" #include "components/system_media_controls/linux/buildflags/buildflags.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/cpu.h" #endif -@@ -397,7 +397,7 @@ const base::Feature kGav1VideoDecoder{"Gav1VideoDecode +@@ -402,7 +402,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 -@@ -429,7 +429,7 @@ constexpr base::FeatureParamstorage_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 d10c8d7ba0b9..8e7da0c3e3bf 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-02-28 16:54:41 UTC +--- media/video/video_encode_accelerator_adapter_test.cc.orig 2022-03-25 21:59:56 UTC +++ media/video/video_encode_accelerator_adapter_test.cc -@@ -349,7 +349,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest, TwoFramesRes +@@ -350,7 +350,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 046adadf70f2..437fff22f41a 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-02-28 16:54:41 UTC +--- media/webrtc/audio_processor.cc.orig 2022-03-25 21:59:56 UTC +++ media/webrtc/audio_processor.cc -@@ -487,7 +487,7 @@ absl::optional AudioProcessor::ProcessData( +@@ -428,7 +428,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-media_webrtc_helpers__unittests.cc b/www/chromium/files/patch-media_webrtc_helpers__unittests.cc index afdf0f36248b..0f4283be3863 100644 --- a/www/chromium/files/patch-media_webrtc_helpers__unittests.cc +++ b/www/chromium/files/patch-media_webrtc_helpers__unittests.cc @@ -1,20 +1,20 @@ ---- media/webrtc/helpers_unittests.cc.orig 2022-02-28 16:54:41 UTC +--- media/webrtc/helpers_unittests.cc.orig 2022-03-25 21:59:56 UTC +++ media/webrtc/helpers_unittests.cc @@ -36,7 +36,7 @@ TEST(CreateWebRtcAudioProcessingModuleTest, CheckDefau EXPECT_FALSE(config.pre_amplifier.enabled); EXPECT_TRUE(config.echo_canceller.enabled); EXPECT_TRUE(config.gain_controller1.enabled); -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) EXPECT_TRUE(config.gain_controller2.enabled); #else EXPECT_FALSE(config.gain_controller2.enabled); -@@ -95,7 +95,7 @@ TEST(CreateWebRtcAudioProcessingModuleTest, CheckDefau +@@ -94,7 +94,7 @@ TEST(CreateWebRtcAudioProcessingModuleTest, CheckDefau // Check that either AGC1 digital or AGC2 digital is used based on the // platforms where the Hybrid AGC is 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) EXPECT_FALSE(agc1_analog_config.enable_digital_adaptive); EXPECT_TRUE(config.gain_controller2.enabled); EXPECT_TRUE(config.gain_controller2.adaptive_digital.enabled); 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 6ac3766ca400..fe26aa1cf5a8 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-02-28 16:54:41 UTC +--- mojo/public/c/system/thunks.cc.orig 2022-03-25 21:59:56 UTC +++ mojo/public/c/system/thunks.cc -@@ -19,7 +19,7 @@ - #include "mojo/public/c/system/core.h" +@@ -20,7 +20,7 @@ #include "mojo/public/c/system/macros.h" --#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + #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" -@@ -67,7 +67,7 @@ class CoreLibraryInitializer { - ~CoreLibraryInitializer() = default; +@@ -69,7 +69,7 @@ class CoreLibraryInitializer { MojoResult LoadLibrary(base::FilePath library_path) { --#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + #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; -@@ -81,7 +81,7 @@ class CoreLibraryInitializer { +@@ -83,7 +83,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_WIN) -@@ -131,7 +131,7 @@ class CoreLibraryInitializer { - } + #elif BUILDFLAG(IS_FUCHSIA) +@@ -139,7 +139,7 @@ class CoreLibraryInitializer { private: --#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + #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 fbbcb5ae12d1..77435d61975a 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-02-28 16:54:41 UTC +--- mojo/public/js/mojo_bindings_resources.grd.orig 2022-03-25 21:59:56 UTC +++ mojo/public/js/mojo_bindings_resources.grd -@@ -110,7 +110,7 @@ +@@ -126,7 +126,7 @@ use_base_dir="false" resource_path="mojo/mojo/public/mojom/base/unguessable_token.mojom-webui.js" type="BINDATA" /> - + NetworkChangeNo +@@ -321,6 +321,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.cc b/www/chromium/files/patch-net_cert_cert__verify__proc.cc index ec2e4a89ae7b..d9b2ded4bcaf 100644 --- a/www/chromium/files/patch-net_cert_cert__verify__proc.cc +++ b/www/chromium/files/patch-net_cert_cert__verify__proc.cc @@ -1,11 +1,11 @@ ---- net/cert/cert_verify_proc.cc.orig 2022-02-28 16:54:41 UTC +--- net/cert/cert_verify_proc.cc.orig 2022-03-25 21:59:56 UTC +++ net/cert/cert_verify_proc.cc -@@ -470,7 +470,7 @@ base::Value CertVerifyParams(X509Certificate* cert, +@@ -552,7 +552,7 @@ base::Value CertVerifyParams(X509Certificate* cert, } // namespace -#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) +#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) // static scoped_refptr CertVerifyProc::CreateSystemVerifyProc( scoped_refptr cert_net_fetcher) { diff --git a/www/chromium/files/patch-net_cert_cert__verify__proc.h b/www/chromium/files/patch-net_cert_cert__verify__proc.h index a6fb7c8da9be..c73588b0ff78 100644 --- a/www/chromium/files/patch-net_cert_cert__verify__proc.h +++ b/www/chromium/files/patch-net_cert_cert__verify__proc.h @@ -1,11 +1,11 @@ ---- net/cert/cert_verify_proc.h.orig 2022-02-28 16:54:41 UTC +--- net/cert/cert_verify_proc.h.orig 2022-03-25 21:59:56 UTC +++ net/cert/cert_verify_proc.h -@@ -66,7 +66,7 @@ class NET_EXPORT CertVerifyProc - kMaxValue = kChainLengthOne +@@ -79,7 +79,7 @@ class NET_EXPORT CertVerifyProc + kMaxValue = kOther }; -#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) +#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) // Creates and returns a CertVerifyProc that uses the system verifier. // |cert_net_fetcher| may not be used, depending on the implementation. static scoped_refptr CreateSystemVerifyProc( 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 47824fcbe7e7..5be4d0055758 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-02-28 16:54:41 UTC +--- net/cert/cert_verify_proc_unittest.cc.orig 2022-03-25 21:59:56 UTC +++ net/cert/cert_verify_proc_unittest.cc -@@ -223,7 +223,7 @@ const std::vector kAllCertVerifier +@@ -225,7 +225,7 @@ const std::vector kAllCertVerifier CERT_VERIFY_PROC_MAC, CERT_VERIFY_PROC_BUILTIN #elif BUILDFLAG(IS_WIN) CERT_VERIFY_PROC_WIN -#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) CERT_VERIFY_PROC_BUILTIN #else #error Unsupported platform diff --git a/www/chromium/files/patch-net_dns_BUILD.gn b/www/chromium/files/patch-net_dns_BUILD.gn index b0a6c631049a..5cd4ec92683f 100644 --- a/www/chromium/files/patch-net_dns_BUILD.gn +++ b/www/chromium/files/patch-net_dns_BUILD.gn @@ -1,23 +1,31 @@ ---- net/dns/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- net/dns/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ net/dns/BUILD.gn -@@ -112,7 +112,7 @@ source_set("dns") { +@@ -114,7 +114,7 @@ source_set("dns") { "dns_config_service_android.cc", "dns_config_service_android.h", ] - } else if (is_linux) { + } else if (is_linux && !is_bsd) { sources += [ "dns_config_service_linux.cc", "dns_config_service_linux.h", -@@ -415,9 +415,9 @@ source_set("tests") { +@@ -155,6 +155,7 @@ source_set("dns") { + ":host_resolver_manager", + ":mdns_client", + "//net:net_public_deps", ++ "//printing/buildflags", + ] + + allow_circular_includes_from = [ +@@ -416,9 +417,9 @@ source_set("tests") { if (is_android) { sources += [ "dns_config_service_android_unittest.cc" ] - } else if (is_linux) { + } else if (is_linux && !is_bsd) { sources += [ "dns_config_service_linux_unittest.cc" ] - } else if (is_posix) { + } else if (is_posix && !is_bsd) { sources += [ "dns_config_service_posix_unittest.cc" ] } diff --git a/www/chromium/files/patch-net_dns_address__sorter__posix.cc b/www/chromium/files/patch-net_dns_address__sorter__posix.cc index dda04a22f4b5..bd934f90b5d8 100644 --- a/www/chromium/files/patch-net_dns_address__sorter__posix.cc +++ b/www/chromium/files/patch-net_dns_address__sorter__posix.cc @@ -1,10 +1,10 @@ ---- net/dns/address_sorter_posix.cc.orig 2022-02-07 13:39:41 UTC +--- net/dns/address_sorter_posix.cc.orig 2022-03-25 21:59:56 UTC +++ net/dns/address_sorter_posix.cc -@@ -17,6 +17,7 @@ +@@ -18,6 +18,7 @@ #include #include #include +#include #include #include #endif diff --git a/www/chromium/files/patch-net_dns_dns__util.cc b/www/chromium/files/patch-net_dns_dns__util.cc index fd21a857ad0d..2b19d06cde92 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-02-28 16:54:41 UTC +--- net/dns/dns_util.cc.orig 2022-03-25 21:59:56 UTC +++ net/dns/dns_util.cc -@@ -28,6 +28,8 @@ +@@ -27,6 +27,8 @@ + #include "net/third_party/uri_template/uri_template.h" #include "third_party/abseil-cpp/absl/types/optional.h" - #include "url/url_canon.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 6c58f20fcb6b..ada52d2db219 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-02-28 16:54:41 UTC +--- net/dns/host_resolver_manager.cc.orig 2022-03-25 21:59:56 UTC +++ net/dns/host_resolver_manager.cc -@@ -3014,7 +3014,7 @@ HostResolverManager::HostResolverManager( +@@ -2979,7 +2979,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_dns_host__resolver__proc.cc b/www/chromium/files/patch-net_dns_host__resolver__proc.cc index b0d72b598594..e4872a750520 100644 --- a/www/chromium/files/patch-net_dns_host__resolver__proc.cc +++ b/www/chromium/files/patch-net_dns_host__resolver__proc.cc @@ -1,22 +1,22 @@ ---- net/dns/host_resolver_proc.cc.orig 2022-02-28 16:54:41 UTC +--- net/dns/host_resolver_proc.cc.orig 2022-03-25 21:59:56 UTC +++ net/dns/host_resolver_proc.cc @@ -19,10 +19,6 @@ #include "net/dns/dns_util.h" #include "net/dns/host_resolver.h" -#if BUILDFLAG(IS_OPENBSD) -#define AI_ADDRCONFIG 0 -#endif - namespace net { HostResolverProc* HostResolverProc::default_proc_ = nullptr; -@@ -177,7 +173,7 @@ int SystemHostResolverCall(const std::string& host, +@@ -192,7 +188,7 @@ int SystemHostResolverCall(const std::string& host, base::BlockingType::WILL_BLOCK); #if BUILDFLAG(IS_POSIX) && \ - !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID)) + !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) || BUILDFLAG(IS_ANDROID)) DnsReloaderMaybeReload(); #endif - absl::optional ai; + auto [ai, err, os_error] = AddressInfo::Get(host, hints, nullptr, network); diff --git a/www/chromium/files/patch-net_dns_public_BUILD.gn b/www/chromium/files/patch-net_dns_public_BUILD.gn index 9444650053b6..47b7d860ad65 100644 --- a/www/chromium/files/patch-net_dns_public_BUILD.gn +++ b/www/chromium/files/patch-net_dns_public_BUILD.gn @@ -1,11 +1,11 @@ ---- net/dns/public/BUILD.gn.orig 2022-02-28 16:54:41 UTC +--- net/dns/public/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ net/dns/public/BUILD.gn -@@ -72,7 +72,7 @@ source_set("tests") { - "util_unittest.cc", +@@ -74,7 +74,7 @@ source_set("tests") { + "doh_provider_entry_unittest.cc", ] - if (is_posix && !is_android) { + if (is_posix && !is_android && !is_bsd) { sources += [ "resolv_reader_unittest.cc" ] } 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 45fed897114b..f8d2ca748e33 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-02-28 16:54:41 UTC +--- net/socket/tcp_socket_posix.cc.orig 2022-03-25 21:59:56 UTC +++ net/socket/tcp_socket_posix.cc -@@ -95,6 +95,17 @@ bool SetTCPKeepAlive(int fd, bool enable, int delay) { +@@ -96,6 +96,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 a1f355535c32..8f4d7d71c0c7 100644 --- a/www/chromium/files/patch-net_socket_udp__socket__posix.cc +++ b/www/chromium/files/patch-net_socket_udp__socket__posix.cc @@ -1,11 +1,11 @@ ---- net/socket/udp_socket_posix.cc.orig 2022-02-28 16:54:41 UTC +--- net/socket/udp_socket_posix.cc.orig 2022-03-25 21:59:56 UTC +++ net/socket/udp_socket_posix.cc -@@ -636,7 +636,7 @@ int UDPSocketPosix::SetDoNotFragment() { +@@ -574,7 +574,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 { 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 3bc86afc1222..c4eab5a25a6e 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-02-28 16:54:41 UTC +--- net/socket/udp_socket_unittest.cc.orig 2022-03-25 21:59:56 UTC +++ net/socket/udp_socket_unittest.cc @@ -324,7 +324,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) { EXPECT_THAT(rv, IsOk()); rv = client.SetDoNotFragment(); -#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) -+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) ++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || 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) { EXPECT_THAT(rv, IsOk()); rv = server.SetDoNotFragment(); -#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) -+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) ++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || 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) { // 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) || defined(OS_MAC) -+#if BUILDFLAG(IS_IOS) || defined(OS_MAC) || defined(IS_BSD) +-#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) { 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 c1c21bbe6826..0a679cd903f8 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-02-28 16:54:41 UTC +--- net/third_party/quiche/BUILD.gn.orig 2022-03-25 21:59:56 UTC +++ net/third_party/quiche/BUILD.gn -@@ -706,7 +706,7 @@ proto_library("net_quic_test_tools_proto") { +@@ -708,7 +708,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", -@@ -1061,7 +1061,7 @@ source_set("quic_test_tools_core") { +@@ -1063,7 +1063,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", -@@ -1526,10 +1526,10 @@ source_set("quiche_tests") { +@@ -1528,10 +1528,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-net_url__request_url__fetcher.h b/www/chromium/files/patch-net_url__request_url__fetcher.h index 3cc317e29c46..2e9466c0dd77 100644 --- a/www/chromium/files/patch-net_url__request_url__fetcher.h +++ b/www/chromium/files/patch-net_url__request_url__fetcher.h @@ -1,11 +1,11 @@ ---- net/url_request/url_fetcher.h.orig 2022-02-28 16:54:41 UTC +--- net/url_request/url_fetcher.h.orig 2022-03-25 21:59:56 UTC +++ net/url_request/url_fetcher.h -@@ -354,7 +354,7 @@ class NET_EXPORT URLFetcher { +@@ -344,7 +344,7 @@ class NET_EXPORT URLFetcher { // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. #if (!BUILDFLAG(IS_WIN) && \ - !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))) || \ + !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))) || \ BUILDFLAG(IS_CHROMEOS) // |url| is the URL to send the request to. It must be valid. // |request_type| is the type of request to make. diff --git a/www/chromium/files/patch-net_url__request_url__request__context.cc b/www/chromium/files/patch-net_url__request_url__request__context.cc index 4065c571abd5..f4ce413f95b7 100644 --- a/www/chromium/files/patch-net_url__request_url__request__context.cc +++ b/www/chromium/files/patch-net_url__request_url__request__context.cc @@ -1,11 +1,11 @@ ---- net/url_request/url_request_context.cc.orig 2022-02-28 16:54:41 UTC +--- net/url_request/url_request_context.cc.orig 2022-03-25 21:59:56 UTC +++ net/url_request/url_request_context.cc -@@ -89,7 +89,7 @@ const HttpNetworkSessionContext* URLRequestContext::Ge +@@ -90,7 +90,7 @@ const HttpNetworkSessionContext* URLRequestContext::Ge // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. #if !BUILDFLAG(IS_WIN) && \ - !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) std::unique_ptr URLRequestContext::CreateRequest( const GURL& url, RequestPriority priority, diff --git a/www/chromium/files/patch-net_url__request_url__request__context.h b/www/chromium/files/patch-net_url__request_url__request__context.h index afd5a144a82d..8b6ae8c4bff1 100644 --- a/www/chromium/files/patch-net_url__request_url__request__context.h +++ b/www/chromium/files/patch-net_url__request_url__request__context.h @@ -1,11 +1,11 @@ ---- net/url_request/url_request_context.h.orig 2022-02-28 16:54:41 UTC +--- net/url_request/url_request_context.h.orig 2022-03-25 21:59:56 UTC +++ net/url_request/url_request_context.h -@@ -82,7 +82,7 @@ class NET_EXPORT URLRequestContext { +@@ -83,7 +83,7 @@ class NET_EXPORT URLRequestContext { // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. #if !BUILDFLAG(IS_WIN) && \ - !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) + !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) // This function should not be used in Chromium, please use the version with // NetworkTrafficAnnotationTag in the future. // diff --git a/www/chromium/files/patch-net_url__request_url__request__context__builder.cc b/www/chromium/files/patch-net_url__request_url__request__context__builder.cc index b028f9251b83..f39035c8be93 100644 --- a/www/chromium/files/patch-net_url__request_url__request__context__builder.cc +++ b/www/chromium/files/patch-net_url__request_url__request__context__builder.cc @@ -1,11 +1,11 @@ ---- net/url_request/url_request_context_builder.cc.orig 2022-02-28 16:54:41 UTC +--- net/url_request/url_request_context_builder.cc.orig 2022-03-25 21:59:56 UTC +++ net/url_request/url_request_context_builder.cc -@@ -427,7 +427,7 @@ std::unique_ptr URLRequestContextBu +@@ -492,7 +492,7 @@ std::unique_ptr URLRequestContextBu } if (!proxy_resolution_service_) { -#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) +#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD) // TODO(willchan): Switch to using this code when // ConfiguredProxyResolutionService::CreateSystemProxyConfigService()'s // signature doesn't suck. diff --git a/www/chromium/files/patch-printing_print__settings__conversion.cc b/www/chromium/files/patch-printing_print__settings__conversion.cc index 3199a832c226..a8f5c1c7691c 100644 --- a/www/chromium/files/patch-printing_print__settings__conversion.cc +++ b/www/chromium/files/patch-printing_print__settings__conversion.cc @@ -1,11 +1,11 @@ ---- printing/print_settings_conversion.cc.orig 2022-02-28 16:54:41 UTC +--- printing/print_settings_conversion.cc.orig 2022-03-25 21:59:56 UTC +++ printing/print_settings_conversion.cc -@@ -216,7 +216,7 @@ std::unique_ptr PrintSettingsFromJobSet +@@ -217,7 +217,7 @@ std::unique_ptr PrintSettingsFromJobSet settings->set_is_modifiable(is_modifiable.value()); } -#if BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && defined(USE_CUPS)) +#if BUILDFLAG(IS_CHROMEOS) || ((BUILDFLAG(IS_BSD) || BUILDFLAG(IS_LINUX)) && defined(USE_CUPS)) const base::Value* advanced_settings = job_settings.FindDictKey(kSettingAdvancedSettings); if (advanced_settings) { diff --git a/www/chromium/files/patch-remoting_host_host__main.cc b/www/chromium/files/patch-remoting_host_host__main.cc index 71415397194e..f058e97d773a 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-02-28 16:54:41 UTC +--- remoting/host/host_main.cc.orig 2022-03-25 21:59:56 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) -@@ -152,7 +152,7 @@ MainRoutineFn SelectMainRoutine(const std::string& pro +@@ -154,7 +154,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 ce0d6a17f7ad..987e63b4bcc6 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,92 @@ ---- remoting/host/remoting_me2me_host.cc.orig 2022-02-28 16:54:41 UTC +--- remoting/host/remoting_me2me_host.cc.orig 2022-03-25 21:59:56 UTC +++ remoting/host/remoting_me2me_host.cc -@@ -123,7 +123,7 @@ +@@ -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" -@@ -167,7 +167,7 @@ const char kApplicationName[] = "chromoting"; +@@ -168,7 +168,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"; -@@ -368,7 +368,7 @@ class HostProcess : public ConfigWatcher::Delegate, +@@ -373,7 +373,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 -@@ -741,7 +741,7 @@ void HostProcess::StartOnNetworkThread() { +@@ -747,7 +747,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) } -@@ -800,7 +800,7 @@ void HostProcess::CreateAuthenticatorFactory() { +@@ -806,7 +806,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, -@@ -914,7 +914,7 @@ void HostProcess::StartOnUiThread() { +@@ -916,7 +916,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()-> -@@ -975,7 +975,7 @@ void HostProcess::ShutdownOnUiThread() { +@@ -987,7 +987,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. -@@ -1685,7 +1685,7 @@ void HostProcess::StartHost() { +@@ -1697,7 +1697,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); -@@ -1882,7 +1882,7 @@ void HostProcess::CrashHostProcess(const std::string& - int HostProcessMain() { +@@ -1897,7 +1897,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(); -@@ -1919,7 +1919,7 @@ int HostProcessMain() { +@@ -1941,7 +1941,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-sandbox_policy_openbsd_sandbox__openbsd.cc b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc index 8e6a040a0010..6c7f986f32e7 100644 --- a/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc +++ b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc @@ -1,397 +1,410 @@ ---- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2022-02-07 13:39:41 UTC +--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2022-03-25 21:59:56 UTC +++ sandbox/policy/openbsd/sandbox_openbsd.cc -@@ -0,0 +1,394 @@ +@@ -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() -+ : sandbox_status_flags_(kInvalid), ++ : 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)); + } + + 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 flock prot_exec recvfd sendfd ps", NULL); ++ 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_openbsd_sandbox__openbsd.h b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.h index 25ac98d7be0c..5e1af030852b 100644 --- a/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.h +++ b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.h @@ -1,281 +1,285 @@ ---- sandbox/policy/openbsd/sandbox_openbsd.h.orig 2022-02-07 13:39:41 UTC +--- sandbox/policy/openbsd/sandbox_openbsd.h.orig 2022-03-25 21:59:56 UTC +++ sandbox/policy/openbsd/sandbox_openbsd.h -@@ -0,0 +1,278 @@ +@@ -0,0 +1,282 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_ +#define SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_ + +#include +#include +#include + +#include "base/logging.h" +#include "base/posix/global_descriptors.h" +#include "sandbox/policy/export.h" +#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h" +#include "sandbox/policy/mojom/sandbox.mojom.h" +#include "sandbox/policy/sanitizer_buildflags.h" + +#if BUILDFLAG(USING_SANITIZER) +#include +#endif + +namespace base { +template +struct DefaultSingletonTraits; +class Thread; +} // namespace base + +namespace sandbox { +namespace syscall_broker { +class BrokerProcess; +} // namespace syscall_broker +} // namespace sandbox + +namespace sandbox { +namespace policy { + +// A singleton class to represent and change our sandboxing state for the +// three main Linux sandboxes. +// The sandboxing model allows using two layers of sandboxing. The first layer +// can be implemented either with unprivileged namespaces or with the setuid +// sandbox. This class provides a way to engage the namespace sandbox, but does +// not deal with the legacy setuid sandbox directly. +// The second layer is mainly based on seccomp-bpf and is engaged with +// InitializeSandbox(). InitializeSandbox() is also responsible for "sealing" +// the first layer of sandboxing. That is, InitializeSandbox must always be +// called to have any meaningful sandboxing at all. +class SANDBOX_POLICY_EXPORT SandboxLinux { + public: + // This is a list of sandbox IPC methods which the renderer may send to the + // sandbox host. See + // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md + // This isn't the full list, values < 32 are reserved for methods called from + // Skia, and values < 64 are reserved for libc_interceptor.cc. + enum LinuxSandboxIPCMethods { + DEPRECATED_METHOD_GET_FALLBACK_FONT_FOR_CHAR = 64, + DEPRECATED_METHOD_GET_CHILD_WITH_INODE, + DEPRECATED_METHOD_GET_STYLE_FOR_STRIKE, + METHOD_MAKE_SHARED_MEMORY_SEGMENT, + DEPRECATED_METHOD_MATCH_WITH_FALLBACK, + }; + + // These form a bitmask which describes the conditions of the Linux sandbox. + // Note: this doesn't strictly give you the current status, it states + // what will be enabled when the relevant processes are initialized. + enum Status { + // SUID sandbox active. + kSUID = 1 << 0, + + // Sandbox is using a new PID namespace. + kPIDNS = 1 << 1, + + // Sandbox is using a new network namespace. + kNetNS = 1 << 2, + + // seccomp-bpf sandbox active. + kSeccompBPF = 1 << 3, + + // The Yama LSM module is present and enforcing. + kYama = 1 << 4, + + // seccomp-bpf sandbox is active and the kernel supports TSYNC. + kSeccompTSYNC = 1 << 5, + + // User namespace sandbox active. + kUserNS = 1 << 6, + + // A flag that denotes an invalid sandbox status. + kInvalid = 1 << 31, + }; + + // SandboxLinux Options are a superset of SandboxSecompBPF Options. + struct Options : public SandboxSeccompBPF::Options { + // When running with a zygote, the namespace sandbox will have already + // been engaged prior to initializing SandboxLinux itself, and need not + // be done so again. Set to true to indicate that there isn't a zygote + // for this process and the step is to be performed here explicitly. + bool engage_namespace_sandbox = false; + + // Allow starting the sandbox with multiple threads already running. This + // will enable TSYNC for seccomp-BPF, which syncs the seccomp-BPF policy + // across all running threads. + bool allow_threads_during_sandbox_init = false; + + // Enables the CHECK for open directories. The open directory check is only + // useful for the chroot jail (from the semantic layer of the sandbox), and + // can safely be disabled if we are only enabling the seccomp-BPF layer. + bool check_for_open_directories = true; + }; + + // Callers can provide this hook to run code right before the policy + // is passed to the BPF compiler and the sandbox is engaged. If + // pre_sandbox_hook() returns true, the sandbox will be engaged + // afterwards, otherwise the process is terminated. + using PreSandboxHook = base::OnceCallback; + + // Get our singleton instance. + static SandboxLinux* GetInstance(); + + SandboxLinux(const SandboxLinux&) = delete; + SandboxLinux& operator=(const SandboxLinux&) = delete; + + bool SetPledge(const char *pstring, const char *ppath); + bool SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type); + + // Do some initialization that can only be done before any of the sandboxes + // are enabled. If using the setuid sandbox, this should be called manually + // before the setuid sandbox is engaged. + // Security: When this runs, it is imperative that either InitializeSandbox() + // runs as well or that all file descriptors returned in + // GetFileDescriptorsToClose() get closed. + // Otherwise file descriptors that bypass the security of the setuid sandbox + // would be kept open. One must be particularly careful if a process performs + // a fork(). + void PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type); + + // Check that the current process is the init process of a new PID + // namespace and then proceed to drop access to the file system by using + // a new unprivileged namespace. This is a layer-1 sandbox. + // In order for this sandbox to be effective, it must be "sealed" by calling + // InitializeSandbox(). + void EngageNamespaceSandbox(bool from_zygote); + + // Return a list of file descriptors to close if PreinitializeSandbox() ran + // but InitializeSandbox() won't. Avoid using. + // TODO(jln): get rid of this hack. + std::vector GetFileDescriptorsToClose(); + + // Seal an eventual layer-1 sandbox and initialize the layer-2 sandbox with + // an adequate policy depending on the process type and command line + // arguments. + // Currently the layer-2 sandbox is composed of seccomp-bpf and address space + // limitations. + // This function should only be called without any thread running. + bool InitializeSandbox(sandbox::mojom::Sandbox sandbox_type, + PreSandboxHook hook, + const Options& options); + + // Stop |thread| in a way that can be trusted by the sandbox. + void StopThread(base::Thread* thread); + + // Returns the status of the renderer, worker and ppapi sandbox. Can only + // be queried after going through PreinitializeSandbox(). This is a bitmask + // and uses the constants defined in "enum Status" above. Since the + // status needs to be provided before the sandboxes are actually started, + // this returns what will actually happen once InitializeSandbox() + // is called from inside these processes. + int GetStatus(); + + static std::string GetSandboxTypeInEnglish(sandbox::mojom::Sandbox sandbox_type); + + // Returns true if the current process is single-threaded or if the number + // of threads cannot be determined. + bool IsSingleThreaded() const; + + // Returns true if we started Seccomp BPF. + bool seccomp_bpf_started() const; + ++ // Returns true if unveil(2) is used. ++ bool unveil_initialized() const; ++ + // Check the policy and eventually start the seccomp-bpf sandbox. This should + // never be called with threads started. If we detect that threads have + // started we will crash. + bool StartSeccompBPF(sandbox::mojom::Sandbox sandbox_type, + PreSandboxHook hook, + const Options& options); + + // Limit the address space of the current process (and its children) to make + // some vulnerabilities harder to exploit. Writes the errno due to setrlimit + // (including 0 if no error) into |error|. + bool LimitAddressSpace(int* error); + + // Returns a file descriptor to proc. The file descriptor is no longer valid + // after the sandbox has been sealed. + int proc_fd() const { + DCHECK_NE(-1, proc_fd_); + return proc_fd_; + } + +#if BUILDFLAG(USING_SANITIZER) + __sanitizer_sandbox_arguments* sanitizer_args() const { + return sanitizer_args_.get(); + }; +#endif + + // A BrokerProcess is a helper that is started before the sandbox is engaged, + // typically from a pre-sandbox hook, that will serve requests to access + // files over an IPC channel. The client of this runs from a SIGSYS handler + // triggered by the seccomp-bpf sandbox. + // |client_sandbox_policy| is the policy being run by the client, and is + // used to derive the equivalent broker-side policy. + // |broker_side_hook| is an alternate pre-sandbox hook to be run before the + // broker itself gets sandboxed, to which the broker side policy and + // |options| are passed. + // Crashes the process if the broker can not be started since continuation + // is impossible (and presumably unsafe). + // This should never be destroyed, as after the sandbox is started it is + // vital to the process. +#if 0 + void StartBrokerProcess( + const sandbox::syscall_broker::BrokerCommandSet& allowed_command_set, + std::vector permissions, + PreSandboxHook broker_side_hook, + const Options& options); + + sandbox::syscall_broker::BrokerProcess* broker_process() const { + return broker_process_; + } +#endif + + private: + friend struct base::DefaultSingletonTraits; + + SandboxLinux(); + ~SandboxLinux(); + + // We must have been pre_initialized_ before using these. + bool seccomp_bpf_supported() const; + bool seccomp_bpf_with_tsync_supported() const; + + // Returns true if it can be determined that the current process has open + // directories that are not managed by the SandboxLinux class. This would + // be a vulnerability as it would allow to bypass the setuid sandbox. + bool HasOpenDirectories() const; + + // The last part of the initialization is to make sure any temporary "hole" + // in the sandbox is closed. For now, this consists of closing proc_fd_. + void SealSandbox(); + + // GetStatus() makes promises as to how the sandbox will behave. This + // checks that no promises have been broken. + void CheckForBrokenPromises(sandbox::mojom::Sandbox sandbox_type); + + // Stop |thread| and make sure it does not appear in /proc/self/tasks/ + // anymore. + void StopThreadAndEnsureNotCounted(base::Thread* thread) const; + + // A file descriptor to /proc. It's dangerous to have it around as it could + // allow for sandbox bypasses. It needs to be closed before we consider + // ourselves sandboxed. + int proc_fd_; + + bool seccomp_bpf_started_; ++ bool unveil_initialized_; + // The value returned by GetStatus(). Gets computed once and then cached. + int sandbox_status_flags_; + // Did PreinitializeSandbox() run? + bool pre_initialized_; + bool seccomp_bpf_supported_; // Accurate if pre_initialized_. + bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_. + bool yama_is_enforcing_; // Accurate if pre_initialized_. + bool initialize_sandbox_ran_; // InitializeSandbox() was called. +#if BUILDFLAG(USING_SANITIZER) + std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_; +#endif + sandbox::syscall_broker::BrokerProcess* broker_process_; // Leaked as global. +}; + +} // namespace policy +} // namespace sandbox + +#endif // SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_ diff --git a/www/chromium/files/patch-services_network_network__service.cc b/www/chromium/files/patch-services_network_network__service.cc index c87c21f075a7..5b6a4e94b1db 100644 --- a/www/chromium/files/patch-services_network_network__service.cc +++ b/www/chromium/files/patch-services_network_network__service.cc @@ -1,11 +1,11 @@ ---- services/network/network_service.cc.orig 2022-02-28 16:54:41 UTC +--- services/network/network_service.cc.orig 2022-03-25 21:59:56 UTC +++ services/network/network_service.cc -@@ -77,7 +77,7 @@ +@@ -82,7 +82,7 @@ #include "third_party/boringssl/src/include/openssl/cpu.h" #endif -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && \ !BUILDFLAG(IS_CHROMECAST) #include "components/os_crypt/key_storage_config_linux.h" #endif diff --git a/www/chromium/files/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc b/www/chromium/files/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc new file mode 100644 index 000000000000..8a5da112e475 --- /dev/null +++ b/www/chromium/files/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc @@ -0,0 +1,65 @@ +--- services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc.orig 2022-03-25 21:59:56 UTC ++++ services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc +@@ -52,7 +52,7 @@ uint32_t CalculatePrivateFootprintKb(const mojom::RawO + uint32_t shared_resident_kb) { + DCHECK(os_dump.platform_private_footprint); + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) + uint64_t rss_anon_bytes = os_dump.platform_private_footprint->rss_anon_bytes; + uint64_t vm_swap_bytes = os_dump.platform_private_footprint->vm_swap_bytes; + return (rss_anon_bytes + vm_swap_bytes) / 1024; +@@ -91,7 +91,7 @@ memory_instrumentation::mojom::OSMemDumpPtr CreatePubl + os_dump->is_peak_rss_resettable = internal_os_dump.is_peak_rss_resettable; + os_dump->private_footprint_kb = + CalculatePrivateFootprintKb(internal_os_dump, shared_resident_kb); +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) + os_dump->private_footprint_swap_kb = + internal_os_dump.platform_private_footprint->vm_swap_bytes / 1024; + #endif +@@ -270,7 +270,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch( + + // On most platforms each process can dump data about their own process + // so ask each process to do so Linux is special see below. +-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) ++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) + request->pending_responses.insert({client_info.pid, ResponseType::kOSDump}); + client->RequestOSMemoryDump(request->memory_map_option(), + {base::kNullProcessId}, +@@ -285,7 +285,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch( + + // In some cases, OS stats can only be dumped from a privileged process to + // get around to sandboxing/selinux restrictions (see crbug.com/461788). +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + std::vector pids; + mojom::ClientProcess* browser_client = nullptr; + base::ProcessId browser_client_pid = base::kNullProcessId; +@@ -331,7 +331,7 @@ void QueuedRequestDispatcher::SetUpAndDispatchVmRegion + const OsCallback& os_callback) { + // On Linux, OS stats can only be dumped from a privileged process to + // get around to sandboxing/selinux restrictions (see crbug.com/461788). +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + mojom::ClientProcess* browser_client = nullptr; + base::ProcessId browser_client_pid = 0; + for (const auto& client_info : clients) { +@@ -382,7 +382,7 @@ QueuedRequestDispatcher::FinalizeVmRegionRequest( + // each client process provides 1 OS dump, % the case where the client is + // disconnected mid dump. + OSMemDumpMap& extra_os_dumps = response.second.os_dumps; +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + for (auto& kv : extra_os_dumps) { + auto pid = kv.first == base::kNullProcessId ? original_pid : kv.first; + DCHECK(results.find(pid) == results.end()); +@@ -444,7 +444,7 @@ void QueuedRequestDispatcher::Finalize(QueuedRequest* + // crash). In the latter case (OS_LINUX) we expect the full map to come + // from the browser process response. + OSMemDumpMap& extra_os_dumps = response.second.os_dumps; +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + for (const auto& kv : extra_os_dumps) { + auto pid = kv.first == base::kNullProcessId ? original_pid : kv.first; + DCHECK_EQ(pid_to_os_dump[pid], nullptr); diff --git a/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn b/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn new file mode 100644 index 000000000000..ccccdb7c2c2d --- /dev/null +++ b/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn @@ -0,0 +1,16 @@ +--- services/resource_coordinator/public/cpp/memory_instrumentation/BUILD.gn.orig 2022-03-25 21:59:56 UTC ++++ services/resource_coordinator/public/cpp/memory_instrumentation/BUILD.gn +@@ -29,8 +29,12 @@ component("memory_instrumentation") { + sources += [ "os_metrics_win.cc" ] + } + +- if (is_android || is_linux || is_chromeos) { ++ if ((is_android || is_linux || is_chromeos) && !is_bsd) { + sources += [ "os_metrics_linux.cc" ] ++ } ++ ++ if (is_bsd) { ++ sources += [ "os_metrics_bsd.cc" ] + } + + if (is_fuchsia) { diff --git a/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc b/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc new file mode 100644 index 000000000000..cec6a7646af2 --- /dev/null +++ b/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc @@ -0,0 +1,61 @@ +--- services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_bsd.cc.orig 2022-03-25 21:59:56 UTC ++++ services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_bsd.cc +@@ -0,0 +1,58 @@ ++// Copyright 2022 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h" ++ ++#include "base/memory/page_size.h" ++#include "base/process/process.h" ++#include "base/process/process_handle.h" ++ ++#include ++ ++#include ++ ++#if BUILDFLAG(IS_OPENBSD) ++#define vm_rssize info.p_vm_rssize ++#elif BUILDFLAG(IS_FREEBSD) ++#include ++#define vm_rssize info.ki_rssize ++#endif ++ ++namespace memory_instrumentation { ++ ++// static ++bool OSMetrics::FillOSMemoryDump(base::ProcessId pid, ++ mojom::RawOSMemDump* dump) { ++ base::Process process = pid == base::kNullProcessId ++ ? base::Process::Current() ++ : base::Process::Open(pid); ++ const size_t kPageSize = base::GetPageSize(); ++ struct kinfo_proc info; ++ size_t length = sizeof(struct kinfo_proc); ++#if BUILDFLAG(IS_OPENBSD) ++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process.Handle(), ++ static_cast(length), 1 }; ++#elif BUILDFLAG(IS_FREEBSD) ++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process.Handle() }; ++#endif ++ ++ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) ++ return false; ++ ++ dump->resident_set_kb = (vm_rssize * kPageSize) / 1024; ++ dump->platform_private_footprint->rss_anon_bytes = ++ vm_rssize * kPageSize; ++ dump->platform_private_footprint->vm_swap_bytes = 0; ++ ++ return true; ++} ++ ++// static ++std::vector OSMetrics::GetProcessMemoryMaps( ++ base::ProcessId) { ++ NOTIMPLEMENTED(); ++ return std::vector(); ++} ++ ++} // namespace memory_instrumentation diff --git a/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__linux.cc b/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__linux.cc deleted file mode 100644 index 0c02405f77a5..000000000000 --- a/www/chromium/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__linux.cc +++ /dev/null @@ -1,83 +0,0 @@ ---- services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc.orig 2022-02-28 16:54:41 UTC -+++ services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc -@@ -5,7 +5,9 @@ - #include - #include - #include -+#if !defined(__OpenBSD__) && !defined(__FreeBSD__) - #include -+#endif - - #include - -@@ -26,8 +28,10 @@ - #include "build/build_config.h" - #include "services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h" - -+#if !defined(OS_BSD) - // Symbol with virtual address of the start of ELF header of the current binary. - extern char __ehdr_start; -+#endif - - namespace memory_instrumentation { - -@@ -39,6 +43,7 @@ using mojom::VmRegionPtr; - const char kClearPeakRssCommand[] = "5"; - const uint32_t kMaxLineSize = 4096; - -+#if !defined(OS_BSD) - // TODO(chiniforooshan): Many of the utility functions in this anonymous - // namespace should move to base/process/process_metrics_linux.cc to make the - // code a lot cleaner. However, we should do so after we made sure the metrics -@@ -267,6 +272,7 @@ class ScopedProcessSetDumpable { - - bool was_dumpable_; - }; -+#endif - - } // namespace - -@@ -280,6 +286,9 @@ void OSMetrics::SetProcSmapsForTesting(FILE* f) { - // static - bool OSMetrics::FillOSMemoryDump(base::ProcessId pid, - mojom::RawOSMemDump* dump) { -+#if defined(OS_BSD) -+ return false; -+#else - // TODO(chiniforooshan): There is no need to read both /statm and /status - // files. Refactor to get everything from /status using ProcessMetric. - auto statm_file = GetProcPidDir(pid).Append("statm"); -@@ -336,10 +345,12 @@ bool OSMetrics::FillOSMemoryDump(base::ProcessId pid, - #endif // BUILDFLAG(IS_ANDROID) - - return true; -+#endif - } - - // static - std::vector OSMetrics::GetProcessMemoryMaps(base::ProcessId pid) { -+#if !defined(OS_BSD) - std::vector maps; - uint32_t res = 0; - if (g_proc_smaps_for_testing) { -@@ -357,8 +368,13 @@ std::vector OSMetrics::GetProcessMemoryMa - return std::vector(); - - return maps; -+#else -+ NOTIMPLEMENTED(); -+ return std::vector(); -+#endif - } - -+#if !defined(OS_BSD) - // static - OSMetrics::MappedAndResidentPagesDumpState OSMetrics::GetMappedAndResidentPages( - const size_t start_address, -@@ -446,5 +462,6 @@ size_t OSMetrics::GetPeakResidentSetSize(base::Process - } - return 0; - } -+#endif - - } // namespace memory_instrumentation diff --git a/www/chromium/files/patch-skia_ext_SkMemory__new__handler.cpp b/www/chromium/files/patch-skia_ext_SkMemory__new__handler.cpp index 3c7526dc73b5..41c940e9e113 100644 --- a/www/chromium/files/patch-skia_ext_SkMemory__new__handler.cpp +++ b/www/chromium/files/patch-skia_ext_SkMemory__new__handler.cpp @@ -1,11 +1,11 @@ ---- skia/ext/SkMemory_new_handler.cpp.orig 2022-02-07 13:39:41 UTC +--- skia/ext/SkMemory_new_handler.cpp.orig 2022-03-25 21:59:56 UTC +++ skia/ext/SkMemory_new_handler.cpp -@@ -78,7 +78,7 @@ static void* malloc_nothrow(size_t size) { +@@ -79,7 +79,7 @@ static void* malloc_nothrow(size_t size) { // TODO(b.kelemen): we should always use UncheckedMalloc but currently it // doesn't work as intended everywhere. void* result; --#if defined(OS_IOS) -+#if defined(OS_IOS) || defined(OS_BSD) - result = malloc(size); +-#if BUILDFLAG(IS_IOS) ++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD) + result = malloc(size); #else - // It's the responsibility of the caller to check the return value. + // It's the responsibility of the caller to check the return value. diff --git a/www/chromium/files/patch-third__party_angle_src_common_system__utils__posix.cpp b/www/chromium/files/patch-third__party_angle_src_common_system__utils__posix.cpp index 2a2c884e552f..9f56a5b88759 100644 --- a/www/chromium/files/patch-third__party_angle_src_common_system__utils__posix.cpp +++ b/www/chromium/files/patch-third__party_angle_src_common_system__utils__posix.cpp @@ -1,12 +1,12 @@ ---- third_party/angle/src/common/system_utils_posix.cpp.orig 2022-02-28 16:54:41 UTC +--- third_party/angle/src/common/system_utils_posix.cpp.orig 2022-03-25 21:59:56 UTC +++ third_party/angle/src/common/system_utils_posix.cpp -@@ -248,7 +248,9 @@ Library *OpenSharedLibraryWithExtensionAndGetError(con +@@ -197,7 +197,9 @@ void *OpenSystemLibraryWithExtensionAndGetError(const int extraFlags = 0; if (searchType == SearchType::AlreadyLoaded) { +#if !defined(__OpenBSD__) extraFlags = RTLD_NOLOAD; +#endif } std::string fullPath = directory + libraryName; 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 5ea43497f6f3..12ca6038d0f1 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-02-28 16:54:41 UTC +--- third_party/angle/src/libANGLE/Display.cpp.orig 2022-03-25 21:59:56 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" -@@ -313,7 +313,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di +@@ -320,7 +320,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) { -@@ -358,7 +358,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di +@@ -365,7 +365,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) - { -@@ -406,7 +406,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib di + if (platformType == 0 || + platformType == EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE) +@@ -416,7 +416,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()) { -@@ -1893,7 +1893,7 @@ static ClientExtensions GenerateClientExtensions() +@@ -1915,7 +1915,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_angle_src_libANGLE_formatutils.cpp b/www/chromium/files/patch-third__party_angle_src_libANGLE_formatutils.cpp new file mode 100644 index 000000000000..de6511913744 --- /dev/null +++ b/www/chromium/files/patch-third__party_angle_src_libANGLE_formatutils.cpp @@ -0,0 +1,11 @@ +--- third_party/angle/src/libANGLE/formatutils.cpp.orig 2022-03-25 21:59:56 UTC ++++ third_party/angle/src/libANGLE/formatutils.cpp +@@ -1388,7 +1388,7 @@ static InternalFormatInfoMap BuildInternalFormatInfoMa + AddYUVFormat(&map, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported); + AddYUVFormat(&map, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported); + +-#if defined(ANGLE_PLATFORM_LINUX) ++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD) + // From GL_OES_required_internalformat + // The |shared| bit shouldn't be 2. But given this hits assertion when bits + // are checked, it's fine to have this bit set as 2 as a workaround. diff --git a/www/chromium/files/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc b/www/chromium/files/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc index b2639ae6d261..7ac18c48300c 100644 --- a/www/chromium/files/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc +++ b/www/chromium/files/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc @@ -1,11 +1,11 @@ ---- third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc.orig 2021-04-14 18:41:08 UTC +--- third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc.orig 2022-03-25 21:59:56 UTC +++ third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc @@ -64,7 +64,7 @@ bool StructTraitsaccept_languages)) return false; --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (!data.ReadSystemFontFamilyName(&out->system_font_family_name)) return false; #endif diff --git a/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h b/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h index fda961a3c939..38d43155bb49 100644 --- a/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h +++ b/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h @@ -1,11 +1,11 @@ ---- third_party/blink/public/common/renderer_preferences/renderer_preferences.h.orig 2021-05-12 22:06:00 UTC +--- third_party/blink/public/common/renderer_preferences/renderer_preferences.h.orig 2022-03-25 21:59:56 UTC +++ third_party/blink/public/common/renderer_preferences/renderer_preferences.h @@ -50,7 +50,7 @@ struct BLINK_COMMON_EXPORT RendererPreferences { bool webrtc_allow_legacy_tls_protocols{false}; UserAgentOverride user_agent_override; std::string accept_languages; --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) std::string system_font_family_name; #endif - #if defined(OS_WIN) + #if BUILDFLAG(IS_WIN) diff --git a/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h b/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h index caf2ae4e539b..8a8cfffc0c32 100644 --- a/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h +++ b/www/chromium/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h @@ -1,11 +1,11 @@ ---- third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h.orig 2021-05-12 22:06:00 UTC +--- third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h.orig 2022-03-25 21:59:56 UTC +++ third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h @@ -157,7 +157,7 @@ struct BLINK_COMMON_EXPORT return data.accept_languages; } --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) static const std::string& system_font_family_name( const ::blink::RendererPreferences& data) { return data.system_font_family_name; 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 75593e01cc42..ff450056d5b0 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-02-28 16:54:41 UTC +--- 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 -@@ -401,7 +401,7 @@ SkFontHinting RendererPreferencesToSkiaHinting( +@@ -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' -@@ -3170,7 +3170,7 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs +@@ -3159,7 +3159,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_html_forms_internal__popup__menu.cc b/www/chromium/files/patch-third__party_blink_renderer_core_html_forms_internal__popup__menu.cc index 6787f1bc9ad7..aa7f47bf2644 100644 --- a/www/chromium/files/patch-third__party_blink_renderer_core_html_forms_internal__popup__menu.cc +++ b/www/chromium/files/patch-third__party_blink_renderer_core_html_forms_internal__popup__menu.cc @@ -1,11 +1,11 @@ ---- third_party/blink/renderer/core/html/forms/internal_popup_menu.cc.orig 2022-02-28 16:54:41 UTC +--- third_party/blink/renderer/core/html/forms/internal_popup_menu.cc.orig 2022-03-25 21:59:56 UTC +++ third_party/blink/renderer/core/html/forms/internal_popup_menu.cc -@@ -159,7 +159,7 @@ class InternalPopupMenu::ItemIterationContext { +@@ -179,7 +179,7 @@ class InternalPopupMenu::ItemIterationContext { is_in_group_(false), buffer_(buffer) { DCHECK(buffer_); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // On other platforms, the