diff --git a/www/chromium/Makefile b/www/chromium/Makefile index 5a7dd8ae27a7..b7ee68b405cf 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,341 +1,337 @@ # Created by: Florent Thoumie PORTNAME= chromium -PORTVERSION= 98.0.4758.102 -PORTREVISION= 3 +PORTVERSION= 99.0.4844.51 CATEGORIES= www MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ - LOCAL/rene/chromium/:fonts + 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}/bin/ar:devel/binutils \ ${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}/bin/python2.7:lang/python27 \ ${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 dos2unix gl gnome jpeg localbase:ldflags \ +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 -DOS2UNIX_FILES= third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 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= python=${LOCALBASE}/bin/python2.7 \ - python3=${PYTHON_CMD} +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=false \ 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_VARS= BUILDTYPE=Debug \ GN_ARGS+=is_debug=true \ GN_ARGS+=is_component_build=false \ GN_ARGS+=symbol_level=1 \ GN_BOOTSTRAP_FLAGS+=--debug \ WANTSPACE="13 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="6.5 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-85${EXTRACT_SUFX}:fonts + 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} < 120 .if ${PORT_OPTIONS:MLTO} BROKEN+= does not build with LTO needs LLVM 12+ .endif .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 ${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_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvulkan.so.1 \ - ${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 d8a1b3138355..aea948673823 100644 --- a/www/chromium/Makefile.tests +++ b/www/chromium/Makefile.tests @@ -1,7 +1,12 @@ TEST_TARGETS= base_unittests \ + blink_unittests \ chromedriver_unittests \ + components_unittests \ + content_unittests \ crypto_unittests \ headless_unittests \ + media_unittests \ + mojo_unittests \ + net_unittests \ printing_unittests \ url_unittests - diff --git a/www/chromium/distinfo b/www/chromium/distinfo index 4f04e0f5b957..7139f2f3df3c 100644 --- a/www/chromium/distinfo +++ b/www/chromium/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1645271488 -SHA256 (chromium-98.0.4758.102.tar.xz) = 415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e -SIZE (chromium-98.0.4758.102.tar.xz) = 1242565220 -SHA256 (chromium-98.0.4758.102-testdata.tar.xz) = d18ea0af0a9a87d53e75fbdbd886b17f689e00486f819905b38f02a2619504e6 -SIZE (chromium-98.0.4758.102-testdata.tar.xz) = 258963780 -SHA256 (test_fonts-85.tar.xz) = f22b61b3639acb147c98ec2e2305d8b96f0b55c8c74c40e2ea696402fae8cef9 -SIZE (test_fonts-85.tar.xz) = 9511984 +TIMESTAMP = 1646114129 +SHA256 (chromium-99.0.4844.51.tar.xz) = 97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3 +SIZE (chromium-99.0.4844.51.tar.xz) = 1316125164 +SHA256 (chromium-99.0.4844.51-testdata.tar.xz) = 80e07d1684b07d0390fbb53115ba6a48e39781f2f805d4e17dac657a00a4363e +SIZE (chromium-99.0.4844.51-testdata.tar.xz) = 258957904 +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 fbf272d4b247..e6324afdb6fc 100644 --- a/www/chromium/files/patch-BUILD.gn +++ b/www/chromium/files/patch-BUILD.gn @@ -1,72 +1,72 @@ ---- BUILD.gn.orig 2022-02-07 13:39:41 UTC +--- BUILD.gn.orig 2022-02-28 16:54:41 UTC +++ BUILD.gn @@ -52,7 +52,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") { ] } - 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", -@@ -638,6 +638,15 @@ group("gn_all") { +@@ -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", -@@ -688,7 +697,7 @@ group("gn_all") { +@@ -686,7 +695,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)" ] } -@@ -1139,7 +1148,7 @@ if (!is_ios) { +@@ -1137,7 +1146,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)" ] } -@@ -1148,7 +1157,7 @@ if (!is_ios) { +@@ -1146,7 +1155,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)" ] } -@@ -1525,7 +1534,7 @@ group("chromium_builder_perf") { +@@ -1521,7 +1530,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-apps_ui_views_app__window__frame__view.cc b/www/chromium/files/patch-apps_ui_views_app__window__frame__view.cc index 4c99002b2147..151948510862 100644 --- a/www/chromium/files/patch-apps_ui_views_app__window__frame__view.cc +++ b/www/chromium/files/patch-apps_ui_views_app__window__frame__view.cc @@ -1,11 +1,11 @@ ---- apps/ui/views/app_window_frame_view.cc.orig 2022-02-07 13:39:41 UTC +--- apps/ui/views/app_window_frame_view.cc.orig 2022-02-28 16:54:41 UTC +++ apps/ui/views/app_window_frame_view.cc -@@ -137,7 +137,7 @@ gfx::Rect AppWindowFrameView::GetWindowBoundsForClient +@@ -138,7 +138,7 @@ gfx::Rect AppWindowFrameView::GetWindowBoundsForClient gfx::Rect window_bounds = client_bounds; // TODO(crbug.com/1052397): Revisit 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Get the difference between the widget's client area bounds and window // bounds, and grow |window_bounds| by that amount. gfx::Insets native_frame_insets = diff --git a/www/chromium/files/patch-base_BUILD.gn b/www/chromium/files/patch-base_BUILD.gn index 20b36c33a916..72069cf118ab 100644 --- a/www/chromium/files/patch-base_BUILD.gn +++ b/www/chromium/files/patch-base_BUILD.gn @@ -1,102 +1,146 @@ ---- base/BUILD.gn.orig 2022-02-07 13:39:41 UTC +--- base/BUILD.gn.orig 2022-02-28 16:54:41 UTC +++ base/BUILD.gn -@@ -975,7 +975,7 @@ component("base") { +@@ -993,7 +993,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", -@@ -986,6 +986,12 @@ component("base") { +@@ -1004,6 +1004,12 @@ mixed_component("base") { "profiler/thread_delegate_posix.h", ] } + + if (is_bsd) { + sources += [ + "profiler/stack_sampler_posix.cc", + ] + } } if (is_win) { -@@ -1416,11 +1422,24 @@ component("base") { +@@ -1462,11 +1468,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 += [ -+ "iconv", + "execinfo", + "util", + ] + } + if (use_allocator_shim) { sources += [ "allocator/allocator_shim.cc", -@@ -1443,7 +1462,7 @@ component("base") { - "allocator/early_zone_registration_mac.h", +@@ -1490,7 +1508,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", -@@ -2176,6 +2195,42 @@ component("base") { - "linux_util.h", - ] +@@ -1550,7 +1568,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") { } -+ } -+ + } + + 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") { + } } - # iOS +- 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") { + "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") { + # 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") { + } + } + +- if (is_fuchsia || is_linux || is_chromeos) { ++ if ((is_fuchsia || is_linux || is_chromeos) && !is_bsd) { + sources += [ + "debug/elf_reader_unittest.cc", + "debug/test_elf_image_builder.cc", diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h b/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h index c15f7b02a90a..3f03f54ad491 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_address__space__randomization.h @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/address_space_randomization.h.orig 2021-10-07 16:50:24 UTC +--- base/allocator/partition_allocator/address_space_randomization.h.orig 2022-02-28 16:54:41 UTC +++ base/allocator/partition_allocator/address_space_randomization.h -@@ -36,7 +36,7 @@ AslrMask(uintptr_t bits) { +@@ -38,7 +38,7 @@ AslrMask(uintptr_t bits) { #if defined(ARCH_CPU_64_BITS) - #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) + #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && !defined(OS_BSD) // We shouldn't allocate system pages at all for sanitizer builds. However, // we do, and if random hint addresses interfere with address ranges diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator.h b/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator.h index 3d932a28ff32..57ceca3efe3a 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator.h +++ b/www/chromium/files/patch-base_allocator_partition__allocator_page__allocator.h @@ -1,11 +1,11 @@ ---- base/allocator/partition_allocator/page_allocator.h.orig 2022-02-23 16:08:07 UTC +--- base/allocator/partition_allocator/page_allocator.h.orig 2022-02-28 16:54:41 UTC +++ base/allocator/partition_allocator/page_allocator.h -@@ -170,7 +170,7 @@ BASE_EXPORT void DecommitAndZeroSystemPages(void* addr +@@ -194,7 +194,7 @@ BASE_EXPORT void DecommitAndZeroSystemPages(void* addr // Whether decommitted memory is guaranteed to be zeroed when it is // recommitted. Do not assume that this will not change over time. constexpr BASE_EXPORT bool DecommittedMemoryIsAlwaysZeroed() { --#if defined(OS_APPLE) -+#if defined(OS_APPLE) || defined(OS_BSD) +-#if BUILDFLAG(IS_APPLE) ++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) return false; #else return true; 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 c5069330b3dd..700bf383a007 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-23 16:08:07 UTC +--- 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 -@@ -339,8 +339,12 @@ bool TryRecommitSystemPagesInternal( - } +@@ -346,8 +346,12 @@ bool TryRecommitSystemPagesInternal( - void DiscardSystemPagesInternal(void* address, size_t length) { --#if defined(OS_APPLE) -+#if defined(OS_APPLE) || defined(OS_BSD) -+#if defined(OS_BSD) -+ int ret = madvise(address, length, MADV_FREE); + 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(address, length, MADV_FREE_REUSABLE); + int ret = madvise(ptr, length, MADV_FREE_REUSABLE); +#endif if (ret) { // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED. - ret = madvise(address, length, 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 b525560e52b0..011bdf1a8e7b 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,11 @@ ---- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-02-07 13:39:41 UTC +--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-02-28 16:54:41 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 defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#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 diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h b/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h deleted file mode 100644 index 3c37a2b8e5a7..000000000000 --- a/www/chromium/files/patch-base_allocator_partition__allocator_partition__alloc__constants.h +++ /dev/null @@ -1,11 +0,0 @@ ---- base/allocator/partition_allocator/partition_alloc_constants.h.orig 2022-02-07 13:39:41 UTC -+++ base/allocator/partition_allocator/partition_alloc_constants.h -@@ -361,7 +361,7 @@ constexpr size_t kBitsPerSizeT = sizeof(void*) * CHAR_ - // PartitionPurgeDecommitEmptySlotSpans flag will eagerly decommit all entries - // in the ring buffer, so with periodic purge enabled, this typically happens - // every few seconds. --#if defined(OS_LINUX) || defined(OS_APPLE) -+#if defined(OS_LINUX) || defined(OS_APPLE) || defined(OS_BSD) - // Set to a higher value on Linux and macOS, to assess impact on performance - // bots. This roughly halves the number of syscalls done during a speedometer - // 2.0 run on these platforms. 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 3fd97ed4f2bf..138e9832363f 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,12 +1,22 @@ ---- base/allocator/partition_allocator/partition_page.h.orig 2022-02-07 13:39:41 UTC +--- base/allocator/partition_allocator/partition_page.h.orig 2022-02-28 16:54:41 UTC +++ base/allocator/partition_allocator/partition_page.h -@@ -141,7 +141,8 @@ struct __attribute__((packed)) SlotSpanMetadata { - // in PartitionPage, which has other fields as well, and must fit in 32 bytes. +@@ -129,7 +129,8 @@ struct __attribute__((packed)) SlotSpanMetadata { + PartitionBucket* const bucket = nullptr; // CHECK()ed in AllocNewSlotSpan(). --#if defined(PA_HAS_64_BITS_POINTERS) && defined(OS_APPLE) -+#if (defined(PA_HAS_64_BITS_POINTERS) && defined(OS_APPLE)) || \ -+ (defined(OS_FREEBSD) && defined(__i386__)) +-#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 { + #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 86e2996e9bc2..a53eb22b38b2 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-07 13:39:41 UTC +--- base/allocator/partition_allocator/partition_root.h.orig 2022-02-28 16:54:41 UTC +++ base/allocator/partition_allocator/partition_root.h -@@ -1044,7 +1044,7 @@ ALWAYS_INLINE void PartitionRoot::FreeNoH +@@ -1019,7 +1019,7 @@ ALWAYS_INLINE void PartitionRoot::FreeNoH // essentially). - #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \ - ((defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMECAST)) || \ -- (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))) -+ ((defined(OS_LINUX) || defined(OS_BSD)) && defined(ARCH_CPU_64_BITS))) - PA_CHECK(IsManagedByPartitionAlloc(reinterpret_cast(ptr))); + #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)); #endif diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc b/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc index be1594ebc8d8..2fa346356669 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.cc @@ -1,47 +1,47 @@ ---- base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-02-07 13:39:41 UTC +--- base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-02-28 16:54:41 UTC +++ base/allocator/partition_allocator/spinning_mutex.cc @@ -17,7 +17,15 @@ #if defined(PA_HAS_LINUX_KERNEL) #include +#if defined(OS_OPENBSD) +#include +#elif defined(OS_FREEBSD) +#include +#include +#include +#else #include +#endif #include #include #endif // defined(PA_HAS_LINUX_KERNEL) -@@ -86,8 +94,13 @@ void SpinningMutex::FutexWait() { +@@ -85,8 +93,13 @@ void SpinningMutex::FutexWait() { // |kLockedContended| anymore. Note that even without spurious wakeups, the // value of |state_| is not guaranteed when this returns, as another thread // may get the lock before we get to run. +#if defined(OS_FREEBSD) + int err = _umtx_op(&state_, UMTX_OP_WAIT_UINT_PRIVATE, + kLockedContended, nullptr, nullptr); +#else int err = syscall(SYS_futex, &state_, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, kLockedContended, nullptr, nullptr, 0); +#endif if (err) { // These are programming error, check them. -@@ -99,8 +112,14 @@ void SpinningMutex::FutexWait() { +@@ -98,8 +111,14 @@ void SpinningMutex::FutexWait() { void SpinningMutex::FutexWake() { int saved_errno = errno; +#if defined(OS_FREEBSD) + long retval = _umtx_op(&state_, UMTX_OP_WAKE_PRIVATE, + 1 /* wake up a single waiter */, nullptr, nullptr); +#else long retval = syscall(SYS_futex, &state_, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1 /* wake up a single waiter */, nullptr, nullptr, 0); +#endif + PA_CHECK(retval != -1); errno = saved_errno; } diff --git a/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc b/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc index 09e46dc3b1a8..54cc31592590 100644 --- a/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc +++ b/www/chromium/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc @@ -1,50 +1,50 @@ ---- base/allocator/partition_allocator/starscan/stack/stack.cc.orig 2022-02-07 13:39:41 UTC +--- base/allocator/partition_allocator/starscan/stack/stack.cc.orig 2022-02-28 16:54:41 UTC +++ base/allocator/partition_allocator/starscan/stack/stack.cc @@ -17,6 +17,10 @@ #include #endif +#if defined(OS_BSD) +#include +#endif + #if defined(LIBC_GLIBC) extern "C" void* __libc_stack_end; #endif @@ -48,6 +52,36 @@ void* GetStackTop() { void* GetStackTop() { return pthread_get_stackaddr_np(pthread_self()); +} + +#elif defined(OS_OPENBSD) + +void* GetStackTop() { + stack_t ss; + if (pthread_stackseg_np(pthread_self(), &ss) != 0) + return nullptr; + return reinterpret_cast(ss.ss_sp); +} + +#elif defined(OS_FREEBSD) + +void* GetStackTop() { + pthread_attr_t attr; + int error = pthread_attr_init(&attr); + if (error) { + return nullptr; + } + error = pthread_attr_get_np(pthread_self(), &attr); + if (!error) { + void* base; + size_t size; + error = pthread_attr_getstack(&attr, &base, &size); + PA_CHECK(!error); + pthread_attr_destroy(&attr); + return reinterpret_cast(base) + size; + } + pthread_attr_destroy(&attr); + return nullptr; } - #elif defined(OS_POSIX) || defined(OS_FUCHSIA) + #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) diff --git a/www/chromium/files/patch-base_base__paths__posix.cc b/www/chromium/files/patch-base_base__paths__posix.cc index e4e467db6322..9b6827056e06 100644 --- a/www/chromium/files/patch-base_base__paths__posix.cc +++ b/www/chromium/files/patch-base_base__paths__posix.cc @@ -1,98 +1,98 @@ ---- base/base_paths_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/base_paths_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/base_paths_posix.cc @@ -15,6 +15,7 @@ #include #include +#include "base/command_line.h" #include "base/environment.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -25,9 +26,13 @@ #include "base/process/process_metrics.h" #include "build/build_config.h" --#if defined(OS_FREEBSD) -+#if defined(OS_BSD) +-#if BUILDFLAG(IS_FREEBSD) ++#if BUILDFLAG(IS_BSD) #include #include -+#if defined(OS_OPENBSD) ++#if BUILDFLAG(IS_OPENBSD) +#include +#define MAXTOKENS 2 +#endif - #elif defined(OS_SOLARIS) || defined(OS_AIX) + #elif BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_AIX) #include #endif @@ -68,13 +73,65 @@ bool PathProviderPosix(int key, FilePath* result) { *result = FilePath(bin_dir); return true; - #elif defined(OS_OPENBSD) || defined(OS_AIX) + #elif BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_AIX) - // There is currently no way to get the executable path on OpenBSD - char* cpath; - if ((cpath = getenv("CHROME_EXE_PATH")) != NULL) - *result = FilePath(cpath); - else - *result = FilePath("/usr/local/chrome/chrome"); - return true; + char *cpath; -+#if !defined(OS_AIX) ++#if !BUILDFLAG(IS_AIX) + struct kinfo_file *files; + kvm_t *kd = NULL; + char errbuf[_POSIX2_LINE_MAX]; + static char retval[PATH_MAX]; + int cnt; + struct stat sb; + pid_t cpid = getpid(); + bool ret = false; + + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); + + VLOG(1) << "PathProviderPosix argv: " << command_line->argv()[0]; + + if (realpath(command_line->argv()[0].c_str(), retval) == NULL) + goto out; + + if (stat(command_line->argv()[0].c_str(), &sb) < 0) + goto out; + + if (!command_line->HasSwitch("no-sandbox")) { + ret = true; + *result = FilePath(retval); + VLOG(1) << "PathProviderPosix (sandbox) result: " << retval; + goto out; + } + + if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL) + goto out; + + if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, cpid, + sizeof(struct kinfo_file), &cnt)) == NULL) + goto out; + + for (int i = 0; i < cnt; i++) { + if (files[i].fd_fd == KERN_FILE_TEXT && + files[i].va_fsid == static_cast(sb.st_dev) && + files[i].va_fileid == sb.st_ino) { + ret = true; + *result = FilePath(retval); + VLOG(1) << "PathProviderPosix result: " << retval; + } + } +out: + if (kd) + kvm_close(kd); + if (!ret) { +#endif + if ((cpath = getenv("CHROME_EXE_PATH")) != NULL) + *result = FilePath(cpath); + else + *result = FilePath("/usr/local/chrome/chrome"); + return true; -+#if !defined(OS_AIX) ++#if !BUILDFLAG(IS_AIX) + } + return ret; +#endif #endif } case DIR_SRC_TEST_DATA_ROOT: { diff --git a/www/chromium/files/patch-base_base__switches.cc b/www/chromium/files/patch-base_base__switches.cc index be1fb8bcdacd..59678d7551d9 100644 --- a/www/chromium/files/patch-base_base__switches.cc +++ b/www/chromium/files/patch-base_base__switches.cc @@ -1,11 +1,11 @@ ---- base/base_switches.cc.orig 2022-02-07 13:39:41 UTC +--- base/base_switches.cc.orig 2022-02-28 16:54:41 UTC +++ base/base_switches.cc @@ -170,7 +170,7 @@ const char kForceFieldTrialParams[] = "force-fieldtria #endif --#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) // Controls whether or not retired instruction counts are surfaced for threads // in trace events on Linux. // diff --git a/www/chromium/files/patch-base_base__switches.h b/www/chromium/files/patch-base_base__switches.h index 3388972738b8..8b90f08b6a9e 100644 --- a/www/chromium/files/patch-base_base__switches.h +++ b/www/chromium/files/patch-base_base__switches.h @@ -1,11 +1,11 @@ ---- base/base_switches.h.orig 2022-02-07 13:39:41 UTC +--- base/base_switches.h.orig 2022-02-28 16:54:41 UTC +++ base/base_switches.h @@ -60,7 +60,7 @@ extern const char kEnableIdleTracing[]; extern const char kForceFieldTrialParams[]; #endif --#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) extern const char kEnableThreadInstructionCount[]; // TODO(crbug.com/1176772): Remove kEnableCrashpad and IsCrashpadEnabled() when diff --git a/www/chromium/files/patch-base_compiler__specific.h b/www/chromium/files/patch-base_compiler__specific.h index d9fcba02e013..5424b9804aa7 100644 --- a/www/chromium/files/patch-base_compiler__specific.h +++ b/www/chromium/files/patch-base_compiler__specific.h @@ -1,11 +1,11 @@ ---- base/compiler_specific.h.orig 2022-02-07 13:39:41 UTC +--- base/compiler_specific.h.orig 2022-02-28 16:54:41 UTC +++ base/compiler_specific.h -@@ -366,7 +366,7 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) { +@@ -359,7 +359,7 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) { #endif // defined(__clang_analyzer__) // Use nomerge attribute to disable optimization of merging multiple same calls. -#if defined(__clang__) && __has_attribute(nomerge) +#if defined(__clang__) && __has_attribute(nomerge) && !defined(OS_FREEBSD) #define NOMERGE [[clang::nomerge]] #else #define NOMERGE diff --git a/www/chromium/files/patch-base_cpu.h b/www/chromium/files/patch-base_cpu.h index 1879d459ce46..68c6722e4905 100644 --- a/www/chromium/files/patch-base_cpu.h +++ b/www/chromium/files/patch-base_cpu.h @@ -1,11 +1,11 @@ ---- base/cpu.h.orig 2022-02-07 13:39:41 UTC +--- base/cpu.h.orig 2022-02-28 16:54:41 UTC +++ base/cpu.h -@@ -104,7 +104,7 @@ class BASE_EXPORT CPU final { +@@ -108,7 +108,7 @@ class BASE_EXPORT CPU final { const std::string& cpu_brand() const { return cpu_brand_; } - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) enum class CoreType { kUnknown = 0, kOther, diff --git a/www/chromium/files/patch-base_debug_debugger__posix.cc b/www/chromium/files/patch-base_debug_debugger__posix.cc index 63a56d85b575..01e51311eb4a 100644 --- a/www/chromium/files/patch-base_debug_debugger__posix.cc +++ b/www/chromium/files/patch-base_debug_debugger__posix.cc @@ -1,68 +1,68 @@ ---- base/debug/debugger_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/debug/debugger_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/debug/debugger_posix.cc @@ -36,6 +36,10 @@ #include #endif -+#if defined(OS_OPENBSD) ++#if BUILDFLAG(IS_OPENBSD) +#include +#endif + - #if defined(OS_FREEBSD) + #if BUILDFLAG(IS_FREEBSD) #include #endif -@@ -95,32 +99,51 @@ bool BeingDebugged() { +@@ -96,32 +100,51 @@ bool BeingDebugged() { // Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and // binary interfaces may change. -+#if defined(OS_OPENBSD) ++#if BUILDFLAG(IS_OPENBSD) + struct kinfo_proc *info; + size_t info_size; +#else struct kinfo_proc info; size_t info_size = sizeof(info); +#endif - #if defined(OS_OPENBSD) + #if BUILDFLAG(IS_OPENBSD) if (sysctl(mib, base::size(mib), NULL, &info_size, NULL, 0) < 0) return -1; mib[5] = (info_size / sizeof(struct kinfo_proc)); + if ((info = reinterpret_cast(malloc(info_size))) == NULL) { + is_set = true; + being_debugged = false; + return being_debugged; + } + + int sysctl_result = sysctl(mib, base::size(mib), info, &info_size, NULL, 0); #endif -+#if !defined(OS_OPENBSD) ++#if !BUILDFLAG(IS_OPENBSD) int sysctl_result = sysctl(mib, base::size(mib), &info, &info_size, NULL, 0); +#endif DCHECK_EQ(sysctl_result, 0); if (sysctl_result != 0) { is_set = true; being_debugged = false; - return being_debugged; + goto out; } // This process is being debugged if the P_TRACED flag is set. is_set = true; - #if defined(OS_FREEBSD) + #if BUILDFLAG(IS_FREEBSD) being_debugged = (info.ki_flag & P_TRACED) != 0; --#elif defined(OS_BSD) +-#elif BUILDFLAG(IS_BSD) - being_debugged = (info.p_flag & P_TRACED) != 0; -+#elif defined(OS_OPENBSD) ++#elif BUILDFLAG(IS_OPENBSD) + being_debugged = (info->p_psflags & PS_TRACED) != 0; #else being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0; +#endif + +out: -+#if defined(OS_OPENBSD) ++#if BUILDFLAG(IS_OPENBSD) + free(info); #endif return being_debugged; } diff --git a/www/chromium/files/patch-base_debug_proc__maps__linux.cc b/www/chromium/files/patch-base_debug_proc__maps__linux.cc index c728ce89a006..4ed7cb701ed6 100644 --- a/www/chromium/files/patch-base_debug_proc__maps__linux.cc +++ b/www/chromium/files/patch-base_debug_proc__maps__linux.cc @@ -1,11 +1,11 @@ ---- base/debug/proc_maps_linux.cc.orig 2022-02-07 13:39:41 UTC +--- base/debug/proc_maps_linux.cc.orig 2022-02-28 16:54:41 UTC +++ base/debug/proc_maps_linux.cc @@ -13,7 +13,7 @@ #include "base/strings/string_split.h" #include "build/build_config.h" --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) #include #endif diff --git a/www/chromium/files/patch-base_debug_stack__trace__posix.cc b/www/chromium/files/patch-base_debug_stack__trace__posix.cc index 1852f89074be..5ddbea4f56ac 100644 --- a/www/chromium/files/patch-base_debug_stack__trace__posix.cc +++ b/www/chromium/files/patch-base_debug_stack__trace__posix.cc @@ -1,38 +1,38 @@ ---- base/debug/stack_trace_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/debug/stack_trace_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/debug/stack_trace_posix.cc -@@ -35,7 +35,7 @@ +@@ -37,7 +37,7 @@ #include #endif --#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) #include "base/debug/proc_maps_linux.h" #endif -@@ -693,6 +693,9 @@ class SandboxSymbolizeHelper { +@@ -695,6 +695,9 @@ class SandboxSymbolizeHelper { // for the modules that are loaded in the current process. // Returns true on success. bool CacheMemoryRegions() { -+#if defined(OS_BSD) ++#if BUILDFLAG(IS_BSD) + return false; +#else // Reads /proc/self/maps. std::string contents; if (!ReadProcMaps(&contents)) { -@@ -710,6 +713,7 @@ class SandboxSymbolizeHelper { +@@ -712,6 +715,7 @@ class SandboxSymbolizeHelper { is_initialized_ = true; return true; +#endif } // Opens all object files and caches their file descriptors. -@@ -866,7 +870,7 @@ size_t CollectStackTrace(void** trace, size_t count) { +@@ -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) && !defined(OS_BSD) ++#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_files_file__path__watcher__unittest.cc b/www/chromium/files/patch-base_files_file__path__watcher__unittest.cc new file mode 100644 index 000000000000..e0978f8b9384 --- /dev/null +++ b/www/chromium/files/patch-base_files_file__path__watcher__unittest.cc @@ -0,0 +1,29 @@ +--- base/files/file_path_watcher_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/files/file_path_watcher_unittest.cc +@@ -450,7 +450,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) { + VLOG(1) << "Waiting for file1 creation"; + ASSERT_TRUE(WaitForEvents()); + +-#if !BUILDFLAG(IS_APPLE) ++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) + // Mac implementation does not detect files modified in a directory. + ASSERT_TRUE(WriteFile(file1, "content v2")); + VLOG(1) << "Waiting for file1 modification"; +@@ -1038,7 +1038,7 @@ enum Permission { + Execute + }; + +-#if BUILDFLAG(IS_APPLE) ++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) + bool ChangeFilePermissions(const FilePath& path, Permission perm, bool allow) { + struct stat stat_buf; + +@@ -1069,7 +1069,7 @@ bool ChangeFilePermissions(const FilePath& path, Permi + } + #endif // BUILDFLAG(IS_APPLE) + +-#if BUILDFLAG(IS_APPLE) ++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) + // Linux implementation of FilePathWatcher doesn't catch attribute changes. + // http://crbug.com/78043 + // Windows implementation of FilePathWatcher catches attribute changes that diff --git a/www/chromium/files/patch-base_files_file__util__unittest.cc b/www/chromium/files/patch-base_files_file__util__unittest.cc new file mode 100644 index 000000000000..4ab8b350d668 --- /dev/null +++ b/www/chromium/files/patch-base_files_file__util__unittest.cc @@ -0,0 +1,20 @@ +--- base/files/file_util_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/files/file_util_unittest.cc +@@ -3524,7 +3524,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) { + } + #endif // BUILDFLAG(IS_WIN) + +-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) ++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) + TEST_F(FileUtilTest, ReadFileToStringWithProcFileSystem) { + FilePath file_path("/proc/cpuinfo"); + std::string data = "temp"; +@@ -4240,7 +4240,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles + NULL); + #else + size_t bytes_written = +- ::write(::fileno(output_file.get()), content.c_str(), content.length()); ++ ::write(fileno(output_file.get()), content.c_str(), content.length()); + #endif + EXPECT_EQ(content.length(), bytes_written); + ::fflush(output_file.get()); diff --git a/www/chromium/files/patch-base_files_important__file__writer__cleaner.cc b/www/chromium/files/patch-base_files_important__file__writer__cleaner.cc index 63a8f084dee3..80f08d51a819 100644 --- a/www/chromium/files/patch-base_files_important__file__writer__cleaner.cc +++ b/www/chromium/files/patch-base_files_important__file__writer__cleaner.cc @@ -1,12 +1,12 @@ ---- base/files/important_file_writer_cleaner.cc.orig 2022-02-07 13:39:41 UTC +--- base/files/important_file_writer_cleaner.cc.orig 2022-02-28 16:54:41 UTC +++ base/files/important_file_writer_cleaner.cc -@@ -24,7 +24,8 @@ namespace base { +@@ -25,7 +25,8 @@ namespace base { namespace { base::Time GetUpperBoundTime() { --#if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_FUCHSIA) +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) +// needed because of .CreationTime() pledge -+#if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_FUCHSIA) || defined(OS_BSD) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // If process creation time is not available then use instance creation // time as the upper-bound for old files. Modification times may be // rounded-down to coarse-grained increments, e.g. FAT has 2s granularity, diff --git a/www/chromium/files/patch-base_files_scoped__file.cc b/www/chromium/files/patch-base_files_scoped__file.cc index 874e2e3d597a..350c73cc76e7 100644 --- a/www/chromium/files/patch-base_files_scoped__file.cc +++ b/www/chromium/files/patch-base_files_scoped__file.cc @@ -1,11 +1,11 @@ ---- base/files/scoped_file.cc.orig 2022-02-07 13:39:41 UTC +--- base/files/scoped_file.cc.orig 2022-02-28 16:54:41 UTC +++ base/files/scoped_file.cc @@ -31,7 +31,7 @@ void ScopedFDCloseTraits::Free(int fd) { int ret = IGNORE_EINTR(close(fd)); - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_APPLE) || \ -- defined(OS_FUCHSIA) || defined(OS_ANDROID) -+ defined(OS_FUCHSIA) || defined(OS_ANDROID) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \ +- BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // NB: Some file descriptors can return errors from close() e.g. network // filesystems such as NFS and Linux input devices. On Linux, macOS, and // Fuchsia's POSIX layer, errors from close other than EBADF do not indicate diff --git a/www/chromium/files/patch-base_i18n_icu__util.cc b/www/chromium/files/patch-base_i18n_icu__util.cc index 36122feefefa..f5d9b12738d7 100644 --- a/www/chromium/files/patch-base_i18n_icu__util.cc +++ b/www/chromium/files/patch-base_i18n_icu__util.cc @@ -1,21 +1,20 @@ ---- base/i18n/icu_util.cc.orig 2022-02-07 13:39:41 UTC +--- base/i18n/icu_util.cc.orig 2022-02-28 16:54:41 UTC +++ base/i18n/icu_util.cc -@@ -49,7 +49,7 @@ - #include "third_party/icu/source/common/unicode/unistr.h" +@@ -52,7 +52,7 @@ #endif --#if defined(OS_ANDROID) || defined(OS_FUCHSIA) || \ -+#if defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_BSD) || \ - ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && !BUILDFLAG(IS_CHROMECAST)) + #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ +- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ ++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ + !BUILDFLAG(IS_CHROMECAST)) #include "third_party/icu/source/i18n/unicode/timezone.h" #endif -@@ -343,7 +343,8 @@ void InitializeIcuTimeZone() { +@@ -346,7 +346,7 @@ void InitializeIcuTimeZone() { FuchsiaIntlProfileWatcher::GetPrimaryTimeZoneIdForIcuInitialization(); icu::TimeZone::adoptDefault( icu::TimeZone::createTimeZone(icu::UnicodeString::fromUTF8(zone_id))); --#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && !BUILDFLAG(IS_CHROMECAST) -+#elif (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && \ -+ !BUILDFLAG(IS_CHROMECAST) +-#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ ++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ + !BUILDFLAG(IS_CHROMECAST) // To respond to the time zone change properly, the default time zone // cache in ICU has to be populated on starting up. - // See TimeZoneMonitorLinux::NotifyClientsFromImpl(). diff --git a/www/chromium/files/patch-base_logging__unittest.cc b/www/chromium/files/patch-base_logging__unittest.cc new file mode 100644 index 000000000000..875546922a1c --- /dev/null +++ b/www/chromium/files/patch-base_logging__unittest.cc @@ -0,0 +1,31 @@ +--- base/logging_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/logging_unittest.cc +@@ -32,7 +32,7 @@ + #include "base/posix/eintr_wrapper.h" + #endif // BUILDFLAG(IS_POSIX) + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) + #include + #endif + +@@ -552,14 +552,18 @@ void CheckCrashTestSighandler(int, siginfo_t* info, vo + // need the arch-specific boilerplate below, which is inspired by breakpad. + // At the same time, on OSX, ucontext.h is deprecated but si_addr works fine. + uintptr_t crash_addr = 0; +-#if BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FREEBSD) + crash_addr = reinterpret_cast(info->si_addr); + #else // OS_* + ucontext_t* context = reinterpret_cast(context_ptr); + #if defined(ARCH_CPU_X86) + crash_addr = static_cast(context->uc_mcontext.gregs[REG_EIP]); + #elif defined(ARCH_CPU_X86_64) ++#if BUILDFLAG(IS_OPENBSD) ++ crash_addr = static_cast(context->sc_rip); ++#else + crash_addr = static_cast(context->uc_mcontext.gregs[REG_RIP]); ++#endif + #elif defined(ARCH_CPU_ARMEL) + crash_addr = static_cast(context->uc_mcontext.arm_pc); + #elif defined(ARCH_CPU_ARM64) diff --git a/www/chromium/files/patch-base_memory_discardable__memory.cc b/www/chromium/files/patch-base_memory_discardable__memory.cc index 136569ca00cd..350a28608203 100644 --- a/www/chromium/files/patch-base_memory_discardable__memory.cc +++ b/www/chromium/files/patch-base_memory_discardable__memory.cc @@ -1,38 +1,38 @@ ---- base/memory/discardable_memory.cc.orig 2022-02-07 13:39:41 UTC +--- base/memory/discardable_memory.cc.orig 2022-02-28 16:54:41 UTC +++ base/memory/discardable_memory.cc @@ -24,7 +24,7 @@ const base::Feature kMadvFreeDiscardableMemory{ "MadvFreeDiscardableMemory", base::FEATURE_DISABLED_BY_DEFAULT}; - #endif // defined(OS_POSIX) + #endif // BUILDFLAG(IS_POSIX) --#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) const base::Feature kDiscardableMemoryBackingTrial{ "DiscardableMemoryBackingTrial", base::FEATURE_DISABLED_BY_DEFAULT}; -@@ -48,7 +48,7 @@ const base::FeatureParam +@@ -49,7 +49,7 @@ const base::FeatureParam namespace { --#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) DiscardableMemoryBacking GetBackingForFieldTrial() { DiscardableMemoryTrialGroup trial_group = -@@ -66,7 +66,7 @@ DiscardableMemoryBacking GetBackingForFieldTrial() { +@@ -68,7 +68,7 @@ DiscardableMemoryBacking GetBackingForFieldTrial() { } // namespace --#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Probe capabilities of this device to determine whether we should participate // in the discardable memory backing trial. -@@ -95,7 +95,7 @@ DiscardableMemory::DiscardableMemory() = default; +@@ -98,7 +98,7 @@ DiscardableMemory::DiscardableMemory() = default; DiscardableMemory::~DiscardableMemory() = default; DiscardableMemoryBacking GetDiscardableMemoryBacking() { --#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (DiscardableMemoryBackingFieldTrialIsEnabled()) { return GetBackingForFieldTrial(); } diff --git a/www/chromium/files/patch-base_memory_discardable__memory__internal.h b/www/chromium/files/patch-base_memory_discardable__memory__internal.h index c511cb6b113c..13bef7210432 100644 --- a/www/chromium/files/patch-base_memory_discardable__memory__internal.h +++ b/www/chromium/files/patch-base_memory_discardable__memory__internal.h @@ -1,11 +1,11 @@ ---- base/memory/discardable_memory_internal.h.orig 2022-02-07 13:39:41 UTC +--- base/memory/discardable_memory_internal.h.orig 2022-02-28 16:54:41 UTC +++ base/memory/discardable_memory_internal.h @@ -10,7 +10,7 @@ #include "base/metrics/field_trial_params.h" #include "build/build_config.h" --#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) namespace base { diff --git a/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc b/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc index 51230808b76b..1f2283b19981 100644 --- a/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc +++ b/www/chromium/files/patch-base_memory_madv__free__discardable__memory__posix.cc @@ -1,21 +1,21 @@ ---- base/memory/madv_free_discardable_memory_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/memory/madv_free_discardable_memory_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/memory/madv_free_discardable_memory_posix.cc -@@ -292,6 +292,10 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT +@@ -294,6 +294,10 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT bool MadvFreeDiscardableMemoryPosix::IsResident() const { DFAKE_SCOPED_RECURSIVE_LOCK(thread_collision_warner_); +// XXX mincore -+#if defined(OS_BSD) ++#if BUILDFLAG(IS_BSD) + return false; +#else - #if defined(OS_APPLE) + #if BUILDFLAG(IS_APPLE) std::vector vec(allocated_pages_); #else -@@ -307,6 +311,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons +@@ -309,6 +313,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons return false; } return true; +#endif } bool MadvFreeDiscardableMemoryPosix::IsDiscarded() const { diff --git a/www/chromium/files/patch-base_memory_platform__shared__memory__region.h b/www/chromium/files/patch-base_memory_platform__shared__memory__region.h index 6057569add0b..002915dba49c 100644 --- a/www/chromium/files/patch-base_memory_platform__shared__memory__region.h +++ b/www/chromium/files/patch-base_memory_platform__shared__memory__region.h @@ -1,29 +1,29 @@ ---- base/memory/platform_shared_memory_region.h.orig 2021-12-14 11:44:55 UTC +--- base/memory/platform_shared_memory_region.h.orig 2022-02-28 16:54:41 UTC +++ base/memory/platform_shared_memory_region.h -@@ -24,7 +24,7 @@ +@@ -23,7 +23,7 @@ #include "base/files/scoped_file.h" #endif --#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) namespace content { class SandboxIPCHandler; } -@@ -117,7 +117,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { +@@ -116,7 +116,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { kMaxValue = GET_SHMEM_TEMP_DIR_FAILURE }; --#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) // Structure to limit access to executable region creation. struct ExecutableRegion { private: -@@ -264,7 +264,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { +@@ -263,7 +263,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion { CheckPlatformHandlePermissionsCorrespondToMode); static PlatformSharedMemoryRegion Create(Mode mode, size_t size --#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) , bool executable = false #endif diff --git a/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc b/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc index a35c8d880061..dc7c81b3ea39 100644 --- a/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc +++ b/www/chromium/files/patch-base_memory_platform__shared__memory__region__posix.cc @@ -1,29 +1,29 @@ ---- base/memory/platform_shared_memory_region_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/memory/platform_shared_memory_region_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/memory/platform_shared_memory_region_posix.cc @@ -70,7 +70,7 @@ FDPair ScopedFDPair::get() const { return {fd.get(), readonly_fd.get()}; } --#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 ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) { PlatformSharedMemoryRegion region = @@ -204,7 +204,7 @@ bool PlatformSharedMemoryRegion::MapAtInternal(off_t o // static PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode, size_t size --#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) , bool executable #endif @@ -233,7 +233,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion: // flag. FilePath directory; if (!GetShmemTempDir( --#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) executable, #else false /* executable */, diff --git a/www/chromium/files/patch-base_message__loop_message__pump__glib.cc b/www/chromium/files/patch-base_message__loop_message__pump__glib.cc index 5cf21bba2dbd..047712904c6f 100644 --- a/www/chromium/files/patch-base_message__loop_message__pump__glib.cc +++ b/www/chromium/files/patch-base_message__loop_message__pump__glib.cc @@ -1,28 +1,28 @@ ---- base/message_loop/message_pump_glib.cc.orig 2021-09-14 01:51:47 UTC +--- base/message_loop/message_pump_glib.cc.orig 2022-02-28 16:54:41 UTC +++ base/message_loop/message_pump_glib.cc @@ -8,6 +8,11 @@ #include #include -+#if defined(OS_BSD) ++#if BUILDFLAG(IS_BSD) +#include +#include +#endif + #include "base/logging.h" #include "base/notreached.h" #include "base/numerics/safe_conversions.h" -@@ -49,9 +54,13 @@ int GetTimeIntervalMilliseconds(TimeTicks next_task_ti +@@ -50,9 +55,13 @@ int GetTimeIntervalMilliseconds(TimeTicks next_task_ti } bool RunningOnMainThread() { -+#if defined(OS_BSD) ++#if BUILDFLAG(IS_BSD) + return pthread_main_np(); +#else auto pid = getpid(); auto tid = PlatformThread::CurrentId(); return pid > 0 && tid > 0 && pid == tid; +#endif } // A brief refresher on GLib: diff --git a/www/chromium/files/patch-base_native__library__posix.cc b/www/chromium/files/patch-base_native__library__posix.cc index a7ea746723c5..1aca9e8e282e 100644 --- a/www/chromium/files/patch-base_native__library__posix.cc +++ b/www/chromium/files/patch-base_native__library__posix.cc @@ -1,11 +1,11 @@ ---- base/native_library_posix.cc.orig 2021-04-14 18:40:48 UTC +--- base/native_library_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/native_library_posix.cc -@@ -31,7 +31,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP +@@ -32,7 +32,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP // http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892, // and http://crbug.com/40794. int flags = RTLD_LAZY; --#if defined(OS_ANDROID) || !defined(RTLD_DEEPBIND) -+#if defined(OS_ANDROID) || !defined(RTLD_DEEPBIND) || defined(OS_BSD) +-#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND) ++#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND) || BUILDFLAG(IS_BSD) // Certain platforms don't define RTLD_DEEPBIND. Android dlopen() requires // further investigation, as it might vary across versions. Crash here to // warn developers that they're trying to rely on uncertain behavior. diff --git a/www/chromium/files/patch-base_native__library__unittest.cc b/www/chromium/files/patch-base_native__library__unittest.cc new file mode 100644 index 000000000000..4729ea97fb39 --- /dev/null +++ b/www/chromium/files/patch-base_native__library__unittest.cc @@ -0,0 +1,11 @@ +--- base/native_library_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/native_library_unittest.cc +@@ -119,7 +119,7 @@ TEST(NativeLibraryTest, LoadLibrary) { + // versions with respect to symbol resolution scope. + // TSan and MSan error out on RTLD_DEEPBIND, https://crbug.com/705255 + #if !BUILDFLAG(IS_ANDROID) && !defined(THREAD_SANITIZER) && \ +- !defined(MEMORY_SANITIZER) ++ !defined(MEMORY_SANITIZER) && !BUILDFLAG(IS_BSD) + + // Verifies that the |prefer_own_symbols| option satisfies its guarantee that + // a loaded library will always prefer local symbol resolution before diff --git a/www/chromium/files/patch-base_posix_can__lower__nice__to.cc b/www/chromium/files/patch-base_posix_can__lower__nice__to.cc index 43b20c5e8988..67a5d35808ae 100644 --- a/www/chromium/files/patch-base_posix_can__lower__nice__to.cc +++ b/www/chromium/files/patch-base_posix_can__lower__nice__to.cc @@ -1,16 +1,16 @@ ---- base/posix/can_lower_nice_to.cc.orig 2022-02-07 13:39:41 UTC +--- base/posix/can_lower_nice_to.cc.orig 2022-02-28 16:54:41 UTC +++ base/posix/can_lower_nice_to.cc @@ -11,8 +11,12 @@ #include "build/build_config.h" -+#if defined(OS_FREEBSD) ++#if BUILDFLAG(IS_FREEBSD) +#include +#endif + // Not defined on AIX by default. --#if defined(OS_AIX) -+#if defined(OS_AIX) || defined(OS_BSD) +-#if BUILDFLAG(IS_AIX) ++#if BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) #if defined(RLIMIT_NICE) #error Assumption about OS_AIX is incorrect #endif diff --git a/www/chromium/files/patch-base_posix_unix__domain__socket.cc b/www/chromium/files/patch-base_posix_unix__domain__socket.cc index db441a342cef..9fac90a4accf 100644 --- a/www/chromium/files/patch-base_posix_unix__domain__socket.cc +++ b/www/chromium/files/patch-base_posix_unix__domain__socket.cc @@ -1,39 +1,39 @@ ---- base/posix/unix_domain_socket.cc.orig 2022-02-07 13:39:41 UTC +--- base/posix/unix_domain_socket.cc.orig 2022-02-28 16:54:41 UTC +++ base/posix/unix_domain_socket.cc @@ -50,7 +50,7 @@ bool CreateSocketPair(ScopedFD* one, ScopedFD* two) { // static bool UnixDomainSocket::EnableReceiveProcessId(int fd) { --#if !defined(OS_APPLE) -+#if !defined(OS_APPLE) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_APPLE) ++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) const int enable = 1; return setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)) == 0; #else @@ -140,7 +140,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, const size_t kControlBufferSize = CMSG_SPACE(sizeof(int) * kMaxFileDescriptors) --#if !defined(OS_APPLE) -+#if !defined(OS_APPLE) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_APPLE) ++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) // macOS does not support ucred. // macOS supports xucred, but this structure is insufficient. + CMSG_SPACE(sizeof(struct ucred)) @@ -168,7 +168,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, wire_fds = reinterpret_cast(CMSG_DATA(cmsg)); wire_fds_len = payload_len / sizeof(int); } --#if !defined(OS_APPLE) -+#if !defined(OS_APPLE) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_APPLE) ++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) // macOS does not support SCM_CREDENTIALS. if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDENTIALS) { @@ -202,6 +202,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, socklen_t pid_size = sizeof(pid); if (getsockopt(fd, SOL_LOCAL, LOCAL_PEERPID, &pid, &pid_size) != 0) pid = -1; -+#elif defined(OS_BSD) ++#elif BUILDFLAG(IS_BSD) + NOTIMPLEMENTED(); + pid = -1; #else // |pid| will legitimately be -1 if we read EOF, so only DCHECK if we // actually received a message. Unfortunately, Linux allows sending zero diff --git a/www/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc b/www/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc new file mode 100644 index 000000000000..b2744d4abb50 --- /dev/null +++ b/www/chromium/files/patch-base_posix_unix__domain__socket__unittest.cc @@ -0,0 +1,11 @@ +--- base/posix/unix_domain_socket_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/posix/unix_domain_socket_unittest.cc +@@ -10,6 +10,8 @@ + #include + #include + ++#include ++ + #include "base/bind.h" + #include "base/callback_helpers.h" + #include "base/files/file_util.h" diff --git a/www/chromium/files/patch-base_process_kill.h b/www/chromium/files/patch-base_process_kill.h index d74a364d078e..df8eb9fb5f9c 100644 --- a/www/chromium/files/patch-base_process_kill.h +++ b/www/chromium/files/patch-base_process_kill.h @@ -1,11 +1,11 @@ ---- base/process/kill.h.orig 2022-02-07 13:39:41 UTC +--- base/process/kill.h.orig 2022-02-28 16:54:41 UTC +++ base/process/kill.h @@ -112,7 +112,7 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus( ProcessHandle handle, int* exit_code); --#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) // Spawns a thread to wait asynchronously for the child |process| to exit // and then reaps it. BASE_EXPORT void EnsureProcessGetsReaped(Process process); diff --git a/www/chromium/files/patch-base_process_kill__posix.cc b/www/chromium/files/patch-base_process_kill__posix.cc index 1fc27331b044..f2229616fa15 100644 --- a/www/chromium/files/patch-base_process_kill__posix.cc +++ b/www/chromium/files/patch-base_process_kill__posix.cc @@ -1,11 +1,11 @@ ---- base/process/kill_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/kill_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/process/kill_posix.cc @@ -159,7 +159,7 @@ void EnsureProcessTerminated(Process process) { 0, new BackgroundReaper(std::move(process), Seconds(2))); } --#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) void EnsureProcessGetsReaped(Process process) { DCHECK(!process.is_current()); diff --git a/www/chromium/files/patch-base_process_launch.h b/www/chromium/files/patch-base_process_launch.h index 0fe8b6553511..61716eeeb3f4 100644 --- a/www/chromium/files/patch-base_process_launch.h +++ b/www/chromium/files/patch-base_process_launch.h @@ -1,11 +1,11 @@ ---- base/process/launch.h.orig 2022-02-07 13:39:41 UTC +--- base/process/launch.h.orig 2022-02-28 16:54:41 UTC +++ base/process/launch.h -@@ -192,7 +192,7 @@ struct BASE_EXPORT LaunchOptions { +@@ -195,7 +195,7 @@ struct BASE_EXPORT LaunchOptions { bool clear_environment = false; - #endif // OS_WIN || OS_POSIX || OS_FUCHSIA + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) --#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 non-zero, start the process using clone(), using flags as provided. // Unlike in clone, clone_flags may not contain a custom termination signal // that is sent to the parent when the child dies. The termination signal will diff --git a/www/chromium/files/patch-base_process_memory.cc b/www/chromium/files/patch-base_process_memory.cc index 67b524cc8e85..13cd43d79b6c 100644 --- a/www/chromium/files/patch-base_process_memory.cc +++ b/www/chromium/files/patch-base_process_memory.cc @@ -1,20 +1,20 @@ ---- base/process/memory.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/memory.cc.orig 2022-02-28 16:54:41 UTC +++ base/process/memory.cc -@@ -63,14 +63,16 @@ NOINLINE void OnNoMemoryInternal(size_t size) { +@@ -65,14 +65,16 @@ NOINLINE void OnNoMemoryInternal(size_t size) { } // namespace internal -+#if !defined(OS_BSD) ++#if !BUILDFLAG(IS_BSD) void TerminateBecauseOutOfMemory(size_t size) { internal::OnNoMemoryInternal(size); } +#endif // Defined in memory_mac.mm for macOS + use_allocator="none". In case of // USE_PARTITION_ALLOC_AS_MALLOC, no need to route the call to the system // default calloc of macOS. --#if !defined(OS_APPLE) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) -+#if (!defined(OS_APPLE) && !defined(OS_BSD)) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +-#if !BUILDFLAG(IS_APPLE) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) ++#if (!BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) bool UncheckedCalloc(size_t num_items, size_t size, void** result) { const size_t alloc_size = num_items * size; diff --git a/www/chromium/files/patch-base_process_process__handle.cc b/www/chromium/files/patch-base_process_process__handle.cc index 781e7bafa948..efb95e7c3b54 100644 --- a/www/chromium/files/patch-base_process_process__handle.cc +++ b/www/chromium/files/patch-base_process_process__handle.cc @@ -1,11 +1,11 @@ ---- base/process/process_handle.cc.orig 2021-04-14 18:40:48 UTC +--- base/process/process_handle.cc.orig 2022-02-28 16:54:41 UTC +++ base/process/process_handle.cc @@ -30,7 +30,7 @@ UniqueProcId GetUniqueIdForProcess() { : UniqueProcId(GetCurrentProcId()); } --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_AIX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) void InitUniqueIdForProcessInPidNamespace(ProcessId pid_outside_of_namespace) { DCHECK(pid_outside_of_namespace != kNullProcessId); diff --git a/www/chromium/files/patch-base_process_process__handle.h b/www/chromium/files/patch-base_process_process__handle.h index 1708776734a2..5e25e86d099c 100644 --- a/www/chromium/files/patch-base_process_process__handle.h +++ b/www/chromium/files/patch-base_process_process__handle.h @@ -1,11 +1,11 @@ ---- base/process/process_handle.h.orig 2021-07-19 18:45:05 UTC +--- base/process/process_handle.h.orig 2022-02-28 16:54:41 UTC +++ base/process/process_handle.h @@ -106,7 +106,7 @@ BASE_EXPORT ProcessId GetCurrentProcId(); // processes may be reused. BASE_EXPORT UniqueProcId GetUniqueIdForProcess(); --#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) // When a process is started in a different PID namespace from the browser // process, this function must be called with the process's PID in the browser's // PID namespace in order to initialize its unique ID. Not thread safe. diff --git a/www/chromium/files/patch-base_process_process__metrics.cc b/www/chromium/files/patch-base_process_process__metrics.cc index aff587d7cf98..a20644fcc0a1 100644 --- a/www/chromium/files/patch-base_process_process__metrics.cc +++ b/www/chromium/files/patch-base_process_process__metrics.cc @@ -1,38 +1,38 @@ ---- base/process/process_metrics.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/process_metrics.cc.orig 2022-02-28 16:54:41 UTC +++ base/process/process_metrics.cc @@ -18,7 +18,7 @@ namespace base { namespace { - #if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #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 defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#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 defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#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); @@ -126,7 +126,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage( #endif - #if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int ProcessMetrics::CalculateIdleWakeupsPerSecond( uint64_t absolute_idle_wakeups) { return CalculateEventsPerSecond(absolute_idle_wakeups, diff --git a/www/chromium/files/patch-base_process_process__metrics.h b/www/chromium/files/patch-base_process_process__metrics.h index d56de6d74153..940559196a29 100644 --- a/www/chromium/files/patch-base_process_process__metrics.h +++ b/www/chromium/files/patch-base_process_process__metrics.h @@ -1,119 +1,119 @@ ---- base/process/process_metrics.h.orig 2022-02-07 13:39:41 UTC +--- base/process/process_metrics.h.orig 2022-02-28 16:54:41 UTC +++ base/process/process_metrics.h -@@ -37,7 +37,7 @@ +@@ -36,7 +36,7 @@ #endif - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) #include #include #include -@@ -53,7 +53,7 @@ class Value; +@@ -52,7 +52,7 @@ class Value; // Full declaration is in process_metrics_iocounters.h. struct IoCounters; --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Minor and major page fault counts since the process creation. // Both counts are process-wide, and exclude child processes. // @@ -107,7 +107,7 @@ class BASE_EXPORT ProcessMetrics { // convenience wrapper for CreateProcessMetrics(). static std::unique_ptr CreateCurrentProcessMetrics(); --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Resident Set Size is a Linux/Android specific memory concept. Do not // attempt to extend this to other platforms. BASE_EXPORT size_t GetResidentSetSize() const; @@ -134,7 +134,7 @@ class BASE_EXPORT ProcessMetrics { - TimeDelta GetCumulativeCPUUsage() WARN_UNUSED_RESULT; + [[nodiscard]] TimeDelta GetCumulativeCPUUsage(); - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Emits the cumulative CPU usage for all currently active threads since they // were started into the output parameter (replacing its current contents). // Threads that have already terminated will not be reported. Thus, the sum of @@ -217,7 +217,7 @@ class BASE_EXPORT ProcessMetrics { int GetOpenFdSoftLimit() const; - #endif // defined(OS_POSIX) + #endif // BUILDFLAG(IS_POSIX) --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) // Bytes of swap as reported by /proc/[pid]/status. uint64_t GetVmSwapBytes() const; -@@ -237,7 +237,7 @@ class BASE_EXPORT ProcessMetrics { - #endif // !defined(OS_MAC) +@@ -238,7 +238,7 @@ class BASE_EXPORT ProcessMetrics { + #endif // !BUILDFLAG(IS_MAC) - #if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups); #endif - #if defined(OS_APPLE) -@@ -248,7 +248,7 @@ class BASE_EXPORT ProcessMetrics { + #if BUILDFLAG(IS_APPLE) +@@ -249,7 +249,7 @@ class BASE_EXPORT ProcessMetrics { #endif - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) CPU::CoreType GetCoreType(int core_index); - #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || - // defined(OS_AIX) -@@ -273,7 +273,7 @@ class BASE_EXPORT ProcessMetrics { + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) +@@ -274,7 +274,7 @@ class BASE_EXPORT ProcessMetrics { uint64_t last_cumulative_disk_usage_ = 0; - #if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Same thing for idle wakeups. TimeTicks last_idle_wakeups_time_; uint64_t last_absolute_idle_wakeups_; -@@ -316,7 +316,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de +@@ -317,7 +317,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de - #if defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) || \ - defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_AIX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Data about system-wide memory consumption. Values are in KB. Available on // Windows, Mac, Linux, Android and Chrome OS. // -@@ -351,7 +351,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { +@@ -352,7 +352,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { #endif - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // This provides an estimate of available memory as described here: // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always -@@ -366,7 +366,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { +@@ -367,7 +367,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { #endif - #if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) || defined(OS_FUCHSIA) -+ defined(OS_AIX) || defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) int buffers = 0; int cached = 0; int active_anon = 0; -@@ -403,7 +403,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK - // defined(OS_FUCHSIA) +@@ -404,7 +404,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK + // BUILDFLAG(IS_FUCHSIA) - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) // Parse the data found in /proc//stat and return the sum of the // CPU-related ticks. Returns -1 on parse error. // Exposed for testing. -@@ -590,7 +590,7 @@ class BASE_EXPORT SystemMetrics { +@@ -591,7 +591,7 @@ class BASE_EXPORT SystemMetrics { FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics); size_t committed_memory_; --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) SystemMemoryInfoKB memory_info_; VmStatInfo vmstat_info_; SystemDiskInfo disk_info_; diff --git a/www/chromium/files/patch-base_process_process__metrics__posix.cc b/www/chromium/files/patch-base_process_process__metrics__posix.cc index 9e3e19fc7abb..e51334a26d54 100644 --- a/www/chromium/files/patch-base_process_process__metrics__posix.cc +++ b/www/chromium/files/patch-base_process_process__metrics__posix.cc @@ -1,20 +1,20 @@ ---- base/process/process_metrics_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/process_metrics_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/process/process_metrics_posix.cc @@ -20,6 +20,8 @@ - #if defined(OS_APPLE) + #if BUILDFLAG(IS_APPLE) #include -+#elif defined(OS_OPENBSD) ++#elif BUILDFLAG(IS_OPENBSD) +#include #else #include #endif -@@ -136,7 +138,7 @@ size_t ProcessMetrics::GetMallocUsage() { +@@ -133,7 +135,7 @@ size_t ProcessMetrics::GetMallocUsage() { return stats.size_in_use; - #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) + #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) return GetMallocUsageMallinfo(); --#elif defined(OS_FUCHSIA) -+#elif defined(OS_FUCHSIA) || defined(OS_BSD) +-#elif BUILDFLAG(IS_FUCHSIA) ++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // TODO(fuchsia): Not currently exposed. https://crbug.com/735087. return 0; #endif diff --git a/www/chromium/files/patch-base_process_process__posix.cc b/www/chromium/files/patch-base_process_process__posix.cc index b2245b1ea796..8a7b5721a4a7 100644 --- a/www/chromium/files/patch-base_process_process__posix.cc +++ b/www/chromium/files/patch-base_process_process__posix.cc @@ -1,70 +1,93 @@ ---- base/process/process_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/process/process_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/process/process_posix.cc -@@ -27,6 +27,11 @@ +@@ -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 {} 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_process_process__unittest.cc b/www/chromium/files/patch-base_process_process__unittest.cc new file mode 100644 index 000000000000..0b87a05680b7 --- /dev/null +++ b/www/chromium/files/patch-base_process_process__unittest.cc @@ -0,0 +1,11 @@ +--- base/process/process_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/process/process_unittest.cc +@@ -140,7 +140,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) { + // was spawned and a time recorded after it was spawned. However, since the + // base::Time and process creation clocks don't match, tolerate some error. + constexpr base::TimeDelta kTolerance = +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // On Linux, process creation time is relative to boot time which has a + // 1-second resolution. Tolerate 1 second for the imprecise boot time and + // 100 ms for the imprecise clock. diff --git a/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc b/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc new file mode 100644 index 000000000000..3fd7776ba195 --- /dev/null +++ b/www/chromium/files/patch-base_profiler_stack__sampling__profiler__test__util.cc @@ -0,0 +1,11 @@ +--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2022-02-28 16:54:41 UTC ++++ base/profiler/stack_sampling_profiler_test_util.cc +@@ -32,7 +32,7 @@ + // Fortunately, it provides _alloca, which functions identically. + #include + #define alloca _alloca +-#else ++#elif !BUILDFLAG(IS_BSD) + #include + #endif + diff --git a/www/chromium/files/patch-base_profiler_stack__sampling__profiler__unittest.cc b/www/chromium/files/patch-base_profiler_stack__sampling__profiler__unittest.cc new file mode 100644 index 000000000000..d739c9137c77 --- /dev/null +++ b/www/chromium/files/patch-base_profiler_stack__sampling__profiler__unittest.cc @@ -0,0 +1,11 @@ +--- base/profiler/stack_sampling_profiler_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/profiler/stack_sampling_profiler_unittest.cc +@@ -41,7 +41,7 @@ + #include + #include + #include +-#else ++#elif !BUILDFLAG(IS_BSD) + #include + #endif + diff --git a/www/chromium/files/patch-base_rand__util.h b/www/chromium/files/patch-base_rand__util.h index 1b379c09a366..7afa38819627 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-07 13:39:41 UTC +--- base/rand_util.h.orig 2022-02-28 16:54:41 UTC +++ base/rand_util.h @@ -77,7 +77,7 @@ void RandomShuffle(Itr first, Itr last) { std::shuffle(first, last, RandomBitGenerator()); } --#if defined(OS_POSIX) -+#if defined(OS_POSIX) && !defined(OS_OPENBSD) +-#if BUILDFLAG(IS_POSIX) ++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_OPENBSD) BASE_EXPORT int GetUrandomFD(); #endif diff --git a/www/chromium/files/patch-base_rand__util__posix.cc b/www/chromium/files/patch-base_rand__util__posix.cc index 0d7503d62921..5e00097c8aa2 100644 --- a/www/chromium/files/patch-base_rand__util__posix.cc +++ b/www/chromium/files/patch-base_rand__util__posix.cc @@ -1,52 +1,52 @@ ---- base/rand_util_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/rand_util_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/rand_util_posix.cc @@ -17,7 +17,7 @@ #include "base/posix/eintr_wrapper.h" #include "build/build_config.h" --#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && !defined(OS_NACL) -+#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && !defined(OS_NACL) && !defined(OS_BSD) +-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) #include "third_party/lss/linux_syscall_support.h" - #elif defined(OS_MAC) + #elif BUILDFLAG(IS_MAC) // TODO(crbug.com/995996): Waiting for this header to appear in the iOS SDK. @@ -34,6 +34,7 @@ static constexpr int kOpenFlags = O_RDONLY; static constexpr int kOpenFlags = O_RDONLY | O_CLOEXEC; #endif -+#if !defined(OS_OPENBSD) ++#if !BUILDFLAG(IS_OPENBSD) // We keep the file descriptor for /dev/urandom around so we don't need to // reopen it (which is expensive), and since we may not even be able to reopen // it if we are later put in a sandbox. This class wraps the file descriptor so @@ -51,6 +52,7 @@ class URandomFd { private: const int fd_; }; +#endif } // namespace @@ -62,6 +64,7 @@ namespace base { // (https://chromium-review.googlesource.com/c/chromium/src/+/1545096) and land // it or some form of it. void RandBytes(void* output, size_t output_length) { -+#if !defined(OS_OPENBSD) - #if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && !defined(OS_NACL) ++#if !BUILDFLAG(IS_OPENBSD) + #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) // We have to call `getrandom` via Linux Syscall Support, rather than through // the libc wrapper, because we might not have an up-to-date libc (e.g. on @@ -93,11 +96,16 @@ void RandBytes(void* output, size_t output_length) { const bool success = ReadFromFD(urandom_fd, static_cast(output), output_length); CHECK(success); +#else + arc4random_buf(static_cast(output), output_length); +#endif } -+#if !defined(OS_OPENBSD) ++#if !BUILDFLAG(IS_OPENBSD) int GetUrandomFD() { static NoDestructor urandom_fd; return urandom_fd->fd(); } +#endif } // namespace base diff --git a/www/chromium/files/patch-base_strings_safe__sprintf__unittest.cc b/www/chromium/files/patch-base_strings_safe__sprintf__unittest.cc new file mode 100644 index 000000000000..f4353c3b265d --- /dev/null +++ b/www/chromium/files/patch-base_strings_safe__sprintf__unittest.cc @@ -0,0 +1,18 @@ +--- base/strings/safe_sprintf_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/strings/safe_sprintf_unittest.cc +@@ -731,6 +731,7 @@ TEST(SafeSPrintfTest, EmbeddedNul) { + #endif + } + ++#if !BUILDFLAG(IS_BSD) + TEST(SafeSPrintfTest, EmitNULL) { + char buf[40]; + #if defined(__GNUC__) +@@ -747,6 +748,7 @@ TEST(SafeSPrintfTest, EmitNULL) { + #pragma GCC diagnostic pop + #endif + } ++#endif + + TEST(SafeSPrintfTest, PointerSize) { + // The internal data representation is a 64bit value, independent of the diff --git a/www/chromium/files/patch-base_strings_string__util.cc b/www/chromium/files/patch-base_strings_string__util.cc deleted file mode 100644 index 1003ec60edef..000000000000 --- a/www/chromium/files/patch-base_strings_string__util.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- base/strings/string_util.cc.orig 2022-02-07 13:39:41 UTC -+++ base/strings/string_util.cc -@@ -36,7 +36,7 @@ namespace base { - bool IsWprintfFormatPortable(const wchar_t* format) { - // This snippet of code checks that we can build C++17 code. - // TODO(thakis): Enable this on all platforms, and then remove it again. --#if !defined(OS_LINUX) && !BUILDFLAG(CFI_ICALL_CHECK) && \ -+#if !defined(OS_LINUX) && !defined(OS_BSD) && !BUILDFLAG(CFI_ICALL_CHECK) && \ - !BUILDFLAG(CFI_CAST_CHECK) - if constexpr (constexpr int i = 0; i > 0) { - } diff --git a/www/chromium/files/patch-base_synchronization_lock__impl.h b/www/chromium/files/patch-base_synchronization_lock__impl.h index 5e7c175fb687..f9f875ee3934 100644 --- a/www/chromium/files/patch-base_synchronization_lock__impl.h +++ b/www/chromium/files/patch-base_synchronization_lock__impl.h @@ -1,23 +1,23 @@ ---- base/synchronization/lock_impl.h.orig 2022-02-07 13:39:41 UTC +--- base/synchronization/lock_impl.h.orig 2022-02-28 16:54:41 UTC +++ base/synchronization/lock_impl.h @@ -107,6 +107,10 @@ void LockImpl::Unlock() { } - #elif defined(OS_POSIX) || defined(OS_FUCHSIA) -+#if defined(OS_FREEBSD) + #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) ++#if BUILDFLAG(IS_FREEBSD) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wthread-safety-analysis" +#endif BASE_EXPORT std::string SystemErrorCodeToString(int error_code); @@ -121,6 +125,9 @@ void LockImpl::Unlock() { int rv = pthread_mutex_unlock(&native_handle_); DCHECK_EQ(rv, 0) << ". " << strerror(rv); } -+#if defined(OS_FREEBSD) ++#if BUILDFLAG(IS_FREEBSD) +#pragma GCC diagnostic pop +#endif #endif // This is an implementation used for AutoLock templated on the lock type. diff --git a/www/chromium/files/patch-base_syslog__logging.cc b/www/chromium/files/patch-base_syslog__logging.cc index 9c9bf076d52b..5c1921e82d4a 100644 --- a/www/chromium/files/patch-base_syslog__logging.cc +++ b/www/chromium/files/patch-base_syslog__logging.cc @@ -1,20 +1,20 @@ ---- base/syslog_logging.cc.orig 2021-12-31 00:57:18 UTC +--- base/syslog_logging.cc.orig 2022-02-28 16:54:41 UTC +++ base/syslog_logging.cc -@@ -13,7 +13,7 @@ +@@ -15,7 +15,7 @@ #include "base/strings/string_util.h" #include "base/win/scoped_handle.h" #include "base/win/win_util.h" --#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) // defines LOG_INFO, LOG_WARNING macros that could conflict with // base::LOG_INFO, base::LOG_WARNING. #include -@@ -145,7 +145,7 @@ EventLogMessage::~EventLogMessage() { +@@ -147,7 +147,7 @@ EventLogMessage::~EventLogMessage() { if (user_sid != nullptr) ::LocalFree(user_sid); --#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) const char kEventSource[] = "chrome"; openlog(kEventSource, LOG_NOWAIT | LOG_PID, LOG_USER); // We can't use the defined names for the logging severity from syslog.h diff --git a/www/chromium/files/patch-base_system_sys__info.cc b/www/chromium/files/patch-base_system_sys__info.cc index 66ca14e577d0..f991071fe48a 100644 --- a/www/chromium/files/patch-base_system_sys__info.cc +++ b/www/chromium/files/patch-base_system_sys__info.cc @@ -1,11 +1,11 @@ ---- base/system/sys_info.cc.orig 2022-02-07 13:39:41 UTC +--- base/system/sys_info.cc.orig 2022-02-28 16:54:41 UTC +++ base/system/sys_info.cc @@ -100,7 +100,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallbackmodel)); + 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_task_thread__pool_environment__config__unittest.cc b/www/chromium/files/patch-base_task_thread__pool_environment__config__unittest.cc new file mode 100644 index 000000000000..18a649f3ba84 --- /dev/null +++ b/www/chromium/files/patch-base_task_thread__pool_environment__config__unittest.cc @@ -0,0 +1,11 @@ +--- base/task/thread_pool/environment_config_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/task/thread_pool/environment_config_unittest.cc +@@ -15,7 +15,7 @@ TEST(ThreadPoolEnvironmentConfig, CanUseBackgroundPrio + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) + EXPECT_TRUE(CanUseBackgroundPriorityForWorkerThread()); + #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ +- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL) ++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD) + EXPECT_FALSE(CanUseBackgroundPriorityForWorkerThread()); + #else + #error Platform doesn't match any block diff --git a/www/chromium/files/patch-base_test_launcher_test__launcher.cc b/www/chromium/files/patch-base_test_launcher_test__launcher.cc index 9625a1f0bd0d..adf2c80b15ce 100644 --- a/www/chromium/files/patch-base_test_launcher_test__launcher.cc +++ b/www/chromium/files/patch-base_test_launcher_test__launcher.cc @@ -1,10 +1,10 @@ ---- base/test/launcher/test_launcher.cc.orig 2022-02-07 13:39:41 UTC +--- base/test/launcher/test_launcher.cc.orig 2022-02-28 16:54:41 UTC +++ base/test/launcher/test_launcher.cc @@ -63,6 +63,7 @@ #include "testing/gtest/include/gtest/gtest.h" - #if defined(OS_POSIX) + #if BUILDFLAG(IS_POSIX) +#include #include #include "base/files/file_descriptor_watcher_posix.h" diff --git a/www/chromium/files/patch-base_test_test__file__util__linux.cc b/www/chromium/files/patch-base_test_test__file__util__linux.cc index 137d156cf616..21b4b25775a0 100644 --- a/www/chromium/files/patch-base_test_test__file__util__linux.cc +++ b/www/chromium/files/patch-base_test_test__file__util__linux.cc @@ -1,13 +1,13 @@ ---- base/test/test_file_util_linux.cc.orig 2022-02-07 13:39:41 UTC +--- base/test/test_file_util_linux.cc.orig 2022-02-28 16:54:41 UTC +++ base/test/test_file_util_linux.cc -@@ -52,8 +52,10 @@ bool EvictFileFromSystemCache(const FilePath& file) { +@@ -54,8 +54,10 @@ bool EvictFileFromSystemCache(const FilePath& file) { return false; if (fdatasync(fd.get()) != 0) return false; +#if !defined(OS_BSD) if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0) return false; +#endif return true; } diff --git a/www/chromium/files/patch-base_test_test__file__util__posix.cc b/www/chromium/files/patch-base_test_test__file__util__posix.cc new file mode 100644 index 000000000000..37c9bbbb70ec --- /dev/null +++ b/www/chromium/files/patch-base_test_test__file__util__posix.cc @@ -0,0 +1,11 @@ +--- base/test/test_file_util_posix.cc.orig 2022-02-28 16:54:41 UTC ++++ base/test/test_file_util_posix.cc +@@ -88,7 +88,7 @@ void SyncPageCacheToDisk() { + } + + #if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_APPLE) && \ +- !BUILDFLAG(IS_ANDROID) ++ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD) + bool EvictFileFromSystemCache(const FilePath& file) { + // There doesn't seem to be a POSIX way to cool the disk cache. + NOTIMPLEMENTED(); diff --git a/www/chromium/files/patch-base_third__party_symbolize_symbolize.cc b/www/chromium/files/patch-base_third__party_symbolize_symbolize.cc index c73aac47312a..774ea24cf00c 100644 --- a/www/chromium/files/patch-base_third__party_symbolize_symbolize.cc +++ b/www/chromium/files/patch-base_third__party_symbolize_symbolize.cc @@ -1,11 +1,11 @@ ---- base/third_party/symbolize/symbolize.cc.orig 2022-02-07 13:39:41 UTC +--- base/third_party/symbolize/symbolize.cc.orig 2022-02-28 16:54:41 UTC +++ base/third_party/symbolize/symbolize.cc -@@ -113,7 +113,7 @@ _END_GOOGLE_NAMESPACE_ +@@ -114,7 +114,7 @@ _END_GOOGLE_NAMESPACE_ #if defined(HAVE_DLFCN_H) #include #endif --#if defined(OS_OPENBSD) +-#if BUILDFLAG(IS_OPENBSD) +#if defined(__OpenBSD__) #include #else #include diff --git a/www/chromium/files/patch-base_threading_platform__thread.h b/www/chromium/files/patch-base_threading_platform__thread.h index b1b6cf3f78e9..fcbe67b6616c 100644 --- a/www/chromium/files/patch-base_threading_platform__thread.h +++ b/www/chromium/files/patch-base_threading_platform__thread.h @@ -1,11 +1,11 @@ ---- base/threading/platform_thread.h.orig 2022-02-07 13:39:41 UTC +--- base/threading/platform_thread.h.orig 2022-02-28 16:54:41 UTC +++ base/threading/platform_thread.h -@@ -243,7 +243,7 @@ class BASE_EXPORT PlatformThread { +@@ -205,7 +205,7 @@ class BASE_EXPORT PlatformThread { // Returns a realtime period provided by `delegate`. static TimeDelta GetRealtimePeriod(Delegate* delegate); --#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) // Toggles a specific thread's priority at runtime. This can be used to // change the priority of a thread in a different process and will fail // if the calling process does not have proper permissions. The diff --git a/www/chromium/files/patch-base_threading_platform__thread__linux.cc b/www/chromium/files/patch-base_threading_platform__thread__linux.cc index fcd82b84be44..a63f03e00a9e 100644 --- a/www/chromium/files/patch-base_threading_platform__thread__linux.cc +++ b/www/chromium/files/patch-base_threading_platform__thread__linux.cc @@ -1,77 +1,77 @@ ---- base/threading/platform_thread_linux.cc.orig 2022-02-07 13:39:41 UTC +--- base/threading/platform_thread_linux.cc.orig 2022-02-28 16:54:41 UTC +++ base/threading/platform_thread_linux.cc @@ -29,7 +29,9 @@ - #if !defined(OS_NACL) && !defined(OS_AIX) + #if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) #include -+#if !defined(OS_BSD) ++#if !BUILDFLAG(IS_BSD) #include +#endif #include #include #include @@ -132,7 +134,7 @@ int sched_setattr(pid_t pid, - #endif // !defined(OS_NACL) && !defined(OS_AIX) + #endif // !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) const FilePath::CharType kCgroupDirectory[] = FILE_PATH_LITERAL("/sys/fs/cgroup"); @@ -286,7 +288,7 @@ void SetThreadCgroupsForThreadPriority(PlatformThreadI namespace internal { namespace { --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) const struct sched_param kRealTimePrio = {8}; #endif } // namespace @@ -299,7 +301,7 @@ const ThreadPriorityToNiceValuePair kThreadPriorityToN }; bool CanSetThreadPriorityToRealtimeAudio() { --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) // A non-zero soft-limit on RLIMIT_RTPRIO is required to be allowed to invoke // pthread_setschedparam in SetCurrentThreadPriorityForPlatform(). struct rlimit rlim; @@ -310,7 +312,7 @@ bool CanSetThreadPriorityToRealtimeAudio() { } bool SetCurrentThreadPriorityForPlatform(ThreadPriority priority) { --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) // For legacy schedtune interface SetThreadCgroupsForThreadPriority(PlatformThread::CurrentId(), priority); @@ -328,7 +330,7 @@ bool SetCurrentThreadPriorityForPlatform(ThreadPriorit } absl::optional GetCurrentThreadPriorityForPlatform() { --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) int maybe_sched_rr = 0; struct sched_param maybe_realtime_prio = {0}; if (pthread_getschedparam(pthread_self(), &maybe_sched_rr, @@ -347,7 +349,7 @@ absl::optional GetCurrentThreadPriorit void PlatformThread::SetName(const std::string& name) { ThreadIdNameManager::GetInstance()->SetName(name); --#if !defined(OS_NACL) && !defined(OS_AIX) -+#if !defined(OS_NACL) && !defined(OS_AIX) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) && !BUILDFLAG(IS_BSD) // On linux we can get the thread names to show up in the debugger by setting // the process name for the LWP. We don't want to do this for the main // thread because that would rename the process, causing tools like killall @@ -377,8 +379,10 @@ void PlatformThread::SetThreadPriority(ProcessId proce // priority. CHECK_NE(thread_id, process_id); -+#if !defined(OS_BSD) ++#if !BUILDFLAG(IS_BSD) // For legacy schedtune interface SetThreadCgroupsForThreadPriority(thread_id, priority); +#endif #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) // For upstream uclamp interface. We try both legacy (schedtune, as done diff --git a/www/chromium/files/patch-base_threading_platform__thread__posix.cc b/www/chromium/files/patch-base_threading_platform__thread__posix.cc index 071a25201e45..3eda63205158 100644 --- a/www/chromium/files/patch-base_threading_platform__thread__posix.cc +++ b/www/chromium/files/patch-base_threading_platform__thread__posix.cc @@ -1,21 +1,21 @@ ---- base/threading/platform_thread_posix.cc.orig 2022-02-07 13:39:41 UTC +--- base/threading/platform_thread_posix.cc.orig 2022-02-28 16:54:41 UTC +++ base/threading/platform_thread_posix.cc -@@ -74,7 +74,7 @@ void* ThreadFunc(void* params) { +@@ -75,7 +75,7 @@ void* ThreadFunc(void* params) { if (!thread_params->joinable) base::DisallowSingleton(); --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) internal::PCScan::NotifyThreadCreated(internal::GetStackPointer()); #endif -@@ -333,6 +333,9 @@ bool PlatformThread::CanChangeThreadPriority(ThreadPri +@@ -362,6 +362,9 @@ bool PlatformThread::CanChangeThreadPriority(ThreadPri // static void PlatformThread::SetCurrentThreadPriorityImpl(ThreadPriority priority) { - #if defined(OS_NACL) + #if BUILDFLAG(IS_NACL) + NOTIMPLEMENTED(); +// avoid pledge(2) violation -+#elif defined(OS_BSD) ++#elif BUILDFLAG(IS_BSD) NOTIMPLEMENTED(); #else if (internal::SetCurrentThreadPriorityForPlatform(priority)) diff --git a/www/chromium/files/patch-base_threading_platform__thread__unittest.cc b/www/chromium/files/patch-base_threading_platform__thread__unittest.cc new file mode 100644 index 000000000000..ddb1bc00ca9f --- /dev/null +++ b/www/chromium/files/patch-base_threading_platform__thread__unittest.cc @@ -0,0 +1,47 @@ +--- base/threading/platform_thread_unittest.cc.orig 2022-02-28 16:54:41 UTC ++++ base/threading/platform_thread_unittest.cc +@@ -30,7 +30,7 @@ + #include "base/time/time.h" + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include + #include + #include +@@ -319,7 +319,7 @@ TEST(PlatformThreadTest, + // and hardcodes what we know. Please inform scheduler-dev@chromium.org if this + // proprerty changes for a given platform. + TEST(PlatformThreadTest, CanChangeThreadPriority) { +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // On Ubuntu, RLIMIT_NICE and RLIMIT_RTPRIO are 0 by default, so we won't be + // able to increase priority to any level. + constexpr bool kCanIncreasePriority = false; +@@ -417,7 +417,7 @@ TEST(PlatformThreadTest, SetHugeThreadName) { + TEST(PlatformThreadTest, GetDefaultThreadStackSize) { + size_t stack_size = PlatformThread::GetDefaultThreadStackSize(); + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || \ +- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ ++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ + !defined(THREAD_SANITIZER)) || \ + (BUILDFLAG(IS_ANDROID) && !defined(ADDRESS_SANITIZER)) + EXPECT_EQ(0u, stack_size); +@@ -578,12 +578,16 @@ INSTANTIATE_TEST_SUITE_P( + + #endif // BUILDFLAG(IS_APPLE) + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + + namespace { + + bool IsTidCacheCorrect() { ++#if BUILDFLAG(IS_BSD) ++ return PlatformThread::CurrentId() == reinterpret_cast(pthread_self()); ++#else + return PlatformThread::CurrentId() == syscall(__NR_gettid); ++#endif + } + + void* CheckTidCacheCorrectWrapper(void*) { diff --git a/www/chromium/files/patch-base_threading_thread__local__storage__unittest.cc b/www/chromium/files/patch-base_threading_thread__local__storage__unittest.cc new file mode 100644 index 000000000000..6ea93f8745fd --- /dev/null +++ b/www/chromium/files/patch-base_threading_thread__local__storage__unittest.cc @@ -0,0 +1,11 @@ +--- 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_time_time.cc b/www/chromium/files/patch-base_time_time.cc index b2f0f148e1a8..de90c9b11c34 100644 --- a/www/chromium/files/patch-base_time_time.cc +++ b/www/chromium/files/patch-base_time_time.cc @@ -1,11 +1,11 @@ ---- base/time/time.cc.orig 2022-02-07 13:39:41 UTC +--- base/time/time.cc.orig 2022-02-28 16:54:41 UTC +++ base/time/time.cc -@@ -4,7 +4,7 @@ +@@ -6,7 +6,7 @@ - #include "base/time/time.h" + #include "build/build_config.h" --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // time.h is a widely included header and its size impacts build time. // Try not to raise this limit unless necessary. See // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md diff --git a/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc b/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc index 0ccf72a1fbf6..42b6b8e0f162 100644 --- a/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc +++ b/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc @@ -1,21 +1,21 @@ ---- base/trace_event/malloc_dump_provider.cc.orig 2021-12-14 11:44:55 UTC +--- base/trace_event/malloc_dump_provider.cc.orig 2022-02-28 16:54:41 UTC +++ base/trace_event/malloc_dump_provider.cc @@ -23,6 +23,8 @@ - #if defined(OS_APPLE) + #if BUILDFLAG(IS_APPLE) #include +#elif defined(OS_BSD) +#include #else #include #endif -@@ -217,6 +219,9 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDump +@@ -220,6 +222,9 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDump &allocated_objects_count); - #elif defined(OS_FUCHSIA) + #elif BUILDFLAG(IS_FUCHSIA) // TODO(fuchsia): Port, see https://crbug.com/706592. +#elif defined(OS_BSD) + total_virtual_size = 0; + allocated_objects_size = 0; #else #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) #if __GLIBC_PREREQ(2, 33) diff --git a/www/chromium/files/patch-base_trace__event_process__memory__dump.cc b/www/chromium/files/patch-base_trace__event_process__memory__dump.cc index dc76336b3bc7..d31975d16574 100644 --- a/www/chromium/files/patch-base_trace__event_process__memory__dump.cc +++ b/www/chromium/files/patch-base_trace__event_process__memory__dump.cc @@ -1,20 +1,20 @@ ---- base/trace_event/process_memory_dump.cc.orig 2022-02-07 13:39:41 UTC +--- base/trace_event/process_memory_dump.cc.orig 2022-02-28 16:54:41 UTC +++ base/trace_event/process_memory_dump.cc @@ -105,7 +105,7 @@ absl::optional ProcessMemoryDump::CountResiden - #if defined(OS_WIN) + #if BUILDFLAG(IS_WIN) std::unique_ptr vec( new PSAPI_WORKING_SET_EX_INFORMATION[max_vec_size]); --#elif defined(OS_APPLE) -+#elif defined(OS_APPLE) || defined(OS_BSD) +-#elif BUILDFLAG(IS_APPLE) ++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) std::unique_ptr vec(new char[max_vec_size]); - #elif defined(OS_POSIX) || defined(OS_FUCHSIA) + #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) std::unique_ptr vec(new unsigned char[max_vec_size]); -@@ -127,7 +127,7 @@ absl::optional ProcessMemoryDump::CountResiden +@@ -130,7 +130,7 @@ absl::optional ProcessMemoryDump::CountResiden for (size_t i = 0; i < page_count; i++) resident_page_count += vec[i].VirtualAttributes.Valid; --#elif defined(OS_FUCHSIA) -+#elif defined(OS_FUCHSIA) | defined(OS_BSD) +-#elif BUILDFLAG(IS_FUCHSIA) ++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // TODO(fuchsia): Port, see https://crbug.com/706592. - ALLOW_UNUSED_LOCAL(chunk_start); - ALLOW_UNUSED_LOCAL(page_count); + #elif BUILDFLAG(IS_APPLE) + // mincore in MAC does not fail with EAGAIN. diff --git a/www/chromium/files/patch-base_tracing_trace__time.cc b/www/chromium/files/patch-base_tracing_trace__time.cc index b391966234ab..36c6113518f4 100644 --- a/www/chromium/files/patch-base_tracing_trace__time.cc +++ b/www/chromium/files/patch-base_tracing_trace__time.cc @@ -1,28 +1,28 @@ ---- base/tracing/trace_time.cc.orig 2022-02-07 13:39:41 UTC +--- base/tracing/trace_time.cc.orig 2022-02-28 16:54:41 UTC +++ base/tracing/trace_time.cc @@ -8,13 +8,17 @@ #include "build/build_config.h" #include "third_party/perfetto/include/perfetto/base/time.h" -+#if defined(OS_FREEBSD) ++#if BUILDFLAG(IS_FREEBSD) +#define CLOCK_BOOTTIME CLOCK_UPTIME +#endif + namespace base { namespace tracing { int64_t TraceBootTicksNow() { // On Windows and Mac, TRACE_TIME_TICKS_NOW() behaves like boottime already. - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) struct timespec ts; int res = clock_gettime(CLOCK_BOOTTIME, &ts); if (res != -1) @@ -24,4 +28,4 @@ int64_t TraceBootTicksNow() { } } // namespace tracing -} // namespace base \ No newline at end of file +} // namespace base diff --git a/www/chromium/files/patch-base_tracing_trace__time.h b/www/chromium/files/patch-base_tracing_trace__time.h index 670469229ceb..0394e382ee6e 100644 --- a/www/chromium/files/patch-base_tracing_trace__time.h +++ b/www/chromium/files/patch-base_tracing_trace__time.h @@ -1,11 +1,11 @@ ---- base/tracing/trace_time.h.orig 2022-02-07 13:39:41 UTC +--- base/tracing/trace_time.h.orig 2022-02-28 16:54:41 UTC +++ base/tracing/trace_time.h @@ -12,7 +12,7 @@ namespace base { namespace tracing { - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ +- BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) // Linux, Android, and Fuchsia all use CLOCK_MONOTONIC. See crbug.com/166153 // about efforts to unify base::TimeTicks across all platforms. constexpr perfetto::protos::pbzero::BuiltinClock kTraceClockId = diff --git a/www/chromium/files/patch-build_config_BUILD.gn b/www/chromium/files/patch-build_config_BUILD.gn index 2f3841e1bb68..13b50eb433dd 100644 --- a/www/chromium/files/patch-build_config_BUILD.gn +++ b/www/chromium/files/patch-build_config_BUILD.gn @@ -1,22 +1,22 @@ ---- build/config/BUILD.gn.orig 2022-02-07 13:39:41 UTC +--- build/config/BUILD.gn.orig 2022-02-28 16:54:41 UTC +++ build/config/BUILD.gn -@@ -222,13 +222,17 @@ config("default_libs") { +@@ -218,13 +218,17 @@ config("default_libs") { "CoreText.framework", "Foundation.framework", ] - } else if (is_linux || is_chromeos) { + } else if ((is_linux && !is_bsd) || is_chromeos) { libs = [ "dl", "pthread", "rt", ] - } + } else if (is_bsd) { + libs = [ + "pthread", + ] + } } group("common_deps") { diff --git a/www/chromium/files/patch-build_config_compiler_BUILD.gn b/www/chromium/files/patch-build_config_compiler_BUILD.gn index b2cb7fa98158..1c9d854a4148 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-07 13:39:41 UTC +--- build/config/compiler/BUILD.gn.orig 2022-02-28 16:54:41 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 -@@ -903,7 +910,7 @@ config("compiler_cpu_abi") { +@@ -902,7 +909,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" ] } -@@ -917,7 +924,7 @@ config("compiler_cpu_abi") { +@@ -916,7 +923,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" ] } -@@ -1238,7 +1245,7 @@ config("compiler_deterministic") { +@@ -1237,7 +1244,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", -@@ -1525,7 +1532,7 @@ config("default_warnings") { +@@ -1524,7 +1531,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" ] } -@@ -1676,7 +1683,7 @@ config("no_chromium_code") { +@@ -1709,7 +1716,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", -@@ -2191,7 +2198,7 @@ config("afdo_optimize_size") { +@@ -2224,7 +2231,7 @@ config("afdo_optimize_size") { # between //base/allocator:tcmalloc and AFDO on GCC), 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. -@@ -2207,7 +2214,7 @@ config("afdo") { +@@ -2240,7 +2247,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 ] } -@@ -2346,7 +2353,8 @@ config("symbols") { +@@ -2379,7 +2386,8 @@ config("symbols") { } } - if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") { + if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos" && + !is_bsd) { if (is_apple) { # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. # Make sure we don't use constructor homing on mac. diff --git a/www/chromium/files/patch-build_linux_chrome.map b/www/chromium/files/patch-build_linux_chrome.map index 8e8c35005efb..992585036b7b 100644 --- a/www/chromium/files/patch-build_linux_chrome.map +++ b/www/chromium/files/patch-build_linux_chrome.map @@ -1,13 +1,13 @@ ---- build/linux/chrome.map.orig 2022-02-07 13:39:41 UTC +--- build/linux/chrome.map.orig 2022-02-28 16:54:41 UTC +++ build/linux/chrome.map @@ -20,6 +20,10 @@ global: # Program entry point. _start; + # FreeBSD specific variables. + __progname; + environ; + # Memory allocation symbols. We want chrome and any libraries to # share the same heap, so it is correct to export these symbols. - calloc; + aligned_alloc; diff --git a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni index b440c70df873..4d018d8b2dee 100644 --- a/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni +++ b/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni @@ -1,39 +1,39 @@ ---- build/toolchain/gcc_toolchain.gni.orig 2022-02-07 13:39:41 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2022-02-28 16:54:41 UTC +++ build/toolchain/gcc_toolchain.gni -@@ -49,6 +49,12 @@ if (enable_resource_allowlist_generation) { +@@ -53,6 +53,12 @@ if (enable_resource_allowlist_generation) { "enable_resource_allowlist_generation=true does not work for target_os=$target_os") } +declare_args() { + extra_cppflags = "" + extra_cxxflags = "" + extra_ldflags = "" +} + # This template defines a toolchain for something that works like gcc # (including clang). # -@@ -737,13 +743,17 @@ template("gcc_toolchain") { +@@ -747,13 +753,17 @@ 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++" + if (is_freebsd) { + prefix = "/usr/local/bin" + } else { + prefix = "/usr/bin" + } + cc = "cc" + cxx = "c++" ld = cxx - readelf = "${prefix}/llvm-readelf" - ar = "${prefix}/llvm-ar" - nm = "${prefix}/llvm-nm" + readelf = "${prefix}/readelf" + ar = "${prefix}/ar" + nm = "${prefix}/nm" forward_variables_from(invoker, [ diff --git a/www/chromium/files/patch-cc_BUILD.gn b/www/chromium/files/patch-cc_BUILD.gn index 80e9e0adb0a0..88c78da6873d 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-07 13:39:41 UTC +--- cc/BUILD.gn.orig 2022-02-28 16:54:41 UTC +++ cc/BUILD.gn -@@ -659,7 +659,7 @@ cc_test_static_library("test_support") { +@@ -660,7 +660,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" ] } } -@@ -884,7 +884,6 @@ cc_test("cc_unittests") { - ] +@@ -886,7 +886,6 @@ cc_test("cc_unittests") { + data = [ "//components/viz/test/data/" ] data_deps = [ "//testing/buildbot/filters:cc_unittests_filters", - "//third_party/mesa_headers", ] - if (is_fuchsia) { + if (is_android && enable_chrome_android_internal) { diff --git a/www/chromium/files/patch-chrome_app_chrome__command__ids.h b/www/chromium/files/patch-chrome_app_chrome__command__ids.h index 87bae79ebd41..34fe446304f1 100644 --- a/www/chromium/files/patch-chrome_app_chrome__command__ids.h +++ b/www/chromium/files/patch-chrome_app_chrome__command__ids.h @@ -1,11 +1,11 @@ ---- chrome/app/chrome_command_ids.h.orig 2021-07-19 18:45:06 UTC +--- chrome/app/chrome_command_ids.h.orig 2022-02-28 16:54:41 UTC +++ chrome/app/chrome_command_ids.h @@ -66,7 +66,7 @@ #define IDC_NAME_WINDOW 34049 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch of lacros-chrome is complete. --#if 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) #define IDC_USE_SYSTEM_TITLE_BAR 34051 #define IDC_RESTORE_WINDOW 34052 #endif diff --git a/www/chromium/files/patch-chrome_app_chrome__main.cc b/www/chromium/files/patch-chrome_app_chrome__main.cc index 25aa85dc6643..6dcdad77169d 100644 --- a/www/chromium/files/patch-chrome_app_chrome__main.cc +++ b/www/chromium/files/patch-chrome_app_chrome__main.cc @@ -1,20 +1,20 @@ ---- chrome/app/chrome_main.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/app/chrome_main.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/app/chrome_main.cc -@@ -26,7 +26,7 @@ +@@ -25,7 +25,7 @@ #include "chrome/app/notification_metrics.h" #endif --#if defined(OS_WIN) || defined(OS_LINUX) -+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/base_switches.h" #endif -@@ -147,7 +147,7 @@ int ChromeMain(int argc, const char** argv) { +@@ -146,7 +146,7 @@ int ChromeMain(int argc, const char** argv) { headless::SetUpCommandLine(command_line); } else { - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ -- defined(OS_WIN) -+ defined(OS_WIN) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ +- BUILDFLAG(IS_WIN) ++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) if (command_line->HasSwitch(switches::kHeadless)) { #if BUILDFLAG(GOOGLE_CHROME_BRANDING) command_line->AppendSwitch(::headless::switches::kEnableCrashReporter); diff --git a/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc b/www/chromium/files/patch-chrome_app_chrome__main__delegate.cc index 97abda5f5a89..9935801ef7b3 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-07 13:39:41 UTC +--- chrome/app/chrome_main_delegate.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/app/chrome_main_delegate.cc -@@ -112,7 +112,7 @@ +@@ -113,7 +113,7 @@ #include "chrome/app/chrome_crash_reporter_client.h" #endif --#if BUILDFLAG(ENABLE_NACL) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) -+#if BUILDFLAG(ENABLE_NACL) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) && !defined(OS_BSD) +-#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 -@@ -156,12 +156,12 @@ +@@ -157,12 +157,12 @@ #include "v8/include/v8.h" #endif --#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) #include "base/environment.h" #endif - #if defined(OS_MAC) || defined(OS_WIN) || defined(OS_ANDROID) || \ -- defined(OS_LINUX) || defined(OS_CHROMEOS) -+ defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) + #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 -@@ -309,7 +309,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty +@@ -310,7 +310,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty // and resources loaded. bool SubprocessNeedsResourceBundle(const std::string& process_type) { return --#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) // The zygote process opens the resources for the renderers. process_type == switches::kZygoteProcess || #endif -@@ -349,7 +349,7 @@ bool HandleVersionSwitches(const base::CommandLine& co +@@ -350,7 +350,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 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) // 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) || -@@ -413,7 +413,7 @@ void InitializeUserDataDir(base::CommandLine* command_ +@@ -414,7 +414,7 @@ void InitializeUserDataDir(base::CommandLine* command_ std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); --#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) // 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. -@@ -497,7 +497,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat +@@ -498,7 +498,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat #endif - #if defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) -+ defined(OS_CHROMEOS) || defined(OS_BSD) + #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( -@@ -685,6 +685,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization( +@@ -679,6 +679,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization( // not always enabled on Linux/ChromeOS. - #if defined(OS_LINUX) || defined(OS_CHROMEOS) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) bool enable_gwp_asan = crash_reporter::IsCrashpadEnabled(); -+#elif defined(OS_BSD) ++#elif BUILDFLAG(IS_BSD) + bool enable_gwp_asan = false; #else bool enable_gwp_asan = true; #endif -@@ -809,7 +811,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -801,7 +803,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi } // 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) || defined(OS_BSD) +-#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 -@@ -840,7 +842,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi +@@ -832,7 +834,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) chromeos::dbus_paths::RegisterPathProvider(); #endif --#if BUILDFLAG(ENABLE_NACL) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) -+#if BUILDFLAG(ENABLE_NACL) && (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) +-#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 -@@ -1154,7 +1156,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1146,7 +1148,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } --#if defined(OS_POSIX) && !defined(OS_MAC) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) +-#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 defined(OS_ANDROID) -@@ -1237,7 +1239,7 @@ absl::variant Chrome + #if BUILDFLAG(IS_ANDROID) +@@ -1222,7 +1224,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) && !defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if BUILDFLAG(ENABLE_NACL) && !defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_BSD) +-#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 7db2405e0ab4..c7410f592b87 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-07 13:39:41 UTC +--- chrome/app/chromium_strings.grd.orig 2022-02-28 16:54:41 UTC +++ chrome/app/chromium_strings.grd -@@ -296,7 +296,7 @@ If you update this file, be sure also to update google +@@ -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 -@@ -808,7 +808,7 @@ Chromium is unable to recover your settings. +@@ -810,7 +810,7 @@ Chromium is unable to recover your settings. - + Your system administrator has configured Chromium to open an alternative browser to access $1example.com. -@@ -934,7 +934,7 @@ Chromium is unable to recover your settings. +@@ -936,7 +936,7 @@ Chromium is unable to recover your settings. - + 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 1603c775fd26..31e633027c98 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-07 13:39:41 UTC +--- chrome/app/generated_resources.grd.orig 2022-02-28 16:54:41 UTC +++ chrome/app/generated_resources.grd @@ -2,7 +2,7 @@ -@@ -296,7 +296,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -298,7 +298,7 @@ are declared in tools/grit/grit_rule.gni. - + -@@ -2811,7 +2811,7 @@ are declared in tools/grit/grit_rule.gni. +@@ -2813,7 +2813,7 @@ are declared in tools/grit/grit_rule.gni. - + Device Credentials -@@ -5557,7 +5557,7 @@ Keep your key file in a safe place. You will need it t +@@ -5568,7 +5568,7 @@ Keep your key file in a safe place. You will need it t - + Legacy Browser Support -@@ -8016,7 +8016,7 @@ Keep your key file in a safe place. You will need it t +@@ -8043,7 +8043,7 @@ Keep your key file in a safe place. You will need it t Google Pay - + Use system title bar and borders -@@ -9104,7 +9104,7 @@ Please help our engineers fix this problem. Tell us wh +@@ -9134,7 +9134,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 f30963321403..c257a13fb957 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-07 13:39:41 UTC +--- chrome/app/google_chrome_strings.grd.orig 2022-02-28 16:54:41 UTC +++ chrome/app/google_chrome_strings.grd -@@ -301,7 +301,7 @@ chromium_strings.grd. --> +@@ -303,7 +303,7 @@ chromium_strings.grd. --> Welcome to Chrome; new browser window opened - + Welcome to Google Chrome -@@ -816,7 +816,7 @@ Google Chrome is unable to recover your settings. +@@ -818,7 +818,7 @@ Google Chrome is unable to recover your settings. - + Your system administrator has configured Google Chrome to open an alternative browser to access $1example.com. -@@ -942,7 +942,7 @@ Google Chrome is unable to recover your settings. +@@ -944,7 +944,7 @@ Google Chrome is unable to recover your settings. - + The profile appears to be in use by another Google Chrome process ($112345) on another computer ($2example.com). Chrome has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chrome. diff --git a/www/chromium/files/patch-chrome_app_settings__strings.grdp b/www/chromium/files/patch-chrome_app_settings__strings.grdp index e0be89211d5f..017a675fc6cd 100644 --- a/www/chromium/files/patch-chrome_app_settings__strings.grdp +++ b/www/chromium/files/patch-chrome_app_settings__strings.grdp @@ -1,20 +1,20 @@ ---- chrome/app/settings_strings.grdp.orig 2021-10-08 06:25:37 UTC +--- chrome/app/settings_strings.grdp.orig 2022-02-28 16:54:41 UTC +++ chrome/app/settings_strings.grdp -@@ -123,7 +123,7 @@ +@@ -131,7 +131,7 @@ Theme - + GTK+ -@@ -137,7 +137,7 @@ +@@ -145,7 +145,7 @@ Use Classic -- -+ +- ++ Reset to default diff --git a/www/chromium/files/patch-chrome_browser_about__flags.cc b/www/chromium/files/patch-chrome_browser_about__flags.cc index 5cc17e7ac79f..e0474b9664a0 100644 --- a/www/chromium/files/patch-chrome_browser_about__flags.cc +++ b/www/chromium/files/patch-chrome_browser_about__flags.cc @@ -1,155 +1,137 @@ ---- chrome/browser/about_flags.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/about_flags.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/about_flags.cc -@@ -203,7 +203,7 @@ +@@ -205,7 +205,7 @@ #include "ui/native_theme/native_theme_features.h" #include "ui/ui_features.h" --#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) #include "base/allocator/buildflags.h" #endif -@@ -271,7 +271,7 @@ +@@ -273,7 +273,7 @@ #include "chrome/browser/supervised_user/supervised_user_features/supervised_user_features.h" #endif // ENABLE_SUPERVISED_USERS --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_BSD) +-#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 // OS_LINUX || BUILDFLAG(IS_CHROMEOS_ASH) -@@ -358,7 +358,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = { + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) +@@ -360,7 +360,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = { gl::kANGLEImplementationMetalName}}; #endif --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) const FeatureEntry::Choice kOzonePlatformHintRuntimeChoices[] = { {flag_descriptions::kOzonePlatformHintChoiceDefault, "", ""}, {flag_descriptions::kOzonePlatformHintChoiceAuto, -@@ -941,7 +941,7 @@ const FeatureEntry::FeatureVariation kPageContentAnnot +@@ -966,7 +966,7 @@ const FeatureEntry::FeatureVariation kPageContentAnnot }; - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ -- defined(OS_WIN) || defined(OS_FUCHSIA) -+ defined(OS_WIN) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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"}, -@@ -2344,7 +2344,7 @@ const FeatureEntry::FeatureVariation kPasswordChangeFe - nullptr}}; - #endif // defined(OS_ANDROID) - --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) - const FeatureEntry::FeatureParam - kSendWebUIJavaScriptErrorReportsVariationSendToStaging[] = { - {features::kSendWebUIJavaScriptErrorReportsSendToProductionVariation, -@@ -2699,7 +2699,7 @@ const FeatureEntry kFeatureEntries[] = { - flag_descriptions::kWebKioskEnableLacrosDescription, kOsCrOS, - FEATURE_VALUE_TYPE(features::kWebKioskEnableLacros)}, - #endif // BUILDFLAG(IS_CHROMEOS_ASH) --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) - {"send-webui-javascript-error-reports", - flag_descriptions::kSendWebUIJavaScriptErrorReportsName, - flag_descriptions::kSendWebUIJavaScriptErrorReportsDescription, -@@ -3208,7 +3208,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3243,7 +3243,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(chromeos::kLacrosTtsSupport)}, - #endif // defined(OS_CHROMEOS) + #endif // BUILDFLAG(IS_CHROMEOS) --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) { "enable-accelerated-video-decode", flag_descriptions::kAcceleratedVideoDecodeName, -@@ -3620,7 +3620,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3648,7 +3648,7 @@ const FeatureEntry kFeatureEntries[] = { {"enable-login-detection", flag_descriptions::kEnableLoginDetectionName, flag_descriptions::kEnableLoginDetectionDescription, kOsAll, FEATURE_VALUE_TYPE(login_detection::kLoginDetection)}, --#if defined(OS_CHROMEOS) || defined(OS_LINUX) -+#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) +-#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( -@@ -3808,7 +3808,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3835,7 +3835,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kWebShare)}, - #endif // BUILDFLAG(IS_CHROMEOS_ASH) || OS_WIN || OS_MAC + #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#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)}, -@@ -4493,7 +4493,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4518,7 +4518,7 @@ const FeatureEntry kFeatureEntries[] = { "OmniboxBundledExperimentV1")}, - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ -- defined(OS_WIN) || defined(OS_FUCHSIA) -+ defined(OS_WIN) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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, -@@ -4870,7 +4870,7 @@ const FeatureEntry kFeatureEntries[] = { - #endif // !defined(OS_ANDROID) +@@ -4887,7 +4887,7 @@ const FeatureEntry kFeatureEntries[] = { + #endif // BUILDFLAG(IS_ANDROID) - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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)}, -@@ -5492,7 +5492,7 @@ const FeatureEntry kFeatureEntries[] = { - FEATURE_VALUE_TYPE(kSharingSendViaSync)}, - - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) - {"sharing-hub-desktop-app-menu", - flag_descriptions::kSharingHubDesktopAppMenuName, - flag_descriptions::kSharingHubDesktopAppMenuDescription, kOsDesktop, -@@ -5917,7 +5917,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -5897,7 +5897,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kMouseSubframeNoImplicitCapture)}, - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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, -@@ -6606,7 +6606,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6607,7 +6607,7 @@ const FeatureEntry kFeatureEntries[] = { #endif - #if defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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, -@@ -6739,7 +6739,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6740,7 +6740,7 @@ const FeatureEntry kFeatureEntries[] = { #endif - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #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)}, -@@ -6982,7 +6982,7 @@ const FeatureEntry kFeatureEntries[] = { - FEATURE_VALUE_TYPE(media::kVp9kSVCHWDecoding)}, +@@ -6985,7 +6985,7 @@ const FeatureEntry kFeatureEntries[] = { - #if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ -- defined(OS_MAC) || defined(OS_FUCHSIA) -+ defined(OS_MAC) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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, -@@ -7124,7 +7124,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7129,7 +7129,7 @@ const FeatureEntry kFeatureEntries[] = { #endif - #if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #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_after__startup__task__utils.cc b/www/chromium/files/patch-chrome_browser_after__startup__task__utils.cc index 43dc49863e1b..8ca400175f0c 100644 --- a/www/chromium/files/patch-chrome_browser_after__startup__task__utils.cc +++ b/www/chromium/files/patch-chrome_browser_after__startup__task__utils.cc @@ -1,29 +1,29 @@ ---- chrome/browser/after_startup_task_utils.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/after_startup_task_utils.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/after_startup_task_utils.cc @@ -25,7 +25,7 @@ // 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "ui/views/linux_ui/linux_ui.h" #endif @@ -111,7 +111,7 @@ void SetBrowserStartupIsComplete() { g_startup_complete_flag.Get().Set(); - #if defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) -+ defined(OS_CHROMEOS) || defined(OS_BSD) + #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_CHROMEOS) ++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Process::Current().CreationTime() is not available on all platforms. const base::Time process_creation_time = base::Process::Current().CreationTime(); @@ -130,7 +130,7 @@ void SetBrowserStartupIsComplete() { // 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Make sure we complete the startup notification sequence, or launchers will // get confused by not receiving the expected message from the main process. views::LinuxUI* linux_ui = views::LinuxUI::instance(); diff --git a/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc b/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc index dad818ce9cf0..3b4e28b819a9 100644 --- a/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc +++ b/www/chromium/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc @@ -1,71 +1,71 @@ ---- chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc @@ -4,6 +4,15 @@ #include "chrome/browser/apps/platform_apps/api/music_manager_private/device_id.h" +#include "build/build_config.h" + +#if defined(OS_BSD) +#include +#include +#include +#include +#endif + #include #include #include -@@ -105,11 +114,33 @@ class MacAddressProcessor { +@@ -106,11 +115,33 @@ class MacAddressProcessor { const char* const prefixes[], size_t prefixes_count) { const int MAC_LENGTH = 6; +#if defined(OS_BSD) + struct ifaddrs *ifap, *ifinfo; +#else struct ifreq ifinfo; +#endif memset(&ifinfo, 0, sizeof(ifinfo)); - strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1); +#if defined(OS_BSD) + int result = getifaddrs(&ifap); + if (result != 0) + return true; + result = 1; // no MAC found yet + for (ifinfo = ifap; ifinfo != NULL; ifinfo = ifinfo->ifa_next) { + struct sockaddr* sa = ifinfo->ifa_addr; + if (sa->sa_family == AF_LINK && + !strncmp(ifinfo->ifa_name, ifaddr->ifa_name, + sizeof(ifinfo->ifa_name) - 1)) { + result = 0; + break; + } + } + + char mac_address[6]; + strncpy(mac_address, (const char*)LLADDR((struct sockaddr_dl*)ifinfo->ifa_addr), sizeof(mac_address)); +#else + strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1); int sd = socket(AF_INET, SOCK_DGRAM, 0); int result = ioctl(sd, SIOCGIFHWADDR, &ifinfo); close(sd); -@@ -119,11 +150,17 @@ class MacAddressProcessor { +@@ -120,11 +151,17 @@ class MacAddressProcessor { const char* mac_address = static_cast(ifinfo.ifr_hwaddr.sa_data); +#endif if (!is_valid_mac_address_.Run(mac_address, MAC_LENGTH)) return true; +#if defined(OS_BSD) + if (!IsValidPrefix(ifinfo->ifa_name, prefixes, prefixes_count)) + return true; +#else if (!IsValidPrefix(ifinfo.ifr_name, prefixes, prefixes_count)) return true; +#endif // Got one! found_mac_address_ = diff --git a/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc b/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc index 8567bb517f11..914a8f443f2c 100644 --- a/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc +++ b/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc @@ -1,20 +1,20 @@ ---- chrome/browser/apps/platform_apps/platform_app_launch.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/apps/platform_apps/platform_app_launch.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/apps/platform_apps/platform_app_launch.cc -@@ -17,7 +17,7 @@ +@@ -18,7 +18,7 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" --#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_window.h" -@@ -122,7 +122,7 @@ bool OpenExtensionApplicationTab(Profile* profile, con +@@ -121,7 +121,7 @@ bool OpenExtensionApplicationTab(Profile* profile, con return app_tab != nullptr; } --#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) bool OpenDeprecatedApplicationPrompt(Profile* profile, const std::string& app_id) { if (!extensions::IsExtensionUnsupportedDeprecatedApp(profile, app_id)) diff --git a/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h b/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h index a133bcabdb34..393b6f62495b 100644 --- a/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h +++ b/www/chromium/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h @@ -1,11 +1,11 @@ ---- chrome/browser/apps/platform_apps/platform_app_launch.h.orig 2021-09-24 18:17:59 UTC +--- chrome/browser/apps/platform_apps/platform_app_launch.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/apps/platform_apps/platform_app_launch.h @@ -36,7 +36,7 @@ bool OpenExtensionApplicationWindow(Profile* profile, // and false otherwise. bool OpenExtensionApplicationTab(Profile* profile, const std::string& app_id); --#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Opens the deprecated Chrome Apps flow if |app_id| refers to a Chrome App and // Chrome Apps are deprecated on the |profile|. Returns true if that was the // case, or false otherwise. diff --git a/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc b/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc index d6aa299207f8..7d62b3c9c226 100644 --- a/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc +++ b/www/chromium/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc @@ -1,11 +1,11 @@ ---- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc @@ -89,7 +89,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForSch return metrics::OmniboxInputType::QUERY; case ExternalProtocolHandler::UNKNOWN: { --#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) // Linux impl of GetApplicationNameForProtocol doesn't distinguish // between URL schemes with handers and those without. This will // make the default behaviour be search on Linux. diff --git a/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc b/www/chromium/files/patch-chrome_browser_background_background__mode__manager.cc index 8d3f48160b1a..c3e6446c375d 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 2021-09-24 04:25:58 UTC +--- chrome/browser/background/background_mode_manager.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/background/background_mode_manager.cc @@ -892,7 +892,7 @@ gfx::ImageSkia GetStatusTrayIcon() { return gfx::ImageSkia(); return family->CreateExact(size).AsImageSkia(); --#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) return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( IDR_PRODUCT_LOGO_128); - #elif defined(OS_MAC) + #elif BUILDFLAG(IS_MAC) diff --git a/www/chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc b/www/chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc index 28a83f9c9559..37083840f5bd 100644 --- a/www/chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc +++ b/www/chromium/files/patch-chrome_browser_background_background__mode__optimizer.cc @@ -1,11 +1,11 @@ ---- chrome/browser/background/background_mode_optimizer.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/background/background_mode_optimizer.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/background/background_mode_optimizer.cc @@ -31,7 +31,7 @@ std::unique_ptr BackgroundMod switches::kKeepAliveForTest)) return nullptr; --#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) if (base::FeatureList::IsEnabled(features::kBackgroundModeAllowRestart)) return base::WrapUnique(new BackgroundModeOptimizer()); - #endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) 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 512a65dad887..88bf739e9f2e 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-07 13:39:41 UTC +--- chrome/browser/browser_process_impl.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/browser_process_impl.cc -@@ -208,7 +208,7 @@ +@@ -209,7 +209,7 @@ #include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h" #endif --#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) #include "chrome/browser/error_reporting/chrome_js_error_report_processor.h" // nogncheck #endif -@@ -1160,7 +1160,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { +@@ -1157,7 +1157,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { + ApplyMetricsReportingPolicy(); - #endif --#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) ChromeJsErrorReportProcessor::Create(); #endif -@@ -1420,7 +1420,7 @@ void BrowserProcessImpl::Unpin() { +@@ -1418,7 +1418,7 @@ void BrowserProcessImpl::Unpin() { // Mac is currently not supported. // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. --#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_BSD) +-#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 9ede1407b876..14ccde8270cd 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-07 13:39:41 UTC +--- chrome/browser/browser_process_impl.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/browser_process_impl.h @@ -373,7 +373,7 @@ class BrowserProcessImpl : public BrowserProcess, // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_BSD) +-#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 ed429a3889e5..1d3a0cb745bf 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,56 @@ ---- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_browser_interface_binders.cc @@ -97,7 +97,7 @@ #endif // BUILDFLAG(FULL_SAFE_BROWSING) - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_ASH) -+ BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_BSD) ++ 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 @@ - #endif // defined(OS_ANDROID) + #endif // BUILDFLAG(IS_ANDROID) - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) -+ defined(OS_CHROMEOS) || defined(OS_BSD) + #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" -@@ -654,7 +654,7 @@ void PopulateChromeFrameBinders( +@@ -658,7 +658,7 @@ void PopulateChromeFrameBinders( #endif - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) -+ defined(OS_CHROMEOS) || defined(OS_BSD) + #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)); -@@ -662,7 +662,7 @@ void PopulateChromeFrameBinders( +@@ -666,7 +666,7 @@ void PopulateChromeFrameBinders( #endif - #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MAC) || \ -- defined(OS_WIN) -+ defined(OS_WIN) || defined(OS_BSD) + #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( -@@ -702,7 +702,7 @@ void PopulateChromeWebUIFrameBinders( + map->Add( +@@ -706,7 +706,7 @@ void PopulateChromeWebUIFrameBinders( SegmentationInternalsUI>(map); - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_ASH) -+ BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_BSD) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) RegisterWebUIControllerInterfaceBinder< connectors_internals::mojom::PageHandler, enterprise_connectors::ConnectorsInternalsUI>(map); -@@ -1003,7 +1003,7 @@ void PopulateChromeWebUIFrameBinders( +@@ -1013,7 +1013,7 @@ void PopulateChromeWebUIFrameBinders( #endif - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) -+ defined(OS_CHROMEOS) || defined(OS_BSD) + #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 995770294b88..ee6b20867dee 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-07 13:39:41 UTC +--- chrome/browser/chrome_browser_main.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_browser_main.cc -@@ -224,11 +224,11 @@ +@@ -228,11 +228,11 @@ // 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) || defined(OS_BSD) +-#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 // defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) --#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) #include "components/crash/core/app/breakpad_linux.h" #include "components/crash/core/app/crashpad.h" #endif -@@ -263,7 +263,7 @@ +@@ -267,7 +267,7 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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" -@@ -949,7 +949,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1007,7 +1007,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs); } --#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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 . -@@ -962,7 +962,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1020,7 +1020,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { } - #endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) + #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) --#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_OPENBSD) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) +-#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( -@@ -982,7 +982,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -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 defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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__browser__main__extra__parts__linux.cc b/www/chromium/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc index bfe5cf2b7ccc..009b0cbbe1e2 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc @@ -1,11 +1,11 @@ ---- chrome/browser/chrome_browser_main_extra_parts_linux.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/chrome_browser_main_extra_parts_linux.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_browser_main_extra_parts_linux.cc @@ -120,7 +120,7 @@ ChromeBrowserMainExtraPartsLinux::ChromeBrowserMainExt ChromeBrowserMainExtraPartsLinux::~ChromeBrowserMainExtraPartsLinux() = default; void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() { --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // On the desktop, we fix the platform name if necessary. // See https://crbug.com/1246928. auto* const command_line = base::CommandLine::ForCurrentProcess(); diff --git a/www/chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc b/www/chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc index fa6f25a6beab..711142efa19a 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__main__linux.cc @@ -1,20 +1,20 @@ ---- chrome/browser/chrome_browser_main_linux.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/chrome_browser_main_linux.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_browser_main_linux.cc -@@ -86,7 +86,7 @@ void ChromeBrowserMainPartsLinux::PreProfileInit() { +@@ -57,7 +57,7 @@ ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLi } void ChromeBrowserMainPartsLinux::PostCreateMainMessageLoop() { -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) // No-op: Ash and Lacros Bluetooth DBusManager initialization depend on // FeatureList, and is done elsewhere. #else -@@ -115,7 +115,7 @@ void ChromeBrowserMainPartsLinux::PostBrowserStart() { - #endif // defined(USE_DBUS) && !defined(OS_CHROMEOS) +@@ -122,7 +122,7 @@ void ChromeBrowserMainPartsLinux::PostBrowserStart() { + #endif // defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS) void ChromeBrowserMainPartsLinux::PostDestroyThreads() { -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) // No-op; per PostBrowserStart() comment, this is done elsewhere. #else bluez::BluezDBusManager::Shutdown(); diff --git a/www/chromium/files/patch-chrome_browser_chrome__browser__main__posix.cc b/www/chromium/files/patch-chrome_browser_chrome__browser__main__posix.cc index f1af0f25cc94..78f929dfa12f 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__browser__main__posix.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__browser__main__posix.cc @@ -1,11 +1,11 @@ ---- chrome/browser/chrome_browser_main_posix.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/chrome_browser_main_posix.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_browser_main_posix.cc @@ -72,7 +72,7 @@ void ExitHandler::ExitWhenPossibleOnUIThread(int signa } else { // 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) switch (signal) { case SIGINT: case SIGHUP: 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 20ddbcd0d54d..e7e35569e08c 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,136 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_content_browser_client.cc @@ -373,7 +373,7 @@ - #include "components/user_manager/user_manager.h" #include "services/service_manager/public/mojom/interface_provider_spec.mojom.h" #include "storage/browser/file_system/external_mount_points.h" --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) + #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 defined(OS_ANDROID) + #elif BUILDFLAG(IS_ANDROID) #include "base/android/application_status_listener.h" -@@ -437,17 +437,17 @@ +@@ -442,17 +442,17 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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 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) #include "components/crash/core/app/crash_switches.h" #include "components/crash/core/app/crashpad.h" #endif --#if defined(OS_POSIX) && !defined(OS_MAC) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) - #if !defined(OS_ANDROID) +-#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" -@@ -456,7 +456,7 @@ +@@ -461,7 +461,7 @@ #endif - #if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || \ + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_CHROMEOS_ASH) -+ BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_BSD) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h" - #endif // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || // BUILDFLAG(IS_CHROMEOS_ASH) -@@ -478,11 +478,11 @@ +@@ -483,11 +483,11 @@ // 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) || defined(OS_BSD) +-#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 defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#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" -@@ -866,7 +866,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo +@@ -870,7 +870,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo int GetCrashSignalFD(const base::CommandLine& command_line) { return crashpad::CrashHandlerHost::Get()->GetDeathSignalSocket(); } --#elif defined(OS_POSIX) && !defined(OS_MAC) -+#elif defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) +-#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; -@@ -1361,7 +1361,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1370,7 +1370,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( #elif BUILDFLAG(IS_CHROMEOS_LACROS) main_parts = std::make_unique( std::move(parameters), &startup_data_); --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#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 defined(OS_ANDROID) -@@ -1395,7 +1395,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( + #elif BUILDFLAG(IS_ANDROID) +@@ -1404,7 +1404,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( std::make_unique()); // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#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 -@@ -1412,7 +1412,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +@@ -1421,7 +1421,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( main_parts->AddParts(std::make_unique()); #endif --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#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()); -@@ -2184,6 +2184,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin - #elif defined(OS_POSIX) - #if defined(OS_ANDROID) +@@ -2161,6 +2161,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin + #elif BUILDFLAG(IS_POSIX) + #if BUILDFLAG(IS_ANDROID) bool enable_crash_reporter = true; -+#elif defined(OS_BSD) ++#elif BUILDFLAG(IS_BSD) + bool enable_crash_reporter = false; #else bool enable_crash_reporter = false; if (crash_reporter::IsCrashpadEnabled()) { -@@ -2497,7 +2499,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin +@@ -2474,7 +2476,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin ThreadProfilerConfiguration::Get()->AppendCommandLineSwitchForChildProcess( command_line); --#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) // 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)) { -@@ -3858,7 +3860,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +@@ -3846,7 +3848,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst } } --#if defined(OS_POSIX) && !defined(OS_MAC) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) +-#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, -@@ -4266,7 +4268,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4258,7 +4260,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati } - #if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || \ + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_CHROMEOS_ASH) -+ BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_BSD) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) MaybeAddThrottle(enterprise_connectors::DeviceTrustNavigationThrottle:: MaybeCreateThrottleFor(handle), &throttles); -@@ -4299,7 +4301,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -4291,7 +4293,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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 4c3aff5fb455..ff16b8c5387c 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-07 13:39:41 UTC +--- chrome/browser/chrome_content_browser_client.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/chrome_content_browser_client.h -@@ -412,7 +412,7 @@ class ChromeContentBrowserClient : public content::Con +@@ -410,7 +410,7 @@ class ChromeContentBrowserClient : public content::Con void OverridePageVisibilityState( content::RenderFrameHost* render_frame_host, content::PageVisibilityState* visibility_state) override; --#if defined(OS_POSIX) && !defined(OS_MAC) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) +-#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_crash__upload__list_crash__upload__list.cc b/www/chromium/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc index 63fec6929287..a7fe163ba2e5 100644 --- a/www/chromium/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc +++ b/www/chromium/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc @@ -1,11 +1,11 @@ ---- chrome/browser/crash_upload_list/crash_upload_list.cc.orig 2021-09-24 04:25:58 UTC +--- chrome/browser/crash_upload_list/crash_upload_list.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/crash_upload_list/crash_upload_list.cc @@ -52,7 +52,7 @@ scoped_refptr CreateCrashUploadList() { // to log uploads in CrashUploadList::kReporterLogFilename. // Linux is handled below. #if !(BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ -- defined(OS_LINUX)) -+ defined(OS_LINUX) || defined(OS_BSD)) +- BUILDFLAG(IS_LINUX)) ++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) if (crash_reporter::IsCrashpadEnabled()) { return new CrashUploadListCrashpad(); } diff --git a/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc b/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc index 89bbf2da0605..8b9b9115d38e 100644 --- a/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc +++ b/www/chromium/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc @@ -1,11 +1,11 @@ ---- chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc @@ -69,7 +69,7 @@ void ChromeProtocolHandlerRegistryDelegate::CheckDefau // If true default protocol handlers will be removed if the OS level // registration for a protocol is no longer Chrome. bool ChromeProtocolHandlerRegistryDelegate::ShouldRemoveHandlersNotInOS() { --#if 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) // We don't do this on Linux as the OS registration there is not reliable, // and Chrome OS doesn't have any notion of OS registration. // TODO(benwells): When Linux support is more reliable remove this diff --git a/www/chromium/files/patch-chrome_browser_defaults.cc b/www/chromium/files/patch-chrome_browser_defaults.cc index 8ccc3075788f..f7270b716bdd 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 2021-12-14 11:44:58 UTC +--- chrome/browser/defaults.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/defaults.cc @@ -50,7 +50,7 @@ const bool kSyncAutoStarts = false; // 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) const bool kScrollEventChangesTab = true; #else const bool kScrollEventChangesTab = false; diff --git a/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd b/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd index c15238834196..4b0f3ecbf844 100644 --- a/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd +++ b/www/chromium/files/patch-chrome_browser_dev__ui__browser__resources.grd @@ -1,11 +1,11 @@ ---- chrome/browser/dev_ui_browser_resources.grd.orig 2021-05-12 22:05:43 UTC +--- chrome/browser/dev_ui_browser_resources.grd.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/dev_ui_browser_resources.grd -@@ -47,7 +47,7 @@ This file specifies browser resources for developer-fa - - +@@ -46,7 +46,7 @@ This file specifies browser resources for developer-fa + + - + diff --git a/www/chromium/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc b/www/chromium/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc index e3a763d30322..e5e00061d6ab 100644 --- a/www/chromium/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc @@ -1,11 +1,11 @@ ---- chrome/browser/device_identity/device_oauth2_token_service_factory.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/device_identity/device_oauth2_token_service_factory.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/device_identity/device_oauth2_token_service_factory.cc @@ -28,7 +28,7 @@ std::unique_ptr CreatePlatform return std::make_unique( local_state); - #elif defined(OS_WIN) || defined(OS_MAC) || defined(OS_FUCHSIA) || \ -- (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_BSD) + #elif 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) return std::make_unique(local_state); #else NOTREACHED(); diff --git a/www/chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc b/www/chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc index a4fdabda91cb..6b9f8c54bad4 100644 --- a/www/chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc +++ b/www/chromium/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc @@ -1,11 +1,11 @@ ---- chrome/browser/devtools/devtools_eye_dropper.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/devtools/devtools_eye_dropper.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/devtools/devtools_eye_dropper.cc @@ -186,7 +186,7 @@ void DevToolsEyeDropper::UpdateCursor() { // magnified projection only with centered hotspot. // Mac Retina requires cursor to be > 120px in order to render smoothly. --#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) const float kCursorSize = 63; const float kDiameter = 63; const float kHotspotOffset = 32; 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 2fe459b66614..e50b9ab03679 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-07 13:39:41 UTC +--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/download/chrome_download_manager_delegate.cc @@ -1539,7 +1539,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe target_info->is_filetype_handled_safely) DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); --#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 (item->GetOriginalMimeType() == "application/x-x509-user-cert") DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); #endif @@ -1608,7 +1608,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile( const base::FilePath& path) { - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #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 content::CheckDownloadAllowedCallback check_download_allowed_cb) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #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 ChromeDownloadManagerDelegate::GetRenameHandlerForDownload( download::DownloadItem* download_item) { - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #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 DCHECK(download_item->IsSavePackageDownload()); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #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__commands.cc b/www/chromium/files/patch-chrome_browser_download_download__commands.cc index 450356c57c46..7322bb2b635c 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__commands.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__commands.cc @@ -1,20 +1,20 @@ ---- chrome/browser/download/download_commands.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/download/download_commands.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/download/download_commands.cc @@ -27,7 +27,7 @@ #include "ui/base/clipboard/scoped_clipboard_writer.h" - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) || defined(OS_FUCHSIA) -+ defined(OS_MAC) || defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" @@ -168,7 +168,7 @@ void DownloadCommands::ExecuteCommand(Command command) } - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) Browser* DownloadCommands::GetBrowser() const { if (!model_) diff --git a/www/chromium/files/patch-chrome_browser_download_download__commands.h b/www/chromium/files/patch-chrome_browser_download_download__commands.h index de608693e66a..b06c4d936816 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__commands.h +++ b/www/chromium/files/patch-chrome_browser_download_download__commands.h @@ -1,11 +1,11 @@ ---- chrome/browser/download/download_commands.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/download/download_commands.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/download/download_commands.h @@ -54,7 +54,7 @@ class DownloadCommands { void ExecuteCommand(Command command); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) || defined(OS_FUCHSIA) -+ defined(OS_MAC) || defined(OS_FUCHSIA) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) bool IsDownloadPdf() const; bool CanOpenPdfInSystemViewer() const; Browser* GetBrowser() const; diff --git a/www/chromium/files/patch-chrome_browser_download_download__item__model.cc b/www/chromium/files/patch-chrome_browser_download_download__item__model.cc index a3f2e3a5db43..de6f03b8595d 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-07 13:39:41 UTC +--- chrome/browser/download/download_item_model.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/download/download_item_model.cc -@@ -635,7 +635,7 @@ bool DownloadItemModel::IsCommandChecked( +@@ -636,7 +636,7 @@ bool DownloadItemModel::IsCommandChecked( download_crx_util::IsExtensionDownload(*download_); case DownloadCommands::ALWAYS_OPEN_TYPE: - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #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(); -@@ -676,7 +676,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand +@@ -677,7 +677,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand DownloadCommands::ALWAYS_OPEN_TYPE); DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile()); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (download_commands->CanOpenPdfInSystemViewer()) { prefs->SetShouldOpenPdfInSystemReader(!is_checked); SetShouldPreferOpeningInBrowser(is_checked); diff --git a/www/chromium/files/patch-chrome_browser_download_download__prefs.cc b/www/chromium/files/patch-chrome_browser_download_download__prefs.cc index 09000d57351d..9dbb2956cd6f 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__prefs.cc +++ b/www/chromium/files/patch-chrome_browser_download_download__prefs.cc @@ -1,97 +1,97 @@ ---- chrome/browser/download/download_prefs.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/download/download_prefs.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/download/download_prefs.cc @@ -13,6 +13,7 @@ #include "base/callback_helpers.h" #include "base/check.h" #include "base/cxx17_backports.h" +#include "base/command_line.h" #include "base/feature_list.h" #include "base/files/file_util.h" #include "base/no_destructor.h" @@ -60,6 +61,8 @@ #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" #endif +#include "sandbox/policy/switches.h" + using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; @@ -70,7 +73,7 @@ namespace { // Consider downloads 'dangerous' if they go to the home directory on Linux and // to the desktop on any platform. bool DownloadPathIsDangerous(const base::FilePath& download_path) { --#if 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) base::FilePath home_dir = base::GetHomeDir(); if (download_path == home_dir) { return true; @@ -168,7 +171,7 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profi #endif // BUILDFLAG(IS_CHROMEOS_ASH) - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) should_open_pdf_in_system_reader_ = prefs->GetBoolean(prefs::kOpenPdfDownloadInSystemReader); #endif @@ -287,7 +290,7 @@ void DownloadPrefs::RegisterProfilePrefs( registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory, default_download_path); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) registry->RegisterBooleanPref(prefs::kOpenPdfDownloadInSystemReader, false); #endif - #if defined(OS_ANDROID) + #if BUILDFLAG(IS_ANDROID) @@ -421,7 +424,7 @@ bool DownloadPrefs::IsDownloadPathManaged() const { bool DownloadPrefs::IsAutoOpenByUserUsed() const { - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (ShouldOpenPdfInSystemReader()) return true; #endif @@ -436,7 +439,7 @@ bool DownloadPrefs::IsAutoOpenEnabled(const GURL& url, DCHECK(extension[0] == base::FilePath::kExtensionSeparator); extension.erase(0, 1); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (base::FilePath::CompareEqualIgnoreCase(extension, FILE_PATH_LITERAL("pdf")) && ShouldOpenPdfInSystemReader()) @@ -491,7 +494,7 @@ void DownloadPrefs::DisableAutoOpenByUserBasedOnExtens } - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) void DownloadPrefs::SetShouldOpenPdfInSystemReader(bool should_open) { if (should_open_pdf_in_system_reader_ == should_open) return; @@ -513,7 +516,7 @@ bool DownloadPrefs::ShouldOpenPdfInSystemReader() cons void DownloadPrefs::ResetAutoOpenByUser() { - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) SetShouldOpenPdfInSystemReader(false); #endif auto_open_by_user_.clear(); -@@ -630,9 +633,13 @@ base::FilePath DownloadPrefs::SanitizeDownloadTargetPa +@@ -651,9 +654,13 @@ base::FilePath DownloadPrefs::SanitizeDownloadTargetPa // Fall back to the default download directory for all other paths. return GetDefaultDownloadDirectoryForProfile(); #else + // If unveil(2) is used, force the file dialog directory to something we + // know is available. + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + // If the stored download directory is an absolute path, we presume it's // correct; there's not really much more validation we can do here. - if (path.IsAbsolute()) + if (command_line->HasSwitch(sandbox::policy::switches::kDisableUnveil) && path.IsAbsolute()) return path; // When the default download directory is *not* an absolute path, we use the diff --git a/www/chromium/files/patch-chrome_browser_download_download__prefs.h b/www/chromium/files/patch-chrome_browser_download_download__prefs.h index 9dfc3dcb070d..7ad6d7876c19 100644 --- a/www/chromium/files/patch-chrome_browser_download_download__prefs.h +++ b/www/chromium/files/patch-chrome_browser_download_download__prefs.h @@ -1,20 +1,20 @@ ---- chrome/browser/download/download_prefs.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/download/download_prefs.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/download/download_prefs.h @@ -122,7 +122,7 @@ class DownloadPrefs { void DisableAutoOpenByUserBasedOnExtension(const base::FilePath& file_name); - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) // Store the user preference to disk. If |should_open| is true, also disable // the built-in PDF plugin. If |should_open| is false, enable the PDF plugin. void SetShouldOpenPdfInSystemReader(bool should_open); @@ -181,7 +181,7 @@ class DownloadPrefs { std::unique_ptr auto_open_allowed_by_urls_; - #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) bool should_open_pdf_in_system_reader_; #endif diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc index d9ebefbbd7f4..4bef52efb9e8 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc @@ -1,29 +1,29 @@ ---- chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc @@ -12,7 +12,7 @@ #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/core/keyed_service.h" --#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) || defined(OS_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 "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/device_trust/browser/browser_device_trust_connector_service.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" @@ -37,7 +37,7 @@ DeviceTrustConnectorService* DeviceTrustConnectorServi bool DeviceTrustConnectorServiceFactory::ServiceIsCreatedWithBrowserContext() const { --#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) return IsDeviceTrustConnectorFeatureEnabled(); #else return false; @@ -58,7 +58,7 @@ KeyedService* DeviceTrustConnectorServiceFactory::Buil DeviceTrustConnectorService* service = nullptr; --#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (IsDeviceTrustConnectorFeatureEnabled()) { auto* key_manager = g_browser_process->browser_policy_connector() ->chrome_browser_cloud_management_controller() diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc index c8de763196d0..62f759813b08 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc @@ -1,11 +1,11 @@ ---- chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc @@ -21,7 +21,7 @@ #include "components/policy/content/policy_blocklist_service.h" #include "content/public/browser/browser_context.h" --#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) || defined(OS_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 "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/device_trust/attestation/desktop/desktop_attestation_service.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc index bdaa9bca00f1..8268b3ffef16 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc @@ -1,20 +1,20 @@ ---- chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/key_persistence_delegate_factory.cc.orig 2022-01-21 13:09:59 UTC +--- chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/key_persistence_delegate_factory.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/key_persistence_delegate_factory.cc @@ -13,7 +13,7 @@ #include "chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/win_key_persistence_delegate.h" - #elif defined(OS_MAC) + #elif BUILDFLAG(IS_MAC) #include "chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/mac_key_persistence_delegate.h" --#elif defined(OS_LINUX) -+#elif defined(OS_LINUX) || defined(OS_BSD) +-#elif BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/linux_key_persistence_delegate.h" #endif @@ -44,7 +44,7 @@ KeyPersistenceDelegateFactory::CreateKeyPersistenceDel return std::make_unique(); - #elif defined(OS_MAC) + #elif BUILDFLAG(IS_MAC) return std::make_unique(); --#elif defined(OS_LINUX) -+#elif defined(OS_LINUX) || defined(OS_BSD) +-#elif BUILDFLAG(IS_LINUX) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return std::make_unique(); #else NOTREACHED(); diff --git a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc index 8c2c05f45f9a..e7c6c5dfc77e 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc @@ -1,20 +1,20 @@ ---- chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc @@ -14,7 +14,7 @@ #include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service_impl.h" #include "chrome/browser/profiles/profile.h" --#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) || defined(OS_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 "base/check.h" #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" @@ -44,7 +44,7 @@ std::unique_ptr CreateSignalsService( decorators.push_back( std::make_unique(policy_blocklist_service)); --#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) policy::ChromeBrowserPolicyConnector* browser_policy_connector = g_browser_process->browser_policy_connector(); DCHECK(browser_policy_connector); diff --git a/www/chromium/files/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc b/www/chromium/files/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc new file mode 100644 index 000000000000..255d96a1e284 --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc @@ -0,0 +1,20 @@ +--- chrome/browser/enterprise/remote_commands/cbcm_remote_commands_factory.cc.orig 2022-02-28 16:54:41 UTC ++++ chrome/browser/enterprise/remote_commands/cbcm_remote_commands_factory.cc +@@ -11,7 +11,7 @@ + #include "chrome/browser/profiles/profile_manager.h" + #include "components/policy/core/common/remote_commands/remote_command_job.h" + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) + #include "chrome/browser/enterprise/connectors/device_trust/device_trust_features.h" + #include "chrome/browser/enterprise/remote_commands/rotate_attestation_credential_job.h" + #include "chrome/browser/policy/chrome_browser_policy_connector.h" +@@ -31,7 +31,7 @@ CBCMRemoteCommandsFactory::BuildJobForType( + g_browser_process->profile_manager()); + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) + if (enterprise_connectors::IsDeviceTrustConnectorFeatureEnabled() && + type == enterprise_management:: + RemoteCommand_Type_BROWSER_ROTATE_ATTESTATION_CREDENTIAL) { diff --git a/www/chromium/files/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc b/www/chromium/files/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc index f47f4f273fd5..cef049635caf 100644 --- a/www/chromium/files/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc +++ b/www/chromium/files/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc @@ -1,20 +1,20 @@ ---- chrome/browser/enterprise/signals/device_info_fetcher.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/enterprise/signals/device_info_fetcher.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/enterprise/signals/device_info_fetcher.cc @@ -10,7 +10,7 @@ #include "chrome/browser/enterprise/signals/device_info_fetcher_mac.h" - #elif defined(OS_WIN) + #elif BUILDFLAG(IS_WIN) #include "chrome/browser/enterprise/signals/device_info_fetcher_win.h" --#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) #include "chrome/browser/enterprise/signals/device_info_fetcher_linux.h" #endif @@ -70,7 +70,7 @@ std::unique_ptr DeviceInfoFetcher:: return std::make_unique(); - #elif defined(OS_WIN) + #elif BUILDFLAG(IS_WIN) return std::make_unique(); --#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) return std::make_unique(); #else return std::make_unique(); diff --git a/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn b/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn index d76569f1c6aa..c415a0336962 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-07 13:39:41 UTC +--- chrome/browser/extensions/BUILD.gn.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/BUILD.gn -@@ -1303,6 +1303,10 @@ static_library("extensions") { +@@ -1298,6 +1298,10 @@ static_library("extensions") { deps += [ "//chrome/services/printing/public/mojom" ] } + if (is_bsd) { + sources -= [ "api/image_writer_private/removable_storage_provider_linux.cc" ] + } + if (enable_service_discovery) { sources += [ "api/mdns/mdns_api.cc", diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc index 184921c28f0b..59e2bb1525d0 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc @@ -1,29 +1,29 @@ ---- chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc -@@ -23,7 +23,7 @@ +@@ -24,7 +24,7 @@ #include "base/win/registry.h" #endif --#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) #include "base/environment.h" #include "base/nix/xdg_util.h" #endif -@@ -228,7 +228,7 @@ base::FilePath GetEndpointVerificationDir() { +@@ -208,7 +208,7 @@ base::FilePath GetEndpointVerificationDir() { bool got_path = false; - #if defined(OS_WIN) + #if BUILDFLAG(IS_WIN) got_path = base::PathService::Get(base::DIR_LOCAL_APP_DATA, &path); --#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) std::unique_ptr env(base::Environment::Create()); path = base::nix::GetXDGDirectory(env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir); -@@ -239,7 +239,7 @@ base::FilePath GetEndpointVerificationDir() { +@@ -219,7 +219,7 @@ base::FilePath GetEndpointVerificationDir() { if (!got_path) return path; --#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) path = path.AppendASCII("google"); #else path = path.AppendASCII("Google"); diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc index 318ce33580c5..a88036a55cae 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc @@ -1,11 +1,11 @@ ---- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc @@ -155,7 +155,7 @@ EnterpriseReportingPrivateGetDeviceIdFunction:: // getPersistentSecret --#if !defined(OS_LINUX) -+#if !defined(OS_LINUX) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_LINUX) ++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) EnterpriseReportingPrivateGetPersistentSecretFunction:: EnterpriseReportingPrivateGetPersistentSecretFunction() = default; diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h index 6428727febf6..885f7e4d295e 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h +++ b/www/chromium/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h @@ -1,11 +1,11 @@ ---- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h @@ -45,7 +45,7 @@ class EnterpriseReportingPrivateGetDeviceIdFunction : ~EnterpriseReportingPrivateGetDeviceIdFunction() override; }; --#if !defined(OS_LINUX) -+#if !defined(OS_LINUX) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_LINUX) ++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) class EnterpriseReportingPrivateGetPersistentSecretFunction : public ExtensionFunction { diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_messaging_native__process__launcher__posix.cc b/www/chromium/files/patch-chrome_browser_extensions_api_messaging_native__process__launcher__posix.cc index e760b5589021..657717257a26 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_messaging_native__process__launcher__posix.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_messaging_native__process__launcher__posix.cc @@ -1,11 +1,11 @@ ---- chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc @@ -82,7 +82,7 @@ bool NativeProcessLauncher::LaunchNativeProcess( // 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) // Don't use no_new_privs mode, e.g. in case the host needs to use sudo. options.allow_new_privs = true; #endif 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 c8ea0be62458..5e1c8a8a0917 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 2021-09-14 01:51:50 UTC +--- 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 -@@ -182,7 +182,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -181,7 +181,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist // 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) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) (*s_allowlist)[::prefs::kUseCustomChromeFrame] = settings_api::PrefType::PREF_TYPE_BOOLEAN; #endif -@@ -196,7 +196,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist +@@ -195,7 +195,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 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) (*s_allowlist)[::prefs::kUsesSystemTheme] = settings_api::PrefType::PREF_TYPE_BOOLEAN; #endif diff --git a/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc b/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc index 1150bf672f0d..8e814e8a9a64 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc @@ -1,29 +1,29 @@ ---- chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc @@ -30,7 +30,7 @@ #include "extensions/browser/process_manager.h" #include "extensions/common/error_utils.h" --#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) #include "extensions/common/permissions/permissions_data.h" #endif @@ -39,7 +39,7 @@ namespace { bool CanEnableAudioDebugRecordingsFromExtension( const extensions::Extension* extension) { bool enabled_by_permissions = 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 (extension) { enabled_by_permissions = extension->permissions_data()->active_permissions().HasAPIPermission( @@ -580,7 +580,7 @@ void WebrtcLoggingPrivateStartEventLoggingFunction::Fi ExtensionFunction::ResponseAction WebrtcLoggingPrivateGetLogsDirectoryFunction::Run() { --#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) // Unlike other WebrtcLoggingPrivate functions that take a RequestInfo object, // this function shouldn't be called by a component extension on behalf of // some web code. It returns a DirectoryEntry for use directly in the calling diff --git a/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc b/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc index 132a4b35a2ba..ccfb84227366 100644 --- a/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc +++ b/www/chromium/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc @@ -1,20 +1,20 @@ ---- chrome/browser/extensions/browser_context_keyed_service_factories.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/extensions/browser_context_keyed_service_factories.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/browser_context_keyed_service_factories.cc -@@ -53,7 +53,7 @@ +@@ -52,7 +52,7 @@ #include "extensions/browser/api/networking_private/networking_private_delegate_factory.h" #include "ppapi/buildflags/buildflags.h" --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h" #endif -@@ -126,7 +126,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() +@@ -124,7 +124,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() extensions::SettingsPrivateEventRouterFactory::GetInstance(); extensions::SettingsOverridesAPI::GetFactoryInstance(); extensions::SignedInDevicesManager::GetFactoryInstance(); --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) extensions::SystemIndicatorManagerFactory::GetInstance(); #endif extensions::TabGroupsEventRouterFactory::GetInstance(); diff --git a/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc b/www/chromium/files/patch-chrome_browser_extensions_external__provider__impl.cc index 20346cba311a..ef8769083bb5 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-07 13:39:41 UTC +--- chrome/browser/extensions/external_provider_impl.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/extensions/external_provider_impl.cc -@@ -815,7 +815,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -816,7 +816,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 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) provider_list->push_back(std::make_unique( service, base::MakeRefCounted( -@@ -843,7 +843,7 @@ void ExternalProviderImpl::CreateExternalProviders( +@@ -844,7 +844,7 @@ void ExternalProviderImpl::CreateExternalProviders( bundled_extension_creation_flags)); // Define a per-user source of external extensions. --#if defined(OS_MAC) || ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && \ -+#if defined(OS_MAC) || ((defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && \ - BUILDFLAG(CHROMIUM_BRANDING)) +-#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ ++#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \ + BUILDFLAG(CHROMIUM_BRANDING)) provider_list->push_back(std::make_unique( service, diff --git a/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc b/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc index b03f80a4a3b9..ebbdbd6295d6 100644 --- a/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc +++ b/www/chromium/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc @@ -1,11 +1,11 @@ ---- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc -@@ -216,7 +216,7 @@ const struct { +@@ -217,7 +217,7 @@ const struct { {base::DIR_HOME, FILE_PATH_LITERAL("Library/Mobile Documents"), kDontBlockChildren}, #endif --#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) // On Linux also block access to devices via /dev, as well as security // sensitive data in /sys and /proc. {kNoBasePathKey, FILE_PATH_LITERAL("/dev"), kBlockAllChildren}, diff --git a/www/chromium/files/patch-chrome_browser_first__run_first__run__dialog.h b/www/chromium/files/patch-chrome_browser_first__run_first__run__dialog.h index d0700ee0815a..3accb34d0e25 100644 --- a/www/chromium/files/patch-chrome_browser_first__run_first__run__dialog.h +++ b/www/chromium/files/patch-chrome_browser_first__run_first__run__dialog.h @@ -1,11 +1,11 @@ ---- chrome/browser/first_run/first_run_dialog.h.orig 2021-04-14 18:40:53 UTC +--- chrome/browser/first_run/first_run_dialog.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/first_run/first_run_dialog.h @@ -12,7 +12,7 @@ // Hide this function on platforms where the dialog does not exist. // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_MAC) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+#if defined(OS_MAC) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_BSD) +-#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) ++#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) class Profile; diff --git a/www/chromium/files/patch-chrome_browser_first__run_first__run__internal.h b/www/chromium/files/patch-chrome_browser_first__run_first__run__internal.h index 14310d4cb9ac..e354427b6e15 100644 --- a/www/chromium/files/patch-chrome_browser_first__run_first__run__internal.h +++ b/www/chromium/files/patch-chrome_browser_first__run_first__run__internal.h @@ -1,11 +1,11 @@ ---- chrome/browser/first_run/first_run_internal.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/first_run/first_run_internal.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/first_run/first_run_internal.h @@ -58,7 +58,7 @@ FirstRunState DetermineFirstRunState(bool has_sentinel // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_MAC) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+#if defined(OS_MAC) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_BSD) +-#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) ++#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD) // For testing, forces the first run dialog to either be shown or not. If not // called, the decision to show the dialog or not will be made by Chrome based // on a number of factors (such as install type, whether it's a Chrome-branded diff --git a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc index 161dfa92d8e6..6338e2b7acaa 100644 --- a/www/chromium/files/patch-chrome_browser_flag__descriptions.cc +++ b/www/chromium/files/patch-chrome_browser_flag__descriptions.cc @@ -1,47 +1,56 @@ ---- chrome/browser/flag_descriptions.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/flag_descriptions.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/flag_descriptions.cc -@@ -5314,7 +5314,7 @@ const char kDownloadShelfWebUIDescription[] = +@@ -5323,7 +5323,7 @@ const char kDownloadShelfWebUIDescription[] = // Random platform combinations ----------------------------------------------- - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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[] = -@@ -5329,7 +5329,7 @@ const char kWebuiFeedbackDescription[] = - // defined(OS_CHROMEOS) || defined(OS_FUCHSIA) +@@ -5338,7 +5338,7 @@ const char kWebuiFeedbackDescription[] = + // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #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[] = -@@ -5348,7 +5348,7 @@ const char kDesktopDetailedLanguageSettingsDescription - #endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || - // defined(OS_FUCHSIA) - --#if defined(OS_CHROMEOS) || defined(OS_LINUX) -+#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) - #if BUILDFLAG(USE_TCMALLOC) - const char kDynamicTcmallocName[] = "Dynamic Tcmalloc Tuning"; - const char kDynamicTcmallocDescription[] = -@@ -5364,7 +5364,7 @@ const char kWebShareDescription[] = +@@ -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[] = "platforms."; - #endif // defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) --#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) const char kOzonePlatformHintChoiceDefault[] = "Default"; const char kOzonePlatformHintChoiceAuto[] = "Auto"; const char kOzonePlatformHintChoiceX11[] = "X11"; -@@ -5482,7 +5482,7 @@ const char kElasticOverscrollDescription[] = - #endif // defined(OS_WIN) || defined(OS_ANDROID) +@@ -5384,7 +5384,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[] = - #if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ -- defined(OS_MAC) || defined(OS_FUCHSIA) -+ defined(OS_MAC) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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 b7b8292e6415..0772dee1e296 100644 --- a/www/chromium/files/patch-chrome_browser_flag__descriptions.h +++ b/www/chromium/files/patch-chrome_browser_flag__descriptions.h @@ -1,56 +1,47 @@ ---- chrome/browser/flag_descriptions.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/flag_descriptions.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/flag_descriptions.h -@@ -22,7 +22,7 @@ - #include "printing/buildflags/buildflags.h" - #include "third_party/blink/public/common/buildflags.h" - --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) - #include "base/allocator/buildflags.h" - #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) - -@@ -3081,7 +3081,7 @@ extern const char kDownloadShelfWebUIDescription[]; +@@ -3070,7 +3070,7 @@ extern const char kDownloadShelfWebUIDescription[]; // Random platform combinations ----------------------------------------------- - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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[]; -@@ -3093,7 +3093,7 @@ extern const char kWebuiFeedbackDescription[]; - // defined(OS_CHROMEOS) || defined(OS_FUCHSIA) +@@ -3082,7 +3082,7 @@ extern const char kWebuiFeedbackDescription[]; + // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #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[]; -@@ -3107,7 +3107,7 @@ extern const char kDesktopDetailedLanguageSettingsDesc - #endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined - // (OS_FUCHSIA) - --#if defined(OS_CHROMEOS) || defined(OS_LINUX) -+#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) - #if BUILDFLAG(USE_TCMALLOC) - extern const char kDynamicTcmallocName[]; - extern const char kDynamicTcmallocDescription[]; -@@ -3119,7 +3119,7 @@ extern const char kWebShareName[]; +@@ -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[]; extern const char kWebShareDescription[]; - #endif // defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) extern const char kOzonePlatformHintChoiceDefault[]; extern const char kOzonePlatformHintChoiceAuto[]; extern const char kOzonePlatformHintChoiceX11[]; -@@ -3201,7 +3201,7 @@ extern const char kElasticOverscrollDescription[]; - #endif // defined(OS_WIN) || defined(OS_ANDROID) +@@ -3197,7 +3197,7 @@ extern const char kElasticOverscrollDescription[]; - #if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \ -- defined(OS_MAC) || defined(OS_FUCHSIA) -+ defined(OS_MAC) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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 212403f82033..dd8f461c2568 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-07 13:39:41 UTC +--- chrome/browser/headless/headless_mode_util.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/headless/headless_mode_util.cc @@ -9,7 +9,7 @@ // Native headless is currently available only on Linux and Windows platforms. // More platforms will be added later, so avoid function level clutter by // providing stub implementations at the end of the file. --#if defined(OS_LINUX) || defined(OS_WIN) -+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include #include @@ -17,7 +17,7 @@ #include "base/base_switches.h" #include "ui/gfx/switches.h" --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/ozone/public/ozone_switches.h" - #endif // defined(OS_LINUX) + #endif // BUILDFLAG(IS_LINUX) @@ -51,7 +51,7 @@ void SetUpCommandLine(const base::CommandLine* command base::CommandLine::ForCurrentProcess()->AppendSwitch( ::switches::kNoErrorDialogs); } --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#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_intranet__redirect__detector.h b/www/chromium/files/patch-chrome_browser_intranet__redirect__detector.h index 3e6bbefc0095..cb20abe773a3 100644 --- a/www/chromium/files/patch-chrome_browser_intranet__redirect__detector.h +++ b/www/chromium/files/patch-chrome_browser_intranet__redirect__detector.h @@ -1,11 +1,11 @@ ---- chrome/browser/intranet_redirect_detector.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/intranet_redirect_detector.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/intranet_redirect_detector.h @@ -27,7 +27,7 @@ class SimpleURLLoader; class PrefRegistrySimple; - #if !(defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA)) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD)) + #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)) #error "IntranetRedirectDetector should only be built on Desktop platforms." #endif diff --git a/www/chromium/files/patch-chrome_browser_media__galleries_media__file__system__registry.cc b/www/chromium/files/patch-chrome_browser_media__galleries_media__file__system__registry.cc index 1ba9df1cf86a..b3fb3adedf5e 100644 --- a/www/chromium/files/patch-chrome_browser_media__galleries_media__file__system__registry.cc +++ b/www/chromium/files/patch-chrome_browser_media__galleries_media__file__system__registry.cc @@ -1,16 +1,16 @@ ---- chrome/browser/media_galleries/media_file_system_registry.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/media_galleries/media_file_system_registry.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media_galleries/media_file_system_registry.cc -@@ -743,7 +743,12 @@ class MediaFileSystemRegistry::MediaFileSystemContextI +@@ -744,7 +744,12 @@ class MediaFileSystemRegistry::MediaFileSystemContextI // Constructor in 'private' section because depends on private class definition. MediaFileSystemRegistry::MediaFileSystemRegistry() : file_system_context_(new MediaFileSystemContextImpl) { - StorageMonitor::GetInstance()->AddObserver(this); + /* + * This conditional is needed for shutdown. Destructors + * try to get the media file system registry. + */ + if (StorageMonitor::GetInstance()) + StorageMonitor::GetInstance()->AddObserver(this); } MediaFileSystemRegistry::~MediaFileSystemRegistry() { diff --git a/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc b/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc index 3810e1791dac..be8233631306 100644 --- a/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc +++ b/www/chromium/files/patch-chrome_browser_media_audio__service__util.cc @@ -1,20 +1,20 @@ ---- chrome/browser/media/audio_service_util.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/media/audio_service_util.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media/audio_service_util.cc -@@ -20,7 +20,7 @@ +@@ -21,7 +21,7 @@ namespace { --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ + (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) bool GetPolicyOrFeature(const char* policy_name, const base::Feature& feature) { const policy::PolicyMap& policies = -@@ -40,7 +40,7 @@ bool GetPolicyOrFeature(const char* policy_name, const +@@ -41,7 +41,7 @@ bool GetPolicyOrFeature(const char* policy_name, const bool IsAudioServiceSandboxEnabled() { // TODO(crbug.com/1052397): Remove !IS_CHROMEOS_LACROS once lacros starts being // built with OS_CHROMEOS instead of OS_LINUX. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ + (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) return GetPolicyOrFeature(policy::key::kAudioSandboxEnabled, features::kAudioServiceSandbox); diff --git a/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn b/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn new file mode 100644 index 000000000000..2d1225b3ad1a --- /dev/null +++ b/www/chromium/files/patch-chrome_browser_media_router_discovery_BUILD.gn @@ -0,0 +1,11 @@ +--- chrome/browser/media/router/discovery/BUILD.gn.orig 2022-02-28 16:54:41 UTC ++++ chrome/browser/media/router/discovery/BUILD.gn +@@ -93,7 +93,7 @@ static_library("discovery") { + "media_sink_discovery_metrics.h", + ] + +- if (is_linux || is_chromeos) { ++ if ((is_linux || is_chromeos) && !is_bsd) { + sources += [ "discovery_network_list_wifi_linux.cc" ] + } + diff --git a/www/chromium/files/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc b/www/chromium/files/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc index de533cff8cd7..71650219d44a 100644 --- a/www/chromium/files/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc +++ b/www/chromium/files/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc @@ -1,35 +1,48 @@ ---- chrome/browser/media/router/discovery/discovery_network_list_posix.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/media/router/discovery/discovery_network_list_posix.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media/router/discovery/discovery_network_list_posix.cc @@ -5,11 +5,12 @@ #include "chrome/browser/media/router/discovery/discovery_network_list.h" #include +#include +#include +#include #include #include #include -#include -#include #include @@ -18,7 +19,7 @@ #include "chrome/browser/media/router/discovery/discovery_network_list_wifi.h" #include "net/base/net_errors.h" --#if !defined(OS_MAC) -+#if !defined(OS_MAC) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_MAC) ++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) #include #else #include @@ -27,7 +28,7 @@ namespace media_router { namespace { --#if !defined(OS_MAC) -+#if !defined(OS_MAC) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_MAC) ++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) using sll = struct sockaddr_ll; #define SOCKET_ARP_TYPE(s) ((s)->sll_hatype) #define SOCKET_ADDRESS_LEN(s) ((s)->sll_halen) +@@ -38,6 +39,12 @@ using sll = struct sockaddr_dl; + #define SOCKET_ARP_TYPE(s) ((s)->sdl_type) + #define SOCKET_ADDRESS_LEN(s) ((s)->sdl_alen) + #define SOCKET_ADDRESS(s) (LLADDR(s)) ++#endif ++ ++#if BUILDFLAG(IS_BSD) ++bool MaybeGetWifiSSID(const std::string& if_name, std::string* ssid_out) { ++ return false; ++} + #endif + + void GetDiscoveryNetworkInfoListImpl( diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc index 23421173ffa6..5e7159774a61 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc @@ -1,11 +1,11 @@ ---- chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media/webrtc/webrtc_event_log_uploader.cc @@ -40,7 +40,7 @@ const char kProduct[] = "Chrome"; const char kProduct[] = "Chrome_Mac"; #elif BUILDFLAG(IS_CHROMEOS_ASH) const char kProduct[] = "Chrome_ChromeOS"; --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) const char kProduct[] = "Chrome_Linux"; - #elif defined(OS_ANDROID) + #elif BUILDFLAG(IS_ANDROID) const char kProduct[] = "Chrome_Android"; diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc index 3955e908aa1c..0d84ec44ea96 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc @@ -1,13 +1,13 @@ ---- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media/webrtc/webrtc_log_uploader.cc @@ -363,6 +363,10 @@ void WebRtcLogUploader::SetupMultipart( const char product[] = "Chrome_ChromeOS"; - #elif defined(OS_FUCHSIA) + #elif BUILDFLAG(IS_FUCHSIA) const char product[] = "Chrome_Fuchsia"; +#elif defined(OS_OPENBSD) + const char product[] = "Chrome_OpenBSD"; +#elif defined(OS_FREEBSD) + const char product[] = "Chrome_FreeBSD"; #else #error Platform not supported. #endif diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc index ce1a69947c1d..5266ccb476a1 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc @@ -1,33 +1,33 @@ ---- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2021-12-14 11:44:58 UTC +--- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media/webrtc/webrtc_logging_controller.cc -@@ -24,10 +24,10 @@ +@@ -25,10 +25,10 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/render_process_host.h" --#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) #include "content/public/browser/child_process_security_policy.h" #include "storage/browser/file_system/isolated_context.h" --#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) -+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) using webrtc_event_logging::WebRtcEventLogManager; -@@ -281,7 +281,7 @@ void WebRtcLoggingController::StartEventLogging( +@@ -282,7 +282,7 @@ void WebRtcLoggingController::StartEventLogging( web_app_id, callback); } --#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) void WebRtcLoggingController::GetLogsDirectory( LogsDirectoryCallback callback, LogsDirectoryErrorCallback error_callback) { -@@ -327,7 +327,7 @@ void WebRtcLoggingController::GrantLogsDirectoryAccess +@@ -328,7 +328,7 @@ void WebRtcLoggingController::GrantLogsDirectoryAccess FROM_HERE, base::BindOnce(std::move(callback), file_system.id(), registered_name)); } --#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) -+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) void WebRtcLoggingController::OnRtpPacket( std::unique_ptr packet_header, diff --git a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h index 13788e46d8a8..9232d0b58ff7 100644 --- a/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h +++ b/www/chromium/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h @@ -1,20 +1,20 @@ ---- chrome/browser/media/webrtc/webrtc_logging_controller.h.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/media/webrtc/webrtc_logging_controller.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/media/webrtc/webrtc_logging_controller.h @@ -132,7 +132,7 @@ class WebRtcLoggingController size_t web_app_id, const StartEventLoggingCallback& callback); --#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) // Ensures that the WebRTC Logs directory exists and then grants render // process access to the 'WebRTC Logs' directory, and invokes |callback| with // the ids necessary to create a DirectoryEntry object. @@ -191,7 +191,7 @@ class WebRtcLoggingController bool success, const std::string& error_message); --#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) // Grants the render process access to the 'WebRTC Logs' directory, and // invokes |callback| with the ids necessary to create a DirectoryEntry // object. If the |logs_path| couldn't be created or found, |error_callback| diff --git a/www/chromium/files/patch-chrome_browser_memory__details.cc b/www/chromium/files/patch-chrome_browser_memory__details.cc index f89d5faa9ab3..18dd4eaf463f 100644 --- a/www/chromium/files/patch-chrome_browser_memory__details.cc +++ b/www/chromium/files/patch-chrome_browser_memory__details.cc @@ -1,20 +1,20 @@ ---- chrome/browser/memory_details.cc.orig 2021-12-31 00:57:23 UTC +--- chrome/browser/memory_details.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/memory_details.cc -@@ -37,7 +37,7 @@ +@@ -38,7 +38,7 @@ #include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h" #include "ui/base/l10n/l10n_util.h" --#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_ANDROID) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_ANDROID) && !defined(OS_BSD) +-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD) #include "content/public/browser/zygote_host/zygote_host_linux.h" #endif -@@ -325,7 +325,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() { +@@ -329,7 +329,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() { std::ref(process))); } --#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_ANDROID) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_ANDROID) && !defined(OS_BSD) +-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD) if (content::ZygoteHost::GetInstance()->IsZygotePid(process.pid)) { process.process_type = content::PROCESS_TYPE_ZYGOTE; } 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 74704b2e05ee..e1174816f336 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,33 +1,23 @@ ---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2022-02-07 13:39:41 UTC +--- 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 -@@ -61,8 +61,10 @@ +@@ -58,8 +58,10 @@ // 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) || defined(OS_BSD) -+#if !defined(OS_BSD) +-#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" -@@ -223,15 +225,18 @@ void RecordStartupMetrics() { - base::UmaHistogramBoolean("Windows.ApplockerRunning", IsApplockerRunning()); - #endif // defined(OS_WIN) - -+#if !defined(OS_BSD) - // TODO(crbug.com/1216328) Remove logging. - LOG(ERROR) << "START: ReportBluetoothAvailability(). " - "If you don't see the END: message, this is crbug.com/1216328."; - bluetooth_utility::ReportBluetoothAvailability(); - LOG(ERROR) << "END: ReportBluetoothAvailability()"; -+#endif +@@ -224,7 +226,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) -+#error out - LOG(ERROR) << "START: GetDefaultBrowser(). " - "If you don't see the END: message, this is 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 45aa8736a957..ec09b0349062 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-07 13:39:41 UTC +--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/metrics/chrome_metrics_service_client.cc -@@ -742,7 +742,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -752,7 +752,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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()); -@@ -838,7 +838,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic +@@ -848,7 +848,7 @@ void ChromeMetricsServiceClient::RegisterMetricsServic std::make_unique()); #endif --#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD) +-#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 // defined(OS_WIN) || defined(OS_MAC) || (defined(OS_LINUX) -@@ -1014,7 +1014,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve + #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) +@@ -1024,7 +1024,7 @@ bool ChromeMetricsServiceClient::RegisterForProfileEve #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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_metrics_perf_cpu__identity.cc b/www/chromium/files/patch-chrome_browser_metrics_perf_cpu__identity.cc index 1458181621b2..804cc8cb640a 100644 --- a/www/chromium/files/patch-chrome_browser_metrics_perf_cpu__identity.cc +++ b/www/chromium/files/patch-chrome_browser_metrics_perf_cpu__identity.cc @@ -1,11 +1,11 @@ ---- chrome/browser/metrics/perf/cpu_identity.cc.orig 2021-07-28 07:40:29 UTC +--- chrome/browser/metrics/perf/cpu_identity.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/metrics/perf/cpu_identity.cc @@ -106,7 +106,7 @@ CPUIdentity GetCPUIdentity() { result.release = #if BUILDFLAG(IS_CHROMEOS_ASH) base::SysInfo::KernelVersion(); --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) base::SysInfo::OperatingSystemVersion(); #else #error "Unsupported configuration" 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 5f63460fb5ac..58b38715d304 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,47 +1,38 @@ ---- chrome/browser/net/system_network_context_manager.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/net/system_network_context_manager.cc.orig 2022-02-28 16:54:41 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 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) #include "chrome/common/chrome_paths_internal.h" #include "chrome/grit/chromium_strings.h" #include "ui/base/l10n/l10n_util.h" -@@ -139,7 +139,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut +@@ -137,7 +137,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAut auth_dynamic_params->basic_over_http_enabled = local_state->GetBoolean(prefs::kBasicAuthOverHttpEnabled); --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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 // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -@@ -370,7 +370,7 @@ SystemNetworkContextManager::SystemNetworkContextManag + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +@@ -369,7 +369,7 @@ SystemNetworkContextManager::SystemNetworkContextManag pref_change_registrar_.Add(prefs::kBasicAuthOverHttpEnabled, auth_pref_callback); --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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 // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -@@ -428,7 +428,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +@@ -427,7 +427,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRe registry->RegisterStringPref(prefs::kAuthServerAllowlist, std::string()); registry->RegisterStringPref(prefs::kAuthNegotiateDelegateAllowlist, std::string()); --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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 // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -@@ -575,7 +575,7 @@ void SystemNetworkContextManager::OnNetworkServiceCrea - - // 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) || defined(OS_BSD) - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - + #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 8c5b62eaca96..d57ebf908539 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-07 13:39:41 UTC +--- chrome/browser/notifications/notification_display_service_impl.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/notifications/notification_display_service_impl.cc @@ -31,7 +31,7 @@ #endif - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ -- defined(OS_WIN) || defined(OS_FUCHSIA) -+ defined(OS_WIN) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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 // static void NotificationDisplayServiceImpl::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#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 std::make_unique()); - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ -- defined(OS_WIN) -+ defined(OS_WIN) || defined(OS_BSD) + #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 #endif - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ -- defined(OS_WIN) -+ defined(OS_WIN) || defined(OS_BSD) + #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_notifications_notification__platform__bridge__delegator.cc b/www/chromium/files/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc index 9826c93c7a70..1d138c9c3cb0 100644 --- a/www/chromium/files/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc +++ b/www/chromium/files/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc @@ -1,11 +1,11 @@ ---- chrome/browser/notifications/notification_platform_bridge_delegator.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/notifications/notification_platform_bridge_delegator.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/notifications/notification_platform_bridge_delegator.cc @@ -57,7 +57,7 @@ bool SystemNotificationsEnabled(Profile* profile) { - #elif defined(OS_WIN) + #elif BUILDFLAG(IS_WIN) return NotificationPlatformBridgeWin::SystemNotificationEnabled(); #else --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (profile) { // Prefs take precedence over flags. PrefService* prefs = profile->GetPrefs(); diff --git a/www/chromium/files/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc b/www/chromium/files/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc index dcccaeaa5380..5800a8f3fd1a 100644 --- a/www/chromium/files/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc +++ b/www/chromium/files/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc @@ -1,11 +1,11 @@ ---- chrome/browser/password_manager/password_reuse_manager_factory.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/password_manager/password_reuse_manager_factory.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/password_manager/password_reuse_manager_factory.cc @@ -94,7 +94,7 @@ KeyedService* PasswordReuseManagerFactory::BuildServic // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) -+ BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) ++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) std::unique_ptr notifier = std::make_unique( IdentityManagerFactory::GetForProfile(profile)); diff --git a/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc b/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc index a809c0a6f185..b76fb7634ea3 100644 --- a/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc +++ b/www/chromium/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc @@ -1,20 +1,20 @@ ---- chrome/browser/performance_manager/policies/high_pmf_discard_policy.cc.orig 2021-09-24 18:27:13 UTC +--- chrome/browser/performance_manager/policies/high_pmf_discard_policy.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/performance_manager/policies/high_pmf_discard_policy.cc @@ -17,7 +17,7 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" --#if !defined(OS_LINUX) -+#if !defined(OS_LINUX) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_LINUX) ++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) #include "base/memory/memory_pressure_monitor.h" #endif @@ -122,7 +122,7 @@ void HighPMFDiscardPolicy::OnProcessMemoryMetricsAvail if (should_discard) { discard_attempt_in_progress_ = true; --#if !defined(OS_LINUX) -+#if !defined(OS_LINUX) && !defined(OS_BSD) +-#if !BUILDFLAG(IS_LINUX) ++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD) // Record the memory pressure level before discarding a tab. content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce([]() { diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc b/www/chromium/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc index 1772808f5a58..a70e5774afa5 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-07 13:39:41 UTC +--- 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 @@ -42,7 +42,7 @@ void RecordProcessHistograms(const char* histogram_suf metrics.cpu_usage * kCPUUsageFactor, kCPUUsageHistogramMin, kCPUUsageHistogramMax, kCPUUsageHistogramBucketCount); - #if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #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.cc b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc index 0849e8e1662f..a5d771754212 100644 --- a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc +++ b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.cc @@ -1,11 +1,11 @@ ---- chrome/browser/performance_monitor/process_monitor.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/performance_monitor/process_monitor.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/performance_monitor/process_monitor.cc -@@ -80,7 +80,7 @@ ProcessMonitor::Metrics& operator+=(ProcessMonitor::Me +@@ -82,7 +82,7 @@ ProcessMonitor::Metrics& operator+=(ProcessMonitor::Me lhs.cpu_usage += rhs.cpu_usage; - #if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_AIX) ++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD) lhs.idle_wakeups += rhs.idle_wakeups; #endif diff --git a/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h b/www/chromium/files/patch-chrome_browser_performance__monitor_process__monitor.h index 7420e47f1360..d3867265beed 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-07 13:39:41 UTC +--- chrome/browser/performance_monitor/process_monitor.h.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/performance_monitor/process_monitor.h @@ -56,7 +56,7 @@ class ProcessMonitor { double cpu_usage = 0.0; - #if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ -- defined(OS_AIX) -+ defined(OS_AIX) || defined(OS_BSD) + #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_platform__util__linux.cc b/www/chromium/files/patch-chrome_browser_platform__util__linux.cc index 0ca2e07e3e4b..6c677548e70d 100644 --- a/www/chromium/files/patch-chrome_browser_platform__util__linux.cc +++ b/www/chromium/files/patch-chrome_browser_platform__util__linux.cc @@ -1,12 +1,12 @@ ---- chrome/browser/platform_util_linux.cc.orig 2021-09-14 01:51:50 UTC +--- chrome/browser/platform_util_linux.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/platform_util_linux.cc -@@ -297,7 +297,9 @@ void RunCommand(const std::string& command, +@@ -298,7 +298,9 @@ void RunCommand(const std::string& command, base::LaunchOptions options; options.current_directory = working_directory; +#if !defined(OS_BSD) options.allow_new_privs = true; +#endif // xdg-open can fall back on mailcap which eventually might plumb through // to a command that needs a terminal. Set the environment variable telling // it that we definitely don't have a terminal available and that it should diff --git a/www/chromium/files/patch-chrome_browser_plugins_plugins__resource__service.cc b/www/chromium/files/patch-chrome_browser_plugins_plugins__resource__service.cc index c741db0784ac..6762dc97c10f 100644 --- a/www/chromium/files/patch-chrome_browser_plugins_plugins__resource__service.cc +++ b/www/chromium/files/patch-chrome_browser_plugins_plugins__resource__service.cc @@ -1,11 +1,11 @@ ---- chrome/browser/plugins/plugins_resource_service.cc.orig 2021-04-14 18:40:54 UTC +--- chrome/browser/plugins/plugins_resource_service.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/plugins/plugins_resource_service.cc @@ -62,7 +62,7 @@ GURL GetPluginsServerURL() { filename = "plugins_win.json"; #elif BUILDFLAG(IS_CHROMEOS_ASH) filename = "plugins_chromeos.json"; --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) filename = "plugins_linux.json"; - #elif defined(OS_MAC) + #elif BUILDFLAG(IS_MAC) filename = "plugins_mac.json"; diff --git a/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc b/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc index 259f40114c52..53796a9dfae2 100644 --- a/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc +++ b/www/chromium/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc @@ -1,11 +1,11 @@ ---- chrome/browser/policy/browser_signin_policy_handler.cc.orig 2021-09-14 01:51:50 UTC +--- chrome/browser/policy/browser_signin_policy_handler.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/policy/browser_signin_policy_handler.cc @@ -43,7 +43,7 @@ void BrowserSigninPolicyHandler::ApplyPolicySettings(c const base::Value* value = policies.GetValue(policy_name()); switch (static_cast(value->GetInt())) { case BrowserSigninMode::kForced: --#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) prefs->SetValue(prefs::kForceBrowserSignin, base::Value(true)); #endif - FALLTHROUGH; + [[fallthrough]]; diff --git a/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc b/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc index 01e01264b438..15c89668c143 100644 --- a/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc +++ b/www/chromium/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc @@ -1,38 +1,38 @@ ---- chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc @@ -46,7 +46,7 @@ #include "chrome/browser/policy/browser_dm_token_storage_mac.h" - #endif // defined(OS_MAC) + #endif // BUILDFLAG(IS_MAC) --#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) #include "chrome/browser/policy/browser_dm_token_storage_linux.h" - #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -55,7 +55,7 @@ #include "chrome/install_static/install_util.h" - #endif // defined(OS_WIN) + #endif // BUILDFLAG(IS_WIN) --#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MAC) -+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MAC) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/device_trust/device_trust_features.h" #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/device_trust_key_manager_impl.h" #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/key_rotation_launcher.h" @@ -88,7 +88,7 @@ void ChromeBrowserCloudManagementControllerDesktop:: - #if defined(OS_MAC) + #if BUILDFLAG(IS_MAC) storage_delegate = std::make_unique(); --#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) storage_delegate = std::make_unique(); - #elif defined(OS_WIN) + #elif BUILDFLAG(IS_WIN) storage_delegate = std::make_unique(); @@ -243,7 +243,7 @@ ChromeBrowserCloudManagementControllerDesktop::CreateC std::unique_ptr ChromeBrowserCloudManagementControllerDesktop::CreateDeviceTrustKeyManager() { --#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MAC) -+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MAC) || defined(OS_BSD) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) if (enterprise_connectors::IsDeviceTrustConnectorFeatureEnabled()) { auto key_rotation_launcher = enterprise_connectors::KeyRotationLauncher::Create( diff --git a/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc b/www/chromium/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc index c77867ed9e8e..17638cef1e0f 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-07 13:39:41 UTC +--- 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 -@@ -1432,7 +1432,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1443,7 +1443,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = base::Value::Type::BOOLEAN }, - #endif // !defined(OS_MAC) && !defined(OS_CHROMEOS) + #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CHROMEOS) --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_BSD) +-#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 }, -@@ -1541,7 +1541,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = +@@ -1552,7 +1552,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_CHROMEOS_ASH) --#if BUILDFLAG(ENABLE_EXTENSIONS) && (defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)) -+#if BUILDFLAG(ENABLE_EXTENSIONS) && (defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || defined(OS_BSD)) +-#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 }, -@@ -1828,7 +1828,7 @@ std::unique_ptr BuildH - #endif // defined(OS_ANDROID) +@@ -1848,7 +1848,7 @@ std::unique_ptr BuildH + #endif // BUILDFLAG(IS_ANDROID) - #if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || \ -- defined(OS_CHROMEOS) || defined(OS_FUCHSIA) -+ defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || defined(OS_BSD) + #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>( -@@ -2193,7 +2193,7 @@ std::unique_ptr BuildH +@@ -2213,7 +2213,7 @@ std::unique_ptr BuildH SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED)); - #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ -- defined(OS_FUCHSIA) -+ defined(OS_FUCHSIA) || defined(OS_BSD) + #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, -@@ -2224,7 +2224,7 @@ std::unique_ptr BuildH +@@ -2244,7 +2244,7 @@ std::unique_ptr BuildH policy::key::kSpellcheckLanguageBlocklist)); #endif // BUILDFLAG(ENABLE_SPELLCHECK) --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) +-#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_policy_device__management__service__configuration.cc b/www/chromium/files/patch-chrome_browser_policy_device__management__service__configuration.cc index ecc41e4e4b39..56bc422f9731 100644 --- a/www/chromium/files/patch-chrome_browser_policy_device__management__service__configuration.cc +++ b/www/chromium/files/patch-chrome_browser_policy_device__management__service__configuration.cc @@ -1,20 +1,20 @@ ---- chrome/browser/policy/device_management_service_configuration.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/policy/device_management_service_configuration.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/policy/device_management_service_configuration.cc -@@ -19,7 +19,7 @@ - #include "chromeos/system/statistics_provider.h" - #endif +@@ -21,7 +21,7 @@ --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && !defined(OS_ANDROID)) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ + ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +- !BUILDFLAG(IS_ANDROID)) ++ !BUILDFLAG(IS_ANDROID)) || BUILDFLAG(IS_BSD) #include "chrome/browser/enterprise/connectors/common.h" #include "chrome/browser/enterprise/connectors/connectors_service.h" -@@ -97,7 +97,7 @@ DeviceManagementServiceConfiguration::GetEncryptedRepo - std::string - DeviceManagementServiceConfiguration::GetReportingConnectorServerUrl( + #endif +@@ -100,7 +100,7 @@ DeviceManagementServiceConfiguration::GetReportingConn content::BrowserContext* context) const { --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && !defined(OS_ANDROID)) + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ + ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +- !BUILDFLAG(IS_ANDROID)) ++ !BUILDFLAG(IS_ANDROID)) || BUILDFLAG(IS_BSD) auto* service = enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext( + context); 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 5090d1971a8d..765d014c725f 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-07 13:39:41 UTC +--- chrome/browser/prefs/browser_prefs.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/prefs/browser_prefs.cc -@@ -415,14 +415,14 @@ +@@ -418,14 +418,14 @@ #include "components/os_crypt/os_crypt.h" #endif --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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 defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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 -@@ -1069,7 +1069,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -1133,7 +1133,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) // TODO(crbug/1169547) Remove `BUILDFLAG(IS_CHROMEOS_LACROS)` once the // migration is complete. - #if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || \ + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ - BUILDFLAG(IS_CHROMEOS_LACROS) -+ BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) ++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) enterprise_connectors::RegisterLocalPrefs(registry); - #endif // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) -@@ -1101,7 +1101,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) +@@ -1165,7 +1165,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) - #endif // defined(OS_WIN) + #endif // BUILDFLAG(IS_WIN) --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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 -@@ -1396,7 +1396,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync +@@ -1462,7 +1462,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySync // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) browser_switcher::BrowserSwitcherPrefs::RegisterProfilePrefs(registry); #endif diff --git a/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc b/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc index d7e49d174568..832e4f781f80 100644 --- a/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc +++ b/www/chromium/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc @@ -1,11 +1,11 @@ ---- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2021-09-14 01:51:50 UTC +--- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/prefs/pref_service_incognito_allowlist.cc @@ -139,7 +139,7 @@ const char* const kPersistentPrefNames[] = { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if 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) // Toggleing custom frames affects all open windows in the profile, hence // should be written to the regular profile when changed in incognito mode. prefs::kUseCustomChromeFrame, diff --git a/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc b/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc index c6418795ec69..fbf6389c8630 100644 --- a/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc +++ b/www/chromium/files/patch-chrome_browser_printing_print__job__worker.cc @@ -1,11 +1,11 @@ ---- chrome/browser/printing/print_job_worker.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/printing/print_job_worker.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/printing/print_job_worker.cc -@@ -231,7 +231,7 @@ void PrintJobWorker::UpdatePrintSettings(base::Value n +@@ -225,7 +225,7 @@ void PrintJobWorker::UpdatePrintSettings(base::Value n crash_key = std::make_unique( print_backend->GetPrinterDriverInfo(printer_name)); --#if defined(OS_LINUX) && defined(USE_CUPS) -+#if (defined(OS_LINUX) || defined(OS_BSD)) && defined(USE_CUPS) +-#if BUILDFLAG(IS_LINUX) && defined(USE_CUPS) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(USE_CUPS) PrinterBasicInfo basic_info; if (print_backend->GetPrinterBasicInfo(printer_name, &basic_info) == mojom::ResultCode::kSuccess) { diff --git a/www/chromium/files/patch-chrome_browser_process__singleton__posix.cc b/www/chromium/files/patch-chrome_browser_process__singleton__posix.cc index 13496fa7614a..66ce87c56787 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 2021-12-14 11:44:58 UTC +--- chrome/browser/process_singleton_posix.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/process_singleton_posix.cc @@ -97,12 +97,12 @@ #include "net/base/network_interfaces.h" #include "ui/base/l10n/l10n_util.h" --#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) #include "chrome/browser/ui/process_singleton_dialog_linux.h" #endif #if defined(TOOLKIT_VIEWS) && \ -- (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)) +- (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 if (g_disable_prompt) return g_user_opted_unlock_in_use_profile; --#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::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 return PROCESS_NONE; } else if (strncmp(buf, kACKToken, base::size(kACKToken) - 1) == 0) { #if defined(TOOLKIT_VIEWS) && \ -- (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)) +- (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 56f01d1a7bbc..83a59c11089e 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-07 13:39:41 UTC +--- 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 -@@ -384,7 +384,7 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -385,7 +385,7 @@ void ChromeBrowserMainExtraPartsProfiles:: #endif // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#if defined(OS_WIN) || defined(OS_MAC) || \ -+#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_BSD) || \ - (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) +-#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 ba2d9b1e4223..eedb1286b9ff 100644 --- a/www/chromium/files/patch-chrome_browser_profiles_profile__impl.cc +++ b/www/chromium/files/patch-chrome_browser_profiles_profile__impl.cc @@ -1,25 +1,25 @@ ---- chrome/browser/profiles/profile_impl.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/profiles/profile_impl.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/profiles/profile_impl.cc -@@ -181,6 +181,7 @@ +@@ -182,6 +182,7 @@ #include "services/preferences/public/mojom/preferences.mojom.h" #include "services/preferences/public/mojom/tracked_preference_validation_delegate.mojom.h" #include "services/service_manager/public/cpp/service.h" +#include "sandbox/policy/switches.h" #include "ui/base/l10n/l10n_util.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -846,7 +847,13 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) +@@ -850,7 +851,13 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) } base::FilePath ProfileImpl::last_selected_directory() { - return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); + // If unveil(2) is used, force the file dialog directory to something we + // know is available. + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (!command_line->HasSwitch(sandbox::policy::switches::kDisableUnveil)) + return GetPrefs()->GetFilePath(prefs::kDownloadDefaultDirectory); + else + return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); } void ProfileImpl::set_last_selected_directory(const base::FilePath& path) { diff --git a/www/chromium/files/patch-chrome_browser_profiles_profiles__state.cc b/www/chromium/files/patch-chrome_browser_profiles_profiles__state.cc index a413ea0d2112..497ec10d4120 100644 --- a/www/chromium/files/patch-chrome_browser_profiles_profiles__state.cc +++ b/www/chromium/files/patch-chrome_browser_profiles_profiles__state.cc @@ -1,11 +1,11 @@ ---- chrome/browser/profiles/profiles_state.cc.orig 2022-02-07 13:39:41 UTC +--- chrome/browser/profiles/profiles_state.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/profiles/profiles_state.cc @@ -176,7 +176,7 @@ bool IsGuestModeRequested(const base::CommandLine& com PrefService* local_state, bool show_warning) { - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \ -- defined(OS_MAC) -+ defined(OS_MAC) || defined(OS_BSD) + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \ +- BUILDFLAG(IS_MAC) ++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) DCHECK(local_state); // Check if guest mode enforcement commandline switch or policy are provided. 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 d676169653ed..b85855ca3911 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-07 13:39:41 UTC +--- chrome/browser/renderer_preferences_util.cc.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/renderer_preferences_util.cc @@ -41,7 +41,7 @@ #include "ui/base/cocoa/defaults_utils.h" #endif --#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)) +-#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; #endif --#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) -+#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)) +-#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 #endif - #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ -- defined(OS_WIN) -+ defined(OS_WIN) || defined(OS_BSD) + #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 index 4808ad2f96b9..e82d989ae51f 100644 --- 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 @@ -1,13 +1,13 @@ ---- chrome/browser/resources/new_tab_page/new_tab_page.js.orig 2022-02-07 13:39:41 UTC +--- 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/foo_proxy.js'; --export {dummyDescriptor} from './modules/dummy/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} from './modules/module_descriptor.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.html b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html index aa0737875900..522102aa1e38 100644 --- a/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html +++ b/www/chromium/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html @@ -1,29 +1,29 @@ ---- chrome/browser/resources/settings/appearance_page/appearance_page.html.orig 2021-09-14 01:51:51 UTC +--- chrome/browser/resources/settings/appearance_page/appearance_page.html.orig 2022-02-28 16:54:41 UTC +++ chrome/browser/resources/settings/appearance_page/appearance_page.html @@ -27,7 +27,7 @@ -- -+ +- ++ - +