pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
chromium-next: working on the llvm-19 based chromium-132
Module Name: pkgsrc-wip
Committed By: kikadf <kikadf.01%gmail.com@localhost>
Pushed By: kikadf
Date: Mon Jan 27 08:44:27 2025 +0100
Changeset: 81f09aab8eda45c91d294e1baeda03ce07753e4d
Modified Files:
Makefile
chromium/TODO
Added Files:
chromium-next/DESCR
chromium-next/Makefile
chromium-next/PLIST
chromium-next/TODO
chromium-next/distinfo
chromium-next/files/chromium-browser.desktop
chromium-next/files/chromium.sh.in
chromium-next/options.mk
chromium-next/patches/patch-BUILD.gn
chromium-next/patches/patch-apps_ui_views_app__window__frame__view.cc
chromium-next/patches/patch-ash_display_mirror__window__controller.cc
chromium-next/patches/patch-base_BUILD.gn
chromium-next/patches/patch-base_allocator_dispatcher_tls.h
chromium-next/patches/patch-base_allocator_partition__allocator_partition__alloc.gni
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_BUILD.gn
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_address__space__randomization.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_proc__maps__linux.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_stack__trace__posix.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_rand__util__posix.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__internal__posix.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__posix.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__config.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__forward.h
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_spinning__mutex.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_stack_stack.cc
chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_thread__isolation_pkey.cc
chromium-next/patches/patch-base_atomicops.h
chromium-next/patches/patch-base_base__paths__posix.cc
chromium-next/patches/patch-base_compiler__specific.h
chromium-next/patches/patch-base_debug_debugger__posix.cc
chromium-next/patches/patch-base_debug_elf__reader.cc
chromium-next/patches/patch-base_debug_proc__maps__linux.cc
chromium-next/patches/patch-base_debug_stack__trace.cc
chromium-next/patches/patch-base_debug_stack__trace__posix.cc
chromium-next/patches/patch-base_files_dir__reader__linux.h
chromium-next/patches/patch-base_files_dir__reader__posix.h
chromium-next/patches/patch-base_files_drive__info.h
chromium-next/patches/patch-base_files_drive__info__posix.cc
chromium-next/patches/patch-base_files_file__path__watcher.h
chromium-next/patches/patch-base_files_file__path__watcher__bsd.cc
chromium-next/patches/patch-base_files_file__path__watcher__kqueue.cc
chromium-next/patches/patch-base_files_file__path__watcher__kqueue.h
chromium-next/patches/patch-base_files_file__path__watcher__unittest.cc
chromium-next/patches/patch-base_files_file__util__posix.cc
chromium-next/patches/patch-base_files_file__util__unittest.cc
chromium-next/patches/patch-base_files_important__file__writer__cleaner.cc
chromium-next/patches/patch-base_files_scoped__file.cc
chromium-next/patches/patch-base_functional_unretained__traits.h
chromium-next/patches/patch-base_i18n_icu__util.cc
chromium-next/patches/patch-base_linux__util.cc
chromium-next/patches/patch-base_logging__unittest.cc
chromium-next/patches/patch-base_memory_discardable__memory.cc
chromium-next/patches/patch-base_memory_discardable__memory__internal.h
chromium-next/patches/patch-base_memory_madv__free__discardable__memory__posix.cc
chromium-next/patches/patch-base_memory_platform__shared__memory__region.h
chromium-next/patches/patch-base_memory_platform__shared__memory__region__posix.cc
chromium-next/patches/patch-base_memory_protected__memory.h
chromium-next/patches/patch-base_memory_protected__memory__posix.cc
chromium-next/patches/patch-base_message__loop_message__pump__epoll.cc
chromium-next/patches/patch-base_message__loop_message__pump__epoll.h
chromium-next/patches/patch-base_message__loop_message__pump__glib.cc
chromium-next/patches/patch-base_native__library__posix.cc
chromium-next/patches/patch-base_native__library__unittest.cc
chromium-next/patches/patch-base_posix_can__lower__nice__to.cc
chromium-next/patches/patch-base_posix_file__descriptor__shuffle.h
chromium-next/patches/patch-base_posix_sysctl.cc
chromium-next/patches/patch-base_posix_unix__domain__socket.cc
chromium-next/patches/patch-base_posix_unix__domain__socket__unittest.cc
chromium-next/patches/patch-base_process_internal__linux.h
chromium-next/patches/patch-base_process_kill.h
chromium-next/patches/patch-base_process_kill__posix.cc
chromium-next/patches/patch-base_process_launch.h
chromium-next/patches/patch-base_process_launch__posix.cc
chromium-next/patches/patch-base_process_memory__linux.cc
chromium-next/patches/patch-base_process_process__handle.cc
chromium-next/patches/patch-base_process_process__handle.h
chromium-next/patches/patch-base_process_process__handle__freebsd.cc
chromium-next/patches/patch-base_process_process__handle__netbsd.cc
chromium-next/patches/patch-base_process_process__handle__openbsd.cc
chromium-next/patches/patch-base_process_process__iterator.h
chromium-next/patches/patch-base_process_process__iterator__freebsd.cc
chromium-next/patches/patch-base_process_process__iterator__netbsd.cc
chromium-next/patches/patch-base_process_process__iterator__openbsd.cc
chromium-next/patches/patch-base_process_process__metrics.cc
chromium-next/patches/patch-base_process_process__metrics.h
chromium-next/patches/patch-base_process_process__metrics__freebsd.cc
chromium-next/patches/patch-base_process_process__metrics__netbsd.cc
chromium-next/patches/patch-base_process_process__metrics__openbsd.cc
chromium-next/patches/patch-base_process_process__metrics__posix.cc
chromium-next/patches/patch-base_process_process__metrics__unittest.cc
chromium-next/patches/patch-base_process_process__posix.cc
chromium-next/patches/patch-base_process_process__unittest.cc
chromium-next/patches/patch-base_profiler_module__cache.cc
chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.cc
chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.h
chromium-next/patches/patch-base_profiler_stack__base__address__posix.cc
chromium-next/patches/patch-base_profiler_stack__sampling__profiler__test__util.cc
chromium-next/patches/patch-base_profiler_stack__sampling__profiler__unittest.cc
chromium-next/patches/patch-base_profiler_thread__delegate__posix.cc
chromium-next/patches/patch-base_rand__util.h
chromium-next/patches/patch-base_rand__util__posix.cc
chromium-next/patches/patch-base_strings_safe__sprintf__unittest.cc
chromium-next/patches/patch-base_synchronization_lock__impl.h
chromium-next/patches/patch-base_syslog__logging.cc
chromium-next/patches/patch-base_system_sys__info.cc
chromium-next/patches/patch-base_system_sys__info.h
chromium-next/patches/patch-base_system_sys__info__freebsd.cc
chromium-next/patches/patch-base_system_sys__info__netbsd.cc
chromium-next/patches/patch-base_system_sys__info__openbsd.cc
chromium-next/patches/patch-base_system_sys__info__posix.cc
chromium-next/patches/patch-base_system_sys__info__unittest.cc
chromium-next/patches/patch-base_task_thread__pool_environment__config__unittest.cc
chromium-next/patches/patch-base_test_launcher_test__launcher.cc
chromium-next/patches/patch-base_test_test__file__util__linux.cc
chromium-next/patches/patch-base_test_test__file__util__posix.cc
chromium-next/patches/patch-base_threading_platform__thread.h
chromium-next/patches/patch-base_threading_platform__thread__bsd.cc
chromium-next/patches/patch-base_threading_platform__thread__internal__posix.cc
chromium-next/patches/patch-base_threading_platform__thread__posix.cc
chromium-next/patches/patch-base_threading_platform__thread__unittest.cc
chromium-next/patches/patch-base_time_time__now__posix.cc
chromium-next/patches/patch-base_trace__event_malloc__dump__provider.cc
chromium-next/patches/patch-base_trace__event_memory__dump__manager.cc
chromium-next/patches/patch-base_trace__event_process__memory__dump.cc
chromium-next/patches/patch-base_tracing_trace__time.cc
chromium-next/patches/patch-base_tracing_trace__time.h
chromium-next/patches/patch-base_version__info_version__info.h
chromium-next/patches/patch-build_config_BUILD.gn
chromium-next/patches/patch-build_config_BUILDCONFIG.gn
chromium-next/patches/patch-build_config_clang_BUILD.gn
chromium-next/patches/patch-build_config_compiler_BUILD.gn
chromium-next/patches/patch-build_config_gcc_BUILD.gn
chromium-next/patches/patch-build_config_linux_BUILD.gn
chromium-next/patches/patch-build_config_linux_libdrm_BUILD.gn
chromium-next/patches/patch-build_config_linux_pkg-config.py
chromium-next/patches/patch-build_config_ozone.gni
chromium-next/patches/patch-build_config_rust.gni
chromium-next/patches/patch-build_config_v8__target__cpu.gni
chromium-next/patches/patch-build_detect__host__arch.py
chromium-next/patches/patch-build_gn__run__binary.py
chromium-next/patches/patch-build_linux_chrome.map
chromium-next/patches/patch-build_linux_strip__binary.py
chromium-next/patches/patch-build_linux_unbundle_icu.gn
chromium-next/patches/patch-build_linux_unbundle_libevent.gn
chromium-next/patches/patch-build_linux_unbundle_libusb.gn
chromium-next/patches/patch-build_rust_rust__bindgen.gni
chromium-next/patches/patch-build_rust_rust__bindgen__generator.gni
chromium-next/patches/patch-build_rust_std_BUILD.gn
chromium-next/patches/patch-build_toolchain_freebsd_BUILD.gn
chromium-next/patches/patch-build_toolchain_gcc__solink__wrapper.py
chromium-next/patches/patch-build_toolchain_gcc__toolchain.gni
chromium-next/patches/patch-build_toolchain_netbsd_BUILD.gn
chromium-next/patches/patch-build_toolchain_openbsd_BUILD.gn
chromium-next/patches/patch-build_toolchain_toolchain.gni
chromium-next/patches/patch-cc_base_features.cc
chromium-next/patches/patch-chrome_app_chrome__command__ids.h
chromium-next/patches/patch-chrome_app_chrome__main.cc
chromium-next/patches/patch-chrome_app_chrome__main__delegate.cc
chromium-next/patches/patch-chrome_browser_BUILD.gn
chromium-next/patches/patch-chrome_browser_about__flags.cc
chromium-next/patches/patch-chrome_browser_accessibility_page__colors.cc
chromium-next/patches/patch-chrome_browser_after__startup__task__utils.cc
chromium-next/patches/patch-chrome_browser_apps_app__service_publishers_extension__apps.cc
chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc
chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.h
chromium-next/patches/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc
chromium-next/patches/patch-chrome_browser_background_background__mode__manager.cc
chromium-next/patches/patch-chrome_browser_background_background__mode__optimizer.cc
chromium-next/patches/patch-chrome_browser_browser__features.cc
chromium-next/patches/patch-chrome_browser_browser__features.h
chromium-next/patches/patch-chrome_browser_browser__process__impl.cc
chromium-next/patches/patch-chrome_browser_browser__process__impl.h
chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.cc
chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.h
chromium-next/patches/patch-chrome_browser_chrome__browser__interface__binders.cc
chromium-next/patches/patch-chrome_browser_chrome__browser__main.cc
chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc
chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__ozone.cc
chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.cc
chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.h
chromium-next/patches/patch-chrome_browser_chrome__browser__main__posix.cc
chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.cc
chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.h
chromium-next/patches/patch-chrome_browser_component__updater_widevine__cdm__component__installer.cc
chromium-next/patches/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc
chromium-next/patches/patch-chrome_browser_defaults.cc
chromium-next/patches/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc
chromium-next/patches/patch-chrome_browser_diagnostics_diagnostics__writer.h
chromium-next/patches/patch-chrome_browser_download_chrome__download__manager__delegate.cc
chromium-next/patches/patch-chrome_browser_download_download__commands.cc
chromium-next/patches/patch-chrome_browser_download_download__commands.h
chromium-next/patches/patch-chrome_browser_download_download__file__picker.cc
chromium-next/patches/patch-chrome_browser_download_download__item__model.cc
chromium-next/patches/patch-chrome_browser_download_download__prefs.cc
chromium-next/patches/patch-chrome_browser_download_download__prefs.h
chromium-next/patches/patch-chrome_browser_enterprise_connectors_analysis_analysis__service__settings.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_common.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_connectors__service.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_browser__crash__event__router.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.cc
chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.h
chromium-next/patches/patch-chrome_browser_enterprise_identifiers_profile__id__delegate__impl.cc
chromium-next/patches/patch-chrome_browser_enterprise_profile__management_profile__management__navigation__throttle.cc
chromium-next/patches/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc
chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc
chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher__linux.cc
chromium-next/patches/patch-chrome_browser_enterprise_signin_enterprise__signin__service.h
chromium-next/patches/patch-chrome_browser_enterprise_signin_interstitials_managed__profile__required__page.cc
chromium-next/patches/patch-chrome_browser_extensions_BUILD.gn
chromium-next/patches/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc
chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc
chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.cc
chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.h
chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc
chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h
chromium-next/patches/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc
chromium-next/patches/patch-chrome_browser_extensions_api_management_chrome__management__api__delegate.cc
chromium-next/patches/patch-chrome_browser_extensions_api_messaging_launch__context__posix.cc
chromium-next/patches/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc
chromium-next/patches/patch-chrome_browser_extensions_api_runtime_chrome__runtime__api__delegate.cc
chromium-next/patches/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc
chromium-next/patches/patch-chrome_browser_extensions_api_tabs_tabs__api.cc
chromium-next/patches/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc
chromium-next/patches/patch-chrome_browser_extensions_api_webstore__private_webstore__private__api.cc
chromium-next/patches/patch-chrome_browser_extensions_external__provider__impl.cc
chromium-next/patches/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc
chromium-next/patches/patch-chrome_browser_first__run_first__run__dialog.h
chromium-next/patches/patch-chrome_browser_first__run_first__run__internal.h
chromium-next/patches/patch-chrome_browser_flag__descriptions.cc
chromium-next/patches/patch-chrome_browser_flag__descriptions.h
chromium-next/patches/patch-chrome_browser_gcm_gcm__profile__service__factory.cc
chromium-next/patches/patch-chrome_browser_gcm_instance__id_instance__id__profile__service__factory.cc
chromium-next/patches/patch-chrome_browser_global__features.cc
chromium-next/patches/patch-chrome_browser_global__features.h
chromium-next/patches/patch-chrome_browser_headless_headless__mode__util.cc
chromium-next/patches/patch-chrome_browser_intranet__redirect__detector.h
chromium-next/patches/patch-chrome_browser_media__galleries_fileapi_mtp__device__map__service.cc
chromium-next/patches/patch-chrome_browser_media__galleries_media__file__system__registry.cc
chromium-next/patches/patch-chrome_browser_media_audio__service__util.cc
chromium-next/patches/patch-chrome_browser_media_router_discovery_BUILD.gn
chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc
chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__wifi__linux.cc
chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc
chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h
chromium-next/patches/patch-chrome_browser_media_webrtc_desktop__media__picker__controller.cc
chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc
chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc
chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h
chromium-next/patches/patch-chrome_browser_memory__details.cc
chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc
chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h
chromium-next/patches/patch-chrome_browser_metrics_chrome__metrics__service__client.cc
chromium-next/patches/patch-chrome_browser_metrics_perf_cpu__identity.cc
chromium-next/patches/patch-chrome_browser_metrics_power_process__metrics__recorder__util.cc
chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.cc
chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.h
chromium-next/patches/patch-chrome_browser_net_profile__network__context__service.cc
chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.cc
chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.h
chromium-next/patches/patch-chrome_browser_new__tab__page_modules_file__suggestion_drive__service.cc
chromium-next/patches/patch-chrome_browser_new__tab__page_new__tab__page__util.cc
chromium-next/patches/patch-chrome_browser_notifications_notification__display__service__impl.cc
chromium-next/patches/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc
chromium-next/patches/patch-chrome_browser_password__manager_chrome__password__manager__client.cc
chromium-next/patches/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc
chromium-next/patches/patch-chrome_browser_platform__util__linux.cc
chromium-next/patches/patch-chrome_browser_policy_browser__signin__policy__handler.cc
chromium-next/patches/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc
chromium-next/patches/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc
chromium-next/patches/patch-chrome_browser_policy_device__management__service__configuration.cc
chromium-next/patches/patch-chrome_browser_policy_policy__value__and__status__aggregator.cc
chromium-next/patches/patch-chrome_browser_prefs_browser__prefs.cc
chromium-next/patches/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc
chromium-next/patches/patch-chrome_browser_printing_print__backend__service__manager.cc
chromium-next/patches/patch-chrome_browser_printing_printer__query.cc
chromium-next/patches/patch-chrome_browser_process__singleton__posix.cc
chromium-next/patches/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc
chromium-next/patches/patch-chrome_browser_profiles_profile__impl.cc
chromium-next/patches/patch-chrome_browser_profiles_profiles__state.cc
chromium-next/patches/patch-chrome_browser_renderer__preferences__util.cc
chromium-next/patches/patch-chrome_browser_resources_settings_autofill__page_passwords__shared.css
chromium-next/patches/patch-chrome_browser_resources_signin_signin__shared.css
chromium-next/patches/patch-chrome_browser_safe__browsing_chrome__password__protection__service.cc
chromium-next/patches/patch-chrome_browser_safe__browsing_cloud__content__scanning_binary__upload__service.cc
chromium-next/patches/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc
chromium-next/patches/patch-chrome_browser_safe__browsing_safe__browsing__service.cc
chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__install__state.cc
chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__service__router.cc
chromium-next/patches/patch-chrome_browser_send__tab__to__self_receiving__ui__handler__registry.cc
chromium-next/patches/patch-chrome_browser_send__tab__to__self_send__tab__to__self__client__service.cc
chromium-next/patches/patch-chrome_browser_sessions_session__restore.cc
chromium-next/patches/patch-chrome_browser_sharing_sharing__handler__registry__impl.cc
chromium-next/patches/patch-chrome_browser_shortcuts_icon__badging.cc
chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.cc
chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.h
chromium-next/patches/patch-chrome_browser_signin_signin__util.cc
chromium-next/patches/patch-chrome_browser_supervised__user_classify__url__navigation__throttle.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.h
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__delegate__impl.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.h
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__google__auth__navigation__throttle.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__metrics__service__factory.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__observer.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.cc
chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.h
chromium-next/patches/patch-chrome_browser_sync_chrome__sync__controller__builder.cc
chromium-next/patches/patch-chrome_browser_sync_device__info__sync__client__impl.cc
chromium-next/patches/patch-chrome_browser_sync_sync__service__factory.cc
chromium-next/patches/patch-chrome_browser_tab__group__sync_tab__group__sync__service__factory.cc
chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.cc
chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.h
chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.cc
chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.h
chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc
chromium-next/patches/patch-chrome_browser_task__manager_task__manager__observer.h
chromium-next/patches/patch-chrome_browser_themes_theme__helper.cc
chromium-next/patches/patch-chrome_browser_themes_theme__service.cc
chromium-next/patches/patch-chrome_browser_themes_theme__service__aura__linux.cc
chromium-next/patches/patch-chrome_browser_themes_theme__service__factory.cc
chromium-next/patches/patch-chrome_browser_ui_actions_chrome__action__id.h
chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.cc
chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.h
chromium-next/patches/patch-chrome_browser_ui_browser.h
chromium-next/patches/patch-chrome_browser_ui_browser__command__controller.cc
chromium-next/patches/patch-chrome_browser_ui_browser__commands.cc
chromium-next/patches/patch-chrome_browser_ui_browser__ui__prefs.cc
chromium-next/patches/patch-chrome_browser_ui_browser__view__prefs.cc
chromium-next/patches/patch-chrome_browser_ui_chrome__pages.cc
chromium-next/patches/patch-chrome_browser_ui_chrome__pages.h
chromium-next/patches/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc
chromium-next/patches/patch-chrome_browser_ui_managed__ui.cc
chromium-next/patches/patch-chrome_browser_ui_omnibox_omnibox__pedal__implementations.cc
chromium-next/patches/patch-chrome_browser_ui_passwords_bubble__controllers_relaunch__chrome__bubble__controller.cc
chromium-next/patches/patch-chrome_browser_ui_passwords_manage__passwords__ui__controller.cc
chromium-next/patches/patch-chrome_browser_ui_sad__tab.cc
chromium-next/patches/patch-chrome_browser_ui_sharing__hub_sharing__hub__bubble__controller.h
chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller.cc
chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller__delegate.h
chromium-next/patches/patch-chrome_browser_ui_startup_bad__flags__prompt.cc
chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator.cc
chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc
chromium-next/patches/patch-chrome_browser_ui_startup_startup__tab__provider.cc
chromium-next/patches/patch-chrome_browser_ui_tab__helpers.cc
chromium-next/patches/patch-chrome_browser_ui_tabs_features.cc
chromium-next/patches/patch-chrome_browser_ui_tabs_tab__strip__prefs.cc
chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__columns.h
chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__table__model.cc
chromium-next/patches/patch-chrome_browser_ui_test_popup__browsertest.cc
chromium-next/patches/patch-chrome_browser_ui_test_test__browser__ui.cc
chromium-next/patches/patch-chrome_browser_ui_ui__features.cc
chromium-next/patches/patch-chrome_browser_ui_ui__features.h
chromium-next/patches/patch-chrome_browser_ui_views_accelerator__table.cc
chromium-next/patches/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc
chromium-next/patches/patch-chrome_browser_ui_views_chrome__browser__main__extra__parts__views.cc
chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate.h
chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate__linux.cc
chromium-next/patches/patch-chrome_browser_ui_views_compose_compose__dialog__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.h
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux__native.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__linux.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.h
chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view__layout__delegate.h
chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.h
chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__builder.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__delegate.cc
chromium-next/patches/patch-chrome_browser_ui_views_frame_tab__strip__region__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_hung__renderer__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_omnibox_omnibox__view__views.cc
chromium-next/patches/patch-chrome_browser_ui_views_passwords_password__bubble__view__base.cc
chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc
chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__picker__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc
chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.h
chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab.cc
chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc
chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc
chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__style__views.cc
chromium-next/patches/patch-chrome_browser_ui_views_user__education_browser__user__education__service.cc
chromium-next/patches/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc
chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__dialogs.h
chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.cc
chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.h
chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.cc
chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.h
chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc
chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.h
chromium-next/patches/patch-chrome_browser_ui_webui_app__settings_web__app__settings__ui.h
chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_certificate__manager__handler.cc
chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.cc
chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.h
chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__configs.cc
chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc
chromium-next/patches/patch-chrome_browser_ui_webui_connectors__internals_device__trust__utils.cc
chromium-next/patches/patch-chrome_browser_ui_webui_internals_user__education_user__education__internals__page__handler__impl.cc
chromium-next/patches/patch-chrome_browser_ui_webui_interstitials_interstitial__ui.cc
chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui.cc
chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.cc
chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.h
chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.cc
chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.h
chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards__handler.cc
chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards_relaunch__chrome__promo.cc
chromium-next/patches/patch-chrome_browser_ui_webui_searchbox_searchbox__handler.cc
chromium-next/patches/patch-chrome_browser_ui_webui_settings_appearance__handler.cc
chromium-next/patches/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc
chromium-next/patches/patch-chrome_browser_ui_webui_signin_profile__picker__handler.cc
chromium-next/patches/patch-chrome_browser_ui_window__sizer_window__sizer.cc
chromium-next/patches/patch-chrome_browser_visited__url__ranking_visited__url__ranking__service__factory.cc
chromium-next/patches/patch-chrome_browser_web__applications_commands_launch__web__app__command.cc
chromium-next/patches/patch-chrome_browser_web__applications_commands_set__user__display__mode__command.cc
chromium-next/patches/patch-chrome_browser_web__applications_extension__status__utils.h
chromium-next/patches/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__manager.cc
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_shortcut__sub__manager.cc
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc
chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h
chromium-next/patches/patch-chrome_browser_web__applications_policy_web__app__policy__manager.cc
chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.cc
chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.h
chromium-next/patches/patch-chrome_browser_web__applications_web__app__helpers.cc
chromium-next/patches/patch-chrome_browser_web__applications_web__app__install__info.h
chromium-next/patches/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc
chromium-next/patches/patch-chrome_browser_webauthn_enclave__manager.cc
chromium-next/patches/patch-chrome_browser_webauthn_gpm__user__verification__policy.cc
chromium-next/patches/patch-chrome_browser_webauthn_unexportable__key__utils.cc
chromium-next/patches/patch-chrome_common_channel__info.h
chromium-next/patches/patch-chrome_common_channel__info__posix.cc
chromium-next/patches/patch-chrome_common_chrome__features.cc
chromium-next/patches/patch-chrome_common_chrome__features.h
chromium-next/patches/patch-chrome_common_chrome__paths.cc
chromium-next/patches/patch-chrome_common_chrome__paths.h
chromium-next/patches/patch-chrome_common_chrome__paths__internal.h
chromium-next/patches/patch-chrome_common_chrome__switches.cc
chromium-next/patches/patch-chrome_common_chrome__switches.h
chromium-next/patches/patch-chrome_common_crash__keys.cc
chromium-next/patches/patch-chrome_common_extensions_permissions_chrome__permission__message__rules.cc
chromium-next/patches/patch-chrome_common_media_cdm__host__file__path.cc
chromium-next/patches/patch-chrome_common_media_cdm__registration.cc
chromium-next/patches/patch-chrome_common_media_cdm__registration.h
chromium-next/patches/patch-chrome_common_media_component__widevine__cdm__hint__file__linux.h
chromium-next/patches/patch-chrome_common_pref__names.h
chromium-next/patches/patch-chrome_common_url__constants.h
chromium-next/patches/patch-chrome_common_webui__url__constants.cc
chromium-next/patches/patch-chrome_common_webui__url__constants.h
chromium-next/patches/patch-chrome_enterprise__companion_enterprise__companion__client.cc
chromium-next/patches/patch-chrome_enterprise__companion_lock.cc
chromium-next/patches/patch-chrome_services_printing_print__backend__service__impl.cc
chromium-next/patches/patch-chrome_services_speech_audio__source__fetcher__impl.cc
chromium-next/patches/patch-chrome_test_base_scoped__channel__override__posix.cc
chromium-next/patches/patch-chrome_test_chromedriver_chrome__launcher.cc
chromium-next/patches/patch-chrome_test_chromedriver_chrome_chrome__finder.cc
chromium-next/patches/patch-chrome_test_chromedriver_key__converter__unittest.cc
chromium-next/patches/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc
chromium-next/patches/patch-chrome_test_supervised__user_google__auth__state__waiter__mixin.cc
chromium-next/patches/patch-chrome_updater_app_app__uninstall.cc
chromium-next/patches/patch-chrome_updater_configurator.cc
chromium-next/patches/patch-chrome_updater_lock.cc
chromium-next/patches/patch-chrome_updater_util_posix__util.cc
chromium-next/patches/patch-chrome_utility_services.cc
chromium-next/patches/patch-chromecast_browser_cast__browser__main__parts.cc
chromium-next/patches/patch-chromecast_browser_cast__content__browser__client.cc
chromium-next/patches/patch-chromecast_cast__core_runtime_browser_runtime__application__service__impl.cc
chromium-next/patches/patch-chromecast_media_base_default__monotonic__clock.cc
chromium-next/patches/patch-components_autofill_core_browser_autofill__optimization__guide.cc
chromium-next/patches/patch-components_autofill_core_browser_payments__data__manager.cc
chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.cc
chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.h
chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.cc
chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.h
chromium-next/patches/patch-components_commerce_core_commerce__feature__list.cc
chromium-next/patches/patch-components_constrained__window_constrained__window__views.cc
chromium-next/patches/patch-components_content__settings_core_browser_website__settings__registry.cc
chromium-next/patches/patch-components_cookie__config_cookie__store__util.cc
chromium-next/patches/patch-components_crash_core_app_BUILD.gn
chromium-next/patches/patch-components_crash_core_app_chrome__crashpad__handler.cc
chromium-next/patches/patch-components_crash_core_app_crashpad__handler__main.cc
chromium-next/patches/patch-components_crash_core_browser_crash__upload__list__crashpad.cc
chromium-next/patches/patch-components_crash_core_common_BUILD.gn
chromium-next/patches/patch-components_device__signals_core_browser_mock__signals__aggregator.h
chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator.h
chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.cc
chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.h
chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service.h
chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.cc
chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.h
chromium-next/patches/patch-components_device__signals_core_common_signals__features.cc
chromium-next/patches/patch-components_device__signals_core_common_signals__features.h
chromium-next/patches/patch-components_device__signals_core_system__signals_platform__delegate.cc
chromium-next/patches/patch-components_device__signals_test_signals__contract.cc
chromium-next/patches/patch-components_discardable__memory_service_discardable__shared__memory__manager.cc
chromium-next/patches/patch-components_embedder__support_user__agent__utils.cc
chromium-next/patches/patch-components_embedder__support_user__agent__utils__unittest.cc
chromium-next/patches/patch-components_enterprise_watermarking_watermark.cc
chromium-next/patches/patch-components_eye__dropper_eye__dropper__view.cc
chromium-next/patches/patch-components_feature__engagement_public_event__constants.cc
chromium-next/patches/patch-components_feature__engagement_public_event__constants.h
chromium-next/patches/patch-components_feature__engagement_public_feature__configurations.cc
chromium-next/patches/patch-components_feature__engagement_public_feature__constants.cc
chromium-next/patches/patch-components_feature__engagement_public_feature__constants.h
chromium-next/patches/patch-components_feature__engagement_public_feature__list.cc
chromium-next/patches/patch-components_feature__engagement_public_feature__list.h
chromium-next/patches/patch-components_feed_core_proto_v2_wire_version.proto
chromium-next/patches/patch-components_feed_core_v2_feed__network__impl__unittest.cc
chromium-next/patches/patch-components_feed_core_v2_proto__util.cc
chromium-next/patches/patch-components_feed_core_v2_proto__util__unittest.cc
chromium-next/patches/patch-components_feed_core_v2_test_proto__printer.cc
chromium-next/patches/patch-components_flags__ui_flags__state.cc
chromium-next/patches/patch-components_gwp__asan_BUILD.gn
chromium-next/patches/patch-components_gwp__asan_client_guarded__page__allocator__posix.cc
chromium-next/patches/patch-components_gwp__asan_client_gwp__asan.cc
chromium-next/patches/patch-components_gwp__asan_client_gwp__asan__features.cc
chromium-next/patches/patch-components_gwp__asan_crash__handler_crash__analyzer.cc
chromium-next/patches/patch-components_live__caption_caption__util.cc
chromium-next/patches/patch-components_live__caption_caption__util.h
chromium-next/patches/patch-components_media__router_common_media__source.cc
chromium-next/patches/patch-components_media__router_common_providers_cast_channel_cast__message__util.cc
chromium-next/patches/patch-components_media__router_common_providers_cast_channel_enum__table.h
chromium-next/patches/patch-components_metrics_drive__metrics__provider__linux.cc
chromium-next/patches/patch-components_metrics_dwa_dwa__service.cc
chromium-next/patches/patch-components_metrics_metrics__log.cc
chromium-next/patches/patch-components_metrics_motherboard.cc
chromium-next/patches/patch-components_named__mojo__ipc__server_connection__info.h
chromium-next/patches/patch-components_named__mojo__ipc__server_named__mojo__ipc__server__client__util.cc
chromium-next/patches/patch-components_named__system__lock_lock.h
chromium-next/patches/patch-components_neterror_resources_neterror.js
chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__features.cc
chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__util.cc
chromium-next/patches/patch-components_os__crypt_async_browser_secret__portal__key__provider.cc
chromium-next/patches/patch-components_os__crypt_async_common_encryptor.cc
chromium-next/patches/patch-components_os__crypt_sync_libsecret__util__linux.cc
chromium-next/patches/patch-components_os__crypt_sync_os__crypt.h
chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client.cc
chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client__unittest.cc
chromium-next/patches/patch-components_paint__preview_common_proto_paint__preview.proto
chromium-next/patches/patch-components_paint__preview_player_player__compositor__delegate.cc
chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.cc
chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.h
chromium-next/patches/patch-components_password__manager_core_browser_password__form__manager.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__manager.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__manager__client.h
chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.h
chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.h
chromium-next/patches/patch-components_password__manager_core_browser_password__store__factory__util.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__async__helper.cc
chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__unittest.cc
chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.cc
chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.h
chromium-next/patches/patch-components_password__manager_core_common_password__manager__pref__names.h
chromium-next/patches/patch-components_performance__manager_decorators_process__metrics__decorator.cc
chromium-next/patches/patch-components_performance__manager_public_features.h
chromium-next/patches/patch-components_permissions_prediction__service_prediction__common.cc
chromium-next/patches/patch-components_policy_core_browser_policy__pref__mapping__test.cc
chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__client.cc
chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__refresh__scheduler.cc
chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__util.cc
chromium-next/patches/patch-components_policy_core_common_policy__loader__common.cc
chromium-next/patches/patch-components_policy_core_common_policy__paths.cc
chromium-next/patches/patch-components_policy_core_common_policy__utils.cc
chromium-next/patches/patch-components_policy_tools_generate__policy__source.py
chromium-next/patches/patch-components_power__metrics_BUILD.gn
chromium-next/patches/patch-components_power__metrics_energy__metrics__provider.cc
chromium-next/patches/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc
chromium-next/patches/patch-components_safe__browsing_content_resources_gen__file__type__proto.py
chromium-next/patches/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc
chromium-next/patches/patch-components_safe__browsing_core_browser_realtime_url__lookup__service__base.cc
chromium-next/patches/patch-components_safe__browsing_core_common_features.cc
chromium-next/patches/patch-components_search__engines_search__engine__choice_search__engine__choice__service.cc
chromium-next/patches/patch-components_search__engines_template__url__service.cc
chromium-next/patches/patch-components_security__interstitials_content_utils.cc
chromium-next/patches/patch-components_segmentation__platform_embedder_default__model_cross__device__user__segment.cc
chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.cc
chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.h
chromium-next/patches/patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.cc
chromium-next/patches/patch-components_soda_soda__util.cc
chromium-next/patches/patch-components_startup__metric__utils_common_startup__metric__utils.cc
chromium-next/patches/patch-components_storage__monitor_BUILD.gn
chromium-next/patches/patch-components_storage__monitor_removable__device__constants.cc
chromium-next/patches/patch-components_storage__monitor_removable__device__constants.h
chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__metrics__service.cc
chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__preferences.cc
chromium-next/patches/patch-components_supervised__user_core_common_features.cc
chromium-next/patches/patch-components_supervised__user_core_common_features.h
chromium-next/patches/patch-components_supervised__user_core_common_pref__names.h
chromium-next/patches/patch-components_sync__device__info_local__device__info__util.cc
chromium-next/patches/patch-components_sync__device__info_local__device__info__util__linux.cc
chromium-next/patches/patch-components_sync_base_sync__util.cc
chromium-next/patches/patch-components_system__cpu_cpu__probe.cc
chromium-next/patches/patch-components_translate_core_common_translate__util.cc
chromium-next/patches/patch-components_trusted__vault_trusted__vault__connection__impl.cc
chromium-next/patches/patch-components_update__client_update__query__params.cc
chromium-next/patches/patch-components_url__formatter_spoof__checks_idn__spoof__checker.cc
chromium-next/patches/patch-components_user__education_views_help__bubble__view.cc
chromium-next/patches/patch-components_variations_service_variations__service.cc
chromium-next/patches/patch-components_visited__url__ranking_public_url__visit__util.cc
chromium-next/patches/patch-components_viz_host_gpu__host__impl.cc
chromium-next/patches/patch-components_viz_host_host__display__client.cc
chromium-next/patches/patch-components_viz_host_host__display__client.h
chromium-next/patches/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc
chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.cc
chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.h
chromium-next/patches/patch-components_viz_service_display_skia__renderer.cc
chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc
chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h
chromium-next/patches/patch-components_viz_test_fake__display__client.cc
chromium-next/patches/patch-components_viz_test_fake__display__client.h
chromium-next/patches/patch-components_viz_test_mock__display__client.h
chromium-next/patches/patch-content_app_BUILD.gn
chromium-next/patches/patch-content_app_content__main.cc
chromium-next/patches/patch-content_app_content__main__runner__impl.cc
chromium-next/patches/patch-content_browser_BUILD.gn
chromium-next/patches/patch-content_browser_audio_audio__service.cc
chromium-next/patches/patch-content_browser_browser__child__process__host__impl.cc
chromium-next/patches/patch-content_browser_browser__child__process__host__impl.h
chromium-next/patches/patch-content_browser_browser__child__process__host__impl__receiver__bindings.cc
chromium-next/patches/patch-content_browser_browser__main__loop.cc
chromium-next/patches/patch-content_browser_child__process__launcher__helper.h
chromium-next/patches/patch-content_browser_child__process__launcher__helper__linux.cc
chromium-next/patches/patch-content_browser_child__thread__type__switcher__linux.cc
chromium-next/patches/patch-content_browser_compositor_viz__process__transport__factory.cc
chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.cc
chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.h
chromium-next/patches/patch-content_browser_devtools_protocol_system__info__handler.cc
chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher.h
chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__bsd.cc
chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__kqueue.h
chromium-next/patches/patch-content_browser_file__system__access_file__system__access__local__path__watcher.cc
chromium-next/patches/patch-content_browser_font__access_font__enumeration__data__source.cc
chromium-next/patches/patch-content_browser_gpu_compositor__util.cc
chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.cc
chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.h
chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.cc
chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.h
chromium-next/patches/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc
chromium-next/patches/patch-content_browser_gpu_gpu__process__host.cc
chromium-next/patches/patch-content_browser_media_frameless__media__interface__proxy.h
chromium-next/patches/patch-content_browser_media_media__keys__listener__manager__impl.cc
chromium-next/patches/patch-content_browser_network__service__instance__impl.cc
chromium-next/patches/patch-content_browser_ppapi__plugin__process__host__receiver__bindings.cc
chromium-next/patches/patch-content_browser_renderer__host_delegated__frame__host.cc
chromium-next/patches/patch-content_browser_renderer__host_media_service__video__capture__device__launcher.cc
chromium-next/patches/patch-content_browser_renderer__host_pepper_pepper__file__io__host.cc
chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl.h
chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl__receiver__bindings.cc
chromium-next/patches/patch-content_browser_renderer__host_render__view__host__impl.cc
chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.cc
chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.h
chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__event__handler.cc
chromium-next/patches/patch-content_browser_sandbox__host__linux.cc
chromium-next/patches/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc
chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.cc
chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.h
chromium-next/patches/patch-content_browser_utility__process__host.cc
chromium-next/patches/patch-content_browser_utility__process__host__receiver__bindings.cc
chromium-next/patches/patch-content_browser_utility__sandbox__delegate.cc
chromium-next/patches/patch-content_browser_v8__snapshot__files.cc
chromium-next/patches/patch-content_browser_web__contents_slow__web__preference__cache.cc
chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura.cc
chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura__unittest.cc
chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.cc
chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.h
chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.cc
chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.h
chromium-next/patches/patch-content_child_BUILD.gn
chromium-next/patches/patch-content_child_child__process.cc
chromium-next/patches/patch-content_child_child__process.h
chromium-next/patches/patch-content_common_BUILD.gn
chromium-next/patches/patch-content_common_features.cc
chromium-next/patches/patch-content_common_features.h
chromium-next/patches/patch-content_common_font__list__unittest.cc
chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.cc
chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.h
chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__linux.h
chromium-next/patches/patch-content_common_user__agent.cc
chromium-next/patches/patch-content_gpu_gpu__child__thread.cc
chromium-next/patches/patch-content_gpu_gpu__main.cc
chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.cc
chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.h
chromium-next/patches/patch-content_ppapi__plugin_ppapi__plugin__main.cc
chromium-next/patches/patch-content_public_browser_content__browser__client.cc
chromium-next/patches/patch-content_public_browser_zygote__host_zygote__host__linux.h
chromium-next/patches/patch-content_public_common_content__features.cc
chromium-next/patches/patch-content_public_common_content__switches.cc
chromium-next/patches/patch-content_public_common_content__switches.h
chromium-next/patches/patch-content_public_common_zygote_features.gni
chromium-next/patches/patch-content_renderer_render__thread__impl.cc
chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.cc
chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.h
chromium-next/patches/patch-content_renderer_renderer__main__platform__delegate__linux.cc
chromium-next/patches/patch-content_shell_BUILD.gn
chromium-next/patches/patch-content_shell_app_shell__main__delegate.cc
chromium-next/patches/patch-content_shell_browser_shell__browser__main__parts.cc
chromium-next/patches/patch-content_shell_browser_shell__paths.cc
chromium-next/patches/patch-content_shell_renderer_shell__content__renderer__client.cc
chromium-next/patches/patch-content_shell_utility_shell__content__utility__client.cc
chromium-next/patches/patch-content_test_BUILD.gn
chromium-next/patches/patch-content_utility_services.cc
chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.cc
chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h
chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.cc
chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.h
chromium-next/patches/patch-content_utility_utility__main.cc
chromium-next/patches/patch-content_utility_utility__thread__impl.cc
chromium-next/patches/patch-content_zygote_BUILD.gn
chromium-next/patches/patch-content_zygote_zygote__linux.cc
chromium-next/patches/patch-content_zygote_zygote__main__linux.cc
chromium-next/patches/patch-device_bluetooth_bluetooth__adapter.cc
chromium-next/patches/patch-device_bluetooth_cast__bluetooth.gni
chromium-next/patches/patch-device_gamepad_BUILD.gn
chromium-next/patches/patch-device_gamepad_gamepad__provider.cc
chromium-next/patches/patch-device_gamepad_hid__writer__linux.cc
chromium-next/patches/patch-extensions_browser_api_api__browser__context__keyed__service__factories.cc
chromium-next/patches/patch-extensions_browser_api_management_management__api.cc
chromium-next/patches/patch-extensions_browser_api_messaging_message__service.cc
chromium-next/patches/patch-extensions_browser_api_networking__private_networking__private__delegate__factory.cc
chromium-next/patches/patch-extensions_common_api___permission__features.json
chromium-next/patches/patch-extensions_common_api_runtime.json
chromium-next/patches/patch-extensions_common_command.cc
chromium-next/patches/patch-extensions_common_features_feature.cc
chromium-next/patches/patch-extensions_renderer_bindings_api__binding__util.cc
chromium-next/patches/patch-extensions_renderer_bindings_argument__spec.cc
chromium-next/patches/patch-extensions_shell_app_shell__main__delegate.cc
chromium-next/patches/patch-extensions_shell_browser_api_runtime_shell__runtime__api__delegate.cc
chromium-next/patches/patch-extensions_shell_browser_shell__browser__main__parts.cc
chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.cc
chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.h
chromium-next/patches/patch-google__apis_gcm_engine_heartbeat__manager.cc
chromium-next/patches/patch-gpu_command__buffer_service_dawn__context__provider.cc
chromium-next/patches/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.h
chromium-next/patches/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__factory.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc
chromium-next/patches/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc
chromium-next/patches/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc
chromium-next/patches/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc
chromium-next/patches/patch-gpu_config_gpu__control__list.cc
chromium-next/patches/patch-gpu_config_gpu__finch__features.cc
chromium-next/patches/patch-gpu_config_gpu__info__collector.cc
chromium-next/patches/patch-gpu_config_gpu__test__config.cc
chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.cc
chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.h
chromium-next/patches/patch-gpu_ipc_service_gpu__init.cc
chromium-next/patches/patch-gpu_ipc_service_gpu__memory__buffer__factory.cc
chromium-next/patches/patch-gpu_ipc_service_x__util.h
chromium-next/patches/patch-gpu_vulkan_generate__bindings.py
chromium-next/patches/patch-gpu_vulkan_semaphore__handle.cc
chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.cc
chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.h
chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.cc
chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.h
chromium-next/patches/patch-gpu_vulkan_vulkan__image.h
chromium-next/patches/patch-gpu_vulkan_vulkan__util.cc
chromium-next/patches/patch-headless_lib_browser_headless__browser__main__parts__posix.cc
chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.cc
chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.h
chromium-next/patches/patch-headless_lib_browser_headless__web__contents__impl.cc
chromium-next/patches/patch-headless_lib_headless__content__main__delegate.cc
chromium-next/patches/patch-ipc_ipc__channel.h
chromium-next/patches/patch-ipc_ipc__channel__common.cc
chromium-next/patches/patch-ipc_ipc__channel__mojo.cc
chromium-next/patches/patch-ipc_ipc__message__utils.cc
chromium-next/patches/patch-ipc_ipc__message__utils.h
chromium-next/patches/patch-media_BUILD.gn
chromium-next/patches/patch-media_audio_BUILD.gn
chromium-next/patches/patch-media_audio_alsa_audio__manager__alsa.cc
chromium-next/patches/patch-media_audio_audio__input__device.cc
chromium-next/patches/patch-media_audio_audio__output__proxy__unittest.cc
chromium-next/patches/patch-media_audio_pulse_pulse__util.cc
chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.cc
chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.h
chromium-next/patches/patch-media_audio_sndio_sndio__input.cc
chromium-next/patches/patch-media_audio_sndio_sndio__input.h
chromium-next/patches/patch-media_audio_sndio_sndio__output.cc
chromium-next/patches/patch-media_audio_sndio_sndio__output.h
chromium-next/patches/patch-media_base_audio__latency.cc
chromium-next/patches/patch-media_base_libaom__thread__wrapper.cc
chromium-next/patches/patch-media_base_libvpx__thread__wrapper.cc
chromium-next/patches/patch-media_base_media__switches.cc
chromium-next/patches/patch-media_base_media__switches.h
chromium-next/patches/patch-media_base_user__input__monitor__unittest.cc
chromium-next/patches/patch-media_base_video__frame.cc
chromium-next/patches/patch-media_base_video__frame.h
chromium-next/patches/patch-media_capture_video_create__video__capture__device__factory.cc
chromium-next/patches/patch-media_capture_video_fake__video__capture__device__factory.cc
chromium-next/patches/patch-media_capture_video_file__video__capture__device__factory.cc
chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.cc
chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.h
chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.cc
chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.h
chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device.h
chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.cc
chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.h
chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc
chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.h
chromium-next/patches/patch-media_capture_video_linux_video__capture__device__linux.cc
chromium-next/patches/patch-media_capture_video_video__capture__buffer__tracker__factory__impl.cc
chromium-next/patches/patch-media_capture_video_video__capture__device__client.cc
chromium-next/patches/patch-media_cdm_cdm__paths__unittest.cc
chromium-next/patches/patch-media_cdm_library__cdm_cdm__paths.gni
chromium-next/patches/patch-media_ffmpeg_scripts_build__ffmpeg.py
chromium-next/patches/patch-media_ffmpeg_scripts_robo__lib_config.py
chromium-next/patches/patch-media_gpu_buffer__validation.cc
chromium-next/patches/patch-media_gpu_chromeos_gl__image__processor__backend.cc
chromium-next/patches/patch-media_gpu_chromeos_libyuv__image__processor__backend.cc
chromium-next/patches/patch-media_gpu_chromeos_mailbox__video__frame__converter.cc
chromium-next/patches/patch-media_gpu_chromeos_platform__video__frame__utils.cc
chromium-next/patches/patch-media_gpu_chromeos_video__decoder__pipeline.cc
chromium-next/patches/patch-media_gpu_gpu__video__encode__accelerator__factory.cc
chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc
chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h
chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc
chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h
chromium-next/patches/patch-media_gpu_test_raw__video.cc
chromium-next/patches/patch-media_gpu_test_video__frame__file__writer.cc
chromium-next/patches/patch-media_gpu_test_video__frame__helpers.cc
chromium-next/patches/patch-media_gpu_test_video__frame__validator.cc
chromium-next/patches/patch-media_gpu_vaapi_vaapi__video__decoder.cc
chromium-next/patches/patch-media_gpu_vaapi_vaapi__wrapper.cc
chromium-next/patches/patch-media_media__options.gni
chromium-next/patches/patch-media_mojo_mojom_stable_BUILD.gn
chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc
chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h
chromium-next/patches/patch-media_mojo_mojom_video__frame__mojom__traits.cc
chromium-next/patches/patch-media_video_fake__gpu__memory__buffer.cc
chromium-next/patches/patch-media_video_gpu__memory__buffer__video__frame__pool.cc
chromium-next/patches/patch-media_video_video__encode__accelerator__adapter.cc
chromium-next/patches/patch-media_video_video__encode__accelerator__adapter__test.cc
chromium-next/patches/patch-media_webrtc_audio__processor.cc
chromium-next/patches/patch-media_webrtc_helpers.cc
chromium-next/patches/patch-media_webrtc_helpers__unittests.cc
chromium-next/patches/patch-mojo_core_BUILD.gn
chromium-next/patches/patch-mojo_core_channel.cc
chromium-next/patches/patch-mojo_core_embedder_features.h
chromium-next/patches/patch-mojo_public_cpp_platform_socket__utils__posix.cc
chromium-next/patches/patch-mojo_public_tools_bindings_mojom.gni
chromium-next/patches/patch-net_BUILD.gn
chromium-next/patches/patch-net_base_features.cc
chromium-next/patches/patch-net_base_mock__network__change__notifier.cc
chromium-next/patches/patch-net_base_mock__network__change__notifier.h
chromium-next/patches/patch-net_base_network__change__notifier.cc
chromium-next/patches/patch-net_base_network__change__notifier.h
chromium-next/patches/patch-net_base_network__change__notifier__passive.cc
chromium-next/patches/patch-net_base_network__interfaces__posix.h
chromium-next/patches/patch-net_base_sockaddr__util__posix.cc
chromium-next/patches/patch-net_base_sockaddr__util__posix__unittest.cc
chromium-next/patches/patch-net_cert_cert__verify__proc.h
chromium-next/patches/patch-net_disk__cache_backend__experiment.h
chromium-next/patches/patch-net_disk__cache_simple_simple__file__tracker.cc
chromium-next/patches/patch-net_dns_BUILD.gn
chromium-next/patches/patch-net_dns_address__info.cc
chromium-next/patches/patch-net_dns_address__sorter__posix.cc
chromium-next/patches/patch-net_dns_dns__config__service__posix.cc
chromium-next/patches/patch-net_dns_dns__reloader.cc
chromium-next/patches/patch-net_dns_dns__util.cc
chromium-next/patches/patch-net_dns_host__resolver__proc.cc
chromium-next/patches/patch-net_dns_public_BUILD.gn
chromium-next/patches/patch-net_dns_public_resolv__reader.cc
chromium-next/patches/patch-net_dns_public_resolv__reader.h
chromium-next/patches/patch-net_dns_public_scoped__res__state.cc
chromium-next/patches/patch-net_dns_public_scoped__res__state.h
chromium-next/patches/patch-net_filter_zstd__source__stream.cc
chromium-next/patches/patch-net_http_http__auth__gssapi__posix.cc
chromium-next/patches/patch-net_http_http__auth__gssapi__posix.h
chromium-next/patches/patch-net_http_http__auth__handler__negotiate.cc
chromium-next/patches/patch-net_http_http__auth__preferences.cc
chromium-next/patches/patch-net_http_http__auth__preferences.h
chromium-next/patches/patch-net_http_http__network__session.cc
chromium-next/patches/patch-net_proxy__resolution_proxy__config__service.cc
chromium-next/patches/patch-net_proxy__resolution_proxy__config__service__linux.cc
chromium-next/patches/patch-net_socket_socket__posix.cc
chromium-next/patches/patch-net_socket_socks5__client__socket.cc
chromium-next/patches/patch-net_socket_tcp__socket__posix.cc
chromium-next/patches/patch-net_socket_udp__socket__posix.cc
chromium-next/patches/patch-net_socket_udp__socket__unittest.cc
chromium-next/patches/patch-net_third__party_quiche_BUILD.gn
chromium-next/patches/patch-net_tools_cert__verify__tool_cert__verify__tool.cc
chromium-next/patches/patch-net_tools_net__watcher_net__watcher.cc
chromium-next/patches/patch-net_traffic__annotation_network__traffic__annotation.h
chromium-next/patches/patch-net_url__request_url__request__context.cc
chromium-next/patches/patch-net_url__request_url__request__context.h
chromium-next/patches/patch-net_url__request_url__request__context__builder.cc
chromium-next/patches/patch-pdf_pdfium_pdfium__engine.cc
chromium-next/patches/patch-ppapi_tests_test__utils.h
chromium-next/patches/patch-printing_backend_cups__ipp__helper.cc
chromium-next/patches/patch-printing_backend_print__backend__cups.cc
chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.cc
chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.h
chromium-next/patches/patch-printing_print__settings.cc
chromium-next/patches/patch-printing_print__settings.h
chromium-next/patches/patch-printing_print__settings__conversion.cc
chromium-next/patches/patch-printing_printing__context__linux.cc
chromium-next/patches/patch-printing_printing__features.cc
chromium-next/patches/patch-printing_printing__features.h
chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc
chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.h
chromium-next/patches/patch-remoting_base_chromoting__event.cc
chromium-next/patches/patch-remoting_base_host__settings.cc
chromium-next/patches/patch-remoting_codec_webrtc__video__encoder__vpx.cc
chromium-next/patches/patch-remoting_host_base_desktop__environment__options.cc
chromium-next/patches/patch-remoting_host_base_switches.cc
chromium-next/patches/patch-remoting_host_base_switches.h
chromium-next/patches/patch-remoting_host_basic__desktop__environment.cc
chromium-next/patches/patch-remoting_host_chromoting__host.cc
chromium-next/patches/patch-remoting_host_chromoting__host.h
chromium-next/patches/patch-remoting_host_chromoting__host__context.cc
chromium-next/patches/patch-remoting_host_chromoting__host__services__client.cc
chromium-next/patches/patch-remoting_host_client__session.cc
chromium-next/patches/patch-remoting_host_crash_crash__file__uploader.cc
chromium-next/patches/patch-remoting_host_desktop__and__cursor__conditional__composer.cc
chromium-next/patches/patch-remoting_host_desktop__capturer__proxy.cc
chromium-next/patches/patch-remoting_host_desktop__capturer__wrapper.cc
chromium-next/patches/patch-remoting_host_evaluate__capability.cc
chromium-next/patches/patch-remoting_host_host__attributes.cc
chromium-next/patches/patch-remoting_host_host__details.cc
chromium-next/patches/patch-remoting_host_host__main.cc
chromium-next/patches/patch-remoting_host_ipc__constants.cc
chromium-next/patches/patch-remoting_host_it2me_it2me__host.cc
chromium-next/patches/patch-remoting_host_it2me_it2me__native__messaging__host__main.cc
chromium-next/patches/patch-remoting_host_me2me__desktop__environment.cc
chromium-next/patches/patch-remoting_host_mojo__caller__security__checker.cc
chromium-next/patches/patch-remoting_host_mouse__cursor__monitor__proxy.cc
chromium-next/patches/patch-remoting_host_policy__watcher.cc
chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__client.cc
chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__util.cc
chromium-next/patches/patch-remoting_host_remote__open__url_url__forwarder__configurator.cc
chromium-next/patches/patch-remoting_host_remoting__me2me__host.cc
chromium-next/patches/patch-remoting_host_session__policies__from__dict.cc
chromium-next/patches/patch-remoting_host_setup_start__host__main.cc
chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__caller__security__utils.cc
chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__extension__notifier.cc
chromium-next/patches/patch-remoting_protocol_webrtc__video__stream.cc
chromium-next/patches/patch-sandbox_BUILD.gn
chromium-next/patches/patch-sandbox_features.gni
chromium-next/patches/patch-sandbox_linux_BUILD.gn
chromium-next/patches/patch-sandbox_linux_services_init__process__reaper.cc
chromium-next/patches/patch-sandbox_linux_services_libc__interceptor.cc
chromium-next/patches/patch-sandbox_policy_BUILD.gn
chromium-next/patches/patch-sandbox_policy_features.cc
chromium-next/patches/patch-sandbox_policy_features.h
chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.cc
chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.h
chromium-next/patches/patch-sandbox_policy_mojom_sandbox.mojom
chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.cc
chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.h
chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.cc
chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.h
chromium-next/patches/patch-sandbox_policy_sandbox.cc
chromium-next/patches/patch-sandbox_policy_sandbox.h
chromium-next/patches/patch-sandbox_policy_sandbox__type.cc
chromium-next/patches/patch-sandbox_policy_switches.cc
chromium-next/patches/patch-sandbox_policy_switches.h
chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.cc
chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.h
chromium-next/patches/patch-services_device_BUILD.gn
chromium-next/patches/patch-services_device_geolocation_location__provider__manager.cc
chromium-next/patches/patch-services_device_hid_BUILD.gn
chromium-next/patches/patch-services_device_hid_hid__connection__fido.cc
chromium-next/patches/patch-services_device_hid_hid__connection__fido.h
chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.cc
chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.h
chromium-next/patches/patch-services_device_hid_hid__service.cc
chromium-next/patches/patch-services_device_hid_hid__service__fido.cc
chromium-next/patches/patch-services_device_hid_hid__service__fido.h
chromium-next/patches/patch-services_device_hid_hid__service__freebsd.cc
chromium-next/patches/patch-services_device_hid_hid__service__freebsd.h
chromium-next/patches/patch-services_device_hid_hid__service__netbsd.cc
chromium-next/patches/patch-services_device_hid_hid__service__netbsd.h
chromium-next/patches/patch-services_device_public_cpp_generic__sensor_sensor__reading.h
chromium-next/patches/patch-services_device_public_mojom_BUILD.gn
chromium-next/patches/patch-services_device_serial_BUILD.gn
chromium-next/patches/patch-services_device_serial_serial__device__enumerator.cc
chromium-next/patches/patch-services_device_serial_serial__io__handler__posix.cc
chromium-next/patches/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc
chromium-next/patches/patch-services_device_usb_BUILD.gn
chromium-next/patches/patch-services_device_usb_usb__service.cc
chromium-next/patches/patch-services_device_usb_usb__service__fake.cc
chromium-next/patches/patch-services_device_usb_usb__service__fake.h
chromium-next/patches/patch-services_network_BUILD.gn
chromium-next/patches/patch-services_network_network__context.cc
chromium-next/patches/patch-services_network_network__context.h
chromium-next/patches/patch-services_network_network__sandbox__hook__linux.cc
chromium-next/patches/patch-services_network_network__sandbox__hook__linux.h
chromium-next/patches/patch-services_network_network__service.cc
chromium-next/patches/patch-services_network_network__service.h
chromium-next/patches/patch-services_network_public_cpp_BUILD.gn
chromium-next/patches/patch-services_network_public_cpp_features.cc
chromium-next/patches/patch-services_network_public_mojom_BUILD.gn
chromium-next/patches/patch-services_network_shared__dictionary_shared__dictionary__writer__in__memory.h
chromium-next/patches/patch-services_on__device__model_on__device__model__service.h
chromium-next/patches/patch-services_on__device__model_pre__sandbox__init.cc
chromium-next/patches/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc
chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn
chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h
chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc
chromium-next/patches/patch-services_screen__ai_public_cpp_utilities.cc
chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc
chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h
chromium-next/patches/patch-services_service__manager_BUILD.gn
chromium-next/patches/patch-services_service__manager_public_cpp_service__executable_BUILD.gn
chromium-next/patches/patch-services_tracing_public_cpp_stack__sampling_tracing__sampler__profiler.cc
chromium-next/patches/patch-services_video__capture_public_mojom_video__capture__service.mojom
chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.cc
chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.h
chromium-next/patches/patch-skia_ext_SkMemory__new__handler.cpp
chromium-next/patches/patch-skia_ext_font__utils.cc
chromium-next/patches/patch-skia_ext_platform__canvas.h
chromium-next/patches/patch-skia_ext_skcolorspace__trfn.cc
chromium-next/patches/patch-third__party_abseil-cpp_absl_base_config.h
chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc
chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_sysinfo.cc
chromium-next/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h
chromium-next/patches/patch-third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc
chromium-next/patches/patch-third__party_afl_src_afl-fuzz.c
chromium-next/patches/patch-third__party_angle_BUILD.gn
chromium-next/patches/patch-third__party_angle_src_common_platform.h
chromium-next/patches/patch-third__party_angle_src_common_platform__helpers.h
chromium-next/patches/patch-third__party_angle_src_common_system__utils.cpp
chromium-next/patches/patch-third__party_angle_src_common_system__utils__linux.cpp
chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__internal.h
chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp
chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp
chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp
chromium-next/patches/patch-third__party_angle_src_libANGLE_Display.cpp
chromium-next/patches/patch-third__party_angle_src_libANGLE_formatutils.cpp
chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp
chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h
chromium-next/patches/patch-third__party_angle_util_BUILD.gn
chromium-next/patches/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc
chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h
chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h
chromium-next/patches/patch-third__party_blink_public_platform_platform.h
chromium-next/patches/patch-third__party_blink_public_platform_web__vector.h
chromium-next/patches/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
chromium-next/patches/patch-third__party_blink_renderer_build_scripts_run__with__pythonpath.py
chromium-next/patches/patch-third__party_blink_renderer_controller_blink__initializer.cc
chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.cc
chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.h
chromium-next/patches/patch-third__party_blink_renderer_core_editing_editing__behavior.cc
chromium-next/patches/patch-third__party_blink_renderer_core_execution__context_navigator__base.cc
chromium-next/patches/patch-third__party_blink_renderer_core_exported_web__view__impl.cc
chromium-next/patches/patch-third__party_blink_renderer_core_frame_web__frame__test.cc
chromium-next/patches/patch-third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc
chromium-next/patches/patch-third__party_blink_renderer_core_inspector_inspector__memory__agent.cc
chromium-next/patches/patch-third__party_blink_renderer_core_layout_layout__view.cc
chromium-next/patches/patch-third__party_blink_renderer_core_origin__trials_origin__trial__context.cc
chromium-next/patches/patch-third__party_blink_renderer_core_paint_paint__layer.cc
chromium-next/patches/patch-third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc
chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor.h
chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor__libxslt.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__device__factory.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_rtc__data__channel.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc
chromium-next/patches/patch-third__party_blink_renderer_modules_webgpu_gpu__queue.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_BUILD.gn
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.h
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__description.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__metrics.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__platform__data.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_begin__frame__provider.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_gpu_image__layer__bridge.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_video__frame__submitter.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_instrumentation_partition__alloc__memory__dump__provider.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_peerconnection_rtc__video__encoder__factory.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_runtime__enabled__features.json5
chromium-next/patches/patch-third__party_blink_renderer_platform_scheduler_common_thread.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_widget_compositing_blink__categorized__worker__pool__delegate.cc
chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_container__annotations.h
chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_math__extras.h
chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_stack__util.cc
chromium-next/patches/patch-third__party_brotli_common_platform.h
chromium-next/patches/patch-third__party_cpuinfo_cpuinfo.gni
chromium-next/patches/patch-third__party_crashpad_crashpad_build_crashpad__buildconfig.gni
chromium-next/patches/patch-third__party_crashpad_crashpad_client_BUILD.gn
chromium-next/patches/patch-third__party_crashpad_crashpad_client_crashpad__client__posix.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_address__types.h
chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_capture__context.h
chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_metrics.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_uuid.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_close__multiple.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_drop__privileges.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_signals.cc
chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc
chromium-next/patches/patch-third__party_crc32c_BUILD.gn
chromium-next/patches/patch-third__party_dawn_include_dawn_native_VulkanBackend.h
chromium-next/patches/patch-third__party_dawn_src_dawn_common_Platform.h
chromium-next/patches/patch-third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp
chromium-next/patches/patch-third__party_ffmpeg_BUILD.gn
chromium-next/patches/patch-third__party_ffmpeg_libavcodec_x86_cabac.h
chromium-next/patches/patch-third__party_ffmpeg_libavutil_cpu.c
chromium-next/patches/patch-third__party_ffmpeg_libavutil_mem.c
chromium-next/patches/patch-third__party_ffmpeg_libavutil_random__seed.c
chromium-next/patches/patch-third__party_ffmpeg_libavutil_x86_x86inc.asm
chromium-next/patches/patch-third__party_fontconfig_include_config.h
chromium-next/patches/patch-third__party_fontconfig_src_src_fccompat.c
chromium-next/patches/patch-third__party_ipcz_src_reference__drivers_random.cc
chromium-next/patches/patch-third__party_ipcz_src_standalone_base_logging.cc
chromium-next/patches/patch-third__party_leveldatabase_env__chromium.cc
chromium-next/patches/patch-third__party_libaom_source_libaom_aom__ports_aarch64__cpudetect.c
chromium-next/patches/patch-third__party_libc++_src_src_chrono.cpp
chromium-next/patches/patch-third__party_libc++_src_src_filesystem_filesystem__clock.cpp
chromium-next/patches/patch-third__party_libc++abi_src_src_cxa__guard__impl.h
chromium-next/patches/patch-third__party_libdrm_src_xf86drmMode.c
chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_memory_singleton.h
chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_synchronization_lock.h
chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_thread__checker.h
chromium-next/patches/patch-third__party_libsync_src_include_sync_sync.h
chromium-next/patches/patch-third__party_libsync_src_sync.c
chromium-next/patches/patch-third__party_libusb_BUILD.gn
chromium-next/patches/patch-third__party_libusb_src_libusb_core.c
chromium-next/patches/patch-third__party_libusb_src_libusb_os_threads__posix.c
chromium-next/patches/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
chromium-next/patches/patch-third__party_lzma__sdk_C_CpuArch.c
chromium-next/patches/patch-third__party_material__color__utilities_src_cpp_palettes_tones.cc
chromium-next/patches/patch-third__party_nasm_BUILD.gn
chromium-next/patches/patch-third__party_nasm_config_config-linux.h
chromium-next/patches/patch-third__party_node_node.gni
chromium-next/patches/patch-third__party_node_node.py
chromium-next/patches/patch-third__party_pdfium_core_fxge_cfx__fontmapper.cpp
chromium-next/patches/patch-third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp
chromium-next/patches/patch-third__party_pdfium_fxjs_fx__date__helpers.cpp
chromium-next/patches/patch-third__party_pdfium_pdfium.gni
chromium-next/patches/patch-third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp
chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_build__config.h
chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_thread__utils.h
chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_time.h
chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_event__fd.h
chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_thread__utils.h
chromium-next/patches/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__legacy.h
chromium-next/patches/patch-third__party_perfetto_protos_perfetto_trace_ftrace_v4l2.proto
chromium-next/patches/patch-third__party_perfetto_src_base_clock__snapshots.cc
chromium-next/patches/patch-third__party_perfetto_src_base_event__fd.cc
chromium-next/patches/patch-third__party_perfetto_src_base_periodic__task.cc
chromium-next/patches/patch-third__party_perfetto_src_base_string__utils.cc
chromium-next/patches/patch-third__party_perfetto_src_base_subprocess__posix.cc
chromium-next/patches/patch-third__party_perfetto_src_base_test_vm__test__utils.cc
chromium-next/patches/patch-third__party_perfetto_src_base_thread__task__runner.cc
chromium-next/patches/patch-third__party_perfetto_src_base_unix__socket.cc
chromium-next/patches/patch-third__party_perfetto_src_base_utils.cc
chromium-next/patches/patch-third__party_perfetto_src_trace__processor_importers_ftrace_v4l2__tracker.cc
chromium-next/patches/patch-third__party_perfetto_src_tracing_ipc_memfd.cc
chromium-next/patches/patch-third__party_perfetto_src_tracing_platform__posix.cc
chromium-next/patches/patch-third__party_perfetto_src_tracing_track.cc
chromium-next/patches/patch-third__party_protobuf_src_google_protobuf_stubs_platform__macros.h
chromium-next/patches/patch-third__party_skia_src_gpu_ganesh_GrAutoLocaleSetter.h
chromium-next/patches/patch-third__party_skia_src_ports_SkMemory__malloc.cpp
chromium-next/patches/patch-third__party_skia_src_ports_SkOSFile__posix.cpp
chromium-next/patches/patch-third__party_speech-dispatcher_libspeechd__version.h
chromium-next/patches/patch-third__party_speech-dispatcher_speechd__types.h
chromium-next/patches/patch-third__party_sqlite_BUILD.gn
chromium-next/patches/patch-third__party_sqlite_src_amalgamation__dev_sqlite3.c
chromium-next/patches/patch-third__party_sqlite_src_amalgamation_sqlite3.c
chromium-next/patches/patch-third__party_swiftshader_src_Reactor_Debug.cpp
chromium-next/patches/patch-third__party_swiftshader_src_System_Configurator.cpp
chromium-next/patches/patch-third__party_swiftshader_src_System_Linux_MemFd.cpp
chromium-next/patches/patch-third__party_swiftshader_src_Vulkan_VkSemaphoreExternalLinux.hpp
chromium-next/patches/patch-third__party_swiftshader_src_WSI_libXCB.cpp
chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h
chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-subzero_build_Linux_include_llvm_Config_config.h
chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_memory.cpp
chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_thread.cpp
chromium-next/patches/patch-third__party_test__fonts_fontconfig_BUILD.gn
chromium-next/patches/patch-third__party_test__fonts_fontconfig_fontconfig__util__linux.cc
chromium-next/patches/patch-third__party_test__fonts_fontconfig_generate__fontconfig__caches.cc
chromium-next/patches/patch-third__party_tflite_features.gni
chromium-next/patches/patch-third__party_unrar_src_crypt.cpp
chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_external_vma_vk__mem__alloc.h
chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_vulkan_generated_vk__function__pointers.cpp
chromium-next/patches/patch-third__party_vulkan__memory__allocator_include_vk__mem__alloc.h
chromium-next/patches/patch-third__party_wayland_BUILD.gn
chromium-next/patches/patch-third__party_wayland_include_config.h
chromium-next/patches/patch-third__party_webrtc_BUILD.gn
chromium-next/patches/patch-third__party_webrtc_modules_audio__device_BUILD.gn
chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc
chromium-next/patches/patch-third__party_webrtc_modules_video__coding_codecs_av1_libaom__av1__encoder.cc
chromium-next/patches/patch-third__party_webrtc_rtc__base_byte__order.h
chromium-next/patches/patch-third__party_webrtc_rtc__base_ip__address.cc
chromium-next/patches/patch-third__party_webrtc_rtc__base_net__test__helpers.cc
chromium-next/patches/patch-third__party_webrtc_rtc__base_network.cc
chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.cc
chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.h
chromium-next/patches/patch-third__party_webrtc_rtc__base_platform__thread__types.cc
chromium-next/patches/patch-third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h
chromium-next/patches/patch-third__party_webrtc_system__wrappers_BUILD.gn
chromium-next/patches/patch-third__party_widevine_cdm_widevine.gni
chromium-next/patches/patch-third__party_zlib_BUILD.gn
chromium-next/patches/patch-third__party_zlib_cpu__features.c
chromium-next/patches/patch-tools_generate__shim__headers_generate__shim__headers.py
chromium-next/patches/patch-tools_generate__stubs_rules.gni
chromium-next/patches/patch-tools_gn_build_build__linux.ninja.template
chromium-next/patches/patch-tools_gn_build_gen.py
chromium-next/patches/patch-tools_gn_src_base_files_file__posix.cc
chromium-next/patches/patch-tools_gn_src_gn_version.h
chromium-next/patches/patch-tools_gn_src_util_exe__path.cc
chromium-next/patches/patch-tools_grit_grit_node_base.py
chromium-next/patches/patch-tools_json__schema__compiler_cpp__bundle__generator.py
chromium-next/patches/patch-tools_json__schema__compiler_feature__compiler.py
chromium-next/patches/patch-tools_memory_partition__allocator_inspect__utils.h
chromium-next/patches/patch-tools_perf_chrome__telemetry__build_BUILD.gn
chromium-next/patches/patch-tools_protoc__wrapper_protoc__wrapper.py
chromium-next/patches/patch-tools_v8__context__snapshot_BUILD.gn
chromium-next/patches/patch-tools_variations_fieldtrial__to__struct.py
chromium-next/patches/patch-ui_aura_client_drag__drop__client.h
chromium-next/patches/patch-ui_aura_screen__ozone.cc
chromium-next/patches/patch-ui_aura_screen__ozone.h
chromium-next/patches/patch-ui_base_accelerators_accelerator.cc
chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.cc
chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.h
chromium-next/patches/patch-ui_base_clipboard_clipboard__non__backed.cc
chromium-next/patches/patch-ui_base_cursor_cursor__factory.cc
chromium-next/patches/patch-ui_base_cursor_cursor__factory.h
chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__factory.cc
chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__non__backed.cc
chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.cc
chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.h
chromium-next/patches/patch-ui_base_ime_fake__text__input__client.cc
chromium-next/patches/patch-ui_base_ime_fake__text__input__client.h
chromium-next/patches/patch-ui_base_ime_init_input__method__initializer.cc
chromium-next/patches/patch-ui_base_ime_linux_linux__input__method__context__factory.cc
chromium-next/patches/patch-ui_base_ime_text__input__client.h
chromium-next/patches/patch-ui_base_resource_resource__bundle.cc
chromium-next/patches/patch-ui_base_test_skia__gold__pixel__diff.cc
chromium-next/patches/patch-ui_base_test_ui__controls.h
chromium-next/patches/patch-ui_base_ui__base__features.cc
chromium-next/patches/patch-ui_base_ui__base__features.h
chromium-next/patches/patch-ui_base_ui__base__switches.cc
chromium-next/patches/patch-ui_base_ui__base__switches.h
chromium-next/patches/patch-ui_base_webui_web__ui__util.cc
chromium-next/patches/patch-ui_base_x_x11__cursor__factory.cc
chromium-next/patches/patch-ui_base_x_x11__cursor__factory.h
chromium-next/patches/patch-ui_base_x_x11__cursor__loader.cc
chromium-next/patches/patch-ui_base_x_x11__display__manager.cc
chromium-next/patches/patch-ui_base_x_x11__shm__image__pool.cc
chromium-next/patches/patch-ui_color_color__id.h
chromium-next/patches/patch-ui_color_color__provider__utils.cc
chromium-next/patches/patch-ui_color_system__theme.h
chromium-next/patches/patch-ui_compositor_compositor.cc
chromium-next/patches/patch-ui_compositor_compositor.h
chromium-next/patches/patch-ui_compositor_compositor__observer.h
chromium-next/patches/patch-ui_display_screen.cc
chromium-next/patches/patch-ui_display_screen.h
chromium-next/patches/patch-ui_events_devices_x11_device__data__manager__x11.cc
chromium-next/patches/patch-ui_events_event.cc
chromium-next/patches/patch-ui_events_event__switches.cc
chromium-next/patches/patch-ui_events_event__switches.h
chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.cc
chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.h
chromium-next/patches/patch-ui_gfx_BUILD.gn
chromium-next/patches/patch-ui_gfx_canvas__skia.cc
chromium-next/patches/patch-ui_gfx_font__fallback__linux.cc
chromium-next/patches/patch-ui_gfx_font__render__params.h
chromium-next/patches/patch-ui_gfx_font__render__params__linux.cc
chromium-next/patches/patch-ui_gfx_font__util.cc
chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.cc
chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.h
chromium-next/patches/patch-ui_gfx_linux_dmabuf__uapi.h
chromium-next/patches/patch-ui_gfx_linux_gbm__wrapper.cc
chromium-next/patches/patch-ui_gfx_mojom_buffer__types__mojom__traits.cc
chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.cc
chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.h
chromium-next/patches/patch-ui_gfx_native__pixmap__handle.cc
chromium-next/patches/patch-ui_gfx_native__pixmap__handle.h
chromium-next/patches/patch-ui_gfx_native__widget__types.h
chromium-next/patches/patch-ui_gfx_platform__font__skia.cc
chromium-next/patches/patch-ui_gfx_render__text__api__fuzzer.cc
chromium-next/patches/patch-ui_gfx_render__text__fuzzer.cc
chromium-next/patches/patch-ui_gfx_switches.cc
chromium-next/patches/patch-ui_gfx_switches.h
chromium-next/patches/patch-ui_gfx_x_atom__cache.cc
chromium-next/patches/patch-ui_gfx_x_generated__protos_dri3.cc
chromium-next/patches/patch-ui_gfx_x_generated__protos_shm.cc
chromium-next/patches/patch-ui_gfx_x_xlib__support.cc
chromium-next/patches/patch-ui_gl_BUILD.gn
chromium-next/patches/patch-ui_gl_gl__context.cc
chromium-next/patches/patch-ui_gl_gl__fence.cc
chromium-next/patches/patch-ui_gl_gl__implementation.cc
chromium-next/patches/patch-ui_gl_gl__switches.cc
chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.cc
chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.h
chromium-next/patches/patch-ui_gtk_gtk__compat.cc
chromium-next/patches/patch-ui_gtk_printing_print__dialog__gtk.cc
chromium-next/patches/patch-ui_message__center_views_message__popup__view.cc
chromium-next/patches/patch-ui_native__theme_native__theme.h
chromium-next/patches/patch-ui_native__theme_native__theme__base.cc
chromium-next/patches/patch-ui_native__theme_native__theme__features.cc
chromium-next/patches/patch-ui_ozone_common_egl__util.cc
chromium-next/patches/patch-ui_ozone_platform_headless_headless__surface__factory.cc
chromium-next/patches/patch-ui_ozone_platform_headless_ozone__platform__headless.cc
chromium-next/patches/patch-ui_ozone_platform_headless_vulkan__implementation__headless.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_common_wayland__util.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.h
chromium-next/patches/patch-ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__connection.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__input__method__context.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__popup.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.h
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.h
chromium-next/patches/patch-ui_ozone_platform_wayland_host_zwp__text__input__wrapper__v1.cc
chromium-next/patches/patch-ui_ozone_platform_wayland_ozone__platform__wayland.cc
chromium-next/patches/patch-ui_ozone_platform_x11_vulkan__implementation__x11.cc
chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.cc
chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.h
chromium-next/patches/patch-ui_ozone_platform_x11_x11__window.cc
chromium-next/patches/patch-ui_ozone_test_mock__platform__window__delegate.h
chromium-next/patches/patch-ui_platform__window_platform__window__delegate.cc
chromium-next/patches/patch-ui_platform__window_platform__window__delegate.h
chromium-next/patches/patch-ui_platform__window_platform__window__init__properties.h
chromium-next/patches/patch-ui_qt_BUILD.gn
chromium-next/patches/patch-ui_qt_qt.gni
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__bn.xtb
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ja.xtb
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ko.xtb
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ml.xtb
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__th.xtb
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-CN.xtb
chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-TW.xtb
chromium-next/patches/patch-ui_views_controls_prefix__selector.cc
chromium-next/patches/patch-ui_views_controls_prefix__selector.h
chromium-next/patches/patch-ui_views_controls_textfield_textfield.cc
chromium-next/patches/patch-ui_views_controls_textfield_textfield.h
chromium-next/patches/patch-ui_views_corewm_tooltip__aura.cc
chromium-next/patches/patch-ui_views_examples_widget__example.cc
chromium-next/patches/patch-ui_views_focus_focus__manager.cc
chromium-next/patches/patch-ui_views_style_platform__style.cc
chromium-next/patches/patch-ui_views_test_ui__controls__factory__desktop__aura__ozone.cc
chromium-next/patches/patch-ui_views_views__delegate.cc
chromium-next/patches/patch-ui_views_views__delegate.h
chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.cc
chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.h
chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc
chromium-next/patches/patch-ui_views_widget_root__view.cc
chromium-next/patches/patch-ui_views_widget_widget.cc
chromium-next/patches/patch-ui_views_window_custom__frame__view.cc
chromium-next/patches/patch-ui_views_window_dialog__delegate.cc
chromium-next/patches/patch-ui_views_window_frame__background.cc
chromium-next/patches/patch-v8_BUILD.gn
chromium-next/patches/patch-v8_include_v8-internal.h
chromium-next/patches/patch-v8_include_v8config.h
chromium-next/patches/patch-v8_src_api_api.cc
chromium-next/patches/patch-v8_src_base_atomicops.h
chromium-next/patches/patch-v8_src_base_platform_memory.h
chromium-next/patches/patch-v8_src_base_platform_platform-freebsd.cc
chromium-next/patches/patch-v8_src_base_platform_platform-openbsd.cc
chromium-next/patches/patch-v8_src_base_platform_platform-posix.cc
chromium-next/patches/patch-v8_src_base_small-vector.h
chromium-next/patches/patch-v8_src_base_strings.h
chromium-next/patches/patch-v8_src_base_sys-info.cc
chromium-next/patches/patch-v8_src_base_utils_random-number-generator.cc
chromium-next/patches/patch-v8_src_diagnostics_perf-jit.cc
chromium-next/patches/patch-v8_src_diagnostics_perf-jit.h
chromium-next/patches/patch-v8_src_execution_isolate.cc
chromium-next/patches/patch-v8_src_flags_flags.cc
chromium-next/patches/patch-v8_src_libsampler_sampler.cc
chromium-next/patches/patch-v8_src_sandbox_sandbox.cc
chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.cc
chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.h
chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-generic.cc
chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.cc
chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.h
chromium-next/patches/patch-v8_src_trap-handler_trap-handler.h
chromium-next/patches/patch-v8_src_wasm_baseline_ia32_liftoff-assembler-ia32-inl.h
chromium-next/patches/patch-v8_tools_run-paxctl.py
chromium-next/patches/patch-v8_tools_run.py
chromium-next/tests.mk
Log Message:
chromium-next: working on the llvm-19 based chromium-132
will be merged to chromium, after pkgsrc/llvm-19 release
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=81f09aab8eda45c91d294e1baeda03ce07753e4d
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
chromium-next/DESCR | 3 +
chromium-next/Makefile | 377 ++++++
chromium-next/PLIST | 141 ++
chromium-next/TODO | 19 +
chromium-next/distinfo | 1407 ++++++++++++++++++++
chromium-next/files/chromium-browser.desktop | 220 +++
chromium-next/files/chromium.sh.in | 76 ++
chromium-next/options.mk | 61 +
chromium-next/patches/patch-BUILD.gn | 95 ++
...patch-apps_ui_views_app__window__frame__view.cc | 17 +
...patch-ash_display_mirror__window__controller.cc | 20 +
chromium-next/patches/patch-base_BUILD.gn | 172 +++
.../patches/patch-base_allocator_dispatcher_tls.h | 17 +
...cator_partition__allocator_partition__alloc.gni | 26 +
...tition__allocator_src_partition__alloc_BUILD.gn | 17 +
...artition__alloc_address__space__randomization.h | 26 +
...llocator_src_partition__alloc_page__allocator.h | 17 +
...c_partition__alloc_page__allocator__constants.h | 19 +
...ion__alloc_page__allocator__internals__posix.cc | 17 +
...tion__alloc_page__allocator__internals__posix.h | 22 +
...rtition__alloc__base_debug_proc__maps__linux.cc | 17 +
...ition__alloc__base_debug_stack__trace__posix.cc | 40 +
...loc_partition__alloc__base_rand__util__posix.cc | 19 +
...ition__alloc__base_threading_platform__thread.h | 17 +
...e_threading_platform__thread__internal__posix.h | 17 +
...lloc__base_threading_platform__thread__posix.cc | 17 +
...src_partition__alloc_partition__alloc__config.h | 26 +
..._partition__alloc_partition__alloc__constants.h | 26 +
...rc_partition__alloc_partition__alloc__forward.h | 22 +
...locator_src_partition__alloc_partition__root.cc | 35 +
...locator_src_partition__alloc_spinning__mutex.cc | 65 +
...__allocator_src_partition__alloc_stack_stack.cc | 56 +
..._src_partition__alloc_thread__isolation_pkey.cc | 17 +
chromium-next/patches/patch-base_atomicops.h | 20 +
.../patches/patch-base_base__paths__posix.cc | 128 ++
.../patches/patch-base_compiler__specific.h | 16 +
.../patches/patch-base_debug_debugger__posix.cc | 106 ++
.../patches/patch-base_debug_elf__reader.cc | 19 +
.../patches/patch-base_debug_proc__maps__linux.cc | 17 +
.../patches/patch-base_debug_stack__trace.cc | 35 +
.../patch-base_debug_stack__trace__posix.cc | 109 ++
.../patches/patch-base_files_dir__reader__linux.h | 45 +
.../patches/patch-base_files_dir__reader__posix.h | 26 +
.../patches/patch-base_files_drive__info.h | 17 +
.../patches/patch-base_files_drive__info__posix.cc | 17 +
.../patches/patch-base_files_file__path__watcher.h | 17 +
.../patch-base_files_file__path__watcher__bsd.cc | 63 +
...patch-base_files_file__path__watcher__kqueue.cc | 24 +
.../patch-base_files_file__path__watcher__kqueue.h | 16 +
...tch-base_files_file__path__watcher__unittest.cc | 35 +
.../patches/patch-base_files_file__util__posix.cc | 61 +
.../patch-base_files_file__util__unittest.cc | 26 +
...-base_files_important__file__writer__cleaner.cc | 18 +
.../patches/patch-base_files_scoped__file.cc | 17 +
.../patch-base_functional_unretained__traits.h | 17 +
chromium-next/patches/patch-base_i18n_icu__util.cc | 26 +
chromium-next/patches/patch-base_linux__util.cc | 23 +
.../patches/patch-base_logging__unittest.cc | 37 +
.../patch-base_memory_discardable__memory.cc | 44 +
...tch-base_memory_discardable__memory__internal.h | 17 +
...emory_madv__free__discardable__memory__posix.cc | 27 +
...-base_memory_platform__shared__memory__region.h | 35 +
...mory_platform__shared__memory__region__posix.cc | 35 +
.../patches/patch-base_memory_protected__memory.h | 50 +
.../patch-base_memory_protected__memory__posix.cc | 26 +
...atch-base_message__loop_message__pump__epoll.cc | 17 +
...patch-base_message__loop_message__pump__epoll.h | 20 +
...patch-base_message__loop_message__pump__glib.cc | 44 +
.../patches/patch-base_native__library__posix.cc | 17 +
.../patch-base_native__library__unittest.cc | 17 +
.../patch-base_posix_can__lower__nice__to.cc | 22 +
.../patch-base_posix_file__descriptor__shuffle.h | 17 +
chromium-next/patches/patch-base_posix_sysctl.cc | 38 +
.../patch-base_posix_unix__domain__socket.cc | 63 +
...ch-base_posix_unix__domain__socket__unittest.cc | 17 +
.../patches/patch-base_process_internal__linux.h | 26 +
chromium-next/patches/patch-base_process_kill.h | 17 +
.../patches/patch-base_process_kill__posix.cc | 17 +
chromium-next/patches/patch-base_process_launch.h | 31 +
.../patches/patch-base_process_launch__posix.cc | 27 +
.../patches/patch-base_process_memory__linux.cc | 50 +
.../patches/patch-base_process_process__handle.cc | 17 +
.../patches/patch-base_process_process__handle.h | 17 +
.../patch-base_process_process__handle__freebsd.cc | 33 +
.../patch-base_process_process__handle__netbsd.cc | 64 +
.../patch-base_process_process__handle__openbsd.cc | 140 ++
.../patches/patch-base_process_process__iterator.h | 29 +
...atch-base_process_process__iterator__freebsd.cc | 57 +
...patch-base_process_process__iterator__netbsd.cc | 141 ++
...atch-base_process_process__iterator__openbsd.cc | 51 +
.../patches/patch-base_process_process__metrics.cc | 55 +
.../patches/patch-base_process_process__metrics.h | 121 ++
...patch-base_process_process__metrics__freebsd.cc | 308 +++++
.../patch-base_process_process__metrics__netbsd.cc | 184 +++
...patch-base_process_process__metrics__openbsd.cc | 239 ++++
.../patch-base_process_process__metrics__posix.cc | 26 +
...atch-base_process_process__metrics__unittest.cc | 18 +
.../patches/patch-base_process_process__posix.cc | 100 ++
.../patch-base_process_process__unittest.cc | 17 +
.../patches/patch-base_profiler_module__cache.cc | 17 +
...e_profiler_sampling__profiler__thread__token.cc | 26 +
...se_profiler_sampling__profiler__thread__token.h | 26 +
...ch-base_profiler_stack__base__address__posix.cc | 69 +
...ofiler_stack__sampling__profiler__test__util.cc | 17 +
...profiler_stack__sampling__profiler__unittest.cc | 17 +
.../patch-base_profiler_thread__delegate__posix.cc | 26 +
chromium-next/patches/patch-base_rand__util.h | 17 +
.../patches/patch-base_rand__util__posix.cc | 68 +
.../patch-base_strings_safe__sprintf__unittest.cc | 24 +
.../patch-base_synchronization_lock__impl.h | 29 +
.../patches/patch-base_syslog__logging.cc | 26 +
.../patches/patch-base_system_sys__info.cc | 17 +
.../patches/patch-base_system_sys__info.h | 26 +
.../patch-base_system_sys__info__freebsd.cc | 118 ++
.../patches/patch-base_system_sys__info__netbsd.cc | 97 ++
.../patch-base_system_sys__info__openbsd.cc | 88 ++
.../patches/patch-base_system_sys__info__posix.cc | 35 +
.../patch-base_system_sys__info__unittest.cc | 26 +
...k_thread__pool_environment__config__unittest.cc | 26 +
.../patch-base_test_launcher_test__launcher.cc | 27 +
.../patch-base_test_test__file__util__linux.cc | 19 +
.../patch-base_test_test__file__util__posix.cc | 17 +
.../patch-base_threading_platform__thread.h | 17 +
.../patch-base_threading_platform__thread__bsd.cc | 40 +
..._threading_platform__thread__internal__posix.cc | 17 +
...patch-base_threading_platform__thread__posix.cc | 59 +
...ch-base_threading_platform__thread__unittest.cc | 44 +
.../patches/patch-base_time_time__now__posix.cc | 17 +
...tch-base_trace__event_malloc__dump__provider.cc | 36 +
...atch-base_trace__event_memory__dump__manager.cc | 17 +
...atch-base_trace__event_process__memory__dump.cc | 26 +
.../patches/patch-base_tracing_trace__time.cc | 36 +
.../patches/patch-base_tracing_trace__time.h | 17 +
.../patch-base_version__info_version__info.h | 17 +
chromium-next/patches/patch-build_config_BUILD.gn | 19 +
.../patches/patch-build_config_BUILDCONFIG.gn | 54 +
.../patches/patch-build_config_clang_BUILD.gn | 22 +
.../patches/patch-build_config_compiler_BUILD.gn | 128 ++
.../patches/patch-build_config_gcc_BUILD.gn | 19 +
.../patches/patch-build_config_linux_BUILD.gn | 17 +
.../patch-build_config_linux_libdrm_BUILD.gn | 17 +
.../patches/patch-build_config_linux_pkg-config.py | 17 +
chromium-next/patches/patch-build_config_ozone.gni | 29 +
chromium-next/patches/patch-build_config_rust.gni | 19 +
.../patches/patch-build_config_v8__target__cpu.gni | 19 +
.../patches/patch-build_detect__host__arch.py | 17 +
.../patches/patch-build_gn__run__binary.py | 17 +
chromium-next/patches/patch-build_linux_chrome.map | 19 +
.../patches/patch-build_linux_strip__binary.py | 16 +
.../patches/patch-build_linux_unbundle_icu.gn | 49 +
.../patches/patch-build_linux_unbundle_libevent.gn | 21 +
.../patches/patch-build_linux_unbundle_libusb.gn | 36 +
.../patches/patch-build_rust_rust__bindgen.gni | 25 +
.../patch-build_rust_rust__bindgen__generator.gni | 25 +
.../patches/patch-build_rust_std_BUILD.gn | 16 +
.../patches/patch-build_toolchain_freebsd_BUILD.gn | 75 ++
.../patch-build_toolchain_gcc__solink__wrapper.py | 17 +
.../patch-build_toolchain_gcc__toolchain.gni | 59 +
.../patches/patch-build_toolchain_netbsd_BUILD.gn | 75 ++
.../patches/patch-build_toolchain_openbsd_BUILD.gn | 75 ++
.../patches/patch-build_toolchain_toolchain.gni | 17 +
chromium-next/patches/patch-cc_base_features.cc | 17 +
.../patch-chrome_app_chrome__command__ids.h | 23 +
.../patches/patch-chrome_app_chrome__main.cc | 49 +
.../patch-chrome_app_chrome__main__delegate.cc | 153 +++
.../patches/patch-chrome_browser_BUILD.gn | 22 +
.../patches/patch-chrome_browser_about__flags.cc | 340 +++++
...ch-chrome_browser_accessibility_page__colors.cc | 26 +
...h-chrome_browser_after__startup__task__utils.cc | 17 +
...apps_app__service_publishers_extension__apps.cc | 17 +
...er_apps_platform__apps_platform__app__launch.cc | 71 +
...ser_apps_platform__apps_platform__app__launch.h | 17 +
...ete_chrome__autocomplete__scheme__classifier.cc | 17 +
...browser_background_background__mode__manager.cc | 17 +
...owser_background_background__mode__optimizer.cc | 17 +
.../patch-chrome_browser_browser__features.cc | 35 +
.../patch-chrome_browser_browser__features.h | 26 +
.../patch-chrome_browser_browser__process__impl.cc | 62 +
.../patch-chrome_browser_browser__process__impl.h | 17 +
...hrome_browser_chrome__browser__field__trials.cc | 26 +
...chrome_browser_chrome__browser__field__trials.h | 17 +
..._browser_chrome__browser__interface__binders.cc | 103 ++
.../patch-chrome_browser_chrome__browser__main.cc | 124 ++
...r_chrome__browser__main__extra__parts__linux.cc | 17 +
...r_chrome__browser__main__extra__parts__ozone.cc | 17 +
...-chrome_browser_chrome__browser__main__linux.cc | 45 +
...h-chrome_browser_chrome__browser__main__linux.h | 17 +
...-chrome_browser_chrome__browser__main__posix.cc | 17 +
...ome_browser_chrome__content__browser__client.cc | 177 +++
...rome_browser_chrome__content__browser__client.h | 17 +
..._updater_widevine__cdm__component__installer.cc | 44 +
...hrome__protocol__handler__registry__delegate.cc | 17 +
.../patches/patch-chrome_browser_defaults.cc | 17 +
...tity_device__oauth2__token__service__factory.cc | 17 +
...hrome_browser_diagnostics_diagnostics__writer.h | 17 +
...download_chrome__download__manager__delegate.cc | 35 +
...h-chrome_browser_download_download__commands.cc | 26 +
...ch-chrome_browser_download_download__commands.h | 17 +
...rome_browser_download_download__file__picker.cc | 26 +
...hrome_browser_download_download__item__model.cc | 35 +
...atch-chrome_browser_download_download__prefs.cc | 96 ++
...patch-chrome_browser_download_download__prefs.h | 26 +
...nectors_analysis_analysis__service__settings.cc | 17 +
...-chrome_browser_enterprise_connectors_common.cc | 26 +
...er_enterprise_connectors_connectors__service.cc | 17 +
...t_device__trust__connector__service__factory.cc | 35 +
...evice__trust_device__trust__service__factory.cc | 35 +
...ser_commands_key__rotation__command__factory.cc | 26 +
...sistence_key__persistence__delegate__factory.cc | 26 +
...ice__trust_signals_signals__service__factory.cc | 26 +
...tors_reporting_browser__crash__event__router.cc | 26 +
...nnectors_reporting_crash__reporting__context.cc | 17 +
...ectors_reporting_realtime__reporting__client.cc | 44 +
...nectors_reporting_realtime__reporting__client.h | 35 +
...rise_identifiers_profile__id__delegate__impl.cc | 26 +
...nt_profile__management__navigation__throttle.cc | 19 +
...te__commands_cbcm__remote__commands__factory.cc | 26 +
...ser_enterprise_signals_device__info__fetcher.cc | 26 +
...erprise_signals_device__info__fetcher__linux.cc | 83 ++
...enterprise_signin_enterprise__signin__service.h | 17 +
...terstitials_managed__profile__required__page.cc | 17 +
.../patch-chrome_browser_extensions_BUILD.gn | 19 +
..._browser__context__keyed__service__factories.cc | 26 +
...ate_chrome__desktop__report__request__helper.cc | 35 +
...rprise__reporting__private_conversion__utils.cc | 17 +
...erprise__reporting__private_conversion__utils.h | 17 +
..._private_enterprise__reporting__private__api.cc | 53 +
...__private_enterprise__reporting__private__api.h | 35 +
...writer__private_removable__storage__provider.cc | 26 +
...management_chrome__management__api__delegate.cc | 17 +
...ensions_api_messaging_launch__context__posix.cc | 17 +
...__private_passwords__private__delegate__impl.cc | 17 +
...s_api_runtime_chrome__runtime__api__delegate.cc | 21 +
...extensions_api_settings__private_prefs__util.cc | 35 +
...chrome_browser_extensions_api_tabs_tabs__api.cc | 17 +
...gging__private_webrtc__logging__private__api.cc | 35 +
...api_webstore__private_webstore__private__api.cc | 17 +
..._browser_extensions_external__provider__impl.cc | 26 +
...e__file__system__access__permission__context.cc | 17 +
...-chrome_browser_first__run_first__run__dialog.h | 17 +
...hrome_browser_first__run_first__run__internal.h | 17 +
.../patch-chrome_browser_flag__descriptions.cc | 164 +++
.../patch-chrome_browser_flag__descriptions.h | 151 +++
...e_browser_gcm_gcm__profile__service__factory.cc | 26 +
...__id_instance__id__profile__service__factory.cc | 26 +
.../patch-chrome_browser_global__features.cc | 35 +
.../patch-chrome_browser_global__features.h | 44 +
...chrome_browser_headless_headless__mode__util.cc | 35 +
...h-chrome_browser_intranet__redirect__detector.h | 17 +
..._galleries_fileapi_mtp__device__map__service.cc | 21 +
...dia__galleries_media__file__system__registry.cc | 22 +
...ch-chrome_browser_media_audio__service__util.cc | 26 +
...-chrome_browser_media_router_discovery_BUILD.gn | 17 +
...er_discovery_discovery__network__list__posix.cc | 54 +
...covery_discovery__network__list__wifi__linux.cc | 36 +
...wser_media_webrtc_chrome__screen__enumerator.cc | 53 +
...owser_media_webrtc_chrome__screen__enumerator.h | 26 +
...ia_webrtc_desktop__media__picker__controller.cc | 17 +
...e_browser_media_webrtc_webrtc__log__uploader.cc | 17 +
...ser_media_webrtc_webrtc__logging__controller.cc | 39 +
...wser_media_webrtc_webrtc__logging__controller.h | 26 +
.../patch-chrome_browser_memory__details.cc | 17 +
...chrome__browser__main__extra__parts__metrics.cc | 49 +
..._chrome__browser__main__extra__parts__metrics.h | 26 +
...ser_metrics_chrome__metrics__service__client.cc | 94 ++
...ch-chrome_browser_metrics_perf_cpu__identity.cc | 17 +
...trics_power_process__metrics__recorder__util.cc | 17 +
...hrome_browser_metrics_power_process__monitor.cc | 35 +
...chrome_browser_metrics_power_process__monitor.h | 17 +
...owser_net_profile__network__context__service.cc | 35 +
...rowser_net_system__network__context__manager.cc | 153 +++
...browser_net_system__network__context__manager.h | 26 +
...page_modules_file__suggestion_drive__service.cc | 17 +
..._browser_new__tab__page_new__tab__page__util.cc | 17 +
...cations_notification__display__service__impl.cc | 44 +
...ns_notification__platform__bridge__delegator.cc | 17 +
...d__manager_chrome__password__manager__client.cc | 26 +
...d__manager_password__reuse__manager__factory.cc | 17 +
.../patch-chrome_browser_platform__util__linux.cc | 18 +
...wser_policy_browser__signin__policy__handler.cc | 17 +
...wser__cloud__management__controller__desktop.cc | 44 +
...onfiguration__policy__handler__list__factory.cc | 269 ++++
...y_device__management__service__configuration.cc | 17 +
...olicy_policy__value__and__status__aggregator.cc | 17 +
.../patch-chrome_browser_prefs_browser__prefs.cc | 81 ++
...er_prefs_pref__service__incognito__allowlist.cc | 17 +
...er_printing_print__backend__service__manager.cc | 35 +
...patch-chrome_browser_printing_printer__query.cc | 17 +
...tch-chrome_browser_process__singleton__posix.cc | 26 +
...hrome__browser__main__extra__parts__profiles.cc | 124 ++
.../patch-chrome_browser_profiles_profile__impl.cc | 46 +
...atch-chrome_browser_profiles_profiles__state.cc | 35 +
...h-chrome_browser_renderer__preferences__util.cc | 35 +
...s_settings_autofill__page_passwords__shared.css | 17 +
...ome_browser_resources_signin_signin__shared.css | 17 +
...owsing_chrome__password__protection__service.cc | 17 +
...d__content__scanning_binary__upload__service.cc | 26 +
...dent__reporting_incident__reporting__service.cc | 17 +
...owser_safe__browsing_safe__browsing__service.cc | 26 +
...rowser_screen__ai_screen__ai__install__state.cc | 26 +
...owser_screen__ai_screen__ai__service__router.cc | 26 +
...b__to__self_receiving__ui__handler__registry.cc | 26 +
...o__self_send__tab__to__self__client__service.cc | 26 +
...tch-chrome_browser_sessions_session__restore.cc | 26 +
...ser_sharing_sharing__handler__registry__impl.cc | 26 +
...patch-chrome_browser_shortcuts_icon__badging.cc | 17 +
...ome_browser_signin_accounts__policy__manager.cc | 44 +
...rome_browser_signin_accounts__policy__manager.h | 35 +
.../patch-chrome_browser_signin_signin__util.cc | 17 +
...ed__user_classify__url__navigation__throttle.cc | 17 +
...vised__user_supervised__user__browser__utils.cc | 26 +
...rvised__user_supervised__user__browser__utils.h | 17 +
...supervised__user__extensions__delegate__impl.cc | 17 +
...__user_supervised__user__extensions__manager.cc | 26 +
...d__user_supervised__user__extensions__manager.h | 17 +
...ed__user__google__auth__navigation__throttle.cc | 26 +
..._supervised__user__metrics__service__factory.cc | 26 +
..._user_supervised__user__navigation__observer.cc | 26 +
..._user_supervised__user__navigation__throttle.cc | 26 +
...__user_supervised__user__navigation__throttle.h | 17 +
...owser_sync_chrome__sync__controller__builder.cc | 17 +
...rowser_sync_device__info__sync__client__impl.cc | 17 +
...h-chrome_browser_sync_sync__service__factory.cc | 44 +
...oup__sync_tab__group__sync__service__factory.cc | 26 +
...e_browser_task__manager_sampling_task__group.cc | 44 +
...me_browser_task__manager_sampling_task__group.h | 44 +
..._task__manager_sampling_task__group__sampler.cc | 53 +
...r_task__manager_sampling_task__group__sampler.h | 44 +
...r_task__manager_sampling_task__manager__impl.cc | 17 +
...browser_task__manager_task__manager__observer.h | 17 +
.../patch-chrome_browser_themes_theme__helper.cc | 17 +
.../patch-chrome_browser_themes_theme__service.cc | 26 +
...e_browser_themes_theme__service__aura__linux.cc | 17 +
...hrome_browser_themes_theme__service__factory.cc | 43 +
...-chrome_browser_ui_actions_chrome__action__id.h | 17 +
..._payments_desktop__payments__window__manager.cc | 26 +
...l_payments_desktop__payments__window__manager.h | 44 +
.../patches/patch-chrome_browser_ui_browser.h | 17 +
...rome_browser_ui_browser__command__controller.cc | 86 ++
.../patch-chrome_browser_ui_browser__commands.cc | 17 +
.../patch-chrome_browser_ui_browser__ui__prefs.cc | 26 +
...patch-chrome_browser_ui_browser__view__prefs.cc | 26 +
.../patch-chrome_browser_ui_chrome__pages.cc | 35 +
.../patch-chrome_browser_ui_chrome__pages.h | 26 +
...rowser_ui_color_native__chrome__color__mixer.cc | 17 +
.../patches/patch-chrome_browser_ui_managed__ui.cc | 26 +
...r_ui_omnibox_omnibox__pedal__implementations.cc | 17 +
...rollers_relaunch__chrome__bubble__controller.cc | 26 +
..._passwords_manage__passwords__ui__controller.cc | 26 +
.../patches/patch-chrome_browser_ui_sad__tab.cc | 17 +
...sharing__hub_sharing__hub__bubble__controller.h | 17 +
...e_browser_ui_signin_signin__view__controller.cc | 17 +
..._ui_signin_signin__view__controller__delegate.h | 17 +
...chrome_browser_ui_startup_bad__flags__prompt.cc | 17 +
...browser_ui_startup_startup__browser__creator.cc | 44 +
...r_ui_startup_startup__browser__creator__impl.cc | 35 +
...me_browser_ui_startup_startup__tab__provider.cc | 26 +
.../patch-chrome_browser_ui_tab__helpers.cc | 32 +
.../patch-chrome_browser_ui_tabs_features.cc | 17 +
...tch-chrome_browser_ui_tabs_tab__strip__prefs.cc | 17 +
...owser_ui_task__manager_task__manager__columns.h | 17 +
...ui_task__manager_task__manager__table__model.cc | 35 +
...ch-chrome_browser_ui_test_popup__browsertest.cc | 26 +
...tch-chrome_browser_ui_test_test__browser__ui.cc | 26 +
.../patch-chrome_browser_ui_ui__features.cc | 35 +
.../patches/patch-chrome_browser_ui_ui__features.h | 26 +
...h-chrome_browser_ui_views_accelerator__table.cc | 40 +
...pps_chrome__native__app__window__views__aura.cc | 26 +
...s_chrome__browser__main__extra__parts__views.cc | 26 +
...rome_browser_ui_views_chrome__views__delegate.h | 17 +
...wser_ui_views_chrome__views__delegate__linux.cc | 26 +
...owser_ui_views_compose_compose__dialog__view.cc | 17 +
...chrome_browser_ui_views_frame_browser__frame.cc | 62 +
...-chrome_browser_ui_views_frame_browser__frame.h | 26 +
...ws_frame_browser__frame__view__layout__linux.cc | 17 +
..._browser__frame__view__layout__linux__native.cc | 17 +
...r_ui_views_frame_browser__frame__view__linux.cc | 26 +
...er__non__client__frame__view__factory__views.cc | 26 +
...-chrome_browser_ui_views_frame_browser__view.cc | 17 +
..._ui_views_frame_opaque__browser__frame__view.cc | 44 +
...r_ui_views_frame_opaque__browser__frame__view.h | 26 +
...paque__browser__frame__view__layout__delegate.h | 26 +
...e_picture__in__picture__browser__frame__view.cc | 98 ++
...me_picture__in__picture__browser__frame__view.h | 44 +
..._ui_views_frame_system__menu__model__builder.cc | 35 +
...ui_views_frame_system__menu__model__delegate.cc | 35 +
...wser_ui_views_frame_tab__strip__region__view.cc | 17 +
...chrome_browser_ui_views_hung__renderer__view.cc | 17 +
...rowser_ui_views_omnibox_omnibox__view__views.cc | 17 +
...views_passwords_password__bubble__view__base.cc | 26 +
...rowser_ui_views_profiles_profile__menu__view.cc | 26 +
..._ui_views_profiles_profile__menu__view__base.cc | 17 +
...wser_ui_views_profiles_profile__picker__view.cc | 26 +
...es_signin__view__controller__delegate__views.cc | 53 +
...les_signin__view__controller__delegate__views.h | 26 +
.../patch-chrome_browser_ui_views_tabs_tab.cc | 17 +
..._browser_ui_views_tabs_tab__drag__controller.cc | 53 +
...ui_views_tabs_tab__hover__card__bubble__view.cc | 17 +
...rome_browser_ui_views_tabs_tab__style__views.cc | 17 +
..._education_browser__user__education__service.cc | 26 +
...eb__apps_web__app__integration__test__driver.cc | 89 ++
...rowser_ui_web__applications_web__app__dialogs.h | 17 +
...eb__applications_web__app__ui__manager__impl.cc | 26 +
...web__applications_web__app__ui__manager__impl.h | 17 +
...atch-chrome_browser_ui_webui_about_about__ui.cc | 35 +
...patch-chrome_browser_ui_webui_about_about__ui.h | 17 +
..._ui_webui_app__home_app__home__page__handler.cc | 17 +
...r_ui_webui_app__home_app__home__page__handler.h | 17 +
...ui_webui_app__settings_web__app__settings__ui.h | 24 +
...icate__manager_certificate__manager__handler.cc | 17 +
...i_certificate__manager_client__cert__sources.cc | 71 +
...ui_certificate__manager_client__cert__sources.h | 26 +
...me_browser_ui_webui_chrome__web__ui__configs.cc | 104 ++
...i_webui_chrome__web__ui__controller__factory.cc | 46 +
...i_connectors__internals_device__trust__utils.cc | 35 +
...r__education__internals__page__handler__impl.cc | 35 +
...wser_ui_webui_interstitials_interstitial__ui.cc | 35 +
...e_browser_ui_webui_management_management__ui.cc | 22 +
...i_webui_management_management__ui__constants.cc | 23 +
...ui_webui_management_management__ui__constants.h | 25 +
..._ui_webui_management_management__ui__handler.cc | 44 +
...r_ui_webui_management_management__ui__handler.h | 26 +
...ebui_password__manager_promo__cards__handler.cc | 26 +
...manager_promo__cards_relaunch__chrome__promo.cc | 26 +
...rowser_ui_webui_searchbox_searchbox__handler.cc | 35 +
...rowser_ui_webui_settings_appearance__handler.cc | 17 +
...tings_settings__localized__strings__provider.cc | 62 +
...ser_ui_webui_signin_profile__picker__handler.cc | 26 +
...hrome_browser_ui_window__sizer_window__sizer.cc | 17 +
...king_visited__url__ranking__service__factory.cc | 26 +
...lications_commands_launch__web__app__command.cc | 17 +
...s_commands_set__user__display__mode__command.cc | 17 +
...er_web__applications_extension__status__utils.h | 17 +
...ications_extensions_extension__status__utils.cc | 26 +
...ons_os__integration_os__integration__manager.cc | 17 +
...__integration_os__integration__test__override.h | 17 +
...integration_run__on__os__login__sub__manager.cc | 17 +
...tions_os__integration_shortcut__sub__manager.cc | 17 +
...gration_web__app__file__handler__registration.h | 17 +
...lications_os__integration_web__app__shortcut.cc | 26 +
...plications_os__integration_web__app__shortcut.h | 26 +
...pplications_policy_web__app__policy__manager.cc | 17 +
...s_test_os__integration__test__override__impl.cc | 125 ++
...ns_test_os__integration__test__override__impl.h | 44 +
..._browser_web__applications_web__app__helpers.cc | 17 +
...ser_web__applications_web__app__install__info.h | 17 +
...thn_chrome__authenticator__request__delegate.cc | 17 +
...tch-chrome_browser_webauthn_enclave__manager.cc | 26 +
...ser_webauthn_gpm__user__verification__policy.cc | 17 +
...me_browser_webauthn_unexportable__key__utils.cc | 17 +
.../patches/patch-chrome_common_channel__info.h | 26 +
.../patch-chrome_common_channel__info__posix.cc | 26 +
.../patch-chrome_common_chrome__features.cc | 71 +
.../patches/patch-chrome_common_chrome__features.h | 60 +
.../patches/patch-chrome_common_chrome__paths.cc | 90 ++
.../patches/patch-chrome_common_chrome__paths.h | 35 +
.../patch-chrome_common_chrome__paths__internal.h | 17 +
.../patch-chrome_common_chrome__switches.cc | 26 +
.../patches/patch-chrome_common_chrome__switches.h | 24 +
.../patches/patch-chrome_common_crash__keys.cc | 34 +
...rmissions_chrome__permission__message__rules.cc | 17 +
...ch-chrome_common_media_cdm__host__file__path.cc | 17 +
.../patch-chrome_common_media_cdm__registration.cc | 62 +
.../patch-chrome_common_media_cdm__registration.h | 17 +
...a_component__widevine__cdm__hint__file__linux.h | 17 +
.../patches/patch-chrome_common_pref__names.h | 97 ++
.../patches/patch-chrome_common_url__constants.h | 17 +
.../patch-chrome_common_webui__url__constants.cc | 43 +
.../patch-chrome_common_webui__url__constants.h | 62 +
...ise__companion_enterprise__companion__client.cc | 17 +
.../patch-chrome_enterprise__companion_lock.cc | 26 +
...vices_printing_print__backend__service__impl.cc | 53 +
...services_speech_audio__source__fetcher__impl.cc | 17 +
...e_test_base_scoped__channel__override__posix.cc | 17 +
...ch-chrome_test_chromedriver_chrome__launcher.cc | 16 +
...rome_test_chromedriver_chrome_chrome__finder.cc | 35 +
...e_test_chromedriver_key__converter__unittest.cc | 26 +
...medriver_keycode__text__conversion__unittest.cc | 26 +
...sed__user_google__auth__state__waiter__mixin.cc | 17 +
.../patch-chrome_updater_app_app__uninstall.cc | 17 +
.../patches/patch-chrome_updater_configurator.cc | 17 +
chromium-next/patches/patch-chrome_updater_lock.cc | 17 +
.../patch-chrome_updater_util_posix__util.cc | 17 +
.../patches/patch-chrome_utility_services.cc | 35 +
...hromecast_browser_cast__browser__main__parts.cc | 44 +
...ecast_browser_cast__content__browser__client.cc | 17 +
..._browser_runtime__application__service__impl.cc | 17 +
...omecast_media_base_default__monotonic__clock.cc | 26 +
...l_core_browser_autofill__optimization__guide.cc | 17 +
...utofill_core_browser_payments__data__manager.cc | 17 +
...ill_core_common_autofill__payments__features.cc | 26 +
...fill_core_common_autofill__payments__features.h | 17 +
...ponents_autofill_core_common_autofill__prefs.cc | 17 +
...mponents_autofill_core_common_autofill__prefs.h | 17 +
...onents_commerce_core_commerce__feature__list.cc | 44 +
...nstrained__window_constrained__window__views.cc | 17 +
...ngs_core_browser_website__settings__registry.cc | 17 +
...omponents_cookie__config_cookie__store__util.cc | 17 +
.../patch-components_crash_core_app_BUILD.gn | 49 +
...nts_crash_core_app_chrome__crashpad__handler.cc | 18 +
...nents_crash_core_app_crashpad__handler__main.cc | 26 +
...h_core_browser_crash__upload__list__crashpad.cc | 32 +
.../patch-components_crash_core_common_BUILD.gn | 17 +
...ignals_core_browser_mock__signals__aggregator.h | 17 +
...ice__signals_core_browser_signals__aggregator.h | 17 +
...gnals_core_browser_signals__aggregator__impl.cc | 17 +
...ignals_core_browser_signals__aggregator__impl.h | 17 +
...ignals_core_browser_user__permission__service.h | 17 +
...core_browser_user__permission__service__impl.cc | 17 +
..._core_browser_user__permission__service__impl.h | 17 +
...evice__signals_core_common_signals__features.cc | 17 +
...device__signals_core_common_signals__features.h | 17 +
...nals_core_system__signals_platform__delegate.cc | 17 +
...nents_device__signals_test_signals__contract.cc | 17 +
...service_discardable__shared__memory__manager.cc | 17 +
...ponents_embedder__support_user__agent__utils.cc | 18 +
...bedder__support_user__agent__utils__unittest.cc | 35 +
...components_enterprise_watermarking_watermark.cc | 26 +
...h-components_eye__dropper_eye__dropper__view.cc | 17 +
..._feature__engagement_public_event__constants.cc | 17 +
...s_feature__engagement_public_event__constants.h | 17 +
...e__engagement_public_feature__configurations.cc | 36 +
...eature__engagement_public_feature__constants.cc | 36 +
...feature__engagement_public_feature__constants.h | 36 +
...nts_feature__engagement_public_feature__list.cc | 36 +
...ents_feature__engagement_public_feature__list.h | 64 +
...omponents_feed_core_proto_v2_wire_version.proto | 19 +
...s_feed_core_v2_feed__network__impl__unittest.cc | 19 +
.../patch-components_feed_core_v2_proto__util.cc | 30 +
...omponents_feed_core_v2_proto__util__unittest.cc | 19 +
...-components_feed_core_v2_test_proto__printer.cc | 19 +
.../patch-components_flags__ui_flags__state.cc | 17 +
.../patches/patch-components_gwp__asan_BUILD.gn | 17 +
..._asan_client_guarded__page__allocator__posix.cc | 19 +
.../patch-components_gwp__asan_client_gwp__asan.cc | 17 +
...ponents_gwp__asan_client_gwp__asan__features.cc | 17 +
...nts_gwp__asan_crash__handler_crash__analyzer.cc | 26 +
...patch-components_live__caption_caption__util.cc | 17 +
.../patch-components_live__caption_caption__util.h | 17 +
...omponents_media__router_common_media__source.cc | 17 +
...n_providers_cast_channel_cast__message__util.cc | 17 +
...ter_common_providers_cast_channel_enum__table.h | 21 +
...ents_metrics_drive__metrics__provider__linux.cc | 22 +
.../patch-components_metrics_dwa_dwa__service.cc | 17 +
.../patch-components_metrics_metrics__log.cc | 44 +
.../patch-components_metrics_motherboard.cc | 16 +
...nts_named__mojo__ipc__server_connection__info.h | 33 +
...erver_named__mojo__ipc__server__client__util.cc | 17 +
.../patch-components_named__system__lock_lock.h | 17 +
...patch-components_neterror_resources_neterror.js | 17 +
...on__guide_core_optimization__guide__features.cc | 17 +
...zation__guide_core_optimization__guide__util.cc | 17 +
..._async_browser_secret__portal__key__provider.cc | 18 +
...-components_os__crypt_async_common_encryptor.cc | 17 +
...onents_os__crypt_sync_libsecret__util__linux.cc | 33 +
.../patch-components_os__crypt_sync_os__crypt.h | 78 ++
...aint__preview_browser_paint__preview__client.cc | 19 +
...iew_browser_paint__preview__client__unittest.cc | 19 +
...aint__preview_common_proto_paint__preview.proto | 19 +
..._preview_player_player__compositor__delegate.cc | 19 +
...ger_core_browser_features_password__features.cc | 26 +
...ager_core_browser_features_password__features.h | 17 +
...manager_core_browser_password__form__manager.cc | 35 +
...word__manager_core_browser_password__manager.cc | 26 +
...anager_core_browser_password__manager__client.h | 26 +
...ger_core_browser_password__manager__switches.cc | 17 +
...ager_core_browser_password__manager__switches.h | 17 +
...ore_browser_password__manual__fallback__flow.cc | 35 +
...core_browser_password__manual__fallback__flow.h | 26 +
..._core_browser_password__store__factory__util.cc | 17 +
...core_browser_password__store_login__database.cc | 26 +
...ssword__store_login__database__async__helper.cc | 17 +
...er_password__store_login__database__unittest.cc | 17 +
...core_browser_stub__password__manager__client.cc | 17 +
..._core_browser_stub__password__manager__client.h | 17 +
...er_core_common_password__manager__pref__names.h | 26 +
...nager_decorators_process__metrics__decorator.cc | 17 +
...mponents_performance__manager_public_features.h | 17 +
...sions_prediction__service_prediction__common.cc | 26 +
...icy_core_browser_policy__pref__mapping__test.cc | 17 +
...licy_core_common_cloud_cloud__policy__client.cc | 17 +
...mmon_cloud_cloud__policy__refresh__scheduler.cc | 26 +
...policy_core_common_cloud_cloud__policy__util.cc | 61 +
...ts_policy_core_common_policy__loader__common.cc | 26 +
...-components_policy_core_common_policy__paths.cc | 19 +
...-components_policy_core_common_policy__utils.cc | 17 +
...onents_policy_tools_generate__policy__source.py | 20 +
.../patch-components_power__metrics_BUILD.gn | 17 +
...nts_power__metrics_energy__metrics__provider.cc | 27 +
...ontent_common_file__type__policies__unittest.cc | 17 +
...ing_content_resources_gen__file__type__proto.py | 27 +
..._core_browser_db_v4__protocol__manager__util.cc | 17 +
..._browser_realtime_url__lookup__service__base.cc | 17 +
...mponents_safe__browsing_core_common_features.cc | 17 +
...gine__choice_search__engine__choice__service.cc | 17 +
...nents_search__engines_template__url__service.cc | 17 +
...onents_security__interstitials_content_utils.cc | 17 +
..._default__model_cross__device__user__segment.cc | 17 +
...rvices_on__device__translation_sandbox__hook.cc | 49 +
...ervices_on__device__translation_sandbox__hook.h | 22 +
...paint__preview__compositor__collection__impl.cc | 35 +
.../patches/patch-components_soda_soda__util.cc | 35 +
..._metric__utils_common_startup__metric__utils.cc | 17 +
.../patch-components_storage__monitor_BUILD.gn | 26 +
...torage__monitor_removable__device__constants.cc | 17 +
...storage__monitor_removable__device__constants.h | 17 +
...e_browser_supervised__user__metrics__service.cc | 17 +
...r_core_browser_supervised__user__preferences.cc | 17 +
...onents_supervised__user_core_common_features.cc | 60 +
...ponents_supervised__user_core_common_features.h | 40 +
...ents_supervised__user_core_common_pref__names.h | 17 +
...sync__device__info_local__device__info__util.cc | 35 +
...evice__info_local__device__info__util__linux.cc | 20 +
.../patch-components_sync_base_sync__util.cc | 17 +
.../patch-components_system__cpu_cpu__probe.cc | 18 +
...onents_translate_core_common_translate__util.cc | 17 +
...sted__vault_trusted__vault__connection__impl.cc | 17 +
...ponents_update__client_update__query__params.cc | 19 +
..._formatter_spoof__checks_idn__spoof__checker.cc | 17 +
...nts_user__education_views_help__bubble__view.cc | 17 +
...nents_variations_service_variations__service.cc | 17 +
...isited__url__ranking_public_url__visit__util.cc | 17 +
.../patch-components_viz_host_gpu__host__impl.cc | 17 +
...ch-components_viz_host_host__display__client.cc | 17 +
...tch-components_viz_host_host__display__client.h | 17 +
...isplay__embedder_skia__output__surface__impl.cc | 17 +
..._display__embedder_software__output__surface.cc | 26 +
...e_display__embedder_software__output__surface.h | 26 +
...omponents_viz_service_display_skia__renderer.cc | 17 +
...e__sinks_root__compositor__frame__sink__impl.cc | 26 +
...me__sinks_root__compositor__frame__sink__impl.h | 17 +
...ch-components_viz_test_fake__display__client.cc | 17 +
...tch-components_viz_test_fake__display__client.h | 17 +
...tch-components_viz_test_mock__display__client.h | 17 +
chromium-next/patches/patch-content_app_BUILD.gn | 21 +
.../patches/patch-content_app_content__main.cc | 26 +
...atch-content_app_content__main__runner__impl.cc | 133 ++
.../patches/patch-content_browser_BUILD.gn | 39 +
.../patch-content_browser_audio_audio__service.cc | 26 +
..._browser_browser__child__process__host__impl.cc | 25 +
...t_browser_browser__child__process__host__impl.h | 26 +
...ild__process__host__impl__receiver__bindings.cc | 17 +
.../patch-content_browser_browser__main__loop.cc | 43 +
...tent_browser_child__process__launcher__helper.h | 17 +
...wser_child__process__launcher__helper__linux.cc | 131 ++
...browser_child__thread__type__switcher__linux.cc | 26 +
..._compositor_viz__process__transport__factory.cc | 17 +
...wser_devtools_devtools__frontend__host__impl.cc | 44 +
...owser_devtools_devtools__frontend__host__impl.h | 17 +
...wser_devtools_protocol_system__info__handler.cc | 17 +
...ccess_file__path__watcher_file__path__watcher.h | 17 +
...file__path__watcher_file__path__watcher__bsd.cc | 64 +
...le__path__watcher_file__path__watcher__kqueue.h | 16 +
...s_file__system__access__local__path__watcher.cc | 17 +
...font__access_font__enumeration__data__source.cc | 35 +
.../patch-content_browser_gpu_compositor__util.cc | 26 +
...content_browser_gpu_gpu__data__manager__impl.cc | 17 +
...-content_browser_gpu_gpu__data__manager__impl.h | 17 +
...rowser_gpu_gpu__data__manager__impl__private.cc | 17 +
...browser_gpu_gpu__data__manager__impl__private.h | 26 +
..._gpu_gpu__memory__buffer__manager__singleton.cc | 26 +
...patch-content_browser_gpu_gpu__process__host.cc | 25 +
...wser_media_frameless__media__interface__proxy.h | 26 +
...r_media_media__keys__listener__manager__impl.cc | 17 +
...ent_browser_network__service__instance__impl.cc | 35 +
...i__plugin__process__host__receiver__bindings.cc | 26 +
...rowser_renderer__host_delegated__frame__host.cc | 17 +
...ia_service__video__capture__device__launcher.cc | 26 +
...renderer__host_pepper_pepper__file__io__host.cc | 26 +
...er_renderer__host_render__process__host__impl.h | 35 +
...der__process__host__impl__receiver__bindings.cc | 26 +
...wser_renderer__host_render__view__host__impl.cc | 17 +
...derer__host_render__widget__host__view__aura.cc | 53 +
...nderer__host_render__widget__host__view__aura.h | 17 +
...t_render__widget__host__view__event__handler.cc | 17 +
.../patch-content_browser_sandbox__host__linux.cc | 24 +
...scheduler_responsiveness_jank__monitor__impl.cc | 17 +
...duler_responsiveness_native__event__observer.cc | 26 +
...eduler_responsiveness_native__event__observer.h | 53 +
...patch-content_browser_utility__process__host.cc | 53 +
...r_utility__process__host__receiver__bindings.cc | 26 +
...h-content_browser_utility__sandbox__delegate.cc | 56 +
.../patch-content_browser_v8__snapshot__files.cc | 17 +
...r_web__contents_slow__web__preference__cache.cc | 35 +
...wser_web__contents_web__contents__view__aura.cc | 35 +
...contents_web__contents__view__aura__unittest.cc | 17 +
...browser_webui_web__ui__main__frame__observer.cc | 44 +
..._browser_webui_web__ui__main__frame__observer.h | 26 +
...owser_zygote__host_zygote__host__impl__linux.cc | 87 ++
...rowser_zygote__host_zygote__host__impl__linux.h | 35 +
chromium-next/patches/patch-content_child_BUILD.gn | 22 +
.../patches/patch-content_child_child__process.cc | 26 +
.../patches/patch-content_child_child__process.h | 17 +
.../patches/patch-content_common_BUILD.gn | 42 +
.../patches/patch-content_common_features.cc | 26 +
.../patches/patch-content_common_features.h | 26 +
.../patch-content_common_font__list__unittest.cc | 17 +
...-content_common_gpu__pre__sandbox__hook__bsd.cc | 77 ++
...h-content_common_gpu__pre__sandbox__hook__bsd.h | 29 +
...content_common_gpu__pre__sandbox__hook__linux.h | 22 +
.../patches/patch-content_common_user__agent.cc | 43 +
.../patch-content_gpu_gpu__child__thread.cc | 27 +
.../patches/patch-content_gpu_gpu__main.cc | 79 ++
...t_ppapi__plugin_ppapi__blink__platform__impl.cc | 35 +
...nt_ppapi__plugin_ppapi__blink__platform__impl.h | 17 +
...ch-content_ppapi__plugin_ppapi__plugin__main.cc | 29 +
...tent_public_browser_content__browser__client.cc | 17 +
...blic_browser_zygote__host_zygote__host__linux.h | 22 +
...atch-content_public_common_content__features.cc | 41 +
...atch-content_public_common_content__switches.cc | 26 +
...patch-content_public_common_content__switches.h | 25 +
...patch-content_public_common_zygote_features.gni | 14 +
.../patch-content_renderer_render__thread__impl.cc | 44 +
...ent_renderer_renderer__blink__platform__impl.cc | 51 +
...tent_renderer_renderer__blink__platform__impl.h | 17 +
...er_renderer__main__platform__delegate__linux.cc | 24 +
chromium-next/patches/patch-content_shell_BUILD.gn | 17 +
...atch-content_shell_app_shell__main__delegate.cc | 17 +
...nt_shell_browser_shell__browser__main__parts.cc | 53 +
.../patch-content_shell_browser_shell__paths.cc | 26 +
...ll_renderer_shell__content__renderer__client.cc | 17 +
...hell_utility_shell__content__utility__client.cc | 26 +
chromium-next/patches/patch-content_test_BUILD.gn | 17 +
.../patches/patch-content_utility_services.cc | 80 ++
...ch_speech__recognition__sandbox__hook__linux.cc | 43 +
...ech_speech__recognition__sandbox__hook__linux.h | 22 +
...link__platform__with__sandbox__support__impl.cc | 35 +
...blink__platform__with__sandbox__support__impl.h | 17 +
.../patches/patch-content_utility_utility__main.cc | 161 +++
.../patch-content_utility_utility__thread__impl.cc | 27 +
.../patches/patch-content_zygote_BUILD.gn | 17 +
.../patches/patch-content_zygote_zygote__linux.cc | 21 +
.../patch-content_zygote_zygote__main__linux.cc | 64 +
.../patch-device_bluetooth_bluetooth__adapter.cc | 17 +
.../patch-device_bluetooth_cast__bluetooth.gni | 15 +
.../patches/patch-device_gamepad_BUILD.gn | 17 +
.../patch-device_gamepad_gamepad__provider.cc | 17 +
.../patch-device_gamepad_hid__writer__linux.cc | 17 +
..._browser__context__keyed__service__factories.cc | 17 +
...sions_browser_api_management_management__api.cc | 17 +
...sions_browser_api_messaging_message__service.cc | 26 +
...ivate_networking__private__delegate__factory.cc | 35 +
...tensions_common_api___permission__features.json | 35 +
.../patch-extensions_common_api_runtime.json | 17 +
.../patches/patch-extensions_common_command.cc | 17 +
.../patch-extensions_common_features_feature.cc | 17 +
...ensions_renderer_bindings_api__binding__util.cc | 17 +
...-extensions_renderer_bindings_argument__spec.cc | 17 +
...h-extensions_shell_app_shell__main__delegate.cc | 26 +
...er_api_runtime_shell__runtime__api__delegate.cc | 17 +
...ns_shell_browser_shell__browser__main__parts.cc | 17 +
...shell_browser_shell__extensions__api__client.cc | 26 +
..._shell_browser_shell__extensions__api__client.h | 25 +
...h-google__apis_gcm_engine_heartbeat__manager.cc | 35 +
...mand__buffer_service_dawn__context__provider.cc | 17 +
..._command__buffer_service_gles2__cmd__decoder.cc | 17 +
...mmand__buffer_service_shared__context__state.cc | 35 +
...ommand__buffer_service_shared__context__state.h | 26 +
...image_angle__vulkan__image__backing__factory.cc | 17 +
...e_shared__image_external__vk__image__backing.cc | 26 +
..._image_external__vk__image__backing__factory.cc | 17 +
...service_shared__image_shared__image__factory.cc | 35 +
...service_shared__image_shared__image__manager.cc | 17 +
...ce_shared__image_wrapped__sk__image__backing.cc | 17 +
...ommand__buffer_service_webgpu__decoder__impl.cc | 26 +
...ffer_tests_gl__gpu__memory__buffer__unittest.cc | 26 +
.../patches/patch-gpu_config_gpu__control__list.cc | 26 +
.../patch-gpu_config_gpu__finch__features.cc | 18 +
.../patch-gpu_config_gpu__info__collector.cc | 17 +
.../patches/patch-gpu_config_gpu__test__config.cc | 17 +
...-gpu_ipc_common_gpu__memory__buffer__support.cc | 26 +
...h-gpu_ipc_common_gpu__memory__buffer__support.h | 17 +
.../patches/patch-gpu_ipc_service_gpu__init.cc | 80 ++
...gpu_ipc_service_gpu__memory__buffer__factory.cc | 26 +
.../patches/patch-gpu_ipc_service_x__util.h | 17 +
.../patches/patch-gpu_vulkan_generate__bindings.py | 17 +
.../patches/patch-gpu_vulkan_semaphore__handle.cc | 26 +
.../patch-gpu_vulkan_vulkan__device__queue.cc | 26 +
.../patch-gpu_vulkan_vulkan__device__queue.h | 17 +
.../patch-gpu_vulkan_vulkan__function__pointers.cc | 26 +
.../patch-gpu_vulkan_vulkan__function__pointers.h | 33 +
.../patches/patch-gpu_vulkan_vulkan__image.h | 26 +
.../patches/patch-gpu_vulkan_vulkan__util.cc | 17 +
...rowser_headless__browser__main__parts__posix.cc | 45 +
...b_browser_headless__content__browser__client.cc | 26 +
...ib_browser_headless__content__browser__client.h | 17 +
...ss_lib_browser_headless__web__contents__impl.cc | 17 +
...adless_lib_headless__content__main__delegate.cc | 17 +
chromium-next/patches/patch-ipc_ipc__channel.h | 17 +
.../patches/patch-ipc_ipc__channel__common.cc | 17 +
.../patches/patch-ipc_ipc__channel__mojo.cc | 17 +
.../patches/patch-ipc_ipc__message__utils.cc | 17 +
.../patches/patch-ipc_ipc__message__utils.h | 17 +
chromium-next/patches/patch-media_BUILD.gn | 21 +
chromium-next/patches/patch-media_audio_BUILD.gn | 45 +
.../patch-media_audio_alsa_audio__manager__alsa.cc | 60 +
.../patch-media_audio_audio__input__device.cc | 17 +
...h-media_audio_audio__output__proxy__unittest.cc | 20 +
.../patches/patch-media_audio_pulse_pulse__util.cc | 21 +
...atch-media_audio_sndio_audio__manager__sndio.cc | 222 +++
...patch-media_audio_sndio_audio__manager__sndio.h | 75 ++
.../patch-media_audio_sndio_sndio__input.cc | 209 +++
.../patches/patch-media_audio_sndio_sndio__input.h | 100 ++
.../patch-media_audio_sndio_sndio__output.cc | 196 +++
.../patch-media_audio_sndio_sndio__output.h | 97 ++
.../patches/patch-media_base_audio__latency.cc | 17 +
.../patch-media_base_libaom__thread__wrapper.cc | 30 +
.../patch-media_base_libvpx__thread__wrapper.cc | 31 +
.../patches/patch-media_base_media__switches.cc | 132 ++
.../patches/patch-media_base_media__switches.h | 73 +
...ch-media_base_user__input__monitor__unittest.cc | 35 +
.../patches/patch-media_base_video__frame.cc | 53 +
.../patches/patch-media_base_video__frame.h | 53 +
...ideo_create__video__capture__device__factory.cc | 26 +
..._video_fake__video__capture__device__factory.cc | 17 +
..._video_file__video__capture__device__factory.cc | 17 +
...h-media_capture_video_linux_fake__v4l2__impl.cc | 17 +
...ch-media_capture_video_linux_fake__v4l2__impl.h | 31 +
..._capture_video_linux_v4l2__capture__delegate.cc | 183 +++
...a_capture_video_linux_v4l2__capture__delegate.h | 66 +
...dia_capture_video_linux_v4l2__capture__device.h | 17 +
...ture_video_linux_v4l2__capture__device__impl.cc | 17 +
...pture_video_linux_v4l2__capture__device__impl.h | 17 +
..._linux_video__capture__device__factory__v4l2.cc | 107 ++
...o_linux_video__capture__device__factory__v4l2.h | 17 +
...re_video_linux_video__capture__device__linux.cc | 17 +
...deo__capture__buffer__tracker__factory__impl.cc | 26 +
...capture_video_video__capture__device__client.cc | 17 +
.../patch-media_cdm_cdm__paths__unittest.cc | 17 +
.../patch-media_cdm_library__cdm_cdm__paths.gni | 17 +
.../patch-media_ffmpeg_scripts_build__ffmpeg.py | 82 ++
.../patch-media_ffmpeg_scripts_robo__lib_config.py | 64 +
.../patches/patch-media_gpu_buffer__validation.cc | 35 +
...a_gpu_chromeos_gl__image__processor__backend.cc | 19 +
...u_chromeos_libyuv__image__processor__backend.cc | 35 +
...pu_chromeos_mailbox__video__frame__converter.cc | 17 +
...a_gpu_chromeos_platform__video__frame__utils.cc | 17 +
...-media_gpu_chromeos_video__decoder__pipeline.cc | 35 +
...gpu_gpu__video__encode__accelerator__factory.cc | 26 +
...dware__video__decoding__sandbox__hook__linux.cc | 50 +
...rdware__video__decoding__sandbox__hook__linux.h | 22 +
...dware__video__encoding__sandbox__hook__linux.cc | 32 +
...rdware__video__encoding__sandbox__hook__linux.h | 29 +
.../patches/patch-media_gpu_test_raw__video.cc | 17 +
...ch-media_gpu_test_video__frame__file__writer.cc | 17 +
.../patch-media_gpu_test_video__frame__helpers.cc | 17 +
...patch-media_gpu_test_video__frame__validator.cc | 17 +
.../patch-media_gpu_vaapi_vaapi__video__decoder.cc | 17 +
.../patch-media_gpu_vaapi_vaapi__wrapper.cc | 17 +
.../patches/patch-media_media__options.gni | 28 +
.../patches/patch-media_mojo_mojom_stable_BUILD.gn | 17 +
...stable__video__decoder__types__mojom__traits.cc | 26 +
..._stable__video__decoder__types__mojom__traits.h | 17 +
...media_mojo_mojom_video__frame__mojom__traits.cc | 17 +
.../patch-media_video_fake__gpu__memory__buffer.cc | 44 +
...ideo_gpu__memory__buffer__video__frame__pool.cc | 35 +
...ia_video_video__encode__accelerator__adapter.cc | 26 +
...eo_video__encode__accelerator__adapter__test.cc | 17 +
.../patches/patch-media_webrtc_audio__processor.cc | 17 +
.../patches/patch-media_webrtc_helpers.cc | 25 +
.../patch-media_webrtc_helpers__unittests.cc | 44 +
chromium-next/patches/patch-mojo_core_BUILD.gn | 17 +
chromium-next/patches/patch-mojo_core_channel.cc | 20 +
.../patches/patch-mojo_core_embedder_features.h | 17 +
...ojo_public_cpp_platform_socket__utils__posix.cc | 17 +
.../patch-mojo_public_tools_bindings_mojom.gni | 30 +
chromium-next/patches/patch-net_BUILD.gn | 101 ++
chromium-next/patches/patch-net_base_features.cc | 30 +
...tch-net_base_mock__network__change__notifier.cc | 17 +
...atch-net_base_mock__network__change__notifier.h | 26 +
.../patch-net_base_network__change__notifier.cc | 45 +
.../patch-net_base_network__change__notifier.h | 35 +
...-net_base_network__change__notifier__passive.cc | 17 +
.../patch-net_base_network__interfaces__posix.h | 17 +
.../patch-net_base_sockaddr__util__posix.cc | 18 +
...tch-net_base_sockaddr__util__posix__unittest.cc | 18 +
.../patches/patch-net_cert_cert__verify__proc.h | 17 +
.../patch-net_disk__cache_backend__experiment.h | 17 +
...net_disk__cache_simple_simple__file__tracker.cc | 26 +
chromium-next/patches/patch-net_dns_BUILD.gn | 49 +
.../patches/patch-net_dns_address__info.cc | 22 +
.../patch-net_dns_address__sorter__posix.cc | 16 +
.../patch-net_dns_dns__config__service__posix.cc | 32 +
.../patches/patch-net_dns_dns__reloader.cc | 25 +
chromium-next/patches/patch-net_dns_dns__util.cc | 17 +
.../patches/patch-net_dns_host__resolver__proc.cc | 19 +
.../patches/patch-net_dns_public_BUILD.gn | 17 +
.../patches/patch-net_dns_public_resolv__reader.cc | 17 +
.../patches/patch-net_dns_public_resolv__reader.h | 16 +
.../patch-net_dns_public_scoped__res__state.cc | 17 +
.../patch-net_dns_public_scoped__res__state.h | 16 +
.../patch-net_filter_zstd__source__stream.cc | 16 +
.../patch-net_http_http__auth__gssapi__posix.cc | 20 +
.../patch-net_http_http__auth__gssapi__posix.h | 18 +
...atch-net_http_http__auth__handler__negotiate.cc | 17 +
.../patch-net_http_http__auth__preferences.cc | 17 +
.../patch-net_http_http__auth__preferences.h | 35 +
.../patch-net_http_http__network__session.cc | 18 +
...net_proxy__resolution_proxy__config__service.cc | 41 +
...xy__resolution_proxy__config__service__linux.cc | 46 +
.../patches/patch-net_socket_socket__posix.cc | 17 +
.../patch-net_socket_socks5__client__socket.cc | 18 +
.../patches/patch-net_socket_tcp__socket__posix.cc | 26 +
.../patches/patch-net_socket_udp__socket__posix.cc | 132 ++
.../patch-net_socket_udp__socket__unittest.cc | 53 +
.../patches/patch-net_third__party_quiche_BUILD.gn | 17 +
..._tools_cert__verify__tool_cert__verify__tool.cc | 35 +
.../patch-net_tools_net__watcher_net__watcher.cc | 35 +
...ffic__annotation_network__traffic__annotation.h | 26 +
...patch-net_url__request_url__request__context.cc | 17 +
.../patch-net_url__request_url__request__context.h | 17 +
..._url__request_url__request__context__builder.cc | 17 +
.../patches/patch-pdf_pdfium_pdfium__engine.cc | 26 +
.../patches/patch-ppapi_tests_test__utils.h | 27 +
.../patch-printing_backend_cups__ipp__helper.cc | 17 +
.../patch-printing_backend_print__backend__cups.cc | 35 +
...nting_mojom_printing__context__mojom__traits.cc | 35 +
...inting_mojom_printing__context__mojom__traits.h | 17 +
.../patches/patch-printing_print__settings.cc | 44 +
.../patches/patch-printing_print__settings.h | 53 +
.../patch-printing_print__settings__conversion.cc | 17 +
.../patch-printing_printing__context__linux.cc | 44 +
.../patches/patch-printing_printing__features.cc | 23 +
.../patches/patch-printing_printing__features.h | 17 +
...sandbox_print__backend__sandbox__hook__linux.cc | 56 +
..._sandbox_print__backend__sandbox__hook__linux.h | 22 +
.../patch-remoting_base_chromoting__event.cc | 17 +
.../patches/patch-remoting_base_host__settings.cc | 26 +
...h-remoting_codec_webrtc__video__encoder__vpx.cc | 17 +
...ting_host_base_desktop__environment__options.cc | 17 +
.../patches/patch-remoting_host_base_switches.cc | 24 +
.../patches/patch-remoting_host_base_switches.h | 24 +
...ch-remoting_host_basic__desktop__environment.cc | 17 +
.../patch-remoting_host_chromoting__host.cc | 17 +
.../patches/patch-remoting_host_chromoting__host.h | 35 +
...atch-remoting_host_chromoting__host__context.cc | 17 +
...ting_host_chromoting__host__services__client.cc | 26 +
.../patches/patch-remoting_host_client__session.cc | 17 +
...ch-remoting_host_crash_crash__file__uploader.cc | 17 +
..._desktop__and__cursor__conditional__composer.cc | 26 +
...patch-remoting_host_desktop__capturer__proxy.cc | 35 +
...tch-remoting_host_desktop__capturer__wrapper.cc | 35 +
.../patch-remoting_host_evaluate__capability.cc | 17 +
.../patch-remoting_host_host__attributes.cc | 17 +
.../patches/patch-remoting_host_host__details.cc | 17 +
.../patches/patch-remoting_host_host__main.cc | 44 +
.../patches/patch-remoting_host_ipc__constants.cc | 26 +
.../patch-remoting_host_it2me_it2me__host.cc | 35 +
...t_it2me_it2me__native__messaging__host__main.cc | 53 +
...ch-remoting_host_me2me__desktop__environment.cc | 44 +
...emoting_host_mojo__caller__security__checker.cc | 35 +
...-remoting_host_mouse__cursor__monitor__proxy.cc | 17 +
.../patches/patch-remoting_host_policy__watcher.cc | 17 +
..._remote__open__url_remote__open__url__client.cc | 26 +
...st_remote__open__url_remote__open__url__util.cc | 17 +
...mote__open__url_url__forwarder__configurator.cc | 17 +
.../patch-remoting_host_remoting__me2me__host.cc | 166 +++
...-remoting_host_session__policies__from__dict.cc | 17 +
.../patch-remoting_host_setup_start__host__main.cc | 35 +
...hn_remote__webauthn__caller__security__utils.cc | 35 +
...bauthn_remote__webauthn__extension__notifier.cc | 34 +
...atch-remoting_protocol_webrtc__video__stream.cc | 17 +
chromium-next/patches/patch-sandbox_BUILD.gn | 17 +
chromium-next/patches/patch-sandbox_features.gni | 17 +
chromium-next/patches/patch-sandbox_linux_BUILD.gn | 41 +
...sandbox_linux_services_init__process__reaper.cc | 21 +
...tch-sandbox_linux_services_libc__interceptor.cc | 27 +
.../patches/patch-sandbox_policy_BUILD.gn | 56 +
.../patches/patch-sandbox_policy_features.cc | 29 +
.../patches/patch-sandbox_policy_features.h | 17 +
...atch-sandbox_policy_freebsd_sandbox__freebsd.cc | 220 +++
...patch-sandbox_policy_freebsd_sandbox__freebsd.h | 285 ++++
.../patch-sandbox_policy_mojom_sandbox.mojom | 24 +
.../patch-sandbox_policy_netbsd_sandbox__netbsd.cc | 220 +++
.../patch-sandbox_policy_netbsd_sandbox__netbsd.h | 285 ++++
...atch-sandbox_policy_openbsd_sandbox__openbsd.cc | 401 ++++++
...patch-sandbox_policy_openbsd_sandbox__openbsd.h | 289 ++++
.../patches/patch-sandbox_policy_sandbox.cc | 28 +
.../patches/patch-sandbox_policy_sandbox.h | 32 +
.../patches/patch-sandbox_policy_sandbox__type.cc | 138 ++
.../patches/patch-sandbox_policy_switches.cc | 41 +
.../patches/patch-sandbox_policy_switches.h | 40 +
...h-services_audio_audio__sandbox__hook__linux.cc | 37 +
...ch-services_audio_audio__sandbox__hook__linux.h | 22 +
.../patches/patch-services_device_BUILD.gn | 17 +
...vice_geolocation_location__provider__manager.cc | 17 +
.../patches/patch-services_device_hid_BUILD.gn | 43 +
...ch-services_device_hid_hid__connection__fido.cc | 225 ++++
...tch-services_device_hid_hid__connection__fido.h | 69 +
...services_device_hid_hid__connection__freebsd.cc | 249 ++++
...-services_device_hid_hid__connection__freebsd.h | 76 ++
.../patch-services_device_hid_hid__service.cc | 46 +
...patch-services_device_hid_hid__service__fido.cc | 405 ++++++
.../patch-services_device_hid_hid__service__fido.h | 74 +
...ch-services_device_hid_hid__service__freebsd.cc | 404 ++++++
...tch-services_device_hid_hid__service__freebsd.h | 58 +
...tch-services_device_hid_hid__service__netbsd.cc | 36 +
...atch-services_device_hid_hid__service__netbsd.h | 42 +
...ce_public_cpp_generic__sensor_sensor__reading.h | 17 +
.../patch-services_device_public_mojom_BUILD.gn | 17 +
.../patches/patch-services_device_serial_BUILD.gn | 17 +
...ces_device_serial_serial__device__enumerator.cc | 26 +
...ces_device_serial_serial__io__handler__posix.cc | 17 +
...me__zone__monitor_time__zone__monitor__linux.cc | 20 +
.../patches/patch-services_device_usb_BUILD.gn | 40 +
.../patch-services_device_usb_usb__service.cc | 42 +
...patch-services_device_usb_usb__service__fake.cc | 58 +
.../patch-services_device_usb_usb__service__fake.h | 57 +
.../patches/patch-services_network_BUILD.gn | 16 +
.../patch-services_network_network__context.cc | 26 +
.../patch-services_network_network__context.h | 17 +
...rvices_network_network__sandbox__hook__linux.cc | 43 +
...ervices_network_network__sandbox__hook__linux.h | 20 +
.../patch-services_network_network__service.cc | 35 +
.../patch-services_network_network__service.h | 35 +
.../patch-services_network_public_cpp_BUILD.gn | 26 +
.../patch-services_network_public_cpp_features.cc | 17 +
.../patch-services_network_public_mojom_BUILD.gn | 31 +
...ionary_shared__dictionary__writer__in__memory.h | 17 +
..._on__device__model_on__device__model__service.h | 28 +
...ervices_on__device__model_pre__sandbox__init.cc | 44 +
..._instrumentation_queued__request__dispatcher.cc | 71 +
...tor_public_cpp_memory__instrumentation_BUILD.gn | 24 +
...ublic_cpp_memory__instrumentation_os__metrics.h | 26 +
...cpp_memory__instrumentation_os__metrics__bsd.cc | 75 ++
...tch-services_screen__ai_public_cpp_utilities.cc | 35 +
..._ai_sandbox_screen__ai__sandbox__hook__linux.cc | 24 +
...__ai_sandbox_screen__ai__sandbox__hook__linux.h | 22 +
.../patch-services_service__manager_BUILD.gn | 17 +
...manager_public_cpp_service__executable_BUILD.gn | 17 +
...p_stack__sampling_tracing__sampler__profiler.cc | 17 +
...ture_public_mojom_video__capture__service.mojom | 21 +
...effects_video__effects__sandbox__hook__linux.cc | 33 +
..._effects_video__effects__sandbox__hook__linux.h | 22 +
.../patch-skia_ext_SkMemory__new__handler.cpp | 26 +
.../patches/patch-skia_ext_font__utils.cc | 26 +
.../patches/patch-skia_ext_platform__canvas.h | 17 +
.../patches/patch-skia_ext_skcolorspace__trfn.cc | 17 +
...atch-third__party_abseil-cpp_absl_base_config.h | 27 +
...y_abseil-cpp_absl_base_internal_raw__logging.cc | 17 +
..._party_abseil-cpp_absl_base_internal_sysinfo.cc | 71 +
...l-cpp_absl_debugging_internal_elf__mem__image.h | 18 +
...sl_time_internal_cctz_src_time__zone__format.cc | 18 +
.../patches/patch-third__party_afl_src_afl-fuzz.c | 48 +
.../patches/patch-third__party_angle_BUILD.gn | 35 +
.../patch-third__party_angle_src_common_platform.h | 30 +
...ird__party_angle_src_common_platform__helpers.h | 17 +
...third__party_angle_src_common_system__utils.cpp | 17 +
...party_angle_src_common_system__utils__linux.cpp | 45 +
...ngle_src_gpu__info__util_SystemInfo__internal.h | 22 +
...ngle_src_gpu__info__util_SystemInfo__libpci.cpp | 96 ++
...angle_src_gpu__info__util_SystemInfo__linux.cpp | 41 +
...y_angle_src_gpu__info__util_SystemInfo__x11.cpp | 67 +
...tch-third__party_angle_src_libANGLE_Display.cpp | 62 +
...third__party_angle_src_libANGLE_formatutils.cpp | 17 +
...e_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp | 21 +
...e_src_libANGLE_renderer_vulkan_DisplayVk__api.h | 17 +
.../patches/patch-third__party_angle_util_BUILD.gn | 17 +
...erences_renderer__preferences__mojom__traits.cc | 17 +
...n_renderer__preferences_renderer__preferences.h | 17 +
...ferences_renderer__preferences__mojom__traits.h | 17 +
...h-third__party_blink_public_platform_platform.h | 17 +
...hird__party_blink_public_platform_web__vector.h | 17 +
...rer_bindings_scripts_bind__gen_style__format.py | 17 +
...renderer_build_scripts_run__with__pythonpath.py | 16 +
...blink_renderer_controller_blink__initializer.cc | 41 +
...rer_controller_memory__usage__monitor__posix.cc | 27 +
...erer_controller_memory__usage__monitor__posix.h | 53 +
...link_renderer_core_editing_editing__behavior.cc | 17 +
...erer_core_execution__context_navigator__base.cc | 17 +
...blink_renderer_core_exported_web__view__impl.cc | 26 +
...y_blink_renderer_core_frame_web__frame__test.cc | 26 +
...ore_html_canvas_canvas__async__blob__creator.cc | 17 +
...erer_core_inspector_inspector__memory__agent.cc | 17 +
...arty_blink_renderer_core_layout_layout__view.cc | 26 +
...r_core_origin__trials_origin__trial__context.cc | 17 +
...party_blink_renderer_core_paint_paint__layer.cc | 17 +
..._renderer_core_scroll_scrollbar__theme__aura.cc | 26 +
...party_blink_renderer_core_xml_xslt__processor.h | 20 +
...k_renderer_core_xml_xslt__processor__libxslt.cc | 20 +
...r_modules_media_audio_audio__device__factory.cc | 17 +
..._audio_audio__renderer__mixer__manager__test.cc | 17 +
...er_modules_peerconnection_rtc__data__channel.cc | 16 +
...peerconnection_webrtc__audio__renderer__test.cc | 17 +
...odules_webaudio_audio__worklet__thread__test.cc | 17 +
...odules_webgl_webgl__rendering__context__base.cc | 17 +
...rty_blink_renderer_modules_webgpu_gpu__queue.cc | 17 +
...h-third__party_blink_renderer_platform_BUILD.gn | 17 +
...ty_blink_renderer_platform_fonts_font__cache.cc | 26 +
...rty_blink_renderer_platform_fonts_font__cache.h | 53 +
...nk_renderer_platform_fonts_font__description.cc | 26 +
..._blink_renderer_platform_fonts_font__metrics.cc | 35 +
...renderer_platform_fonts_font__platform__data.cc | 26 +
...er_platform_fonts_font__unique__name__lookup.cc | 26 +
...nderer_platform_fonts_skia_font__cache__skia.cc | 26 +
...rer_platform_graphics_begin__frame__provider.cc | 21 +
...r_platform_graphics_gpu_image__layer__bridge.cc | 17 +
...er_platform_graphics_video__frame__submitter.cc | 17 +
...ion_partition__alloc__memory__dump__provider.cc | 34 +
..._peerconnection_rtc__video__encoder__factory.cc | 23 +
...derer_platform_runtime__enabled__features.json5 | 89 ++
...nk_renderer_platform_scheduler_common_thread.cc | 17 +
...g_blink__categorized__worker__pool__delegate.cc | 17 +
..._renderer_platform_wtf_container__annotations.h | 17 +
...arty_blink_renderer_platform_wtf_math__extras.h | 29 +
...arty_blink_renderer_platform_wtf_stack__util.cc | 82 ++
.../patch-third__party_brotli_common_platform.h | 17 +
.../patches/patch-third__party_cpuinfo_cpuinfo.gni | 17 +
...ashpad_crashpad_build_crashpad__buildconfig.gni | 17 +
...-third__party_crashpad_crashpad_client_BUILD.gn | 22 +
...hpad_crashpad_client_crashpad__client__posix.cc | 49 +
...ashpad_minidump_minidump__misc__info__writer.cc | 21 +
...ty_crashpad_crashpad_util_misc_address__types.h | 26 +
..._crashpad_crashpad_util_misc_capture__context.h | 28 +
...d__party_crashpad_crashpad_util_misc_metrics.cc | 17 +
...hird__party_crashpad_crashpad_util_misc_uuid.cc | 17 +
...crashpad_crashpad_util_posix_close__multiple.cc | 17 +
...rashpad_crashpad_util_posix_drop__privileges.cc | 17 +
...__party_crashpad_crashpad_util_posix_signals.cc | 39 +
...ashpad_util_posix_symbolic__constants__posix.cc | 26 +
.../patches/patch-third__party_crc32c_BUILD.gn | 17 +
..._party_dawn_include_dawn_native_VulkanBackend.h | 18 +
...ch-third__party_dawn_src_dawn_common_Platform.h | 20 +
...party_dawn_src_dawn_native_vulkan_BackendVk.cpp | 17 +
.../patches/patch-third__party_ffmpeg_BUILD.gn | 16 +
...atch-third__party_ffmpeg_libavcodec_x86_cabac.h | 18 +
.../patch-third__party_ffmpeg_libavutil_cpu.c | 20 +
.../patch-third__party_ffmpeg_libavutil_mem.c | 18 +
...ch-third__party_ffmpeg_libavutil_random__seed.c | 31 +
...ch-third__party_ffmpeg_libavutil_x86_x86inc.asm | 29 +
.../patch-third__party_fontconfig_include_config.h | 55 +
...atch-third__party_fontconfig_src_src_fccompat.c | 19 +
...rd__party_ipcz_src_reference__drivers_random.cc | 55 +
...hird__party_ipcz_src_standalone_base_logging.cc | 18 +
...tch-third__party_leveldatabase_env__chromium.cc | 18 +
...m_source_libaom_aom__ports_aarch64__cpudetect.c | 56 +
.../patch-third__party_libc++_src_src_chrono.cpp | 17 +
...libc++_src_src_filesystem_filesystem__clock.cpp | 17 +
...ird__party_libc++abi_src_src_cxa__guard__impl.h | 26 +
.../patch-third__party_libdrm_src_xf86drmMode.c | 29 +
...st_cpp_src_phonenumbers_base_memory_singleton.h | 18 +
...pp_src_phonenumbers_base_synchronization_lock.h | 18 +
...ist_cpp_src_phonenumbers_base_thread__checker.h | 29 +
...ch-third__party_libsync_src_include_sync_sync.h | 18 +
.../patches/patch-third__party_libsync_src_sync.c | 31 +
.../patches/patch-third__party_libusb_BUILD.gn | 58 +
.../patch-third__party_libusb_src_libusb_core.c | 17 +
...rd__party_libusb_src_libusb_os_threads__posix.c | 30 +
...x_source_libvpx_vpx__ports_aarch64__cpudetect.c | 34 +
.../patch-third__party_lzma__sdk_C_CpuArch.c | 50 +
...ial__color__utilities_src_cpp_palettes_tones.cc | 17 +
.../patches/patch-third__party_nasm_BUILD.gn | 22 +
.../patch-third__party_nasm_config_config-linux.h | 108 ++
.../patches/patch-third__party_node_node.gni | 17 +
.../patches/patch-third__party_node_node.py | 18 +
...ird__party_pdfium_core_fxge_cfx__fontmapper.cpp | 17 +
...arty_pdfium_core_fxge_linux_fx__linux__impl.cpp | 29 +
...-third__party_pdfium_fxjs_fx__date__helpers.cpp | 28 +
.../patches/patch-third__party_pdfium_pdfium.gni | 17 +
...fium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp | 47 +
..._perfetto_include_perfetto_base_build__config.h | 72 +
..._perfetto_include_perfetto_base_thread__utils.h | 28 +
...rd__party_perfetto_include_perfetto_base_time.h | 40 +
..._perfetto_include_perfetto_ext_base_event__fd.h | 17 +
...fetto_include_perfetto_ext_base_thread__utils.h | 21 +
...erfetto_tracing_internal_track__event__legacy.h | 17 +
...erfetto_protos_perfetto_trace_ftrace_v4l2.proto | 62 +
...rd__party_perfetto_src_base_clock__snapshots.cc | 18 +
...tch-third__party_perfetto_src_base_event__fd.cc | 28 +
...hird__party_perfetto_src_base_periodic__task.cc | 26 +
...third__party_perfetto_src_base_string__utils.cc | 21 +
...d__party_perfetto_src_base_subprocess__posix.cc | 28 +
...party_perfetto_src_base_test_vm__test__utils.cc | 17 +
...party_perfetto_src_base_thread__task__runner.cc | 20 +
...-third__party_perfetto_src_base_unix__socket.cc | 46 +
.../patch-third__party_perfetto_src_base_utils.cc | 57 +
...ce__processor_importers_ftrace_v4l2__tracker.cc | 62 +
...-third__party_perfetto_src_tracing_ipc_memfd.cc | 18 +
...__party_perfetto_src_tracing_platform__posix.cc | 25 +
...atch-third__party_perfetto_src_tracing_track.cc | 29 +
...uf_src_google_protobuf_stubs_platform__macros.h | 17 +
..._party_skia_src_gpu_ganesh_GrAutoLocaleSetter.h | 17 +
...hird__party_skia_src_ports_SkMemory__malloc.cpp | 27 +
...third__party_skia_src_ports_SkOSFile__posix.cpp | 17 +
...__party_speech-dispatcher_libspeechd__version.h | 38 +
...third__party_speech-dispatcher_speechd__types.h | 148 ++
.../patches/patch-third__party_sqlite_BUILD.gn | 17 +
...d__party_sqlite_src_amalgamation__dev_sqlite3.c | 18 +
...-third__party_sqlite_src_amalgamation_sqlite3.c | 47 +
...-third__party_swiftshader_src_Reactor_Debug.cpp | 18 +
...__party_swiftshader_src_System_Configurator.cpp | 18 +
...d__party_swiftshader_src_System_Linux_MemFd.cpp | 43 +
...tshader_src_Vulkan_VkSemaphoreExternalLinux.hpp | 26 +
...tch-third__party_swiftshader_src_WSI_libXCB.cpp | 26 +
...10.0_configs_linux_include_llvm_Config_config.h | 180 +++
...ubzero_build_Linux_include_llvm_Config_config.h | 53 +
...ty_swiftshader_third__party_marl_src_memory.cpp | 18 +
...ty_swiftshader_third__party_marl_src_thread.cpp | 29 +
...ch-third__party_test__fonts_fontconfig_BUILD.gn | 34 +
...st__fonts_fontconfig_fontconfig__util__linux.cc | 33 +
...onts_fontconfig_generate__fontconfig__caches.cc | 26 +
.../patches/patch-third__party_tflite_features.gni | 19 +
.../patches/patch-third__party_unrar_src_crypt.cpp | 17 +
...layers_src_layers_external_vma_vk__mem__alloc.h | 17 +
...ers_vulkan_generated_vk__function__pointers.cpp | 18 +
...kan__memory__allocator_include_vk__mem__alloc.h | 17 +
.../patches/patch-third__party_wayland_BUILD.gn | 20 +
.../patch-third__party_wayland_include_config.h | 35 +
.../patches/patch-third__party_webrtc_BUILD.gn | 18 +
...rd__party_webrtc_modules_audio__device_BUILD.gn | 17 +
...s_desktop__capture_linux_wayland_egl__dmabuf.cc | 24 +
...__capture_linux_x11_x__server__pixel__buffer.cc | 21 +
...ideo__coding_codecs_av1_libaom__av1__encoder.cc | 29 +
...tch-third__party_webrtc_rtc__base_byte__order.h | 17 +
...ch-third__party_webrtc_rtc__base_ip__address.cc | 18 +
...d__party_webrtc_rtc__base_net__test__helpers.cc | 16 +
.../patch-third__party_webrtc_rtc__base_network.cc | 21 +
...ty_webrtc_rtc__base_physical__socket__server.cc | 120 ++
...rty_webrtc_rtc__base_physical__socket__server.h | 17 +
...rty_webrtc_rtc__base_platform__thread__types.cc | 43 +
...webrtc_rtc__base_third__party_sigslot_sigslot.h | 29 +
...h-third__party_webrtc_system__wrappers_BUILD.gn | 17 +
.../patch-third__party_widevine_cdm_widevine.gni | 18 +
.../patches/patch-third__party_zlib_BUILD.gn | 37 +
.../patch-third__party_zlib_cpu__features.c | 57 +
...erate__shim__headers_generate__shim__headers.py | 27 +
.../patches/patch-tools_generate__stubs_rules.gni | 16 +
...atch-tools_gn_build_build__linux.ninja.template | 17 +
chromium-next/patches/patch-tools_gn_build_gen.py | 40 +
.../patch-tools_gn_src_base_files_file__posix.cc | 17 +
.../patches/patch-tools_gn_src_gn_version.h | 21 +
.../patches/patch-tools_gn_src_util_exe__path.cc | 96 ++
.../patches/patch-tools_grit_grit_node_base.py | 18 +
...son__schema__compiler_cpp__bundle__generator.py | 17 +
...ols_json__schema__compiler_feature__compiler.py | 18 +
...ls_memory_partition__allocator_inspect__utils.h | 17 +
...ch-tools_perf_chrome__telemetry__build_BUILD.gn | 26 +
.../patch-tools_protoc__wrapper_protoc__wrapper.py | 30 +
.../patch-tools_v8__context__snapshot_BUILD.gn | 43 +
...atch-tools_variations_fieldtrial__to__struct.py | 18 +
.../patch-ui_aura_client_drag__drop__client.h | 17 +
.../patches/patch-ui_aura_screen__ozone.cc | 17 +
.../patches/patch-ui_aura_screen__ozone.h | 26 +
.../patch-ui_base_accelerators_accelerator.cc | 17 +
...patch-ui_base_clipboard_clipboard__constants.cc | 17 +
.../patch-ui_base_clipboard_clipboard__constants.h | 17 +
...tch-ui_base_clipboard_clipboard__non__backed.cc | 17 +
.../patch-ui_base_cursor_cursor__factory.cc | 17 +
.../patches/patch-ui_base_cursor_cursor__factory.h | 17 +
...agdrop_os__exchange__data__provider__factory.cc | 26 +
...op_os__exchange__data__provider__non__backed.cc | 17 +
...patch-ui_base_ime_dummy__text__input__client.cc | 17 +
.../patch-ui_base_ime_dummy__text__input__client.h | 17 +
.../patch-ui_base_ime_fake__text__input__client.cc | 17 +
.../patch-ui_base_ime_fake__text__input__client.h | 17 +
...-ui_base_ime_init_input__method__initializer.cc | 35 +
...linux_linux__input__method__context__factory.cc | 26 +
.../patch-ui_base_ime_text__input__client.h | 17 +
.../patch-ui_base_resource_resource__bundle.cc | 17 +
.../patch-ui_base_test_skia__gold__pixel__diff.cc | 17 +
.../patches/patch-ui_base_test_ui__controls.h | 17 +
.../patches/patch-ui_base_ui__base__features.cc | 35 +
.../patches/patch-ui_base_ui__base__features.h | 17 +
.../patches/patch-ui_base_ui__base__switches.cc | 24 +
.../patches/patch-ui_base_ui__base__switches.h | 22 +
.../patches/patch-ui_base_webui_web__ui__util.cc | 26 +
.../patch-ui_base_x_x11__cursor__factory.cc | 26 +
.../patches/patch-ui_base_x_x11__cursor__factory.h | 26 +
.../patches/patch-ui_base_x_x11__cursor__loader.cc | 47 +
.../patch-ui_base_x_x11__display__manager.cc | 26 +
.../patch-ui_base_x_x11__shm__image__pool.cc | 77 ++
chromium-next/patches/patch-ui_color_color__id.h | 17 +
.../patch-ui_color_color__provider__utils.cc | 17 +
.../patches/patch-ui_color_system__theme.h | 17 +
.../patches/patch-ui_compositor_compositor.cc | 17 +
.../patches/patch-ui_compositor_compositor.h | 17 +
.../patch-ui_compositor_compositor__observer.h | 17 +
chromium-next/patches/patch-ui_display_screen.cc | 17 +
chromium-next/patches/patch-ui_display_screen.h | 26 +
...vents_devices_x11_device__data__manager__x11.cc | 16 +
chromium-next/patches/patch-ui_events_event.cc | 35 +
.../patches/patch-ui_events_event__switches.cc | 17 +
.../patches/patch-ui_events_event__switches.h | 17 +
...ch-ui_events_keycodes_dom_keycode__converter.cc | 44 +
...tch-ui_events_keycodes_dom_keycode__converter.h | 17 +
chromium-next/patches/patch-ui_gfx_BUILD.gn | 17 +
chromium-next/patches/patch-ui_gfx_canvas__skia.cc | 17 +
.../patches/patch-ui_gfx_font__fallback__linux.cc | 17 +
.../patches/patch-ui_gfx_font__render__params.h | 26 +
.../patch-ui_gfx_font__render__params__linux.cc | 26 +
chromium-next/patches/patch-ui_gfx_font__util.cc | 26 +
.../patches/patch-ui_gfx_gpu__memory__buffer.cc | 17 +
.../patches/patch-ui_gfx_gpu__memory__buffer.h | 26 +
.../patches/patch-ui_gfx_linux_dmabuf__uapi.h | 42 +
.../patches/patch-ui_gfx_linux_gbm__wrapper.cc | 17 +
...ch-ui_gfx_mojom_buffer__types__mojom__traits.cc | 26 +
...x_mojom_native__handle__types__mojom__traits.cc | 40 +
...fx_mojom_native__handle__types__mojom__traits.h | 42 +
.../patches/patch-ui_gfx_native__pixmap__handle.cc | 68 +
.../patches/patch-ui_gfx_native__pixmap__handle.h | 44 +
.../patches/patch-ui_gfx_native__widget__types.h | 26 +
.../patches/patch-ui_gfx_platform__font__skia.cc | 26 +
.../patch-ui_gfx_render__text__api__fuzzer.cc | 26 +
.../patches/patch-ui_gfx_render__text__fuzzer.cc | 26 +
chromium-next/patches/patch-ui_gfx_switches.cc | 17 +
chromium-next/patches/patch-ui_gfx_switches.h | 17 +
.../patches/patch-ui_gfx_x_atom__cache.cc | 16 +
.../patch-ui_gfx_x_generated__protos_dri3.cc | 17 +
.../patch-ui_gfx_x_generated__protos_shm.cc | 17 +
.../patches/patch-ui_gfx_x_xlib__support.cc | 27 +
chromium-next/patches/patch-ui_gl_BUILD.gn | 32 +
chromium-next/patches/patch-ui_gl_gl__context.cc | 17 +
chromium-next/patches/patch-ui_gl_gl__fence.cc | 17 +
.../patches/patch-ui_gl_gl__implementation.cc | 17 +
chromium-next/patches/patch-ui_gl_gl__switches.cc | 35 +
.../patch-ui_gl_sync__control__vsync__provider.cc | 44 +
.../patch-ui_gl_sync__control__vsync__provider.h | 26 +
chromium-next/patches/patch-ui_gtk_gtk__compat.cc | 56 +
.../patch-ui_gtk_printing_print__dialog__gtk.cc | 17 +
...i_message__center_views_message__popup__view.cc | 17 +
.../patches/patch-ui_native__theme_native__theme.h | 17 +
.../patch-ui_native__theme_native__theme__base.cc | 17 +
...tch-ui_native__theme_native__theme__features.cc | 26 +
.../patches/patch-ui_ozone_common_egl__util.cc | 20 +
...platform_headless_headless__surface__factory.cc | 26 +
..._platform_headless_ozone__platform__headless.cc | 17 +
...rm_headless_vulkan__implementation__headless.cc | 35 +
..._ozone_platform_wayland_common_wayland__util.cc | 26 +
...form_wayland_emulate_wayland__input__emulate.cc | 17 +
...tform_wayland_emulate_wayland__input__emulate.h | 17 +
..._wayland_gpu_vulkan__implementation__wayland.cc | 20 +
...ne_platform_wayland_host_wayland__connection.cc | 17 +
...wayland_host_wayland__input__method__context.cc | 17 +
...i_ozone_platform_wayland_host_wayland__popup.cc | 17 +
...tform_wayland_host_wayland__toplevel__window.cc | 17 +
...atform_wayland_host_wayland__toplevel__window.h | 17 +
..._ozone_platform_wayland_host_wayland__window.cc | 50 +
...i_ozone_platform_wayland_host_wayland__window.h | 44 +
...m_wayland_host_zwp__text__input__wrapper__v1.cc | 27 +
...ne_platform_wayland_ozone__platform__wayland.cc | 60 +
...one_platform_x11_vulkan__implementation__x11.cc | 20 +
...tch-ui_ozone_platform_x11_x11__screen__ozone.cc | 35 +
...atch-ui_ozone_platform_x11_x11__screen__ozone.h | 44 +
.../patch-ui_ozone_platform_x11_x11__window.cc | 17 +
...i_ozone_test_mock__platform__window__delegate.h | 17 +
..._platform__window_platform__window__delegate.cc | 17 +
...i_platform__window_platform__window__delegate.h | 17 +
...rm__window_platform__window__init__properties.h | 26 +
chromium-next/patches/patch-ui_qt_BUILD.gn | 17 +
chromium-next/patches/patch-ui_qt_qt.gni | 17 +
...ings_translations_app__locale__settings__bn.xtb | 17 +
...ings_translations_app__locale__settings__ja.xtb | 17 +
...ings_translations_app__locale__settings__ko.xtb | 17 +
...ings_translations_app__locale__settings__ml.xtb | 17 +
...ings_translations_app__locale__settings__th.xtb | 17 +
...s_translations_app__locale__settings__zh-CN.xtb | 17 +
...s_translations_app__locale__settings__zh-TW.xtb | 17 +
.../patch-ui_views_controls_prefix__selector.cc | 17 +
.../patch-ui_views_controls_prefix__selector.h | 17 +
.../patch-ui_views_controls_textfield_textfield.cc | 70 +
.../patch-ui_views_controls_textfield_textfield.h | 26 +
.../patches/patch-ui_views_corewm_tooltip__aura.cc | 17 +
.../patch-ui_views_examples_widget__example.cc | 17 +
.../patches/patch-ui_views_focus_focus__manager.cc | 26 +
.../patch-ui_views_style_platform__style.cc | 35 +
..._ui__controls__factory__desktop__aura__ozone.cc | 17 +
.../patches/patch-ui_views_views__delegate.cc | 17 +
.../patches/patch-ui_views_views__delegate.h | 17 +
...top__aura_desktop__drag__drop__client__ozone.cc | 17 +
...ktop__aura_desktop__drag__drop__client__ozone.h | 26 +
...__aura_desktop__window__tree__host__platform.cc | 35 +
.../patches/patch-ui_views_widget_root__view.cc | 17 +
.../patches/patch-ui_views_widget_widget.cc | 26 +
.../patch-ui_views_window_custom__frame__view.cc | 17 +
.../patch-ui_views_window_dialog__delegate.cc | 17 +
.../patch-ui_views_window_frame__background.cc | 17 +
chromium-next/patches/patch-v8_BUILD.gn | 139 ++
.../patches/patch-v8_include_v8-internal.h | 17 +
chromium-next/patches/patch-v8_include_v8config.h | 59 +
chromium-next/patches/patch-v8_src_api_api.cc | 26 +
.../patches/patch-v8_src_base_atomicops.h | 30 +
.../patches/patch-v8_src_base_platform_memory.h | 24 +
.../patch-v8_src_base_platform_platform-freebsd.cc | 38 +
.../patch-v8_src_base_platform_platform-openbsd.cc | 53 +
.../patch-v8_src_base_platform_platform-posix.cc | 101 ++
.../patches/patch-v8_src_base_small-vector.h | 17 +
chromium-next/patches/patch-v8_src_base_strings.h | 18 +
.../patches/patch-v8_src_base_sys-info.cc | 21 +
...ch-v8_src_base_utils_random-number-generator.cc | 17 +
.../patches/patch-v8_src_diagnostics_perf-jit.cc | 17 +
.../patches/patch-v8_src_diagnostics_perf-jit.h | 17 +
.../patches/patch-v8_src_execution_isolate.cc | 33 +
chromium-next/patches/patch-v8_src_flags_flags.cc | 30 +
.../patches/patch-v8_src_libsampler_sampler.cc | 25 +
.../patches/patch-v8_src_sandbox_sandbox.cc | 17 +
..._embedded_platform-embedded-file-writer-base.cc | 17 +
...t_embedded_platform-embedded-file-writer-base.h | 16 +
...bedded_platform-embedded-file-writer-generic.cc | 48 +
...tch-v8_src_trap-handler_handler-inside-posix.cc | 43 +
...atch-v8_src_trap-handler_handler-inside-posix.h | 17 +
.../patch-v8_src_trap-handler_trap-handler.h | 17 +
...wasm_baseline_ia32_liftoff-assembler-ia32-inl.h | 134 ++
chromium-next/patches/patch-v8_tools_run-paxctl.py | 25 +
chromium-next/patches/patch-v8_tools_run.py | 17 +
chromium-next/tests.mk | 59 +
chromium/TODO | 2 +
1407 files changed, 48655 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index 4cadaac736..3f1639ae0f 100644
--- a/Makefile
+++ b/Makefile
@@ -470,6 +470,7 @@ SUBDIR+= choosefont
SUBDIR+= chora
SUBDIR+= chromium
SUBDIR+= chromium-depot_tools
+SUBDIR+= chromium-next
SUBDIR+= chronograf
SUBDIR+= chrsh
SUBDIR+= chruby
diff --git a/chromium-next/DESCR b/chromium-next/DESCR
new file mode 100644
index 0000000000..2a86084420
--- /dev/null
+++ b/chromium-next/DESCR
@@ -0,0 +1,3 @@
+Chromium is an open-source browser project that aims to build a
+safer, faster, and more stable way for all Internet users to
+experience the web.
diff --git a/chromium-next/Makefile b/chromium-next/Makefile
new file mode 100644
index 0000000000..e93e1dee9c
--- /dev/null
+++ b/chromium-next/Makefile
@@ -0,0 +1,377 @@
+# $NetBSD$
+
+DISTNAME= chromium-${VERSION}
+PKGNAME= ${DISTNAME:S/chromium/chromium-next/}
+VERSION= 132.0.6834.83
+CATEGORIES= www
+MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/
+EXTRACT_SUFX_C= .tar.xz
+
+#PROFILE_DISTFILES= chromium-linux-${VERSION}-llvm17.profdata${EXTRACT_SUFX_C}
+#SITES.${PROFILE_DISTFILES}= https://nerd.hu/distfiles/
+DISTFILES+= ${DISTNAME}${EXTRACT_SUFX_C}
+#DISTFILES+= ${PROFILE_DISTFILES}
+
+# audioio source
+A_VERSION= 130.0
+GITHUB_SUBMODULES= kikadf chromium-audioio v${A_VERSION} media/audio/audioio
+
+MAINTAINER= kikadf.01%gmail.com@localhost
+HOMEPAGE= https://www.chromium.org/Home
+COMMENT= Open source web browser
+LICENSE= modified-bsd AND gnu-lgpl-v3 AND mpl-2.0
+
+USE_TOOLS+= bash bison flex:pkgsrc gmake pax perl pkg-config
+TOOLS_PLATFORM.flex= # override the platform definition to use pkgsrc's flex.
+USE_LANGUAGES= c c++
+
+CHECK_PORTABILITY_SKIP+= third_party/dawn/third_party/dxc/utils/buildit/build_llvm
+CHECK_PORTABILITY_SKIP+= third_party/sqlite/src/configure
+CHECK_PORTABILITY_SKIP+= third_party/protobuf/post_process_dist.sh
+CHECK_PORTABILITY_SKIP+= third_party/ffmpeg/configure
+CHECK_PORTABILITY_SKIP+= third_party/nearby/src/embedded/build.sh
+CHECK_PORTABILITY_SKIP+= third_party/xdg-utils/scripts/xdg-terminal
+CHECK_PORTABILITY_SKIP+= third_party/xdg-utils/scripts/xdg-terminal.in
+CHECK_PORTABILITY_SKIP+= third_party/llvm/flang/tools/f18/flang.sh.in
+CHECK_PORTABILITY_SKIP+= third_party/rust-src/vendor/libdbus-sys-0.2.5/vendor/dbus/tools/cmake-format
+CHECK_PORTABILITY_SKIP+= third_party/rust-toolchain/lib/rustlib/src/rust/vendor/libdbus-sys-0.2.5/vendor/dbus/tools/cmake-format
+CHECK_PORTABILITY_SKIP+= v8/tools/run-llprof.sh
+CHECK_PORTABILITY_SKIP+= v8/tools/profiling/run-llprof.sh
+
+TOOL_DEPENDS+= gperf>=3.0.1:../../devel/gperf
+TOOL_DEPENDS+= nasm-[0-9]*:../../devel/nasm
+TOOL_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
+TOOL_DEPENDS+= ${PYPKGPREFIX}-html5lib-[0-9]*:../../textproc/py-html5lib
+TOOL_DEPENDS+= ${PYPKGPREFIX}-beautifulsoup4-[0-9]*:../../www/py-beautifulsoup4
+TOOL_DEPENDS+= ${PYPKGPREFIX}-ply-[0-9]*:../../devel/py-ply
+TOOL_DEPENDS+= nodejs-[0-9]*:../../lang/nodejs
+TOOL_DEPENDS+= rust-bindgen-[0-9]*:../../devel/rust-bindgen
+
+DEPENDS+= xdg-utils-[0-9]*:../../misc/xdg-utils
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/compiler.mk"
+
+#ONLY_FOR_PLATFORM+= *-*-arm # not yet
+#ONLY_FOR_PLATFORM+= *-*-aarch64 # not yet
+#ONLY_FOR_PLATFORM+= *-*-i386 # not yet
+ONLY_FOR_PLATFORM+= *-*-x86_64
+
+# Workaround for brotli and other commands.
+#BUILDLINK_TRANSFORM.NetBSD+= rm:-ldl
+
+# Let to chromium use the -Wl,-z,relro flag
+BUILDLINK_TRANSFORM+= rm:-Wl,-zrelro
+
+# Do not use alloca(3) in libc.
+BUILDLINK_TRANSFORM+= opt:-std=c11:-std=gnu11
+BUILDLINK_TRANSFORM+= opt:-std=c99:-std=gnu99
+BUILDLINK_TRANSFORM+= opt:-std=c++14:-std=gnu++14
+BUILDLINK_TRANSFORM+= opt:-std=c++17:-std=gnu++17
+BUILDLINK_TRANSFORM+= opt:-std=c++20:-std=gnu++20
+
+REPLACE_BASH= chrome/tools/build/linux/chrome-wrapper
+FILES_SUBST+= PYTHONBIN=${PYTHONBIN:Q}
+
+SUBST_CLASSES+= path
+SUBST_STAGE.path= pre-configure
+SUBST_MESSAGE.path= Fixing pathes
+SUBST_FILES.path+= base/base_paths_posix.cc
+SUBST_FILES.path+= base/process/process_handle_openbsd.cc
+SUBST_FILES.path+= build/rust/rust_bindgen.gni
+SUBST_FILES.path+= build/rust/rust_bindgen_generator.gni
+SUBST_FILES.path+= chrome/common/chrome_paths.cc
+SUBST_FILES.path+= chromium.sh
+SUBST_FILES.path+= components/policy/core/common/policy_paths.cc
+SUBST_FILES.path+= sandbox/policy/openbsd/sandbox_openbsd.cc
+SUBST_FILES.path+= services/device/hid/hid_service_freebsd.cc
+SUBST_FILES.path+= services/device/time_zone_monitor/time_zone_monitor_linux.cc
+SUBST_FILES.path+= third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp
+SUBST_FILES.path+= third_party/perfetto/src/base/utils.cc
+SUBST_FILES.path+= ui/qt/qt.gni
+SUBST_FILES.path+= v8/tools/run-paxctl.py
+SUBST_VARS.path+= PREFIX PKG_SYSCONFBASE VARBASE QTDIR X11BASE PYTHONBIN
+
+SUBST_CLASSES+= man
+SUBST_STAGE.man= pre-configure
+SUBST_MESSAGE.man= Fixing manpage
+SUBST_FILES.man+= chrome/app/resources/manpage.1.in
+SUBST_SED.man+= -e 's,@@PACKAGE@@,chromium,g'
+SUBST_SED.man+= -e 's,@@MENUNAME@@,Chromium Web Browser,g'
+
+.include "options.mk"
+
+SUBST_CLASSES+= pulse
+SUBST_STAGE.pulse= pre-configure
+SUBST_MESSAGE.pulse= Set BUILT_WITH_PULSE to ${WITH_PA} in chromium wrapper
+SUBST_FILES.pulse+= chromium.sh
+SUBST_SED.pulse+= -e 's,@PULSE@,${WITH_PA},g'
+
+.include "tests.mk"
+
+MAKE_ENV+= BUILDTYPE=${BUILDTYPE}
+MAKE_ENV+= GPERF=${PREFIX}/bin/gperf
+TARGET= chrome chromedriver
+
+# These libraries are used from the system and the build infrastructure
+# removes them from the bundled third_party directory and replaces them
+# with hooks to use them from the system.
+GN_SYSTEM_LIBS= dav1d
+GN_SYSTEM_LIBS+= fontconfig
+GN_SYSTEM_LIBS+= icu
+GN_SYSTEM_LIBS+= libaom
+GN_SYSTEM_LIBS+= libevent
+#GN_SYSTEM_LIBS+= libjpeg # libjpeg-turbo
+GN_SYSTEM_LIBS+= libpng
+GN_SYSTEM_LIBS+= libvpx
+GN_SYSTEM_LIBS+= libxml
+GN_SYSTEM_LIBS+= libxslt
+GN_SYSTEM_LIBS+= openh264
+GN_SYSTEM_LIBS+= opus
+
+GN_ARGS+= chrome_pgo_phase=0
+GN_ARGS+= clang_use_chrome_plugins=false
+GN_ARGS+= disable_fieldtrial_testing_config=true
+GN_ARGS+= enable_backup_ref_ptr_support=false
+GN_ARGS+= enable_hangout_services_extension=true
+GN_ARGS+= enable_nacl=false
+GN_ARGS+= enable_remoting=false
+GN_ARGS+= fatal_linker_warnings=false
+GN_ARGS+= icu_use_data_file=false
+GN_ARGS+= is_cfi=false
+GN_ARGS+= is_clang=true
+GN_ARGS+= optimize_webui=true
+GN_ARGS+= thin_lto_enable_optimizations=true
+GN_ARGS+= treat_warnings_as_errors=false
+GN_ARGS+= use_allocator_shim=false
+GN_ARGS+= use_cups=true
+GN_ARGS+= use_custom_libcxx=true
+GN_ARGS+= use_custom_libunwind=true
+GN_ARGS+= use_kerberos=false
+GN_ARGS+= use_lld=false
+GN_ARGS+= use_partition_alloc=true
+GN_ARGS+= use_partition_alloc_as_malloc=false
+GN_ARGS+= use_sysroot=false
+GN_ARGS+= use_system_freetype=true
+GN_ARGS+= use_system_harfbuzz=true
+GN_ARGS+= use_system_libdrm=true
+#GN_ARGS+= use_system_libjpeg=true #libjpeg-turbo
+GN_ARGS+= use_thin_lto=false
+GN_ARGS+= use_udev=false
+GN_ARGS+= use_vaapi=false
+GN_ARGS+= v8_enable_cet_ibt=true
+
+# flags
+CFLAGS+= -fno-stack-protector
+CFLAGS+= -isystem${PREFIX}/lib/clang/17/include # third_party/zlib with clang
+CFLAGS+= -Wno-error=unused-command-line-argument
+CFLAGS+= -Wno-unknown-warning-option
+
+EXTRA_LDFLAGS= -L${PREFIX}/lib \
+ -L${X11BASE}/lib \
+ ${COMPILER_RPATH_FLAG}${PREFIX}/lib \
+ ${COMPILER_RPATH_FLAG}${PREFIX}/lib/nspr \
+ ${COMPILER_RPATH_FLAG}${PREFIX}/lib/nss \
+ ${COMPILER_RPATH_FLAG}${X11BASE}/lib
+EXTRA_CXXFLAGS= -Wno-unknown-warning-option \
+ -I${BUILDLINK_DIR}/include \
+ -I${BUILDLINK_DIR}/include/libepoll-shim \
+ -I${BUILDLINK_DIR}/include/glib \
+ -I${BUILDLINK_DIR}/include/nss
+
+# rust
+RUSTC_VERSION= rustc -V
+MAKE_ENV+= RUSTC_BOOTSTRAP=1
+GN_ARGS+= enable_rust=true \
+ rust_sysroot_absolute=\"${PREFIX}\" \
+ rustc_version=\"${RUSTC_VERSION:sh}\"
+
+PLIST_VARS+= swiftshader
+.if ${MACHINE_ARCH} == "aarch64"
+FFMPEG_TARGET= arm64
+.elif ${MACHINE_ARCH} == "x86_64"
+PLIST.swiftshader= yes
+FFMPEG_TARGET= x64
+.elif ${MACHINE_ARCH} == "i386"
+EXTRA_LDFLAGS+= -Wl,--no-keep-memory
+PLIST.swiftshader= yes
+FFMPEG_TARGET= ia32
+.endif
+
+GN_ARGS+= extra_cxxflags=\"${EXTRA_CXXFLAGS}\" \
+ extra_ldflags=\"${EXTRA_LDFLAGS}\"
+
+# Proprietary codecs are enabled.
+FFMPEG_BRAND= Chrome
+FFMPEG_BDIR= ${WRKSRC}/third_party/ffmpeg/build.${FFMPEG_TARGET}.${LOWER_OPSYS}/${FFMPEG_BRAND}
+FFMPEG_CDIR= ${WRKSRC}/third_party/ffmpeg/chromium/config/${FFMPEG_BRAND}/${LOWER_OPSYS}/${FFMPEG_TARGET}
+
+GN_ARGS+= proprietary_codecs=true \
+ ffmpeg_branding=\"${FFMPEG_BRAND}\"
+
+GN_BOOTSTRAP_FLAGS+= --no-clean --no-rebuild
+GN_BOOTSTRAP_FLAGS+= --skip-generate-buildfiles
+
+# API key and OAuth credential for Google.
+# This is pkgsrc use only.
+GN_ARGS+= google_api_key=\"AIzaSyAT_3ogzNMKbBMFk3xQ6T35fg52Y9GrFBg\"
+#GN_ARGS+= google_default_client_id=\"74061691103-faqqnan75j2s8ej3p7lh2k98dhkee816.apps.googleusercontent.com\"
+#GN_ARGS+= google_default_client_secret=\"3R9TyUv14OXgzJnZi6Ismela\"
+
+NOT_PAX_MPROTECT_SAFE+= lib/chromium/chrome
+#NOT_PAX_ASLR_SAFE+= lib/chromium/chrome
+
+PKG_CC= clang
+PKG_CXX= clang++
+
+CONFLICTS= chromium-[0-9]*
+
+post-extract:
+ ${CP} ${FILESDIR}/chromium.sh.in ${WRKSRC}/chromium.sh
+
+pre-configure:
+ # Prepare internal ffmpeg
+ cd ${WRKSRC}/media/ffmpeg && \
+ ${PYTHONBIN} scripts/build_ffmpeg.py \
+ ${LOWER_OPSYS} ${FFMPEG_TARGET} --config-only --branding=${FFMPEG_BRAND}
+ cd ${FFMPEG_BDIR} && ${GMAKE} ffversion.h
+ ${INSTALL_DATA_DIR} ${FFMPEG_CDIR}
+.for ffmpeg_part in config.h config.asm config_components.h libavcodec libavformat libavutil
+ cp -pR ${FFMPEG_BDIR}/${ffmpeg_part} ${FFMPEG_CDIR}
+.endfor
+
+ # Create symlink to NetBSD nodejs command.
+ ${MKDIR} ${WRKSRC}/third_party/node/${LOWER_OPSYS}/node-${LOWER_OPSYS}/bin
+ ${LN} -sf ${PREFIX}/bin/node \
+ ${WRKSRC}/third_party/node/${LOWER_OPSYS}/node-${LOWER_OPSYS}/bin/node
+
+do-configure:
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${PYTHONBIN} ./build/linux/unbundle/replace_gn_files.py \
+ --system-libraries ${GN_SYSTEM_LIBS} || ${FALSE}
+
+ cd ${WRKSRC}/tools/gn && \
+ ${SETENV} ${MAKE_ENV} ${PYTHONBIN} bootstrap/bootstrap.py ${GN_BOOTSTRAP_FLAGS}
+
+ cd ${WRKSRC} && \
+ ${SETENV} ${CONFIGURE_ENV} ./out/${BUILDTYPE}/gn \
+ gen --args="${GN_ARGS}" --script-executable="${PYTHONBIN}" ${GN_VERBOSE} out/${BUILDTYPE}
+
+do-build:
+ ${RUN} ${_ULIMIT_CMD} cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/ninja -j ${_MAKE_JOBS_N} -C out/${BUILDTYPE} ${TARGET}
+
+
+CHROMIUM= chromium
+BUILDDIR= ${WRKSRC}/out/${BUILDTYPE}
+INSTALLATION_DIRS+= lib/${CHROMIUM}
+INSTALLATION_DIRS+= bin
+INSTALLATION_DIRS+= ${PKGMANDIR}/man1
+INSTALLATION_DIRS+= ${PREFIX}/share/applications
+
+ICON_SIZES= 22_mono 24 48 64 128 256
+.for i in ${ICON_SIZES}
+ICONS_DIR${i}+= share/icons/hicolor/${i}x${i}/apps
+INSTALLATION_DIRS+= ${ICONS_DIR${i}}
+.endfor
+
+CHROMIUM_LIBS+= libEGL.so
+CHROMIUM_LIBS+= libGLESv2.so
+CHROMIUM_LIBS+= libVkICD_mock_icd.so
+CHROMIUM_LIBS+= libvulkan.so.1
+.if ${MACHINE_ARCH} != "aarch64"
+CHROMIUM_LIBS+= libvk_swiftshader.so
+CHROMIUM_LIBS+= vk_swiftshader_icd.json
+.endif
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/${CHROMIUM}.sh ${DESTDIR}${PREFIX}/bin/${CHROMIUM}
+ ${INSTALL_DATA} ${FILESDIR}/chromium-browser.desktop ${DESTDIR}${PREFIX}/share/applications
+ ${INSTALL_PROGRAM} ${BUILDDIR}/chrome ${DESTDIR}${PREFIX}/lib/${CHROMIUM}
+ ${INSTALL_PROGRAM} ${BUILDDIR}/chromedriver.unstripped ${DESTDIR}${PREFIX}/bin/chromedriver
+.for i in ${CHROMIUM_LIBS}
+ ${INSTALL_LIB} ${BUILDDIR}/${i} ${DESTDIR}${PREFIX}/lib/${CHROMIUM}
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/chrome/app/resources/manpage.1.in \
+ ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man1/${CHROMIUM}.1
+ ${INSTALL_DATA} ${BUILDDIR}/*.pak ${DESTDIR}${PREFIX}/lib/${CHROMIUM}
+.for i in ${ICON_SIZES}
+ ${INSTALL_DATA} ${WRKSRC}/chrome/app/theme/chromium/product_logo_${i}.png \
+ ${DESTDIR}${PREFIX}/${ICONS_DIR${i}}/${CHROMIUM}.png
+.endfor
+.for i in locales resources
+ cd ${WRKSRC}/out/${BUILDTYPE} && \
+ ${FIND} ${i} -type f -print | pax -rw -pmp ${DESTDIR}${PREFIX}/lib/${CHROMIUM}
+.endfor
+.for f in snapshot_blob.bin v8_context_snapshot.bin
+ ${INSTALL_DATA} ${BUILDDIR}/${f} ${DESTDIR}${PREFIX}/lib/${CHROMIUM}
+.endfor
+
+.include "../../archivers/bzip2/buildlink3.mk"
+.include "../../audio/flac/buildlink3.mk"
+.include "../../audio/libopus/buildlink3.mk"
+.include "../../audio/speech-dispatcher/buildlink3.mk"
+.include "../../audio/speex/buildlink3.mk"
+.include "../../devel/dconf/buildlink3.mk"
+.include "../../devel/libatomic/buildlink3.mk"
+.include "../../devel/libepoll-shim/buildlink3.mk"
+.include "../../devel/libevent/buildlink3.mk"
+.include "../../devel/libusb1/buildlink3.mk"
+.include "../../devel/nspr/buildlink3.mk"
+.include "../../devel/nss/buildlink3.mk"
+.include "../../devel/re2/buildlink3.mk"
+.include "../../devel/snappy/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../fonts/fontconfig/buildlink3.mk"
+.include "../../fonts/harfbuzz/buildlink3.mk"
+.include "../../graphics/cairo/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../graphics/libexif/buildlink3.mk"
+.include "../../graphics/libwebp/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+BUILDLINK_DEPMETHOD.clang= build
+#.include "../../lang/clang/buildlink3.mk"
+#.include "../../lang/compiler-rt/buildlink3.mk"
+.include "../../wip/clang/buildlink3.mk"
+.include "../../wip/compiler-rt/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../lang/rust/rust.mk"
+.include "../../misc/usbids/buildlink3.mk"
+#.include "../../mk/jpeg.buildlink3.mk" # libjpeg-turbo
+.include "../../multimedia/dav1d/buildlink3.mk"
+.include "../../multimedia/libaom/buildlink3.mk"
+.include "../../multimedia/libvpx/buildlink3.mk"
+.include "../../multimedia/openh264/buildlink3.mk"
+.include "../../print/libcups/buildlink3.mk"
+.include "../../security/libgnome-keyring/buildlink3.mk"
+.include "../../security/libsecret/buildlink3.mk"
+.include "../../security/libgcrypt/buildlink3.mk"
+.include "../../sysutils/dbus/buildlink3.mk"
+.include "../../sysutils/dbus-glib/buildlink3.mk"
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../sysutils/pciutils/buildlink3.mk"
+# Use -lpciutils instead of -lpci for pkgsrc.
+BUILDLINK_TRANSFORM+= l:pci:pciutils
+.include "../../textproc/expat/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../textproc/jsoncpp/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../x11/gtk3/buildlink3.mk"
+.include "../../x11/xorgproto/buildlink3.mk"
+.include "../../x11/libdrm/buildlink3.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../x11/libxcb/buildlink3.mk"
+.include "../../x11/libXcomposite/buildlink3.mk"
+.include "../../x11/libXcursor/buildlink3.mk"
+.include "../../x11/libXdamage/buildlink3.mk"
+.include "../../x11/libXext/buildlink3.mk"
+.include "../../x11/libXfixes/buildlink3.mk"
+.include "../../x11/libXi/buildlink3.mk"
+.include "../../x11/libXrandr/buildlink3.mk"
+.include "../../x11/libXrender/buildlink3.mk"
+.include "../../x11/libXScrnSaver/buildlink3.mk"
+.include "../../x11/libXtst/buildlink3.mk"
+.include "../../x11/qt5-qtbase/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/chromium-next/PLIST b/chromium-next/PLIST
new file mode 100644
index 0000000000..a7efa77ffe
--- /dev/null
+++ b/chromium-next/PLIST
@@ -0,0 +1,141 @@
+@comment $NetBSD$
+bin/chromedriver
+bin/chromium
+lib/chromium/chrome
+lib/chromium/chrome_100_percent.pak
+lib/chromium/chrome_200_percent.pak
+lib/chromium/headless_command_resources.pak
+lib/chromium/headless_lib_data.pak
+lib/chromium/headless_lib_strings.pak
+lib/chromium/libEGL.so
+lib/chromium/libGLESv2.so
+lib/chromium/libVkICD_mock_icd.so
+${PLIST.swiftshader}lib/chromium/libvk_swiftshader.so
+lib/chromium/libvulkan.so.1
+lib/chromium/locales/af.pak
+lib/chromium/locales/af.pak.info
+lib/chromium/locales/am.pak
+lib/chromium/locales/am.pak.info
+lib/chromium/locales/ar.pak
+lib/chromium/locales/ar.pak.info
+lib/chromium/locales/bg.pak
+lib/chromium/locales/bg.pak.info
+lib/chromium/locales/bn.pak
+lib/chromium/locales/bn.pak.info
+lib/chromium/locales/ca.pak
+lib/chromium/locales/ca.pak.info
+lib/chromium/locales/cs.pak
+lib/chromium/locales/cs.pak.info
+lib/chromium/locales/da.pak
+lib/chromium/locales/da.pak.info
+lib/chromium/locales/de.pak
+lib/chromium/locales/de.pak.info
+lib/chromium/locales/el.pak
+lib/chromium/locales/el.pak.info
+lib/chromium/locales/en-GB.pak
+lib/chromium/locales/en-GB.pak.info
+lib/chromium/locales/en-US.pak
+lib/chromium/locales/en-US.pak.info
+lib/chromium/locales/es-419.pak
+lib/chromium/locales/es-419.pak.info
+lib/chromium/locales/es.pak
+lib/chromium/locales/es.pak.info
+lib/chromium/locales/et.pak
+lib/chromium/locales/et.pak.info
+lib/chromium/locales/fa.pak
+lib/chromium/locales/fa.pak.info
+lib/chromium/locales/fi.pak
+lib/chromium/locales/fi.pak.info
+lib/chromium/locales/fil.pak
+lib/chromium/locales/fil.pak.info
+lib/chromium/locales/fr.pak
+lib/chromium/locales/fr.pak.info
+lib/chromium/locales/gu.pak
+lib/chromium/locales/gu.pak.info
+lib/chromium/locales/he.pak
+lib/chromium/locales/he.pak.info
+lib/chromium/locales/hi.pak
+lib/chromium/locales/hi.pak.info
+lib/chromium/locales/hr.pak
+lib/chromium/locales/hr.pak.info
+lib/chromium/locales/hu.pak
+lib/chromium/locales/hu.pak.info
+lib/chromium/locales/id.pak
+lib/chromium/locales/id.pak.info
+lib/chromium/locales/it.pak
+lib/chromium/locales/it.pak.info
+lib/chromium/locales/ja.pak
+lib/chromium/locales/ja.pak.info
+lib/chromium/locales/kn.pak
+lib/chromium/locales/kn.pak.info
+lib/chromium/locales/ko.pak
+lib/chromium/locales/ko.pak.info
+lib/chromium/locales/lt.pak
+lib/chromium/locales/lt.pak.info
+lib/chromium/locales/lv.pak
+lib/chromium/locales/lv.pak.info
+lib/chromium/locales/ml.pak
+lib/chromium/locales/ml.pak.info
+lib/chromium/locales/mr.pak
+lib/chromium/locales/mr.pak.info
+lib/chromium/locales/ms.pak
+lib/chromium/locales/ms.pak.info
+lib/chromium/locales/nb.pak
+lib/chromium/locales/nb.pak.info
+lib/chromium/locales/nl.pak
+lib/chromium/locales/nl.pak.info
+lib/chromium/locales/pl.pak
+lib/chromium/locales/pl.pak.info
+lib/chromium/locales/pt-BR.pak
+lib/chromium/locales/pt-BR.pak.info
+lib/chromium/locales/pt-PT.pak
+lib/chromium/locales/pt-PT.pak.info
+lib/chromium/locales/ro.pak
+lib/chromium/locales/ro.pak.info
+lib/chromium/locales/ru.pak
+lib/chromium/locales/ru.pak.info
+lib/chromium/locales/sk.pak
+lib/chromium/locales/sk.pak.info
+lib/chromium/locales/sl.pak
+lib/chromium/locales/sl.pak.info
+lib/chromium/locales/sr.pak
+lib/chromium/locales/sr.pak.info
+lib/chromium/locales/sv.pak
+lib/chromium/locales/sv.pak.info
+lib/chromium/locales/sw.pak
+lib/chromium/locales/sw.pak.info
+lib/chromium/locales/ta.pak
+lib/chromium/locales/ta.pak.info
+lib/chromium/locales/te.pak
+lib/chromium/locales/te.pak.info
+lib/chromium/locales/th.pak
+lib/chromium/locales/th.pak.info
+lib/chromium/locales/tr.pak
+lib/chromium/locales/tr.pak.info
+lib/chromium/locales/uk.pak
+lib/chromium/locales/uk.pak.info
+lib/chromium/locales/ur.pak
+lib/chromium/locales/ur.pak.info
+lib/chromium/locales/vi.pak
+lib/chromium/locales/vi.pak.info
+lib/chromium/locales/zh-CN.pak
+lib/chromium/locales/zh-CN.pak.info
+lib/chromium/locales/zh-TW.pak
+lib/chromium/locales/zh-TW.pak.info
+lib/chromium/resources.pak
+lib/chromium/resources/accessibility/reading_mode_gdocs_helper/content.js
+lib/chromium/resources/accessibility/reading_mode_gdocs_helper/gdocs_script.js
+lib/chromium/resources/accessibility/reading_mode_gdocs_helper_manifest.json
+lib/chromium/resources/inspector_overlay/inspector_overlay_resources.grd
+lib/chromium/resources/inspector_overlay/main.js
+lib/chromium/snapshot_blob.bin
+lib/chromium/v8_context_snapshot.bin
+${PLIST.swiftshader}lib/chromium/vk_swiftshader_icd.json
+man/man1/chromium.1
+share/applications/chromium-browser.desktop
+share/icons/hicolor/128x128/apps/chromium.png
+share/icons/hicolor/22_monox22_mono/apps/chromium.png
+share/icons/hicolor/24x24/apps/chromium.png
+share/icons/hicolor/256x256/apps/chromium.png
+share/icons/hicolor/48x48/apps/chromium.png
+share/icons/hicolor/64x64/apps/chromium.png
diff --git a/chromium-next/TODO b/chromium-next/TODO
new file mode 100644
index 0000000000..5946e48353
--- /dev/null
+++ b/chromium-next/TODO
@@ -0,0 +1,19 @@
+To Do:
+
+0) Build on NetBSD-10 amd64, should work on OpenBSD and FreeBSD
+
+1) Audio backends
+ a) NetBSD uses sunaudio (https://github.com/kikadf/chromium-audioio)
+ b) OpenBSD uses sndio
+ c) FreeBSD uses pulseaudio
+
+If pulseaudio not run, chromium can't start it, so no sound:
+VERBOSE1:pulse_util.cc(261)] Failed to connect to the context. Error: Connection refused
+WARNING:audio_manager_linux.cc(53)] Falling back to ALSA for audio output. PulseAudio is not available or could not be initialized.
+
+If pulseaudio already started, chromium can join it, and has sound.
+This is the workaround, see the files/chromium.sh.in launch wrapper.
+
+2) HID doesn't work on NetBSD.
+NOTE: For this OpenBSD uses libudev-openbsd, FreeBSD uses devd.
+
diff --git a/chromium-next/distinfo b/chromium-next/distinfo
new file mode 100644
index 0000000000..d229855e12
--- /dev/null
+++ b/chromium-next/distinfo
@@ -0,0 +1,1407 @@
+$NetBSD$
+
+BLAKE2s (chromium-132.0.6834.83-testdata.tar.xz) = dc3ff7abef9843945bb0e60f9eca2982ec70288a61b5557e580b30647ade8e5c
+SHA512 (chromium-132.0.6834.83-testdata.tar.xz) = 0df2a3a257f2476e90151a56193c0ce5ac7fa473284ab0b75cc3af1f6ed3d39c9679be3972b0bdca491a71d712a9683b464f1bc898d66b8543376b8970fa889a
+Size (chromium-132.0.6834.83-testdata.tar.xz) = 645598356 bytes
+BLAKE2s (chromium-132.0.6834.83.tar.xz) = 20ba149cf092dc5b16cac620cb60424264049feca5ffa10c2c49615fc6ca977b
+SHA512 (chromium-132.0.6834.83.tar.xz) = 1f97f39202d425d364d3cc8ac01a0a27bc06039b3dccb3f040bba78b7331d5af9138400449ecd4762d32ee4722f3ad3c28ff8c1f2f4ed99a4325414e819a9cdc
+Size (chromium-132.0.6834.83.tar.xz) = 6845623836 bytes
+BLAKE2s (kikadf-chromium-audioio-v130.0.tar.gz) = 45fe07cb8280f81b8ef490059002da426b59fe69b5ebd53951fe1dc3e9495a10
+SHA512 (kikadf-chromium-audioio-v130.0.tar.gz) = 840aed119dc69982f14fd5f4767e144bfc8a66672b660f0f05f5459070d7f6a36b8719ae7c0de049f7345dec39266759aedcdd5ee37aa4e98bcd2b44d06a3a4c
+Size (kikadf-chromium-audioio-v130.0.tar.gz) = 7824 bytes
+SHA1 (patch-BUILD.gn) = f87d62ac26cbab2d91888d4849bef708186275a5
+SHA1 (patch-apps_ui_views_app__window__frame__view.cc) = c95fa4e87daedcdefd6990c1b0e9be190d9828af
+SHA1 (patch-ash_display_mirror__window__controller.cc) = 5529a44edfa179fc4bcc7db57a72a8ecabee4448
+SHA1 (patch-base_BUILD.gn) = 80d0a6838cd78b6a4b469749891c47af7a736c83
+SHA1 (patch-base_allocator_dispatcher_tls.h) = ea26f9d548e7a46429ed0e1def584770c18ebc40
+SHA1 (patch-base_allocator_partition__allocator_partition__alloc.gni) = 8b79b25ff8c36f24d3f30708d541db3afbbf7649
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_BUILD.gn) = 5fea34512b1d26749477c9da2b96d9c421e49aad
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_address__space__randomization.h) = 72b77a2240105b8a5ce7012ace70d14e261cbe92
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator.h) = 628af8a5f76bd0d739469597160725a1c84e200e
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h) = 421aa203ecc5c86916de3e4db08c96c172b8bfbc
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.cc) = a01ab3ff9bf511872d9c8d08efee9d3c0d003d2c
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.h) = 04dc3b43757834445d8563be14aa97794e27dd23
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_proc__maps__linux.cc) = e20cf861b57e173bd4662c84d2bd19ec0d9ff62f
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_stack__trace__posix.cc) = ae29496c8c8e9227f3ffe6ab9592a80524432e64
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_rand__util__posix.cc) = 38a0c2df425a7833b50db0dbf9efe54ac17b2375
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread.h) = 497f0c73e2bf5316239369383fb899e244cca2e4
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__internal__posix.h) = e77fa6780460b0b1260b76358fa86719f82b0e7f
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__posix.cc) = 438059745eb878b715b867fa4826d4143771c60e
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__config.h) = 71545e2b9440520da9ad951e060347e0d54e5225
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h) = 823f95064b778f7ae39c3dbf10f0f19094175e73
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__forward.h) = 3b47908811d29ef4a7858f971749d2022a087406
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_partition__root.cc) = 8f9572dcb39ddc3f5ea76c88c2883cd80d180b30
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_spinning__mutex.cc) = 26cd90c78505989767df6d064eccdacabe8cad53
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_stack_stack.cc) = 5864aa1079e23bf30587dba758b98b7ce8b1ab8e
+SHA1 (patch-base_allocator_partition__allocator_src_partition__alloc_thread__isolation_pkey.cc) = 92066d010407499430e926ac0e864d4fe591f2e4
+SHA1 (patch-base_atomicops.h) = fdaffa4a37363224bb06704204e66a9e364e19ea
+SHA1 (patch-base_base__paths__posix.cc) = 360e520d8bf0c3da6204d478fdf52eb9f056b618
+SHA1 (patch-base_compiler__specific.h) = 0a847d148b17476c2f376dd6b2baa7f1ff7bf863
+SHA1 (patch-base_debug_debugger__posix.cc) = f67f056cf7e4942dacaf147804c43a066cc00d7c
+SHA1 (patch-base_debug_elf__reader.cc) = fc947ef0b8b31bb81a167347ce7bbd4fab45c122
+SHA1 (patch-base_debug_proc__maps__linux.cc) = 904a2b74e0e655d59405dc281b121350fa384142
+SHA1 (patch-base_debug_stack__trace.cc) = 87d59482a19ef40d357875e7a43ed57f01bd3bbe
+SHA1 (patch-base_debug_stack__trace__posix.cc) = 14a452865beadb246ecb2bb3511e82dc6104229c
+SHA1 (patch-base_files_dir__reader__linux.h) = 1094bad3f8c8484d276cf0043837341fcfd6c92d
+SHA1 (patch-base_files_dir__reader__posix.h) = 27fe3a25a24d827d4acccf220adba88b1a2ad0e8
+SHA1 (patch-base_files_drive__info.h) = 06fff8eae3d1814c19fefdcc28cf9aaf50471c49
+SHA1 (patch-base_files_drive__info__posix.cc) = e6ecff083cf87157365e16219a67ce5d128f4894
+SHA1 (patch-base_files_file__path__watcher.h) = 386cbfa15365e7ec3e922848edc0954c927ed1a4
+SHA1 (patch-base_files_file__path__watcher__bsd.cc) = fd6b59bf34b2be7838de88b03e392148077438a0
+SHA1 (patch-base_files_file__path__watcher__kqueue.cc) = d8dbb0ce0f9fb56a1a22817f342babbfbefa661d
+SHA1 (patch-base_files_file__path__watcher__kqueue.h) = 8b51669aeb5bb0c63fdc856665da68480a967674
+SHA1 (patch-base_files_file__path__watcher__unittest.cc) = 41d6cd41b1184a14787d6fc27d9ee7d1d305127f
+SHA1 (patch-base_files_file__util__posix.cc) = dbedac0d65584263332079c6a4bf67eb5d7c8bb1
+SHA1 (patch-base_files_file__util__unittest.cc) = 92a986fabdf765f2c892b3294cd4171eaae843d4
+SHA1 (patch-base_files_important__file__writer__cleaner.cc) = e476997de172919556beda968759f88b7d633de3
+SHA1 (patch-base_files_scoped__file.cc) = 35f07e02c4db8c3704f3c8040a6b09dc7a24b1d1
+SHA1 (patch-base_functional_unretained__traits.h) = 1757a513e4e580d53f0251169aa72acd1becb47f
+SHA1 (patch-base_i18n_icu__util.cc) = e17ff21e49696bfda8b192d6e61c6ad6f942d3c5
+SHA1 (patch-base_linux__util.cc) = 79ec24d4dcd45884a1a7cb5370c05b3db3aaeb25
+SHA1 (patch-base_logging__unittest.cc) = 9671c192934b504aed53010de21cd47ebfcbb69e
+SHA1 (patch-base_memory_discardable__memory.cc) = 96fc917c8d2af9387345279714de44ef2c32b5e2
+SHA1 (patch-base_memory_discardable__memory__internal.h) = 50bede74d8ade980b587150d0dc9d2298411ab23
+SHA1 (patch-base_memory_madv__free__discardable__memory__posix.cc) = 660c0f09b0eeb74742a4bff6d5a2caf71d806a62
+SHA1 (patch-base_memory_platform__shared__memory__region.h) = f75157b93c71763eb5d8f12dcb2e1e1c0df71718
+SHA1 (patch-base_memory_platform__shared__memory__region__posix.cc) = a4787818f085e6fb3f8d776d357750e680a33f1d
+SHA1 (patch-base_memory_protected__memory.h) = b0ed21833ddf1c6be0506b981ea8edf00e20f0d3
+SHA1 (patch-base_memory_protected__memory__posix.cc) = 20f30102c111e7a8ca649b984e55edc0e93ac017
+SHA1 (patch-base_message__loop_message__pump__epoll.cc) = c1235542686b4b0dcd117a70d3cfdecb873444c9
+SHA1 (patch-base_message__loop_message__pump__epoll.h) = 5ff212b1d2513eb14ff759f7a8efe72f4fffaa57
+SHA1 (patch-base_message__loop_message__pump__glib.cc) = 42430e26900cee0c56e592a62e879e4c10d5e835
+SHA1 (patch-base_native__library__posix.cc) = 0f4bed85dbd77291476b76308661841fa773a87c
+SHA1 (patch-base_native__library__unittest.cc) = a8454b3e3182a38a4b98652a9cbf12c77ac0584b
+SHA1 (patch-base_posix_can__lower__nice__to.cc) = 79e508c6fd32c0ff7e4ef3898810656f8a50f5cb
+SHA1 (patch-base_posix_file__descriptor__shuffle.h) = f68bc384200d833c1429a16aec0df56dd9b81674
+SHA1 (patch-base_posix_sysctl.cc) = 84e4dc2ecbbfc55f4a80f74bee2d0a2bf54a7ce4
+SHA1 (patch-base_posix_unix__domain__socket.cc) = 4d8d55949015dcaad91976ea6f3442470ea026fa
+SHA1 (patch-base_posix_unix__domain__socket__unittest.cc) = 6a3c9052f82a0640374a9c3bc3042fb869e41db2
+SHA1 (patch-base_process_internal__linux.h) = 874445cdc48e7e7bc1352309b230dd5e19e61456
+SHA1 (patch-base_process_kill.h) = ea836ab59a5916da0e5149fab5044a1adf842c37
+SHA1 (patch-base_process_kill__posix.cc) = 56e1c41ef7ab64b9929d9262fc53433372b033fd
+SHA1 (patch-base_process_launch.h) = 7a67df4f3af7d2fb68badf22614cac75083489fe
+SHA1 (patch-base_process_launch__posix.cc) = 3ac41b73e88da7363efda0af4207f063edcc1e29
+SHA1 (patch-base_process_memory__linux.cc) = b80d86a70793fe62403f4e788002f204d584cd01
+SHA1 (patch-base_process_process__handle.cc) = ed46333bff0dc620a4ce3181f5a287b03120bb0c
+SHA1 (patch-base_process_process__handle.h) = fd93403163b4ac4b45f9c266e75981a012cc3129
+SHA1 (patch-base_process_process__handle__freebsd.cc) = 21a4d80a1766040a6adbddf504c22103e36e5afb
+SHA1 (patch-base_process_process__handle__netbsd.cc) = 53259a1c02d9bccb78c25f3dfef87a6acc947fea
+SHA1 (patch-base_process_process__handle__openbsd.cc) = d6caec30beb1d10bb1ef3d05d745416394eb394f
+SHA1 (patch-base_process_process__iterator.h) = fe2802ee52ab76b80fd0062076b8dcdaef08c73f
+SHA1 (patch-base_process_process__iterator__freebsd.cc) = 0b6128fd766eb002a9d98942f4c99c01620e8ace
+SHA1 (patch-base_process_process__iterator__netbsd.cc) = 5b7ebe5c1c9b0c27b7d6c4aad8a00f9faeb8d256
+SHA1 (patch-base_process_process__iterator__openbsd.cc) = 92cd15c2b4bde9339b7818ea97dc6b8db2817b78
+SHA1 (patch-base_process_process__metrics.cc) = 47f5ff5d4158df0171a2fe2f441357be690fb61f
+SHA1 (patch-base_process_process__metrics.h) = 532097529d9fb963ffe78872db42b36475ba862f
+SHA1 (patch-base_process_process__metrics__freebsd.cc) = 9ae54509a361d02806b24ae4c5a5945db982cf50
+SHA1 (patch-base_process_process__metrics__netbsd.cc) = d8ab24e29cb81b00f01e80adc0365f38572f2487
+SHA1 (patch-base_process_process__metrics__openbsd.cc) = e5b01c6966c96026ebdbda6ef6b25159396f8681
+SHA1 (patch-base_process_process__metrics__posix.cc) = 79be8ac2aca04179ed2e61b558d919a93d9f0761
+SHA1 (patch-base_process_process__metrics__unittest.cc) = 8550d8ddd1934ffed74d1b755938a528de3cf90e
+SHA1 (patch-base_process_process__posix.cc) = fcc06cb44f5d72b26ca3edf5e0d00dbd3fca183f
+SHA1 (patch-base_process_process__unittest.cc) = 74be7188be80d9f0f8443ec580df8c79e006849d
+SHA1 (patch-base_profiler_module__cache.cc) = 0eec1aabb274f24f0bbe930888e825b6d984857a
+SHA1 (patch-base_profiler_sampling__profiler__thread__token.cc) = 2fd48068aa3d8dcf0edb0a58a272bdbcdfa6773f
+SHA1 (patch-base_profiler_sampling__profiler__thread__token.h) = 2128f26e339652332d20125e95973ea6ac434576
+SHA1 (patch-base_profiler_stack__base__address__posix.cc) = ffbd0e555941137d71309b35c9991107dacd69a0
+SHA1 (patch-base_profiler_stack__sampling__profiler__test__util.cc) = cf6aff71a00294bae1e95dc8ebc8c2c74ea4dba3
+SHA1 (patch-base_profiler_stack__sampling__profiler__unittest.cc) = 8860c8be462871e95c6a131f422e64c93110f12b
+SHA1 (patch-base_profiler_thread__delegate__posix.cc) = 70eaf3077498e653949963ad02c0eb1f8c455c89
+SHA1 (patch-base_rand__util.h) = 1d2925347194bcb4073da112e3ac98dec5bbec8e
+SHA1 (patch-base_rand__util__posix.cc) = fe330a0cac4e39ff358a2a6c4c97d6d28ceb798d
+SHA1 (patch-base_strings_safe__sprintf__unittest.cc) = b1ec6ae61c0e0c23f519da9278eb9a7eca30e6d8
+SHA1 (patch-base_synchronization_lock__impl.h) = f9daf65dc6386fe534dc90f1fca0177d468a636b
+SHA1 (patch-base_syslog__logging.cc) = b7878cfb4c53a56fa547b0143a5a6944ba274f05
+SHA1 (patch-base_system_sys__info.cc) = e0d2a14ff948e93db08fc98a536deded5635a740
+SHA1 (patch-base_system_sys__info.h) = 82756f011e9c5e34d7fa3a3aa017d21ac9a76bbb
+SHA1 (patch-base_system_sys__info__freebsd.cc) = 02ab1f41420530a182783ffe0d72747395e84d11
+SHA1 (patch-base_system_sys__info__netbsd.cc) = 1aeeb14be453ac85f8bceca1b21553a7fc3c4c44
+SHA1 (patch-base_system_sys__info__openbsd.cc) = 3aef7ca0a54aa3809e81296418f1fb4a95085904
+SHA1 (patch-base_system_sys__info__posix.cc) = acea245e93cf325259be6e8cff8c93ba31b55fb9
+SHA1 (patch-base_system_sys__info__unittest.cc) = 95d3942b49f6cf0fe53a1e05fec5a61bd614ca60
+SHA1 (patch-base_task_thread__pool_environment__config__unittest.cc) = 0b037775991c64db8b5955d5d32a425191328fa5
+SHA1 (patch-base_test_launcher_test__launcher.cc) = 9d4154669c433be194a61ad06a450f19a923f5f4
+SHA1 (patch-base_test_test__file__util__linux.cc) = b394e354bcbad0b6388d35ae216745ec66d925d7
+SHA1 (patch-base_test_test__file__util__posix.cc) = e9e26307450547505c3cd8b849b9a521aabd44b8
+SHA1 (patch-base_threading_platform__thread.h) = 3c547bdc89e1ba94aec5a8b69daba35a2503ecf6
+SHA1 (patch-base_threading_platform__thread__bsd.cc) = ba75c632e4f324ad2a89b083a12dc9f4ad09e888
+SHA1 (patch-base_threading_platform__thread__internal__posix.cc) = 1e0e5ae1144cc2446c7d550d184385d97f9cf695
+SHA1 (patch-base_threading_platform__thread__posix.cc) = 26c8bc91a8ebdd221c1acc86ca9be224545bfa0f
+SHA1 (patch-base_threading_platform__thread__unittest.cc) = 98f364868a47e2e6d1a01a0c6fa45d8081943a9d
+SHA1 (patch-base_time_time__now__posix.cc) = 53b8e27ffecf41dd6e4275a028a4d9217bb1fbe5
+SHA1 (patch-base_trace__event_malloc__dump__provider.cc) = ea9452641b4cd3ca08a6947c67536eca935d7c66
+SHA1 (patch-base_trace__event_memory__dump__manager.cc) = 5bce60052344032ad390e5929064e3d4e913b4c5
+SHA1 (patch-base_trace__event_process__memory__dump.cc) = d1ea7509fc8a9039bc50e8bd90fbf483b64810d5
+SHA1 (patch-base_tracing_trace__time.cc) = b2fb13231130202de8a1bf9358c28b92e058a593
+SHA1 (patch-base_tracing_trace__time.h) = b3d74e4f79ac6d536bfb070244a4574b1eb48790
+SHA1 (patch-base_version__info_version__info.h) = 44491088043f842b58809372b8502a7fbecd38af
+SHA1 (patch-build_config_BUILD.gn) = 60019ade96473ee08c24b6cec802fe744128aa38
+SHA1 (patch-build_config_BUILDCONFIG.gn) = cc13622a1e65f38d9d841a7a4a023b3de36c2acc
+SHA1 (patch-build_config_clang_BUILD.gn) = 17427ada928154c6c58ef3f6e360db232ce997ab
+SHA1 (patch-build_config_compiler_BUILD.gn) = dc1a8eaddc4926b9bacf4289fb03781729550bfa
+SHA1 (patch-build_config_gcc_BUILD.gn) = 96f929db79befb364981d57343c9f9e13e1a4a08
+SHA1 (patch-build_config_linux_BUILD.gn) = 6e385ea39aaa3a53142f3f2421acc978d0aaf347
+SHA1 (patch-build_config_linux_libdrm_BUILD.gn) = a7d93841f73354231a25b4ebe1c7abe4502b8e0d
+SHA1 (patch-build_config_linux_pkg-config.py) = 2b50e84eb8e6dc73e5e3f221f898417e3607ee0a
+SHA1 (patch-build_config_ozone.gni) = d2392bc2237ea9fd6da0c5ac102239fd7f091fff
+SHA1 (patch-build_config_rust.gni) = 6de339faffdac1f902f3ba024910a6f265a9e596
+SHA1 (patch-build_config_v8__target__cpu.gni) = 554c68a3991d4369d94e1343b59afc623a07f56b
+SHA1 (patch-build_detect__host__arch.py) = 427f9c6857afc2f8fd0cd6f056335035ae88c6a7
+SHA1 (patch-build_gn__run__binary.py) = 93667d32f4b6d28133274e4910bf67d877eccfa5
+SHA1 (patch-build_linux_chrome.map) = 13bc669ab65aaa98e512c1ed248b8b0a3a9ae799
+SHA1 (patch-build_linux_strip__binary.py) = be1a354c7db96cf75c62555d85005c5efc4a88e7
+SHA1 (patch-build_linux_unbundle_icu.gn) = 686fad55d28428d1133f7acdf8b98ec1c3449b17
+SHA1 (patch-build_linux_unbundle_libevent.gn) = 0df762faadee64dfbcbdc97be43e5c771a024288
+SHA1 (patch-build_linux_unbundle_libusb.gn) = 18cc19e10d13b195cacfb61f80fbcf9156450c21
+SHA1 (patch-build_rust_rust__bindgen.gni) = 651b06d6484d89b38edaa027d8ae3130daf42d5d
+SHA1 (patch-build_rust_rust__bindgen__generator.gni) = 7a95a7d2ef04c1223b758a96fa6a4706a3795a5b
+SHA1 (patch-build_rust_std_BUILD.gn) = 439ef768ea7946a81bd90bd9c3c97839849e997b
+SHA1 (patch-build_toolchain_freebsd_BUILD.gn) = ccc8e95c83f26f8cd7a0f3d844438b6cf5d220f8
+SHA1 (patch-build_toolchain_gcc__solink__wrapper.py) = dd795e849e9518bd0af5add12d98ccf45f6c538f
+SHA1 (patch-build_toolchain_gcc__toolchain.gni) = bbf62d123ebf8176226f067019ebc50d5b0b1619
+SHA1 (patch-build_toolchain_netbsd_BUILD.gn) = 2ea3757590c8796399a7e63468d8b4745d46ccae
+SHA1 (patch-build_toolchain_openbsd_BUILD.gn) = 0045338e6a73d996dfd868da249b1784bf26b4b7
+SHA1 (patch-build_toolchain_toolchain.gni) = 27983c082fd0cce78e066177f6f8178b62f050de
+SHA1 (patch-cc_base_features.cc) = e3aa4df226d3e5696dabfae20dbe01892b9dafc3
+SHA1 (patch-chrome_app_chrome__command__ids.h) = d45f1e1a1bfae126f22937a105d3ff951f519f7f
+SHA1 (patch-chrome_app_chrome__main.cc) = 338495657b776225f289a99aba42eb6af1f90967
+SHA1 (patch-chrome_app_chrome__main__delegate.cc) = bbf4c6afd7ac0d70fa2c189fae4bf7a2a8afe572
+SHA1 (patch-chrome_browser_BUILD.gn) = e3fe70a35a86a8039ae20f63cf7d9dfa3ea5761d
+SHA1 (patch-chrome_browser_about__flags.cc) = 6cd6b2bb263368f6cb7bf37badfd4953f410a3bc
+SHA1 (patch-chrome_browser_accessibility_page__colors.cc) = 475a7cf6ac90fe2e08918546bc26485e3ed4ab1e
+SHA1 (patch-chrome_browser_after__startup__task__utils.cc) = de8775ad2e759ae5fab8407f3871a6a2c5d6c287
+SHA1 (patch-chrome_browser_apps_app__service_publishers_extension__apps.cc) = 0b7c1e9ed499dbbb100e3bb2fdd89aa7dd488146
+SHA1 (patch-chrome_browser_apps_platform__apps_platform__app__launch.cc) = 1dd997e825c837bebd3da1773e51cf21c25b7e0c
+SHA1 (patch-chrome_browser_apps_platform__apps_platform__app__launch.h) = 929d48ca0d94d969ad5f6eabe7ba398f8e089b0d
+SHA1 (patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc) = ac15e639eb8a255e5d30fb7d73fadee1d9bd9e81
+SHA1 (patch-chrome_browser_background_background__mode__manager.cc) = 14aa52f83984fd40e69fe5ce06910c7e8eeed40b
+SHA1 (patch-chrome_browser_background_background__mode__optimizer.cc) = 653666fab2fb861d21aa09c977d677408275a911
+SHA1 (patch-chrome_browser_browser__features.cc) = 564f91a04d051129f2521450792907955d2bd064
+SHA1 (patch-chrome_browser_browser__features.h) = 8b6f249b08e0d8c96186f79f9dfb3383007fd275
+SHA1 (patch-chrome_browser_browser__process__impl.cc) = d01cf9190ac4079d64aef9f6b8b06d29435cf337
+SHA1 (patch-chrome_browser_browser__process__impl.h) = cf84967aa396a0dcbabb88fe1ee94019495070e2
+SHA1 (patch-chrome_browser_chrome__browser__field__trials.cc) = f52f0d6b07557d01c47ab9f5d68b56b1a5641d46
+SHA1 (patch-chrome_browser_chrome__browser__field__trials.h) = 77131a93b76bac85408d91795080e9a005dfcf22
+SHA1 (patch-chrome_browser_chrome__browser__interface__binders.cc) = aa8b9643e85411c741f7adc639a3edcc7a413690
+SHA1 (patch-chrome_browser_chrome__browser__main.cc) = 2f48218aa13e3ea0e40ec67f4df70880628b178a
+SHA1 (patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc) = dee3cbca0b07dbffd3123b16faab426cd77df3f7
+SHA1 (patch-chrome_browser_chrome__browser__main__extra__parts__ozone.cc) = b94e47144af1c4fc111556d91136cf7920c32053
+SHA1 (patch-chrome_browser_chrome__browser__main__linux.cc) = 5660bcc55a585bbcc63e6e7305845d787fbead65
+SHA1 (patch-chrome_browser_chrome__browser__main__linux.h) = 707d5f2d4ca8925231dfb8792b5199762ec44801
+SHA1 (patch-chrome_browser_chrome__browser__main__posix.cc) = e1ccc3ea10fad1510af4c41fa88fbed86ceae0f7
+SHA1 (patch-chrome_browser_chrome__content__browser__client.cc) = b65b5600c30aa67c78d1412e9583bd7ca35c1c82
+SHA1 (patch-chrome_browser_chrome__content__browser__client.h) = 34b87819d4c50c6c43d8f4c743b3b9a6e7da172a
+SHA1 (patch-chrome_browser_component__updater_widevine__cdm__component__installer.cc) = 64ed3dd51f4dd55681ea7bc5e6c1eece7a18e853
+SHA1 (patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc) = 4d8152f1f8ddb7f41cb3bd9c73a45fb6e06941b3
+SHA1 (patch-chrome_browser_defaults.cc) = 108745bf7f80cc2d0daa762a412ecc6824c8e5ad
+SHA1 (patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc) = ddbd1bd2ada4f3c4b0e85281c68ca432966dd720
+SHA1 (patch-chrome_browser_diagnostics_diagnostics__writer.h) = 4fd417242bd2f09e18b811b749f75296a0512f91
+SHA1 (patch-chrome_browser_download_chrome__download__manager__delegate.cc) = b62b36081e84bef1be9ca878e671c5a1f2d97b8e
+SHA1 (patch-chrome_browser_download_download__commands.cc) = 6a064b14f8e0ce738be55631a9094f29665cbee0
+SHA1 (patch-chrome_browser_download_download__commands.h) = 805e2ffe6f6489cf1a50d380c859ac1bde0ffce2
+SHA1 (patch-chrome_browser_download_download__file__picker.cc) = fb23fba98a7b4c52ae14da5c003a0e8c37dd46b1
+SHA1 (patch-chrome_browser_download_download__item__model.cc) = de91ccd72d83b9f58b17c424034eb66a6644d1e9
+SHA1 (patch-chrome_browser_download_download__prefs.cc) = 3f00069cc978e6706ed812e8f5cc3c3419990eec
+SHA1 (patch-chrome_browser_download_download__prefs.h) = c3365db42545be61fa5fef1b27e53d2476e882b7
+SHA1 (patch-chrome_browser_enterprise_connectors_analysis_analysis__service__settings.cc) = 6de08e0cde0c2fc914c859181e6ec7b738ded380
+SHA1 (patch-chrome_browser_enterprise_connectors_common.cc) = bca4f0232437d8c53de8161e0ab31ef5afb56e24
+SHA1 (patch-chrome_browser_enterprise_connectors_connectors__service.cc) = 7c1034448eae019f7c57b66564d0ee34f485706d
+SHA1 (patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc) = f697aa25dfdf2fcb874b194cf3d543cabab4fa11
+SHA1 (patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc) = 9571f5ff8404cb49000748764162ed8f4cb5fae0
+SHA1 (patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc) = 084dd22cec84c65051fb8df96b07dca21781a84c
+SHA1 (patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc) = 166a3847623363be6915a4def0a1c082dd096015
+SHA1 (patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc) = 6261d8d66c25447683df6da0ec3d8a7beefb6be4
+SHA1 (patch-chrome_browser_enterprise_connectors_reporting_browser__crash__event__router.cc) = 187fd6976ec4ff06847c7deb814808f124974ec4
+SHA1 (patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.cc) = 11579823874bd8216b4b5a08fa9a5485618c6802
+SHA1 (patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.cc) = 79186c4bbdfeced4c5208a3c97caad110b308f65
+SHA1 (patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.h) = 455c394cbd76f092a8d23fde8379e52dd618c1a3
+SHA1 (patch-chrome_browser_enterprise_identifiers_profile__id__delegate__impl.cc) = c3188985aecd87015d4e41109a6c2145d587ad9a
+SHA1 (patch-chrome_browser_enterprise_profile__management_profile__management__navigation__throttle.cc) = 765f39bfdb38954e681c5541d2002d8c77293879
+SHA1 (patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc) = 39f40e619c891b1c9bd8fef5c0816fd53757d780
+SHA1 (patch-chrome_browser_enterprise_signals_device__info__fetcher.cc) = c6f4dff91784dc5d971ca5c03b896fa7700dff72
+SHA1 (patch-chrome_browser_enterprise_signals_device__info__fetcher__linux.cc) = fb1986435a75acce127ee3f249031b9adea53ee5
+SHA1 (patch-chrome_browser_enterprise_signin_enterprise__signin__service.h) = 3f63349f633de21d2f14178a05e040c3305d7ceb
+SHA1 (patch-chrome_browser_enterprise_signin_interstitials_managed__profile__required__page.cc) = fa143fc6c87527f78d0092226f6f1145143fd202
+SHA1 (patch-chrome_browser_extensions_BUILD.gn) = b4b9f547d619cb599d24bc7c68598cf0fa381e8a
+SHA1 (patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc) = 1a9835f4911b4f40ab24652ee3cffa574e585f3a
+SHA1 (patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc) = 1ef738d5f787b69457acd9217fb65240c28ae5db
+SHA1 (patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.cc) = 45541582fb78f96680404edf9b6d0e999066313d
+SHA1 (patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.h) = fa62326cadc20ac6f95b80a1ee6b70d9d8a7e163
+SHA1 (patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc) = c1eb3af690b14f0b8d04b5667b4dc474fda0d599
+SHA1 (patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h) = db2a44336f4505c8a9462273b121acbbc9903535
+SHA1 (patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc) = 0c3c9f38e60f35c9bb719b74f6f0c723320852ff
+SHA1 (patch-chrome_browser_extensions_api_management_chrome__management__api__delegate.cc) = e58a0518668f04224017b0039e062a18684617da
+SHA1 (patch-chrome_browser_extensions_api_messaging_launch__context__posix.cc) = aa958ffba3b1a36d706f50aed7c6b2937aa84005
+SHA1 (patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc) = bbb00dd39897b24e4eba8b5268afb5587026af91
+SHA1 (patch-chrome_browser_extensions_api_runtime_chrome__runtime__api__delegate.cc) = 3ad3588050aa5208ad09c756d65cd8d95bfd8c2d
+SHA1 (patch-chrome_browser_extensions_api_settings__private_prefs__util.cc) = f38ca981b0c24e08eafaed9e2e98271f07e24822
+SHA1 (patch-chrome_browser_extensions_api_tabs_tabs__api.cc) = 685b64469d7d6012fdf6cac7e765f5179d8684ce
+SHA1 (patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc) = 5904a0e65910a1fca751a3812728f0e2ebe03849
+SHA1 (patch-chrome_browser_extensions_api_webstore__private_webstore__private__api.cc) = f8d88109013bb0e7553145f0cefbd4e9fa786aa7
+SHA1 (patch-chrome_browser_extensions_external__provider__impl.cc) = 3f77446112640b73af9b888406c210d97ed2a4d2
+SHA1 (patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc) = 4afd38c55fa629d225521957fe5de8437d912004
+SHA1 (patch-chrome_browser_first__run_first__run__dialog.h) = e599a5a44a42070f55e556311439e9d8ac94d858
+SHA1 (patch-chrome_browser_first__run_first__run__internal.h) = 2deb5c2698f70a5f128476e29f5b42bafe3cc112
+SHA1 (patch-chrome_browser_flag__descriptions.cc) = 270cb1e3697055696ef1aa987ca2c43082db81ec
+SHA1 (patch-chrome_browser_flag__descriptions.h) = d0686a8108c8033d72769091c4af01e52a76852d
+SHA1 (patch-chrome_browser_gcm_gcm__profile__service__factory.cc) = 5469e5d4133695fd01f9c41d0fb346d7a39fd411
+SHA1 (patch-chrome_browser_gcm_instance__id_instance__id__profile__service__factory.cc) = 8b775b8b46a296262ad91f4cedf1a64837d7e97e
+SHA1 (patch-chrome_browser_global__features.cc) = 354f674473276a0d77390bb847130b5f345cf4c0
+SHA1 (patch-chrome_browser_global__features.h) = 9ffdc5395a5f873c8a779d7831eac3d20df7016c
+SHA1 (patch-chrome_browser_headless_headless__mode__util.cc) = b7ef13cd67b860d4aa87280ecc49f4d0fe5ff3a6
+SHA1 (patch-chrome_browser_intranet__redirect__detector.h) = 74368e301886c269a6384f1849b216fd83285eac
+SHA1 (patch-chrome_browser_media__galleries_fileapi_mtp__device__map__service.cc) = 8e0ed95e95333849dee5cbd6cd505367253c0ef9
+SHA1 (patch-chrome_browser_media__galleries_media__file__system__registry.cc) = d5216346534386876b4031e124988ed550c58dd7
+SHA1 (patch-chrome_browser_media_audio__service__util.cc) = b7db1187ea879780e7feb75f72fd385d9d767e86
+SHA1 (patch-chrome_browser_media_router_discovery_BUILD.gn) = 7f4f96aa5d50c509b1ffebba1e7709a197fc4ac0
+SHA1 (patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc) = 9b79217b14bf0b6cc598693a3aa2d9e878aade8f
+SHA1 (patch-chrome_browser_media_router_discovery_discovery__network__list__wifi__linux.cc) = 221817e04904e0383fbad9b8f8ec433e7dd2e7f4
+SHA1 (patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc) = f9d0f6375919a66d5dc20560438aac20a1ef6d1a
+SHA1 (patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h) = 3cefcbb82a89e613c12fd27d22a6984737615d6f
+SHA1 (patch-chrome_browser_media_webrtc_desktop__media__picker__controller.cc) = 7c72fac9a63f0c9a4e42fd1fc60b916c8b0b94c9
+SHA1 (patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc) = 7ffbdd90b038a756858bb872e0bccda7ff7ebd90
+SHA1 (patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc) = 0e6101f38f40eac003b6333237e7944840a90bcf
+SHA1 (patch-chrome_browser_media_webrtc_webrtc__logging__controller.h) = 1845d5eeff89fdb860807f248ac664173c65d863
+SHA1 (patch-chrome_browser_memory__details.cc) = 1a19b09b7fe0ea11dd7b363f17438488f47cf33f
+SHA1 (patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc) = eee34c7c8334033f310b164b78bc04d3b99fd56e
+SHA1 (patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h) = c12cadf337e9c02028af60502569526ce15efc6e
+SHA1 (patch-chrome_browser_metrics_chrome__metrics__service__client.cc) = c94ac6628dd3e0bfee779fe935c433d3c340fb06
+SHA1 (patch-chrome_browser_metrics_perf_cpu__identity.cc) = 98314b5d3e41af336eb0795c852010a78adb1535
+SHA1 (patch-chrome_browser_metrics_power_process__metrics__recorder__util.cc) = 2a5ef2ff399de9dc6ff16c5df4a4bf500a752b69
+SHA1 (patch-chrome_browser_metrics_power_process__monitor.cc) = b427607720f41334dff40bf6612a71428519ac81
+SHA1 (patch-chrome_browser_metrics_power_process__monitor.h) = 48894e58c916ef88192ae46dbb50d6c194b82ae3
+SHA1 (patch-chrome_browser_net_profile__network__context__service.cc) = 7224bab63bf91566ca7c78dafb5057bd00dd9294
+SHA1 (patch-chrome_browser_net_system__network__context__manager.cc) = 8f0e4c25d00494a4462ccb0384dbcca016964ae5
+SHA1 (patch-chrome_browser_net_system__network__context__manager.h) = 499b6b66504a0cf296ed929b0a8bfd811c1887bc
+SHA1 (patch-chrome_browser_new__tab__page_modules_file__suggestion_drive__service.cc) = cbc2592ab741b9ccc10024cf9de486be5c20f6c9
+SHA1 (patch-chrome_browser_new__tab__page_new__tab__page__util.cc) = ba196ebb0b07de4966cf3e3ebfc7247af28cff60
+SHA1 (patch-chrome_browser_notifications_notification__display__service__impl.cc) = e0e53ed92e5f44dee05d355ab3de829f8a2942fd
+SHA1 (patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc) = d78f903d2bbb10720804be3b588714582319e2da
+SHA1 (patch-chrome_browser_password__manager_chrome__password__manager__client.cc) = a448fd2214a751ffd13cebdc55597c6385e9ee7d
+SHA1 (patch-chrome_browser_password__manager_password__reuse__manager__factory.cc) = 4f52407d482dcb7104affc63cfb2782c69c35397
+SHA1 (patch-chrome_browser_platform__util__linux.cc) = f25087a45d3f06455791a8129614b52aaef3fc66
+SHA1 (patch-chrome_browser_policy_browser__signin__policy__handler.cc) = 29f195b4664429b7003e906b6eacba4dc72c6705
+SHA1 (patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc) = f42cd06c78f4abff4231414decfc2d8e40df4b8c
+SHA1 (patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc) = aa885a3e95796de2f7ac8e8df492b5ab55669878
+SHA1 (patch-chrome_browser_policy_device__management__service__configuration.cc) = 5cd83c3d598f6687c5fa7708d9bb5c29a6577dc2
+SHA1 (patch-chrome_browser_policy_policy__value__and__status__aggregator.cc) = a5d109d2419a06901d06047cf50aeca4fdf0f7ec
+SHA1 (patch-chrome_browser_prefs_browser__prefs.cc) = ff8253c0881430a7f43c62c30f325aab8a86d8c3
+SHA1 (patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc) = f5c520720a3134901151cc2099a31125e59f7206
+SHA1 (patch-chrome_browser_printing_print__backend__service__manager.cc) = 1d303815a1296c12039febc4a5c852ee06c904d4
+SHA1 (patch-chrome_browser_printing_printer__query.cc) = d5737a86969e155ec56903c49b7682d9b156a7fc
+SHA1 (patch-chrome_browser_process__singleton__posix.cc) = 9d8e7cd54829b483c0ad734793d98fb51d068a3f
+SHA1 (patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc) = 6161a9fe5d6c290ea3d4ec53653d26646893c3b8
+SHA1 (patch-chrome_browser_profiles_profile__impl.cc) = 066c2d181bf2d48252f147615756572d84eb6216
+SHA1 (patch-chrome_browser_profiles_profiles__state.cc) = a452dca7113859b3defbdd69df7c2ab8071d13cc
+SHA1 (patch-chrome_browser_renderer__preferences__util.cc) = b76facb2f222ab77da95fe1a2ebc8cc25a06e550
+SHA1 (patch-chrome_browser_resources_settings_autofill__page_passwords__shared.css) = fa4bf7c99e1f36ccef9f5fcff0746d751f95ee3d
+SHA1 (patch-chrome_browser_resources_signin_signin__shared.css) = 81306fec1b8b96d256b08d824c20d4a9440b9813
+SHA1 (patch-chrome_browser_safe__browsing_chrome__password__protection__service.cc) = cef3a88d8df7ff9bc35a9d8aa476c526045faa6a
+SHA1 (patch-chrome_browser_safe__browsing_cloud__content__scanning_binary__upload__service.cc) = be51fee71417549b7e1a438a1d857ba532be2fc0
+SHA1 (patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc) = a852278dc058e3061258d2bc80995dea6a84c5ae
+SHA1 (patch-chrome_browser_safe__browsing_safe__browsing__service.cc) = 66290f23efda60ed36a6d42f485248653a4cb4f9
+SHA1 (patch-chrome_browser_screen__ai_screen__ai__install__state.cc) = 42c95743a256c9db2e21a8f88512a3132d27b4bc
+SHA1 (patch-chrome_browser_screen__ai_screen__ai__service__router.cc) = 5be69714c09aca851ca0addec9214da7137bd805
+SHA1 (patch-chrome_browser_send__tab__to__self_receiving__ui__handler__registry.cc) = c0d52e91e6f61b85b028411af95744de405adc2d
+SHA1 (patch-chrome_browser_send__tab__to__self_send__tab__to__self__client__service.cc) = bfa5b90c9491f6651913fed324af79f66f2e67b2
+SHA1 (patch-chrome_browser_sessions_session__restore.cc) = bb6adee9b922cfaecd86edf9b4a356c882293e9b
+SHA1 (patch-chrome_browser_sharing_sharing__handler__registry__impl.cc) = 2b4a205fa38e60ce8a42bbda5e776ddba4926d3c
+SHA1 (patch-chrome_browser_shortcuts_icon__badging.cc) = 705a89b77aaadb17ece24998bd9a573efe7ae48a
+SHA1 (patch-chrome_browser_signin_accounts__policy__manager.cc) = 5855248e87d718d720269591d5a44d44011252db
+SHA1 (patch-chrome_browser_signin_accounts__policy__manager.h) = b3c67b6a1558c9fb82d8c4fa3a3c6e95366226e9
+SHA1 (patch-chrome_browser_signin_signin__util.cc) = 152f421e245216e0a01fdedf4c4bc7c08c49322f
+SHA1 (patch-chrome_browser_supervised__user_classify__url__navigation__throttle.cc) = 2c3859109fcb59ee1d95f08bd484e09ca7da498d
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__browser__utils.cc) = f1070d1ea3adb4827cf00ef9d9656a7b0b7ee53e
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__browser__utils.h) = 0008b247782c9ce960628b6439242f673323fccc
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__extensions__delegate__impl.cc) = a3a862926178176a6d1345e8540248c4c9ddbd59
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__extensions__manager.cc) = d60ab729f0fec21932657e46e5a4a3fd6b3b9def
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__extensions__manager.h) = d774e372cfcefc12ad8b2db66cc9b9df8138411f
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__google__auth__navigation__throttle.cc) = dde6ac80f7f5acf9568ebbbbfd14e4ec72096c1e
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__metrics__service__factory.cc) = ad50f731617da7b4c3fc9c8947a5b4e0660c06c9
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__navigation__observer.cc) = 0d22d260af8ab40424d48adf5543bbfd43a9ac0e
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.cc) = d4711b7f489dc441c0177c70162f7bb8dad52e50
+SHA1 (patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.h) = f55f548254c98bd704ddd0012b4d6f1d98dd2e76
+SHA1 (patch-chrome_browser_sync_chrome__sync__controller__builder.cc) = 8ae709216094ddb6e2a120c1476864b1d9fe6498
+SHA1 (patch-chrome_browser_sync_device__info__sync__client__impl.cc) = 995ccff4ecb09d3d229aa2986d2a54757150cee8
+SHA1 (patch-chrome_browser_sync_sync__service__factory.cc) = c39d13efb6917b17eaba1de34cbd90162f9ca2cc
+SHA1 (patch-chrome_browser_tab__group__sync_tab__group__sync__service__factory.cc) = 1c7ccbaaa6e26eed44d414176bbec40c0cfcd8bf
+SHA1 (patch-chrome_browser_task__manager_sampling_task__group.cc) = 7cf81f74eb868f9c611b1c471ff68fe228bcc600
+SHA1 (patch-chrome_browser_task__manager_sampling_task__group.h) = d4e3e10983d2fde01d2ad1d82abefa3e222e26a4
+SHA1 (patch-chrome_browser_task__manager_sampling_task__group__sampler.cc) = 469246a82388c0f75730380d73a760e5e966755c
+SHA1 (patch-chrome_browser_task__manager_sampling_task__group__sampler.h) = 92115ac81b59314185c234b69025749409246f64
+SHA1 (patch-chrome_browser_task__manager_sampling_task__manager__impl.cc) = 2fee1f6f632ea435680b0f4a844b03c946b3570c
+SHA1 (patch-chrome_browser_task__manager_task__manager__observer.h) = a9395929e98aefc80a7c73562cb0cfd5c95ca224
+SHA1 (patch-chrome_browser_themes_theme__helper.cc) = be1dd578f62bbe6b070730b457951d0bf43ef800
+SHA1 (patch-chrome_browser_themes_theme__service.cc) = 87f2105d760a864a42cc987b3c7c148a33f45415
+SHA1 (patch-chrome_browser_themes_theme__service__aura__linux.cc) = a9eaee897d534c55c4599250908bfb97696a4a64
+SHA1 (patch-chrome_browser_themes_theme__service__factory.cc) = 3f4811a12126657466ac5abdf11a639372e2bd80
+SHA1 (patch-chrome_browser_ui_actions_chrome__action__id.h) = 71a6294f2555d07fe509273e2fb288e953fdf4df
+SHA1 (patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.cc) = 5741f173e680e8bae61ee9af419006ea82ba6d85
+SHA1 (patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.h) = 9612252a91b30036f55993755bd4e120156e51f4
+SHA1 (patch-chrome_browser_ui_browser.h) = 3f634fc3bda7bf3730b31f370c5e6f943df6e697
+SHA1 (patch-chrome_browser_ui_browser__command__controller.cc) = 6603b4c50d30627c4c51beaab16b4ee6d5f2cc37
+SHA1 (patch-chrome_browser_ui_browser__commands.cc) = c6ef7e8f57a271a53ab66a054f008a0e11297d3a
+SHA1 (patch-chrome_browser_ui_browser__ui__prefs.cc) = 7666974d479acb3965f16accdcf0f4914bff5ce2
+SHA1 (patch-chrome_browser_ui_browser__view__prefs.cc) = 5f251990358b69e7f82df3854b34b00a776610d4
+SHA1 (patch-chrome_browser_ui_chrome__pages.cc) = 8df42824be3ca881ba6bb2d68345ffbdbfada7b3
+SHA1 (patch-chrome_browser_ui_chrome__pages.h) = 78e17f4fec9f373ce283e99a45a0e26636732fbd
+SHA1 (patch-chrome_browser_ui_color_native__chrome__color__mixer.cc) = a6212ce065eaad3fc66dbf7fff660d331b4b4f93
+SHA1 (patch-chrome_browser_ui_managed__ui.cc) = af11d5d90d979d2249c05e9adcd51f0aadf6a5c8
+SHA1 (patch-chrome_browser_ui_omnibox_omnibox__pedal__implementations.cc) = a425206898d1e50ec8108f833a323b5182ab8633
+SHA1 (patch-chrome_browser_ui_passwords_bubble__controllers_relaunch__chrome__bubble__controller.cc) = f2ef92a4fcbc1eccd4154a8a5756978cd620d615
+SHA1 (patch-chrome_browser_ui_passwords_manage__passwords__ui__controller.cc) = a1171d8026f5abe7db7afccb4bb0b6c28efbb537
+SHA1 (patch-chrome_browser_ui_sad__tab.cc) = 2fdbb68fe37005a75760f632e299489943f47624
+SHA1 (patch-chrome_browser_ui_sharing__hub_sharing__hub__bubble__controller.h) = 1a0cdf8413139efac30210b913b1d666eca82b78
+SHA1 (patch-chrome_browser_ui_signin_signin__view__controller.cc) = 5bc19791dacf25efc7d9da1531e9a8cba2f7e2d5
+SHA1 (patch-chrome_browser_ui_signin_signin__view__controller__delegate.h) = f8bad8d0188051bb2f793b93f78eba68ce186661
+SHA1 (patch-chrome_browser_ui_startup_bad__flags__prompt.cc) = fbfee7b2d71d41c181831f3ed460029d60c4ba18
+SHA1 (patch-chrome_browser_ui_startup_startup__browser__creator.cc) = beb1a423c84943b18cf38dd6b9d70208a8f50bc3
+SHA1 (patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc) = 0eea79cc1c65cc3ae8f49b93c056a68cc8682e3a
+SHA1 (patch-chrome_browser_ui_startup_startup__tab__provider.cc) = 38d64f90a95ec7944d67082719100eda49f651f2
+SHA1 (patch-chrome_browser_ui_tab__helpers.cc) = 93e65c5bf2959afde38ce8a5ae32e79cb8b9ebba
+SHA1 (patch-chrome_browser_ui_tabs_features.cc) = e881bdd72e080043662c277630da22c3e4076d75
+SHA1 (patch-chrome_browser_ui_tabs_tab__strip__prefs.cc) = 6058cee36e64258c57991681248dbeda2addb785
+SHA1 (patch-chrome_browser_ui_task__manager_task__manager__columns.h) = a5b2035fa9660fc1b12ae2fa0173067a0bb6ba45
+SHA1 (patch-chrome_browser_ui_task__manager_task__manager__table__model.cc) = 647429a57189fd633d954801fecf6db70068371a
+SHA1 (patch-chrome_browser_ui_test_popup__browsertest.cc) = 023c0486ac3c8f8e31c7fb279eaddedefb340466
+SHA1 (patch-chrome_browser_ui_test_test__browser__ui.cc) = b776955925be81574f38f325572a85772ece6cc2
+SHA1 (patch-chrome_browser_ui_ui__features.cc) = a93c9a98d4536754ec57d1242a07f7074656bf3b
+SHA1 (patch-chrome_browser_ui_ui__features.h) = 0d6abca256ddb7b31322987988e5e97f3090f4b0
+SHA1 (patch-chrome_browser_ui_views_accelerator__table.cc) = 0a8433afc64b98223bbff04ad9e5049170c12554
+SHA1 (patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc) = 48c9aedf6fdf6b840c324807248923d6d4d277f7
+SHA1 (patch-chrome_browser_ui_views_chrome__browser__main__extra__parts__views.cc) = ccce19a567638ddb28f22467b9f4a006461a8e72
+SHA1 (patch-chrome_browser_ui_views_chrome__views__delegate.h) = 5ccbdb12cfeae99ac3ffa297768290faa56a304e
+SHA1 (patch-chrome_browser_ui_views_chrome__views__delegate__linux.cc) = 3c9c4db1d7afedff0cf3a3fdbb0314db4884efce
+SHA1 (patch-chrome_browser_ui_views_compose_compose__dialog__view.cc) = 06a2b2ecc7e473ce727fecc9fad33682d40e26ef
+SHA1 (patch-chrome_browser_ui_views_frame_browser__frame.cc) = 40953e7988965eae2b438cd47cfb57ab5b579d93
+SHA1 (patch-chrome_browser_ui_views_frame_browser__frame.h) = 29c3455980a161a0ef7d1d1c79e6074ae7d7be00
+SHA1 (patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux.cc) = c7420f1d80859a28be379b438217e212e29c9313
+SHA1 (patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux__native.cc) = 54c361cafc207c35223e013f4e6f10fc8bdf91fb
+SHA1 (patch-chrome_browser_ui_views_frame_browser__frame__view__linux.cc) = 3039c0dfac38b69170f92048c9c43fdbd7738431
+SHA1 (patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc) = 4d08f816c4e397bbee7f04413edaba1aa7149642
+SHA1 (patch-chrome_browser_ui_views_frame_browser__view.cc) = d7ef294f4d861e589705281d03c609bce388cbb5
+SHA1 (patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc) = 92bc48c8b2fec46b4a3230fca6f52cd607601c08
+SHA1 (patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.h) = 0d66df5907b172d7ee74e0cb5b58e4615706bbf2
+SHA1 (patch-chrome_browser_ui_views_frame_opaque__browser__frame__view__layout__delegate.h) = 0124d5da211995dd2c799fa85f6cb93a9ef56193
+SHA1 (patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc) = 1b2e85b7c2a4d4a1def0f30e9d3a9903820de558
+SHA1 (patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.h) = 03c140a570c79a48bba39933c0e6a1c5741db95e
+SHA1 (patch-chrome_browser_ui_views_frame_system__menu__model__builder.cc) = d3b912559390d92c2012e14f2ad3f2cf9063f6b0
+SHA1 (patch-chrome_browser_ui_views_frame_system__menu__model__delegate.cc) = f3dfbacf00ba18e2cdfddfbc44b1444cf77c190c
+SHA1 (patch-chrome_browser_ui_views_frame_tab__strip__region__view.cc) = 0ddf7b7621fdd858ffe0a20d63a98a690033521b
+SHA1 (patch-chrome_browser_ui_views_hung__renderer__view.cc) = 652d926ca3194e344cd89177fb931ab4b889e5ba
+SHA1 (patch-chrome_browser_ui_views_omnibox_omnibox__view__views.cc) = 30a013b19d894a0f17bae7f2d884e375d470202a
+SHA1 (patch-chrome_browser_ui_views_passwords_password__bubble__view__base.cc) = b895457e83e60ee46b55415d8b01656ca47092f2
+SHA1 (patch-chrome_browser_ui_views_profiles_profile__menu__view.cc) = 3128d1a45167caf34c8e9a964c65df817e138e94
+SHA1 (patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc) = 16b5f6dd6ef7746c857f35ab67eb9c793199d7dd
+SHA1 (patch-chrome_browser_ui_views_profiles_profile__picker__view.cc) = 19491c4a56d1fc206cccafe95e0c6d3f56b7c026
+SHA1 (patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc) = f3c70862b408600e2ea20ffe29757152fc3c4128
+SHA1 (patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.h) = 6d635ecff471fd98cfc9178467ee2119962fd484
+SHA1 (patch-chrome_browser_ui_views_tabs_tab.cc) = 2f9a90f08b3324fea367bcf9921f214123cddfbe
+SHA1 (patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc) = 0e028a8e29176b525ff7b9f1ed06572d87c6382c
+SHA1 (patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc) = fb65cb1bfe68841a4117b04e3480c6ce1d0adeb7
+SHA1 (patch-chrome_browser_ui_views_tabs_tab__style__views.cc) = 4b6d6c32833b4b24c26100b77d1a541dad32b5a6
+SHA1 (patch-chrome_browser_ui_views_user__education_browser__user__education__service.cc) = 4c176249d3351508e6fd802161181d3db17d0814
+SHA1 (patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc) = f213705180ab07eb491b85e832d217376f67ecea
+SHA1 (patch-chrome_browser_ui_web__applications_web__app__dialogs.h) = e71785a6633ff5f0a5cd261ae407f3000fd038b5
+SHA1 (patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.cc) = 3bbf8ab10a2a36ebecbbae890963b046b301def5
+SHA1 (patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.h) = 041ec19067716acf6064fa33eb12318218e20cbc
+SHA1 (patch-chrome_browser_ui_webui_about_about__ui.cc) = 5c5913c2983c55ab57c57f12ce0e99612dab0d6d
+SHA1 (patch-chrome_browser_ui_webui_about_about__ui.h) = 9285223edd34e3ca21959e7329b8c2d013daade9
+SHA1 (patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc) = c7f5a7189a83e847da1565b93a811d361469d50d
+SHA1 (patch-chrome_browser_ui_webui_app__home_app__home__page__handler.h) = 6971b2d315d9938428eff5829a59c088df225529
+SHA1 (patch-chrome_browser_ui_webui_app__settings_web__app__settings__ui.h) = 3a51c33638882535efe37e3a7941e513cc8534b2
+SHA1 (patch-chrome_browser_ui_webui_certificate__manager_certificate__manager__handler.cc) = 975be8686ed867bb87da1035bc03f2823b1f296e
+SHA1 (patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.cc) = a7f8095847b9523c325578306cfcba5c68540aae
+SHA1 (patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.h) = 276149dddfaf9618bba5816959a9d5101a5ec812
+SHA1 (patch-chrome_browser_ui_webui_chrome__web__ui__configs.cc) = 327176ef24a705bfad4d1612437c7b4c9620ccb7
+SHA1 (patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc) = e3a68de3467e2379b7638998ad92eae8cc1f3884
+SHA1 (patch-chrome_browser_ui_webui_connectors__internals_device__trust__utils.cc) = 987414b8b6b18708ddb340ae9f479071fd7a3d36
+SHA1 (patch-chrome_browser_ui_webui_internals_user__education_user__education__internals__page__handler__impl.cc) = 85edf0fd38b4bbac59df871ea1fca091369ba6a9
+SHA1 (patch-chrome_browser_ui_webui_interstitials_interstitial__ui.cc) = 0e09fba101351f23e669c44e0aaac780e6978911
+SHA1 (patch-chrome_browser_ui_webui_management_management__ui.cc) = d8cd09e70cc64c7b1a2299d560e1c747427564f8
+SHA1 (patch-chrome_browser_ui_webui_management_management__ui__constants.cc) = a967daa111103323ba29003877225e8375286f2f
+SHA1 (patch-chrome_browser_ui_webui_management_management__ui__constants.h) = c56b88253ec62fd44746e9dd18458cbca4dd1d7f
+SHA1 (patch-chrome_browser_ui_webui_management_management__ui__handler.cc) = 965b2586b84c45635e5e664f09d0e6c0b8b81ad4
+SHA1 (patch-chrome_browser_ui_webui_management_management__ui__handler.h) = e9b60953aee990a11d4aef86843b1b2662f45ec7
+SHA1 (patch-chrome_browser_ui_webui_password__manager_promo__cards__handler.cc) = 78ff756337efa3757bf4c01d5e94b7024b61461a
+SHA1 (patch-chrome_browser_ui_webui_password__manager_promo__cards_relaunch__chrome__promo.cc) = d6fba08a5f9fb1a4f1807320d3cb7352ab561133
+SHA1 (patch-chrome_browser_ui_webui_searchbox_searchbox__handler.cc) = 47a40a523265629e806c80fac32a819dd17b746b
+SHA1 (patch-chrome_browser_ui_webui_settings_appearance__handler.cc) = daa655fe4f62869fe014a30d982625ac3a3ff91d
+SHA1 (patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc) = 7a7d21fd04cdbbbaf6d7c8a85e8121ec77f20a28
+SHA1 (patch-chrome_browser_ui_webui_signin_profile__picker__handler.cc) = 196b007e7ad265cf6dfed7a807383e4585e1166d
+SHA1 (patch-chrome_browser_ui_window__sizer_window__sizer.cc) = 78fadf4487a5e6ad069e95959648322df336e86b
+SHA1 (patch-chrome_browser_visited__url__ranking_visited__url__ranking__service__factory.cc) = 5ffb32bdee5358851c773cc209932d3f7ca7dfb3
+SHA1 (patch-chrome_browser_web__applications_commands_launch__web__app__command.cc) = fca43396070d8dca1dc2db53f9b492687d391ba6
+SHA1 (patch-chrome_browser_web__applications_commands_set__user__display__mode__command.cc) = d8ba278e10c17b92e6d4ba333a9a0ddf150862cf
+SHA1 (patch-chrome_browser_web__applications_extension__status__utils.h) = 0a529d4e36e53a4b998ab0a74a94e5ba03994400
+SHA1 (patch-chrome_browser_web__applications_extensions_extension__status__utils.cc) = 5081480ee65bb97f951ee5997f95c4825e2a149b
+SHA1 (patch-chrome_browser_web__applications_os__integration_os__integration__manager.cc) = 21c414716a69124b4a988ecddf26a35ff35b0181
+SHA1 (patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h) = 8a5b86faa8b812517eea51fffe772eecdeab1b39
+SHA1 (patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc) = ccc28fbab87a448e29d826e13db3b6958678ed91
+SHA1 (patch-chrome_browser_web__applications_os__integration_shortcut__sub__manager.cc) = 424d553f5a60f4868cbe56f59fe0059ccd6ccf5c
+SHA1 (patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h) = 884cde0a9ac8ce19f353c93692db5be04a052a1a
+SHA1 (patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc) = ca55e51d51d5b4a32a9ac23a707d84f1b303b8de
+SHA1 (patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h) = 9265df15995b0cdc8ef5238e8a6c32ec3b64c2a9
+SHA1 (patch-chrome_browser_web__applications_policy_web__app__policy__manager.cc) = b53b183b00ec65c1e2c1f997f64e8f1847c04b80
+SHA1 (patch-chrome_browser_web__applications_test_os__integration__test__override__impl.cc) = 7523ba10505f9ae2955d28ef2b3e955c11654564
+SHA1 (patch-chrome_browser_web__applications_test_os__integration__test__override__impl.h) = 3fafc5a387231542b8406f61d79d3d638bff5e92
+SHA1 (patch-chrome_browser_web__applications_web__app__helpers.cc) = 85638ed9e7a45d9ca6b20df7569b7036e642709c
+SHA1 (patch-chrome_browser_web__applications_web__app__install__info.h) = fb1c4225d30caea41a2df7ebe25683a12a646954
+SHA1 (patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc) = 654edd8cffd282983c7a2b910577eaf1944f9e4e
+SHA1 (patch-chrome_browser_webauthn_enclave__manager.cc) = b27b0c08a5cebe1b44fcdfe06c6cce0c15e91fb9
+SHA1 (patch-chrome_browser_webauthn_gpm__user__verification__policy.cc) = 4a82010d6c99f2f1e44b4e969e012ff28b6fd21d
+SHA1 (patch-chrome_browser_webauthn_unexportable__key__utils.cc) = aa0fee0be299de797c44b3e0378d09621991bba6
+SHA1 (patch-chrome_common_channel__info.h) = fbf9634ddfadbde09dd3ed4d9dbf53c7ffda2a50
+SHA1 (patch-chrome_common_channel__info__posix.cc) = ff10baaaab16f1a9701779def11776ef922d7280
+SHA1 (patch-chrome_common_chrome__features.cc) = 76b0e16005086090145892931005520c86162d2b
+SHA1 (patch-chrome_common_chrome__features.h) = 67693a626ed1167193a9431d980ad05ef8994d99
+SHA1 (patch-chrome_common_chrome__paths.cc) = 3253114252bd9cd785f15736d9753a1b251550a3
+SHA1 (patch-chrome_common_chrome__paths.h) = ba6f22da1700f80d1a02ae8565bf5d318cef84cd
+SHA1 (patch-chrome_common_chrome__paths__internal.h) = 283bdede7e377fc7875f7207b222eb6dab99352a
+SHA1 (patch-chrome_common_chrome__switches.cc) = bdf35b1c17299bc4c520438fc31a704461c0f3ea
+SHA1 (patch-chrome_common_chrome__switches.h) = 8f4eab3ad6804cf424cf0b6ea31cf246d74c50b2
+SHA1 (patch-chrome_common_crash__keys.cc) = 10b2b992fafe1cde5c85a6809a66e49a198d1c06
+SHA1 (patch-chrome_common_extensions_permissions_chrome__permission__message__rules.cc) = 54857258bea37b6d83cf857f6860848adb142756
+SHA1 (patch-chrome_common_media_cdm__host__file__path.cc) = 8d8e46ac40b1500e9126c4f113f16eb1e789bd72
+SHA1 (patch-chrome_common_media_cdm__registration.cc) = 56721870315ff342941a5dbd488ddffca11b19c2
+SHA1 (patch-chrome_common_media_cdm__registration.h) = c2397188346717a7cbb77eb32e93c0b94d7e3d93
+SHA1 (patch-chrome_common_media_component__widevine__cdm__hint__file__linux.h) = 0c512f0278e442d2e4a90bf1d174cac79ca59435
+SHA1 (patch-chrome_common_pref__names.h) = 6c27e1bedda0fdfb9b8d6cb2342e83674144215b
+SHA1 (patch-chrome_common_url__constants.h) = 1b477db5ae79f76f79382f3248f6352cf6bd2d52
+SHA1 (patch-chrome_common_webui__url__constants.cc) = 757215cedc0207cf5c3092455405e448808758b0
+SHA1 (patch-chrome_common_webui__url__constants.h) = 99024a3acaabeeefb6ecab6980690f1f51b3c1bc
+SHA1 (patch-chrome_enterprise__companion_enterprise__companion__client.cc) = 9e3eca1fbc43e3eb9dcf37286e9884d01614632c
+SHA1 (patch-chrome_enterprise__companion_lock.cc) = 05be79e00f3863c671ffd11ef0b25d08e9bc20c8
+SHA1 (patch-chrome_services_printing_print__backend__service__impl.cc) = 2558d487b4d2a511e174d4c7a72a5588d82f550b
+SHA1 (patch-chrome_services_speech_audio__source__fetcher__impl.cc) = bec2aaad93468230c090619d16ddfa72f6000f59
+SHA1 (patch-chrome_test_base_scoped__channel__override__posix.cc) = f97f0abba84a4c91b7f9977234d2e953c966917a
+SHA1 (patch-chrome_test_chromedriver_chrome__launcher.cc) = d0baf92819364995afb627094eede3306be2925a
+SHA1 (patch-chrome_test_chromedriver_chrome_chrome__finder.cc) = 472d3977d4713d62447114fef2e63d7ca2a07fd8
+SHA1 (patch-chrome_test_chromedriver_key__converter__unittest.cc) = 32a34f207d99a4d99df77e18ff29531e3d909085
+SHA1 (patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc) = 2cb80bd1f7b7e9b5e7700765d608e9976969f073
+SHA1 (patch-chrome_test_supervised__user_google__auth__state__waiter__mixin.cc) = 3404eb32b622460a67be6de94632a87ab107f913
+SHA1 (patch-chrome_updater_app_app__uninstall.cc) = a84ed24e7be9a705078709f4ccab7b8aa12eb685
+SHA1 (patch-chrome_updater_configurator.cc) = e43237f71360206f9ac84785007d8eeccbda9918
+SHA1 (patch-chrome_updater_lock.cc) = f1205732540f8a0226abcf04e257e20d30ddad9a
+SHA1 (patch-chrome_updater_util_posix__util.cc) = 6b299469307a59756529d2db93a488c3dd4aaf63
+SHA1 (patch-chrome_utility_services.cc) = d5e350bb66a9135f4b24454b3f176a3162fa65a3
+SHA1 (patch-chromecast_browser_cast__browser__main__parts.cc) = adecffdad29c3bd3cf31f85b118c53948934ae67
+SHA1 (patch-chromecast_browser_cast__content__browser__client.cc) = 48a6401b90e556be32b1a12181a9cd597c65c68f
+SHA1 (patch-chromecast_cast__core_runtime_browser_runtime__application__service__impl.cc) = 6c7b35299c0bcd87d9074031c433f05d1cb685c9
+SHA1 (patch-chromecast_media_base_default__monotonic__clock.cc) = 5e4215e3a3a6d9636c29d61e10cccadd4805efe3
+SHA1 (patch-components_autofill_core_browser_autofill__optimization__guide.cc) = bde55c4bcceb84125019b5333906813ef29ca7ff
+SHA1 (patch-components_autofill_core_browser_payments__data__manager.cc) = 4e936ddf35d4ed07e46733621cbb01a6b6c167b2
+SHA1 (patch-components_autofill_core_common_autofill__payments__features.cc) = ef821b7c998944d23e02c315c107ecbf709fa88e
+SHA1 (patch-components_autofill_core_common_autofill__payments__features.h) = 537fc6f1e3367f2b0978bd0f032a7216f52692eb
+SHA1 (patch-components_autofill_core_common_autofill__prefs.cc) = 9ad820742e6d02f529b17bbfa0c9c35a16c6af01
+SHA1 (patch-components_autofill_core_common_autofill__prefs.h) = 3a1caa73a53424aa62bf34d6fcfb4036c061e7d3
+SHA1 (patch-components_commerce_core_commerce__feature__list.cc) = 72ea1442cad5dd2fd4bb88a710e32dee51cc9059
+SHA1 (patch-components_constrained__window_constrained__window__views.cc) = 451a38670df49d32c41d5ed7d7fe53e8257b9e7f
+SHA1 (patch-components_content__settings_core_browser_website__settings__registry.cc) = a18683ca753420d2ca1b5dc9c0e422e43d37312b
+SHA1 (patch-components_cookie__config_cookie__store__util.cc) = 87a7cdcb2312d92c0f8236dc3bd85f6fdb5da4a7
+SHA1 (patch-components_crash_core_app_BUILD.gn) = 8305106469b69dbe16e760dc08767693782e5f2c
+SHA1 (patch-components_crash_core_app_chrome__crashpad__handler.cc) = faf831ffc1cbb6055b46be9b21c2094146f990b8
+SHA1 (patch-components_crash_core_app_crashpad__handler__main.cc) = 226a6b6cd98ec1ecd6d70adfcd56484fc80805e4
+SHA1 (patch-components_crash_core_browser_crash__upload__list__crashpad.cc) = ab576d688d226a462d401d248fdf9f25680e7670
+SHA1 (patch-components_crash_core_common_BUILD.gn) = 365fb06ce06e5146b652b889536969b8fbcc077c
+SHA1 (patch-components_device__signals_core_browser_mock__signals__aggregator.h) = 8eef236781f8d161b93f808d8a5ca4085cd97f64
+SHA1 (patch-components_device__signals_core_browser_signals__aggregator.h) = 3bb139ce9bfe5243eb1f74fde15b624790b891df
+SHA1 (patch-components_device__signals_core_browser_signals__aggregator__impl.cc) = 9012729a5fffb54fdb652a3dfdbffccc9e8a5f93
+SHA1 (patch-components_device__signals_core_browser_signals__aggregator__impl.h) = d4def9f1141c993582cdffaac665ce68369959e3
+SHA1 (patch-components_device__signals_core_browser_user__permission__service.h) = abc0d923310cda289e29c84ddaeced7859d2bbb1
+SHA1 (patch-components_device__signals_core_browser_user__permission__service__impl.cc) = 89f8fa13706eafb41cb4cfbce252f3ddd9071b50
+SHA1 (patch-components_device__signals_core_browser_user__permission__service__impl.h) = a61a77262b17c70cea6979c462982783b5a100ff
+SHA1 (patch-components_device__signals_core_common_signals__features.cc) = 0709f4e7b844222cae6d93b34d56aed0d93d75ec
+SHA1 (patch-components_device__signals_core_common_signals__features.h) = f6c58970c4968c6192566dbf096544729655ba45
+SHA1 (patch-components_device__signals_core_system__signals_platform__delegate.cc) = dcbdcf5e36d1c34103f2544cf6013d5a1c441674
+SHA1 (patch-components_device__signals_test_signals__contract.cc) = 9c7ce482beb9656defd848616c3b5b1fa719c056
+SHA1 (patch-components_discardable__memory_service_discardable__shared__memory__manager.cc) = 6346630d70a1270c05674b596ace73b0c9d766cf
+SHA1 (patch-components_embedder__support_user__agent__utils.cc) = 95fca000e9f3a547145093e754269b8c7baf5512
+SHA1 (patch-components_embedder__support_user__agent__utils__unittest.cc) = ef9951afdd458b58be5709e4718186faf95aec61
+SHA1 (patch-components_enterprise_watermarking_watermark.cc) = 5e514e1919ab881b651cc59550b774d2f3e8d71a
+SHA1 (patch-components_eye__dropper_eye__dropper__view.cc) = 2eef89802f761d12d57e511434239e3396a87fbb
+SHA1 (patch-components_feature__engagement_public_event__constants.cc) = e9a7cd37be1dbedb4546f8062f920b16424fe23e
+SHA1 (patch-components_feature__engagement_public_event__constants.h) = bfe895ae1e72f072a2d70500827dd94750c70ed1
+SHA1 (patch-components_feature__engagement_public_feature__configurations.cc) = a40abda426a2b9e4bef22c89bf7609ecc80accf2
+SHA1 (patch-components_feature__engagement_public_feature__constants.cc) = 15eff1d82de559833ec8682a49fb81d3ad864241
+SHA1 (patch-components_feature__engagement_public_feature__constants.h) = 3b82256158212b5da3886c042cae06f9ae3c6630
+SHA1 (patch-components_feature__engagement_public_feature__list.cc) = aa2413025e35c1447bfb824f771a27376e8b1f02
+SHA1 (patch-components_feature__engagement_public_feature__list.h) = 8dc4b865b31548bb59745684a4046c8961b804ff
+SHA1 (patch-components_feed_core_proto_v2_wire_version.proto) = 624dc78f2ead1d2eca443b37860d591c8c6907e0
+SHA1 (patch-components_feed_core_v2_feed__network__impl__unittest.cc) = b20a12913474db80d2b478645da11c84226a09aa
+SHA1 (patch-components_feed_core_v2_proto__util.cc) = f205abacb4a68b45e93826383d4bdf1b924692c7
+SHA1 (patch-components_feed_core_v2_proto__util__unittest.cc) = 03dad07180336005041db98b70a4f0897cdf5581
+SHA1 (patch-components_feed_core_v2_test_proto__printer.cc) = 0116755ca676a99f10677dd73b64da58303df2ef
+SHA1 (patch-components_flags__ui_flags__state.cc) = 1d3c75e2e1492d861fb5ca62a6d4960a61e14b0d
+SHA1 (patch-components_gwp__asan_BUILD.gn) = ca1334e37c7bb438c58a1591eb495919b564cd16
+SHA1 (patch-components_gwp__asan_client_guarded__page__allocator__posix.cc) = 78ec507ec450a4d8945774ce8893c52dc7b4fdc6
+SHA1 (patch-components_gwp__asan_client_gwp__asan.cc) = a62d8efd0ac15377d5553e7a1b9036d4f151f7f8
+SHA1 (patch-components_gwp__asan_client_gwp__asan__features.cc) = 063ab5516180dc5b86b2c55157968f2191ec4cda
+SHA1 (patch-components_gwp__asan_crash__handler_crash__analyzer.cc) = af2924c394156d8b82085d6668e325888bfc925c
+SHA1 (patch-components_live__caption_caption__util.cc) = fe8dcb28816b73e9ffcc543fd3e5895d092dcb94
+SHA1 (patch-components_live__caption_caption__util.h) = 0f8b77c5e6551b2b223fe2891f43490bac665d06
+SHA1 (patch-components_media__router_common_media__source.cc) = 5f8092fdb7a0782ff1e875c7d79bf607896598d0
+SHA1 (patch-components_media__router_common_providers_cast_channel_cast__message__util.cc) = 95f3de7714b009b3d80cb25f39687b0ba02aa7a6
+SHA1 (patch-components_media__router_common_providers_cast_channel_enum__table.h) = d36d19caf3762061abe1570bbe82cc54456f9f7b
+SHA1 (patch-components_metrics_drive__metrics__provider__linux.cc) = cb9b6faf620ce92e50ca2605fd2a666c4126173b
+SHA1 (patch-components_metrics_dwa_dwa__service.cc) = acba4082ecde864d7e3a8fb4526afd746c539f55
+SHA1 (patch-components_metrics_metrics__log.cc) = d413d2b344a7dd8bb1ffd049fe592860b56177b6
+SHA1 (patch-components_metrics_motherboard.cc) = c4a70bacbeb66ce734c75849016388245786646f
+SHA1 (patch-components_named__mojo__ipc__server_connection__info.h) = 5cb396b5c2d566736bd7966d77cf521ba6b16895
+SHA1 (patch-components_named__mojo__ipc__server_named__mojo__ipc__server__client__util.cc) = c83f11e1567a522e1b35dd0459784d80be740bd7
+SHA1 (patch-components_named__system__lock_lock.h) = a062ebf619311a17ad5c48e6f7abb6fb49ce027b
+SHA1 (patch-components_neterror_resources_neterror.js) = 095d99e44bf3b4e8bc36191fb1078effc36f7234
+SHA1 (patch-components_optimization__guide_core_optimization__guide__features.cc) = 142ef3e5d39ee4bc31d01a36b045986779bc6f90
+SHA1 (patch-components_optimization__guide_core_optimization__guide__util.cc) = 032578c06c571094e6b3bcbcb1ca3d99ecfdeb60
+SHA1 (patch-components_os__crypt_async_browser_secret__portal__key__provider.cc) = e30f937df9d385a5a1622c30323a0d56896378bd
+SHA1 (patch-components_os__crypt_async_common_encryptor.cc) = 31849aeec36f72de6e4d53c09614463b1750b931
+SHA1 (patch-components_os__crypt_sync_libsecret__util__linux.cc) = fc0997fb7ac4fe9b69bf4f12a8d03b60ee7f7ad8
+SHA1 (patch-components_os__crypt_sync_os__crypt.h) = 6aa210f07e4e15e850875b62a97e742b2ab7ebd9
+SHA1 (patch-components_paint__preview_browser_paint__preview__client.cc) = b2ca2a66c398dd75dda604f1d5ca8cd1d1187278
+SHA1 (patch-components_paint__preview_browser_paint__preview__client__unittest.cc) = 04f324d3b9b683448c37a1d0c454ee51c9c71df6
+SHA1 (patch-components_paint__preview_common_proto_paint__preview.proto) = 82cb8a514f58f1f1b25fde1931fbd710723bee24
+SHA1 (patch-components_paint__preview_player_player__compositor__delegate.cc) = 537fff3de2b919be8896b0ccc9d5c40ee9b450f4
+SHA1 (patch-components_password__manager_core_browser_features_password__features.cc) = b96ffc0994e6150a974e6619432c3db714a76731
+SHA1 (patch-components_password__manager_core_browser_features_password__features.h) = 8dfa79e249c87130a23e3c43cec6f3895abf5b09
+SHA1 (patch-components_password__manager_core_browser_password__form__manager.cc) = 3a9f78ca6d3cce890f354033758d85a9d39733f0
+SHA1 (patch-components_password__manager_core_browser_password__manager.cc) = 31130952c6a64839c77ea1325848c128ce059955
+SHA1 (patch-components_password__manager_core_browser_password__manager__client.h) = 5731616ca734377420f325a411b6665ba6a8a5e0
+SHA1 (patch-components_password__manager_core_browser_password__manager__switches.cc) = 953cc2fcb570b0a51a5c55ac34e18e1964fa728f
+SHA1 (patch-components_password__manager_core_browser_password__manager__switches.h) = d71e53511e8f914be376630bb3eb482cf458554f
+SHA1 (patch-components_password__manager_core_browser_password__manual__fallback__flow.cc) = 0cc3229a2dec24abde6a0a18c50a14a7ff82415c
+SHA1 (patch-components_password__manager_core_browser_password__manual__fallback__flow.h) = f16d896f167d0d3a486a136c41551fcd26fcc076
+SHA1 (patch-components_password__manager_core_browser_password__store__factory__util.cc) = 72b65ba0d0aba31d893422190f38913d4804e3cd
+SHA1 (patch-components_password__manager_core_browser_password__store_login__database.cc) = 4bf126dad15d539fde0df0fe8027d4f6eac7602e
+SHA1 (patch-components_password__manager_core_browser_password__store_login__database__async__helper.cc) = badaa33ebcf70e05f790d92880a6cb2b71a9e188
+SHA1 (patch-components_password__manager_core_browser_password__store_login__database__unittest.cc) = 80fdfc1bdb91687a11e089723322cfbbd5a46a16
+SHA1 (patch-components_password__manager_core_browser_stub__password__manager__client.cc) = 20137bdb5e1b1952e9e71b996a9df5df34a04c77
+SHA1 (patch-components_password__manager_core_browser_stub__password__manager__client.h) = 3c2e931155673e7db949757f55ae9a21361ca3e5
+SHA1 (patch-components_password__manager_core_common_password__manager__pref__names.h) = 3384870fbcdd7fc693b5868f97c85e59c168e8c8
+SHA1 (patch-components_performance__manager_decorators_process__metrics__decorator.cc) = 80a3117da691c5011a858174e0c81f3bb76671e1
+SHA1 (patch-components_performance__manager_public_features.h) = d1cdccee3af8c0846db77080670aff38c5434280
+SHA1 (patch-components_permissions_prediction__service_prediction__common.cc) = 6d6050d9edc349639fc36f175699990e7bbd6465
+SHA1 (patch-components_policy_core_browser_policy__pref__mapping__test.cc) = 807c236a65b9fd59f5d523254ceb206aa66e8a18
+SHA1 (patch-components_policy_core_common_cloud_cloud__policy__client.cc) = b8df49f4a359efcec44e3fa552e619651b34087f
+SHA1 (patch-components_policy_core_common_cloud_cloud__policy__refresh__scheduler.cc) = 9515c1db2b03902fa437507182bd802c03fbed72
+SHA1 (patch-components_policy_core_common_cloud_cloud__policy__util.cc) = 8d1fa586aad2cef05a11a071064407f7e48b2461
+SHA1 (patch-components_policy_core_common_policy__loader__common.cc) = 524085829c9ec2487e0964063709f84bfeda5c0e
+SHA1 (patch-components_policy_core_common_policy__paths.cc) = 82d9a68fd298d9f000e2f97d31fbe81cc43115b3
+SHA1 (patch-components_policy_core_common_policy__utils.cc) = 9f24e6552c04d620a3055d65105514188268d447
+SHA1 (patch-components_policy_tools_generate__policy__source.py) = 77081de3775f490a5e1177780ba609a385a640ed
+SHA1 (patch-components_power__metrics_BUILD.gn) = 20f5596b8cb639d27553fc943a6511771357416f
+SHA1 (patch-components_power__metrics_energy__metrics__provider.cc) = acfe0621e0be97294c675c46dabef6b2bef3a3e3
+SHA1 (patch-components_safe__browsing_content_common_file__type__policies__unittest.cc) = 5b6c98b831ab6701de521ae795b4b87e19737f30
+SHA1 (patch-components_safe__browsing_content_resources_gen__file__type__proto.py) = 3c51b7264959f6c6991c789585f8ab2bab290e74
+SHA1 (patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc) = 885ab5b52eb656ed73bfd17562c8784fac8f177f
+SHA1 (patch-components_safe__browsing_core_browser_realtime_url__lookup__service__base.cc) = ae5e7a0815f3234734179625588ce7d3255ec502
+SHA1 (patch-components_safe__browsing_core_common_features.cc) = 7d916050a619768338f62e198a3a8218771c5f90
+SHA1 (patch-components_search__engines_search__engine__choice_search__engine__choice__service.cc) = 98831863bcc152117870762aa87807d094d92d03
+SHA1 (patch-components_search__engines_template__url__service.cc) = f61053948aa2551e3deed34dd8aedcd6f6fad794
+SHA1 (patch-components_security__interstitials_content_utils.cc) = 6ccb1c60c7948c00390cea03d3d8fd8cdda79834
+SHA1 (patch-components_segmentation__platform_embedder_default__model_cross__device__user__segment.cc) = 651c41b2bc6a91b101390450505457c148f3a2ca
+SHA1 (patch-components_services_on__device__translation_sandbox__hook.cc) = 68da0a69fe01677684430543e53af8ecabd0e63e
+SHA1 (patch-components_services_on__device__translation_sandbox__hook.h) = f04d361d7c7f6900bd25ae6f9b7ddc3c5e415e49
+SHA1 (patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.cc) = 588adbe7911d4001d085041fa6ebbd7d6e4575a7
+SHA1 (patch-components_soda_soda__util.cc) = 6c2d7ada2ce17d968a7ed306c5e591036e106447
+SHA1 (patch-components_startup__metric__utils_common_startup__metric__utils.cc) = e66eee2eade95d8228ad761cd2642677001957f8
+SHA1 (patch-components_storage__monitor_BUILD.gn) = 1b50e0fd68d8e61ce0ee21d2949e2bad4d33fd0e
+SHA1 (patch-components_storage__monitor_removable__device__constants.cc) = 515fa0aeab9d9d4e79776c44adc4361b323a1a92
+SHA1 (patch-components_storage__monitor_removable__device__constants.h) = 6fb838c7dfb0de339e7c31ab24857ddd29607495
+SHA1 (patch-components_supervised__user_core_browser_supervised__user__metrics__service.cc) = 3caa1f353016c434e17c3ca7dfa90c219f4f347e
+SHA1 (patch-components_supervised__user_core_browser_supervised__user__preferences.cc) = 2c0d5152c499eca431ee418dd8991fe416a09f25
+SHA1 (patch-components_supervised__user_core_common_features.cc) = 2aa8e14c0b2a5fbd3f70f5bef64fba42149c5499
+SHA1 (patch-components_supervised__user_core_common_features.h) = 25ddf1ffac021ab2675665cb9e15abac9e3643f6
+SHA1 (patch-components_supervised__user_core_common_pref__names.h) = a6a2277f697b35cc72964f64ab7479e983cee854
+SHA1 (patch-components_sync__device__info_local__device__info__util.cc) = ed032e9c9033c6bb12b941816cde09f052b94866
+SHA1 (patch-components_sync__device__info_local__device__info__util__linux.cc) = f956447639df044352d704153788d65d91bbfa9f
+SHA1 (patch-components_sync_base_sync__util.cc) = 38a94dabd9f385e5b096a111988ef3b3d5f04aa2
+SHA1 (patch-components_system__cpu_cpu__probe.cc) = 1864e28f6aa2d162bbd96e24c2049f8c8e88b6c3
+SHA1 (patch-components_translate_core_common_translate__util.cc) = dca6a6882c3fc26738a627a48b046b2bd8f370d4
+SHA1 (patch-components_trusted__vault_trusted__vault__connection__impl.cc) = 2c7e46d31280b7985bca9142109fd96214bd978d
+SHA1 (patch-components_update__client_update__query__params.cc) = e9011af6d67492cdf79992362a9b9833fa8a966f
+SHA1 (patch-components_url__formatter_spoof__checks_idn__spoof__checker.cc) = e128182cbe499d03610149ce1689c21fc08f7f7a
+SHA1 (patch-components_user__education_views_help__bubble__view.cc) = 3ed7fd6fb2b09410c6f96e7f213d88989f6367f4
+SHA1 (patch-components_variations_service_variations__service.cc) = b7cfaf520562bc86884014bf4b3628cba71f5766
+SHA1 (patch-components_visited__url__ranking_public_url__visit__util.cc) = 00085ef384a253a982190fde325e7f464345b521
+SHA1 (patch-components_viz_host_gpu__host__impl.cc) = 575d3f2eafaa054f3b7c9f8ae5fda0b05402d74a
+SHA1 (patch-components_viz_host_host__display__client.cc) = 905f5df7d43cbc473521ff9f6945ab014bbd73b7
+SHA1 (patch-components_viz_host_host__display__client.h) = 6c3e7fc816abf6aab50f3ebd3a95894dba33212c
+SHA1 (patch-components_viz_service_display__embedder_skia__output__surface__impl.cc) = 4c97c54ebb6c5746c5dc348b5eabd91f0634fc78
+SHA1 (patch-components_viz_service_display__embedder_software__output__surface.cc) = e6a3ee88ec32da5591f9849d46c1493fa66f1fc6
+SHA1 (patch-components_viz_service_display__embedder_software__output__surface.h) = 93e55a0c0dbb76a3aa9538343b4acb260f39a6ad
+SHA1 (patch-components_viz_service_display_skia__renderer.cc) = 98fe6fbdab1cb5aac767ebfc47fc3521a8d2c0bd
+SHA1 (patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc) = 68279c0353fa4609fc2862f328c48ad9657708b7
+SHA1 (patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h) = ac5d4fb0cadaa89bc9ea1014acc85ef90cb782d3
+SHA1 (patch-components_viz_test_fake__display__client.cc) = ee619e6a36a4450136e832713dd953186425c508
+SHA1 (patch-components_viz_test_fake__display__client.h) = 622b4f50fbf465c8c2cfb30839bfdd1dfbf8264a
+SHA1 (patch-components_viz_test_mock__display__client.h) = dc442ddb9fa74dd8063e8afe979f2641dfce4841
+SHA1 (patch-content_app_BUILD.gn) = c37b26540ef0186ed46194905b42d3aa9c69b426
+SHA1 (patch-content_app_content__main.cc) = 07e0932deb3c0a938fed3c9d80f2f742ee087057
+SHA1 (patch-content_app_content__main__runner__impl.cc) = 8fe4d1094434a8115f43673cc7c72ffd6f363fe8
+SHA1 (patch-content_browser_BUILD.gn) = d0e0f3b1b22b91542c541abc917efe7b60b6ea2a
+SHA1 (patch-content_browser_audio_audio__service.cc) = eae95d1a34caaa8c3564c8c3daf33ac42f746c6c
+SHA1 (patch-content_browser_browser__child__process__host__impl.cc) = ec2e09b0b73b23658b6ff7ea0a7099e450c00221
+SHA1 (patch-content_browser_browser__child__process__host__impl.h) = 6419827d5c4a02a756ef18614cbf6a57d3b30dfa
+SHA1 (patch-content_browser_browser__child__process__host__impl__receiver__bindings.cc) = f096f356cde85e233c52ec6c4c99489af58105df
+SHA1 (patch-content_browser_browser__main__loop.cc) = 5e3626e1c6ffe6c1ae1e9380bc534d85da2d9f2d
+SHA1 (patch-content_browser_child__process__launcher__helper.h) = d4ea0c3aa5596a7b41de833eefd7d8bd2eb0b4d3
+SHA1 (patch-content_browser_child__process__launcher__helper__linux.cc) = c5efbda056a34af7ca83ddfe77be88d94ebd79ce
+SHA1 (patch-content_browser_child__thread__type__switcher__linux.cc) = 0916e3ea67c656f5d374293730adfa624a8ecb00
+SHA1 (patch-content_browser_compositor_viz__process__transport__factory.cc) = ecec17a5060ec37ad915a0076e182afe2270168b
+SHA1 (patch-content_browser_devtools_devtools__frontend__host__impl.cc) = 27aab92d99e7aed736ae5bae9dded59532d5a223
+SHA1 (patch-content_browser_devtools_devtools__frontend__host__impl.h) = 45050c2930c2f6da6cc49bb2f0299c026ea74315
+SHA1 (patch-content_browser_devtools_protocol_system__info__handler.cc) = dafca124931da221de222c87fb53d4949dc750ca
+SHA1 (patch-content_browser_file__system__access_file__path__watcher_file__path__watcher.h) = eb234dde365324e6814e39f2eddb993365ba07c9
+SHA1 (patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__bsd.cc) = e46947c6d7b8bca61001a1e76d0d9579f97342d5
+SHA1 (patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__kqueue.h) = a9244c60d9174e392c18b808c2c30639ce63a096
+SHA1 (patch-content_browser_file__system__access_file__system__access__local__path__watcher.cc) = 8d46ea75144bb6df81f259342fa632360f99102e
+SHA1 (patch-content_browser_font__access_font__enumeration__data__source.cc) = b5fa201ef6f128c45660dd92d43aafb802f4b514
+SHA1 (patch-content_browser_gpu_compositor__util.cc) = 7dae6365a63086df8cc47d33f8c3bf59c9efcc4e
+SHA1 (patch-content_browser_gpu_gpu__data__manager__impl.cc) = e1397d370546774b4e1a948242880a754f877b56
+SHA1 (patch-content_browser_gpu_gpu__data__manager__impl.h) = f7dd639b30b5e50cbb24cef21b3e2ef9780f9a5b
+SHA1 (patch-content_browser_gpu_gpu__data__manager__impl__private.cc) = 0fbe90cbab773848b3f548abf144bb3647ea2add
+SHA1 (patch-content_browser_gpu_gpu__data__manager__impl__private.h) = cd3a1896df3977971ac2d8e6a4241bccc9820e1a
+SHA1 (patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc) = d4bc93ccd27c39d49c504451ffd2895e4e3414e5
+SHA1 (patch-content_browser_gpu_gpu__process__host.cc) = a8d45f4108c97ab41e8a2c1cbb9c6d515d1ae521
+SHA1 (patch-content_browser_media_frameless__media__interface__proxy.h) = 687d525c719ec51f9195f85a0b4b69737f6f42af
+SHA1 (patch-content_browser_media_media__keys__listener__manager__impl.cc) = c02c09b784fc228a2d36a69e0ac6f058a2f0edfa
+SHA1 (patch-content_browser_network__service__instance__impl.cc) = 087db9f70441f0c02889cbeb237ff56047e856ed
+SHA1 (patch-content_browser_ppapi__plugin__process__host__receiver__bindings.cc) = 205d2997cd57835d41079edd8138d715b307884f
+SHA1 (patch-content_browser_renderer__host_delegated__frame__host.cc) = 66b455d19570ab65d766d59d91718b2917924ed5
+SHA1 (patch-content_browser_renderer__host_media_service__video__capture__device__launcher.cc) = 76282a549768729af5c9e7296771cd5df96dfe26
+SHA1 (patch-content_browser_renderer__host_pepper_pepper__file__io__host.cc) = cd63da2f4f0a8e87576ef9496e5eb3d7e057e4d7
+SHA1 (patch-content_browser_renderer__host_render__process__host__impl.h) = 6513fc80f82d750c96bf1541610b900c646fd161
+SHA1 (patch-content_browser_renderer__host_render__process__host__impl__receiver__bindings.cc) = 9cd6149dfe1f3a695638a9a8333b2896cc5b2de5
+SHA1 (patch-content_browser_renderer__host_render__view__host__impl.cc) = c5259a9d24e4a7f4e4fd17d9faa8eea3ce886440
+SHA1 (patch-content_browser_renderer__host_render__widget__host__view__aura.cc) = dfe7b17114045079779b71d45acdaebc2cb98493
+SHA1 (patch-content_browser_renderer__host_render__widget__host__view__aura.h) = 9e6ce2c71eeb45fda1461211d7b8d93caac3fc48
+SHA1 (patch-content_browser_renderer__host_render__widget__host__view__event__handler.cc) = 35f851292ff9b562c2a3541c4bb78081e40088d8
+SHA1 (patch-content_browser_sandbox__host__linux.cc) = 2a5fc45fd31f3e22023840508e44d88f70f4d107
+SHA1 (patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc) = 1d5675b73db262701860d7bcff0f828d7cdbd472
+SHA1 (patch-content_browser_scheduler_responsiveness_native__event__observer.cc) = 29cec2c14c1c85591c72656f958ee836477ac20c
+SHA1 (patch-content_browser_scheduler_responsiveness_native__event__observer.h) = c943e9ca7be11d085e79b8c554f05ee6812e1769
+SHA1 (patch-content_browser_utility__process__host.cc) = 34fcbdac79f1adb7ec091070b7333c5ff0e38221
+SHA1 (patch-content_browser_utility__process__host__receiver__bindings.cc) = c4d628654431a51dc788980bcdbf93b0c5aafe6c
+SHA1 (patch-content_browser_utility__sandbox__delegate.cc) = 8f01db81a9152dd97d742190a0e3edb00363a1a5
+SHA1 (patch-content_browser_v8__snapshot__files.cc) = 40e37ee2b0ccfb073c4c63e406ef32f6c3b7085d
+SHA1 (patch-content_browser_web__contents_slow__web__preference__cache.cc) = 089b3f799e887c234f8cf31f9f856fce7a427afa
+SHA1 (patch-content_browser_web__contents_web__contents__view__aura.cc) = 72b58fe4bedd731f7a0b9dc1090c68642b66b2f7
+SHA1 (patch-content_browser_web__contents_web__contents__view__aura__unittest.cc) = 01eee8377bc49484aaf87de1dadbb1d4d3f5f96e
+SHA1 (patch-content_browser_webui_web__ui__main__frame__observer.cc) = 615ffecb72ee3825e3acc82cbe512d8d3ea3d2a5
+SHA1 (patch-content_browser_webui_web__ui__main__frame__observer.h) = 225d11ecee3d0d85cf64b77aa64688edb7bd0353
+SHA1 (patch-content_browser_zygote__host_zygote__host__impl__linux.cc) = 8e19d335196b3da96364f101bc7cf2fc19118c85
+SHA1 (patch-content_browser_zygote__host_zygote__host__impl__linux.h) = 7196bba2ed62ce4891c694bc0b493da687d2ff7b
+SHA1 (patch-content_child_BUILD.gn) = c93469c73dea97bffcf51bf64e8642860c265cd8
+SHA1 (patch-content_child_child__process.cc) = 023746503fce75ffc222cc97d71f9769f35562b3
+SHA1 (patch-content_child_child__process.h) = e9b384356c92baf4e87e87aa1deea5717d5fd6e9
+SHA1 (patch-content_common_BUILD.gn) = d9e3b534b6ae47c59fe5b91cdcced22e17008274
+SHA1 (patch-content_common_features.cc) = 6f9eea8960e45f9fa050f1bf5791430183610458
+SHA1 (patch-content_common_features.h) = f5137c7246d3e6541805d1a91d546a28d4c96689
+SHA1 (patch-content_common_font__list__unittest.cc) = 7b8c53ee97392fcc888fada8c6c69fc355f7e79b
+SHA1 (patch-content_common_gpu__pre__sandbox__hook__bsd.cc) = 941e73fdd78bba92a06ed0a882b0c649477d5925
+SHA1 (patch-content_common_gpu__pre__sandbox__hook__bsd.h) = 89ca5c92ef621f4fd8b562f79bc2edc50bab1156
+SHA1 (patch-content_common_gpu__pre__sandbox__hook__linux.h) = bf137e21900275ec07f7f4da995dc4c9432b31d4
+SHA1 (patch-content_common_user__agent.cc) = a247bc5f097400f4bc07e7ad424f78788fc7a2e4
+SHA1 (patch-content_gpu_gpu__child__thread.cc) = cbd7155b0002bd83f8a02116be573e8fa9ea1c07
+SHA1 (patch-content_gpu_gpu__main.cc) = 45081d952f46868ddba444bf38a3a6a53b3006af
+SHA1 (patch-content_ppapi__plugin_ppapi__blink__platform__impl.cc) = 31e24b121bcad83dd59af529ebac435cfe85a227
+SHA1 (patch-content_ppapi__plugin_ppapi__blink__platform__impl.h) = 40d9e802797e5e8de6e853e33ad627d8120f969b
+SHA1 (patch-content_ppapi__plugin_ppapi__plugin__main.cc) = db14ed2a1c5e7fe209613475f1eb52053fc58b5c
+SHA1 (patch-content_public_browser_content__browser__client.cc) = d269afce5e95222f1869cdf13d672d1d1a9493cf
+SHA1 (patch-content_public_browser_zygote__host_zygote__host__linux.h) = 8ed7903371961150d50b809b7d1211f8dd1470bd
+SHA1 (patch-content_public_common_content__features.cc) = 26694f85e5ab6c805259240ce910c075aa77bbab
+SHA1 (patch-content_public_common_content__switches.cc) = bbfa3c32e8c64a5ed4f2caade2d92fa0cd3aa732
+SHA1 (patch-content_public_common_content__switches.h) = 54023074f7f1eecf9fcccf09ca5919182032df13
+SHA1 (patch-content_public_common_zygote_features.gni) = 978b9897a2db1b6f881c0348fb919a86f96206fe
+SHA1 (patch-content_renderer_render__thread__impl.cc) = 60af80e8a58053d0a28d77682c9fd312a6949efc
+SHA1 (patch-content_renderer_renderer__blink__platform__impl.cc) = 081b49571262d2c10dac2daffa2f19095b9b0269
+SHA1 (patch-content_renderer_renderer__blink__platform__impl.h) = dd7eff0fdc35d6621bfca51bba1e451454d8a781
+SHA1 (patch-content_renderer_renderer__main__platform__delegate__linux.cc) = fe51b4c8bfe9f795bdd15a372cebfb7a2971667a
+SHA1 (patch-content_shell_BUILD.gn) = 03a6ccb50f3d0e09721e29091f2f2c1ab622d796
+SHA1 (patch-content_shell_app_shell__main__delegate.cc) = 36515ccd061117135df89f6cf0985b4af59150de
+SHA1 (patch-content_shell_browser_shell__browser__main__parts.cc) = 321aa4ea3d557ff6c2ba94a5ed2dcd1c1e7fc675
+SHA1 (patch-content_shell_browser_shell__paths.cc) = 64f41b864c72dc755af0bbe08ccaa881a7649e5d
+SHA1 (patch-content_shell_renderer_shell__content__renderer__client.cc) = d5d6e5be913a5e5806f61ca720f671b3eea968eb
+SHA1 (patch-content_shell_utility_shell__content__utility__client.cc) = 32e0a7236c972efab22769ff5f71835831e0cae6
+SHA1 (patch-content_test_BUILD.gn) = 530ba8833a5a297c9c7d116600aa9fffe02ed7fd
+SHA1 (patch-content_utility_services.cc) = a41e3eccce1eb1aa6093adfca46cb80c38cdbf82
+SHA1 (patch-content_utility_speech_speech__recognition__sandbox__hook__linux.cc) = 99774892cfcb973b3ec530d0cedb8cb25fa6cd8c
+SHA1 (patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h) = 06fc6347ff157522f867f3dedd01b6c9ea8d30b9
+SHA1 (patch-content_utility_utility__blink__platform__with__sandbox__support__impl.cc) = b7f3ef580a10e5cc5d2c54df1c26eff3c7904dec
+SHA1 (patch-content_utility_utility__blink__platform__with__sandbox__support__impl.h) = dc3482f6fabcffd4f3a41a5d13b56b0a94adbce1
+SHA1 (patch-content_utility_utility__main.cc) = 47c698cfe497eef36de4b103eb22ce3eeca74b9f
+SHA1 (patch-content_utility_utility__thread__impl.cc) = b36421e66aab790c39ce6443526cd10f96f5fd39
+SHA1 (patch-content_zygote_BUILD.gn) = 1f9d08ae8cfac9ad0fd2a1ce42f7f383267eecf4
+SHA1 (patch-content_zygote_zygote__linux.cc) = 7913f5dc26fcd7c6752015628ddac26b1c4b9bc3
+SHA1 (patch-content_zygote_zygote__main__linux.cc) = cd46d3696346ce33cf87aa8cc7c0a7f99ae3ca4f
+SHA1 (patch-device_bluetooth_bluetooth__adapter.cc) = 0196f9c6f335aadde7650241be8b8ea7cb4cee3a
+SHA1 (patch-device_bluetooth_cast__bluetooth.gni) = 27d4086159c741ef9a6929a998c816685642d0f6
+SHA1 (patch-device_gamepad_BUILD.gn) = 04272856ebeecbf2017d9c377c1921c2771d4b3d
+SHA1 (patch-device_gamepad_gamepad__provider.cc) = 1ba3ffae2442364c91b6af1584b4a5e0fd41c74e
+SHA1 (patch-device_gamepad_hid__writer__linux.cc) = 9e703f1cc1532ab562172b6577def37b970f2757
+SHA1 (patch-extensions_browser_api_api__browser__context__keyed__service__factories.cc) = 7f4cbc17eb52f6af6629f16fde9c90b41ee969d5
+SHA1 (patch-extensions_browser_api_management_management__api.cc) = 41dbe18a936415508ae71e38c32639957dd76ee8
+SHA1 (patch-extensions_browser_api_messaging_message__service.cc) = 442d2349eeadec62b608662c5d95935ecf1c41f5
+SHA1 (patch-extensions_browser_api_networking__private_networking__private__delegate__factory.cc) = 6f5e5fb805909d24f6c30740d8aba2e6a2f92644
+SHA1 (patch-extensions_common_api___permission__features.json) = 1e40723ca7bdc387082342ae355b59053c464166
+SHA1 (patch-extensions_common_api_runtime.json) = 0108dc3816c156ebbf515e3f349d2970f245a9ef
+SHA1 (patch-extensions_common_command.cc) = e2c66e6bb5c225f4a9ffb2a53bac61fe7c22a581
+SHA1 (patch-extensions_common_features_feature.cc) = 073cfe9f05fad0b6e8a893ea411e1a8d999be94a
+SHA1 (patch-extensions_renderer_bindings_api__binding__util.cc) = d3a9129be134e3818c5fe476f1a8775a1f7bb685
+SHA1 (patch-extensions_renderer_bindings_argument__spec.cc) = 28ef9b08c52924448c40ebce83ecab3ee7eeb788
+SHA1 (patch-extensions_shell_app_shell__main__delegate.cc) = 0fbb6f8da58c4b735b5c53cf4b85324f677a9e21
+SHA1 (patch-extensions_shell_browser_api_runtime_shell__runtime__api__delegate.cc) = 90401ecf96ac1c1cbefa4772099f1870528ec5ea
+SHA1 (patch-extensions_shell_browser_shell__browser__main__parts.cc) = 2fdf19e321ae6a4ad3d87d2acc1c6beba36c8f4e
+SHA1 (patch-extensions_shell_browser_shell__extensions__api__client.cc) = bfd2497e989eb3448c5389a821f08c8dd04f4c5b
+SHA1 (patch-extensions_shell_browser_shell__extensions__api__client.h) = df2e5eaa17854ddb52701de5df0c8319b0db1d91
+SHA1 (patch-google__apis_gcm_engine_heartbeat__manager.cc) = a52640416f54c0139ad5e84c30893b3e53363302
+SHA1 (patch-gpu_command__buffer_service_dawn__context__provider.cc) = d94d779c5a8f268bb215e26cbb2fd07f5d50766c
+SHA1 (patch-gpu_command__buffer_service_gles2__cmd__decoder.cc) = 0bd1e849386460f7f67d8defa822dfe9b1b427ed
+SHA1 (patch-gpu_command__buffer_service_shared__context__state.cc) = bef6f8202a2480bc3865230f19ee5189e40b18a8
+SHA1 (patch-gpu_command__buffer_service_shared__context__state.h) = 58258dc89dccbe1596f3d477ab9b90584470df3e
+SHA1 (patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc) = 2af08e5dd9d91f00fb3e782d31ccf5fbe9d7b7ec
+SHA1 (patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc) = 745ec7b03df0fb256bf25f002fe681615c64fb74
+SHA1 (patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc) = 41dc5fb959828176036ab70a52f3386edb44b440
+SHA1 (patch-gpu_command__buffer_service_shared__image_shared__image__factory.cc) = ebf174ce9b27118cb974b320de25263030a10a48
+SHA1 (patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc) = cd2364b1888ec487f4072d9a8bde15b3654cb108
+SHA1 (patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc) = 70f77421f48f7de61a0df1013bfd741aecf4b2b9
+SHA1 (patch-gpu_command__buffer_service_webgpu__decoder__impl.cc) = 29835d1548703825db95c157afeefdba27db1669
+SHA1 (patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc) = 7487c70fe6758af9474fea1a0c179cfc9175ded5
+SHA1 (patch-gpu_config_gpu__control__list.cc) = 2a38098682d5cb98e1e42815ec60b460dcadae0b
+SHA1 (patch-gpu_config_gpu__finch__features.cc) = 19d6346cd09a87c157ef53f57131c59e301f3a1e
+SHA1 (patch-gpu_config_gpu__info__collector.cc) = 09b39a2f80aed599bf123fac7716d9b009aa917f
+SHA1 (patch-gpu_config_gpu__test__config.cc) = 7922fe3eb20976e7cd8b8ca1632e0184b49197ce
+SHA1 (patch-gpu_ipc_common_gpu__memory__buffer__support.cc) = 85449ae9268f04aa44d35ae07552cc6eb3816917
+SHA1 (patch-gpu_ipc_common_gpu__memory__buffer__support.h) = d9c8bc95d21b3f28242073d0c092318cfe33a377
+SHA1 (patch-gpu_ipc_service_gpu__init.cc) = 93bca645e75769356e96002d53ebcfc9129223d2
+SHA1 (patch-gpu_ipc_service_gpu__memory__buffer__factory.cc) = 4279da038907fb549d577895190debe238548254
+SHA1 (patch-gpu_ipc_service_x__util.h) = 510cc83dba156a0efa813aca30d87741cd1887a8
+SHA1 (patch-gpu_vulkan_generate__bindings.py) = b17236b89b9f1b3c00fbefcaca6357ee8920c69c
+SHA1 (patch-gpu_vulkan_semaphore__handle.cc) = cfc6e9a5408355cb92b139faed36a0914514eab2
+SHA1 (patch-gpu_vulkan_vulkan__device__queue.cc) = 7c8dbde812260671da96607975ce3c1ccf251624
+SHA1 (patch-gpu_vulkan_vulkan__device__queue.h) = 849f727fac05f6f7faef12d8e0dbb3c8ee2424b0
+SHA1 (patch-gpu_vulkan_vulkan__function__pointers.cc) = a97012ecd78792164939ef7232fd9bdc80f68136
+SHA1 (patch-gpu_vulkan_vulkan__function__pointers.h) = 842d92c71581ee42480961ff37eb651c91e06c0c
+SHA1 (patch-gpu_vulkan_vulkan__image.h) = 18d398d58f7c43f4c9480157643d206f08210a52
+SHA1 (patch-gpu_vulkan_vulkan__util.cc) = 230f947381d41529e235a6facaa8677a97badb46
+SHA1 (patch-headless_lib_browser_headless__browser__main__parts__posix.cc) = 0c8eeb9bcdf82761717f3011c8fd77ce3d7f6fd9
+SHA1 (patch-headless_lib_browser_headless__content__browser__client.cc) = c1331b7994445334586ec6093e65e8f63f1e3ce0
+SHA1 (patch-headless_lib_browser_headless__content__browser__client.h) = fa274cfa47e11936b9a5cdd4fdd2f10675b7baf8
+SHA1 (patch-headless_lib_browser_headless__web__contents__impl.cc) = f84569f34f5aaf47f9da6c70a719a07bf53fdb0c
+SHA1 (patch-headless_lib_headless__content__main__delegate.cc) = 2785df89ec5b6430b242af8e2597b8db21eecbe7
+SHA1 (patch-ipc_ipc__channel.h) = 25420306e931111a394962f50fdfc036e3a805c0
+SHA1 (patch-ipc_ipc__channel__common.cc) = a3a089eb5ef3542bb79602a2cc87152a4ee83955
+SHA1 (patch-ipc_ipc__channel__mojo.cc) = 5165c84ed3a61e25fb79eb95bf329679263d8686
+SHA1 (patch-ipc_ipc__message__utils.cc) = 3dfab36e8b1c62e66cc21a2d22f103d8032106c7
+SHA1 (patch-ipc_ipc__message__utils.h) = 7835d4bca33afc763b9dee4b98fc66a3bc0c0a78
+SHA1 (patch-media_BUILD.gn) = 4aadee6caea359c5e9a43eeb2991191c632d7370
+SHA1 (patch-media_audio_BUILD.gn) = 07c410bcf4944abdb35dbc379e90b7e471799915
+SHA1 (patch-media_audio_alsa_audio__manager__alsa.cc) = acf51c8938f821a801dfa1a7069a2f9df119e121
+SHA1 (patch-media_audio_audio__input__device.cc) = 163e4aa915c3a15990f335f4a12fae1e0799339f
+SHA1 (patch-media_audio_audio__output__proxy__unittest.cc) = dc98e193e8006d14792fe13219ab5f4547d3ae92
+SHA1 (patch-media_audio_pulse_pulse__util.cc) = 8ba04181ece0f62ab384edd5882181c884a785cc
+SHA1 (patch-media_audio_sndio_audio__manager__sndio.cc) = 18d425c9910540d6a230eaaea2c2e716f9aeb5eb
+SHA1 (patch-media_audio_sndio_audio__manager__sndio.h) = e6faca98a5858fd7caa2ce946aa2e5fea7f2c9da
+SHA1 (patch-media_audio_sndio_sndio__input.cc) = 2a1b7bc70f46df216dfb2a2491bc6dedd4d97efe
+SHA1 (patch-media_audio_sndio_sndio__input.h) = edd483081eaa3dd7ed9e8cec1311fec1fdd0706a
+SHA1 (patch-media_audio_sndio_sndio__output.cc) = a39bf7d7482a3955cca685a829b2317783546f10
+SHA1 (patch-media_audio_sndio_sndio__output.h) = 1c20da0f731c669e0dfbd2a3f5ef0ae12caa8bd2
+SHA1 (patch-media_base_audio__latency.cc) = 733f7b6929de05a02e43c8fb7d449b68504b9668
+SHA1 (patch-media_base_libaom__thread__wrapper.cc) = 6c57cff17b6657ca215520dc9da380a3cbb2e7c8
+SHA1 (patch-media_base_libvpx__thread__wrapper.cc) = 5382edfb8a50806961711dc0664877509f77385a
+SHA1 (patch-media_base_media__switches.cc) = a66a203ef6f715e188c913bc34708b9622c746ab
+SHA1 (patch-media_base_media__switches.h) = adc38ead3ab1a5b8bf4c8cc06f5c035c59b73bdd
+SHA1 (patch-media_base_user__input__monitor__unittest.cc) = 8a6682eb45fde8e3817b1291cc257a5612fa3e01
+SHA1 (patch-media_base_video__frame.cc) = 2e8ae6e2703f515d7562873d3ccf490b2b37dd31
+SHA1 (patch-media_base_video__frame.h) = 319accad72444727c8f8512bac2ef456f15689f9
+SHA1 (patch-media_capture_video_create__video__capture__device__factory.cc) = b55eef3350c96a771d79b7677a465641f1861eb1
+SHA1 (patch-media_capture_video_fake__video__capture__device__factory.cc) = a1e8e0e9689903849adb5a090707a90554acbd40
+SHA1 (patch-media_capture_video_file__video__capture__device__factory.cc) = b8687c010db8898f5006238f7d7a23db266bba84
+SHA1 (patch-media_capture_video_linux_fake__v4l2__impl.cc) = 3c6168159a6a359a33fc8fcf9ee2b9207110702a
+SHA1 (patch-media_capture_video_linux_fake__v4l2__impl.h) = 6a1ca60f7f8b9cb965fd95afb03f013fd7a5054d
+SHA1 (patch-media_capture_video_linux_v4l2__capture__delegate.cc) = c14ab8e2bf11e276a494edddd1b1d8a08e0858c6
+SHA1 (patch-media_capture_video_linux_v4l2__capture__delegate.h) = d4aa0f91129cfe35fd707b0fa266431d53c57de3
+SHA1 (patch-media_capture_video_linux_v4l2__capture__device.h) = d6a3efc7d22cc9bed631b584cd3dc357cf1f4a7b
+SHA1 (patch-media_capture_video_linux_v4l2__capture__device__impl.cc) = 5a1d42ca2572b715e04e020e2860df51066c91fe
+SHA1 (patch-media_capture_video_linux_v4l2__capture__device__impl.h) = 512e182342e5e5ef16335a6dde28663ca88ff418
+SHA1 (patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc) = 586117e0d4702ec860ee16f24c9a2164015817dd
+SHA1 (patch-media_capture_video_linux_video__capture__device__factory__v4l2.h) = f5196513b02474a60d6ca7245975bf4663378022
+SHA1 (patch-media_capture_video_linux_video__capture__device__linux.cc) = c202af1abcd5e2784039b679aaedf59a3e51e289
+SHA1 (patch-media_capture_video_video__capture__buffer__tracker__factory__impl.cc) = 852f20443c08f79f4a4c45d6fe9aeaa9f928e5f5
+SHA1 (patch-media_capture_video_video__capture__device__client.cc) = c7bf8319d08ca81a91a954e06e4ac2b846492265
+SHA1 (patch-media_cdm_cdm__paths__unittest.cc) = 08df3917411dbe2e7d79bae60a4424b80eb6f8f9
+SHA1 (patch-media_cdm_library__cdm_cdm__paths.gni) = 9726161417581560b8c37ada419c35095d847abf
+SHA1 (patch-media_ffmpeg_scripts_build__ffmpeg.py) = d8314de5a3888c670bc5f9a8e8ebb3905036e79e
+SHA1 (patch-media_ffmpeg_scripts_robo__lib_config.py) = 9ec6d8f67f9ee5a50c61a0e0294b02fff59b00a4
+SHA1 (patch-media_gpu_buffer__validation.cc) = fac81dc7bcaa9ad20803c7b2bd5442c67bd081e8
+SHA1 (patch-media_gpu_chromeos_gl__image__processor__backend.cc) = 5de7ea6e2c7eb176317e697d702520f4c946b011
+SHA1 (patch-media_gpu_chromeos_libyuv__image__processor__backend.cc) = e629d4cc56064f33878400b35648eabe96cbe20a
+SHA1 (patch-media_gpu_chromeos_mailbox__video__frame__converter.cc) = 92a5491391bf145c72a9a6c1fffb0c75cb9d8d72
+SHA1 (patch-media_gpu_chromeos_platform__video__frame__utils.cc) = f4694c731c1f889f9da284db0d0ece68f14de972
+SHA1 (patch-media_gpu_chromeos_video__decoder__pipeline.cc) = 58000798963ca4fa769ab9066c14a7326da22390
+SHA1 (patch-media_gpu_gpu__video__encode__accelerator__factory.cc) = 2c128936c14db3bfdb9da2d25fd606bfb5952bc5
+SHA1 (patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc) = d3af8e00a61a01bb418642ebce7bf8a2ae1e8b4b
+SHA1 (patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h) = e672d293460522e2c599d232de5fe3f176248988
+SHA1 (patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc) = 973cc98f7a4dbeab199aedaf37d5bac1f1e4a014
+SHA1 (patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h) = 21830ce7c16d60eb09253adaafcadabdced84fe2
+SHA1 (patch-media_gpu_test_raw__video.cc) = 91e8f3af23045c727a42d57ff818f7dc38940399
+SHA1 (patch-media_gpu_test_video__frame__file__writer.cc) = c582fa2b98549dd098bccb1a03763650552dcfae
+SHA1 (patch-media_gpu_test_video__frame__helpers.cc) = aae6548ac241b88745a8fea7ea0e16ada54d3192
+SHA1 (patch-media_gpu_test_video__frame__validator.cc) = 301203617e52776ac25e294b232a9558cd355945
+SHA1 (patch-media_gpu_vaapi_vaapi__video__decoder.cc) = 390f3b86ae39b305f70faa05c650c8189351ac98
+SHA1 (patch-media_gpu_vaapi_vaapi__wrapper.cc) = c92a26b62a05ab37d8633f71bbdfd90fffa8e5de
+SHA1 (patch-media_media__options.gni) = 05ece7be4c38d1a4cb0f74bf666ae32c9fc68c42
+SHA1 (patch-media_mojo_mojom_stable_BUILD.gn) = 9476f78c88d367dfb89992ef8b69d09c1db485a7
+SHA1 (patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc) = e049016634086bc4440f35c7c06372e5bd56b838
+SHA1 (patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h) = 85dfa0659a38f1e0267f4dc5bcfe7fa061fe2ae6
+SHA1 (patch-media_mojo_mojom_video__frame__mojom__traits.cc) = 7380d55ee1a8fc933adb6032c763c870f4ecb0ff
+SHA1 (patch-media_video_fake__gpu__memory__buffer.cc) = abea780d5831339584144c5ad1437ad96af92965
+SHA1 (patch-media_video_gpu__memory__buffer__video__frame__pool.cc) = 3d72b25d0e7f29c7c3f3d4e0c553d738af9290c5
+SHA1 (patch-media_video_video__encode__accelerator__adapter.cc) = b324c6888e75048bee1ad4d3a1678eff8e274ab8
+SHA1 (patch-media_video_video__encode__accelerator__adapter__test.cc) = 20a41135aa9e7bcfe6a3bc1be0d8b5eaada46a4f
+SHA1 (patch-media_webrtc_audio__processor.cc) = d8f1c76b588a84248ecc80b9c1680868865a2715
+SHA1 (patch-media_webrtc_helpers.cc) = 777be018f0b306f1a1732e0f3d69a85aeacd35ab
+SHA1 (patch-media_webrtc_helpers__unittests.cc) = e3460a4635529f0b1d0a95ea8b052a57e60b5a11
+SHA1 (patch-mojo_core_BUILD.gn) = 5646f27211673bfafecd30b43500fbacd99256f4
+SHA1 (patch-mojo_core_channel.cc) = ac308db70b6598b4cee5aa45f52c2cd6ac52fb07
+SHA1 (patch-mojo_core_embedder_features.h) = e378e5a6089e62bb63677250b6a033f383aa31c3
+SHA1 (patch-mojo_public_cpp_platform_socket__utils__posix.cc) = 6e1a0384d73ffba7485563084665b727b0204896
+SHA1 (patch-mojo_public_tools_bindings_mojom.gni) = 37a5bebd8fd7e606978532132594b693072bc503
+SHA1 (patch-net_BUILD.gn) = 9904f9ca764b17385384287fc2e05940a7b8f9a7
+SHA1 (patch-net_base_features.cc) = 3a3eb3c5a1be911b9506a3ce1738906dfd1db059
+SHA1 (patch-net_base_mock__network__change__notifier.cc) = ec6e3cc0937c4d6e88321ae81054fcb427ab18e2
+SHA1 (patch-net_base_mock__network__change__notifier.h) = b1f7c3c2dc80650306405468b9ee352d3fbb045f
+SHA1 (patch-net_base_network__change__notifier.cc) = a5fba38a556d59bcf699d93a46bdfe2d230a5971
+SHA1 (patch-net_base_network__change__notifier.h) = 93f808b980872c05cefe214daa9935ba31ecd56a
+SHA1 (patch-net_base_network__change__notifier__passive.cc) = 639fac96dd4243bdae8ef78f8166cfa9a470d4f5
+SHA1 (patch-net_base_network__interfaces__posix.h) = d69ab0d52615add498083713b5ddd95e0ea9cfe6
+SHA1 (patch-net_base_sockaddr__util__posix.cc) = 4388b71a19f7a7b79637202a71b6fa14b5e5b6e0
+SHA1 (patch-net_base_sockaddr__util__posix__unittest.cc) = ed39a9289eba0da7a1a68e89b00b1dab1ce17d62
+SHA1 (patch-net_cert_cert__verify__proc.h) = f0e894d8b7e769dc595474f2f28f6f800aadcd5b
+SHA1 (patch-net_disk__cache_backend__experiment.h) = 7c97a27796d85db5f20aa93581d38f86ce564920
+SHA1 (patch-net_disk__cache_simple_simple__file__tracker.cc) = 8c0331eafc748e2d068341ef0aa938da2c07230b
+SHA1 (patch-net_dns_BUILD.gn) = 018515e0f0f704468cf5d7c8ed32a26296c0fc55
+SHA1 (patch-net_dns_address__info.cc) = 691c0ca2d72c5379a68bc0d09e5d6c08aa87085e
+SHA1 (patch-net_dns_address__sorter__posix.cc) = 033320bbe93f809801a5b43c0a315b12884f355b
+SHA1 (patch-net_dns_dns__config__service__posix.cc) = c421529adb0399431e0a2950c04f303b7847569c
+SHA1 (patch-net_dns_dns__reloader.cc) = c6a698113bce87679e86a7cf9a535adde6d3f1aa
+SHA1 (patch-net_dns_dns__util.cc) = d8b934d5212e4d3c55e786004428f6f435452066
+SHA1 (patch-net_dns_host__resolver__proc.cc) = 41164fb8447a592eebe324f060b4779dbef89069
+SHA1 (patch-net_dns_public_BUILD.gn) = badea3dd057f4dc978a4325eed277f9361591685
+SHA1 (patch-net_dns_public_resolv__reader.cc) = feb3bddbe65f9ada7e615d09f73371710fbfd2e3
+SHA1 (patch-net_dns_public_resolv__reader.h) = 754b865fc7871b9be830cf9335d7ef15624d6fcf
+SHA1 (patch-net_dns_public_scoped__res__state.cc) = de33adf4460a02df7937b51a15a4d69a97776b7a
+SHA1 (patch-net_dns_public_scoped__res__state.h) = 19f19b7faa9dc028bf5c14d5d7c7e24ed69d0799
+SHA1 (patch-net_filter_zstd__source__stream.cc) = 3b16cf7d5fe5e490dfc64bd72a35baa21322362d
+SHA1 (patch-net_http_http__auth__gssapi__posix.cc) = d6320c49efdf586123ff03b853d08d32f00cbed6
+SHA1 (patch-net_http_http__auth__gssapi__posix.h) = ae366b71436027a565b1756ee6e2072c00cfad58
+SHA1 (patch-net_http_http__auth__handler__negotiate.cc) = 970937a0dea38c6d256634fb62eb94cd67ad0cf1
+SHA1 (patch-net_http_http__auth__preferences.cc) = 809a5ef25bb1fa74b383914178d73fb0549b3ac7
+SHA1 (patch-net_http_http__auth__preferences.h) = 06f60e75da05e6c4c6a97e6643da36c28e14d48b
+SHA1 (patch-net_http_http__network__session.cc) = b255efe7b3f5202eda4e0185a25c1fc185f9f579
+SHA1 (patch-net_proxy__resolution_proxy__config__service.cc) = ef6f8a0c31138670c1384773c5db5f5455a80dbf
+SHA1 (patch-net_proxy__resolution_proxy__config__service__linux.cc) = 4c6d05a2820e67e298fe594ef8be4373a1ecdcf8
+SHA1 (patch-net_socket_socket__posix.cc) = 126aef0707a4d9ab286127253ac7ff485474d5c8
+SHA1 (patch-net_socket_socks5__client__socket.cc) = fb862aa5673187d3b8b42d8fbffd3b81c31b8308
+SHA1 (patch-net_socket_tcp__socket__posix.cc) = da5615bc55c872f5049e5a1e3abf486b76fd0db5
+SHA1 (patch-net_socket_udp__socket__posix.cc) = d4c769380670d9fc5a0e30213575bd225f341d65
+SHA1 (patch-net_socket_udp__socket__unittest.cc) = cf7d8adbdd61940e66ee1d91b70b8a1ec6a4963f
+SHA1 (patch-net_third__party_quiche_BUILD.gn) = be0ffb6fa31b7495b9fbb5d3eb0b933f6ac56271
+SHA1 (patch-net_tools_cert__verify__tool_cert__verify__tool.cc) = 7d6e04be01b28ffbc69b838b78986bfbefcbf096
+SHA1 (patch-net_tools_net__watcher_net__watcher.cc) = c0e80c2e84be9c99e883c268d8c1a6a81f759456
+SHA1 (patch-net_traffic__annotation_network__traffic__annotation.h) = 3c39e3607bc8b2d9f7681cb7c42e9ea9718d66b1
+SHA1 (patch-net_url__request_url__request__context.cc) = f3544aceb1b4368b707a0f68070ebb2cbd6cff81
+SHA1 (patch-net_url__request_url__request__context.h) = 4acddef82024a4ac7edf21ea274ad691ca9c6daf
+SHA1 (patch-net_url__request_url__request__context__builder.cc) = 7d4caa24219e58c14432dfc54b92a91381992164
+SHA1 (patch-pdf_pdfium_pdfium__engine.cc) = 37ec483d12a1df22b0e4eb702f6438490d5bca6d
+SHA1 (patch-ppapi_tests_test__utils.h) = 05c29e9b4c07872ffdc6618075b454489a546d17
+SHA1 (patch-printing_backend_cups__ipp__helper.cc) = 84eae27e6f4578a82be651cd7b77fa62a77c35ab
+SHA1 (patch-printing_backend_print__backend__cups.cc) = f5d4f07909e272313f7a2e2bc09f3dd98c3c46e9
+SHA1 (patch-printing_mojom_printing__context__mojom__traits.cc) = e60a3e5feca952d18767eaaaa296653760febb0b
+SHA1 (patch-printing_mojom_printing__context__mojom__traits.h) = df6ce3a39b2288702f3909b00739ec9a4589373d
+SHA1 (patch-printing_print__settings.cc) = 519ba89e79f3eba2b2691b8115d0974ae8ff01db
+SHA1 (patch-printing_print__settings.h) = c423eb740ed2361eb6a3936adfe69ab547d043bc
+SHA1 (patch-printing_print__settings__conversion.cc) = 6cb1ad2cf7206ff5e81d4cbe94b55ad3eb02cabd
+SHA1 (patch-printing_printing__context__linux.cc) = d69c921b398a6fb67847a11a7bac8233337677f8
+SHA1 (patch-printing_printing__features.cc) = ca26264569eff19ba07032acb4bf64c65bb215e7
+SHA1 (patch-printing_printing__features.h) = 08129c8a30207bd9a780321213a94f9b998384ee
+SHA1 (patch-printing_sandbox_print__backend__sandbox__hook__linux.cc) = 2da359e05008a77641bedd5fc139bd5d085ad6bb
+SHA1 (patch-printing_sandbox_print__backend__sandbox__hook__linux.h) = 5f3a2c18b4a06a34345562966f030cb7cfd265fd
+SHA1 (patch-remoting_base_chromoting__event.cc) = 33dcadab47eb4cd8d0142216cd0cd85ae2112a7f
+SHA1 (patch-remoting_base_host__settings.cc) = 3d663bfda4d4dc0659d3c7c0ba04e0bef2dc0b09
+SHA1 (patch-remoting_codec_webrtc__video__encoder__vpx.cc) = a8dfbf483c0c51255fbd66d277fe8ae0837ae910
+SHA1 (patch-remoting_host_base_desktop__environment__options.cc) = 077ce6e386292a0b26191bc30dcb5e8c223dd695
+SHA1 (patch-remoting_host_base_switches.cc) = d49db41e35cae4e91c1ed7c582ad9e0d8d5b11a7
+SHA1 (patch-remoting_host_base_switches.h) = 3fb0e611eacb56cb075cbc688a886d37bbfc9abe
+SHA1 (patch-remoting_host_basic__desktop__environment.cc) = 11d341c2daf05dda36cccb293c3b1909bda59682
+SHA1 (patch-remoting_host_chromoting__host.cc) = 1c6d516e6f5b194401c069f28e48f7bffc5b3fd5
+SHA1 (patch-remoting_host_chromoting__host.h) = 8fb134b17712f2e3125d809bd943012fbed23f67
+SHA1 (patch-remoting_host_chromoting__host__context.cc) = c8925df7fd4f5870c75c8216d6443bb9c1442942
+SHA1 (patch-remoting_host_chromoting__host__services__client.cc) = f34c16c4d57ff5ceb4d2cf0faeab31bb090de5b6
+SHA1 (patch-remoting_host_client__session.cc) = 6076d62b82914c1d9922d59d55bcef6130968185
+SHA1 (patch-remoting_host_crash_crash__file__uploader.cc) = b9061d042bd4e2a1309de61d3a851b01bee7165d
+SHA1 (patch-remoting_host_desktop__and__cursor__conditional__composer.cc) = f594f13ca78a7f1439e3f8212d7124b308f62e74
+SHA1 (patch-remoting_host_desktop__capturer__proxy.cc) = 7ab352d67a7bae53e43a975e6811ce575c667a0d
+SHA1 (patch-remoting_host_desktop__capturer__wrapper.cc) = c1ea47ec6a86d1d0443d25d56752043f8ba277ef
+SHA1 (patch-remoting_host_evaluate__capability.cc) = fca6b3760a5b5819d7dd12373eb94a0637281d45
+SHA1 (patch-remoting_host_host__attributes.cc) = 42a4248e030a8ef022881c19fa7b1fa25dd0ea4d
+SHA1 (patch-remoting_host_host__details.cc) = 298cdcd57641177237236bb53201d55053fd99e6
+SHA1 (patch-remoting_host_host__main.cc) = d87aba453ef13c79de247bcf74c6b8d3129a610c
+SHA1 (patch-remoting_host_ipc__constants.cc) = 494f50ab350eef1a983904cfa90bd9f0f7fec9ea
+SHA1 (patch-remoting_host_it2me_it2me__host.cc) = 16741da59904ec7a03d88a72a9a56956c6174b1a
+SHA1 (patch-remoting_host_it2me_it2me__native__messaging__host__main.cc) = 70fddd5e95756a2ba7770a42116e9918738c883a
+SHA1 (patch-remoting_host_me2me__desktop__environment.cc) = 2d285478771cc0939721db0641ffc568acc99b8f
+SHA1 (patch-remoting_host_mojo__caller__security__checker.cc) = 98208771d87be2a9c26d4189bba1643c39ca725f
+SHA1 (patch-remoting_host_mouse__cursor__monitor__proxy.cc) = e43d1620c1625aa7b9dea0a6c41035308913f784
+SHA1 (patch-remoting_host_policy__watcher.cc) = 5f3f71eb535c76627eb47b7dbe5b3fc3841b1cb3
+SHA1 (patch-remoting_host_remote__open__url_remote__open__url__client.cc) = 6d1d1b6ca14a1aa3a37ea9e0546b1e7a9d0c60f3
+SHA1 (patch-remoting_host_remote__open__url_remote__open__url__util.cc) = d7a014b0f4bc38a3df922e0a790661fa0406c89b
+SHA1 (patch-remoting_host_remote__open__url_url__forwarder__configurator.cc) = 32da17a7d36001dd8c20bb4027b0c5e8bbf91eea
+SHA1 (patch-remoting_host_remoting__me2me__host.cc) = 8f66c78d03501d028fc63bbb2368459cfb11a2a5
+SHA1 (patch-remoting_host_session__policies__from__dict.cc) = 01fd3ab57f255fcdcd84a7b2e6825d5134102379
+SHA1 (patch-remoting_host_setup_start__host__main.cc) = 99d19e157fa3f2842d4659ade9f13c9a5119eb02
+SHA1 (patch-remoting_host_webauthn_remote__webauthn__caller__security__utils.cc) = 656a6ad260aa58b87c0c93b624c08460d794a4fc
+SHA1 (patch-remoting_host_webauthn_remote__webauthn__extension__notifier.cc) = 85e4d36382f64978a6ab81a64a1475ca08771602
+SHA1 (patch-remoting_protocol_webrtc__video__stream.cc) = cb6b998baab945bf5b36a6db64303ed63b513880
+SHA1 (patch-sandbox_BUILD.gn) = ea6b3d4d265e4d5b05c2f7532c855f66a4033785
+SHA1 (patch-sandbox_features.gni) = 57ebd963b265966f90af21888fad10cd761613f2
+SHA1 (patch-sandbox_linux_BUILD.gn) = e0a3e42f27365b5f7371f022742f2f114f9bcaf1
+SHA1 (patch-sandbox_linux_services_init__process__reaper.cc) = e5641f024e3af1af4b5080bccf25f59aa111b342
+SHA1 (patch-sandbox_linux_services_libc__interceptor.cc) = e29eb5a7f5fda31466dccbb8c89a040aeea8c756
+SHA1 (patch-sandbox_policy_BUILD.gn) = 40937a548ee504639925df291e7454d1780ac127
+SHA1 (patch-sandbox_policy_features.cc) = 64583b172af2c8636fb7d0b0da05ee50f8e8c6dd
+SHA1 (patch-sandbox_policy_features.h) = e8c548e47c3c93e9ee7fd75c937d8fd59b485cd1
+SHA1 (patch-sandbox_policy_freebsd_sandbox__freebsd.cc) = 698c05f59c5274a8383de4e255a035ad6aa2564a
+SHA1 (patch-sandbox_policy_freebsd_sandbox__freebsd.h) = 5de77367576577a6e4aea5b57e23919355414d1a
+SHA1 (patch-sandbox_policy_mojom_sandbox.mojom) = 92ae00d4f783534eed98ca6260774c9c6e4ba4ad
+SHA1 (patch-sandbox_policy_netbsd_sandbox__netbsd.cc) = 430b150937939debbb80f1d3ee536aabc1a77f4f
+SHA1 (patch-sandbox_policy_netbsd_sandbox__netbsd.h) = 974ae35e079758ccc4438eec882ed178da97a693
+SHA1 (patch-sandbox_policy_openbsd_sandbox__openbsd.cc) = 2a94921b144c3539e07c17dd9c4ebdccc6f3e3e2
+SHA1 (patch-sandbox_policy_openbsd_sandbox__openbsd.h) = 0e80bc4fa01b2419192221263097cff1fb87f014
+SHA1 (patch-sandbox_policy_sandbox.cc) = a489a955d0d92138c1775a82c5a5023fd72dc994
+SHA1 (patch-sandbox_policy_sandbox.h) = 73fadc2633a21e2a47d386c4cefd02431af5c39e
+SHA1 (patch-sandbox_policy_sandbox__type.cc) = cf4e691fae77fba9d0f8d7843c359b65b95260f8
+SHA1 (patch-sandbox_policy_switches.cc) = feda58b887fc4b8d2b619a352507b99e1aebde76
+SHA1 (patch-sandbox_policy_switches.h) = 945d8180b315c72bed3c3075400beab987f5c8fd
+SHA1 (patch-services_audio_audio__sandbox__hook__linux.cc) = bdd4d4ad98f18f51bdf60f4afd81c0346dd4cf8e
+SHA1 (patch-services_audio_audio__sandbox__hook__linux.h) = aea6685707750739f001a12da6ce2954fd0687dd
+SHA1 (patch-services_device_BUILD.gn) = a86d1169b341907b147ffa92438856b177bc18ec
+SHA1 (patch-services_device_geolocation_location__provider__manager.cc) = c37f13320c4b4bdbc085b3fc560d5f89ff771754
+SHA1 (patch-services_device_hid_BUILD.gn) = e9cd5d7a9db610ad57f1a7c13cf86edef9801603
+SHA1 (patch-services_device_hid_hid__connection__fido.cc) = 904c194f0a54e9b5d61941c23241bd621b4c3f17
+SHA1 (patch-services_device_hid_hid__connection__fido.h) = 8dfddb9c0c998c0710cf49b25e3be018a5b026dd
+SHA1 (patch-services_device_hid_hid__connection__freebsd.cc) = 5059233a4afefce0f93f918d06a018eb255d0f1c
+SHA1 (patch-services_device_hid_hid__connection__freebsd.h) = 3a1c298d7d8a32549e4fd1297095b38050f40dd4
+SHA1 (patch-services_device_hid_hid__service.cc) = 5ef971760ceba872ce32775f7dbd982e60742fb0
+SHA1 (patch-services_device_hid_hid__service__fido.cc) = f3fa2b363a11987fc44c8993826d702fa2a1fa48
+SHA1 (patch-services_device_hid_hid__service__fido.h) = 1376af4da593bf00e45ebbc3eb9be4af77e1ff6d
+SHA1 (patch-services_device_hid_hid__service__freebsd.cc) = df8c5cf78aa7db241b9f4c11dfde4db14326b8e2
+SHA1 (patch-services_device_hid_hid__service__freebsd.h) = 179b82ef40be40e46e6055152a049c7beba366ad
+SHA1 (patch-services_device_hid_hid__service__netbsd.cc) = 547be366f81defe9aa5e09285874903ab525c234
+SHA1 (patch-services_device_hid_hid__service__netbsd.h) = 15d5f6d20bffc4ab90e31d74b671580a65a42d8b
+SHA1 (patch-services_device_public_cpp_generic__sensor_sensor__reading.h) = 3069f2e2d0733ba2dc5791f3d83d1154b611035f
+SHA1 (patch-services_device_public_mojom_BUILD.gn) = 89fc0f29a87550b9623f8a06782cd11c676ecf65
+SHA1 (patch-services_device_serial_BUILD.gn) = b2b10b0114f417ecf90bf0c93f35121227676bbb
+SHA1 (patch-services_device_serial_serial__device__enumerator.cc) = 709a580af81847abee1516dcba5246797616add8
+SHA1 (patch-services_device_serial_serial__io__handler__posix.cc) = 1fa625157d54d6441918a2c36a618886cefeed3a
+SHA1 (patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc) = 565cf6cdbf7e8083d53ede8f8698466ed0edb880
+SHA1 (patch-services_device_usb_BUILD.gn) = 40cec3293e43264517f386653cabb76054c5ebf5
+SHA1 (patch-services_device_usb_usb__service.cc) = 05077c4fe04198f4ca7ad677660f22c4f91007f3
+SHA1 (patch-services_device_usb_usb__service__fake.cc) = 8f3c6eac9d107f0490ca1f3b6868cd4e021f6dfc
+SHA1 (patch-services_device_usb_usb__service__fake.h) = 1c69517ddab3176149edda55e56599f5e143867f
+SHA1 (patch-services_network_BUILD.gn) = 510f1e946c1ee731054102ac1311afec13946fe1
+SHA1 (patch-services_network_network__context.cc) = fc4f1b7691aa615bbe359e6fcfc635e0c16ba0a3
+SHA1 (patch-services_network_network__context.h) = 64a36130b1a7e59ea531a99810aa6dfbca85d7ec
+SHA1 (patch-services_network_network__sandbox__hook__linux.cc) = 433895f1a9e68a4d339e6cf53d033e81bd288374
+SHA1 (patch-services_network_network__sandbox__hook__linux.h) = a7e0cedc32de5d7db89b0bd9765ce2e3400098d0
+SHA1 (patch-services_network_network__service.cc) = 718c6d960496368dbd0d54e5a412c2925acd11c4
+SHA1 (patch-services_network_network__service.h) = ddcc6a1d37432bbd0564661ded1c0456b5e20367
+SHA1 (patch-services_network_public_cpp_BUILD.gn) = aa62dc0f46a130c490048a4d46dc8bf790ddf46e
+SHA1 (patch-services_network_public_cpp_features.cc) = f5268e2447affe4b1f94f52c8d0879f3f224c84d
+SHA1 (patch-services_network_public_mojom_BUILD.gn) = 217a8a8dd60d19185288b206cb4725c1ce129fb7
+SHA1 (patch-services_network_shared__dictionary_shared__dictionary__writer__in__memory.h) = c09fb0ee2f0d3cfcf5718b862a9ba1e4fcf67b73
+SHA1 (patch-services_on__device__model_on__device__model__service.h) = 468aba0471f2767d0eb4333b9e1dafb9da82d666
+SHA1 (patch-services_on__device__model_pre__sandbox__init.cc) = abef45f80554519d86468670a93a9d62605e2bbb
+SHA1 (patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc) = 17636644797ff8340246466b5ea4f252b36ae8bb
+SHA1 (patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn) = c85584667107e08d833c28448a48ad2fa7a53dbf
+SHA1 (patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h) = 1fb836984b99875f8a8b8181e0259c0bbe97be69
+SHA1 (patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc) = 501461a5ac8f98f2055755519102a816b89810e5
+SHA1 (patch-services_screen__ai_public_cpp_utilities.cc) = 70c00bdfe441971b2fb67d757d93c743fd8318df
+SHA1 (patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc) = 94daad38e2fa9714b155d464254b9cb815d14e8a
+SHA1 (patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h) = ff864d9ed4eed270dbdfe354dbe5adedad5fe565
+SHA1 (patch-services_service__manager_BUILD.gn) = 2b10c198a612612e793978f1aac9c653f5810949
+SHA1 (patch-services_service__manager_public_cpp_service__executable_BUILD.gn) = 611700378a4ff9d0cc534ebdcea320f7096b8778
+SHA1 (patch-services_tracing_public_cpp_stack__sampling_tracing__sampler__profiler.cc) = 7b08ef97c323d8bca0b94a7c86d14d079fe17bd3
+SHA1 (patch-services_video__capture_public_mojom_video__capture__service.mojom) = 1b141a0b8554538a18f8a7460e122e343a1a6279
+SHA1 (patch-services_video__effects_video__effects__sandbox__hook__linux.cc) = 26056b856b1f5bf159b80b9aed313a9649694093
+SHA1 (patch-services_video__effects_video__effects__sandbox__hook__linux.h) = be3415ba688574dbffba4cfc7b1e219a72db06ee
+SHA1 (patch-skia_ext_SkMemory__new__handler.cpp) = 982f2735a53512c5836a619595876be00349353f
+SHA1 (patch-skia_ext_font__utils.cc) = b721e29d4224e966623fbacaa84e6033752b354f
+SHA1 (patch-skia_ext_platform__canvas.h) = d6d6da04bb1c80d3ce024a9074e1730244c79008
+SHA1 (patch-skia_ext_skcolorspace__trfn.cc) = 2674964bf0ad9f1ff99195f310e07ae1e5e29fce
+SHA1 (patch-third__party_abseil-cpp_absl_base_config.h) = ad95ee414f6781ff7e9c96a425f814e992429822
+SHA1 (patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc) = 4cbedcb2a422806fb3a3cf24672d9008d9df9d3b
+SHA1 (patch-third__party_abseil-cpp_absl_base_internal_sysinfo.cc) = 2bb4ed71c5eac209fcacb897ade3e02149ca012b
+SHA1 (patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h) = 5ac71833820ed28fdd33cee7410710ee047d99a3
+SHA1 (patch-third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc) = 55733c533dae20ffd1bfe988db241da170ad5ff2
+SHA1 (patch-third__party_afl_src_afl-fuzz.c) = 277fc521e819627f5a13ded9a30a10a91bbacbb2
+SHA1 (patch-third__party_angle_BUILD.gn) = 57cd6fba6aec23467ba7aa8b221f0c26c017a234
+SHA1 (patch-third__party_angle_src_common_platform.h) = 77c33c7bf0197649f3423112e789b8539d0c6d28
+SHA1 (patch-third__party_angle_src_common_platform__helpers.h) = e842db3325d0f5a6883927d3c4672a373cb3a4ae
+SHA1 (patch-third__party_angle_src_common_system__utils.cpp) = f5c825057f9e4d746e0d56187a817dc71c749dfb
+SHA1 (patch-third__party_angle_src_common_system__utils__linux.cpp) = 56351399ea7b48528d5821228eb380d4f9fe5afb
+SHA1 (patch-third__party_angle_src_gpu__info__util_SystemInfo__internal.h) = dfbd8ef4e9e8a91b461b7e04133ac32874bb7bdc
+SHA1 (patch-third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp) = 712429321ad70d929a91314f49d7e1443c8058b8
+SHA1 (patch-third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp) = ba21cbf32f10eaee9a8db5f2c89686c8c3a05bd5
+SHA1 (patch-third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp) = c317d31d823c533a32e1e82d3f4f14c9a27bcb0c
+SHA1 (patch-third__party_angle_src_libANGLE_Display.cpp) = 8458f29bcfaf1c778ca3d5069519d952022868f7
+SHA1 (patch-third__party_angle_src_libANGLE_formatutils.cpp) = df2f34e9895bf8b2575b0fc7ce08f10f0e2e2531
+SHA1 (patch-third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp) = f5709a6567f436844756bd968834867c7530dac8
+SHA1 (patch-third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h) = 8107577ec1bcb9d4cbacf99e8aba098371e072a3
+SHA1 (patch-third__party_angle_util_BUILD.gn) = 5c91850c6eaa9c536723e9d15b2d1411bb2304d1
+SHA1 (patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc) = e58b64117f978542a4a87a2972fe39c02274861e
+SHA1 (patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h) = b9c3fa73dde3b8f01cc047859133732dcc0d001e
+SHA1 (patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h) = 2277d158b52c6c247a6981ff77f2429fb3e2124d
+SHA1 (patch-third__party_blink_public_platform_platform.h) = 882abee6711c522c7db413f95a70800ede762dc4
+SHA1 (patch-third__party_blink_public_platform_web__vector.h) = 416f527c25dce4d42ffa940b402c7dd1b9ce0695
+SHA1 (patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py) = 1842557ddffa8d82b9376842183bd9c5562730bc
+SHA1 (patch-third__party_blink_renderer_build_scripts_run__with__pythonpath.py) = 05af39ef834dd1f46af32e67b6a46709beadbc38
+SHA1 (patch-third__party_blink_renderer_controller_blink__initializer.cc) = 27a0cebc81744956842c04aff9fb21298761e203
+SHA1 (patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.cc) = 6124dd70a1f770435446aafa0db4db245d44efcf
+SHA1 (patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.h) = 7dc4f9ba7293b94acfad05eba199a3d0e63a6a16
+SHA1 (patch-third__party_blink_renderer_core_editing_editing__behavior.cc) = eb1aad7752ed5b7dbe60df3559cba3eded825eed
+SHA1 (patch-third__party_blink_renderer_core_execution__context_navigator__base.cc) = 265c60c103f9862ad017b98606c577d0233b1b7b
+SHA1 (patch-third__party_blink_renderer_core_exported_web__view__impl.cc) = f054e539ac53053ca30f97e02f7e66de948219ea
+SHA1 (patch-third__party_blink_renderer_core_frame_web__frame__test.cc) = c2be8f3fe695ea13af08552cf2cc83dc7b20360c
+SHA1 (patch-third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc) = 216d3024a9d5d2d458afc0b9558b5d95f824c8ca
+SHA1 (patch-third__party_blink_renderer_core_inspector_inspector__memory__agent.cc) = 284f75a24bdb83c58a48a9ed6083341812d2c817
+SHA1 (patch-third__party_blink_renderer_core_layout_layout__view.cc) = bc33ef49e6d9872a64d43197ca00d64520aae9e3
+SHA1 (patch-third__party_blink_renderer_core_origin__trials_origin__trial__context.cc) = 4d46cf5a39de055164332be749e0817d83fc3e13
+SHA1 (patch-third__party_blink_renderer_core_paint_paint__layer.cc) = 3fd2e3d8e8f9e7aa0f254d47a5d2aeab0ea8941c
+SHA1 (patch-third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc) = c902d1b3abddaedfa23a87b2b5045871c8d0807d
+SHA1 (patch-third__party_blink_renderer_core_xml_xslt__processor.h) = 5f14caa9287032a2a281530ded0d202ab56a8eaa
+SHA1 (patch-third__party_blink_renderer_core_xml_xslt__processor__libxslt.cc) = 1871aa4f18d1faa9d590f9c8af6d6cb41ac0de43
+SHA1 (patch-third__party_blink_renderer_modules_media_audio_audio__device__factory.cc) = 46416ba4943008cfa77be9cc6ca426bf9d908360
+SHA1 (patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc) = 28b438007b516c9825f4e8640d07e6c12c3475d2
+SHA1 (patch-third__party_blink_renderer_modules_peerconnection_rtc__data__channel.cc) = 0a84af38650b29ce8010f91f318472681b33892f
+SHA1 (patch-third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc) = 8feac805c3325e1be93e43d918abacfedea688d7
+SHA1 (patch-third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc) = c5609ccdb7b9d13d4278e1eeed284b0ba1732b7e
+SHA1 (patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc) = 190f418b497193a6ae6ddcf7296f36c779d89113
+SHA1 (patch-third__party_blink_renderer_modules_webgpu_gpu__queue.cc) = 0ebdbdd46a7c2b2bd5fe9c8cf62744065dcd7aca
+SHA1 (patch-third__party_blink_renderer_platform_BUILD.gn) = 6db9fe48e627ad5c59c6766b253ab4f7b451ae21
+SHA1 (patch-third__party_blink_renderer_platform_fonts_font__cache.cc) = 66cc8eac6a0e4fa47c4572081e8b812a7da8a510
+SHA1 (patch-third__party_blink_renderer_platform_fonts_font__cache.h) = 81e57cd0f97ef061a2af6bad8ec2292a8ddece1f
+SHA1 (patch-third__party_blink_renderer_platform_fonts_font__description.cc) = b493d42cf0e05f592d023a414580f5c77fa39232
+SHA1 (patch-third__party_blink_renderer_platform_fonts_font__metrics.cc) = 9b2f92ffe8b3e003cb6b88876b2202b3b6c8c75e
+SHA1 (patch-third__party_blink_renderer_platform_fonts_font__platform__data.cc) = a81289cf4d7408580212764d3a5bb29e2c80ab4f
+SHA1 (patch-third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc) = c3acdc9ae42f06d90a0d70c8f78aebb2318003c6
+SHA1 (patch-third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc) = 8112744a051ff549e2d51bd100b630ac774db5f8
+SHA1 (patch-third__party_blink_renderer_platform_graphics_begin__frame__provider.cc) = 6c82b4543d1ae95a154ecda5f95a6c88e44e60f2
+SHA1 (patch-third__party_blink_renderer_platform_graphics_gpu_image__layer__bridge.cc) = 1485c7af245e4288bf1a1685ac73b04f808fef26
+SHA1 (patch-third__party_blink_renderer_platform_graphics_video__frame__submitter.cc) = 9a82f6dbfa12f8c11708a6f9878d44b384ef3edf
+SHA1 (patch-third__party_blink_renderer_platform_instrumentation_partition__alloc__memory__dump__provider.cc) = de5d484e79daba120ccf2a7bea777e4e4f744886
+SHA1 (patch-third__party_blink_renderer_platform_peerconnection_rtc__video__encoder__factory.cc) = c43057c27235a3e2bb0efb13e6a32e9c727c130c
+SHA1 (patch-third__party_blink_renderer_platform_runtime__enabled__features.json5) = f44ba0d66c02aeeb366910e6dffd0c78fd454ac2
+SHA1 (patch-third__party_blink_renderer_platform_scheduler_common_thread.cc) = 631a2c826eeea832ffe77a4f41a3cfba4a6139c2
+SHA1 (patch-third__party_blink_renderer_platform_widget_compositing_blink__categorized__worker__pool__delegate.cc) = e49248177e1b01aa0067c3a13f60163f43d6d38f
+SHA1 (patch-third__party_blink_renderer_platform_wtf_container__annotations.h) = e361d6d1a57d4764acbbb0a856be3c40d7e8e7b9
+SHA1 (patch-third__party_blink_renderer_platform_wtf_math__extras.h) = 4346b65f05d634f67c245de378d1e0fcfe691bef
+SHA1 (patch-third__party_blink_renderer_platform_wtf_stack__util.cc) = 1e698836d42c653de47b80a75c525ebc8777679c
+SHA1 (patch-third__party_brotli_common_platform.h) = a9131017cd4f26fda722fc0d6d8d2fe1f7d966d6
+SHA1 (patch-third__party_cpuinfo_cpuinfo.gni) = b61a36ba3b0b6edca3b37589d6d4d0a8022d8b27
+SHA1 (patch-third__party_crashpad_crashpad_build_crashpad__buildconfig.gni) = 0e51b2354343b86397339277944a3200d3d971c2
+SHA1 (patch-third__party_crashpad_crashpad_client_BUILD.gn) = d4386930df6187da076f28a1db6b19cacc981211
+SHA1 (patch-third__party_crashpad_crashpad_client_crashpad__client__posix.cc) = 3291a2ba31e1d14b3f2bf31ab7a71864962d17cb
+SHA1 (patch-third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc) = 73da5cc10db3547fa9c63352877c7f021757289b
+SHA1 (patch-third__party_crashpad_crashpad_util_misc_address__types.h) = 62526d999f9f68f5b4e3daab5737b7914e95895b
+SHA1 (patch-third__party_crashpad_crashpad_util_misc_capture__context.h) = 0afc453e3bb10cad2c04c643acf917092fe77304
+SHA1 (patch-third__party_crashpad_crashpad_util_misc_metrics.cc) = 91af80cc15c5c56f8b13b4cc4b29aa273be5dc9c
+SHA1 (patch-third__party_crashpad_crashpad_util_misc_uuid.cc) = f47db294c43a089d9f17e5c6353bffde48ddb785
+SHA1 (patch-third__party_crashpad_crashpad_util_posix_close__multiple.cc) = 567f62b979951cc3feb91c35b9376a547fc3e318
+SHA1 (patch-third__party_crashpad_crashpad_util_posix_drop__privileges.cc) = 3d11e6e690f6d4b07a2238260aa9624c4615bf9e
+SHA1 (patch-third__party_crashpad_crashpad_util_posix_signals.cc) = 577f2ff2e69d71c3e90a5f84f7ab99fff218d2ef
+SHA1 (patch-third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc) = f4ef7fc96643f69b6b6ba87ee831d56c01a1451b
+SHA1 (patch-third__party_crc32c_BUILD.gn) = 64590b707fdb7984cdda9952a2086337b14123ce
+SHA1 (patch-third__party_dawn_include_dawn_native_VulkanBackend.h) = b69d466b9bda023b41b8d669b7c4092003e9ab42
+SHA1 (patch-third__party_dawn_src_dawn_common_Platform.h) = 2e4c7e4d28a2092e2c7e3d2037171775b62380a2
+SHA1 (patch-third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp) = be2694249abf8b453d56cb7277003d265624eeba
+SHA1 (patch-third__party_ffmpeg_BUILD.gn) = 182451609cc2f9f3602cedd7da725c8615192f4f
+SHA1 (patch-third__party_ffmpeg_libavcodec_x86_cabac.h) = 7baaab7f70778bc2ab455a54fd514421493b1b61
+SHA1 (patch-third__party_ffmpeg_libavutil_cpu.c) = 97d00dee6a3b17f5098faa87705e71f3276a6b7a
+SHA1 (patch-third__party_ffmpeg_libavutil_mem.c) = c125587b13f84c6ad95e66d78b23457bb3200a7f
+SHA1 (patch-third__party_ffmpeg_libavutil_random__seed.c) = 88448ead2863c6119ee6de0e390e67c5e643f5dd
+SHA1 (patch-third__party_ffmpeg_libavutil_x86_x86inc.asm) = 44af1acf6d347a2ef9d98b4cc9f3c09894163da9
+SHA1 (patch-third__party_fontconfig_include_config.h) = e3d3c5d8c3cd5ab60846e6996e2fcce360ca8734
+SHA1 (patch-third__party_fontconfig_src_src_fccompat.c) = a0d5bdf85540b0f8bc62e8eeb12de418d5fd6598
+SHA1 (patch-third__party_ipcz_src_reference__drivers_random.cc) = 393a878f6fe1e24e16b2299ca48b08ac7294716c
+SHA1 (patch-third__party_ipcz_src_standalone_base_logging.cc) = 5c5632c33a54dbe59aa0eaacf28c1cb0781d33ae
+SHA1 (patch-third__party_leveldatabase_env__chromium.cc) = d9b30c0052141ec16cc5bf7cc19b7bf387d0a618
+SHA1 (patch-third__party_libaom_source_libaom_aom__ports_aarch64__cpudetect.c) = a381944dff67af0f323aff3be19b4f6123bc3e91
+SHA1 (patch-third__party_libc++_src_src_chrono.cpp) = 6107eb714cd33fabb4d825300a4ee9d2612b729c
+SHA1 (patch-third__party_libc++_src_src_filesystem_filesystem__clock.cpp) = 0ebfa7210312712473757240b0c8234c89ede6c6
+SHA1 (patch-third__party_libc++abi_src_src_cxa__guard__impl.h) = 1f401e1f2a2d23b7c494fa916d937335bb2a11e1
+SHA1 (patch-third__party_libdrm_src_xf86drmMode.c) = aeb79a1a52a9f2e7876de542d2b958e4c7c8f4a8
+SHA1 (patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_memory_singleton.h) = e29b2fd6c290e4cb2eaddc78b2d8ec78512a5d42
+SHA1 (patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_synchronization_lock.h) = 2ddf0da6e5ad2581cb0de27e780d92b5aab38c5c
+SHA1 (patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_thread__checker.h) = 5bc199a6eaa7cf15e340f1fed9b39bdb771854ec
+SHA1 (patch-third__party_libsync_src_include_sync_sync.h) = f30a946a1dd4a5a3b2b54ebdfbf6e4b44af7ef3f
+SHA1 (patch-third__party_libsync_src_sync.c) = eca43ccd4453e1a790e38ee714d1cbfd2ebc624e
+SHA1 (patch-third__party_libusb_BUILD.gn) = efb0e721d32562be2a37c16e03abf4743f37635f
+SHA1 (patch-third__party_libusb_src_libusb_core.c) = 400282daa3a59b77e90a578405c1db94f35d6fdb
+SHA1 (patch-third__party_libusb_src_libusb_os_threads__posix.c) = 912e1b1b807e819c33b18c03eaed04d8cb00951c
+SHA1 (patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c) = 39be16bc13b656965c1b52768a9396736d8dc23a
+SHA1 (patch-third__party_lzma__sdk_C_CpuArch.c) = 746264b771c97b9907196440e200c5fc0dcaad27
+SHA1 (patch-third__party_material__color__utilities_src_cpp_palettes_tones.cc) = f941db5d2bac1ebc4d0299df1b1cc1d628e22e47
+SHA1 (patch-third__party_nasm_BUILD.gn) = c5f1e24aa2a0461c9374a44b83ffc17285cf2bd6
+SHA1 (patch-third__party_nasm_config_config-linux.h) = 07a4c872eb80b2cf4872ffae3b05e25f92846f6d
+SHA1 (patch-third__party_node_node.gni) = e27c7850813d03d9d5d43557fd184b874f3560bf
+SHA1 (patch-third__party_node_node.py) = 483e33920bd6ffe9b546e92eb6b7fbb0fd681413
+SHA1 (patch-third__party_pdfium_core_fxge_cfx__fontmapper.cpp) = 13d8f72f439d4b43cd5806510160a1a993eeed2c
+SHA1 (patch-third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp) = 55ba9a747ebabfbfaa29f11d23ede1454a77de48
+SHA1 (patch-third__party_pdfium_fxjs_fx__date__helpers.cpp) = 2cd5dd6184fdcf37e123f1332c90a186aee1ee4a
+SHA1 (patch-third__party_pdfium_pdfium.gni) = 84c5164e3058d29b4c13c477095787da9f7897f1
+SHA1 (patch-third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp) = ef446af252b8aa77176c66951c04eba857a4a938
+SHA1 (patch-third__party_perfetto_include_perfetto_base_build__config.h) = 5df210b3cab72c92d7eba972fef0b4800e3d7875
+SHA1 (patch-third__party_perfetto_include_perfetto_base_thread__utils.h) = 846e5fc311948bae8e601f1848173cd6168473ec
+SHA1 (patch-third__party_perfetto_include_perfetto_base_time.h) = 29f35c95e2a4a3dcaf1b7467bd2121ebdb594c76
+SHA1 (patch-third__party_perfetto_include_perfetto_ext_base_event__fd.h) = 78d279e31423874b03171e3e38506b48a1ca39fd
+SHA1 (patch-third__party_perfetto_include_perfetto_ext_base_thread__utils.h) = 7df3423d02df98ac4ac6f51ee81f10c89047cb71
+SHA1 (patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__legacy.h) = 68a9d0ec2968f1344f1e182763fbd7d950d4eadc
+SHA1 (patch-third__party_perfetto_protos_perfetto_trace_ftrace_v4l2.proto) = ea99b5717e640b48259abf434db32f6c973b843f
+SHA1 (patch-third__party_perfetto_src_base_clock__snapshots.cc) = 6c0cd48066653ae9efa01bddb60478556b48ffa5
+SHA1 (patch-third__party_perfetto_src_base_event__fd.cc) = e2b6d1275e18cdef9d2df3fa9a7d7adc531b28fb
+SHA1 (patch-third__party_perfetto_src_base_periodic__task.cc) = ddd2b926911d04aab2d4c1e4a3f8f243bdc1646b
+SHA1 (patch-third__party_perfetto_src_base_string__utils.cc) = 602e05143241b85dc63b3d0a28c0a207434a6339
+SHA1 (patch-third__party_perfetto_src_base_subprocess__posix.cc) = 2ad38ae541b0289e718cd08aa648e4fd44a21d41
+SHA1 (patch-third__party_perfetto_src_base_test_vm__test__utils.cc) = e54eb1a088ed98462dfc032e2333a3c1592a5709
+SHA1 (patch-third__party_perfetto_src_base_thread__task__runner.cc) = 6aab75cf14feab03aeea34bc6458a01bc141de44
+SHA1 (patch-third__party_perfetto_src_base_unix__socket.cc) = 396efdb5297906cf01d1e813a7f44537f3dc523b
+SHA1 (patch-third__party_perfetto_src_base_utils.cc) = 7ae0196a9d7397e7313ad4d3ebf7407cba526365
+SHA1 (patch-third__party_perfetto_src_trace__processor_importers_ftrace_v4l2__tracker.cc) = 48c4a434d6aad903d3da3468b3ab289d0a978f0f
+SHA1 (patch-third__party_perfetto_src_tracing_ipc_memfd.cc) = 0b5dfa63e7cb5b7ab63be47a3274bf0543395b2b
+SHA1 (patch-third__party_perfetto_src_tracing_platform__posix.cc) = 601edf23d499be1c7bb93072ecceb9c4e01fa97e
+SHA1 (patch-third__party_perfetto_src_tracing_track.cc) = a491c8df7fe5652eb827400a627cbac9f77b78e5
+SHA1 (patch-third__party_protobuf_src_google_protobuf_stubs_platform__macros.h) = defe76cef373602c89e12819465b7d5e2469bbeb
+SHA1 (patch-third__party_skia_src_gpu_ganesh_GrAutoLocaleSetter.h) = b2324566c10820828132b3f2c74da8a5eaa14886
+SHA1 (patch-third__party_skia_src_ports_SkMemory__malloc.cpp) = a88ffc780a11a19f5556b79c168f2b8dc0f1b571
+SHA1 (patch-third__party_skia_src_ports_SkOSFile__posix.cpp) = 3a6dff6b0a6f6a0ed6b07944a4b235a60d1afec6
+SHA1 (patch-third__party_speech-dispatcher_libspeechd__version.h) = 294105bbe9ec43e3e14d554ca58bb2b6347842ea
+SHA1 (patch-third__party_speech-dispatcher_speechd__types.h) = a9b4c3b6d852ae42ff1bd7e7306e92c9c3e5d67a
+SHA1 (patch-third__party_sqlite_BUILD.gn) = b9bc1f1a4787ed9374cbd047747debc9f3490173
+SHA1 (patch-third__party_sqlite_src_amalgamation__dev_sqlite3.c) = 272e32f59427b16b5c735a70452d34eeb17c355f
+SHA1 (patch-third__party_sqlite_src_amalgamation_sqlite3.c) = 239fbb574f41815b7ead1a7030a81c3088f26cdf
+SHA1 (patch-third__party_swiftshader_src_Reactor_Debug.cpp) = 01bdbf0492be61f8aff9de757fe7f52957f881b9
+SHA1 (patch-third__party_swiftshader_src_System_Configurator.cpp) = 97771c3b6d9ae1f276dbb9528261a3d3d0cd8311
+SHA1 (patch-third__party_swiftshader_src_System_Linux_MemFd.cpp) = 6572021232a60a23ec94e165e3a0be94fdace132
+SHA1 (patch-third__party_swiftshader_src_Vulkan_VkSemaphoreExternalLinux.hpp) = 740958ee969c178b1d6a220d6cdc31785b55fb68
+SHA1 (patch-third__party_swiftshader_src_WSI_libXCB.cpp) = 32ebea43b3ba88621493270bf473644c322fe864
+SHA1 (patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h) = 822be214b9bfc1b44635bf04eaf8795340900262
+SHA1 (patch-third__party_swiftshader_third__party_llvm-subzero_build_Linux_include_llvm_Config_config.h) = 4be5107da3ae79283ce8b797a364b8732f2e5a16
+SHA1 (patch-third__party_swiftshader_third__party_marl_src_memory.cpp) = 1d233e18f77cc0f8de829d253e3e691ed4eb7867
+SHA1 (patch-third__party_swiftshader_third__party_marl_src_thread.cpp) = e088b17ceeb36c4ffe41345db9a6e107224f06df
+SHA1 (patch-third__party_test__fonts_fontconfig_BUILD.gn) = 349aaf3eadffe288aa66fd246197224512cc436b
+SHA1 (patch-third__party_test__fonts_fontconfig_fontconfig__util__linux.cc) = 65b7515018694696550b84519a15563dac83ddfe
+SHA1 (patch-third__party_test__fonts_fontconfig_generate__fontconfig__caches.cc) = 6b8a695cb8eddfb695e5353ccdb850ec727f86a7
+SHA1 (patch-third__party_tflite_features.gni) = 0fe46c4f22ca26779c3ebf202277a2a342b048e2
+SHA1 (patch-third__party_unrar_src_crypt.cpp) = 43d673bb1af8a2a0fbcb3f9e3483a277a573ecef
+SHA1 (patch-third__party_vulkan-validation-layers_src_layers_external_vma_vk__mem__alloc.h) = 91080504b70bfbcac62ad87185fd626b2b5ae9de
+SHA1 (patch-third__party_vulkan-validation-layers_src_layers_vulkan_generated_vk__function__pointers.cpp) = a9b7c13c2aeddd1d3fe292b61c3b207693fe9d43
+SHA1 (patch-third__party_vulkan__memory__allocator_include_vk__mem__alloc.h) = f8571cdbbf3f97f29fadd6dacc8925a830eb0d0a
+SHA1 (patch-third__party_wayland_BUILD.gn) = 1fc6fd7946d38463cfb5c479fbce244ef627ca4e
+SHA1 (patch-third__party_wayland_include_config.h) = c03276ac49fb0ce2d0ee6253d2eee0a1a57f0513
+SHA1 (patch-third__party_webrtc_BUILD.gn) = 23bd03c7f6feca45da795b3fa79cc059d658f543
+SHA1 (patch-third__party_webrtc_modules_audio__device_BUILD.gn) = 856d51ec2077b5c56a6dd4dbfd571cb42dd59375
+SHA1 (patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc) = 5556055991a2db7e09d9dc17c43a3bad32f9369b
+SHA1 (patch-third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc) = a6a9bddd2bf03a6c9bbf5e637038f2c18cf18485
+SHA1 (patch-third__party_webrtc_modules_video__coding_codecs_av1_libaom__av1__encoder.cc) = c78c16f93c00d2b9ee8b7b67ffbc639de18ff8ff
+SHA1 (patch-third__party_webrtc_rtc__base_byte__order.h) = ff8e2ea23d785cb296d6d5be509c4968d6cd0585
+SHA1 (patch-third__party_webrtc_rtc__base_ip__address.cc) = 8627ab23386b55bff2acf8dd0a46989bff3f005e
+SHA1 (patch-third__party_webrtc_rtc__base_net__test__helpers.cc) = 92e38631588ac396ae393c3b807fee9660c9d0bb
+SHA1 (patch-third__party_webrtc_rtc__base_network.cc) = d86a3f784b8a36831535f7303379c026c562832d
+SHA1 (patch-third__party_webrtc_rtc__base_physical__socket__server.cc) = f4ba29e13f2522956d6e685e4de095a8d8404044
+SHA1 (patch-third__party_webrtc_rtc__base_physical__socket__server.h) = 980bf952a12b9331e0f93b564ae6707b426d3389
+SHA1 (patch-third__party_webrtc_rtc__base_platform__thread__types.cc) = debb7bee69bf8d643b25052b79e0d4b1253cd7c2
+SHA1 (patch-third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h) = 9bd1f07f9aaa6ab131589239966bd1e565c53eda
+SHA1 (patch-third__party_webrtc_system__wrappers_BUILD.gn) = e25ccea9cdb3749b0e6cb060dce0ac8d19c7064c
+SHA1 (patch-third__party_widevine_cdm_widevine.gni) = 8adffb2b95ae318e4db9efde9f813999c0613754
+SHA1 (patch-third__party_zlib_BUILD.gn) = bb16cc6b0fb269846af1658ecbeaacf8d9745f04
+SHA1 (patch-third__party_zlib_cpu__features.c) = d2faa0c69820b353e521bf2ba28f91913647d047
+SHA1 (patch-tools_generate__shim__headers_generate__shim__headers.py) = b494f8361bce0c22ff56ea3055334fe1a86539b5
+SHA1 (patch-tools_generate__stubs_rules.gni) = 77dd5741effacd449325e39448d5fa1b30511080
+SHA1 (patch-tools_gn_build_build__linux.ninja.template) = 2c45189cf6068abe47e9ed4e47df0fe6b45c70b6
+SHA1 (patch-tools_gn_build_gen.py) = 63dca7c4e5b1b42a1bb82bc86c1e8971b7823f26
+SHA1 (patch-tools_gn_src_base_files_file__posix.cc) = e90e776484ccff749bc6533865d7e09d3ddd271d
+SHA1 (patch-tools_gn_src_gn_version.h) = ffa17ea3278c066c96a0eab1cc3b543e1cc2fc80
+SHA1 (patch-tools_gn_src_util_exe__path.cc) = 4b694bf0692e25aeeb133f2f9d9c64c367477756
+SHA1 (patch-tools_grit_grit_node_base.py) = 10790acebf88691e1a4d6fc7f63cae20d3734f16
+SHA1 (patch-tools_json__schema__compiler_cpp__bundle__generator.py) = 96fa7749b14399b29998d26f8a1f543218089081
+SHA1 (patch-tools_json__schema__compiler_feature__compiler.py) = 8ecae6c5f93676f80636bd41bf4bf879e55700ba
+SHA1 (patch-tools_memory_partition__allocator_inspect__utils.h) = f79fbdfa29d43ad142ab279724fe9ad2c0a56f7f
+SHA1 (patch-tools_perf_chrome__telemetry__build_BUILD.gn) = 725b24002f8538df37f106ab515122472111b3cc
+SHA1 (patch-tools_protoc__wrapper_protoc__wrapper.py) = a999a1b22a2351551f502f9a66c7786a9443f051
+SHA1 (patch-tools_v8__context__snapshot_BUILD.gn) = 6d9fa936f08187271e9530712b673ad30c4c2ad1
+SHA1 (patch-tools_variations_fieldtrial__to__struct.py) = 211536f1bd87e5c3757e934f40c77020ce343094
+SHA1 (patch-ui_aura_client_drag__drop__client.h) = 6daaf05da0ce8f792c61f9b4ddd38dccd9451fb0
+SHA1 (patch-ui_aura_screen__ozone.cc) = c48f11457403fe606a75929760ecb09a99f37206
+SHA1 (patch-ui_aura_screen__ozone.h) = d3efd9df34e5ceb7c737378245ca28419e2586ae
+SHA1 (patch-ui_base_accelerators_accelerator.cc) = 28eaab8a0e681e2eb41a4f77795569613bc5ff6a
+SHA1 (patch-ui_base_clipboard_clipboard__constants.cc) = 9f7ecfb962c5a55fc203ef9bcb8cc4773ab7973b
+SHA1 (patch-ui_base_clipboard_clipboard__constants.h) = 939696a7b04b0b0a4d948fd56a07d9fc5df70a19
+SHA1 (patch-ui_base_clipboard_clipboard__non__backed.cc) = a3e9683872f644d0c4847f82e0fd9b48c084d147
+SHA1 (patch-ui_base_cursor_cursor__factory.cc) = f68b96af3a7a17a19cf455fa0d64577b314fd039
+SHA1 (patch-ui_base_cursor_cursor__factory.h) = b4f29470af93a11f0c9e48ee1ef0c41307e31a2f
+SHA1 (patch-ui_base_dragdrop_os__exchange__data__provider__factory.cc) = da60c917ac488601a47b9bcc3d29b9c1f5a21128
+SHA1 (patch-ui_base_dragdrop_os__exchange__data__provider__non__backed.cc) = 20b100872d6e69b8c6f8389265258adeeea4542e
+SHA1 (patch-ui_base_ime_dummy__text__input__client.cc) = 23d1f8105839b888be3f3e6cef5eef17757eaf5b
+SHA1 (patch-ui_base_ime_dummy__text__input__client.h) = 481550834a94da6636f727faac4c790ea629924a
+SHA1 (patch-ui_base_ime_fake__text__input__client.cc) = 6d3a8b4c5d7fd8503352f48085625e82d27733b4
+SHA1 (patch-ui_base_ime_fake__text__input__client.h) = 45eb5118151fb9038fb55d083b4efe70253d0650
+SHA1 (patch-ui_base_ime_init_input__method__initializer.cc) = b0b79dc9d3e78057a1aea6f1a81f0e4af0eb540f
+SHA1 (patch-ui_base_ime_linux_linux__input__method__context__factory.cc) = 930190be282ac805d42a6e87f02f2d9ce40824ce
+SHA1 (patch-ui_base_ime_text__input__client.h) = 7b28922feaaabafdecca755aa73590e4314d92f3
+SHA1 (patch-ui_base_resource_resource__bundle.cc) = 2467c5b7433ce5a5e25267ff06c14e9c525a6df9
+SHA1 (patch-ui_base_test_skia__gold__pixel__diff.cc) = a62b810125758c19ecbfc68b01f0e2d93f616e5b
+SHA1 (patch-ui_base_test_ui__controls.h) = d02c6687699e39fedbbc2e484f00710cd8030509
+SHA1 (patch-ui_base_ui__base__features.cc) = d1bf5a60cd0ff0219086a0fb55df27a1a6c9faab
+SHA1 (patch-ui_base_ui__base__features.h) = 3be879dd25c5afd7a78eb28950e2c1c68ca0e08f
+SHA1 (patch-ui_base_ui__base__switches.cc) = baf240f37398c3d3845160814821c6741c51ac85
+SHA1 (patch-ui_base_ui__base__switches.h) = ca2b0173652d134b1f9efdea37d28562329cd5d3
+SHA1 (patch-ui_base_webui_web__ui__util.cc) = f5bc1661a6e3ade666ae566e7af5bb8be8305b97
+SHA1 (patch-ui_base_x_x11__cursor__factory.cc) = e4ac2338ab921a11abd6d8417290779bc06db5bd
+SHA1 (patch-ui_base_x_x11__cursor__factory.h) = 3fec224abea44b56b0c883212df305f390e5b068
+SHA1 (patch-ui_base_x_x11__cursor__loader.cc) = 1a3cf9a75a8b56e6bacf87159f3080087b74f2a7
+SHA1 (patch-ui_base_x_x11__display__manager.cc) = c730bd9f295b69e39d8f58281f2be01ed0be59b1
+SHA1 (patch-ui_base_x_x11__shm__image__pool.cc) = ac4770494e55f520200c9d633610c3c3d04c1dca
+SHA1 (patch-ui_color_color__id.h) = 0054006854fcc5b395d5b6298801444aece8183b
+SHA1 (patch-ui_color_color__provider__utils.cc) = 4d96aef171ddd9a92b0dc56cf1878114add5bf5d
+SHA1 (patch-ui_color_system__theme.h) = 597598cbb3f802f200a8819bbe8f94bb26e9caad
+SHA1 (patch-ui_compositor_compositor.cc) = cfb22da60d72108310a94fe726428b383285f899
+SHA1 (patch-ui_compositor_compositor.h) = 05e695a806c51e1815b9f5b0a42fec5337324bb4
+SHA1 (patch-ui_compositor_compositor__observer.h) = 02e350f33a29679905b7881f903ce3d886ce011b
+SHA1 (patch-ui_display_screen.cc) = 3c54dda0ea04e7be23965841365a40a94d625945
+SHA1 (patch-ui_display_screen.h) = e6cd3a17d864036458b8c6e5b75a62ea0484976d
+SHA1 (patch-ui_events_devices_x11_device__data__manager__x11.cc) = da02a87d261c0b28558b07f891a39ce25af9595f
+SHA1 (patch-ui_events_event.cc) = f75b032ae1cae6a540d885c799ffdd86ba8b0e1e
+SHA1 (patch-ui_events_event__switches.cc) = 507bd169791ba46d129d19d4b3f74a959b563bfe
+SHA1 (patch-ui_events_event__switches.h) = 9e6387102eb2666e24093d910f5ac9cdf297ef63
+SHA1 (patch-ui_events_keycodes_dom_keycode__converter.cc) = c7c5f748a43daf5d2790b2cef1607e113866b14d
+SHA1 (patch-ui_events_keycodes_dom_keycode__converter.h) = 1e552a041d0b1295a930098d44c6356af9cc33c2
+SHA1 (patch-ui_gfx_BUILD.gn) = 177cea8a4b8eb4dfee4e196403cbbce675813952
+SHA1 (patch-ui_gfx_canvas__skia.cc) = 3f704fd58efbbdfdb4d856b5cade50066bf7cf32
+SHA1 (patch-ui_gfx_font__fallback__linux.cc) = f88153874245609a8f0dde0877411fcef726e5fd
+SHA1 (patch-ui_gfx_font__render__params.h) = b73bc6f4163b17cb4805a527e3c9b3b4addb8d37
+SHA1 (patch-ui_gfx_font__render__params__linux.cc) = 46cda6950ba78af228ec33c2fc625f4674e60fa6
+SHA1 (patch-ui_gfx_font__util.cc) = 14d7f6f93bf56e7f58ca2daae3c0599d2d2f87e1
+SHA1 (patch-ui_gfx_gpu__memory__buffer.cc) = 6caf597429b6346b450a4e7fa67687143bc47b70
+SHA1 (patch-ui_gfx_gpu__memory__buffer.h) = 06abef9a26fc8d046ced3d36c83404e392a51b32
+SHA1 (patch-ui_gfx_linux_dmabuf__uapi.h) = 8be516fba8c0f5a3b9a45e15e52627ee618a914a
+SHA1 (patch-ui_gfx_linux_gbm__wrapper.cc) = 6ed1ed733a8b90d81f96d58a5422f8dd381be2ba
+SHA1 (patch-ui_gfx_mojom_buffer__types__mojom__traits.cc) = a5cf166c480000134883c80dc92754e36797d59b
+SHA1 (patch-ui_gfx_mojom_native__handle__types__mojom__traits.cc) = 661baa43e6a5c51b8b7205b8b05215d36d8e04c9
+SHA1 (patch-ui_gfx_mojom_native__handle__types__mojom__traits.h) = 71da280b3905988c57566ce7d636d2aadee528bd
+SHA1 (patch-ui_gfx_native__pixmap__handle.cc) = 9be943b7b49d2cea2a456227ef4f447be81f3a26
+SHA1 (patch-ui_gfx_native__pixmap__handle.h) = f2d2f89c06f063f632b607246ca2b80770b1cc2f
+SHA1 (patch-ui_gfx_native__widget__types.h) = 71f5da228cbfc36ab7591ab8c68f525d7b73aeb5
+SHA1 (patch-ui_gfx_platform__font__skia.cc) = 113dc14bccabb6ab109db23d1db862984da85bb8
+SHA1 (patch-ui_gfx_render__text__api__fuzzer.cc) = fa13c94ff7d168a8147422d76c2d5405bce96040
+SHA1 (patch-ui_gfx_render__text__fuzzer.cc) = b39d400aaab02c9dd0d9f15bb7a0b1f0a68b5e83
+SHA1 (patch-ui_gfx_switches.cc) = 26d5051a3020209e34d87a0fcfd53bdc2f8ab659
+SHA1 (patch-ui_gfx_switches.h) = 83bc5aee684db8e613cf0fa3ab49b5877aecb06c
+SHA1 (patch-ui_gfx_x_atom__cache.cc) = b3383412344d6339105824baaa37682a0c6ebe55
+SHA1 (patch-ui_gfx_x_generated__protos_dri3.cc) = 86cafc459aa52de10385c9b88c07a79799a01dd1
+SHA1 (patch-ui_gfx_x_generated__protos_shm.cc) = b746b01081f5e72e9a697e7122194f66f7484049
+SHA1 (patch-ui_gfx_x_xlib__support.cc) = bf4e5b67299542cbb633d45770b7c1aaf25e2dba
+SHA1 (patch-ui_gl_BUILD.gn) = 24a625366caae47e113a4114a6bb07b3fbb767f5
+SHA1 (patch-ui_gl_gl__context.cc) = 08ead2480784a8aa453c79709170af029c0dbc75
+SHA1 (patch-ui_gl_gl__fence.cc) = 86c7b7a17fdef0e1a93a981c97dd5edffee844bd
+SHA1 (patch-ui_gl_gl__implementation.cc) = e48231ba73e980f95aab4264463a73ff1892ccf2
+SHA1 (patch-ui_gl_gl__switches.cc) = 7667214f3830ca1bffbb33a23e7e1998a408d09b
+SHA1 (patch-ui_gl_sync__control__vsync__provider.cc) = 8c9c30c74354c50f3fe346b1adb312b313bd58bf
+SHA1 (patch-ui_gl_sync__control__vsync__provider.h) = d60b4f2030b1f70a5516812063fbe4423ecc9ce7
+SHA1 (patch-ui_gtk_gtk__compat.cc) = e9b5532b8647de74b713b8f156f29b31985f58b2
+SHA1 (patch-ui_gtk_printing_print__dialog__gtk.cc) = a787a68e1d36bf4bdf1e4849e01fc54207403f4b
+SHA1 (patch-ui_message__center_views_message__popup__view.cc) = 022d07a9248f169eac740d635bb20b435a201c52
+SHA1 (patch-ui_native__theme_native__theme.h) = 271e1db22dc3a10a6c8352a874aa2f40c58cc7a7
+SHA1 (patch-ui_native__theme_native__theme__base.cc) = f81b4e838ae6f26c302282f9d68ccd76b37c1d5c
+SHA1 (patch-ui_native__theme_native__theme__features.cc) = 33d808a981b6fe1ee3445a4a6a0798ac262d279a
+SHA1 (patch-ui_ozone_common_egl__util.cc) = 10e98f41e639e750714f593d96e6632d1936f2f3
+SHA1 (patch-ui_ozone_platform_headless_headless__surface__factory.cc) = b5d59392900f7f37dbbd15559c284b3ab7864b91
+SHA1 (patch-ui_ozone_platform_headless_ozone__platform__headless.cc) = d2340e46863f02c03414d293bccc325efed6b4e0
+SHA1 (patch-ui_ozone_platform_headless_vulkan__implementation__headless.cc) = 45e3ea7b8b626ddeb0870ec2d5849cfc3d180465
+SHA1 (patch-ui_ozone_platform_wayland_common_wayland__util.cc) = 66a084c0e67348fe413095c1a078fbd7d8f89427
+SHA1 (patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.cc) = e819f7a05812f0f4158a04cf8b1a565e783414ab
+SHA1 (patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.h) = b0119278060196befe4a696125f9da40aade6a8e
+SHA1 (patch-ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc) = 25e64c7ce06a7053fe165caab286221a0eac85d7
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__connection.cc) = 236b2962bb5a0e3255caa2e963fb215edd3668af
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__input__method__context.cc) = e832328a6779b3b973eae807a5f196bbed9dc49b
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__popup.cc) = 01f1219ba80d9b999d96430815ea2de60cbec732
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.cc) = 7f37eb8afe5e67c9e59287c27842f9c4547e4ae0
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.h) = 0d19a702fc42d6730714cf2c2ac949b1b86ff439
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__window.cc) = 185304d8e5de0650c94a1603987f6e3afd0533b8
+SHA1 (patch-ui_ozone_platform_wayland_host_wayland__window.h) = 07252db8676c5acce9f07ca71b7830370e50f72c
+SHA1 (patch-ui_ozone_platform_wayland_host_zwp__text__input__wrapper__v1.cc) = c79bde3ad7dd7162dc59ef2ca677afe5456dd190
+SHA1 (patch-ui_ozone_platform_wayland_ozone__platform__wayland.cc) = 32f64db4b46cacede3c602760245387bcd006aa2
+SHA1 (patch-ui_ozone_platform_x11_vulkan__implementation__x11.cc) = 287ae4eb8dd38d1c521b3ab5cdf9cbdd0f7f97d5
+SHA1 (patch-ui_ozone_platform_x11_x11__screen__ozone.cc) = c6a55164455c2dddf21d6161a880e18386d6a85e
+SHA1 (patch-ui_ozone_platform_x11_x11__screen__ozone.h) = 285d71166fe4db4627773066a2234f28b188abfa
+SHA1 (patch-ui_ozone_platform_x11_x11__window.cc) = b2f6393fe7bc65c69e0ad6eab1ad7965094ca724
+SHA1 (patch-ui_ozone_test_mock__platform__window__delegate.h) = 9c5c4de2dddd25f0115efd1253d6ddb01f348f65
+SHA1 (patch-ui_platform__window_platform__window__delegate.cc) = bc6675aa7a7935dc55184acf9b0b22c8851309b6
+SHA1 (patch-ui_platform__window_platform__window__delegate.h) = 5be6f708a10f356191b46ab2be42804a18d5b108
+SHA1 (patch-ui_platform__window_platform__window__init__properties.h) = 8bc8c6eec9f784abb7c438a2d7ab3829b3ac4633
+SHA1 (patch-ui_qt_BUILD.gn) = 38511972d842a082e0c3fae90904a5ad6bd37f14
+SHA1 (patch-ui_qt_qt.gni) = f5b394ac11d29e026355b403ac8e4f3ff2822510
+SHA1 (patch-ui_strings_translations_app__locale__settings__bn.xtb) = cf65965442ecf033787aa51dc6b7f8e811745a97
+SHA1 (patch-ui_strings_translations_app__locale__settings__ja.xtb) = 595a99f919a74d78f93ba43b5643ecd625b3c4b8
+SHA1 (patch-ui_strings_translations_app__locale__settings__ko.xtb) = 2d9cef0d3fd5e20be6e43e7617b0df2557b9b05b
+SHA1 (patch-ui_strings_translations_app__locale__settings__ml.xtb) = 79a1bf889b3b135556fedeb0885c66da589b5260
+SHA1 (patch-ui_strings_translations_app__locale__settings__th.xtb) = 89475590b09fbe97ab0329ecc8c29287f003340f
+SHA1 (patch-ui_strings_translations_app__locale__settings__zh-CN.xtb) = 96e7904680e431006b772c49b4be538689eab9ab
+SHA1 (patch-ui_strings_translations_app__locale__settings__zh-TW.xtb) = 0936deba5752d7d343e6f2a4165fbd28bb2ed55a
+SHA1 (patch-ui_views_controls_prefix__selector.cc) = cc5acec7947d6db8d258c0b2c81086f3372d2a44
+SHA1 (patch-ui_views_controls_prefix__selector.h) = 34e617727c8dfca9d88ec9bbd22276bce44130d5
+SHA1 (patch-ui_views_controls_textfield_textfield.cc) = 8612269eaf2f36a845500f023aee512848217784
+SHA1 (patch-ui_views_controls_textfield_textfield.h) = 6db3560f605434ce34c129f5dc87938ce567f677
+SHA1 (patch-ui_views_corewm_tooltip__aura.cc) = 4fa7aea7333c5c8e4057375ea600a765f12c8d02
+SHA1 (patch-ui_views_examples_widget__example.cc) = 087410e6c62b268b6a70e62d1b7071b52fb7c2c2
+SHA1 (patch-ui_views_focus_focus__manager.cc) = 7daf90510eebb3424e5507cec3e714928172c461
+SHA1 (patch-ui_views_style_platform__style.cc) = 1680bc32db9c361e283b4bc197fff95b0374e925
+SHA1 (patch-ui_views_test_ui__controls__factory__desktop__aura__ozone.cc) = b92238ffc12c0980f59859ed9827dcdca2f64561
+SHA1 (patch-ui_views_views__delegate.cc) = 7788f48774d46a1ea0af13b45a575f31e5bfe51b
+SHA1 (patch-ui_views_views__delegate.h) = 101c0870ffc169a75b87774567613d881fc1959a
+SHA1 (patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.cc) = 0bcda61ad37e9465553f6075fa1b19952d51c51f
+SHA1 (patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.h) = deee7e3f39340fe9c622e09e97d8bcf843a37780
+SHA1 (patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc) = 904893ba92649989293106192e894f5575df76ce
+SHA1 (patch-ui_views_widget_root__view.cc) = 7f397b584101a178ae74a15f17e400d50d78c74c
+SHA1 (patch-ui_views_widget_widget.cc) = 9d0d21b687123a63f0f2eadca6041e3bfc2d4b58
+SHA1 (patch-ui_views_window_custom__frame__view.cc) = 0705b9e12199952af41e74cdb4668d124b7ac8aa
+SHA1 (patch-ui_views_window_dialog__delegate.cc) = 8fda16a84ef2702865171f020ecb229165fab275
+SHA1 (patch-ui_views_window_frame__background.cc) = f6df3811614dc9b2066d1b8a10d8a20b52061633
+SHA1 (patch-v8_BUILD.gn) = 7f016adac58df0211e6d6bcaf45e12f98035194e
+SHA1 (patch-v8_include_v8-internal.h) = 24a4dba5c74321528318a681342313d96d71b65d
+SHA1 (patch-v8_include_v8config.h) = da060b309f61a23a11cb74c9c68c3801d75e5d15
+SHA1 (patch-v8_src_api_api.cc) = d7c051549f74c2b16db84163331b98072316bfe0
+SHA1 (patch-v8_src_base_atomicops.h) = 3d3a733c1e8facb6f5dbec864ed8d0357eb3484f
+SHA1 (patch-v8_src_base_platform_memory.h) = 8ac495946796b6f0f2b875678d7e1894545c67b3
+SHA1 (patch-v8_src_base_platform_platform-freebsd.cc) = 1ebca13e4daee0bed655128928cbb33bd9550268
+SHA1 (patch-v8_src_base_platform_platform-openbsd.cc) = 90fe6b0b666459df172f421d561328008b0e2dd5
+SHA1 (patch-v8_src_base_platform_platform-posix.cc) = fa3b692920a03279e88d059bf8cf5da69133c213
+SHA1 (patch-v8_src_base_small-vector.h) = f6b205d65e9166fb5d93dc86c5e1fb0758313e10
+SHA1 (patch-v8_src_base_strings.h) = 172f31b33ea7cf09314886eb642f1779cccc23c6
+SHA1 (patch-v8_src_base_sys-info.cc) = f146448ad391886fa2d269f3ec6b6c1b6d6f43f6
+SHA1 (patch-v8_src_base_utils_random-number-generator.cc) = 01c7608c91ffac863f94cb3c7ce94472faa4ac9b
+SHA1 (patch-v8_src_diagnostics_perf-jit.cc) = a32969c8cd036c57070c7addd12acfad978c717c
+SHA1 (patch-v8_src_diagnostics_perf-jit.h) = a538dbd46773abf5cc40e9afcdd7fb2d464dc177
+SHA1 (patch-v8_src_execution_isolate.cc) = 555f8826fc0a7ed405897fdeb255a1d506af579e
+SHA1 (patch-v8_src_flags_flags.cc) = c0dd397bc7f1f49a3d8f80f50ea69c8e1a76ef58
+SHA1 (patch-v8_src_libsampler_sampler.cc) = 03f3df367f49f2abfca26a775ddf883db518838c
+SHA1 (patch-v8_src_sandbox_sandbox.cc) = d81b8a4100e9e4724c6ee2c601a43f100596af5f
+SHA1 (patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.cc) = 93c28a4e2bcd1985b498ed609e2d58b2b38b3eeb
+SHA1 (patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.h) = c21afb1718cf76338cd66d7da83201635fc52634
+SHA1 (patch-v8_src_snapshot_embedded_platform-embedded-file-writer-generic.cc) = 177d3601462bc716e3788372cfad4826ee861bd3
+SHA1 (patch-v8_src_trap-handler_handler-inside-posix.cc) = 3fd62026ee98155cf925d8d6d1557b2af431c7cf
+SHA1 (patch-v8_src_trap-handler_handler-inside-posix.h) = 6f504a1b21ea9f88e3ceda21e84d43c39f75ccfc
+SHA1 (patch-v8_src_trap-handler_trap-handler.h) = e1ed477fe141a09d0b172d612bf1e8ea0f3c72c0
+SHA1 (patch-v8_src_wasm_baseline_ia32_liftoff-assembler-ia32-inl.h) = 95c346fe51a4e6512568c8917bc6d02f84ef63c3
+SHA1 (patch-v8_tools_run-paxctl.py) = 45813a7f47e47053a70f0c1bacf59dfd1d0ecfb1
+SHA1 (patch-v8_tools_run.py) = df385f65303354d4e724e2e77d6d5468ebe32635
diff --git a/chromium-next/files/chromium-browser.desktop b/chromium-next/files/chromium-browser.desktop
new file mode 100644
index 0000000000..163a834091
--- /dev/null
+++ b/chromium-next/files/chromium-browser.desktop
@@ -0,0 +1,220 @@
+[Desktop Entry]
+Version=1.0
+Name=Chromium Web Browser
+# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
+# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
+GenericName=Web Browser
+GenericName[ar]=متصفح الشبكة
+GenericName[bg]=Уеб браузър
+GenericName[ca]=Navegador web
+GenericName[cs]=WWW prohlížeč
+GenericName[da]=Browser
+GenericName[de]=Web-Browser
+GenericName[el]=Περιηγητής ιστού
+GenericName[en_GB]=Web Browser
+GenericName[es]=Navegador web
+GenericName[et]=Veebibrauser
+GenericName[fi]=WWW-selain
+GenericName[fr]=Navigateur Web
+GenericName[gu]=વેબ બ્રાઉઝર
+GenericName[he]=דפדפן אינטרנט
+GenericName[hi]=वेब ब्राउज़र
+GenericName[hu]=Webböngésző
+GenericName[it]=Browser Web
+GenericName[ja]=ウェブブラウザ
+GenericName[kn]=ಜಾಲ ವೀಕ್ಷಕ
+GenericName[ko]=웹 브라우저
+GenericName[lt]=Žiniatinklio naršyklė
+GenericName[lv]=Tīmekļa pārlūks
+GenericName[ml]=വെബ് ബ്രൌസര്
+GenericName[mr]=वेब ब्राऊजर
+GenericName[nb]=Nettleser
+GenericName[nl]=Webbrowser
+GenericName[pl]=Przeglądarka WWW
+GenericName[pt]=Navegador Web
+GenericName[pt_BR]=Navegador da Internet
+GenericName[ro]=Navigator de Internet
+GenericName[ru]=Веб-браузер
+GenericName[sl]=Spletni brskalnik
+GenericName[sv]=Webbläsare
+GenericName[ta]=இணைய உலாவி
+GenericName[th]=เว็บเบราว์เซอร์
+GenericName[tr]=Web Tarayıcı
+GenericName[uk]=Навігатор Тенет
+GenericName[zh_CN]=网页浏览器
+GenericName[zh_HK]=網頁瀏覽器
+GenericName[zh_TW]=網頁瀏覽器
+# Not translated in KDE, from Epiphany 2.26.1-0ubuntu1.
+GenericName[bn]=ওয়েব ব্রাউজার
+GenericName[fil]=Web Browser
+GenericName[hr]=Web preglednik
+GenericName[id]=Browser Web
+GenericName[or]=ଓ୍ବେବ ବ୍ରାଉଜର
+GenericName[sk]=WWW prehliadač
+GenericName[sr]=Интернет прегледник
+GenericName[te]=మహాతల అన్వేషి
+GenericName[vi]=Bộ duyệt Web
+# Gnome and KDE 3 uses Comment.
+Comment=Access the Internet
+Comment[ar]=الدخول إلى الإنترنت
+Comment[bg]=Достъп до интернет
+Comment[bn]=ইন্টারনেটটি অ্যাক্সেস করুন
+Comment[ca]=Accedeix a Internet
+Comment[cs]=Přístup k internetu
+Comment[da]=Få adgang til internettet
+Comment[de]=Internetzugriff
+Comment[el]=Πρόσβαση στο Διαδίκτυο
+Comment[en_GB]=Access the Internet
+Comment[es]=Accede a Internet.
+Comment[et]=Pääs Internetti
+Comment[fi]=Käytä internetiä
+Comment[fil]=I-access ang Internet
+Comment[fr]=Accéder à Internet
+Comment[gu]=ઇંટરનેટ ઍક્સેસ કરો
+Comment[he]=גישה אל האינטרנט
+Comment[hi]=इंटरनेट तक पहुंच स्थापित करें
+Comment[hr]=Pristup Internetu
+Comment[hu]=Internetelérés
+Comment[id]=Akses Internet
+Comment[it]=Accesso a Internet
+Comment[ja]=インターネットにアクセス
+Comment[kn]=ಇಂಟರ್ನೆಟ್ ಅನ್ನು ಪ್ರವೇಶಿಸಿ
+Comment[ko]=인터넷 연결
+Comment[lt]=Interneto prieiga
+Comment[lv]=Piekļūt internetam
+Comment[ml]=ഇന്റര്നെറ്റ് ആക്സസ് ചെയ്യുക
+Comment[mr]=इंटरनेटमध्ये प्रवेश करा
+Comment[nb]=Gå til Internett
+Comment[nl]=Verbinding maken met internet
+Comment[or]=ଇଣ୍ଟର୍ନେଟ୍ ପ୍ରବେଶ କରନ୍ତୁ
+Comment[pl]=Skorzystaj z internetu
+Comment[pt]=Aceder à Internet
+Comment[pt_BR]=Acessar a internet
+Comment[ro]=Accesaţi Internetul
+Comment[ru]=Доступ в Интернет
+Comment[sk]=Prístup do siete Internet
+Comment[sl]=Dostop do interneta
+Comment[sr]=Приступите Интернету
+Comment[sv]=Gå ut på Internet
+Comment[ta]=இணையத்தை அணுகுதல்
+Comment[te]=ఇంటర్నెట్ను ఆక్సెస్ చెయ్యండి
+Comment[th]=เข้าถึงอินเทอร์เน็ต
+Comment[tr]=İnternet'e erişin
+Comment[uk]=Доступ до Інтернету
+Comment[vi]=Truy cập Internet
+Comment[zh_CN]=访问互联网
+Comment[zh_HK]=連線到網際網路
+Comment[zh_TW]=連線到網際網路
+Exec=chromium %U
+Terminal=false
+Icon=chromium
+Type=Application
+Categories=Network;WebBrowser;
+MimeType=text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
+Actions=NewWindow;NewPrivateWindow;
+
+[Desktop Action NewWindow]
+Name=New Window
+Name[am]=አዲስ መስኮት
+Name[ar]=نافذة جديدة
+Name[bg]=Нов прозорец
+Name[bn]=নতুন উইন্ডো
+Name[ca]=Finestra nova
+Name[cs]=Nové okno
+Name[da]=Nyt vindue
+Name[de]=Neues Fenster
+Name[el]=Νέο Παράθυρο
+Name[en_GB]=New Window
+Name[es]=Nueva ventana
+Name[et]=Uus aken
+Name[fa]=پنجره جدید
+Name[fi]=Uusi ikkuna
+Name[fil]=New Window
+Name[fr]=Nouvelle fenêtre
+Name[gu]=નવી વિંડો
+Name[hi]=नई विंडो
+Name[hr]=Novi prozor
+Name[hu]=Új ablak
+Name[id]=Jendela Baru
+Name[it]=Nuova finestra
+Name[iw]=חלון חדש
+Name[ja]=新規ウインドウ
+Name[kn]=ಹೊಸ ವಿಂಡೊ
+Name[ko]=새 창
+Name[lt]=Naujas langas
+Name[lv]=Jauns logs
+Name[ml]=പുതിയ വിന്ഡോ
+Name[mr]=नवीन विंडो
+Name[nl]=Nieuw venster
+Name[no]=Nytt vindu
+Name[pl]=Nowe okno
+Name[pt]=Nova janela
+Name[pt_BR]=Nova janela
+Name[ro]=Fereastră nouă
+Name[ru]=Новое окно
+Name[sk]=Nové okno
+Name[sl]=Novo okno
+Name[sr]=Нови прозор
+Name[sv]=Nytt fönster
+Name[sw]=Dirisha Jipya
+Name[ta]=புதிய சாளரம்
+Name[te]=క్రొత్త విండో
+Name[th]=หน้าต่างใหม่
+Name[tr]=Yeni Pencere
+Name[uk]=Нове вікно
+Name[vi]=Cửa sổ Mới
+Name[zh_CN]=新建窗口
+Name[zh_TW]=開新視窗
+Exec=chromium
+
+[Desktop Action NewPrivateWindow]
+Name=New Incognito Window
+Name[ar]=نافذة جديدة للتصفح المتخفي
+Name[bg]=Нов прозорец „инкогнито“
+Name[bn]=নতুন ছদ্মবেশী উইন্ডো
+Name[ca]=Finestra d'incògnit nova
+Name[cs]=Nové anonymní okno
+Name[da]=Nyt inkognitovindue
+Name[de]=Neues Inkognito-Fenster
+Name[el]=Νέο παράθυρο για ανώνυμη περιήγηση
+Name[en_GB]=New Incognito window
+Name[es]=Nueva ventana de incógnito
+Name[et]=Uus inkognito aken
+Name[fa]=پنجره جدید حالت ناشناس
+Name[fi]=Uusi incognito-ikkuna
+Name[fil]=Bagong Incognito window
+Name[fr]=Nouvelle fenêtre de navigation privée
+Name[gu]=નવી છુપી વિંડો
+Name[hi]=नई गुप्त विंडो
+Name[hr]=Novi anoniman prozor
+Name[hu]=Új Inkognitóablak
+Name[id]=Jendela Penyamaran baru
+Name[it]=Nuova finestra di navigazione in incognito
+Name[iw]=חלון חדש לגלישה בסתר
+Name[ja]=新しいシークレット ウィンドウ
+Name[kn]=ಹೊಸ ಅಜ್ಞಾತ ವಿಂಡೋ
+Name[ko]=새 시크릿 창
+Name[lt]=Naujas inkognito langas
+Name[lv]=Jauns inkognito režīma logs
+Name[ml]=പുതിയ വേഷ പ്രച്ഛന്ന വിന്ഡോ
+Name[mr]=नवीन गुप्त विंडो
+Name[nl]=Nieuw incognitovenster
+Name[no]=Nytt inkognitovindu
+Name[pl]=Nowe okno incognito
+Name[pt]=Nova janela de navegação anónima
+Name[pt_BR]=Nova janela anônima
+Name[ro]=Fereastră nouă incognito
+Name[ru]=Новое окно в режиме инкогнито
+Name[sk]=Nové okno inkognito
+Name[sl]=Novo okno brez beleženja zgodovine
+Name[sr]=Нови прозор за прегледање без архивирања
+Name[sv]=Nytt inkognitofönster
+Name[ta]=புதிய மறைநிலைச் சாளரம்
+Name[te]=క్రొత్త అజ్ఞాత విండో
+Name[th]=หน้าต่างใหม่ที่ไม่ระบุตัวตน
+Name[tr]=Yeni Gizli pencere
+Name[uk]=Нове вікно в режимі анонімного перегляду
+Name[vi]=Cửa sổ ẩn danh mới
+Name[zh_CN]=新建隐身窗口
+Name[zh_TW]=新增無痕式視窗
+Exec=chromium --incognito
diff --git a/chromium-next/files/chromium.sh.in b/chromium-next/files/chromium.sh.in
new file mode 100644
index 0000000000..62a6546ed6
--- /dev/null
+++ b/chromium-next/files/chromium.sh.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+DATASIZE="716800"
+OPENFILES="400"
+
+xm_log() {
+ echo -n "$@\nDo you want to run Chromium anyway?\n\
+(If you don't increase these limits, Chromium might fail to work properly.)" | \
+ @X11BASE@/bin/xmessage -file - -center -buttons yes:0,no:1 -default no
+}
+
+if [ $(ulimit -Sd) -lt ${DATASIZE} ]; then
+ ulimit -Sd ${DATASIZE} || \
+ xm_log "Cannot increase datasize-cur to at least ${DATASIZE}"
+ [ $? -eq 0 ] || exit
+fi
+
+if [ $(ulimit -Sn) -lt ${OPENFILES} ]; then
+ ulimit -Sn ${OPENFILES} || \
+ xm_log "Cannot increase openfiles-cur to at least ${OPENFILES}"
+ [ $? -eq 0 ] || exit
+fi
+
+#
+# Temporary workaround for the case when chromium crashes and leaves
+# the SingletonLock, which prevents chromium to start up.
+#
+if [ -h ${HOME}/.config/chromium/SingletonLock ]; then
+ _pid=`readlink ${HOME}/.config/chromium/SingletonLock | cut -d '-' -f 2`
+ kill -0 ${_pid} 2>/dev/null
+ if [ $? -gt 0 ]; then
+ rm ${HOME}/.config/chromium/SingletonLock
+ fi
+fi
+
+#
+# Issue #395446
+# https://code.google.com/p/chromium/issues/detail?id=395446
+#
+[ -z ${LANG} ] && _l=en_US.UTF-8 || _l=${LANG}
+
+#
+# Workaround to dbus
+# https://bugs.chromium.org/p/chromium/issues/detail?id=918234
+#
+[ -z ${DBUS_SESSION_BUS_ADDRESS} ] && export DBUS_SESSION_BUS_ADDRESS="autolaunch:"
+
+#
+# Workaround to pulseaudio
+# Chromium is failing to start a new pulseaudio server,
+# however can use an already started.
+#
+BUILT_WITH_PULSE=@PULSE@
+if [ "$BUILT_WITH_PULSE" = "yes" ]; then
+ pgrep -x pulseaudio || pulseaudio --start --log-target=syslog --exit-idle-time=-1
+fi
+
+# Always use our versions of ffmpeg libs.
+# This also makes RPMs find the compatibly-named library symlinks.
+if [ -n "$LD_LIBRARY_PATH" ]; then
+ LD_LIBRARY_PATH="@PREFIX@/lib/chromium:@PREFIX@/lib/chromium/lib:$LD_LIBRARY_PATH"
+else
+ LD_LIBRARY_PATH="@PREFIX@/lib/chromium:@PREFIX@/lib/chromium/lib"
+fi
+export LD_LIBRARY_PATH
+
+[ -d ~/Downloads ] || mkdir -m 0700 ~/Downloads
+[ -d ~/.config ] || mkdir -m 0700 ~/.config
+[ -f ~/.config/user-dirs.dirs ] || \
+ echo 'XDG_DOWNLOAD_DIR="$HOME/Downloads"' > ~/.config/user-dirs.dirs
+
+# WebAssembly can be disabled by setting CHROMIUM_ENABLE_WASM=0 in your environment.
+[ "${CHROMIUM_ENABLE_WASM:-1}" != "1" ] && \
+ _NOWASM="--disable-features=WebAssembly,AsmJsToWebAssembly,WebAssemblyStreaming --js-flags=--noexpose-wasm"
+
+LANG=${_l} exec "@PREFIX@/lib/chromium/chrome" ${_NOWASM} "${@}"
diff --git a/chromium-next/options.mk b/chromium-next/options.mk
new file mode 100644
index 0000000000..94cbc58252
--- /dev/null
+++ b/chromium-next/options.mk
@@ -0,0 +1,61 @@
+# $NetBSD: options.mk,v 1.32 2016/08/20 11:17:32 ryoon Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.chromium
+PKG_OPTIONS_REQUIRED_GROUPS= audio
+PKG_OPTIONS_GROUP.audio= alsa pulseaudio sndio sunaudio
+PKG_SUPPORTED_OPTIONS+= debug
+
+.if ${OPSYS} == "NetBSD"
+PKG_SUGGESTED_OPTIONS+= sunaudio
+.elif ${OPSYS} == "OpenBSD"
+PKG_SUGGESTED_OPTIONS+= sndio
+.else
+PKG_SUGGESTED_OPTIONS+= pulseaudio
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Msunaudio)
+GN_ARGS+= use_audioio=true
+.else
+GN_ARGS+= use_audioio=false
+.endif
+
+.if !empty(PKG_OPTIONS:Malsa)
+GN_ARGS+= use_alsa=true
+.include "../../audio/alsa-lib/buildlink3.mk"
+.else
+GN_ARGS+= use_alsa=false
+.endif
+
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+WITH_PA= yes
+GN_ARGS+= use_pulseaudio=true
+.include "../../audio/pulseaudio/buildlink3.mk"
+.else
+WITH_PA= no
+GN_ARGS+= use_pulseaudio=false
+.endif
+
+.if !empty(PKG_OPTIONS:Msndio)
+GN_ARGS+= use_sndio=true
+.else
+GN_ARGS+= use_sndio=false
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+BUILDTYPE= Debug
+GN_ARGS+= is_debug=true
+GN_ARGS+= symbol_level=1
+GN_BOOTSTRAP_FLAGS+= --debug
+GN_VERBOSE= #-v
+INSTALL_UNSTRIPPED= yes
+.else
+BUILDTYPE= Release
+GN_ARGS+= is_official_build=true
+GN_ARGS+= is_component_build=false
+GN_ARGS+= is_debug=false
+GN_ARGS+= blink_symbol_level=0
+GN_ARGS+= symbol_level=0
+GN_VERBOSE= # empty
+.endif
diff --git a/chromium-next/patches/patch-BUILD.gn b/chromium-next/patches/patch-BUILD.gn
new file mode 100644
index 0000000000..3fdd0d220d
--- /dev/null
+++ b/chromium-next/patches/patch-BUILD.gn
@@ -0,0 +1,95 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ BUILD.gn
+@@ -68,7 +68,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)
+@@ -100,7 +100,6 @@ group("gn_all") {
+ "//codelabs",
+ "//components:components_unittests",
+ "//components/gwp_asan:gwp_asan_unittests",
+- "//infra/orchestrator:orchestrator_all",
+ "//net:net_unittests",
+ "//sandbox:sandbox_unittests",
+ "//services:services_unittests",
+@@ -446,7 +445,7 @@ group("gn_all") {
+ }
+ }
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux && !is_bsd) || is_chromeos || is_android) {
+ deps += [
+ "//third_party/breakpad:breakpad_unittests",
+ "//third_party/breakpad:core-2-minidump",
+@@ -636,6 +635,15 @@ group("gn_all") {
+ }
+ }
+
++ if (is_bsd) {
++ deps -= [
++ "//third_party/breakpad:dump_syms($host_system_allocator_toolchain)",
++ "//third_party/breakpad:microdump_stackwalk($host_system_allocator_toolchain)",
++ "//third_party/breakpad:minidump_dump($host_system_allocator_toolchain)",
++ "//third_party/breakpad:minidump_stackwalk($host_system_allocator_toolchain)",
++ ]
++ }
++
+ if (is_mac) {
+ deps += [
+ "//third_party/breakpad:dump_syms($host_system_allocator_toolchain)",
+@@ -684,7 +692,7 @@ group("gn_all") {
+ }
+ }
+
+- if (!is_fuchsia) {
++ if (!is_fuchsia && !is_bsd) {
+ # The official builders use this binary from the default toolchain's
+ # output directory after building in order to upload the symbols of that
+ # binary. They build the binary like `ninja symupload` which requires the
+@@ -1172,7 +1180,7 @@ if (use_blink && !is_cronet_build) {
+ ]
+ }
+
+- if (!is_chromeos_ash && !is_ios && !is_fuchsia && !is_android && !is_castos) {
++ if (!is_chromeos_ash && !is_ios && !is_fuchsia && !is_android && !is_castos && !is_bsd) {
+ script_test("chrome_wpt_tests") {
+ script = "//third_party/blink/tools/run_wpt_tests.py"
+ args = _common_web_test_options + [ "--product=chrome" ]
+@@ -1265,7 +1273,7 @@ if (use_blink && !is_cronet_build) {
+ data_deps += [ "//content/web_test:web_test_common_mojom_js_data_deps" ]
+ }
+
+- if (!is_win && !is_android) {
++ if (!is_win && !is_android && !is_bsd) {
+ # Using the default toolchain for this tool, as it's run during tests not
+ # during the build. This places a symlink in the root_build_dir for scrips
+ # to use.
+@@ -1279,7 +1287,7 @@ if (use_blink && !is_cronet_build) {
+ data_deps += [ "//third_party/breakpad:dump_syms" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux && !is_bsd) || is_chromeos) {
+ # Using the default toolchain for this tool, as it's run during tests not
+ # during the build. This places a symlink in the root_build_dir for scrips
+ # to use.
+@@ -1743,7 +1751,7 @@ group("chromium_builder_perf") {
+ data_deps += [ "//chrome/test:performance_browser_tests" ]
+ }
+
+- if (!is_win) {
++ if (!is_win && !is_bsd) {
+ data_deps += [ "//third_party/breakpad:minidump_stackwalk($host_system_allocator_toolchain)" ]
+ }
+ }
diff --git a/chromium-next/patches/patch-apps_ui_views_app__window__frame__view.cc b/chromium-next/patches/patch-apps_ui_views_app__window__frame__view.cc
new file mode 100644
index 0000000000..72d8275df5
--- /dev/null
+++ b/chromium-next/patches/patch-apps_ui_views_app__window__frame__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- apps/ui/views/app_window_frame_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ apps/ui/views/app_window_frame_view.cc
+@@ -149,7 +149,7 @@ gfx::Rect AppWindowFrameView::GetWindowB
+ gfx::Rect window_bounds = client_bounds;
+ // TODO(crbug.com/40118868): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // 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/chromium-next/patches/patch-ash_display_mirror__window__controller.cc b/chromium-next/patches/patch-ash_display_mirror__window__controller.cc
new file mode 100644
index 0000000000..e1b2ec8727
--- /dev/null
+++ b/chromium-next/patches/patch-ash_display_mirror__window__controller.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ash/display/mirror_window_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ash/display/mirror_window_controller.cc
+@@ -295,7 +295,11 @@ void MirrorWindowController::UpdateWindo
+ if (!base::Contains(display_info_list, iter->first,
+ &display::ManagedDisplayInfo::id)) {
+ CloseAndDeleteHost(iter->second, true);
++#if defined(__llvm__)
++ mirroring_host_info_map_.erase(iter++);
++#else
+ iter = mirroring_host_info_map_.erase(iter);
++#endif
+ } else {
+ ++iter;
+ }
diff --git a/chromium-next/patches/patch-base_BUILD.gn b/chromium-next/patches/patch-base_BUILD.gn
new file mode 100644
index 0000000000..c53a603bfb
--- /dev/null
+++ b/chromium-next/patches/patch-base_BUILD.gn
@@ -0,0 +1,172 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/BUILD.gn
+@@ -920,7 +920,7 @@ component("base") {
+ #"system/sys_info_openbsd.cc",
+ ]
+
+- if (is_apple || current_os == "freebsd" || current_os == "openbsd") {
++ if (is_apple || current_os == "freebsd" || current_os == "openbsd" || current_os == "netbsd") {
+ sources += [
+ "posix/sysctl.cc",
+ "posix/sysctl.h",
+@@ -1077,11 +1077,26 @@ component("base") {
+ # Needed for <atomic> if using newer C++ library than sysroot, except if
+ # building inside the cros_sdk environment - use host_toolchain as a
+ # more robust check for this.
+- if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos)) &&
++ if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos && !is_bsd)) &&
+ host_toolchain != "//build/toolchain/cros:host") {
+ libs += [ "atomic" ]
+ }
+
++ # *BSD needs libkvm
++ if (is_bsd) {
++ libs += [
++ "kvm",
++ "epoll-shim",
++ ]
++ }
++
++ if (is_freebsd) {
++ libs += [
++ "execinfo",
++ "util",
++ ]
++ }
++
+ if (use_allocator_shim) {
+ if (is_apple) {
+ sources += [ "allocator/early_zone_registration_apple.h" ]
+@@ -1101,7 +1116,7 @@ component("base") {
+
+ # Allow more direct string conversions on platforms with native utf8
+ # strings
+- if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) {
++ if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia || is_bsd) {
+ defines += [ "SYSTEM_NATIVE_UTF8" ]
+ }
+
+@@ -2095,6 +2110,29 @@ component("base") {
+ ]
+ }
+
++ 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",
++ ]
++ } else if (is_netbsd) {
++ sources += [
++ "process/process_handle_netbsd.cc",
++ "process/process_iterator_netbsd.cc",
++ "process/process_metrics_netbsd.cc",
++ "system/sys_info_netbsd.cc",
++ ]
++ }
++
+ # iOS
+ if (is_ios) {
+ sources += [
+@@ -2239,6 +2277,33 @@ component("base") {
+ }
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "files/file_path_watcher_inotify.cc",
++ "files/scoped_file_linux.cc",
++ "process/set_process_title_linux.cc",
++ "process/set_process_title_linux.h",
++ "system/sys_info_linux.cc",
++ "process/process_iterator_linux.cc",
++ "process/process_linux.cc",
++ "process/process_metrics_linux.cc",
++ "process/process_handle_linux.cc",
++ "profiler/stack_copier_signal.cc",
++ "profiler/stack_copier_signal.h",
++ "profiler/thread_delegate_posix.cc",
++ "profiler/thread_delegate_posix.h",
++ "threading/platform_thread_linux.cc",
++ "stack_canary_linux.cc",
++ "stack_canary_linux.h",
++ ]
++ sources += [
++ "files/file_path_watcher_kqueue.cc",
++ "files/file_path_watcher_kqueue.h",
++ "files/file_path_watcher_bsd.cc",
++ "threading/platform_thread_bsd.cc",
++ ]
++ }
++
+ if (use_blink) {
+ sources += [
+ "files/file_path_watcher.cc",
+@@ -2594,7 +2659,7 @@ buildflag_header("protected_memory_build
+ header = "protected_memory_buildflags.h"
+ header_dir = "base/memory"
+
+- protected_memory_enabled = !is_component_build && is_clang &&
++ protected_memory_enabled = !is_openbsd && !is_component_build && is_clang &&
+ (is_win || is_linux || is_android || is_mac)
+
+ flags = [ "PROTECTED_MEMORY_ENABLED=$protected_memory_enabled" ]
+@@ -3079,7 +3144,7 @@ if (is_apple) {
+ }
+ }
+
+-if (!is_nacl && (is_linux || is_chromeos)) {
++if (!is_nacl && !is_bsd && (is_linux || is_chromeos)) {
+ # This test must compile with -fstack-protector-all
+ source_set("stack_canary_linux_unittests") {
+ testonly = true
+@@ -3756,7 +3821,7 @@ test("base_unittests") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if (!is_bsd && (is_linux || is_chromeos)) {
+ sources += [
+ "debug/proc_maps_linux_unittest.cc",
+ "files/scoped_file_linux_unittest.cc",
+@@ -3783,7 +3848,7 @@ test("base_unittests") {
+ "posix/file_descriptor_shuffle_unittest.cc",
+ "posix/unix_domain_socket_unittest.cc",
+ ]
+- if (!is_nacl && !is_apple) {
++ if (!is_nacl && !is_apple && !is_bsd) {
+ sources += [
+ "profiler/stack_base_address_posix_unittest.cc",
+ "profiler/stack_copier_signal_unittest.cc",
+@@ -3794,7 +3859,7 @@ test("base_unittests") {
+
+ # Allow more direct string conversions on platforms with native utf8
+ # strings
+- if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) {
++ if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia || is_bsd) {
+ defines += [ "SYSTEM_NATIVE_UTF8" ]
+ }
+
+@@ -3984,7 +4049,7 @@ test("base_unittests") {
+ deps += [ ":base_profiler_test_support_library" ]
+ }
+
+- 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/chromium-next/patches/patch-base_allocator_dispatcher_tls.h b/chromium-next/patches/patch-base_allocator_dispatcher_tls.h
new file mode 100644
index 0000000000..f2512323ba
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_dispatcher_tls.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/dispatcher/tls.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/dispatcher/tls.h
+@@ -77,7 +77,7 @@ struct BASE_EXPORT MMapAllocator {
+ constexpr static size_t AllocationChunkSize = 16384;
+ #elif BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS)
+ constexpr static size_t AllocationChunkSize = 16384;
+-#elif BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ constexpr static size_t AllocationChunkSize = 16384;
+ #else
+ constexpr static size_t AllocationChunkSize = 4096;
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_partition__alloc.gni b/chromium-next/patches/patch-base_allocator_partition__allocator_partition__alloc.gni
new file mode 100644
index 0000000000..2657eb0719
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_partition__alloc.gni
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/partition_alloc.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/partition_alloc.gni
+@@ -38,7 +38,7 @@ if (is_nacl) {
+ use_large_empty_slot_span_ring = true
+
+ has_memory_tagging =
+- current_cpu == "arm64" && is_clang && !is_asan && (is_linux || is_android)
++ current_cpu == "arm64" && is_clang && !is_asan && !is_bsd && (is_linux || is_android)
+
+ declare_args() {
+ # Causes all the allocations to be routed via allocator_shim.cc. Usually,
+@@ -432,7 +432,7 @@ assert(!use_asan_backup_ref_ptr || use_r
+ # dependencies that use partition_allocator are compiled in AOSP against a
+ # version of glibc that does not include pkeys syscall numbers.
+ is_pkeys_available =
+- (is_linux || is_chromeos) && current_cpu == "x64" && !is_cronet_build
++ !is_bsd && (is_linux || is_chromeos) && current_cpu == "x64" && !is_cronet_build
+ declare_args() {
+ enable_pkeys = is_pkeys_available
+ }
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_BUILD.gn b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_BUILD.gn
new file mode 100644
index 0000000000..a298009497
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
+@@ -863,7 +863,7 @@ if (is_clang_or_gcc) {
+ configs -= [ partition_alloc_enable_arc_config ]
+ }
+ }
+- if (is_chromeos || is_linux) {
++ if ((is_chromeos || is_linux) && !is_bsd) {
+ shim_headers += [
+ "shim/allocator_shim_override_cpp_symbols.h",
+ "shim/allocator_shim_override_glibc_weak_symbols.h",
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_address__space__randomization.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_address__space__randomization.h
new file mode 100644
index 0000000000..f8e72a4e94
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_address__space__randomization.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/address_space_randomization.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/address_space_randomization.h
+@@ -38,7 +38,7 @@ AslrMask(uintptr_t bits) {
+
+ #if PA_BUILDFLAG(PA_ARCH_CPU_64_BITS)
+
+- #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
++ #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && !PA_BUILDFLAG(IS_BSD)
+
+ // We shouldn't allocate system pages at all for sanitizer builds. However,
+ // we do, and if random hint addresses interfere with address ranges
+@@ -125,7 +125,7 @@ AslrMask(uintptr_t bits) {
+ return AslrAddress(0x20000000ULL);
+ }
+ #elif PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
+- #if PA_BUILDFLAG(IS_LINUX)
++ #if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_BSD)
+
+ // Linux on arm64 can use 39, 42, 48, or 52-bit user space, depending on
+ // page size and number of levels of translation pages used. We use
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator.h
new file mode 100644
index 0000000000..8774c1c6e1
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/page_allocator.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/page_allocator.h
+@@ -269,7 +269,7 @@ bool DecommitAndZeroSystemPages(void* ad
+ // recommitted. Do not assume that this will not change over time.
+ constexpr PA_COMPONENT_EXPORT(
+ PARTITION_ALLOC) bool DecommittedMemoryIsAlwaysZeroed() {
+-#if PA_BUILDFLAG(IS_APPLE)
++#if PA_BUILDFLAG(IS_APPLE) || PA_BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
new file mode 100644
index 0000000000..5d6cdf7726
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/page_allocator_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/page_allocator_constants.h
+@@ -26,8 +26,8 @@
+ #define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const))
+
+ #elif (PA_BUILDFLAG(IS_ANDROID) && PA_BUILDFLAG(PA_ARCH_CPU_64_BITS)) || \
+- (PA_BUILDFLAG(IS_LINUX) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)) || \
+- (PA_BUILDFLAG(IS_LINUX) && PA_BUILDFLAG(PA_ARCH_CPU_PPC64))
++ ((PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_BSD)) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)) || \
++ ((PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_BSD)) && PA_BUILDFLAG(PA_ARCH_CPU_PPC64))
+ // This should work for all POSIX (if needed), but currently all other
+ // supported OS/architecture combinations use either hard-coded values
+ // (such as x86) or have means to determine these values without needing
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.cc
new file mode 100644
index 0000000000..c4110698aa
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.cc
+@@ -39,7 +39,7 @@ uint32_t SecTaskGetCodeSignStatus(SecTas
+
+ #if PA_BUILDFLAG(HAS_MEMORY_TAGGING) || \
+ (defined(__ARM_FEATURE_BTI_DEFAULT) && (__ARM_FEATURE_BTI_DEFAULT == 1) && \
+- __has_include(<sys/ifunc.h>))
++ __has_include(<sys/ifunc.h>) && !PA_BUILDFLAG(IS_BSD))
+ struct __ifunc_arg_t;
+
+ #include "partition_alloc/aarch64_support.h"
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.h
new file mode 100644
index 0000000000..acc55eaf81
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h
+@@ -302,8 +302,12 @@ bool TryRecommitSystemPagesInternal(
+
+ void DiscardSystemPagesInternal(uintptr_t address, size_t length) {
+ void* ptr = reinterpret_cast<void*>(address);
+-#if PA_BUILDFLAG(IS_APPLE)
++#if PA_BUILDFLAG(IS_APPLE) || PA_BUILDFLAG(IS_BSD)
++#if PA_BUILDFLAG(IS_BSD)
++ int ret = madvise(ptr, length, MADV_FREE);
++#else
+ int ret = madvise(ptr, length, MADV_FREE_REUSABLE);
++#endif
+ if (ret) {
+ // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED.
+ ret = madvise(ptr, length, MADV_DONTNEED);
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_proc__maps__linux.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_proc__maps__linux.cc
new file mode 100644
index 0000000000..d44d163d53
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_proc__maps__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/proc_maps_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/proc_maps_linux.cc
+@@ -19,7 +19,7 @@
+ #include "partition_alloc/partition_alloc_check.h"
+
+ #if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS) || \
+- PA_BUILDFLAG(IS_ANDROID)
++ PA_BUILDFLAG(IS_ANDROID) || PA_BUILDFLAG(IS_BSD)
+ #include <inttypes.h>
+ #endif
+
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_stack__trace__posix.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_stack__trace__posix.cc
new file mode 100644
index 0000000000..c3d133c645
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_stack__trace__posix.cc
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_posix.cc
+@@ -13,11 +13,11 @@
+ #include "partition_alloc/partition_alloc_base/posix/eintr_wrapper.h"
+ #include "partition_alloc/partition_alloc_base/strings/safe_sprintf.h"
+
+-#if !PA_BUILDFLAG(IS_ANDROID) && !PA_BUILDFLAG(IS_APPLE)
++#if !PA_BUILDFLAG(IS_ANDROID) && !PA_BUILDFLAG(IS_APPLE) && !PA_BUILDFLAG(IS_BSD)
+ #include <link.h> // For ElfW() macro.
+ #endif
+
+-#if PA_BUILDFLAG(IS_APPLE)
++#if PA_BUILDFLAG(IS_APPLE) || PA_BUILDFLAG(IS_BSD)
+ #include <dlfcn.h>
+ #endif
+
+@@ -25,7 +25,7 @@ namespace partition_alloc::internal::bas
+
+ namespace {
+
+-#if !PA_BUILDFLAG(IS_APPLE)
++#if !PA_BUILDFLAG(IS_APPLE) && !PA_BUILDFLAG(IS_BSD)
+
+ // On Android the 'open' function has two versions:
+ // int open(const char *pathname, int flags);
+@@ -369,7 +369,7 @@ void PrintStackTraceInternal(const void*
+ }
+ #endif // !PA_BUILDFLAG(IS_APPLE)
+
+-#if PA_BUILDFLAG(IS_APPLE)
++#if PA_BUILDFLAG(IS_APPLE) || PA_BUILDFLAG(IS_BSD)
+ // Since /proc/self/maps is not available, use dladdr() to obtain module
+ // names and offsets inside the modules from the given addresses.
+ void PrintStackTraceInternal(const void* const* trace, size_t size) {
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_rand__util__posix.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_rand__util__posix.cc
new file mode 100644
index 0000000000..1bebc83dd0
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_rand__util__posix.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/rand_util_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/rand_util_posix.cc
+@@ -102,6 +102,10 @@ void RandBytes(void* output, size_t outp
+ if (getentropy(output, output_length) == 0) {
+ return;
+ }
++#elif PA_BUILDFLAG(IS_BSD)
++ if (getentropy(output, output_length) == 0) {
++ return;
++ }
+ #endif
+ // If getrandom(2) above returned with an error and the /dev/urandom fallback
+ // took place on Linux/ChromeOS bots, they would fail with a CHECK in
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread.h
new file mode 100644
index 0000000000..d79ef06aee
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread.h
+@@ -37,6 +37,8 @@ typedef DWORD PlatformThreadId;
+ typedef zx_handle_t PlatformThreadId;
+ #elif PA_BUILDFLAG(IS_APPLE)
+ typedef mach_port_t PlatformThreadId;
++#elif PA_BUILDFLAG(IS_BSD)
++typedef uint64_t PlatformThreadId;
+ #elif PA_BUILDFLAG(IS_POSIX)
+ typedef pid_t PlatformThreadId;
+ #endif
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__internal__posix.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__internal__posix.h
new file mode 100644
index 0000000000..3dd6c32cc6
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__internal__posix.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_internal_posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_internal_posix.h
+@@ -10,7 +10,7 @@
+
+ namespace partition_alloc::internal::base::internal {
+
+-#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)
++#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS) || PA_BUILDFLAG(IS_BSD)
+ // Current thread id is cached in thread local storage for performance reasons.
+ // In some rare cases it's important to invalidate that cache explicitly (e.g.
+ // after going through clone() syscall which does not call pthread_atfork()
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__posix.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__posix.cc
new file mode 100644
index 0000000000..f1dadcd458
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix.cc
+@@ -18,7 +18,7 @@
+ #include "partition_alloc/partition_alloc_base/logging.h"
+ #include "partition_alloc/partition_alloc_base/threading/platform_thread_internal_posix.h"
+
+-#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)
++#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS) || PA_BUILDFLAG(IS_BSD)
+ #include <sys/syscall.h>
+ #include <atomic>
+ #endif
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__config.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__config.h
new file mode 100644
index 0000000000..8aad46bc73
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__config.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_config.h
+@@ -170,7 +170,7 @@ constexpr bool kUseLazyCommit = false;
+ // This may be required on more platforms in the future.
+ #define PA_CONFIG_HAS_ATFORK_HANDLER() \
+ (PA_BUILDFLAG(IS_APPLE) || PA_BUILDFLAG(IS_LINUX) || \
+- PA_BUILDFLAG(IS_CHROMEOS))
++ PA_BUILDFLAG(IS_CHROMEOS) || PA_BUILDFLAG(IS_BSD))
+
+ // Enable shadow metadata.
+ //
+@@ -233,7 +233,7 @@ constexpr bool kUseLazyCommit = false;
+ // Also enabled on ARM64 macOS and iOS, as the 16kiB pages on this platform lead
+ // to larger slot spans.
+ #if PA_BUILDFLAG(IS_LINUX) || \
+- (PA_BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64))
++ (PA_BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)) || PA_BUILDFLAG(IS_BSD)
+ #define PA_CONFIG_PREFER_SMALLER_SLOT_SPANS() 1
+ #else
+ #define PA_CONFIG_PREFER_SMALLER_SLOT_SPANS() 0
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
new file mode 100644
index 0000000000..1b85c8ab70
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h
+@@ -329,7 +329,7 @@ PA_DEFINE_OPERATORS_FOR_FLAGS(PoolHandle
+ // 8GB for each of the glued pools).
+ #if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
+ #if PA_BUILDFLAG(IS_ANDROID) || PA_BUILDFLAG(IS_IOS) || \
+- PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
++ PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION) || PA_BUILDFLAG(IS_BSD)
+ constexpr size_t kPoolMaxSize = 8 * kGiB;
+ #else
+ constexpr size_t kPoolMaxSize = 16 * kGiB;
+@@ -446,7 +446,7 @@ PA_ALWAYS_INLINE constexpr size_t MaxDir
+ // TODO(casey.smalley%arm.com@localhost): under 64k pages we can end up in a situation
+ // where a normal slot span will be large enough to contain multiple items,
+ // but the address will go over the final partition page after being aligned.
+-#if PA_BUILDFLAG(IS_LINUX) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
++#if (PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_BSD)) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
+ constexpr size_t kMaxSupportedAlignment = kSuperPageSize / 4;
+ #else
+ constexpr size_t kMaxSupportedAlignment = kSuperPageSize / 2;
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__forward.h b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__forward.h
new file mode 100644
index 0000000000..bee986ad91
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__alloc__forward.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_forward.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_forward.h
+@@ -28,9 +28,13 @@ namespace internal {
+ // the second one 16. We could technically return something different for
+ // malloc() and operator new(), but this would complicate things, and most of
+ // our allocations are presumably coming from operator new() anyway.
++#if defined(__i386__) && defined(OS_FREEBSD)
++constexpr size_t kAlignment = 8;
++#else
+ constexpr size_t kAlignment =
+ std::max(alignof(max_align_t),
+ static_cast<size_t>(__STDCPP_DEFAULT_NEW_ALIGNMENT__));
++#endif
+ static_assert(kAlignment <= 16,
+ "PartitionAlloc doesn't support a fundamental alignment larger "
+ "than 16 bytes.");
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__root.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
new file mode 100644
index 0000000000..be8b15f4d4
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/partition_root.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
+@@ -44,7 +44,7 @@
+ #include "wow64apiset.h"
+ #endif
+
+-#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)
++#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS) || PA_BUILDFLAG(IS_BSD)
+ #include <pthread.h>
+ #if PA_CONFIG(ENABLE_SHADOW_METADATA)
+ #include <sys/mman.h>
+@@ -293,7 +293,7 @@ void PartitionAllocMallocInitOnce() {
+ return;
+ }
+
+-#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)
++#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS) || PA_BUILDFLAG(IS_BSD)
+ // When fork() is called, only the current thread continues to execute in the
+ // child process. If the lock is held, but *not* by this thread when fork() is
+ // called, we have a deadlock.
+@@ -1113,7 +1113,7 @@ void PartitionRoot::Init(PartitionOption
+ // apple OSes.
+ PA_CHECK((internal::SystemPageSize() == (size_t{1} << 12)) ||
+ (internal::SystemPageSize() == (size_t{1} << 14)));
+-#elif PA_BUILDFLAG(IS_LINUX) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
++#elif (PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_BSD)) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
+ // Check runtime pagesize. Though the code is currently the same, it is
+ // not merged with the IS_APPLE case above as a 1 << 16 case is only
+ // supported on Linux on AArch64.
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_spinning__mutex.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_spinning__mutex.cc
new file mode 100644
index 0000000000..01f674f433
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_spinning__mutex.cc
@@ -0,0 +1,65 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/spinning_mutex.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/spinning_mutex.cc
+@@ -17,7 +17,16 @@
+ #endif
+
+ #if PA_CONFIG(HAS_LINUX_KERNEL)
++#if defined(OS_OPENBSD) || defined(OS_NETBSD)
++#include <sys/time.h>
++#include <sys/futex.h>
++#elif defined(OS_FREEBSD)
++#include <sys/types.h>
++#include <sys/thr.h>
++#include <sys/umtx.h>
++#else
+ #include <linux/futex.h>
++#endif
+ #include <sys/syscall.h>
+ #include <unistd.h>
+
+@@ -106,8 +115,19 @@ void SpinningMutex::FutexWait() {
+ // |kLockedContended| anymore. Note that even without spurious wakeups, the
+ // value of |state_| is not guaranteed when this returns, as another thread
+ // may get the lock before we get to run.
++#if defined(OS_FREEBSD)
++ int err = _umtx_op(&state_, UMTX_OP_WAIT_UINT_PRIVATE,
++ kLockedContended, nullptr, nullptr);
++#elif defined(OS_OPENBSD)
++ int err = futex(reinterpret_cast<volatile unsigned int *>(&state_), FUTEX_WAIT | FUTEX_PRIVATE_FLAG,
++ kLockedContended, nullptr, nullptr);
++#elif defined(OS_NETBSD)
++ int err = syscall(SYS___futex, reinterpret_cast<int *>(&state_), FUTEX_WAIT | FUTEX_PRIVATE_FLAG,
++ kLockedContended, nullptr, nullptr, 0, 0);
++#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.
+@@ -119,8 +139,19 @@ void SpinningMutex::FutexWait() {
+
+ void SpinningMutex::FutexWake() {
+ int saved_errno = errno;
++#if defined(OS_FREEBSD)
++ long retval = _umtx_op(&state_, UMTX_OP_WAKE_PRIVATE,
++ 1 /* wake up a single waiter */, nullptr, nullptr);
++#elif defined(OS_OPENBSD)
++ long retval = futex(reinterpret_cast<volatile unsigned int *>(&state_), FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
++ 1 /* wake up a single waiter */, nullptr, nullptr);
++#elif defined(OS_NETBSD)
++ long retval = syscall(SYS___futex, reinterpret_cast<int *>(&state_), FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
++ 1 /* wake up a single waiter */, nullptr, nullptr, 0, 0);
++#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/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_stack_stack.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_stack_stack.cc
new file mode 100644
index 0000000000..d151d57e92
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_stack_stack.cc
@@ -0,0 +1,56 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/stack/stack.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/stack/stack.cc
+@@ -18,6 +18,10 @@
+ #include <pthread.h>
+ #endif
+
++#if PA_BUILDFLAG(IS_BSD) && !PA_BUILDFLAG(IS_NETBSD)
++#include <pthread_np.h>
++#endif
++
+ #if PA_BUILDFLAG(PA_LIBC_GLIBC)
+ extern "C" void* __libc_stack_end;
+ #endif
+@@ -50,6 +54,36 @@ void* GetStackTop() {
+ return pthread_get_stackaddr_np(pthread_self());
+ }
+
++#elif PA_BUILDFLAG(IS_OPENBSD)
++
++void* GetStackTop() {
++ stack_t ss;
++ if (pthread_stackseg_np(pthread_self(), &ss) != 0)
++ return nullptr;
++ return reinterpret_cast<uint8_t*>(ss.ss_sp);
++}
++
++#elif PA_BUILDFLAG(IS_FREEBSD) || PA_BUILDFLAG(IS_NETBSD)
++
++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<uint8_t*>(base) + size;
++ }
++ pthread_attr_destroy(&attr);
++ return nullptr;
++}
++
+ #elif PA_BUILDFLAG(IS_POSIX) || PA_BUILDFLAG(IS_FUCHSIA)
+
+ void* GetStackTop() {
diff --git a/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_thread__isolation_pkey.cc b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_thread__isolation_pkey.cc
new file mode 100644
index 0000000000..18acf783e3
--- /dev/null
+++ b/chromium-next/patches/patch-base_allocator_partition__allocator_src_partition__alloc_thread__isolation_pkey.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.cc
+@@ -16,7 +16,7 @@
+ #include "partition_alloc/partition_alloc_check.h"
+ #include "partition_alloc/thread_isolation/thread_isolation.h"
+
+-#if !PA_BUILDFLAG(IS_LINUX) && !PA_BUILDFLAG(IS_CHROMEOS)
++#if !PA_BUILDFLAG(IS_LINUX) && !PA_BUILDFLAG(IS_CHROMEOS) && !PA_BUILDFLAG(IS_BSD)
+ #error "This pkey code is currently only supported on Linux and ChromeOS"
+ #endif
+
diff --git a/chromium-next/patches/patch-base_atomicops.h b/chromium-next/patches/patch-base_atomicops.h
new file mode 100644
index 0000000000..8826e31e49
--- /dev/null
+++ b/chromium-next/patches/patch-base_atomicops.h
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/atomicops.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/atomicops.h
+@@ -71,7 +71,11 @@ typedef intptr_t Atomic64;
+
+ // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
+ // Atomic64 routines below, depending on your architecture.
++#if !defined(OS_OPENBSD) && defined(__i386__)
++typedef Atomic32 AtomicWord;
++#else
+ typedef intptr_t AtomicWord;
++#endif
+
+ // Atomically execute:
+ // result = *ptr;
diff --git a/chromium-next/patches/patch-base_base__paths__posix.cc b/chromium-next/patches/patch-base_base__paths__posix.cc
new file mode 100644
index 0000000000..87378911b6
--- /dev/null
+++ b/chromium-next/patches/patch-base_base__paths__posix.cc
@@ -0,0 +1,128 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/base_paths_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/base_paths_posix.cc
+@@ -15,6 +15,7 @@
+ #include <ostream>
+ #include <string>
+
++#include "base/command_line.h"
+ #include "base/environment.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
+@@ -26,9 +27,13 @@
+ #include "base/process/process_metrics.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_BSD)
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
++#if BUILDFLAG(IS_OPENBSD)
++#include <kvm.h>
++#define MAXTOKENS 2
++#endif
+ #elif BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_AIX)
+ #include <stdlib.h>
+ #endif
+@@ -47,13 +52,21 @@ bool PathProviderPosix(int key, FilePath
+ *result = bin_dir;
+ return true;
+ #elif BUILDFLAG(IS_FREEBSD)
+- int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
+- std::optional<std::string> bin_dir = StringSysctl(name, std::size(name));
++ std::optional<std::string> bin_dir = StringSysctl({ CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 });
+ if (!bin_dir.has_value() || bin_dir.value().length() <= 1) {
+ NOTREACHED() << "Unable to resolve path.";
+ }
+ *result = FilePath(bin_dir.value());
+ return true;
++#elif BUILDFLAG(IS_NETBSD)
++ std::optional<std::string> bin_dir = StringSysctl({ CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_PATHNAME });
++ if (!bin_dir.has_value() || bin_dir.value().length() <= 1) {
++ NOTREACHED_IN_MIGRATION() << "Unable to resolve path.";
++ return false;
++ }
++ *result = FilePath(bin_dir.value());
++ VLOG(1) << "PathProviderPosix result: " << bin_dir.value();
++ return true;
+ #elif BUILDFLAG(IS_SOLARIS)
+ char bin_dir[PATH_MAX + 1];
+ if (realpath(getexecname(), bin_dir) == NULL) {
+@@ -62,13 +75,65 @@ bool PathProviderPosix(int key, FilePath
+ *result = FilePath(bin_dir);
+ return true;
+ #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 !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, (int)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<uint32_t>(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("@PREFIX@/lib/chromium/chrome");
++ return true;
++#if !BUILDFLAG(IS_AIX)
++ }
++ return ret;
++#endif
+ #endif
+ }
+ case DIR_SRC_TEST_DATA_ROOT: {
diff --git a/chromium-next/patches/patch-base_compiler__specific.h b/chromium-next/patches/patch-base_compiler__specific.h
new file mode 100644
index 0000000000..80478f15e0
--- /dev/null
+++ b/chromium-next/patches/patch-base_compiler__specific.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/compiler_specific.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/compiler_specific.h
+@@ -683,6 +683,7 @@ inline constexpr bool AnalyzerAssumeTrue
+ #if __has_cpp_attribute(clang::preserve_most) && \
+ (defined(ARCH_CPU_ARM64) || defined(ARCH_CPU_X86_64)) && \
+ !defined(COMPONENT_BUILD) && \
++ !BUILDFLAG(IS_OPENBSD) && \
+ !(BUILDFLAG(IS_WIN) && defined(ARCH_CPU_ARM64))
+ #define PRESERVE_MOST [[clang::preserve_most]]
+ #else
diff --git a/chromium-next/patches/patch-base_debug_debugger__posix.cc b/chromium-next/patches/patch-base_debug_debugger__posix.cc
new file mode 100644
index 0000000000..6d87c9f710
--- /dev/null
+++ b/chromium-next/patches/patch-base_debug_debugger__posix.cc
@@ -0,0 +1,106 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/debug/debugger_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/debug/debugger_posix.cc
+@@ -41,6 +41,10 @@
+ #include <sys/sysctl.h>
+ #endif
+
++#if BUILDFLAG(IS_OPENBSD)
++#include <sys/proc.h>
++#endif
++
+ #if BUILDFLAG(IS_FREEBSD)
+ #include <sys/user.h>
+ #endif
+@@ -86,6 +90,7 @@ bool BeingDebugged() {
+
+ // Initialize mib, which tells sysctl what info we want. In this case,
+ // we're looking for information about a specific process ID.
++#if !BUILDFLAG(IS_NETBSD)
+ int mib[] = {
+ CTL_KERN,
+ KERN_PROC,
+@@ -97,36 +102,75 @@ bool BeingDebugged() {
+ 0
+ #endif
+ };
++#else
++ int mib[] = {
++ CTL_KERN,
++ KERN_PROC2,
++ KERN_PROC_PID,
++ getpid(),
++ sizeof(struct kinfo_proc2),
++ 1
++ };
++#endif
+
+ // Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and
+ // binary interfaces may change.
++#if BUILDFLAG(IS_OPENBSD)
++ struct kinfo_proc *info;
++ size_t info_size;
++#elif BUILDFLAG(IS_NETBSD)
++ struct kinfo_proc2 info;
++ size_t info_size = sizeof(info);
++#else
+ struct kinfo_proc info;
+ size_t info_size = sizeof(info);
++#endif
+
+ #if BUILDFLAG(IS_OPENBSD)
+ if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0)
+ return -1;
+
+- mib[5] = (info_size / sizeof(struct kinfo_proc));
++ mib[5] = static_cast<int>((info_size / sizeof(struct kinfo_proc)));
++ if ((info = reinterpret_cast<kinfo_proc*>(malloc(info_size))) == NULL) {
++ is_set = true;
++ being_debugged = false;
++ return being_debugged;
++ }
++
++ int sysctl_result = sysctl(mib, std::size(mib), info, &info_size, NULL, 0);
++#elif BUILDFLAG(IS_NETBSD)
++ if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0)
++ return -1;
++
++ mib[5] = (info_size / sizeof(struct kinfo_proc2));
+ #endif
+
++#if !BUILDFLAG(IS_OPENBSD)
+ int sysctl_result = sysctl(mib, std::size(mib), &info, &info_size, NULL, 0);
++#endif
+ DCHECK_EQ(sysctl_result, 0);
+ if (sysctl_result != 0) {
+ is_set = true;
+ being_debugged = false;
+- return being_debugged;
++ goto out;
+ }
+
+ // This process is being debugged if the P_TRACED flag is set.
+ is_set = true;
+ #if BUILDFLAG(IS_FREEBSD)
+ being_debugged = (info.ki_flag & P_TRACED) != 0;
+-#elif BUILDFLAG(IS_BSD)
++#elif BUILDFLAG(IS_OPENBSD)
++ being_debugged = (info->p_psflags & PS_TRACED) != 0;
++#elif BUILDFLAG(IS_NETBSD)
+ being_debugged = (info.p_flag & P_TRACED) != 0;
+ #else
+ being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
+ #endif
++
++out:
++#if BUILDFLAG(IS_OPENBSD)
++ free(info);
++#endif
+ return being_debugged;
+ }
+
diff --git a/chromium-next/patches/patch-base_debug_elf__reader.cc b/chromium-next/patches/patch-base_debug_elf__reader.cc
new file mode 100644
index 0000000000..562e910c67
--- /dev/null
+++ b/chromium-next/patches/patch-base_debug_elf__reader.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/debug/elf_reader.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/debug/elf_reader.cc
+@@ -50,6 +50,10 @@ using Xword = Elf64_Xword;
+
+ constexpr char kGnuNoteName[] = "GNU";
+
++#ifndef NT_GNU_BUILD_ID
++#define NT_GNU_BUILD_ID 3
++#endif
++
+ // Returns a pointer to the header of the ELF binary mapped into memory, or a
+ // null pointer if the header is invalid. Here and below |elf_mapped_base| is a
+ // pointer to the start of the ELF image.
diff --git a/chromium-next/patches/patch-base_debug_proc__maps__linux.cc b/chromium-next/patches/patch-base_debug_proc__maps__linux.cc
new file mode 100644
index 0000000000..0864d05353
--- /dev/null
+++ b/chromium-next/patches/patch-base_debug_proc__maps__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/debug/proc_maps_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/debug/proc_maps_linux.cc
+@@ -20,7 +20,7 @@
+ #include "base/strings/string_split.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include <inttypes.h>
+ #endif
+
diff --git a/chromium-next/patches/patch-base_debug_stack__trace.cc b/chromium-next/patches/patch-base_debug_stack__trace.cc
new file mode 100644
index 0000000000..26a066bcea
--- /dev/null
+++ b/chromium-next/patches/patch-base_debug_stack__trace.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/debug/stack_trace.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/debug/stack_trace.cc
+@@ -258,7 +258,7 @@ bool StackTrace::WillSymbolizeToStreamFo
+ // Symbols are not expected to be reliable when gn args specifies
+ // symbol_level=0.
+ return false;
+-#elif defined(__UCLIBC__) || defined(_AIX)
++#elif defined(__UCLIBC__) || defined(_AIX) || BUILDFLAG(IS_BSD)
+ // StackTrace::OutputToStream() is not implemented under uclibc, nor AIX.
+ // See https://crbug.com/706728
+ return false;
+@@ -320,7 +320,7 @@ std::string StackTrace::ToString() const
+
+ std::string StackTrace::ToStringWithPrefix(cstring_view prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+@@ -344,7 +344,7 @@ bool StackTrace::ShouldSuppressOutput()
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
diff --git a/chromium-next/patches/patch-base_debug_stack__trace__posix.cc b/chromium-next/patches/patch-base_debug_stack__trace__posix.cc
new file mode 100644
index 0000000000..bb4f277f2c
--- /dev/null
+++ b/chromium-next/patches/patch-base_debug_stack__trace__posix.cc
@@ -0,0 +1,109 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/debug/stack_trace_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/debug/stack_trace_posix.cc
+@@ -45,8 +45,8 @@
+ // Surprisingly, uClibc defines __GLIBC__ in some build configs, but
+ // execinfo.h and backtrace(3) are really only present in glibc and in macOS
+ // libc.
+-#if BUILDFLAG(IS_APPLE) || \
+- (defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__AIX))
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NETBSD) || \
++ (defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__AIX) && !BUILDFLAG(IS_BSD))
+ #define HAVE_BACKTRACE
+ #include <execinfo.h>
+ #endif
+@@ -64,8 +64,10 @@
+ #include <AvailabilityMacros.h>
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/prctl.h>
++#endif
+
+ #include "base/debug/proc_maps_linux.h"
+ #endif
+@@ -322,7 +324,7 @@ void PrintToStderr(const char* output) {
+ std::ignore = HANDLE_EINTR(write(STDERR_FILENO, output, strlen(output)));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void AlarmSignalHandler(int signal, siginfo_t* info, void* void_context) {
+ // We have seen rare cases on AMD linux where the default signal handler
+ // either does not run or a thread (Probably an AMD driver thread) prevents
+@@ -339,7 +341,11 @@ void AlarmSignalHandler(int signal, sigi
+ "Warning: Default signal handler failed to terminate process.\n");
+ PrintToStderr("Calling exit_group() directly to prevent timeout.\n");
+ // See: https://man7.org/linux/man-pages/man2/exit_group.2.html
++#if BUILDFLAG(IS_BSD)
++ _exit(EXIT_FAILURE);
++#else
+ syscall(SYS_exit_group, EXIT_FAILURE);
++#endif
+ }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ||
+ // BUILDFLAG(IS_CHROMEOS)
+@@ -537,7 +543,7 @@ void StackDumpSignalHandler(int signal,
+ _exit(EXIT_FAILURE);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Set an alarm to trigger in case the default handler does not terminate
+ // the process. See 'AlarmSignalHandler' for more details.
+ struct sigaction action;
+@@ -562,6 +568,7 @@ void StackDumpSignalHandler(int signal,
+ // signals that do not re-raise autonomously), such as signals delivered via
+ // kill() and asynchronous hardware faults such as SEGV_MTEAERR, which would
+ // otherwise be lost when re-raising the signal via raise().
++#if !BUILDFLAG(IS_BSD)
+ long retval = syscall(SYS_rt_tgsigqueueinfo, getpid(), syscall(SYS_gettid),
+ info->si_signo, info);
+ if (retval == 0) {
+@@ -576,6 +583,7 @@ void StackDumpSignalHandler(int signal,
+ if (errno != EPERM) {
+ _exit(EXIT_FAILURE);
+ }
++#endif
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ||
+ // BUILDFLAG(IS_CHROMEOS)
+
+@@ -772,6 +780,7 @@ class SandboxSymbolizeHelper {
+ return -1;
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ // This class is copied from
+ // third_party/crashpad/crashpad/util/linux/scoped_pr_set_dumpable.h.
+ // It aims at ensuring the process is dumpable before opening /proc/self/mem.
+@@ -864,11 +873,15 @@ class SandboxSymbolizeHelper {
+ r.base = cur_base;
+ }
+ }
++#endif
+
+ // Parses /proc/self/maps in order to compile a list of all object file names
+ // for the modules that are loaded in the current process.
+ // Returns true on success.
+ bool CacheMemoryRegions() {
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ // Reads /proc/self/maps.
+ std::string contents;
+ if (!ReadProcMaps(&contents)) {
+@@ -886,6 +899,7 @@ class SandboxSymbolizeHelper {
+
+ is_initialized_ = true;
+ return true;
++#endif
+ }
+
+ // Opens all object files and caches their file descriptors.
diff --git a/chromium-next/patches/patch-base_files_dir__reader__linux.h b/chromium-next/patches/patch-base_files_dir__reader__linux.h
new file mode 100644
index 0000000000..8a1f290e2a
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_dir__reader__linux.h
@@ -0,0 +1,45 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/dir_reader_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/dir_reader_linux.h
+@@ -21,10 +21,16 @@
+ #include "base/logging.h"
+ #include "base/posix/eintr_wrapper.h"
+
++#include "build/build_config.h"
++
+ // See the comments in dir_reader_posix.h about this.
+
+ namespace base {
+
++#if BUILDFLAG(IS_BSD)
++#include <dirent.h>
++typedef struct dirent linux_dirent;
++#else
+ struct linux_dirent {
+ uint64_t d_ino;
+ int64_t d_off;
+@@ -32,6 +38,7 @@ struct linux_dirent {
+ unsigned char d_type;
+ char d_name[0];
+ };
++#endif
+
+ class DirReaderLinux {
+ public:
+@@ -66,7 +73,11 @@ class DirReaderLinux {
+ if (offset_ != size_)
+ return true;
+
++#if BUILDFLAG(IS_BSD)
++ const int r = getdents(fd_, reinterpret_cast<char *>(buf_), sizeof(buf_));
++#else
+ const long r = syscall(__NR_getdents64, fd_, buf_, sizeof(buf_));
++#endif
+ if (r == 0)
+ return false;
+ if (r < 0) {
diff --git a/chromium-next/patches/patch-base_files_dir__reader__posix.h b/chromium-next/patches/patch-base_files_dir__reader__posix.h
new file mode 100644
index 0000000000..e03e1a9215
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_dir__reader__posix.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/dir_reader_posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/dir_reader_posix.h
+@@ -17,7 +17,7 @@
+ // seems worse than falling back to enumerating all file descriptors so we will
+ // probably never implement this on the Mac.
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "base/files/dir_reader_linux.h"
+ #else
+ #include "base/files/dir_reader_fallback.h"
+@@ -25,7 +25,7 @@
+
+ namespace base {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ typedef DirReaderLinux DirReaderPosix;
+ #else
+ typedef DirReaderFallback DirReaderPosix;
diff --git a/chromium-next/patches/patch-base_files_drive__info.h b/chromium-next/patches/patch-base_files_drive__info.h
new file mode 100644
index 0000000000..e291840b7f
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_drive__info.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/drive_info.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/drive_info.h
+@@ -40,7 +40,7 @@ class BASE_EXPORT DriveInfo {
+ std::optional<bool> has_seek_penalty;
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Whether the drive is a removable drive.
+ //
+ // Note on macOS: that SSDs that are connected over USB that you can eject
diff --git a/chromium-next/patches/patch-base_files_drive__info__posix.cc b/chromium-next/patches/patch-base_files_drive__info__posix.cc
new file mode 100644
index 0000000000..0f1b50ce65
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_drive__info__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/drive_info_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/drive_info_posix.cc
+@@ -28,7 +28,7 @@ DriveInfo& DriveInfo::operator=(DriveInf
+
+ std::optional<DriveInfo> GetFileDriveInfo(const FilePath& file_path) {
+ DriveInfo drive_info;
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ drive_info.has_seek_penalty = false;
+ return drive_info;
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-base_files_file__path__watcher.h b/chromium-next/patches/patch-base_files_file__path__watcher.h
new file mode 100644
index 0000000000..f10a91ea89
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__path__watcher.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_path_watcher.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/file_path_watcher.h
+@@ -105,7 +105,7 @@ class BASE_EXPORT FilePathWatcher {
+ Type type = Type::kNonRecursive;
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // The callback will return the full path to a changed file instead of
+ // the watched path supplied as |path| when Watch is called.
+ // So the full path can be different from the watched path when a folder is
diff --git a/chromium-next/patches/patch-base_files_file__path__watcher__bsd.cc b/chromium-next/patches/patch-base_files_file__path__watcher__bsd.cc
new file mode 100644
index 0000000000..0bcf88a57f
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__path__watcher__bsd.cc
@@ -0,0 +1,63 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_path_watcher_bsd.cc.orig 2025-01-20 18:01:27.799940648 +0000
++++ base/files/file_path_watcher_bsd.cc
+@@ -0,0 +1,54 @@
++// Copyright 2021 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include <memory>
++
++#include "base/files/file_path_watcher.h"
++#include "base/files/file_path_watcher_kqueue.h"
++#include "base/memory/ptr_util.h"
++#include "build/build_config.h"
++
++namespace base {
++
++namespace {
++
++class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
++ public:
++ FilePathWatcherImpl() = default;
++ FilePathWatcherImpl(const FilePathWatcherImpl&) = delete;
++ FilePathWatcherImpl& operator=(const FilePathWatcherImpl&) = delete;
++ ~FilePathWatcherImpl() override = default;
++
++ bool Watch(const FilePath& path,
++ Type type,
++ const FilePathWatcher::Callback& callback) override {
++ DCHECK(!impl_.get());
++ if (type == Type::kRecursive) {
++ if (!FilePathWatcher::RecursiveWatchAvailable())
++ return false;
++ } else {
++ impl_ = std::make_unique<FilePathWatcherKQueue>();
++ }
++ DCHECK(impl_.get());
++ return impl_->Watch(path, type, callback);
++ }
++
++ void Cancel() override {
++ if (impl_.get())
++ impl_->Cancel();
++ set_cancelled();
++ }
++
++ private:
++ std::unique_ptr<PlatformDelegate> impl_;
++};
++
++} // namespace
++
++FilePathWatcher::FilePathWatcher() {
++ DETACH_FROM_SEQUENCE(sequence_checker_);
++ impl_ = std::make_unique<FilePathWatcherImpl>();
++}
++
++} // namespace base
diff --git a/chromium-next/patches/patch-base_files_file__path__watcher__kqueue.cc b/chromium-next/patches/patch-base_files_file__path__watcher__kqueue.cc
new file mode 100644
index 0000000000..d2bf9e3edd
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__path__watcher__kqueue.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_path_watcher_kqueue.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/file_path_watcher_kqueue.cc
+@@ -81,9 +81,15 @@ size_t FilePathWatcherKQueue::EventsForP
+ FilePath::StringType subdir = (i != (components.end() - 1)) ? *(i + 1) : "";
+ EventData* data = new EventData(built_path, subdir);
+ struct kevent event;
++#if defined(__NetBSD__) && __NetBSD_Version__ < 999000000
++ EV_SET(&event, fd, EVFILT_VNODE, (EV_ADD | EV_CLEAR | EV_RECEIPT),
++ (NOTE_DELETE | NOTE_WRITE | NOTE_ATTRIB |
++ NOTE_RENAME | NOTE_REVOKE | NOTE_EXTEND), 0, reinterpret_cast<intptr_t>(data));
++#else
+ EV_SET(&event, fd, EVFILT_VNODE, (EV_ADD | EV_CLEAR | EV_RECEIPT),
+ (NOTE_DELETE | NOTE_WRITE | NOTE_ATTRIB |
+ NOTE_RENAME | NOTE_REVOKE | NOTE_EXTEND), 0, data);
++#endif
+ events->push_back(event);
+ }
+ return last_existing_entry;
diff --git a/chromium-next/patches/patch-base_files_file__path__watcher__kqueue.h b/chromium-next/patches/patch-base_files_file__path__watcher__kqueue.h
new file mode 100644
index 0000000000..cff945d7ed
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__path__watcher__kqueue.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_path_watcher_kqueue.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/file_path_watcher_kqueue.h
+@@ -5,6 +5,7 @@
+ #ifndef BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+ #define BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+
++#include <sys/time.h>
+ #include <sys/event.h>
+
+ #include <memory>
diff --git a/chromium-next/patches/patch-base_files_file__path__watcher__unittest.cc b/chromium-next/patches/patch-base_files_file__path__watcher__unittest.cc
new file mode 100644
index 0000000000..f8c469cc39
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__path__watcher__unittest.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_path_watcher_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/file_path_watcher_unittest.cc
+@@ -902,7 +902,7 @@ TEST_F(FilePathWatcherTest, WatchDirecto
+ }
+ delegate.RunUntilEventsMatch(event_expecter);
+
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && BUILDFLAG(IS_BSD)
+ ASSERT_TRUE(WriteFile(file1, "content v2"));
+ // Mac implementation does not detect files modified in a directory.
+ // TODO(crbug.com/40263777): Expect that no events are fired on Mac.
+@@ -1848,7 +1848,7 @@ namespace {
+
+ enum Permission { Read, Write, 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;
+
+@@ -1882,7 +1882,7 @@ bool ChangeFilePermissions(const FilePat
+
+ } // namespace
+
+-#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/chromium-next/patches/patch-base_files_file__util__posix.cc b/chromium-next/patches/patch-base_files_file__util__posix.cc
new file mode 100644
index 0000000000..795bae811c
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__util__posix.cc
@@ -0,0 +1,61 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_util_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/file_util_posix.cc
+@@ -897,36 +897,33 @@ bool CreateNewTempDirectory(const FilePa
+ bool CreateDirectoryAndGetError(const FilePath& full_path, File::Error* error) {
+ ScopedBlockingCall scoped_blocking_call(
+ FROM_HERE, BlockingType::MAY_BLOCK); // For call to mkdir().
++ const FilePath kFileSystemRoot("/");
+ std::vector<FilePath> subpaths;
+
+ // Collect a list of all parent directories.
+ FilePath last_path = full_path;
+- subpaths.push_back(full_path);
+- for (FilePath path = full_path.DirName(); path.value() != last_path.value();
+- path = path.DirName()) {
++ if (full_path != kFileSystemRoot)
++ subpaths.push_back(full_path);
++ for (FilePath path = full_path.DirName(); (path.value() != last_path.value() &&
++ (path != kFileSystemRoot)); path = path.DirName()) {
+ subpaths.push_back(path);
+ last_path = path;
+ }
+
+ // Iterate through the parents and create the missing ones.
+ for (const FilePath& subpath : base::Reversed(subpaths)) {
+- if (DirectoryExists(subpath)) {
+- continue;
+- }
+- if (mkdir(subpath.value().c_str(), 0700) == 0) {
+- continue;
+- }
+- // Mkdir failed, but it might have failed with EEXIST, or some other error
+- // due to the directory appearing out of thin air. This can occur if
+- // two processes are trying to create the same file system tree at the same
+- // time. Check to see if it exists and make sure it is a directory.
+- int saved_errno = errno;
+- if (!DirectoryExists(subpath)) {
+- if (error) {
+- *error = File::OSErrorToFileError(saved_errno);
++ if (!PathExists(subpath)) {
++ if ((mkdir(subpath.value().c_str(), 0700) == -1) &&
++ ((full_path != subpath) ? (errno != ENOENT) : (-1))) {
++ int saved_errno = errno;
++ if (error)
++ *error = File::OSErrorToFileError(saved_errno);
++ return false;
+ }
+- errno = saved_errno;
+- return false;
++ } else if (!DirectoryExists(subpath)) {
++ if (error)
++ *error = File::OSErrorToFileError(ENOTDIR);
++ return false;
+ }
+ }
+ return true;
diff --git a/chromium-next/patches/patch-base_files_file__util__unittest.cc b/chromium-next/patches/patch-base_files_file__util__unittest.cc
new file mode 100644
index 0000000000..dcf5fa8dff
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_file__util__unittest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/file_util_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/file_util_unittest.cc
+@@ -3908,7 +3908,7 @@ TEST_F(FileUtilTest, ReadFileToStringWit
+ }
+ #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";
+@@ -4645,7 +4645,7 @@ TEST(FileUtilMultiThreadedTest, MultiThr
+ 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/chromium-next/patches/patch-base_files_important__file__writer__cleaner.cc b/chromium-next/patches/patch-base_files_important__file__writer__cleaner.cc
new file mode 100644
index 0000000000..45cbd46be5
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_important__file__writer__cleaner.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/important_file_writer_cleaner.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/important_file_writer_cleaner.cc
+@@ -25,7 +25,8 @@ namespace base {
+ namespace {
+
+ base::Time GetUpperBoundTime() {
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA)
++// needed because of .CreationTime() pledge
++#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/chromium-next/patches/patch-base_files_scoped__file.cc b/chromium-next/patches/patch-base_files_scoped__file.cc
new file mode 100644
index 0000000000..91b47957f8
--- /dev/null
+++ b/chromium-next/patches/patch-base_files_scoped__file.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/files/scoped_file.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/files/scoped_file.cc
+@@ -32,7 +32,7 @@ void ScopedFDCloseTraits::Free(int fd) {
+ int ret = IGNORE_EINTR(close(fd));
+
+ #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/chromium-next/patches/patch-base_functional_unretained__traits.h b/chromium-next/patches/patch-base_functional_unretained__traits.h
new file mode 100644
index 0000000000..f06f6e297e
--- /dev/null
+++ b/chromium-next/patches/patch-base_functional_unretained__traits.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/functional/unretained_traits.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/functional/unretained_traits.h
+@@ -93,7 +93,7 @@ struct SupportsUnretainedImpl {
+ // official builds, and then in non-test code as well.
+ #if defined(FORCE_UNRETAINED_COMPLETENESS_CHECKS_FOR_TESTS) || \
+ (!defined(UNIT_TEST) && !defined(OFFICIAL_BUILD) && \
+- (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)))
++ (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)))
+ static_assert(v,
+ "Argument requires unretained storage, but type is not "
+ "fully defined. This prevents determining whether "
diff --git a/chromium-next/patches/patch-base_i18n_icu__util.cc b/chromium-next/patches/patch-base_i18n_icu__util.cc
new file mode 100644
index 0000000000..3602adfd71
--- /dev/null
+++ b/chromium-next/patches/patch-base_i18n_icu__util.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/i18n/icu_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/i18n/icu_util.cc
+@@ -52,7 +52,7 @@
+ #include "third_party/icu/source/common/unicode/unistr.h"
+ #endif
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \
+ BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS))
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+ #endif
+@@ -328,7 +328,7 @@ void InitializeIcuTimeZone() {
+ FuchsiaIntlProfileWatcher::GetPrimaryTimeZoneIdForIcuInitialization();
+ icu::TimeZone::adoptDefault(
+ icu::TimeZone::createTimeZone(icu::UnicodeString::fromUTF8(zone_id)));
+-#elif BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS))
++#elif BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD)
+ // 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/chromium-next/patches/patch-base_linux__util.cc b/chromium-next/patches/patch-base_linux__util.cc
new file mode 100644
index 0000000000..7de748ecf0
--- /dev/null
+++ b/chromium-next/patches/patch-base_linux__util.cc
@@ -0,0 +1,23 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/linux_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/linux_util.cc
+@@ -154,10 +154,14 @@ void SetLinuxDistro(const std::string& d
+ }
+
+ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t>* tids) {
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ // 25 > strlen("/proc//task") + strlen(base::NumberToString(INT_MAX)) + 1 = 22
+ char buf[25];
+ strings::SafeSPrintf(buf, "/proc/%d/task", pid);
+ return GetThreadsFromProcessDir(buf, tids);
++#endif
+ }
+
+ bool GetThreadsForCurrentProcess(std::vector<pid_t>* tids) {
diff --git a/chromium-next/patches/patch-base_logging__unittest.cc b/chromium-next/patches/patch-base_logging__unittest.cc
new file mode 100644
index 0000000000..66f97a4894
--- /dev/null
+++ b/chromium-next/patches/patch-base_logging__unittest.cc
@@ -0,0 +1,37 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/logging_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/logging_unittest.cc
+@@ -41,7 +41,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 <ucontext.h>
+ #endif
+
+@@ -585,14 +585,18 @@ void CheckCrashTestSighandler(int, sigin
+ // 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) || BUILDFLAG(IS_NETBSD)
+ crash_addr = reinterpret_cast<uintptr_t>(info->si_addr);
+ #else // OS_*
+ ucontext_t* context = reinterpret_cast<ucontext_t*>(context_ptr);
+ #if defined(ARCH_CPU_X86)
+ crash_addr = static_cast<uintptr_t>(context->uc_mcontext.gregs[REG_EIP]);
+ #elif defined(ARCH_CPU_X86_64)
++#if BUILDFLAG(IS_OPENBSD)
++ crash_addr = static_cast<uintptr_t>(context->sc_rip);
++#else
+ crash_addr = static_cast<uintptr_t>(context->uc_mcontext.gregs[REG_RIP]);
++#endif
+ #elif defined(ARCH_CPU_ARMEL)
+ crash_addr = static_cast<uintptr_t>(context->uc_mcontext.arm_pc);
+ #elif defined(ARCH_CPU_ARM64)
diff --git a/chromium-next/patches/patch-base_memory_discardable__memory.cc b/chromium-next/patches/patch-base_memory_discardable__memory.cc
new file mode 100644
index 0000000000..0691453fc5
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_discardable__memory.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/discardable_memory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/discardable_memory.cc
+@@ -26,7 +26,7 @@ BASE_FEATURE(kMadvFreeDiscardableMemory,
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kDiscardableMemoryBackingTrial,
+ "DiscardableMemoryBackingTrial",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -39,7 +39,7 @@ BASE_FEATURE(kDiscardableMemoryBackingTr
+
+ namespace {
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ DiscardableMemoryBacking GetBackingForFieldTrial() {
+ DiscardableMemoryTrialGroup trial_group =
+@@ -58,7 +58,7 @@ DiscardableMemoryBacking GetBackingForFi
+
+ } // namespace
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Probe capabilities of this device to determine whether we should participate
+ // in the discardable memory backing trial.
+@@ -88,7 +88,7 @@ DiscardableMemory::DiscardableMemory() =
+ DiscardableMemory::~DiscardableMemory() = default;
+
+ DiscardableMemoryBacking GetDiscardableMemoryBacking() {
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (DiscardableMemoryBackingFieldTrialIsEnabled()) {
+ return GetBackingForFieldTrial();
+ }
diff --git a/chromium-next/patches/patch-base_memory_discardable__memory__internal.h b/chromium-next/patches/patch-base_memory_discardable__memory__internal.h
new file mode 100644
index 0000000000..f200f836cc
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_discardable__memory__internal.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/discardable_memory_internal.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/discardable_memory_internal.h
+@@ -12,7 +12,7 @@
+ #include "base/metrics/field_trial_params.h"
+ #include "build/build_config.h"
+
+-#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/chromium-next/patches/patch-base_memory_madv__free__discardable__memory__posix.cc b/chromium-next/patches/patch-base_memory_madv__free__discardable__memory__posix.cc
new file mode 100644
index 0000000000..ffd1d8671b
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_madv__free__discardable__memory__posix.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/madv_free_discardable_memory_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/madv_free_discardable_memory_posix.cc
+@@ -310,6 +310,10 @@ void MadvFreeDiscardableMemoryPosix::Set
+
+ bool MadvFreeDiscardableMemoryPosix::IsResident() const {
+ DFAKE_SCOPED_RECURSIVE_LOCK(thread_collision_warner_);
++// XXX mincore
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ #if BUILDFLAG(IS_APPLE)
+ std::vector<char> vec(allocated_pages_);
+ #else
+@@ -325,6 +329,7 @@ bool MadvFreeDiscardableMemoryPosix::IsR
+ return false;
+ }
+ return true;
++#endif
+ }
+
+ bool MadvFreeDiscardableMemoryPosix::IsDiscarded() const {
diff --git a/chromium-next/patches/patch-base_memory_platform__shared__memory__region.h b/chromium-next/patches/patch-base_memory_platform__shared__memory__region.h
new file mode 100644
index 0000000000..3be6525ee5
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_platform__shared__memory__region.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/platform_shared_memory_region.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/platform_shared_memory_region.h
+@@ -18,7 +18,7 @@
+ #include "base/unguessable_token.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ namespace content {
+ class SandboxIPCHandler;
+ }
+@@ -85,7 +85,7 @@ class BASE_EXPORT PlatformSharedMemoryRe
+ kMaxValue = GET_SHMEM_TEMP_DIR_FAILURE
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Structure to limit access to executable region creation.
+ struct ExecutableRegion {
+ private:
+@@ -217,7 +217,7 @@ class BASE_EXPORT PlatformSharedMemoryRe
+ CheckPlatformHandlePermissionsCorrespondToMode);
+ static PlatformSharedMemoryRegion Create(Mode mode,
+ size_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ bool executable = false
+ #endif
diff --git a/chromium-next/patches/patch-base_memory_platform__shared__memory__region__posix.cc b/chromium-next/patches/patch-base_memory_platform__shared__memory__region__posix.cc
new file mode 100644
index 0000000000..f7d9a18161
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_platform__shared__memory__region__posix.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/platform_shared_memory_region_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/platform_shared_memory_region_posix.cc
+@@ -55,7 +55,7 @@ bool CheckFDAccessMode(int fd, int expec
+
+ } // namespace
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) {
+ PlatformSharedMemoryRegion region =
+@@ -168,7 +168,7 @@ bool PlatformSharedMemoryRegion::Convert
+ // static
+ PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode,
+ size_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ bool executable
+ #endif
+@@ -197,7 +197,7 @@ PlatformSharedMemoryRegion PlatformShare
+ // flag.
+ FilePath directory;
+ if (!GetShmemTempDir(
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ executable,
+ #else
+ false /* executable */,
diff --git a/chromium-next/patches/patch-base_memory_protected__memory.h b/chromium-next/patches/patch-base_memory_protected__memory.h
new file mode 100644
index 0000000000..a690589106
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_protected__memory.h
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/protected_memory.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/protected_memory.h
+@@ -120,12 +120,12 @@ __declspec(selectany) char __stop_protec
+
+ #define DECLARE_PROTECTED_DATA constinit
+ #define DEFINE_PROTECTED_DATA constinit __declspec(allocate("prot$mem"))
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // This value is used to align the writers variable. That variable needs to be
+ // aligned to ensure that the protected memory section starts on a page
+ // boundary.
+ #if (PA_BUILDFLAG(IS_ANDROID) && PA_BUILDFLAG(PA_ARCH_CPU_64_BITS)) || \
+- (PA_BUILDFLAG(IS_LINUX) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64))
++ ((PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_BSD)) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64))
+ // arm64 supports 4kb, 16kb, and 64kb pages. Set to the largest of 64kb as that
+ // will guarantee the section is page aligned regardless of the choice.
+ inline constexpr int kProtectedMemoryAlignment = 65536;
+@@ -340,7 +340,7 @@ class BASE_EXPORT AutoWritableMemoryBase
+ // where an attacker could overwrite it with a large value and invoke code
+ // that constructs and destructs an AutoWritableMemory. After such a call
+ // protected memory would still be set writable because writers > 0.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // On Linux, the protected memory section is not automatically page aligned.
+ // This means that attempts to reset the protected memory region to readonly
+ // will set some of the preceding section that is on the same page readonly
+@@ -354,7 +354,7 @@ class BASE_EXPORT AutoWritableMemoryBase
+ #endif
+ static inline size_t writers GUARDED_BY(writers_lock()) = 0;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // On Linux, there is no guarantee the section following the protected
+ // memory section is page aligned. This can result in attempts to change
+ // the access permissions of the end of the protected memory section
+@@ -412,7 +412,7 @@ class BASE_EXPORT AutoWritableMemoryInit
+ // the variable to something large before the section was read-only.
+ WriterData::writers = 0;
+ CHECK(SetProtectedSectionReadOnly());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Set the protected_memory_section_buffer to true to ensure the buffer
+ // section is created. If a variable is declared but not used the memory
+ // section won't be created.
diff --git a/chromium-next/patches/patch-base_memory_protected__memory__posix.cc b/chromium-next/patches/patch-base_memory_protected__memory__posix.cc
new file mode 100644
index 0000000000..14a1729a62
--- /dev/null
+++ b/chromium-next/patches/patch-base_memory_protected__memory__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/memory/protected_memory_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/memory/protected_memory_posix.cc
+@@ -6,7 +6,7 @@
+
+ #include <sys/mman.h>
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include <sys/resource.h>
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -34,7 +34,7 @@ bool SetMemory(void* start, void* end, i
+ } // namespace
+
+ namespace internal {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ void CheckMemoryReadOnly(const void* ptr) {
+ const uintptr_t page_start =
+ bits::AlignDown(reinterpret_cast<uintptr_t>(ptr), GetPageSize());
diff --git a/chromium-next/patches/patch-base_message__loop_message__pump__epoll.cc b/chromium-next/patches/patch-base_message__loop_message__pump__epoll.cc
new file mode 100644
index 0000000000..d59857a4c2
--- /dev/null
+++ b/chromium-next/patches/patch-base_message__loop_message__pump__epoll.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/message_loop/message_pump_epoll.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/message_loop/message_pump_epoll.cc
+@@ -42,7 +42,7 @@ std::atomic_bool g_use_batched_version =
+ std::atomic_bool g_use_poll = false;
+
+ constexpr std::pair<uint32_t, short int> kEpollToPollEvents[] = {
+- {EPOLLIN, POLLIN}, {EPOLLOUT, POLLOUT}, {EPOLLRDHUP, POLLRDHUP},
++ {EPOLLIN, POLLIN}, {EPOLLOUT, POLLOUT},
+ {EPOLLPRI, POLLPRI}, {EPOLLERR, POLLERR}, {EPOLLHUP, POLLHUP}};
+
+ void SetEventsForPoll(const uint32_t epoll_events, struct pollfd* poll_entry) {
diff --git a/chromium-next/patches/patch-base_message__loop_message__pump__epoll.h b/chromium-next/patches/patch-base_message__loop_message__pump__epoll.h
new file mode 100644
index 0000000000..2559c9637f
--- /dev/null
+++ b/chromium-next/patches/patch-base_message__loop_message__pump__epoll.h
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/message_loop/message_pump_epoll.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/message_loop/message_pump_epoll.h
+@@ -51,7 +51,11 @@ namespace base {
+ // every call, don't do it when we have too many FDs.
+ BASE_FEATURE(kUsePollForMessagePumpEpoll,
+ "UsePollForMessagePumpEpoll",
++#if BUILDFLAG(IS_BSD)
++ base::FEATURE_ENABLED_BY_DEFAULT);
++#else
+ base::FEATURE_DISABLED_BY_DEFAULT);
++#endif
+
+ // A MessagePump implementation suitable for I/O message loops on Linux-based
+ // systems with epoll API support.
diff --git a/chromium-next/patches/patch-base_message__loop_message__pump__glib.cc b/chromium-next/patches/patch-base_message__loop_message__pump__glib.cc
new file mode 100644
index 0000000000..c773b136fb
--- /dev/null
+++ b/chromium-next/patches/patch-base_message__loop_message__pump__glib.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/message_loop/message_pump_glib.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/message_loop/message_pump_glib.cc
+@@ -8,6 +8,15 @@
+ #include <glib.h>
+ #include <math.h>
+
++#if BUILDFLAG(IS_BSD)
++#if BUILDFLAG(IS_NETBSD)
++#include <lwp.h>
++#else
++#include <pthread.h>
++#include <pthread_np.h>
++#endif
++#endif
++
+ #include "base/logging.h"
+ #include "base/memory/raw_ptr.h"
+ #include "base/notreached.h"
+@@ -51,9 +60,19 @@ int GetTimeIntervalMilliseconds(TimeTick
+ }
+
+ bool RunningOnMainThread() {
++#if BUILDFLAG(IS_BSD)
++#if BUILDFLAG(IS_NETBSD)
++ auto pid = getpid();
++ auto tid = _lwp_self();
++ return pid > 0 && tid > 0 && pid == tid;
++#else
++ return pthread_main_np();
++#endif
++#else
+ auto pid = getpid();
+ auto tid = PlatformThread::CurrentId();
+ return pid > 0 && tid > 0 && pid == tid;
++#endif
+ }
+
+ // A brief refresher on GLib:
diff --git a/chromium-next/patches/patch-base_native__library__posix.cc b/chromium-next/patches/patch-base_native__library__posix.cc
new file mode 100644
index 0000000000..0c749a7b69
--- /dev/null
+++ b/chromium-next/patches/patch-base_native__library__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/native_library_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/native_library_posix.cc
+@@ -34,7 +34,7 @@ NativeLibrary LoadNativeLibraryWithOptio
+ // http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892,
+ // and http://crbug.com/40794.
+ int flags = RTLD_LAZY;
+-#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND)
++#if BUILDFLAG(IS_ANDROID) || !defined(RTLD_DEEPBIND) || BUILDFLAG(IS_BSD)
+ // Certain platforms don't define RTLD_DEEPBIND. Android dlopen() requires
+ // further investigation, as it might vary across versions. Crash here to
+ // warn developers that they're trying to rely on uncertain behavior.
diff --git a/chromium-next/patches/patch-base_native__library__unittest.cc b/chromium-next/patches/patch-base_native__library__unittest.cc
new file mode 100644
index 0000000000..a84b74cdec
--- /dev/null
+++ b/chromium-next/patches/patch-base_native__library__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/native_library_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/native_library_unittest.cc
+@@ -135,7 +135,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/chromium-next/patches/patch-base_posix_can__lower__nice__to.cc b/chromium-next/patches/patch-base_posix_can__lower__nice__to.cc
new file mode 100644
index 0000000000..37eff54c8e
--- /dev/null
+++ b/chromium-next/patches/patch-base_posix_can__lower__nice__to.cc
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/posix/can_lower_nice_to.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/posix/can_lower_nice_to.cc
+@@ -11,8 +11,12 @@
+
+ #include "build/build_config.h"
+
++#if BUILDFLAG(IS_FREEBSD)
++#include <sys/param.h>
++#endif
++
+ // Not defined on AIX by default.
+-#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/chromium-next/patches/patch-base_posix_file__descriptor__shuffle.h b/chromium-next/patches/patch-base_posix_file__descriptor__shuffle.h
new file mode 100644
index 0000000000..d7f035c58c
--- /dev/null
+++ b/chromium-next/patches/patch-base_posix_file__descriptor__shuffle.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/posix/file_descriptor_shuffle.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/posix/file_descriptor_shuffle.h
+@@ -26,6 +26,8 @@
+ #include "base/base_export.h"
+ #include "base/compiler_specific.h"
+
++#undef close
++
+ namespace base {
+
+ // A Delegate which performs the actions required to perform an injective
diff --git a/chromium-next/patches/patch-base_posix_sysctl.cc b/chromium-next/patches/patch-base_posix_sysctl.cc
new file mode 100644
index 0000000000..fe812d068b
--- /dev/null
+++ b/chromium-next/patches/patch-base_posix_sysctl.cc
@@ -0,0 +1,38 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/posix/sysctl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/posix/sysctl.cc
+@@ -4,6 +4,7 @@
+
+ #include "base/posix/sysctl.h"
+
++#include <sys/types.h>
+ #include <sys/sysctl.h>
+
+ #include <initializer_list>
+@@ -16,17 +17,17 @@
+ #include "build/build_config.h"
+
+ namespace {
+-
++// NetBSD has sysctl_func macro in sys/sysctl.h, workaround: sysctl_func -> sysctl_func2
+ std::optional<std::string> StringSysctlImpl(
+- base::FunctionRef<int(char* /*out*/, size_t* /*out_len*/)> sysctl_func) {
++ base::FunctionRef<int(char* /*out*/, size_t* /*out_len*/)> sysctl_func2) {
+ size_t buf_len;
+- int result = sysctl_func(nullptr, &buf_len);
++ int result = sysctl_func2(nullptr, &buf_len);
+ if (result < 0 || buf_len < 1) {
+ return std::nullopt;
+ }
+
+ std::string value(buf_len - 1, '\0');
+- result = sysctl_func(&value[0], &buf_len);
++ result = sysctl_func2(&value[0], &buf_len);
+ if (result < 0) {
+ return std::nullopt;
+ }
diff --git a/chromium-next/patches/patch-base_posix_unix__domain__socket.cc b/chromium-next/patches/patch-base_posix_unix__domain__socket.cc
new file mode 100644
index 0000000000..13119cdc43
--- /dev/null
+++ b/chromium-next/patches/patch-base_posix_unix__domain__socket.cc
@@ -0,0 +1,63 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/posix/unix_domain_socket.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/posix/unix_domain_socket.cc
+@@ -56,7 +56,7 @@ bool CreateSocketPair(ScopedFD* one, Sco
+
+ // static
+ bool UnixDomainSocket::EnableReceiveProcessId(int fd) {
+-#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
+@@ -82,7 +82,7 @@ bool UnixDomainSocket::SendMsg(int fd,
+
+ struct cmsghdr* cmsg;
+ msg.msg_control = control_buffer;
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ msg.msg_controllen = checked_cast<socklen_t>(control_len);
+ #else
+ msg.msg_controllen = control_len;
+@@ -90,7 +90,7 @@ bool UnixDomainSocket::SendMsg(int fd,
+ cmsg = CMSG_FIRSTHDR(&msg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ cmsg->cmsg_len = checked_cast<u_int>(CMSG_LEN(sizeof(int) * fds.size()));
+ #else
+ cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fds.size());
+@@ -154,7 +154,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFla
+
+ const size_t kControlBufferSize =
+ CMSG_SPACE(sizeof(int) * kMaxFileDescriptors)
+-#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))
+@@ -182,7 +182,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFla
+ wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
+ wire_fds_len = payload_len / sizeof(int);
+ }
+-#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) {
+@@ -216,6 +216,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFla
+ socklen_t pid_size = sizeof(pid);
+ if (getsockopt(fd, SOL_LOCAL, LOCAL_PEERPID, &pid, &pid_size) != 0)
+ pid = -1;
++#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/chromium-next/patches/patch-base_posix_unix__domain__socket__unittest.cc b/chromium-next/patches/patch-base_posix_unix__domain__socket__unittest.cc
new file mode 100644
index 0000000000..6434d6f8c5
--- /dev/null
+++ b/chromium-next/patches/patch-base_posix_unix__domain__socket__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/posix/unix_domain_socket_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/posix/unix_domain_socket_unittest.cc
+@@ -15,6 +15,8 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+
++#include <signal.h>
++
+ #include "base/files/file_util.h"
+ #include "base/files/scoped_file.h"
+ #include "base/functional/bind.h"
diff --git a/chromium-next/patches/patch-base_process_internal__linux.h b/chromium-next/patches/patch-base_process_internal__linux.h
new file mode 100644
index 0000000000..637222ac31
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_internal__linux.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/internal_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/internal_linux.h
+@@ -140,6 +140,9 @@ TimeDelta ClockTicksToTimeDelta(int64_t
+ // arguments to the lambda.
+ template <typename Lambda>
+ void ForEachProcessTask(base::ProcessHandle process, Lambda&& lambda) {
++#if BUILDFLAG(IS_BSD)
++ return;
++#else
+ // Iterate through the different threads tracked in /proc/<pid>/task.
+ FilePath fd_path = GetProcPidDir(process).Append("task");
+
+@@ -159,6 +162,7 @@ void ForEachProcessTask(base::ProcessHan
+ FilePath task_path = fd_path.Append(tid_str);
+ lambda(tid, task_path);
+ }
++#endif
+ }
+
+ } // namespace internal
diff --git a/chromium-next/patches/patch-base_process_kill.h b/chromium-next/patches/patch-base_process_kill.h
new file mode 100644
index 0000000000..013e852576
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_kill.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/kill.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/kill.h
+@@ -123,7 +123,7 @@ BASE_EXPORT TerminationStatus GetTermina
+ BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus(
+ ProcessHandle handle, int* exit_code);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Spawns a thread to wait asynchronously for the child |process| to exit
+ // and then reaps it.
+ BASE_EXPORT void EnsureProcessGetsReaped(Process process);
diff --git a/chromium-next/patches/patch-base_process_kill__posix.cc b/chromium-next/patches/patch-base_process_kill__posix.cc
new file mode 100644
index 0000000000..3278018968
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_kill__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/kill_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/kill_posix.cc
+@@ -157,7 +157,7 @@ void EnsureProcessTerminated(Process pro
+ 0, new BackgroundReaper(std::move(process), Seconds(2)));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void EnsureProcessGetsReaped(Process process) {
+ DCHECK(!process.is_current());
+
diff --git a/chromium-next/patches/patch-base_process_launch.h b/chromium-next/patches/patch-base_process_launch.h
new file mode 100644
index 0000000000..5c2a4e18d6
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_launch.h
@@ -0,0 +1,31 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/launch.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/launch.h
+@@ -7,6 +7,13 @@
+ #ifndef BASE_PROCESS_LAUNCH_H_
+ #define BASE_PROCESS_LAUNCH_H_
+
++#if defined(__NetBSD__)
++#define _NETBSD_SOURCE 1
++#ifndef PTHREAD_STACK_MIN
++#define PTHREAD_STACK_MIN 4096
++#endif
++#endif
++
+ #include <limits.h>
+ #include <stddef.h>
+
+@@ -241,7 +248,7 @@ struct BASE_EXPORT LaunchOptions {
+ bool clear_environment = false;
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // If non-zero, start the process using clone(), using flags as provided.
+ // Unlike in clone, clone_flags may not contain a custom termination signal
+ // that is sent to the parent when the child dies. The termination signal will
diff --git a/chromium-next/patches/patch-base_process_launch__posix.cc b/chromium-next/patches/patch-base_process_launch__posix.cc
new file mode 100644
index 0000000000..8be37e6739
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_launch__posix.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/launch_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/launch_posix.cc
+@@ -67,6 +67,9 @@
+ #error "macOS should use launch_mac.cc"
+ #endif
+
++#if defined(OS_FREEBSD)
++#pragma weak environ
++#endif
+ extern char** environ;
+
+ namespace base {
+@@ -223,6 +226,8 @@ static const char kFDDir[] = "/dev/fd";
+ static const char kFDDir[] = "/dev/fd";
+ #elif BUILDFLAG(IS_OPENBSD)
+ static const char kFDDir[] = "/dev/fd";
++#elif BUILDFLAG(IS_NETBSD)
++static const char kFDDir[] = "/dev/fd";
+ #elif BUILDFLAG(IS_ANDROID)
+ static const char kFDDir[] = "/proc/self/fd";
+ #endif
diff --git a/chromium-next/patches/patch-base_process_memory__linux.cc b/chromium-next/patches/patch-base_process_memory__linux.cc
new file mode 100644
index 0000000000..b4c7e5038d
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_memory__linux.cc
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/memory_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/memory_linux.cc
+@@ -28,6 +28,7 @@ void __libc_free(void*);
+
+ namespace base {
+
++#if !BUILDFLAG(IS_BSD)
+ namespace {
+
+ void ReleaseReservationOrTerminate() {
+@@ -37,12 +38,14 @@ void ReleaseReservationOrTerminate() {
+ }
+
+ } // namespace
++#endif
+
+ void EnableTerminationOnHeapCorruption() {
+ // On Linux, there nothing to do AFAIK.
+ }
+
+ void EnableTerminationOnOutOfMemory() {
++#if !BUILDFLAG(IS_BSD)
+ // Set the new-out of memory handler.
+ std::set_new_handler(&ReleaseReservationOrTerminate);
+ // If we're using glibc's allocator, the above functions will override
+@@ -51,8 +54,10 @@ void EnableTerminationOnOutOfMemory() {
+ #if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
+ allocator_shim::SetCallNewHandlerOnMallocFailure(true);
+ #endif
++#endif
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ // ScopedAllowBlocking() has private constructor and it can only be used in
+ // friend classes/functions. Declaring a class is easier in this situation to
+ // avoid adding more dependency to thread_restrictions.h because of the
+@@ -110,6 +115,7 @@ bool AdjustOOMScoreHelper::AdjustOOMScor
+ bool AdjustOOMScore(ProcessId process, int score) {
+ return AdjustOOMScoreHelper::AdjustOOMScore(process, score);
+ }
++#endif
+
+ bool UncheckedMalloc(size_t size, void** result) {
+ #if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
diff --git a/chromium-next/patches/patch-base_process_process__handle.cc b/chromium-next/patches/patch-base_process_process__handle.cc
new file mode 100644
index 0000000000..b076debc83
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__handle.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_handle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_handle.cc
+@@ -30,7 +30,7 @@ UniqueProcId GetUniqueIdForProcess() {
+ : UniqueProcId(GetCurrentProcId());
+ }
+
+-#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/chromium-next/patches/patch-base_process_process__handle.h b/chromium-next/patches/patch-base_process_process__handle.h
new file mode 100644
index 0000000000..1a3389b376
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__handle.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_handle.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_handle.h
+@@ -86,7 +86,7 @@ BASE_EXPORT ProcessId GetCurrentProcId()
+ // processes may be reused.
+ BASE_EXPORT UniqueProcId GetUniqueIdForProcess();
+
+-#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/chromium-next/patches/patch-base_process_process__handle__freebsd.cc b/chromium-next/patches/patch-base_process_process__handle__freebsd.cc
new file mode 100644
index 0000000000..e7bd6d4099
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__handle__freebsd.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_handle_freebsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_handle_freebsd.cc
+@@ -3,6 +3,7 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_handle.h"
++#include "base/files/file_util.h"
+
+ #include <limits.h>
+ #include <stddef.h>
+@@ -20,12 +21,15 @@ namespace base {
+
+ ProcessId GetParentProcessId(ProcessHandle process) {
+ struct kinfo_proc info;
+- size_t length;
++ size_t length = sizeof(struct kinfo_proc);
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
+
+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+ return -1;
+
++ if (length < sizeof(struct kinfo_proc))
++ return -1;
++
+ return info.ki_ppid;
+ }
+
diff --git a/chromium-next/patches/patch-base_process_process__handle__netbsd.cc b/chromium-next/patches/patch-base_process_process__handle__netbsd.cc
new file mode 100644
index 0000000000..fdf3e2281c
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__handle__netbsd.cc
@@ -0,0 +1,64 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_handle_netbsd.cc.orig 2025-01-20 18:01:27.805255378 +0000
++++ base/process/process_handle_netbsd.cc
+@@ -0,0 +1,55 @@
++// Copyright 2011 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/process/process_handle.h"
++#include "base/files/file_util.h"
++
++#include <stddef.h>
++#include <sys/param.h>
++#include <sys/proc.h>
++#include <sys/sysctl.h>
++#include <sys/types.h>
++#include <unistd.h>
++
++#include <optional>
++
++#include "base/files/file_path.h"
++#include "base/posix/sysctl.h"
++
++namespace base {
++
++ProcessId GetParentProcessId(ProcessHandle process) {
++ struct kinfo_proc2 *info;
++ size_t length;
++ pid_t ppid;
++ int mib[] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, process,
++ sizeof(struct kinfo_proc2), 1 };
++
++ if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0)
++ return -1;
++
++ info = (struct kinfo_proc2 *)malloc(length);
++
++ mib[5] = static_cast<int>((length / sizeof(struct kinfo_proc2)));
++
++ if (sysctl(mib, std::size(mib), info, &length, NULL, 0) < 0) {
++ ppid = -1;
++ goto out;
++ }
++
++ ppid = info->p_ppid;
++
++out:
++ free(info);
++ return ppid;
++}
++
++FilePath GetProcessExecutablePath(ProcessHandle process) {
++ std::optional<std::string> pathname =
++ base::StringSysctl({CTL_KERN, KERN_PROC_ARGS, process, KERN_PROC_PATHNAME});
++
++ return FilePath(pathname.value_or(std::string{}));
++}
++
++} // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__handle__openbsd.cc b/chromium-next/patches/patch-base_process_process__handle__openbsd.cc
new file mode 100644
index 0000000000..1c8cc8d3fb
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__handle__openbsd.cc
@@ -0,0 +1,140 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_handle_openbsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_handle_openbsd.cc
+@@ -3,48 +3,112 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_handle.h"
++#include "base/files/file_util.h"
+
+ #include <stddef.h>
++#include <stdlib.h>
++#include <sys/param.h>
++#include <sys/proc.h>
++#include <sys/stat.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
++#include <kvm.h>
++
+ namespace base {
+
+ ProcessId GetParentProcessId(ProcessHandle process) {
+- struct kinfo_proc info;
++ struct kinfo_proc *info;
+ size_t length;
++ pid_t ppid;
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process,
+ sizeof(struct kinfo_proc), 0 };
+
+ if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0)
+ return -1;
+
+- mib[5] = (length / sizeof(struct kinfo_proc));
++ info = (struct kinfo_proc *)malloc(length);
+
+- if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+- return -1;
++ mib[5] = static_cast<int>((length / sizeof(struct kinfo_proc)));
++
++ if (sysctl(mib, std::size(mib), info, &length, NULL, 0) < 0) {
++ ppid = -1;
++ goto out;
++ }
++
++ ppid = info->p_ppid;
+
+- return info.p_ppid;
++out:
++ free(info);
++ return ppid;
+ }
+
+ FilePath GetProcessExecutablePath(ProcessHandle process) {
+- struct kinfo_proc kp;
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ char errbuf[_POSIX2_LINE_MAX];
++ char **retvalargs, *cpath, retval[PATH_MAX];
++ int cnt;
+ size_t len;
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process,
+- sizeof(struct kinfo_proc), 0 };
+-
+- if (sysctl(mib, std::size(mib), NULL, &len, NULL, 0) == -1)
+- return FilePath();
+- mib[5] = (len / sizeof(struct kinfo_proc));
+- if (sysctl(mib, std::size(mib), &kp, &len, NULL, 0) < 0)
+- return FilePath();
+- if ((kp.p_flag & P_SYSTEM) != 0)
+- return FilePath();
+- if (strcmp(kp.p_comm, "chrome") == 0)
+- return FilePath(kp.p_comm);
++ char *tokens[2];
++ struct stat sb;
++ FilePath result;
++
++ int mib[] = { CTL_KERN, KERN_PROC_ARGS, process, KERN_PROC_ARGV };
++
++ if ((cpath = getenv("CHROME_EXE_PATH")) != NULL)
++ result = FilePath(cpath);
++ else
++ result = FilePath("@PREFIX@/lib/chromium/chrome");
++
++ if (sysctl(mib, std::size(mib), NULL, &len, NULL, 0) != -1) {
++ retvalargs = static_cast<char**>(malloc(len));
++ if (!retvalargs)
++ return result;
++
++ if (sysctl(mib, std::size(mib), retvalargs, &len, NULL, 0) < 0) {
++ free(retvalargs);
++ return result;
++ }
++
++ if ((*tokens = strtok(retvalargs[0], ":")) == NULL) {
++ free(retvalargs);
++ return result;
++ }
++
++ free(retvalargs);
++
++ if (tokens[0] == NULL)
++ return result;
++
++ if (realpath(tokens[0], retval) == NULL)
++ return result;
++
++ if (stat(retval, &sb) < 0)
++ return result;
++
++ if ((kd = kvm_openfiles(NULL, NULL, NULL, (int)KVM_NO_FILES,
++ errbuf)) == NULL)
++ return result;
++
++ if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, process,
++ sizeof(struct kinfo_file), &cnt)) == NULL) {
++ kvm_close(kd);
++ return result;
++ }
++
++ for (int i = 0; i < cnt; i++) {
++ if (files[i].fd_fd == KERN_FILE_TEXT &&
++ files[i].va_fsid == static_cast<uint32_t>(sb.st_dev) &&
++ files[i].va_fileid == sb.st_ino) {
++ kvm_close(kd);
++ result = FilePath(retval);
++ }
++ }
++ }
+
+- return FilePath();
++ return result;
+ }
+
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__iterator.h b/chromium-next/patches/patch-base_process_process__iterator.h
new file mode 100644
index 0000000000..0d37a53362
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__iterator.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_iterator.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_iterator.h
+@@ -25,7 +25,7 @@
+ #include <windows.h>
+
+ #include <tlhelp32.h>
+-#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD)
++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
+ #include <sys/sysctl.h>
+ #elif BUILDFLAG(IS_FREEBSD)
+ #include <sys/user.h>
+@@ -117,7 +117,11 @@ class BASE_EXPORT ProcessIterator {
+ HANDLE snapshot_;
+ bool started_iteration_ = false;
+ #elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
++# if BUILDFLAG(IS_NETBSD)
++ std::vector<kinfo_proc2> kinfo_procs_;
++# else
+ std::vector<kinfo_proc> kinfo_procs_;
++# endif
+ size_t index_of_kinfo_proc_ = 0;
+ #elif BUILDFLAG(IS_POSIX)
+ struct DIRClose {
diff --git a/chromium-next/patches/patch-base_process_process__iterator__freebsd.cc b/chromium-next/patches/patch-base_process_process__iterator__freebsd.cc
new file mode 100644
index 0000000000..7c0c4c46ef
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__iterator__freebsd.cc
@@ -0,0 +1,57 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_iterator_freebsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_iterator_freebsd.cc
+@@ -18,7 +18,7 @@ namespace base {
+
+ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
+ : filter_(filter) {
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid() };
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, (int) getuid() };
+
+ bool done = false;
+ int try_num = 1;
+@@ -37,7 +37,7 @@ ProcessIterator::ProcessIterator(const P
+ num_of_kinfo_proc += 16;
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ len = num_of_kinfo_proc * sizeof(struct kinfo_proc);
+- if (sysctl(mib, std::size(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) {
++ if (sysctl(mib, std::size(mib), kinfo_procs_.data(), &len, NULL, 0) < 0) {
+ // If we get a mem error, it just means we need a bigger buffer, so
+ // loop around again. Anything else is a real error and give up.
+ if (errno != ENOMEM) {
+@@ -47,7 +47,7 @@ ProcessIterator::ProcessIterator(const P
+ }
+ } else {
+ // Got the list, just make sure we're sized exactly right
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ done = true;
+ }
+@@ -68,18 +68,13 @@ bool ProcessIterator::CheckForNextProces
+ for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) {
+ size_t length;
+ struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_];
+- int mib[] = { CTL_KERN, KERN_PROC_ARGS, kinfo.ki_pid };
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, kinfo.ki_pid };
+
+ if ((kinfo.ki_pid > 0) && (kinfo.ki_stat == SZOMB))
+ continue;
+
+- length = 0;
+- if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) {
+- LOG(ERROR) << "failed to figure out the buffer size for a command line";
+- continue;
+- }
+-
+- data.resize(length);
++ data.resize(ARG_MAX);
++ length = ARG_MAX;
+
+ if (sysctl(mib, std::size(mib), &data[0], &length, NULL, 0) < 0) {
+ LOG(ERROR) << "failed to fetch a commandline";
diff --git a/chromium-next/patches/patch-base_process_process__iterator__netbsd.cc b/chromium-next/patches/patch-base_process_process__iterator__netbsd.cc
new file mode 100644
index 0000000000..4efda95d14
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__iterator__netbsd.cc
@@ -0,0 +1,141 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_iterator_netbsd.cc.orig 2025-01-20 18:01:27.805654462 +0000
++++ base/process/process_iterator_netbsd.cc
+@@ -0,0 +1,132 @@
++// Copyright 2013 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/process/process_iterator.h"
++
++#include <errno.h>
++#include <stddef.h>
++#include <unistd.h>
++#include <sys/param.h>
++#include <sys/proc.h>
++#include <sys/sysctl.h>
++
++#include "base/logging.h"
++#include "base/strings/string_split.h"
++#include "base/strings/string_util.h"
++
++namespace base {
++
++ProcessIterator::ProcessIterator(const ProcessFilter* filter)
++ : filter_(filter) {
++ int mib[] = { CTL_KERN, KERN_PROC2, KERN_PROC_UID, static_cast<int>(getuid()),
++ sizeof(struct kinfo_proc2), 1 };
++
++ bool done = false;
++ int try_num = 1;
++ const int max_tries = 10;
++ size_t num_of_kinfo_proc;
++
++ do {
++ size_t len = 0;
++ if (sysctl(mib, std::size(mib), NULL, &len, NULL, 0) < 0) {
++ DLOG(ERROR) << "failed to get the size needed for the process list";
++ kinfo_procs_.resize(0);
++ done = true;
++ } else {
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc2);
++ // Leave some spare room for process table growth (more could show up
++ // between when we check and now)
++ num_of_kinfo_proc += 16;
++ kinfo_procs_.resize(num_of_kinfo_proc);
++ len = num_of_kinfo_proc * sizeof(struct kinfo_proc2);
++ if (sysctl(mib, std::size(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) {
++ // If we get a mem error, it just means we need a bigger buffer, so
++ // loop around again. Anything else is a real error and give up.
++ if (errno != ENOMEM) {
++ DLOG(ERROR) << "failed to get the process list";
++ kinfo_procs_.resize(0);
++ done = true;
++ }
++ } else {
++ // Got the list, just make sure we're sized exactly right
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc2);
++ kinfo_procs_.resize(num_of_kinfo_proc);
++ done = true;
++ }
++ }
++ } while (!done && (try_num++ < max_tries));
++
++ if (!done) {
++ DLOG(ERROR) << "failed to collect the process list in a few tries";
++ kinfo_procs_.resize(0);
++ }
++}
++
++ProcessIterator::~ProcessIterator() = default;
++
++bool ProcessIterator::CheckForNextProcess() {
++ std::string data;
++ for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) {
++ kinfo_proc2& kinfo = kinfo_procs_[index_of_kinfo_proc_];
++
++ // Skip processes just awaiting collection
++ if ((kinfo.p_pid > 0) && (kinfo.p_stat == SZOMB))
++ continue;
++
++ int mib[] = { CTL_KERN, KERN_PROC_ARGS, kinfo.p_pid };
++
++ // Find out what size buffer we need.
++ size_t data_len = 0;
++ if (sysctl(mib, std::size(mib), NULL, &data_len, NULL, 0) < 0) {
++ DVPLOG(1) << "failed to figure out the buffer size for a commandline";
++ continue;
++ }
++
++ data.resize(data_len);
++ if (sysctl(mib, std::size(mib), &data[0], &data_len, NULL, 0) < 0) {
++ DVPLOG(1) << "failed to fetch a commandline";
++ continue;
++ }
++
++ // |data| contains all the command line parameters of the process, separated
++ // by blocks of one or more null characters. We tokenize |data| into a
++ // vector of strings using '\0' as a delimiter and populate
++ // |entry_.cmd_line_args_|.
++ std::string delimiters;
++ delimiters.push_back('\0');
++ entry_.cmd_line_args_ = SplitString(data, delimiters, KEEP_WHITESPACE,
++ SPLIT_WANT_NONEMPTY);
++
++ // |data| starts with the full executable path followed by a null character.
++ // We search for the first instance of '\0' and extract everything before it
++ // to populate |entry_.exe_file_|.
++ size_t exec_name_end = data.find('\0');
++ if (exec_name_end == std::string::npos) {
++ DLOG(ERROR) << "command line data didn't match expected format";
++ continue;
++ }
++
++ entry_.pid_ = kinfo.p_pid;
++ entry_.ppid_ = kinfo.p_ppid;
++ entry_.gid_ = kinfo.p__pgid;
++ size_t last_slash = data.rfind('/', exec_name_end);
++ if (last_slash == std::string::npos)
++ entry_.exe_file_.assign(data, 0, exec_name_end);
++ else
++ entry_.exe_file_.assign(data, last_slash + 1,
++ exec_name_end - last_slash - 1);
++ // Start w/ the next entry next time through
++ ++index_of_kinfo_proc_;
++ // Done
++ return true;
++ }
++ return false;
++}
++
++bool NamedProcessIterator::IncludeEntry() {
++ return (executable_name_ == entry().exe_file() &&
++ ProcessIterator::IncludeEntry());
++}
++
++} // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__iterator__openbsd.cc b/chromium-next/patches/patch-base_process_process__iterator__openbsd.cc
new file mode 100644
index 0000000000..9caecc5fb8
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__iterator__openbsd.cc
@@ -0,0 +1,51 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_iterator_openbsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_iterator_openbsd.cc
+@@ -6,6 +6,9 @@
+
+ #include <errno.h>
+ #include <stddef.h>
++#include <unistd.h>
++#include <sys/param.h>
++#include <sys/proc.h>
+ #include <sys/sysctl.h>
+
+ #include "base/logging.h"
+@@ -16,12 +19,13 @@ namespace base {
+
+ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
+ : filter_(filter) {
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid(),
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, static_cast<int>(getuid()),
+ sizeof(struct kinfo_proc), 0 };
+
+ bool done = false;
+ int try_num = 1;
+ const int max_tries = 10;
++ size_t num_of_kinfo_proc;
+
+ do {
+ size_t len = 0;
+@@ -30,7 +34,7 @@ ProcessIterator::ProcessIterator(const P
+ kinfo_procs_.resize(0);
+ done = true;
+ } else {
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ // Leave some spare room for process table growth (more could show up
+ // between when we check and now)
+ num_of_kinfo_proc += 16;
+@@ -46,7 +50,7 @@ ProcessIterator::ProcessIterator(const P
+ }
+ } else {
+ // Got the list, just make sure we're sized exactly right
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ done = true;
+ }
diff --git a/chromium-next/patches/patch-base_process_process__metrics.cc b/chromium-next/patches/patch-base_process_process__metrics.cc
new file mode 100644
index 0000000000..46fde9d669
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics.cc
@@ -0,0 +1,55 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_metrics.cc
+@@ -17,7 +17,7 @@ namespace base {
+ namespace {
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int CalculateEventsPerSecond(uint64_t event_count,
+ uint64_t* last_event_count,
+ base::TimeTicks* last_calculated) {
+@@ -54,7 +54,7 @@ SystemMetrics SystemMetrics::Sample() {
+ SystemMetrics system_metrics;
+
+ system_metrics.committed_memory_ = GetSystemCommitCharge();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ GetSystemMemoryInfo(&system_metrics.memory_info_);
+ GetVmStatInfo(&system_metrics.vmstat_info_);
+ GetSystemDiskInfo(&system_metrics.disk_info_);
+@@ -73,7 +73,7 @@ Value::Dict SystemMetrics::ToDict() cons
+ Value::Dict res;
+
+ res.Set("committed_memory", static_cast<int>(committed_memory_));
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ Value::Dict meminfo = memory_info_.ToDict();
+ meminfo.Merge(vmstat_info_.ToDict());
+ res.Set("meminfo", std::move(meminfo));
+@@ -100,7 +100,6 @@ std::unique_ptr<ProcessMetrics> ProcessM
+ #endif // !BUILDFLAG(IS_MAC)
+ }
+
+-#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX)
+ double ProcessMetrics::GetPlatformIndependentCPUUsage(
+ TimeDelta cumulative_cpu) {
+ TimeTicks time = TimeTicks::Now();
+@@ -129,10 +128,9 @@ ProcessMetrics::GetPlatformIndependentCP
+ return GetPlatformIndependentCPUUsage(cpu_usage);
+ });
+ }
+-#endif
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int ProcessMetrics::CalculateIdleWakeupsPerSecond(
+ uint64_t absolute_idle_wakeups) {
+ return CalculateEventsPerSecond(absolute_idle_wakeups,
diff --git a/chromium-next/patches/patch-base_process_process__metrics.h b/chromium-next/patches/patch-base_process_process__metrics.h
new file mode 100644
index 0000000000..5710de5483
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics.h
@@ -0,0 +1,121 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_metrics.h
+@@ -38,7 +38,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ #include <string>
+ #include <utility>
+ #include <vector>
+@@ -48,7 +48,7 @@
+
+ namespace base {
+
+-#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.
+ //
+@@ -113,7 +113,7 @@ class BASE_EXPORT ProcessMetrics {
+ // convenience wrapper for CreateProcessMetrics().
+ static std::unique_ptr<ProcessMetrics> CreateCurrentProcessMetrics();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Resident Set Size is a Linux/Android specific memory concept. Do not
+ // attempt to extend this to other platforms.
+ BASE_EXPORT size_t GetResidentSetSize() const;
+@@ -147,7 +147,7 @@ class BASE_EXPORT ProcessMetrics {
+ base::expected<TimeDelta, ProcessCPUUsageError> GetCumulativeCPUUsage();
+
+ #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
+@@ -192,7 +192,7 @@ class BASE_EXPORT ProcessMetrics {
+ int GetOpenFdSoftLimit() const;
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Bytes of swap as reported by /proc/[pid]/status.
+ uint64_t GetVmSwapBytes() const;
+
+@@ -213,7 +213,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif // !BUILDFLAG(IS_MAC)
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups);
+ #endif
+ #if BUILDFLAG(IS_APPLE)
+@@ -235,12 +235,10 @@ class BASE_EXPORT ProcessMetrics {
+ // Used to store the previous times and CPU usage counts so we can
+ // compute the CPU usage between calls.
+ TimeTicks last_cpu_time_;
+-#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX)
+ TimeDelta last_cumulative_cpu_;
+-#endif
+
+ #if BUILDFLAG(IS_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_;
+@@ -281,7 +279,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsig
+
+ #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.
+ //
+@@ -316,7 +314,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // This provides an estimate of available memory as described here:
+ // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
+ // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
+@@ -331,7 +329,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ int buffers = 0;
+ int cached = 0;
+ int active_anon = 0;
+@@ -368,7 +366,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(Sys
+ // BUILDFLAG(IS_FUCHSIA)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // Parse the data found in /proc/<pid>/stat and return the sum of the
+ // CPU-related ticks. Returns -1 on parse error.
+ // Exposed for testing.
+@@ -563,7 +561,7 @@ class BASE_EXPORT SystemMetrics {
+ FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics);
+
+ size_t committed_memory_;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ SystemMemoryInfoKB memory_info_;
+ VmStatInfo vmstat_info_;
+ SystemDiskInfo disk_info_;
diff --git a/chromium-next/patches/patch-base_process_process__metrics__freebsd.cc b/chromium-next/patches/patch-base_process_process__metrics__freebsd.cc
new file mode 100644
index 0000000000..05ef4fc4f5
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics__freebsd.cc
@@ -0,0 +1,308 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics_freebsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_metrics_freebsd.cc
+@@ -3,19 +3,37 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_metrics.h"
++#include "base/notreached.h"
+
+ #include <stddef.h>
++#include <sys/types.h>
+ #include <sys/sysctl.h>
+ #include <sys/user.h>
+ #include <unistd.h>
+
++#include <fcntl.h> /* O_RDONLY */
++#include <kvm.h>
++#include <libutil.h>
++
+ #include "base/memory/ptr_util.h"
++#include "base/values.h"
+
+ namespace base {
++namespace {
++int GetPageShift() {
++ int pagesize = getpagesize();
++ int pageshift = 0;
++
++ while (pagesize > 1) {
++ pageshift++;
++ pagesize >>= 1;
++ }
++
++ return pageshift;
++}
++}
+
+-ProcessMetrics::ProcessMetrics(ProcessHandle process)
+- : process_(process),
+- last_cpu_(0) {}
++ProcessMetrics::ProcessMetrics(ProcessHandle process) : process_(process) {}
+
+ // static
+ std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+@@ -23,21 +41,18 @@ std::unique_ptr<ProcessMetrics> ProcessM
+ return WrapUnique(new ProcessMetrics(process));
+ }
+
+-base::expected<double, ProcessCPUUsageError>
+-ProcessMetrics::GetPlatformIndependentCPUUsage() {
++base::expected<TimeDelta, ProcessCPUUsageError>
++ProcessMetrics::GetCumulativeCPUUsage() {
+ struct kinfo_proc info;
+- int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_};
+- size_t length = sizeof(info);
++ size_t length = sizeof(struct kinfo_proc);
++ struct timeval tv;
++
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ };
+
+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
+- return base::unexpected(ProcessCPUUsageError::kSystemError);
++ return base::ok(TimeDelta());
+
+- return base::ok(double{info.ki_pctcpu} / FSCALE * 100.0);
+-}
+-
+-base::expected<TimeDelta, ProcessCPUUsageError>
+-ProcessMetrics::GetCumulativeCPUUsage() {
+- NOTREACHED();
++ return base::ok(Microseconds(info.ki_runtime));
+ }
+
+ size_t GetSystemCommitCharge() {
+@@ -63,4 +78,228 @@ size_t GetSystemCommitCharge() {
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
+ }
+
++int64_t GetNumberOfThreads(ProcessHandle process) {
++ // Taken from FreeBSD top (usr.bin/top/machine.c)
++
++ kvm_t* kd = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open");
++ if (kd == NULL)
++ return 0;
++
++ struct kinfo_proc* pbase;
++ int nproc;
++ pbase = kvm_getprocs(kd, KERN_PROC_PID, process, &nproc);
++ if (pbase == NULL)
++ return 0;
++
++ if (kvm_close(kd) == -1)
++ return 0;
++
++ return nproc;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB *meminfo) {
++ unsigned int mem_total, mem_free, swap_total, swap_used;
++ size_t length;
++ int pagesizeKB;
++
++ pagesizeKB = getpagesize() / 1024;
++
++ length = sizeof(mem_total);
++ if (sysctlbyname("vm.stats.vm.v_page_count", &mem_total,
++ &length, NULL, 0) != 0 || length != sizeof(mem_total))
++ return false;
++
++ length = sizeof(mem_free);
++ if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &length, NULL, 0)
++ != 0 || length != sizeof(mem_free))
++ return false;
++
++ length = sizeof(swap_total);
++ if (sysctlbyname("vm.swap_size", &swap_total, &length, NULL, 0)
++ != 0 || length != sizeof(swap_total))
++ return false;
++
++ length = sizeof(swap_used);
++ if (sysctlbyname("vm.swap_anon_use", &swap_used, &length, NULL, 0)
++ != 0 || length != sizeof(swap_used))
++ return false;
++
++ meminfo->total = mem_total * pagesizeKB;
++ meminfo->free = mem_free * pagesizeKB;
++ meminfo->swap_total = swap_total * pagesizeKB;
++ meminfo->swap_free = (swap_total - swap_used) * pagesizeKB;
++
++ return true;
++}
++
++int ProcessMetrics::GetOpenFdCount() const {
++ struct kinfo_file * kif;
++ int cnt;
++
++ if ((kif = kinfo_getfile(process_, &cnt)) == NULL)
++ return -1;
++
++ free(kif);
++
++ return cnt;
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ size_t length;
++ int total_count = 0;
++ int mib[] = { CTL_KERN, KERN_MAXFILESPERPROC };
++
++ length = sizeof(total_count);
++
++ if (sysctl(mib, std::size(mib), &total_count, &length, NULL, 0) < 0) {
++ total_count = -1;
++ }
++
++ return total_count;
++}
++
++size_t ProcessMetrics::GetResidentSetSize() const {
++ kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open");
++
++ if (kd == nullptr)
++ return 0;
++
++ struct kinfo_proc *pp;
++ int nproc;
++
++ if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) {
++ kvm_close(kd);
++ return 0;
++ }
++
++ size_t rss;
++
++ if (nproc > 0) {
++ rss = pp->ki_rssize << GetPageShift();
++ } else {
++ rss = 0;
++ }
++
++ kvm_close(kd);
++ return rss;
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open");
++
++ if (kd == nullptr)
++ return 0;
++
++ struct kinfo_proc *pp;
++ int nproc;
++
++ if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) {
++ kvm_close(kd);
++ return 0;
++ }
++
++ size_t swrss;
++
++ if (nproc > 0) {
++ swrss = pp->ki_swrss > pp->ki_rssize
++ ? (pp->ki_swrss - pp->ki_rssize) << GetPageShift()
++ : 0;
++ } else {
++ swrss = 0;
++ }
++
++ kvm_close(kd);
++ return swrss;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default;
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value::Dict SystemDiskInfo::ToDict() const {
++ Value::Dict res;
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.Set("reads", static_cast<double>(reads));
++ res.Set("reads_merged", static_cast<double>(reads_merged));
++ res.Set("sectors_read", static_cast<double>(sectors_read));
++ res.Set("read_time", static_cast<double>(read_time));
++ res.Set("writes", static_cast<double>(writes));
++ res.Set("writes_merged", static_cast<double>(writes_merged));
++ res.Set("sectors_written", static_cast<double>(sectors_written));
++ res.Set("write_time", static_cast<double>(write_time));
++ res.Set("io", static_cast<double>(io));
++ res.Set("io_time", static_cast<double>(io_time));
++ res.Set("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++Value::Dict SystemMemoryInfoKB::ToDict() const {
++ Value::Dict res;
++ res.Set("total", total);
++ res.Set("free", free);
++ res.Set("available", available);
++ res.Set("buffers", buffers);
++ res.Set("cached", cached);
++ res.Set("active_anon", active_anon);
++ res.Set("inactive_anon", inactive_anon);
++ res.Set("active_file", active_file);
++ res.Set("inactive_file", inactive_file);
++ res.Set("swap_total", swap_total);
++ res.Set("swap_free", swap_free);
++ res.Set("swap_used", swap_total - swap_free);
++ res.Set("dirty", dirty);
++ res.Set("reclaimable", reclaimable);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++Value::Dict VmStatInfo::ToDict() const {
++ Value::Dict res;
++ // TODO(crbug.com/1334256): Make base::Value able to hold uint64_t and remove
++ // casts below.
++ res.Set("pswpin", static_cast<int>(pswpin));
++ res.Set("pswpout", static_cast<int>(pswpout));
++ res.Set("pgmajfault", static_cast<int>(pgmajfault));
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__metrics__netbsd.cc b/chromium-next/patches/patch-base_process_process__metrics__netbsd.cc
new file mode 100644
index 0000000000..0079e0fd6b
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics__netbsd.cc
@@ -0,0 +1,184 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics_netbsd.cc.orig 2025-01-20 18:01:27.806256098 +0000
++++ base/process/process_metrics_netbsd.cc
+@@ -0,0 +1,175 @@
++// Copyright 2013 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/process/process_metrics.h"
++
++#include <stddef.h>
++#include <stdint.h>
++#include <fcntl.h>
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <sys/vmmeter.h>
++
++#include "base/memory/ptr_util.h"
++#include "base/types/expected.h"
++#include "base/values.h"
++#include "base/notreached.h"
++
++namespace base {
++
++ProcessMetrics::ProcessMetrics(ProcessHandle process) : process_(process) {}
++
++base::expected<TimeDelta, ProcessCPUUsageError>
++ProcessMetrics::GetCumulativeCPUUsage() {
++ struct kinfo_proc2 info;
++ size_t length = sizeof(struct kinfo_proc2);
++ struct timeval tv;
++
++ int mib[] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, process_,
++ sizeof(struct kinfo_proc2), 1 };
++
++ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) {
++ return base::unexpected(ProcessCPUUsageError::kSystemError);
++ }
++
++ tv.tv_sec = info.p_rtime_sec;
++ tv.tv_usec = info.p_rtime_usec;
++
++ return base::ok(Microseconds(TimeValToMicroseconds(tv)));
++}
++
++// static
++std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
++ ProcessHandle process) {
++ return WrapUnique(new ProcessMetrics(process));
++}
++
++size_t GetSystemCommitCharge() {
++ int mib[] = { CTL_VM, VM_METER };
++ size_t pagesize;
++ struct vmtotal vmtotal;
++ unsigned long mem_total, mem_free, mem_inactive;
++ size_t len = sizeof(vmtotal);
++
++ if (sysctl(mib, std::size(mib), &vmtotal, &len, NULL, 0) < 0) {
++ return 0;
++ }
++
++ mem_total = vmtotal.t_vm;
++ mem_free = vmtotal.t_free;
++ mem_inactive = vmtotal.t_vm - vmtotal.t_avm;
++
++ pagesize = checked_cast<size_t>(getpagesize());
++
++ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
++}
++
++int ProcessMetrics::GetOpenFdCount() const {
++ return -1;
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ return getdtablesize();
++// return GetMaxFds();
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
++ NOTIMPLEMENTED_LOG_ONCE();
++ return false;
++}
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++Value::Dict SystemMemoryInfoKB::ToDict() const {
++ Value::Dict res;
++ res.Set("total", total);
++ res.Set("free", free);
++ res.Set("available", available);
++ res.Set("buffers", buffers);
++ res.Set("cached", cached);
++ res.Set("active_anon", active_anon);
++ res.Set("inactive_anon", inactive_anon);
++ res.Set("active_file", active_file);
++ res.Set("inactive_file", inactive_file);
++ res.Set("swap_total", swap_total);
++ res.Set("swap_free", swap_free);
++ res.Set("swap_used", swap_total - swap_free);
++ res.Set("dirty", dirty);
++ res.Set("reclaimable", reclaimable);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++Value::Dict VmStatInfo::ToDict() const {
++ Value::Dict res;
++ res.Set("pswpin", static_cast<int>(pswpin));
++ res.Set("pswpout", static_cast<int>(pswpout));
++ res.Set("pgmajfault", static_cast<int>(pgmajfault));
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo&) = default;
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value::Dict SystemDiskInfo::ToDict() const {
++ Value::Dict res;
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.Set("reads", static_cast<double>(reads));
++ res.Set("reads_merged", static_cast<double>(reads_merged));
++ res.Set("sectors_read", static_cast<double>(sectors_read));
++ res.Set("read_time", static_cast<double>(read_time));
++ res.Set("writes", static_cast<double>(writes));
++ res.Set("writes_merged", static_cast<double>(writes_merged));
++ res.Set("sectors_written", static_cast<double>(sectors_written));
++ res.Set("write_time", static_cast<double>(write_time));
++ res.Set("io", static_cast<double>(io));
++ res.Set("io_time", static_cast<double>(io_time));
++ res.Set("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++} // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__metrics__openbsd.cc b/chromium-next/patches/patch-base_process_process__metrics__openbsd.cc
new file mode 100644
index 0000000000..6ade73ffd8
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics__openbsd.cc
@@ -0,0 +1,239 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics_openbsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_metrics_openbsd.cc
+@@ -6,36 +6,40 @@
+
+ #include <stddef.h>
+ #include <stdint.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
++#include <sys/vmmeter.h>
++
++#include <kvm.h>
+
+ #include "base/memory/ptr_util.h"
+ #include "base/types/expected.h"
++#include "base/values.h"
++#include "base/notreached.h"
+
+ namespace base {
+
+-namespace {
++ProcessMetrics::ProcessMetrics(ProcessHandle process) : process_(process) {}
+
+-base::expected<int, ProcessCPUUsageError> GetProcessCPU(pid_t pid) {
++base::expected<TimeDelta, ProcessCPUUsageError>
++ProcessMetrics::GetCumulativeCPUUsage() {
+ struct kinfo_proc info;
+- size_t length;
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
+- sizeof(struct kinfo_proc), 0 };
+-
+- if (sysctl(mib, std::size(mib), NULL, &length, NULL, 0) < 0) {
+- return base::unexpected(ProcessCPUUsageError::kSystemError);
+- }
++ size_t length = sizeof(struct kinfo_proc);
++ struct timeval tv;
+
+- mib[5] = (length / sizeof(struct kinfo_proc));
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_,
++ sizeof(struct kinfo_proc), 1 };
+
+ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) {
+ return base::unexpected(ProcessCPUUsageError::kSystemError);
+ }
+
+- return base::ok(info.p_pctcpu);
+-}
++ tv.tv_sec = info.p_rtime_sec;
++ tv.tv_usec = info.p_rtime_usec;
+
+-} // namespace
++ return base::ok(Microseconds(TimeValToMicroseconds(tv)));
++}
+
+ // static
+ std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+@@ -43,37 +47,9 @@ std::unique_ptr<ProcessMetrics> ProcessM
+ return WrapUnique(new ProcessMetrics(process));
+ }
+
+-base::expected<double, ProcessCPUUsageError>
+-ProcessMetrics::GetPlatformIndependentCPUUsage() {
+- TimeTicks time = TimeTicks::Now();
+-
+- if (last_cpu_time_.is_zero()) {
+- // First call, just set the last values.
+- last_cpu_time_ = time;
+- return base::ok(0.0);
+- }
+-
+- const base::expected<int, ProcessCPUUsageError> cpu = GetProcessCPU(process_);
+- if (!cpu.has_value()) {
+- return base::unexpected(cpu.error());
+- }
+-
+- last_cpu_time_ = time;
+- return base::ok(double{cpu.value()} / FSCALE * 100.0);
+-}
+-
+-base::expected<TimeDelta, ProcessCPUUsageError>
+-ProcessMetrics::GetCumulativeCPUUsage() {
+- NOTREACHED();
+-}
+-
+-ProcessMetrics::ProcessMetrics(ProcessHandle process)
+- : process_(process),
+- last_cpu_(0) {}
+-
+ size_t GetSystemCommitCharge() {
+ int mib[] = { CTL_VM, VM_METER };
+- int pagesize;
++ size_t pagesize;
+ struct vmtotal vmtotal;
+ unsigned long mem_total, mem_free, mem_inactive;
+ size_t len = sizeof(vmtotal);
+@@ -85,9 +61,136 @@ size_t GetSystemCommitCharge() {
+ mem_free = vmtotal.t_free;
+ mem_inactive = vmtotal.t_vm - vmtotal.t_avm;
+
+- pagesize = getpagesize();
++ pagesize = checked_cast<size_t>(getpagesize());
+
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
+ }
+
++int ProcessMetrics::GetOpenFdCount() const {
++#if 0
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ int total_count = 0;
++ char errbuf[_POSIX2_LINE_MAX];
++
++ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL)
++ goto out;
++
++ if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, process_,
++ sizeof(struct kinfo_file), &total_count)) == NULL) {
++ total_count = 0;
++ goto out;
++ }
++
++ kvm_close(kd);
++
++out:
++ return total_count;
++#endif
++ return getdtablecount();
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ return getdtablesize();
++// return GetMaxFds();
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
++ NOTIMPLEMENTED_LOG_ONCE();
++ return false;
++}
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++Value::Dict SystemMemoryInfoKB::ToDict() const {
++ Value::Dict res;
++ res.Set("total", total);
++ res.Set("free", free);
++ res.Set("available", available);
++ res.Set("buffers", buffers);
++ res.Set("cached", cached);
++ res.Set("active_anon", active_anon);
++ res.Set("inactive_anon", inactive_anon);
++ res.Set("active_file", active_file);
++ res.Set("inactive_file", inactive_file);
++ res.Set("swap_total", swap_total);
++ res.Set("swap_free", swap_free);
++ res.Set("swap_used", swap_total - swap_free);
++ res.Set("dirty", dirty);
++ res.Set("reclaimable", reclaimable);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++Value::Dict VmStatInfo::ToDict() const {
++ Value::Dict res;
++ res.Set("pswpin", static_cast<int>(pswpin));
++ res.Set("pswpout", static_cast<int>(pswpout));
++ res.Set("pgmajfault", static_cast<int>(pgmajfault));
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo&) = default;
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value::Dict SystemDiskInfo::ToDict() const {
++ Value::Dict res;
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.Set("reads", static_cast<double>(reads));
++ res.Set("reads_merged", static_cast<double>(reads_merged));
++ res.Set("sectors_read", static_cast<double>(sectors_read));
++ res.Set("read_time", static_cast<double>(read_time));
++ res.Set("writes", static_cast<double>(writes));
++ res.Set("writes_merged", static_cast<double>(writes_merged));
++ res.Set("sectors_written", static_cast<double>(sectors_written));
++ res.Set("write_time", static_cast<double>(write_time));
++ res.Set("io", static_cast<double>(io));
++ res.Set("io_time", static_cast<double>(io_time));
++ res.Set("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__metrics__posix.cc b/chromium-next/patches/patch-base_process_process__metrics__posix.cc
new file mode 100644
index 0000000000..5a658e4f7e
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_metrics_posix.cc
+@@ -21,6 +21,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -134,7 +136,7 @@ size_t ProcessMetrics::GetMallocUsage()
+ return stats.size_in_use;
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ return GetMallocUsageMallinfo();
+-#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/chromium-next/patches/patch-base_process_process__metrics__unittest.cc b/chromium-next/patches/patch-base_process_process__metrics__unittest.cc
new file mode 100644
index 0000000000..0599f66556
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__metrics__unittest.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_metrics_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_metrics_unittest.cc
+@@ -62,7 +62,8 @@
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_APPLE)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_APPLE) || \
++ BUILDFLAG(IS_BSD)
+ #define ENABLE_CPU_TESTS 1
+ #else
+ #define ENABLE_CPU_TESTS 0
diff --git a/chromium-next/patches/patch-base_process_process__posix.cc b/chromium-next/patches/patch-base_process_process__posix.cc
new file mode 100644
index 0000000000..d6aa771503
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__posix.cc
@@ -0,0 +1,100 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_posix.cc
+@@ -23,10 +23,15 @@
+ #include "base/trace_event/base_tracing.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include <sys/event.h>
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
++
+ #if BUILDFLAG(CLANG_PROFILING)
+ #include "base/test/clang_profiling.h"
+ #endif
+@@ -99,7 +104,7 @@ bool WaitpidWithTimeout(base::ProcessHan
+ }
+ #endif
+
+-#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.
+@@ -376,7 +381,7 @@ bool Process::WaitForExitWithTimeoutImpl
+ 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
+@@ -413,7 +418,56 @@ void Process::Exited(int exit_code) cons
+
+ int Process::GetOSPriority() const {
+ DCHECK(IsValid());
++// avoid pledge(2) violation
++#if BUILDFLAG(IS_BSD)
++ return 0;
++#else
+ return getpriority(PRIO_PROCESS, static_cast<id_t>(process_));
++#endif
++}
++
++Time Process::CreationTime() const {
++// avoid ps pledge in the network process
++#if !BUILDFLAG(IS_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 !BUILDFLAG(IS_BSD)
++ if (sysctl(mib, std::size(mib), NULL, &info_size, NULL, 0) < 0)
++ goto out;
++
++ mib[5] = (info_size / sizeof(struct kinfo_proc));
++ if ((info = reinterpret_cast<kinfo_proc*>(malloc(info_size))) == NULL)
++ goto out;
++
++ if (sysctl(mib, std::size(mib), info, &info_size, NULL, 0) < 0)
++ goto out;
++
++ ct = Time::FromTimeT(info->p_ustart_sec);
++
++out:
++ if (info)
++ free(info);
++#endif
++ return ct;
++}
++
++#if BUILDFLAG(IS_BSD)
++Process::Priority Process::GetPriority() const {
++ return Priority::kUserBlocking;
+ }
+
++bool Process::SetPriority(Priority priority) {
++ return false;
++}
++
++bool Process::CanSetPriority() {
++ return false;
++}
++#endif
++
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_process_process__unittest.cc b/chromium-next/patches/patch-base_process_process__unittest.cc
new file mode 100644
index 0000000000..a8219f1f41
--- /dev/null
+++ b/chromium-next/patches/patch-base_process_process__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/process/process_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/process/process_unittest.cc
+@@ -203,7 +203,7 @@ TEST_F(ProcessTest, CreationTimeOtherPro
+ // 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/chromium-next/patches/patch-base_profiler_module__cache.cc b/chromium-next/patches/patch-base_profiler_module__cache.cc
new file mode 100644
index 0000000000..f6767ba3ed
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_module__cache.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/module_cache.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/module_cache.cc
+@@ -38,7 +38,7 @@ std::string TransformModuleIDToSymbolSer
+ // Android and Linux Chrome builds use the "breakpad" format to index their
+ // build id, so we transform the build id for these platforms. All other
+ // platforms keep their symbols indexed by the original build ID.
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Linux ELF module IDs are 160bit integers, which we need to mangle
+ // down to 128bit integers to match the id that Breakpad outputs.
+ // Example on version '66.0.3359.170' x64:
diff --git a/chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.cc b/chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.cc
new file mode 100644
index 0000000000..c4628bd103
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/sampling_profiler_thread_token.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/sampling_profiler_thread_token.cc
+@@ -6,7 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <pthread.h>
+
+ #include "base/profiler/stack_base_address_posix.h"
+@@ -18,7 +18,7 @@ SamplingProfilerThreadToken GetSamplingP
+ PlatformThreadId id = PlatformThread::CurrentId();
+ #if BUILDFLAG(IS_ANDROID)
+ return {id, pthread_self()};
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::optional<uintptr_t> maybe_stack_base =
+ GetThreadStackBaseAddress(id, pthread_self());
+ return {id, maybe_stack_base};
diff --git a/chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.h b/chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.h
new file mode 100644
index 0000000000..411d2ec497
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_sampling__profiler__thread__token.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/sampling_profiler_thread_token.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/sampling_profiler_thread_token.h
+@@ -13,7 +13,7 @@
+
+ #if BUILDFLAG(IS_ANDROID)
+ #include <pthread.h>
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <stdint.h>
+ #endif
+
+@@ -27,7 +27,7 @@ struct SamplingProfilerThreadToken {
+ PlatformThreadId id;
+ #if BUILDFLAG(IS_ANDROID)
+ pthread_t pthread_id;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Due to the sandbox, we can only retrieve the stack base address for the
+ // current thread. We must grab it during
+ // GetSamplingProfilerCurrentThreadToken() and not try to get it later.
diff --git a/chromium-next/patches/patch-base_profiler_stack__base__address__posix.cc b/chromium-next/patches/patch-base_profiler_stack__base__address__posix.cc
new file mode 100644
index 0000000000..82f915d321
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_stack__base__address__posix.cc
@@ -0,0 +1,69 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/stack_base_address_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/stack_base_address_posix.cc
+@@ -17,6 +17,14 @@
+ #include "base/files/scoped_file.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#if BUILDFLAG(IS_NETBSD)
++#include <pthread.h>
++#else
++#include <pthread_np.h>
++#endif
++#endif
++
+ #if BUILDFLAG(IS_CHROMEOS)
+ extern "C" void* __libc_stack_end;
+ #endif
+@@ -45,7 +53,21 @@ std::optional<uintptr_t> GetAndroidMainT
+
+ #if !BUILDFLAG(IS_LINUX)
+ uintptr_t GetThreadStackBaseAddressImpl(pthread_t pthread_id) {
++#if BUILDFLAG(IS_OPENBSD)
++ stack_t ss;
++ void *address;
++ size_t size;
++ if (pthread_stackseg_np(pthread_id, &ss) != 0)
++ return 0;
++ size = ss.ss_size;
++ address = (void*)((size_t) ss.ss_sp - ss.ss_size);
++#else
+ pthread_attr_t attr;
++#if BUILDFLAG(IS_FREEBSD)
++ int result;
++ pthread_attr_init(&attr);
++ pthread_attr_get_np(pthread_id, &attr);
++#else
+ // pthread_getattr_np will crash on ChromeOS & Linux if we are in the sandbox
+ // and pthread_id refers to a different thread, due to the use of
+ // sched_getaffinity().
+@@ -58,12 +80,14 @@ uintptr_t GetThreadStackBaseAddressImpl(
+ << logging::SystemErrorCodeToString(result);
+ // See crbug.com/617730 for limitations of this approach on Linux-like
+ // systems.
++#endif
+ void* address;
+ size_t size;
+ result = pthread_attr_getstack(&attr, &address, &size);
+ CHECK_EQ(result, 0) << "pthread_attr_getstack returned "
+ << logging::SystemErrorCodeToString(result);
+ pthread_attr_destroy(&attr);
++#endif
+ const uintptr_t base_address = reinterpret_cast<uintptr_t>(address) + size;
+ return base_address;
+ }
+@@ -80,7 +104,7 @@ std::optional<uintptr_t> GetThreadStackB
+ // trying to work around the problem.
+ return std::nullopt;
+ #else
+- const bool is_main_thread = id == GetCurrentProcId();
++ const bool is_main_thread = id == checked_cast<PlatformThreadId>(GetCurrentProcId());
+ if (is_main_thread) {
+ #if BUILDFLAG(IS_ANDROID)
+ // The implementation of pthread_getattr_np() in Bionic reads proc/self/maps
diff --git a/chromium-next/patches/patch-base_profiler_stack__sampling__profiler__test__util.cc b/chromium-next/patches/patch-base_profiler_stack__sampling__profiler__test__util.cc
new file mode 100644
index 0000000000..9b42a4e4e4
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_stack__sampling__profiler__test__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/stack_sampling_profiler_test_util.cc
+@@ -42,7 +42,7 @@
+ // Fortunately, it provides _alloca, which functions identically.
+ #include <malloc.h>
+ #define alloca _alloca
+-#else
++#elif !BUILDFLAG(IS_BSD)
+ #include <alloca.h>
+ #endif
+
diff --git a/chromium-next/patches/patch-base_profiler_stack__sampling__profiler__unittest.cc b/chromium-next/patches/patch-base_profiler_stack__sampling__profiler__unittest.cc
new file mode 100644
index 0000000000..9e31b09207
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_stack__sampling__profiler__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/stack_sampling_profiler_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/stack_sampling_profiler_unittest.cc
+@@ -45,7 +45,7 @@
+
+ #include <intrin.h>
+ #include <malloc.h>
+-#else
++#elif !BUILDFLAG(IS_BSD)
+ #include <alloca.h>
+ #endif
+
diff --git a/chromium-next/patches/patch-base_profiler_thread__delegate__posix.cc b/chromium-next/patches/patch-base_profiler_thread__delegate__posix.cc
new file mode 100644
index 0000000000..7644803c60
--- /dev/null
+++ b/chromium-next/patches/patch-base_profiler_thread__delegate__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/profiler/thread_delegate_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/profiler/thread_delegate_posix.cc
+@@ -19,7 +19,7 @@
+ #include "base/process/process_handle.h"
+ #include "build/build_config.h"
+
+-#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ #include "base/profiler/stack_base_address_posix.h"
+ #endif
+
+@@ -28,7 +28,7 @@ namespace base {
+ std::unique_ptr<ThreadDelegatePosix> ThreadDelegatePosix::Create(
+ SamplingProfilerThreadToken thread_token) {
+ std::optional<uintptr_t> base_address;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base_address = thread_token.stack_base_address;
+ #else
+ base_address =
diff --git a/chromium-next/patches/patch-base_rand__util.h b/chromium-next/patches/patch-base_rand__util.h
new file mode 100644
index 0000000000..5b1e6ae65c
--- /dev/null
+++ b/chromium-next/patches/patch-base_rand__util.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/rand_util.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/rand_util.h
+@@ -141,7 +141,7 @@ void RandomShuffle(Itr first, Itr last)
+ std::shuffle(first, last, RandomBitGenerator());
+ }
+
+-#if BUILDFLAG(IS_POSIX)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_BSD)
+ BASE_EXPORT int GetUrandomFD();
+ #endif
+
diff --git a/chromium-next/patches/patch-base_rand__util__posix.cc b/chromium-next/patches/patch-base_rand__util__posix.cc
new file mode 100644
index 0000000000..d40a534d68
--- /dev/null
+++ b/chromium-next/patches/patch-base_rand__util__posix.cc
@@ -0,0 +1,68 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/rand_util_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/rand_util_posix.cc
+@@ -28,7 +28,7 @@
+ #include "base/time/time.h"
+ #include "build/build_config.h"
+
+-#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 BUILDFLAG(IS_MAC)
+ // TODO(crbug.com/40641285): Waiting for this header to appear in the iOS SDK.
+@@ -44,6 +44,7 @@ namespace base {
+
+ namespace {
+
++#if !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(IS_AIX)
+ // AIX has no 64-bit support for O_CLOEXEC.
+ static constexpr int kOpenFlags = O_RDONLY;
+@@ -68,10 +69,11 @@ class URandomFd {
+ private:
+ const int fd_;
+ };
++#endif
+
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+ BUILDFLAG(IS_ANDROID)) && \
+- !BUILDFLAG(IS_NACL)
++ !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ // TODO(pasko): Unify reading kernel version numbers in:
+ // mojo/core/channel_linux.cc
+ // chrome/browser/android/seccomp_support_detector.cc
+@@ -152,6 +154,7 @@ bool UseBoringSSLForRandBytes() {
+ namespace {
+
+ void RandBytesInternal(span<uint8_t> output, bool avoid_allocation) {
++#if !BUILDFLAG(IS_BSD)
+ #if !BUILDFLAG(IS_NACL)
+ // The BoringSSL experiment takes priority over everything else.
+ if (!avoid_allocation && internal::UseBoringSSLForRandBytes()) {
+@@ -186,6 +189,9 @@ void RandBytesInternal(span<uint8_t> out
+ const int urandom_fd = GetUrandomFD();
+ const bool success = ReadFromFD(urandom_fd, as_writable_chars(output));
+ CHECK(success);
++#else
++ arc4random_buf(output.data(), output.size());
++#endif
+ }
+
+ } // namespace
+@@ -205,9 +211,11 @@ void RandBytes(span<uint8_t> output) {
+ RandBytesInternal(output, /*avoid_allocation=*/false);
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ int GetUrandomFD() {
+ static NoDestructor<URandomFd> urandom_fd;
+ return urandom_fd->fd();
+ }
++#endif
+
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_strings_safe__sprintf__unittest.cc b/chromium-next/patches/patch-base_strings_safe__sprintf__unittest.cc
new file mode 100644
index 0000000000..8a5ed5d9cb
--- /dev/null
+++ b/chromium-next/patches/patch-base_strings_safe__sprintf__unittest.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/strings/safe_sprintf_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/strings/safe_sprintf_unittest.cc
+@@ -740,6 +740,7 @@ TEST(SafeSPrintfTest, EmbeddedNul) {
+ #endif
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ TEST(SafeSPrintfTest, EmitNULL) {
+ char buf[40];
+ #if defined(__GNUC__)
+@@ -756,6 +757,7 @@ TEST(SafeSPrintfTest, EmitNULL) {
+ #pragma GCC diagnostic pop
+ #endif
+ }
++#endif
+
+ TEST(SafeSPrintfTest, PointerSize) {
+ // The internal data representation is a 64bit value, independent of the
diff --git a/chromium-next/patches/patch-base_synchronization_lock__impl.h b/chromium-next/patches/patch-base_synchronization_lock__impl.h
new file mode 100644
index 0000000000..3573517729
--- /dev/null
+++ b/chromium-next/patches/patch-base_synchronization_lock__impl.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/synchronization/lock_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/synchronization/lock_impl.h
+@@ -109,6 +109,10 @@ void LockImpl::Unlock() {
+ }
+
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FREEBSD)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
++#endif
+
+ #if DCHECK_IS_ON()
+ BASE_EXPORT void dcheck_trylock_result(int rv);
+@@ -129,6 +133,9 @@ void LockImpl::Unlock() {
+ dcheck_unlock_result(rv);
+ #endif
+ }
++#if BUILDFLAG(IS_FREEBSD)
++#pragma GCC diagnostic pop
++#endif
+ #endif
+
+ // This is an implementation used for AutoLock templated on the lock type.
diff --git a/chromium-next/patches/patch-base_syslog__logging.cc b/chromium-next/patches/patch-base_syslog__logging.cc
new file mode 100644
index 0000000000..d7ee8c8c26
--- /dev/null
+++ b/chromium-next/patches/patch-base_syslog__logging.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/syslog_logging.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/syslog_logging.cc
+@@ -17,7 +17,7 @@
+ #include "base/strings/string_util.h"
+ #include "base/win/scoped_handle.h"
+ #include "base/win/win_util.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // <syslog.h> defines LOG_INFO, LOG_WARNING macros that could conflict with
+ // base::LOG_INFO, base::LOG_WARNING.
+ #include <syslog.h>
+@@ -149,7 +149,7 @@ EventLogMessage::~EventLogMessage() {
+
+ if (user_sid != nullptr)
+ ::LocalFree(user_sid);
+-#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/chromium-next/patches/patch-base_system_sys__info.cc b/chromium-next/patches/patch-base_system_sys__info.cc
new file mode 100644
index 0000000000..7a58be16e6
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/system/sys_info.cc
+@@ -229,7 +229,7 @@ std::string SysInfo::SocManufacturer() {
+ #endif
+
+ void SysInfo::GetHardwareInfo(base::OnceCallback<void(HardwareInfo)> callback) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ constexpr base::TaskTraits kTraits = {base::MayBlock()};
+ #else
+ constexpr base::TaskTraits kTraits = {};
diff --git a/chromium-next/patches/patch-base_system_sys__info.h b/chromium-next/patches/patch-base_system_sys__info.h
new file mode 100644
index 0000000000..a6fdb5afbd
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/system/sys_info.h
+@@ -331,6 +331,8 @@ class BASE_EXPORT SysInfo {
+ static void ResetCpuSecurityMitigationsEnabledForTesting();
+ #endif
+
++ static uint64_t MaxSharedMemorySize();
++
+ private:
+ friend class test::ScopedAmountOfPhysicalMemoryOverride;
+ FRIEND_TEST_ALL_PREFIXES(SysInfoTest, AmountOfAvailablePhysicalMemory);
+@@ -343,7 +345,7 @@ class BASE_EXPORT SysInfo {
+ static HardwareInfo GetHardwareInfoSync();
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ static uint64_t AmountOfAvailablePhysicalMemory(
+ const SystemMemoryInfoKB& meminfo);
+ #endif
diff --git a/chromium-next/patches/patch-base_system_sys__info__freebsd.cc b/chromium-next/patches/patch-base_system_sys__info__freebsd.cc
new file mode 100644
index 0000000000..b8581e29b1
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info__freebsd.cc
@@ -0,0 +1,118 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info_freebsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/system/sys_info_freebsd.cc
+@@ -9,28 +9,103 @@
+ #include <sys/sysctl.h>
+
+ #include "base/notreached.h"
++#include "base/process/process_metrics.h"
++#include "base/strings/string_util.h"
+
+ namespace base {
+
+-int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+- int pages, page_size;
++int SysInfo::NumberOfProcessors() {
++ int mib[] = {CTL_HW, HW_NCPU};
++ int ncpu;
++ size_t size = sizeof(ncpu);
++ if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) {
++ NOTREACHED();
++ return 1;
++ }
++ return ncpu;
++}
++
++uint64_t SysInfo::AmountOfPhysicalMemoryImpl() {
++ int pages, page_size, r = 0;
+ size_t size = sizeof(pages);
+- sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
+- sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
+- if (pages == -1 || page_size == -1) {
++
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
++
++ if (r == -1) {
++ NOTREACHED();
++ }
++
++ return static_cast<uint64_t>(pages) * page_size;
++}
++
++uint64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
++ int page_size, r = 0;
++ unsigned int pgfree, pginact, pgcache;
++ size_t size = sizeof(page_size);
++ size_t szpg = sizeof(pgfree);
++
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_free_count", &pgfree, &szpg, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_inactive_count", &pginact, &szpg, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_cache_count", &pgcache, &szpg, NULL, 0);
++
++ if (r == -1) {
+ NOTREACHED();
++ return 0;
+ }
+- return static_cast<int64_t>(pages) * page_size;
++
++ return static_cast<uint64_t>((pgfree + pginact + pgcache) * page_size);
++}
++
++// static
++uint64_t SysInfo::AmountOfAvailablePhysicalMemory(const SystemMemoryInfoKB& info) {
++ uint64_t res_kb = info.available != 0
++ ? info.available - info.active_file
++ : info.free + info.reclaimable + info.inactive_file;
++ return res_kb * 1024;
++}
++
++// static
++std::string SysInfo::CPUModelName() {
++ int mib[] = { CTL_HW, HW_MODEL };
++ char name[256];
++ size_t size = std::size(name);
++
++ if (sysctl(mib, std::size(mib), &name, &size, NULL, 0) == 0) {
++ return name;
++ }
++
++ return std::string();
+ }
+
+ // static
+ uint64_t SysInfo::MaxSharedMemorySize() {
+ size_t limit;
+ size_t size = sizeof(limit);
++
+ if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ }
+ return static_cast<uint64_t>(limit);
+ }
+
++SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
++ HardwareInfo info;
++
++ info.manufacturer = "FreeBSD";
++ info.model = HardwareModelName();
++
++ DCHECK(IsStringUTF8(info.manufacturer));
++ DCHECK(IsStringUTF8(info.model));
++
++ return info;
++}
++
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_system_sys__info__netbsd.cc b/chromium-next/patches/patch-base_system_sys__info__netbsd.cc
new file mode 100644
index 0000000000..bdca7a5738
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info__netbsd.cc
@@ -0,0 +1,97 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info_netbsd.cc.orig 2025-01-20 18:01:27.808948085 +0000
++++ base/system/sys_info_netbsd.cc
+@@ -0,0 +1,88 @@
++// Copyright 2011 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/system/sys_info.h"
++
++#include <stddef.h>
++#include <stdint.h>
++#include <sys/param.h>
++#include <sys/shm.h>
++#include <sys/sysctl.h>
++
++#include "base/notreached.h"
++#include "base/posix/sysctl.h"
++#include "base/strings/string_util.h"
++
++namespace {
++
++uint64_t AmountOfMemory(int pages_name) {
++ long pages = sysconf(pages_name);
++ long page_size = sysconf(_SC_PAGESIZE);
++ if (pages < 0 || page_size < 0)
++ return 0;
++ return static_cast<uint64_t>(pages) * static_cast<uint64_t>(page_size);
++}
++
++} // namespace
++
++namespace base {
++
++// static
++int SysInfo::NumberOfProcessors() {
++ int mib[] = {CTL_HW, HW_NCPU};
++ int ncpu;
++ size_t size = sizeof(ncpu);
++ if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) {
++ NOTREACHED();
++ }
++ return ncpu;
++}
++
++// static
++uint64_t SysInfo::AmountOfPhysicalMemoryImpl() {
++ return AmountOfMemory(_SC_PHYS_PAGES);
++}
++
++// static
++uint64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
++ return AmountOfMemory(_SC_PHYS_PAGES);
++}
++
++// static
++uint64_t SysInfo::MaxSharedMemorySize() {
++ int mib[] = {CTL_KERN, KERN_SYSVIPC, KERN_SYSVIPC_SHMMAX};
++ size_t limit;
++ size_t size = sizeof(limit);
++ if (sysctl(mib, std::size(mib), &limit, &size, NULL, 0) < 0) {
++ NOTREACHED();
++ }
++ return static_cast<uint64_t>(limit);
++}
++
++// static
++std::string SysInfo::CPUModelName() {
++ int mib[] = { CTL_HW, HW_MODEL };
++ char name[256];
++ size_t size = std::size(name);
++
++ if (sysctl(mib, std::size(mib), &name, &size, NULL, 0) == 0) {
++ return name;
++ }
++
++ return std::string();
++}
++
++// static
++SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
++ HardwareInfo info;
++ // Set the manufacturer to "NetBSD" and the model to
++ // an empty string.
++ info.manufacturer = "NetBSD";
++ info.model = HardwareModelName();
++ DCHECK(IsStringUTF8(info.manufacturer));
++ DCHECK(IsStringUTF8(info.model));
++ return info;
++}
++
++} // namespace base
diff --git a/chromium-next/patches/patch-base_system_sys__info__openbsd.cc b/chromium-next/patches/patch-base_system_sys__info__openbsd.cc
new file mode 100644
index 0000000000..fca9eebb67
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info__openbsd.cc
@@ -0,0 +1,88 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info_openbsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/system/sys_info_openbsd.cc
+@@ -12,6 +12,7 @@
+
+ #include "base/notreached.h"
+ #include "base/posix/sysctl.h"
++#include "base/strings/string_util.h"
+
+ namespace {
+
+@@ -27,9 +28,14 @@ uint64_t AmountOfMemory(int pages_name)
+
+ namespace base {
+
++// pledge(2)
++uint64_t aofpmem = 0;
++uint64_t shmmax = 0;
++char cpumodel[256];
++
+ // static
+ int SysInfo::NumberOfProcessors() {
+- int mib[] = {CTL_HW, HW_NCPU};
++ int mib[] = {CTL_HW, HW_NCPUONLINE};
+ int ncpu;
+ size_t size = sizeof(ncpu);
+ if (sysctl(mib, std::size(mib), &ncpu, &size, NULL, 0) < 0) {
+@@ -40,7 +46,23 @@ int SysInfo::NumberOfProcessors() {
+
+ // static
+ uint64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+- return AmountOfMemory(_SC_PHYS_PAGES);
++ // pledge(2)
++ if (!aofpmem)
++ aofpmem = AmountOfMemory(_SC_PHYS_PAGES);
++ return aofpmem;
++}
++
++// static
++std::string SysInfo::CPUModelName() {
++ int mib[] = {CTL_HW, HW_MODEL};
++ size_t len = std::size(cpumodel);
++
++ if (cpumodel[0] == '\0') {
++ if (sysctl(mib, std::size(mib), cpumodel, &len, NULL, 0) < 0)
++ return std::string();
++ }
++
++ return std::string(cpumodel, len - 1);
+ }
+
+ // static
+@@ -55,15 +77,27 @@ uint64_t SysInfo::MaxSharedMemorySize()
+ int mib[] = {CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX};
+ size_t limit;
+ size_t size = sizeof(limit);
++ // pledge(2)
++ if (shmmax)
++ goto out;
+ if (sysctl(mib, std::size(mib), &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ }
+- return static_cast<uint64_t>(limit);
++ shmmax = static_cast<uint64_t>(limit);
++out:
++ return shmmax;
+ }
+
+ // static
+-std::string SysInfo::CPUModelName() {
+- return StringSysctl({CTL_HW, HW_MODEL}).value();
++SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
++ HardwareInfo info;
++ // Set the manufacturer to "OpenBSD" and the model to
++ // an empty string.
++ info.manufacturer = "OpenBSD";
++ info.model = HardwareModelName();
++ DCHECK(IsStringUTF8(info.manufacturer));
++ DCHECK(IsStringUTF8(info.model));
++ return info;
+ }
+
+ } // namespace base
diff --git a/chromium-next/patches/patch-base_system_sys__info__posix.cc b/chromium-next/patches/patch-base_system_sys__info__posix.cc
new file mode 100644
index 0000000000..4272e3ec96
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info__posix.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/system/sys_info_posix.cc
+@@ -117,7 +117,7 @@ bool GetDiskSpaceInfo(const base::FilePa
+
+ namespace base {
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ // static
+ int SysInfo::NumberOfProcessors() {
+ #if BUILDFLAG(IS_MAC)
+@@ -173,7 +173,7 @@ int SysInfo::NumberOfProcessors() {
+
+ return cached_num_cpus;
+ }
+-#endif // !BUILDFLAG(IS_OPENBSD)
++#endif // !BUILDFLAG(IS_BSD)
+
+ // static
+ uint64_t SysInfo::AmountOfVirtualMemory() {
+@@ -256,6 +256,8 @@ std::string SysInfo::OperatingSystemArch
+ arch = "x86";
+ } else if (arch == "amd64") {
+ arch = "x86_64";
++ } else if (arch == "arm64") {
++ arch = "aarch64";
+ } else if (std::string(info.sysname) == "AIX") {
+ arch = "ppc64";
+ }
diff --git a/chromium-next/patches/patch-base_system_sys__info__unittest.cc b/chromium-next/patches/patch-base_system_sys__info__unittest.cc
new file mode 100644
index 0000000000..4130b89134
--- /dev/null
+++ b/chromium-next/patches/patch-base_system_sys__info__unittest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/system/sys_info_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/system/sys_info_unittest.cc
+@@ -265,12 +265,16 @@ TEST_F(SysInfoTest, GetHardwareInfo) {
+ EXPECT_TRUE(IsStringUTF8(hardware_info->model));
+ bool empty_result_expected =
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \
++ 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/chromium-next/patches/patch-base_task_thread__pool_environment__config__unittest.cc b/chromium-next/patches/patch-base_task_thread__pool_environment__config__unittest.cc
new file mode 100644
index 0000000000..ba27f926f5
--- /dev/null
+++ b/chromium-next/patches/patch-base_task_thread__pool_environment__config__unittest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/task/thread_pool/environment_config_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/task/thread_pool/environment_config_unittest.cc
+@@ -15,7 +15,7 @@ TEST(ThreadPoolEnvironmentConfig, CanUse
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)
+ EXPECT_TRUE(CanUseBackgroundThreadTypeForWorkerThread());
+ #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(CanUseBackgroundThreadTypeForWorkerThread());
+ #else
+ #error Platform doesn't match any block
+@@ -24,7 +24,7 @@ TEST(ThreadPoolEnvironmentConfig, CanUse
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID)
+ EXPECT_TRUE(CanUseUtilityThreadTypeForWorkerThread());
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
+ EXPECT_FALSE(CanUseUtilityThreadTypeForWorkerThread());
+ #else
+ #error Platform doesn't match any block
diff --git a/chromium-next/patches/patch-base_test_launcher_test__launcher.cc b/chromium-next/patches/patch-base_test_launcher_test__launcher.cc
new file mode 100644
index 0000000000..ee91ba20cb
--- /dev/null
+++ b/chromium-next/patches/patch-base_test_launcher_test__launcher.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/test/launcher/test_launcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/test/launcher/test_launcher.cc
+@@ -75,6 +75,7 @@
+ #include "testing/gtest/include/gtest/gtest.h"
+
+ #if BUILDFLAG(IS_POSIX)
++#include <signal.h>
+ #include <fcntl.h>
+
+ #include "base/files/file_descriptor_watcher_posix.h"
+@@ -1810,6 +1811,10 @@ bool TestLauncher::Init(CommandLine* com
+ results_tracker_.AddGlobalTag("OS_OPENBSD");
+ #endif
+
++#if BUILDFLAG(IS_NETBSD)
++ results_tracker_.AddGlobalTag("OS_NETBSD");
++#endif
++
+ #if BUILDFLAG(IS_POSIX)
+ results_tracker_.AddGlobalTag("OS_POSIX");
+ #endif
diff --git a/chromium-next/patches/patch-base_test_test__file__util__linux.cc b/chromium-next/patches/patch-base_test_test__file__util__linux.cc
new file mode 100644
index 0000000000..12881ef640
--- /dev/null
+++ b/chromium-next/patches/patch-base_test_test__file__util__linux.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/test/test_file_util_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/test/test_file_util_linux.cc
+@@ -54,8 +54,10 @@ bool EvictFileFromSystemCache(const File
+ return false;
+ if (fdatasync(fd.get()) != 0)
+ return false;
++#if !BUILDFLAG(IS_BSD)
+ if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0)
+ return false;
++#endif
+ return true;
+ }
+
diff --git a/chromium-next/patches/patch-base_test_test__file__util__posix.cc b/chromium-next/patches/patch-base_test_test__file__util__posix.cc
new file mode 100644
index 0000000000..43ad6f0488
--- /dev/null
+++ b/chromium-next/patches/patch-base_test_test__file__util__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/test/test_file_util_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/test/test_file_util_posix.cc
+@@ -91,7 +91,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/chromium-next/patches/patch-base_threading_platform__thread.h b/chromium-next/patches/patch-base_threading_platform__thread.h
new file mode 100644
index 0000000000..489c63b7fa
--- /dev/null
+++ b/chromium-next/patches/patch-base_threading_platform__thread.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/threading/platform_thread.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/threading/platform_thread.h
+@@ -49,6 +49,8 @@ typedef DWORD PlatformThreadId;
+ typedef zx_koid_t PlatformThreadId;
+ #elif BUILDFLAG(IS_APPLE)
+ typedef mach_port_t PlatformThreadId;
++#elif BUILDFLAG(IS_BSD)
++typedef uint64_t PlatformThreadId;
+ #elif BUILDFLAG(IS_POSIX)
+ typedef pid_t PlatformThreadId;
+ #endif
diff --git a/chromium-next/patches/patch-base_threading_platform__thread__bsd.cc b/chromium-next/patches/patch-base_threading_platform__thread__bsd.cc
new file mode 100644
index 0000000000..323bffd7c5
--- /dev/null
+++ b/chromium-next/patches/patch-base_threading_platform__thread__bsd.cc
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/threading/platform_thread_bsd.cc.orig 2025-01-20 18:01:27.810208849 +0000
++++ base/threading/platform_thread_bsd.cc
+@@ -0,0 +1,31 @@
++// Copyright 2023 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++// Description: These are stubs for *BSD.
++
++#include "base/threading/platform_thread.h"
++
++namespace base {
++namespace internal {
++
++bool CanSetThreadTypeToRealtimeAudio() {
++ return false;
++}
++
++bool SetCurrentThreadTypeForPlatform(ThreadType thread_type,
++ MessagePumpType pump_type_hint) {
++ return false;
++}
++
++std::optional<ThreadPriorityForTest>
++GetCurrentThreadPriorityForPlatformForTest() {
++ return std::nullopt;
++}
++} // namespace internal
++
++// static
++void PlatformThreadBase::SetName(const std::string& name) {
++ SetNameCommon(name);
++}
++
++} // namespace base
diff --git a/chromium-next/patches/patch-base_threading_platform__thread__internal__posix.cc b/chromium-next/patches/patch-base_threading_platform__thread__internal__posix.cc
new file mode 100644
index 0000000000..2c589f5e98
--- /dev/null
+++ b/chromium-next/patches/patch-base_threading_platform__thread__internal__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/threading/platform_thread_internal_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/threading/platform_thread_internal_posix.cc
+@@ -41,7 +41,7 @@ ThreadPriorityForTest NiceValueToThreadP
+ }
+
+ int GetCurrentThreadNiceValue() {
+-#if BUILDFLAG(IS_NACL)
++#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
+ NOTIMPLEMENTED();
+ return 0;
+ #else
diff --git a/chromium-next/patches/patch-base_threading_platform__thread__posix.cc b/chromium-next/patches/patch-base_threading_platform__thread__posix.cc
new file mode 100644
index 0000000000..ab14aaf8ae
--- /dev/null
+++ b/chromium-next/patches/patch-base_threading_platform__thread__posix.cc
@@ -0,0 +1,59 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/threading/platform_thread_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/threading/platform_thread_posix.cc
+@@ -77,11 +77,11 @@ void* ThreadFunc(void* params) {
+ if (!thread_params->joinable)
+ base::DisallowSingleton();
+
+-#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
++#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !BUILDFLAG(IS_BSD)
+ partition_alloc::internal::StackTopRegistry::Get().NotifyThreadCreated();
+ #endif
+
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(IS_APPLE)
+ PlatformThread::SetCurrentThreadRealtimePeriodValue(
+ delegate->GetRealtimePeriod());
+@@ -265,6 +265,8 @@ PlatformThreadId PlatformThreadBase::Cur
+ return reinterpret_cast<int32_t>(pthread_self());
+ #elif BUILDFLAG(IS_POSIX) && BUILDFLAG(IS_AIX)
+ return pthread_self();
++#elif BUILDFLAG(IS_BSD)
++ return reinterpret_cast<uint64_t>(pthread_self());
+ #elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_AIX)
+ return reinterpret_cast<int64_t>(pthread_self());
+ #endif
+@@ -355,7 +357,7 @@ void PlatformThreadBase::Detach(Platform
+
+ // static
+ bool PlatformThreadBase::CanChangeThreadType(ThreadType from, ThreadType to) {
+-#if BUILDFLAG(IS_NACL)
++#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ if (from >= to) {
+@@ -376,6 +378,9 @@ void SetCurrentThreadTypeImpl(ThreadType
+ MessagePumpType pump_type_hint) {
+ #if BUILDFLAG(IS_NACL)
+ NOTIMPLEMENTED();
++// avoid pledge(2) violation
++#elif BUILDFLAG(IS_BSD)
++ NOTIMPLEMENTED();
+ #else
+ if (internal::SetCurrentThreadTypeForPlatform(thread_type, pump_type_hint))
+ return;
+@@ -398,7 +403,7 @@ void SetCurrentThreadTypeImpl(ThreadType
+
+ // static
+ ThreadPriorityForTest PlatformThreadBase::GetCurrentThreadPriorityForTest() {
+-#if BUILDFLAG(IS_NACL)
++#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
+ NOTIMPLEMENTED();
+ return ThreadPriorityForTest::kNormal;
+ #else
diff --git a/chromium-next/patches/patch-base_threading_platform__thread__unittest.cc b/chromium-next/patches/patch-base_threading_platform__thread__unittest.cc
new file mode 100644
index 0000000000..eb981e7919
--- /dev/null
+++ b/chromium-next/patches/patch-base_threading_platform__thread__unittest.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/threading/platform_thread_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/threading/platform_thread_unittest.cc
+@@ -38,7 +38,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 <pthread.h>
+ #include <sys/syscall.h>
+ #include <sys/types.h>
+@@ -362,7 +362,7 @@ TEST(PlatformThreadTest,
+ // and hardcodes what we know. Please inform scheduler-dev%chromium.org@localhost if this
+ // proprerty changes for a given platform.
+ TEST(PlatformThreadTest, CanChangeThreadType) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Ubuntu, RLIMIT_NICE and RLIMIT_RTPRIO are 0 by default, so we won't be
+ // able to increase priority to any level unless we are root (euid == 0).
+ bool kCanIncreasePriority = false;
+@@ -616,12 +616,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<int64_t>(pthread_self());
++#else
+ return PlatformThread::CurrentId() == syscall(__NR_gettid);
++#endif
+ }
+
+ void* CheckTidCacheCorrectWrapper(void*) {
diff --git a/chromium-next/patches/patch-base_time_time__now__posix.cc b/chromium-next/patches/patch-base_time_time__now__posix.cc
new file mode 100644
index 0000000000..e358935ae8
--- /dev/null
+++ b/chromium-next/patches/patch-base_time_time__now__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/time/time_now_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/time/time_now_posix.cc
+@@ -27,7 +27,7 @@
+ #endif
+
+ // NaCl doesn't support CLOCK_MONOTONIC_COARSE.
+-#if BUILDFLAG(IS_NACL)
++#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
+ #define TIMETICKS_LOW_RESOLUTION_CLOCK CLOCK_MONOTONIC
+ #else
+ #define TIMETICKS_LOW_RESOLUTION_CLOCK CLOCK_MONOTONIC_COARSE
diff --git a/chromium-next/patches/patch-base_trace__event_malloc__dump__provider.cc b/chromium-next/patches/patch-base_trace__event_malloc__dump__provider.cc
new file mode 100644
index 0000000000..9b0ffea4c0
--- /dev/null
+++ b/chromium-next/patches/patch-base_trace__event_malloc__dump__provider.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/trace_event/malloc_dump_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/trace_event/malloc_dump_provider.cc
+@@ -28,6 +28,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif BUILDFLAG(IS_BSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -178,7 +180,7 @@ void ReportAppleAllocStats(size_t* total
+
+ #if (PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_ANDROID)) || \
+ (!PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !BUILDFLAG(IS_WIN) && \
+- !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_FUCHSIA))
++ !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_BSD))
+ void ReportMallinfoStats(ProcessMemoryDump* pmd,
+ size_t* total_virtual_size,
+ size_t* resident_size,
+@@ -368,6 +370,9 @@ bool MallocDumpProvider::OnMemoryDump(co
+ &allocated_objects_count);
+ #elif BUILDFLAG(IS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
++#elif BUILDFLAG(IS_BSD)
++ total_virtual_size = 0;
++ allocated_objects_size = 0;
+ #else
+ ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size,
+ &allocated_objects_size, &allocated_objects_count);
diff --git a/chromium-next/patches/patch-base_trace__event_memory__dump__manager.cc b/chromium-next/patches/patch-base_trace__event_memory__dump__manager.cc
new file mode 100644
index 0000000000..b4cfd9e33a
--- /dev/null
+++ b/chromium-next/patches/patch-base_trace__event_memory__dump__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/trace_event/memory_dump_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/trace_event/memory_dump_manager.cc
+@@ -83,7 +83,7 @@ const char* const MemoryDumpManager::kSy
+ #if defined(MALLOC_MEMORY_TRACING_SUPPORTED)
+ MallocDumpProvider::kAllocatedObjects;
+ #else
+- nullptr;
++ "";
+ #endif
+
+ // static
diff --git a/chromium-next/patches/patch-base_trace__event_process__memory__dump.cc b/chromium-next/patches/patch-base_trace__event_process__memory__dump.cc
new file mode 100644
index 0000000000..f5836e9e82
--- /dev/null
+++ b/chromium-next/patches/patch-base_trace__event_process__memory__dump.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/trace_event/process_memory_dump.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/trace_event/process_memory_dump.cc
+@@ -120,7 +120,7 @@ std::optional<size_t> ProcessMemoryDump:
+ #if BUILDFLAG(IS_WIN)
+ auto vec =
+ base::HeapArray<PSAPI_WORKING_SET_EX_INFORMATION>::WithSize(max_vec_size);
+-#elif BUILDFLAG(IS_APPLE)
++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ auto vec = base::HeapArray<char>::WithSize(max_vec_size);
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+ auto vec = base::HeapArray<unsigned char>::WithSize(max_vec_size);
+@@ -143,7 +143,7 @@ std::optional<size_t> ProcessMemoryDump:
+
+ for (size_t i = 0; i < page_count; i++)
+ resident_page_count += vec[i].VirtualAttributes.Valid;
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/42050620): Implement counting resident bytes.
+ // For now, log and avoid unused variable warnings.
+ NOTIMPLEMENTED_LOG_ONCE();
diff --git a/chromium-next/patches/patch-base_tracing_trace__time.cc b/chromium-next/patches/patch-base_tracing_trace__time.cc
new file mode 100644
index 0000000000..f7d4391699
--- /dev/null
+++ b/chromium-next/patches/patch-base_tracing_trace__time.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/tracing/trace_time.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/tracing/trace_time.cc
+@@ -8,13 +8,19 @@
+ #include "build/build_config.h"
+ #include "third_party/perfetto/include/perfetto/base/time.h"
+
++#if BUILDFLAG(IS_FREEBSD)
++#define CLOCK_BOOTTIME CLOCK_UPTIME
++#elif BUILDFLAG(IS_NETBSD)
++#define CLOCK_BOOTTIME CLOCK_MONOTONIC
++#endif
++
+ namespace base {
+ namespace tracing {
+
+ int64_t TraceBootTicksNow() {
+ // On Windows and Mac, TRACE_TIME_TICKS_NOW() behaves like boottime already.
+ #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 +30,4 @@ int64_t TraceBootTicksNow() {
+ }
+
+ } // namespace tracing
+-} // namespace base
+\ No newline at end of file
++} // namespace base
diff --git a/chromium-next/patches/patch-base_tracing_trace__time.h b/chromium-next/patches/patch-base_tracing_trace__time.h
new file mode 100644
index 0000000000..c2d2bb8988
--- /dev/null
+++ b/chromium-next/patches/patch-base_tracing_trace__time.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/tracing/trace_time.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/tracing/trace_time.h
+@@ -12,7 +12,7 @@ namespace base {
+ namespace tracing {
+
+ #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/chromium-next/patches/patch-base_version__info_version__info.h b/chromium-next/patches/patch-base_version__info_version__info.h
new file mode 100644
index 0000000000..dbe78fa5e1
--- /dev/null
+++ b/chromium-next/patches/patch-base_version__info_version__info.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- base/version_info/version_info.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ base/version_info/version_info.h
+@@ -74,6 +74,8 @@ constexpr std::string_view GetOSType() {
+ return "FreeBSD";
+ #elif BUILDFLAG(IS_OPENBSD)
+ return "OpenBSD";
++#elif BUILDFLAG(IS_NETBSD)
++ return "NetBSD";
+ #elif BUILDFLAG(IS_SOLARIS)
+ return "Solaris";
+ #elif BUILDFLAG(IS_FUCHSIA)
diff --git a/chromium-next/patches/patch-build_config_BUILD.gn b/chromium-next/patches/patch-build_config_BUILD.gn
new file mode 100644
index 0000000000..258bcb2e3e
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_BUILD.gn
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/BUILD.gn
+@@ -215,6 +215,10 @@ config("default_libs") {
+ # Targets should choose to explicitly link frameworks they require. Since
+ # linking can have run-time side effects, nothing should be listed here.
+ libs = []
++ } else if (is_bsd) {
++ libs = [
++ "pthread",
++ ]
+ } else if (is_linux || is_chromeos) {
+ libs = [
+ "dl",
diff --git a/chromium-next/patches/patch-build_config_BUILDCONFIG.gn b/chromium-next/patches/patch-build_config_BUILDCONFIG.gn
new file mode 100644
index 0000000000..d62863a6f5
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_BUILDCONFIG.gn
@@ -0,0 +1,54 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/BUILDCONFIG.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/BUILDCONFIG.gn
+@@ -136,7 +136,8 @@ declare_args() {
+ is_official_build = false
+
+ # Set to true when compiling with the Clang compiler.
+- is_clang = current_os != "linux" ||
++ is_clang = current_os != "linux" || current_os == "openbsd" ||
++ current_os == "freebsd" || current_os == "netbsd" ||
+ (current_cpu != "s390x" && current_cpu != "s390" &&
+ current_cpu != "ppc64" && current_cpu != "ppc" &&
+ current_cpu != "mips" && current_cpu != "mips64" &&
+@@ -234,6 +235,12 @@ if (host_toolchain == "") {
+ host_toolchain = "//build/toolchain/aix:$host_cpu"
+ } else if (host_os == "zos") {
+ host_toolchain = "//build/toolchain/zos:$host_cpu"
++ } else if (host_os == "openbsd") {
++ host_toolchain = "//build/toolchain/openbsd:clang_$host_cpu"
++ } else if (host_os == "freebsd") {
++ host_toolchain = "//build/toolchain/freebsd:clang_$host_cpu"
++ } else if (host_os == "netbsd") {
++ host_toolchain = "//build/toolchain/netbsd:clang_$host_cpu"
+ } else {
+ assert(false, "Unsupported host_os: $host_os")
+ }
+@@ -278,6 +285,8 @@ if (target_os == "android") {
+ _default_toolchain = "//build/toolchain/aix:$target_cpu"
+ } else if (target_os == "zos") {
+ _default_toolchain = "//build/toolchain/zos:$target_cpu"
++} else if (target_os == "openbsd" || target_os == "freebsd" || target_os == "netbsd") {
++ _default_toolchain = host_toolchain
+ } else {
+ assert(false, "Unsupported target_os: $target_os")
+ }
+@@ -312,7 +321,12 @@ is_android = current_os == "android"
+ is_chromeos = current_os == "chromeos"
+ is_fuchsia = current_os == "fuchsia"
+ is_ios = current_os == "ios"
+-is_linux = current_os == "linux"
++is_linux = current_os == "linux" || current_os == "openbsd" ||
++ current_os == "freebsd" || current_os == "netbsd"
++is_openbsd = current_os == "openbsd"
++is_freebsd = current_os == "freebsd"
++is_netbsd = current_os == "netbsd"
++is_bsd = current_os == "openbsd" || current_os == "freebsd" || current_os == "netbsd"
+ is_mac = current_os == "mac"
+ is_nacl = current_os == "nacl"
+ is_watchos = current_os == "watchos"
diff --git a/chromium-next/patches/patch-build_config_clang_BUILD.gn b/chromium-next/patches/patch-build_config_clang_BUILD.gn
new file mode 100644
index 0000000000..2375ba5f4a
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_clang_BUILD.gn
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/clang/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/clang/BUILD.gn
+@@ -213,7 +213,12 @@ template("clang_lib") {
+
+ # Adds a dependency on the Clang runtime library clang_rt.builtins.
+ clang_lib("compiler_builtins") {
+- if (is_mac) {
++ if (is_bsd) {
++ # Since there's no Rust in the toolchain, there's no concern that we'll use
++ # the Rust stdlib's intrinsics here.
++ #
++ # Don't define libname which makes this target do nothing.
++ } else if (is_mac) {
+ libname = "osx"
+ } else if (is_ios) {
+ if (target_environment == "simulator") {
diff --git a/chromium-next/patches/patch-build_config_compiler_BUILD.gn b/chromium-next/patches/patch-build_config_compiler_BUILD.gn
new file mode 100644
index 0000000000..867bdc93c1
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_compiler_BUILD.gn
@@ -0,0 +1,128 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/compiler/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/compiler/BUILD.gn
+@@ -199,7 +199,7 @@ declare_args() {
+ # This greatly reduces the size of debug builds, at the cost of
+ # debugging information which is required by some specialized
+ # debugging tools.
+- simple_template_names = is_clang && !is_nacl && !is_win && !is_apple
++ simple_template_names = is_clang && !is_nacl && !is_win && !is_apple && !is_bsd
+ }
+
+ declare_args() {
+@@ -256,13 +256,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", "-Wl,--strip-all" ]
++ }
+ }
+
+ # compiler ---------------------------------------------------------------------
+@@ -509,6 +512,10 @@ config("compiler") {
+ }
+ }
+
++ if (is_openbsd) {
++ ldflags += [ "-Wl,-z,wxneeded" ]
++ }
++
+ # Linux-specific compiler flags setup.
+ # ------------------------------------
+ if (use_icf && (!is_apple || use_lld)) {
+@@ -568,7 +575,7 @@ config("compiler") {
+ ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
+ }
+
+- if (is_clang && !is_nacl) {
++ if (is_clang && !is_nacl && !is_bsd) {
+ cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
+ if (save_reproducers_on_lld_crash && use_lld) {
+ ldflags += [
+@@ -1241,7 +1248,7 @@ config("compiler_cpu_abi") {
+ ]
+ }
+ } else if (current_cpu == "arm") {
+- if (is_clang && !is_android && !is_nacl && !is_chromeos_device) {
++ if (is_clang && !is_android && !is_nacl && !is_chromeos_device && !is_bsd) {
+ cflags += [ "--target=arm-linux-gnueabihf" ]
+ ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
+@@ -1256,7 +1263,7 @@ config("compiler_cpu_abi") {
+ }
+ } else if (current_cpu == "arm64") {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
+- !is_chromeos_device) {
++ !is_chromeos_device && !is_bsd) {
+ cflags += [ "--target=aarch64-linux-gnu" ]
+ ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
+@@ -1590,7 +1597,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",
+@@ -1648,7 +1655,7 @@ config("compiler_deterministic") {
+ }
+
+ config("clang_revision") {
+- if (is_clang && clang_base_path == default_clang_base_path &&
++ if (is_clang && !is_bsd && clang_base_path == default_clang_base_path &&
+ current_os != "zos") {
+ update_args = [
+ "--print-revision",
+@@ -1972,9 +1979,6 @@ config("default_warnings") {
+ cflags += [
+ # TODO(crbug.com/330524456): -Wcast-function-type is under -Wextra now.
+ "-Wno-cast-function-type",
+-
+- # TODO(crbug.com/40284799): Fix and re-enable.
+- "-Wno-thread-safety-reference-return",
+ ]
+
+ cflags_cc += [
+@@ -2761,7 +2765,7 @@ config("afdo_optimize_size") {
+ # There are some targeted places that AFDO regresses, so we provide a separate
+ # config to allow AFDO to be disabled per-target.
+ config("afdo") {
+- if (is_clang) {
++ if (is_clang && !is_bsd) {
+ cflags = []
+ if (clang_emit_debug_info_for_profiling) {
+ # Add the following flags to generate debug info for profiling.
+@@ -2788,7 +2792,7 @@ config("afdo") {
+ cflags += [ "-Wno-backend-plugin" ]
+ 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 ]
+ }
+@@ -2965,7 +2969,7 @@ config("symbols") {
+ cflags += [ "-gomit-unreferenced-methods" ]
+ }
+
+- if (is_clang && (!is_nacl || is_nacl_saigo)) {
++ if (is_clang && (!is_nacl || is_nacl_saigo) && !is_bsd) {
+ if (is_apple) {
+ # TODO(crbug.com/40117949): Investigate missing debug info on mac.
+ # Make sure we don't use constructor homing on mac.
diff --git a/chromium-next/patches/patch-build_config_gcc_BUILD.gn b/chromium-next/patches/patch-build_config_gcc_BUILD.gn
new file mode 100644
index 0000000000..2edcc9f544
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_gcc_BUILD.gn
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/gcc/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/gcc/BUILD.gn
+@@ -32,7 +32,9 @@ declare_args() {
+ # See http://gcc.gnu.org/wiki/Visibility
+ config("symbol_visibility_hidden") {
+ cflags = [ "-fvisibility=hidden" ]
+- rustflags = [ "-Zdefault-visibility=hidden" ]
++ if (!is_bsd) {
++ rustflags = [ "-Zdefault-visibility=hidden" ]
++ }
+
+ # Visibility attribute is not supported on AIX.
+ if (current_os != "aix") {
diff --git a/chromium-next/patches/patch-build_config_linux_BUILD.gn b/chromium-next/patches/patch-build_config_linux_BUILD.gn
new file mode 100644
index 0000000000..3ed8a95f20
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_linux_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/linux/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/linux/BUILD.gn
+@@ -41,7 +41,7 @@ config("runtime_library") {
+ }
+
+ if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") &&
+- (!use_custom_libcxx || current_cpu == "mipsel")) {
++ (!use_custom_libcxx || current_cpu == "mipsel") && !is_bsd) {
+ libs = [ "atomic" ]
+ }
+ }
diff --git a/chromium-next/patches/patch-build_config_linux_libdrm_BUILD.gn b/chromium-next/patches/patch-build_config_linux_libdrm_BUILD.gn
new file mode 100644
index 0000000000..221c9fed25
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_linux_libdrm_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/linux/libdrm/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/linux/libdrm/BUILD.gn
+@@ -15,7 +15,7 @@ declare_args() {
+ }
+
+ if (use_system_libdrm) {
+- assert(!is_linux, "System libdrm is not supported in linux")
++# assert(!is_linux, "System libdrm is not supported in linux")
+ pkg_config("libdrm_config") {
+ packages = [ "libdrm" ]
+ }
diff --git a/chromium-next/patches/patch-build_config_linux_pkg-config.py b/chromium-next/patches/patch-build_config_linux_pkg-config.py
new file mode 100644
index 0000000000..66953f3cf0
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_linux_pkg-config.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/linux/pkg-config.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/linux/pkg-config.py
+@@ -108,7 +108,7 @@ def main():
+ # If this is run on non-Linux platforms, just return nothing and indicate
+ # success. This allows us to "kind of emulate" a Linux build from other
+ # platforms.
+- if "linux" not in sys.platform:
++ if not sys.platform.startswith(tuple(['linux', 'openbsd', 'freebsd', 'netbsd'])):
+ print("[[],[],[],[],[]]")
+ return 0
+
diff --git a/chromium-next/patches/patch-build_config_ozone.gni b/chromium-next/patches/patch-build_config_ozone.gni
new file mode 100644
index 0000000000..76791f714d
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_ozone.gni
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/ozone.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/ozone.gni
+@@ -84,7 +84,19 @@ declare_args() {
+ } else if (is_chromeos_lacros) {
+ ozone_platform = "wayland"
+ ozone_platform_wayland = true
+- } else if (is_linux) {
++ } else if (is_linux && !is_bsd) {
++ ozone_platform = "x11"
++ ozone_platform_wayland = true
++ ozone_platform_x11 = true
++ } else if (is_openbsd) {
++ ozone_platform = "x11"
++ ozone_platform_wayland = false
++ ozone_platform_x11 = true
++ } else if (is_netbsd) {
++ ozone_platform = "x11"
++ ozone_platform_wayland = false
++ ozone_platform_x11 = true
++ } else if (is_freebsd) {
+ ozone_platform = "x11"
+ ozone_platform_wayland = true
+ ozone_platform_x11 = true
diff --git a/chromium-next/patches/patch-build_config_rust.gni b/chromium-next/patches/patch-build_config_rust.gni
new file mode 100644
index 0000000000..a84aa4bfa7
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_rust.gni
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/rust.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/rust.gni
+@@ -298,6 +298,10 @@ if (is_linux || is_chromeos) {
+ }
+ }
+
++if (is_bsd) {
++ rust_abi_target = string_replace(rust_abi_target, "linux-gnu", current_os)
++}
++
+ assert(!toolchain_has_rust || rust_abi_target != "")
+
+ # This variable is passed to the Rust libstd build.
diff --git a/chromium-next/patches/patch-build_config_v8__target__cpu.gni b/chromium-next/patches/patch-build_config_v8__target__cpu.gni
new file mode 100644
index 0000000000..fedccc52ec
--- /dev/null
+++ b/chromium-next/patches/patch-build_config_v8__target__cpu.gni
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/config/v8_target_cpu.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/config/v8_target_cpu.gni
+@@ -36,6 +36,10 @@ declare_args() {
+ if (v8_target_cpu == "") {
+ if (current_toolchain == "//build/toolchain/linux:clang_x64_v8_arm64") {
+ v8_target_cpu = "arm64"
++ } else if (current_toolchain == "//build/toolchain/openbsd:clang_arm64") {
++ v8_target_cpu = "arm64"
++ } else if (current_toolchain == "//build/toolchain/freebsd:clang_arm64") {
++ v8_target_cpu = "arm64"
+ } else if (current_toolchain == "//build/toolchain/linux:clang_x86_v8_arm") {
+ v8_target_cpu = "arm"
+ } else if (current_toolchain ==
diff --git a/chromium-next/patches/patch-build_detect__host__arch.py b/chromium-next/patches/patch-build_detect__host__arch.py
new file mode 100644
index 0000000000..40f1bc1496
--- /dev/null
+++ b/chromium-next/patches/patch-build_detect__host__arch.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/detect_host_arch.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/detect_host_arch.py
+@@ -20,6 +20,8 @@ def HostArch():
+ host_arch = 'ia32'
+ elif host_arch in ['x86_64', 'amd64']:
+ host_arch = 'x64'
++ elif host_arch.startswith('arm64'):
++ host_arch = 'arm64'
+ elif host_arch.startswith('arm'):
+ host_arch = 'arm'
+ elif host_arch.startswith('aarch64'):
diff --git a/chromium-next/patches/patch-build_gn__run__binary.py b/chromium-next/patches/patch-build_gn__run__binary.py
new file mode 100644
index 0000000000..dd161c6679
--- /dev/null
+++ b/chromium-next/patches/patch-build_gn__run__binary.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/gn_run_binary.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/gn_run_binary.py
+@@ -23,7 +23,7 @@ if not os.path.isabs(path):
+ # The rest of the arguments are passed directly to the executable.
+ args = [path] + sys.argv[2:]
+
+-ret = subprocess.call(args)
++ret = subprocess.call(args, env={"CHROME_EXE_PATH":"${WRKSRC}/out/Release/chrome","LD_LIBRARY_PATH":"${WRKSRC}/out/Release"})
+ if ret != 0:
+ if ret <= -100:
+ # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier to
diff --git a/chromium-next/patches/patch-build_linux_chrome.map b/chromium-next/patches/patch-build_linux_chrome.map
new file mode 100644
index 0000000000..30f9ae66c6
--- /dev/null
+++ b/chromium-next/patches/patch-build_linux_chrome.map
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/linux/chrome.map.orig 2025-01-07 19:49:01.000000000 +0000
++++ 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.
+ aligned_alloc;
diff --git a/chromium-next/patches/patch-build_linux_strip__binary.py b/chromium-next/patches/patch-build_linux_strip__binary.py
new file mode 100644
index 0000000000..b821c4c069
--- /dev/null
+++ b/chromium-next/patches/patch-build_linux_strip__binary.py
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/linux/strip_binary.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/linux/strip_binary.py
+@@ -10,6 +10,7 @@ import sys
+
+
+ def main():
++ return 0
+ argparser = argparse.ArgumentParser(description='eu-strip binary.')
+
+ argparser.add_argument('--eu-strip-binary-path', help='eu-strip path.')
diff --git a/chromium-next/patches/patch-build_linux_unbundle_icu.gn b/chromium-next/patches/patch-build_linux_unbundle_icu.gn
new file mode 100644
index 0000000000..9df35a0c42
--- /dev/null
+++ b/chromium-next/patches/patch-build_linux_unbundle_icu.gn
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/linux/unbundle/icu.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/linux/unbundle/icu.gn
+@@ -17,6 +17,15 @@ config("icu_config") {
+ "USING_SYSTEM_ICU=1",
+ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+
++ # As of icu 73 C++ nullptr, char16_t, override, final and noexcept are used
++ # instead of defines. These definitions can be removed when the bundled icu
++ # gets updated to 73. For more details, see:
++ # https://unicode-org.atlassian.net/browse/ICU-21833 and
++ # https://github.com/unicode-org/icu/commit/28643799377ecf654564f6f31854b02788cebe33
++ "U_FINAL=final",
++ "U_NOEXCEPT=noexcept",
++ "U_OVERRIDE=override",
++
+ # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
+ # on classes through the U_COMMON_API and U_I18N_API macros (among others).
+ # When linking against the system ICU library, we want its symbols to have
+@@ -34,6 +43,9 @@ config("icu_config") {
+ # to define U_IMPORT to have the same value as U_EXPORT. For more details,
+ # please see: https://crbug.com/822820
+ "U_IMPORT=U_EXPORT",
++
++ # Unbreak with icu 76 where private symbols are picked up
++ "U_HIDE_DRAFT_API",
+ ]
+ }
+
+@@ -53,6 +65,14 @@ source_set("icui18n") {
+ ]
+ }
+
++source_set("icui18n_hidden_visibility") {
++ deps = [ ":icui18n_shim" ]
++ public_configs = [
++ ":icu_config",
++ ":system_icui18n",
++ ]
++}
++
+ source_set("icuuc") {
+ deps = [ ":icuuc_shim" ]
+ public_configs = [
diff --git a/chromium-next/patches/patch-build_linux_unbundle_libevent.gn b/chromium-next/patches/patch-build_linux_unbundle_libevent.gn
new file mode 100644
index 0000000000..b0a1a607bb
--- /dev/null
+++ b/chromium-next/patches/patch-build_linux_unbundle_libevent.gn
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/linux/unbundle/libevent.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/linux/unbundle/libevent.gn
+@@ -9,7 +9,12 @@ shim_headers("libevent_shim") {
+ headers = [ "event.h" ]
+ }
+
++config("system_libevent") {
++ defines = [ "USE_SYSTEM_LIBEVENT=1" ]
++}
++
+ source_set("libevent") {
+ deps = [ ":libevent_shim" ]
+ libs = [ "event" ]
++ public_configs = [ ":system_libevent" ]
+ }
diff --git a/chromium-next/patches/patch-build_linux_unbundle_libusb.gn b/chromium-next/patches/patch-build_linux_unbundle_libusb.gn
new file mode 100644
index 0000000000..fd8a5e034c
--- /dev/null
+++ b/chromium-next/patches/patch-build_linux_unbundle_libusb.gn
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/linux/unbundle/libusb.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/linux/unbundle/libusb.gn
+@@ -1,3 +1,27 @@
++# Copyright 2016 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/linux/pkg_config.gni")
++import("//build/shim_headers.gni")
++
++pkg_config("system_libusb") {
++ packages = [ "libusb-1.0" ]
++}
++
++shim_headers("libusb_shim") {
++ root_path = "src/libusb"
++ headers = [
++ "libusb.h",
++ ]
++}
++
++source_set("libusb") {
++ deps = [
++ ":libusb_shim",
++ ]
++ public_configs = [ ":system_libusb" ]
++}
+ import("//build/config/linux/pkg_config.gni")
+ import("//build/shim_headers.gni")
+
diff --git a/chromium-next/patches/patch-build_rust_rust__bindgen.gni b/chromium-next/patches/patch-build_rust_rust__bindgen.gni
new file mode 100644
index 0000000000..35d95784e5
--- /dev/null
+++ b/chromium-next/patches/patch-build_rust_rust__bindgen.gni
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/rust/rust_bindgen.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/rust/rust_bindgen.gni
+@@ -12,14 +12,14 @@ if (is_win) {
+ import("//build/toolchain/win/win_toolchain_data.gni")
+ }
+
+-_bindgen_path = "${rust_bindgen_root}/bin/bindgen"
++_bindgen_path = "@PREFIX@/bin/bindgen"
+ if (host_os == "win") {
+ _bindgen_path = "${_bindgen_path}.exe"
+ }
+
+ # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in
+ # ../lib.
+-_libclang_path = rust_bindgen_root
++_libclang_path = "@PREFIX@"
+ if (host_os == "win") {
+ _libclang_path += "/bin"
+ } else {
diff --git a/chromium-next/patches/patch-build_rust_rust__bindgen__generator.gni b/chromium-next/patches/patch-build_rust_rust__bindgen__generator.gni
new file mode 100644
index 0000000000..2229d6c08d
--- /dev/null
+++ b/chromium-next/patches/patch-build_rust_rust__bindgen__generator.gni
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/rust/rust_bindgen_generator.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/rust/rust_bindgen_generator.gni
+@@ -11,14 +11,14 @@ if (is_win) {
+ import("//build/toolchain/win/win_toolchain_data.gni")
+ }
+
+-_bindgen_path = "${rust_bindgen_root}/bin/bindgen"
++_bindgen_path = "@PREFIX@/bin/bindgen"
+ if (host_os == "win") {
+ _bindgen_path = "${_bindgen_path}.exe"
+ }
+
+ # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in
+ # ../lib.
+-_libclang_path = rust_bindgen_root
++_libclang_path = "@PREFIX@"
+ if (host_os == "win") {
+ _libclang_path += "/bin"
+ } else {
diff --git a/chromium-next/patches/patch-build_rust_std_BUILD.gn b/chromium-next/patches/patch-build_rust_std_BUILD.gn
new file mode 100644
index 0000000000..f78907c599
--- /dev/null
+++ b/chromium-next/patches/patch-build_rust_std_BUILD.gn
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/rust/std/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/rust/std/BUILD.gn
+@@ -100,7 +100,6 @@ if (toolchain_has_rust) {
+ # don't need to pass to the C++ linker because they're used for specialized
+ # purposes.
+ skip_stdlib_files = [
+- "profiler_builtins",
+ "rustc_std_workspace_alloc",
+ "rustc_std_workspace_core",
+ "rustc_std_workspace_std",
diff --git a/chromium-next/patches/patch-build_toolchain_freebsd_BUILD.gn b/chromium-next/patches/patch-build_toolchain_freebsd_BUILD.gn
new file mode 100644
index 0000000000..47b838d8f6
--- /dev/null
+++ b/chromium-next/patches/patch-build_toolchain_freebsd_BUILD.gn
@@ -0,0 +1,75 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/toolchain/freebsd/BUILD.gn.orig 2025-01-20 18:01:27.814105070 +0000
++++ build/toolchain/freebsd/BUILD.gn
+@@ -0,0 +1,66 @@
++# Copyright 2013 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/sysroot.gni")
++import("//build/toolchain/gcc_toolchain.gni")
++
++clang_toolchain("clang_x86") {
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "freebsd"
++ }
++}
++
++gcc_toolchain("x86") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "freebsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_x64") {
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "freebsd"
++ }
++}
++
++gcc_toolchain("x64") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "freebsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_arm") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "freebsd"
++ }
++}
++
++clang_toolchain("clang_arm64") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "freebsd"
++ }
++}
diff --git a/chromium-next/patches/patch-build_toolchain_gcc__solink__wrapper.py b/chromium-next/patches/patch-build_toolchain_gcc__solink__wrapper.py
new file mode 100644
index 0000000000..7cbf5a8a1a
--- /dev/null
+++ b/chromium-next/patches/patch-build_toolchain_gcc__solink__wrapper.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/toolchain/gcc_solink_wrapper.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/toolchain/gcc_solink_wrapper.py
+@@ -39,7 +39,7 @@ def CollectDynSym(args):
+ """Replaces: nm --format=posix -g -D -p $sofile | cut -f1-2 -d' '"""
+ toc = ''
+ nm = subprocess.Popen(wrapper_utils.CommandToRun(
+- [args.nm, '--format=posix', '-g', '-D', '-p', args.sofile]),
++ [args.nm, '-g', '-D', '-p', args.sofile]),
+ stdout=subprocess.PIPE,
+ bufsize=-1,
+ universal_newlines=True)
diff --git a/chromium-next/patches/patch-build_toolchain_gcc__toolchain.gni b/chromium-next/patches/patch-build_toolchain_gcc__toolchain.gni
new file mode 100644
index 0000000000..318bd25780
--- /dev/null
+++ b/chromium-next/patches/patch-build_toolchain_gcc__toolchain.gni
@@ -0,0 +1,59 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/toolchain/gcc_toolchain.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/toolchain/gcc_toolchain.gni
+@@ -56,6 +56,13 @@ if (enable_resource_allowlist_generation
+ "enable_resource_allowlist_generation=true does not work for target_os=$target_os")
+ }
+
++declare_args() {
++ extra_cflags = ""
++ extra_cppflags = ""
++ extra_cxxflags = ""
++ extra_ldflags = ""
++}
++
+ # This template defines a toolchain for something that works like gcc
+ # (including clang).
+ #
+@@ -617,7 +624,7 @@ template("single_gcc_toolchain") {
+ # We need to specify link groups, at least, for single pass linkers. I.e.
+ # Rust libraries are alpha-sorted instead of by dependencies so they fail
+ # to link if not properly ordered or grouped.
+- link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" $end_group_flag {{solibs}} {{libs}} $start_group_flag {{rlibs}} $end_group_flag"
++ link_command = "$ld $start_group_flag {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" @\"$rspfile\" {{solibs}} {{libs}} {{rlibs}} $end_group_flag"
+
+ # Generate a map file to be used for binary size analysis.
+ # Map file adds ~10% to the link time on a z620.
+@@ -904,22 +911,12 @@ template("gcc_toolchain") {
+ # actually just be doing a native compile.
+ template("clang_toolchain") {
+ gcc_toolchain(target_name) {
+- _path = "$clang_base_path/bin"
+- _is_path_absolute = get_path_info(_path, "abspath") == _path
+-
+- # Preserve absolute paths for tools like distcc.
+- if (_is_path_absolute && filter_include([ _path ], [ "//*" ]) == []) {
+- prefix = _path
+- } else {
+- prefix = rebase_path(_path, root_build_dir)
+- }
+-
+- cc = "${prefix}/clang"
+- cxx = "${prefix}/clang++"
++ cc = "cc"
++ cxx = "c++"
+ ld = cxx
+- readelf = "${prefix}/llvm-readelf"
+- ar = "${prefix}/llvm-ar"
+- nm = "${prefix}/llvm-nm"
++ readelf = "readelf"
++ ar = "ar"
++ nm = "nm"
+
+ forward_variables_from(invoker, "*", [ "toolchain_args" ])
+
diff --git a/chromium-next/patches/patch-build_toolchain_netbsd_BUILD.gn b/chromium-next/patches/patch-build_toolchain_netbsd_BUILD.gn
new file mode 100644
index 0000000000..b117a5d675
--- /dev/null
+++ b/chromium-next/patches/patch-build_toolchain_netbsd_BUILD.gn
@@ -0,0 +1,75 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/toolchain/netbsd/BUILD.gn.orig 2025-01-20 18:01:27.814558368 +0000
++++ build/toolchain/netbsd/BUILD.gn
+@@ -0,0 +1,66 @@
++# Copyright 2013 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/sysroot.gni")
++import("//build/toolchain/gcc_toolchain.gni")
++
++clang_toolchain("clang_x86") {
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "netbsd"
++ }
++}
++
++gcc_toolchain("x86") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "netbsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_x64") {
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "netbsd"
++ }
++}
++
++gcc_toolchain("x64") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "netbsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_arm") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "netbsd"
++ }
++}
++
++clang_toolchain("clang_arm64") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "netbsd"
++ }
++}
diff --git a/chromium-next/patches/patch-build_toolchain_openbsd_BUILD.gn b/chromium-next/patches/patch-build_toolchain_openbsd_BUILD.gn
new file mode 100644
index 0000000000..d8d5aa624d
--- /dev/null
+++ b/chromium-next/patches/patch-build_toolchain_openbsd_BUILD.gn
@@ -0,0 +1,75 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/toolchain/openbsd/BUILD.gn.orig 2025-01-20 18:01:27.814709732 +0000
++++ build/toolchain/openbsd/BUILD.gn
+@@ -0,0 +1,66 @@
++# Copyright 2013 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/sysroot.gni")
++import("//build/toolchain/gcc_toolchain.gni")
++
++clang_toolchain("clang_x86") {
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "openbsd"
++ }
++}
++
++gcc_toolchain("x86") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "openbsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_x64") {
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "openbsd"
++ }
++}
++
++gcc_toolchain("x64") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "openbsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_arm") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "openbsd"
++ }
++}
++
++clang_toolchain("clang_arm64") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "openbsd"
++ }
++}
diff --git a/chromium-next/patches/patch-build_toolchain_toolchain.gni b/chromium-next/patches/patch-build_toolchain_toolchain.gni
new file mode 100644
index 0000000000..06d572b269
--- /dev/null
+++ b/chromium-next/patches/patch-build_toolchain_toolchain.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- build/toolchain/toolchain.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ build/toolchain/toolchain.gni
+@@ -72,7 +72,7 @@ if (host_os == "mac") {
+ host_shlib_extension = ".dylib"
+ } else if (host_os == "win") {
+ host_shlib_extension = ".dll"
+-} else if (host_os == "linux" || host_os == "aix" || host_os == "zos") {
++} else if (is_posix) {
+ host_shlib_extension = ".so"
+ } else {
+ assert(false, "Host platform not supported")
diff --git a/chromium-next/patches/patch-cc_base_features.cc b/chromium-next/patches/patch-cc_base_features.cc
new file mode 100644
index 0000000000..02e017bd95
--- /dev/null
+++ b/chromium-next/patches/patch-cc_base_features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- cc/base/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ cc/base/features.cc
+@@ -65,7 +65,7 @@ const base::FeatureParam<int> kDeferImpl
+ // be using a separate flag to control the launch on GL.
+ BASE_FEATURE(kUseDMSAAForTiles,
+ "UseDMSAAForTiles",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-chrome_app_chrome__command__ids.h b/chromium-next/patches/patch-chrome_app_chrome__command__ids.h
new file mode 100644
index 0000000000..a108808480
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_app_chrome__command__ids.h
@@ -0,0 +1,23 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/app/chrome_command_ids.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/app/chrome_command_ids.h
+@@ -68,12 +68,12 @@
+ #define IDC_TOGGLE_MULTITASK_MENU 34050
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define IDC_USE_SYSTEM_TITLE_BAR 34051
+ #endif
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #define IDC_RESTORE_WINDOW 34052
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_app_chrome__main.cc b/chromium-next/patches/patch-chrome_app_chrome__main.cc
new file mode 100644
index 0000000000..cd9c9d91d6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_app_chrome__main.cc
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/app/chrome_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/app/chrome_main.cc
+@@ -28,11 +28,11 @@
+ #include "chrome/app/chrome_main_mac.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/base_switches.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/app/chrome_main_linux.h"
+ #endif
+
+@@ -57,7 +57,7 @@
+ // sometime after old headless code is removed from Chrome.
+ // See https://crbug.com/373672160.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #define ENABLE_OLD_HEADLESS_INFO
+ #endif
+
+@@ -115,7 +115,7 @@ int ChromeMain(int argc, const char** ar
+ #error Unknown platform.
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ PossiblyDetermineFallbackChromeChannel(argv[0]);
+ #endif
+
+@@ -181,7 +181,7 @@ int ChromeMain(int argc, const char** ar
+ SetUpBundleOverrides();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ AppendExtraArgumentsToCommandLine(command_line);
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_app_chrome__main__delegate.cc b/chromium-next/patches/patch-chrome_app_chrome__main__delegate.cc
new file mode 100644
index 0000000000..4e9e34453d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_app_chrome__main__delegate.cc
@@ -0,0 +1,153 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/app/chrome_main_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/app/chrome_main_delegate.cc
+@@ -145,7 +145,7 @@
+ #include "components/about_ui/credit_utils.h"
+ #endif
+
+-#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ #include "components/nacl/common/nacl_paths.h"
+ #include "components/nacl/zygote/nacl_fork_delegate_linux.h"
+ #endif
+@@ -189,17 +189,17 @@
+ #include "v8/include/v8.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/nix/scoped_xdg_activation_token_injector.h"
+ #include "ui/linux/display_server_utils.h"
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/policy/policy_path_parser.h"
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+@@ -341,7 +341,7 @@ void AdjustLinuxOOMScore(const std::stri
+ // and resources loaded.
+ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
+ return
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The zygote process opens the resources for the renderers.
+ process_type == switches::kZygoteProcess ||
+ #endif
+@@ -426,7 +426,7 @@ bool HandleVersionSwitches(const base::C
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Show the man page if --help or -h is on the command line.
+ void HandleHelpSwitches(const base::CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kHelp) ||
+@@ -438,7 +438,7 @@ void HandleHelpSwitches(const base::Comm
+ }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD)
+ void SIGTERMProfilingShutdown(int signal) {
+ content::Profiling::Stop();
+ struct sigaction sigact;
+@@ -520,7 +520,7 @@ std::optional<int> AcquireProcessSinglet
+ // process can be exited.
+ ChromeProcessSingleton::CreateInstance(user_data_dir);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Read the xdg-activation token and set it in the command line for the
+ // duration of the notification in order to ensure this is propagated to an
+ // already running browser process if it exists.
+@@ -604,7 +604,7 @@ void InitializeUserDataDir(base::Command
+ std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, Chrome does not support running multiple copies under different
+ // DISPLAYs, so the profile directory can be specified in the environment to
+ // support the virtual desktop use-case.
+@@ -700,7 +700,7 @@ void RecordMainStartupMetrics(const Star
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Record the startup process creation time on supported platforms. On Android
+ // this is recorded in ChromeMainDelegateAndroid.
+ startup_metric_utils::GetCommon().RecordStartupProcessCreationTime(
+@@ -889,7 +889,7 @@ std::optional<int> ChromeMainDelegate::P
+ #if BUILDFLAG(IS_OZONE)
+ // Initialize Ozone platform and add required feature flags as per platform's
+ // properties.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ui::SetOzonePlatformForLinuxIfNeeded(*base::CommandLine::ForCurrentProcess());
+ #endif
+ ui::OzonePlatform::PreEarlyInitialization();
+@@ -1085,7 +1085,7 @@ void ChromeMainDelegate::CommonEarlyInit
+ const bool is_canary_dev = IsCanaryDev();
+ const bool emit_crashes =
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ is_canary_dev;
+ #else
+ false;
+@@ -1234,7 +1234,7 @@ std::optional<int> ChromeMainDelegate::B
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag
+ // switch of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // This will directly exit if the user asked for help.
+ HandleHelpSwitches(command_line);
+ #endif
+@@ -1264,7 +1264,7 @@ std::optional<int> ChromeMainDelegate::B
+ #if BUILDFLAG(IS_CHROMEOS)
+ chromeos::dbus_paths::RegisterPathProvider();
+ #endif
+-#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ nacl::RegisterPathProvider();
+ #endif
+
+@@ -1559,7 +1559,7 @@ void ChromeMainDelegate::PreSandboxStart
+ CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
+ }
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ // Zygote needs to call InitCrashReporter() in RunZygote().
+ if (process_type != switches::kZygoteProcess &&
+ !command_line.HasSwitch(switches::kDisableCrashpadForTesting)) {
+@@ -1647,13 +1647,13 @@ absl::variant<int, content::MainFunction
+ #else
+
+ #if BUILDFLAG(IS_MAC) || (BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && \
+- !BUILDFLAG(IS_CHROMEOS))
++ !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD))
+ static const MainFunction kMainFunctions[] = {
+ #if BUILDFLAG(IS_MAC)
+ {switches::kRelauncherProcess, mac_relauncher::internal::RelauncherMain},
+ {switches::kCodeSignCloneCleanupProcess,
+ code_sign_clone_manager::internal::ChromeCodeSignCloneCleanupMain},
+-#elif BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // This entry is not needed on Linux, where the NaCl loader
+ // process is launched via nacl_helper instead.
+ {switches::kNaClLoaderProcess, NaClMain},
diff --git a/chromium-next/patches/patch-chrome_browser_BUILD.gn b/chromium-next/patches/patch-chrome_browser_BUILD.gn
new file mode 100644
index 0000000000..41f60a2692
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_BUILD.gn
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/BUILD.gn
+@@ -6958,6 +6958,13 @@ static_library("browser") {
+ }
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "metrics/bluetooth_metrics_provider.cc",
++ "metrics/bluetooth_metrics_provider.h",
++ ]
++ }
++
+ if (is_linux && use_dbus) {
+ sources += [
+ "dbus_memory_pressure_evaluator_linux.cc",
diff --git a/chromium-next/patches/patch-chrome_browser_about__flags.cc b/chromium-next/patches/patch-chrome_browser_about__flags.cc
new file mode 100644
index 0000000000..546e811f18
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_about__flags.cc
@@ -0,0 +1,340 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/about_flags.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/about_flags.cc
+@@ -249,7 +249,7 @@
+ #include "ui/ui_features.h"
+ #include "url/url_features.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/allocator/buildflags.h"
+ #endif
+
+@@ -344,7 +344,7 @@
+ #include "device/vr/public/cpp/features.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/public/ozone_switches.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+
+@@ -353,7 +353,7 @@
+ #include "chrome/browser/win/mica_titlebar.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/contextual_cueing/contextual_cueing_features.h"
+ #include "chrome/browser/enterprise/profile_management/profile_management_features.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+@@ -364,7 +364,7 @@
+ #include "components/user_education/common/user_education_features.h" // nogncheck
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/ui_features.h"
+ #include "ui/base/ui_base_features.h"
+ #endif
+@@ -510,7 +510,7 @@ const FeatureEntry::FeatureVariation kDX
+ {"Max 3 Frames", &kDXGIWaitableSwapChain3Frames, 1, nullptr}};
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::Choice kOzonePlatformHintRuntimeChoices[] = {
+ {flag_descriptions::kOzonePlatformHintChoiceDefault, "", ""},
+ {flag_descriptions::kOzonePlatformHintChoiceAuto,
+@@ -780,6 +780,31 @@ const FeatureEntry::FeatureVariation
+ std::size(kWebIdentityDigitalIdentityCredentialHighRiskDialogParam),
+ nullptr}};
+
++#if BUILDFLAG(IS_BSD)
++const FeatureEntry::FeatureParam kAudioBackendPulseAudio[] = {
++ { "audio-backend", "pulseaudio" }};
++const FeatureEntry::FeatureParam kAudioBackendSndio[] = {
++ { "audio-backend", "sndio" }};
++const FeatureEntry::FeatureParam kAudioBackendAudioIO[] = {
++ { "audio-backend", "audioio" }};
++const FeatureEntry::FeatureParam kAudioBackendAlsa[] = {
++ { "audio-backend", "alsa" }};
++const FeatureEntry::FeatureVariation
++ kAudioBackendVariations[] = {
++ {"using PulseAudio by default if available", kAudioBackendPulseAudio,
++ std::size(kAudioBackendPulseAudio),
++ nullptr},
++ {"using sndio by default if available", kAudioBackendSndio,
++ std::size(kAudioBackendSndio),
++ nullptr},
++ {"using audioio by default if available", kAudioBackendAudioIO,
++ std::size(kAudioBackendAudioIO),
++ nullptr},
++ {"using ALSA by default if available", kAudioBackendAlsa,
++ std::size(kAudioBackendAlsa),
++ nullptr}};
++#endif
++
+ const FeatureEntry::FeatureParam kClipboardMaximumAge60Seconds[] = {
+ {"UIClipboardMaximumAge", "60"}};
+ const FeatureEntry::FeatureParam kClipboardMaximumAge90Seconds[] = {
+@@ -1216,7 +1241,7 @@ const FeatureEntry::FeatureVariation kPa
+ };
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::FeatureParam kHistoryEmbeddingsAtKeywordAcceleration[]{
+ {"AtKeywordAcceleration", "true"},
+ };
+@@ -1254,7 +1279,7 @@ const FeatureEntry::FeatureVariation kRe
+ };
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::FeatureParam kShortcutBoostSingleUrl[] = {
+ {"ShortcutBoostSearchScore", "0"},
+ {"ShortcutBoostNonTopHitThreshold", "0"},
+@@ -1872,7 +1897,7 @@ const FeatureEntry::FeatureVariation kTa
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::FeatureParam kTabstripDeclutterQuickModeParams[] = {
+ {"stale_threshold_duration", "10s"},
+ {"declutter_timer_interval", "10s"},
+@@ -3589,7 +3614,7 @@ const FeatureEntry::FeatureVariation
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const flags_ui::FeatureEntry::FeatureParam kPwaNavigationCapturingDefaultOn[] =
+ {{"link_capturing_state", "on_by_default"}};
+ const flags_ui::FeatureEntry::FeatureParam kPwaNavigationCapturingDefaultOff[] =
+@@ -4135,7 +4160,7 @@ const FeatureEntry::FeatureVariation
+ std::size(kSecurePaymentConfirmationNetworkAndIssuerIcons_Rows),
+ nullptr}};
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::FeatureParam kTranslationAPI_SkipLanguagePackLimit[] = {
+ {"TranslationAPIAcceptLanguagesCheck", "false"},
+ {"TranslationAPILimitLanguagePackCount", "false"}};
+@@ -4968,7 +4993,7 @@ const FeatureEntry kFeatureEntries[] = {
+ },
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {
+ "fluent-overlay-scrollbars",
+ flag_descriptions::kFluentOverlayScrollbarsName,
+@@ -5373,7 +5398,7 @@ const FeatureEntry kFeatureEntries[] = {
+ flag_descriptions::kDesktopPWAsSyncChangesDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(features::kWebAppDontAddExistingAppsToSync)},
+ #endif // !BUILDFLAG(IS_ANDROID)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"shortcuts-not-apps", flag_descriptions::kShortcutsNotAppsName,
+ flag_descriptions::kShortcutsNotAppsDescription,
+ kOsMac | kOsWin | kOsLinux,
+@@ -5532,7 +5557,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(features::kWebShare)},
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"pulseaudio-loopback-for-cast",
+ flag_descriptions::kPulseaudioLoopbackForCastName,
+ flag_descriptions::kPulseaudioLoopbackForCastDescription, kOsLinux,
+@@ -5568,9 +5593,19 @@ const FeatureEntry kFeatureEntries[] = {
+ flag_descriptions::kWaylandLinuxDrmSyncobjName,
+ flag_descriptions::kWaylandLinuxDrmSyncobjDescription, kOsLinux,
+ FEATURE_VALUE_TYPE(features::kWaylandLinuxDrmSyncobj)},
++
++#if BUILDFLAG(IS_BSD)
++ {"audio-backend",
++ flag_descriptions::kAudioBackendName,
++ flag_descriptions::kAudioBackendDescription, kOsLinux,
++ FEATURE_WITH_PARAMS_VALUE_TYPE(
++ media::kAudioBackend,
++ kAudioBackendVariations,
++ "AudioBackend")},
++#endif
+ #endif // BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ {"skip-undecryptable-passwords",
+ flag_descriptions::kSkipUndecryptablePasswordsName,
+ flag_descriptions::kSkipUndecryptablePasswordsDescription,
+@@ -6466,7 +6501,7 @@ const FeatureEntry kFeatureEntries[] = {
+ "MlUrlScoring")},
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ {"omnibox-domain-suggestions",
+ flag_descriptions::kOmniboxDomainSuggestionsName,
+ flag_descriptions::kOmniboxDomainSuggestionsDescription, kOsDesktop,
+@@ -6675,7 +6710,7 @@ const FeatureEntry kFeatureEntries[] = {
+ "OrganicRepeatableQueries")},
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ {"history-embeddings", flag_descriptions::kHistoryEmbeddingsName,
+ flag_descriptions::kHistoryEmbeddingsDescription, kOsDesktop,
+ FEATURE_WITH_PARAMS_VALUE_TYPE(history_embeddings::kHistoryEmbeddings,
+@@ -7278,7 +7313,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(printing::features::kAddPrinterViaPrintscanmgr)},
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ {"cups-ipp-printing-backend",
+ flag_descriptions::kCupsIppPrintingBackendName,
+ flag_descriptions::kCupsIppPrintingBackendDescription, kOsDesktop,
+@@ -8228,7 +8263,7 @@ const FeatureEntry kFeatureEntries[] = {
+ flag_descriptions::kCooperativeSchedulingDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kCooperativeScheduling)},
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {"enable-network-service-sandbox",
+ flag_descriptions::kEnableNetworkServiceSandboxName,
+ flag_descriptions::kEnableNetworkServiceSandboxDescription,
+@@ -8973,7 +9008,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(ash::features::kWallpaperGooglePhotosSharedAlbums)},
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"enable-get-all-screens-media", flag_descriptions::kGetAllScreensMediaName,
+ flag_descriptions::kGetAllScreensMediaDescription,
+ kOsCrOS | kOsLacros | kOsLinux,
+@@ -9002,7 +9037,7 @@ const FeatureEntry kFeatureEntries[] = {
+
+ #if BUILDFLAG(IS_WIN) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ {
+ "ui-debug-tools",
+ flag_descriptions::kUIDebugToolsName,
+@@ -9472,7 +9507,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(features::kRenderPassDrawnRect)},
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {"media-session-enter-picture-in-picture",
+ flag_descriptions::kMediaSessionEnterPictureInPictureName,
+ flag_descriptions::kMediaSessionEnterPictureInPictureDescription,
+@@ -10270,7 +10305,7 @@ const FeatureEntry kFeatureEntries[] = {
+ kOsDesktop | kOsAndroid,
+ FEATURE_VALUE_TYPE(features::kProcessPerSiteUpToMainFrameThreshold)},
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"camera-mic-effects", flag_descriptions::kCameraMicEffectsName,
+ flag_descriptions::kCameraMicEffectsDescription,
+ static_cast<unsigned short>(kOsMac | kOsWin | kOsLinux),
+@@ -10296,7 +10331,7 @@ const FeatureEntry kFeatureEntries[] = {
+ "RenderDocument")},
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {"enable-search-aggregator-policy",
+ flag_descriptions::kEnableSearchAggregatorPolicyName,
+ flag_descriptions::kEnableSearchAggregatorPolicyDescription,
+@@ -10412,7 +10447,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(chrome::android::kReadAloudTapToSeek)},
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ {"third-party-profile-management",
+ flag_descriptions::kThirdPartyProfileManagementName,
+ flag_descriptions::kThirdPartyProfileManagementDescription,
+@@ -10454,7 +10489,7 @@ const FeatureEntry kFeatureEntries[] = {
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {"enable-user-navigation-capturing-pwa",
+ flag_descriptions::kPwaNavigationCapturingName,
+ flag_descriptions::kPwaNavigationCapturingDescription,
+@@ -11311,7 +11346,7 @@ const FeatureEntry kFeatureEntries[] = {
+ performance_manager::features::kPerformanceInterventionDemoMode)},
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"sync-enable-bookmarks-in-transport-mode",
+ flag_descriptions::kSyncEnableBookmarksInTransportModeName,
+ flag_descriptions::kSyncEnableBookmarksInTransportModeDescription,
+@@ -11400,7 +11435,7 @@ const FeatureEntry kFeatureEntries[] = {
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ {"classify-url-on-process-response-event",
+ flag_descriptions::kClassifyUrlOnProcessResponseEventName,
+ flag_descriptions::kClassifyUrlOnProcessResponseEventDescription,
+@@ -11409,7 +11444,7 @@ const FeatureEntry kFeatureEntries[] = {
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {"tab-organization", flag_descriptions::kTabOrganizationName,
+ flag_descriptions::kTabOrganizationDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(features::kTabOrganization)},
+@@ -11454,7 +11489,7 @@ const FeatureEntry kFeatureEntries[] = {
+ flag_descriptions::kLanguageDetectionAPIDescription, kOsAll,
+ FEATURE_VALUE_TYPE(blink::features::kLanguageDetectionAPI)},
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ {"supervised-profile-hide-guest",
+ flag_descriptions::kSupervisedProfileHideGuestName,
+ flag_descriptions::kSupervisedProfileHideGuestDescription,
+@@ -11724,7 +11759,7 @@ const FeatureEntry kFeatureEntries[] = {
+ segmentation_platform::features::kSegmentationSurveyPage)},
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {"autofill-enable-buy-now-pay-later-for-affirm",
+ flag_descriptions::kAutofillEnableBuyNowPayLaterForAffirmName,
+ flag_descriptions::kAutofillEnableBuyNowPayLaterForAffirmDescription,
+@@ -11853,7 +11888,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(
+ autofill::features::kAutofillEnableCardInfoRuntimeRetrieval)},
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"translation-api", flag_descriptions::kTranslationAPIName,
+ flag_descriptions::kTranslationAPIDescription, kOsMac | kOsWin | kOsLinux,
+ FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kEnableTranslationAPI,
+@@ -11879,7 +11914,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(
+ password_manager::features::kPasswordFormClientsideClassifier)},
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"contextual-cueing", flag_descriptions::kContextualCueingName,
+ flag_descriptions::kContextualCueingDescription,
+ kOsLinux | kOsMac | kOsWin,
diff --git a/chromium-next/patches/patch-chrome_browser_accessibility_page__colors.cc b/chromium-next/patches/patch-chrome_browser_accessibility_page__colors.cc
new file mode 100644
index 0000000000..3ef4e6bdc1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_accessibility_page__colors.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/accessibility/page_colors.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/accessibility/page_colors.cc
+@@ -12,7 +12,7 @@
+ #include "components/sync_preferences/pref_service_syncable.h"
+ #include "ui/native_theme/native_theme.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #include "ui/linux/linux_ui_factory.h"
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -55,7 +55,7 @@ void PageColors::Init() {
+
+ void PageColors::OnPageColorsChanged() {
+ auto* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Allow the Linux native theme to update its state for page colors.
+ if (auto* linux_ui_theme = ui::GetDefaultLinuxUiTheme()) {
+ if (auto* linux_native_theme = linux_ui_theme->GetNativeTheme()) {
diff --git a/chromium-next/patches/patch-chrome_browser_after__startup__task__utils.cc b/chromium-next/patches/patch-chrome_browser_after__startup__task__utils.cc
new file mode 100644
index 0000000000..6749ae3068
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_after__startup__task__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/after_startup_task_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/after_startup_task_utils.cc
+@@ -117,7 +117,7 @@ void SetBrowserStartupIsComplete() {
+ TRACE_EVENT_SCOPE_GLOBAL, "BrowserCount", browser_count);
+ GetStartupCompleteFlag().Set();
+ #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();
diff --git a/chromium-next/patches/patch-chrome_browser_apps_app__service_publishers_extension__apps.cc b/chromium-next/patches/patch-chrome_browser_apps_app__service_publishers_extension__apps.cc
new file mode 100644
index 0000000000..d67d66f955
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_apps_app__service_publishers_extension__apps.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/apps/app_service/publishers/extension_apps.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/apps/app_service/publishers/extension_apps.cc
+@@ -23,7 +23,7 @@ ExtensionApps::ExtensionApps(AppServiceP
+ ExtensionApps::~ExtensionApps() = default;
+
+ bool ExtensionApps::Accepts(const extensions::Extension* extension) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (extensions::IsExtensionUnsupportedDeprecatedApp(profile(),
+ extension->id())) {
+ return false;
diff --git a/chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc b/chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc
new file mode 100644
index 0000000000..965bbf14e5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc
@@ -0,0 +1,71 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/apps/platform_apps/platform_app_launch.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/apps/platform_apps/platform_app_launch.cc
+@@ -19,7 +19,7 @@
+ #include "extensions/common/constants.h"
+ #include "extensions/common/extension.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/browser.h"
+ #include "chrome/browser/ui/browser_navigator.h"
+ #include "chrome/browser/ui/browser_window.h"
+@@ -86,7 +86,7 @@ bool OpenExtensionApplicationWindow(Prof
+ if (launch_container == LaunchContainer::kLaunchContainerTab)
+ return false;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (OpenDeprecatedApplicationPrompt(profile, app_id)) {
+ return false;
+ }
+@@ -118,7 +118,7 @@ content::WebContents* OpenExtensionAppli
+ if (launch_container != apps::LaunchContainer::kLaunchContainerTab)
+ return nullptr;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (OpenDeprecatedApplicationPrompt(profile, app_id)) {
+ return nullptr;
+ }
+@@ -134,7 +134,7 @@ content::WebContents* OpenExtensionAppli
+ return app_tab;
+ }
+
+-#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))
+@@ -170,7 +170,7 @@ bool OpenExtensionApplicationWithReenabl
+ if (!GetPlatformApp(profile, app_id))
+ return false;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (OpenDeprecatedApplicationPrompt(profile, app_id)) {
+ return false;
+ }
+@@ -192,7 +192,7 @@ content::WebContents* OpenExtensionAppSh
+ ->enabled_extensions()
+ .GetAppByURL(url);
+ if (app) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (OpenDeprecatedApplicationPrompt(profile, app->id())) {
+ return nullptr;
+ }
+@@ -215,7 +215,7 @@ void RecordExtensionAppLaunchOnTabRestor
+ if (!extension)
+ return;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (OpenDeprecatedApplicationPrompt(profile, extension->id())) {
+ return;
+ }
diff --git a/chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.h b/chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.h
new file mode 100644
index 0000000000..364defaf15
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_apps_platform__apps_platform__app__launch.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/apps/platform_apps/platform_app_launch.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/apps/platform_apps/platform_app_launch.h
+@@ -38,7 +38,7 @@ bool OpenExtensionApplicationWindow(Prof
+ content::WebContents* OpenExtensionApplicationTab(Profile* profile,
+ const std::string& app_id);
+
+-#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/chromium-next/patches/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc b/chromium-next/patches/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc
new file mode 100644
index 0000000000..9e303b8642
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
+@@ -88,7 +88,7 @@ ChromeAutocompleteSchemeClassifier::GetI
+ return metrics::OmniboxInputType::QUERY;
+
+ case ExternalProtocolHandler::UNKNOWN: {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Linux impl of GetApplicationNameForScheme doesn't distinguish
+ // between URL schemes with handers and those without. This will
+ // make the default behaviour be search on Linux.
diff --git a/chromium-next/patches/patch-chrome_browser_background_background__mode__manager.cc b/chromium-next/patches/patch-chrome_browser_background_background__mode__manager.cc
new file mode 100644
index 0000000000..245d66cf44
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_background_background__mode__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/background/background_mode_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/background/background_mode_manager.cc
+@@ -872,7 +872,7 @@ gfx::ImageSkia GetStatusTrayIcon() {
+ return gfx::ImageSkia();
+
+ return family->CreateExact(size).AsImageSkia();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ IDR_PRODUCT_LOGO_128);
+ #elif BUILDFLAG(IS_MAC)
diff --git a/chromium-next/patches/patch-chrome_browser_background_background__mode__optimizer.cc b/chromium-next/patches/patch-chrome_browser_background_background__mode__optimizer.cc
new file mode 100644
index 0000000000..079c65cd4d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_background_background__mode__optimizer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/background/background_mode_optimizer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/background/background_mode_optimizer.cc
+@@ -31,7 +31,7 @@ std::unique_ptr<BackgroundModeOptimizer>
+ return nullptr;
+ }
+
+-#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)) {
+ // Private ctor.
+ return base::WrapUnique(new BackgroundModeOptimizer());
diff --git a/chromium-next/patches/patch-chrome_browser_browser__features.cc b/chromium-next/patches/patch-chrome_browser_browser__features.cc
new file mode 100644
index 0000000000..28ebd4b8a6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_browser__features.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/browser_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/browser_features.cc
+@@ -65,7 +65,7 @@ BASE_FEATURE(kCertVerificationNetworkTim
+ "CertVerificationNetworkTime",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enables usage of os_crypt_async::SecretPortalKeyProvider. Once
+ // `kSecretPortalKeyProviderUseForEncryption` is enabled, this flag cannot be
+ // disabled without losing data.
+@@ -81,7 +81,7 @@ BASE_FEATURE(kDbusSecretPortal,
+ BASE_FEATURE(kDestroyProfileOnBrowserClose,
+ "DestroyProfileOnBrowserClose",
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT);
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -248,7 +248,7 @@ BASE_FEATURE(kSandboxExternalProtocolBlo
+ "SandboxExternalProtocolBlockedWarning",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If true, encrypt new data with the key provided by SecretPortalKeyProvider.
+ // Otherwise, it will only decrypt existing data.
+ BASE_FEATURE(kSecretPortalKeyProviderUseForEncryption,
diff --git a/chromium-next/patches/patch-chrome_browser_browser__features.h b/chromium-next/patches/patch-chrome_browser_browser__features.h
new file mode 100644
index 0000000000..108848b329
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_browser__features.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/browser_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/browser_features.h
+@@ -37,7 +37,7 @@ BASE_DECLARE_FEATURE(kBookmarkTriggerFor
+ BASE_DECLARE_FEATURE(kCertificateTransparencyAskBeforeEnabling);
+ BASE_DECLARE_FEATURE(kCertVerificationNetworkTime);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kDbusSecretPortal);
+ #endif
+
+@@ -111,7 +111,7 @@ BASE_DECLARE_FEATURE(kRestartNetworkServ
+ BASE_DECLARE_FEATURE(kSandboxExternalProtocolBlocked);
+ BASE_DECLARE_FEATURE(kSandboxExternalProtocolBlockedWarning);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kSecretPortalKeyProviderUseForEncryption);
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_browser__process__impl.cc b/chromium-next/patches/patch-chrome_browser_browser__process__impl.cc
new file mode 100644
index 0000000000..5bddc79849
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_browser__process__impl.cc
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/browser_process_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/browser_process_impl.cc
+@@ -236,7 +236,7 @@
+ #include "chrome/browser/ui/profiles/profile_picker.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/error_reporting/chrome_js_error_report_processor.h" // nogncheck
+ #endif
+
+@@ -257,7 +257,7 @@
+ #include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/browser_features.h"
+ #include "components/os_crypt/async/browser/secret_portal_key_provider.h"
+ #endif
+@@ -1124,7 +1124,7 @@ void BrowserProcessImpl::RegisterPrefs(P
+ GoogleUpdateSettings::GetCollectStatsConsent());
+ registry->RegisterBooleanPref(prefs::kDevToolsRemoteDebuggingAllowed, true);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ os_crypt_async::SecretPortalKeyProvider::RegisterLocalPrefs(registry);
+ #endif
+ }
+@@ -1303,7 +1303,7 @@ void BrowserProcessImpl::PreMainMessageL
+
+ ApplyMetricsReportingPolicy();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ChromeJsErrorReportProcessor::Create();
+ #endif
+
+@@ -1393,7 +1393,7 @@ void BrowserProcessImpl::PreMainMessageL
+ features::kUseAppBoundEncryptionProviderForEncryption))));
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(features::kDbusSecretPortal)) {
+ providers.emplace_back(
+ /*precedence=*/10u,
+@@ -1643,7 +1643,7 @@ void BrowserProcessImpl::Unpin() {
+ // Mac is currently not supported.
+ // TODO(crbug.com/40118868): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+
+ bool BrowserProcessImpl::IsRunningInBackground() const {
+ // Check if browser is in the background.
diff --git a/chromium-next/patches/patch-chrome_browser_browser__process__impl.h b/chromium-next/patches/patch-chrome_browser_browser__process__impl.h
new file mode 100644
index 0000000000..6189d2c743
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_browser__process__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/browser_process_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/browser_process_impl.h
+@@ -405,7 +405,7 @@ class BrowserProcessImpl : public Browse
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ base::RepeatingTimer autoupdate_timer_;
+
+ // Gets called by autoupdate timer to see if browser needs restart and can be
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.cc
new file mode 100644
index 0000000000..a998aa4c36
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_field_trials.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_field_trials.cc
+@@ -49,7 +49,7 @@
+ #include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_trial.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/nix/xdg_util.h"
+ #include "ui/base/ui_base_features.h"
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -135,7 +135,7 @@ void ChromeBrowserFieldTrials::RegisterS
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Linux/Desktop platform variants, such as ozone/wayland, some features
+ // might need to be disabled as per OzonePlatform's runtime properties.
+ // OzonePlatform selection and initialization, in turn, depend on Chrome flags
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.h b/chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.h
new file mode 100644
index 0000000000..3be0ef0a67
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__field__trials.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_field_trials.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_field_trials.h
+@@ -33,7 +33,7 @@ class ChromeBrowserFieldTrials : public
+ const variations::EntropyProviders& entropy_providers,
+ base::FeatureList* feature_list) override;
+ void RegisterSyntheticTrials() override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void RegisterFeatureOverrides(base::FeatureList* feature_list) override;
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__interface__binders.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__interface__binders.cc
new file mode 100644
index 0000000000..09f7518a29
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__interface__binders.cc
@@ -0,0 +1,103 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_interface_binders.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_interface_binders.cc
+@@ -126,12 +126,12 @@
+ #endif // BUILDFLAG(FULL_SAFE_BROWSING)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/connectors_internals/connectors_internals.mojom.h"
+ #include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/app_settings/web_app_settings_ui.h"
+ #include "chrome/browser/ui/webui/on_device_translation_internals/on_device_translation_internals_ui.h"
+ #include "ui/webui/resources/cr_components/app_management/app_management.mojom.h"
+@@ -221,7 +221,7 @@
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/screen_ai/screen_ai_service_router.h"
+ #include "chrome/browser/screen_ai/screen_ai_service_router_factory.h"
+ #include "chrome/browser/ui/web_applications/sub_apps_service_impl.h"
+@@ -231,7 +231,7 @@
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS)
+
+-#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/webui/whats_new/whats_new_ui.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+@@ -735,7 +735,7 @@ void BindMediaFoundationPreferences(
+ #endif // BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ void BindScreenAIAnnotator(
+ content::RenderFrameHost* frame_host,
+ mojo::PendingReceiver<screen_ai::mojom::ScreenAIAnnotator> receiver) {
+@@ -873,7 +873,7 @@ void PopulateChromeFrameBinders(
+ #endif // BUILDFLAG(ENABLE_SPEECH_SERVICE)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(blink::features::kDesktopPWAsSubApps) &&
+ !render_frame_host->GetParentOrOuterDocument()) {
+ // The service binder will reject non-primary main frames, but we still need
+@@ -961,7 +961,7 @@ void PopulateChromeWebUIFrameBinders(
+ DataSharingInternalsUI>(map);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<
+ connectors_internals::mojom::PageHandler,
+ enterprise_connectors::ConnectorsInternalsUI>(map);
+@@ -972,7 +972,7 @@ void PopulateChromeWebUIFrameBinders(
+ policy::DlpInternalsUI>(map);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<
+ app_management::mojom::PageHandlerFactory, WebAppSettingsUI>(map);
+
+@@ -1065,14 +1065,14 @@ void PopulateChromeWebUIFrameBinders(
+ page_image_service::mojom::PageImageServiceHandler, HistoryUI,
+ HistoryClustersSidePanelUI, NewTabPageUI, BookmarksSidePanelUI>(map);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<whats_new::mojom::PageHandlerFactory,
+ WhatsNewUI>(map);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+ RegisterWebUIControllerInterfaceBinder<
+ browser_command::mojom::CommandHandlerFactory,
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ WhatsNewUI,
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+ NewTabPageUI>(map);
+@@ -1589,7 +1589,7 @@ void PopulateChromeWebUIFrameBinders(
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<discards::mojom::DetailsProvider,
+ DiscardsUI>(map);
+
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__main.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__main.cc
new file mode 100644
index 0000000000..ed25b8bbe1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__main.cc
@@ -0,0 +1,124 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_main.cc
+@@ -250,15 +250,15 @@
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/first_run/upgrade_util_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/nix/xdg_util.h"
+ #endif
+
+@@ -291,14 +291,14 @@
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h"
+ #include "chrome/browser/metrics/desktop_session_duration/touch_mode_stats_tracker.h"
+ #include "chrome/browser/profiles/profile_activity_metrics_recorder.h"
+ #include "ui/base/pointer/touch_ui_controller.h"
+ #endif
+
+-#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/headless/headless_mode_metrics.h" // nogncheck
+ #include "chrome/browser/headless/headless_mode_util.h" // nogncheck
+ #include "components/headless/select_file_dialog/headless_select_file_dialog.h"
+@@ -366,14 +366,14 @@
+ #endif // BUILDFLAG(IS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "sql/database.h"
+ #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
+
+ namespace {
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ constexpr base::FilePath::CharType kMediaHistoryDatabaseName[] =
+ FILE_PATH_LITERAL("Media History");
+
+@@ -538,7 +538,7 @@ void ProcessSingletonNotificationCallbac
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Set the global activation token sent as a command line switch by another
+ // browser process. This also removes the switch after use to prevent any side
+ // effects of leaving it in the command line after this point.
+@@ -1121,7 +1121,7 @@ int ChromeBrowserMainParts::PreCreateThr
+ browser_creator_->AddFirstRunTabs(master_prefs_->new_tabs);
+ }
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Create directory for user-level Native Messaging manifest files. This
+ // makes it less likely that the directory will be created by third-party
+ // software with incorrect owner or permission. See crbug.com/725513 .
+@@ -1169,7 +1169,7 @@ int ChromeBrowserMainParts::PreCreateThr
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ metrics::DesktopSessionDurationTracker::Initialize();
+ ProfileActivityMetricsRecorder::Initialize();
+ TouchModeStatsTracker::Initialize(
+@@ -1365,7 +1365,7 @@ void ChromeBrowserMainParts::PostProfile
+ #endif // BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Delete the media history database if it still exists.
+ // TODO(crbug.com/40177301): Remove this.
+ base::ThreadPool::PostTask(
+@@ -1414,7 +1414,7 @@ void ChromeBrowserMainParts::PostProfile
+ *UrlLanguageHistogramFactory::GetForBrowserContext(profile));
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (headless::IsHeadlessMode()) {
+ headless::ReportHeadlessActionMetrics();
+ }
+@@ -1523,7 +1523,7 @@ int ChromeBrowserMainParts::PreMainMessa
+ // In headless mode provide alternate SelectFileDialog factory overriding
+ // any platform specific SelectFileDialog implementation that may have been
+ // set.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (headless::IsHeadlessMode()) {
+ headless::HeadlessSelectFileDialogFactory::SetUp();
+ }
+@@ -2080,7 +2080,7 @@ bool ChromeBrowserMainParts::ProcessSing
+
+ // Drop the request if headless mode is in effect or the request is from
+ // a headless Chrome process.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (headless::IsHeadlessMode() ||
+ command_line.HasSwitch(switches::kHeadless)) {
+ return false;
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc
new file mode 100644
index 0000000000..7792bf9734
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_main_extra_parts_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_main_extra_parts_linux.cc
+@@ -58,7 +58,7 @@ void ChromeBrowserMainExtraPartsLinux::P
+
+ // static
+ void ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* const command_line = base::CommandLine::ForCurrentProcess();
+ auto env = base::Environment::Create();
+ std::string desktop_startup_id;
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__ozone.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__ozone.cc
new file mode 100644
index 0000000000..bc3cd36ddd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__extra__parts__ozone.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_main_extra_parts_ozone.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_main_extra_parts_ozone.cc
+@@ -27,7 +27,7 @@ void ChromeBrowserMainExtraPartsOzone::P
+ }
+
+ void ChromeBrowserMainExtraPartsOzone::PostMainMessageLoopRun() {
+-#if !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // Lacros's `PostMainMessageLoopRun` must be called at the very end of
+ // `PostMainMessageLoopRun` in
+ // `ChromeBrowserMainPartsLacros::PostMainMessageLoopRun`.
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.cc
new file mode 100644
index 0000000000..c32607b130
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.cc
@@ -0,0 +1,45 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_main_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_main_linux.cc
+@@ -25,7 +25,7 @@
+ #include "device/bluetooth/dbus/bluez_dbus_thread_manager.h"
+ #include "ui/base/l10n/l10n_util.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif
+
+@@ -72,7 +72,9 @@ void ChromeBrowserMainPartsLinux::PostCr
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+ #if !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_BSD)
+ bluez::BluezDBusManager::Initialize(nullptr /* system_bus */);
++#endif
+
+ // Set up crypt config. This needs to be done before anything starts the
+ // network service, as the raw encryption key needs to be shared with the
+@@ -98,7 +100,7 @@ void ChromeBrowserMainPartsLinux::PostCr
+ ChromeBrowserMainPartsPosix::PostCreateMainMessageLoop();
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() {
+ ChromeBrowserMainPartsPosix::PostMainMessageLoopRun();
+ ui::OzonePlatform::GetInstance()->PostMainMessageLoopRun();
+@@ -136,7 +138,7 @@ void ChromeBrowserMainPartsLinux::PostBr
+ #endif // (defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS))
+
+ void ChromeBrowserMainPartsLinux::PostDestroyThreads() {
+-#if BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // No-op; per PostBrowserStart() comment, this is done elsewhere.
+ #else
+ bluez::BluezDBusManager::Shutdown();
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.h b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.h
new file mode 100644
index 0000000000..f515337c3b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__linux.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_main_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_main_linux.h
+@@ -30,7 +30,7 @@ class ChromeBrowserMainPartsLinux : publ
+
+ // ChromeBrowserMainPartsPosix overrides.
+ void PostCreateMainMessageLoop() override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void PostMainMessageLoopRun() override;
+ #endif
+ void PreProfileInit() override;
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__browser__main__posix.cc b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__posix.cc
new file mode 100644
index 0000000000..e698a094f3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__browser__main__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_browser_main_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_browser_main_posix.cc
+@@ -79,7 +79,7 @@ void ExitHandler::ExitWhenPossibleOnUITh
+ } else {
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ switch (signal) {
+ case SIGINT:
+ case SIGHUP:
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.cc b/chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.cc
new file mode 100644
index 0000000000..4c9787cc37
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.cc
@@ -0,0 +1,177 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_content_browser_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_content_browser_client.cc
+@@ -496,7 +496,7 @@
+ #include "storage/browser/file_system/external_mount_points.h"
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/chrome_browser_main_linux.h"
+ #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
+ #elif BUILDFLAG(IS_ANDROID)
+@@ -613,12 +613,12 @@
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ #include "chrome/browser/browser_switcher/browser_switcher_navigation_throttle.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/crash/core/app/crash_switches.h"
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+@@ -629,7 +629,7 @@
+ #include "chrome/browser/apps/link_capturing/web_app_link_capturing_delegate.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/chrome_browser_main_extra_parts_enterprise.h"
+ #include "chrome/browser/enterprise/profile_management/oidc_auth_response_capture_navigation_throttle.h"
+ #include "chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.h"
+@@ -638,7 +638,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -651,7 +651,7 @@
+ #include "chrome/browser/ui/views/lens/lens_side_panel_navigation_helper.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/chrome_browser_main_extra_parts_linux.h"
+ #elif BUILDFLAG(IS_OZONE)
+ #include "chrome/browser/chrome_browser_main_extra_parts_ozone.h"
+@@ -1570,7 +1570,7 @@ void ChromeContentBrowserClient::Registe
+ registry->RegisterBooleanPref(prefs::kDeviceNativeClientForceAllowedCache,
+ false);
+ #endif // BUILDFLAG(IS_CHROMEOS)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kOutOfProcessSystemDnsResolutionEnabled,
+ true);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
+@@ -1778,7 +1778,7 @@ ChromeContentBrowserClient::CreateBrowse
+ #elif BUILDFLAG(IS_CHROMEOS_LACROS)
+ main_parts = std::make_unique<ChromeBrowserMainPartsLacros>(
+ is_integration_test, &startup_data_);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ main_parts = std::make_unique<ChromeBrowserMainPartsLinux>(
+ is_integration_test, &startup_data_);
+ #elif BUILDFLAG(IS_ANDROID)
+@@ -1812,7 +1812,7 @@ ChromeContentBrowserClient::CreateBrowse
+ std::make_unique<ChromeBrowserMainExtraPartsViewsLacros>());
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ main_parts->AddParts(
+ std::make_unique<ChromeBrowserMainExtraPartsViewsLinux>());
+ #else
+@@ -1833,7 +1833,7 @@ ChromeContentBrowserClient::CreateBrowse
+ main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsLacros>());
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsLinux>());
+ #elif BUILDFLAG(IS_OZONE)
+ main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsOzone>());
+@@ -1852,7 +1852,7 @@ ChromeContentBrowserClient::CreateBrowse
+
+ chrome::AddMetricsExtraParts(main_parts.get());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ main_parts->AddParts(
+ std::make_unique<
+ enterprise_util::ChromeBrowserMainExtraPartsEnterprise>());
+@@ -2729,7 +2729,9 @@ void MaybeAppendBlinkSettingsSwitchForFi
+ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
+ base::CommandLine* command_line,
+ int child_process_id) {
++#ifdef notyet
+ crash_keys::AppendStringAnnotationsCommandLineSwitch(command_line);
++#endif
+ #if BUILDFLAG(IS_MAC)
+ std::unique_ptr<metrics::ClientInfo> client_info =
+ GoogleUpdateSettings::LoadMetricsClientInfo();
+@@ -2738,7 +2740,7 @@ void ChromeContentBrowserClient::AppendE
+ client_info->client_id);
+ }
+ #elif BUILDFLAG(IS_POSIX)
+-#if !BUILDFLAG(IS_ANDROID)
++#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD)
+ pid_t pid;
+ if (crash_reporter::GetHandlerSocket(nullptr, &pid)) {
+ command_line->AppendSwitchASCII(
+@@ -3099,7 +3101,7 @@ void ChromeContentBrowserClient::AppendE
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && !BUILDFLAG(IS_BSD)
+ // Opt into a hardened stack canary mitigation if it hasn't already been
+ // force-disabled.
+ if (!browser_command_line.HasSwitch(switches::kChangeStackGuardOnFork)) {
+@@ -4974,7 +4976,7 @@ void ChromeContentBrowserClient::GetAddi
+ }
+ }
+
+-#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,
+@@ -5536,7 +5538,7 @@ ChromeContentBrowserClient::CreateThrott
+ &throttles);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ MaybeAddThrottle(
+ WebAppSettingsNavigationThrottle::MaybeCreateThrottleFor(handle),
+ &throttles);
+@@ -5553,7 +5555,7 @@ ChromeContentBrowserClient::CreateThrott
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ MaybeAddThrottle(enterprise_connectors::DeviceTrustNavigationThrottle::
+ MaybeCreateThrottleFor(handle),
+ &throttles);
+@@ -5592,7 +5594,7 @@ ChromeContentBrowserClient::CreateThrott
+ handle));
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle::
+ MaybeCreateThrottleFor(handle),
+ &throttles);
+@@ -7548,7 +7550,7 @@ bool ChromeContentBrowserClient::ShouldS
+ bool ChromeContentBrowserClient::ShouldRunOutOfProcessSystemDnsResolution() {
+ // This enterprise policy is supported on Android, but the feature will not be
+ // launched there.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // This is possibly called before `g_browser_process` is initialized.
+ PrefService* local_state;
+ if (g_browser_process) {
diff --git a/chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.h b/chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.h
new file mode 100644
index 0000000000..7e06dc42b9
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_chrome__content__browser__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/chrome_content_browser_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/chrome_content_browser_client.h
+@@ -538,7 +538,7 @@ class ChromeContentBrowserClient : publi
+ bool IsPluginAllowedToUseDevChannelAPIs(
+ content::BrowserContext* browser_context,
+ const GURL& url) override;
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ void GetAdditionalMappedFilesForChildProcess(
+ const base::CommandLine& command_line,
+ int child_process_id,
diff --git a/chromium-next/patches/patch-chrome_browser_component__updater_widevine__cdm__component__installer.cc b/chromium-next/patches/patch-chrome_browser_component__updater_widevine__cdm__component__installer.cc
new file mode 100644
index 0000000000..a316b029ed
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_component__updater_widevine__cdm__component__installer.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/component_updater/widevine_cdm_component_installer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/component_updater/widevine_cdm_component_installer.cc
+@@ -41,7 +41,7 @@
+ #include "third_party/widevine/cdm/buildflags.h"
+ #include "third_party/widevine/cdm/widevine_cdm_common.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/path_service.h"
+ #include "chrome/common/chrome_paths.h"
+ #include "chrome/common/media/component_widevine_cdm_hint_file_linux.h"
+@@ -74,7 +74,7 @@ static_assert(std::size(kWidevineSha2Has
+ const char ImageLoaderComponentName[] = "WidevineCdm";
+ #endif
+
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // On Linux and ChromeOS the Widevine CDM is loaded at startup before the
+ // zygote is locked down. As a result there is no need to register the CDM
+ // with Chrome as it can't be used until Chrome is restarted.
+@@ -102,7 +102,7 @@ void RegisterWidevineCdmWithChrome(const
+ }
+ #endif // !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux and ChromeOS the Widevine CDM is loaded at startup before the
+ // zygote is locked down. To locate the Widevine CDM at startup, a hint file
+ // is used. Update the hint file with the new Widevine CDM path.
+@@ -398,7 +398,7 @@ void WidevineCdmComponentInstallerPolicy
+ return;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ VLOG(1) << "Updating hint file with Widevine CDM " << cdm_version;
+
+ // This is running on a thread that allows IO, so simply update the hint file.
diff --git a/chromium-next/patches/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc b/chromium-next/patches/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc
new file mode 100644
index 0000000000..310428db0c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc
+@@ -68,7 +68,7 @@ void ChromeProtocolHandlerRegistryDelega
+ // If true default protocol handlers will be removed if the OS level
+ // registration for a protocol is no longer Chrome.
+ bool ChromeProtocolHandlerRegistryDelegate::ShouldRemoveHandlersNotInOS() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // We don't do this on Linux as the OS registration there is not reliable,
+ // and Chrome OS doesn't have any notion of OS registration.
+ // TODO(benwells): When Linux support is more reliable remove this
diff --git a/chromium-next/patches/patch-chrome_browser_defaults.cc b/chromium-next/patches/patch-chrome_browser_defaults.cc
new file mode 100644
index 0000000000..45e051ef59
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_defaults.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/defaults.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/defaults.cc
+@@ -44,7 +44,7 @@ const bool kShowHelpMenuItemIcon = true;
+ const bool kShowHelpMenuItemIcon = false;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const bool kScrollEventChangesTab = true;
+ #else
+ const bool kScrollEventChangesTab = false;
diff --git a/chromium-next/patches/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc b/chromium-next/patches/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc
new file mode 100644
index 0000000000..3776c81d3f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/device_identity/device_oauth2_token_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/device_identity/device_oauth2_token_service_factory.cc
+@@ -28,7 +28,7 @@ std::unique_ptr<DeviceOAuth2TokenStore>
+ return std::make_unique<chromeos::DeviceOAuth2TokenStoreChromeOS>(
+ local_state);
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ return std::make_unique<DeviceOAuth2TokenStoreDesktop>(local_state);
+ #else
+ NOTREACHED();
diff --git a/chromium-next/patches/patch-chrome_browser_diagnostics_diagnostics__writer.h b/chromium-next/patches/patch-chrome_browser_diagnostics_diagnostics__writer.h
new file mode 100644
index 0000000000..588ecb3f4c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_diagnostics_diagnostics__writer.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/diagnostics/diagnostics_writer.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/diagnostics/diagnostics_writer.h
+@@ -14,6 +14,8 @@ namespace diagnostics {
+ // Console base class used internally.
+ class SimpleConsole;
+
++#undef MACHINE
++
+ class DiagnosticsWriter : public DiagnosticsModel::Observer {
+ public:
+ // The type of formatting done by this writer.
diff --git a/chromium-next/patches/patch-chrome_browser_download_chrome__download__manager__delegate.cc b/chromium-next/patches/patch-chrome_browser_download_chrome__download__manager__delegate.cc
new file mode 100644
index 0000000000..11cf611476
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_chrome__download__manager__delegate.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/chrome_download_manager_delegate.cc
+@@ -1844,7 +1844,7 @@ void ChromeDownloadManagerDelegate::OnDo
+ bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferredForFile(
+ const base::FilePath& path) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) {
+ return !download_prefs_->ShouldOpenPdfInSystemReader();
+ }
+@@ -1987,7 +1987,7 @@ void ChromeDownloadManagerDelegate::Chec
+ content::CheckDownloadAllowedCallback check_download_allowed_cb) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Don't download pdf if it is a file URL, as that might cause an infinite
+ // download loop if Chrome is not the system pdf viewer.
+ if (url.SchemeIsFile() && download_prefs_->ShouldOpenPdfInSystemReader()) {
+@@ -2069,7 +2069,7 @@ void ChromeDownloadManagerDelegate::Chec
+ DCHECK(download_item->IsSavePackageDownload());
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::optional<enterprise_connectors::AnalysisSettings> settings =
+ safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item);
+
diff --git a/chromium-next/patches/patch-chrome_browser_download_download__commands.cc b/chromium-next/patches/patch-chrome_browser_download_download__commands.cc
new file mode 100644
index 0000000000..0f2a3a22e3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_download__commands.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/download_commands.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/download_commands.cc
+@@ -26,7 +26,7 @@
+ #include "ui/base/clipboard/scoped_clipboard_writer.h"
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || 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"
+@@ -165,7 +165,7 @@ void DownloadCommands::ExecuteCommand(Co
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ Browser* DownloadCommands::GetBrowser() const {
+ if (!model_)
diff --git a/chromium-next/patches/patch-chrome_browser_download_download__commands.h b/chromium-next/patches/patch-chrome_browser_download_download__commands.h
new file mode 100644
index 0000000000..d263c0faab
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_download__commands.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/download_commands.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/download_commands.h
+@@ -66,7 +66,7 @@ class DownloadCommands {
+ void ExecuteCommand(Command command);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ bool IsDownloadPdf() const;
+ bool CanOpenPdfInSystemViewer() const;
+ Browser* GetBrowser() const;
diff --git a/chromium-next/patches/patch-chrome_browser_download_download__file__picker.cc b/chromium-next/patches/patch-chrome_browser_download_download__file__picker.cc
new file mode 100644
index 0000000000..acf7a6cb4e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_download__file__picker.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/download_file_picker.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/download_file_picker.cc
+@@ -18,7 +18,7 @@
+ #include "content/public/browser/web_contents.h"
+ #include "ui/shell_dialogs/selected_file_info.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/browser_list.h"
+ #include "chrome/browser/ui/browser_window.h"
+ #include "ui/aura/window.h"
+@@ -83,7 +83,7 @@ DownloadFilePicker::DownloadFilePicker(d
+ // dialog in Linux (See SelectFileImpl() in select_file_dialog_linux_gtk.cc).
+ // and windows.Here we make owning_window host to browser current active
+ // window if it is null. https://crbug.com/1301898
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (!owning_window || !owning_window->GetHost()) {
+ owning_window = BrowserList::GetInstance()
+ ->GetLastActive()
diff --git a/chromium-next/patches/patch-chrome_browser_download_download__item__model.cc b/chromium-next/patches/patch-chrome_browser_download_download__item__model.cc
new file mode 100644
index 0000000000..3d1145b99d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_download__item__model.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/download_item_model.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/download_item_model.cc
+@@ -756,7 +756,7 @@ bool DownloadItemModel::IsCommandChecked
+ download_crx_util::IsExtensionDownload(*download_);
+ case DownloadCommands::ALWAYS_OPEN_TYPE:
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (download_commands->CanOpenPdfInSystemViewer()) {
+ DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile());
+ return prefs->ShouldOpenPdfInSystemReader();
+@@ -804,7 +804,7 @@ void DownloadItemModel::ExecuteCommand(D
+ DownloadCommands::ALWAYS_OPEN_TYPE);
+ DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile());
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (download_commands->CanOpenPdfInSystemViewer()) {
+ prefs->SetShouldOpenPdfInSystemReader(!is_checked);
+ SetShouldPreferOpeningInBrowser(is_checked);
+@@ -1190,7 +1190,7 @@ void DownloadItemModel::DetermineAndSetS
+ return;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (download_->GetOriginalMimeType() == "application/x-x509-user-cert") {
+ SetShouldPreferOpeningInBrowser(true);
+ return;
diff --git a/chromium-next/patches/patch-chrome_browser_download_download__prefs.cc b/chromium-next/patches/patch-chrome_browser_download_download__prefs.cc
new file mode 100644
index 0000000000..ef4e805151
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_download__prefs.cc
@@ -0,0 +1,96 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/download_prefs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/download_prefs.cc
+@@ -11,6 +11,7 @@
+ #include <vector>
+
+ #include "base/check.h"
++#include "base/command_line.h"
+ #include "base/feature_list.h"
+ #include "base/files/file_util.h"
+ #include "base/functional/bind.h"
+@@ -60,6 +61,10 @@
+ #include "chrome/browser/flags/android/chrome_feature_list.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#endif
++
+ using content::BrowserContext;
+ using content::BrowserThread;
+ using content::DownloadManager;
+@@ -70,7 +75,7 @@ namespace {
+ // Consider downloads 'dangerous' if they go to the home directory on Linux and
+ // to the desktop on any platform.
+ bool DownloadPathIsDangerous(const base::FilePath& download_path) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FilePath home_dir = base::GetHomeDir();
+ if (download_path == home_dir) {
+ return true;
+@@ -176,7 +181,7 @@ DownloadPrefs::DownloadPrefs(Profile* pr
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ should_open_pdf_in_system_reader_ =
+ prefs->GetBoolean(prefs::kOpenPdfDownloadInSystemReader);
+ #endif
+@@ -301,7 +306,7 @@ void DownloadPrefs::RegisterProfilePrefs
+ registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory,
+ default_download_path);
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kOpenPdfDownloadInSystemReader, false);
+ #endif
+ #if BUILDFLAG(IS_ANDROID)
+@@ -468,7 +473,7 @@ void DownloadPrefs::DisableAutoOpenByUse
+ }
+
+ #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;
+@@ -494,7 +499,7 @@ bool DownloadPrefs::ShouldOpenPdfInSyste
+
+ void DownloadPrefs::ResetAutoOpenByUser() {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ SetShouldOpenPdfInSystemReader(false);
+ #endif
+ auto_open_by_user_.clear();
+@@ -531,7 +536,7 @@ void DownloadPrefs::SaveAutoOpenState()
+ bool DownloadPrefs::CanPlatformEnableAutoOpenForPdf() const {
+ #if BUILDFLAG(IS_CHROMEOS)
+ return false; // There is no UI for auto-open on ChromeOS.
+-#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return ShouldOpenPdfInSystemReader();
+ #else
+ return false;
+@@ -683,7 +688,14 @@ base::FilePath DownloadPrefs::SanitizeDo
+ #else
+ // If the stored download directory is an absolute path, we presume it's
+ // correct; there's not really much more validation we can do here.
++#if BUILDFLAG(IS_OPENBSD)
++ // If unveil(2) is used, force the file dialog directory to something we
++ // know is available.
++ auto* sandbox = sandbox::policy::SandboxLinux::GetInstance();
++ if (!sandbox->unveil_initialized() && path.IsAbsolute())
++#else
+ if (path.IsAbsolute())
++#endif
+ return path;
+
+ // When the default download directory is *not* an absolute path, we use the
diff --git a/chromium-next/patches/patch-chrome_browser_download_download__prefs.h b/chromium-next/patches/patch-chrome_browser_download_download__prefs.h
new file mode 100644
index 0000000000..10b7355a63
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_download_download__prefs.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/download/download_prefs.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/download/download_prefs.h
+@@ -107,7 +107,7 @@ class DownloadPrefs {
+ void DisableAutoOpenByUserBasedOnExtension(const base::FilePath& file_name);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Store the user preference to disk. If |should_open| is true, also disable
+ // the built-in PDF plugin. If |should_open| is false, enable the PDF plugin.
+ void SetShouldOpenPdfInSystemReader(bool should_open);
+@@ -171,7 +171,7 @@ class DownloadPrefs {
+ std::unique_ptr<policy::URLBlocklist> auto_open_allowed_by_urls_;
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ bool should_open_pdf_in_system_reader_;
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_analysis_analysis__service__settings.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_analysis_analysis__service__settings.cc
new file mode 100644
index 0000000000..1ea9d03440
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_analysis_analysis__service__settings.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/analysis/analysis_service_settings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/analysis/analysis_service_settings.cc
+@@ -150,7 +150,7 @@ AnalysisServiceSettings::AnalysisService
+ const char* verification_key = kKeyWindowsVerification;
+ #elif BUILDFLAG(IS_MAC)
+ const char* verification_key = kKeyMacVerification;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char* verification_key = kKeyLinuxVerification;
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_common.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_common.cc
new file mode 100644
index 0000000000..36d8c82f3a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_common.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/common.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/common.cc
+@@ -23,7 +23,7 @@
+ #include "components/policy/core/common/policy_loader_lacros.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/signin/enterprise_signin_prefs.h"
+ #include "components/prefs/pref_service.h"
+ #endif
+@@ -266,7 +266,7 @@ std::string GetProfileEmail(Profile* pro
+ std::string email =
+ GetProfileEmail(IdentityManagerFactory::GetForProfile(profile));
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (email.empty()) {
+ email = profile->GetPrefs()->GetString(
+ enterprise_signin::prefs::kProfileUserEmail);
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_connectors__service.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_connectors__service.cc
new file mode 100644
index 0000000000..39b667c01a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_connectors__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/connectors_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/connectors_service.cc
+@@ -509,7 +509,7 @@ bool ConnectorsService::ConnectorsEnable
+
+ Profile* profile = Profile::FromBrowserContext(context_);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On desktop, the guest profile is actually the primary OTR profile of
+ // the "regular" guest profile. The regular guest profile is never used
+ // directly by users. Also, user are not able to create child OTR profiles
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc
new file mode 100644
index 0000000000..bd9a88eaec
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc
+@@ -10,7 +10,7 @@
+ #include "chrome/browser/profiles/profile.h"
+ #include "components/keyed_service/core/keyed_service.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/browser/signing_key_policy_observer.h"
+ #include "chrome/browser/policy/chrome_browser_policy_connector.h"
+@@ -40,7 +40,7 @@ DeviceTrustConnectorService* DeviceTrust
+
+ bool DeviceTrustConnectorServiceFactory::ServiceIsCreatedWithBrowserContext()
+ const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
+@@ -84,7 +84,7 @@ DeviceTrustConnectorServiceFactory::Buil
+ std::unique_ptr<DeviceTrustConnectorService> service =
+ std::make_unique<DeviceTrustConnectorService>(profile->GetPrefs());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ auto* key_manager = g_browser_process->browser_policy_connector()
+ ->chrome_browser_cloud_management_controller()
+ ->GetDeviceTrustKeyManager();
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc
new file mode 100644
index 0000000000..2216c95807
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc
+@@ -23,7 +23,7 @@
+ #include "components/policy/core/common/management/management_service.h"
+ #include "content/public/browser/browser_context.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/attestation/browser/browser_attestation_service.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/attestation/browser/device_attester.h"
+@@ -54,7 +54,7 @@ bool IsProfileManaged(Profile* profile)
+ return management_service && management_service->IsManaged();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ policy::CloudPolicyStore* GetUserCloudPolicyStore(Profile* profile) {
+ policy::CloudPolicyManager* user_policy_manager =
+ profile->GetCloudPolicyManager();
+@@ -106,7 +106,7 @@ DeviceTrustServiceFactory::DeviceTrustSe
+ DependsOn(DeviceTrustConnectorServiceFactory::GetInstance());
+ DependsOn(policy::ManagementServiceFactory::GetInstance());
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Depends on this service via the SignalsService having a dependency on it.
+ DependsOn(enterprise_signals::SignalsAggregatorFactory::GetInstance());
+ // Depends on this service via the ProfileAttester having a dependency on it
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc
new file mode 100644
index 0000000000..6cffc9ea3d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_browser_commands_key__rotation__command__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/key_rotation_command_factory.cc
+@@ -19,7 +19,7 @@
+
+ #if BUILDFLAG(IS_WIN)
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/win_key_rotation_command.h"
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/linux_key_rotation_command.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/commands/mac_key_rotation_command.h"
+@@ -53,7 +53,7 @@ std::unique_ptr<KeyRotationCommand> KeyR
+ policy::DeviceManagementService* device_management_service) {
+ #if BUILDFLAG(IS_WIN)
+ return std::make_unique<WinKeyRotationCommand>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return std::make_unique<LinuxKeyRotationCommand>(url_loader_factory);
+ #elif BUILDFLAG(IS_MAC)
+ if (IsDTCKeyRotationUploadedBySharedAPI()) {
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc
new file mode 100644
index 0000000000..4dfb9357ab
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/key_persistence_delegate_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ 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 BUILDFLAG(IS_MAC)
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/mac_key_persistence_delegate.h"
+-#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
+
+@@ -45,7 +45,7 @@ KeyPersistenceDelegateFactory::CreateKey
+ return std::make_unique<WinKeyPersistenceDelegate>();
+ #elif BUILDFLAG(IS_MAC)
+ return std::make_unique<MacKeyPersistenceDelegate>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return std::make_unique<LinuxKeyPersistenceDelegate>();
+ #else
+ NOTREACHED();
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc
new file mode 100644
index 0000000000..27372add0f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc
+@@ -21,7 +21,7 @@
+ #include "chrome/browser/profiles/profile.h"
+ #include "components/policy/core/common/management/management_service.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "base/check.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h"
+ #include "chrome/browser/enterprise/core/dependency_factory_impl.h"
+@@ -58,7 +58,7 @@ std::unique_ptr<SignalsService> CreateSi
+ enterprise_signals::ContextInfoFetcher::CreateInstance(
+ profile, ConnectorsServiceFactory::GetForBrowserContext(profile))));
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+
+ policy::CloudPolicyManager* browser_policy_manager = nullptr;
+ if (management_service->HasManagementAuthority(
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_browser__crash__event__router.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_browser__crash__event__router.cc
new file mode 100644
index 0000000000..6c29ea35da
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_browser__crash__event__router.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/reporting/browser_crash_event_router.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/reporting/browser_crash_event_router.cc
+@@ -13,7 +13,7 @@ namespace enterprise_connectors {
+
+ BrowserCrashEventRouter::BrowserCrashEventRouter(
+ content::BrowserContext* context) {
+-#if !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ CrashReportingContext* crash_reporting_context =
+ CrashReportingContext::GetInstance();
+ Profile* profile = Profile::FromBrowserContext(context);
+@@ -23,7 +23,7 @@ BrowserCrashEventRouter::BrowserCrashEve
+ }
+
+ BrowserCrashEventRouter::~BrowserCrashEventRouter() {
+-#if !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ CrashReportingContext* crash_reporting_context =
+ CrashReportingContext::GetInstance();
+ crash_reporting_context->RemoveProfile(this);
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.cc
new file mode 100644
index 0000000000..b97cd81331
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_crash__reporting__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc
+@@ -20,7 +20,7 @@
+
+ namespace enterprise_connectors {
+
+-#if !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+
+ namespace {
+
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.cc b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.cc
new file mode 100644
index 0000000000..7f062a0b4a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc
+@@ -58,7 +58,7 @@
+ #include "base/strings/utf_string_conversions.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/signals/signals_aggregator_factory.h"
+ #include "chrome/browser/enterprise/signin/enterprise_signin_prefs.h"
+ #include "components/device_signals/core/browser/signals_aggregator.h"
+@@ -181,7 +181,7 @@ void RealtimeReportingClient::ReportPast
+ /*include_profile_user_name=*/false);
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ void AddCrowdstrikeSignalsToEvent(
+ base::Value::Dict& event,
+@@ -217,7 +217,7 @@ std::string RealtimeReportingClient::Get
+ username_ =
+ identity_manager_ ? GetProfileEmail(identity_manager_) : std::string();
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (username_.empty()) {
+ username_ = Profile::FromBrowserContext(context_)->GetPrefs()->GetString(
+ enterprise_signin::prefs::kProfileUserEmail);
+@@ -275,7 +275,7 @@ std::string RealtimeReportingClient::Get
+ return client_id;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(notyet)
+ void RealtimeReportingClient::MaybeCollectDeviceSignalsAndReportEvent(
+ base::Value::Dict event,
+ policy::CloudPolicyClient* client,
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.h b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.h
new file mode 100644
index 0000000000..6c03951296
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_connectors_reporting_realtime__reporting__client.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.h
+@@ -18,7 +18,7 @@
+ #include "components/keyed_service/core/keyed_service.h"
+ #include "components/policy/core/common/cloud/cloud_policy_client.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "components/device_signals/core/browser/signals_types.h"
+ #endif
+
+@@ -112,7 +112,7 @@ class RealtimeReportingClient : public R
+ const std::string& dm_token) override;
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(notyet)
+ void MaybeCollectDeviceSignalsAndReportEvent(
+ base::Value::Dict event,
+ policy::CloudPolicyClient* client,
+@@ -151,7 +151,7 @@ class RealtimeReportingClient : public R
+ base::WeakPtrFactory<RealtimeReportingClient> weak_ptr_factory_{this};
+ };
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Populate event dict with CrowdStrike signal values. If those signals are
+ // available in `response`, this function returns a Dict with the following
+ // fields added:
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_identifiers_profile__id__delegate__impl.cc b/chromium-next/patches/patch-chrome_browser_enterprise_identifiers_profile__id__delegate__impl.cc
new file mode 100644
index 0000000000..7dbe6cb8c5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_identifiers_profile__id__delegate__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/identifiers/profile_id_delegate_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/identifiers/profile_id_delegate_impl.cc
+@@ -13,7 +13,7 @@
+ #include "components/enterprise/browser/identifiers/identifiers_prefs.h"
+ #include "components/prefs/pref_service.h"
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "components/enterprise/browser/controller/browser_dm_token_storage.h"
+ #if BUILDFLAG(IS_WIN)
+ #include "base/strings/utf_string_conversions.h"
+@@ -94,7 +94,7 @@ std::string ProfileIdDelegateImpl::GetDe
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Gets the device ID from the BrowserDMTokenStorage.
+ std::string ProfileIdDelegateImpl::GetId() {
+ std::string device_id =
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_profile__management_profile__management__navigation__throttle.cc b/chromium-next/patches/patch-chrome_browser_enterprise_profile__management_profile__management__navigation__throttle.cc
new file mode 100644
index 0000000000..afe6cbecd7
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_profile__management_profile__management__navigation__throttle.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc
+@@ -67,8 +67,8 @@ base::flat_map<std::string, SAMLProfileA
+ // TODO(crbug.com/40267996): Add actual domains with attribute names.
+ profile_attributes->insert(std::make_pair(
+ "supported.test",
+- SAMLProfileAttributes("placeholderName", "placeholderDomain",
+- "placeholderToken")));
++ SAMLProfileAttributes(SAMLProfileAttributes{"placeholderName", "placeholderDomain",
++ "placeholderToken"})));
+
+ // Extract domains and attributes from the command line switch.
+ const base::CommandLine& command_line =
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc b/chromium-next/patches/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc
new file mode 100644
index 0000000000..c0607fe331
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/remote_commands/cbcm_remote_commands_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ 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/remote_commands/rotate_attestation_credential_job.h"
+ #include "chrome/browser/policy/chrome_browser_policy_connector.h"
+ #include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h"
+@@ -30,7 +30,7 @@ CBCMRemoteCommandsFactory::BuildJobForTy
+ 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 (type == enterprise_management::
+ RemoteCommand_Type_BROWSER_ROTATE_ATTESTATION_CREDENTIAL) {
+ return std::make_unique<RotateAttestationCredentialJob>(
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc b/chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc
new file mode 100644
index 0000000000..d6fa74197d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/signals/device_info_fetcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/signals/device_info_fetcher.cc
+@@ -10,7 +10,7 @@
+ #include "chrome/browser/enterprise/signals/device_info_fetcher_mac.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "chrome/browser/enterprise/signals/device_info_fetcher_win.h"
+-#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
+
+@@ -67,7 +67,7 @@ std::unique_ptr<DeviceInfoFetcher> Devic
+ return CreateInstanceInternal();
+ }
+
+-#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && \
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD) && \
+ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
+ // static
+ std::unique_ptr<DeviceInfoFetcher> DeviceInfoFetcher::CreateInstanceInternal() {
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher__linux.cc b/chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher__linux.cc
new file mode 100644
index 0000000000..2ac3d015d5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_signals_device__info__fetcher__linux.cc
@@ -0,0 +1,83 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/signals/device_info_fetcher_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/signals/device_info_fetcher_linux.cc
+@@ -4,11 +4,22 @@
+
+ #include "chrome/browser/enterprise/signals/device_info_fetcher_linux.h"
+
++#include "build/build_config.h"
++
+ #if defined(USE_GIO)
+ #include <gio/gio.h>
+ #endif // defined(USE_GIO)
+ #include <sys/stat.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/sysmacros.h>
++#endif
++
++#if BUILDFLAG(IS_BSD)
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <ifaddrs.h>
++#include <net/if_dl.h>
++#endif
+
+ #include <string>
+
+@@ -117,6 +128,7 @@ SettingValue GetScreenlockSecured() {
+ // Implements the logic from the native host installation script. First find the
+ // root device identifier, then locate its parent and get its type.
+ SettingValue GetDiskEncrypted() {
++#if !BUILDFLAG(IS_BSD)
+ struct stat info;
+ // First figure out the device identifier. Fail fast if this fails.
+ if (stat("/", &info) != 0)
+@@ -138,11 +150,35 @@ SettingValue GetDiskEncrypted() {
+ }
+ return SettingValue::UNKNOWN;
+ }
++#endif
+ return SettingValue::DISABLED;
+ }
+
+ std::vector<std::string> GetMacAddresses() {
+ std::vector<std::string> result;
++#if BUILDFLAG(IS_BSD)
++ struct ifaddrs* ifa = nullptr;
++
++ if (getifaddrs(&ifa) != 0)
++ return result;
++
++ struct ifaddrs* interface = ifa;
++ for (; interface != nullptr; interface = interface->ifa_next) {
++ if (interface->ifa_addr == nullptr ||
++ interface->ifa_addr->sa_family != AF_LINK) {
++ continue;
++ }
++ struct sockaddr_dl* sdl =
++ reinterpret_cast<struct sockaddr_dl*>(interface->ifa_addr);
++ if (!sdl || sdl->sdl_alen != 6)
++ continue;
++ char* link_address = static_cast<char*>(LLADDR(sdl));
++ result.push_back(base::StringPrintf(
++ "%02x:%02x:%02x:%02x:%02x:%02x", link_address[0] & 0xff,
++ link_address[1] & 0xff, link_address[2] & 0xff, link_address[3] & 0xff,
++ link_address[4] & 0xff, link_address[5] & 0xff));
++ }
++#else
+ base::DirReaderPosix reader("/sys/class/net");
+ if (!reader.IsValid())
+ return result;
+@@ -165,6 +201,7 @@ std::vector<std::string> GetMacAddresses
+ &address);
+ result.push_back(address);
+ }
++#endif
+ return result;
+ }
+
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_signin_enterprise__signin__service.h b/chromium-next/patches/patch-chrome_browser_enterprise_signin_enterprise__signin__service.h
new file mode 100644
index 0000000000..71da946139
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_signin_enterprise__signin__service.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/signin/enterprise_signin_service.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/signin/enterprise_signin_service.h
+@@ -9,7 +9,7 @@
+
+ #include "build/build_config.h"
+
+-#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN))
++#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD))
+ #error EnterpriseSigninService should only be built on desktop platforms.
+ #endif // !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN))
+
diff --git a/chromium-next/patches/patch-chrome_browser_enterprise_signin_interstitials_managed__profile__required__page.cc b/chromium-next/patches/patch-chrome_browser_enterprise_signin_interstitials_managed__profile__required__page.cc
new file mode 100644
index 0000000000..dc2daf0f11
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_enterprise_signin_interstitials_managed__profile__required__page.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/enterprise/signin/interstitials/managed_profile_required_page.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/enterprise/signin/interstitials/managed_profile_required_page.cc
+@@ -89,7 +89,7 @@ void ManagedProfileRequiredPage::Command
+
+ switch (cmd) {
+ case security_interstitials::CMD_DONT_PROCEED:
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (ManagedProfileRequiredNavigationThrottle::IsBlockingNavigations(
+ web_contents()->GetBrowserContext())) {
+ ManagedProfileRequiredNavigationThrottle::ShowBlockedWindow(
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_BUILD.gn b/chromium-next/patches/patch-chrome_browser_extensions_BUILD.gn
new file mode 100644
index 0000000000..f5303270c5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_BUILD.gn
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/BUILD.gn
+@@ -1426,6 +1426,10 @@ source_set("extensions") {
+ deps += [ "//chrome/services/printing/public/mojom" ]
+ }
+
++ if (is_bsd) {
++ sources -= [ "api/image_writer_private/removable_storage_provider_linux.cc" ]
++ }
++
+ if (enable_pdf) {
+ deps += [
+ "//chrome/browser/pdf",
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc
new file mode 100644
index 0000000000..95b956579d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_api__browser__context__keyed__service__factories.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/api_browser_context_keyed_service_factories.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/api_browser_context_keyed_service_factories.cc
+@@ -45,7 +45,7 @@
+ #include "pdf/buildflags.h"
+ #include "printing/buildflags/buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h"
+ #endif
+
+@@ -114,7 +114,7 @@ void EnsureApiBrowserContextKeyedService
+ extensions::SettingsPrivateEventRouterFactory::GetInstance();
+ extensions::SettingsOverridesAPI::GetFactoryInstance();
+ extensions::SidePanelService::GetFactoryInstance();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ extensions::SystemIndicatorManagerFactory::GetInstance();
+ #endif
+ extensions::TabGroupsEventRouterFactory::GetInstance();
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc
new file mode 100644
index 0000000000..742a92430e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
+@@ -24,7 +24,7 @@
+ #include "base/win/registry.h"
+ #endif
+
+-#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
+@@ -255,7 +255,7 @@ base::FilePath GetEndpointVerificationDi
+ bool got_path = false;
+ #if BUILDFLAG(IS_WIN)
+ got_path = base::PathService::Get(base::DIR_LOCAL_APP_DATA, &path);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
+ path = base::nix::GetXDGDirectory(env.get(), base::nix::kXdgConfigHomeEnvVar,
+ base::nix::kDotConfigDir);
+@@ -266,7 +266,7 @@ base::FilePath GetEndpointVerificationDi
+ if (!got_path)
+ return path;
+
+-#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/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.cc
new file mode 100644
index 0000000000..fc7938d08b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/enterprise_reporting_private/conversion_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/enterprise_reporting_private/conversion_utils.cc
+@@ -8,7 +8,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ #include <memory>
+ #include <utility>
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.h b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.h
new file mode 100644
index 0000000000..ef27171e8f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_conversion__utils.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/enterprise_reporting_private/conversion_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/enterprise_reporting_private/conversion_utils.h
+@@ -7,7 +7,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ #include <optional>
+ #include <vector>
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc
new file mode 100644
index 0000000000..002b6677fd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
+@@ -42,7 +42,7 @@
+ #include "components/reporting/util/statusor.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include <optional>
+
+ #include "base/strings/string_util.h"
+@@ -159,7 +159,7 @@ api::enterprise_reporting_private::Conte
+ }
+
+ bool AllowClientCertificateReportingForUsers() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(
+ enterprise_signals::features::kAllowClientCertificateReportingForUsers);
+ #else
+@@ -172,7 +172,7 @@ bool IsProfilePrefManaged(Profile* profi
+ return pref && pref->IsManaged();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ device_signals::SignalsAggregationRequest CreateAggregationRequest(
+ device_signals::SignalName signal_name) {
+@@ -234,7 +234,7 @@ EnterpriseReportingPrivateGetDeviceIdFun
+
+ // getPersistentSecret
+
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+
+ EnterpriseReportingPrivateGetPersistentSecretFunction::
+ EnterpriseReportingPrivateGetPersistentSecretFunction() = default;
+@@ -672,7 +672,7 @@ void EnterpriseReportingPrivateEnqueueRe
+ }
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ // getFileSystemInfo
+
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h
new file mode 100644
index 0000000000..b746d29064
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h
+@@ -20,7 +20,7 @@
+ #include "components/reporting/proto/synced/record.pb.h"
+ #include "components/reporting/proto/synced/record_constants.pb.h"
+ #include "components/reporting/util/statusor.h"
+-#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/time/time.h"
+ #include "components/device_signals/core/browser/signals_types.h"
+ #endif // BUILDFLAG(IS_CHROMEOS)
+@@ -56,7 +56,7 @@ class EnterpriseReportingPrivateGetDevic
+ ~EnterpriseReportingPrivateGetDeviceIdFunction() override;
+ };
+
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+
+ class EnterpriseReportingPrivateGetPersistentSecretFunction
+ : public ExtensionFunction {
+@@ -266,7 +266,7 @@ class EnterpriseReportingPrivateEnqueueR
+
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ class EnterpriseReportingPrivateGetFileSystemInfoFunction
+ : public ExtensionFunction {
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc
new file mode 100644
index 0000000000..bf264a5ea1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc
+@@ -20,6 +20,7 @@ static base::LazyInstance<scoped_refptr<
+
+ void RemovableStorageProvider::GetAllDevices(DeviceListReadyCallback callback) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
++#if !BUILDFLAG(IS_BSD)
+ if (g_test_device_list.Get().get() != nullptr) {
+ base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
+ FROM_HERE,
+@@ -33,6 +34,9 @@ void RemovableStorageProvider::GetAllDev
+ base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
+ base::BindOnce(&RemovableStorageProvider::PopulateDeviceList),
+ std::move(callback));
++#else
++ NOTIMPLEMENTED();
++#endif
+ }
+
+ // static
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_management_chrome__management__api__delegate.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_management_chrome__management__api__delegate.cc
new file mode 100644
index 0000000000..3c632080de
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_management_chrome__management__api__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/management/chrome_management_api_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
+@@ -407,7 +407,7 @@ bool ChromeManagementAPIDelegate::Launch
+ apps::LaunchContainer launch_container =
+ GetLaunchContainer(extensions::ExtensionPrefs::Get(context), extension);
+ Profile* profile = Profile::FromBrowserContext(context);
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (extensions::IsExtensionUnsupportedDeprecatedApp(profile,
+ extension->id())) {
+ return false;
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_messaging_launch__context__posix.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_messaging_launch__context__posix.cc
new file mode 100644
index 0000000000..ee9b658c00
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_messaging_launch__context__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/messaging/launch_context_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/messaging/launch_context_posix.cc
+@@ -84,7 +84,7 @@ std::optional<LaunchContext::ProcessStat
+
+ options.current_directory = command_line.GetProgram().DirName();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || 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/chromium-next/patches/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc
new file mode 100644
index 0000000000..48ce2108d1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_passwords__private_passwords__private__delegate__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
+@@ -645,7 +645,7 @@ void PasswordsPrivateDelegateImpl::OnFet
+ }
+
+ void PasswordsPrivateDelegateImpl::OsReauthTimeoutCall() {
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ PasswordsPrivateEventRouter* router =
+ PasswordsPrivateEventRouterFactory::GetForProfile(profile_);
+ if (router) {
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_runtime_chrome__runtime__api__delegate.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_runtime_chrome__runtime__api__delegate.cc
new file mode 100644
index 0000000000..2afafb7c85
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_runtime_chrome__runtime__api__delegate.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
+@@ -288,7 +288,11 @@ bool ChromeRuntimeAPIDelegate::GetPlatfo
+ } else if (strcmp(os, "linux") == 0) {
+ info->os = extensions::api::runtime::PlatformOs::kLinux;
+ } else if (strcmp(os, "openbsd") == 0) {
+- info->os = extensions::api::runtime::PlatformOs::kOpenbsd;
++ info->os = extensions::api::runtime::PlatformOs::kLinux;
++ } else if (strcmp(os, "freebsd") == 0) {
++ info->os = extensions::api::runtime::PlatformOs::kLinux;
++ } else if (strcmp(os, "netbsd") == 0) {
++ info->os = extensions::api::runtime::PlatformOs::kLinux;
+ } else {
+ NOTREACHED() << "Platform not supported: " << os;
+ }
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc
new file mode 100644
index 0000000000..af6bca8ecc
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/settings_private/prefs_util.cc
+@@ -189,7 +189,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
+ (*s_allowlist)[autofill::prefs::kAutofillPaymentCardBenefits] =
+ settings_api::PrefType::kBoolean;
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ (*s_allowlist)[autofill::prefs::kAutofillPredictionImprovementsEnabled] =
+ settings_api::PrefType::kBoolean;
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+@@ -207,7 +207,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
+ (*s_allowlist)[tab_groups::prefs::kAutoPinNewTabGroups] =
+ settings_api::PrefType::kBoolean;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ (*s_allowlist)[::prefs::kUseCustomChromeFrame] =
+ settings_api::PrefType::kBoolean;
+ #endif
+@@ -219,7 +219,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
+ (*s_allowlist)[::prefs::kCurrentThemeID] = settings_api::PrefType::kString;
+ (*s_allowlist)[::prefs::kPinnedActions] = settings_api::PrefType::kList;
+ (*s_allowlist)[::prefs::kPolicyThemeColor] = settings_api::PrefType::kNumber;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ (*s_allowlist)[::prefs::kSystemTheme] = settings_api::PrefType::kNumber;
+ #endif
+ (*s_allowlist)[::prefs::kHomePage] = settings_api::PrefType::kUrl;
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_tabs_tabs__api.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_tabs_tabs__api.cc
new file mode 100644
index 0000000000..de57f45388
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_tabs_tabs__api.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/tabs/tabs_api.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/tabs/tabs_api.cc
+@@ -916,7 +916,7 @@ ExtensionFunction::ResponseAction Window
+ // created as minimized.
+ // TODO(crbug.com/40254339): Remove this workaround when linux is fixed.
+ // TODO(crbug.com/40254339): Find a fix for wayland as well.
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ if (new_window->initial_show_state() ==
+ ui::mojom::WindowShowState::kMinimized) {
+ new_window->window()->Minimize();
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc
new file mode 100644
index 0000000000..a932c77704
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc
+@@ -28,7 +28,7 @@
+ #include "extensions/browser/process_manager.h"
+ #include "extensions/common/error_utils.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "extensions/common/permissions/permissions_data.h"
+ #endif
+
+@@ -37,7 +37,7 @@ namespace {
+ bool CanEnableAudioDebugRecordingsFromExtension(
+ const extensions::Extension* extension) {
+ bool enabled_by_permissions = false;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (extension) {
+ enabled_by_permissions =
+ extension->permissions_data()->active_permissions().HasAPIPermission(
+@@ -575,7 +575,7 @@ void WebrtcLoggingPrivateStartEventLoggi
+
+ ExtensionFunction::ResponseAction
+ WebrtcLoggingPrivateGetLogsDirectoryFunction::Run() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Unlike other WebrtcLoggingPrivate functions that take a RequestInfo object,
+ // this function shouldn't be called by a component extension on behalf of
+ // some web code. It returns a DirectoryEntry for use directly in the calling
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_api_webstore__private_webstore__private__api.cc b/chromium-next/patches/patch-chrome_browser_extensions_api_webstore__private_webstore__private__api.cc
new file mode 100644
index 0000000000..26f7390df8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_api_webstore__private_webstore__private__api.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/api/webstore_private/webstore_private_api.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+@@ -913,7 +913,7 @@ void WebstorePrivateBeginInstallWithMani
+ #if BUILDFLAG(IS_CHROMEOS)
+ RequestExtensionApproval(contents);
+ return;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Shows a parental permission dialog directly bypassing the extension
+ // install dialog view. The parental permission dialog contains a superset
+ // of data from the extension install dialog: requested extension
diff --git a/chromium-next/patches/patch-chrome_browser_extensions_external__provider__impl.cc b/chromium-next/patches/patch-chrome_browser_extensions_external__provider__impl.cc
new file mode 100644
index 0000000000..5d2edb835e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_extensions_external__provider__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/extensions/external_provider_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/extensions/external_provider_impl.cc
+@@ -790,7 +790,7 @@ void ExternalProviderImpl::CreateExterna
+
+ #endif // BUILDFLAG(IS_CHROMEOS)
+ if (!profile->GetPrefs()->GetBoolean(pref_names::kBlockExternalExtensions)) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ provider_list->push_back(std::make_unique<ExternalProviderImpl>(
+ service,
+ base::MakeRefCounted<ExternalPrefLoader>(
+@@ -818,7 +818,7 @@ void ExternalProviderImpl::CreateExterna
+ bundled_extension_creation_flags));
+
+ // Define a per-user source of external extensions.
+-#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if BUILDFLAG(IS_MAC) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(CHROMIUM_BRANDING))
+ provider_list->push_back(std::make_unique<ExternalProviderImpl>(
+ service,
diff --git a/chromium-next/patches/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc b/chromium-next/patches/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc
new file mode 100644
index 0000000000..6a23839843
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
+@@ -351,7 +351,7 @@ const struct {
+ FILE_PATH_LITERAL("Library/Mobile Documents/com~apple~CloudDocs"),
+ kDontBlockChildren},
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // On Linux also block access to devices via /dev.
+ {kNoBasePathKey, FILE_PATH_LITERAL("/dev"), kBlockAllChildren},
+ // And security sensitive data in /proc and /sys.
diff --git a/chromium-next/patches/patch-chrome_browser_first__run_first__run__dialog.h b/chromium-next/patches/patch-chrome_browser_first__run_first__run__dialog.h
new file mode 100644
index 0000000000..117d5db39a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_first__run_first__run__dialog.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/first_run/first_run_dialog.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ 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/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#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)
+
+ namespace first_run {
+
diff --git a/chromium-next/patches/patch-chrome_browser_first__run_first__run__internal.h b/chromium-next/patches/patch-chrome_browser_first__run_first__run__internal.h
new file mode 100644
index 0000000000..b74925dc69
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_first__run_first__run__internal.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/first_run/first_run_internal.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/first_run/first_run_internal.h
+@@ -54,7 +54,7 @@ FirstRunState DetermineFirstRunState(boo
+ bool force_first_run,
+ bool no_first_run);
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || 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/chromium-next/patches/patch-chrome_browser_flag__descriptions.cc b/chromium-next/patches/patch-chrome_browser_flag__descriptions.cc
new file mode 100644
index 0000000000..118063a855
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_flag__descriptions.cc
@@ -0,0 +1,164 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/flag_descriptions.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/flag_descriptions.cc
+@@ -470,7 +470,7 @@ const char kAutofillDisableLocalCardMigr
+ "from checkout flows and from the payment methods settings page.";
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kAutofillEnableAmountExtractionDesktopName[] =
+ "Enable checkout amount extraction on Chrome desktop";
+ const char kAutofillEnableAmountExtractionDesktopDescription[] =
+@@ -479,7 +479,7 @@ const char kAutofillEnableAmountExtracti
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kAutofillEnableBuyNowPayLaterForAffirmName[] =
+ "Enable buy now pay later on Autofill for Affirm";
+ const char kAutofillEnableBuyNowPayLaterForAffirmDescription[] =
+@@ -976,7 +976,7 @@ const char kDevicePostureDescription[] =
+ "Enables Device Posture API (foldable devices)";
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kDocumentPictureInPictureAnimateResizeName[] =
+ "Document Picture-in-Picture Animate Resize";
+ const char kDocumentPictureInPictureAnimateResizeDescription[] =
+@@ -1060,7 +1060,7 @@ const char kCompressionDictionaryTranspo
+ "when the connection is using a well known root cert or when the server is "
+ "a localhost.";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ const char kContextualCueingName[] = "Contextual cueing";
+ const char kContextualCueingDescription[] =
+ "Enables the contextual cueing system to support showing actions";
+@@ -2203,7 +2203,7 @@ const char kContextualPageActionsShareMo
+ "Enables share model data collection.";
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kEnableSearchAggregatorPolicyName[] =
+ "Enable EnterpriseSearchAggregatorSettings policy";
+ const char kEnableSearchAggregatorPolicyDescription[] =
+@@ -3516,7 +3516,7 @@ const char kSiteInstanceGroupsForDataUrl
+ "but in the same SiteInstanceGroup, and thus the same process.";
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kPwaNavigationCapturingName[] = "Desktop PWA Link Capturing";
+ const char kPwaNavigationCapturingDescription[] =
+ "Enables opening links from Chrome in an installed PWA. Currently under "
+@@ -3736,7 +3736,7 @@ const char kTranslateForceTriggerOnEngli
+ "Force the Translate Triggering on English pages experiment to be enabled "
+ "with the selected language model active.";
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char kTranslationAPIName[] = "Experimental translation API";
+ const char kTranslationAPIDescription[] =
+ "Enables the on-device language translation API. "
+@@ -7663,7 +7663,7 @@ const char kBlinkExtensionDiagnosticsDes
+ "Enable the experimental Diagnostics Blink Extension.";
+ #endif // #if BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char kGetAllScreensMediaName[] = "GetAllScreensMedia API";
+ const char kGetAllScreensMediaDescription[] =
+ "When enabled, the getAllScreensMedia API for capturing multiple screens "
+@@ -7883,7 +7883,7 @@ const char kEnableArmHwdrmDescription[]
+
+ // Linux -----------------------------------------------------------------------
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char kOzonePlatformHintChoiceDefault[] = "Default";
+ const char kOzonePlatformHintChoiceAuto[] = "Auto";
+ const char kOzonePlatformHintChoiceX11[] = "X11";
+@@ -7929,6 +7929,20 @@ const char kWaylandUiScalingDescription[
+ "Enable experimental support for text scaling in the Wayland backend "
+ "backed by full UI scaling. Requires #wayland-per-window-scaling to be "
+ "enabled too.";
++
++#if BUILDFLAG(IS_BSD)
++const char kAudioBackendName[] =
++ "Audio Backend";
++const char kAudioBackendDescription[] =
++#if BUILDFLAG(IS_OPENBSD)
++ "Select the desired audio backend to use. The default is sndio.";
++#elif BUILDFLAG(IS_NETBSD)
++ "Select the desired audio backend to use. The default is audioio.";
++#elif BUILDFLAG(IS_FREEBSD)
++ "Select the desired audio backend to use. The default will automatically "
++ "enumerate through the supported backends.";
++#endif
++#endif
+ #endif // BUILDFLAG(IS_LINUX)
+
+ // Random platform combinations -----------------------------------------------
+@@ -7941,7 +7955,7 @@ const char kZeroCopyVideoCaptureDescript
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kFollowingFeedSidepanelName[] = "Following feed in the sidepanel";
+ const char kFollowingFeedSidepanelDescription[] =
+ "Enables the following feed in the sidepanel.";
+@@ -7963,7 +7977,7 @@ const char kTaskManagerDesktopRefreshDes
+ "Enables a refreshed design for the Task Manager on Desktop platforms.";
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kEnableNetworkServiceSandboxName[] =
+ "Enable the network service sandbox.";
+ const char kEnableNetworkServiceSandboxDescription[] =
+@@ -7995,7 +8009,7 @@ const char kWebBluetoothConfirmPairingSu
+ "Bluetooth";
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ const char kSkipUndecryptablePasswordsName[] =
+ "Skip undecryptable passwords to use the available decryptable "
+ "passwords.";
+@@ -8150,7 +8164,7 @@ const char kElementCaptureDescription[]
+
+ #if BUILDFLAG(IS_WIN) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ const char kUIDebugToolsName[] = "Debugging tools for UI";
+ const char kUIDebugToolsDescription[] =
+ "Enables additional keyboard shortcuts to help debugging.";
+@@ -8206,7 +8220,7 @@ const char kComposeUpfrontInputModesDesc
+ "Enables upfront input modes in the Compose dialog";
+ #endif // BUILDFLAG(ENABLE_COMPOSE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ const char kThirdPartyProfileManagementName[] =
+ "Third party profile management";
+ const char kThirdPartyProfileManagementDescription[] =
+@@ -8323,7 +8337,7 @@ const char kOverlayScrollbarsOSSettingsD
+ "Enable the os settings for overlay scrollbars on ChromeOS.";
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ const char kSupervisedProfileHideGuestName[] = "Supervised Profile Hide Guest";
+ const char kSupervisedProfileHideGuestDescription[] =
+ "Hides Guest Profile entry points for supervised users";
diff --git a/chromium-next/patches/patch-chrome_browser_flag__descriptions.h b/chromium-next/patches/patch-chrome_browser_flag__descriptions.h
new file mode 100644
index 0000000000..eb7a444341
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_flag__descriptions.h
@@ -0,0 +1,151 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/flag_descriptions.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/flag_descriptions.h
+@@ -291,13 +291,13 @@ extern const char kAutofillDisableLocalC
+ extern const char kAutofillDisableLocalCardMigrationDescription[];
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kAutofillEnableAmountExtractionDesktopName[];
+ extern const char kAutofillEnableAmountExtractionDesktopDescription[];
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kAutofillEnableBuyNowPayLaterForAffirmName[];
+ extern const char kAutofillEnableBuyNowPayLaterForAffirmDescription[];
+
+@@ -556,7 +556,7 @@ extern const char kCapturedSurfaceContro
+ extern const char kCommerceHintAndroidName[];
+ extern const char kCommerceHintAndroidDescription[];
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ extern const char kContextualCueingName[];
+ extern const char kContextualCueingDescription[];
+ #endif // #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+@@ -737,7 +737,7 @@ extern const char kDevicePostureName[];
+ extern const char kDevicePostureDescription[];
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kDocumentPictureInPictureAnimateResizeName[];
+ extern const char kDocumentPictureInPictureAnimateResizeDescription[];
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) ||
+@@ -1227,7 +1227,7 @@ extern const char kContextualPageActions
+ extern const char kContextualPageActionsShareModelDescription[];
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kEnableSearchAggregatorPolicyName[];
+ extern const char kEnableSearchAggregatorPolicyDescription[];
+ #endif
+@@ -2004,7 +2004,7 @@ extern const char kSiteInstanceGroupsFor
+ extern const char kSiteInstanceGroupsForDataUrlsDescription[];
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kPwaNavigationCapturingName[];
+ extern const char kPwaNavigationCapturingDescription[];
+ #endif
+@@ -2163,7 +2163,7 @@ extern const char kTouchTextEditingRedes
+ extern const char kTranslateForceTriggerOnEnglishName[];
+ extern const char kTranslateForceTriggerOnEnglishDescription[];
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extern const char kTranslationAPIName[];
+ extern const char kTranslationAPIDescription[];
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+@@ -4429,7 +4429,7 @@ extern const char kBlinkExtensionDiagnos
+ extern const char kBlinkExtensionDiagnosticsDescription[];
+ #endif // #if BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extern const char kGetAllScreensMediaName[];
+ extern const char kGetAllScreensMediaDescription[];
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+@@ -4558,7 +4558,7 @@ extern const char kEnableArmHwdrmDescrip
+
+ // Linux ---------------------------------------------------------------------
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extern const char kOzonePlatformHintChoiceDefault[];
+ extern const char kOzonePlatformHintChoiceAuto[];
+ extern const char kOzonePlatformHintChoiceX11[];
+@@ -4586,6 +4586,9 @@ extern const char kWaylandTextInputV3Des
+
+ extern const char kWaylandUiScalingName[];
+ extern const char kWaylandUiScalingDescription[];
++
++extern const char kAudioBackendName[];
++extern const char kAudioBackendDescription[];
+ #endif // BUILDFLAG(IS_LINUX)
+
+ // Random platform combinations -----------------------------------------------
+@@ -4605,7 +4608,7 @@ extern const char kWebBluetoothConfirmPa
+ extern const char kWebBluetoothConfirmPairingSupportDescription[];
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ extern const char kSkipUndecryptablePasswordsName[];
+ extern const char kSkipUndecryptablePasswordsDescription[];
+
+@@ -4627,7 +4630,7 @@ extern const char kScreenlockReauthPromo
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kFollowingFeedSidepanelName[];
+ extern const char kFollowingFeedSidepanelDescription[];
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+@@ -4641,7 +4644,7 @@ extern const char kTaskManagerDesktopRef
+ extern const char kTaskManagerDesktopRefreshDescription[];
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kEnableNetworkServiceSandboxName[];
+ extern const char kEnableNetworkServiceSandboxDescription[];
+
+@@ -4738,7 +4741,7 @@ extern const char kElementCaptureDescrip
+
+ #if BUILDFLAG(IS_WIN) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ extern const char kUIDebugToolsName[];
+ extern const char kUIDebugToolsDescription[];
+ #endif
+@@ -4780,7 +4783,7 @@ extern const char kComposeUpfrontInputMo
+ extern const char kComposeUpfrontInputModesDescription[];
+ #endif // BUILDFLAG(ENABLE_COMPOSE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ extern const char kThirdPartyProfileManagementName[];
+ extern const char kThirdPartyProfileManagementDescription[];
+
+@@ -4850,7 +4853,7 @@ extern const char kOverlayScrollbarsOSSe
+ extern const char kOverlayScrollbarsOSSettingsDescription[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ extern const char kSupervisedProfileHideGuestName[];
+ extern const char kSupervisedProfileHideGuestDescription[];
+
diff --git a/chromium-next/patches/patch-chrome_browser_gcm_gcm__profile__service__factory.cc b/chromium-next/patches/patch-chrome_browser_gcm_gcm__profile__service__factory.cc
new file mode 100644
index 0000000000..0744911786
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_gcm_gcm__profile__service__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/gcm/gcm_profile_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/gcm/gcm_profile_service_factory.cc
+@@ -89,7 +89,7 @@ GCMProfileServiceFactory::ScopedTestingF
+ // static
+ GCMProfileService* GCMProfileServiceFactory::GetForProfile(
+ content::BrowserContext* profile) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On desktop, incognito profiles are checked with IsIncognitoProfile().
+ // It's possible for non-incognito profiles to also be off-the-record.
+ bool is_profile_supported =
+@@ -132,7 +132,7 @@ GCMProfileServiceFactory::~GCMProfileSer
+ KeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ Profile* profile = Profile::FromBrowserContext(context);
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ DCHECK(!profile->IsIncognitoProfile());
+ #else
+ DCHECK(!profile->IsOffTheRecord());
diff --git a/chromium-next/patches/patch-chrome_browser_gcm_instance__id_instance__id__profile__service__factory.cc b/chromium-next/patches/patch-chrome_browser_gcm_instance__id_instance__id__profile__service__factory.cc
new file mode 100644
index 0000000000..1aaa8182ee
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_gcm_instance__id_instance__id__profile__service__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/gcm/instance_id/instance_id_profile_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/gcm/instance_id/instance_id_profile_service_factory.cc
+@@ -16,7 +16,7 @@ namespace instance_id {
+ // static
+ InstanceIDProfileService* InstanceIDProfileServiceFactory::GetForProfile(
+ content::BrowserContext* profile) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On desktop, the guest profile is actually the primary OTR profile of
+ // the "regular" guest profile. The regular guest profile is never used
+ // directly by users. Also, user are not able to create child OTR profiles
+@@ -64,7 +64,7 @@ InstanceIDProfileServiceFactory::~Instan
+ KeyedService* InstanceIDProfileServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ Profile* profile = Profile::FromBrowserContext(context);
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On desktop, incognito profiles are checked with IsIncognitoProfile().
+ // It's possible for non-incognito profiles to also be off-the-record.
+ bool is_incognito = profile->IsIncognitoProfile();
diff --git a/chromium-next/patches/patch-chrome_browser_global__features.cc b/chromium-next/patches/patch-chrome_browser_global__features.cc
new file mode 100644
index 0000000000..9e9af6c0e1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_global__features.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/global_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/global_features.cc
+@@ -10,7 +10,7 @@
+ #include "build/build_config.h"
+ #include "chrome/browser/permissions/system/platform_handle.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // This causes a gn error on Android builds, because gn does not understand
+ // buildflags, so we include it only on platforms where it is used.
+ #include "components/user_education/common/user_education_features.h" // nogncheck
+@@ -49,7 +49,7 @@ void GlobalFeatures::ReplaceGlobalFeatur
+
+ void GlobalFeatures::Init() {
+ system_permissions_platform_handle_ = CreateSystemPermissionsPlatformHandle();
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (user_education::features::IsWhatsNewV2()) {
+ whats_new_registry_ = CreateWhatsNewRegistry();
+ }
+@@ -61,7 +61,7 @@ GlobalFeatures::CreateSystemPermissionsP
+ return system_permission_settings::PlatformHandle::Create();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<whats_new::WhatsNewRegistry>
+ GlobalFeatures::CreateWhatsNewRegistry() {
+ return whats_new::CreateWhatsNewRegistry();
diff --git a/chromium-next/patches/patch-chrome_browser_global__features.h b/chromium-next/patches/patch-chrome_browser_global__features.h
new file mode 100644
index 0000000000..ada70a4e69
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_global__features.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/global_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/global_features.h
+@@ -14,7 +14,7 @@ namespace system_permission_settings {
+ class PlatformHandle;
+ } // namespace system_permission_settings
+ namespace whats_new {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class WhatsNewRegistry;
+ #endif
+ } // namespace whats_new
+@@ -45,7 +45,7 @@ class GlobalFeatures {
+ system_permissions_platform_handle() {
+ return system_permissions_platform_handle_.get();
+ }
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ whats_new::WhatsNewRegistry* whats_new_registry() {
+ return whats_new_registry_.get();
+ }
+@@ -60,7 +60,7 @@ class GlobalFeatures {
+
+ virtual std::unique_ptr<system_permission_settings::PlatformHandle>
+ CreateSystemPermissionsPlatformHandle();
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ virtual std::unique_ptr<whats_new::WhatsNewRegistry> CreateWhatsNewRegistry();
+ #endif
+
+@@ -70,7 +70,7 @@ class GlobalFeatures {
+
+ std::unique_ptr<system_permission_settings::PlatformHandle>
+ system_permissions_platform_handle_;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<whats_new::WhatsNewRegistry> whats_new_registry_;
+ #endif
+ };
diff --git a/chromium-next/patches/patch-chrome_browser_headless_headless__mode__util.cc b/chromium-next/patches/patch-chrome_browser_headless_headless__mode__util.cc
new file mode 100644
index 0000000000..4a3d305cd4
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_headless_headless__mode__util.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/headless/headless_mode_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/headless/headless_mode_util.cc
+@@ -10,7 +10,7 @@
+ // New headless mode is available on Linux, Windows and Mac platforms.
+ // More platforms will be added later, so avoid function level clutter
+ // by providing stub implementations at the end of the file.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+
+ #include "base/base_switches.h"
+ #include "base/files/file_path.h"
+@@ -19,7 +19,7 @@
+ #include "chrome/common/chrome_switches.h"
+ #include "content/public/common/content_switches.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/gl/gl_switches.h" // nogncheck
+ #include "ui/ozone/public/ozone_switches.h" // nogncheck
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -94,7 +94,7 @@ class HeadlessModeHandleImpl : public He
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Headless mode on Linux relies on ozone/headless platform.
+ command_line->AppendSwitchASCII(::switches::kOzonePlatform,
+ switches::kHeadless);
diff --git a/chromium-next/patches/patch-chrome_browser_intranet__redirect__detector.h b/chromium-next/patches/patch-chrome_browser_intranet__redirect__detector.h
new file mode 100644
index 0000000000..ddda7278bf
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_intranet__redirect__detector.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/intranet_redirect_detector.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/intranet_redirect_detector.h
+@@ -25,7 +25,7 @@ class SimpleURLLoader;
+ class PrefRegistrySimple;
+
+ #if !(BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS))
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ #error "IntranetRedirectDetector should only be built on Desktop platforms."
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_media__galleries_fileapi_mtp__device__map__service.cc b/chromium-next/patches/patch-chrome_browser_media__galleries_fileapi_mtp__device__map__service.cc
new file mode 100644
index 0000000000..936a6ea471
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media__galleries_fileapi_mtp__device__map__service.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc
+@@ -40,10 +40,12 @@ void MTPDeviceMapService::RegisterMTPFil
+ // Note that this initializes the delegate asynchronously, but since
+ // the delegate will only be used from the IO thread, it is guaranteed
+ // to be created before use of it expects it to be there.
++#if !BUILDFLAG(IS_BSD)
+ CreateMTPDeviceAsyncDelegate(
+ device_location, read_only,
+ base::BindOnce(&MTPDeviceMapService::AddAsyncDelegate,
+ base::Unretained(this), device_location, read_only));
++#endif
+ mtp_device_usage_map_[key] = 0;
+ }
+
diff --git a/chromium-next/patches/patch-chrome_browser_media__galleries_media__file__system__registry.cc b/chromium-next/patches/patch-chrome_browser_media__galleries_media__file__system__registry.cc
new file mode 100644
index 0000000000..2dfd532057
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media__galleries_media__file__system__registry.cc
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media_galleries/media_file_system_registry.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media_galleries/media_file_system_registry.cc
+@@ -584,7 +584,12 @@ class MediaFileSystemRegistry::MediaFile
+ // 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/chromium-next/patches/patch-chrome_browser_media_audio__service__util.cc b/chromium-next/patches/patch-chrome_browser_media_audio__service__util.cc
new file mode 100644
index 0000000000..912448d156
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_audio__service__util.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/audio_service_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/audio_service_util.cc
+@@ -21,7 +21,7 @@
+
+ namespace {
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS))
+ const base::Value* GetPolicy(const char* policy_name) {
+ const policy::PolicyMap& policies =
+@@ -43,7 +43,7 @@ bool GetPolicyOrFeature(const char* poli
+ bool IsAudioServiceSandboxEnabled() {
+ // TODO(crbug.com/40118868): Remove !IS_CHROMEOS_LACROS once lacros starts being
+ // built with OS_CHROMEOS instead of OS_LINUX.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS))
+ return GetPolicyOrFeature(policy::key::kAudioSandboxEnabled,
+ features::kAudioServiceSandbox);
diff --git a/chromium-next/patches/patch-chrome_browser_media_router_discovery_BUILD.gn b/chromium-next/patches/patch-chrome_browser_media_router_discovery_BUILD.gn
new file mode 100644
index 0000000000..58208619db
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_router_discovery_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/router/discovery/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/router/discovery/BUILD.gn
+@@ -82,7 +82,7 @@ static_library("discovery") {
+ ]
+ configs += [ "//build/config/compiler:wexit_time_destructors" ]
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "discovery_network_list_wifi_linux.cc" ]
+ }
+
diff --git a/chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc b/chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc
new file mode 100644
index 0000000000..08f0c2f5f1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc
@@ -0,0 +1,54 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/router/discovery/discovery_network_list_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/router/discovery/discovery_network_list_posix.cc
+@@ -10,11 +10,12 @@
+ #include "chrome/browser/media/router/discovery/discovery_network_list.h"
+
+ #include <ifaddrs.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#include <sys/time.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
+ #include <netinet/in.h>
+-#include <sys/socket.h>
+-#include <sys/types.h>
+
+ #include <algorithm>
+
+@@ -23,7 +24,7 @@
+ #include "chrome/browser/media/router/discovery/discovery_network_list_wifi.h"
+ #include "net/base/net_errors.h"
+
+-#if !BUILDFLAG(IS_MAC)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ #include <netpacket/packet.h>
+ #else
+ #include <net/if_dl.h>
+@@ -32,7 +33,7 @@
+ namespace media_router {
+ namespace {
+
+-#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)
+@@ -45,6 +46,12 @@ using sll = struct sockaddr_dl;
+ #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(
+ const struct ifaddrs* if_list,
+ std::vector<DiscoveryNetworkInfo>* network_info_list) {
diff --git a/chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__wifi__linux.cc b/chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__wifi__linux.cc
new file mode 100644
index 0000000000..b081e63da4
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_router_discovery_discovery__network__list__wifi__linux.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/router/discovery/discovery_network_list_wifi_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/router/discovery/discovery_network_list_wifi_linux.cc
+@@ -9,7 +9,11 @@
+ #include <sys/socket.h>
+ #include <sys/types.h>
+
++#include "build/build_config.h"
++
++#if !BUILDFLAG(IS_BSD)
+ #include <linux/wireless.h>
++#endif
+
+ #include "base/check.h"
+ #include "base/files/scoped_file.h"
+@@ -20,6 +24,7 @@ namespace media_router {
+ bool MaybeGetWifiSSID(const std::string& if_name, std::string* ssid_out) {
+ DCHECK(ssid_out);
+
++#if !BUILDFLAG(IS_BSD)
+ base::ScopedFD ioctl_socket(socket(AF_INET, SOCK_DGRAM, 0));
+ if (!ioctl_socket.is_valid()) {
+ // AF_INET is for IPv4, so it may fail for IPv6-only hosts even when there
+@@ -41,6 +46,7 @@ bool MaybeGetWifiSSID(const std::string&
+ ssid_out->assign(ssid);
+ return true;
+ }
++#endif
+ return false;
+ }
+
diff --git a/chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc b/chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc
new file mode 100644
index 0000000000..c44f90a70b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/webrtc/chrome_screen_enumerator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/webrtc/chrome_screen_enumerator.cc
+@@ -21,7 +21,7 @@
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ #include "ash/shell.h"
+ #include "ui/aura/window.h"
+-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/functional/callback.h"
+ #include "content/public/browser/desktop_capture.h"
+ #endif
+@@ -32,7 +32,7 @@ base::LazyInstance<std::vector<raw_ptr<a
+ DestructorAtExit root_windows_for_testing_ = LAZY_INSTANCE_INITIALIZER;
+ } // namespace
+
+-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ namespace {
+ base::LazyInstance<std::unique_ptr<webrtc::DesktopCapturer>>::DestructorAtExit
+ g_desktop_capturer_for_testing = LAZY_INSTANCE_INITIALIZER;
+@@ -79,7 +79,7 @@ blink::mojom::StreamDevicesSetPtr Enumer
+ return stream_devices_set;
+ }
+
+-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ blink::mojom::StreamDevicesSetPtr EnumerateScreens(
+ blink::mojom::MediaStreamType stream_type) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+@@ -130,7 +130,7 @@ void ChromeScreenEnumerator::SetRootWind
+ root_windows_for_testing_.Get() = std::move(root_windows);
+ }
+
+-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ChromeScreenEnumerator::SetDesktopCapturerForTesting(
+ std::unique_ptr<webrtc::DesktopCapturer> capturer) {
+ g_desktop_capturer_for_testing.Get() = std::move(capturer);
+@@ -143,7 +143,7 @@ void ChromeScreenEnumerator::EnumerateSc
+ ScreensCallback screens_callback) const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ content::GetUIThreadTaskRunner({})->PostTaskAndReplyWithResult(
+ FROM_HERE, base::BindOnce(::EnumerateScreens, stream_type),
+ base::BindOnce(
diff --git a/chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h b/chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h
new file mode 100644
index 0000000000..c72ea9384f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_webrtc_chrome__screen__enumerator.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/webrtc/chrome_screen_enumerator.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/webrtc/chrome_screen_enumerator.h
+@@ -20,7 +20,7 @@ namespace aura {
+ class Window;
+ }
+
+-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ namespace webrtc {
+ class DesktopCapturer;
+ }
+@@ -42,7 +42,7 @@ class ChromeScreenEnumerator : public me
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ static void SetRootWindowsForTesting(
+ std::vector<raw_ptr<aura::Window, VectorExperimental>> root_windows);
+-#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ static void SetDesktopCapturerForTesting(
+ std::unique_ptr<webrtc::DesktopCapturer> capturer);
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_media_webrtc_desktop__media__picker__controller.cc b/chromium-next/patches/patch-chrome_browser_media_webrtc_desktop__media__picker__controller.cc
new file mode 100644
index 0000000000..aa6b84a6c9
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_webrtc_desktop__media__picker__controller.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/webrtc/desktop_media_picker_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/webrtc/desktop_media_picker_controller.cc
+@@ -89,7 +89,7 @@ bool DesktopMediaPickerController::IsSys
+ #if BUILDFLAG(IS_MAC)
+ return request_source == Params::RequestSource::kCast ||
+ base::FeatureList::IsEnabled(media::kMacLoopbackAudioForScreenShare);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (request_source == Params::RequestSource::kCast) {
+ return base::FeatureList::IsEnabled(media::kPulseaudioLoopbackForCast);
+ } else {
diff --git a/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc b/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc
new file mode 100644
index 0000000000..3d59b91124
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/webrtc/webrtc_log_uploader.cc
+@@ -106,7 +106,7 @@ std::string GetLogUploadProduct() {
+ const char product[] = "Chrome_Mac";
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #if !defined(ADDRESS_SANITIZER)
+ const char product[] = "Chrome_Linux";
+ #else
diff --git a/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc b/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc
new file mode 100644
index 0000000000..34378cc901
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc
@@ -0,0 +1,39 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/webrtc/webrtc_logging_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/webrtc/webrtc_logging_controller.cc
+@@ -25,10 +25,10 @@
+ #include "components/webrtc_logging/browser/text_log_list.h"
+ #include "content/public/browser/render_process_host.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/public/browser/child_process_security_policy.h"
+ #include "storage/browser/file_system/isolated_context.h"
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ using webrtc_event_logging::WebRtcEventLogManager;
+
+@@ -288,7 +288,7 @@ void WebRtcLoggingController::StartEvent
+ web_app_id, callback);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void WebRtcLoggingController::GetLogsDirectory(
+ LogsDirectoryCallback callback,
+ LogsDirectoryErrorCallback error_callback) {
+@@ -334,7 +334,7 @@ void WebRtcLoggingController::GrantLogsD
+ FROM_HERE,
+ base::BindOnce(std::move(callback), file_system.id(), registered_name));
+ }
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ void WebRtcLoggingController::OnRtpPacket(
+ base::HeapArray<uint8_t> packet_header,
diff --git a/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h b/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h
new file mode 100644
index 0000000000..0077f6a031
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/media/webrtc/webrtc_logging_controller.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/media/webrtc/webrtc_logging_controller.h
+@@ -133,7 +133,7 @@ class WebRtcLoggingController
+ size_t web_app_id,
+ const StartEventLoggingCallback& callback);
+
+-#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.
+@@ -197,7 +197,7 @@ class WebRtcLoggingController
+
+ content::BrowserContext* GetBrowserContext() const;
+
+-#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/chromium-next/patches/patch-chrome_browser_memory__details.cc b/chromium-next/patches/patch-chrome_browser_memory__details.cc
new file mode 100644
index 0000000000..5f71e1c902
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_memory__details.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/memory_details.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/memory_details.cc
+@@ -335,7 +335,7 @@ void MemoryDetails::CollectChildInfoOnUI
+ });
+ }
+
+-#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/chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc b/chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc
new file mode 100644
index 0000000000..bbbf6e24f8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -116,7 +116,7 @@
+ #include "chromeos/crosapi/cpp/crosapi_constants.h"
+ #endif // BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/metrics/pressure/pressure_metrics_reporter.h"
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -125,7 +125,7 @@
+ #include "components/user_manager/user_manager.h"
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/power_metrics/system_power_monitor.h"
+ #endif
+
+@@ -873,7 +873,7 @@ void RecordStartupMetrics() {
+
+ // Record whether Chrome is the default browser or not.
+ // Disabled on Linux due to hanging browser tests, see crbug.com/1216328.
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ shell_integration::DefaultWebClientState default_state =
+ shell_integration::GetDefaultBrowser();
+ base::UmaHistogramEnumeration("DefaultBrowser.State", default_state,
+@@ -1188,11 +1188,11 @@ void ChromeBrowserMainExtraPartsMetrics:
+ std::make_unique<web_app::SamplingMetricsProvider>();
+ #endif // !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ pressure_metrics_reporter_ = std::make_unique<PressureMetricsReporter>();
+ #endif // BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(
+ power_metrics::SystemPowerMonitor::GetInstance());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h b/chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h
new file mode 100644
index 0000000000..69a8ca2ccd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h
+@@ -29,7 +29,7 @@ class PowerMetricsReporter;
+ class ProcessMonitor;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class PressureMetricsReporter;
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -126,7 +126,7 @@ class ChromeBrowserMainExtraPartsMetrics
+ std::unique_ptr<web_app::SamplingMetricsProvider> web_app_metrics_provider_;
+ #endif // !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Reports pressure metrics.
+ std::unique_ptr<PressureMetricsReporter> pressure_metrics_reporter_;
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-chrome_browser_metrics_chrome__metrics__service__client.cc b/chromium-next/patches/patch-chrome_browser_metrics_chrome__metrics__service__client.cc
new file mode 100644
index 0000000000..d7ef17567d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_chrome__metrics__service__client.cc
@@ -0,0 +1,94 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/chrome_metrics_service_client.cc
+@@ -196,11 +196,11 @@
+ #include "chrome/notification_helper/notification_helper_constants.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "components/metrics/motherboard_metrics_provider.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
+ #include "chrome/browser/metrics/chrome_metrics_service_crash_reporter.h"
+ #endif
+
+@@ -214,7 +214,7 @@
+ #include "chrome/browser/metrics/power/power_metrics_provider_mac.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/metrics/bluetooth_metrics_provider.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -536,7 +536,7 @@ void ChromeMetricsServiceClient::Registe
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ metrics::structured::StructuredMetricsService::RegisterPrefs(registry);
+
+ #if !BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -708,7 +708,7 @@ void ChromeMetricsServiceClient::Initial
+ RegisterUKMProviders();
+ }
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ metrics::structured::Recorder::GetInstance()->SetUiTaskRunner(
+ base::SequencedTaskRunner::GetCurrentDefault());
+ #endif
+@@ -759,7 +759,7 @@ void ChromeMetricsServiceClient::Registe
+ metrics_service_->RegisterMetricsProvider(
+ std::make_unique<metrics::CPUMetricsProvider>());
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ metrics_service_->RegisterMetricsProvider(
+ std::make_unique<metrics::MotherboardMetricsProvider>());
+ #endif
+@@ -846,7 +846,7 @@ void ChromeMetricsServiceClient::Registe
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ metrics_service_->RegisterMetricsProvider(
+ std::make_unique<DesktopPlatformFeaturesMetricsProvider>());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) ||
+@@ -951,7 +951,7 @@ void ChromeMetricsServiceClient::Registe
+ std::make_unique<PowerMetricsProvider>());
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ metrics_service_->RegisterMetricsProvider(
+ metrics::CreateDesktopSessionMetricsProvider());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX)
+@@ -1138,7 +1138,7 @@ bool ChromeMetricsServiceClient::Registe
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ // This creates the DesktopProfileSessionDurationsServices if it didn't exist
+ // already.
+ metrics::DesktopProfileSessionDurationsServiceFactory::GetForBrowserContext(
+@@ -1472,7 +1472,7 @@ void ChromeMetricsServiceClient::CreateS
+ recorder =
+ base::MakeRefCounted<metrics::structured::AshStructuredMetricsRecorder>(
+ cros_system_profile_provider_.get());
+-#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+
+ // Make sure that Structured Metrics recording delegates have been created
+ // before the service is created. This is handled in other places for ChromeOS
diff --git a/chromium-next/patches/patch-chrome_browser_metrics_perf_cpu__identity.cc b/chromium-next/patches/patch-chrome_browser_metrics_perf_cpu__identity.cc
new file mode 100644
index 0000000000..1506dbbb0b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_perf_cpu__identity.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/perf/cpu_identity.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/perf/cpu_identity.cc
+@@ -147,7 +147,7 @@ CPUIdentity GetCPUIdentity() {
+ result.release =
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ base::SysInfo::KernelVersion();
+-#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/chromium-next/patches/patch-chrome_browser_metrics_power_process__metrics__recorder__util.cc b/chromium-next/patches/patch-chrome_browser_metrics_power_process__metrics__recorder__util.cc
new file mode 100644
index 0000000000..8d7389200b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_power_process__metrics__recorder__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/power/process_metrics_recorder_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/power/process_metrics_recorder_util.cc
+@@ -65,7 +65,7 @@ void RecordProcessHistograms(const char*
+ const ProcessMonitor::Metrics& metrics) {
+ RecordAverageCPUUsage(histogram_suffix, metrics.cpu_usage);
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ base::UmaHistogramCounts10000(
+ base::StrCat({"PerformanceMonitor.IdleWakeups2.", histogram_suffix}),
+ metrics.idle_wakeups);
diff --git a/chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.cc b/chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.cc
new file mode 100644
index 0000000000..cbd54089bd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/power/process_monitor.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/power/process_monitor.cc
+@@ -65,7 +65,7 @@ ProcessMonitor::Metrics SampleMetrics(ba
+ process_metrics.GetPlatformIndependentCPUUsage());
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ metrics.idle_wakeups = process_metrics.GetIdleWakeupsPerSecond();
+ #endif
+ #if BUILDFLAG(IS_MAC)
+@@ -83,7 +83,7 @@ void ScaleMetrics(ProcessMonitor::Metric
+ }
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ metrics->idle_wakeups *= factor;
+ #endif
+
+@@ -157,7 +157,7 @@ ProcessMonitor::Metrics& operator+=(Proc
+ }
+
+ #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/chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.h b/chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.h
new file mode 100644
index 0000000000..dd902b5c65
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_metrics_power_process__monitor.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/metrics/power/process_monitor.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/metrics/power/process_monitor.h
+@@ -76,7 +76,7 @@ class ProcessMonitor : public content::B
+ std::optional<double> cpu_usage;
+
+ #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/chromium-next/patches/patch-chrome_browser_net_profile__network__context__service.cc b/chromium-next/patches/patch-chrome_browser_net_profile__network__context__service.cc
new file mode 100644
index 0000000000..91494bc2ee
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_net_profile__network__context__service.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/net/profile_network_context_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/net/profile_network_context_service.cc
+@@ -143,7 +143,7 @@
+ #include "chromeos/startup/browser_params_proxy.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/client_certificates/certificate_provisioning_service_factory.h"
+ #include "components/enterprise/client_certificates/core/certificate_provisioning_service.h"
+ #include "components/enterprise/client_certificates/core/client_certificates_service.h"
+@@ -268,7 +268,7 @@ void UpdateCookieSettings(Profile* profi
+ });
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<net::ClientCertStore> GetWrappedCertStore(
+ Profile* profile,
+ std::unique_ptr<net::ClientCertStore> platform_store) {
+@@ -1159,7 +1159,7 @@ ProfileNetworkContextService::CreateClie
+ store = std::make_unique<ClientCertStoreLacros>(
+ std::move(certificate_provider), cert_db_initializer, std::move(store));
+ #endif // BUILDFLAG(IS_CHROMEOS_LACROS)
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return GetWrappedCertStore(profile_, std::move(store));
+ #else
+ return store;
diff --git a/chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.cc b/chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.cc
new file mode 100644
index 0000000000..c02e9f809f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.cc
@@ -0,0 +1,153 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/net/system_network_context_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/net/system_network_context_manager.cc
+@@ -102,7 +102,7 @@
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/common/chrome_paths_internal.h"
+ #include "chrome/grit/branded_strings.h"
+ #include "ui/base/l10n/l10n_util.h"
+@@ -146,7 +146,7 @@ SystemNetworkContextManager* g_system_ne
+ // received a failed launch for a sandboxed network service.
+ bool g_previously_failed_to_launch_sandboxed_service = false;
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Whether kerberos library loading will work in the network service due to the
+ // sandbox.
+ bool g_network_service_will_allow_gssapi_library_load = false;
+@@ -154,7 +154,7 @@ bool g_network_service_will_allow_gssapi
+ const char* kGssapiDesiredPref =
+ #if BUILDFLAG(IS_CHROMEOS)
+ prefs::kKerberosEnabled;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ prefs::kReceivedHttpAuthNegotiateHeader;
+ #endif
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+@@ -200,7 +200,7 @@ network::mojom::HttpAuthDynamicParamsPtr
+ auth_dynamic_params->basic_over_http_enabled =
+ local_state->GetBoolean(prefs::kBasicAuthOverHttpEnabled);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ auth_dynamic_params->delegate_by_kdc_policy =
+ local_state->GetBoolean(prefs::kAuthNegotiateDelegateByKdcPolicy);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
+@@ -215,7 +215,7 @@ network::mojom::HttpAuthDynamicParamsPtr
+ local_state->GetString(prefs::kAuthAndroidNegotiateAccountType);
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auth_dynamic_params->allow_gssapi_library_load =
+ local_state->GetBoolean(kGssapiDesiredPref);
+ #endif // BUILDFLAG(IS_CHROMEOS)
+@@ -225,7 +225,7 @@ network::mojom::HttpAuthDynamicParamsPtr
+
+ void OnNewHttpAuthDynamicParams(
+ network::mojom::HttpAuthDynamicParamsPtr& params) {
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The kerberos library is incompatible with the network service sandbox, so
+ // if library loading is now enabled, the network service needs to be
+ // restarted. It will be restarted unsandboxed because is
+@@ -267,11 +267,11 @@ NetworkSandboxState IsNetworkSandboxEnab
+ if (g_previously_failed_to_launch_sandboxed_service) {
+ return NetworkSandboxState::kDisabledBecauseOfFailedLaunch;
+ }
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* local_state = g_browser_process->local_state();
+ #endif
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The network service sandbox and the kerberos library are incompatible.
+ // If kerberos is enabled by policy, disable the network service sandbox.
+ if (g_network_service_will_allow_gssapi_library_load ||
+@@ -287,7 +287,7 @@ NetworkSandboxState IsNetworkSandboxEnab
+ }
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (local_state &&
+ local_state->HasPrefPath(prefs::kNetworkServiceSandboxEnabled)) {
+ return local_state->GetBoolean(prefs::kNetworkServiceSandboxEnabled)
+@@ -518,7 +518,7 @@ void SystemNetworkContextManager::Delete
+ g_system_network_context_manager = nullptr;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ SystemNetworkContextManager::GssapiLibraryLoadObserver::
+ GssapiLibraryLoadObserver(SystemNetworkContextManager* owner)
+ : owner_(owner) {}
+@@ -576,7 +576,7 @@ SystemNetworkContextManager::SystemNetwo
+ pref_change_registrar_.Add(prefs::kAllHttpAuthSchemesAllowedForOrigins,
+ auth_pref_callback);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ pref_change_registrar_.Add(prefs::kAuthNegotiateDelegateByKdcPolicy,
+ auth_pref_callback);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
+@@ -590,7 +590,7 @@ SystemNetworkContextManager::SystemNetwo
+ auth_pref_callback);
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ pref_change_registrar_.Add(kGssapiDesiredPref, auth_pref_callback);
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
+@@ -661,7 +661,7 @@ void SystemNetworkContextManager::Regist
+ registry->RegisterBooleanPref(prefs::kKerberosEnabled, false);
+ #endif // BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kAuthNegotiateDelegateByKdcPolicy,
+ false);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
+@@ -686,11 +686,11 @@ void SystemNetworkContextManager::Regist
+
+ registry->RegisterListPref(prefs::kExplicitlyAllowedNetworkPorts);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kNetworkServiceSandboxEnabled, true);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kReceivedHttpAuthNegotiateHeader, false);
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -743,7 +743,7 @@ void SystemNetworkContextManager::OnNetw
+ OnNewHttpAuthDynamicParams(http_auth_dynamic_params);
+ network_service->ConfigureHttpAuthPrefs(std::move(http_auth_dynamic_params));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ gssapi_library_loader_observer_.Install(network_service);
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -966,7 +966,7 @@ bool SystemNetworkContextManager::IsNetw
+ break;
+ }
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!enabled) {
+ g_network_service_will_allow_gssapi_library_load = true;
+ }
diff --git a/chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.h b/chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.h
new file mode 100644
index 0000000000..8d0b143066
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_net_system__network__context__manager.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/net/system_network_context_manager.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/net/system_network_context_manager.h
+@@ -198,7 +198,7 @@ class SystemNetworkContextManager {
+ class URLLoaderFactoryForSystem;
+ class NetworkProcessLaunchWatcher;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class GssapiLibraryLoadObserver
+ : public network::mojom::GssapiLibraryLoadObserver {
+ public:
+@@ -279,7 +279,7 @@ class SystemNetworkContextManager {
+ std::unique_ptr<NetworkAnnotationMonitor> network_annotation_monitor_;
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ GssapiLibraryLoadObserver gssapi_library_loader_observer_{this};
+ #endif // BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-chrome_browser_new__tab__page_modules_file__suggestion_drive__service.cc b/chromium-next/patches/patch-chrome_browser_new__tab__page_modules_file__suggestion_drive__service.cc
new file mode 100644
index 0000000000..d41cd1b9e2
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_new__tab__page_modules_file__suggestion_drive__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/new_tab_page/modules/file_suggestion/drive_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/new_tab_page/modules/file_suggestion/drive_service.cc
+@@ -34,7 +34,7 @@
+ #include "services/network/public/cpp/resource_request.h"
+
+ namespace {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr char kPlatform[] = "LINUX";
+ #elif BUILDFLAG(IS_WIN)
+ constexpr char kPlatform[] = "WINDOWS";
diff --git a/chromium-next/patches/patch-chrome_browser_new__tab__page_new__tab__page__util.cc b/chromium-next/patches/patch-chrome_browser_new__tab__page_new__tab__page__util.cc
new file mode 100644
index 0000000000..462d567503
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_new__tab__page_new__tab__page__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/new_tab_page/new_tab_page_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/new_tab_page/new_tab_page_util.cc
+@@ -25,7 +25,7 @@ bool IsOsSupportedForCart() {
+ }
+
+ bool IsOsSupportedForDrive() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-chrome_browser_notifications_notification__display__service__impl.cc b/chromium-next/patches/patch-chrome_browser_notifications_notification__display__service__impl.cc
new file mode 100644
index 0000000000..0e0a5b16dd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_notifications_notification__display__service__impl.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/notifications/notification_display_service_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/notifications/notification_display_service_impl.cc
+@@ -32,7 +32,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/send_tab_to_self/desktop_notification_handler.h"
+ #include "chrome/browser/sharing/sharing_notification_handler.h"
+ #endif
+@@ -57,7 +57,7 @@ NotificationDisplayServiceImpl* Notifica
+ // static
+ void NotificationDisplayServiceImpl::RegisterProfilePrefs(
+ user_prefs::PrefRegistrySyncable* registry) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kAllowSystemNotifications, true);
+ #endif
+ }
+@@ -73,7 +73,7 @@ NotificationDisplayServiceImpl::Notifica
+ std::make_unique<PersistentNotificationHandler>());
+
+ #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<send_tab_to_self::DesktopNotificationHandler>(
+@@ -81,7 +81,7 @@ NotificationDisplayServiceImpl::Notifica
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ AddNotificationHandler(
+ NotificationHandler::Type::TAILORED_SECURITY,
+ std::make_unique<safe_browsing::TailoredSecurityNotificationHandler>());
diff --git a/chromium-next/patches/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc b/chromium-next/patches/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc
new file mode 100644
index 0000000000..3690dad1fc
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/notifications/notification_platform_bridge_delegator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/notifications/notification_platform_bridge_delegator.cc
+@@ -56,7 +56,7 @@ bool SystemNotificationsEnabled(Profile*
+ #elif BUILDFLAG(IS_WIN)
+ return NotificationPlatformBridgeWin::SystemNotificationEnabled();
+ #else
+-#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/chromium-next/patches/patch-chrome_browser_password__manager_chrome__password__manager__client.cc b/chromium-next/patches/patch-chrome_browser_password__manager_chrome__password__manager__client.cc
new file mode 100644
index 0000000000..57637c5382
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_password__manager_chrome__password__manager__client.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/password_manager/chrome_password_manager_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/password_manager/chrome_password_manager_client.cc
+@@ -620,7 +620,7 @@ void ChromePasswordManagerClient::
+ bool ChromePasswordManagerClient::IsReauthBeforeFillingRequired(
+ device_reauth::DeviceAuthenticator* authenticator) {
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!GetLocalStatePrefs() || !GetPrefs() || !authenticator) {
+ return false;
+ }
+@@ -876,7 +876,7 @@ void ChromePasswordManagerClient::Notify
+ }
+
+ void ChromePasswordManagerClient::NotifyKeychainError() {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ PasswordsClientUIDelegate* manage_passwords_ui_controller =
+ PasswordsClientUIDelegateFromWebContents(web_contents());
+ if (manage_passwords_ui_controller) {
diff --git a/chromium-next/patches/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc b/chromium-next/patches/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc
new file mode 100644
index 0000000000..d06a51efd3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/password_manager/password_reuse_manager_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/password_manager/password_reuse_manager_factory.cc
+@@ -141,7 +141,7 @@ PasswordReuseManagerFactory::BuildServic
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<password_manager::PasswordReuseManagerSigninNotifier>
+ notifier = std::make_unique<
+ password_manager::PasswordReuseManagerSigninNotifierImpl>(
diff --git a/chromium-next/patches/patch-chrome_browser_platform__util__linux.cc b/chromium-next/patches/patch-chrome_browser_platform__util__linux.cc
new file mode 100644
index 0000000000..1cacfb4e95
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_platform__util__linux.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/platform_util_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/platform_util_linux.cc
+@@ -222,7 +222,9 @@ void OnLaunchOptionsCreated(const std::s
+ argv.push_back(command);
+ argv.push_back(arg);
+ options.current_directory = working_directory;
++#if !BUILDFLAG(IS_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/chromium-next/patches/patch-chrome_browser_policy_browser__signin__policy__handler.cc b/chromium-next/patches/patch-chrome_browser_policy_browser__signin__policy__handler.cc
new file mode 100644
index 0000000000..da3056e6b0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_policy_browser__signin__policy__handler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/policy/browser_signin_policy_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/policy/browser_signin_policy_handler.cc
+@@ -45,7 +45,7 @@ void BrowserSigninPolicyHandler::ApplyPo
+ policies.GetValue(policy_name(), base::Value::Type::INTEGER);
+ switch (static_cast<BrowserSigninMode>(value->GetInt())) {
+ case BrowserSigninMode::kForced:
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ prefs->SetValue(prefs::kForceBrowserSignin, base::Value(true));
+ #endif
+ [[fallthrough]];
diff --git a/chromium-next/patches/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc b/chromium-next/patches/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc
new file mode 100644
index 0000000000..1f139a6e2e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/policy/chrome_browser_cloud_management_controller_desktop.cc
+@@ -57,7 +57,7 @@
+ #include "chrome/browser/policy/browser_dm_token_storage_mac.h"
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/policy/browser_dm_token_storage_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -66,7 +66,7 @@
+ #include "chrome/install_static/install_util.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/device_trust_key_manager_impl.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/key_rotation_launcher.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
+@@ -106,7 +106,7 @@ void ChromeBrowserCloudManagementControl
+
+ #if BUILDFLAG(IS_MAC)
+ storage_delegate = std::make_unique<BrowserDMTokenStorageMac>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ storage_delegate = std::make_unique<BrowserDMTokenStorageLinux>();
+ #elif BUILDFLAG(IS_WIN)
+ storage_delegate = std::make_unique<BrowserDMTokenStorageWin>();
+@@ -277,7 +277,7 @@ ChromeBrowserCloudManagementControllerDe
+
+ std::unique_ptr<enterprise_connectors::DeviceTrustKeyManager>
+ ChromeBrowserCloudManagementControllerDesktop::CreateDeviceTrustKeyManager() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ auto* browser_dm_token_storage = BrowserDMTokenStorage::Get();
+ auto* device_management_service = GetDeviceManagementService();
+ auto shared_url_loader_factory = GetSharedURLLoaderFactory();
diff --git a/chromium-next/patches/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc b/chromium-next/patches/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc
new file mode 100644
index 0000000000..6b74485642
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc
@@ -0,0 +1,269 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/policy/configuration_policy_handler_list_factory.cc
+@@ -252,19 +252,19 @@
+ #include "components/spellcheck/browser/pref_names.h"
+ #endif // BUILDFLAG(ENABLE_SPELLCHECK)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/idle/action.h"
+ #include "chrome/browser/enterprise/signin/enterprise_signin_prefs.h"
+ #include "components/device_signals/core/browser/pref_names.h" // nogncheck due to crbug.com/1125897
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "components/enterprise/idle/idle_timeout_policy_handler.h"
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/privacy_sandbox/privacy_sandbox_policy_handler.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+@@ -278,13 +278,13 @@
+ #endif // BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/policy/battery_saver_policy_handler.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/search_engines/enterprise/search_aggregator_policy_handler.h"
+ #include "components/search_engines/enterprise/site_search_policy_handler.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+@@ -576,7 +576,7 @@ const PolicyToPreferenceMapEntry kSimple
+ { key::kDefaultDirectSocketsSetting,
+ prefs::kManagedDefaultDirectSocketsSetting,
+ base::Value::Type::INTEGER },
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kDeletingUndecryptablePasswordsEnabled,
+ password_manager::prefs::kDeletingUndecryptablePasswordsEnabled,
+ base::Value::Type::BOOLEAN },
+@@ -927,7 +927,7 @@ const PolicyToPreferenceMapEntry kSimple
+ prefs::kManagedDefaultGeolocationSetting,
+ base::Value::Type::INTEGER },
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) \
+- || BUILDFLAG(IS_MAC)
++ || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ { key::kRequireOnlineRevocationChecksForLocalAnchors,
+ prefs::kCertRevocationCheckingRequiredLocalAnchors,
+ base::Value::Type::BOOLEAN },
+@@ -936,7 +936,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::BOOLEAN },
+ #endif // #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+ // || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ { key::kFullscreenAllowed,
+ prefs::kFullscreenAllowed,
+ base::Value::Type::BOOLEAN },
+@@ -1773,7 +1773,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::BOOLEAN },
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kGSSAPILibraryName,
+ prefs::kGSSAPILibraryName,
+ base::Value::Type::STRING },
+@@ -1832,7 +1832,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::BOOLEAN },
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kNetworkServiceSandboxEnabled,
+ prefs::kNetworkServiceSandboxEnabled,
+ base::Value::Type::BOOLEAN },
+@@ -1858,12 +1858,12 @@ const PolicyToPreferenceMapEntry kSimple
+ prefs::kTotalMemoryLimitMb,
+ base::Value::Type::INTEGER },
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kBackgroundModeEnabled,
+ prefs::kBackgroundModeEnabled,
+ base::Value::Type::BOOLEAN },
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kUnmanagedDeviceSignalsConsentFlowEnabled,
+ device_signals::prefs::kUnmanagedDeviceSignalsConsentFlowEnabled,
+ base::Value::Type::BOOLEAN },
+@@ -1871,7 +1871,7 @@ const PolicyToPreferenceMapEntry kSimple
+ prefs::kProfileSeparationDomainExceptionList,
+ base::Value::Type::LIST },
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kDefaultBrowserSettingEnabled,
+ prefs::kDefaultBrowserSettingEnabled,
+ base::Value::Type::BOOLEAN },
+@@ -1883,7 +1883,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::BOOLEAN },
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) \
+- || BUILDFLAG(IS_CHROMEOS)
++ || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ { key::kAutoplayAllowed,
+ prefs::kAutoplayAllowed,
+ base::Value::Type::BOOLEAN },
+@@ -1984,7 +1984,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::BOOLEAN },
+ #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ { key::kAlternativeBrowserPath,
+ browser_switcher::prefs::kAlternativeBrowserPath,
+ base::Value::Type::STRING },
+@@ -2089,7 +2089,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::LIST },
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#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 },
+@@ -2168,7 +2168,7 @@ const PolicyToPreferenceMapEntry kSimple
+ ash::prefs::kUrlParameterToAutofillSAMLUsername,
+ base::Value::Type::STRING },
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ { key::kTabDiscardingExceptions,
+ performance_manager::user_tuning::prefs::kManagedTabDiscardingExceptions,
+ base::Value::Type::LIST },
+@@ -2197,7 +2197,7 @@ const PolicyToPreferenceMapEntry kSimple
+ prefs::kUiAutomationProviderEnabled,
+ base::Value::Type::BOOLEAN },
+ #endif // BUILDFLAG(IS_WIN)
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kOutOfProcessSystemDnsResolutionEnabled,
+ prefs::kOutOfProcessSystemDnsResolutionEnabled,
+ base::Value::Type::BOOLEAN },
+@@ -2240,7 +2240,7 @@ const PolicyToPreferenceMapEntry kSimple
+ base::Value::Type::INTEGER },
+ #endif
+ #if BUILDFLAG(ENABLE_EXTENSIONS)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ { key::kExtensionInstallTypeBlocklist,
+ extensions::pref_names::kExtensionInstallTypeBlocklist,
+ base::Value::Type::LIST},
+@@ -2266,7 +2266,7 @@ const PolicyToPreferenceMapEntry kSimple
+ { key::kTabCompareSettings,
+ optimization_guide::prefs::kProductSpecificationsEnterprisePolicyAllowed,
+ base::Value::Type::INTEGER},
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ { key::kChromeForTestingAllowed,
+ prefs::kChromeForTestingAllowed,
+ base::Value::Type::BOOLEAN },
+@@ -2422,7 +2422,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ // Policies for all platforms - End
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(std::make_unique<IntRangePolicyHandler>(
+ key::kMemorySaverModeSavings,
+ performance_manager::user_tuning::prefs::kMemorySaverModeAggressiveness,
+@@ -2438,7 +2438,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(
+ std::make_unique<SiteSearchPolicyHandler>(chrome_schema));
+ handlers->AddHandler(
+@@ -2647,7 +2647,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(
+ std::make_unique<enterprise_idle::IdleTimeoutPolicyHandler>());
+ handlers->AddHandler(
+@@ -2700,7 +2700,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ key::kBrowsingDataLifetime, browsing_data::prefs::kBrowsingDataLifetime,
+ chrome_schema));
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(std::make_unique<LocalSyncPolicyHandler>());
+ handlers->AddHandler(std::make_unique<ThemeColorPolicyHandler>());
+ handlers->AddHandler(
+@@ -2791,7 +2791,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ std::vector<std::unique_ptr<ConfigurationPolicyHandler>>
+ signin_legacy_policies;
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_LINUX)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ signin_legacy_policies.push_back(std::make_unique<SimplePolicyHandler>(
+ key::kForceBrowserSignin, prefs::kForceBrowserSignin,
+ base::Value::Type::BOOLEAN));
+@@ -3160,7 +3160,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ #endif
+
+ #if BUILDFLAG(ENABLE_SPELLCHECK)
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(std::make_unique<SpellcheckLanguagePolicyHandler>());
+ handlers->AddHandler(
+ std::make_unique<SpellcheckLanguageBlocklistPolicyHandler>(
+@@ -3168,7 +3168,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+ #endif // BUILDFLAG(ENABLE_SPELLCHECK)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(std::make_unique<SimplePolicyHandler>(
+ key::kAllowSystemNotifications, prefs::kAllowSystemNotifications,
+ base::Value::Type::BOOLEAN));
+@@ -3186,7 +3186,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ first_party_sets::FirstPartySetsOverridesPolicyHandler>(
+ key::kRelatedWebsiteSetsOverrides, chrome_schema)));
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(std::make_unique<PrivacySandboxPolicyHandler>());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+@@ -3209,7 +3209,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ base::Value::Type::BOOLEAN)));
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ handlers->AddHandler(std::make_unique<BatterySaverPolicyHandler>());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -3233,7 +3233,7 @@ std::unique_ptr<ConfigurationPolicyHandl
+ std::vector<GenAiDefaultSettingsPolicyHandler::GenAiPolicyDetails>
+ gen_ai_default_policies;
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ gen_ai_default_policies.emplace_back(
+ key::kAutofillPredictionSettings,
+ optimization_guide::prefs::
diff --git a/chromium-next/patches/patch-chrome_browser_policy_device__management__service__configuration.cc b/chromium-next/patches/patch-chrome_browser_policy_device__management__service__configuration.cc
new file mode 100644
index 0000000000..eb4eafc157
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_policy_device__management__service__configuration.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/policy/device_management_service_configuration.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/policy/device_management_service_configuration.cc
+@@ -23,7 +23,7 @@
+
+ #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"
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_policy_policy__value__and__status__aggregator.cc b/chromium-next/patches/patch-chrome_browser_policy_policy__value__and__status__aggregator.cc
new file mode 100644
index 0000000000..a0848745d7
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_policy_policy__value__and__status__aggregator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/policy/policy_value_and_status_aggregator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/policy/policy_value_and_status_aggregator.cc
+@@ -53,7 +53,7 @@
+ #include "chrome/browser/policy/value_provider/extension_policies_value_provider.h"
+ #endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "components/policy/core/common/cloud/profile_cloud_policy_manager.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-chrome_browser_prefs_browser__prefs.cc b/chromium-next/patches/patch-chrome_browser_prefs_browser__prefs.cc
new file mode 100644
index 0000000000..8fdd54cc3d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_prefs_browser__prefs.cc
@@ -0,0 +1,81 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/prefs/browser_prefs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/prefs/browser_prefs.cc
+@@ -314,7 +314,7 @@
+ #include "components/user_notes/user_notes_prefs.h"
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/whats_new/whats_new_ui.h"
+ #endif
+
+@@ -485,18 +485,18 @@
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "components/device_signals/core/browser/pref_names.h" // nogncheck due to crbug.com/1125897
+ #endif
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ #include "chrome/browser/browser_switcher/browser_switcher_prefs.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/signin/enterprise_signin_prefs.h"
+ #endif
+
+@@ -531,7 +531,7 @@
+ #include "chrome/browser/sessions/session_service_log.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/color/system_theme.h"
+ #endif
+
+@@ -1719,7 +1719,7 @@ void RegisterLocalState(PrefRegistrySimp
+ on_device_translation::RegisterLocalStatePrefs(registry);
+ #endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ WhatsNewUI::RegisterLocalStatePrefs(registry);
+ #endif
+
+@@ -1892,7 +1892,7 @@ void RegisterLocalState(PrefRegistrySimp
+ #endif // BUILDFLAG(ENABLE_PDF)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kChromeForTestingAllowed, true);
+ #endif
+
+@@ -2248,12 +2248,12 @@ void RegisterProfilePrefs(user_prefs::Pr
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ device_signals::RegisterProfilePrefs(registry);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ browser_switcher::BrowserSwitcherPrefs::RegisterProfilePrefs(registry);
+ enterprise_signin::RegisterProfilePrefs(registry);
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc b/chromium-next/patches/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc
new file mode 100644
index 0000000000..ec36bf9ed3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/prefs/pref_service_incognito_allowlist.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/prefs/pref_service_incognito_allowlist.cc
+@@ -205,7 +205,7 @@ const char* const kPersistentPrefNames[]
+ prefs::kShowFullscreenToolbar,
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || 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/chromium-next/patches/patch-chrome_browser_printing_print__backend__service__manager.cc b/chromium-next/patches/patch-chrome_browser_printing_print__backend__service__manager.cc
new file mode 100644
index 0000000000..067c51bf8f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_printing_print__backend__service__manager.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/printing/print_backend_service_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/printing/print_backend_service_manager.cc
+@@ -36,7 +36,7 @@
+ #include "printing/printing_context.h"
+ #include "printing/printing_features.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "content/public/common/content_switches.h"
+ #endif
+
+@@ -883,7 +883,7 @@ PrintBackendServiceManager::GetServiceFr
+ host.BindNewPipeAndPassReceiver(),
+ content::ServiceProcessHost::Options()
+ .WithDisplayName(IDS_UTILITY_PROCESS_PRINT_BACKEND_SERVICE_NAME)
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ .WithExtraCommandLineSwitches({switches::kMessageLoopTypeUi})
+ #endif
+ .Pass());
+@@ -1060,7 +1060,7 @@ PrintBackendServiceManager::DetermineIdl
+ return kNoClientsRegisteredResetOnIdleTimeout;
+
+ case ClientType::kQueryWithUi:
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // No need to update if there were other query with UI clients.
+ if (HasQueryWithUiClientForRemoteId(remote_id)) {
+ return std::nullopt;
diff --git a/chromium-next/patches/patch-chrome_browser_printing_printer__query.cc b/chromium-next/patches/patch-chrome_browser_printing_printer__query.cc
new file mode 100644
index 0000000000..ee11a55607
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_printing_printer__query.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/printing/printer_query.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/printing/printer_query.cc
+@@ -341,7 +341,7 @@ void PrinterQuery::UpdatePrintSettings(b
+ crash_key = std::make_unique<crash_keys::ScopedPrinterInfo>(
+ printer_name, print_backend->GetPrinterDriverInfo(printer_name));
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_CUPS)
++#if (BUILDFLAG(IS_BSD) || BUILDFLAG(IS_LINUX)) && BUILDFLAG(USE_CUPS)
+ PrinterBasicInfo basic_info;
+ if (print_backend->GetPrinterBasicInfo(printer_name, &basic_info) ==
+ mojom::ResultCode::kSuccess) {
diff --git a/chromium-next/patches/patch-chrome_browser_process__singleton__posix.cc b/chromium-next/patches/patch-chrome_browser_process__singleton__posix.cc
new file mode 100644
index 0000000000..d096370676
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_process__singleton__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/process_singleton_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/process_singleton_posix.cc
+@@ -102,7 +102,7 @@
+ #include "ui/base/l10n/l10n_util.h"
+ #include "ui/base/resource/scoped_startup_resource_bundle.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/process_singleton_dialog_linux.h"
+ #endif
+
+@@ -360,7 +360,7 @@ bool DisplayProfileInUseError(const base
+ if (g_disable_prompt)
+ return g_user_opted_unlock_in_use_profile;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::u16string relaunch_button_text =
+ l10n_util::GetStringUTF16(IDS_PROFILE_IN_USE_LINUX_RELAUNCH);
+ return ShowProcessSingletonDialog(error, relaunch_button_text);
diff --git a/chromium-next/patches/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc b/chromium-next/patches/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc
new file mode 100644
index 0000000000..d7ac4abdb6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc
@@ -0,0 +1,124 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
+@@ -352,7 +352,7 @@
+ #include "chrome/browser/profiles/gaia_info_update_service_factory.h"
+ #endif
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/policy/messaging_layer/util/manual_test_heartbeat_event_factory.h"
+ #endif
+
+@@ -433,18 +433,18 @@
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.h"
+ #include "chrome/browser/enterprise/signals/user_permission_service_factory.h"
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/idle/idle_service_factory.h"
+ #endif
+
+-#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/browser_switcher/browser_switcher_service_factory.h"
+ #include "chrome/browser/enterprise/client_certificates/certificate_provisioning_service_factory.h"
+ #include "chrome/browser/enterprise/client_certificates/certificate_store_factory.h"
+@@ -719,7 +719,7 @@ void ChromeBrowserMainExtraPartsProfiles
+ DiceBoundSessionCookieServiceFactory::GetInstance();
+ #endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
+ #endif // BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ browser_switcher::BrowserSwitcherServiceFactory::GetInstance();
+ #endif
+ browser_sync::UserEventServiceFactory::GetInstance();
+@@ -829,7 +829,7 @@ void ChromeBrowserMainExtraPartsProfiles
+ enterprise_connectors::ConnectorsServiceFactory::GetInstance();
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ enterprise_connectors::DeviceTrustConnectorServiceFactory::GetInstance();
+ enterprise_connectors::DeviceTrustServiceFactory::GetInstance();
+ #endif
+@@ -837,25 +837,25 @@ void ChromeBrowserMainExtraPartsProfiles
+ enterprise_connectors::ExtensionInstallEventRouterFactory::GetInstance();
+ enterprise_connectors::ExtensionTelemetryEventRouterFactory::GetInstance();
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ enterprise_connectors::LocalBinaryUploadServiceFactory::GetInstance();
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ enterprise_idle::IdleServiceFactory::GetInstance();
+ #endif
+ #if !BUILDFLAG(IS_CHROMEOS)
+ enterprise_reporting::CloudProfileReportingServiceFactory::GetInstance();
+ #endif
+ enterprise_reporting::LegacyTechServiceFactory::GetInstance();
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ enterprise_signals::SignalsAggregatorFactory::GetInstance();
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ enterprise_signals::UserPermissionServiceFactory::GetInstance();
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ enterprise_signin::EnterpriseSigninServiceFactory::GetInstance();
+ #endif
+ #if BUILDFLAG(ENABLE_SESSION_SERVICE)
+@@ -975,7 +975,7 @@ void ChromeBrowserMainExtraPartsProfiles
+ #if BUILDFLAG(IS_ANDROID)
+ MerchantViewerDataManagerFactory::GetInstance();
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ metrics::DesktopProfileSessionDurationsServiceFactory::GetInstance();
+ #endif
+ NavigationPredictorKeyedServiceFactory::GetInstance();
+@@ -1080,7 +1080,7 @@ void ChromeBrowserMainExtraPartsProfiles
+ #if BUILDFLAG(IS_CHROMEOS)
+ policy::PolicyCertServiceFactory::GetInstance();
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ policy::ProfileTokenPolicyWebSigninServiceFactory::GetInstance();
+ policy::UserPolicyOidcSigninServiceFactory::GetInstance();
+ #endif
+@@ -1127,7 +1127,7 @@ void ChromeBrowserMainExtraPartsProfiles
+ #if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
+ ProfileStatisticsFactory::GetInstance();
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ProfileTokenWebSigninInterceptorFactory::GetInstance();
+ OidcAuthenticationSigninInterceptorFactory::GetInstance();
+ #endif
+@@ -1146,7 +1146,7 @@ void ChromeBrowserMainExtraPartsProfiles
+ #endif
+ ReduceAcceptLanguageFactory::GetInstance();
+ RendererUpdaterFactory::GetInstance();
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ reporting::ManualTestHeartbeatEventFactory::GetInstance();
+ #endif
+ #if !BUILDFLAG(IS_ANDROID)
diff --git a/chromium-next/patches/patch-chrome_browser_profiles_profile__impl.cc b/chromium-next/patches/patch-chrome_browser_profiles_profile__impl.cc
new file mode 100644
index 0000000000..45815e8946
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_profiles_profile__impl.cc
@@ -0,0 +1,46 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/profiles/profile_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/profiles/profile_impl.cc
+@@ -267,6 +267,10 @@
+ #include "chrome/browser/spellchecker/spellcheck_service.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#endif
++
+ using bookmarks::BookmarkModel;
+ using content::BrowserThread;
+ using content::DownloadManagerDelegate;
+@@ -591,7 +595,7 @@ void ProfileImpl::LoadPrefsForNormalStar
+ policy_provider = GetUserCloudPolicyManagerAsh();
+ #else // !BUILDFLAG(IS_CHROMEOS)
+ {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ ProfileAttributesEntry* entry =
+ profile_manager->GetProfileAttributesStorage()
+@@ -901,7 +905,17 @@ void ProfileImpl::DoFinalInit(CreateMode
+ }
+
+ base::FilePath ProfileImpl::last_selected_directory() {
++#if BUILDFLAG(IS_OPENBSD)
++ // If unveil(2) is used, force the file dialog directory to something we
++ // know is available.
++ auto* sandbox = sandbox::policy::SandboxLinux::GetInstance();
++ if (sandbox->unveil_initialized())
++ return GetPrefs()->GetFilePath(prefs::kDownloadDefaultDirectory);
++ else
++ return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
++#else
+ return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
++#endif
+ }
+
+ void ProfileImpl::set_last_selected_directory(const base::FilePath& path) {
diff --git a/chromium-next/patches/patch-chrome_browser_profiles_profiles__state.cc b/chromium-next/patches/patch-chrome_browser_profiles_profiles__state.cc
new file mode 100644
index 0000000000..ec8366635a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_profiles_profiles__state.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/profiles/profiles_state.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/profiles/profiles_state.cc
+@@ -190,7 +190,7 @@ bool IsGuestModeRequested(const base::Co
+ PrefService* local_state,
+ bool show_warning) {
+ #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.
+@@ -226,7 +226,7 @@ bool IsGuestModeEnabled() {
+ return false;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // If there are any supervised profiles, disable guest mode.
+ if (base::FeatureList::IsEnabled(
+ supervised_user::kHideGuestModeForSupervisedUsers) &&
+@@ -245,7 +245,7 @@ bool IsGuestModeEnabled() {
+ }
+
+ bool IsGuestModeEnabled(const Profile& profile) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(
+ supervised_user::kHideGuestModeForSupervisedUsers)) {
+ ProfileAttributesEntry* profile_attributes =
diff --git a/chromium-next/patches/patch-chrome_browser_renderer__preferences__util.cc b/chromium-next/patches/patch-chrome_browser_renderer__preferences__util.cc
new file mode 100644
index 0000000000..e79dc9cff3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_renderer__preferences__util.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/renderer_preferences_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/renderer_preferences_util.cc
+@@ -38,7 +38,7 @@
+ #include "ui/views/controls/textfield/textfield.h"
+ #endif
+
+-#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ #include "chrome/browser/themes/theme_service.h"
+ #include "chrome/browser/themes/theme_service_factory.h"
+ #include "ui/linux/linux_ui.h"
+@@ -150,7 +150,7 @@ void UpdateFromSystemSettings(blink::Ren
+ prefs->caret_blink_interval = views::Textfield::GetCaretBlinkInterval();
+ #endif
+
+-#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ auto* linux_ui_theme = ui::LinuxUiTheme::GetForProfile(profile);
+ if (linux_ui_theme) {
+ if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) {
+@@ -173,7 +173,7 @@ void UpdateFromSystemSettings(blink::Ren
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ content::UpdateFontRendererPreferencesFromSystemSettings(prefs);
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_resources_settings_autofill__page_passwords__shared.css b/chromium-next/patches/patch-chrome_browser_resources_settings_autofill__page_passwords__shared.css
new file mode 100644
index 0000000000..307f81dfce
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_resources_settings_autofill__page_passwords__shared.css
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/resources/settings/autofill_page/passwords_shared.css.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/resources/settings/autofill_page/passwords_shared.css
+@@ -100,7 +100,7 @@ cr-input.password-input::part(input),
+ * necessary to prevent Chrome from using the operating system's font
+ * instead of the Material Design font.
+ * TODO(dbeam): why not font: inherit? */
+-<if expr="is_linux or is_chromeos">
++<if expr="is_posix or is_chromeos">
+ font-family: 'DejaVu Sans Mono', monospace;
+ </if>
+ <if expr="is_win">
diff --git a/chromium-next/patches/patch-chrome_browser_resources_signin_signin__shared.css b/chromium-next/patches/patch-chrome_browser_resources_signin_signin__shared.css
new file mode 100644
index 0000000000..8c0d72a914
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_resources_signin_signin__shared.css
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/resources/signin/signin_shared.css.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/resources/signin/signin_shared.css
+@@ -54,7 +54,7 @@ a {
+ border-radius: var(--scrollbar-width);
+ }
+
+-<if expr="is_macosx or is_linux or is_chromeos">
++<if expr="is_macosx or is_posix or is_chromeos">
+ .action-container {
+ flex-flow: row-reverse;
+ justify-content: flex-start;
diff --git a/chromium-next/patches/patch-chrome_browser_safe__browsing_chrome__password__protection__service.cc b/chromium-next/patches/patch-chrome_browser_safe__browsing_chrome__password__protection__service.cc
new file mode 100644
index 0000000000..9165c231ca
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_safe__browsing_chrome__password__protection__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/safe_browsing/chrome_password_protection_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/safe_browsing/chrome_password_protection_service.cc
+@@ -1248,7 +1248,7 @@ std::string ChromePasswordProtectionServ
+ ReusedPasswordAccountType password_type) const {
+ if (base::FeatureList::IsEnabled(
+ safe_browsing::kEnterprisePasswordReuseUiRefresh)) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return GetPrefs()->GetString(prefs::kEnterpriseCustomLabel);
+ #else
+ return std::string();
diff --git a/chromium-next/patches/patch-chrome_browser_safe__browsing_cloud__content__scanning_binary__upload__service.cc b/chromium-next/patches/patch-chrome_browser_safe__browsing_cloud__content__scanning_binary__upload__service.cc
new file mode 100644
index 0000000000..5c1875b605
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_safe__browsing_cloud__content__scanning_binary__upload__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc
+@@ -18,7 +18,7 @@
+ #include "net/base/url_util.h"
+ #include "third_party/abseil-cpp/absl/types/variant.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/connectors/analysis/local_binary_upload_service_factory.h"
+ #endif
+
+@@ -437,7 +437,7 @@ BinaryUploadService* BinaryUploadService
+ Profile* profile,
+ const enterprise_connectors::AnalysisSettings& settings) {
+ // Local content analysis is supported only on desktop platforms.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (settings.cloud_or_local_settings.is_cloud_analysis()) {
+ return CloudBinaryUploadServiceFactory::GetForProfile(profile);
+ } else {
diff --git a/chromium-next/patches/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc b/chromium-next/patches/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc
new file mode 100644
index 0000000000..6cfecce9c8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
+@@ -696,7 +696,7 @@ void IncidentReportingService::OnEnviron
+
+ // Process::Current().CreationTime() is missing on some platforms.
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::TimeDelta uptime =
+ first_incident_time_ - base::Process::Current().CreationTime();
+ environment_data->mutable_process()->set_uptime_msec(uptime.InMilliseconds());
diff --git a/chromium-next/patches/patch-chrome_browser_safe__browsing_safe__browsing__service.cc b/chromium-next/patches/patch-chrome_browser_safe__browsing_safe__browsing__service.cc
new file mode 100644
index 0000000000..54d400d9b1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_safe__browsing_safe__browsing__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/safe_browsing/safe_browsing_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/safe_browsing/safe_browsing_service.cc
+@@ -83,7 +83,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/browser_finder.h"
+ #include "chrome/browser/ui/browser_window/public/browser_window_features.h"
+ #include "chrome/browser/ui/toasts/api/toast_id.h"
+@@ -554,7 +554,7 @@ base::CallbackListSubscription SafeBrows
+ void SafeBrowsingServiceImpl::EnhancedProtectionPrefChange(Profile* profile) {
+ RefreshState();
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (!base::FeatureList::IsEnabled(safe_browsing::kEsbAsASyncedSetting) ||
+ !profile) {
+ return;
diff --git a/chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__install__state.cc b/chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__install__state.cc
new file mode 100644
index 0000000000..7c6a039213
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__install__state.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/screen_ai/screen_ai_install_state.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/screen_ai/screen_ai_install_state.cc
+@@ -16,7 +16,7 @@
+ #include "services/screen_ai/public/cpp/utilities.h"
+ #include "ui/accessibility/accessibility_features.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/cpu.h"
+ #include "base/files/file_util.h"
+ #endif
+@@ -26,7 +26,7 @@ const int kScreenAICleanUpDelayInDays =
+ const char kMinExpectedVersion[] = "124.2";
+
+ bool IsDeviceCompatible() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #if defined(ARCH_CPU_X86_FAMILY)
+ // Check if the CPU has the required instruction set to run the Screen AI
+ // library.
diff --git a/chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__service__router.cc b/chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__service__router.cc
new file mode 100644
index 0000000000..a53581e0ab
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_screen__ai_screen__ai__service__router.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/screen_ai/screen_ai_service_router.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/screen_ai/screen_ai_service_router.cc
+@@ -318,7 +318,7 @@ void ScreenAIServiceRouter::LaunchIfNotR
+ base::FilePath binary_path = state_instance->get_component_binary_path();
+ #if BUILDFLAG(IS_WIN)
+ std::vector<base::FilePath> preload_libraries = {binary_path};
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::vector<std::string> extra_switches = {
+ base::StringPrintf("--%s=%s", screen_ai::GetBinaryPathSwitch(),
+ binary_path.MaybeAsASCII().c_str())};
+@@ -332,7 +332,7 @@ void ScreenAIServiceRouter::LaunchIfNotR
+ .WithPreloadedLibraries(
+ preload_libraries,
+ content::ServiceProcessHostPreloadLibraries::GetPassKey())
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ .WithExtraCommandLineSwitches(extra_switches)
+ #endif // BUILDFLAG(IS_WIN)
+ .Pass());
diff --git a/chromium-next/patches/patch-chrome_browser_send__tab__to__self_receiving__ui__handler__registry.cc b/chromium-next/patches/patch-chrome_browser_send__tab__to__self_receiving__ui__handler__registry.cc
new file mode 100644
index 0000000000..842820347a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_send__tab__to__self_receiving__ui__handler__registry.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/send_tab_to_self/receiving_ui_handler_registry.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/send_tab_to_self/receiving_ui_handler_registry.cc
+@@ -15,7 +15,7 @@
+ #include "components/send_tab_to_self/features.h"
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/send_tab_to_self/desktop_notification_handler.h"
+ #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_toolbar_icon_controller.h"
+ #endif
+@@ -47,7 +47,7 @@ SendTabToSelfToolbarIconController*
+ ReceivingUiHandlerRegistry::GetToolbarButtonControllerForProfile(
+ Profile* profile) {
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ for (const std::unique_ptr<ReceivingUiHandler>& handler :
+ applicable_handlers_) {
+ auto* button_controller =
diff --git a/chromium-next/patches/patch-chrome_browser_send__tab__to__self_send__tab__to__self__client__service.cc b/chromium-next/patches/patch-chrome_browser_send__tab__to__self_send__tab__to__self__client__service.cc
new file mode 100644
index 0000000000..21f12cdb5d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_send__tab__to__self_send__tab__to__self__client__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/send_tab_to_self/send_tab_to_self_client_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/send_tab_to_self/send_tab_to_self_client_service.cc
+@@ -16,7 +16,7 @@
+ #include "components/send_tab_to_self/send_tab_to_self_model.h"
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_toolbar_icon_controller.h"
+ #endif
+
+@@ -50,7 +50,7 @@ void SendTabToSelfClientService::Entries
+ const std::vector<const SendTabToSelfEntry*>& new_entries) {
+ for (const std::unique_ptr<ReceivingUiHandler>& handler : GetHandlers()) {
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Only respond to notifications corresponding to this service's profile
+ // for these OSes; mobile does not have a Profile.
+ // Cast note: on desktop, handlers are guaranteed to be the derived class
diff --git a/chromium-next/patches/patch-chrome_browser_sessions_session__restore.cc b/chromium-next/patches/patch-chrome_browser_sessions_session__restore.cc
new file mode 100644
index 0000000000..0fafb9acd8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_sessions_session__restore.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/sessions/session_restore.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/sessions/session_restore.cc
+@@ -102,7 +102,7 @@
+ #include "chrome/browser/web_applications/web_app_registrar.h"
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#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/webui/whats_new/whats_new_fetcher.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+@@ -1138,7 +1138,7 @@ class SessionRestoreImpl : public Browse
+ bool is_first_tab = true;
+ for (const auto& startup_tab : startup_tabs) {
+ const GURL& url = startup_tab.url;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (url == whats_new::GetWebUIStartupURL()) {
+ whats_new::StartWhatsNewFetch(browser);
+ continue;
diff --git a/chromium-next/patches/patch-chrome_browser_sharing_sharing__handler__registry__impl.cc b/chromium-next/patches/patch-chrome_browser_sharing_sharing__handler__registry__impl.cc
new file mode 100644
index 0000000000..74d134f4d5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_sharing_sharing__handler__registry__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/sharing/sharing_handler_registry_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/sharing/sharing_handler_registry_impl.cc
+@@ -22,7 +22,7 @@
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/sharing/shared_clipboard/remote_copy_message_handler.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS)) BUILDFLAG(IS_CHROMEOS)
+@@ -74,7 +74,7 @@ SharingHandlerRegistryImpl::SharingHandl
+ #endif // !BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (sharing_device_registration->IsRemoteCopySupported()) {
+ AddSharingHandler(
+ std::make_unique<RemoteCopyMessageHandler>(profile),
diff --git a/chromium-next/patches/patch-chrome_browser_shortcuts_icon__badging.cc b/chromium-next/patches/patch-chrome_browser_shortcuts_icon__badging.cc
new file mode 100644
index 0000000000..69b02022d6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_shortcuts_icon__badging.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/shortcuts/icon_badging.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/shortcuts/icon_badging.cc
+@@ -59,7 +59,7 @@ enum class BadgeSize {
+ constexpr ShortcutSize kSizesNeededForShortcutCreation[] = {
+ ShortcutSize::k16, ShortcutSize::k32, ShortcutSize::k128,
+ ShortcutSize::k256, ShortcutSize::k512};
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr ShortcutSize kSizesNeededForShortcutCreation[] = {ShortcutSize::k32,
+ ShortcutSize::k128};
+ #elif BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.cc b/chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.cc
new file mode 100644
index 0000000000..2404bf3adb
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/signin/accounts_policy_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/signin/accounts_policy_manager.cc
+@@ -39,7 +39,7 @@
+ #include "chrome/browser/ui/webui/profile_helper.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "components/policy/core/common/features.h"
+ #include "components/signin/public/identity_manager/accounts_mutator.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+@@ -207,7 +207,7 @@ void AccountsPolicyManager::Initialize()
+ &AccountsPolicyManager::OnGoogleServicesUsernamePatternChanged,
+ weak_pointer_factory_.GetWeakPtr()));
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* identity_manager = IdentityManagerFactory::GetForProfile(profile_);
+ identity_manager_observation_.Observe(identity_manager);
+ profile_pref_change_registrar_.Init(profile_->GetPrefs());
+@@ -222,7 +222,7 @@ void AccountsPolicyManager::Initialize()
+ }
+
+ void AccountsPolicyManager::Shutdown() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ profile_pref_change_registrar_.RemoveAll();
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+ local_state_pref_registrar_.RemoveAll();
+@@ -339,7 +339,7 @@ void AccountsPolicyManager::OnUserConfir
+ }
+ #endif // defined(TOOLKIT_VIEWS) && !BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void AccountsPolicyManager::OnRefreshTokensLoaded() {
+ RemoveUnallowedAccounts();
+ identity_manager_observation_.Reset();
diff --git a/chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.h b/chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.h
new file mode 100644
index 0000000000..cf884f392c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_signin_accounts__policy__manager.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/signin/accounts_policy_manager.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/signin/accounts_policy_manager.h
+@@ -13,7 +13,7 @@
+ #include "components/signin/public/base/signin_metrics.h"
+ #include "components/signin/public/identity_manager/identity_manager.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/scoped_observation.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+@@ -64,7 +64,7 @@ class AccountsPolicyManager : public Key
+ }
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void RemoveUnallowedAccounts();
+
+ // IdentityManager::Observer implementation.
+@@ -85,7 +85,7 @@ class AccountsPolicyManager : public Key
+ bool hide_ui_for_testing_ = false;
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ScopedObservation<signin::IdentityManager,
+ signin::IdentityManager::Observer>
+ identity_manager_observation_{this};
diff --git a/chromium-next/patches/patch-chrome_browser_signin_signin__util.cc b/chromium-next/patches/patch-chrome_browser_signin_signin__util.cc
new file mode 100644
index 0000000000..58dbda3518
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_signin_signin__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/signin/signin_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/signin/signin_util.cc
+@@ -81,7 +81,7 @@ CookiesMover::CookiesMover(base::WeakPtr
+ CookiesMover::~CookiesMover() = default;
+
+ void CookiesMover::StartMovingCookies() {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ bool allow_cookies_to_be_moved = base::FeatureList::IsEnabled(
+ profile_management::features::kThirdPartyProfileManagement);
+ #else
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_classify__url__navigation__throttle.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_classify__url__navigation__throttle.cc
new file mode 100644
index 0000000000..f7adb33efd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_classify__url__navigation__throttle.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/classify_url_navigation_throttle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/classify_url_navigation_throttle.cc
+@@ -220,7 +220,7 @@ void ClassifyUrlNavigationThrottle::OnIn
+ case SupervisedUserNavigationThrottle::kCancelWithInterstitial: {
+ CHECK(navigation_handle());
+ // LINT.IfChange(cancel_with_interstitial)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (ShouldShowReAuthInterstitial(*navigation_handle(), is_main_frame)) {
+ // Show the re-authentication interstitial if the user signed out of
+ // the content area, as parent's approval requires authentication.
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.cc
new file mode 100644
index 0000000000..271738744f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_browser_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_browser_utils.cc
+@@ -40,7 +40,7 @@
+ #include "chrome/browser/ash/profiles/profile_helper.h"
+ #include "components/user_manager/user.h"
+ #include "components/user_manager/user_type.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/supervised_user/supervised_user_verification_controller_client.h"
+ #include "chrome/browser/supervised_user/supervised_user_verification_page_blocked_sites.h"
+ #include "chrome/browser/supervised_user/supervised_user_verification_page_youtube.h"
+@@ -158,7 +158,7 @@ void AssertChildStatusOfTheUser(Profile*
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ std::string CreateReauthenticationInterstitialForYouTube(
+ content::NavigationHandle& navigation_handle) {
+ content::WebContents* web_contents = navigation_handle.GetWebContents();
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.h b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.h
new file mode 100644
index 0000000000..e2423917ae
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__browser__utils.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_browser_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_browser_utils.h
+@@ -52,7 +52,7 @@ std::string GetAccountGivenName(Profile&
+ // of the user.
+ void AssertChildStatusOfTheUser(Profile* profile, bool is_child);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Returns the html content of the reauthentication interstitial for blocked
+ // sites. This interstitial is associated with the given NavigationHandle.
+ std::string CreateReauthenticationInterstitialForBlockedSites(
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__delegate__impl.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__delegate__impl.cc
new file mode 100644
index 0000000000..38a7f71925
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__delegate__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_extensions_delegate_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_extensions_delegate_impl.cc
+@@ -194,7 +194,7 @@ void SupervisedUserExtensionsDelegateImp
+ return;
+ }
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ CHECK(contents.value());
+ content::WebContents* web_contents = contents.value().get();
+ if (CanInstallExtensions()) {
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.cc
new file mode 100644
index 0000000000..88bdc5b5c7
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_extensions_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_extensions_manager.cc
+@@ -353,7 +353,7 @@ void SupervisedUserExtensionsManager::
+ ActivateManagementPolicyAndUpdateRegistration() {
+ SetActiveForSupervisedUsers();
+ UpdateManagementPolicyRegistration();
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MaybeMarkExtensionsLocallyParentApproved();
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+ }
+@@ -471,7 +471,7 @@ bool SupervisedUserExtensionsManager::Sh
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SupervisedUserExtensionsManager::
+ MaybeMarkExtensionsLocallyParentApproved() {
+ supervised_user::LocallyParentApprovedExtensionsMigrationState
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.h b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.h
new file mode 100644
index 0000000000..aae0a3899d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__extensions__manager.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_extensions_manager.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_extensions_manager.h
+@@ -153,7 +153,7 @@ class SupervisedUserExtensionsManager :
+ // launched.
+ bool ShouldBlockExtension(const std::string& extension_id) const;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Triggers an one-time migration of the present extensions as parent-approved
+ // when the feature
+ // `kEnableSupervisedUserSkipParentApprovalToInstallExtensions` becomes
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__google__auth__navigation__throttle.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__google__auth__navigation__throttle.cc
new file mode 100644
index 0000000000..403c39f3af
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__google__auth__navigation__throttle.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc
+@@ -34,7 +34,7 @@
+ #include "chrome/browser/supervised_user/child_accounts/child_account_service_android.h"
+ #include "components/signin/public/identity_manager/identity_manager.h"
+ #include "ui/android/view_android.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/supervised_user/supervised_user_verification_controller_client.h"
+ #include "chrome/browser/supervised_user/supervised_user_verification_page.h"
+ #endif
+@@ -150,7 +150,7 @@ SupervisedUserGoogleAuthNavigationThrott
+ return content::NavigationThrottle::DEFER;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // When an unauthenticated supervised user tries to access YouTube, we force
+ // re-authentication with an interstitial so that YouTube can be subject to
+ // content restrictions. This interstitial is only available on Desktop
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__metrics__service__factory.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__metrics__service__factory.cc
new file mode 100644
index 0000000000..1597e95ac8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__metrics__service__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_metrics_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_metrics_service_factory.cc
+@@ -14,7 +14,7 @@
+ #include "components/supervised_user/core/browser/supervised_user_service.h"
+ #include "content/public/browser/browser_context.h"
+
+-#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/supervised_user/linux_mac_windows/supervised_user_extensions_metrics_delegate_impl.h"
+ #endif
+
+@@ -62,7 +62,7 @@ SupervisedUserMetricsServiceFactory::Bui
+ std::unique_ptr<supervised_user::SupervisedUserMetricsService ::
+ SupervisedUserMetricsServiceExtensionDelegate>
+ extensions_metrics_delegate = nullptr;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extensions_metrics_delegate =
+ std::make_unique<SupervisedUserExtensionsMetricsDelegateImpl>(
+ extensions::ExtensionRegistry::Get(profile), profile);
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__observer.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__observer.cc
new file mode 100644
index 0000000000..74fb326ffe
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__observer.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_navigation_observer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_navigation_observer.cc
+@@ -47,7 +47,7 @@
+ #include "chrome/browser/supervised_user/android/supervised_user_web_content_handler_impl.h"
+ #elif BUILDFLAG(IS_CHROMEOS)
+ #include "chrome/browser/supervised_user/chromeos/supervised_user_web_content_handler_impl.h"
+-#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/supervised_user/linux_mac_windows/supervised_user_web_content_handler_impl.h"
+ #endif
+
+@@ -67,7 +67,7 @@ std::unique_ptr<supervised_user::WebCont
+ #elif BUILDFLAG(IS_ANDROID)
+ return std::make_unique<SupervisedUserWebContentHandlerImpl>(
+ web_contents, frame_id, navigation_id);
+-#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return std::make_unique<SupervisedUserWebContentHandlerImpl>(
+ web_contents, frame_id, navigation_id);
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.cc b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.cc
new file mode 100644
index 0000000000..afb03134c6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_navigation_throttle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_navigation_throttle.cc
+@@ -215,7 +215,7 @@ void SupervisedUserNavigationThrottle::O
+ case kCancelWithInterstitial: {
+ CHECK(navigation_handle());
+ // LINT.IfChange(cancel_with_interstitial)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (supervised_user::ShouldShowReAuthInterstitial(*navigation_handle(),
+ is_main_frame)) {
+ // Show the re-authentication interstitial if the user signed out of
+@@ -246,7 +246,7 @@ void SupervisedUserNavigationThrottle::O
+ }
+
+ namespace supervised_user {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+
+ bool ShouldShowReAuthInterstitial(content::NavigationHandle& navigation_handle,
+ bool is_main_frame) {
diff --git a/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.h b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.h
new file mode 100644
index 0000000000..0f5548ccef
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_supervised__user_supervised__user__navigation__throttle.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/supervised_user/supervised_user_navigation_throttle.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/supervised_user/supervised_user_navigation_throttle.h
+@@ -22,7 +22,7 @@
+ class Profile;
+
+ namespace supervised_user {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ bool ShouldShowReAuthInterstitial(content::NavigationHandle& navigation_handle,
+ bool is_main_frame);
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_sync_chrome__sync__controller__builder.cc b/chromium-next/patches/patch-chrome_browser_sync_chrome__sync__controller__builder.cc
new file mode 100644
index 0000000000..9d13b69c74
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_sync_chrome__sync__controller__builder.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/sync/chrome_sync_controller_builder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/sync/chrome_sync_controller_builder.cc
+@@ -275,7 +275,7 @@ ChromeSyncControllerBuilder::Build(synce
+ #if BUILDFLAG(ENABLE_SPELLCHECK)
+ // Chrome prefers OS provided spell checkers where they exist. So only sync
+ // the custom dictionary on platforms that typically don't provide one.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Dictionary sync is enabled by default.
+ if (spellcheck_service_.value()) {
+ controllers.push_back(
diff --git a/chromium-next/patches/patch-chrome_browser_sync_device__info__sync__client__impl.cc b/chromium-next/patches/patch-chrome_browser_sync_device__info__sync__client__impl.cc
new file mode 100644
index 0000000000..fed998a940
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_sync_device__info__sync__client__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/sync/device_info_sync_client_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/sync/device_info_sync_client_impl.cc
+@@ -41,7 +41,7 @@ std::string DeviceInfoSyncClientImpl::Ge
+ // included in lacros-chrome once build flag switch of lacros-chrome is
+ // complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ syncer::SyncPrefs prefs(profile_->GetPrefs());
+ if (prefs.IsLocalSyncEnabled()) {
+ return "local_device";
diff --git a/chromium-next/patches/patch-chrome_browser_sync_sync__service__factory.cc b/chromium-next/patches/patch-chrome_browser_sync_sync__service__factory.cc
new file mode 100644
index 0000000000..8d20591f8a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_sync_sync__service__factory.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/sync/sync_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/sync/sync_service_factory.cc
+@@ -110,7 +110,7 @@
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h"
+ #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
+ #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
+@@ -137,7 +137,7 @@ namespace {
+ tab_groups::TabGroupSyncService* GetTabGroupSyncService(Profile* profile) {
+ CHECK(profile);
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ tab_groups::TabGroupSyncService* service =
+ tab_groups::SavedTabGroupUtils::GetServiceForProfile(profile);
+ CHECK(service);
+@@ -379,7 +379,7 @@ std::unique_ptr<KeyedService> BuildSyncS
+ bool local_sync_backend_enabled = false;
+ // Only check the local sync backend pref on the supported platforms of
+ // Windows, Mac and Linux.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ syncer::SyncPrefs prefs(profile->GetPrefs());
+ local_sync_backend_enabled = prefs.IsLocalSyncEnabled();
+ base::UmaHistogramBoolean("Sync.Local.Enabled2", local_sync_backend_enabled);
+@@ -514,7 +514,7 @@ SyncServiceFactory::SyncServiceFactory()
+ DependsOn(ProfilePasswordStoreFactory::GetInstance());
+ DependsOn(PowerBookmarkServiceFactory::GetInstance());
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ DependsOn(tab_groups::SavedTabGroupServiceFactory::GetInstance());
+ #elif BUILDFLAG(IS_ANDROID)
+ DependsOn(tab_groups::TabGroupSyncServiceFactory::GetInstance());
diff --git a/chromium-next/patches/patch-chrome_browser_tab__group__sync_tab__group__sync__service__factory.cc b/chromium-next/patches/patch-chrome_browser_tab__group__sync_tab__group__sync__service__factory.cc
new file mode 100644
index 0000000000..819e4dff16
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_tab__group__sync_tab__group__sync__service__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/tab_group_sync/tab_group_sync_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/tab_group_sync/tab_group_sync_service_factory.cc
+@@ -31,7 +31,7 @@
+ #include "components/sync_device_info/device_info_sync_service.h"
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_delegate_desktop.h"
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) ||
+ // BUILDFLAG(IS_WIN)
+@@ -89,7 +89,7 @@ TabGroupSyncServiceFactory::BuildService
+
+ std::unique_ptr<TabGroupSyncDelegate> delegate;
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (tab_groups::IsTabGroupSyncServiceDesktopMigrationEnabled()) {
+ delegate =
+ std::make_unique<TabGroupSyncDelegateDesktop>(service.get(), profile);
diff --git a/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.cc b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.cc
new file mode 100644
index 0000000000..4d5a4fdf01
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/task_manager/sampling/task_group.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/task_manager/sampling/task_group.cc
+@@ -41,7 +41,7 @@ const int kBackgroundRefreshTypesMask =
+ #if BUILDFLAG(IS_WIN)
+ REFRESH_TYPE_START_TIME | REFRESH_TYPE_CPU_TIME |
+ #endif // BUILDFLAG(IS_WIN)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ REFRESH_TYPE_FD_COUNT |
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ #if BUILDFLAG(ENABLE_NACL)
+@@ -126,7 +126,7 @@ TaskGroup::TaskGroup(
+ #if BUILDFLAG(ENABLE_NACL)
+ nacl_debug_stub_port_(nacl::kGdbDebugStubPortUnknown),
+ #endif // BUILDFLAG(ENABLE_NACL)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ open_fd_count_(-1),
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ idle_wakeups_per_second_(-1),
+@@ -145,7 +145,7 @@ TaskGroup::TaskGroup(
+ weak_ptr_factory_.GetWeakPtr()),
+ base::BindRepeating(&TaskGroup::OnIdleWakeupsRefreshDone,
+ weak_ptr_factory_.GetWeakPtr()),
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ base::BindRepeating(&TaskGroup::OnOpenFdCountRefreshDone,
+ weak_ptr_factory_.GetWeakPtr()),
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+@@ -324,7 +324,7 @@ void TaskGroup::OnRefreshNaClDebugStubPo
+ }
+ #endif // BUILDFLAG(ENABLE_NACL)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ void TaskGroup::OnOpenFdCountRefreshDone(int open_fd_count) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
diff --git a/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.h b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.h
new file mode 100644
index 0000000000..aa7b1abe91
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/task_manager/sampling/task_group.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/task_manager/sampling/task_group.h
+@@ -44,7 +44,7 @@ constexpr int kUnsupportedVMRefreshFlags
+ REFRESH_TYPE_WEBCACHE_STATS | REFRESH_TYPE_NETWORK_USAGE |
+ REFRESH_TYPE_NACL | REFRESH_TYPE_IDLE_WAKEUPS | REFRESH_TYPE_HANDLES |
+ REFRESH_TYPE_START_TIME | REFRESH_TYPE_CPU_TIME | REFRESH_TYPE_PRIORITY |
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ REFRESH_TYPE_FD_COUNT |
+ #endif
+ REFRESH_TYPE_HARD_FAULTS;
+@@ -152,7 +152,7 @@ class TaskGroup {
+ }
+ #endif // BUILDFLAG(ENABLE_NACL)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ int open_fd_count() const { return open_fd_count_; }
+ void set_open_fd_count(int open_fd_count) { open_fd_count_ = open_fd_count; }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+@@ -172,7 +172,7 @@ class TaskGroup {
+ void RefreshNaClDebugStubPort(int child_process_unique_id);
+ void OnRefreshNaClDebugStubPortDone(int port);
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ void OnOpenFdCountRefreshDone(int open_fd_count);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+
+@@ -244,7 +244,7 @@ class TaskGroup {
+ #if BUILDFLAG(ENABLE_NACL)
+ int nacl_debug_stub_port_;
+ #endif // BUILDFLAG(ENABLE_NACL)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // The number of file descriptors currently open by the process.
+ int open_fd_count_;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
diff --git a/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.cc b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.cc
new file mode 100644
index 0000000000..2eb925625b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/task_manager/sampling/task_group_sampler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/task_manager/sampling/task_group_sampler.cc
+@@ -46,7 +46,7 @@ TaskGroupSampler::TaskGroupSampler(
+ const OnCpuRefreshCallback& on_cpu_refresh,
+ const OnSwappedMemRefreshCallback& on_swapped_mem_refresh,
+ const OnIdleWakeupsCallback& on_idle_wakeups,
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ const OnOpenFdCountCallback& on_open_fd_count,
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ const OnProcessPriorityCallback& on_process_priority)
+@@ -56,7 +56,7 @@ TaskGroupSampler::TaskGroupSampler(
+ on_cpu_refresh_callback_(on_cpu_refresh),
+ on_swapped_mem_refresh_callback_(on_swapped_mem_refresh),
+ on_idle_wakeups_callback_(on_idle_wakeups),
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ on_open_fd_count_callback_(on_open_fd_count),
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ on_process_priority_callback_(on_process_priority) {
+@@ -86,7 +86,7 @@ void TaskGroupSampler::Refresh(int64_t r
+ base::BindOnce(on_swapped_mem_refresh_callback_));
+ }
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (TaskManagerObserver::IsResourceRefreshEnabled(REFRESH_TYPE_IDLE_WAKEUPS,
+ refresh_flags)) {
+ blocking_pool_runner_->PostTaskAndReplyWithResult(
+@@ -96,7 +96,7 @@ void TaskGroupSampler::Refresh(int64_t r
+ }
+ #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (TaskManagerObserver::IsResourceRefreshEnabled(REFRESH_TYPE_FD_COUNT,
+ refresh_flags)) {
+ blocking_pool_runner_->PostTaskAndReplyWithResult(
+@@ -150,7 +150,7 @@ int TaskGroupSampler::RefreshIdleWakeups
+ return process_metrics_->GetIdleWakeupsPerSecond();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ int TaskGroupSampler::RefreshOpenFdCount() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(worker_pool_sequenced_checker_);
+
diff --git a/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.h b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.h
new file mode 100644
index 0000000000..90c8eafd50
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__group__sampler.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/task_manager/sampling/task_group_sampler.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/task_manager/sampling/task_group_sampler.h
+@@ -31,7 +31,7 @@ class TaskGroupSampler : public base::Re
+ using OnCpuRefreshCallback = base::RepeatingCallback<void(double)>;
+ using OnSwappedMemRefreshCallback = base::RepeatingCallback<void(int64_t)>;
+ using OnIdleWakeupsCallback = base::RepeatingCallback<void(int)>;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ using OnOpenFdCountCallback = base::RepeatingCallback<void(int)>;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ using OnProcessPriorityCallback =
+@@ -43,7 +43,7 @@ class TaskGroupSampler : public base::Re
+ const OnCpuRefreshCallback& on_cpu_refresh,
+ const OnSwappedMemRefreshCallback& on_memory_refresh,
+ const OnIdleWakeupsCallback& on_idle_wakeups,
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ const OnOpenFdCountCallback& on_open_fd_count,
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ const OnProcessPriorityCallback& on_process_priority);
+@@ -63,7 +63,7 @@ class TaskGroupSampler : public base::Re
+ double RefreshCpuUsage();
+ int64_t RefreshSwappedMem();
+ int RefreshIdleWakeupsPerSecond();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ int RefreshOpenFdCount();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ base::Process::Priority RefreshProcessPriority();
+@@ -87,7 +87,7 @@ class TaskGroupSampler : public base::Re
+ const OnCpuRefreshCallback on_cpu_refresh_callback_;
+ const OnSwappedMemRefreshCallback on_swapped_mem_refresh_callback_;
+ const OnIdleWakeupsCallback on_idle_wakeups_callback_;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ const OnOpenFdCountCallback on_open_fd_count_callback_;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
+ const OnProcessPriorityCallback on_process_priority_callback_;
diff --git a/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc
new file mode 100644
index 0000000000..06a6cce67c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/task_manager/sampling/task_manager_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/task_manager/sampling/task_manager_impl.cc
+@@ -219,7 +219,7 @@ void TaskManagerImpl::GetUSERHandles(Tas
+ }
+
+ int TaskManagerImpl::GetOpenFdCount(TaskId task_id) const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return GetTaskGroupByTaskId(task_id)->open_fd_count();
+ #else
+ return -1;
diff --git a/chromium-next/patches/patch-chrome_browser_task__manager_task__manager__observer.h b/chromium-next/patches/patch-chrome_browser_task__manager_task__manager__observer.h
new file mode 100644
index 0000000000..be89b02a67
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_task__manager_task__manager__observer.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/task_manager/task_manager_observer.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/task_manager/task_manager_observer.h
+@@ -47,7 +47,7 @@ enum RefreshType {
+ // or backgrounded.
+ REFRESH_TYPE_PRIORITY = 1 << 13,
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // For observers interested in getting the number of open file descriptors of
+ // processes.
+ REFRESH_TYPE_FD_COUNT = 1 << 14,
diff --git a/chromium-next/patches/patch-chrome_browser_themes_theme__helper.cc b/chromium-next/patches/patch-chrome_browser_themes_theme__helper.cc
new file mode 100644
index 0000000000..0d15b36733
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_themes_theme__helper.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/themes/theme_helper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/themes/theme_helper.cc
+@@ -18,7 +18,7 @@
+ #include "ui/gfx/image/image.h"
+ #include "ui/native_theme/native_theme.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_themes_theme__service.cc b/chromium-next/patches/patch-chrome_browser_themes_theme__service.cc
new file mode 100644
index 0000000000..063e89ac84
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_themes_theme__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/themes/theme_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/themes/theme_service.cc
+@@ -70,7 +70,7 @@
+ #include "extensions/browser/extension_registry_observer.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #include "ui/ozone/public/ozone_platform.h" // nogncheck
+ #endif
+@@ -328,7 +328,7 @@ CustomThemeSupplier* ThemeService::GetTh
+ }
+
+ bool ThemeService::ShouldUseCustomFrame() const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!ui::OzonePlatform::GetInstance()
+ ->GetPlatformRuntimeProperties()
+ .supports_server_side_window_decorations) {
diff --git a/chromium-next/patches/patch-chrome_browser_themes_theme__service__aura__linux.cc b/chromium-next/patches/patch-chrome_browser_themes_theme__service__aura__linux.cc
new file mode 100644
index 0000000000..96f484dc39
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_themes_theme__service__aura__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/themes/theme_service_aura_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/themes/theme_service_aura_linux.cc
+@@ -23,7 +23,7 @@ namespace {
+ ui::SystemTheme ValidateSystemTheme(ui::SystemTheme system_theme) {
+ switch (system_theme) {
+ case ui::SystemTheme::kDefault:
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case ui::SystemTheme::kGtk:
+ case ui::SystemTheme::kQt:
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_themes_theme__service__factory.cc b/chromium-next/patches/patch-chrome_browser_themes_theme__service__factory.cc
new file mode 100644
index 0000000000..a8dcb2d3f8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_themes_theme__service__factory.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/themes/theme_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/themes/theme_service_factory.cc
+@@ -27,11 +27,11 @@
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/themes/theme_service_aura_linux.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui_factory.h"
+ #endif
+
+@@ -108,7 +108,7 @@ ThemeServiceFactory::~ThemeServiceFactor
+ std::unique_ptr<KeyedService>
+ ThemeServiceFactory::BuildServiceInstanceForBrowserContext(
+ content::BrowserContext* profile) const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ using ThemeService = ThemeServiceAuraLinux;
+ #endif
+
+@@ -122,9 +122,9 @@ void ThemeServiceFactory::RegisterProfil
+ user_prefs::PrefRegistrySyncable* registry) {
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ ui::SystemTheme default_system_theme = ui::SystemTheme::kDefault;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ default_system_theme = ui::GetDefaultSystemTheme();
+ #endif
+ registry->RegisterIntegerPref(prefs::kSystemTheme,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_actions_chrome__action__id.h b/chromium-next/patches/patch-chrome_browser_ui_actions_chrome__action__id.h
new file mode 100644
index 0000000000..1476b02255
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_actions_chrome__action__id.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/actions/chrome_action_id.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/actions/chrome_action_id.h
+@@ -515,7 +515,7 @@
+ IDC_CONTENT_CONTEXT_QUICK_ANSWERS_INLINE_ANSWER) \
+ E(kActionContentContextQuickAnswersInlineQuery, \
+ IDC_CONTENT_CONTEXT_QUICK_ANSWERS_INLINE_QUERY)
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define CHROME_PLATFORM_SPECIFIC_ACTION_IDS \
+ E(kUseSystemTitleBar, IDC_USE_SYSTEM_TITLE_BAR) \
+ E(kRestoreWindow, IDC_RESTORE_WINDOW)
diff --git a/chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.cc b/chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.cc
new file mode 100644
index 0000000000..81c23a3292
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/autofill/payments/desktop_payments_window_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/autofill/payments/desktop_payments_window_manager.cc
+@@ -49,7 +49,7 @@ gfx::Rect GetPopupSizeForVcn3ds() {
+ DesktopPaymentsWindowManager::DesktopPaymentsWindowManager(
+ ContentAutofillClient* client)
+ : client_(CHECK_DEREF(client)) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ scoped_observation_.Observe(BrowserList::GetInstance());
+ #endif // BUILDFLAG(IS_LINUX)
+ }
+@@ -109,7 +109,7 @@ void DesktopPaymentsWindowManager::WebCo
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void DesktopPaymentsWindowManager::OnBrowserSetLastActive(Browser* browser) {
+ // If there is an ongoing payments window manager pop-up flow, and the
+ // original tab's WebContents become active, activate the pop-up's
diff --git a/chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.h b/chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.h
new file mode 100644
index 0000000000..d4e6cef77f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_autofill_payments_desktop__payments__window__manager.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/autofill/payments/desktop_payments_window_manager.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/autofill/payments/desktop_payments_window_manager.h
+@@ -14,7 +14,7 @@
+ #include "components/autofill/core/browser/payments/payments_window_manager.h"
+ #include "content/public/browser/web_contents_observer.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/scoped_observation.h"
+ #include "chrome/browser/ui/browser_list.h"
+ #include "chrome/browser/ui/browser_list_observer.h"
+@@ -39,7 +39,7 @@ class PaymentsWindowUserConsentDialogCon
+ // WebContents of the original tab that the pop-up is created in. If there is a
+ // pop-up currently present, `this` will observe the WebContents of that pop-up.
+ class DesktopPaymentsWindowManager : public PaymentsWindowManager,
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ public BrowserListObserver,
+ #endif // BUILDFLAG(IS_LINUX)
+ public content::WebContentsObserver {
+@@ -58,7 +58,7 @@ class DesktopPaymentsWindowManager : pub
+ content::NavigationHandle* navigation_handle) override;
+ void WebContentsDestroyed() override;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // BrowserListObserver:
+ void OnBrowserSetLastActive(Browser* browser) override;
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -136,7 +136,7 @@ class DesktopPaymentsWindowManager : pub
+ std::unique_ptr<PaymentsWindowUserConsentDialogControllerImpl>
+ payments_window_user_consent_dialog_controller_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ScopedObservation<BrowserList, BrowserListObserver> scoped_observation_{
+ this};
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-chrome_browser_ui_browser.h b/chromium-next/patches/patch-chrome_browser_ui_browser.h
new file mode 100644
index 0000000000..66e8d198e0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_browser.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/browser.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/browser.h
+@@ -301,7 +301,7 @@ class Browser : public TabStripModelObse
+ std::optional<int64_t> display_id;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // When the browser window is shown, the desktop environment is notified
+ // using this ID. In response, the desktop will stop playing the "waiting
+ // for startup" animation (if any).
diff --git a/chromium-next/patches/patch-chrome_browser_ui_browser__command__controller.cc b/chromium-next/patches/patch-chrome_browser_ui_browser__command__controller.cc
new file mode 100644
index 0000000000..0803e9ac60
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_browser__command__controller.cc
@@ -0,0 +1,86 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/browser_command_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/browser_command_controller.cc
+@@ -127,7 +127,7 @@
+ #include "components/user_manager/user_manager.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/base/ime/text_input_flags.h"
+ #include "ui/linux/linux_ui.h"
+ #endif
+@@ -136,7 +136,7 @@
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/shortcuts/desktop_shortcuts_utils.h"
+ #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+
+@@ -317,7 +317,7 @@ bool BrowserCommandController::IsReserve
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If this key was registered by the user as a content editing hotkey, then
+ // it is not reserved.
+ auto* linux_ui = ui::LinuxUi::instance();
+@@ -572,7 +572,7 @@ bool BrowserCommandController::ExecuteCo
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ case IDC_MINIMIZE_WINDOW:
+ browser_->window()->Minimize();
+ break;
+@@ -584,7 +584,7 @@ bool BrowserCommandController::ExecuteCo
+ break;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case IDC_USE_SYSTEM_TITLE_BAR: {
+ PrefService* prefs = profile()->GetPrefs();
+ prefs->SetBoolean(prefs::kUseCustomChromeFrame,
+@@ -788,7 +788,7 @@ bool BrowserCommandController::ExecuteCo
+ break;
+ case IDC_CREATE_SHORTCUT:
+ base::RecordAction(base::UserMetricsAction("CreateShortcut"));
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(features::kShortcutsNotApps)) {
+ chrome::CreateDesktopShortcutForActiveWebContents(browser_);
+ } else {
+@@ -1263,12 +1263,12 @@ void BrowserCommandController::InitComma
+ #endif
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true);
+ command_updater_.UpdateCommandEnabled(IDC_MAXIMIZE_WINDOW, true);
+ command_updater_.UpdateCommandEnabled(IDC_RESTORE_WINDOW, true);
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool use_system_title_bar = true;
+ #if BUILDFLAG(IS_OZONE)
+ use_system_title_bar = ui::OzonePlatform::GetInstance()
+@@ -1606,7 +1606,7 @@ void BrowserCommandController::UpdateCom
+ bool can_create_web_app = web_app::CanCreateWebApp(browser_);
+ command_updater_.UpdateCommandEnabled(IDC_INSTALL_PWA, can_create_web_app);
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(features::kShortcutsNotApps)) {
+ command_updater_.UpdateCommandEnabled(
+ IDC_CREATE_SHORTCUT, shortcuts::CanCreateDesktopShortcut(browser_));
diff --git a/chromium-next/patches/patch-chrome_browser_ui_browser__commands.cc b/chromium-next/patches/patch-chrome_browser_ui_browser__commands.cc
new file mode 100644
index 0000000000..d94269edba
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_browser__commands.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/browser_commands.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/browser_commands.cc
+@@ -2032,7 +2032,7 @@ void OpenUpdateChromeDialog(Browser* bro
+ } else if (UpgradeDetector::GetInstance()->is_outdated_install_no_au()) {
+ UpgradeDetector::GetInstance()->NotifyOutdatedInstallNoAutoUpdate();
+ } else {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(features::kFewerUpdateConfirmations)) {
+ chrome::AttemptRelaunch();
+ return;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_browser__ui__prefs.cc b/chromium-next/patches/patch-chrome_browser_ui_browser__ui__prefs.cc
new file mode 100644
index 0000000000..c0bfe59f39
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_browser__ui__prefs.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/browser_ui_prefs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/browser_ui_prefs.cc
+@@ -72,7 +72,7 @@ void RegisterBrowserPrefs(PrefRegistrySi
+ registry->RegisterIntegerPref(prefs::kDefaultBrowserDeclinedCount, 0);
+ registry->RegisterTimePref(prefs::kDefaultBrowserFirstShownTime,
+ base::Time());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ registry->RegisterStringPref(prefs::kEnterpriseCustomLabel, std::string());
+ registry->RegisterStringPref(prefs::kEnterpriseLogoUrl, std::string());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+@@ -182,7 +182,7 @@ void RegisterBrowserUserPrefs(user_prefs
+ registry->RegisterDictionaryPref(prefs::kHttpsUpgradeFallbacks);
+ registry->RegisterDictionaryPref(prefs::kHttpsUpgradeNavigations);
+ registry->RegisterBooleanPref(prefs::kHttpsOnlyModeAutoEnabled, false);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ registry->RegisterStringPref(prefs::kEnterpriseLogoUrl, std::string());
+ registry->RegisterStringPref(prefs::kEnterpriseCustomLabel, std::string());
+ registry->RegisterStringPref(prefs::kEnterpriseLogoUrlForProfile,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_browser__view__prefs.cc b/chromium-next/patches/patch-chrome_browser_ui_browser__view__prefs.cc
new file mode 100644
index 0000000000..65f96f7ada
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_browser__view__prefs.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/browser_view_prefs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/browser_view_prefs.cc
+@@ -15,7 +15,7 @@
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool GetCustomFramePrefDefault() {
+ #if BUILDFLAG(IS_OZONE)
+ return ui::OzonePlatform::GetInstance()
+@@ -31,7 +31,7 @@ bool GetCustomFramePrefDefault() {
+
+ void RegisterBrowserViewProfilePrefs(
+ user_prefs::PrefRegistrySyncable* registry) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kUseCustomChromeFrame,
+ GetCustomFramePrefDefault());
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_chrome__pages.cc b/chromium-next/patches/patch-chrome_browser_ui_chrome__pages.cc
new file mode 100644
index 0000000000..ccf45cd6a6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_chrome__pages.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/chrome_pages.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/chrome_pages.cc
+@@ -87,7 +87,7 @@
+ #include "components/signin/public/identity_manager/identity_manager.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/web_applications/web_app_utils.h"
+ #endif
+
+@@ -380,7 +380,7 @@ void ShowChromeTips(Browser* browser) {
+ ShowSingletonTab(browser, GURL(kChromeTipsURL));
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ShowChromeWhatsNew(Browser* browser) {
+ ShowSingletonTab(browser, GURL(kChromeUIWhatsNewURL));
+ }
+@@ -728,7 +728,7 @@ void ShowShortcutCustomizationApp(Profil
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ShowWebAppSettingsImpl(Browser* browser,
+ Profile* profile,
+ const std::string& app_id,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_chrome__pages.h b/chromium-next/patches/patch-chrome_browser_ui_chrome__pages.h
new file mode 100644
index 0000000000..328cb2522d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_chrome__pages.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/chrome_pages.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/chrome_pages.h
+@@ -39,7 +39,7 @@ namespace signin {
+ enum class ConsentLevel;
+ } // namespace signin
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ namespace web_app {
+ enum class AppSettingsPageEntryPoint;
+ } // namespace web_app
+@@ -175,7 +175,7 @@ void ShowShortcutCustomizationApp(Profil
+ const std::string& category);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Show chrome://app-settings/<app-id> page.
+ void ShowWebAppSettings(Browser* browser,
+ const std::string& app_id,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc b/chromium-next/patches/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc
new file mode 100644
index 0000000000..b5b4676faf
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/color/native_chrome_color_mixer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/color/native_chrome_color_mixer.cc
+@@ -7,7 +7,7 @@
+ #include "build/build_config.h"
+
+ #if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && \
+- !BUILDFLAG(IS_WIN)
++ !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD)
+ void AddNativeChromeColorMixer(ui::ColorProvider* provider,
+ const ui::ColorProviderKey& key) {}
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_managed__ui.cc b/chromium-next/patches/patch-chrome_browser_ui_managed__ui.cc
new file mode 100644
index 0000000000..bce458899e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_managed__ui.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/managed_ui.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/managed_ui.cc
+@@ -439,7 +439,7 @@ std::optional<std::string> GetDeviceMana
+ g_browser_process->platform_part()->browser_policy_connector_ash();
+ return connector->GetEnterpriseDomainManager();
+ #else
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(
+ features::kEnterpriseManagementDisclaimerUsesCustomLabel)) {
+ std::string custom_management_label =
+@@ -476,7 +476,7 @@ std::optional<std::string> GetAccountMan
+ policy::EnterpriseManagementAuthority::CLOUD))
+ return std::nullopt;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(
+ features::kEnterpriseManagementDisclaimerUsesCustomLabel)) {
+ std::string custom_management_label =
diff --git a/chromium-next/patches/patch-chrome_browser_ui_omnibox_omnibox__pedal__implementations.cc b/chromium-next/patches/patch-chrome_browser_ui_omnibox_omnibox__pedal__implementations.cc
new file mode 100644
index 0000000000..8942cec108
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_omnibox_omnibox__pedal__implementations.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc
+@@ -1976,7 +1976,7 @@ const gfx::VectorIcon& GetSharingHubVect
+ return omnibox::kShareMacChromeRefreshIcon;
+ #elif BUILDFLAG(IS_WIN)
+ return omnibox::kShareWinChromeRefreshIcon;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return omnibox::kShareLinuxChromeRefreshIcon;
+ #else
+ return omnibox::kShareChromeRefreshIcon;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_passwords_bubble__controllers_relaunch__chrome__bubble__controller.cc b/chromium-next/patches/patch-chrome_browser_ui_passwords_bubble__controllers_relaunch__chrome__bubble__controller.cc
new file mode 100644
index 0000000000..76ecd98c29
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_passwords_bubble__controllers_relaunch__chrome__bubble__controller.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/passwords/bubble_controllers/relaunch_chrome_bubble_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/passwords/bubble_controllers/relaunch_chrome_bubble_controller.cc
+@@ -44,7 +44,7 @@ std::u16string RelaunchChromeBubbleContr
+ #if BUILDFLAG(IS_MAC)
+ ? IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_TITLE_BRANDED
+ : IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_TITLE_NON_BRANDED
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ? IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_TITLE_LINUX_BRANDED
+ : IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_TITLE_LINUX_NON_BRANDED
+ #endif
+@@ -57,7 +57,7 @@ std::u16string RelaunchChromeBubbleContr
+ #if BUILDFLAG(IS_MAC)
+ ? IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_DESCRIPTION_BRANDED
+ : IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_DESCRIPTION_NON_BRANDED
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ? IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_DESCRIPTION_LINUX_BRANDED
+ : IDS_PASSWORD_MANAGER_RELAUNCH_CHROME_BUBBLE_DESCRIPTION_LINUX_NON_BRANDED
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_passwords_manage__passwords__ui__controller.cc b/chromium-next/patches/patch-chrome_browser_ui_passwords_manage__passwords__ui__controller.cc
new file mode 100644
index 0000000000..c2cc8a370c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_passwords_manage__passwords__ui__controller.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/passwords/manage_passwords_ui_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+@@ -97,7 +97,7 @@ namespace {
+
+ using Logger = autofill::SavePasswordProgressLogger;
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Should be kept in sync with constant declared in
+ // bubble_controllers/relaunch_chrome_bubble_controller.cc.
+ constexpr int kMaxNumberOfTimesKeychainErrorBubbleIsShown = 3;
+@@ -517,7 +517,7 @@ void ManagePasswordsUIController::OnBiom
+ }
+
+ void ManagePasswordsUIController::OnKeychainError() {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ CHECK(!dialog_controller_);
+ PrefService* prefs =
+ Profile::FromBrowserContext(web_contents()->GetBrowserContext())
diff --git a/chromium-next/patches/patch-chrome_browser_ui_sad__tab.cc b/chromium-next/patches/patch-chrome_browser_ui_sad__tab.cc
new file mode 100644
index 0000000000..069fe928d7
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_sad__tab.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/sad_tab.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/sad_tab.cc
+@@ -173,7 +173,7 @@ std::vector<int> SadTab::GetSubMessages(
+ // Only show Incognito suggestion if not already in Incognito mode.
+ if (!web_contents_->GetBrowserContext()->IsOffTheRecord())
+ message_ids.insert(message_ids.begin(), IDS_SAD_TAB_RELOAD_INCOGNITO);
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Note: on macOS, Linux and ChromeOS, the first bullet is either one of
+ // IDS_SAD_TAB_RELOAD_CLOSE_TABS or IDS_SAD_TAB_RELOAD_CLOSE_NOTABS
+ // followed by one of the above suggestions.
diff --git a/chromium-next/patches/patch-chrome_browser_ui_sharing__hub_sharing__hub__bubble__controller.h b/chromium-next/patches/patch-chrome_browser_ui_sharing__hub_sharing__hub__bubble__controller.h
new file mode 100644
index 0000000000..c146b67b6c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_sharing__hub_sharing__hub__bubble__controller.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h
+@@ -36,7 +36,7 @@ class SharingHubBubbleController {
+ // Returns true if the omnibox icon should be shown.
+ virtual bool ShouldOfferOmniboxIcon() = 0;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // This method returns the set of first-party actions, which are actions
+ // internal to Chrome. Third-party actions (those outside Chrome) are
+ // currently not supported.
diff --git a/chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller.cc b/chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller.cc
new file mode 100644
index 0000000000..cf76933fcc
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/signin/signin_view_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/signin/signin_view_controller.cc
+@@ -487,7 +487,7 @@ void SigninViewController::ShowModalMana
+ std::unique_ptr<signin::EnterpriseProfileCreationDialogParams>
+ create_param) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ CloseModalSignin();
+ dialog_ = std::make_unique<SigninModalDialogImpl>(
+ SigninViewControllerDelegate::CreateManagedUserNoticeDelegate(
diff --git a/chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller__delegate.h b/chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller__delegate.h
new file mode 100644
index 0000000000..7216569bbd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_signin_signin__view__controller__delegate.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/signin/signin_view_controller_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/signin/signin_view_controller_delegate.h
+@@ -85,7 +85,7 @@ class SigninViewControllerDelegate {
+ #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Returns a platform-specific SigninViewContolllerDelegate instance that
+ // displays the managed user notice modal dialog. The returned object
+ // should delete itself when the window it's managing is closed.
diff --git a/chromium-next/patches/patch-chrome_browser_ui_startup_bad__flags__prompt.cc b/chromium-next/patches/patch-chrome_browser_ui_startup_bad__flags__prompt.cc
new file mode 100644
index 0000000000..bb6d6bc6df
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_startup_bad__flags__prompt.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/startup/bad_flags_prompt.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/startup/bad_flags_prompt.cc
+@@ -101,7 +101,7 @@ const char* const kBadFlags[] = {
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Speech dispatcher is buggy, it can crash and it can make Chrome freeze.
+ // http://crbug.com/327295
+ switches::kEnableSpeechDispatcher,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator.cc b/chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator.cc
new file mode 100644
index 0000000000..18ebf5df02
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/startup/startup_browser_creator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/startup/startup_browser_creator.cc
+@@ -139,7 +139,7 @@
+ #include "chrome/credential_provider/common/gcp_strings.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+-#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/headless/headless_mode_util.h"
+ #include "chrome/browser/ui/startup/web_app_info_recorder_utils.h"
+ #include "components/headless/policy/headless_mode_policy.h"
+@@ -968,7 +968,7 @@ bool StartupBrowserCreator::ProcessCmdLi
+ TRACE_EVENT0("startup", "StartupBrowserCreator::ProcessCmdLineImpl");
+ ComputeAndRecordLaunchMode(command_line);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (headless::IsHeadlessMode() &&
+ headless::HeadlessModePolicy::IsHeadlessModeDisabled(
+ g_browser_process->local_state())) {
+@@ -1069,7 +1069,7 @@ bool StartupBrowserCreator::ProcessCmdLi
+ silent_launch = true;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Writes open and installed web apps to the specified file without
+ // launching a new browser window or tab.
+ if (base::FeatureList::IsEnabled(features::kListWebAppsSwitch) &&
+@@ -1282,7 +1282,7 @@ bool StartupBrowserCreator::ProcessCmdLi
+ CHECK_EQ(profile_info.mode, StartupProfileMode::kBrowserWindow)
+ << "Failed launch with app: couldn't pick a profile";
+ std::string app_id = command_line.GetSwitchValueASCII(switches::kAppId);
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If Chrome Apps are deprecated and |app_id| is a Chrome App, display the
+ // deprecation UI instead of launching the app.
+ if (apps::OpenDeprecatedApplicationPrompt(privacy_safe_profile, app_id))
diff --git a/chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc b/chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc
new file mode 100644
index 0000000000..f8507fc013
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_startup_startup__browser__creator__impl.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/startup/startup_browser_creator_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/startup/startup_browser_creator_impl.cc
+@@ -85,7 +85,7 @@
+ #include "chromeos/startup/browser_params_proxy.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/whats_new/whats_new_fetcher.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+@@ -225,7 +225,7 @@ Browser* StartupBrowserCreatorImpl::Open
+ // at the state of the MessageLoop.
+ Browser::CreateParams params = Browser::CreateParams(profile_, false);
+ params.creation_source = Browser::CreationSource::kStartupCreator;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ params.startup_id =
+ command_line_->GetSwitchValueASCII("desktop-startup-id");
+ #endif
+@@ -255,7 +255,7 @@ Browser* StartupBrowserCreatorImpl::Open
+ continue;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Start the What's New fetch but don't add the tab at this point. The tab
+ // will open as the foreground tab only if the remote content can be
+ // retrieved successfully. This prevents needing to automatically close the
diff --git a/chromium-next/patches/patch-chrome_browser_ui_startup_startup__tab__provider.cc b/chromium-next/patches/patch-chrome_browser_ui_startup_startup__tab__provider.cc
new file mode 100644
index 0000000000..25f6e8afd0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_startup_startup__tab__provider.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/startup/startup_tab_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/startup/startup_tab_provider.cc
+@@ -61,7 +61,7 @@
+ #include "extensions/browser/extension_registry.h"
+ #endif // !BUILDFLAG(IS_ANDROID)
+
+-#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/headless/headless_mode_util.h"
+ #endif
+
+@@ -105,7 +105,7 @@ bool ValidateUrl(const GURL& url) {
+ #if BUILDFLAG(IS_CHROMEOS_LACROS)
+ // In ChromeOS, allow any URL pattern that matches chrome:// scheme.
+ url_scheme_is_chrome = url.SchemeIs(content::kChromeUIScheme);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // In Headless mode, allow any URL pattern that matches chrome:// scheme if
+ // the user explicitly allowed it.
+ if (headless::IsHeadlessMode() && url.SchemeIs(content::kChromeUIScheme)) {
diff --git a/chromium-next/patches/patch-chrome_browser_ui_tab__helpers.cc b/chromium-next/patches/patch-chrome_browser_ui_tab__helpers.cc
new file mode 100644
index 0000000000..6d57d97b07
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_tab__helpers.cc
@@ -0,0 +1,32 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/tab_helpers.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/tab_helpers.cc
+@@ -234,7 +234,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/blocked_content/framebust_block_tab_helper.h"
+ #include "chrome/browser/ui/browser_finder.h"
+ #include "chrome/browser/ui/hats/hats_helper.h"
+@@ -699,12 +699,12 @@ void TabHelpers::AttachTabHelpers(WebCon
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ metrics::DesktopSessionDurationObserver::CreateForWebContents(web_contents);
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(
+ features::kHappinessTrackingSurveysForDesktopDemo) ||
+ base::FeatureList::IsEnabled(features::kTrustSafetySentimentSurvey) ||
diff --git a/chromium-next/patches/patch-chrome_browser_ui_tabs_features.cc b/chromium-next/patches/patch-chrome_browser_ui_tabs_features.cc
new file mode 100644
index 0000000000..92906856bb
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_tabs_features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/tabs/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/tabs/features.cc
+@@ -48,7 +48,7 @@ BASE_FEATURE(kTabStripCollectionStorage,
+ bool CanShowTabSearchPositionSetting() {
+ // Mac and other platforms will always have the tab search position in the
+ // correct location, cros/linux/win git the user the option to change.
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(kTabSearchPositionSetting);
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_tabs_tab__strip__prefs.cc b/chromium-next/patches/patch-chrome_browser_ui_tabs_tab__strip__prefs.cc
new file mode 100644
index 0000000000..0ed9997f9b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_tabs_tab__strip__prefs.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/tabs/tab_strip_prefs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/tabs/tab_strip_prefs.cc
+@@ -20,7 +20,7 @@ namespace tabs {
+
+ bool GetDefaultTabSearchRightAligned() {
+ // These platforms are all left aligned, the others should be right.
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__columns.h b/chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__columns.h
new file mode 100644
index 0000000000..9119a6a7d3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__columns.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/task_manager/task_manager_columns.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/task_manager/task_manager_columns.h
+@@ -278,7 +278,7 @@ inline constexpr std::array kColumns = {
+ .default_visibility = false},
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ TableColumnData{.id = IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN,
+ .align = ui::TableColumn::RIGHT,
+ .width = -1,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__table__model.cc b/chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__table__model.cc
new file mode 100644
index 0000000000..939cb5414d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_task__manager_task__manager__table__model.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/task_manager/task_manager_table_model.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/task_manager/task_manager_table_model.cc
+@@ -459,7 +459,7 @@ std::u16string TaskManagerTableModel::Ge
+ ? stringifier_->backgrounded_string()
+ : stringifier_->foregrounded_string();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ case IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN: {
+ const int fd_count = observed_task_manager()->GetOpenFdCount(tasks_[row]);
+ return fd_count >= 0 ? base::FormatNumber(fd_count)
+@@ -624,7 +624,7 @@ int TaskManagerTableModel::CompareValues
+ return BooleanCompare(is_proc1_bg, is_proc2_bg);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ case IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN: {
+ const int proc1_fd_count =
+ observed_task_manager()->GetOpenFdCount(tasks_[row1]);
+@@ -808,7 +808,7 @@ void TaskManagerTableModel::UpdateRefres
+ type = REFRESH_TYPE_KEEPALIVE_COUNT;
+ break;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ case IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN:
+ type = REFRESH_TYPE_FD_COUNT;
+ break;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_test_popup__browsertest.cc b/chromium-next/patches/patch-chrome_browser_ui_test_popup__browsertest.cc
new file mode 100644
index 0000000000..ccc64b0adb
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_test_popup__browsertest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/test/popup_browsertest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/test/popup_browsertest.cc
+@@ -75,7 +75,7 @@ IN_PROC_BROWSER_TEST_F(PopupTest, OpenLe
+ const display::Display display = GetDisplayNearestBrowser(popup);
+ gfx::Rect expected(popup->window()->GetBounds().size());
+ expected.AdjustToFit(display.work_area());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/40815883) Desktop Linux window bounds are inaccurate.
+ expected.Outset(50);
+ EXPECT_TRUE(expected.Contains(popup->window()->GetBounds()))
+@@ -107,7 +107,7 @@ IN_PROC_BROWSER_TEST_F(PopupTest, OpenCl
+ // The popup should be constrained to the opener's available display space.
+ EXPECT_EQ(display, GetDisplayNearestBrowser(popup));
+ gfx::Rect work_area(display.work_area());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/40815883) Desktop Linux bounds flakily extend outside the
+ // work area on trybots, when opening with excessive width and height, e.g.:
+ // width=${screen.availWidth+300},height=${screen.availHeight+300} yields:
diff --git a/chromium-next/patches/patch-chrome_browser_ui_test_test__browser__ui.cc b/chromium-next/patches/patch-chrome_browser_ui_test_test__browser__ui.cc
new file mode 100644
index 0000000000..2eebe2ff89
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_test_test__browser__ui.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/test/test_browser_ui.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/test/test_browser_ui.cc
+@@ -22,7 +22,7 @@
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ #include "content/public/common/content_switches.h"
+ #include "ui/base/test/skia_gold_matching_algorithm.h"
+@@ -39,7 +39,7 @@
+ // TODO(crbug.com/40625383) support Mac for pixel tests.
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ #define SUPPORTS_PIXEL_TEST
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_ui__features.cc b/chromium-next/patches/patch-chrome_browser_ui_ui__features.cc
new file mode 100644
index 0000000000..157d4f87c5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_ui__features.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/ui_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/ui_features.cc
+@@ -90,7 +90,7 @@ bool IsExtensionMenuInRootAppMenu() {
+ return base::FeatureList::IsEnabled(kExtensionsMenuInAppMenu);
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enables the feature to remove the last confirmation dialog when relaunching
+ // to update Chrome.
+ BASE_FEATURE(kFewerUpdateConfirmations,
+@@ -300,7 +300,7 @@ BASE_FEATURE(kTabOrganizationAppMenuItem
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kMultiTabOrganization,
+ "MultiTabOrganization",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+@@ -463,7 +463,7 @@ BASE_FEATURE(kStopLoadingAnimationForHid
+ "StopLoadingAnimationForHiddenWindow",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kUsePortalAccentColor,
+ "UsePortalAccentColor",
+ base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_ui__features.h b/chromium-next/patches/patch-chrome_browser_ui_ui__features.h
new file mode 100644
index 0000000000..b258a608c6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_ui__features.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/ui_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/ui_features.h
+@@ -68,7 +68,7 @@ extern const base::FeatureParam<bool> kA
+ BASE_DECLARE_FEATURE(kExtensionsMenuInAppMenu);
+ bool IsExtensionMenuInRootAppMenu();
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kFewerUpdateConfirmations);
+ #endif
+
+@@ -277,7 +277,7 @@ BASE_DECLARE_FEATURE(kViewsJSAppModalDia
+
+ BASE_DECLARE_FEATURE(kStopLoadingAnimationForHiddenWindow);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kUsePortalAccentColor);
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_accelerator__table.cc b/chromium-next/patches/patch-chrome_browser_ui_views_accelerator__table.cc
new file mode 100644
index 0000000000..9f08db3b71
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_accelerator__table.cc
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/accelerator_table.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/accelerator_table.cc
+@@ -68,11 +68,11 @@ const AcceleratorMapping kAcceleratorMap
+ {ui::VKEY_S, ui::EF_PLATFORM_ACCELERATOR, IDC_SAVE_PAGE},
+ {ui::VKEY_9, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_LAST_TAB},
+ {ui::VKEY_NUMPAD9, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_LAST_TAB},
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {ui::VKEY_9, ui::EF_ALT_DOWN, IDC_SELECT_LAST_TAB},
+ {ui::VKEY_NUMPAD9, ui::EF_ALT_DOWN, IDC_SELECT_LAST_TAB},
+ #endif // BUILDFLAG(IS_LINUX)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ {ui::VKEY_NEXT, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_MOVE_TAB_NEXT},
+ {ui::VKEY_PRIOR, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
+ IDC_MOVE_TAB_PREVIOUS},
+@@ -100,7 +100,7 @@ const AcceleratorMapping kAcceleratorMap
+ {ui::VKEY_NUMPAD7, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_TAB_6},
+ {ui::VKEY_8, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_TAB_7},
+ {ui::VKEY_NUMPAD8, ui::EF_PLATFORM_ACCELERATOR, IDC_SELECT_TAB_7},
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {ui::VKEY_1, ui::EF_ALT_DOWN, IDC_SELECT_TAB_0},
+ {ui::VKEY_NUMPAD1, ui::EF_ALT_DOWN, IDC_SELECT_TAB_0},
+ {ui::VKEY_2, ui::EF_ALT_DOWN, IDC_SELECT_TAB_1},
+@@ -152,7 +152,7 @@ const AcceleratorMapping kAcceleratorMap
+ IDC_SHOW_AVATAR_MENU},
+
+ // Platform-specific key maps.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ {ui::VKEY_BROWSER_BACK, ui::EF_NONE, IDC_BACK},
+ {ui::VKEY_BROWSER_FORWARD, ui::EF_NONE, IDC_FORWARD},
+ {ui::VKEY_BROWSER_HOME, ui::EF_NONE, IDC_HOME},
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc b/chromium-next/patches/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc
new file mode 100644
index 0000000000..f322046c41
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc
+@@ -19,7 +19,7 @@
+ #include "ui/menus/simple_menu_model.h"
+ #include "ui/views/widget/widget.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/shell_integration_linux.h"
+ #endif
+
+@@ -49,7 +49,7 @@ void ChromeNativeAppWindowViewsAura::OnB
+ const AppWindow::CreateParams& create_params,
+ views::Widget::InitParams* init_params,
+ views::Widget* widget) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string app_name =
+ web_app::GenerateApplicationNameFromAppId(app_window()->extension_id());
+ // Set up a custom WM_CLASS for app windows. This allows task switchers in
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_chrome__browser__main__extra__parts__views.cc b/chromium-next/patches/patch-chrome_browser_ui_views_chrome__browser__main__extra__parts__views.cc
new file mode 100644
index 0000000000..fcb8c467e3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_chrome__browser__main__extra__parts__views.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
+@@ -39,7 +39,7 @@
+ #include "ui/wm/core/wm_state.h"
+ #endif // defined(USE_AURA)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -132,7 +132,7 @@ void ChromeBrowserMainExtraPartsViews::P
+ return controller;
+ }));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On the Linux desktop, we want to prevent the user from logging in as root,
+ // so that we don't destroy the profile. Now that we have some minimal ui
+ // initialized, check to see if we're running as root and bail if we are.
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate.h b/chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate.h
new file mode 100644
index 0000000000..f38cf72b44
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/chrome_views_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/chrome_views_delegate.h
+@@ -52,7 +52,7 @@ class ChromeViewsDelegate : public views
+ base::OnceClosure callback) override;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool WindowManagerProvidesTitleBar(bool maximized) override;
+ gfx::ImageSkia* GetDefaultWindowIcon() const override;
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate__linux.cc b/chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate__linux.cc
new file mode 100644
index 0000000000..b5d0bde3be
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_chrome__views__delegate__linux.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/chrome_views_delegate_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/chrome_views_delegate_linux.cc
+@@ -26,7 +26,7 @@ bool IsDesktopEnvironmentUnity() {
+ return desktop_env == base::nix::DESKTOP_ENVIRONMENT_UNITY;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ int GetWindowIconResourceId() {
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ switch (chrome::GetChannel()) {
+@@ -80,7 +80,7 @@ views::NativeWidget* ChromeViewsDelegate
+ delegate);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ gfx::ImageSkia* ChromeViewsDelegate::GetDefaultWindowIcon() const {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ return rb.GetImageSkiaNamed(GetWindowIconResourceId());
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_compose_compose__dialog__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_compose_compose__dialog__view.cc
new file mode 100644
index 0000000000..89e477ed01
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_compose_compose__dialog__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/compose/compose_dialog_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/compose/compose_dialog_view.cc
+@@ -160,7 +160,7 @@ void ComposeDialogView::OnBeforeBubbleWi
+ views::Widget::InitParams* params,
+ views::Widget* widget) const {
+ WebUIBubbleDialogView::OnBeforeBubbleWidgetInit(params, widget);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // In linux, windows may be clipped to their anchors' bounds,
+ // resulting in visual errors, unless they use accelerated rendering. See
+ // crbug.com/1445770 for details.
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.cc
new file mode 100644
index 0000000000..0853e88c53
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.cc
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_frame.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_frame.cc
+@@ -52,7 +52,7 @@
+ #include "ui/aura/window.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/display/screen.h"
+ #include "ui/linux/linux_ui.h"
+ #endif
+@@ -87,7 +87,7 @@ class ThemeChangedObserver : public view
+ };
+
+ bool IsUsingLinuxSystemTheme(Profile* profile) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme();
+ #else
+ return false;
+@@ -182,7 +182,7 @@ void BrowserFrame::InitBrowserFrame() {
+
+ Init(std::move(params));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ SelectNativeTheme();
+ #else
+ SetNativeTheme(ui::NativeTheme::GetInstanceForNativeUi());
+@@ -369,7 +369,7 @@ void BrowserFrame::OnNativeWidgetWorkspa
+ chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace());
+ chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(),
+ IsVisibleOnAllWorkspaces());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If the window was sent to a different workspace, prioritize it if
+ // it was sent to the current workspace and deprioritize it
+ // otherwise. This is done by MoveBrowsersInWorkspaceToFront()
+@@ -563,7 +563,7 @@ void BrowserFrame::OnMenuClosed() {
+ }
+
+ void BrowserFrame::SelectNativeTheme() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Use the regular NativeTheme instance if running incognito mode, regardless
+ // of system theme (gtk, qt etc).
+ ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
+@@ -604,7 +604,7 @@ void BrowserFrame::OnTouchUiChanged() {
+ bool BrowserFrame::RegenerateFrameOnThemeChange(
+ BrowserThemeChangeType theme_change_type) {
+ bool need_regenerate = false;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // System and user theme changes can both change frame buttons, so the frame
+ // always needs to be regenerated on Linux.
+ need_regenerate = true;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.h b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.h
new file mode 100644
index 0000000000..3458782699
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_frame.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_frame.h
+@@ -66,7 +66,7 @@ class BrowserFrame : public views::Widge
+
+ ~BrowserFrame() override;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Returns whether the frame is in a tiled state.
+ bool tiled() const { return tiled_; }
+ void set_tiled(bool tiled) { tiled_ = tiled; }
+@@ -227,7 +227,7 @@ class BrowserFrame : public views::Widge
+ // contents for smoother dragging.
+ TabDragKind tab_drag_kind_ = TabDragKind::kNone;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool tiled_ = false;
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux.cc
new file mode 100644
index 0000000000..73e69855c8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc
+@@ -54,7 +54,7 @@ gfx::Insets BrowserFrameViewLayoutLinux:
+ OpaqueBrowserFrameViewLayout::RestoredFrameBorderInsets());
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const bool tiled = delegate_->IsTiled();
+ #else
+ const bool tiled = false;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux__native.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux__native.cc
new file mode 100644
index 0000000000..9047908e1a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__layout__linux__native.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native.cc
+@@ -18,7 +18,7 @@ BrowserFrameViewLayoutLinuxNative::~Brow
+
+ ui::WindowFrameProvider* BrowserFrameViewLayoutLinuxNative::GetFrameProvider()
+ const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const bool tiled = delegate_->IsTiled();
+ #else
+ const bool tiled = false;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__linux.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__linux.cc
new file mode 100644
index 0000000000..4c8f9350dc
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__frame__view__linux.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_frame_view_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_frame_view_linux.cc
+@@ -70,7 +70,7 @@ gfx::ShadowValues BrowserFrameViewLinux:
+
+ void BrowserFrameViewLinux::PaintRestoredFrameBorder(
+ gfx::Canvas* canvas) const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const bool tiled = frame()->tiled();
+ #else
+ const bool tiled = false;
+@@ -125,7 +125,7 @@ int BrowserFrameViewLinux::NonClientHitT
+ }
+
+ float BrowserFrameViewLinux::GetRestoredCornerRadiusDip() const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const bool tiled = frame()->tiled();
+ #else
+ const bool tiled = false;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc
new file mode 100644
index 0000000000..95fa820944
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc
+@@ -15,7 +15,7 @@
+ #include "chrome/browser/ui/views/frame/browser_frame_view_win.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux.h"
+ #include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native.h"
+ #include "chrome/browser/ui/views/frame/browser_frame_view_linux_native.h"
+@@ -32,7 +32,7 @@ namespace {
+ std::unique_ptr<OpaqueBrowserFrameView> CreateOpaqueBrowserFrameView(
+ BrowserFrame* frame,
+ BrowserView* browser_view) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* profile = browser_view->browser()->profile();
+ auto* linux_ui_theme = ui::LinuxUiTheme::GetForProfile(profile);
+ auto* theme_service_factory = ThemeServiceFactory::GetForProfile(profile);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__view.cc
new file mode 100644
index 0000000000..5b534b28ad
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_browser__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/browser_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/browser_view.cc
+@@ -2356,7 +2356,7 @@ void BrowserView::ToolbarSizeChanged(boo
+ }
+
+ void BrowserView::TabDraggingStatusChanged(bool is_dragging) {
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ contents_web_view_->SetFastResize(is_dragging);
+ if (!is_dragging) {
+ // When tab dragging is ended, we need to make sure the web contents get
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc
new file mode 100644
index 0000000000..a30964462c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/opaque_browser_frame_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+@@ -54,7 +54,7 @@
+ #include "ui/views/window/vector_icons/vector_icons.h"
+ #include "ui/views/window/window_shape.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/views/controls/menu/menu_runner.h"
+ #endif
+
+@@ -557,7 +557,7 @@ bool OpaqueBrowserFrameView::EverHasVisi
+
+ OpaqueBrowserFrameView::FrameButtonStyle
+ OpaqueBrowserFrameView::GetFrameButtonStyle() const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return FrameButtonStyle::kMdButton;
+ #else
+ return FrameButtonStyle::kImageButton;
+@@ -576,7 +576,7 @@ bool OpaqueBrowserFrameView::ShouldDrawR
+ return false;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool OpaqueBrowserFrameView::IsTiled() const {
+ return frame()->tiled();
+ }
+@@ -775,7 +775,7 @@ gfx::Rect OpaqueBrowserFrameView::GetIco
+ }
+
+ void OpaqueBrowserFrameView::WindowIconPressed() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Chrome OS doesn't show the window icon, and Windows handles this on its own
+ // due to the hit test being HTSYSMENU.
+ menu_runner_ = std::make_unique<views::MenuRunner>(
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.h b/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.h
new file mode 100644
index 0000000000..65e4698209
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/opaque_browser_frame_view.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/opaque_browser_frame_view.h
+@@ -110,7 +110,7 @@ class OpaqueBrowserFrameView : public Br
+ FrameButtonStyle GetFrameButtonStyle() const override;
+ void UpdateWindowControlsOverlay(const gfx::Rect& bounding_rect) override;
+ bool ShouldDrawRestoredFrameShadow() const override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool IsTiled() const override;
+ #endif
+ int WebAppButtonHeight() const override;
+@@ -227,7 +227,7 @@ class OpaqueBrowserFrameView : public Br
+ // Background painter for the window frame.
+ std::unique_ptr<views::FrameBackground> frame_background_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<views::MenuRunner> menu_runner_;
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view__layout__delegate.h b/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view__layout__delegate.h
new file mode 100644
index 0000000000..57b1866dfc
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view__layout__delegate.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h
+@@ -9,7 +9,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/base/ui_base_types.h"
+ #endif
+
+@@ -92,7 +92,7 @@ class OpaqueBrowserFrameViewLayoutDelega
+ // Returns true if a client-side shadow should be drawn for restored windows.
+ virtual bool ShouldDrawRestoredFrameShadow() const = 0;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Returns whether the window is in a tiled state.
+ virtual bool IsTiled() const = 0;
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc
new file mode 100644
index 0000000000..bd5bb93ec6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.cc
@@ -0,0 +1,98 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
+@@ -62,7 +62,7 @@
+ #include "ui/aura/window.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/themes/theme_service.h"
+ #include "chrome/browser/themes/theme_service_factory.h"
+ #include "chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.h"
+@@ -83,7 +83,7 @@ constexpr int kContentSettingIconSize =
+ // The height of the controls bar at the top of the window.
+ constexpr int kTopControlsHeight = 34;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Frame border when window shadow is not drawn.
+ constexpr int kFrameBorderThickness = 4;
+ #endif
+@@ -178,7 +178,7 @@ class WindowEventObserver : public ui::E
+
+ gfx::Rect input_bounds = pip_browser_frame_view_->GetLocalBounds();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Calculate input bounds for Linux. This is needed because the input bounds
+ // is not necessary the same as the local bounds on Linux.
+ if (pip_browser_frame_view_->ShouldDrawFrameShadow()) {
+@@ -583,7 +583,7 @@ PictureInPictureBrowserFrameView::Pictur
+ AddChildView(std::move(auto_pip_setting_overlay));
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* profile = browser_view->browser()->profile();
+ auto* linux_ui_theme = ui::LinuxUiTheme::GetForProfile(profile);
+ auto* theme_service_factory = ThemeServiceFactory::GetForProfile(profile);
+@@ -796,7 +796,7 @@ void PictureInPictureBrowserFrameView::O
+ for (ContentSettingImageView* view : content_setting_views_)
+ view->SetIconColor(color_provider->GetColor(kColorPipWindowForeground));
+
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // On Linux the top bar background will be drawn in OnPaint().
+ top_bar_container_view_->SetBackground(views::CreateSolidBackground(
+ color_provider->GetColor(kColorPipWindowTopBarBackground)));
+@@ -876,7 +876,7 @@ void PictureInPictureBrowserFrameView::R
+ BrowserNonClientFrameView::RemovedFromWidget();
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ gfx::Insets
+ PictureInPictureBrowserFrameView::RestoredMirroredFrameBorderInsets() const {
+ auto border = FrameBorderInsets();
+@@ -1166,7 +1166,7 @@ void PictureInPictureBrowserFrameView::A
+ // views::View implementations:
+
+ void PictureInPictureBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Draw the PiP window frame borders and shadows, including the top bar
+ // background.
+ if (window_frame_provider_) {
+@@ -1321,7 +1321,7 @@ void PictureInPictureBrowserFrameView::U
+ }
+
+ gfx::Insets PictureInPictureBrowserFrameView::FrameBorderInsets() const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (window_frame_provider_) {
+ const auto insets = window_frame_provider_->GetFrameThicknessDip();
+ const bool tiled = frame()->tiled();
+@@ -1339,7 +1339,7 @@ gfx::Insets PictureInPictureBrowserFrame
+ }
+
+ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return FrameBorderInsets();
+ #elif !BUILDFLAG(IS_CHROMEOS)
+ return gfx::Insets(kResizeBorder);
+@@ -1360,7 +1360,7 @@ gfx::Size PictureInPictureBrowserFrameVi
+ top_height + border_thickness.bottom());
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool PictureInPictureBrowserFrameView::ShouldDrawFrameShadow() const {
+ return static_cast<DesktopBrowserFrameAuraLinux*>(
+ frame()->native_browser_frame())
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.h b/chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.h
new file mode 100644
index 0000000000..77883e0ef0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_picture__in__picture__browser__frame__view.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h
+@@ -28,7 +28,7 @@
+ #include "ui/views/layout/flex_layout_view.h"
+ #include "ui/views/widget/widget_observer.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/window_frame_provider.h"
+ #endif
+
+@@ -88,7 +88,7 @@ class PictureInPictureBrowserFrameView
+ void Layout(PassKey) override;
+ void AddedToWidget() override;
+ void RemovedFromWidget() override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ gfx::Insets RestoredMirroredFrameBorderInsets() const override;
+ gfx::Insets GetInputInsets() const override;
+ SkRRect GetRestoredClipRegion() const override;
+@@ -180,7 +180,7 @@ class PictureInPictureBrowserFrameView
+ // Returns true if there's an overlay view that's currently shown.
+ bool IsOverlayViewVisible() const;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Returns whether a client-side shadow should be drawn for the window.
+ bool ShouldDrawFrameShadow() const;
+
+@@ -351,7 +351,7 @@ class PictureInPictureBrowserFrameView
+ // `top_bar_color_animation_`.
+ std::optional<SkColor> current_foreground_color_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Used to draw window frame borders and shadow on Linux when GTK theme is
+ // enabled.
+ raw_ptr<ui::WindowFrameProvider> window_frame_provider_ = nullptr;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__builder.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__builder.cc
new file mode 100644
index 0000000000..44c2801a4d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__builder.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/system_menu_model_builder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/system_menu_model_builder.cc
+@@ -71,7 +71,7 @@ void SystemMenuModelBuilder::BuildMenu(u
+
+ void SystemMenuModelBuilder::BuildSystemMenuForBrowserWindow(
+ ui::SimpleMenuModel* model) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ model->AddItemWithStringId(IDC_MINIMIZE_WINDOW, IDS_MINIMIZE_WINDOW_MENU);
+ model->AddItemWithStringId(IDC_MAXIMIZE_WINDOW, IDS_MAXIMIZE_WINDOW_MENU);
+ model->AddItemWithStringId(IDC_RESTORE_WINDOW, IDS_RESTORE_WINDOW_MENU);
+@@ -89,7 +89,7 @@ void SystemMenuModelBuilder::BuildSystem
+ model->AddSeparator(ui::NORMAL_SEPARATOR);
+ model->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
+ }
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ model->AddSeparator(ui::NORMAL_SEPARATOR);
+ bool supports_server_side_decorations = true;
+ #if BUILDFLAG(IS_OZONE) && !BUILDFLAG(IS_CHROMEOS)
+@@ -163,7 +163,7 @@ void SystemMenuModelBuilder::BuildSystem
+ model->AddSeparator(ui::NORMAL_SEPARATOR);
+ model->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
+ }
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ model->AddSeparator(ui::NORMAL_SEPARATOR);
+ model->AddItemWithStringId(IDC_CLOSE_WINDOW, IDS_CLOSE);
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__delegate.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__delegate.cc
new file mode 100644
index 0000000000..2f31667ccf
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_system__menu__model__delegate.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/system_menu_model_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/system_menu_model_delegate.cc
+@@ -20,7 +20,7 @@
+ #include "chromeos/ui/frame/desks/move_to_desks_menu_model.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/common/pref_names.h"
+ #include "components/prefs/pref_service.h"
+ #endif
+@@ -35,7 +35,7 @@ SystemMenuModelDelegate::SystemMenuModel
+ SystemMenuModelDelegate::~SystemMenuModelDelegate() {}
+
+ bool SystemMenuModelDelegate::IsCommandIdChecked(int command_id) const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (command_id == IDC_USE_SYSTEM_TITLE_BAR) {
+ PrefService* prefs = browser_->profile()->GetPrefs();
+ return !prefs->GetBoolean(prefs::kUseCustomChromeFrame);
+@@ -55,7 +55,7 @@ bool SystemMenuModelDelegate::IsCommandI
+ }
+
+ bool SystemMenuModelDelegate::IsCommandIdVisible(int command_id) const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool is_maximized = browser_->window()->IsMaximized();
+ switch (command_id) {
+ case IDC_MAXIMIZE_WINDOW:
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_frame_tab__strip__region__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_frame_tab__strip__region__view.cc
new file mode 100644
index 0000000000..8b8ba3d01e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_frame_tab__strip__region__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/frame/tab_strip_region_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/frame/tab_strip_region_view.cc
+@@ -219,7 +219,7 @@ TabStripRegionView::TabStripRegionView(s
+ new_tab_button_->GetViewAccessibility().SetName(
+ l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The New Tab Button can be middle-clicked on Linux.
+ new_tab_button_->SetTriggerableEventFlags(
+ new_tab_button_->GetTriggerableEventFlags() |
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_hung__renderer__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_hung__renderer__view.cc
new file mode 100644
index 0000000000..4b7e0f1c99
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_hung__renderer__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/hung_renderer_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/hung_renderer_view.cc
+@@ -408,7 +408,7 @@ void HungRendererDialogView::ForceCrashH
+ content::RenderProcessHost* rph =
+ hung_pages_table_model_->GetRenderWidgetHost()->GetProcess();
+ if (rph) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // A generic |CrashDumpHungChildProcess()| is not implemented for Linux.
+ // Instead we send an explicit IPC to crash on the renderer's IO thread.
+ rph->ForceCrash();
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_omnibox_omnibox__view__views.cc b/chromium-next/patches/patch-chrome_browser_ui_views_omnibox_omnibox__view__views.cc
new file mode 100644
index 0000000000..d3cdb7b1b9
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_omnibox_omnibox__view__views.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/omnibox/omnibox_view_views.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+@@ -2005,7 +2005,7 @@ void OmniboxViewViews::MaybeAddSendTabTo
+ }
+
+ void OmniboxViewViews::OnPopupOpened() {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // It's not great for promos to overlap the omnibox if the user opens the
+ // drop-down after showing the promo. This especially causes issues on Mac and
+ // Linux due to z-order/rendering issues, see crbug.com/1225046 and
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_passwords_password__bubble__view__base.cc b/chromium-next/patches/patch-chrome_browser_ui_views_passwords_password__bubble__view__base.cc
new file mode 100644
index 0000000000..462cdca5a5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_passwords_password__bubble__view__base.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/passwords/password_bubble_view_base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/passwords/password_bubble_view_base.cc
+@@ -40,7 +40,7 @@
+ #include "ui/base/metadata/metadata_impl_macros.h"
+ #include "ui/views/controls/button/button.h"
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/views/passwords/password_relaunch_chrome_view.h"
+ #endif
+
+@@ -156,7 +156,7 @@ PasswordBubbleViewBase* PasswordBubbleVi
+ } else if (model_state ==
+ password_manager::ui::NOTIFY_RECEIVED_SHARED_CREDENTIALS) {
+ view = new SharedPasswordsNotificationView(web_contents, anchor_view);
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ } else if (model_state == password_manager::ui::KEYCHAIN_ERROR_STATE) {
+ view = new RelaunchChromeView(
+ web_contents, anchor_view,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view.cc
new file mode 100644
index 0000000000..fa6bcb0046
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/profiles/profile_menu_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/profiles/profile_menu_view.cc
+@@ -89,7 +89,7 @@
+ #include "ui/strings/grit/ui_strings.h"
+ #include "ui/views/accessibility/view_accessibility.h"
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/signin/enterprise_signin_prefs.h"
+ #endif
+
+@@ -580,7 +580,7 @@ void ProfileMenuView::BuildIdentity() {
+ badge_image_model, menu_title_, menu_subtitle_, management_label);
+ } else {
+ std::string profile_user_display_name, profile_user_email;
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ profile_user_display_name = profile->GetPrefs()->GetString(
+ enterprise_signin::prefs::kProfileUserDisplayName);
+ profile_user_email = profile->GetPrefs()->GetString(
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc
new file mode 100644
index 0000000000..73cf61b26f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc
+@@ -698,7 +698,7 @@ void ProfileMenuViewBase::SetProfileIden
+ image_model, management_badge, this,
+ ProfileMenuViewBase::kIdentityImageSize, kIdentityImageBorder);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // crbug.com/1161166: Orca does not read the accessible window title of the
+ // bubble, so we duplicate it in the top-level menu item. To be revisited
+ // after considering other options, including fixes on the AT side.
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__picker__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__picker__view.cc
new file mode 100644
index 0000000000..b2271f005d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_profile__picker__view.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/profiles/profile_picker_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/profiles/profile_picker_view.cc
+@@ -85,7 +85,7 @@
+ #include "chrome/browser/global_keyboard_shortcuts_mac.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/shell_integration_linux.h"
+ #endif
+
+@@ -115,7 +115,7 @@ class ProfilePickerWidget : public views
+ views::Widget::InitParams params(
+ views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET);
+ params.delegate = profile_picker_view_;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ params.wm_class_name = shell_integration_linux::GetProgramClassName();
+ params.wm_class_class = shell_integration_linux::GetProgramClassClass();
+ params.wayland_app_id = params.wm_class_class;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc
new file mode 100644
index 0000000000..b51a0ac968
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc
+@@ -58,7 +58,7 @@
+ namespace {
+
+ const int kModalDialogWidth = 448;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const int kManagedUserNoticeConfirmationDialogWidth = 512;
+ const int kManagedUserNoticeConfirmationDialogHeight = 576;
+ const int kManagedUserNoticeConfirmationUpdatedDialogWidth = 780;
+@@ -179,7 +179,7 @@ SigninViewControllerDelegateViews::Creat
+ }
+ #endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // static
+ std::unique_ptr<views::WebView>
+ SigninViewControllerDelegateViews::CreateManagedUserNoticeConfirmationWebView(
+@@ -338,7 +338,7 @@ SigninViewControllerDelegateViews::Signi
+
+ SetButtons(static_cast<int>(ui::mojom::DialogButton::kNone));
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On the local profile creation dialog, cancelling the dialog (for instance
+ // through the VKEY_ESCAPE accelerator) should delete the profile.
+ if (delete_profile_on_cancel) {
+@@ -426,7 +426,7 @@ void SigninViewControllerDelegateViews::
+ content_view_->RequestFocus();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SigninViewControllerDelegateViews::DeleteProfileOnCancel() {
+ ProfileAttributesEntry* entry =
+ g_browser_process->profile_manager()
+@@ -502,7 +502,7 @@ SigninViewControllerDelegate::CreateProf
+ }
+ #endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // static
+ SigninViewControllerDelegate*
+ SigninViewControllerDelegate::CreateManagedUserNoticeDelegate(
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.h b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.h
new file mode 100644
index 0000000000..5caae53325
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h
+@@ -74,7 +74,7 @@ class SigninViewControllerDelegateViews
+ bool show_supervised_user_iph = false);
+ #endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ static std::unique_ptr<views::WebView>
+ CreateManagedUserNoticeConfirmationWebView(
+ Browser* browser,
+@@ -138,7 +138,7 @@ class SigninViewControllerDelegateViews
+ std::optional<int> dialog_width,
+ InitializeSigninWebDialogUI initialize_signin_web_dialog_ui);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Deletes the ephemeral profile when cancelling the local profile creation
+ // dialog.
+ void DeleteProfileOnCancel();
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab.cc b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab.cc
new file mode 100644
index 0000000000..7094ce0767
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/tabs/tab.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/tabs/tab.cc
+@@ -626,7 +626,7 @@ void Tab::MaybeUpdateHoverStatus(const u
+ return;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Move the hit test area for hovering up so that it is not overlapped by tab
+ // hover cards when they are shown.
+ // TODO(crbug.com/41467565): Once Linux/CrOS widget transparency is solved,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc
new file mode 100644
index 0000000000..385c9c3c62
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/tabs/tab_drag_controller.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/tabs/tab_drag_controller.cc
+@@ -211,7 +211,7 @@ bool IsWindowDragUsingSystemDragDropAllo
+
+ void UpdateSystemDnDDragImage(TabDragContext* attached_context,
+ const gfx::ImageSkia& image) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ aura::Window* root_window =
+ attached_context->GetWidget()->GetNativeWindow()->GetRootWindow();
+ if (aura::client::GetDragDropClient(root_window)) {
+@@ -411,7 +411,7 @@ TabDragController::Liveness TabDragContr
+ // synchronous on desktop Linux, so use that.
+ // - ChromeOS Ash
+ // Releasing capture on Ash cancels gestures so avoid it.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ref->can_release_capture_ = false;
+ #endif
+ ref->start_point_in_screen_ =
+@@ -1015,7 +1015,7 @@ TabDragController::DragBrowserToNewTabSt
+ else
+ SetCapture(target_context);
+
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // EndMoveLoop is going to snap the window back to its original location.
+ // Hide it so users don't see this. Hiding a window in Linux aura causes
+ // it to lose capture so skip it.
+@@ -2078,7 +2078,7 @@ void TabDragController::CompleteDrag() {
+ }
+
+ // If source window was maximized - maximize the new window as well.
+-#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC)
++#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ // Keeping maximized state breaks snap to Grid on Windows when dragging
+ // tabs from maximized windows. TODO:(crbug.com/727051) Explore doing this
+ // for other desktop OS's. kMaximizedStateRetainedOnTabDrag in
+@@ -2526,7 +2526,7 @@ TabDragController::Liveness TabDragContr
+ exclude.insert(dragged_window);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Exclude windows which are pending deletion via Browser::TabStripEmpty().
+ // These windows can be returned in the Linux Aura port because the browser
+ // window which was used for dragging is not hidden once all of its tabs are
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc
new file mode 100644
index 0000000000..d094cf371c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__hover__card__bubble__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
+@@ -376,7 +376,7 @@ TabHoverCardBubbleView::TabHoverCardBubb
+ // not become active. Setting this to false creates the need to explicitly
+ // hide the hovercard on press, touch, and keyboard events.
+ SetCanActivate(false);
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ set_accept_events(false);
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__style__views.cc b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__style__views.cc
new file mode 100644
index 0000000000..0524c79a9b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_tabs_tab__style__views.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/tabs/tab_style_views.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/tabs/tab_style_views.cc
+@@ -550,7 +550,7 @@ float TabStyleViewsImpl::GetCurrentActiv
+ if (!IsHoverAnimationActive()) {
+ return base_opacity;
+ }
+- return std::lerp(base_opacity, GetHoverOpacity(), GetHoverAnimationValue());
++ return std::lerp(base_opacity, GetHoverOpacity(), static_cast<float>(GetHoverAnimationValue()));
+ }
+
+ TabActive TabStyleViewsImpl::GetApparentActiveState() const {
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_user__education_browser__user__education__service.cc b/chromium-next/patches/patch-chrome_browser_ui_views_user__education_browser__user__education__service.cc
new file mode 100644
index 0000000000..d6eddd8212
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_user__education_browser__user__education__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/user_education/browser_user_education_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/user_education/browser_user_education_service.cc
+@@ -872,7 +872,7 @@ void MaybeRegisterChromeFeaturePromos(
+ "defaulted to saved for the first time.")));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // kIPHSupervisedUserProfileSigninFeature
+ registry.RegisterFeature(std::move(
+ FeaturePromoSpecification::CreateForCustomAction(
+@@ -1112,7 +1112,7 @@ void MaybeRegisterChromeFeaturePromos(
+ "Triggered to inform users of the availability of the "
+ "new translate screen feature on the Lens Overlay.")));
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // kIPHDesktopPWAsLinkCapturingLaunch:
+ registry.RegisterFeature(std::move(
+ FeaturePromoSpecification::CreateForCustomAction(
diff --git a/chromium-next/patches/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc b/chromium-next/patches/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc
new file mode 100644
index 0000000000..72a1c10e09
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_views_web__apps_web__app__integration__test__driver.cc
@@ -0,0 +1,89 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc
+@@ -503,7 +503,7 @@ std::string GetFileExtension(FileExtensi
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SiteConfig GetSiteConfigurationFromAppName(const std::string& app_name) {
+ SiteConfig config;
+ bool is_app_found = false;
+@@ -2031,7 +2031,7 @@ void WebAppIntegrationTestDriver::Delete
+ if (app_name.empty()) {
+ app_name = GetSiteConfiguration(site).app_name;
+ }
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ASSERT_TRUE(override_registration_->test_override().IsShortcutCreated(
+ profile(), app_id, app_name));
+ ASSERT_TRUE(
+@@ -3367,7 +3367,7 @@ void WebAppIntegrationTestDriver::CheckR
+ app_state->id, app_state->name);
+ ASSERT_TRUE(icon_color.has_value());
+ ASSERT_THAT(site_config.icon_color, testing::Eq(icon_color.value()));
+-#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ASSERT_TRUE(override_registration_->test_override().IsRunOnOsLoginEnabled(
+ profile(), app_state->id, app_state->name));
+ #endif
+@@ -3382,7 +3382,7 @@ void WebAppIntegrationTestDriver::CheckR
+ GetAppBySiteMode(after_state_change_action_state_.get(), profile(), site);
+ ASSERT_TRUE(app_state);
+ base::ScopedAllowBlockingForTesting allow_blocking;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ASSERT_FALSE(override_registration_->test_override().IsRunOnOsLoginEnabled(
+ profile(), app_state->id, app_state->name));
+ #endif
+@@ -3392,7 +3392,7 @@ void WebAppIntegrationTestDriver::CheckR
+ void WebAppIntegrationTestDriver::CheckSiteHandlesFile(
+ Site site,
+ FileExtension file_extension) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!BeforeStateCheckAction(__FUNCTION__)) {
+ return;
+ }
+@@ -3408,7 +3408,7 @@ void WebAppIntegrationTestDriver::CheckS
+ void WebAppIntegrationTestDriver::CheckSiteNotHandlesFile(
+ Site site,
+ FileExtension file_extension) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!BeforeStateCheckAction(__FUNCTION__)) {
+ return;
+ }
+@@ -4228,7 +4228,7 @@ base::FilePath WebAppIntegrationTestDriv
+ base::FilePath shortcut_dir,
+ const std::string& app_name,
+ const webapps::AppId& app_id) {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return override_registration_->test_override().GetShortcutPath(
+ profile(), shortcut_dir, app_id, app_name);
+ #else
+@@ -4428,7 +4428,7 @@ bool WebAppIntegrationTestDriver::IsShor
+ const webapps::AppId& id) {
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ bool is_shortcut_and_icon_correct = false;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool is_shortcut_correct =
+ override_registration_->test_override().IsShortcutCreated(profile, id,
+ name);
+@@ -4472,7 +4472,7 @@ bool WebAppIntegrationTestDriver::DoIcon
+ do_icon_colors_match =
+ (expected_icon_pixel_color == shortcut_pixel_color_apps_folder.value());
+ }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SkColor expected_icon_pixel_color =
+ GetSiteConfigurationFromAppName(name).icon_color;
+ std::optional<SkColor> actual_color_install_icon_size =
diff --git a/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__dialogs.h b/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__dialogs.h
new file mode 100644
index 0000000000..09bcf4b081
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__dialogs.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/web_applications/web_app_dialogs.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/web_applications/web_app_dialogs.h
+@@ -21,7 +21,7 @@
+ #include "ui/gfx/native_widget_types.h"
+
+ static_assert(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+- BUILDFLAG(IS_CHROMEOS));
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD));
+
+ class GURL;
+ class Profile;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.cc b/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.cc
new file mode 100644
index 0000000000..59cfaed13f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/web_applications/web_app_ui_manager_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/web_applications/web_app_ui_manager_impl.cc
+@@ -522,7 +522,7 @@ void WebAppUiManagerImpl::MaybeShowIPHPr
+ Browser* browser,
+ Profile* profile,
+ const std::string& app_id) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ WebAppProvider* provider = WebAppProvider::GetForWebApps(profile);
+ CHECK(provider);
+
+@@ -748,7 +748,7 @@ void WebAppUiManagerImpl::ClearWebAppSit
+ }
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ const base::Feature& GetPromoFeatureEngagementFromBrowser(
+ const Browser* browser) {
diff --git a/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.h b/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.h
new file mode 100644
index 0000000000..b678713738
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_web__applications_web__app__ui__manager__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/web_applications/web_app_ui_manager_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/web_applications/web_app_ui_manager_impl.h
+@@ -223,7 +223,7 @@ class WebAppUiManagerImpl : public Brows
+ UninstallCompleteCallback uninstall_complete_callback,
+ webapps::UninstallResultCode uninstall_code);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ShowIPHPromoForAppsLaunchedViaLinkCapturing(const Browser* browser,
+ const webapps::AppId& app_id,
+ bool is_activated);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.cc
new file mode 100644
index 0000000000..6e5e8b1a67
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/about/about_ui.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/about/about_ui.cc
+@@ -592,7 +592,7 @@ std::string ChromeURLs(content::BrowserC
+ return html;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::string AboutLinuxProxyConfig() {
+ std::string data;
+ AppendHeader(&data,
+@@ -625,7 +625,7 @@ TermsUIConfig::TermsUIConfig()
+ : AboutUIConfigBase(chrome::kChromeUITermsHost) {}
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ LinuxProxyConfigUI::LinuxProxyConfigUI()
+ : AboutUIConfigBase(chrome::kChromeUILinuxProxyConfigHost) {}
+ #endif
+@@ -677,7 +677,7 @@ void AboutUIHTMLSource::StartDataRequest
+ response =
+ ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(idr);
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ } else if (source_name_ == chrome::kChromeUILinuxProxyConfigHost) {
+ response = AboutLinuxProxyConfig();
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.h b/chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.h
new file mode 100644
index 0000000000..905aa9be52
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_about_about__ui.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/about/about_ui.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/about/about_ui.h
+@@ -50,7 +50,7 @@ class TermsUIConfig : public AboutUIConf
+ };
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // chrome://linux-proxy-config
+ class LinuxProxyConfigUI : public AboutUIConfigBase {
+ public:
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc
new file mode 100644
index 0000000000..c64ac47ce5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/app_home/app_home_page_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/app_home/app_home_page_handler.cc
+@@ -62,7 +62,7 @@
+ #include "ui/base/window_open_disposition_utils.h"
+ #include "url/gurl.h"
+
+-static_assert(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX));
++static_assert(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD));
+
+ using content::WebUI;
+ using extensions::Extension;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.h b/chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.h
new file mode 100644
index 0000000000..7ce9cbdb20
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_app__home_app__home__page__handler.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/app_home/app_home_page_handler.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/app_home/app_home_page_handler.h
+@@ -24,7 +24,7 @@
+ #include "mojo/public/cpp/bindings/receiver.h"
+ #include "mojo/public/cpp/bindings/remote.h"
+
+-static_assert(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX));
++static_assert(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD));
+
+ class ExtensionEnableFlow;
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_app__settings_web__app__settings__ui.h b/chromium-next/patches/patch-chrome_browser_ui_webui_app__settings_web__app__settings__ui.h
new file mode 100644
index 0000000000..4cc7958fd6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_app__settings_web__app__settings__ui.h
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/app_settings/web_app_settings_ui.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/app_settings/web_app_settings_ui.h
+@@ -14,13 +14,13 @@
+ #include "ui/webui/mojo_web_ui_controller.h"
+ #include "ui/webui/resources/cr_components/app_management/app_management.mojom-forward.h"
+
+-#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/common/webui_url_constants.h"
+ #include "content/public/browser/webui_config.h"
+ #include "content/public/common/url_constants.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class WebAppSettingsUI;
+
+ class WebAppSettingsUIConfig
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_certificate__manager__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_certificate__manager__handler.cc
new file mode 100644
index 0000000000..83b9a35ec8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_certificate__manager__handler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/certificate_manager/certificate_manager_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/certificate_manager/certificate_manager_handler.cc
+@@ -216,7 +216,7 @@ CertificateManagerPageHandler::GetCertSo
+ CERTIFICATE_TRUST_TYPE_DISTRUSTED,
+ profile_, &remote_client_);
+ break;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case certificate_manager_v2::mojom::CertificateSource::
+ kProvisionedClientCert:
+ source_ptr = CreateProvisionedClientCertSource(profile_);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.cc
new file mode 100644
index 0000000000..f89b1fa7b5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.cc
@@ -0,0 +1,71 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/certificate_manager/client_cert_sources.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/certificate_manager/client_cert_sources.cc
+@@ -54,7 +54,7 @@
+ #include "net/ssl/client_cert_store_mac.h"
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/client_certificates/certificate_provisioning_service_factory.h"
+ #include "components/enterprise/client_certificates/core/certificate_provisioning_service.h"
+ #include "components/enterprise/client_certificates/core/client_certificates_service.h"
+@@ -177,7 +177,7 @@ class ClientCertStoreFactoryMac : public
+ };
+ #endif
+
+-#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ std::unique_ptr<ClientCertStoreLoader> CreatePlatformClientCertLoader(
+ Profile* profile) {
+ #if BUILDFLAG(IS_WIN)
+@@ -192,7 +192,7 @@ std::unique_ptr<ClientCertStoreLoader> C
+ }
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // ClientCertStore implementation that always returns an empty list. The
+ // CertificateProvisioningService implementation expects to wrap a platform
+ // cert store, but here we only want to get results from the provisioning
+@@ -350,7 +350,7 @@ class ClientCertSource : public Certific
+ std::optional<net::CertificateList> certs_;
+ };
+
+-#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // ChromeOS currently can use either Kcer or NSS for listing client certs, and
+ // Linux uses NSS only. This interface provides an abstraction to hide that
+ // from WritableClientCertSource. Currently this class only handles reading
+@@ -1057,7 +1057,7 @@ CreatePlatformClientCertSource(
+ mojo::Remote<certificate_manager_v2::mojom::CertificateManagerPage>*
+ remote_client,
+ Profile* profile) {
+-#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return std::make_unique<WritableClientCertSource>(remote_client, profile);
+ #else
+ return std::make_unique<ClientCertSource>(
+@@ -1065,7 +1065,7 @@ CreatePlatformClientCertSource(
+ #endif
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<CertificateManagerPageHandler::CertSource>
+ CreateProvisionedClientCertSource(Profile* profile) {
+ return std::make_unique<ClientCertSource>(
+@@ -1116,7 +1116,7 @@ bool ClientCertManagementAccessControls:
+
+ return client_cert_policy_ == ClientCertificateManagementPermission::kAll;
+ }
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ClientCertManagementAccessControls::ClientCertManagementAccessControls(
+ Profile* profile) {}
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.h b/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.h
new file mode 100644
index 0000000000..6fe638bc8a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_certificate__manager_client__cert__sources.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/certificate_manager/client_cert_sources.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/certificate_manager/client_cert_sources.h
+@@ -19,7 +19,7 @@ CreatePlatformClientCertSource(
+ remote_client,
+ Profile* profile);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<CertificateManagerPageHandler::CertSource>
+ CreateProvisionedClientCertSource(Profile* profile);
+ #endif
+@@ -29,7 +29,7 @@ std::unique_ptr<CertificateManagerPageHa
+ CreateExtensionsClientCertSource(Profile* profile);
+ #endif
+
+-#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class ClientCertManagementAccessControls {
+ public:
+ enum KeyStorage {
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__configs.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__configs.cc
new file mode 100644
index 0000000000..e6a9ad08cb
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__configs.cc
@@ -0,0 +1,104 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/chrome_web_ui_configs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/chrome_web_ui_configs.cc
+@@ -139,30 +139,30 @@
+ #include "chrome/browser/ui/webui/conflicts/conflicts_ui.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/webui_js_error/webui_js_error_ui.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#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/webui/app_settings/web_app_settings_ui.h"
+ #include "chrome/browser/ui/webui/browser_switch/browser_switch_ui.h"
+ #include "chrome/browser/ui/webui/whats_new/whats_new_ui.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/discards/discards_ui.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS)
+@@ -198,7 +198,7 @@
+ #include "chrome/browser/ui/webui/signin/signin_error_ui.h"
+ #endif // !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/on_device_translation_internals/on_device_translation_internals_ui.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+@@ -326,14 +326,14 @@ void RegisterChromeWebUIConfigs() {
+ map.AddWebUIConfig(std::make_unique<WebuiGalleryUIConfig>());
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ map.AddWebUIConfig(std::make_unique<WebUIJsErrorUIConfig>());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ map.AddWebUIConfig(std::make_unique<LinuxProxyConfigUI>());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+- // BUILDFLAG(IS_OPENBSD)
++ // BUILDFLAG(IS_BSD)
+
+ #if BUILDFLAG(ENABLE_EXTENSIONS)
+ map.AddWebUIConfig(std::make_unique<extensions::ExtensionsUIConfig>());
+@@ -355,7 +355,7 @@ void RegisterChromeWebUIConfigs() {
+ map.AddWebUIConfig(std::make_unique<ConflictsUIConfig>());
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ map.AddWebUIConfig(std::make_unique<BrowserSwitchUIConfig>());
+ map.AddWebUIConfig(std::make_unique<WebAppSettingsUIConfig>());
+ map.AddWebUIConfig(std::make_unique<WhatsNewUIConfig>());
+@@ -363,20 +363,20 @@ void RegisterChromeWebUIConfigs() {
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ map.AddWebUIConfig(std::make_unique<SandboxInternalsUIConfig>());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ map.AddWebUIConfig(
+ std::make_unique<enterprise_connectors::ConnectorsInternalsUIConfig>());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ map.AddWebUIConfig(std::make_unique<DiscardsUIConfig>());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc
new file mode 100644
index 0000000000..463722c71b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc
@@ -0,0 +1,46 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+@@ -123,16 +123,16 @@
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/commerce/product_specifications_ui.h"
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/whats_new/whats_new_ui.h"
+ #endif
+
+@@ -412,7 +412,7 @@ base::RefCountedMemory* ChromeWebUIContr
+ if (page_url.host_piece() == chrome::kChromeUINewTabPageHost)
+ return NewTabPageUI::GetFaviconResourceBytes(scale_factor);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (page_url.host_piece() == chrome::kChromeUIWhatsNewHost)
+ return WhatsNewUI::GetFaviconResourceBytes(scale_factor);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+@@ -440,7 +440,7 @@ base::RefCountedMemory* ChromeWebUIContr
+ return ManagementUI::GetFaviconResourceBytes(scale_factor);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (page_url.host_piece() == commerce::kChromeUICompareHost) {
+ return commerce::ProductSpecificationsUI::GetFaviconResourceBytes(
+ scale_factor);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_connectors__internals_device__trust__utils.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_connectors__internals_device__trust__utils.cc
new file mode 100644
index 0000000000..786ef75248
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_connectors__internals_device__trust__utils.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/connectors_internals/device_trust_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/connectors_internals/device_trust_utils.cc
+@@ -7,7 +7,7 @@
+ #include "build/build_config.h"
+ #include "components/enterprise/buildflags/buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "base/base64url.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/policy/chrome_browser_policy_connector.h"
+@@ -38,7 +38,7 @@ namespace enterprise_connectors::utils {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+
+ connectors_internals::mojom::KeyTrustLevel ParseTrustLevel(
+ BPKUR::KeyTrustLevel trust_level) {
+@@ -173,7 +173,7 @@ connectors_internals::mojom::Certificate
+ } // namespace
+
+ connectors_internals::mojom::KeyInfoPtr GetKeyInfo() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ auto* key_manager = g_browser_process->browser_policy_connector()
+ ->chrome_browser_cloud_management_controller()
+ ->GetDeviceTrustKeyManager();
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_internals_user__education_user__education__internals__page__handler__impl.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_internals_user__education_user__education__internals__page__handler__impl.cc
new file mode 100644
index 0000000000..1d451cbb19
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_internals_user__education_user__education__internals__page__handler__impl.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/internals/user_education/user_education_internals_page_handler_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/internals/user_education/user_education_internals_page_handler_impl.cc
+@@ -44,7 +44,7 @@
+ #include "ui/base/l10n/l10n_util.h"
+ #include "ui/base/webui/resource_path.h"
+
+-#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_navigator.h"
+ #include "chrome/browser/ui/browser_navigator_params.h"
+ #include "net/base/url_util.h"
+@@ -84,7 +84,7 @@ user_education::NewBadgeRegistry* GetNew
+ }
+
+ whats_new::WhatsNewRegistry* GetWhatsNewRegistry() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return g_browser_process->GetFeatures()->whats_new_registry();
+ #else
+ return nullptr;
+@@ -773,7 +773,7 @@ void UserEducationInternalsPageHandlerIm
+ }
+
+ void UserEducationInternalsPageHandlerImpl::LaunchWhatsNewStaging() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ GURL url = net::AppendQueryParameter(GURL(chrome::kChromeUIWhatsNewURL),
+ "staging", "true");
+ NavigateParams params(profile_, url, ui::PAGE_TRANSITION_TYPED);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_interstitials_interstitial__ui.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_interstitials_interstitial__ui.cc
new file mode 100644
index 0000000000..625776faa2
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_interstitials_interstitial__ui.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/interstitials/interstitial_ui.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+@@ -74,7 +74,7 @@
+ #include "components/security_interstitials/content/captive_portal_blocking_page.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/supervised_user/supervised_user_verification_controller_client.h"
+ #include "chrome/browser/supervised_user/supervised_user_verification_page_blocked_sites.h"
+ #include "chrome/browser/supervised_user/supervised_user_verification_page_youtube.h"
+@@ -395,7 +395,7 @@ std::unique_ptr<EnterpriseWarnPage> Crea
+ kRequestUrl));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<SupervisedUserVerificationPageForYouTube>
+ CreateSupervisedUserVerificationPageForYouTube(
+ content::WebContents* web_contents,
+@@ -612,7 +612,7 @@ void InterstitialHTMLSource::StartDataRe
+ interstitial_delegate = CreateInsecureFormPage(web_contents);
+ } else if (path_without_query == "/https_only") {
+ interstitial_delegate = CreateHttpsOnlyModePage(web_contents);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ } else if (path_without_query == "/supervised-user-verify") {
+ interstitial_delegate = CreateSupervisedUserVerificationPageForYouTube(
+ web_contents, /*is_main_frame=*/true);
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui.cc
new file mode 100644
index 0000000000..076982f894
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui.cc
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/management/management_ui.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/management/management_ui.cc
+@@ -185,11 +185,11 @@ void ManagementUI::GetLocalizedStrings(
+ IDS_MANAGEMENT_FILE_TRANSFER_VISIBLE_DATA},
+ {kManagementReportFileEvents, IDS_MANAGEMENT_REPORT_FILE_EVENTS},
+ #endif // BUILDFLAG(IS_CHROMEOS)
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {kManagementScreenCaptureEvent, IDS_MANAGEMENT_SCREEN_CAPTURE_EVENT},
+ {kManagementScreenCaptureData, IDS_MANAGEMENT_SCREEN_CAPTURE_DATA},
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {kManagementDeviceSignalsDisclosure,
+ IDS_MANAGEMENT_DEVICE_SIGNALS_DISCLOSURE},
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.cc
new file mode 100644
index 0000000000..57c08eed1b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.cc
@@ -0,0 +1,23 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/management/management_ui_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/management/management_ui_constants.cc
+@@ -89,12 +89,12 @@ const char kProfileReportingExtension[]
+ const char kProfileReportingPolicy[] = "profileReportingPolicy";
+ const char kProfileReportingLearnMore[] = "profileReportingLearnMore";
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char kManagementScreenCaptureEvent[] = "managementScreenCaptureEvent";
+ const char kManagementScreenCaptureData[] = "managementScreenCaptureData";
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char kManagementDeviceSignalsDisclosure[] =
+ "managementDeviceSignalsDisclosure";
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.h b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.h
new file mode 100644
index 0000000000..d4abb19a7b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__constants.h
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/management/management_ui_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/management/management_ui_constants.h
+@@ -8,14 +8,14 @@
+ #include "build/build_config.h"
+ #include "build/chromeos_buildflags.h"
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Constants defining the IDs for the localized strings sent to the page as
+ // load time data.
+ extern const char kManagementScreenCaptureEvent[];
+ extern const char kManagementScreenCaptureData[];
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extern const char kManagementDeviceSignalsDisclosure[];
+ #endif // #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.cc
new file mode 100644
index 0000000000..86668d2a81
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/management/management_ui_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/management/management_ui_handler.cc
+@@ -58,7 +58,7 @@
+ #include "ui/base/l10n/l10n_util.h"
+ #include "ui/base/webui/web_ui_util.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/signals/user_permission_service_factory.h"
+ #include "components/device_signals/core/browser/user_permission_service.h" // nogncheck
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+@@ -349,7 +349,7 @@ void ManagementUIHandler::AddReportingIn
+ report_sources->Append(std::move(data));
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto device_signal_data = GetDeviceSignalGrantedMessage();
+ if (!device_signal_data.empty()) {
+ report_sources->Append(std::move(device_signal_data));
+@@ -371,7 +371,7 @@ void ManagementUIHandler::AddReportingIn
+ report_sources->Append(std::move(data));
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto device_signal_data = GetDeviceSignalGrantedMessage();
+ if (!device_signal_data.empty()) {
+ report_sources->Append(std::move(device_signal_data));
+@@ -552,7 +552,7 @@ policy::PolicyService* ManagementUIHandl
+ ->policy_service();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ device_signals::UserPermissionService*
+ ManagementUIHandler::GetUserPermissionService() {
+ return enterprise_signals::UserPermissionServiceFactory::GetForProfile(
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.h b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.h
new file mode 100644
index 0000000000..111cef993f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_management_management__ui__handler.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/management/management_ui_handler.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/management/management_ui_handler.h
+@@ -31,7 +31,7 @@ namespace policy {
+ class PolicyService;
+ } // namespace policy
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ namespace device_signals {
+ class UserPermissionService;
+ } // namespace device_signals
+@@ -72,7 +72,7 @@ class ManagementUIHandler : public conte
+ base::Value::List GetManagedWebsitesInfo(Profile* profile) const;
+ base::Value::List GetApplicationsInfo(Profile* profile) const;
+ virtual policy::PolicyService* GetPolicyService();
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ virtual device_signals::UserPermissionService* GetUserPermissionService();
+ base::Value::Dict GetDeviceSignalGrantedMessage();
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards__handler.cc
new file mode 100644
index 0000000000..8f4f4ed8e9
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards__handler.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/password_manager/promo_cards_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/password_manager/promo_cards_handler.cc
+@@ -28,7 +28,7 @@
+ #include "chrome/browser/ui/webui/password_manager/promo_cards/web_password_manager_promo.h"
+ #endif
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/password_manager/promo_cards/relaunch_chrome_promo.h"
+ #endif
+
+@@ -71,7 +71,7 @@ std::vector<std::unique_ptr<PasswordProm
+ .get()));
+ #endif
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ promo_cards.push_back(
+ std::make_unique<RelaunchChromePromo>(profile->GetPrefs()));
+ #endif
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards_relaunch__chrome__promo.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards_relaunch__chrome__promo.cc
new file mode 100644
index 0000000000..5c6db2453a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_password__manager_promo__cards_relaunch__chrome__promo.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/password_manager/promo_cards/relaunch_chrome_promo.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/password_manager/promo_cards/relaunch_chrome_promo.cc
+@@ -37,7 +37,7 @@ std::u16string RelaunchChromePromo::GetT
+ return l10n_util::GetStringUTF16(
+ #if BUILDFLAG(IS_MAC)
+ IDS_PASSWORD_MANAGER_UI_RELAUNCH_CHROME_PROMO_CARD_TITLE
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ IDS_PASSWORD_MANAGER_UI_RELAUNCH_CHROME_PROMO_CARD_TITLE_LINUX
+ #endif
+ );
+@@ -47,7 +47,7 @@ std::u16string RelaunchChromePromo::GetD
+ return l10n_util::GetStringUTF16(
+ #if BUILDFLAG(IS_MAC)
+ IDS_PASSWORD_MANAGER_UI_RELAUNCH_CHROME_PROMO_CARD_DESCRIPTION
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ IDS_PASSWORD_MANAGER_UI_RELAUNCH_CHROME_PROMO_CARD_DESCRIPTION_LINUX
+ #endif
+ );
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_searchbox_searchbox__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_searchbox_searchbox__handler.cc
new file mode 100644
index 0000000000..fa70a0eebb
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_searchbox_searchbox__handler.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/searchbox/searchbox_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/searchbox/searchbox_handler.cc
+@@ -108,7 +108,7 @@ const char* kMacShareIconResourceName =
+ #elif BUILDFLAG(IS_WIN)
+ const char* kWinShareIconResourceName =
+ "//resources/cr_components/searchbox/icons/win_share.svg";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char* kLinuxShareIconResourceName =
+ "//resources/cr_components/searchbox/icons/share.svg";
+ #else
+@@ -168,7 +168,7 @@ static void DefineChromeRefreshRealboxIc
+ #elif BUILDFLAG(IS_WIN)
+ kWinShareIconResourceName =
+ "//resources/cr_components/searchbox/icons/win_share_cr23.svg";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ kLinuxShareIconResourceName =
+ "//resources/cr_components/searchbox/icons/share_cr23.svg";
+ #else
+@@ -612,7 +612,7 @@ std::string SearchboxHandler::ActionVect
+ icon.name == omnibox::kShareWinChromeRefreshIcon.name) {
+ return kWinShareIconResourceName;
+ }
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (icon.name == omnibox::kShareIcon.name ||
+ icon.name == omnibox::kShareLinuxChromeRefreshIcon.name) {
+ return kLinuxShareIconResourceName;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_settings_appearance__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_settings_appearance__handler.cc
new file mode 100644
index 0000000000..ff04628966
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_settings_appearance__handler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/settings/appearance_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/settings/appearance_handler.cc
+@@ -34,7 +34,7 @@ void AppearanceHandler::RegisterMessages
+ "useDefaultTheme",
+ base::BindRepeating(&AppearanceHandler::HandleUseTheme,
+ base::Unretained(this), ui::SystemTheme::kDefault));
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ web_ui()->RegisterMessageCallback(
+ "useGtkTheme",
+ base::BindRepeating(&AppearanceHandler::HandleUseTheme,
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc
new file mode 100644
index 0000000000..5a0c68b089
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+@@ -143,7 +143,7 @@
+ #include "chrome/browser/ui/chrome_pages.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/display/screen.h"
+ #endif
+
+@@ -162,7 +162,7 @@
+ #include "chrome/browser/ui/webui/certificate_manager_localized_strings_provider.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui_factory.h"
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif
+@@ -283,7 +283,7 @@ void AddA11yStrings(content::WebUIDataSo
+ {"focusHighlightLabel",
+ IDS_SETTINGS_ACCESSIBILITY_FOCUS_HIGHLIGHT_DESCRIPTION},
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ {"overscrollHistoryNavigationTitle",
+ IDS_SETTINGS_OVERSCROLL_HISTORY_NAVIGATION_TITLE},
+ {"overscrollHistoryNavigationSubtitle",
+@@ -556,7 +556,7 @@ void AddAppearanceStrings(content::WebUI
+ {"uiFeatureAlignLeft", IDS_SETTINGS_UI_FEATURE_ALIGN_LEFT},
+ {"uiFeatureAlignRight", IDS_SETTINGS_UI_FEATURE_ALIGN_RIGHT},
+ {"resetToDefault", IDS_SETTINGS_RESET_TO_DEFAULT},
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"gtkTheme", IDS_SETTINGS_GTK_THEME},
+ {"useGtkTheme", IDS_SETTINGS_USE_GTK_THEME},
+ {"qtTheme", IDS_SETTINGS_QT_THEME},
+@@ -564,7 +564,7 @@ void AddAppearanceStrings(content::WebUI
+ {"classicTheme", IDS_SETTINGS_CLASSIC_THEME},
+ {"useClassicTheme", IDS_SETTINGS_USE_CLASSIC_THEME},
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"showWindowDecorations", IDS_SHOW_WINDOW_DECORATIONS},
+ #endif
+ #if BUILDFLAG(IS_MAC)
+@@ -590,7 +590,7 @@ void AddAppearanceStrings(content::WebUI
+ html_source->AddBoolean("toolbarPinningEnabled",
+ features::IsToolbarPinningEnabled());
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool show_custom_chrome_frame = ui::OzonePlatform::GetInstance()
+ ->GetPlatformRuntimeProperties()
+ .supports_server_side_window_decorations;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_webui_signin_profile__picker__handler.cc b/chromium-next/patches/patch-chrome_browser_ui_webui_signin_profile__picker__handler.cc
new file mode 100644
index 0000000000..6c6d60c7e1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_webui_signin_profile__picker__handler.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/webui/signin/profile_picker_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/webui/signin/profile_picker_handler.cc
+@@ -195,7 +195,7 @@ base::Value::Dict CreateProfileEntry(con
+
+ if (AccountInfo::IsManaged(entry->GetHostedDomain())) {
+ profile_entry.Set("avatarBadge", "cr:domain");
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ } else if (base::FeatureList::IsEnabled(
+ supervised_user::kShowKiteForSupervisedUsers) &&
+ entry->IsSupervised()) {
+@@ -1074,7 +1074,7 @@ void ProfilePickerHandler::BeginFirstWeb
+ }
+
+ void ProfilePickerHandler::MaybeUpdateGuestMode() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (!base::FeatureList::IsEnabled(
+ supervised_user::kHideGuestModeForSupervisedUsers)) {
+ return;
diff --git a/chromium-next/patches/patch-chrome_browser_ui_window__sizer_window__sizer.cc b/chromium-next/patches/patch-chrome_browser_ui_window__sizer_window__sizer.cc
new file mode 100644
index 0000000000..697ef15c8a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_ui_window__sizer_window__sizer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/ui/window_sizer/window_sizer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/ui/window_sizer/window_sizer.cc
+@@ -214,7 +214,7 @@ void WindowSizer::GetBrowserWindowBounds
+ browser, window_bounds, show_state);
+ }
+
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Linux has its own implementation, see WindowSizerLinux.
+ // static
+ void WindowSizer::GetBrowserWindowBoundsAndShowState(
diff --git a/chromium-next/patches/patch-chrome_browser_visited__url__ranking_visited__url__ranking__service__factory.cc b/chromium-next/patches/patch-chrome_browser_visited__url__ranking_visited__url__ranking__service__factory.cc
new file mode 100644
index 0000000000..9a0a046ad4
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_visited__url__ranking_visited__url__ranking__service__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/visited_url_ranking/visited_url_ranking_service_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/visited_url_ranking/visited_url_ranking_service_factory.cc
+@@ -44,7 +44,7 @@
+ #include "components/visited_url_ranking/public/visited_url_ranking_service.h"
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/visited_url_ranking/desktop_tab_model_url_visit_data_fetcher.h"
+ #elif BUILDFLAG(IS_ANDROID)
+ #include "chrome/browser/visited_url_ranking/android_tab_model_url_visit_data_fetcher.h"
+@@ -118,7 +118,7 @@ VisitedURLRankingServiceFactory::BuildSe
+
+ std::map<Fetcher, std::unique_ptr<URLVisitDataFetcher>> data_fetchers;
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ data_fetchers.emplace(
+ Fetcher::kTabModel,
+ std::make_unique<visited_url_ranking::DesktopTabModelURLVisitDataFetcher>(
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_commands_launch__web__app__command.cc b/chromium-next/patches/patch-chrome_browser_web__applications_commands_launch__web__app__command.cc
new file mode 100644
index 0000000000..279371fd25
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_commands_launch__web__app__command.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/commands/launch_web_app_command.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/commands/launch_web_app_command.cc
+@@ -98,7 +98,7 @@ void LaunchWebAppCommand::StartWithLock(
+ // OsIntegrationTestOverride can use the xdg install command to detect
+ // install.
+ SynchronizeOsOptions options;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ options.add_shortcut_to_desktop = true;
+ #endif
+ lock_->os_integration_manager().Synchronize(
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_commands_set__user__display__mode__command.cc b/chromium-next/patches/patch-chrome_browser_web__applications_commands_set__user__display__mode__command.cc
new file mode 100644
index 0000000000..aaf343b3bb
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_commands_set__user__display__mode__command.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/commands/set_user_display_mode_command.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/commands/set_user_display_mode_command.cc
+@@ -57,7 +57,7 @@ void SetUserDisplayModeCommand::StartWit
+ // OsIntegrationTestOverride can use the xdg install command to detect
+ // install.
+ SynchronizeOsOptions options;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ options.add_shortcut_to_desktop = true;
+ #endif
+ app_lock_->os_integration_manager().Synchronize(
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_extension__status__utils.h b/chromium-next/patches/patch-chrome_browser_web__applications_extension__status__utils.h
new file mode 100644
index 0000000000..3e5a8ff6ba
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_extension__status__utils.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/extension_status_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/extension_status_utils.h
+@@ -50,7 +50,7 @@ bool IsExtensionDefaultInstalled(content
+ bool IsExternalExtensionUninstalled(content::BrowserContext* context,
+ const std::string& extension_id);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If this method returns true, then |extension_id| will not be launchable.
+ //
+ // The eventual goal is that this method should return true for all hosted apps,
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc b/chromium-next/patches/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc
new file mode 100644
index 0000000000..93556efef6
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/extensions/extension_status_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/extensions/extension_status_utils.cc
+@@ -25,7 +25,7 @@ namespace {
+
+ const char* g_preinstalled_app_for_testing = nullptr;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(b/268221237): Remove this allow-list.
+ const char kDefaultAllowedExtensionIds[] =
+ "alhngdkjgnedakdlnamimgfihgkmenbh,"
+@@ -107,7 +107,7 @@ bool IsExternalExtensionUninstalled(cont
+ return prefs && prefs->IsExternalExtensionUninstalled(extension_id);
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool IsExtensionUnsupportedDeprecatedApp(content::BrowserContext* context,
+ const std::string& extension_id) {
+ if (testing::g_enable_chrome_apps_for_testing) {
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__manager.cc b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__manager.cc
new file mode 100644
index 0000000000..c84e75bcbf
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/os_integration_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/os_integration_manager.cc
+@@ -650,7 +650,7 @@ std::unique_ptr<ShortcutInfo> OsIntegrat
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const std::vector<WebAppShortcutsMenuItemInfo>& shortcuts_menu_item_infos =
+ app->shortcuts_menu_item_infos();
+ DCHECK_LE(shortcuts_menu_item_infos.size(), kMaxApplicationDockMenuItems);
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h
new file mode 100644
index 0000000000..0df007c8b7
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_os__integration__test__override.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/os_integration_test_override.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/os_integration_test_override.h
+@@ -99,7 +99,7 @@ class OsIntegrationTestOverride
+ virtual base::FilePath chrome_apps_folder() = 0;
+ virtual void EnableOrDisablePathOnLogin(const base::FilePath& file_path,
+ bool enable_on_login) = 0;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ virtual base::Environment* environment() = 0;
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc
new file mode 100644
index 0000000000..b5c8dc996f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_run__on__os__login__sub__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/run_on_os_login_sub_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/run_on_os_login_sub_manager.cc
+@@ -54,7 +54,7 @@ proto::RunOnOsLoginMode ConvertWebAppRun
+ // different from other platforms, see web_app_run_on_os_login_manager.h for
+ // more info.
+ bool DoesRunOnOsLoginRequireExecution() {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(features::kDesktopPWAsRunOnOsLogin);
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_shortcut__sub__manager.cc b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_shortcut__sub__manager.cc
new file mode 100644
index 0000000000..eee53a2941
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_shortcut__sub__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/shortcut_sub_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/shortcut_sub_manager.cc
+@@ -191,7 +191,7 @@ void ShortcutSubManager::Execute(
+ return;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Protocol handler update detection. Shortcuts need to be updated in this
+ // case on Linux & Mac because the shortcut itself includes the protocol
+ // handling metadata.
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h
new file mode 100644
index 0000000000..c8970b21dc
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/web_app_file_handler_registration.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/web_app_file_handler_registration.h
+@@ -43,7 +43,7 @@ void UnregisterFileHandlersWithOs(const
+ const base::FilePath& profile_path,
+ ResultCallback callback);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Exposed for testing purposes. Register the set of
+ // MIME-type-to-file-extensions mappings corresponding to |file_handlers|. File
+ // I/O and callouts to the Linux shell are performed asynchronously.
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc
new file mode 100644
index 0000000000..e56da8d49b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/web_app_shortcut.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/web_app_shortcut.cc
+@@ -71,7 +71,7 @@ namespace {
+
+ #if BUILDFLAG(IS_MAC)
+ const int kDesiredIconSizesForShortcut[] = {16, 32, 128, 256, 512};
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Linux supports icons of any size. FreeDesktop Icon Theme Specification states
+ // that "Minimally you should install a 48x48 icon in the hicolor theme."
+ const int kDesiredIconSizesForShortcut[] = {16, 32, 48, 128, 256, 512};
+@@ -253,7 +253,7 @@ std::unique_ptr<ShortcutInfo> BuildShort
+
+ // TODO(crbug.com/40257107): Implement tests on Linux for using shortcuts_menu
+ // actions.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const std::vector<WebAppShortcutsMenuItemInfo>& shortcuts_menu_item_infos =
+ CreateShortcutsMenuItemInfos(state.shortcut_menus());
+ DCHECK_LE(shortcuts_menu_item_infos.size(), kMaxApplicationDockMenuItems);
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h
new file mode 100644
index 0000000000..1e2da257b9
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/os_integration/web_app_shortcut.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/os_integration/web_app_shortcut.h
+@@ -21,7 +21,7 @@
+ #include "ui/gfx/image/image_family.h"
+ #include "url/gurl.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/web_applications/os_integration/web_app_shortcut_linux.h"
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -74,7 +74,7 @@ struct ShortcutInfo {
+ // the installed PWA experience and thus the icons are not designed to be
+ // displayed on an OS dock.
+ bool is_diy_app = false;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::set<DesktopActionInfo> actions;
+ #endif // BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_policy_web__app__policy__manager.cc b/chromium-next/patches/patch-chrome_browser_web__applications_policy_web__app__policy__manager.cc
new file mode 100644
index 0000000000..00447d752e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_policy_web__app__policy__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/policy/web_app_policy_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/policy/web_app_policy_manager.cc
+@@ -106,7 +106,7 @@ namespace web_app {
+
+ BASE_FEATURE(kDesktopPWAsForceUnregisterOSIntegration,
+ "DesktopPWAsForceUnregisterOSIntegration",
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.cc b/chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.cc
new file mode 100644
index 0000000000..86dee52381
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.cc
@@ -0,0 +1,125 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/test/os_integration_test_override_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/test/os_integration_test_override_impl.cc
+@@ -45,7 +45,7 @@
+ #include "third_party/skia/include/core/SkBitmap.h"
+ #include "third_party/skia/include/core/SkColor.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/nix/xdg_util.h"
+ #endif
+
+@@ -130,7 +130,7 @@ std::vector<std::wstring> GetFileExtensi
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Performs a blocking read of app icons from the disk.
+ SkColor IconManagerReadIconTopLeftColorForSize(WebAppIconManager& icon_manager,
+ const webapps::AppId& app_id,
+@@ -265,7 +265,7 @@ bool OsIntegrationTestOverrideImpl::Simu
+ GetShortcutPath(profile, chrome_apps_folder(), app_id, app_name);
+ CHECK(base::PathExists(app_folder_shortcut_path));
+ return base::DeletePathRecursively(app_folder_shortcut_path);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FilePath desktop_shortcut_path =
+ GetShortcutPath(profile, desktop(), app_id, app_name);
+ LOG(INFO) << desktop_shortcut_path;
+@@ -312,7 +312,7 @@ bool OsIntegrationTestOverrideImpl::Dele
+ }
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool OsIntegrationTestOverrideImpl::DeleteDesktopDirOnLinux() {
+ if (desktop_.IsValid()) {
+ return desktop_.Delete();
+@@ -326,7 +326,7 @@ bool OsIntegrationTestOverrideImpl::IsRu
+ Profile* profile,
+ const webapps::AppId& app_id,
+ const std::string& app_name) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string shortcut_filename =
+ "chrome-" + app_id + "-" + profile->GetBaseName().value() + ".desktop";
+ return base::PathExists(startup().Append(shortcut_filename));
+@@ -381,7 +381,7 @@ bool OsIntegrationTestOverrideImpl::IsFi
+ is_file_handled =
+ shell_integration::CanApplicationHandleURL(app_path, test_file_url);
+ base::DeleteFile(test_file_path);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FilePath user_applications_dir = applications();
+ bool database_update_called = false;
+ for (const LinuxFileRegistration& command : linux_file_registration_) {
+@@ -424,7 +424,7 @@ OsIntegrationTestOverrideImpl::GetShortc
+ return std::nullopt;
+ }
+ return GetIconTopLeftColorFromShortcutFile(shortcut_path);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ WebAppProvider* provider = WebAppProvider::GetForLocalAppsUnchecked(profile);
+ if (!provider) {
+ return std::nullopt;
+@@ -473,7 +473,7 @@ base::FilePath OsIntegrationTestOverride
+ app_installed_profiles.end()) {
+ return shortcut_path;
+ }
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string shortcut_filename =
+ "chrome-" + app_id + "-" + profile->GetBaseName().value() + ".desktop";
+ base::FilePath shortcut_path = shortcut_dir.Append(shortcut_filename);
+@@ -498,7 +498,7 @@ bool OsIntegrationTestOverrideImpl::IsSh
+ base::FilePath app_shortcut_path =
+ GetShortcutPath(profile, chrome_apps_folder(), app_id, app_name);
+ return base::PathExists(app_shortcut_path);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FilePath desktop_shortcut_path =
+ GetShortcutPath(profile, desktop(), app_id, app_name);
+ return base::PathExists(desktop_shortcut_path);
+@@ -690,7 +690,7 @@ void OsIntegrationTestOverrideImpl::Enab
+ }
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FilePath OsIntegrationTestOverrideImpl::desktop() {
+ return desktop_.GetPath();
+ }
+@@ -741,7 +741,7 @@ OsIntegrationTestOverrideImpl::OsIntegra
+ success = chrome_apps_folder_.CreateUniqueTempDirUnderPath(
+ outer_temp_dir_.GetPath());
+ CHECK(success);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ success = desktop_.CreateUniqueTempDirUnderPath(outer_temp_dir_.GetPath());
+ CHECK(success);
+ success = startup_.CreateUniqueTempDirUnderPath(outer_temp_dir_.GetPath());
+@@ -754,7 +754,7 @@ OsIntegrationTestOverrideImpl::OsIntegra
+ CHECK(success);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto callback = base::BindRepeating([](base::FilePath filename_in,
+ std::string xdg_command,
+ std::string file_contents) {
+@@ -826,7 +826,7 @@ OsIntegrationTestOverrideImpl::~OsIntegr
+ EXPECT_TRUE(!startup_.IsValid() || startup_.Delete());
+ #elif BUILDFLAG(IS_MAC)
+ EXPECT_TRUE(!chrome_apps_folder_.IsValid() || DeleteChromeAppsDir());
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ EXPECT_TRUE(!desktop_.IsValid() || desktop_.Delete());
+ EXPECT_TRUE(!startup_.IsValid() || startup_.Delete());
+ EXPECT_TRUE(!xdg_data_home_dir_.IsValid() || xdg_data_home_dir_.Delete());
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.h b/chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.h
new file mode 100644
index 0000000000..e95e2e6582
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_test_os__integration__test__override__impl.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/test/os_integration_test_override_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/test/os_integration_test_override_impl.h
+@@ -40,7 +40,7 @@ class ShellLinkItem;
+
+ namespace web_app {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ struct LinuxFileRegistration {
+ base::FilePath file_name;
+ std::string xdg_command;
+@@ -122,7 +122,7 @@ class OsIntegrationTestOverrideImpl : pu
+ bool DeleteApplicationMenuDirOnWin();
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool DeleteDesktopDirOnLinux();
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -241,7 +241,7 @@ class OsIntegrationTestOverrideImpl : pu
+ base::FilePath chrome_apps_folder() override;
+ void EnableOrDisablePathOnLogin(const base::FilePath& file_path,
+ bool enable_on_login) override;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FilePath desktop();
+ base::FilePath startup();
+ base::FilePath applications();
+@@ -321,7 +321,7 @@ class OsIntegrationTestOverrideImpl : pu
+ base::ScopedTempDir chrome_apps_folder_;
+ std::map<base::FilePath, bool> startup_enabled_;
+
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ScopedTempDir desktop_;
+ base::ScopedTempDir startup_;
+ base::ScopedTempDir xdg_data_home_dir_;
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_web__app__helpers.cc b/chromium-next/patches/patch-chrome_browser_web__applications_web__app__helpers.cc
new file mode 100644
index 0000000000..5e72b3bf50
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_web__app__helpers.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/web_app_helpers.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/web_app_helpers.cc
+@@ -145,7 +145,7 @@ bool IsValidWebAppUrl(const GURL& app_ur
+ return false;
+
+ bool allow_extension_apps = true;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Stop allowing apps to be extension urls when the shortcuts are separated -
+ // they can be extension urls instead.
+ allow_extension_apps =
diff --git a/chromium-next/patches/patch-chrome_browser_web__applications_web__app__install__info.h b/chromium-next/patches/patch-chrome_browser_web__applications_web__app__install__info.h
new file mode 100644
index 0000000000..74dd235d0e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_web__applications_web__app__install__info.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/web_applications/web_app_install_info.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/web_applications/web_app_install_info.h
+@@ -39,7 +39,7 @@
+ #include "url/gurl.h"
+
+ static_assert(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+- BUILDFLAG(IS_CHROMEOS));
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD));
+
+ namespace web_app {
+
diff --git a/chromium-next/patches/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc b/chromium-next/patches/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc
new file mode 100644
index 0000000000..f55df9b8a5
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/webauthn/chrome_authenticator_request_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
+@@ -1141,7 +1141,7 @@ void ChromeAuthenticatorRequestDelegate:
+ g_observer->ConfiguringCable(request_type);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // No caBLEv1 on Linux. It tends to crash bluez.
+ if (base::Contains(pairings_from_extension,
+ device::CableDiscoveryData::Version::V1,
diff --git a/chromium-next/patches/patch-chrome_browser_webauthn_enclave__manager.cc b/chromium-next/patches/patch-chrome_browser_webauthn_enclave__manager.cc
new file mode 100644
index 0000000000..b7d8408c71
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_webauthn_enclave__manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/webauthn/enclave_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/webauthn/enclave_manager.cc
+@@ -693,7 +693,7 @@ base::flat_set<std::string> GetGaiaIDs(
+
+ std::string UserVerifyingLabelToString(crypto::UserVerifyingKeyLabel label) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ return label;
+ #else
+ return std::string("placeholder");
+@@ -703,7 +703,7 @@ std::string UserVerifyingLabelToString(c
+ std::optional<crypto::UserVerifyingKeyLabel> UserVerifyingKeyLabelFromString(
+ std::string saved_label) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ return saved_label;
+ #else
+ return std::nullopt;
diff --git a/chromium-next/patches/patch-chrome_browser_webauthn_gpm__user__verification__policy.cc b/chromium-next/patches/patch-chrome_browser_webauthn_gpm__user__verification__policy.cc
new file mode 100644
index 0000000000..355a973299
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_webauthn_gpm__user__verification__policy.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/webauthn/gpm_user_verification_policy.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/webauthn/gpm_user_verification_policy.cc
+@@ -17,7 +17,7 @@ bool GpmWillDoUserVerification(device::U
+ return platform_has_biometrics;
+ #elif BUILDFLAG(IS_MAC)
+ return platform_has_biometrics;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ // This default is for unit tests.
diff --git a/chromium-next/patches/patch-chrome_browser_webauthn_unexportable__key__utils.cc b/chromium-next/patches/patch-chrome_browser_webauthn_unexportable__key__utils.cc
new file mode 100644
index 0000000000..ee649e6cf1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_browser_webauthn_unexportable__key__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/browser/webauthn/unexportable_key_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/browser/webauthn/unexportable_key_utils.cc
+@@ -33,7 +33,7 @@ GetWebAuthnUnexportableKeyProvider() {
+ // If there is a scoped UnexportableKeyProvider configured, we always use
+ // that so that tests can still override the key provider.
+ const bool use_software_provider =
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ !crypto::internal::HasScopedUnexportableKeyProvider();
+ #else
+ false;
diff --git a/chromium-next/patches/patch-chrome_common_channel__info.h b/chromium-next/patches/patch-chrome_common_channel__info.h
new file mode 100644
index 0000000000..233d059e99
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_channel__info.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/channel_info.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/channel_info.h
+@@ -12,7 +12,7 @@
+ #include "build/build_config.h"
+ #include "build/chromeos_buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ namespace base {
+ class Environment;
+ }
+@@ -100,7 +100,7 @@ void ClearChannelIdForTesting();
+ std::string GetChannelSuffixForDataDir();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string GetChannelSuffixForExtraFlagsEnvVarName();
+
+ // Returns the channel-specific filename of the desktop shortcut used to launch
diff --git a/chromium-next/patches/patch-chrome_common_channel__info__posix.cc b/chromium-next/patches/patch-chrome_common_channel__info__posix.cc
new file mode 100644
index 0000000000..5daed4312f
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_channel__info__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/channel_info_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/channel_info_posix.cc
+@@ -95,7 +95,7 @@ std::string GetChannelSuffixForDataDir()
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string GetChannelSuffixForExtraFlagsEnvVarName() {
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ const auto channel_state = GetChannelImpl();
+@@ -123,7 +123,7 @@ std::string GetChannelSuffixForExtraFlag
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ std::string GetDesktopName(base::Environment* env) {
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ // Google Chrome packaged as a snap is a special case: the application name
diff --git a/chromium-next/patches/patch-chrome_common_chrome__features.cc b/chromium-next/patches/patch-chrome_common_chrome__features.cc
new file mode 100644
index 0000000000..baa973b6b0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__features.cc
@@ -0,0 +1,71 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_features.cc
+@@ -83,7 +83,7 @@ BASE_FEATURE(kUseAdHocSigningForWebAppSh
+ #endif // BUILDFLAG(IS_MAC)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Enables or disables the Autofill survey triggered by opening a prompt to
+ // save address info.
+ BASE_FEATURE(kAutofillAddressSurvey,
+@@ -101,7 +101,7 @@ BASE_FEATURE(kAutofillPasswordSurvey,
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Enables the Restart background mode optimization. When all Chrome UI is
+ // closed and it goes in the background, allows to restart the browser to
+ // discard memory.
+@@ -240,7 +240,7 @@ BASE_FEATURE(kDesktopPWAsElidedExtension
+ BASE_FEATURE(kDesktopPWAsRunOnOsLogin,
+ "DesktopPWAsRunOnOsLogin",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -266,7 +266,7 @@ BASE_FEATURE(kDesktopPWAsTabStripSetting
+ "DesktopPWAsTabStripSettings",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Controls whether Chrome Apps are supported. See https://crbug.com/1221251.
+ // If the feature is disabled, Chrome Apps continue to work. If enabled, Chrome
+ // Apps will not launch and will be marked in the UI as deprecated.
+@@ -332,7 +332,7 @@ BASE_FEATURE(kForcedAppRelaunchOnPlaceho
+ // of languages.
+ BASE_FEATURE(kGeoLanguage, "GeoLanguage", base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Controls whether the Glic feature is enabled.
+ BASE_FEATURE(kGlic, "Glic", base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif
+@@ -823,7 +823,7 @@ BASE_FEATURE(kKAnonymityServiceStorage,
+ "KAnonymityServiceStorage",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kLinuxLowMemoryMonitor,
+ "LinuxLowMemoryMonitor",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -836,7 +836,7 @@ constexpr base::FeatureParam<int> kLinux
+ &kLinuxLowMemoryMonitor, "critical_level", 255};
+ #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kListWebAppsSwitch,
+ "ListWebAppsSwitch",
+ base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-chrome_common_chrome__features.h b/chromium-next/patches/patch-chrome_common_chrome__features.h
new file mode 100644
index 0000000000..b3be03eee1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__features.h
@@ -0,0 +1,60 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_features.h
+@@ -60,13 +60,13 @@ BASE_DECLARE_FEATURE(kUseAdHocSigningFor
+ #endif // BUILDFLAG(IS_MAC)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAutofillAddressSurvey);
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAutofillCardSurvey);
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kAutofillPasswordSurvey);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(CHROME_FEATURES)
+ BASE_DECLARE_FEATURE(kBackgroundModeAllowRestart);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -163,7 +163,7 @@ BASE_DECLARE_FEATURE(kDesktopPWAsPrevent
+ COMPONENT_EXPORT(CHROME_FEATURES)
+ BASE_DECLARE_FEATURE(kDesktopPWAsTabStripSettings);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kChromeAppsDeprecation);
+ COMPONENT_EXPORT(CHROME_FEATURES)
+ BASE_DECLARE_FEATURE(kShortcutsNotApps);
+@@ -218,7 +218,7 @@ BASE_DECLARE_FEATURE(kForcedAppRelaunchO
+
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kGeoLanguage);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kGlic);
+ #endif
+
+@@ -493,7 +493,7 @@ BASE_DECLARE_FEATURE(kKAnonymityServiceO
+ COMPONENT_EXPORT(CHROME_FEATURES)
+ BASE_DECLARE_FEATURE(kKAnonymityServiceStorage);
+
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kLinuxLowMemoryMonitor);
+ COMPONENT_EXPORT(CHROME_FEATURES)
+ extern const base::FeatureParam<int> kLinuxLowMemoryMonitorModerateLevel;
+@@ -501,7 +501,7 @@ COMPONENT_EXPORT(CHROME_FEATURES)
+ extern const base::FeatureParam<int> kLinuxLowMemoryMonitorCriticalLevel;
+ #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kListWebAppsSwitch);
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_common_chrome__paths.cc b/chromium-next/patches/patch-chrome_common_chrome__paths.cc
new file mode 100644
index 0000000000..f857e1fa0a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__paths.cc
@@ -0,0 +1,90 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_paths.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_paths.cc
+@@ -30,7 +30,7 @@
+ #include "base/apple/foundation_util.h"
+ #endif
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
+ #include "components/policy/core/common/policy_paths.h"
+ #endif
+
+@@ -52,14 +52,14 @@
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The path to the external extension <id>.json files.
+ // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/
+ const base::FilePath::CharType kFilepathSinglePrefExtensions[] =
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+- FILE_PATH_LITERAL("/usr/share/google-chrome/extensions");
++ FILE_PATH_LITERAL("@PREFIX@/share/chromium/extensions");
+ #else
+- FILE_PATH_LITERAL("/usr/share/chromium/extensions");
++ FILE_PATH_LITERAL("@PREFIX@/share/chromium/extensions");
+ #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
+
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -219,7 +219,7 @@ bool PathProvider(int key, base::FilePat
+ }
+ break;
+ case chrome::DIR_DEFAULT_DOWNLOADS_SAFE:
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!GetUserDownloadsDirectorySafe(&cur)) {
+ return false;
+ }
+@@ -525,7 +525,7 @@ bool PathProvider(int key, base::FilePat
+ break;
+ }
+ #endif
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
+ case chrome::DIR_POLICY_FILES: {
+ cur = base::FilePath(policy::kPolicyPath);
+ break;
+@@ -536,7 +536,7 @@ bool PathProvider(int key, base::FilePat
+ #if BUILDFLAG(IS_CHROMEOS_ASH) || \
+ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+ BUILDFLAG(CHROMIUM_BRANDING)) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ case chrome::DIR_USER_EXTERNAL_EXTENSIONS: {
+ if (!base::PathService::Get(chrome::DIR_USER_DATA, &cur)) {
+ return false;
+@@ -545,7 +545,7 @@ bool PathProvider(int key, base::FilePat
+ break;
+ }
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: {
+ cur = base::FilePath(kFilepathSinglePrefExtensions);
+ break;
+@@ -583,7 +583,7 @@ bool PathProvider(int key, base::FilePat
+ break;
+
+ #if BUILDFLAG(ENABLE_EXTENSIONS) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD))
+ case chrome::DIR_NATIVE_MESSAGING:
+ #if BUILDFLAG(IS_MAC)
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+@@ -597,6 +597,9 @@ bool PathProvider(int key, base::FilePat
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ cur = base::FilePath(
+ FILE_PATH_LITERAL("/etc/opt/chrome/native-messaging-hosts"));
++#elif BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
++ cur = base::FilePath(FILE_PATH_LITERAL(
++ "@PREFIX@/etc/chromium/native-messaging-hosts"));
+ #else
+ cur = base::FilePath(
+ FILE_PATH_LITERAL("/etc/chromium/native-messaging-hosts"));
diff --git a/chromium-next/patches/patch-chrome_common_chrome__paths.h b/chromium-next/patches/patch-chrome_common_chrome__paths.h
new file mode 100644
index 0000000000..165c1483c0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__paths.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_paths.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_paths.h
+@@ -62,7 +62,7 @@ enum {
+ #if BUILDFLAG(IS_CHROMEOS_ASH) || \
+ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+ BUILDFLAG(CHROMIUM_BRANDING)) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ DIR_USER_EXTERNAL_EXTENSIONS, // Directory for per-user external extensions
+ // on Chrome Mac and Chromium Linux.
+ // On Chrome OS, this path is used for OEM
+@@ -70,7 +70,7 @@ enum {
+ // create it.
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ DIR_STANDALONE_EXTERNAL_EXTENSIONS, // Directory for 'per-extension'
+ // definition manifest files that
+ // describe extensions which are to be
+@@ -117,7 +117,7 @@ enum {
+
+ #endif
+ #if BUILDFLAG(ENABLE_EXTENSIONS) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD))
+ DIR_NATIVE_MESSAGING, // System directory where native messaging host
+ // manifest files are stored.
+ DIR_USER_NATIVE_MESSAGING, // Directory with Native Messaging Hosts
diff --git a/chromium-next/patches/patch-chrome_common_chrome__paths__internal.h b/chromium-next/patches/patch-chrome_common_chrome__paths__internal.h
new file mode 100644
index 0000000000..a31a12bb7e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__paths__internal.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_paths_internal.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_paths_internal.h
+@@ -43,7 +43,7 @@ void GetUserCacheDirectory(const base::F
+ // Get the path to the user's documents directory.
+ bool GetUserDocumentsDirectory(base::FilePath* result);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Gets the path to a safe default download directory for a user.
+ bool GetUserDownloadsDirectorySafe(base::FilePath* result);
+ #endif
diff --git a/chromium-next/patches/patch-chrome_common_chrome__switches.cc b/chromium-next/patches/patch-chrome_common_chrome__switches.cc
new file mode 100644
index 0000000000..fdcda21c2d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__switches.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_switches.cc
+@@ -892,7 +892,7 @@ const char kAllowNaClSocketAPI[] = "allo
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ const char kEnableNewAppMenuIcon[] = "enable-new-app-menu-icon";
+
+ // Causes the browser to launch directly in guest mode.
+@@ -902,7 +902,7 @@ const char kGuest[] = "guest";
+ const char kForceNtpMobilePromo[] = "force-ntp-mobile-promo";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Writes open and installed web apps for each profile to the specified file
+ // without launching a new browser window or tab. Pass a absolute file path to
+ // specify where to output the information. Can be used together with optional
diff --git a/chromium-next/patches/patch-chrome_common_chrome__switches.h b/chromium-next/patches/patch-chrome_common_chrome__switches.h
new file mode 100644
index 0000000000..256e677669
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_chrome__switches.h
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/chrome_switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/chrome_switches.h
+@@ -277,13 +277,13 @@ extern const char kAllowNaClSocketAPI[];
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ extern const char kEnableNewAppMenuIcon[];
+ extern const char kGuest[];
+ extern const char kForceNtpMobilePromo[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ extern const char kListApps[];
+ extern const char kProfileBaseName[];
+ extern const char kProfileManagementAttributes[];
diff --git a/chromium-next/patches/patch-chrome_common_crash__keys.cc b/chromium-next/patches/patch-chrome_common_crash__keys.cc
new file mode 100644
index 0000000000..b88120193a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_crash__keys.cc
@@ -0,0 +1,34 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/crash_keys.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/crash_keys.cc
+@@ -56,7 +56,9 @@ class CrashKeyWithName {
+ ~CrashKeyWithName() = delete;
+
+ std::string_view Name() const { return name_; }
++#if BUILDFLAG(USE_CRASHPAD_ANNOTATION)
+ std::string_view Value() const { return crash_key_.value(); }
++#endif
+ void Clear() { crash_key_.Clear(); }
+ void Set(std::string_view value) { crash_key_.Set(value); }
+
+@@ -201,6 +203,7 @@ void AllocateCrashKeyInBrowserAndChildre
+ GetCommandLineStringAnnotations().emplace_back(std::string(key)).Set(value);
+ }
+
++#if BUILDFLAG(USE_CRASHPAD_ANNOTATION)
+ void AppendStringAnnotationsCommandLineSwitch(base::CommandLine* command_line) {
+ std::string string_annotations;
+ for (const auto& crash_key : GetCommandLineStringAnnotations()) {
+@@ -212,6 +215,7 @@ void AppendStringAnnotationsCommandLineS
+ }
+ command_line->AppendSwitchASCII(kStringAnnotationsSwitch, string_annotations);
+ }
++#endif
+
+ void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
+ SetStringAnnotations(command_line);
diff --git a/chromium-next/patches/patch-chrome_common_extensions_permissions_chrome__permission__message__rules.cc b/chromium-next/patches/patch-chrome_common_extensions_permissions_chrome__permission__message__rules.cc
new file mode 100644
index 0000000000..be371eac39
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_extensions_permissions_chrome__permission__message__rules.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/extensions/permissions/chrome_permission_message_rules.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/extensions/permissions/chrome_permission_message_rules.cc
+@@ -285,7 +285,7 @@ int GetEnterpriseReportingPrivatePermiss
+ }
+ #if BUILDFLAG(IS_WIN)
+ return IDS_EXTENSION_PROMPT_WARNING_ENTERPRISE_REPORTING_PRIVATE_ENABLED_WIN;
+-#elif BUILDFLAG(IS_LINUX) or BUILDFLAG(IS_MAC)
++#elif BUILDFLAG(IS_LINUX) or BUILDFLAG(IS_MAC) or BUILDFLAG(IS_BSD)
+ return IDS_EXTENSION_PROMPT_WARNING_ENTERPRISE_REPORTING_PRIVATE_ENABLED_LINUX_AND_MACOS;
+ #else
+ return IDS_EXTENSION_PROMPT_WARNING_ENTERPRISE_REPORTING_PRIVATE;
diff --git a/chromium-next/patches/patch-chrome_common_media_cdm__host__file__path.cc b/chromium-next/patches/patch-chrome_common_media_cdm__host__file__path.cc
new file mode 100644
index 0000000000..5d3bcafd37
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_media_cdm__host__file__path.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/media/cdm_host_file_path.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/media/cdm_host_file_path.cc
+@@ -90,7 +90,7 @@ void AddCdmHostFilePaths(
+ cdm_host_file_paths->emplace_back(chrome_framework_path,
+ chrome_framework_sig_path);
+
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ base::FilePath chrome_exe_dir;
+ if (!base::PathService::Get(base::DIR_EXE, &chrome_exe_dir)) {
diff --git a/chromium-next/patches/patch-chrome_common_media_cdm__registration.cc b/chromium-next/patches/patch-chrome_common_media_cdm__registration.cc
new file mode 100644
index 0000000000..a436ce0f82
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_media_cdm__registration.cc
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/media/cdm_registration.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/media/cdm_registration.cc
+@@ -33,7 +33,7 @@
+ #if BUILDFLAG(ENABLE_WIDEVINE)
+ #include "components/cdm/common/cdm_manifest.h"
+ #include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/native_library.h"
+ #include "chrome/common/chrome_paths.h"
+ #include "chrome/common/media/component_widevine_cdm_hint_file_linux.h"
+@@ -86,7 +86,7 @@ void ReportLacrosUMA(LacrosBundledWidevi
+
+ #if (BUILDFLAG(BUNDLE_WIDEVINE_CDM) || \
+ BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ // Create a CdmInfo for a Widevine CDM, using |version|, |cdm_library_path|, and
+ // |capability|.
+ std::unique_ptr<content::CdmInfo> CreateWidevineCdmInfo(
+@@ -131,7 +131,7 @@ std::unique_ptr<content::CdmInfo> Create
+ // BUILDFLAG(IS_CHROMEOS))
+
+ #if BUILDFLAG(BUNDLE_WIDEVINE_CDM) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ // On Linux/ChromeOS we have to preload the CDM since it uses the zygote
+ // sandbox. On Windows and Mac, CDM registration is handled by Component
+ // Update (as the CDM can be loaded only when needed).
+@@ -185,7 +185,7 @@ std::unique_ptr<content::CdmInfo> GetAsh
+ #endif // BUILDFLAG(IS_CHROMEOS_LACROS)
+
+ #if (BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH))) || \
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD))) || \
+ BUILDFLAG(IS_CHROMEOS_LACROS)
+ // This code checks to see if Component Updater picked a version of the Widevine
+ // CDM to be used last time it ran. (Component Updater may choose the bundled
+@@ -232,7 +232,7 @@ void AddSoftwareSecureWidevine(std::vect
+ /*supports_sub_key_systems=*/false, kWidevineCdmDisplayName,
+ kWidevineCdmType, base::Version(), base::FilePath());
+
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
+ base::Version glibc_version(gnu_get_libc_version());
+ DCHECK(glibc_version.IsValid());
+@@ -493,7 +493,7 @@ void RegisterCdmInfo(std::vector<content
+ }
+
+ #if BUILDFLAG(ENABLE_WIDEVINE) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD))
+ std::vector<content::CdmInfo> GetSoftwareSecureWidevine() {
+ std::vector<content::CdmInfo> cdms;
+ AddSoftwareSecureWidevine(&cdms);
diff --git a/chromium-next/patches/patch-chrome_common_media_cdm__registration.h b/chromium-next/patches/patch-chrome_common_media_cdm__registration.h
new file mode 100644
index 0000000000..42169b52e2
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_media_cdm__registration.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/media/cdm_registration.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/media/cdm_registration.h
+@@ -16,7 +16,7 @@
+ void RegisterCdmInfo(std::vector<content::CdmInfo>* cdms);
+
+ #if BUILDFLAG(ENABLE_WIDEVINE) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD))
+ // Returns the software secure Widevine CDM, if one exists.
+ std::vector<content::CdmInfo> GetSoftwareSecureWidevine();
+ #endif
diff --git a/chromium-next/patches/patch-chrome_common_media_component__widevine__cdm__hint__file__linux.h b/chromium-next/patches/patch-chrome_common_media_component__widevine__cdm__hint__file__linux.h
new file mode 100644
index 0000000000..572c9a0327
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_media_component__widevine__cdm__hint__file__linux.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/media/component_widevine_cdm_hint_file_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/media/component_widevine_cdm_hint_file_linux.h
+@@ -17,7 +17,7 @@
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ #error "This file only applies to desktop Linux and ChromeOS."
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_common_pref__names.h b/chromium-next/patches/patch-chrome_common_pref__names.h
new file mode 100644
index 0000000000..9e5a3fab7b
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_pref__names.h
@@ -0,0 +1,97 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/pref_names.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/pref_names.h
+@@ -1353,7 +1353,7 @@ inline constexpr char kUseAshProxy[] = "
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Linux specific preference on whether we should match the system theme.
+ inline constexpr char kSystemTheme[] = "extensions.theme.system_theme";
+ #endif
+@@ -1530,7 +1530,7 @@ inline constexpr char kShowUpdatePromoti
+ "browser.show_update_promotion_info_bar";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Boolean that is false if we should show window manager decorations. If
+ // true, we draw a custom chrome frame (thicker title bar and blue border).
+ inline constexpr char kUseCustomChromeFrame[] = "browser.custom_chrome_frame";
+@@ -2146,7 +2146,7 @@ inline constexpr char kDownloadDefaultDi
+ inline constexpr char kDownloadDirUpgraded[] = "download.directory_upgrade";
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ inline constexpr char kOpenPdfDownloadInSystemReader[] =
+ "download.open_pdf_in_system_reader";
+ #endif
+@@ -2599,14 +2599,14 @@ inline constexpr char kMediaStorageIdSal
+ inline constexpr char kMediaCdmOriginData[] = "media.cdm.origin_data";
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // A boolean pref to determine whether or not the network service is running
+ // sandboxed.
+ inline constexpr char kNetworkServiceSandboxEnabled[] =
+ "net.network_service_sandbox";
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Records whether the user has seen an HTTP auth "negotiate" header.
+ inline constexpr char kReceivedHttpAuthNegotiateHeader[] =
+ "net.received_http_auth_negotiate_headers";
+@@ -2684,7 +2684,7 @@ inline constexpr char kAmbientAuthentica
+ inline constexpr char kBasicAuthOverHttpEnabled[] =
+ "auth.basic_over_http_enabled";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Boolean that specifies whether OK-AS-DELEGATE flag from KDC is respected
+ // along with kAuthNegotiateDelegateAllowlist.
+ inline constexpr char kAuthNegotiateDelegateByKdcPolicy[] =
+@@ -3225,7 +3225,7 @@ inline constexpr char kDeviceWeeklySched
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Defines administrator-set availability of Chrome for Testing.
+ inline constexpr char kChromeForTestingAllowed[] = "chrome_for_testing.allowed";
+ #endif
+@@ -3818,7 +3818,7 @@ inline constexpr char kScreenCaptureWith
+ inline constexpr char kSandboxExternalProtocolBlocked[] =
+ "profile.sandbox_external_protocol_blocked";
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Boolean that indicates if system notifications are allowed to be used in
+ // place of Chrome notifications.
+ inline constexpr char kAllowSystemNotifications[] =
+@@ -4085,7 +4085,7 @@ inline constexpr char kLensDesktopNTPSea
+ "policy.lens_desktop_ntp_search_enabled";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // A dict mapping the edition name with the major version it was shown.
+ inline constexpr char kWhatsNewEditionUsed[] = "browser.whats_new.edition_used";
+ // A list containing the features of each module in order of when they
+@@ -4179,7 +4179,7 @@ inline constexpr char kPrintingOAuth2Aut
+ "printing.oauth2_authorization_servers";
+ #endif
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If this exists and is true, Chrome may run system DNS resolution out of the
+ // network process. If false, Chrome will run system DNS resolution in the
+ // network process. If non-existent, Chrome will decide where to run system DNS
diff --git a/chromium-next/patches/patch-chrome_common_url__constants.h b/chromium-next/patches/patch-chrome_common_url__constants.h
new file mode 100644
index 0000000000..debd844bdd
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_url__constants.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/url_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/url_constants.h
+@@ -968,7 +968,7 @@ inline constexpr char kOutdatedPluginLea
+ inline constexpr char kPhoneHubPermissionLearnMoreURL[] =
+ "https://support.google.com/chromebook?p=multidevice";
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // "Learn more" URL for the chrome apps deprecation dialog.
+ inline constexpr char kChromeAppsDeprecationLearnMoreURL[] =
+ "https://support.google.com/chrome?p=chrome_app_deprecation";
diff --git a/chromium-next/patches/patch-chrome_common_webui__url__constants.cc b/chromium-next/patches/patch-chrome_common_webui__url__constants.cc
new file mode 100644
index 0000000000..b5530f986c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_webui__url__constants.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/webui_url_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/webui_url_constants.cc
+@@ -197,21 +197,21 @@ base::span<const base::cstring_view> Chr
+ kChromeUIAssistantOptInHost,
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ kChromeUIConnectorsInternalsHost,
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ kChromeUIDiscardsHost,
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ kChromeUIWebAppSettingsHost,
+ #endif
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID)
+ kChromeUILinuxProxyConfigHost,
+ #endif
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ kChromeUISandboxHost,
+ #endif
+ #if BUILDFLAG(IS_WIN)
+@@ -282,7 +282,7 @@ base::span<const base::cstring_view> Chr
+ blink::kChromeUIGpuJavaCrashURL,
+ kChromeUIJavaCrashURL,
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ kChromeUIWebUIJsErrorURL,
+ #endif
+ kChromeUIQuitURL,
diff --git a/chromium-next/patches/patch-chrome_common_webui__url__constants.h b/chromium-next/patches/patch-chrome_common_webui__url__constants.h
new file mode 100644
index 0000000000..d92a30a611
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_common_webui__url__constants.h
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/common/webui_url_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/common/webui_url_constants.h
+@@ -578,24 +578,24 @@ inline constexpr char16_t kOsUISystemURL
+ inline constexpr char kOsUIVersionURL[] = "os://version";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ inline constexpr char kChromeUIWebUIJsErrorHost[] = "webuijserror";
+ inline constexpr char kChromeUIWebUIJsErrorURL[] = "chrome://webuijserror/";
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ inline constexpr char kChromeUIConnectorsInternalsHost[] =
+ "connectors-internals";
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ inline constexpr char kChromeUIDiscardsHost[] = "discards";
+ inline constexpr char kChromeUIDiscardsURL[] = "chrome://discards/";
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ inline constexpr char kChromeUIWebAppSettingsHost[] = "app-settings";
+ inline constexpr char kChromeUIWebAppSettingsURL[] = "chrome://app-settings/";
+ inline constexpr char kChromeUIWhatsNewHost[] = "whats-new";
+@@ -607,13 +607,13 @@ inline constexpr char kChromeUILinuxProx
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ inline constexpr char kChromeUISandboxHost[] = "sandbox";
+ #endif
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ inline constexpr char kChromeUIBrowserSwitchHost[] = "browser-switch";
+ inline constexpr char kChromeUIBrowserSwitchURL[] = "chrome://browser-switch/";
+@@ -635,7 +635,7 @@ inline constexpr char kChromeUIProfilePi
+ inline constexpr char kChromeUIProfilePickerUrl[] = "chrome://profile-picker/";
+ #endif
+
+-#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ defined(TOOLKIT_VIEWS)) || \
+ defined(USE_AURA)
+ inline constexpr char kChromeUITabModalConfirmDialogHost[] =
diff --git a/chromium-next/patches/patch-chrome_enterprise__companion_enterprise__companion__client.cc b/chromium-next/patches/patch-chrome_enterprise__companion_enterprise__companion__client.cc
new file mode 100644
index 0000000000..5c7ecd7888
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_enterprise__companion_enterprise__companion__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/enterprise_companion/enterprise_companion_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/enterprise_companion/enterprise_companion_client.cc
+@@ -36,7 +36,7 @@ namespace {
+
+ #if BUILDFLAG(IS_MAC)
+ constexpr char kServerName[] = MAC_BUNDLE_IDENTIFIER_STRING ".service";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr char kServerName[] =
+ "/run/" COMPANY_SHORTNAME_STRING "/" PRODUCT_FULLNAME_STRING "/service.sk";
+ #elif BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-chrome_enterprise__companion_lock.cc b/chromium-next/patches/patch-chrome_enterprise__companion_lock.cc
new file mode 100644
index 0000000000..50b40e96f7
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_enterprise__companion_lock.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/enterprise_companion/lock.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/enterprise_companion/lock.cc
+@@ -17,7 +17,7 @@
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr char kLockName[] = "/" PRODUCT_FULLNAME_STRING ".lock";
+ #elif BUILDFLAG(IS_MAC)
+ constexpr char kLockName[] = MAC_BUNDLE_IDENTIFIER_STRING ".lock";
+@@ -42,7 +42,7 @@ CSecurityDesc GetAdminDaclSecurityDescri
+ namespace enterprise_companion {
+
+ std::unique_ptr<ScopedLock> CreateScopedLock(base::TimeDelta timeout) {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return named_system_lock::ScopedLock::Create(kLockName, timeout);
+ #elif BUILDFLAG(IS_WIN)
+ CSecurityAttributes sa =
diff --git a/chromium-next/patches/patch-chrome_services_printing_print__backend__service__impl.cc b/chromium-next/patches/patch-chrome_services_printing_print__backend__service__impl.cc
new file mode 100644
index 0000000000..5b71f637b1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_services_printing_print__backend__service__impl.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/services/printing/print_backend_service_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/services/printing/print_backend_service_impl.cc
+@@ -50,7 +50,7 @@
+ #include "printing/backend/cups_connection_pool.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/no_destructor.h"
+ #include "ui/linux/linux_ui.h"
+ #include "ui/linux/linux_ui_delegate_stub.h"
+@@ -77,7 +77,7 @@ namespace printing {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void InstantiateLinuxUiDelegate() {
+ // TODO(crbug.com/40561724) Until a real UI can be used in a utility process,
+ // need to use the stub version.
+@@ -86,7 +86,7 @@ void InstantiateLinuxUiDelegate() {
+ #endif
+
+ scoped_refptr<base::SequencedTaskRunner> GetPrintingTaskRunner() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Use task runner associated with equivalent of UI thread. Needed for calls
+ // made through `PrintDialogLinuxInterface` to properly execute.
+ CHECK(base::SequencedTaskRunner::HasCurrentDefault());
+@@ -469,7 +469,7 @@ void PrintBackendServiceImpl::Init(
+ // `InitCommon()`.
+ InitializeProcessForPrinting();
+ print_backend_ = PrintBackend::CreateInstance(locale);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Test framework already initializes the UI, so this should not go in
+ // `InitCommon()`. Additionally, low-level Linux UI is not needed when tests
+ // are using `TestPrintingContext`.
+@@ -690,7 +690,7 @@ void PrintBackendServiceImpl::UpdatePrin
+ crash_keys_ = std::make_unique<crash_keys::ScopedPrinterInfo>(
+ *printer_name, print_backend_->GetPrinterDriverInfo(*printer_name));
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_CUPS)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_CUPS)
+ // Try to fill in advanced settings based upon basic info options.
+ PrinterBasicInfo basic_info;
+ if (print_backend_->GetPrinterBasicInfo(*printer_name, &basic_info) ==
diff --git a/chromium-next/patches/patch-chrome_services_speech_audio__source__fetcher__impl.cc b/chromium-next/patches/patch-chrome_services_speech_audio__source__fetcher__impl.cc
new file mode 100644
index 0000000000..71ce98a6ac
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_services_speech_audio__source__fetcher__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/services/speech/audio_source_fetcher_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/services/speech/audio_source_fetcher_impl.cc
+@@ -132,7 +132,7 @@ void AudioSourceFetcherImpl::Start(
+
+ // TODO(crbug.com/40753481): Check implementation / sandbox policy on Mac and
+ // Windows.
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ is_started_ = true;
+ // Initialize the AudioCapturerSource with |this| as the CaptureCallback,
+ // get the parameters for the device ID, then start audio capture.
diff --git a/chromium-next/patches/patch-chrome_test_base_scoped__channel__override__posix.cc b/chromium-next/patches/patch-chrome_test_base_scoped__channel__override__posix.cc
new file mode 100644
index 0000000000..c1aca50f1e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_test_base_scoped__channel__override__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/test/base/scoped_channel_override_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/test/base/scoped_channel_override_posix.cc
+@@ -45,7 +45,7 @@ std::string GetVersionExtra(ScopedChanne
+ return "beta";
+ case ScopedChannelOverride::Channel::kDev:
+ return "unstable";
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case ScopedChannelOverride::Channel::kCanary:
+ return "canary";
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-chrome_test_chromedriver_chrome__launcher.cc b/chromium-next/patches/patch-chrome_test_chromedriver_chrome__launcher.cc
new file mode 100644
index 0000000000..882a1b9e7e
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_test_chromedriver_chrome__launcher.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/test/chromedriver/chrome_launcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/test/chromedriver/chrome_launcher.cc
+@@ -73,6 +73,7 @@
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <sys/wait.h>
+ #include <unistd.h>
+ #elif BUILDFLAG(IS_WIN)
+ #include <windows.h>
diff --git a/chromium-next/patches/patch-chrome_test_chromedriver_chrome_chrome__finder.cc b/chromium-next/patches/patch-chrome_test_chromedriver_chrome_chrome__finder.cc
new file mode 100644
index 0000000000..eea84238e3
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_test_chromedriver_chrome_chrome__finder.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/test/chromedriver/chrome/chrome_finder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/test/chromedriver/chrome/chrome_finder.cc
+@@ -58,7 +58,7 @@ void GetApplicationDirs(std::vector<base
+ installation_locations[i].Append(L"Chromium\\Application"));
+ }
+ }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void GetApplicationDirs(std::vector<base::FilePath>* locations) {
+ // TODO: Respect users' PATH variables.
+ // Until then, we use an approximation of the most common defaults.
+@@ -125,7 +125,7 @@ std::vector<base::FilePath> GetChromePro
+ chrome::kGoogleChromeForTestingBrowserProcessExecutablePath),
+ base::FilePath(chrome::kGoogleChromeBrowserProcessExecutablePath),
+ base::FilePath(chrome::kChromiumBrowserProcessExecutablePath),
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FilePath(chrome::kBrowserProcessExecutablePath),
+ base::FilePath("chrome"), // Chrome for Testing or Google Chrome
+ base::FilePath("google-chrome"), base::FilePath("chromium"),
+@@ -141,7 +141,7 @@ std::vector<base::FilePath> GetHeadlessS
+ return {
+ #if BUILDFLAG(IS_WIN)
+ base::FilePath(FILE_PATH_LITERAL("chrome-headless-shell.exe")),
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FilePath("chrome-headless-shell"),
+ #else
+ // it will compile but won't work on other OSes
diff --git a/chromium-next/patches/patch-chrome_test_chromedriver_key__converter__unittest.cc b/chromium-next/patches/patch-chrome_test_chromedriver_key__converter__unittest.cc
new file mode 100644
index 0000000000..a736bc7ae8
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_test_chromedriver_key__converter__unittest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/test/chromedriver/key_converter_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/test/chromedriver/key_converter_unittest.cc
+@@ -251,7 +251,7 @@ TEST(KeyConverter, ToggleModifiers) {
+ CheckEventsReleaseModifiers(keys, key_events);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Fails on bots: crbug.com/174962
+ #define MAYBE_AllEnglishKeyboardSymbols DISABLED_AllEnglishKeyboardSymbols
+ #else
+@@ -308,7 +308,7 @@ TEST(KeyConverter, AllEnglishKeyboardTex
+ TEST(KeyConverter, AllSpecialWebDriverKeysOnEnglishKeyboard) {
+ ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US);
+ const char kTextForKeys[] = {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ 0, 0, 0, 0, '\t', 0, '\r', '\r', 0, 0, 0, 0, 0,
+ #else
+ 0, 0, 0, 0, 0, 0, '\r', '\r', 0, 0, 0, 0, 0,
diff --git a/chromium-next/patches/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc b/chromium-next/patches/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc
new file mode 100644
index 0000000000..22546375b1
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/test/chromedriver/keycode_text_conversion_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/test/chromedriver/keycode_text_conversion_unittest.cc
+@@ -67,7 +67,7 @@ std::string ConvertKeyCodeToTextNoError(
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Fails on bots: crbug.com/174962
+ #define MAYBE_KeyCodeToText DISABLED_KeyCodeToText
+ #else
+@@ -104,7 +104,7 @@ TEST(KeycodeTextConversionTest, MAYBE_Ke
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Fails on bots: crbug.com/174962
+ #define MAYBE_CharToKeyCode DISABLED_CharToKeyCode
+ #else
diff --git a/chromium-next/patches/patch-chrome_test_supervised__user_google__auth__state__waiter__mixin.cc b/chromium-next/patches/patch-chrome_test_supervised__user_google__auth__state__waiter__mixin.cc
new file mode 100644
index 0000000000..0ac81f594c
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_test_supervised__user_google__auth__state__waiter__mixin.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/test/supervised_user/google_auth_state_waiter_mixin.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/test/supervised_user/google_auth_state_waiter_mixin.cc
+@@ -24,7 +24,7 @@ GoogleAuthStateWaiterMixin::GoogleAuthSt
+ GoogleAuthStateWaiterMixin::~GoogleAuthStateWaiterMixin() = default;
+
+ void GoogleAuthStateWaiterMixin::SetUpOnMainThread() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ ChildAccountService* child_account_service =
+ ChildAccountServiceFactory::GetForProfile(
+ test_base_->browser()->profile());
diff --git a/chromium-next/patches/patch-chrome_updater_app_app__uninstall.cc b/chromium-next/patches/patch-chrome_updater_app_app__uninstall.cc
new file mode 100644
index 0000000000..7532e57c0a
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_updater_app_app__uninstall.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/updater/app/app_uninstall.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/updater/app/app_uninstall.cc
+@@ -157,7 +157,7 @@ void UninstallInThreadPool(UpdaterScope
+ }
+ if (int result = UninstallOtherVersions(scope);
+ result != kErrorOk) {
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/366249606): Ignores the errors when uninstalls
+ // the other versions, because currently older Linux updater on
+ // CIPD exits with error `kErrorFailedToDeleteFolder`.
diff --git a/chromium-next/patches/patch-chrome_updater_configurator.cc b/chromium-next/patches/patch-chrome_updater_configurator.cc
new file mode 100644
index 0000000000..c000b5b33d
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_updater_configurator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/updater/configurator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/updater/configurator.cc
+@@ -72,7 +72,7 @@ Configurator::Configurator(scoped_refptr
+ return std::nullopt;
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+ }()) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Linux creating the NetworkFetcherFactory requires performing blocking IO
+ // to load an external library. This should be done when the configurator is
+ // created.
diff --git a/chromium-next/patches/patch-chrome_updater_lock.cc b/chromium-next/patches/patch-chrome_updater_lock.cc
new file mode 100644
index 0000000000..e5e72e6568
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_updater_lock.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/updater/lock.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/updater/lock.cc
+@@ -26,7 +26,7 @@ namespace updater {
+ std::unique_ptr<ScopedLock> CreateScopedLock(const std::string& name,
+ UpdaterScope scope,
+ base::TimeDelta timeout) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return named_system_lock::ScopedLock::Create(
+ base::StrCat({"/" PRODUCT_FULLNAME_STRING, name,
+ UpdaterScopeToString(scope), ".lock"}),
diff --git a/chromium-next/patches/patch-chrome_updater_util_posix__util.cc b/chromium-next/patches/patch-chrome_updater_util_posix__util.cc
new file mode 100644
index 0000000000..02d9fd7cb0
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_updater_util_posix__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/updater/util/posix_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/updater/util/posix_util.cc
+@@ -20,7 +20,7 @@
+ #include "chrome/updater/updater_branding.h"
+ #include "chrome/updater/util/util.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/updater/util/linux_util.h"
+ #endif
+
diff --git a/chromium-next/patches/patch-chrome_utility_services.cc b/chromium-next/patches/patch-chrome_utility_services.cc
new file mode 100644
index 0000000000..40899bfdce
--- /dev/null
+++ b/chromium-next/patches/patch-chrome_utility_services.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chrome/utility/services.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chrome/utility/services.cc
+@@ -49,7 +49,7 @@
+ #include "chrome/services/system_signals/mac/mac_system_signals_service.h"
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/services/system_signals/linux/linux_system_signals_service.h"
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -207,7 +207,7 @@ auto RunMacNotificationService(
+ }
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto RunSystemSignalsService(
+ mojo::PendingReceiver<device_signals::mojom::SystemSignalsService>
+ receiver) {
+@@ -481,7 +481,7 @@ void RegisterMainThreadServices(mojo::Se
+ services.Add(RunWindowsIconReader);
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ services.Add(RunSystemSignalsService);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-chromecast_browser_cast__browser__main__parts.cc b/chromium-next/patches/patch-chromecast_browser_cast__browser__main__parts.cc
new file mode 100644
index 0000000000..de0c7e01a7
--- /dev/null
+++ b/chromium-next/patches/patch-chromecast_browser_cast__browser__main__parts.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chromecast/browser/cast_browser_main_parts.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chromecast/browser/cast_browser_main_parts.cc
+@@ -95,7 +95,7 @@
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif // BUILDFLAG(IS_OZONE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <fontconfig/fontconfig.h>
+ #include <signal.h>
+ #include <sys/prctl.h>
+@@ -268,7 +268,7 @@ class CastViewsDelegate : public views::
+
+ #endif // defined(USE_AURA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ base::FilePath GetApplicationFontsDir() {
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
+@@ -314,7 +314,7 @@ const DefaultCommandLineSwitch kDefaultS
+ {switches::kDisableThreadedAnimation, ""},
+ #endif // BUILDFLAG(IS_ANDROID)
+ #endif // BUILDFLAG(IS_CAST_AUDIO_ONLY)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if defined(ARCH_CPU_X86_FAMILY)
+ // This is needed for now to enable the x11 Ozone platform to work with
+ // current Linux/NVidia OpenGL drivers.
+@@ -491,7 +491,7 @@ void CastBrowserMainParts::ToolkitInitia
+ views_delegate_ = std::make_unique<CastViewsDelegate>();
+ #endif // defined(USE_AURA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FilePath dir_font = GetApplicationFontsDir();
+ const FcChar8* dir_font_char8 =
+ reinterpret_cast<const FcChar8*>(dir_font.value().data());
diff --git a/chromium-next/patches/patch-chromecast_browser_cast__content__browser__client.cc b/chromium-next/patches/patch-chromecast_browser_cast__content__browser__client.cc
new file mode 100644
index 0000000000..2cc0fd0d7a
--- /dev/null
+++ b/chromium-next/patches/patch-chromecast_browser_cast__content__browser__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chromecast/browser/cast_content_browser_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chromecast/browser/cast_content_browser_client.cc
+@@ -429,7 +429,7 @@ void CastContentBrowserClient::AppendExt
+ switches::kAudioOutputChannels));
+ }
+ } else if (process_type == switches::kGpuProcess) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Necessary for accelerated 2d canvas. By default on Linux, Chromium
+ // assumes GLES2 contexts can be lost to a power-save mode, which breaks GPU
+ // canvas apps.
diff --git a/chromium-next/patches/patch-chromecast_cast__core_runtime_browser_runtime__application__service__impl.cc b/chromium-next/patches/patch-chromecast_cast__core_runtime_browser_runtime__application__service__impl.cc
new file mode 100644
index 0000000000..abe68d9109
--- /dev/null
+++ b/chromium-next/patches/patch-chromecast_cast__core_runtime_browser_runtime__application__service__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chromecast/cast_core/runtime/browser/runtime_application_service_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chromecast/cast_core/runtime/browser/runtime_application_service_impl.cc
+@@ -347,7 +347,7 @@ CastWebView::Scoped RuntimeApplicationSe
+ params->force_720p_resolution =
+ GetFlagEntry(feature::kCastCoreForce720p, config_.extra_features(),
+ /*default_value=*/false);
+-#if BUILDFLAG(ENABLE_CAST_RECEIVER) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_CAST_RECEIVER) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ // Starboard-based (linux) cast receivers may not render their UI at 720p, so
+ // we need to scale to the proper resolution. For example, a 4k TV may render
+ // the window at 1920x1080, so a scaling factor of 1.5 is necessary for a 720p
diff --git a/chromium-next/patches/patch-chromecast_media_base_default__monotonic__clock.cc b/chromium-next/patches/patch-chromecast_media_base_default__monotonic__clock.cc
new file mode 100644
index 0000000000..195e534515
--- /dev/null
+++ b/chromium-next/patches/patch-chromecast_media_base_default__monotonic__clock.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- chromecast/media/base/default_monotonic_clock.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ chromecast/media/base/default_monotonic_clock.cc
+@@ -11,7 +11,7 @@
+ #include "base/time/time.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chromecast/media/base/buildflags.h"
+ #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS)
+@@ -28,7 +28,7 @@ std::unique_ptr<MonotonicClock> Monotoni
+ return std::make_unique<DefaultMonotonicClock>();
+ }
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ int64_t MonotonicClockNow() {
+ timespec now = {0, 0};
+ #if BUILDFLAG(MEDIA_CLOCK_MONOTONIC_RAW)
diff --git a/chromium-next/patches/patch-components_autofill_core_browser_autofill__optimization__guide.cc b/chromium-next/patches/patch-components_autofill_core_browser_autofill__optimization__guide.cc
new file mode 100644
index 0000000000..e674966236
--- /dev/null
+++ b/chromium-next/patches/patch-components_autofill_core_browser_autofill__optimization__guide.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/autofill/core/browser/autofill_optimization_guide.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/autofill/core/browser/autofill_optimization_guide.cc
+@@ -186,7 +186,7 @@ void AutofillOptimizationGuide::OnDidPar
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (has_credit_card_field &&
+ !personal_data_manager->payments_data_manager()
+ .GetServerCreditCards()
diff --git a/chromium-next/patches/patch-components_autofill_core_browser_payments__data__manager.cc b/chromium-next/patches/patch-components_autofill_core_browser_payments__data__manager.cc
new file mode 100644
index 0000000000..c926f8a138
--- /dev/null
+++ b/chromium-next/patches/patch-components_autofill_core_browser_payments__data__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/autofill/core/browser/payments_data_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/autofill/core/browser/payments_data_manager.cc
+@@ -1090,7 +1090,7 @@ bool PaymentsDataManager::ShouldShowCard
+ // The feature is only for Linux, Windows, Mac, and Fuchsia.
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) || \
+ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA)
+ // This option should only be shown for users that have not enabled the Sync
+ // Feature and that have server credit cards available.
diff --git a/chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.cc b/chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.cc
new file mode 100644
index 0000000000..53bfbc1f72
--- /dev/null
+++ b/chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/autofill/core/common/autofill_payments_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/autofill/core/common/autofill_payments_features.cc
+@@ -13,7 +13,7 @@ BASE_FEATURE(kAutofillDisableLocalCardMi
+ "AutofillDisableLocalCardMigration",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
+ // When enabled, Chrome will extract the checkout amount from the checkout page
+ // of the allowlisted merchant websites.
+@@ -319,7 +319,7 @@ BASE_FEATURE(kAutofillSyncEwalletAccount
+ bool ShouldShowImprovedUserConsentForCreditCardSave() {
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ // The new user consent UI is fully launched on MacOS, Windows and Linux.
+ return true;
diff --git a/chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.h b/chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.h
new file mode 100644
index 0000000000..7fe8a68dcd
--- /dev/null
+++ b/chromium-next/patches/patch-components_autofill_core_common_autofill__payments__features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/autofill/core/common/autofill_payments_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/autofill/core/common/autofill_payments_features.h
+@@ -17,7 +17,7 @@ COMPONENT_EXPORT(AUTOFILL)
+ BASE_DECLARE_FEATURE(kAutofillDisableLocalCardMigration);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(AUTOFILL)
+ BASE_DECLARE_FEATURE(kAutofillEnableAmountExtractionDesktop);
+ #endif
diff --git a/chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.cc b/chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.cc
new file mode 100644
index 0000000000..5cb26aa809
--- /dev/null
+++ b/chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/autofill/core/common/autofill_prefs.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/autofill/core/common/autofill_prefs.cc
+@@ -118,7 +118,7 @@ void RegisterProfilePrefs(user_prefs::Pr
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kAutofillPredictionImprovementsEnabled,
+ false);
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
diff --git a/chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.h b/chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.h
new file mode 100644
index 0000000000..118e8749c9
--- /dev/null
+++ b/chromium-next/patches/patch-components_autofill_core_common_autofill__prefs.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/autofill/core/common/autofill_prefs.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/autofill/core/common/autofill_prefs.h
+@@ -73,7 +73,7 @@ inline constexpr char kAutofillPaymentCv
+ inline constexpr char kAutofillPaymentCardBenefits[] =
+ "autofill.payment_card_benefits";
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Boolean that controls improved autofill filling predictions. When enabled,
+ // the autofill functionality is enhanced with adopting user data to
+ // the form being filled in, which is triggered by the user via an extra
diff --git a/chromium-next/patches/patch-components_commerce_core_commerce__feature__list.cc b/chromium-next/patches/patch-components_commerce_core_commerce__feature__list.cc
new file mode 100644
index 0000000000..de0cebade7
--- /dev/null
+++ b/chromium-next/patches/patch-components_commerce_core_commerce__feature__list.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/commerce/core/commerce_feature_list.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/commerce/core/commerce_feature_list.cc
+@@ -169,7 +169,7 @@ BASE_FEATURE(kPriceInsights,
+ "PriceInsights",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kPriceInsightsRegionLaunched,
+ "PriceInsightsRegionLaunched",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+@@ -248,7 +248,7 @@ BASE_FEATURE(kEnableDiscountInfoApi,
+
+ const char kDiscountOnShoppyPageParam[] = "discount-on-shoppy-page";
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const base::FeatureParam<bool> kDiscountOnShoppyPage{
+ &kEnableDiscountInfoApi, kDiscountOnShoppyPageParam, true};
+ #else
+@@ -257,7 +257,7 @@ const base::FeatureParam<bool> kDiscount
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kEnableDiscountInfoApiRegionLaunched,
+ "EnableDiscountInfoApiRegionLaunched",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+@@ -296,7 +296,7 @@ const base::FeatureParam<bool> kDeleteAl
+
+ BASE_FEATURE(kShoppingList, "ShoppingList", base::FEATURE_DISABLED_BY_DEFAULT);
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_IOS)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kShoppingListRegionLaunched,
+ "ShoppingListRegionLaunched",
+ base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-components_constrained__window_constrained__window__views.cc b/chromium-next/patches/patch-components_constrained__window_constrained__window__views.cc
new file mode 100644
index 0000000000..7c3e05d088
--- /dev/null
+++ b/chromium-next/patches/patch-components_constrained__window_constrained__window__views.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/constrained_window/constrained_window_views.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/constrained_window/constrained_window_views.cc
+@@ -372,7 +372,7 @@ bool SupportsGlobalScreenCoordinates() {
+ }
+
+ bool PlatformClipsChildrenToViewport() {
+-#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-components_content__settings_core_browser_website__settings__registry.cc b/chromium-next/patches/patch-components_content__settings_core_browser_website__settings__registry.cc
new file mode 100644
index 0000000000..06e6cd1ad1
--- /dev/null
+++ b/chromium-next/patches/patch-components_content__settings_core_browser_website__settings__registry.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/content_settings/core/browser/website_settings_registry.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/content_settings/core/browser/website_settings_registry.cc
+@@ -67,7 +67,7 @@ const WebsiteSettingsInfo* WebsiteSettin
+ #if BUILDFLAG(IS_WIN)
+ if (!(platform & PLATFORM_WINDOWS))
+ return nullptr;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!(platform & PLATFORM_LINUX))
+ return nullptr;
+ #elif BUILDFLAG(IS_MAC)
diff --git a/chromium-next/patches/patch-components_cookie__config_cookie__store__util.cc b/chromium-next/patches/patch-components_cookie__config_cookie__store__util.cc
new file mode 100644
index 0000000000..e503c53efc
--- /dev/null
+++ b/chromium-next/patches/patch-components_cookie__config_cookie__store__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/cookie_config/cookie_store_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/cookie_config/cookie_store_util.cc
+@@ -12,7 +12,7 @@
+ namespace cookie_config {
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ namespace {
+
+ // Use the operating system's mechanisms to encrypt cookies before writing
diff --git a/chromium-next/patches/patch-components_crash_core_app_BUILD.gn b/chromium-next/patches/patch-components_crash_core_app_BUILD.gn
new file mode 100644
index 0000000000..ccd65d5244
--- /dev/null
+++ b/chromium-next/patches/patch-components_crash_core_app_BUILD.gn
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/crash/core/app/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/crash/core/app/BUILD.gn
+@@ -70,6 +70,10 @@ static_library("app") {
+ ]
+ }
+
++ if (is_bsd) {
++ sources -= [ "crashpad.cc" ]
++ }
++
+ defines = [ "CRASH_IMPLEMENTATION" ]
+
+ public_deps = [ ":lib" ]
+@@ -83,7 +87,7 @@ static_library("app") {
+ "//third_party/crashpad/crashpad/util",
+ ]
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "crashpad_linux.cc" ]
+ data_deps = [ ":chrome_crashpad_handler" ]
+ }
+@@ -103,7 +107,7 @@ static_library("app") {
+ libs = [ "log" ]
+ }
+
+- if (is_android || is_linux || is_chromeos) {
++ if ((is_android || is_linux || is_chromeos) && !is_bsd) {
+ deps += [
+ "//base:base_static",
+ "//components/crash/core/common",
+@@ -234,11 +238,6 @@ if (is_mac || is_android || is_linux ||
+ executable("chrome_crashpad_handler") {
+ sources = [ "chrome_crashpad_handler.cc" ]
+
+- deps = [
+- ":crashpad_handler_main",
+- "//third_party/crashpad/crashpad/handler",
+- ]
+-
+ if (is_mac && (is_component_build || is_asan || is_ubsan_any)) {
+ ldflags = [
+ # The handler is in
diff --git a/chromium-next/patches/patch-components_crash_core_app_chrome__crashpad__handler.cc b/chromium-next/patches/patch-components_crash_core_app_chrome__crashpad__handler.cc
new file mode 100644
index 0000000000..ceaf544d53
--- /dev/null
+++ b/chromium-next/patches/patch-components_crash_core_app_chrome__crashpad__handler.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/crash/core/app/chrome_crashpad_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/crash/core/app/chrome_crashpad_handler.cc
+@@ -6,5 +6,9 @@
+ extern "C" int CrashpadHandlerMain(int argc, char* argv[]);
+
+ int main(int argc, char* argv[]) {
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++ return -1;
++#else
+ return CrashpadHandlerMain(argc, argv);
++#endif
+ }
diff --git a/chromium-next/patches/patch-components_crash_core_app_crashpad__handler__main.cc b/chromium-next/patches/patch-components_crash_core_app_crashpad__handler__main.cc
new file mode 100644
index 0000000000..b81c718462
--- /dev/null
+++ b/chromium-next/patches/patch-components_crash_core_app_crashpad__handler__main.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/crash/core/app/crashpad_handler_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/crash/core/app/crashpad_handler_main.cc
+@@ -10,7 +10,7 @@
+ #include "third_party/crashpad/crashpad/handler/handler_main.h"
+ #include "third_party/crashpad/crashpad/handler/user_stream_data_source.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "components/stability_report/user_stream_data_source_posix.h"
+ #endif
+
+@@ -31,7 +31,7 @@ __attribute__((visibility("default"), us
+ char* argv[]) {
+ crashpad::UserStreamDataSources user_stream_data_sources;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ user_stream_data_sources.push_back(
+ std::make_unique<stability_report::UserStreamDataSourcePosix>());
+ #endif
diff --git a/chromium-next/patches/patch-components_crash_core_browser_crash__upload__list__crashpad.cc b/chromium-next/patches/patch-components_crash_core_browser_crash__upload__list__crashpad.cc
new file mode 100644
index 0000000000..2401786a4e
--- /dev/null
+++ b/chromium-next/patches/patch-components_crash_core_browser_crash__upload__list__crashpad.cc
@@ -0,0 +1,32 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/crash/core/browser/crash_upload_list_crashpad.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/crash/core/browser/crash_upload_list_crashpad.cc
+@@ -38,7 +38,9 @@ CrashUploadListCrashpad::~CrashUploadLis
+ std::vector<std::unique_ptr<UploadList::UploadInfo>>
+ CrashUploadListCrashpad::LoadUploadList() {
+ std::vector<crash_reporter::Report> reports;
++#if !BUILDFLAG(IS_BSD)
+ crash_reporter::GetReports(&reports);
++#endif
+
+ std::vector<std::unique_ptr<UploadInfo>> uploads;
+ for (const crash_reporter::Report& report : reports) {
+@@ -52,9 +54,13 @@ CrashUploadListCrashpad::LoadUploadList(
+
+ void CrashUploadListCrashpad::ClearUploadList(const base::Time& begin,
+ const base::Time& end) {
++#if !BUILDFLAG(IS_BSD)
+ crash_reporter::ClearReportsBetween(begin, end);
++#endif
+ }
+
+ void CrashUploadListCrashpad::RequestSingleUpload(const std::string& local_id) {
++#if !BUILDFLAG(IS_BSD)
+ crash_reporter::RequestSingleCrashUpload(local_id);
++#endif
+ }
diff --git a/chromium-next/patches/patch-components_crash_core_common_BUILD.gn b/chromium-next/patches/patch-components_crash_core_common_BUILD.gn
new file mode 100644
index 0000000000..4fa8292034
--- /dev/null
+++ b/chromium-next/patches/patch-components_crash_core_common_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/crash/core/common/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/crash/core/common/BUILD.gn
+@@ -9,7 +9,7 @@ import("//components/gwp_asan/buildflags
+
+ declare_args() {
+ # If set to true, this will stub out and disable the entire crash key system.
+- use_crash_key_stubs = is_fuchsia
++ use_crash_key_stubs = is_fuchsia || is_bsd
+ }
+
+ group("common") {
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_mock__signals__aggregator.h b/chromium-next/patches/patch-components_device__signals_core_browser_mock__signals__aggregator.h
new file mode 100644
index 0000000000..5a7aca9d68
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_mock__signals__aggregator.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/mock_signals_aggregator.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/mock_signals_aggregator.h
+@@ -17,7 +17,7 @@ class MockSignalsAggregator : public Sig
+ MockSignalsAggregator();
+ ~MockSignalsAggregator() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MOCK_METHOD(void,
+ GetSignalsForUser,
+ (const UserContext&,
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator.h b/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator.h
new file mode 100644
index 0000000000..18b4b6a134
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/signals_aggregator.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/signals_aggregator.h
+@@ -22,7 +22,7 @@ class SignalsAggregator : public KeyedSe
+
+ ~SignalsAggregator() override = default;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Will asynchronously collect signals whose names are specified in the
+ // `request` object, and will also use a `user_context` to validate that the
+ // user has permissions to the device's signals. Invokes `callback` with the
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.cc b/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.cc
new file mode 100644
index 0000000000..b15ab54001
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/signals_aggregator_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/signals_aggregator_impl.cc
+@@ -65,7 +65,7 @@ SignalsAggregatorImpl::SignalsAggregator
+
+ SignalsAggregatorImpl::~SignalsAggregatorImpl() = default;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SignalsAggregatorImpl::GetSignalsForUser(
+ const UserContext& user_context,
+ const SignalsAggregationRequest& request,
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.h b/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.h
new file mode 100644
index 0000000000..6408df1206
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_signals__aggregator__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/signals_aggregator_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/signals_aggregator_impl.h
+@@ -29,7 +29,7 @@ class SignalsAggregatorImpl : public Sig
+ ~SignalsAggregatorImpl() override;
+
+ // SignalsAggregator:
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void GetSignalsForUser(const UserContext& user_context,
+ const SignalsAggregationRequest& request,
+ GetSignalsCallback callback) override;
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service.h b/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service.h
new file mode 100644
index 0000000000..17cae1eec2
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/user_permission_service.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/user_permission_service.h
+@@ -57,7 +57,7 @@ class UserPermissionService : public Key
+ // missing.
+ virtual bool ShouldCollectConsent() const = 0;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Will verify whether context-aware signals can be collected
+ // on behalf of the user represented by `user_context`. Returns `kGranted` if
+ // collection is allowed.
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.cc b/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.cc
new file mode 100644
index 0000000000..71de327c8e
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/user_permission_service_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/user_permission_service_impl.cc
+@@ -87,7 +87,7 @@ bool UserPermissionServiceImpl::ShouldCo
+ consent_required_by_dependent_policy;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ UserPermission UserPermissionServiceImpl::CanUserCollectSignals(
+ const UserContext& user_context) const {
+ // Return "unknown user" if no user ID was given.
diff --git a/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.h b/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.h
new file mode 100644
index 0000000000..1027f0b02a
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_browser_user__permission__service__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/browser/user_permission_service_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/browser/user_permission_service_impl.h
+@@ -38,7 +38,7 @@ class UserPermissionServiceImpl : public
+
+ // UserPermissionService:
+ bool ShouldCollectConsent() const override;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ UserPermission CanUserCollectSignals(
+ const UserContext& user_context) const override;
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX
diff --git a/chromium-next/patches/patch-components_device__signals_core_common_signals__features.cc b/chromium-next/patches/patch-components_device__signals_core_common_signals__features.cc
new file mode 100644
index 0000000000..0e9e4af926
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_common_signals__features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/common/signals_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/common/signals_features.cc
+@@ -50,7 +50,7 @@ bool IsNewFunctionEnabled(NewEvFunction
+ }
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ // Enables the triggering of device signals consent dialog when conditions met
+ // This feature also requires UnmanagedDeviceSignalsConsentFlowEnabled policy to
+ // be enabled
diff --git a/chromium-next/patches/patch-components_device__signals_core_common_signals__features.h b/chromium-next/patches/patch-components_device__signals_core_common_signals__features.h
new file mode 100644
index 0000000000..4248771e0e
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_common_signals__features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/common/signals_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/common/signals_features.h
+@@ -31,7 +31,7 @@ enum class NewEvFunction { kFileSystemIn
+ bool IsNewFunctionEnabled(NewEvFunction new_ev_function);
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kDeviceSignalsConsentDialog);
+
+ // Returns true if device signals consent dialog has been enabled for
diff --git a/chromium-next/patches/patch-components_device__signals_core_system__signals_platform__delegate.cc b/chromium-next/patches/patch-components_device__signals_core_system__signals_platform__delegate.cc
new file mode 100644
index 0000000000..c22be297ec
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_core_system__signals_platform__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/core/system_signals/platform_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/core/system_signals/platform_delegate.cc
+@@ -11,7 +11,7 @@ namespace device_signals {
+
+ bool CustomFilePathComparator::operator()(const base::FilePath& a,
+ const base::FilePath& b) const {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Linux, the file system is case sensitive.
+ return a < b;
+ #else
diff --git a/chromium-next/patches/patch-components_device__signals_test_signals__contract.cc b/chromium-next/patches/patch-components_device__signals_test_signals__contract.cc
new file mode 100644
index 0000000000..12b3e3821c
--- /dev/null
+++ b/chromium-next/patches/patch-components_device__signals_test_signals__contract.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/device_signals/test/signals_contract.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/device_signals/test/signals_contract.cc
+@@ -212,7 +212,7 @@ GetSignalsContract() {
+ base::BindRepeating(VerifyUnset, names::kCrowdStrike);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ contract[names::kAllowScreenLock] =
+ base::BindRepeating(VerifyUnset, names::kAllowScreenLock);
+ contract[names::kImei] = base::BindRepeating(VerifyUnset, names::kImei);
diff --git a/chromium-next/patches/patch-components_discardable__memory_service_discardable__shared__memory__manager.cc b/chromium-next/patches/patch-components_discardable__memory_service_discardable__shared__memory__manager.cc
new file mode 100644
index 0000000000..66366a816b
--- /dev/null
+++ b/chromium-next/patches/patch-components_discardable__memory_service_discardable__shared__memory__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/discardable_memory/service/discardable_shared_memory_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/discardable_memory/service/discardable_shared_memory_manager.cc
+@@ -172,7 +172,7 @@ uint64_t GetDefaultMemoryLimit() {
+ // Limits the number of FDs used to 32, assuming a 4MB allocation size.
+ uint64_t max_default_memory_limit = 128 * kMegabyte;
+ #else
+- uint64_t max_default_memory_limit = 512 * kMegabyte;
++ uint64_t max_default_memory_limit = 128 * kMegabyte;
+ #endif
+
+ // Use 1/8th of discardable memory on low-end devices.
diff --git a/chromium-next/patches/patch-components_embedder__support_user__agent__utils.cc b/chromium-next/patches/patch-components_embedder__support_user__agent__utils.cc
new file mode 100644
index 0000000000..7ffffd1d06
--- /dev/null
+++ b/chromium-next/patches/patch-components_embedder__support_user__agent__utils.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/embedder_support/user_agent_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/embedder_support/user_agent_utils.cc
+@@ -500,6 +500,9 @@ std::string GetPlatformForUAMetadata() {
+ # else
+ return "Chromium OS";
+ # endif
++#elif BUILDFLAG(IS_BSD)
++ // The internet is weird...
++ return "Linux";
+ #else
+ return std::string(version_info::GetOSType());
+ #endif
diff --git a/chromium-next/patches/patch-components_embedder__support_user__agent__utils__unittest.cc b/chromium-next/patches/patch-components_embedder__support_user__agent__utils__unittest.cc
new file mode 100644
index 0000000000..7142ab1d40
--- /dev/null
+++ b/chromium-next/patches/patch-components_embedder__support_user__agent__utils__unittest.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/embedder_support/user_agent_utils_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/embedder_support/user_agent_utils_unittest.cc
+@@ -71,7 +71,7 @@ const char kDesktop[] =
+ "X11; CrOS x86_64 14541.0.0"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ "Fuchsia"
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ "X11; Linux x86_64"
+ #elif BUILDFLAG(IS_MAC)
+ "Macintosh; Intel Mac OS X 10_15_7"
+@@ -171,7 +171,7 @@ void CheckUserAgentStringOrdering(bool m
+ ASSERT_EQ("CrOS", pieces[0]);
+ ASSERT_EQ("x86_64", pieces[1]);
+ ASSERT_EQ("14541.0.0", pieces[2]);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Post-UA Reduction there is a single <unifiedPlatform> value for Linux:
+ // X11; Linux x86_64
+ ASSERT_EQ(2u, pieces.size());
+@@ -727,7 +727,7 @@ TEST_F(UserAgentUtilsTest, UserAgentMeta
+ #endif
+ #elif BUILDFLAG(IS_ANDROID)
+ EXPECT_EQ(metadata.platform, "Android");
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ EXPECT_EQ(metadata.platform, "Linux");
+ #elif BUILDFLAG(IS_FREEBSD)
+ EXPECT_EQ(metadata.platform, "FreeBSD");
diff --git a/chromium-next/patches/patch-components_enterprise_watermarking_watermark.cc b/chromium-next/patches/patch-components_enterprise_watermarking_watermark.cc
new file mode 100644
index 0000000000..ff9f58f7dc
--- /dev/null
+++ b/chromium-next/patches/patch-components_enterprise_watermarking_watermark.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/enterprise/watermarking/watermark.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/enterprise/watermarking/watermark.cc
+@@ -34,7 +34,7 @@ gfx::Font WatermarkFont() {
+ "Segoe UI",
+ #elif BUILDFLAG(IS_MAC)
+ "SF Pro Text",
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ "Ubuntu",
+ #elif BUILDFLAG(IS_CHROMEOS)
+ "Google Sans",
+@@ -45,7 +45,7 @@ gfx::Font WatermarkFont() {
+ }
+
+ gfx::Font::Weight WatermarkFontWeight() {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return gfx::Font::Weight::SEMIBOLD;
+ #else
+ return gfx::Font::Weight::MEDIUM;
diff --git a/chromium-next/patches/patch-components_eye__dropper_eye__dropper__view.cc b/chromium-next/patches/patch-components_eye__dropper_eye__dropper__view.cc
new file mode 100644
index 0000000000..33cab648c7
--- /dev/null
+++ b/chromium-next/patches/patch-components_eye__dropper_eye__dropper__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/eye_dropper/eye_dropper_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/eye_dropper/eye_dropper_view.cc
+@@ -203,7 +203,7 @@ EyeDropperView::EyeDropperView(gfx::Nati
+ // EyeDropper/WidgetDelegate.
+ set_owned_by_client();
+ SetPreferredSize(GetSize());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Use TYPE_MENU for Linux to ensure that the eye dropper view is displayed
+ // above the color picker.
+ views::Widget::InitParams params(
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_event__constants.cc b/chromium-next/patches/patch-components_feature__engagement_public_event__constants.cc
new file mode 100644
index 0000000000..4c34d64e63
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_event__constants.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/event_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/event_constants.cc
+@@ -11,7 +11,7 @@ namespace feature_engagement {
+ namespace events {
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ const char kNewTabOpened[] = "new_tab_opened";
+ const char kSixthTabOpened[] = "sixth_tab_opened";
+ const char kReadingListItemAdded[] = "reading_list_item_added";
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_event__constants.h b/chromium-next/patches/patch-components_feature__engagement_public_event__constants.h
new file mode 100644
index 0000000000..03609a4449
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_event__constants.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/event_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/event_constants.h
+@@ -14,7 +14,7 @@ namespace events {
+
+ // Desktop
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // The user has explicitly opened a new tab via an entry point from inside of
+ // Chrome.
+ extern const char kNewTabOpened[];
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_feature__configurations.cc b/chromium-next/patches/patch-components_feature__engagement_public_feature__configurations.cc
new file mode 100644
index 0000000000..4be91c4297
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_feature__configurations.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/feature_configurations.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/feature_configurations.cc
+@@ -95,7 +95,7 @@ std::optional<FeatureConfig> CreateNewUs
+
+ std::optional<FeatureConfig> GetClientSideFeatureConfig(
+ const base::Feature* feature) {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+
+ // The IPH bubble for link capturing has a trigger set to ANY so that it
+ // always shows up. The per app specific guardrails are independently stored
+@@ -114,7 +114,7 @@ std::optional<FeatureConfig> GetClientSi
+
+ #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (kIPHPasswordsManagementBubbleAfterSaveFeature.name == feature->name) {
+ std::optional<FeatureConfig> config = FeatureConfig();
+ config->valid = true;
+@@ -1641,7 +1641,8 @@ std::optional<FeatureConfig> GetClientSi
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+
+ if (kIPHAutofillCreditCardBenefitFeature.name == feature->name) {
+ // Credit card benefit IPH is shown:
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_feature__constants.cc b/chromium-next/patches/patch-components_feature__engagement_public_feature__constants.cc
new file mode 100644
index 0000000000..222dfdaebe
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_feature__constants.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/feature_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/feature_constants.cc
+@@ -18,7 +18,7 @@ BASE_FEATURE(kIPHDemoMode, "IPH_DemoMode
+ BASE_FEATURE(kIPHDummyFeature, "IPH_Dummy", base::FEATURE_DISABLED_BY_DEFAULT);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ BASE_FEATURE(kEsbDownloadRowPromoFeature,
+ "EsbDownloadRowPromo",
+@@ -646,7 +646,8 @@ BASE_FEATURE(kDefaultBrowserTriggerCrite
+ #endif // BUILDFLAG(IS_IOS)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kIPHAutofillCreditCardBenefitFeature,
+ "IPH_AutofillCreditCardBenefit",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -789,7 +790,7 @@ BASE_FEATURE(kIPHScalableIphGamingFeatur
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // This can be enabled by default, as the DesktopPWAsLinkCapturing
+ // flag is needed for the IPH linked to this feature to work, and
+ // use-cases to show the IPH are guarded by that flag.
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_feature__constants.h b/chromium-next/patches/patch-components_feature__engagement_public_feature__constants.h
new file mode 100644
index 0000000000..28fdf2b479
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_feature__constants.h
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/feature_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/feature_constants.h
+@@ -20,7 +20,7 @@ BASE_DECLARE_FEATURE(kIPHDemoMode);
+ BASE_DECLARE_FEATURE(kIPHDummyFeature);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ BASE_DECLARE_FEATURE(kEsbDownloadRowPromoFeature);
+ #endif
+@@ -261,7 +261,8 @@ BASE_DECLARE_FEATURE(kDefaultBrowserTrig
+ #endif // BUILDFLAG(IS_IOS)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kIPHAutofillCreditCardBenefitFeature);
+ BASE_DECLARE_FEATURE(kIPHAutofillDisabledVirtualCardSuggestionFeature);
+ BASE_DECLARE_FEATURE(kIPHAutofillExternalAccountProfileSuggestionFeature);
+@@ -314,7 +315,7 @@ BASE_DECLARE_FEATURE(kIPHScalableIphHelp
+ BASE_DECLARE_FEATURE(kIPHScalableIphGamingFeature);
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kIPHDesktopPWAsLinkCapturingLaunch);
+ BASE_DECLARE_FEATURE(kIPHDesktopPWAsLinkCapturingLaunchAppInTab);
+ BASE_DECLARE_FEATURE(kIPHToolbarManagementButtonFeature);
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_feature__list.cc b/chromium-next/patches/patch-components_feature__engagement_public_feature__list.cc
new file mode 100644
index 0000000000..123916ffd8
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_feature__list.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/feature_list.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/feature_list.cc
+@@ -160,7 +160,7 @@ const base::Feature* const kAllFeatures[
+ &kIPHiOSLensOverlayEntrypointTipFeature,
+ #endif // BUILDFLAG(IS_IOS)
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ &kEsbDownloadRowPromoFeature,
+ #endif
+@@ -230,7 +230,8 @@ const base::Feature* const kAllFeatures[
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+ &kIPHAutofillCreditCardBenefitFeature,
+ &kIPHAutofillDisabledVirtualCardSuggestionFeature,
+ &kIPHAutofillExternalAccountProfileSuggestionFeature,
+@@ -283,7 +284,7 @@ const base::Feature* const kAllFeatures[
+ &kIPHScalableIphGamingFeature,
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ &kIPHDesktopPWAsLinkCapturingLaunch,
+ &kIPHDesktopPWAsLinkCapturingLaunchAppInTab,
+ &kIPHToolbarManagementButtonFeature,
diff --git a/chromium-next/patches/patch-components_feature__engagement_public_feature__list.h b/chromium-next/patches/patch-components_feature__engagement_public_feature__list.h
new file mode 100644
index 0000000000..88eb7ce662
--- /dev/null
+++ b/chromium-next/patches/patch-components_feature__engagement_public_feature__list.h
@@ -0,0 +1,64 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feature_engagement/public/feature_list.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feature_engagement/public/feature_list.h
+@@ -278,7 +278,7 @@ DEFINE_VARIATION_PARAM(kIPHHomeCustomiza
+ #endif // BUILDFLAG(IS_IOS)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ DEFINE_VARIATION_PARAM(kEsbDownloadRowPromoFeature, "EsbDownloadRowPromo");
+ #endif
+@@ -387,7 +387,8 @@ DEFINE_VARIATION_PARAM(kIPHTabGroupsSave
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+ DEFINE_VARIATION_PARAM(kIPHAutofillCreditCardBenefitFeature,
+ "IPH_AutofillCreditCardBenefit");
+
+@@ -481,7 +482,7 @@ DEFINE_VARIATION_PARAM(kIPHScalableIphHe
+ DEFINE_VARIATION_PARAM(kIPHScalableIphGamingFeature, "IPH_ScalableIphGaming");
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ DEFINE_VARIATION_PARAM(kIPHDesktopPWAsLinkCapturingLaunch,
+ "IPH_DesktopPWAsLinkCapturingLaunch");
+ DEFINE_VARIATION_PARAM(kIPHDesktopPWAsLinkCapturingLaunchAppInTab,
+@@ -643,7 +644,7 @@ constexpr flags_ui::FeatureEntry::Featur
+ VARIATION_ENTRY(kIPHHomeCustomizationMenuFeature),
+ VARIATION_ENTRY(kIPHiOSLensOverlayEntrypointTipFeature),
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ VARIATION_ENTRY(kIPHBatterySaverModeFeature),
+ VARIATION_ENTRY(kIPHCompanionSidePanelFeature),
+ VARIATION_ENTRY(kIPHCompanionSidePanelRegionSearchFeature),
+@@ -701,7 +702,8 @@ constexpr flags_ui::FeatureEntry::Featur
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_BSD)
+ VARIATION_ENTRY(kIPHAutofillCreditCardBenefitFeature),
+ VARIATION_ENTRY(kIPHAutofillDisabledVirtualCardSuggestionFeature),
+ VARIATION_ENTRY(kIPHAutofillExternalAccountProfileSuggestionFeature),
+@@ -753,7 +755,7 @@ constexpr flags_ui::FeatureEntry::Featur
+ VARIATION_ENTRY(kIPHScalableIphGamingFeature),
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ VARIATION_ENTRY(kIPHDesktopPWAsLinkCapturingLaunch),
+ VARIATION_ENTRY(kIPHDesktopPWAsLinkCapturingLaunchAppInTab),
+ VARIATION_ENTRY(kIPHToolbarManagementButtonFeature),
diff --git a/chromium-next/patches/patch-components_feed_core_proto_v2_wire_version.proto b/chromium-next/patches/patch-components_feed_core_proto_v2_wire_version.proto
new file mode 100644
index 0000000000..345be6d299
--- /dev/null
+++ b/chromium-next/patches/patch-components_feed_core_proto_v2_wire_version.proto
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feed/core/proto/v2/wire/version.proto.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feed/core/proto/v2/wire/version.proto
+@@ -25,8 +25,8 @@ message Version {
+ BETA = 3;
+ RELEASE = 4;
+ }
+- optional int32 major = 1;
+- optional int32 minor = 2;
++ optional int32 gmajor = 1;
++ optional int32 gminor = 2;
+ optional int32 build = 3;
+ optional int32 revision = 4;
+ optional Architecture architecture = 5;
diff --git a/chromium-next/patches/patch-components_feed_core_v2_feed__network__impl__unittest.cc b/chromium-next/patches/patch-components_feed_core_v2_feed__network__impl__unittest.cc
new file mode 100644
index 0000000000..89ef450ae6
--- /dev/null
+++ b/chromium-next/patches/patch-components_feed_core_v2_feed__network__impl__unittest.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feed/core/v2/feed_network_impl_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feed/core/v2/feed_network_impl_unittest.cc
+@@ -747,8 +747,8 @@ TEST_F(FeedNetworkTest, SendApiRequest_D
+
+ EXPECT_EQ(feedwire::ClientInfo::CHROME_ANDROID, client_info.app_type());
+ EXPECT_EQ(feedwire::Version::RELEASE, client_info.app_version().build_type());
+- EXPECT_EQ(1, client_info.app_version().major());
+- EXPECT_EQ(2, client_info.app_version().minor());
++ EXPECT_EQ(1, client_info.app_version().gmajor());
++ EXPECT_EQ(2, client_info.app_version().gminor());
+ EXPECT_EQ(3, client_info.app_version().build());
+ EXPECT_EQ(4, client_info.app_version().revision());
+ EXPECT_FALSE(client_info.chrome_client_info().start_surface());
diff --git a/chromium-next/patches/patch-components_feed_core_v2_proto__util.cc b/chromium-next/patches/patch-components_feed_core_v2_proto__util.cc
new file mode 100644
index 0000000000..409082fcfc
--- /dev/null
+++ b/chromium-next/patches/patch-components_feed_core_v2_proto__util.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feed/core/v2/proto_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feed/core/v2/proto_util.cc
+@@ -93,8 +93,8 @@ feedwire::Version GetPlatformVersionMess
+
+ int32_t major, minor, revision;
+ base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &revision);
+- result.set_major(major);
+- result.set_minor(minor);
++ result.set_gmajor(major);
++ result.set_gminor(minor);
+ result.set_revision(revision);
+ #if BUILDFLAG(IS_ANDROID)
+ result.set_api_version(base::android::BuildInfo::GetInstance()->sdk_int());
+@@ -109,8 +109,8 @@ feedwire::Version GetAppVersionMessage(c
+ // Chrome's version is in the format: MAJOR,MINOR,BUILD,PATCH.
+ const std::vector<uint32_t>& numbers = chrome_info.version.components();
+ if (numbers.size() > 3) {
+- result.set_major(static_cast<int32_t>(numbers[0]));
+- result.set_minor(static_cast<int32_t>(numbers[1]));
++ result.set_gmajor(static_cast<int32_t>(numbers[0]));
++ result.set_gminor(static_cast<int32_t>(numbers[1]));
+ result.set_build(static_cast<int32_t>(numbers[2]));
+ result.set_revision(static_cast<int32_t>(numbers[3]));
+ }
diff --git a/chromium-next/patches/patch-components_feed_core_v2_proto__util__unittest.cc b/chromium-next/patches/patch-components_feed_core_v2_proto__util__unittest.cc
new file mode 100644
index 0000000000..7a55b2357a
--- /dev/null
+++ b/chromium-next/patches/patch-components_feed_core_v2_proto__util__unittest.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feed/core/v2/proto_util_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feed/core/v2/proto_util_unittest.cc
+@@ -43,8 +43,8 @@ TEST(ProtoUtilTest, CreateClientInfo) {
+ feedwire::ClientInfo result = CreateClientInfo(request_metadata);
+ EXPECT_EQ(feedwire::ClientInfo::CHROME_ANDROID, result.app_type());
+ EXPECT_EQ(feedwire::Version::RELEASE, result.app_version().build_type());
+- EXPECT_EQ(1, result.app_version().major());
+- EXPECT_EQ(2, result.app_version().minor());
++ EXPECT_EQ(1, result.app_version().gmajor());
++ EXPECT_EQ(2, result.app_version().gminor());
+ EXPECT_EQ(3, result.app_version().build());
+ EXPECT_EQ(4, result.app_version().revision());
+
diff --git a/chromium-next/patches/patch-components_feed_core_v2_test_proto__printer.cc b/chromium-next/patches/patch-components_feed_core_v2_test_proto__printer.cc
new file mode 100644
index 0000000000..5677f264c3
--- /dev/null
+++ b/chromium-next/patches/patch-components_feed_core_v2_test_proto__printer.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/feed/core/v2/test/proto_printer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/feed/core/v2/test/proto_printer.cc
+@@ -158,8 +158,8 @@ class TextProtoPrinter {
+ }
+ TextProtoPrinter& operator<<(const feedwire::Version& v) {
+ BeginMessage();
+- PRINT_FIELD(major);
+- PRINT_FIELD(minor);
++ PRINT_FIELD(gmajor);
++ PRINT_FIELD(gminor);
+ PRINT_FIELD(build);
+ PRINT_FIELD(revision);
+ PRINT_FIELD(architecture);
diff --git a/chromium-next/patches/patch-components_flags__ui_flags__state.cc b/chromium-next/patches/patch-components_flags__ui_flags__state.cc
new file mode 100644
index 0000000000..1939d8dda5
--- /dev/null
+++ b/chromium-next/patches/patch-components_flags__ui_flags__state.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/flags_ui/flags_state.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/flags_ui/flags_state.cc
+@@ -755,7 +755,7 @@ unsigned short FlagsState::GetCurrentPla
+ return kOsCrOS;
+ #elif BUILDFLAG(IS_CHROMEOS_LACROS)
+ return kOsLacros;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OPENBSD)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return kOsLinux;
+ #elif BUILDFLAG(IS_ANDROID)
+ return kOsAndroid;
diff --git a/chromium-next/patches/patch-components_gwp__asan_BUILD.gn b/chromium-next/patches/patch-components_gwp__asan_BUILD.gn
new file mode 100644
index 0000000000..ef9fbf7b0e
--- /dev/null
+++ b/chromium-next/patches/patch-components_gwp__asan_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/gwp_asan/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/gwp_asan/BUILD.gn
+@@ -15,7 +15,7 @@ test("gwp_asan_unittests") {
+ "//testing/gtest",
+ "//third_party/boringssl",
+ ]
+- if (is_win || is_mac || is_linux || is_chromeos || is_android) {
++ if ((is_win || is_mac || is_linux || is_chromeos || is_android) && !is_bsd) {
+ deps += [
+ "//components/gwp_asan/client:unit_tests",
+ "//components/gwp_asan/crash_handler:unit_tests",
diff --git a/chromium-next/patches/patch-components_gwp__asan_client_guarded__page__allocator__posix.cc b/chromium-next/patches/patch-components_gwp__asan_client_guarded__page__allocator__posix.cc
new file mode 100644
index 0000000000..7f760162e3
--- /dev/null
+++ b/chromium-next/patches/patch-components_gwp__asan_client_guarded__page__allocator__posix.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/gwp_asan/client/guarded_page_allocator_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/gwp_asan/client/guarded_page_allocator_posix.cc
+@@ -35,8 +35,9 @@ void GuardedPageAllocator::MarkPageInacc
+ // mmap() a PROT_NONE page over the address to release it to the system, if
+ // we used mprotect() here the system would count pages in the quarantine
+ // against the RSS.
++ // MAP_ANONYMOUS requires the fd to be -1 on !linux
+ void* err = mmap(ptr, state_.page_size, PROT_NONE,
+- MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
++ MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+ PCHECK(err == ptr) << "mmap";
+ }
+
diff --git a/chromium-next/patches/patch-components_gwp__asan_client_gwp__asan.cc b/chromium-next/patches/patch-components_gwp__asan_client_gwp__asan.cc
new file mode 100644
index 0000000000..bb2d96497b
--- /dev/null
+++ b/chromium-next/patches/patch-components_gwp__asan_client_gwp__asan.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/gwp_asan/client/gwp_asan.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/gwp_asan/client/gwp_asan.cc
+@@ -75,7 +75,7 @@ namespace {
+ // ProcessSamplingBoost is the multiplier to increase the
+ // ProcessSamplingProbability in scenarios where we want to perform additional
+ // testing (e.g., on canary/dev builds).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ constexpr int kDefaultMaxAllocations = 50;
+ constexpr int kDefaultMaxMetadata = 210;
+ constexpr int kDefaultTotalPages = kCpuIs64Bit ? 2048 : kDefaultMaxMetadata * 2;
diff --git a/chromium-next/patches/patch-components_gwp__asan_client_gwp__asan__features.cc b/chromium-next/patches/patch-components_gwp__asan_client_gwp__asan__features.cc
new file mode 100644
index 0000000000..6fb61ab526
--- /dev/null
+++ b/chromium-next/patches/patch-components_gwp__asan_client_gwp__asan__features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/gwp_asan/client/gwp_asan_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/gwp_asan/client/gwp_asan_features.cc
+@@ -9,7 +9,7 @@
+ namespace gwp_asan::internal {
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || \
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ constexpr base::FeatureState kDefaultEnabled = base::FEATURE_ENABLED_BY_DEFAULT;
+ #else
diff --git a/chromium-next/patches/patch-components_gwp__asan_crash__handler_crash__analyzer.cc b/chromium-next/patches/patch-components_gwp__asan_crash__handler_crash__analyzer.cc
new file mode 100644
index 0000000000..768747c9d4
--- /dev/null
+++ b/chromium-next/patches/patch-components_gwp__asan_crash__handler_crash__analyzer.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/gwp_asan/crash_handler/crash_analyzer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/gwp_asan/crash_handler/crash_analyzer.cc
+@@ -35,7 +35,7 @@
+ #include "third_party/crashpad/crashpad/snapshot/process_snapshot.h"
+ #include "third_party/crashpad/crashpad/util/process/process_memory.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include <signal.h>
+ #elif BUILDFLAG(IS_APPLE)
+ #include <mach/exception_types.h>
+@@ -95,7 +95,7 @@ bool CrashAnalyzer::GetExceptionInfo(
+
+ crashpad::VMAddress CrashAnalyzer::GetAccessAddress(
+ const crashpad::ExceptionSnapshot& exception) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ if (exception.Exception() == SIGSEGV || exception.Exception() == SIGBUS)
+ return exception.ExceptionAddress();
+ #elif BUILDFLAG(IS_APPLE)
diff --git a/chromium-next/patches/patch-components_live__caption_caption__util.cc b/chromium-next/patches/patch-components_live__caption_caption__util.cc
new file mode 100644
index 0000000000..9d31c65ea6
--- /dev/null
+++ b/chromium-next/patches/patch-components_live__caption_caption__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/live_caption/caption_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/live_caption/caption_util.cc
+@@ -139,7 +139,7 @@ std::string GetCaptionSettingsUrl() {
+ return "chrome://os-settings/audioAndCaptions";
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return "chrome://settings/captions";
+ #endif // BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-components_live__caption_caption__util.h b/chromium-next/patches/patch-components_live__caption_caption__util.h
new file mode 100644
index 0000000000..c54325d5f6
--- /dev/null
+++ b/chromium-next/patches/patch-components_live__caption_caption__util.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/live_caption/caption_util.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/live_caption/caption_util.h
+@@ -15,7 +15,7 @@ class PrefService;
+ namespace captions {
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ extern const char kCaptionSettingsUrl[];
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) ||
+ // BUILDFLAG(IS_MAC)
diff --git a/chromium-next/patches/patch-components_media__router_common_media__source.cc b/chromium-next/patches/patch-components_media__router_common_media__source.cc
new file mode 100644
index 0000000000..b3583e6c5c
--- /dev/null
+++ b/chromium-next/patches/patch-components_media__router_common_media__source.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/media_router/common/media_source.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/media_router/common/media_source.cc
+@@ -57,7 +57,7 @@ bool IsSystemAudioCaptureSupported() {
+ if (!media::IsSystemLoopbackCaptureSupported()) {
+ return false;
+ }
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(media::kPulseaudioLoopbackForCast);
+ #else
+ return true;
diff --git a/chromium-next/patches/patch-components_media__router_common_providers_cast_channel_cast__message__util.cc b/chromium-next/patches/patch-components_media__router_common_providers_cast_channel_cast__message__util.cc
new file mode 100644
index 0000000000..4561caef79
--- /dev/null
+++ b/chromium-next/patches/patch-components_media__router_common_providers_cast_channel_cast__message__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/media_router/common/providers/cast/channel/cast_message_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/media_router/common/providers/cast/channel/cast_message_util.cc
+@@ -169,7 +169,7 @@ int GetVirtualConnectPlatformValue() {
+ return 4;
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ return 5;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return 6;
+ #else
+ return 0;
diff --git a/chromium-next/patches/patch-components_media__router_common_providers_cast_channel_enum__table.h b/chromium-next/patches/patch-components_media__router_common_providers_cast_channel_enum__table.h
new file mode 100644
index 0000000000..641fbb8bbd
--- /dev/null
+++ b/chromium-next/patches/patch-components_media__router_common_providers_cast_channel_enum__table.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/media_router/common/providers/cast/channel/enum_table.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/media_router/common/providers/cast/channel/enum_table.h
+@@ -366,7 +366,12 @@ class EnumTable {
+
+ private:
+ #ifdef ARCH_CPU_64_BITS
++#ifdef __cpp_lib_hardware_interference_size
+ alignas(std::hardware_destructive_interference_size)
++#else
++ static constexpr std::size_t hardware_destructive_interference_size = 64;
++ alignas(hardware_destructive_interference_size)
++#endif
+ #endif
+ std::initializer_list<Entry> data_;
+ bool is_sorted_;
diff --git a/chromium-next/patches/patch-components_metrics_drive__metrics__provider__linux.cc b/chromium-next/patches/patch-components_metrics_drive__metrics__provider__linux.cc
new file mode 100644
index 0000000000..41b09bbbdb
--- /dev/null
+++ b/chromium-next/patches/patch-components_metrics_drive__metrics__provider__linux.cc
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/metrics/drive_metrics_provider_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/metrics/drive_metrics_provider_linux.cc
+@@ -4,7 +4,13 @@
+
+ #include "components/metrics/drive_metrics_provider.h"
+
++#if BUILDFLAG(IS_BSD)
++#include <sys/types.h>
++#define MAJOR(dev) major(dev)
++#define MINOR(dev) minor(dev)
++#else
+ #include <linux/kdev_t.h> // For MAJOR()/MINOR().
++#endif
+ #include <sys/stat.h>
+ #include <string>
+
diff --git a/chromium-next/patches/patch-components_metrics_dwa_dwa__service.cc b/chromium-next/patches/patch-components_metrics_dwa_dwa__service.cc
new file mode 100644
index 0000000000..ca7bcbaefe
--- /dev/null
+++ b/chromium-next/patches/patch-components_metrics_dwa_dwa__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/metrics/dwa/dwa_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/metrics/dwa/dwa_service.cc
+@@ -161,7 +161,7 @@ void DwaService::RecordCoarseSystemInfor
+ coarse_system_info->set_platform(::dwa::CoarseSystemInfo::PLATFORM_WINDOWS);
+ #elif BUILDFLAG(IS_MAC)
+ coarse_system_info->set_platform(::dwa::CoarseSystemInfo::PLATFORM_MACOS);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ coarse_system_info->set_platform(::dwa::CoarseSystemInfo::PLATFORM_LINUX);
+ #elif BUILDFLAG(IS_ANDROID)
+ // TODO(b/366276323): Populate set_platform using more granular
diff --git a/chromium-next/patches/patch-components_metrics_metrics__log.cc b/chromium-next/patches/patch-components_metrics_metrics__log.cc
new file mode 100644
index 0000000000..c0dea704c9
--- /dev/null
+++ b/chromium-next/patches/patch-components_metrics_metrics__log.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/metrics/metrics_log.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/metrics/metrics_log.cc
+@@ -61,7 +61,7 @@
+ #include "base/win/current_module.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #include "base/nix/xdg_util.h"
+ #endif
+@@ -151,7 +151,7 @@ void RecordCurrentTime(
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ metrics::SystemProfileProto::OS::XdgSessionType ToProtoSessionType(
+ base::nix::SessionType session_type) {
+ switch (session_type) {
+@@ -418,7 +418,7 @@ void MetricsLog::RecordCoreSystemProfile
+ // OperatingSystemVersion refers to the ChromeOS release version.
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ os->set_kernel_version(base::SysInfo::KernelVersion());
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Linux operating system version is copied over into kernel version to be
+ // consistent.
+ os->set_kernel_version(base::SysInfo::OperatingSystemVersion());
+@@ -435,7 +435,7 @@ void MetricsLog::RecordCoreSystemProfile
+ os->set_build_number(base::SysInfo::GetIOSBuildNumber());
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<base::Environment> env = base::Environment::Create();
+ os->set_xdg_session_type(ToProtoSessionType(base::nix::GetSessionType(*env)));
+ os->set_xdg_current_desktop(
diff --git a/chromium-next/patches/patch-components_metrics_motherboard.cc b/chromium-next/patches/patch-components_metrics_motherboard.cc
new file mode 100644
index 0000000000..c64e1b0a0d
--- /dev/null
+++ b/chromium-next/patches/patch-components_metrics_motherboard.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/metrics/motherboard.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/metrics/motherboard.cc
+@@ -1,6 +1,7 @@
+ // Copyright 2022 The Chromium Authors
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
++// CHECK
+
+ #include "components/metrics/motherboard.h"
+
diff --git a/chromium-next/patches/patch-components_named__mojo__ipc__server_connection__info.h b/chromium-next/patches/patch-components_named__mojo__ipc__server_connection__info.h
new file mode 100644
index 0000000000..d3319a11b5
--- /dev/null
+++ b/chromium-next/patches/patch-components_named__mojo__ipc__server_connection__info.h
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/named_mojo_ipc_server/connection_info.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/named_mojo_ipc_server/connection_info.h
+@@ -12,8 +12,14 @@
+ #include "base/win/scoped_handle.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include <bsm/libbsm.h>
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include <sys/socket.h>
++#if defined(__NetBSD__)
++#include <sys/un.h>
++#define ucred unpcbid
++#define SO_PEERCRED LOCAL_PEEREID
++#define pid unp_pid
++#endif
+ #endif
+
+ namespace named_mojo_ipc_server {
+@@ -29,7 +35,7 @@ struct ConnectionInfo {
+ base::ProcessId pid{};
+ #if BUILDFLAG(IS_MAC)
+ audit_token_t audit_token{};
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ucred credentials{};
+ #endif
+ };
diff --git a/chromium-next/patches/patch-components_named__mojo__ipc__server_named__mojo__ipc__server__client__util.cc b/chromium-next/patches/patch-components_named__mojo__ipc__server_named__mojo__ipc__server__client__util.cc
new file mode 100644
index 0000000000..21c7da59a0
--- /dev/null
+++ b/chromium-next/patches/patch-components_named__mojo__ipc__server_named__mojo__ipc__server__client__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/named_mojo_ipc_server/named_mojo_ipc_server_client_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/named_mojo_ipc_server/named_mojo_ipc_server_client_util.cc
+@@ -23,7 +23,7 @@ namespace named_mojo_ipc_server {
+ // static
+ mojo::PlatformChannelEndpoint ConnectToServer(
+ const mojo::NamedPlatformChannel::ServerName& server_name) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return mojo::NamedPlatformChannel::ConnectToServer(server_name);
+ #elif BUILDFLAG(IS_MAC)
+ mojo::PlatformChannelEndpoint endpoint =
diff --git a/chromium-next/patches/patch-components_named__system__lock_lock.h b/chromium-next/patches/patch-components_named__system__lock_lock.h
new file mode 100644
index 0000000000..b83120c90a
--- /dev/null
+++ b/chromium-next/patches/patch-components_named__system__lock_lock.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/named_system_lock/lock.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/named_system_lock/lock.h
+@@ -38,7 +38,7 @@ class ScopedLock {
+ // may acquire that lock. The lock name has different meanings per platform:
+ // Linux: A shared memory object name starting with `/`. E.g. `/MyApp.lock`.
+ // Mac: A bootstrap service name (see `man bootstrap_check_in`).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ static std::unique_ptr<ScopedLock> Create(const std::string& name,
+ base::TimeDelta timeout);
+ #elif BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-components_neterror_resources_neterror.js b/chromium-next/patches/patch-components_neterror_resources_neterror.js
new file mode 100644
index 0000000000..a64401cb17
--- /dev/null
+++ b/chromium-next/patches/patch-components_neterror_resources_neterror.js
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/neterror/resources/neterror.js.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/neterror/resources/neterror.js
+@@ -142,7 +142,7 @@ function detailsButtonClick() {
+
+ let primaryControlOnLeft = true;
+ // clang-format off
+-// <if expr="is_macosx or is_ios or is_linux or is_chromeos or is_android">
++// <if expr="is_macosx or is_ios or is_posix or is_chromeos or is_android">
+ // clang-format on
+ primaryControlOnLeft = false;
+ // </if>
diff --git a/chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__features.cc b/chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__features.cc
new file mode 100644
index 0000000000..51722d733a
--- /dev/null
+++ b/chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/optimization_guide/core/optimization_guide_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/optimization_guide/core/optimization_guide_features.cc
+@@ -140,7 +140,7 @@ BASE_FEATURE(kOptimizationGuideModelExec
+ // Whether to use the on device model service in optimization guide.
+ BASE_FEATURE(kOptimizationGuideOnDeviceModel,
+ "OptimizationGuideOnDeviceModel",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT);
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__util.cc b/chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__util.cc
new file mode 100644
index 0000000000..f7827f8992
--- /dev/null
+++ b/chromium-next/patches/patch-components_optimization__guide_core_optimization__guide__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/optimization_guide/core/optimization_guide_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/optimization_guide/core/optimization_guide_util.cc
+@@ -37,7 +37,7 @@ optimization_guide::proto::Platform GetP
+ return optimization_guide::proto::PLATFORM_CHROMEOS;
+ #elif BUILDFLAG(IS_ANDROID)
+ return optimization_guide::proto::PLATFORM_ANDROID;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return optimization_guide::proto::PLATFORM_LINUX;
+ #else
+ return optimization_guide::proto::PLATFORM_UNDEFINED;
diff --git a/chromium-next/patches/patch-components_os__crypt_async_browser_secret__portal__key__provider.cc b/chromium-next/patches/patch-components_os__crypt_async_browser_secret__portal__key__provider.cc
new file mode 100644
index 0000000000..e279bf17dd
--- /dev/null
+++ b/chromium-next/patches/patch-components_os__crypt_async_browser_secret__portal__key__provider.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/os_crypt/async/browser/secret_portal_key_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/os_crypt/async/browser/secret_portal_key_provider.cc
+@@ -5,7 +5,9 @@
+ #include "components/os_crypt/async/browser/secret_portal_key_provider.h"
+
+ #include <fcntl.h>
++#if BUILDFLAG(IS_LINUX)
+ #include <linux/limits.h>
++#endif
+
+ #include <array>
+ #include <utility>
diff --git a/chromium-next/patches/patch-components_os__crypt_async_common_encryptor.cc b/chromium-next/patches/patch-components_os__crypt_async_common_encryptor.cc
new file mode 100644
index 0000000000..536ce08d82
--- /dev/null
+++ b/chromium-next/patches/patch-components_os__crypt_async_common_encryptor.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/os_crypt/async/common/encryptor.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/os_crypt/async/common/encryptor.cc
+@@ -277,7 +277,7 @@ std::optional<std::string> Encryptor::De
+ // or not encryption worked or not, and certainly not advisable to recommend
+ // a re-encryption of this potentially invalid data.
+ // TODO(crbug.com/365712505): Remove this fallback.
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && \
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD) && \
+ !(BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || \
+ BUILDFLAG(IS_FUCHSIA)
+ if (plaintext == string_data) {
diff --git a/chromium-next/patches/patch-components_os__crypt_sync_libsecret__util__linux.cc b/chromium-next/patches/patch-components_os__crypt_sync_libsecret__util__linux.cc
new file mode 100644
index 0000000000..c1ae293e2b
--- /dev/null
+++ b/chromium-next/patches/patch-components_os__crypt_sync_libsecret__util__linux.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/os_crypt/sync/libsecret_util_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/os_crypt/sync/libsecret_util_linux.cc
+@@ -185,16 +185,22 @@ bool LibsecretLoader::EnsureLibsecretLoa
+
+ // static
+ bool LibsecretLoader::LoadLibsecret() {
++#if BUILDFLAG(IS_BSD)
++ const char* kSecretLib = "libsecret-1.so";
++#else
++ const char* kSecretLib = "libsecret-1.so.0";
++#endif
++
+ if (libsecret_loaded_)
+ return true;
+
+- static void* handle = dlopen("libsecret-1.so.0", RTLD_NOW | RTLD_GLOBAL);
++ static void* handle = dlopen(kSecretLib, RTLD_NOW | RTLD_GLOBAL);
+ if (!handle) {
+ // We wanted to use libsecret, but we couldn't load it. Warn, because
+ // either the user asked for this, or we autodetected it incorrectly. (Or
+ // the system has broken libraries, which is also good to warn about.)
+ // TODO(crbug.com/40467093): Channel this message to the user-facing log
+- VLOG(1) << "Could not load libsecret-1.so.0: " << dlerror();
++ VLOG(1) << "Could not load " << kSecretLib << ": " << dlerror();
+ return false;
+ }
+
diff --git a/chromium-next/patches/patch-components_os__crypt_sync_os__crypt.h b/chromium-next/patches/patch-components_os__crypt_sync_os__crypt.h
new file mode 100644
index 0000000000..8234f63078
--- /dev/null
+++ b/chromium-next/patches/patch-components_os__crypt_sync_os__crypt.h
@@ -0,0 +1,78 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/os_crypt/sync/os_crypt.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/os_crypt/sync/os_crypt.h
+@@ -14,7 +14,7 @@
+ #include "build/build_config.h"
+ #include "build/chromecast_buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class KeyStorageLinux;
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -23,7 +23,7 @@ class PrefRegistrySimple;
+ class PrefService;
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ namespace crypto {
+ class SymmetricKey;
+ }
+@@ -36,7 +36,7 @@ struct Config;
+ // Temporary interface due to OSCrypt refactor. See OSCryptImpl for descriptions
+ // of what each function does.
+ namespace OSCrypt {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(OS_CRYPT)
+ void SetConfig(std::unique_ptr<os_crypt::Config> config);
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -81,7 +81,7 @@ COMPONENT_EXPORT(OS_CRYPT) void UseMockK
+ COMPONENT_EXPORT(OS_CRYPT) void SetLegacyEncryptionForTesting(bool legacy);
+ COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting();
+ #endif // BUILDFLAG(IS_WIN)
+-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS))
++#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(OS_CRYPT)
+ void UseMockKeyStorageForTesting(
+ base::OnceCallback<std::unique_ptr<KeyStorageLinux>()>
+@@ -108,7 +108,7 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCrypt
+ // Returns singleton instance of OSCryptImpl.
+ static OSCryptImpl* GetInstance();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Set the configuration of OSCryptImpl.
+ // This method, or SetRawEncryptionKey(), must be called before using
+ // EncryptString() and DecryptString().
+@@ -200,7 +200,7 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCrypt
+ void ResetStateForTesting();
+ #endif
+
+-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS))
++#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD)
+ // For unit testing purposes, inject methods to be used.
+ // |storage_provider_factory| provides the desired |KeyStorage|
+ // implementation. If the provider returns |nullptr|, a hardcoded password
+@@ -225,13 +225,13 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCrypt
+ crypto::SymmetricKey* GetEncryptionKey();
+ #endif // BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // This lock is used to make the GetEncryptionKey and
+ // GetRawEncryptionKey methods thread-safe.
+ static base::Lock& GetLock();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Returns a cached string of "peanuts". Is thread-safe.
+ crypto::SymmetricKey* GetPasswordV10();
+
diff --git a/chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client.cc b/chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client.cc
new file mode 100644
index 0000000000..18c8d5417e
--- /dev/null
+++ b/chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/paint_preview/browser/paint_preview_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/paint_preview/browser/paint_preview_client.cc
+@@ -326,8 +326,8 @@ void PaintPreviewClient::CapturePaintPre
+ metadata->set_version(kPaintPreviewVersion);
+ auto* chromeVersion = metadata->mutable_chrome_version();
+ const auto& current_chrome_version = version_info::GetVersion();
+- chromeVersion->set_major(current_chrome_version.components()[0]);
+- chromeVersion->set_minor(current_chrome_version.components()[1]);
++ chromeVersion->set_gmajor(current_chrome_version.components()[0]);
++ chromeVersion->set_gminor(current_chrome_version.components()[1]);
+ chromeVersion->set_build(current_chrome_version.components()[2]);
+ chromeVersion->set_patch(current_chrome_version.components()[3]);
+ document_data.callback = std::move(callback);
diff --git a/chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client__unittest.cc b/chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client__unittest.cc
new file mode 100644
index 0000000000..d83d0ce20f
--- /dev/null
+++ b/chromium-next/patches/patch-components_paint__preview_browser_paint__preview__client__unittest.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/paint_preview/browser/paint_preview_client_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/paint_preview/browser/paint_preview_client_unittest.cc
+@@ -174,8 +174,8 @@ TEST_P(PaintPreviewClientRenderViewHostT
+ metadata->set_version(kPaintPreviewVersion);
+ auto* chromeVersion = metadata->mutable_chrome_version();
+ const auto& current_chrome_version = version_info::GetVersion();
+- chromeVersion->set_major(current_chrome_version.components()[0]);
+- chromeVersion->set_minor(current_chrome_version.components()[1]);
++ chromeVersion->set_gmajor(current_chrome_version.components()[0]);
++ chromeVersion->set_gminor(current_chrome_version.components()[1]);
+ chromeVersion->set_build(current_chrome_version.components()[2]);
+ chromeVersion->set_patch(current_chrome_version.components()[3]);
+ PaintPreviewFrameProto* main_frame = expected_proto.mutable_root_frame();
diff --git a/chromium-next/patches/patch-components_paint__preview_common_proto_paint__preview.proto b/chromium-next/patches/patch-components_paint__preview_common_proto_paint__preview.proto
new file mode 100644
index 0000000000..00d3fbca36
--- /dev/null
+++ b/chromium-next/patches/patch-components_paint__preview_common_proto_paint__preview.proto
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/paint_preview/common/proto/paint_preview.proto.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/paint_preview/common/proto/paint_preview.proto
+@@ -82,8 +82,8 @@ message PaintPreviewFrameProto {
+ // Stores Chrome version.
+ // NEXT_TAG = 5
+ message ChromeVersionProto {
+- optional uint64 major = 1;
+- optional uint64 minor = 2;
++ optional uint64 gmajor = 1;
++ optional uint64 gminor = 2;
+ optional uint64 build = 3;
+ optional uint64 patch = 4;
+ }
diff --git a/chromium-next/patches/patch-components_paint__preview_player_player__compositor__delegate.cc b/chromium-next/patches/patch-components_paint__preview_player_player__compositor__delegate.cc
new file mode 100644
index 0000000000..f683c102a7
--- /dev/null
+++ b/chromium-next/patches/patch-components_paint__preview_player_player__compositor__delegate.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/paint_preview/player/player_compositor_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/paint_preview/player/player_compositor_delegate.cc
+@@ -434,8 +434,8 @@ void PlayerCompositorDelegate::ValidateP
+ auto chrome_version = capture_result_->proto.metadata().chrome_version();
+ const auto& current_chrome_version = version_info::GetVersion();
+ if (capture_result_->proto.metadata().has_chrome_version() &&
+- chrome_version.major() == current_chrome_version.components()[0] &&
+- chrome_version.minor() == current_chrome_version.components()[1] &&
++ chrome_version.gmajor() == current_chrome_version.components()[0] &&
++ chrome_version.gminor() == current_chrome_version.components()[1] &&
+ chrome_version.build() == current_chrome_version.components()[2] &&
+ chrome_version.patch() == current_chrome_version.components()[3]) {
+ paint_preview_service_->GetFileMixin()->GetAXTreeUpdate(
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.cc b/chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.cc
new file mode 100644
index 0000000000..42a3388eb7
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/features/password_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/features/password_features.cc
+@@ -35,7 +35,7 @@ BASE_FEATURE(kClearUndecryptablePassword
+ BASE_FEATURE(kClearUndecryptablePasswordsOnSync,
+ "ClearUndecryptablePasswordsInSync",
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_IOS) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -109,7 +109,7 @@ BASE_FEATURE(kReuseDetectionBasedOnPassw
+ "ReuseDetectionBasedOnPasswordHashes",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kRestartToGainAccessToKeychain,
+ "RestartToGainAccessToKeychain",
+ #if BUILDFLAG(IS_MAC)
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.h b/chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.h
new file mode 100644
index 0000000000..7020d38b55
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_features_password__features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/features/password_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/features/password_features.h
+@@ -110,7 +110,7 @@ BASE_DECLARE_FEATURE(kPasswordManualFall
+ // Detects password reuse based on hashed password values.
+ BASE_DECLARE_FEATURE(kReuseDetectionBasedOnPasswordHashes);
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enables "Needs access to keychain, restart chrome" bubble and banner.
+ BASE_DECLARE_FEATURE(kRestartToGainAccessToKeychain);
+ #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__form__manager.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__form__manager.cc
new file mode 100644
index 0000000000..c44bffac6d
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__form__manager.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_form_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_form_manager.cc
+@@ -61,7 +61,7 @@
+ #include "components/webauthn/android/webauthn_cred_man_delegate.h"
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "components/os_crypt/sync/os_crypt.h"
+ #endif
+
+@@ -233,7 +233,7 @@ bool ShouldUploadCrowdsourcingVotes(cons
+ return false;
+ }
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool ShouldShowKeychainErrorBubble(
+ std::optional<PasswordStoreBackendError> backend_error) {
+ if (!backend_error.has_value()) {
+@@ -892,7 +892,7 @@ void PasswordFormManager::OnFetchComplet
+ error.value().type);
+ }
+
+-#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (ShouldShowKeychainErrorBubble(
+ form_fetcher_->GetProfileStoreBackendError())) {
+ client_->NotifyKeychainError();
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__manager.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager.cc
new file mode 100644
index 0000000000..0d251b2662
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_manager.cc
+@@ -418,7 +418,7 @@ void PasswordManager::RegisterProfilePre
+ prefs::kAutofillableCredentialsAccountStoreLoginDatabase, false);
+ #endif // BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+ registry->RegisterBooleanPref(prefs::kPasswordSharingEnabled, true);
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ registry->RegisterIntegerPref(prefs::kRelaunchChromeBubbleDismissedCounter,
+ 0);
+ #endif
+@@ -431,7 +431,7 @@ void PasswordManager::RegisterProfilePre
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_IOS)
++ BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kDeletingUndecryptablePasswordsEnabled,
+ true);
+ #endif
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__client.h b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__client.h
new file mode 100644
index 0000000000..497f12f7be
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__client.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_manager_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_manager_client.h
+@@ -30,7 +30,7 @@
+ #include "net/cert/cert_status_flags.h"
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/i18n/rtl.h"
+ #include "components/password_manager/core/browser/password_cross_domain_confirmation_popup_controller.h"
+ #include "ui/gfx/geometry/rect_f.h"
+@@ -551,7 +551,7 @@ class PasswordManagerClient {
+ CredentialsCallback callback);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Shows the bubble with the details of the `form`.
+ virtual void OpenPasswordDetailsBubble(
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.cc
new file mode 100644
index 0000000000..cea29830e5
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_manager_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_manager_switches.cc
+@@ -6,7 +6,7 @@
+
+ namespace password_manager {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Specifies which encryption storage backend to use. Possible values are
+ // kwallet, kwallet5, kwallet6, gnome-libsecret, basic.
+ // Any other value will lead to Chrome detecting the best backend automatically.
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.h b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.h
new file mode 100644
index 0000000000..39abaf8dee
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__manager__switches.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_manager_switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_manager_switches.h
+@@ -10,7 +10,7 @@
+
+ namespace password_manager {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extern const char kPasswordStore[];
+ extern const char kEnableEncryptionSelection[];
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.cc
new file mode 100644
index 0000000000..5940274ec7
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_manual_fallback_flow.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_manual_fallback_flow.cc
+@@ -44,7 +44,7 @@ std::u16string GetUsernameFromLabel(cons
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Returns the password form corresponding to the `payload` data. In most
+ // cases there is only one such form stored, but having more than one or no
+ // forms is also possible. If there is more than one form, showing any of them
+@@ -293,7 +293,7 @@ void PasswordManualFallbackFlow::DidAcce
+ }
+ case autofill::SuggestionType::kViewPasswordDetails: {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::optional<password_manager::PasswordForm> credentials =
+ GetCorrespondingPasswordForm(
+ suggestion.GetPayload<Suggestion::PasswordSuggestionDetails>(),
+@@ -428,7 +428,7 @@ void PasswordManualFallbackFlow::EnsureC
+ const Suggestion::PasswordSuggestionDetails& payload,
+ base::OnceClosure on_allowed) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (payload.is_cross_domain) {
+ cross_domain_confirmation_popup_controller_ =
+ password_client_->ShowCrossDomainConfirmationPopup(
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.h b/chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.h
new file mode 100644
index 0000000000..07d0eb6c6c
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__manual__fallback__flow.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_manual_fallback_flow.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_manual_fallback_flow.h
+@@ -17,7 +17,7 @@
+ #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h"
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/password_manager/core/browser/password_cross_domain_confirmation_popup_controller.h"
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) ||
+ // BUILDFLAG(IS_CHROMEOS)
+@@ -178,7 +178,7 @@ class PasswordManualFallbackFlow : publi
+ std::unique_ptr<device_reauth::DeviceAuthenticator> authenticator_;
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<PasswordCrossDomainConfirmationPopupController>
+ cross_domain_confirmation_popup_controller_;
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) ||
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__store__factory__util.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__store__factory__util.cc
new file mode 100644
index 0000000000..673120a001
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__store__factory__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_store_factory_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_store_factory_util.cc
+@@ -29,7 +29,7 @@ namespace {
+ LoginDatabase::DeletingUndecryptablePasswordsEnabled GetPolicyFromPrefs(
+ PrefService* prefs) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_IOS)
++ BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ return LoginDatabase::DeletingUndecryptablePasswordsEnabled(
+ prefs->GetBoolean(prefs::kDeletingUndecryptablePasswordsEnabled));
+ #else
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database.cc
new file mode 100644
index 0000000000..0c7e7acd40
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_store/login_database.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_store/login_database.cc
+@@ -1030,7 +1030,7 @@ bool ShouldDeleteUndecryptablePasswords(
+ bool is_user_data_dir_policy_set,
+ bool is_enabled_by_policy,
+ IsAccountStore is_account_store) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string user_data_dir_string;
+ std::unique_ptr<base::Environment> environment(base::Environment::Create());
+ // On Linux user data directory ca be specified using an env variable. If it
+@@ -1049,7 +1049,7 @@ bool ShouldDeleteUndecryptablePasswords(
+ return false;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (command_line->HasSwitch(password_manager::kPasswordStore)) {
+ RecordShouldDeleteUndecryptablePasswordsMetric(
+ ShouldDeleteUndecryptablePasswordsResult::
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__async__helper.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__async__helper.cc
new file mode 100644
index 0000000000..fdd7562759
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__async__helper.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_store/login_database_async_helper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_store/login_database_async_helper.cc
+@@ -154,7 +154,7 @@ LoginsResultOrError LoginDatabaseAsyncHe
+ std::vector<PasswordForm> matched_forms;
+ if (!login_db_ ||
+ !login_db_->GetLogins(form, include_psl, &matched_forms)) {
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return PasswordStoreBackendError(
+ OSCrypt::IsEncryptionAvailable()
+ ? PasswordStoreBackendErrorType::kUncategorized
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__unittest.cc b/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__unittest.cc
new file mode 100644
index 0000000000..bdf175b681
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_password__store_login__database__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/password_store/login_database_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/password_store/login_database_unittest.cc
+@@ -2253,7 +2253,7 @@ INSTANTIATE_TEST_SUITE_P(MigrationToVCur
+ testing::Bool()));
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_IOS) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ class LoginDatabaseUndecryptableLoginsTest : public testing::Test {
+ protected:
+ LoginDatabaseUndecryptableLoginsTest() = default;
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.cc b/chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.cc
new file mode 100644
index 0000000000..b84a3f5ba5
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/stub_password_manager_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/stub_password_manager_client.cc
+@@ -190,7 +190,7 @@ version_info::Channel StubPasswordManage
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void StubPasswordManagerClient::OpenPasswordDetailsBubble(
+ const password_manager::PasswordForm& form) {}
+
diff --git a/chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.h b/chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.h
new file mode 100644
index 0000000000..3743a813ef
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_browser_stub__password__manager__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/browser/stub_password_manager_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/browser/stub_password_manager_client.h
+@@ -75,7 +75,7 @@ class StubPasswordManagerClient : public
+ MockPasswordFeatureManager* GetPasswordFeatureManager();
+ version_info::Channel GetChannel() const override;
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void OpenPasswordDetailsBubble(
+ const password_manager::PasswordForm& form) override;
+ std::unique_ptr<
diff --git a/chromium-next/patches/patch-components_password__manager_core_common_password__manager__pref__names.h b/chromium-next/patches/patch-components_password__manager_core_common_password__manager__pref__names.h
new file mode 100644
index 0000000000..17d5a8a3b7
--- /dev/null
+++ b/chromium-next/patches/patch-components_password__manager_core_common_password__manager__pref__names.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/password_manager/core/common/password_manager_pref_names.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/password_manager/core/common/password_manager_pref_names.h
+@@ -50,7 +50,7 @@ inline constexpr char kCredentialProvide
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_IOS)
++ BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ // Boolean pref controlled by the DeletingUndecryptablePasswordsEnabled policy.
+ // If set to false it blocks deleting undecryptable passwords, otherwise the
+ // deletion can happen.
+@@ -343,7 +343,7 @@ inline constexpr char kAutofillableCrede
+ inline constexpr char kPasswordSharingEnabled[] =
+ "password_manager.password_sharing_enabled";
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Integer pref indicating how many times relaunch Chrome bubble was dismissed.
+ inline constexpr char kRelaunchChromeBubbleDismissedCounter[] =
+ "password_manager.relaunch_chrome_bubble_dismissed_counter";
diff --git a/chromium-next/patches/patch-components_performance__manager_decorators_process__metrics__decorator.cc b/chromium-next/patches/patch-components_performance__manager_decorators_process__metrics__decorator.cc
new file mode 100644
index 0000000000..6aeb3e9d41
--- /dev/null
+++ b/chromium-next/patches/patch-components_performance__manager_decorators_process__metrics__decorator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/performance_manager/decorators/process_metrics_decorator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/performance_manager/decorators/process_metrics_decorator.cc
+@@ -264,7 +264,7 @@ void ProcessMetricsDecorator::DidGetMemo
+ // RSS and PMF to each node proportionally to its V8 heap size.
+ uint64_t process_rss = process_dump_iter.os_dump().resident_set_kb;
+ process_node->set_resident_set_kb(process_rss);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ process_node->set_private_swap_kb(
+ process_dump_iter.os_dump().private_footprint_swap_kb);
+ #endif
diff --git a/chromium-next/patches/patch-components_performance__manager_public_features.h b/chromium-next/patches/patch-components_performance__manager_public_features.h
new file mode 100644
index 0000000000..3c3b58cbd4
--- /dev/null
+++ b/chromium-next/patches/patch-components_performance__manager_public_features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/performance_manager/public/features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/performance_manager/public/features.h
+@@ -21,7 +21,7 @@ BASE_DECLARE_FEATURE(kRunOnMainThreadSyn
+
+ #if !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define URGENT_DISCARDING_FROM_PERFORMANCE_MANAGER() false
+ #else
+ #define URGENT_DISCARDING_FROM_PERFORMANCE_MANAGER() true
diff --git a/chromium-next/patches/patch-components_permissions_prediction__service_prediction__common.cc b/chromium-next/patches/patch-components_permissions_prediction__service_prediction__common.cc
new file mode 100644
index 0000000000..e52706f3b2
--- /dev/null
+++ b/chromium-next/patches/patch-components_permissions_prediction__service_prediction__common.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/permissions/prediction_service/prediction_common.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/permissions/prediction_service/prediction_common.cc
+@@ -33,7 +33,7 @@ int BucketizeValue(int count) {
+
+ ClientFeatures_Platform GetCurrentPlatformProto() {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return permissions::ClientFeatures_Platform_PLATFORM_DESKTOP;
+ #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
+ return permissions::ClientFeatures_Platform_PLATFORM_MOBILE;
+@@ -44,7 +44,7 @@ ClientFeatures_Platform GetCurrentPlatfo
+
+ ClientFeatures_PlatformEnum GetCurrentPlatformEnumProto() {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return permissions::ClientFeatures_PlatformEnum_PLATFORM_DESKTOP_V2;
+ #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
+ return permissions::ClientFeatures_PlatformEnum_PLATFORM_MOBILE_V2;
diff --git a/chromium-next/patches/patch-components_policy_core_browser_policy__pref__mapping__test.cc b/chromium-next/patches/patch-components_policy_core_browser_policy__pref__mapping__test.cc
new file mode 100644
index 0000000000..6cd4b551c0
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_browser_policy__pref__mapping__test.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/browser/policy_pref_mapping_test.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/browser/policy_pref_mapping_test.cc
+@@ -411,7 +411,7 @@ class PolicyTestCase {
+ const std::string os("chromeos_lacros");
+ #elif BUILDFLAG(IS_IOS)
+ const std::string os("ios");
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const std::string os("linux");
+ #elif BUILDFLAG(IS_MAC)
+ const std::string os("mac");
diff --git a/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__client.cc b/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__client.cc
new file mode 100644
index 0000000000..8c6ac6f01f
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/common/cloud/cloud_policy_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/common/cloud/cloud_policy_client.cc
+@@ -738,7 +738,7 @@ void CloudPolicyClient::FetchPolicy(Poli
+ fetch_request->set_invalidation_payload(invalidation_payload_);
+ }
+ }
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Only set browser device identifier for CBCM Chrome cloud policy on
+ // desktop.
+ if (type_to_fetch.first ==
diff --git a/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__refresh__scheduler.cc b/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__refresh__scheduler.cc
new file mode 100644
index 0000000000..987b13c53d
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__refresh__scheduler.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
+@@ -25,7 +25,7 @@ namespace policy {
+
+ namespace {
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kRetryWithKeyReset,
+ "RetryWithKeyReset",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+@@ -220,7 +220,7 @@ void CloudPolicyRefreshScheduler::OnStor
+ // continue using the stale information. Thus, no specific response to a store
+ // error is required. NB: Changes to is_managed fire OnStoreLoaded().
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Client is registered means we have successfully get policy key once. However,
+ // a following policy fetch request is failed because we can't verified
+ // signature. Delete the policy key so that we can get it again with next
diff --git a/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__util.cc b/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__util.cc
new file mode 100644
index 0000000000..9c0d1bb1ee
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_common_cloud_cloud__policy__util.cc
@@ -0,0 +1,61 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/common/cloud/cloud_policy_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/common/cloud/cloud_policy_util.cc
+@@ -20,7 +20,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
+- BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include <pwd.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -35,10 +35,15 @@
+ #import <SystemConfiguration/SCDynamicStoreCopySpecific.h>
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include <limits.h> // For HOST_NAME_MAX
+ #endif
+
++#if BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
++#include <sys/param.h>
++#define HOST_NAME_MAX MAXHOSTNAMELEN
++#endif
++
+ #include <algorithm>
+ #include <utility>
+
+@@ -88,7 +93,7 @@ namespace em = enterprise_management;
+
+ std::string GetMachineName() {
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ char hostname[HOST_NAME_MAX];
+ if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success.
+ return hostname;
+@@ -144,7 +149,7 @@ std::string GetMachineName() {
+
+ std::string GetOSVersion() {
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ return base::SysInfo::OperatingSystemVersion();
+ #elif BUILDFLAG(IS_WIN)
+ base::win::OSInfo::VersionNumber version_number =
+@@ -167,7 +172,7 @@ std::string GetOSArchitecture() {
+ }
+
+ std::string GetOSUsername() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ struct passwd* creds = getpwuid(getuid());
+ if (!creds || !creds->pw_name)
+ return std::string();
diff --git a/chromium-next/patches/patch-components_policy_core_common_policy__loader__common.cc b/chromium-next/patches/patch-components_policy_core_common_policy__loader__common.cc
new file mode 100644
index 0000000000..712deab355
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_common_policy__loader__common.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/common/policy_loader_common.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/common/policy_loader_common.cc
+@@ -46,7 +46,7 @@ const char* kSensitivePolicies[] = {
+ key::kDefaultSearchProviderEnabled,
+ key::kSafeBrowsingEnabled,
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ key::kAutoOpenFileTypes,
+ key::kEnterpriseSearchAggregatorSettings,
+ key::kHomepageIsNewTabPage,
+@@ -57,7 +57,7 @@ const char* kSensitivePolicies[] = {
+ key::kSafeBrowsingAllowlistDomains,
+ key::kSiteSearchSettings,
+ #endif
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ key::kCommandLineFlagSecurityWarningsEnabled,
+ #endif
+ #if !BUILDFLAG(IS_IOS)
diff --git a/chromium-next/patches/patch-components_policy_core_common_policy__paths.cc b/chromium-next/patches/patch-components_policy_core_common_policy__paths.cc
new file mode 100644
index 0000000000..78ed751c0e
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_common_policy__paths.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/common/policy_paths.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/common/policy_paths.cc
+@@ -17,6 +17,10 @@ namespace policy {
+ const char kPolicyPath[] = "/etc/opt/chrome/policies";
+ #elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
+ const char kPolicyPath[] = "/etc/opt/chrome_for_testing/policies";
++#elif BUILDFLAG(IS_FREEBSD)
++const char kPolicyPath[] = "/usr/local/etc/chromium/policies";
++#elif BUILDFLAG(IS_NETBSD)
++const char kPolicyPath[] = "@PKG_SYSCONFBASE@/chromium/policies";
+ #else
+ const char kPolicyPath[] = "/etc/chromium/policies";
+ #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
diff --git a/chromium-next/patches/patch-components_policy_core_common_policy__utils.cc b/chromium-next/patches/patch-components_policy_core_common_policy__utils.cc
new file mode 100644
index 0000000000..0179f5d5c9
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_core_common_policy__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/core/common/policy_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/core/common/policy_utils.cc
+@@ -22,7 +22,7 @@ bool IsPolicyTestingEnabled(PrefService*
+ return true;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_IOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ if (channel == version_info::Channel::DEV) {
+ return true;
+ }
diff --git a/chromium-next/patches/patch-components_policy_tools_generate__policy__source.py b/chromium-next/patches/patch-components_policy_tools_generate__policy__source.py
new file mode 100644
index 0000000000..5cb2a128f6
--- /dev/null
+++ b/chromium-next/patches/patch-components_policy_tools_generate__policy__source.py
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/policy/tools/generate_policy_source.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/policy/tools/generate_policy_source.py
+@@ -38,9 +38,9 @@ PLATFORM_STRINGS = {
+ 'ios': ['ios'],
+ 'fuchsia': ['fuchsia'],
+ 'chrome.win': ['win'],
+- 'chrome.linux': ['linux'],
++ 'chrome.linux': ['linux', 'openbsd', 'freebsd', 'netbsd'],
+ 'chrome.mac': ['mac'],
+- 'chrome.*': ['win', 'mac', 'linux'],
++ 'chrome.*': ['win', 'mac', 'linux', 'openbsd', 'freebsd', 'netbsd'],
+ 'chrome.win7': ['win'],
+ }
+
diff --git a/chromium-next/patches/patch-components_power__metrics_BUILD.gn b/chromium-next/patches/patch-components_power__metrics_BUILD.gn
new file mode 100644
index 0000000000..57dc04e7f2
--- /dev/null
+++ b/chromium-next/patches/patch-components_power__metrics_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/power_metrics/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/power_metrics/BUILD.gn
+@@ -41,7 +41,7 @@ static_library("power_metrics") {
+ ldflags = [ "/DELAYLOAD:setupapi.dll" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux && !is_bsd) || is_chromeos) {
+ sources += [
+ "energy_metrics_provider_linux.cc",
+ "energy_metrics_provider_linux.h",
diff --git a/chromium-next/patches/patch-components_power__metrics_energy__metrics__provider.cc b/chromium-next/patches/patch-components_power__metrics_energy__metrics__provider.cc
new file mode 100644
index 0000000000..3da6cec7ba
--- /dev/null
+++ b/chromium-next/patches/patch-components_power__metrics_energy__metrics__provider.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/power_metrics/energy_metrics_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/power_metrics/energy_metrics_provider.cc
+@@ -9,6 +9,8 @@
+ #include "components/power_metrics/energy_metrics_provider_win.h"
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ #include "components/power_metrics/energy_metrics_provider_linux.h"
++#elif BUILDFLAG(IS_BSD)
++#include "base/notreached.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+ namespace power_metrics {
+@@ -22,6 +24,9 @@ std::unique_ptr<EnergyMetricsProvider> E
+ return EnergyMetricsProviderWin::Create();
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ return EnergyMetricsProviderLinux::Create();
++#elif BUILDFLAG(IS_BSD)
++ NOTIMPLEMENTED();
++ return nullptr;
+ #else
+ return nullptr;
+ #endif // BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc b/chromium-next/patches/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc
new file mode 100644
index 0000000000..e7e54aeec3
--- /dev/null
+++ b/chromium-next/patches/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/safe_browsing/content/common/file_type_policies_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/safe_browsing/content/common/file_type_policies_unittest.cc
+@@ -148,7 +148,7 @@ TEST_F(FileTypePoliciesTest, UnpackResou
+ EXPECT_EQ(DownloadFileType::FULL_PING, file_type.ping_setting());
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ EXPECT_EQ(DownloadFileType::ALLOW_ON_USER_GESTURE,
+ file_type.platform_settings(0).danger_level());
+ EXPECT_EQ(DownloadFileType::DISALLOW_AUTO_OPEN,
diff --git a/chromium-next/patches/patch-components_safe__browsing_content_resources_gen__file__type__proto.py b/chromium-next/patches/patch-components_safe__browsing_content_resources_gen__file__type__proto.py
new file mode 100644
index 0000000000..7d8cc0d561
--- /dev/null
+++ b/chromium-next/patches/patch-components_safe__browsing_content_resources_gen__file__type__proto.py
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/safe_browsing/content/resources/gen_file_type_proto.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/safe_browsing/content/resources/gen_file_type_proto.py
+@@ -37,6 +37,9 @@ def PlatformTypes():
+ "chromeos":
+ download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_CHROME_OS,
+ "linux": download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_LINUX,
++ "openbsd": download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_LINUX,
++ "freebsd": download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_LINUX,
++ "netbsd": download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_LINUX,
+ "mac": download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_MAC,
+ "win": download_file_types_pb2.DownloadFileType.PLATFORM_TYPE_WINDOWS,
+ # LINT.ThenChange(BUILD.gn:PlatformTypes)
+@@ -179,7 +182,7 @@ class DownloadFileTypeProtoGenerator(Bin
+ '-t',
+ '--type',
+ help='The platform type. One of android, chromeos, ' +
+- 'linux, mac, win')
++ 'linux, mac, win, openbsd, freebsd, netbsd')
+
+ def AddExtraCommandLineArgsForVirtualEnvRun(self, opts, command):
+ if opts.type is not None:
diff --git a/chromium-next/patches/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc b/chromium-next/patches/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc
new file mode 100644
index 0000000000..4f42ac6613
--- /dev/null
+++ b/chromium-next/patches/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc
+@@ -119,7 +119,7 @@ std::ostream& operator<<(std::ostream& o
+ PlatformType GetCurrentPlatformType() {
+ #if BUILDFLAG(IS_WIN)
+ return WINDOWS_PLATFORM;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return LINUX_PLATFORM;
+ #elif BUILDFLAG(IS_IOS)
+ return IOS_PLATFORM;
diff --git a/chromium-next/patches/patch-components_safe__browsing_core_browser_realtime_url__lookup__service__base.cc b/chromium-next/patches/patch-components_safe__browsing_core_browser_realtime_url__lookup__service__base.cc
new file mode 100644
index 0000000000..46faf7377b
--- /dev/null
+++ b/chromium-next/patches/patch-components_safe__browsing_core_browser_realtime_url__lookup__service__base.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/safe_browsing/core/browser/realtime/url_lookup_service_base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/safe_browsing/core/browser/realtime/url_lookup_service_base.cc
+@@ -110,7 +110,7 @@ RTLookupRequest::OSType GetRTLookupReque
+ return RTLookupRequest::OS_TYPE_CHROME_OS;
+ #elif BUILDFLAG(IS_IOS)
+ return RTLookupRequest::OS_TYPE_IOS;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return RTLookupRequest::OS_TYPE_LINUX;
+ #elif BUILDFLAG(IS_MAC)
+ return RTLookupRequest::OS_TYPE_MAC;
diff --git a/chromium-next/patches/patch-components_safe__browsing_core_common_features.cc b/chromium-next/patches/patch-components_safe__browsing_core_common_features.cc
new file mode 100644
index 0000000000..8da555d82f
--- /dev/null
+++ b/chromium-next/patches/patch-components_safe__browsing_core_common_features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/safe_browsing/core/common/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/safe_browsing/core/common/features.cc
+@@ -256,7 +256,7 @@ constexpr base::FeatureParam<std::string
+ BASE_FEATURE(kSafeBrowsingAsyncRealTimeCheck,
+ "SafeBrowsingAsyncRealTimeCheck",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-components_search__engines_search__engine__choice_search__engine__choice__service.cc b/chromium-next/patches/patch-components_search__engines_search__engine__choice_search__engine__choice__service.cc
new file mode 100644
index 0000000000..c2da668cb3
--- /dev/null
+++ b/chromium-next/patches/patch-components_search__engines_search__engine__choice_search__engine__choice__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/search_engines/search_engine_choice/search_engine_choice_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/search_engines/search_engine_choice/search_engine_choice_service.cc
+@@ -614,7 +614,7 @@ void SearchEngineChoiceService::Register
+
+ int SearchEngineChoiceService::GetCountryIdInternal() {
+ // `country_codes::kCountryIDAtInstall` may not be set yet.
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Android, ChromeOS and Linux, `country_codes::kCountryIDAtInstall` is
+ // computed asynchronously using platform-specific signals, and may not be
+ // available yet.
diff --git a/chromium-next/patches/patch-components_search__engines_template__url__service.cc b/chromium-next/patches/patch-components_search__engines_template__url__service.cc
new file mode 100644
index 0000000000..8b241c96a0
--- /dev/null
+++ b/chromium-next/patches/patch-components_search__engines_template__url__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/search_engines/template_url_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/search_engines/template_url_service.cc
+@@ -3062,7 +3062,7 @@ bool TemplateURLService::MatchesDefaultS
+ std::unique_ptr<EnterpriseSearchManager>
+ TemplateURLService::GetEnterpriseSearchManager(PrefService* prefs) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<EnterpriseSearchManager>(
+ prefs,
+ base::BindRepeating(&TemplateURLService::EnterpriseSiteSearchChanged,
diff --git a/chromium-next/patches/patch-components_security__interstitials_content_utils.cc b/chromium-next/patches/patch-components_security__interstitials_content_utils.cc
new file mode 100644
index 0000000000..a73d88bd02
--- /dev/null
+++ b/chromium-next/patches/patch-components_security__interstitials_content_utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/security_interstitials/content/utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/security_interstitials/content/utils.cc
+@@ -38,7 +38,7 @@ void LaunchDateAndTimeSettings() {
+ #if BUILDFLAG(IS_ANDROID)
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_DateAndTimeSettingsHelper_openDateAndTimeSettings(env);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ struct ClockCommand {
+ const char* const pathname;
+ const char* const argument;
diff --git a/chromium-next/patches/patch-components_segmentation__platform_embedder_default__model_cross__device__user__segment.cc b/chromium-next/patches/patch-components_segmentation__platform_embedder_default__model_cross__device__user__segment.cc
new file mode 100644
index 0000000000..5cfa27e8eb
--- /dev/null
+++ b/chromium-next/patches/patch-components_segmentation__platform_embedder_default__model_cross__device__user__segment.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/segmentation_platform/embedder/default_model/cross_device_user_segment.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/segmentation_platform/embedder/default_model/cross_device_user_segment.cc
+@@ -148,7 +148,7 @@ void CrossDeviceUserSegment::ExecuteMode
+ // Check for current device type and subtract it from the device count
+ // calculation.
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ desktop_count -= 1;
+ #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
+ if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) {
diff --git a/chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.cc b/chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.cc
new file mode 100644
index 0000000000..685a7d0a1f
--- /dev/null
+++ b/chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.cc
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/services/on_device_translation/sandbox_hook.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/services/on_device_translation/sandbox_hook.cc
+@@ -7,12 +7,15 @@
+ #include "components/services/on_device_translation/translate_kit_client.h"
+ #include "sandbox/linux/syscall_broker/broker_command.h"
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
+ using sandbox::syscall_broker::MakeBrokerCommandSet;
++#endif
+
+ namespace on_device_translation {
+ namespace {
+
++#if !BUILDFLAG(IS_BSD)
+ // Gets the file permissions required by the TranslateKit
+ std::vector<BrokerFilePermission> GetOnDeviceTranslationFilePermissions() {
+ std::vector<BrokerFilePermission> permissions{
+@@ -21,6 +24,7 @@ std::vector<BrokerFilePermission> GetOnD
+ };
+ return permissions;
+ }
++#endif
+
+ } // namespace
+
+@@ -29,6 +33,7 @@ bool OnDeviceTranslationSandboxHook(
+ // Call `TranslateKitClient::Get()` to load libtranslatekit.so
+ TranslateKitClient::Get();
+
++#if !BUILDFLAG(IS_BSD)
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+ instance->StartBrokerProcess(MakeBrokerCommandSet({
+ sandbox::syscall_broker::COMMAND_OPEN,
+@@ -36,7 +41,7 @@ bool OnDeviceTranslationSandboxHook(
+ GetOnDeviceTranslationFilePermissions(),
+ options);
+ instance->EngageNamespaceSandboxIfPossible();
+-
++#endif
+ return true;
+ }
+
diff --git a/chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.h b/chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.h
new file mode 100644
index 0000000000..0a62a92cf2
--- /dev/null
+++ b/chromium-next/patches/patch-components_services_on__device__translation_sandbox__hook.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/services/on_device_translation/sandbox_hook.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/services/on_device_translation/sandbox_hook.h
+@@ -5,7 +5,13 @@
+ #ifndef COMPONENTS_SERVICES_ON_DEVICE_TRANSLATION_SANDBOX_HOOK_H_
+ #define COMPONENTS_SERVICES_ON_DEVICE_TRANSLATION_SANDBOX_HOOK_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace on_device_translation {
+
diff --git a/chromium-next/patches/patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.cc b/chromium-next/patches/patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.cc
new file mode 100644
index 0000000000..5dcb49dd9a
--- /dev/null
+++ b/chromium-next/patches/patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/services/paint_preview_compositor/paint_preview_compositor_collection_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/services/paint_preview_compositor/paint_preview_compositor_collection_impl.cc
+@@ -22,7 +22,7 @@
+
+ #if BUILDFLAG(IS_WIN)
+ #include "content/public/child/dwrite_font_proxy_init_win.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/cpp/font_loader.h"
+ #endif
+
+@@ -79,7 +79,7 @@ PaintPreviewCompositorCollectionImpl::Pa
+ // Initialize font access for Skia.
+ #if BUILDFLAG(IS_WIN)
+ content::InitializeDWriteFontProxy();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ content::UtilityThread::Get()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -102,7 +102,7 @@ PaintPreviewCompositorCollectionImpl::Pa
+ base::BindOnce([] { skia::DefaultFontMgr(); }));
+
+ // Sanity check that fonts are working.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // No WebSandbox is provided on Linux so the local fonts aren't accessible.
+ // This is fine since since the subsetted fonts are provided in the SkPicture.
+ // However, we still need to check that the SkFontMgr starts as it is used by
diff --git a/chromium-next/patches/patch-components_soda_soda__util.cc b/chromium-next/patches/patch-components_soda_soda__util.cc
new file mode 100644
index 0000000000..ce2a98580d
--- /dev/null
+++ b/chromium-next/patches/patch-components_soda_soda__util.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/soda/soda_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/soda/soda_util.cc
+@@ -27,7 +27,7 @@
+ #include "base/win/windows_version.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_X86_FAMILY)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_X86_FAMILY)
+ #include "base/cpu.h"
+ #endif
+
+@@ -52,7 +52,7 @@ bool IsSupportedChromeOS() {
+ }
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool IsSupportedLinux() {
+ #if defined(ARCH_CPU_X86_FAMILY)
+ // Check if the CPU has the required instruction set to run the Speech
+@@ -83,7 +83,7 @@ bool IsSupportedWin() {
+ bool IsOnDeviceSpeechRecognitionSupported() {
+ #if BUILDFLAG(IS_CHROMEOS)
+ return IsSupportedChromeOS();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return IsSupportedLinux();
+ #elif BUILDFLAG(IS_WIN)
+ return IsSupportedWin();
diff --git a/chromium-next/patches/patch-components_startup__metric__utils_common_startup__metric__utils.cc b/chromium-next/patches/patch-components_startup__metric__utils_common_startup__metric__utils.cc
new file mode 100644
index 0000000000..fd91308bb6
--- /dev/null
+++ b/chromium-next/patches/patch-components_startup__metric__utils_common_startup__metric__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/startup_metric_utils/common/startup_metric_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/startup_metric_utils/common/startup_metric_utils.cc
+@@ -94,7 +94,7 @@ base::TimeTicks CommonStartupMetricRecor
+ // Enabling this logic on OS X causes a significant performance regression.
+ // TODO(crbug.com/40464036): Remove IS_APPLE ifdef once utility processes
+ // set their desired main thread priority.
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ static bool statics_initialized = false;
+ if (!statics_initialized) {
+ statics_initialized = true;
diff --git a/chromium-next/patches/patch-components_storage__monitor_BUILD.gn b/chromium-next/patches/patch-components_storage__monitor_BUILD.gn
new file mode 100644
index 0000000000..f443b45dcf
--- /dev/null
+++ b/chromium-next/patches/patch-components_storage__monitor_BUILD.gn
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/storage_monitor/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/storage_monitor/BUILD.gn
+@@ -75,7 +75,7 @@ static_library("storage_monitor") {
+ deps += [ "//services/device/public/mojom" ]
+ }
+ } else if (is_linux || is_chromeos_lacros) {
+- if (use_udev) {
++ if (use_udev && !is_bsd) {
+ sources += [
+ "mtab_watcher_linux.cc",
+ "mtab_watcher_linux.h",
+@@ -180,7 +180,7 @@ source_set("unit_tests") {
+ "storage_monitor_chromeos_unittest.cc",
+ ]
+ }
+- } else if (is_linux || is_chromeos_lacros) {
++ } else if ((is_linux || is_chromeos_lacros) && !is_bsd) {
+ if (use_udev) {
+ sources += [ "storage_monitor_linux_unittest.cc" ]
+ }
diff --git a/chromium-next/patches/patch-components_storage__monitor_removable__device__constants.cc b/chromium-next/patches/patch-components_storage__monitor_removable__device__constants.cc
new file mode 100644
index 0000000000..9436698bf2
--- /dev/null
+++ b/chromium-next/patches/patch-components_storage__monitor_removable__device__constants.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/storage_monitor/removable_device_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/storage_monitor/removable_device_constants.cc
+@@ -10,7 +10,7 @@ namespace storage_monitor {
+ const char kFSUniqueIdPrefix[] = "UUID:";
+ const char kVendorModelSerialPrefix[] = "VendorModelSerial:";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kVendorModelVolumeStoragePrefix[] = "VendorModelVolumeStorage:";
+ #endif
+
diff --git a/chromium-next/patches/patch-components_storage__monitor_removable__device__constants.h b/chromium-next/patches/patch-components_storage__monitor_removable__device__constants.h
new file mode 100644
index 0000000000..dc485d947a
--- /dev/null
+++ b/chromium-next/patches/patch-components_storage__monitor_removable__device__constants.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/storage_monitor/removable_device_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/storage_monitor/removable_device_constants.h
+@@ -14,7 +14,7 @@ namespace storage_monitor {
+ extern const char kFSUniqueIdPrefix[];
+ extern const char kVendorModelSerialPrefix[];
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kVendorModelVolumeStoragePrefix[];
+ #endif
+
diff --git a/chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__metrics__service.cc b/chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__metrics__service.cc
new file mode 100644
index 0000000000..3586e0c9f3
--- /dev/null
+++ b/chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__metrics__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/supervised_user/core/browser/supervised_user_metrics_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/supervised_user/core/browser/supervised_user_metrics_service.cc
+@@ -47,7 +47,7 @@ SupervisedUserMetricsService::Supervised
+ extensions_metrics_delegate_(std::move(extensions_metrics_delegate)) {
+ DCHECK(pref_service_);
+ DCHECK(url_filter_);
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ CHECK(extensions_metrics_delegate_)
+ << "Extensions metrics delegate must exist on Win/Linux/Mac";
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__preferences.cc b/chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__preferences.cc
new file mode 100644
index 0000000000..ac3efe203c
--- /dev/null
+++ b/chromium-next/patches/patch-components_supervised__user_core_browser_supervised__user__preferences.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/supervised_user/core/browser/supervised_user_preferences.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/supervised_user/core/browser/supervised_user_preferences.cc
+@@ -147,7 +147,7 @@ void RegisterProfilePrefs(PrefRegistrySi
+ prefs::kFamilyLinkUserState,
+ static_cast<int>(FamilyLinkUserState::kUnknown));
+ #if BUILDFLAG(ENABLE_EXTENSIONS) && \
+- (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX))
++ (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ registry->RegisterIntegerPref(
+ prefs::kLocallyParentApprovedExtensionsMigrationState,
+ static_cast<int>(
diff --git a/chromium-next/patches/patch-components_supervised__user_core_common_features.cc b/chromium-next/patches/patch-components_supervised__user_core_common_features.cc
new file mode 100644
index 0000000000..67ea1f7097
--- /dev/null
+++ b/chromium-next/patches/patch-components_supervised__user_core_common_features.cc
@@ -0,0 +1,60 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/supervised_user/core/common/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/supervised_user/core/common/features.cc
+@@ -60,7 +60,7 @@ BASE_FEATURE(kUpdatedSupervisedUserExten
+ "UpdatedSupervisedUserExtensionApprovalStrings",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kEnableExtensionsPermissionsForSupervisedUsersOnDesktop,
+ "EnableExtensionsPermissionsForSupervisedUsersOnDesktop",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+@@ -75,7 +75,7 @@ bool IsSupervisedUserSkipParentApprovalT
+ #if BUILDFLAG(IS_CHROMEOS)
+ return base::FeatureList::IsEnabled(
+ kEnableSupervisedUserSkipParentApprovalToInstallExtensions);
+-#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ bool skipParentApprovalEnabled = base::FeatureList::IsEnabled(
+ kEnableSupervisedUserSkipParentApprovalToInstallExtensions);
+ bool permissionExtensionsForSupervisedUsersEnabled =
+@@ -96,13 +96,13 @@ BASE_FEATURE(kCustomProfileStringsForSup
+ "CustomProfileStringsForSupervisedUsers",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kShowKiteForSupervisedUsers,
+ "ShowKiteForSupervisedUsers",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kHideGuestModeForSupervisedUsers,
+ "HideGuestModeForSupervisedUsers",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -112,7 +112,7 @@ BASE_FEATURE(kForceSafeSearchForUnauthen
+ "ForceSafeSearchForUnauthenticatedSupervisedUsers",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kForceSupervisedUserReauthenticationForYouTube,
+ "ForceSupervisedUserReauthenticationForYouTube",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -162,7 +162,7 @@ BASE_FEATURE(kReplaceSupervisionSystemCa
+
+ BASE_FEATURE(kFetchListFamilyMembersWithCapability,
+ "FetchListFamilyMembersWithCapability",
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-components_supervised__user_core_common_features.h b/chromium-next/patches/patch-components_supervised__user_core_common_features.h
new file mode 100644
index 0000000000..e02c4fc0b8
--- /dev/null
+++ b/chromium-next/patches/patch-components_supervised__user_core_common_features.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/supervised_user/core/common/features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/supervised_user/core/common/features.h
+@@ -25,7 +25,7 @@ BASE_DECLARE_FEATURE(
+ // Applies new informative strings during the parental extension approval flow.
+ BASE_DECLARE_FEATURE(kUpdatedSupervisedUserExtensionApprovalStrings);
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kEnableExtensionsPermissionsForSupervisedUsersOnDesktop);
+ #endif
+
+@@ -55,11 +55,11 @@ BASE_DECLARE_FEATURE(kCustomProfileStrin
+
+ // Displays a Family Link kite badge on the supervised user avatar in various
+ // surfaces.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ BASE_DECLARE_FEATURE(kShowKiteForSupervisedUsers);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // This hides the following guest mode entry points for supervised users:
+ //
+ // * In the Profile menu for supervised profiles
+@@ -71,7 +71,7 @@ BASE_DECLARE_FEATURE(kHideGuestModeForSu
+ // unauthenticated (e.g. signed out of the content area) account.
+ BASE_DECLARE_FEATURE(kForceSafeSearchForUnauthenticatedSupervisedUsers);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Force re-authentication when an unauthenticated supervised user tries to
+ // access YouTube, so that content restrictions can be applied.
+ BASE_DECLARE_FEATURE(kForceSupervisedUserReauthenticationForYouTube);
diff --git a/chromium-next/patches/patch-components_supervised__user_core_common_pref__names.h b/chromium-next/patches/patch-components_supervised__user_core_common_pref__names.h
new file mode 100644
index 0000000000..4957fef288
--- /dev/null
+++ b/chromium-next/patches/patch-components_supervised__user_core_common_pref__names.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/supervised_user/core/common/pref_names.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/supervised_user/core/common/pref_names.h
+@@ -129,7 +129,7 @@ inline constexpr char kDefaultSupervised
+ "profile.managed.default_filtering_behavior";
+
+ #if BUILDFLAG(ENABLE_EXTENSIONS)
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // An integer pref that stores the current state of the local extension
+ // parent approval migration when the feature
+ // `kEnableSupervisedUserSkipParentApprovalToInstallExtensions` becomes enabled.
diff --git a/chromium-next/patches/patch-components_sync__device__info_local__device__info__util.cc b/chromium-next/patches/patch-components_sync__device__info_local__device__info__util.cc
new file mode 100644
index 0000000000..8e8412aea4
--- /dev/null
+++ b/chromium-next/patches/patch-components_sync__device__info_local__device__info__util.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/sync_device_info/local_device_info_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/sync_device_info/local_device_info_util.cc
+@@ -85,7 +85,7 @@ void OnMachineStatisticsLoaded(LocalDevi
+ sync_pb::SyncEnums::DeviceType GetLocalDeviceType() {
+ #if BUILDFLAG(IS_CHROMEOS)
+ return sync_pb::SyncEnums_DeviceType_TYPE_CROS;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return sync_pb::SyncEnums_DeviceType_TYPE_LINUX;
+ #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
+ switch (ui::GetDeviceFormFactor()) {
+@@ -110,7 +110,7 @@ DeviceInfo::OsType GetLocalDeviceOSType(
+ return DeviceInfo::OsType::kChromeOsAsh;
+ #elif BUILDFLAG(IS_CHROMEOS_LACROS)
+ return DeviceInfo::OsType::kChromeOsLacros;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return DeviceInfo::OsType::kLinux;
+ #elif BUILDFLAG(IS_ANDROID)
+ return DeviceInfo::OsType::kAndroid;
+@@ -129,7 +129,7 @@ DeviceInfo::OsType GetLocalDeviceOSType(
+
+ DeviceInfo::FormFactor GetLocalDeviceFormFactor() {
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return DeviceInfo::FormFactor::kDesktop;
+ #elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
+ return ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET
diff --git a/chromium-next/patches/patch-components_sync__device__info_local__device__info__util__linux.cc b/chromium-next/patches/patch-components_sync__device__info_local__device__info__util__linux.cc
new file mode 100644
index 0000000000..23ade483d3
--- /dev/null
+++ b/chromium-next/patches/patch-components_sync__device__info_local__device__info__util__linux.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/sync_device_info/local_device_info_util_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/sync_device_info/local_device_info_util_linux.cc
+@@ -9,6 +9,11 @@
+
+ #include "base/linux_util.h"
+
++#if defined(__FreeBSD__) || defined(__NetBSD__)
++#include <sys/param.h>
++#define HOST_NAME_MAX MAXHOSTNAMELEN
++#endif
++
+ namespace syncer {
+
+ std::string GetPersonalizableDeviceNameInternal() {
diff --git a/chromium-next/patches/patch-components_sync_base_sync__util.cc b/chromium-next/patches/patch-components_sync_base_sync__util.cc
new file mode 100644
index 0000000000..c661f9cfe1
--- /dev/null
+++ b/chromium-next/patches/patch-components_sync_base_sync__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/sync/base/sync_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/sync/base/sync_util.cc
+@@ -45,6 +45,8 @@ std::string GetSystemString() {
+ system = "FREEBSD ";
+ #elif BUILDFLAG(IS_OPENBSD)
+ system = "OPENBSD ";
++#elif BUILDFLAG(IS_NETBSD)
++ system = "NETBSD ";
+ #elif BUILDFLAG(IS_MAC)
+ system = "MAC ";
+ #endif
diff --git a/chromium-next/patches/patch-components_system__cpu_cpu__probe.cc b/chromium-next/patches/patch-components_system__cpu_cpu__probe.cc
new file mode 100644
index 0000000000..875896664a
--- /dev/null
+++ b/chromium-next/patches/patch-components_system__cpu_cpu__probe.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/system_cpu/cpu_probe.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/system_cpu/cpu_probe.cc
+@@ -30,6 +30,9 @@ std::unique_ptr<CpuProbe> CpuProbe::Crea
+ return CpuProbeWin::Create();
+ #elif BUILDFLAG(IS_MAC)
+ return CpuProbeMac::Create();
++#elif BUILDFLAG(IS_BSD)
++ NOTIMPLEMENTED();
++ return nullptr;
+ #else
+ return nullptr;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-components_translate_core_common_translate__util.cc b/chromium-next/patches/patch-components_translate_core_common_translate__util.cc
new file mode 100644
index 0000000000..b93d7dc3c6
--- /dev/null
+++ b/chromium-next/patches/patch-components_translate_core_common_translate__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/translate/core/common/translate_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/translate/core/common/translate_util.cc
+@@ -21,7 +21,7 @@ const char kSecurityOrigin[] = "https://
+ BASE_FEATURE(kTFLiteLanguageDetectionEnabled,
+ "TFLiteLanguageDetectionEnabled",
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-components_trusted__vault_trusted__vault__connection__impl.cc b/chromium-next/patches/patch-components_trusted__vault_trusted__vault__connection__impl.cc
new file mode 100644
index 0000000000..f1deb52b59
--- /dev/null
+++ b/chromium-next/patches/patch-components_trusted__vault_trusted__vault__connection__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/trusted_vault/trusted_vault_connection_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/trusted_vault/trusted_vault_connection_impl.cc
+@@ -102,7 +102,7 @@ GetLocalPhysicalDeviceType() {
+ // currently used or even built on all platforms.
+ #if BUILDFLAG(IS_CHROMEOS)
+ return trusted_vault_pb::PhysicalDeviceMetadata::DEVICE_TYPE_CHROMEOS;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return trusted_vault_pb::PhysicalDeviceMetadata::DEVICE_TYPE_LINUX;
+ #elif BUILDFLAG(IS_ANDROID)
+ return trusted_vault_pb::PhysicalDeviceMetadata::DEVICE_TYPE_ANDROID;
diff --git a/chromium-next/patches/patch-components_update__client_update__query__params.cc b/chromium-next/patches/patch-components_update__client_update__query__params.cc
new file mode 100644
index 0000000000..ff375b4919
--- /dev/null
+++ b/chromium-next/patches/patch-components_update__client_update__query__params.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/update_client/update_query_params.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/update_client/update_query_params.cc
+@@ -40,6 +40,10 @@ const char kOs[] =
+ "fuchsia";
+ #elif BUILDFLAG(IS_OPENBSD)
+ "openbsd";
++#elif defined(OS_FREEBSD)
++ "freebsd";
++#elif defined(OS_NETBSD)
++ "netbsd";
+ #else
+ #error "unknown os"
+ #endif
diff --git a/chromium-next/patches/patch-components_url__formatter_spoof__checks_idn__spoof__checker.cc b/chromium-next/patches/patch-components_url__formatter_spoof__checks_idn__spoof__checker.cc
new file mode 100644
index 0000000000..7b9568df44
--- /dev/null
+++ b/chromium-next/patches/patch-components_url__formatter_spoof__checks_idn__spoof__checker.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/url_formatter/spoof_checks/idn_spoof_checker.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/url_formatter/spoof_checks/idn_spoof_checker.cc
+@@ -294,7 +294,7 @@ IDNSpoofChecker::IDNSpoofChecker() {
+ // The ideal fix would be to change the omnibox font used for Thai. In
+ // that case, the Linux-only list should be revisited and potentially
+ // removed.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ "[ทนบพรหเแ๐ดลปฟม]",
+ #else
+ "[บพเแ๐]",
diff --git a/chromium-next/patches/patch-components_user__education_views_help__bubble__view.cc b/chromium-next/patches/patch-components_user__education_views_help__bubble__view.cc
new file mode 100644
index 0000000000..156a3a84fc
--- /dev/null
+++ b/chromium-next/patches/patch-components_user__education_views_help__bubble__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/user_education/views/help_bubble_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/user_education/views/help_bubble_view.cc
+@@ -852,7 +852,7 @@ gfx::Rect HelpBubbleView::GetAnchorRect(
+ void HelpBubbleView::OnBeforeBubbleWidgetInit(views::Widget::InitParams* params,
+ views::Widget* widget) const {
+ BubbleDialogDelegateView::OnBeforeBubbleWidgetInit(params, widget);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Help bubbles anchored to menus may be clipped to their anchors' bounds,
+ // resulting in visual errors, unless they use accelerated rendering. See
+ // crbug.com/1445770 for details. This also applies to bubbles anchored to
diff --git a/chromium-next/patches/patch-components_variations_service_variations__service.cc b/chromium-next/patches/patch-components_variations_service_variations__service.cc
new file mode 100644
index 0000000000..2218e7b22a
--- /dev/null
+++ b/chromium-next/patches/patch-components_variations_service_variations__service.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/variations/service/variations_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/variations/service/variations_service.cc
+@@ -102,7 +102,7 @@ std::string GetPlatformString() {
+ return "android";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return "fuchsia";
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || BUILDFLAG(IS_SOLARIS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_BSD)
+ // Default BSD and SOLARIS to Linux to not break those builds, although these
+ // platforms are not officially supported by Chrome.
+ return "linux";
diff --git a/chromium-next/patches/patch-components_visited__url__ranking_public_url__visit__util.cc b/chromium-next/patches/patch-components_visited__url__ranking_public_url__visit__util.cc
new file mode 100644
index 0000000000..1308744aa1
--- /dev/null
+++ b/chromium-next/patches/patch-components_visited__url__ranking_public_url__visit__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/visited_url_ranking/public/url_visit_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/visited_url_ranking/public/url_visit_util.cc
+@@ -66,7 +66,7 @@ PlatformType GetPlatformInput() {
+ return PlatformType::kWindows;
+ #elif BUILDFLAG(IS_MAC)
+ return PlatformType::kMac;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return PlatformType::kLinux;
+ #elif BUILDFLAG(IS_IOS)
+ return PlatformType::kIos;
diff --git a/chromium-next/patches/patch-components_viz_host_gpu__host__impl.cc b/chromium-next/patches/patch-components_viz_host_gpu__host__impl.cc
new file mode 100644
index 0000000000..1a49c21dc3
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_host_gpu__host__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/host/gpu_host_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/host/gpu_host_impl.cc
+@@ -139,7 +139,7 @@ GpuHostImpl::GpuHostImpl(Delegate* deleg
+ // overlays are not currently supported on Linux, elide the call here at this
+ // time.
+ // TODO(crbug.com/377886734): Fix the underlying issue and re-enable this call.
+-#if BUILDFLAG(IS_OZONE) && !BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_OZONE) && (!BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD))
+ gpu_service_params->supports_overlays = ui::OzonePlatform::GetInstance()
+ ->GetPlatformRuntimeProperties()
+ .supports_overlays;
diff --git a/chromium-next/patches/patch-components_viz_host_host__display__client.cc b/chromium-next/patches/patch-components_viz_host_host__display__client.cc
new file mode 100644
index 0000000000..934078a831
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_host_host__display__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/host/host_display_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/host/host_display_client.cc
+@@ -65,7 +65,7 @@ void HostDisplayClient::AddChildWindowTo
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
+ NOTIMPLEMENTED();
+ }
diff --git a/chromium-next/patches/patch-components_viz_host_host__display__client.h b/chromium-next/patches/patch-components_viz_host_host__display__client.h
new file mode 100644
index 0000000000..08ab4e9e46
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_host_host__display__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/host/host_display_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/host/host_display_client.h
+@@ -52,7 +52,7 @@ class VIZ_HOST_EXPORT HostDisplayClient
+ void AddChildWindowToBrowser(gpu::SurfaceHandle child_window) override;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
+ #endif // BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
+
diff --git a/chromium-next/patches/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc b/chromium-next/patches/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc
new file mode 100644
index 0000000000..9f3dc13bf1
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/service/display_embedder/skia_output_surface_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/service/display_embedder/skia_output_surface_impl.cc
+@@ -1498,7 +1498,7 @@ GrBackendFormat SkiaOutputSurfaceImpl::G
+ ->GetVulkanPhysicalDevice(),
+ VK_IMAGE_TILING_OPTIMAL, vk_format,
+ si_format, yuv_color_space, ycbcr_info);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Textures that were allocated _on linux_ with ycbcr info came from
+ // VaapiVideoDecoder, which exports using DRM format modifiers.
+ return GrBackendFormats::MakeVk(gr_ycbcr_info,
diff --git a/chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.cc b/chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.cc
new file mode 100644
index 0000000000..74682025c9
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/service/display_embedder/software_output_surface.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/service/display_embedder/software_output_surface.cc
+@@ -113,7 +113,7 @@ void SoftwareOutputSurface::SwapBuffersC
+ base::TimeTicks now = base::TimeTicks::Now();
+ base::TimeDelta interval_to_next_refresh =
+ now.SnappedToNextTick(refresh_timebase_, refresh_interval_) - now;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (needs_swap_size_notifications_)
+ client_->DidSwapWithSize(pixel_size);
+ #endif
+@@ -140,7 +140,7 @@ gfx::OverlayTransform SoftwareOutputSurf
+ return gfx::OVERLAY_TRANSFORM_NONE;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SoftwareOutputSurface::SetNeedsSwapSizeNotifications(
+ bool needs_swap_size_notifications) {
+ needs_swap_size_notifications_ = needs_swap_size_notifications;
diff --git a/chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.h b/chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.h
new file mode 100644
index 0000000000..9f7d5c4791
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_service_display__embedder_software__output__surface.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/service/display_embedder/software_output_surface.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/service/display_embedder/software_output_surface.h
+@@ -42,7 +42,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputS
+ UpdateVSyncParametersCallback callback) override;
+ void SetDisplayTransformHint(gfx::OverlayTransform transform) override {}
+ gfx::OverlayTransform GetDisplayTransform() override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SetNeedsSwapSizeNotifications(
+ bool needs_swap_size_notifications) override;
+ #endif
+@@ -60,7 +60,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputS
+ base::TimeTicks refresh_timebase_;
+ base::TimeDelta refresh_interval_ = BeginFrameArgs::DefaultInterval();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool needs_swap_size_notifications_ = false;
+ #endif
+
diff --git a/chromium-next/patches/patch-components_viz_service_display_skia__renderer.cc b/chromium-next/patches/patch-components_viz_service_display_skia__renderer.cc
new file mode 100644
index 0000000000..2e5b45e759
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_service_display_skia__renderer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/service/display/skia_renderer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/service/display/skia_renderer.cc
+@@ -1358,7 +1358,7 @@ void SkiaRenderer::ClearFramebuffer() {
+ if (current_frame()->current_render_pass->has_transparent_background) {
+ ClearCanvas(SkColors::kTransparent);
+ } else {
+-#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX)
++#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // On DEBUG builds, opaque render passes are cleared to blue
+ // to easily see regions that were not drawn on the screen.
+ // ClearCavas() call causes slight pixel difference, so linux-ref and
diff --git a/chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc b/chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc
new file mode 100644
index 0000000000..0adf17270e
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+@@ -113,7 +113,7 @@ RootCompositorFrameSinkImpl::Create(
+ output_surface->SetNeedsSwapSizeNotifications(
+ params->send_swap_size_notifications);
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ // For X11, we need notify client about swap completion after resizing, so the
+ // client can use it for synchronize with X11 WM.
+ output_surface->SetNeedsSwapSizeNotifications(true);
+@@ -794,7 +794,7 @@ void RootCompositorFrameSinkImpl::Displa
+ if (display_client_ && enable_swap_completion_callback_) {
+ display_client_->DidCompleteSwapWithSize(pixel_size);
+ }
+-#elif BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ if (display_client_ && pixel_size != last_swap_pixel_size_) {
+ last_swap_pixel_size_ = pixel_size;
+ display_client_->DidCompleteSwapWithNewSize(last_swap_pixel_size_);
diff --git a/chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h b/chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h
new file mode 100644
index 0000000000..6a51fe32fb
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h
+@@ -231,7 +231,7 @@ class VIZ_SERVICE_EXPORT RootCompositorF
+ // See comments on `EvictionHandler`.
+ EvictionHandler eviction_handler_;
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ gfx::Size last_swap_pixel_size_;
+ #endif // BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
+
diff --git a/chromium-next/patches/patch-components_viz_test_fake__display__client.cc b/chromium-next/patches/patch-components_viz_test_fake__display__client.cc
new file mode 100644
index 0000000000..e5e4745b41
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_test_fake__display__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/test/fake_display_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/test/fake_display_client.cc
+@@ -27,7 +27,7 @@ void FakeDisplayClient::AddChildWindowTo
+ gpu::SurfaceHandle child_window) {}
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void FakeDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {}
+ #endif // BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
+
diff --git a/chromium-next/patches/patch-components_viz_test_fake__display__client.h b/chromium-next/patches/patch-components_viz_test_fake__display__client.h
new file mode 100644
index 0000000000..2c68e2dd0a
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_test_fake__display__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/test/fake_display_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/test/fake_display_client.h
+@@ -36,7 +36,7 @@ class FakeDisplayClient : public mojom::
+ void AddChildWindowToBrowser(gpu::SurfaceHandle child_window) override;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
+ #endif // BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
+
diff --git a/chromium-next/patches/patch-components_viz_test_mock__display__client.h b/chromium-next/patches/patch-components_viz_test_mock__display__client.h
new file mode 100644
index 0000000000..2ba2d737df
--- /dev/null
+++ b/chromium-next/patches/patch-components_viz_test_mock__display__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- components/viz/test/mock_display_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ components/viz/test/mock_display_client.h
+@@ -45,7 +45,7 @@ class MockDisplayClient : public mojom::
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
+ MOCK_METHOD1(SetPreferredRefreshRate, void(float refresh_rate));
+ #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ MOCK_METHOD1(DidCompleteSwapWithNewSize, void(const gfx::Size&));
+ #endif // BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
+
diff --git a/chromium-next/patches/patch-content_app_BUILD.gn b/chromium-next/patches/patch-content_app_BUILD.gn
new file mode 100644
index 0000000000..cd19f2773e
--- /dev/null
+++ b/chromium-next/patches/patch-content_app_BUILD.gn
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/app/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/app/BUILD.gn
+@@ -96,9 +96,9 @@ source_set("content_main_runner_app") {
+ "//chromeos/startup:constants",
+ ]
+ }
+- if (build_tflite_with_xnnpack) {
+- deps += [ "//third_party/cpuinfo" ]
+- }
++# if (build_tflite_with_xnnpack) {
++# deps += [ "//third_party/cpuinfo" ]
++# }
+ }
+
+ source_set("app") {
diff --git a/chromium-next/patches/patch-content_app_content__main.cc b/chromium-next/patches/patch-content_app_content__main.cc
new file mode 100644
index 0000000000..63eb4101ee
--- /dev/null
+++ b/chromium-next/patches/patch-content_app_content__main.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/app/content_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/app/content_main.cc
+@@ -227,7 +227,7 @@ NO_STACK_PROTECTOR int RunContentProcess
+ base::EnableTerminationOnOutOfMemory();
+ logging::RegisterAbslAbortHook();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The various desktop environments set this environment variable that
+ // allows the dbus client library to connect directly to the bus. When this
+ // variable is not set (test environments like xvfb-run), the dbus client
+@@ -313,7 +313,7 @@ NO_STACK_PROTECTOR int RunContentProcess
+ command_line->AppendSwitch(switches::kUseMobileUserAgent);
+ #endif
+
+-#if (BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)) && !defined(COMPONENT_BUILD)
++#if (BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)) && !defined(COMPONENT_BUILD) && defined(notyet)
+ base::subtle::EnableFDOwnershipEnforcement(true);
+ #endif
+
diff --git a/chromium-next/patches/patch-content_app_content__main__runner__impl.cc b/chromium-next/patches/patch-content_app_content__main__runner__impl.cc
new file mode 100644
index 0000000000..3d11f0714c
--- /dev/null
+++ b/chromium-next/patches/patch-content_app_content__main__runner__impl.cc
@@ -0,0 +1,133 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/app/content_main_runner_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/app/content_main_runner_impl.cc
+@@ -147,18 +147,20 @@
+ #include "content/browser/posix_file_descriptor_info_impl.h"
+ #include "content/public/common/content_descriptors.h"
+
+-#if !BUILDFLAG(IS_MAC)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ #include "content/public/common/zygote/zygote_fork_delegate_linux.h"
+ #endif
+
+ #endif // BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/file_path_watcher_inotify.h"
+ #include "base/native_library.h"
+ #include "base/rand_util.h"
+ #include "content/public/common/zygote/sandbox_support_linux.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "third_party/boringssl/src/include/openssl/crypto.h"
+ #include "third_party/webrtc_overrides/init_webrtc.h" // nogncheck
+
+@@ -192,6 +194,10 @@
+ #include "media/base/media_switches.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "base/system/sys_info.h"
++#endif
++
+ #if BUILDFLAG(IS_ANDROID)
+ #include "base/system/sys_info.h"
+ #include "content/browser/android/battery_metrics.h"
+@@ -399,7 +405,7 @@ void InitializeZygoteSandboxForBrowserPr
+ }
+ #endif // BUILDFLAG(USE_ZYGOTE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ #if BUILDFLAG(ENABLE_PPAPI)
+ // Loads the (native) libraries but does not initialize them (i.e., does not
+@@ -437,7 +443,10 @@ void PreloadLibraryCdms() {
+
+ void PreSandboxInit() {
+ // Ensure the /dev/urandom is opened.
++ // we use arc4random
++#if !BUILDFLAG(IS_BSD)
+ base::GetUrandomFD();
++#endif
+
+ // May use sysinfo(), sched_getaffinity(), and open various /sys/ and /proc/
+ // files.
+@@ -449,9 +458,16 @@ void PreSandboxInit() {
+ // https://boringssl.googlesource.com/boringssl/+/HEAD/SANDBOXING.md
+ CRYPTO_pre_sandbox_init();
+
++#if BUILDFLAG(IS_BSD)
++ // "cache" the amount of physical memory before pledge(2)
++ base::SysInfo::AmountOfPhysicalMemoryMB();
++#endif
++
++#if !BUILDFLAG(IS_BSD)
+ // Pre-read /proc/sys/fs/inotify/max_user_watches so it doesn't have to be
+ // allowed by the sandbox.
+ base::GetMaxNumberOfInotifyWatches();
++#endif
+
+ #if BUILDFLAG(ENABLE_PPAPI)
+ // Ensure access to the Pepper plugins before the sandbox is turned on.
+@@ -762,7 +778,7 @@ NO_STACK_PROTECTOR int RunOtherNamedProc
+ unregister_thread_closure = base::HangWatcher::RegisterThread(
+ base::HangWatcher::ThreadType::kMainThread);
+ bool start_hang_watcher_now;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux/ChromeOS, the HangWatcher can't start until after the sandbox is
+ // initialized, because the sandbox can't be started with multiple threads.
+ // TODO(mpdenton): start the HangWatcher after the sandbox is initialized.
+@@ -872,11 +888,10 @@ int ContentMainRunnerImpl::Initialize(Co
+ base::GlobalDescriptors::kBaseDescriptor);
+ #endif // !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ g_fds->Set(kCrashDumpSignal,
+ kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor);
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+- // BUILDFLAG(IS_OPENBSD)
++#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+ #endif // !BUILDFLAG(IS_WIN)
+
+@@ -1057,6 +1072,18 @@ int ContentMainRunnerImpl::Initialize(Co
+ process_type == switches::kZygoteProcess) {
+ PreSandboxInit();
+ }
++#elif BUILDFLAG(IS_BSD)
++ PreSandboxInit();
++#endif
++
++#if BUILDFLAG(IS_BSD)
++ if (process_type.empty()) {
++ sandbox::policy::SandboxLinux::Options sandbox_options;
++ sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox(
++ sandbox::policy::SandboxTypeFromCommandLine(
++ *base::CommandLine::ForCurrentProcess()),
++ sandbox::policy::SandboxLinux::PreSandboxHook(), sandbox_options);
++ }
+ #endif
+
+ delegate_->SandboxInitialized(process_type);
+@@ -1156,6 +1183,11 @@ NO_STACK_PROTECTOR int ContentMainRunner
+
+ RegisterMainThreadFactories();
+
++#if BUILDFLAG(IS_BSD)
++ if (!process_type.empty())
++ PreSandboxInit();
++#endif
++
+ if (process_type.empty())
+ return RunBrowser(std::move(main_params), start_minimal_browser);
+
diff --git a/chromium-next/patches/patch-content_browser_BUILD.gn b/chromium-next/patches/patch-content_browser_BUILD.gn
new file mode 100644
index 0000000000..173adfc6de
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_BUILD.gn
@@ -0,0 +1,39 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/BUILD.gn
+@@ -2454,6 +2454,14 @@ source_set("browser") {
+ ]
+ }
+
++ if (is_bsd) {
++ sources += [
++ "file_system_access/file_path_watcher/file_path_watcher_bsd.cc",
++ "file_system_access/file_path_watcher/file_path_watcher_kqueue.cc",
++ "file_system_access/file_path_watcher/file_path_watcher_kqueue.h",
++ ]
++ }
++
+ if (is_linux || is_chromeos) {
+ sources += [
+ "child_process_launcher_helper_linux.cc",
+@@ -2499,6 +2507,15 @@ source_set("browser") {
+ deps += [ "//media/mojo/mojom/stable:stable_video_decoder" ]
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "file_system_access/file_path_watcher/file_path_watcher_inotify.cc",
++ "file_system_access/file_path_watcher/file_path_watcher_inotify.h",
++ "sandbox_ipc_linux.cc",
++ "sandbox_ipc_linux.h",
++ ]
++ }
++
+ if (is_chromeos) {
+ sources += [
+ "handwriting/handwriting_recognition_service_impl_cros.cc",
diff --git a/chromium-next/patches/patch-content_browser_audio_audio__service.cc b/chromium-next/patches/patch-content_browser_audio_audio__service.cc
new file mode 100644
index 0000000000..fe0a3dc782
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_audio_audio__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/audio/audio_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/audio/audio_service.cc
+@@ -32,7 +32,7 @@
+ #if BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS)
+ #include "ui/display/util/edid_parser.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/display/display_util.h"
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -200,7 +200,7 @@ audio::mojom::AudioService& GetAudioServ
+ ->PostTaskAndReplyWithResult(
+ FROM_HERE, base::BindOnce(&ScanEdidBitstreams),
+ base::BindOnce(&LaunchAudioService, std::move(receiver)));
+-#elif BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS) && BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ LaunchAudioService(
+ std::move(receiver),
+ ConvertEdidBitstreams(display::DisplayUtil::GetAudioFormats()));
diff --git a/chromium-next/patches/patch-content_browser_browser__child__process__host__impl.cc b/chromium-next/patches/patch-content_browser_browser__child__process__host__impl.cc
new file mode 100644
index 0000000000..2859761856
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_browser__child__process__host__impl.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/browser_child_process_host_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/browser_child_process_host_impl.cc
+@@ -327,6 +327,7 @@ void BrowserChildProcessHostImpl::Launch
+ switches::kLogBestEffortTasks,
+ switches::kPerfettoDisableInterning,
+ switches::kTraceToConsole,
++ switches::kDisableUnveil,
+ };
+ cmd_line->CopySwitchesFrom(browser_command_line, kForwardSwitches);
+
+@@ -656,7 +657,7 @@ void BrowserChildProcessHostImpl::OnProc
+ ->child_process());
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ child_thread_type_switcher_.SetPid(process.Pid());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
diff --git a/chromium-next/patches/patch-content_browser_browser__child__process__host__impl.h b/chromium-next/patches/patch-content_browser_browser__child__process__host__impl.h
new file mode 100644
index 0000000000..0bbbb68a23
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_browser__child__process__host__impl.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/browser_child_process_host_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/browser_child_process_host_impl.h
+@@ -35,7 +35,7 @@
+ #include "base/win/object_watcher.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/browser/child_thread_type_switcher_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -269,7 +269,7 @@ class BrowserChildProcessHostImpl
+ std::unique_ptr<tracing::SystemTracingService> system_tracing_service_;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ChildThreadTypeSwitcher child_thread_type_switcher_;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
diff --git a/chromium-next/patches/patch-content_browser_browser__child__process__host__impl__receiver__bindings.cc b/chromium-next/patches/patch-content_browser_browser__child__process__host__impl__receiver__bindings.cc
new file mode 100644
index 0000000000..6fb540a553
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_browser__child__process__host__impl__receiver__bindings.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/browser_child_process_host_impl_receiver_bindings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/browser_child_process_host_impl_receiver_bindings.cc
+@@ -62,7 +62,7 @@ void BrowserChildProcessHostImpl::BindHo
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto r = receiver.As<mojom::ThreadTypeSwitcher>()) {
+ child_thread_type_switcher_.Bind(std::move(r));
+ return;
diff --git a/chromium-next/patches/patch-content_browser_browser__main__loop.cc b/chromium-next/patches/patch-content_browser_browser__main__loop.cc
new file mode 100644
index 0000000000..a8b4604f8a
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_browser__main__loop.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/browser_main_loop.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/browser_main_loop.cc
+@@ -249,6 +249,12 @@
+ #include "mojo/public/cpp/bindings/lib/test_random_mojo_delays.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "content/browser/sandbox_host_linux.h"
++#include "content/public/common/zygote/sandbox_support_linux.h"
++#include "sandbox/policy/sandbox.h"
++#endif
++
+ // One of the linux specific headers defines this as a macro.
+ #ifdef DestroyAll
+ #undef DestroyAll
+@@ -543,6 +549,12 @@ int BrowserMainLoop::EarlyInitialization
+ // by now since a thread to start the ServiceManager has been created
+ // before the browser main loop starts.
+ DCHECK(SandboxHostLinux::GetInstance()->IsInitialized());
++#elif BUILDFLAG(IS_BSD)
++ base::FileHandleMappingVector additional_remapped_fds;
++ base::LaunchOptions options;
++ SandboxHostLinux::GetInstance()->Init();
++ const int sfd = SandboxHostLinux::GetInstance()->GetChildSocket();
++ options.fds_to_remap.push_back(std::make_pair(sfd, GetSandboxFD()));
+ #endif
+
+ // GLib's spawning of new processes is buggy, so it's important that at this
+@@ -581,7 +593,7 @@ int BrowserMainLoop::EarlyInitialization
+ base::ThreadType::kDisplayCritical);
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // We use quite a few file descriptors for our IPC as well as disk the disk
+ // cache, and the default limit on Apple is low (256), so bump it up.
+
diff --git a/chromium-next/patches/patch-content_browser_child__process__launcher__helper.h b/chromium-next/patches/patch-content_browser_child__process__launcher__helper.h
new file mode 100644
index 0000000000..a0f1e68e90
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_child__process__launcher__helper.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/child_process_launcher_helper.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/child_process_launcher_helper.h
+@@ -304,7 +304,7 @@ class ChildProcessLauncherHelper
+ std::optional<base::ProcessId> process_id_ = std::nullopt;
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The priority of the process. The state is stored to avoid changing the
+ // setting repeatedly.
+ std::optional<base::Process::Priority> priority_;
diff --git a/chromium-next/patches/patch-content_browser_child__process__launcher__helper__linux.cc b/chromium-next/patches/patch-content_browser_child__process__launcher__helper__linux.cc
new file mode 100644
index 0000000000..9a27102b95
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_child__process__launcher__helper__linux.cc
@@ -0,0 +1,131 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/child_process_launcher_helper_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/child_process_launcher_helper_linux.cc
+@@ -22,7 +22,9 @@
+ #include "content/public/common/result_codes.h"
+ #include "content/public/common/sandboxed_process_launcher_delegate.h"
+ #include "content/public/common/zygote/sandbox_support_linux.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "content/public/common/zygote/zygote_handle.h"
++#endif
+ #include "sandbox/policy/linux/sandbox_linux.h"
+
+ namespace content {
+@@ -47,14 +49,20 @@ ChildProcessLauncherHelper::GetFilesToMa
+ }
+
+ bool ChildProcessLauncherHelper::IsUsingLaunchOptions() {
++#if !BUILDFLAG(IS_BSD)
+ return !GetZygoteForLaunch();
++#else
++ return true;
++#endif
+ }
+
+ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
+ PosixFileDescriptorInfo& files_to_register,
+ base::LaunchOptions* options) {
+ if (options) {
++#if !BUILDFLAG(IS_BSD)
+ DCHECK(!GetZygoteForLaunch());
++#endif
+ // Convert FD mapping to FileHandleMappingVector
+ options->fds_to_remap = files_to_register.GetMappingWithIDAdjustment(
+ base::GlobalDescriptors::kBaseDescriptor);
+@@ -66,7 +74,9 @@ bool ChildProcessLauncherHelper::BeforeL
+
+ options->environment = delegate_->GetEnvironment();
+ } else {
++#if !BUILDFLAG(IS_BSD)
+ DCHECK(GetZygoteForLaunch());
++#endif
+ // Environment variables could be supported in the future, but are not
+ // currently supported when launching with the zygote.
+ DCHECK(delegate_->GetEnvironment().empty());
+@@ -83,6 +93,7 @@ ChildProcessLauncherHelper::LaunchProces
+ int* launch_result) {
+ *is_synchronous_launch = true;
+ Process process;
++#if !BUILDFLAG(IS_BSD)
+ ZygoteCommunication* zygote_handle = GetZygoteForLaunch();
+ if (zygote_handle) {
+ // TODO(crbug.com/40448989): If chrome supported multiple zygotes they could
+@@ -93,7 +104,6 @@ ChildProcessLauncherHelper::LaunchProces
+ GetProcessType());
+ *launch_result = LAUNCH_RESULT_SUCCESS;
+
+-#if !BUILDFLAG(IS_OPENBSD)
+ if (handle) {
+ // It could be a renderer process or an utility process.
+ int oom_score = content::kMiscOomScore;
+@@ -102,15 +112,17 @@ ChildProcessLauncherHelper::LaunchProces
+ oom_score = content::kLowestRendererOomScore;
+ ZygoteHostImpl::GetInstance()->AdjustRendererOOMScore(handle, oom_score);
+ }
+-#endif
+
+ process.process = base::Process(handle);
+ process.zygote = zygote_handle;
+ } else {
++#endif
+ process.process = base::LaunchProcess(*command_line(), *options);
+ *launch_result = process.process.IsValid() ? LAUNCH_RESULT_SUCCESS
+ : LAUNCH_RESULT_FAILURE;
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+
+ #if BUILDFLAG(IS_CHROMEOS)
+ process_id_ = process.process.Pid();
+@@ -134,10 +146,14 @@ ChildProcessTerminationInfo ChildProcess
+ const ChildProcessLauncherHelper::Process& process,
+ bool known_dead) {
+ ChildProcessTerminationInfo info;
++#if !BUILDFLAG(IS_BSD)
+ if (process.zygote) {
+ info.status = process.zygote->GetTerminationStatus(
+ process.process.Handle(), known_dead, &info.exit_code);
+ } else if (known_dead) {
++#else
++ if (known_dead) {
++#endif
+ info.status = base::GetKnownDeadTerminationStatus(process.process.Handle(),
+ &info.exit_code);
+ } else {
+@@ -163,13 +179,17 @@ void ChildProcessLauncherHelper::ForceNo
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+ process.process.Terminate(RESULT_CODE_NORMAL_EXIT, false);
+ // On POSIX, we must additionally reap the child.
++#if !BUILDFLAG(IS_BSD)
+ if (process.zygote) {
+ // If the renderer was created via a zygote, we have to proxy the reaping
+ // through the zygote process.
+ process.zygote->EnsureProcessTerminated(process.process.Handle());
+ } else {
++#endif
+ base::EnsureProcessTerminated(std::move(process.process));
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+ }
+
+ void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread(
+@@ -182,11 +202,13 @@ void ChildProcessLauncherHelper::SetProc
+ }
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
+ ? nullptr
+ : delegate_->GetZygote();
+ }
++#endif
+
+ base::File OpenFileToShare(const base::FilePath& path,
+ base::MemoryMappedFile::Region* region) {
diff --git a/chromium-next/patches/patch-content_browser_child__thread__type__switcher__linux.cc b/chromium-next/patches/patch-content_browser_child__thread__type__switcher__linux.cc
new file mode 100644
index 0000000000..05409a6964
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_child__thread__type__switcher__linux.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/child_thread_type_switcher_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/child_thread_type_switcher_linux.cc
+@@ -20,6 +20,9 @@ void SetThreadTypeOnLauncherThread(base:
+ base::ThreadType thread_type) {
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+
++#if BUILDFLAG(IS_BSD)
++ NOTIMPLEMENTED();
++#else
+ bool ns_pid_supported = false;
+ pid_t peer_tid = base::FindThreadID(peer_pid, ns_tid, &ns_pid_supported);
+ if (peer_tid == -1) {
+@@ -39,6 +42,7 @@ void SetThreadTypeOnLauncherThread(base:
+
+ base::PlatformThread::SetThreadType(peer_pid, peer_tid, thread_type,
+ base::IsViaIPC(true));
++#endif
+ }
+
+ } // namespace
diff --git a/chromium-next/patches/patch-content_browser_compositor_viz__process__transport__factory.cc b/chromium-next/patches/patch-content_browser_compositor_viz__process__transport__factory.cc
new file mode 100644
index 0000000000..52d8b17c22
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_compositor_viz__process__transport__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/compositor/viz_process_transport_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/compositor/viz_process_transport_factory.cc
+@@ -110,7 +110,7 @@ class HostDisplayClient : public viz::Ho
+ HostDisplayClient& operator=(const HostDisplayClient&) = delete;
+
+ // viz::HostDisplayClient:
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void DidCompleteSwapWithNewSize(const gfx::Size& size) override {
+ compositor_->OnCompleteSwapWithNewSize(size);
+ }
diff --git a/chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.cc b/chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.cc
new file mode 100644
index 0000000000..4f39533cc3
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/devtools/devtools_frontend_host_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/devtools/devtools_frontend_host_impl.cc
+@@ -27,7 +27,7 @@
+ #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
+ #include "ui/base/webui/resource_path.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/crash/content/browser/error_reporting/javascript_error_report.h" // nogncheck
+ #include "components/crash/content/browser/error_reporting/js_error_report_processor.h" // nogncheck
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -42,7 +42,7 @@ const char kCompatibilityScriptSourceURL
+ "\n//# "
+ "sourceURL=devtools://devtools/bundled/devtools_compatibility.js";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Remove the pieces of the URL we don't want to send back with the error
+ // reports. In particular, do not send query or fragments as those can have
+ // privacy-sensitive information in them.
+@@ -112,7 +112,7 @@ DevToolsFrontendHostImpl::DevToolsFronte
+ const HandleMessageCallback& handle_message_callback)
+ : web_contents_(WebContents::FromRenderFrameHost(frame_host)),
+ handle_message_callback_(handle_message_callback) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ Observe(web_contents_);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ mojo::AssociatedRemote<blink::mojom::DevToolsFrontend> frontend;
+@@ -137,7 +137,7 @@ void DevToolsFrontendHostImpl::DispatchE
+ handle_message_callback_.Run(std::move(message));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void DevToolsFrontendHostImpl::OnDidAddMessageToConsole(
+ RenderFrameHost* source_frame,
+ blink::mojom::ConsoleMessageLevel log_level,
diff --git a/chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.h b/chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.h
new file mode 100644
index 0000000000..e93f70d645
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_devtools_devtools__frontend__host__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/devtools/devtools_frontend_host_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/devtools/devtools_frontend_host_impl.h
+@@ -34,7 +34,7 @@ class DevToolsFrontendHostImpl : public
+
+ void BadMessageReceived() override;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void OnDidAddMessageToConsole(
+ RenderFrameHost* source_frame,
+ blink::mojom::ConsoleMessageLevel log_level,
diff --git a/chromium-next/patches/patch-content_browser_devtools_protocol_system__info__handler.cc b/chromium-next/patches/patch-content_browser_devtools_protocol_system__info__handler.cc
new file mode 100644
index 0000000000..83123f972a
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_devtools_protocol_system__info__handler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/devtools/protocol/system_info_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/devtools/protocol/system_info_handler.cc
+@@ -51,7 +51,7 @@ std::unique_ptr<SystemInfo::Size> GfxSiz
+ // 1046598, and 1153667.
+ // Windows builds need more time -- see Issue 873112 and 1004472.
+ // Mac builds need more time - see Issue angleproject:6182.
+-#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !defined(NDEBUG)) || \
++#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && !defined(NDEBUG)) || \
+ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_OZONE)
+ static constexpr int kGPUInfoWatchdogTimeoutMultiplierOS = 3;
+ #else
diff --git a/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher.h b/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher.h
new file mode 100644
index 0000000000..e97783822e
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/file_system_access/file_path_watcher/file_path_watcher.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/file_system_access/file_path_watcher/file_path_watcher.h
+@@ -125,7 +125,7 @@ class CONTENT_EXPORT FilePathWatcher {
+ Type type = Type::kNonRecursive;
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // The callback will return the full path to a changed file instead of
+ // the watched path supplied as |path| when Watch is called.
+ // So the full path can be different from the watched path when a folder is
diff --git a/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__bsd.cc b/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__bsd.cc
new file mode 100644
index 0000000000..84885c4051
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__bsd.cc
@@ -0,0 +1,64 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/file_system_access/file_path_watcher/file_path_watcher_bsd.cc.orig 2025-01-20 18:01:27.894357975 +0000
++++ content/browser/file_system_access/file_path_watcher/file_path_watcher_bsd.cc
+@@ -0,0 +1,55 @@
++// Copyright 2024 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "content/browser/file_system_access/file_path_watcher/file_path_watcher.h"
++
++#include <memory>
++
++#include "base/memory/ptr_util.h"
++#include "build/build_config.h"
++#include "content/browser/file_system_access/file_path_watcher/file_path_watcher_kqueue.h"
++
++namespace content {
++
++namespace {
++
++class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
++ public:
++ FilePathWatcherImpl() = default;
++ FilePathWatcherImpl(const FilePathWatcherImpl&) = delete;
++ FilePathWatcherImpl& operator=(const FilePathWatcherImpl&) = delete;
++ ~FilePathWatcherImpl() override = default;
++
++ bool Watch(const base::FilePath& path,
++ Type type,
++ const FilePathWatcher::Callback& callback) override {
++ DCHECK(!impl_.get());
++ if (type == Type::kRecursive) {
++ if (!FilePathWatcher::RecursiveWatchAvailable()) {
++ return false;
++ }
++ } else {
++ impl_ = std::make_unique<FilePathWatcherKQueue>();
++ }
++ DCHECK(impl_.get());
++ return impl_->Watch(path, type, callback);
++ }
++
++ void Cancel() override {
++ if (impl_.get()) {
++ impl_->Cancel();
++ }
++ set_cancelled();
++ }
++
++ private:
++ std::unique_ptr<PlatformDelegate> impl_;
++};
++
++} // namespace
++
++FilePathWatcher::FilePathWatcher()
++ : FilePathWatcher(std::make_unique<FilePathWatcherImpl>()) {}
++
++} // namespace content
diff --git a/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__kqueue.h b/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__kqueue.h
new file mode 100644
index 0000000000..daee4b8609
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_file__system__access_file__path__watcher_file__path__watcher__kqueue.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/file_system_access/file_path_watcher/file_path_watcher_kqueue.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/file_system_access/file_path_watcher/file_path_watcher_kqueue.h
+@@ -5,6 +5,7 @@
+ #ifndef CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FILE_PATH_WATCHER_FILE_PATH_WATCHER_KQUEUE_H_
+ #define CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FILE_PATH_WATCHER_FILE_PATH_WATCHER_KQUEUE_H_
+
++#include <sys/time.h>
+ #include <sys/event.h>
+
+ #include <memory>
diff --git a/chromium-next/patches/patch-content_browser_file__system__access_file__system__access__local__path__watcher.cc b/chromium-next/patches/patch-content_browser_file__system__access_file__system__access__local__path__watcher.cc
new file mode 100644
index 0000000000..26ddf813a7
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_file__system__access_file__system__access__local__path__watcher.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/file_system_access/file_system_access_local_path_watcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/file_system_access/file_system_access_local_path_watcher.cc
+@@ -67,7 +67,7 @@ void FileSystemAccessLocalPathWatcher::I
+ .type = scope().IsRecursive() ? FilePathWatcher::Type::kRecursive
+ : FilePathWatcher::Type::kNonRecursive,
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Note: `report_modified_path` is also present on Android
+ // and Fuchsia. Update this switch if support for watching
+ // the local file system is added on those platforms.
diff --git a/chromium-next/patches/patch-content_browser_font__access_font__enumeration__data__source.cc b/chromium-next/patches/patch-content_browser_font__access_font__enumeration__data__source.cc
new file mode 100644
index 0000000000..410477176d
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_font__access_font__enumeration__data__source.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/font_access/font_enumeration_data_source.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/font_access/font_enumeration_data_source.cc
+@@ -16,7 +16,7 @@
+ #include "content/browser/font_access/font_enumeration_data_source_win.h"
+ #elif BUILDFLAG(IS_APPLE)
+ #include "content/browser/font_access/font_enumeration_data_source_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/browser/font_access/font_enumeration_data_source_linux.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+@@ -61,7 +61,7 @@ std::unique_ptr<FontEnumerationDataSourc
+ return std::make_unique<FontEnumerationDataSourceWin>();
+ #elif BUILDFLAG(IS_APPLE)
+ return std::make_unique<FontEnumerationDataSourceMac>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<FontEnumerationDataSourceLinux>();
+ #else
+ return std::make_unique<FontEnumerationDataSourceNull>();
+@@ -76,7 +76,7 @@ bool FontEnumerationDataSource::IsOsSupp
+ return true;
+ #elif BUILDFLAG(IS_APPLE)
+ return true;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-content_browser_gpu_compositor__util.cc b/chromium-next/patches/patch-content_browser_gpu_compositor__util.cc
new file mode 100644
index 0000000000..c9fa35cdc2
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_compositor__util.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/compositor_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/compositor_util.cc
+@@ -153,7 +153,7 @@ std::vector<GpuFeatureData> GetGpuFeatur
+ "video_decode",
+ SafeGetFeatureStatus(
+ gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE,
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ !base::FeatureList::IsEnabled(media::kAcceleratedVideoDecodeLinux) ||
+ #endif // BUILDFLAG(IS_LINUX)
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode)),
+@@ -165,7 +165,7 @@ std::vector<GpuFeatureData> GetGpuFeatur
+ "video_encode",
+ SafeGetFeatureStatus(
+ gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE,
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ !base::FeatureList::IsEnabled(media::kAcceleratedVideoEncodeLinux)),
+ #else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoEncode)),
diff --git a/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.cc b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.cc
new file mode 100644
index 0000000000..e51c50436a
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/gpu_data_manager_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/gpu_data_manager_impl.cc
+@@ -402,7 +402,7 @@ void GpuDataManagerImpl::OnDisplayMetric
+ private_->OnDisplayMetricsChanged(display, changed_metrics);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool GpuDataManagerImpl::IsGpuMemoryBufferNV12Supported() {
+ base::AutoLock auto_lock(lock_);
+ return private_->IsGpuMemoryBufferNV12Supported();
diff --git a/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.h b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.h
new file mode 100644
index 0000000000..07ef3bfb90
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/gpu_data_manager_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/gpu_data_manager_impl.h
+@@ -220,7 +220,7 @@ class CONTENT_EXPORT GpuDataManagerImpl
+ void OnDisplayMetricsChanged(const display::Display& display,
+ uint32_t changed_metrics) override;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool IsGpuMemoryBufferNV12Supported();
+ void SetGpuMemoryBufferNV12Supported(bool supported);
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.cc b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.cc
new file mode 100644
index 0000000000..5531614d76
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/gpu_data_manager_impl_private.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/gpu_data_manager_impl_private.cc
+@@ -1675,7 +1675,7 @@ void GpuDataManagerImplPrivate::RecordCo
+ UMA_HISTOGRAM_ENUMERATION("GPU.CompositingMode", compositing_mode);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool GpuDataManagerImplPrivate::IsGpuMemoryBufferNV12Supported() {
+ return is_gpu_memory_buffer_NV12_supported_;
+ }
diff --git a/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.h b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.h
new file mode 100644
index 0000000000..bcef993a10
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_gpu__data__manager__impl__private.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/gpu_data_manager_impl_private.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/gpu_data_manager_impl_private.h
+@@ -147,7 +147,7 @@ class CONTENT_EXPORT GpuDataManagerImplP
+ void OnDisplayMetricsChanged(const display::Display& display,
+ uint32_t changed_metrics);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool IsGpuMemoryBufferNV12Supported();
+ void SetGpuMemoryBufferNV12Supported(bool supported);
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -311,7 +311,7 @@ class CONTENT_EXPORT GpuDataManagerImplP
+ bool application_is_visible_ = true;
+
+ bool disable_gpu_compositing_ = false;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool is_gpu_memory_buffer_NV12_supported_ = false;
+ #endif // BUILDFLAG(IS_LINUX)
+ };
diff --git a/chromium-next/patches/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc b/chromium-next/patches/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc
new file mode 100644
index 0000000000..7f07b6dfbb
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_gpu__memory__buffer__manager__singleton.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/gpu_memory_buffer_manager_singleton.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/gpu_memory_buffer_manager_singleton.cc
+@@ -46,7 +46,7 @@ scoped_refptr<base::SingleThreadTaskRunn
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool IsGpuMemoryBufferNV12Supported() {
+ static bool is_computed = false;
+ static bool supported = false;
+@@ -111,7 +111,7 @@ void GpuMemoryBufferManagerSingleton::Re
+ }
+
+ void GpuMemoryBufferManagerSingleton::OnGpuExtraInfoUpdate() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Dynamic check whether the NV12 format is supported as it may be
+ // inconsistent between the system GBM (Generic Buffer Management) and
+ // chromium miniGBM.
diff --git a/chromium-next/patches/patch-content_browser_gpu_gpu__process__host.cc b/chromium-next/patches/patch-content_browser_gpu_gpu__process__host.cc
new file mode 100644
index 0000000000..50ef95bb07
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_gpu_gpu__process__host.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/gpu/gpu_process_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/gpu/gpu_process_host.cc
+@@ -275,6 +275,7 @@ static const char* const kSwitchNames[]
+ switches::kDisableSkiaGraphite,
+ switches::kDisableSkiaGraphitePrecompilation,
+ switches::kDisableLowEndDeviceMode,
++ switches::kDisableUnveil,
+ switches::kProfilingAtStart,
+ switches::kProfilingFile,
+ switches::kProfilingFlush,
+@@ -302,7 +303,7 @@ static const char* const kSwitchNames[]
+ switches::kOzoneDumpFile,
+ switches::kEnableNativeGpuMemoryBuffers,
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ switches::kX11Display,
+ switches::kNoXshm,
+ #endif
diff --git a/chromium-next/patches/patch-content_browser_media_frameless__media__interface__proxy.h b/chromium-next/patches/patch-content_browser_media_frameless__media__interface__proxy.h
new file mode 100644
index 0000000000..302419c921
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_media_frameless__media__interface__proxy.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/media/frameless_media_interface_proxy.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/media/frameless_media_interface_proxy.h
+@@ -19,7 +19,7 @@
+ #include "mojo/public/cpp/bindings/receiver_set.h"
+ #include "mojo/public/cpp/bindings/remote.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "media/mojo/mojom/stable/stable_video_decoder.mojom.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -105,7 +105,7 @@ class FramelessMediaInterfaceProxy final
+ // Connections to the renderer.
+ mojo::ReceiverSet<media::mojom::InterfaceFactory> receivers_;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Connection to the StableVideoDecoderFactory that lives in a utility
+ // process. This is only used for out-of-process video decoding and only when
+ // the FramelessMediaInterfaceProxy is created without a RenderProcessHost
diff --git a/chromium-next/patches/patch-content_browser_media_media__keys__listener__manager__impl.cc b/chromium-next/patches/patch-content_browser_media_media__keys__listener__manager__impl.cc
new file mode 100644
index 0000000000..665f99c1c7
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_media_media__keys__listener__manager__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/media/media_keys_listener_manager_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/media/media_keys_listener_manager_impl.cc
+@@ -333,7 +333,7 @@ void MediaKeysListenerManagerImpl::Start
+ return;
+ }
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_WIN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) || BUILDFLAG(IS_WIN)
+ // Create SystemMediaControls with the SingletonHwnd.
+ browser_system_media_controls_ =
+ system_media_controls::SystemMediaControls::Create(
diff --git a/chromium-next/patches/patch-content_browser_network__service__instance__impl.cc b/chromium-next/patches/patch-content_browser_network__service__instance__impl.cc
new file mode 100644
index 0000000000..245c72cc43
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_network__service__instance__impl.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/network_service_instance_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/network_service_instance_impl.cc
+@@ -85,7 +85,7 @@
+ #include "content/browser/network/network_service_process_tracker_win.h"
+ #endif
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/browser/system_dns_resolution/system_dns_resolver.h"
+ #include "services/network/public/mojom/system_dns_resolution.mojom-forward.h"
+ #endif
+@@ -368,7 +368,7 @@ void CreateInProcessNetworkService(
+ std::move(receiver)));
+ }
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Runs a self-owned SystemDnsResolverMojoImpl. This is meant to run on a
+ // high-priority thread pool.
+ void RunSystemDnsResolverOnThreadPool(
+@@ -437,7 +437,7 @@ network::mojom::NetworkServiceParamsPtr
+ }
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (GetContentClient()
+ ->browser()
+ ->ShouldRunOutOfProcessSystemDnsResolution() &&
diff --git a/chromium-next/patches/patch-content_browser_ppapi__plugin__process__host__receiver__bindings.cc b/chromium-next/patches/patch-content_browser_ppapi__plugin__process__host__receiver__bindings.cc
new file mode 100644
index 0000000000..8dbe970c79
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_ppapi__plugin__process__host__receiver__bindings.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/ppapi_plugin_process_host_receiver_bindings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/ppapi_plugin_process_host_receiver_bindings.cc
+@@ -8,7 +8,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck
+ #include "content/browser/font_service.h" // nogncheck
+ #endif
+@@ -17,7 +17,7 @@ namespace content {
+
+ void PpapiPluginProcessHost::BindHostReceiver(
+ mojo::GenericPendingReceiver receiver) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto font_receiver = receiver.As<font_service::mojom::FontService>())
+ ConnectToFontService(std::move(font_receiver));
+ #endif
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_delegated__frame__host.cc b/chromium-next/patches/patch-content_browser_renderer__host_delegated__frame__host.cc
new file mode 100644
index 0000000000..aec40f614c
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_delegated__frame__host.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/delegated_frame_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/delegated_frame_host.cc
+@@ -318,7 +318,7 @@ void DelegatedFrameHost::EmbedSurface(
+
+ if (!primary_surface_id ||
+ primary_surface_id->local_surface_id() != local_surface_id_) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // On Windows and Linux, we would like to produce new content as soon as
+ // possible or the OS will create an additional black gutter. Until we can
+ // block resize on surface synchronization on these platforms, we will not
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_media_service__video__capture__device__launcher.cc b/chromium-next/patches/patch-content_browser_renderer__host_media_service__video__capture__device__launcher.cc
new file mode 100644
index 0000000000..bf87380dd8
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_media_service__video__capture__device__launcher.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/media/service_video_capture_device_launcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/media/service_video_capture_device_launcher.cc
+@@ -25,7 +25,7 @@
+ #include "media/base/media_switches.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "content/browser/gpu/gpu_data_manager_impl.h"
+ #endif
+
+@@ -173,7 +173,7 @@ void ServiceVideoCaptureDeviceLauncher::
+ }
+ #else
+ if (switches::IsVideoCaptureUseGpuMemoryBufferEnabled()) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Linux, additionally check whether the NV12 GPU memory buffer is
+ // supported.
+ if (GpuDataManagerImpl::GetInstance()->IsGpuMemoryBufferNV12Supported())
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_pepper_pepper__file__io__host.cc b/chromium-next/patches/patch-content_browser_renderer__host_pepper_pepper__file__io__host.cc
new file mode 100644
index 0000000000..d101c0f741
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_pepper_pepper__file__io__host.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/pepper/pepper_file_io_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/pepper/pepper_file_io_host.cc
+@@ -462,7 +462,7 @@ void PepperFileIOHost::OnLocalFileOpened
+ ppapi::host::ReplyMessageContext reply_context,
+ const base::FilePath& path,
+ base::File::Error error_code) {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Quarantining a file before its contents are available is only supported on
+ // Windows and Linux.
+ if (!FileOpenForWrite(open_flags_) || error_code != base::File::FILE_OK) {
+@@ -496,7 +496,7 @@ void PepperFileIOHost::OnLocalFileOpened
+ #endif
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void PepperFileIOHost::OnLocalFileQuarantined(
+ ppapi::host::ReplyMessageContext reply_context,
+ const base::FilePath& path,
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl.h b/chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl.h
new file mode 100644
index 0000000000..98fc7716d4
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/render_process_host_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/render_process_host_impl.h
+@@ -102,7 +102,7 @@
+ #include "media/fuchsia_media_codec_provider_impl.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/browser/child_thread_type_switcher_linux.h"
+ #include "media/mojo/mojom/video_encode_accelerator.mojom.h"
+ #endif
+@@ -973,7 +973,7 @@ class CONTENT_EXPORT RenderProcessHostIm
+ std::unique_ptr<service_manager::BinderRegistry> binders_;
+ mojo::Receiver<mojom::ChildProcessHost> receiver_{this};
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::Remote<media::mojom::VideoEncodeAcceleratorProviderFactory>
+ video_encode_accelerator_factory_remote_;
+ ChildThreadTypeSwitcher child_thread_type_switcher_;
+@@ -1219,7 +1219,7 @@ class CONTENT_EXPORT RenderProcessHostIm
+ // if the request isn't handled on the IO thread.
+ void OnBindHostReceiver(mojo::GenericPendingReceiver receiver);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Provides /proc/{renderer pid}/status and statm files for the renderer,
+ // because the files are required to calculate the renderer's private
+ // footprint on Chromium Linux. Regarding MacOS X and Windows, we have
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl__receiver__bindings.cc b/chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl__receiver__bindings.cc
new file mode 100644
index 0000000000..656644d1c6
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_render__process__host__impl__receiver__bindings.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/render_process_host_impl_receiver_bindings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/render_process_host_impl_receiver_bindings.cc
+@@ -52,7 +52,7 @@
+ #include "third_party/blink/public/mojom/webdatabase/web_database.mojom.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck
+ #include "content/browser/font_service.h" // nogncheck
+ #include "content/browser/media/video_encode_accelerator_provider_launcher.h"
+@@ -341,7 +341,7 @@ void RenderProcessHostImpl::IOThreadHost
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto font_receiver = receiver.As<font_service::mojom::FontService>()) {
+ ConnectToFontService(std::move(font_receiver));
+ return;
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_render__view__host__impl.cc b/chromium-next/patches/patch-content_browser_renderer__host_render__view__host__impl.cc
new file mode 100644
index 0000000000..3386a6eac7
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_render__view__host__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/render_view_host_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/render_view_host_impl.cc
+@@ -274,7 +274,7 @@ void RenderViewHostImpl::GetPlatformSpec
+ display::win::ScreenWin::GetSystemMetricsInDIP(SM_CYVSCROLL);
+ prefs->arrow_bitmap_width_horizontal_scroll_bar_in_dips =
+ display::win::ScreenWin::GetSystemMetricsInDIP(SM_CXHSCROLL);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kSystemFontFamily)) {
+ prefs->system_font_family_name =
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.cc b/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.cc
new file mode 100644
index 0000000000..76845016ce
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/render_widget_host_view_aura.cc
+@@ -122,7 +122,7 @@
+ #include "ui/gfx/gdi_util.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/accessibility/platform/browser_accessibility_auralinux.h"
+ #include "ui/base/ime/linux/text_edit_command_auralinux.h"
+ #include "ui/base/ime/text_input_flags.h"
+@@ -485,7 +485,7 @@ gfx::NativeViewAccessible RenderWidgetHo
+ return ToBrowserAccessibilityWin(manager->GetBrowserAccessibilityRoot())
+ ->GetCOM();
+
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ui::BrowserAccessibilityManager* manager =
+ host()->GetOrCreateRootBrowserAccessibilityManager();
+ if (manager && manager->GetBrowserAccessibilityRoot())
+@@ -1773,7 +1773,7 @@ bool RenderWidgetHostViewAura::ShouldDoL
+ return host() && host()->delegate() && host()->delegate()->ShouldDoLearning();
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool RenderWidgetHostViewAura::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
+@@ -2736,7 +2736,7 @@ bool RenderWidgetHostViewAura::NeedsInpu
+ }
+
+ bool RenderWidgetHostViewAura::NeedsMouseCapture() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return NeedsInputGrab();
+ #else
+ return false;
+@@ -2920,7 +2920,7 @@ void RenderWidgetHostViewAura::ForwardKe
+ if (!target_host)
+ return;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* linux_ui = ui::LinuxUi::instance();
+ std::vector<ui::TextEditCommandAuraLinux> commands;
+ if (!event.skip_if_unhandled && linux_ui && event.os_event &&
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.h b/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.h
new file mode 100644
index 0000000000..1f8ff64e90
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__aura.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/render_widget_host_view_aura.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/render_widget_host_view_aura.h
+@@ -275,7 +275,7 @@ class CONTENT_EXPORT RenderWidgetHostVie
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
diff --git a/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__event__handler.cc b/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__event__handler.cc
new file mode 100644
index 0000000000..41a7704366
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_renderer__host_render__widget__host__view__event__handler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/renderer_host/render_widget_host_view_event_handler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/renderer_host/render_widget_host_view_event_handler.cc
+@@ -602,7 +602,7 @@ bool RenderWidgetHostViewEventHandler::C
+ if (event->type() == ui::EventType::kMouseExited) {
+ if (mouse_locked || selection_popup)
+ return false;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Don't forward the mouse leave message which is received when the context
+ // menu is displayed by the page. This confuses the page and causes state
+ // changes.
diff --git a/chromium-next/patches/patch-content_browser_sandbox__host__linux.cc b/chromium-next/patches/patch-content_browser_sandbox__host__linux.cc
new file mode 100644
index 0000000000..74b300ebb3
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_sandbox__host__linux.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/sandbox_host_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/sandbox_host_linux.cc
+@@ -45,6 +45,7 @@ void SandboxHostLinux::Init() {
+ // Instead, it replies on a temporary socket provided by the caller.
+ PCHECK(0 == shutdown(browser_socket, SHUT_WR)) << "shutdown";
+
++#if !BUILDFLAG(IS_BSD)
+ int pipefds[2];
+ CHECK(0 == pipe(pipefds));
+ const int child_lifeline_fd = pipefds[0];
+@@ -55,6 +56,7 @@ void SandboxHostLinux::Init() {
+ ipc_thread_ = std::make_unique<base::DelegateSimpleThread>(
+ ipc_handler_.get(), "sandbox_ipc_thread");
+ ipc_thread_->Start();
++#endif
+ }
+
+ } // namespace content
diff --git a/chromium-next/patches/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc b/chromium-next/patches/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc
new file mode 100644
index 0000000000..1ccb7dbc8d
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/scheduler/responsiveness/jank_monitor_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/scheduler/responsiveness/jank_monitor_impl.cc
+@@ -340,7 +340,7 @@ void JankMonitorImpl::ThreadExecutionSta
+ // in context menus, among others). Simply ignore the mismatches for now.
+ // See https://crbug.com/929813 for the details of why the mismatch
+ // happens.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(IS_OZONE)
+ task_execution_metadata_.clear();
+ #endif
diff --git a/chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.cc b/chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.cc
new file mode 100644
index 0000000000..1d1b604465
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/scheduler/responsiveness/native_event_observer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/scheduler/responsiveness/native_event_observer.cc
+@@ -15,7 +15,7 @@
+
+ #include "ui/events/platform/platform_event_source.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/aura/env.h"
+ #include "ui/events/event.h"
+ #endif
+@@ -39,7 +39,7 @@ NativeEventObserver::~NativeEventObserve
+ DeregisterObserver();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void NativeEventObserver::RegisterObserver() {
+ aura::Env::GetInstance()->AddWindowEventDispatcherObserver(this);
+ }
diff --git a/chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.h b/chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.h
new file mode 100644
index 0000000000..2fba1e02c6
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_scheduler_responsiveness_native__event__observer.h
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/scheduler/responsiveness/native_event_observer.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/scheduler/responsiveness/native_event_observer.h
+@@ -16,7 +16,7 @@
+ #include "content/public/browser/native_event_processor_observer_mac.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/aura/window_event_dispatcher_observer.h"
+ #endif
+
+@@ -41,7 +41,7 @@ namespace responsiveness {
+ class CONTENT_EXPORT NativeEventObserver
+ #if BUILDFLAG(IS_MAC)
+ : public NativeEventProcessorObserver
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ : public aura::WindowEventDispatcherObserver
+ #elif BUILDFLAG(IS_WIN)
+ : public base::MessagePumpForUI::Observer
+@@ -58,7 +58,7 @@ class CONTENT_EXPORT NativeEventObserver
+ NativeEventObserver(WillRunEventCallback will_run_event_callback,
+ DidRunEventCallback did_run_event_callback);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ NativeEventObserver(const NativeEventObserver&) = delete;
+ NativeEventObserver& operator=(const NativeEventObserver&) = delete;
+@@ -74,7 +74,7 @@ class CONTENT_EXPORT NativeEventObserver
+ // Exposed for tests.
+ void WillRunNativeEvent(const void* opaque_identifier) override;
+ void DidRunNativeEvent(const void* opaque_identifier) override;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // aura::WindowEventDispatcherObserver overrides:
+ void OnWindowEventDispatcherStartedProcessing(
+ aura::WindowEventDispatcher* dispatcher,
+@@ -91,7 +91,7 @@ class CONTENT_EXPORT NativeEventObserver
+ void RegisterObserver();
+ void DeregisterObserver();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ struct EventInfo {
+ raw_ptr<const void> unique_id;
+ };
diff --git a/chromium-next/patches/patch-content_browser_utility__process__host.cc b/chromium-next/patches/patch-content_browser_utility__process__host.cc
new file mode 100644
index 0000000000..455ed0af33
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_utility__process__host.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/utility_process_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/utility_process_host.cc
+@@ -62,7 +62,7 @@
+ #include "content/browser/v8_snapshot_files.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/file_util.h"
+ #include "base/files/scoped_file.h"
+ #include "base/pickle.h"
+@@ -86,7 +86,7 @@ namespace content {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::ScopedFD PassNetworkContextParentDirs(
+ std::vector<base::FilePath> network_context_parent_dirs) {
+ base::Pickle pickle;
+@@ -347,7 +347,7 @@ bool UtilityProcessHost::StartProcess()
+ switches::kMuteAudio,
+ switches::kUseFileForFakeAudioCapture,
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD) || \
+- BUILDFLAG(IS_SOLARIS)
++ BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_NETBSD)
+ switches::kAlsaInputDevice,
+ switches::kAlsaOutputDevice,
+ #endif
+@@ -403,7 +403,7 @@ bool UtilityProcessHost::StartProcess()
+ file_data_->files_to_preload.merge(GetV8SnapshotFilesToPreload(*cmd_line));
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The network service should have access to the parent directories
+ // necessary for its usage.
+ if (sandbox_type_ == sandbox::mojom::Sandbox::kNetwork) {
+@@ -420,7 +420,7 @@ bool UtilityProcessHost::StartProcess()
+ if (metrics_name_ == video_capture::mojom::VideoCaptureService::Name_) {
+ bool pass_gpu_buffer_flag =
+ switches::IsVideoCaptureUseGpuMemoryBufferEnabled();
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Check if NV12 GPU memory buffer supported at the same time.
+ pass_gpu_buffer_flag =
+ pass_gpu_buffer_flag &&
diff --git a/chromium-next/patches/patch-content_browser_utility__process__host__receiver__bindings.cc b/chromium-next/patches/patch-content_browser_utility__process__host__receiver__bindings.cc
new file mode 100644
index 0000000000..91296176c9
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_utility__process__host__receiver__bindings.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/utility_process_host_receiver_bindings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/utility_process_host_receiver_bindings.cc
+@@ -10,7 +10,7 @@
+ #include "content/public/common/content_client.h"
+ #include "media/media_buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck
+ #include "content/browser/font_service.h" // nogncheck
+ #endif
+@@ -24,7 +24,7 @@ namespace content {
+
+ void UtilityProcessHost::BindHostReceiver(
+ mojo::GenericPendingReceiver receiver) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (auto font_receiver = receiver.As<font_service::mojom::FontService>()) {
+ ConnectToFontService(std::move(font_receiver));
+ return;
diff --git a/chromium-next/patches/patch-content_browser_utility__sandbox__delegate.cc b/chromium-next/patches/patch-content_browser_utility__sandbox__delegate.cc
new file mode 100644
index 0000000000..ff924486a0
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_utility__sandbox__delegate.cc
@@ -0,0 +1,56 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/utility_sandbox_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/utility_sandbox_delegate.cc
+@@ -83,10 +83,10 @@ UtilitySandboxedProcessLauncherDelegate:
+ #if BUILDFLAG(IS_FUCHSIA)
+ sandbox_type_ == sandbox::mojom::Sandbox::kVideoCapture ||
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kHardwareVideoDecoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kHardwareVideoEncoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -100,10 +100,10 @@ UtilitySandboxedProcessLauncherDelegate:
+ #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
+ sandbox_type_ == sandbox::mojom::Sandbox::kScreenAI ||
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kVideoEffects ||
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kOnDeviceTranslation ||
+ #endif
+ sandbox_type_ == sandbox::mojom::Sandbox::kAudio ||
+@@ -149,10 +149,10 @@ ZygoteCommunication* UtilitySandboxedPro
+ // process upon startup.
+ if (sandbox_type_ == sandbox::mojom::Sandbox::kNetwork ||
+ sandbox_type_ == sandbox::mojom::Sandbox::kOnDeviceModelExecution ||
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kHardwareVideoDecoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kHardwareVideoEncoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -170,7 +170,7 @@ ZygoteCommunication* UtilitySandboxedPro
+ #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
+ sandbox_type_ == sandbox::mojom::Sandbox::kScreenAI ||
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ sandbox_type_ == sandbox::mojom::Sandbox::kVideoEffects ||
+ sandbox_type_ == sandbox::mojom::Sandbox::kOnDeviceTranslation ||
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-content_browser_v8__snapshot__files.cc b/chromium-next/patches/patch-content_browser_v8__snapshot__files.cc
new file mode 100644
index 0000000000..61fc533887
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_v8__snapshot__files.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/v8_snapshot_files.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/v8_snapshot_files.cc
+@@ -17,7 +17,7 @@ namespace content {
+ std::map<std::string, absl::variant<base::FilePath, base::ScopedFD>>
+ GetV8SnapshotFilesToPreload(base::CommandLine& process_command_line) {
+ std::map<std::string, absl::variant<base::FilePath, base::ScopedFD>> files;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(USE_V8_CONTEXT_SNAPSHOT)
+ files[kV8ContextSnapshotDataDescriptor] = base::FilePath(
+ FILE_PATH_LITERAL(BUILDFLAG(V8_CONTEXT_SNAPSHOT_FILENAME)));
diff --git a/chromium-next/patches/patch-content_browser_web__contents_slow__web__preference__cache.cc b/chromium-next/patches/patch-content_browser_web__contents_slow__web__preference__cache.cc
new file mode 100644
index 0000000000..5a1254863d
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_web__contents_slow__web__preference__cache.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/web_contents/slow_web_preference_cache.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/web_contents/slow_web_preference_cache.cc
+@@ -16,7 +16,7 @@
+
+ #if BUILDFLAG(IS_WIN)
+ #include "ui/events/devices/input_device_observer_win.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/events/devices/device_data_manager.h"
+ #elif BUILDFLAG(IS_ANDROID)
+ #include "ui/base/device_form_factor.h"
+@@ -54,7 +54,7 @@ SlowWebPreferenceCache::SlowWebPreferenc
+
+ #if BUILDFLAG(IS_WIN)
+ ui::InputDeviceObserverWin::GetInstance()->AddObserver(this);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ui::DeviceDataManager::GetInstance()->AddObserver(this);
+ #elif BUILDFLAG(IS_ANDROID)
+ ui::InputDeviceObserverAndroid::GetInstance()->AddObserver(this);
+@@ -64,7 +64,7 @@ SlowWebPreferenceCache::SlowWebPreferenc
+ SlowWebPreferenceCache::~SlowWebPreferenceCache() {
+ #if BUILDFLAG(IS_WIN)
+ ui::InputDeviceObserverWin::GetInstance()->RemoveObserver(this);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ui::DeviceDataManager::GetInstance()->RemoveObserver(this);
+ #elif BUILDFLAG(IS_ANDROID)
+ ui::InputDeviceObserverAndroid::GetInstance()->RemoveObserver(this);
diff --git a/chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura.cc b/chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura.cc
new file mode 100644
index 0000000000..06009fb780
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/web_contents/web_contents_view_aura.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/web_contents/web_contents_view_aura.cc
+@@ -174,7 +174,7 @@ class WebDragSourceAura : public content
+ raw_ptr<aura::Window> window_;
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Fill out the OSExchangeData with a file contents, synthesizing a name if
+ // necessary.
+ void PrepareDragForFileContents(const DropData& drop_data,
+@@ -258,7 +258,7 @@ void PrepareDragData(const DropData& dro
+ if (!drop_data.download_metadata.empty())
+ PrepareDragForDownload(drop_data, provider, web_contents);
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // We set the file contents before the URL because the URL also sets file
+ // contents (to a .URL shortcut). We want to prefer file content data over
+ // a shortcut so we add it first.
+@@ -1326,7 +1326,7 @@ void WebContentsViewAura::OnMouseEvent(u
+ // Linux window managers like to handle raise-on-click themselves. If we
+ // raise-on-click manually, this may override user settings that prevent
+ // focus-stealing.
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // It is possible for the web-contents to be destroyed while it is being
+ // activated. Use a weak-ptr to track whether that happened or not.
+ // More in https://crbug.com/1040725
diff --git a/chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura__unittest.cc b/chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura__unittest.cc
new file mode 100644
index 0000000000..04c78a6951
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_web__contents_web__contents__view__aura__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/web_contents/web_contents_view_aura_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/web_contents/web_contents_view_aura_unittest.cc
+@@ -97,7 +97,7 @@ class TestDragDropClient : public aura::
+ drag_drop_data_ = std::move(data);
+ return DragOperation::kCopy;
+ }
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void UpdateDragImage(const gfx::ImageSkia& image,
+ const gfx::Vector2d& offset) override {}
+ #endif
diff --git a/chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.cc b/chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.cc
new file mode 100644
index 0000000000..ddb3986723
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/webui/web_ui_main_frame_observer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/webui/web_ui_main_frame_observer.cc
+@@ -14,7 +14,7 @@
+ #include "content/public/browser/navigation_handle.h"
+ #include "content/public/browser/web_ui_controller.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/feature_list.h"
+ #include "base/functional/callback_helpers.h"
+ #include "base/logging.h"
+@@ -32,7 +32,7 @@ namespace content {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Remove the pieces of the URL we don't want to send back with the error
+ // reports. In particular, do not send query or fragments as those can have
+ // privacy-sensitive information in them.
+@@ -56,7 +56,7 @@ WebUIMainFrameObserver::WebUIMainFrameOb
+
+ WebUIMainFrameObserver::~WebUIMainFrameObserver() = default;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void WebUIMainFrameObserver::OnDidAddMessageToConsole(
+ RenderFrameHost* source_frame,
+ blink::mojom::ConsoleMessageLevel log_level,
+@@ -171,7 +171,7 @@ void WebUIMainFrameObserver::ReadyToComm
+
+ // TODO(crbug.com/40149439) This is currently disabled due to Windows DLL
+ // thunking issues. Fix & re-enable.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ MaybeEnableWebUIJavaScriptErrorReporting(navigation_handle);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ }
diff --git a/chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.h b/chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.h
new file mode 100644
index 0000000000..6d21646123
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_webui_web__ui__main__frame__observer.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/webui/web_ui_main_frame_observer.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/webui/web_ui_main_frame_observer.h
+@@ -44,7 +44,7 @@ class CONTENT_EXPORT WebUIMainFrameObser
+
+ // TODO(crbug.com/40149439) This is currently disabled due to Windows DLL
+ // thunking issues. Fix & re-enable.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On official Google builds, capture and report JavaScript error messages on
+ // WebUI surfaces back to Google. This allows us to fix JavaScript errors and
+ // exceptions.
+@@ -64,7 +64,7 @@ class CONTENT_EXPORT WebUIMainFrameObser
+ private:
+ const GURL& GetUrlForLogging() const;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void MaybeEnableWebUIJavaScriptErrorReporting(
+ NavigationHandle* navigation_handle);
+
diff --git a/chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.cc b/chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.cc
new file mode 100644
index 0000000000..4380d4b5c2
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.cc
@@ -0,0 +1,87 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/zygote_host/zygote_host_impl_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/zygote_host/zygote_host_impl_linux.cc
+@@ -19,8 +19,10 @@
+ #include "build/chromeos_buildflags.h"
+ #include "content/common/zygote/zygote_commands_linux.h"
+ #include "content/common/zygote/zygote_communication_linux.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "content/common/zygote/zygote_handle_impl_linux.h"
+ #include "content/public/common/zygote/zygote_handle.h"
++#endif
+ #include "sandbox/linux/services/credentials.h"
+ #include "sandbox/linux/services/namespace_sandbox.h"
+ #include "sandbox/linux/suid/client/setuid_sandbox_host.h"
+@@ -38,6 +40,7 @@ namespace content {
+
+ namespace {
+
++#if !BUILDFLAG(IS_BSD)
+ // Receive a fixed message on fd and return the sender's PID.
+ // Returns true if the message received matches the expected message.
+ bool ReceiveFixedMessage(int fd,
+@@ -60,6 +63,7 @@ bool ReceiveFixedMessage(int fd,
+ return false;
+ return true;
+ }
++#endif
+
+ } // namespace
+
+@@ -69,9 +73,13 @@ ZygoteHost* ZygoteHost::GetInstance() {
+ }
+
+ ZygoteHostImpl::ZygoteHostImpl()
++#if !BUILDFLAG(IS_BSD)
+ : use_namespace_sandbox_(false),
+ use_suid_sandbox_(false),
+ use_suid_sandbox_for_adj_oom_score_(false),
++#else
++ :
++#endif
+ sandbox_binary_(),
+ zygote_pids_lock_(),
+ zygote_pids_() {}
+@@ -84,6 +92,7 @@ ZygoteHostImpl* ZygoteHostImpl::GetInsta
+ }
+
+ void ZygoteHostImpl::Init(const base::CommandLine& command_line) {
++#if !BUILDFLAG(IS_BSD)
+ if (command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) {
+ return;
+ }
+@@ -138,6 +147,7 @@ void ZygoteHostImpl::Init(const base::Co
+ "you can try using --"
+ << sandbox::policy::switches::kNoSandbox << ".";
+ }
++#endif
+ }
+
+ void ZygoteHostImpl::AddZygotePid(pid_t pid) {
+@@ -162,6 +172,7 @@ pid_t ZygoteHostImpl::LaunchZygote(
+ base::CommandLine* cmd_line,
+ base::ScopedFD* control_fd,
+ base::FileHandleMappingVector additional_remapped_fds) {
++#if !BUILDFLAG(IS_BSD)
+ int fds[2];
+ CHECK_EQ(0, socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, fds));
+ CHECK(base::UnixDomainSocket::EnableReceiveProcessId(fds[0]));
+@@ -230,9 +241,12 @@ pid_t ZygoteHostImpl::LaunchZygote(
+
+ AddZygotePid(pid);
+ return pid;
++#else
++ return 0;
++#endif
+ }
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ void ZygoteHostImpl::AdjustRendererOOMScore(base::ProcessHandle pid,
+ int score) {
+ // 1) You can't change the oom_score_adj of a non-dumpable process
diff --git a/chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.h b/chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.h
new file mode 100644
index 0000000000..7f2ce9b78d
--- /dev/null
+++ b/chromium-next/patches/patch-content_browser_zygote__host_zygote__host__impl__linux.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/browser/zygote_host/zygote_host_impl_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/browser/zygote_host/zygote_host_impl_linux.h
+@@ -47,12 +47,14 @@ class CONTENT_EXPORT ZygoteHostImpl : pu
+ base::ScopedFD* control_fd,
+ base::FileHandleMappingVector additional_remapped_fds);
+
++#if !BUILDFLAG(IS_BSD)
+ void AdjustRendererOOMScore(base::ProcessHandle process_handle,
+ int score) override;
+ #if BUILDFLAG(IS_CHROMEOS)
+ void ReinitializeLogging(uint32_t logging_dest,
+ base::PlatformFile log_file_fd) override;
+ #endif // BUILDFLAG(IS_CHROMEOS)
++#endif
+
+ bool HasZygote() { return !zygote_pids_.empty(); }
+
+@@ -67,9 +69,11 @@ class CONTENT_EXPORT ZygoteHostImpl : pu
+
+ int renderer_sandbox_status_;
+
++#if !BUILDFLAG(IS_BSD)
+ bool use_namespace_sandbox_;
+ bool use_suid_sandbox_;
+ bool use_suid_sandbox_for_adj_oom_score_;
++#endif
+ std::string sandbox_binary_;
+
+ // This lock protects the |zygote_pids_| set.
diff --git a/chromium-next/patches/patch-content_child_BUILD.gn b/chromium-next/patches/patch-content_child_BUILD.gn
new file mode 100644
index 0000000000..46b1cd18ff
--- /dev/null
+++ b/chromium-next/patches/patch-content_child_BUILD.gn
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/child/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/child/BUILD.gn
+@@ -131,6 +131,13 @@ target(link_target_type, "child") {
+ ]
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "sandboxed_process_thread_type_handler.cc",
++ "sandboxed_process_thread_type_handler.h",
++ ]
++ }
++
+ if (is_win) {
+ sources += [
+ "dwrite_font_proxy/dwrite_font_proxy_init_impl_win.cc",
diff --git a/chromium-next/patches/patch-content_child_child__process.cc b/chromium-next/patches/patch-content_child_child__process.cc
new file mode 100644
index 0000000000..6d7d5c78a6
--- /dev/null
+++ b/chromium-next/patches/patch-content_child_child__process.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/child/child_process.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/child/child_process.cc
+@@ -31,7 +31,7 @@
+ #include "content/common/android/cpu_time_metrics.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/sandboxed_process_thread_type_handler.h"
+ #endif
+
+@@ -178,7 +178,7 @@ void ChildProcess::set_main_thread(Child
+ main_thread_.reset(thread);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void ChildProcess::SetIOThreadType(base::ThreadType thread_type) {
+ if (!io_thread_) {
+ return;
diff --git a/chromium-next/patches/patch-content_child_child__process.h b/chromium-next/patches/patch-content_child_child__process.h
new file mode 100644
index 0000000000..dc18d13e15
--- /dev/null
+++ b/chromium-next/patches/patch-content_child_child__process.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/child/child_process.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/child/child_process.h
+@@ -79,7 +79,7 @@ class CONTENT_EXPORT ChildProcess {
+ return io_thread_runner_.get();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Changes the thread type of the child process IO thread.
+ void SetIOThreadType(base::ThreadType thread_type);
+ #endif
diff --git a/chromium-next/patches/patch-content_common_BUILD.gn b/chromium-next/patches/patch-content_common_BUILD.gn
new file mode 100644
index 0000000000..159517cde4
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_BUILD.gn
@@ -0,0 +1,42 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/common/BUILD.gn
+@@ -385,19 +385,28 @@ source_set("common") {
+ }
+
+ if (is_linux || is_chromeos) {
+- sources += [
+- "gpu_pre_sandbox_hook_linux.cc",
+- "gpu_pre_sandbox_hook_linux.h",
+- ]
++ if (is_bsd) {
++ sources += [
++ "gpu_pre_sandbox_hook_bsd.cc",
++ "gpu_pre_sandbox_hook_bsd.h",
++ ]
++ } else {
++ sources += [
++ "gpu_pre_sandbox_hook_linux.cc",
++ "gpu_pre_sandbox_hook_linux.h",
++ ]
++ }
+ public_deps += [ "//sandbox/policy" ]
+ deps += [
+ ":sandbox_support_linux",
+ "//media/gpu:buildflags",
+ "//sandbox/linux:sandbox_services",
+- "//sandbox/linux:seccomp_bpf",
+ "//sandbox/policy:chromecast_sandbox_allowlist_buildflags",
+ "//third_party/fontconfig",
+ ]
++ if (use_seccomp_bpf) {
++ deps += [ "//sandbox/linux:seccomp_bpf" ]
++ }
+ if (use_v4l2_codec) {
+ deps += [ "//media/gpu/v4l2" ]
+ }
diff --git a/chromium-next/patches/patch-content_common_features.cc b/chromium-next/patches/patch-content_common_features.cc
new file mode 100644
index 0000000000..3f95aa2808
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_features.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/common/features.cc
+@@ -156,7 +156,7 @@ BASE_FEATURE(kEnableBackForwardCacheForO
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+ // Enables error reporting for JS errors inside DevTools frontend host
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kEnableDevToolsJsErrorReporting,
+ "EnableDevToolsJsErrorReporting",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+@@ -315,7 +315,7 @@ BASE_FEATURE(kGroupNIKByJoiningOrigin,
+ // process and having browser process handle adjusting thread properties (nice
+ // value, c-group, latency sensitivity...) for children which have sandbox
+ // restrictions.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ BASE_FEATURE(kHandleChildThreadTypeChangesInBrowser,
+ "HandleChildThreadTypeChangesInBrowser",
+ base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-content_common_features.h b/chromium-next/patches/patch-content_common_features.h
new file mode 100644
index 0000000000..3261511077
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_features.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/common/features.h
+@@ -35,7 +35,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kDev
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(kDocumentPolicyNegotiation);
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(
+ kEnableBackForwardCacheForOngoingSubframeNavigation);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(kEnableDevToolsJsErrorReporting);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(kEmbeddingRequiresOptIn);
+@@ -79,7 +79,7 @@ CONTENT_EXPORT extern const base::Featur
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(kGpuInfoCollectionSeparatePrefetch);
+ #endif
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(kGroupNIKByJoiningOrigin);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ CONTENT_EXPORT BASE_DECLARE_FEATURE(kHandleChildThreadTypeChangesInBrowser);
+ #endif
+ #if BUILDFLAG(IS_ANDROID)
diff --git a/chromium-next/patches/patch-content_common_font__list__unittest.cc b/chromium-next/patches/patch-content_common_font__list__unittest.cc
new file mode 100644
index 0000000000..06d8e280b6
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_font__list__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/font_list_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/common/font_list_unittest.cc
+@@ -48,7 +48,7 @@ TEST(FontList, GetFontList) {
+ EXPECT_TRUE(HasFontWithName(fonts, "MS Gothic", "MS Gothic"));
+ EXPECT_TRUE(HasFontWithName(fonts, "Segoe UI", "Segoe UI"));
+ EXPECT_TRUE(HasFontWithName(fonts, "Verdana", "Verdana"));
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ EXPECT_TRUE(HasFontWithName(fonts, "Arimo", "Arimo"));
+ #else
+ EXPECT_TRUE(HasFontWithName(fonts, "Arial", "Arial"));
diff --git a/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.cc b/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.cc
new file mode 100644
index 0000000000..5f50bbe838
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.cc
@@ -0,0 +1,77 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/gpu_pre_sandbox_hook_bsd.cc.orig 2025-01-20 18:01:27.900996672 +0000
++++ content/common/gpu_pre_sandbox_hook_bsd.cc
+@@ -0,0 +1,68 @@
++// Copyright 2023 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "content/common/gpu_pre_sandbox_hook_bsd.h"
++
++#include <dlfcn.h>
++#include <errno.h>
++#include <sys/stat.h>
++
++#include <memory>
++#include <sstream>
++#include <utility>
++#include <vector>
++
++#include "base/base_paths.h"
++#include "base/files/file_enumerator.h"
++#include "base/files/file_path.h"
++#include "base/files/scoped_file.h"
++#include "base/functional/bind.h"
++#include "base/logging.h"
++#include "base/path_service.h"
++#include "base/strings/stringprintf.h"
++#include "build/build_config.h"
++#include "build/buildflag.h"
++#include "build/chromeos_buildflags.h"
++#include "content/public/common/content_switches.h"
++#include "media/gpu/buildflags.h"
++
++namespace content {
++namespace {
++
++constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE;
++
++void LoadVulkanLibraries() {
++ // Try to preload Vulkan libraries. Failure is not an error as not all may be
++ // present.
++ const char* kLibraries[] = {
++ "libvulkan.so",
++ "libvulkan_intel.so",
++ "libvulkan_intel_hasvk.so",
++ "libvulkan_radeon.so",
++ };
++ for (const auto* library : kLibraries) {
++ dlopen(library, dlopen_flag);
++ }
++}
++
++bool LoadLibrariesForGpu(
++ const sandbox::policy::SandboxSeccompBPF::Options& options) {
++ LoadVulkanLibraries();
++
++ return true;
++}
++
++} // namespace
++
++bool GpuPreSandboxHook(sandbox::policy::SandboxLinux::Options options) {
++ if (!LoadLibrariesForGpu(options))
++ return false;
++
++ // TODO(tsepez): enable namspace sandbox here once crashes are understood.
++
++ errno = 0;
++ return true;
++}
++
++} // namespace content
diff --git a/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.h b/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.h
new file mode 100644
index 0000000000..e2a30a158b
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__bsd.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/gpu_pre_sandbox_hook_bsd.h.orig 2025-01-20 18:01:27.901101876 +0000
++++ content/common/gpu_pre_sandbox_hook_bsd.h
+@@ -0,0 +1,20 @@
++// Copyright 2017 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef CONTENT_COMMON_GPU_PRE_SANDBOX_HOOK_BSD_H_
++#define CONTENT_COMMON_GPU_PRE_SANDBOX_HOOK_BSD_H_
++
++#include "base/component_export.h"
++#include "sandbox/policy/sandbox.h"
++
++namespace content {
++
++// A pre-sandbox hook to use on Linux-based systems in sandboxed processes that
++// require general GPU usage.
++COMPONENT_EXPORT(GPU_PRE_SANDBOX_HOOK)
++bool GpuPreSandboxHook(sandbox::policy::SandboxLinux::Options options);
++
++} // namespace content
++
++#endif // CONTENT_COMMON_GPU_PRE_SANDBOX_HOOK_BSD_H_
diff --git a/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__linux.h b/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__linux.h
new file mode 100644
index 0000000000..2d24b21696
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_gpu__pre__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/gpu_pre_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/common/gpu_pre_sandbox_hook_linux.h
+@@ -5,8 +5,13 @@
+ #ifndef CONTENT_COMMON_GPU_PRE_SANDBOX_HOOK_LINUX_H_
+ #define CONTENT_COMMON_GPU_PRE_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
+ #include "base/component_export.h"
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace content {
+
diff --git a/chromium-next/patches/patch-content_common_user__agent.cc b/chromium-next/patches/patch-content_common_user__agent.cc
new file mode 100644
index 0000000000..81b8759cf6
--- /dev/null
+++ b/chromium-next/patches/patch-content_common_user__agent.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/common/user_agent.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/common/user_agent.cc
+@@ -45,7 +45,7 @@ std::string GetUserAgentPlatform() {
+ return "";
+ #elif BUILDFLAG(IS_MAC)
+ return "Macintosh; ";
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return "X11; "; // strange, but that's what Firefox uses
+ #elif BUILDFLAG(IS_ANDROID)
+ return "Linux; ";
+@@ -71,7 +71,7 @@ std::string GetUnifiedPlatform() {
+ return "Windows NT 10.0; Win64; x64";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return "Fuchsia";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return "X11; Linux x86_64";
+ #elif BUILDFLAG(IS_IOS)
+ if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) {
+@@ -296,6 +296,16 @@ std::string BuildOSCpuInfoFromOSVersionA
+ "Android %s", os_version.c_str()
+ #elif BUILDFLAG(IS_FUCHSIA)
+ "Fuchsia"
++#elif BUILDFLAG(IS_BSD)
++#if defined(__x86_64__)
++ "Linux x86_64; %s %s",
++#elif defined(__aarch64__)
++ "Linux aarch64; %s %s",
++#else
++ "Linux i686; %s %s",
++#endif
++ unixinfo.sysname, // e.g. Linux
++ cpu_type.c_str() // e.g. i686
+ #elif BUILDFLAG(IS_IOS)
+ "CPU %s OS %s like Mac OS X", cpu_type.c_str(),
+ os_version.c_str()
diff --git a/chromium-next/patches/patch-content_gpu_gpu__child__thread.cc b/chromium-next/patches/patch-content_gpu_gpu__child__thread.cc
new file mode 100644
index 0000000000..6436f38c0c
--- /dev/null
+++ b/chromium-next/patches/patch-content_gpu_gpu__child__thread.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/gpu/gpu_child_thread.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/gpu/gpu_child_thread.cc
+@@ -58,7 +58,7 @@
+ #include "third_party/skia/include/ports/SkFontConfigInterface.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/sandboxed_process_thread_type_handler.h"
+ #endif
+
+@@ -146,7 +146,8 @@ void GpuChildThread::Init(const base::Ti
+
+ viz_main_.gpu_service()->set_start_time(process_start_time);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++// XXX BSD
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ SandboxedProcessThreadTypeHandler::NotifyMainChildThreadCreated();
+ #endif
+
diff --git a/chromium-next/patches/patch-content_gpu_gpu__main.cc b/chromium-next/patches/patch-content_gpu_gpu__main.cc
new file mode 100644
index 0000000000..c5f3b950c8
--- /dev/null
+++ b/chromium-next/patches/patch-content_gpu_gpu__main.cc
@@ -0,0 +1,79 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/gpu/gpu_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/gpu/gpu_main.cc
+@@ -95,10 +95,14 @@
+ #include "sandbox/win/src/sandbox.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/sandboxed_process_thread_type_handler.h"
+ #include "content/common/gpu_pre_sandbox_hook_linux.h"
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "sandbox/policy/sandbox_type.h"
+ #endif
+
+@@ -117,7 +121,7 @@ namespace content {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool StartSandboxLinux(gpu::GpuWatchdogThread*,
+ const gpu::GPUInfo*,
+ const gpu::GpuPreferences&);
+@@ -175,7 +179,7 @@ class ContentSandboxHelper : public gpu:
+ bool EnsureSandboxInitialized(gpu::GpuWatchdogThread* watchdog_thread,
+ const gpu::GPUInfo* gpu_info,
+ const gpu::GpuPreferences& gpu_prefs) override {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return StartSandboxLinux(watchdog_thread, gpu_info, gpu_prefs);
+ #elif BUILDFLAG(IS_WIN)
+ return StartSandboxWindows(sandbox_info_);
+@@ -293,7 +297,7 @@ int GpuMain(MainFunctionParams parameter
+ std::make_unique<base::SingleThreadTaskExecutor>(
+ gpu_preferences.message_pump_type);
+ }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #error "Unsupported Linux platform."
+ #elif BUILDFLAG(IS_MAC)
+ // Cross-process CoreAnimation requires a CFRunLoop to function at all, and
+@@ -318,7 +322,8 @@ int GpuMain(MainFunctionParams parameter
+ base::PlatformThread::SetName("CrGpuMain");
+ mojo::InterfaceEndpointClient::SetThreadNameSuffixForMetrics("GpuMain");
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++// XXX BSD
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ // Thread type delegate of the process should be registered before
+ // thread type change below for the main thread and for thread pool in
+ // ChildProcess constructor.
+@@ -449,7 +454,7 @@ int GpuMain(MainFunctionParams parameter
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdog_thread,
+ const gpu::GPUInfo* gpu_info,
+ const gpu::GpuPreferences& gpu_prefs) {
+@@ -489,7 +494,7 @@ bool StartSandboxLinux(gpu::GpuWatchdogT
+ sandbox_options.accelerated_video_encode_enabled =
+ !gpu_prefs.disable_accelerated_video_encode;
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Video decoding of many video streams can use thousands of FDs as well as
+ // Exo clients like Lacros.
+ // See https://crbug.com/1417237
diff --git a/chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.cc b/chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.cc
new file mode 100644
index 0000000000..f5b57fed61
--- /dev/null
+++ b/chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/ppapi_plugin/ppapi_blink_platform_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/ppapi_plugin/ppapi_blink_platform_impl.cc
+@@ -21,7 +21,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include "content/child/child_process_sandbox_support_impl_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/child_process_sandbox_support_impl_linux.h"
+ #include "mojo/public/cpp/bindings/pending_remote.h"
+ #endif
+@@ -36,7 +36,7 @@ typedef struct CGFont* CGFontRef;
+ namespace content {
+
+ PpapiBlinkPlatformImpl::PpapiBlinkPlatformImpl() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ ChildThread::Get()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -55,7 +55,7 @@ PpapiBlinkPlatformImpl::~PpapiBlinkPlatf
+ void PpapiBlinkPlatformImpl::Shutdown() {}
+
+ blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetSandboxSupport() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return sandbox_support_.get();
+ #else
+ return nullptr;
diff --git a/chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.h b/chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.h
new file mode 100644
index 0000000000..21f07dc2b6
--- /dev/null
+++ b/chromium-next/patches/patch-content_ppapi__plugin_ppapi__blink__platform__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/ppapi_plugin/ppapi_blink_platform_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/ppapi_plugin/ppapi_blink_platform_impl.h
+@@ -36,7 +36,7 @@ class PpapiBlinkPlatformImpl : public Bl
+ blink::WebString DefaultLocale() override;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
+ #endif
+ };
diff --git a/chromium-next/patches/patch-content_ppapi__plugin_ppapi__plugin__main.cc b/chromium-next/patches/patch-content_ppapi__plugin_ppapi__plugin__main.cc
new file mode 100644
index 0000000000..c7e2a8e8ea
--- /dev/null
+++ b/chromium-next/patches/patch-content_ppapi__plugin_ppapi__plugin__main.cc
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/ppapi_plugin/ppapi_plugin_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/ppapi_plugin/ppapi_plugin_main.cc
+@@ -52,6 +52,11 @@
+ #include "gin/v8_initializer.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#include "sandbox/policy/sandbox_type.h"
++#endif
++
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
+ #include <stdlib.h>
+ #endif
+@@ -141,7 +146,7 @@ int PpapiPluginMain(MainFunctionParams p
+ gin::V8Initializer::LoadV8Snapshot();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
+ sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox(
+ sandbox::policy::SandboxTypeFromCommandLine(command_line),
+ sandbox::policy::SandboxLinux::PreSandboxHook(),
diff --git a/chromium-next/patches/patch-content_public_browser_content__browser__client.cc b/chromium-next/patches/patch-content_public_browser_content__browser__client.cc
new file mode 100644
index 0000000000..2268eae4c7
--- /dev/null
+++ b/chromium-next/patches/patch-content_public_browser_content__browser__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/public/browser/content_browser_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/public/browser/content_browser_client.cc
+@@ -1355,7 +1355,7 @@ bool ContentBrowserClient::ShouldRunOutO
+ // that can be adequately sandboxed.
+ // Currently Android's network service will not run out of process or sandboxed,
+ // so OutOfProcessSystemDnsResolution is not currently enabled on Android.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-content_public_browser_zygote__host_zygote__host__linux.h b/chromium-next/patches/patch-content_public_browser_zygote__host_zygote__host__linux.h
new file mode 100644
index 0000000000..ab636801de
--- /dev/null
+++ b/chromium-next/patches/patch-content_public_browser_zygote__host_zygote__host__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/public/browser/zygote_host/zygote_host_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/public/browser/zygote_host/zygote_host_linux.h
+@@ -35,11 +35,13 @@ class ZygoteHost {
+ // after the first render has been forked.
+ virtual int GetRendererSandboxStatus() = 0;
+
++#if !BUILDFLAG(IS_BSD)
+ // Adjust the OOM score of the given renderer's PID. The allowed
+ // range for the score is [0, 1000], where higher values are more
+ // likely to be killed by the OOM killer.
+ virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle,
+ int score) = 0;
++#endif
+
+ #if BUILDFLAG(IS_CHROMEOS)
+ // Reinitialize logging for the Zygote processes. Needed on ChromeOS, which
diff --git a/chromium-next/patches/patch-content_public_common_content__features.cc b/chromium-next/patches/patch-content_public_common_content__features.cc
new file mode 100644
index 0000000000..67fe77bad0
--- /dev/null
+++ b/chromium-next/patches/patch-content_public_common_content__features.cc
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/public/common/content_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/public/common/content_features.cc
+@@ -72,7 +72,7 @@ BASE_FEATURE(kAudioServiceOutOfProcess,
+ // TODO(crbug.com/40118868): Remove !IS_CHROMEOS_LACROS once lacros starts being
+ // built with OS_CHROMEOS instead of OS_LINUX.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
+- (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -1278,9 +1278,9 @@ BASE_FEATURE(kWebAssemblyTiering,
+ BASE_FEATURE(kWebAssemblyTrapHandler,
+ "WebAssemblyTrapHandler",
+ #if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)) && \
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)) && \
+ defined(ARCH_CPU_X86_64)) || \
+- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)) && \
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)) && \
+ defined(ARCH_CPU_ARM64))
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+@@ -1317,7 +1317,11 @@ BASE_FEATURE(kWebUICodeCache,
+
+ // Controls whether the WebUSB API is enabled:
+ // https://wicg.github.io/webusb
++#if BUILDFLAG(IS_BSD)
++BASE_FEATURE(kWebUsb, "WebUSB", base::FEATURE_DISABLED_BY_DEFAULT);
++#else
+ BASE_FEATURE(kWebUsb, "WebUSB", base::FEATURE_ENABLED_BY_DEFAULT);
++#endif
+
+ // Controls whether the WebXR Device API is enabled.
+ BASE_FEATURE(kWebXr, "WebXR", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-content_public_common_content__switches.cc b/chromium-next/patches/patch-content_public_common_content__switches.cc
new file mode 100644
index 0000000000..9fd8c28453
--- /dev/null
+++ b/chromium-next/patches/patch-content_public_common_content__switches.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/public/common/content_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/public/common/content_switches.cc
+@@ -347,6 +347,8 @@ const char kEnableIsolatedWebAppsInRende
+ // builds.
+ const char kEnableLogging[] = "enable-logging";
+
++const char kDisableUnveil[] = "disable-unveil";
++
+ // Enables the type, downlinkMax attributes of the NetInfo API. Also, enables
+ // triggering of change attribute of the NetInfo API when there is a change in
+ // the connection type.
+@@ -954,7 +956,7 @@ const char kPreventResizingContentsForTe
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Allows sending text-to-speech requests to speech-dispatcher, a common
+ // Linux speech service. Because it's buggy, the user must explicitly
+ // enable it so that visiting a random webpage can't cause instability.
diff --git a/chromium-next/patches/patch-content_public_common_content__switches.h b/chromium-next/patches/patch-content_public_common_content__switches.h
new file mode 100644
index 0000000000..6d6c0bca3f
--- /dev/null
+++ b/chromium-next/patches/patch-content_public_common_content__switches.h
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/public/common/content_switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/public/common/content_switches.h
+@@ -109,6 +109,7 @@ CONTENT_EXPORT extern const char kEnable
+ CONTENT_EXPORT extern const char kEnableIsolatedWebAppsInRenderer[];
+ CONTENT_EXPORT extern const char kEnableLCDText[];
+ CONTENT_EXPORT extern const char kEnableLogging[];
++CONTENT_EXPORT extern const char kDisableUnveil[];
+ CONTENT_EXPORT extern const char kEnableNetworkInformationDownlinkMax[];
+ CONTENT_EXPORT extern const char kEnableCanvas2DLayers[];
+ CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[];
+@@ -262,7 +263,7 @@ CONTENT_EXPORT extern const char kPreven
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ CONTENT_EXPORT extern const char kEnableSpeechDispatcher[];
+ CONTENT_EXPORT extern const char kLLVMProfileFile[];
+ #endif
diff --git a/chromium-next/patches/patch-content_public_common_zygote_features.gni b/chromium-next/patches/patch-content_public_common_zygote_features.gni
new file mode 100644
index 0000000000..d831dcc604
--- /dev/null
+++ b/chromium-next/patches/patch-content_public_common_zygote_features.gni
@@ -0,0 +1,14 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/public/common/zygote/features.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/public/common/zygote/features.gni
+@@ -2,4 +2,4 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
+-use_zygote = is_posix && !is_android && !is_apple
++use_zygote = is_posix && !is_android && !is_mac && !is_bsd
diff --git a/chromium-next/patches/patch-content_renderer_render__thread__impl.cc b/chromium-next/patches/patch-content_renderer_render__thread__impl.cc
new file mode 100644
index 0000000000..e9ecb535c6
--- /dev/null
+++ b/chromium-next/patches/patch-content_renderer_render__thread__impl.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/renderer/render_thread_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/renderer/render_thread_impl.cc
+@@ -212,6 +212,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif BUILDFLAG(IS_BSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -1046,7 +1048,7 @@ media::GpuVideoAcceleratorFactories* Ren
+ kGpuStreamIdMedia, kGpuStreamPriorityMedia);
+
+ const bool enable_video_decode_accelerator =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FeatureList::IsEnabled(media::kAcceleratedVideoDecodeLinux) &&
+ #endif // BUILDFLAG(IS_LINUX)
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
+@@ -1055,7 +1057,7 @@ media::GpuVideoAcceleratorFactories* Ren
+ gpu::kGpuFeatureStatusEnabled);
+
+ const bool enable_video_encode_accelerator =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FeatureList::IsEnabled(media::kAcceleratedVideoEncodeLinux) &&
+ #else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoEncode) &&
+@@ -1850,7 +1852,7 @@ std::unique_ptr<CodecFactory> RenderThre
+ bool enable_video_encode_accelerator) {
+ mojo::PendingRemote<media::mojom::VideoEncodeAcceleratorProvider>
+ vea_provider;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(media::kUseOutOfProcessVideoEncoding)) {
+ BindHostReceiver(vea_provider.InitWithNewPipeAndPassReceiver());
+ } else {
diff --git a/chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.cc b/chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.cc
new file mode 100644
index 0000000000..f461b4a3c9
--- /dev/null
+++ b/chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.cc
@@ -0,0 +1,51 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/renderer/renderer_blink_platform_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/renderer/renderer_blink_platform_impl.cc
+@@ -127,7 +127,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include "content/child/child_process_sandbox_support_impl_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/child_process_sandbox_support_impl_linux.h"
+ #include "content/child/sandboxed_process_thread_type_handler.h"
+ #endif
+@@ -196,13 +196,13 @@ RendererBlinkPlatformImpl::RendererBlink
+ is_locked_to_site_(false),
+ main_thread_scheduler_(main_thread_scheduler),
+ next_frame_sink_id_(uint32_t{std::numeric_limits<int32_t>::max()} + 1) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ sk_sp<font_service::FontLoader> font_loader;
+ #endif
+
+ // RenderThread may not exist in some tests.
+ if (RenderThreadImpl::current()) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ RenderThreadImpl::current()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -222,7 +222,7 @@ RendererBlinkPlatformImpl::RendererBlink
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (sandboxEnabled()) {
+ #if BUILDFLAG(IS_MAC)
+ sandbox_support_ = std::make_unique<WebSandboxSupportMac>();
+@@ -283,7 +283,7 @@ void RendererBlinkPlatformImpl::SetThrea
+ #endif
+
+ blink::WebSandboxSupport* RendererBlinkPlatformImpl::GetSandboxSupport() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return sandbox_support_.get();
+ #else
+ // These platforms do not require sandbox support.
diff --git a/chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.h b/chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.h
new file mode 100644
index 0000000000..fecd8cdd6d
--- /dev/null
+++ b/chromium-next/patches/patch-content_renderer_renderer__blink__platform__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/renderer/renderer_blink_platform_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/renderer/renderer_blink_platform_impl.h
+@@ -254,7 +254,7 @@ class CONTENT_EXPORT RendererBlinkPlatfo
+ void Collect3DContextInformation(blink::Platform::GraphicsInfo* gl_info,
+ const gpu::GPUInfo& gpu_info) const;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
+ #endif
+
diff --git a/chromium-next/patches/patch-content_renderer_renderer__main__platform__delegate__linux.cc b/chromium-next/patches/patch-content_renderer_renderer__main__platform__delegate__linux.cc
new file mode 100644
index 0000000000..313d02fd08
--- /dev/null
+++ b/chromium-next/patches/patch-content_renderer_renderer__main__platform__delegate__linux.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/renderer/renderer_main_platform_delegate_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/renderer/renderer_main_platform_delegate_linux.cc
+@@ -44,6 +44,7 @@ bool RendererMainPlatformDelegate::Enabl
+ // any renderer has been started.
+ // Here, we test that the status of SeccompBpf in the renderer is consistent
+ // with what SandboxLinux::GetStatus() said we would do.
++#if !BUILDFLAG(IS_BSD)
+ auto* linux_sandbox = sandbox::policy::SandboxLinux::GetInstance();
+ if (linux_sandbox->GetStatus() & sandbox::policy::SandboxLinux::kSeccompBPF) {
+ CHECK(linux_sandbox->seccomp_bpf_started());
+@@ -65,6 +66,7 @@ bool RendererMainPlatformDelegate::Enabl
+ CHECK_EQ(errno, EPERM);
+ }
+ #endif // __x86_64__
++#endif
+
+ return true;
+ }
diff --git a/chromium-next/patches/patch-content_shell_BUILD.gn b/chromium-next/patches/patch-content_shell_BUILD.gn
new file mode 100644
index 0000000000..3bebad21a2
--- /dev/null
+++ b/chromium-next/patches/patch-content_shell_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/shell/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/shell/BUILD.gn
+@@ -1087,7 +1087,7 @@ group("content_shell_crash_test") {
+ if (is_win) {
+ data_deps += [ "//build/win:copy_cdb_to_output" ]
+ }
+- if (is_posix) {
++ if (is_posix && !is_bsd) {
+ data_deps += [
+ "//third_party/breakpad:dump_syms",
+ "//third_party/breakpad:minidump_stackwalk",
diff --git a/chromium-next/patches/patch-content_shell_app_shell__main__delegate.cc b/chromium-next/patches/patch-content_shell_app_shell__main__delegate.cc
new file mode 100644
index 0000000000..38d66734f0
--- /dev/null
+++ b/chromium-next/patches/patch-content_shell_app_shell__main__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/shell/app/shell_main_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/shell/app/shell_main_delegate.cc
+@@ -269,7 +269,7 @@ void ShellMainDelegate::PreSandboxStartu
+ // Reporting for sub-processes will be initialized in ZygoteForked.
+ if (process_type != switches::kZygoteProcess) {
+ crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ crash_reporter::SetFirstChanceExceptionHandler(
+ v8::TryHandleWebAssemblyTrapPosix);
+ #endif
diff --git a/chromium-next/patches/patch-content_shell_browser_shell__browser__main__parts.cc b/chromium-next/patches/patch-content_shell_browser_shell__browser__main__parts.cc
new file mode 100644
index 0000000000..4d44d3cd54
--- /dev/null
+++ b/chromium-next/patches/patch-content_shell_browser_shell__browser__main__parts.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/shell/browser/shell_browser_main_parts.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/shell/browser/shell_browser_main_parts.cc
+@@ -51,7 +51,7 @@
+ #include "net/base/network_change_notifier.h"
+ #endif
+
+-#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ #include "ui/base/ime/init/input_method_initializer.h"
+ #endif
+
+@@ -68,7 +68,7 @@
+ #include "chromeos/lacros/dbus/lacros_dbus_thread_manager.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h" // nogncheck
+ #include "ui/linux/linux_ui_factory.h" // nogncheck
+ #endif
+@@ -139,7 +139,7 @@ void ShellBrowserMainParts::PostCreateMa
+ }
+
+ int ShellBrowserMainParts::PreEarlyInitialization() {
+-#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ ui::InitializeInputMethodForTesting();
+ #endif
+ #if BUILDFLAG(IS_ANDROID)
+@@ -168,7 +168,7 @@ void ShellBrowserMainParts::ToolkitIniti
+ if (switches::IsRunWebTestsSwitchPresent())
+ return;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ui::LinuxUi::SetInstance(ui::GetDefaultLinuxUi());
+ #endif
+ }
+@@ -215,7 +215,7 @@ void ShellBrowserMainParts::PostMainMess
+ ShellDevToolsManagerDelegate::StopHttpHandler();
+ browser_context_.reset();
+ off_the_record_browser_context_.reset();
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ui::LinuxUi::SetInstance(nullptr);
+ #endif
+ performance_manager_lifetime_.reset();
diff --git a/chromium-next/patches/patch-content_shell_browser_shell__paths.cc b/chromium-next/patches/patch-content_shell_browser_shell__paths.cc
new file mode 100644
index 0000000000..aeea2cd659
--- /dev/null
+++ b/chromium-next/patches/patch-content_shell_browser_shell__paths.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/shell/browser/shell_paths.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/shell/browser/shell_paths.cc
+@@ -13,7 +13,7 @@
+
+ #if BUILDFLAG(IS_FUCHSIA)
+ #include "base/fuchsia/file_utils.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/nix/xdg_util.h"
+ #endif
+
+@@ -25,7 +25,7 @@ bool GetDefaultUserDataDirectory(base::F
+ #if BUILDFLAG(IS_WIN)
+ CHECK(base::PathService::Get(base::DIR_LOCAL_APP_DATA, result));
+ *result = result->Append(std::wstring(L"content_shell"));
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
+ base::FilePath config_dir(base::nix::GetXDGDirectory(
+ env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir));
diff --git a/chromium-next/patches/patch-content_shell_renderer_shell__content__renderer__client.cc b/chromium-next/patches/patch-content_shell_renderer_shell__content__renderer__client.cc
new file mode 100644
index 0000000000..cfc1957241
--- /dev/null
+++ b/chromium-next/patches/patch-content_shell_renderer_shell__content__renderer__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/shell/renderer/shell_content_renderer_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/shell/renderer/shell_content_renderer_client.cc
+@@ -54,7 +54,7 @@
+ #include "media/base/media_switches.h"
+ #endif
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ (defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARM64))
+ #define ENABLE_WEB_ASSEMBLY_TRAP_HANDLER_LINUX
+ #include "base/debug/stack_trace.h"
diff --git a/chromium-next/patches/patch-content_shell_utility_shell__content__utility__client.cc b/chromium-next/patches/patch-content_shell_utility_shell__content__utility__client.cc
new file mode 100644
index 0000000000..93ea8f309e
--- /dev/null
+++ b/chromium-next/patches/patch-content_shell_utility_shell__content__utility__client.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/shell/utility/shell_content_utility_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/shell/utility/shell_content_utility_client.cc
+@@ -38,7 +38,7 @@
+ #include "sandbox/policy/sandbox.h"
+ #include "services/test/echo/echo_service.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/test/sandbox_status_service.h"
+ #endif
+
+@@ -187,7 +187,7 @@ void ShellContentUtilityClient::ExposeIn
+ binders->Add<mojom::PowerMonitorTest>(
+ base::BindRepeating(&PowerMonitorTestImpl::MakeSelfOwnedReceiver),
+ base::SingleThreadTaskRunner::GetCurrentDefault());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (register_sandbox_status_helper_) {
+ binders->Add<content::mojom::SandboxStatusService>(
+ base::BindRepeating(
diff --git a/chromium-next/patches/patch-content_test_BUILD.gn b/chromium-next/patches/patch-content_test_BUILD.gn
new file mode 100644
index 0000000000..c4a0fd5da0
--- /dev/null
+++ b/chromium-next/patches/patch-content_test_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/test/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/test/BUILD.gn
+@@ -1772,7 +1772,7 @@ test("content_browsertests") {
+ "../test/url_loader_interceptor_browsertest.cc",
+ ]
+
+- if (is_linux) {
++ if ((is_linux) && !is_bsd) {
+ sources += [ "../browser/network/address_map_linux_browsertest.cc" ]
+ }
+
diff --git a/chromium-next/patches/patch-content_utility_services.cc b/chromium-next/patches/patch-content_utility_services.cc
new file mode 100644
index 0000000000..c99d91c777
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_services.cc
@@ -0,0 +1,80 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/services.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/services.cc
+@@ -74,7 +74,7 @@
+ extern sandbox::TargetServices* g_utility_target_services;
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "media/mojo/services/mojo_video_encode_accelerator_provider_factory.h"
+ #include "sandbox/linux/services/libc_interceptor.h"
+ #include "sandbox/policy/mojom/sandbox.mojom.h"
+@@ -102,7 +102,7 @@ extern sandbox::TargetServices* g_utilit
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH) && (BUILDFLAG(USE_VAAPI) ||
+ // BUILDFLAG(USE_V4L2_CODEC))
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)) && \
+ (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
+ #include "content/common/features.h"
+ #include "media/mojo/services/stable_video_decoder_factory_process_service.h" // nogncheck
+@@ -238,7 +238,7 @@ auto RunAudio(mojo::PendingReceiver<audi
+ << "task_policy_set TASK_QOS_POLICY";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ auto* command_line = base::CommandLine::ForCurrentProcess();
+ if (sandbox::policy::SandboxTypeFromCommandLine(*command_line) ==
+ sandbox::mojom::Sandbox::kNoSandbox) {
+@@ -388,7 +388,7 @@ auto RunOOPArcVideoAcceleratorFactorySer
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH) && (BUILDFLAG(USE_VAAPI) ||
+ // BUILDFLAG(USE_V4L2_CODEC))
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)) && \
+ (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
+ auto RunStableVideoDecoderFactoryProcessService(
+ mojo::PendingReceiver<
+@@ -399,7 +399,7 @@ auto RunStableVideoDecoderFactoryProcess
+ #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) &&
+ // (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ auto RunVideoEncodeAcceleratorProviderFactory(
+ mojo::PendingReceiver<media::mojom::VideoEncodeAcceleratorProviderFactory>
+ receiver) {
+@@ -422,7 +422,7 @@ void RegisterIOThreadServices(mojo::Serv
+ // loop of type IO that can get notified when pipes have data.
+ services.Add(RunNetworkService);
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)) && \
+ (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
+ if (base::FeatureList::IsEnabled(
+ features::kRunStableVideoDecoderFactoryProcessServiceOnIOThread)) {
+@@ -478,7 +478,7 @@ void RegisterMainThreadServices(mojo::Se
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH) && (BUILDFLAG(USE_VAAPI) ||
+ // BUILDFLAG(USE_V4L2_CODEC))
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)) && \
+ (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
+ if (!base::FeatureList::IsEnabled(
+ features::kRunStableVideoDecoderFactoryProcessServiceOnIOThread)) {
+@@ -487,7 +487,7 @@ void RegisterMainThreadServices(mojo::Se
+ #endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) &&
+ // (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ services.Add(RunVideoEncodeAcceleratorProviderFactory);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
diff --git a/chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.cc b/chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..0acfa294de
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/speech/speech_recognition_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/speech/speech_recognition_sandbox_hook_linux.cc
+@@ -12,11 +12,14 @@
+ #include "sandbox/linux/syscall_broker/broker_command.h"
+ #include "sandbox/linux/syscall_broker/broker_file_permission.h"
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
+ using sandbox::syscall_broker::MakeBrokerCommandSet;
++#endif
+
+ namespace speech {
+
++#if !BUILDFLAG(IS_BSD)
+ namespace {
+
+ // Gets the file permissions required by the Speech On-Device API (SODA).
+@@ -50,9 +53,11 @@ std::vector<BrokerFilePermission> GetSod
+ }
+
+ } // namespace
++#endif
+
+ bool SpeechRecognitionPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(ENABLE_SODA_INTEGRATION_TESTS)
+ base::FilePath test_binary_path = GetSodaTestBinaryPath();
+ DVLOG(0) << "SODA test binary path: " << test_binary_path.value().c_str();
+@@ -75,6 +80,7 @@ bool SpeechRecognitionPreSandboxHook(
+ }),
+ GetSodaFilePermissions(), options);
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+
+ return true;
+ }
diff --git a/chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h b/chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h
new file mode 100644
index 0000000000..a12bb79ca0
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/speech/speech_recognition_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/speech/speech_recognition_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
+ #define CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace speech {
+
diff --git a/chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.cc b/chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.cc
new file mode 100644
index 0000000000..a0452edc0f
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/utility_blink_platform_with_sandbox_support_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/utility_blink_platform_with_sandbox_support_impl.cc
+@@ -9,7 +9,7 @@
+
+ #if BUILDFLAG(IS_MAC)
+ #include "content/child/child_process_sandbox_support_impl_mac.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/child_process_sandbox_support_impl_linux.h"
+ #endif
+
+@@ -17,7 +17,7 @@ namespace content {
+
+ UtilityBlinkPlatformWithSandboxSupportImpl::
+ UtilityBlinkPlatformWithSandboxSupportImpl() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::PendingRemote<font_service::mojom::FontService> font_service;
+ UtilityThread::Get()->BindHostReceiver(
+ font_service.InitWithNewPipeAndPassReceiver());
+@@ -35,7 +35,7 @@ UtilityBlinkPlatformWithSandboxSupportIm
+
+ blink::WebSandboxSupport*
+ UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return sandbox_support_.get();
+ #else
+ return nullptr;
diff --git a/chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.h b/chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.h
new file mode 100644
index 0000000000..391eddf81a
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/utility_blink_platform_with_sandbox_support_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/utility_blink_platform_with_sandbox_support_impl.h
+@@ -33,7 +33,7 @@ class UtilityBlinkPlatformWithSandboxSup
+ blink::WebSandboxSupport* GetSandboxSupport() override;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
+ #endif
+ };
diff --git a/chromium-next/patches/patch-content_utility_utility__main.cc b/chromium-next/patches/patch-content_utility_utility__main.cc
new file mode 100644
index 0000000000..424686cb8d
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_utility__main.cc
@@ -0,0 +1,161 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/utility_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/utility_main.cc
+@@ -38,17 +38,21 @@
+ #include "services/tracing/public/cpp/trace_startup.h"
+ #include "services/video_effects/public/cpp/buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/file_descriptor_store.h"
+ #include "base/files/file_util.h"
+ #include "base/pickle.h"
+ #include "content/child/sandboxed_process_thread_type_handler.h"
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "content/common/gpu_pre_sandbox_hook_linux.h"
++#endif
+ #include "content/public/common/content_descriptor_keys.h"
+ #include "content/utility/speech/speech_recognition_sandbox_hook_linux.h"
+ #include "gpu/config/gpu_info_collector.h"
+ #include "media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "services/audio/audio_sandbox_hook_linux.h"
+ #include "services/network/network_sandbox_hook_linux.h"
+ // gn check is not smart enough to realize that this include only applies to
+@@ -60,11 +64,16 @@
+ #endif
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(ENABLE_VIDEO_EFFECTS) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#include "content/common/gpu_pre_sandbox_hook_bsd.h"
++#endif
++
++#if BUILDFLAG(ENABLE_VIDEO_EFFECTS) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ #include "services/video_effects/video_effects_sandbox_hook_linux.h" // nogncheck
+ #endif // BUILDFLAG(ENABLE_VIDEO_EFFECTS) && BUILDFLAG(IS_LINUX)
+
+@@ -79,7 +88,7 @@
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if (BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)))
+ #include "services/screen_ai/public/cpp/utilities.h" // nogncheck
+ #include "services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h" // nogncheck
+ #endif
+@@ -103,7 +112,7 @@
+ sandbox::TargetServices* g_utility_target_services = nullptr;
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ #include "components/services/on_device_translation/sandbox_hook.h"
+ #endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION) && BUILDFLAG(IS_LINUX)
+
+@@ -111,7 +120,7 @@ namespace content {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::vector<std::string> GetNetworkContextsParentDirectories() {
+ base::MemoryMappedFile::Region region;
+ base::ScopedFD read_pipe_fd = base::FileDescriptorStore::GetInstance().TakeFD(
+@@ -138,9 +147,10 @@ std::vector<std::string> GetNetworkConte
+ return dirs;
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ bool ShouldUseAmdGpuPolicy(sandbox::mojom::Sandbox sandbox_type) {
+ const bool obtain_gpu_info =
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ sandbox_type == sandbox::mojom::Sandbox::kHardwareVideoDecoding ||
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+ sandbox_type == sandbox::mojom::Sandbox::kHardwareVideoEncoding;
+@@ -155,6 +165,7 @@ bool ShouldUseAmdGpuPolicy(sandbox::mojo
+
+ return false;
+ }
++#endif
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+ #if BUILDFLAG(IS_WIN)
+@@ -252,7 +263,8 @@ int UtilityMain(MainFunctionParams param
+ CHECK(on_device_model::OnDeviceModelService::PreSandboxInit());
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++// XXX BSD
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ // Thread type delegate of the process should be registered before first
+ // thread type change in ChildProcess constructor. It also needs to be
+ // registered before the process has multiple threads, which may race with
+@@ -264,7 +276,7 @@ int UtilityMain(MainFunctionParams param
+ }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Initializes the sandbox before any threads are created.
+ // TODO(jorgelo): move this after GTK initialization when we enable a strict
+ // Seccomp-BPF policy.
+@@ -294,7 +306,7 @@ int UtilityMain(MainFunctionParams param
+ pre_sandbox_hook =
+ base::BindOnce(&speech::SpeechRecognitionPreSandboxHook);
+ break;
+-#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION) && BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ case sandbox::mojom::Sandbox::kOnDeviceTranslation:
+ pre_sandbox_hook = base::BindOnce(
+ &on_device_translation::OnDeviceTranslationSandboxHook);
+@@ -308,13 +320,13 @@ int UtilityMain(MainFunctionParams param
+ screen_ai::GetBinaryPathSwitch()));
+ break;
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case sandbox::mojom::Sandbox::kVideoEffects:
+ pre_sandbox_hook =
+ base::BindOnce(&video_effects::VideoEffectsPreSandboxHook);
+ break;
+ #endif // BUILDFLAG(IS_LINUX)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case sandbox::mojom::Sandbox::kHardwareVideoDecoding:
+ pre_sandbox_hook =
+ base::BindOnce(&media::HardwareVideoDecodingPreSandboxHook);
+@@ -341,6 +353,7 @@ int UtilityMain(MainFunctionParams param
+ default:
+ break;
+ }
++#if !BUILDFLAG(IS_BSD)
+ if (!sandbox::policy::IsUnsandboxedSandboxType(sandbox_type) &&
+ (parameters.zygote_child || !pre_sandbox_hook.is_null())) {
+ sandbox_options.use_amd_specific_policies =
+@@ -348,6 +361,11 @@ int UtilityMain(MainFunctionParams param
+ sandbox::policy::Sandbox::Initialize(
+ sandbox_type, std::move(pre_sandbox_hook), sandbox_options);
+ }
++#else
++ sandbox::policy::Sandbox::Initialize(
++ sandbox_type, std::move(pre_sandbox_hook),
++ sandbox::policy::SandboxLinux::Options());
++#endif
+
+ // Start the HangWatcher now that the sandbox is engaged, if it hasn't
+ // already been started.
diff --git a/chromium-next/patches/patch-content_utility_utility__thread__impl.cc b/chromium-next/patches/patch-content_utility_utility__thread__impl.cc
new file mode 100644
index 0000000000..2c662b31d1
--- /dev/null
+++ b/chromium-next/patches/patch-content_utility_utility__thread__impl.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/utility/utility_thread_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/utility/utility_thread_impl.cc
+@@ -31,7 +31,7 @@
+ #include "mojo/public/cpp/bindings/pending_receiver.h"
+ #include "mojo/public/cpp/bindings/service_factory.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "content/child/sandboxed_process_thread_type_handler.h"
+ #endif
+
+@@ -251,7 +251,8 @@ void UtilityThreadImpl::Init() {
+
+ GetContentClient()->utility()->UtilityThreadStarted();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++// XXX BSD
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ SandboxedProcessThreadTypeHandler::NotifyMainChildThreadCreated();
+ #endif
+
diff --git a/chromium-next/patches/patch-content_zygote_BUILD.gn b/chromium-next/patches/patch-content_zygote_BUILD.gn
new file mode 100644
index 0000000000..4476a42996
--- /dev/null
+++ b/chromium-next/patches/patch-content_zygote_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/zygote/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/zygote/BUILD.gn
+@@ -5,7 +5,7 @@
+ import("//build/config/nacl/config.gni")
+ import("//content/public/common/zygote/features.gni")
+
+-if (is_linux || is_chromeos) {
++if ((is_linux || is_chromeos) && !is_bsd) {
+ source_set("zygote") {
+ sources = [
+ "zygote_linux.cc",
diff --git a/chromium-next/patches/patch-content_zygote_zygote__linux.cc b/chromium-next/patches/patch-content_zygote_zygote__linux.cc
new file mode 100644
index 0000000000..e112b5bf63
--- /dev/null
+++ b/chromium-next/patches/patch-content_zygote_zygote__linux.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/zygote/zygote_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/zygote/zygote_linux.cc
+@@ -1,6 +1,7 @@
+ // Copyright 2012 The Chromium Authors
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
++#if 0
+
+ #ifdef UNSAFE_BUFFERS_BUILD
+ // TODO(crbug.com/342213636): Remove this and spanify to fix the errors.
+@@ -710,3 +711,4 @@ void Zygote::HandleReinitializeLoggingRe
+ }
+
+ } // namespace content
++#endif
diff --git a/chromium-next/patches/patch-content_zygote_zygote__main__linux.cc b/chromium-next/patches/patch-content_zygote_zygote__main__linux.cc
new file mode 100644
index 0000000000..1fd4d4665b
--- /dev/null
+++ b/chromium-next/patches/patch-content_zygote_zygote__main__linux.cc
@@ -0,0 +1,64 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- content/zygote/zygote_main_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ content/zygote/zygote_main_linux.cc
+@@ -11,7 +11,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -41,7 +43,9 @@
+ #include "sandbox/linux/services/thread_helpers.h"
+ #include "sandbox/linux/suid/client/setuid_sandbox_client.h"
+ #include "sandbox/policy/linux/sandbox_debug_handling_linux.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "sandbox/policy/sandbox.h"
+ #include "sandbox/policy/switches.h"
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+@@ -50,11 +54,13 @@ namespace content {
+
+ namespace {
+
++#if !BUILDFLAG(IS_BSD)
+ void CloseFds(const std::vector<int>& fds) {
+ for (const auto& it : fds) {
+ PCHECK(0 == IGNORE_EINTR(close(it)));
+ }
+ }
++#endif
+
+ base::OnceClosure ClosureFromTwoClosures(base::OnceClosure one,
+ base::OnceClosure two) {
+@@ -157,9 +163,11 @@ static void EnterLayerOneSandbox(sandbox
+ CHECK(!using_layer1_sandbox);
+ }
+ }
++#endif
+
+ bool ZygoteMain(
+ std::vector<std::unique_ptr<ZygoteForkDelegate>> fork_delegates) {
++#if !BUILDFLAG(IS_BSD)
+ sandbox::SetAmZygoteOrRenderer(true, GetSandboxFD());
+
+ auto* linux_sandbox = sandbox::policy::SandboxLinux::GetInstance();
+@@ -224,6 +232,9 @@ bool ZygoteMain(
+
+ // This function call can return multiple times, once per fork().
+ return zygote.ProcessRequests();
++#else
++ return false;
++#endif
+ }
+
+ } // namespace content
diff --git a/chromium-next/patches/patch-device_bluetooth_bluetooth__adapter.cc b/chromium-next/patches/patch-device_bluetooth_bluetooth__adapter.cc
new file mode 100644
index 0000000000..e687d42524
--- /dev/null
+++ b/chromium-next/patches/patch-device_bluetooth_bluetooth__adapter.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- device/bluetooth/bluetooth_adapter.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ device/bluetooth/bluetooth_adapter.cc
+@@ -32,7 +32,7 @@ namespace device {
+ BluetoothAdapter::ServiceOptions::ServiceOptions() = default;
+ BluetoothAdapter::ServiceOptions::~ServiceOptions() = default;
+
+-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) && \
++#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD) && \
+ !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX)
+ // static
+ scoped_refptr<BluetoothAdapter> BluetoothAdapter::CreateAdapter() {
diff --git a/chromium-next/patches/patch-device_bluetooth_cast__bluetooth.gni b/chromium-next/patches/patch-device_bluetooth_cast__bluetooth.gni
new file mode 100644
index 0000000000..111708201c
--- /dev/null
+++ b/chromium-next/patches/patch-device_bluetooth_cast__bluetooth.gni
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- device/bluetooth/cast_bluetooth.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ device/bluetooth/cast_bluetooth.gni
+@@ -2,5 +2,5 @@ import("//build/config/features.gni")
+
+ declare_args() {
+ force_cast_bluetooth = false
+- use_bluez = (is_linux && !is_castos && use_dbus) || is_chromeos
++ use_bluez = use_dbus && !is_bsd
+ }
diff --git a/chromium-next/patches/patch-device_gamepad_BUILD.gn b/chromium-next/patches/patch-device_gamepad_BUILD.gn
new file mode 100644
index 0000000000..105db63ba2
--- /dev/null
+++ b/chromium-next/patches/patch-device_gamepad_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- device/gamepad/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ device/gamepad/BUILD.gn
+@@ -99,7 +99,7 @@ component("gamepad") {
+ "hid_writer_linux.cc",
+ "hid_writer_linux.h",
+ ]
+- if (use_udev) {
++ if (use_udev && !is_bsd) {
+ sources += [
+ "gamepad_device_linux.cc",
+ "gamepad_device_linux.h",
diff --git a/chromium-next/patches/patch-device_gamepad_gamepad__provider.cc b/chromium-next/patches/patch-device_gamepad_gamepad__provider.cc
new file mode 100644
index 0000000000..65cf44f86a
--- /dev/null
+++ b/chromium-next/patches/patch-device_gamepad_gamepad__provider.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- device/gamepad/gamepad_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ device/gamepad/gamepad_provider.cc
+@@ -157,7 +157,7 @@ void GamepadProvider::Initialize(std::un
+
+ if (!polling_thread_)
+ polling_thread_ = std::make_unique<base::Thread>("Gamepad polling thread");
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, the data fetcher needs to watch file descriptors, so the message
+ // loop needs to be a libevent loop.
+ const base::MessagePumpType kMessageLoopType = base::MessagePumpType::IO;
diff --git a/chromium-next/patches/patch-device_gamepad_hid__writer__linux.cc b/chromium-next/patches/patch-device_gamepad_hid__writer__linux.cc
new file mode 100644
index 0000000000..d79479e9cb
--- /dev/null
+++ b/chromium-next/patches/patch-device_gamepad_hid__writer__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- device/gamepad/hid_writer_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ device/gamepad/hid_writer_linux.cc
+@@ -2,6 +2,8 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+
++#include <unistd.h>
++
+ #include "device/gamepad/hid_writer_linux.h"
+
+ #include <unistd.h>
diff --git a/chromium-next/patches/patch-extensions_browser_api_api__browser__context__keyed__service__factories.cc b/chromium-next/patches/patch-extensions_browser_api_api__browser__context__keyed__service__factories.cc
new file mode 100644
index 0000000000..dac146b52d
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_browser_api_api__browser__context__keyed__service__factories.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/browser/api/api_browser_context_keyed_service_factories.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/browser/api/api_browser_context_keyed_service_factories.cc
+@@ -118,7 +118,7 @@ void EnsureApiBrowserContextKeyedService
+ #endif
+ MessageService::GetFactoryInstance();
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ NetworkingPrivateEventRouterFactory::GetInstance();
+ #endif
+ OffscreenDocumentManager::GetFactory();
diff --git a/chromium-next/patches/patch-extensions_browser_api_management_management__api.cc b/chromium-next/patches/patch-extensions_browser_api_management_management__api.cc
new file mode 100644
index 0000000000..7867849799
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_browser_api_management_management__api.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/browser/api/management/management_api.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/browser/api/management/management_api.cc
+@@ -285,7 +285,7 @@ bool PlatformSupportsApprovalFlowForExte
+ #if BUILDFLAG(IS_CHROMEOS)
+ // ChromeOS devices have this feature already shipped.
+ return true;
+-#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(
+ supervised_user::kEnableExtensionsPermissionsForSupervisedUsersOnDesktop);
+ #else
diff --git a/chromium-next/patches/patch-extensions_browser_api_messaging_message__service.cc b/chromium-next/patches/patch-extensions_browser_api_messaging_message__service.cc
new file mode 100644
index 0000000000..ca137268da
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_browser_api_messaging_message__service.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/browser/api/messaging/message_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/browser/api/messaging/message_service.cc
+@@ -78,7 +78,7 @@ namespace {
+ const char kReceivingEndDoesntExistError[] =
+ "Could not establish connection. Receiving end does not exist.";
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kMissingPermissionError[] =
+ "Access to native messaging requires nativeMessaging permission.";
+ const char kProhibitedByPoliciesError[] =
+@@ -551,7 +551,7 @@ void MessageService::OpenChannelToNative
+ return;
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool has_permission = extension->permissions_data()->HasAPIPermission(
+ mojom::APIPermissionID::kNativeMessaging);
+ if (!has_permission) {
diff --git a/chromium-next/patches/patch-extensions_browser_api_networking__private_networking__private__delegate__factory.cc b/chromium-next/patches/patch-extensions_browser_api_networking__private_networking__private__delegate__factory.cc
new file mode 100644
index 0000000000..c5c21a97d9
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_browser_api_networking__private_networking__private__delegate__factory.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/browser/api/networking_private/networking_private_delegate_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/browser/api/networking_private/networking_private_delegate_factory.cc
+@@ -12,7 +12,7 @@
+
+ #if BUILDFLAG(IS_CHROMEOS)
+ #include "extensions/browser/api/networking_private/networking_private_chromeos.h"
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "extensions/browser/api/networking_private/networking_private_linux.h"
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+ #include "components/wifi/wifi_service.h"
+@@ -63,7 +63,7 @@ NetworkingPrivateDelegateFactory::BuildS
+ std::unique_ptr<NetworkingPrivateDelegate> delegate;
+ #if BUILDFLAG(IS_CHROMEOS)
+ delegate = std::make_unique<NetworkingPrivateChromeOS>(browser_context);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ delegate = std::make_unique<NetworkingPrivateLinux>();
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+ std::unique_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create());
+@@ -74,7 +74,7 @@ NetworkingPrivateDelegateFactory::BuildS
+ #endif
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (ui_factory_) {
+ delegate->set_ui_delegate(ui_factory_->CreateDelegate());
+ }
diff --git a/chromium-next/patches/patch-extensions_common_api___permission__features.json b/chromium-next/patches/patch-extensions_common_api___permission__features.json
new file mode 100644
index 0000000000..04526a8499
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_common_api___permission__features.json
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/common/api/_permission_features.json.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/common/api/_permission_features.json
+@@ -138,7 +138,7 @@
+ {
+ "channel": "stable",
+ "extension_types": ["platform_app"],
+- "platforms": ["chromeos", "win", "mac", "linux"],
++ "platforms": ["chromeos", "win", "mac", "linux", "openbsd", "freebsd", "netbsd"],
+ "allowlist": [
+ "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/387169
+ "A3BC37E2148AC4E99BE4B16AF9D42DD1E592BBBE", // http://crbug.com/387169
+@@ -432,7 +432,7 @@
+ }, {
+ "channel": "stable",
+ "extension_types": ["extension", "legacy_packaged_app", "platform_app"],
+- "platforms": ["chromeos", "mac", "win", "linux", "fuchsia"],
++ "platforms": ["chromeos", "mac", "win", "linux", "fuchsia", "openbsd", "freebsd", "netbsd"],
+ "allowlist": [
+ "0DE0F05680A4A056BCEC864ED8DDA84296F82B40", // http://crbug.com/434651
+ "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/293683
+@@ -476,7 +476,7 @@
+ "networkingPrivate": {
+ "channel": "stable",
+ "extension_types": ["extension", "legacy_packaged_app", "platform_app"],
+- "platforms": ["chromeos", "mac", "win", "linux", "fuchsia"],
++ "platforms": ["chromeos", "mac", "win", "linux", "fuchsia", "openbsd", "freebsd", "netbsd"],
+ "allowlist": [
+ // DO NOT ADD ANY MORE ENTRIES HERE.
+ // networkingPrivate is being migrated to networking.onc.
diff --git a/chromium-next/patches/patch-extensions_common_api_runtime.json b/chromium-next/patches/patch-extensions_common_api_runtime.json
new file mode 100644
index 0000000000..6e181bfa3b
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_common_api_runtime.json
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/common/api/runtime.json.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/common/api/runtime.json
+@@ -86,6 +86,8 @@
+ {"name": "cros", "description": "Specifies the Chrome operating system."},
+ {"name": "linux", "description": "Specifies the Linux operating system."},
+ {"name": "openbsd", "description": "Specifies the OpenBSD operating system."},
++ {"name": "freebsd", "description": "Specifies the FreeBSD operating system."},
++ {"name": "netbsd", "description": "Specifies the NetBSD operating system."},
+ {"name": "fuchsia", "description": "Specifies the Fuchsia operating system."}
+ ]
+ },
diff --git a/chromium-next/patches/patch-extensions_common_command.cc b/chromium-next/patches/patch-extensions_common_command.cc
new file mode 100644
index 0000000000..abddb06e22
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_common_command.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/common/command.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/common/command.cc
+@@ -284,7 +284,7 @@ std::string Command::CommandPlatform() {
+ return values::kKeybindingPlatformMac;
+ #elif BUILDFLAG(IS_CHROMEOS)
+ return values::kKeybindingPlatformChromeOs;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return values::kKeybindingPlatformLinux;
+ #elif BUILDFLAG(IS_FUCHSIA)
+ // TODO(crbug.com/40220501): Change this once we decide what string should be
diff --git a/chromium-next/patches/patch-extensions_common_features_feature.cc b/chromium-next/patches/patch-extensions_common_features_feature.cc
new file mode 100644
index 0000000000..e7497f6948
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_common_features_feature.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/common/features/feature.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/common/features/feature.cc
+@@ -29,6 +29,8 @@ Feature::Platform Feature::GetCurrentPla
+ return WIN_PLATFORM;
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return FUCHSIA_PLATFORM;
++#elif BUILDFLAG(IS_BSD)
++ return LINUX_PLATFORM;
+ #else
+ return UNSPECIFIED_PLATFORM;
+ #endif
diff --git a/chromium-next/patches/patch-extensions_renderer_bindings_api__binding__util.cc b/chromium-next/patches/patch-extensions_renderer_bindings_api__binding__util.cc
new file mode 100644
index 0000000000..ded4265340
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_renderer_bindings_api__binding__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/renderer/bindings/api_binding_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/renderer/bindings/api_binding_util.cc
+@@ -128,7 +128,7 @@ void InvalidateContext(v8::Local<v8::Con
+ std::string GetPlatformString() {
+ #if BUILDFLAG(IS_CHROMEOS)
+ return "chromeos";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return "linux";
+ #elif BUILDFLAG(IS_MAC)
+ return "mac";
diff --git a/chromium-next/patches/patch-extensions_renderer_bindings_argument__spec.cc b/chromium-next/patches/patch-extensions_renderer_bindings_argument__spec.cc
new file mode 100644
index 0000000000..e9202fab9d
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_renderer_bindings_argument__spec.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/renderer/bindings/argument_spec.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/renderer/bindings/argument_spec.cc
+@@ -18,6 +18,8 @@
+ #include "gin/data_object_builder.h"
+ #include "gin/dictionary.h"
+
++#include <cmath>
++
+ namespace extensions {
+
+ namespace {
diff --git a/chromium-next/patches/patch-extensions_shell_app_shell__main__delegate.cc b/chromium-next/patches/patch-extensions_shell_app_shell__main__delegate.cc
new file mode 100644
index 0000000000..1a058b246d
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_shell_app_shell__main__delegate.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/shell/app/shell_main_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/shell/app/shell_main_delegate.cc
+@@ -40,7 +40,7 @@
+ #if BUILDFLAG(IS_WIN)
+ #include "base/base_paths_win.h"
+ #include "base/process/process_info.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/nix/xdg_util.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "base/base_paths_mac.h"
+@@ -60,7 +60,7 @@ base::FilePath GetDataPath() {
+ }
+
+ base::FilePath data_dir;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
+ data_dir = base::nix::GetXDGDirectory(
+ env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir);
diff --git a/chromium-next/patches/patch-extensions_shell_browser_api_runtime_shell__runtime__api__delegate.cc b/chromium-next/patches/patch-extensions_shell_browser_api_runtime_shell__runtime__api__delegate.cc
new file mode 100644
index 0000000000..631c828cfe
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_shell_browser_api_runtime_shell__runtime__api__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/shell/browser/api/runtime/shell_runtime_api_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/shell/browser/api/runtime/shell_runtime_api_delegate.cc
+@@ -45,7 +45,7 @@ void ShellRuntimeAPIDelegate::OpenURL(co
+ bool ShellRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
+ #if BUILDFLAG(IS_CHROMEOS)
+ info->os = api::runtime::PlatformOs::kCros;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ info->os = api::runtime::PlatformOs::kLinux;
+ #endif
+ return true;
diff --git a/chromium-next/patches/patch-extensions_shell_browser_shell__browser__main__parts.cc b/chromium-next/patches/patch-extensions_shell_browser_shell__browser__main__parts.cc
new file mode 100644
index 0000000000..1b10f5becd
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_shell_browser_shell__browser__main__parts.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/shell/browser/shell_browser_main_parts.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/shell/browser/shell_browser_main_parts.cc
+@@ -137,7 +137,7 @@ void ShellBrowserMainParts::PostCreateMa
+ switches::kAppShellAllowRoaming)) {
+ network_controller_->SetCellularAllowRoaming(true);
+ }
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // app_shell doesn't need GTK, so the fake input method context can work.
+ // See crbug.com/381852 and revision fb69f142.
+ // TODO(michaelpg): Verify this works for target environments.
diff --git a/chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.cc b/chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.cc
new file mode 100644
index 0000000000..e263c8974f
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/shell/browser/shell_extensions_api_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/shell/browser/shell_extensions_api_client.cc
+@@ -18,7 +18,7 @@
+ #include "extensions/shell/browser/shell_virtual_keyboard_delegate.h"
+ #include "extensions/shell/browser/shell_web_view_guest_delegate.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "extensions/shell/browser/api/file_system/shell_file_system_delegate.h"
+ #endif
+
+@@ -54,7 +54,7 @@ ShellExtensionsAPIClient::CreateDisplayI
+ return std::make_unique<ShellDisplayInfoProvider>();
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ FileSystemDelegate* ShellExtensionsAPIClient::GetFileSystemDelegate() {
+ if (!file_system_delegate_)
+ file_system_delegate_ = std::make_unique<ShellFileSystemDelegate>();
diff --git a/chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.h b/chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.h
new file mode 100644
index 0000000000..72d5f7171e
--- /dev/null
+++ b/chromium-next/patches/patch-extensions_shell_browser_shell__extensions__api__client.h
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- extensions/shell/browser/shell_extensions_api_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ extensions/shell/browser/shell_extensions_api_client.h
+@@ -34,14 +34,14 @@ class ShellExtensionsAPIClient : public
+ content::BrowserContext* browser_context) const override;
+ std::unique_ptr<DisplayInfoProvider> CreateDisplayInfoProvider()
+ const override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ FileSystemDelegate* GetFileSystemDelegate() override;
+ #endif
+ MessagingDelegate* GetMessagingDelegate() override;
+ FeedbackPrivateDelegate* GetFeedbackPrivateDelegate() override;
+
+ private:
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<FileSystemDelegate> file_system_delegate_;
+ #endif
+ std::unique_ptr<MessagingDelegate> messaging_delegate_;
diff --git a/chromium-next/patches/patch-google__apis_gcm_engine_heartbeat__manager.cc b/chromium-next/patches/patch-google__apis_gcm_engine_heartbeat__manager.cc
new file mode 100644
index 0000000000..e45e4dabc4
--- /dev/null
+++ b/chromium-next/patches/patch-google__apis_gcm_engine_heartbeat__manager.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- google_apis/gcm/engine/heartbeat_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ google_apis/gcm/engine/heartbeat_manager.cc
+@@ -32,7 +32,7 @@ const int kMinClientHeartbeatIntervalMs
+ // Minimum time spent sleeping before we force a new heartbeat.
+ const int kMinSuspendTimeMs = 1000 * 10; // 10 seconds.
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // The period at which to check if the heartbeat time has passed. Used to
+ // protect against platforms where the timer is delayed by the system being
+ // suspended. Only needed on linux because the other OSes provide a standard
+@@ -191,7 +191,7 @@ void HeartbeatManager::RestartTimer() {
+ base::BindRepeating(&HeartbeatManager::OnHeartbeatTriggered,
+ weak_ptr_factory_.GetWeakPtr()));
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Windows, Mac, Android, iOS, and Chrome OS all provide a way to be notified
+ // when the system is suspending or resuming. The only one that does not is
+ // Linux so we need to poll to check for missed heartbeats.
+@@ -214,7 +214,7 @@ void HeartbeatManager::CheckForMissedHea
+ return;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Otherwise check again later.
+ io_task_runner_->PostDelayedTask(
+ FROM_HERE,
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_dawn__context__provider.cc b/chromium-next/patches/patch-gpu_command__buffer_service_dawn__context__provider.cc
new file mode 100644
index 0000000000..874f059b61
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_dawn__context__provider.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/dawn_context_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/dawn_context_provider.cc
+@@ -303,7 +303,7 @@ wgpu::BackendType DawnContextProvider::G
+ return base::FeatureList::IsEnabled(features::kSkiaGraphiteDawnUseD3D12)
+ ? wgpu::BackendType::D3D12
+ : wgpu::BackendType::D3D11;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ return wgpu::BackendType::Vulkan;
+ #elif BUILDFLAG(IS_APPLE)
+ return wgpu::BackendType::Metal;
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc b/chromium-next/patches/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc
new file mode 100644
index 0000000000..cc44e0bd7d
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_gles2__cmd__decoder.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/gles2_cmd_decoder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/gles2_cmd_decoder.cc
+@@ -2874,7 +2874,7 @@ GLES2Decoder* GLES2Decoder::Create(
+ }
+
+ // Allow linux to run fuzzers.
+-#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return new GLES2DecoderImpl(client, command_buffer_service, outputter, group);
+ #else
+ LOG(FATAL) << "Validating command decoder is not supported.";
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.cc
new file mode 100644
index 0000000000..5133651ef9
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_context_state.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_context_state.cc
+@@ -60,7 +60,7 @@
+ #include "gpu/vulkan/vulkan_implementation.h"
+ #include "gpu/vulkan/vulkan_util.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "gpu/command_buffer/service/external_semaphore_pool.h"
+ #endif
+
+@@ -379,7 +379,7 @@ SharedContextState::SharedContextState(
+ if (gr_context_type_ == GrContextType::kVulkan) {
+ if (vk_context_provider_) {
+ #if BUILDFLAG(ENABLE_VULKAN) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD))
+ external_semaphore_pool_ = std::make_unique<ExternalSemaphorePool>(this);
+ #endif
+ use_virtualized_gl_contexts_ = false;
+@@ -416,7 +416,7 @@ SharedContextState::~SharedContextState(
+ }
+
+ #if BUILDFLAG(ENABLE_VULKAN) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD))
+ external_semaphore_pool_.reset();
+ #endif
+
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.h b/chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.h
new file mode 100644
index 0000000000..4f4e7d4342
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__context__state.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_context_state.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_context_state.h
+@@ -222,7 +222,7 @@ class GPU_GLES2_EXPORT SharedContextStat
+ return &memory_type_tracker_;
+ }
+ #if BUILDFLAG(ENABLE_VULKAN) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD))
+ ExternalSemaphorePool* external_semaphore_pool() {
+ return external_semaphore_pool_.get();
+ }
+@@ -429,7 +429,7 @@ class GPU_GLES2_EXPORT SharedContextStat
+ bool disable_check_reset_status_throttling_for_test_ = false;
+
+ #if BUILDFLAG(ENABLE_VULKAN) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD))
+ std::unique_ptr<ExternalSemaphorePool> external_semaphore_pool_;
+ #endif
+
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc
new file mode 100644
index 0000000000..18cde043a9
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_angle__vulkan__image__backing__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_image/angle_vulkan_image_backing_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_image/angle_vulkan_image_backing_factory.cc
+@@ -20,7 +20,7 @@ namespace {
+ // TODO(penghuang): verify the scanout is the right usage for video playback.
+ // crbug.com/1280798
+ constexpr SharedImageUsageSet kSupportedUsage =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ SHARED_IMAGE_USAGE_SCANOUT |
+ #endif
+ SHARED_IMAGE_USAGE_GLES2_READ | SHARED_IMAGE_USAGE_GLES2_WRITE |
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc
new file mode 100644
index 0000000000..f540a7b7f2
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_image/external_vk_image_backing.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_image/external_vk_image_backing.cc
+@@ -57,7 +57,7 @@
+ #include "ui/gl/gl_version_info.h"
+ #include "ui/gl/scoped_binders.h"
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_DAWN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN)
+ #include "gpu/command_buffer/service/shared_image/external_vk_image_dawn_representation.h"
+ #if BUILDFLAG(DAWN_ENABLE_BACKEND_OPENGLES)
+ #include "gpu/command_buffer/service/shared_image/dawn_gl_texture_representation.h"
+@@ -702,7 +702,7 @@ std::unique_ptr<DawnImageRepresentation>
+ wgpu::BackendType backend_type,
+ std::vector<wgpu::TextureFormat> view_formats,
+ scoped_refptr<SharedContextState> context_state) {
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_DAWN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN)
+ auto wgpu_format = ToDawnFormat(format());
+
+ if (wgpu_format == wgpu::TextureFormat::Undefined) {
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc
new file mode 100644
index 0000000000..b25cd9588f
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_external__vk__image__backing__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_image/external_vk_image_backing_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_image/external_vk_image_backing_factory.cc
+@@ -176,7 +176,7 @@ bool IsFormatSupported(viz::SharedImageF
+
+ SharedImageUsageSet SupportedUsage() {
+ SharedImageUsageSet supported_usage =
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_DAWN)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_DAWN)
+ SHARED_IMAGE_USAGE_WEBGPU_READ | SHARED_IMAGE_USAGE_WEBGPU_WRITE |
+ SHARED_IMAGE_USAGE_WEBGPU_SWAP_CHAIN_TEXTURE |
+ SHARED_IMAGE_USAGE_WEBGPU_STORAGE_TEXTURE |
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__factory.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__factory.cc
new file mode 100644
index 0000000000..e593650675
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__factory.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_image/shared_image_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_image/shared_image_factory.cc
+@@ -48,7 +48,7 @@
+ #include "gpu/command_buffer/service/shared_image/angle_vulkan_image_backing_factory.h"
+ #include "gpu/vulkan/vulkan_device_queue.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "gpu/command_buffer/service/shared_image/external_vk_image_backing_factory.h"
+ #endif
+
+@@ -112,7 +112,7 @@ gfx::GpuMemoryBufferType GetNativeBuffer
+ return gfx::GpuMemoryBufferType::IO_SURFACE_BUFFER;
+ #elif BUILDFLAG(IS_ANDROID)
+ return gfx::GpuMemoryBufferType::ANDROID_HARDWARE_BUFFER;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ return gfx::GpuMemoryBufferType::NATIVE_PIXMAP;
+ #elif BUILDFLAG(IS_WIN)
+ return gfx::GpuMemoryBufferType::DXGI_SHARED_HANDLE;
+@@ -316,7 +316,7 @@ SharedImageFactory::SharedImageFactory(
+ context_state_, workarounds_);
+ factories_.push_back(std::move(ozone_factory));
+ }
+-#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA))
++#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD))
+ if (gr_context_type_ == GrContextType::kVulkan) {
+ auto external_vk_image_factory =
+ std::make_unique<ExternalVkImageBackingFactory>(context_state_);
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc
new file mode 100644
index 0000000000..fa962bb9c9
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_shared__image__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_image/shared_image_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_image/shared_image_manager.cc
+@@ -604,7 +604,7 @@ bool SharedImageManager::SupportsScanout
+ return true;
+ #elif BUILDFLAG(IS_ANDROID)
+ return base::AndroidHardwareBufferCompat::IsSupportAvailable();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // We are in the process of tightening scanout support on Ozone to be guarded
+ // by overlays being supported rather than merely native pixmaps being
+ // supported, as native pixmap support doesn't always imply that those native
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc
new file mode 100644
index 0000000000..c4eaa9b113
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_shared__image_wrapped__sk__image__backing.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc
+@@ -214,7 +214,7 @@ bool WrappedSkImageBacking::Initialize(c
+
+ constexpr GrRenderable is_renderable = GrRenderable::kYes;
+ constexpr GrProtected is_protected = GrProtected::kNo;
+-#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX)
++#if DCHECK_IS_ON() && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // Blue for single-planar and magenta-ish for multi-planar.
+ SkColor4f fallback_color =
+ format().is_single_plane() ? SkColors::kBlue : SkColors::kWhite;
diff --git a/chromium-next/patches/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc b/chromium-next/patches/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc
new file mode 100644
index 0000000000..41e613fc1f
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/service/webgpu_decoder_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/service/webgpu_decoder_impl.cc
+@@ -1341,7 +1341,7 @@ WGPUFuture WebGPUDecoderImpl::RequestAda
+ force_fallback_adapter = true;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!shared_context_state_->GrContextIsVulkan() &&
+ !shared_context_state_->IsGraphiteDawnVulkan() &&
+ use_webgpu_adapter_ != WebGPUAdapterName::kOpenGLES) {
+@@ -2026,7 +2026,7 @@ WebGPUDecoderImpl::AssociateMailboxDawn(
+ }
+
+ #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_APPLE) && \
+- !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_LINUX)
++ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ if (usage & wgpu::TextureUsage::StorageBinding) {
+ LOG(ERROR) << "AssociateMailbox: wgpu::TextureUsage::StorageBinding is NOT "
+ "supported yet on this platform.";
diff --git a/chromium-next/patches/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc b/chromium-next/patches/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc
new file mode 100644
index 0000000000..29a2f9a46a
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+@@ -32,7 +32,7 @@
+ #include "ui/gfx/half_float.h"
+ #include "ui/gl/test/gl_test_support.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h"
+ #include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h"
+ #endif
+@@ -75,7 +75,7 @@ class GpuMemoryBufferTest : public testi
+ GLManager gl_;
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ class GpuMemoryBufferTestEGL : public testing::Test,
+ public gpu::GpuCommandBufferTestEGL {
+ public:
diff --git a/chromium-next/patches/patch-gpu_config_gpu__control__list.cc b/chromium-next/patches/patch-gpu_config_gpu__control__list.cc
new file mode 100644
index 0000000000..d74fada64b
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_config_gpu__control__list.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/config/gpu_control_list.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/config/gpu_control_list.cc
+@@ -276,7 +276,7 @@ bool GpuControlList::More::GLVersionInfo
+ GpuControlList::GLType GpuControlList::More::GetDefaultGLType() {
+ #if BUILDFLAG(IS_CHROMEOS)
+ return kGLTypeGL;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OPENBSD)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return kGLTypeGL;
+ #elif BUILDFLAG(IS_MAC)
+ return kGLTypeGL;
+@@ -847,7 +847,7 @@ GpuControlList::OsType GpuControlList::G
+ return kOsAndroid;
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return kOsFuchsia;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OPENBSD)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return kOsLinux;
+ #elif BUILDFLAG(IS_MAC)
+ return kOsMacosx;
diff --git a/chromium-next/patches/patch-gpu_config_gpu__finch__features.cc b/chromium-next/patches/patch-gpu_config_gpu__finch__features.cc
new file mode 100644
index 0000000000..82c66ce7ed
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_config_gpu__finch__features.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/config/gpu_finch_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/config/gpu_finch_features.cc
+@@ -166,7 +166,8 @@ BASE_FEATURE(kAllowHardwareBufferUsageFl
+ BASE_FEATURE(kDefaultEnableGpuRasterization,
+ "DefaultEnableGpuRasterization",
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \
++ BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-gpu_config_gpu__info__collector.cc b/chromium-next/patches/patch-gpu_config_gpu__info__collector.cc
new file mode 100644
index 0000000000..6a4b8a276c
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_config_gpu__info__collector.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/config/gpu_info_collector.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/config/gpu_info_collector.cc
+@@ -358,7 +358,7 @@ void ReportWebGPUAdapterMetrics(dawn::na
+ void ReportWebGPUSupportMetrics(dawn::native::Instance* instance) {
+ static BASE_FEATURE(kCollectWebGPUSupportMetrics,
+ "CollectWebGPUSupportMetrics",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #else
+ base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chromium-next/patches/patch-gpu_config_gpu__test__config.cc b/chromium-next/patches/patch-gpu_config_gpu__test__config.cc
new file mode 100644
index 0000000000..6fd1fd6234
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_config_gpu__test__config.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/config/gpu_test_config.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/config/gpu_test_config.cc
+@@ -29,7 +29,7 @@ GPUTestConfig::OS GetCurrentOS() {
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ return GPUTestConfig::kOsChromeOS;
+ #elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_OPENBSD)
++ BUILDFLAG(IS_BSD)
+ return GPUTestConfig::kOsLinux;
+ #elif BUILDFLAG(IS_WIN)
+ int32_t major_version = 0;
diff --git a/chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.cc b/chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.cc
new file mode 100644
index 0000000000..951b3a370b
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/ipc/common/gpu_memory_buffer_support.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/ipc/common/gpu_memory_buffer_support.cc
+@@ -26,7 +26,7 @@
+ #include "ui/ozone/public/ozone_platform.h"
+ #endif
+
+-#if BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h"
+ #endif
+
+@@ -55,7 +55,7 @@ GpuMemoryBufferSupport::GetNativeGpuMemo
+ return gfx::IO_SURFACE_BUFFER;
+ #elif BUILDFLAG(IS_ANDROID)
+ return gfx::ANDROID_HARDWARE_BUFFER;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ return gfx::NATIVE_PIXMAP;
+ #elif BUILDFLAG(IS_WIN)
+ return gfx::DXGI_SHARED_HANDLE;
diff --git a/chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.h b/chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.h
new file mode 100644
index 0000000000..9d62d9df29
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_ipc_common_gpu__memory__buffer__support.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/ipc/common/gpu_memory_buffer_support.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/ipc/common/gpu_memory_buffer_support.h
+@@ -21,7 +21,7 @@
+ #include "ui/gfx/geometry/size.h"
+ #include "ui/gfx/gpu_memory_buffer.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ namespace gfx {
+ class ClientNativePixmapFactory;
+ } // namespace gfx
diff --git a/chromium-next/patches/patch-gpu_ipc_service_gpu__init.cc b/chromium-next/patches/patch-gpu_ipc_service_gpu__init.cc
new file mode 100644
index 0000000000..a96429a91f
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_ipc_service_gpu__init.cc
@@ -0,0 +1,80 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/ipc/service/gpu_init.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/ipc/service/gpu_init.cc
+@@ -388,7 +388,7 @@ bool GpuInit::InitializeAndStartSandbox(
+ enable_watchdog = false;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool gpu_sandbox_start_early = gpu_preferences_.gpu_sandbox_start_early;
+ #else // !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
+ // For some reasons MacOSX's VideoToolbox might crash when called after
+@@ -425,7 +425,7 @@ bool GpuInit::InitializeAndStartSandbox(
+ }
+
+ bool attempted_startsandbox = false;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Chrome OS ARM Mali, GPU driver userspace creates threads when
+ // initializing a GL context, so start the sandbox early.
+ // TODO(zmo): Need to collect OS version before this.
+@@ -527,7 +527,7 @@ bool GpuInit::InitializeAndStartSandbox(
+ gpu_preferences_.gr_context_type = GrContextType::kGL;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The ContentSandboxHelper is currently the only one implementation of
+ // GpuSandboxHelper and it has no dependency. Except on Linux where
+ // VaapiWrapper checks the GL implementation to determine which display
+@@ -609,7 +609,7 @@ bool GpuInit::InitializeAndStartSandbox(
+ command_line, gpu_feature_info_,
+ gpu_preferences_.disable_software_rasterizer, false);
+ if (gl_use_swiftshader_) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
+ << "on Linux";
+ return false;
+@@ -765,7 +765,7 @@ bool GpuInit::InitializeAndStartSandbox(
+
+ InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Driver may create a compatibility profile context when collect graphics
+ // information on Linux platform. Try to collect graphics information
+ // based on core profile context after disabling platform extensions.
+@@ -820,7 +820,7 @@ bool GpuInit::InitializeAndStartSandbox(
+ }
+ }
+ }
+-#if BUILDFLAG(IS_LINUX) || \
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE))
+ if (!gl_disabled && !gl_use_swiftshader_ && std::getenv("RUNNING_UNDER_RR")) {
+ // https://rr-project.org/ is a Linux-only record-and-replay debugger that
+@@ -1007,7 +1007,7 @@ void GpuInit::InitializeInProcess(base::
+ }
+ bool gl_disabled = gl::GetGLImplementation() == gl::kGLImplementationDisabled;
+
+-#if BUILDFLAG(IS_LINUX) || \
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE))
+ if (!gl_disabled && !gl_use_swiftshader_ && std::getenv("RUNNING_UNDER_RR")) {
+ // https://rr-project.org/ is a Linux-only record-and-replay debugger that
+@@ -1062,7 +1062,7 @@ void GpuInit::InitializeInProcess(base::
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Driver may create a compatibility profile context when collect graphics
+ // information on Linux platform. Try to collect graphics information
+ // based on core profile context after disabling platform extensions.
diff --git a/chromium-next/patches/patch-gpu_ipc_service_gpu__memory__buffer__factory.cc b/chromium-next/patches/patch-gpu_ipc_service_gpu__memory__buffer__factory.cc
new file mode 100644
index 0000000000..e9b6ea31a4
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_ipc_service_gpu__memory__buffer__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/ipc/service/gpu_memory_buffer_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/ipc/service/gpu_memory_buffer_factory.cc
+@@ -14,7 +14,7 @@
+ #include "gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h"
+ #endif
+
+@@ -71,7 +71,7 @@ GpuMemoryBufferFactory::CreateNativeType
+ // to have a factory that vends invalid GMB handles rather than having no
+ // factory at all.
+ return std::make_unique<GpuMemoryBufferFactoryStub>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ return std::make_unique<GpuMemoryBufferFactoryNativePixmap>(
+ vulkan_context_provider);
+ #elif BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-gpu_ipc_service_x__util.h b/chromium-next/patches/patch-gpu_ipc_service_x__util.h
new file mode 100644
index 0000000000..9ea4c13883
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_ipc_service_x__util.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/ipc/service/x_util.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/ipc/service/x_util.h
+@@ -12,7 +12,7 @@
+ #include "gpu/ipc/service/gpu_config.h"
+ #include "ui/base/ozone_buildflags.h"
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+
+ namespace gpu {
+
diff --git a/chromium-next/patches/patch-gpu_vulkan_generate__bindings.py b/chromium-next/patches/patch-gpu_vulkan_generate__bindings.py
new file mode 100644
index 0000000000..3b20acffa7
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_generate__bindings.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/generate_bindings.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/generate_bindings.py
+@@ -271,7 +271,7 @@ VULKAN_DEVICE_FUNCTIONS = [
+ ]
+ },
+ {
+- 'ifdef': 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)',
++ 'ifdef': 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)',
+ 'extension': 'VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME',
+ 'functions': [
+ 'vkGetImageDrmFormatModifierPropertiesEXT',
diff --git a/chromium-next/patches/patch-gpu_vulkan_semaphore__handle.cc b/chromium-next/patches/patch-gpu_vulkan_semaphore__handle.cc
new file mode 100644
index 0000000000..2e0e4cb5c6
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_semaphore__handle.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/semaphore_handle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/semaphore_handle.cc
+@@ -39,7 +39,7 @@ SemaphoreHandle::SemaphoreHandle(gfx::Gp
+ // https://fuchsia.dev/reference/fidl/fuchsia.ui.scenic.
+ Init(VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA,
+ fence_handle.Release());
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ Init(VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR,
+ fence_handle.Release());
+ #elif BUILDFLAG(IS_POSIX)
+@@ -64,7 +64,7 @@ gfx::GpuFenceHandle SemaphoreHandle::ToG
+ // VkSemaphore, which can then be used to submit present work, see
+ // https://fuchsia.dev/reference/fidl/fuchsia.ui.scenic.
+ fence_handle.Adopt(TakeHandle());
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ if (type_ == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR) {
+ fence_handle.Adopt(TakeHandle());
+ } else {
diff --git a/chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.cc b/chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.cc
new file mode 100644
index 0000000000..423354ffd5
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/vulkan_device_queue.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/vulkan_device_queue.cc
+@@ -154,7 +154,7 @@ bool VulkanDeviceQueue::Initialize(
+
+ // In dual-CPU cases, we cannot detect the active GPU correctly on Linux,
+ // so don't select GPU device based on the |gpu_info|.
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ // If gpu_info is provided, the device should match it.
+ if (gpu_info && (device_properties.vendorID != gpu_info->gpu.vendor_id ||
+ device_properties.deviceID != gpu_info->gpu.device_id)) {
+@@ -297,7 +297,7 @@ bool VulkanDeviceQueue::Initialize(
+ // Android, Fuchsia, Linux, and CrOS (VaapiVideoDecoder) need YCbCr sampler
+ // support.
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!physical_device_info.feature_sampler_ycbcr_conversion) {
+ LOG(ERROR) << "samplerYcbcrConversion is not supported.";
+ return false;
diff --git a/chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.h b/chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.h
new file mode 100644
index 0000000000..ceee2ccc4c
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_vulkan__device__queue.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/vulkan_device_queue.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/vulkan_device_queue.h
+@@ -179,7 +179,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanDev
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures
+ sampler_ycbcr_conversion_features_{
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES};
diff --git a/chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.cc b/chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.cc
new file mode 100644
index 0000000000..8cb424f6d8
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/vulkan_function_pointers.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/vulkan_function_pointers.cc
+@@ -1297,7 +1297,7 @@ bool VulkanFunctionPointers::BindDeviceF
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (gfx::HasExtension(enabled_extensions,
+ VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME)) {
+ constexpr char kvkGetImageDrmFormatModifierPropertiesEXT[] =
+@@ -1498,7 +1498,7 @@ void VulkanFunctionPointers::ResetForTes
+ vkGetSwapchainImagesKHR = nullptr;
+ vkQueuePresentKHR = nullptr;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ vkGetImageDrmFormatModifierPropertiesEXT = nullptr;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ }
diff --git a/chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.h b/chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.h
new file mode 100644
index 0000000000..0657c210fa
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_vulkan__function__pointers.h
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/vulkan_function_pointers.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/vulkan_function_pointers.h
+@@ -322,7 +322,7 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFu
+ VulkanFunction<PFN_vkGetSwapchainImagesKHR> vkGetSwapchainImagesKHR;
+ VulkanFunction<PFN_vkQueuePresentKHR> vkQueuePresentKHR;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VulkanFunction<PFN_vkGetImageDrmFormatModifierPropertiesEXT>
+ vkGetImageDrmFormatModifierPropertiesEXT;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -1336,7 +1336,7 @@ ALWAYS_INLINE VkResult vkQueuePresentKHR
+ pPresentInfo);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ALWAYS_INLINE VkResult vkGetImageDrmFormatModifierPropertiesEXT(
+ VkDevice device,
+ VkImage image,
+@@ -1346,4 +1346,4 @@ ALWAYS_INLINE VkResult vkGetImageDrmForm
+ }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
+\ No newline at end of file
++#endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_
diff --git a/chromium-next/patches/patch-gpu_vulkan_vulkan__image.h b/chromium-next/patches/patch-gpu_vulkan_vulkan__image.h
new file mode 100644
index 0000000000..655a178491
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_vulkan__image.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/vulkan_image.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/vulkan_image.h
+@@ -87,7 +87,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanIma
+ VkImageUsageFlags usage,
+ VkImageCreateFlags flags);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static std::unique_ptr<VulkanImage> CreateWithExternalMemoryAndModifiers(
+ VulkanDeviceQueue* device_queue,
+ const gfx::Size& size,
+@@ -199,7 +199,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanIma
+ VkImageTiling image_tiling,
+ uint32_t queue_family_index);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool InitializeWithExternalMemoryAndModifiers(VulkanDeviceQueue* device_queue,
+ const gfx::Size& size,
+ VkFormat format,
diff --git a/chromium-next/patches/patch-gpu_vulkan_vulkan__util.cc b/chromium-next/patches/patch-gpu_vulkan_vulkan__util.cc
new file mode 100644
index 0000000000..d74fba4d06
--- /dev/null
+++ b/chromium-next/patches/patch-gpu_vulkan_vulkan__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- gpu/vulkan/vulkan_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ gpu/vulkan/vulkan_util.cc
+@@ -473,7 +473,7 @@ bool CheckVulkanCompatibilities(
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) && !defined(OZONE_PLATFORM_IS_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !defined(OZONE_PLATFORM_IS_X11)
+ // Vulkan is only supported with X11 on Linux for now.
+ return false;
+ #else
diff --git a/chromium-next/patches/patch-headless_lib_browser_headless__browser__main__parts__posix.cc b/chromium-next/patches/patch-headless_lib_browser_headless__browser__main__parts__posix.cc
new file mode 100644
index 0000000000..c684bdeb3a
--- /dev/null
+++ b/chromium-next/patches/patch-headless_lib_browser_headless__browser__main__parts__posix.cc
@@ -0,0 +1,45 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- headless/lib/browser/headless_browser_main_parts_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ headless/lib/browser/headless_browser_main_parts_posix.cc
+@@ -21,13 +21,13 @@
+ #include "content/public/browser/browser_thread.h"
+ #include "headless/lib/browser/headless_browser_impl.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/command_line.h"
+ #include "components/os_crypt/sync/key_storage_config_linux.h"
+ #include "components/os_crypt/sync/os_crypt.h"
+ #include "headless/public/switches.h"
+
+-#if defined(USE_DBUS)
++#if defined(USE_DBUS) && !BUILDFLAG(IS_BSD)
+ #include "device/bluetooth/dbus/bluez_dbus_manager.h"
+ #endif
+
+@@ -161,7 +161,7 @@ class BrowserShutdownHandler {
+
+ } // namespace
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr char kProductName[] = "HeadlessChrome";
+ #endif
+
+@@ -169,9 +169,9 @@ void HeadlessBrowserMainParts::PostCreat
+ BrowserShutdownHandler::Install(base::BindOnce(
+ &HeadlessBrowserImpl::ShutdownWithExitCode, browser_->GetWeakPtr()));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+-#if defined(USE_DBUS)
++#if defined(USE_DBUS) && !BUILDFLAG(IS_BSD)
+ bluez::BluezDBusManager::Initialize(/*system_bus=*/nullptr);
+ #endif
+
diff --git a/chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.cc b/chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.cc
new file mode 100644
index 0000000000..af1d39945f
--- /dev/null
+++ b/chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- headless/lib/browser/headless_content_browser_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ headless/lib/browser/headless_content_browser_client.cc
+@@ -56,7 +56,7 @@
+ #include "content/public/common/content_descriptors.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)) && defined(HEADLESS_USE_PREFS)
++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(HEADLESS_USE_PREFS)
+ #include "components/os_crypt/sync/os_crypt.h" // nogncheck
+ #include "content/public/browser/network_service_util.h"
+ #endif
+@@ -516,7 +516,7 @@ void HeadlessContentBrowserClient::Handl
+
+ void HeadlessContentBrowserClient::SetEncryptionKey(
+ ::network::mojom::NetworkService* network_service) {
+-#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)) && defined(HEADLESS_USE_PREFS)
++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(HEADLESS_USE_PREFS)
+ // The OSCrypt keys are process bound, so if network service is out of
+ // process, send it the required key if it is available.
+ if (content::IsOutOfProcessNetworkService()
diff --git a/chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.h b/chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.h
new file mode 100644
index 0000000000..c1642545e9
--- /dev/null
+++ b/chromium-next/patches/patch-headless_lib_browser_headless__content__browser__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- headless/lib/browser/headless_content_browser_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ headless/lib/browser/headless_content_browser_client.h
+@@ -45,7 +45,7 @@ class HeadlessContentBrowserClient : pub
+ CreateDevToolsManagerDelegate() override;
+ content::GeneratedCodeCacheSettings GetGeneratedCodeCacheSettings(
+ content::BrowserContext* context) override;
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ void GetAdditionalMappedFilesForChildProcess(
+ const base::CommandLine& command_line,
+ int child_process_id,
diff --git a/chromium-next/patches/patch-headless_lib_browser_headless__web__contents__impl.cc b/chromium-next/patches/patch-headless_lib_browser_headless__web__contents__impl.cc
new file mode 100644
index 0000000000..c051584704
--- /dev/null
+++ b/chromium-next/patches/patch-headless_lib_browser_headless__web__contents__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- headless/lib/browser/headless_web_contents_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ headless/lib/browser/headless_web_contents_impl.cc
+@@ -69,7 +69,7 @@ BASE_FEATURE(kPrerender2InHeadlessMode,
+ namespace {
+
+ void UpdatePrefsFromSystemSettings(blink::RendererPreferences* prefs) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ content::UpdateFontRendererPreferencesFromSystemSettings(prefs);
+ #endif
+
diff --git a/chromium-next/patches/patch-headless_lib_headless__content__main__delegate.cc b/chromium-next/patches/patch-headless_lib_headless__content__main__delegate.cc
new file mode 100644
index 0000000000..e62149c8ac
--- /dev/null
+++ b/chromium-next/patches/patch-headless_lib_headless__content__main__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- headless/lib/headless_content_main_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ headless/lib/headless_content_main_delegate.cc
+@@ -407,7 +407,7 @@ void HeadlessContentMainDelegate::InitCr
+ if (process_type != ::switches::kZygoteProcess) {
+ g_headless_crash_client.Pointer()->set_crash_dumps_dir(
+ command_line.GetSwitchValuePath(switches::kCrashDumpsDir));
+-#if !BUILDFLAG(IS_WIN)
++#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD)
+ crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
+ #endif // !BUILDFLAG(IS_WIN)
+ crash_keys::SetSwitchesFromCommandLine(command_line, nullptr);
diff --git a/chromium-next/patches/patch-ipc_ipc__channel.h b/chromium-next/patches/patch-ipc_ipc__channel.h
new file mode 100644
index 0000000000..0088c42801
--- /dev/null
+++ b/chromium-next/patches/patch-ipc_ipc__channel.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ipc/ipc_channel.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ipc/ipc_channel.h
+@@ -218,7 +218,7 @@ class COMPONENT_EXPORT(IPC) Channel : pu
+ static std::string GenerateUniqueRandomChannelID();
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Sandboxed processes live in a PID namespace, so when sending the IPC hello
+ // message from client to server we need to send the PID from the global
+ // PID namespace.
diff --git a/chromium-next/patches/patch-ipc_ipc__channel__common.cc b/chromium-next/patches/patch-ipc_ipc__channel__common.cc
new file mode 100644
index 0000000000..adda77cd1a
--- /dev/null
+++ b/chromium-next/patches/patch-ipc_ipc__channel__common.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ipc/ipc_channel_common.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ipc/ipc_channel_common.cc
+@@ -10,7 +10,7 @@
+
+ namespace IPC {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ namespace {
+ int g_global_pid = 0;
diff --git a/chromium-next/patches/patch-ipc_ipc__channel__mojo.cc b/chromium-next/patches/patch-ipc_ipc__channel__mojo.cc
new file mode 100644
index 0000000000..e5db18193b
--- /dev/null
+++ b/chromium-next/patches/patch-ipc_ipc__channel__mojo.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ipc/ipc_channel_mojo.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ipc/ipc_channel_mojo.cc
+@@ -105,7 +105,7 @@ class ThreadSafeChannelProxy : public mo
+ };
+
+ base::ProcessId GetSelfPID() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (int global_pid = Channel::GetGlobalPid())
+ return global_pid;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-ipc_ipc__message__utils.cc b/chromium-next/patches/patch-ipc_ipc__message__utils.cc
new file mode 100644
index 0000000000..641a7210b9
--- /dev/null
+++ b/chromium-next/patches/patch-ipc_ipc__message__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ipc/ipc_message_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ipc/ipc_message_utils.cc
+@@ -399,7 +399,7 @@ void ParamTraits<unsigned int>::Log(cons
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ void ParamTraits<long>::Log(const param_type& p, std::string* l) {
+ l->append(base::NumberToString(p));
diff --git a/chromium-next/patches/patch-ipc_ipc__message__utils.h b/chromium-next/patches/patch-ipc_ipc__message__utils.h
new file mode 100644
index 0000000000..8901c8a223
--- /dev/null
+++ b/chromium-next/patches/patch-ipc_ipc__message__utils.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ipc/ipc_message_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ipc/ipc_message_utils.h
+@@ -214,7 +214,7 @@ struct ParamTraits<unsigned int> {
+ // Since we want to support Android 32<>64 bit IPC, as long as we don't have
+ // these traits for 32 bit ARM then that'll catch any errors.
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ template <>
+ struct ParamTraits<long> {
diff --git a/chromium-next/patches/patch-media_BUILD.gn b/chromium-next/patches/patch-media_BUILD.gn
new file mode 100644
index 0000000000..1f97306c16
--- /dev/null
+++ b/chromium-next/patches/patch-media_BUILD.gn
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/BUILD.gn
+@@ -99,6 +99,12 @@ config("media_config") {
+ defines += [ "DLOPEN_PULSEAUDIO" ]
+ }
+ }
++ if (use_sndio) {
++ defines += [ "USE_SNDIO" ]
++ }
++# if (use_audioio) {
++# defines += [ "USE_AUDIOIO" ]
++# }
+ }
+
+ # Internal grouping of the configs necessary to support sub-folders having their
diff --git a/chromium-next/patches/patch-media_audio_BUILD.gn b/chromium-next/patches/patch-media_audio_BUILD.gn
new file mode 100644
index 0000000000..ab04aeeb0c
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_BUILD.gn
@@ -0,0 +1,45 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/audio/BUILD.gn
+@@ -269,10 +269,35 @@ source_set("audio") {
+ deps += [ "//media/base/android:media_jni_headers" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "linux/audio_manager_linux.cc" ]
+ }
+
++ if (is_bsd && !use_audioio) {
++ sources += [ "sndio/audio_manager_sndio.cc" ]
++ }
++
++ if (use_sndio) {
++ libs += [ "sndio" ]
++ sources += [
++ "sndio/sndio_input.cc",
++ "sndio/sndio_input.h",
++ "sndio/sndio_output.cc",
++ "sndio/sndio_output.h"
++ ]
++ }
++
++ if (use_audioio) {
++ sources += [
++ "audioio/audio_manager_audioio.cc",
++ "audioio/audio_manager_audioio.h",
++ "audioio/audioio_input.cc",
++ "audioio/audioio_input.h",
++ "audioio/audioio_output.cc",
++ "audioio/audioio_output.h"
++ ]
++ }
++
+ if (use_alsa) {
+ libs += [ "asound" ]
+ sources += [
diff --git a/chromium-next/patches/patch-media_audio_alsa_audio__manager__alsa.cc b/chromium-next/patches/patch-media_audio_alsa_audio__manager__alsa.cc
new file mode 100644
index 0000000000..180919cf07
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_alsa_audio__manager__alsa.cc
@@ -0,0 +1,60 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/alsa/audio_manager_alsa.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/audio/alsa/audio_manager_alsa.cc
+@@ -100,7 +100,9 @@ void AudioManagerAlsa::GetAlsaAudioDevic
+ int card = -1;
+
+ // Loop through the physical sound cards to get ALSA device hints.
++#if !BUILDFLAG(IS_BSD)
+ while (!wrapper_->CardNext(&card) && card >= 0) {
++#endif
+ void** hints = NULL;
+ int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
+ if (!error) {
+@@ -112,7 +114,9 @@ void AudioManagerAlsa::GetAlsaAudioDevic
+ DLOG(WARNING) << "GetAlsaAudioDevices: unable to get device hints: "
+ << wrapper_->StrError(error);
+ }
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+ }
+
+ void AudioManagerAlsa::GetAlsaDevicesInfo(AudioManagerAlsa::StreamType type,
+@@ -195,7 +199,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvail
+ // goes through software conversion if needed (e.g. incompatible
+ // sample rate).
+ // TODO(joi): Should we prefer "hw" instead?
++#if BUILDFLAG(IS_BSD)
++ static const char kDeviceTypeDesired[] = "plug";
++#else
+ static const char kDeviceTypeDesired[] = "plughw";
++#endif
+ return strncmp(kDeviceTypeDesired, device_name,
+ std::size(kDeviceTypeDesired) - 1) == 0;
+ }
+@@ -247,7 +255,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDe
+ // Loop through the sound cards.
+ // Don't use snd_device_name_hint(-1,..) since there is an access violation
+ // inside this ALSA API with libasound.so.2.0.0.
++#if !BUILDFLAG(IS_BSD)
+ while (!wrapper_->CardNext(&card) && (card >= 0) && !has_device) {
++#endif
+ int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
+ if (!error) {
+ for (void** hint_iter = hints; *hint_iter != NULL; hint_iter++) {
+@@ -271,7 +281,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDe
+ DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: "
+ << wrapper_->StrError(error);
+ }
++#if !BUILDFLAG(IS_BSD)
+ }
++#endif
+
+ return has_device;
+ }
diff --git a/chromium-next/patches/patch-media_audio_audio__input__device.cc b/chromium-next/patches/patch-media_audio_audio__input__device.cc
new file mode 100644
index 0000000000..db9be2028b
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_audio__input__device.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/audio_input_device.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/audio/audio_input_device.cc
+@@ -269,7 +269,7 @@ void AudioInputDevice::OnStreamCreated(
+ // here. See comments in AliveChecker and PowerObserverHelper for details and
+ // todos.
+ if (detect_dead_stream_ == DeadStreamDetection::kEnabled) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const bool stop_at_first_alive_notification = true;
+ const bool pause_check_during_suspend = false;
+ #else
diff --git a/chromium-next/patches/patch-media_audio_audio__output__proxy__unittest.cc b/chromium-next/patches/patch-media_audio_audio__output__proxy__unittest.cc
new file mode 100644
index 0000000000..b14ad02901
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_audio__output__proxy__unittest.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/audio_output_proxy_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/audio/audio_output_proxy_unittest.cc
+@@ -443,7 +443,11 @@ class AudioOutputProxyTest : public test
+ // |stream| is closed at this point. Start() should reopen it again.
+ EXPECT_CALL(manager(), MakeAudioOutputStream(_, _, _))
+ .Times(2)
++#if BUILDFLAG(IS_BSD)
++ .WillRepeatedly(Return(static_cast<AudioOutputStream*>(NULL)));
++#else
+ .WillRepeatedly(Return(reinterpret_cast<AudioOutputStream*>(NULL)));
++#endif
+
+ EXPECT_CALL(callback_, OnError(_)).Times(2);
+
diff --git a/chromium-next/patches/patch-media_audio_pulse_pulse__util.cc b/chromium-next/patches/patch-media_audio_pulse_pulse__util.cc
new file mode 100644
index 0000000000..9eee8d5996
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_pulse_pulse__util.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/pulse/pulse_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/audio/pulse/pulse_util.cc
+@@ -50,8 +50,12 @@ constexpr char kBrowserDisplayName[] = "
+
+ #if defined(DLOPEN_PULSEAUDIO)
+ static const base::FilePath::CharType kPulseLib[] =
++#if BUILDFLAG(IS_BSD)
++ FILE_PATH_LITERAL("libpulse.so");
++#else
+ FILE_PATH_LITERAL("libpulse.so.0");
+ #endif
++#endif
+
+ void DestroyMainloop(pa_threaded_mainloop* mainloop) {
+ pa_threaded_mainloop_stop(mainloop);
diff --git a/chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.cc b/chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.cc
new file mode 100644
index 0000000000..1f7aac960c
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.cc
@@ -0,0 +1,222 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/sndio/audio_manager_sndio.cc.orig 2025-01-20 18:01:27.917626161 +0000
++++ media/audio/sndio/audio_manager_sndio.cc
+@@ -0,0 +1,213 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/command_line.h"
++#include "base/metrics/histogram_macros.h"
++#include "base/memory/ptr_util.h"
++
++#include "media/audio/sndio/audio_manager_sndio.h"
++
++#include "media/audio/audio_device_description.h"
++#include "media/audio/audio_output_dispatcher.h"
++#if defined(USE_SNDIO)
++#include "media/audio/sndio/sndio_input.h"
++#include "media/audio/sndio/sndio_output.h"
++#endif
++#if defined(USE_PULSEAUDIO)
++#include "media/audio/pulse/audio_manager_pulse.h"
++#include "media/audio/pulse/pulse_util.h"
++#endif
++#if defined(USE_ALSA)
++#include "media/audio/alsa/audio_manager_alsa.h"
++#endif
++#include "media/audio/fake_audio_manager.h"
++#include "media/base/limits.h"
++#include "media/base/media_switches.h"
++
++namespace media {
++
++#if defined(USE_SNDIO)
++// Maximum number of output streams that can be open simultaneously.
++static const int kMaxOutputStreams = 50;
++
++// Default sample rate for input and output streams.
++static const int kDefaultSampleRate = 48000;
++
++void AddDefaultDevice(AudioDeviceNames* device_names) {
++ DCHECK(device_names->empty());
++ device_names->push_front(AudioDeviceName::CreateDefault());
++}
++
++bool AudioManagerSndio::HasAudioOutputDevices() {
++ return true;
++}
++
++bool AudioManagerSndio::HasAudioInputDevices() {
++ return true;
++}
++
++void AudioManagerSndio::GetAudioInputDeviceNames(
++ AudioDeviceNames* device_names) {
++ DCHECK(device_names->empty());
++ AddDefaultDevice(device_names);
++}
++
++void AudioManagerSndio::GetAudioOutputDeviceNames(
++ AudioDeviceNames* device_names) {
++ AddDefaultDevice(device_names);
++}
++
++#if defined(USE_SNDIO)
++const char* AudioManagerSndio::GetName() {
++ return "SNDIO";
++}
++#endif
++
++AudioParameters AudioManagerSndio::GetInputStreamParameters(
++ const std::string& device_id) {
++ static const int kDefaultInputBufferSize = 1024;
++
++ int user_buffer_size = GetUserBufferSize();
++ int buffer_size = user_buffer_size ?
++ user_buffer_size : kDefaultInputBufferSize;
++
++ return AudioParameters(
++ AudioParameters::AUDIO_PCM_LOW_LATENCY, ChannelLayoutConfig::Stereo(),
++ kDefaultSampleRate, buffer_size);
++}
++
++AudioManagerSndio::AudioManagerSndio(std::unique_ptr<AudioThread> audio_thread,
++ AudioLogFactory* audio_log_factory)
++ : AudioManagerBase(std::move(audio_thread),
++ audio_log_factory) {
++ DLOG(WARNING) << "AudioManagerSndio";
++ SetMaxOutputStreamsAllowed(kMaxOutputStreams);
++}
++
++AudioManagerSndio::~AudioManagerSndio() = default;
++
++AudioOutputStream* AudioManagerSndio::MakeLinearOutputStream(
++ const AudioParameters& params,
++ const LogCallback& log_callback) {
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
++ return MakeOutputStream(params);
++}
++
++AudioOutputStream* AudioManagerSndio::MakeLowLatencyOutputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) {
++ DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!";
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
++ return MakeOutputStream(params);
++}
++
++AudioInputStream* AudioManagerSndio::MakeLinearInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) {
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
++ return MakeInputStream(params);
++}
++
++AudioInputStream* AudioManagerSndio::MakeLowLatencyInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) {
++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
++ return MakeInputStream(params);
++}
++
++AudioParameters AudioManagerSndio::GetPreferredOutputStreamParameters(
++ const std::string& output_device_id,
++ const AudioParameters& input_params) {
++ // TODO(tommi): Support |output_device_id|.
++ DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!";
++ static const int kDefaultOutputBufferSize = 2048;
++
++ ChannelLayoutConfig channel_layout_config = ChannelLayoutConfig::Stereo();
++ int sample_rate = kDefaultSampleRate;
++ int buffer_size = kDefaultOutputBufferSize;
++ if (input_params.IsValid()) {
++ sample_rate = input_params.sample_rate();
++ channel_layout_config = input_params.channel_layout_config();
++ buffer_size = std::min(buffer_size, input_params.frames_per_buffer());
++ }
++
++ int user_buffer_size = GetUserBufferSize();
++ if (user_buffer_size)
++ buffer_size = user_buffer_size;
++
++ return AudioParameters(
++ AudioParameters::AUDIO_PCM_LOW_LATENCY,
++ channel_layout_config, sample_rate, buffer_size);
++}
++
++AudioInputStream* AudioManagerSndio::MakeInputStream(
++ const AudioParameters& params) {
++ DLOG(WARNING) << "MakeInputStream";
++ return new SndioAudioInputStream(this,
++ AudioDeviceDescription::kDefaultDeviceId, params);
++}
++
++AudioOutputStream* AudioManagerSndio::MakeOutputStream(
++ const AudioParameters& params) {
++ DLOG(WARNING) << "MakeOutputStream";
++ return new SndioAudioOutputStream(params, this);
++}
++#endif
++
++std::unique_ptr<media::AudioManager> CreateAudioManager(
++ std::unique_ptr<AudioThread> audio_thread,
++ AudioLogFactory* audio_log_factory) {
++ DLOG(WARNING) << "CreateAudioManager";
++
++ auto _ab = kAudioBackendParam.Get();
++
++ // For testing allow audio output to be disabled.
++ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
++ switches::kDisableAudioOutput) ||
++ !base::FeatureList::IsEnabled(media::kAudioBackend)) {
++ return std::make_unique<FakeAudioManager>(std::move(audio_thread),
++ audio_log_factory);
++ }
++
++#if defined(USE_PULSEAUDIO)
++ pa_threaded_mainloop* pa_mainloop = nullptr;
++ pa_context* pa_context = nullptr;
++ if (_ab != AudioBackend::kSndio && _ab != AudioBackend::kAlsa &&
++ pulse::InitPulse(&pa_mainloop, &pa_context)) {
++ return std::make_unique<AudioManagerPulse>(
++ std::move(audio_thread), audio_log_factory, pa_mainloop, pa_context);
++ } else if (_ab == AudioBackend::kAuto) {
++ LOG(WARNING) << "Falling back to SNDIO for audio output. PulseAudio is not "
++ "available or could not be initialized.";
++ }
++#endif
++
++#if defined(USE_SNDIO)
++ if (_ab != AudioBackend::kPulseAudio && _ab != AudioBackend::kAlsa) {
++ return std::make_unique<AudioManagerSndio>(std::move(audio_thread),
++ audio_log_factory);
++ } else if (_ab == AudioBackend::kAuto) {
++ LOG(WARNING) << "Falling back to ALSA audio output. SNDIO is not "
++ "available or could not be initialized.";
++ }
++#endif
++
++#if defined(USE_ALSA)
++ if (_ab != AudioBackend::kPulseAudio && _ab != AudioBackend::kSndio) {
++ return std::make_unique<AudioManagerAlsa>(std::move(audio_thread),
++ audio_log_factory);
++ } else if (_ab == AudioBackend::kAuto) {
++ LOG(WARNING) << "Falling back to fake audio output. ALSA is not "
++ "available or could not be initialized.";
++ }
++#endif
++
++ return std::make_unique<FakeAudioManager>(std::move(audio_thread),
++ audio_log_factory);
++}
++
++} // namespace media
diff --git a/chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.h b/chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.h
new file mode 100644
index 0000000000..290bbe580e
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_sndio_audio__manager__sndio.h
@@ -0,0 +1,75 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/sndio/audio_manager_sndio.h.orig 2025-01-20 18:01:27.917745342 +0000
++++ media/audio/sndio/audio_manager_sndio.h
+@@ -0,0 +1,66 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_
++#define MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_
++
++#include <set>
++
++#include "base/compiler_specific.h"
++#include "base/memory/ref_counted.h"
++#include "base/threading/thread.h"
++#include "media/audio/audio_manager_base.h"
++
++namespace media {
++
++class MEDIA_EXPORT AudioManagerSndio : public AudioManagerBase {
++ public:
++ AudioManagerSndio(std::unique_ptr<AudioThread> audio_thread,
++ AudioLogFactory* audio_log_factory);
++
++ AudioManagerSndio(const AudioManagerSndio&) = delete;
++ AudioManagerSndio& operator=(const AudioManagerSndio&) = delete;
++
++ ~AudioManagerSndio() override;
++
++ // Implementation of AudioManager.
++ bool HasAudioOutputDevices() override;
++ bool HasAudioInputDevices() override;
++ void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
++ void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override;
++ AudioParameters GetInputStreamParameters(
++ const std::string& device_id) override;
++ const char* GetName() override;
++
++ // Implementation of AudioManagerBase.
++ AudioOutputStream* MakeLinearOutputStream(
++ const AudioParameters& params,
++ const LogCallback& log_callback) override;
++ AudioOutputStream* MakeLowLatencyOutputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) override;
++ AudioInputStream* MakeLinearInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) override;
++ AudioInputStream* MakeLowLatencyInputStream(
++ const AudioParameters& params,
++ const std::string& device_id,
++ const LogCallback& log_callback) override;
++
++ protected:
++ AudioParameters GetPreferredOutputStreamParameters(
++ const std::string& output_device_id,
++ const AudioParameters& input_params) override;
++
++ private:
++ // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream.
++ AudioOutputStream* MakeOutputStream(const AudioParameters& params);
++ AudioInputStream* MakeInputStream(const AudioParameters& params);
++};
++
++} // namespace media
++
++#endif // MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_
diff --git a/chromium-next/patches/patch-media_audio_sndio_sndio__input.cc b/chromium-next/patches/patch-media_audio_sndio_sndio__input.cc
new file mode 100644
index 0000000000..40f84b71c8
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_sndio_sndio__input.cc
@@ -0,0 +1,209 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/sndio/sndio_input.cc.orig 2025-01-20 18:01:27.917845095 +0000
++++ media/audio/sndio/sndio_input.cc
+@@ -0,0 +1,200 @@
++// Copyright 2013 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/logging.h"
++#include "media/base/audio_timestamp_helper.h"
++#include "media/audio/sndio/audio_manager_sndio.h"
++#include "media/audio/audio_manager.h"
++#include "media/audio/sndio/sndio_input.h"
++
++namespace media {
++
++static const SampleFormat kSampleFormat = kSampleFormatS16;
++
++void SndioAudioInputStream::OnMoveCallback(void *arg, int delta)
++{
++ SndioAudioInputStream* self = static_cast<SndioAudioInputStream*>(arg);
++
++ self->hw_delay += delta;
++}
++
++void *SndioAudioInputStream::ThreadEntry(void *arg) {
++ SndioAudioInputStream* self = static_cast<SndioAudioInputStream*>(arg);
++
++ self->ThreadLoop();
++ return NULL;
++}
++
++SndioAudioInputStream::SndioAudioInputStream(AudioManagerBase* manager,
++ const std::string& device_name,
++ const AudioParameters& params)
++ : manager(manager),
++ params(params),
++ audio_bus(AudioBus::Create(params)),
++ state(kClosed) {
++}
++
++SndioAudioInputStream::~SndioAudioInputStream() {
++ if (state != kClosed)
++ Close();
++}
++
++AudioInputStream::OpenOutcome SndioAudioInputStream::Open() {
++ struct sio_par par;
++ int sig;
++
++ if (state != kClosed)
++ return OpenOutcome::kFailed;
++
++ if (params.format() != AudioParameters::AUDIO_PCM_LINEAR &&
++ params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) {
++ LOG(WARNING) << "Unsupported audio format.";
++ return OpenOutcome::kFailed;
++ }
++
++ sio_initpar(&par);
++ par.rate = params.sample_rate();
++ par.rchan = params.channels();
++ par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
++ par.bps = par.bits / 8;
++ par.sig = sig = par.bits != 8 ? 1 : 0;
++ par.le = SIO_LE_NATIVE;
++ par.appbufsz = params.frames_per_buffer();
++
++ hdl = sio_open(SIO_DEVANY, SIO_REC, 0);
++
++ if (hdl == NULL) {
++ LOG(ERROR) << "Couldn't open audio device.";
++ return OpenOutcome::kFailed;
++ }
++
++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
++ LOG(ERROR) << "Couldn't set audio parameters.";
++ goto bad_close;
++ }
++
++ if (par.rate != (unsigned int)params.sample_rate() ||
++ par.rchan != (unsigned int)params.channels() ||
++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
++ par.sig != (unsigned int)sig ||
++ (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
++ (par.bits != par.bps * 8)) {
++ LOG(ERROR) << "Unsupported audio parameters.";
++ goto bad_close;
++ }
++ state = kStopped;
++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
++ sio_onmove(hdl, &OnMoveCallback, this);
++ return OpenOutcome::kSuccess;
++bad_close:
++ sio_close(hdl);
++ return OpenOutcome::kFailed;
++}
++
++void SndioAudioInputStream::Start(AudioInputCallback* cb) {
++
++ StartAgc();
++
++ state = kRunning;
++ hw_delay = 0;
++ callback = cb;
++ sio_start(hdl);
++ if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) {
++ LOG(ERROR) << "Failed to create real-time thread for recording.";
++ sio_stop(hdl);
++ state = kStopped;
++ }
++}
++
++void SndioAudioInputStream::Stop() {
++
++ if (state == kStopped)
++ return;
++
++ state = kStopWait;
++ pthread_join(thread, NULL);
++ sio_stop(hdl);
++ state = kStopped;
++
++ StopAgc();
++}
++
++void SndioAudioInputStream::Close() {
++
++ if (state == kClosed)
++ goto release;
++
++ if (state == kRunning)
++ Stop();
++
++ state = kClosed;
++ delete [] buffer;
++ sio_close(hdl);
++
++release:
++ manager->ReleaseInputStream(this);
++}
++
++double SndioAudioInputStream::GetMaxVolume() {
++ // Not supported
++ return 0.0;
++}
++
++void SndioAudioInputStream::SetVolume(double volume) {
++ // Not supported. Do nothing.
++}
++
++double SndioAudioInputStream::GetVolume() {
++ // Not supported.
++ return 0.0;
++}
++
++bool SndioAudioInputStream::IsMuted() {
++ // Not supported.
++ return false;
++}
++
++void SndioAudioInputStream::SetOutputDeviceForAec(
++ const std::string& output_device_id) {
++ // Not supported.
++}
++
++void SndioAudioInputStream::ThreadLoop(void) {
++ size_t todo, n;
++ char *data;
++ unsigned int nframes;
++ double normalized_volume = 0.0;
++
++ nframes = audio_bus->frames();
++
++ while (state == kRunning && !sio_eof(hdl)) {
++
++ GetAgcVolume(&normalized_volume);
++
++ // read one block
++ todo = nframes * params.GetBytesPerFrame(kSampleFormat);
++ data = buffer;
++ while (todo > 0) {
++ n = sio_read(hdl, data, todo);
++ if (n == 0)
++ return; // unrecoverable I/O error
++ todo -= n;
++ data += n;
++ }
++ hw_delay -= nframes;
++
++ // convert frames count to TimeDelta
++ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
++ params.sample_rate());
++
++ // push into bus
++ audio_bus->FromInterleaved<SignedInt16SampleTypeTraits>(reinterpret_cast<int16_t*>(buffer), nframes);
++
++
++ // invoke callback
++ callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1., {});
++ }
++}
++
++} // namespace media
diff --git a/chromium-next/patches/patch-media_audio_sndio_sndio__input.h b/chromium-next/patches/patch-media_audio_sndio_sndio__input.h
new file mode 100644
index 0000000000..a07bab64b1
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_sndio_sndio__input.h
@@ -0,0 +1,100 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/sndio/sndio_input.h.orig 2025-01-20 18:01:27.917961601 +0000
++++ media/audio/sndio/sndio_input.h
+@@ -0,0 +1,91 @@
++// Copyright 2013 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_
++#define MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_
++
++#include <stdint.h>
++#include <string>
++#include <sndio.h>
++
++#include "base/compiler_specific.h"
++#include "base/memory/weak_ptr.h"
++#include "base/time/time.h"
++#include "media/audio/agc_audio_stream.h"
++#include "media/audio/audio_io.h"
++#include "media/audio/audio_device_description.h"
++#include "media/base/audio_parameters.h"
++
++namespace media {
++
++class AudioManagerBase;
++
++// Implementation of AudioOutputStream using sndio(7)
++class SndioAudioInputStream : public AgcAudioStream<AudioInputStream> {
++ public:
++ // Pass this to the constructor if you want to attempt auto-selection
++ // of the audio recording device.
++ static const char kAutoSelectDevice[];
++
++ // Create a PCM Output stream for the SNDIO device identified by
++ // |device_name|. If unsure of what to use for |device_name|, use
++ // |kAutoSelectDevice|.
++ SndioAudioInputStream(AudioManagerBase* audio_manager,
++ const std::string& device_name,
++ const AudioParameters& params);
++
++ SndioAudioInputStream(const SndioAudioInputStream&) = delete;
++ SndioAudioInputStream& operator=(const SndioAudioInputStream&) = delete;
++
++ ~SndioAudioInputStream() override;
++
++ // Implementation of AudioInputStream.
++ OpenOutcome Open() override;
++ void Start(AudioInputCallback* callback) override;
++ void Stop() override;
++ void Close() override;
++ double GetMaxVolume() override;
++ void SetVolume(double volume) override;
++ double GetVolume() override;
++ bool IsMuted() override;
++ void SetOutputDeviceForAec(const std::string& output_device_id) override;
++
++ private:
++
++ enum StreamState {
++ kClosed, // Not opened yet
++ kStopped, // Device opened, but not started yet
++ kRunning, // Started, device playing
++ kStopWait // Stopping, waiting for the real-time thread to exit
++ };
++
++ // C-style call-backs
++ static void OnMoveCallback(void *arg, int delta);
++ static void* ThreadEntry(void *arg);
++
++ // Continuously moves data from the device to the consumer
++ void ThreadLoop();
++ // Our creator, the audio manager needs to be notified when we close.
++ AudioManagerBase* manager;
++ // Parameters of the source
++ AudioParameters params;
++ // We store data here for consumer
++ std::unique_ptr<AudioBus> audio_bus;
++ // Call-back that consumes recorded data
++ AudioInputCallback* callback; // Valid during a recording session.
++ // Handle of the audio device
++ struct sio_hdl* hdl;
++ // Current state of the stream
++ enum StreamState state;
++ // High priority thread running ThreadLoop()
++ pthread_t thread;
++ // Number of frames buffered in the hardware
++ int hw_delay;
++ // Temporary buffer where data is stored sndio-compatible format
++ char* buffer;
++};
++
++} // namespace media
++
++#endif // MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_
diff --git a/chromium-next/patches/patch-media_audio_sndio_sndio__output.cc b/chromium-next/patches/patch-media_audio_sndio_sndio__output.cc
new file mode 100644
index 0000000000..e12cde900c
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_sndio_sndio__output.cc
@@ -0,0 +1,196 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/sndio/sndio_output.cc.orig 2025-01-20 18:01:27.918065903 +0000
++++ media/audio/sndio/sndio_output.cc
+@@ -0,0 +1,187 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "base/logging.h"
++#include "base/time/time.h"
++#include "base/time/default_tick_clock.h"
++#include "media/audio/audio_manager_base.h"
++#include "media/base/audio_timestamp_helper.h"
++#include "media/audio/sndio/sndio_output.h"
++
++namespace media {
++
++static const SampleFormat kSampleFormat = kSampleFormatS16;
++
++void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) {
++ SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
++
++ self->hw_delay -= delta;
++}
++
++void SndioAudioOutputStream::OnVolCallback(void *arg, unsigned int vol) {
++ SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
++
++ self->vol = vol;
++}
++
++void *SndioAudioOutputStream::ThreadEntry(void *arg) {
++ SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
++
++ self->ThreadLoop();
++ return NULL;
++}
++
++SndioAudioOutputStream::SndioAudioOutputStream(const AudioParameters& params,
++ AudioManagerBase* manager)
++ : manager(manager),
++ params(params),
++ audio_bus(AudioBus::Create(params)),
++ state(kClosed),
++ mutex(PTHREAD_MUTEX_INITIALIZER) {
++}
++
++SndioAudioOutputStream::~SndioAudioOutputStream() {
++ if (state != kClosed)
++ Close();
++}
++
++bool SndioAudioOutputStream::Open() {
++ if (params.format() != AudioParameters::AUDIO_PCM_LINEAR &&
++ params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) {
++ LOG(WARNING) << "Unsupported audio format.";
++ return false;
++ }
++ state = kStopped;
++ volpending = 0;
++ vol = SIO_MAXVOL;
++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
++ return true;
++}
++
++void SndioAudioOutputStream::Close() {
++ if (state == kClosed)
++ goto release;
++ if (state == kRunning)
++ Stop();
++ state = kClosed;
++ delete [] buffer;
++release:
++ manager->ReleaseOutputStream(this); // Calls the destructor
++}
++
++void SndioAudioOutputStream::Start(AudioSourceCallback* callback) {
++ struct sio_par par;
++ int sig;
++
++ sio_initpar(&par);
++ par.rate = params.sample_rate();
++ par.pchan = params.channels();
++ par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
++ par.bps = par.bits / 8;
++ par.sig = sig = par.bits != 8 ? 1 : 0;
++ par.le = SIO_LE_NATIVE;
++ par.appbufsz = params.frames_per_buffer();
++
++ hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0);
++ if (hdl == NULL) {
++ LOG(ERROR) << "Couldn't open audio device.";
++ return;
++ }
++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
++ LOG(ERROR) << "Couldn't set audio parameters.";
++ sio_close(hdl);
++ return;
++ }
++ if (par.rate != (unsigned int)params.sample_rate() ||
++ par.pchan != (unsigned int)params.channels() ||
++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
++ par.sig != (unsigned int)sig ||
++ (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
++ (par.bits != par.bps * 8)) {
++ LOG(ERROR) << "Unsupported audio parameters.";
++ sio_close(hdl);
++ return;
++ }
++
++ sio_onmove(hdl, &OnMoveCallback, this);
++ sio_onvol(hdl, &OnVolCallback, this);
++
++ state = kRunning;
++ hw_delay = 0;
++ source = callback;
++ sio_start(hdl);
++
++ if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) {
++ LOG(ERROR) << "Failed to create real-time thread.";
++ sio_stop(hdl);
++ sio_close(hdl);
++ state = kStopped;
++ }
++}
++
++void SndioAudioOutputStream::Stop() {
++ if (state == kStopped)
++ return;
++ state = kStopWait;
++ pthread_join(thread, NULL);
++ sio_stop(hdl);
++ sio_close(hdl);
++ state = kStopped;
++}
++
++void SndioAudioOutputStream::SetVolume(double v) {
++ pthread_mutex_lock(&mutex);
++ vol = v * SIO_MAXVOL;
++ volpending = 1;
++ pthread_mutex_unlock(&mutex);
++}
++
++void SndioAudioOutputStream::GetVolume(double* v) {
++ pthread_mutex_lock(&mutex);
++ *v = vol * (1. / SIO_MAXVOL);
++ pthread_mutex_unlock(&mutex);
++}
++
++// This stream is always used with sub second buffer sizes, where it's
++// sufficient to simply always flush upon Start().
++void SndioAudioOutputStream::Flush() {}
++
++void SndioAudioOutputStream::ThreadLoop(void) {
++ int avail, count, result;
++
++ while (state == kRunning) {
++ // Update volume if needed
++ pthread_mutex_lock(&mutex);
++ if (volpending) {
++ volpending = 0;
++ sio_setvol(hdl, vol);
++ }
++ pthread_mutex_unlock(&mutex);
++
++ // Get data to play
++ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
++ params.sample_rate());
++ count = source->OnMoreData(delay, base::TimeTicks::Now(), {}, audio_bus.get());
++ audio_bus->ToInterleaved<SignedInt16SampleTypeTraits>(count, reinterpret_cast<int16_t*>(buffer));
++ if (count == 0) {
++ // We have to submit something to the device
++ count = audio_bus->frames();
++ memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat));
++ LOG(WARNING) << "No data to play, running empty cycle.";
++ }
++
++ // Submit data to the device
++ avail = count * params.GetBytesPerFrame(kSampleFormat);
++ result = sio_write(hdl, buffer, avail);
++ if (result == 0) {
++ LOG(WARNING) << "Audio device disconnected.";
++ break;
++ }
++
++ // Update hardware pointer
++ hw_delay += count;
++ }
++}
++
++} // namespace media
diff --git a/chromium-next/patches/patch-media_audio_sndio_sndio__output.h b/chromium-next/patches/patch-media_audio_sndio_sndio__output.h
new file mode 100644
index 0000000000..92b11b4c61
--- /dev/null
+++ b/chromium-next/patches/patch-media_audio_sndio_sndio__output.h
@@ -0,0 +1,97 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/audio/sndio/sndio_output.h.orig 2025-01-20 18:01:27.918181397 +0000
++++ media/audio/sndio/sndio_output.h
+@@ -0,0 +1,88 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_
++#define MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_
++
++#include <pthread.h>
++#include <sndio.h>
++
++#include "base/time/tick_clock.h"
++#include "base/time/time.h"
++#include "media/audio/audio_io.h"
++
++namespace media {
++
++class AudioManagerBase;
++
++// Implementation of AudioOutputStream using sndio(7)
++class SndioAudioOutputStream : public AudioOutputStream {
++ public:
++ // The manager is creating this object
++ SndioAudioOutputStream(const AudioParameters& params,
++ AudioManagerBase* manager);
++
++ SndioAudioOutputStream(const SndioAudioOutputStream&) = delete;
++ SndioAudioOutputStream& operator=(const SndioAudioOutputStream&) = delete;
++
++ virtual ~SndioAudioOutputStream();
++
++ // Implementation of AudioOutputStream.
++ bool Open() override;
++ void Close() override;
++ void Start(AudioSourceCallback* callback) override;
++ void Stop() override;
++ void SetVolume(double volume) override;
++ void GetVolume(double* volume) override;
++ void Flush() override;
++
++ friend void sndio_onmove(void *arg, int delta);
++ friend void sndio_onvol(void *arg, unsigned int vol);
++ friend void *sndio_threadstart(void *arg);
++
++ private:
++ enum StreamState {
++ kClosed, // Not opened yet
++ kStopped, // Device opened, but not started yet
++ kRunning, // Started, device playing
++ kStopWait // Stopping, waiting for the real-time thread to exit
++ };
++
++ // C-style call-backs
++ static void OnMoveCallback(void *arg, int delta);
++ static void OnVolCallback(void *arg, unsigned int vol);
++ static void* ThreadEntry(void *arg);
++
++ // Continuously moves data from the producer to the device
++ void ThreadLoop(void);
++
++ // Our creator, the audio manager needs to be notified when we close.
++ AudioManagerBase* manager;
++ // Parameters of the source
++ AudioParameters params;
++ // Source stores data here
++ std::unique_ptr<AudioBus> audio_bus;
++ // Call-back that produces data to play
++ AudioSourceCallback* source;
++ // Handle of the audio device
++ struct sio_hdl* hdl;
++ // Current state of the stream
++ enum StreamState state;
++ // High priority thread running ThreadLoop()
++ pthread_t thread;
++ // Protects vol, volpending and hw_delay
++ pthread_mutex_t mutex;
++ // Current volume in the 0..SIO_MAXVOL range
++ int vol;
++ // Set to 1 if volumes must be refreshed in the realtime thread
++ int volpending;
++ // Number of frames buffered in the hardware
++ int hw_delay;
++ // Temporary buffer where data is stored sndio-compatible format
++ char* buffer;
++};
++
++} // namespace media
++
++#endif // MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_
diff --git a/chromium-next/patches/patch-media_base_audio__latency.cc b/chromium-next/patches/patch-media_base_audio__latency.cc
new file mode 100644
index 0000000000..d06ba4a8b2
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_audio__latency.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/audio_latency.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/audio_latency.cc
+@@ -148,7 +148,7 @@ int AudioLatency::GetRtcBufferSize(int s
+ }
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // On Linux, MacOS and Fuchsia, the low level IO implementations on the
+ // browser side supports all buffer size the clients want. We use the native
+ // peer connection buffer size (10ms) to achieve best possible performance.
diff --git a/chromium-next/patches/patch-media_base_libaom__thread__wrapper.cc b/chromium-next/patches/patch-media_base_libaom__thread__wrapper.cc
new file mode 100644
index 0000000000..b0f0695035
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_libaom__thread__wrapper.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/libaom_thread_wrapper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/libaom_thread_wrapper.cc
+@@ -5,17 +5,21 @@
+ #include "base/logging.h"
+ #include "media/base/codec_worker_impl.h"
+ #include "media/base/libvpx_thread_wrapper.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "third_party/libaom/source/libaom/aom_util/aom_thread.h"
++#endif
+
+ namespace media {
+
+ void InitLibAomThreadWrapper() {
++#if !BUILDFLAG(IS_BSD)
+ const AVxWorkerInterface interface =
+ CodecWorkerImpl<AVxWorkerInterface, AVxWorkerImpl, AVxWorker,
+ AVxWorkerStatus, AVX_WORKER_STATUS_NOT_OK,
+ AVX_WORKER_STATUS_OK,
+ AVX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface();
+ CHECK(aom_set_worker_interface(&interface));
++#endif
+ }
+
+ } // namespace media
diff --git a/chromium-next/patches/patch-media_base_libvpx__thread__wrapper.cc b/chromium-next/patches/patch-media_base_libvpx__thread__wrapper.cc
new file mode 100644
index 0000000000..4edf819479
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_libvpx__thread__wrapper.cc
@@ -0,0 +1,31 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/libvpx_thread_wrapper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/libvpx_thread_wrapper.cc
+@@ -5,11 +5,14 @@
+ #include "media/base/libvpx_thread_wrapper.h"
+
+ #include "media/base/codec_worker_impl.h"
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_NETBSD)
+ #include "third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h"
++#endif
+
+ namespace media {
+
+ void InitLibVpxThreadWrapper() {
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_NETBSD)
+ const VPxWorkerInterface interface =
+ CodecWorkerImpl<VPxWorkerInterface, VPxWorkerImpl, VPxWorker,
+ VPxWorkerStatus, VPX_WORKER_STATUS_NOT_OK,
+@@ -17,6 +20,7 @@ void InitLibVpxThreadWrapper() {
+ VPX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface();
+
+ CHECK(vpx_set_worker_interface(&interface));
++#endif
+ }
+
+ } // namespace media
diff --git a/chromium-next/patches/patch-media_base_media__switches.cc b/chromium-next/patches/patch-media_base_media__switches.cc
new file mode 100644
index 0000000000..587db2ba21
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_media__switches.cc
@@ -0,0 +1,132 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/media_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/media_switches.cc
+@@ -20,7 +20,7 @@
+ #include "ui/gl/gl_features.h"
+ #include "ui/gl/gl_utils.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/cpu.h"
+ #endif
+
+@@ -60,7 +60,7 @@ const char kReportVp9AsAnUnsupportedMime
+ "report-vp9-as-an-unsupported-mime-type";
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD) || \
+- BUILDFLAG(IS_SOLARIS)
++ BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_NETBSD)
+ // The Alsa device to use when opening an audio input stream.
+ const char kAlsaInputDevice[] = "alsa-input-device";
+ // The Alsa device to use when opening an audio stream.
+@@ -371,8 +371,8 @@ BASE_FEATURE(kUseSCContentSharingPicker,
+ "UseSCContentSharingPicker",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(IS_MAC)
+-
+-#if BUILDFLAG(IS_LINUX)
++
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enables system audio mirroring using pulseaudio.
+ BASE_FEATURE(kPulseaudioLoopbackForCast,
+ "PulseaudioLoopbackForCast",
+@@ -382,6 +382,31 @@ BASE_FEATURE(kPulseaudioLoopbackForCast,
+ BASE_FEATURE(kPulseaudioLoopbackForScreenShare,
+ "PulseaudioLoopbackForScreenShare",
+ base::FEATURE_DISABLED_BY_DEFAULT);
++
++BASE_FEATURE(kAudioBackend,
++ "AudioBackend",
++ base::FEATURE_ENABLED_BY_DEFAULT);
++
++constexpr base::FeatureParam<AudioBackend>::Option
++ kAudioBackendOptions[] = {
++ {AudioBackend::kAuto,
++ "auto"},
++ {AudioBackend::kAudioIO, "audioio"},
++ {AudioBackend::kPulseAudio, "pulseaudio"},
++ {AudioBackend::kSndio, "sndio"},
++ {AudioBackend::kAlsa, "alsa"}};
++
++const base::FeatureParam<AudioBackend>
++ kAudioBackendParam{
++ &kAudioBackend, "audio-backend",
++#if BUILDFLAG(IS_OPENBSD)
++ AudioBackend::kSndio,
++#elif BUILDFLAG(IS_NETBSD)
++ AudioBackend::kAudioIO,
++#elif BUILDFLAG(IS_FREEBSD)
++ AudioBackend::kAuto,
++#endif
++ &kAudioBackendOptions};
+ #endif // BUILDFLAG(IS_LINUX)
+
+ // When enabled, MediaCapabilities will check with GPU Video Accelerator
+@@ -627,7 +652,7 @@ BASE_FEATURE(kFileDialogsBlockPictureInP
+ // Show toolbar button that opens dialog for controlling media sessions.
+ BASE_FEATURE(kGlobalMediaControls,
+ "GlobalMediaControls",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -650,7 +675,7 @@ BASE_FEATURE(kGlobalMediaControlsUpdated
+ // If enabled, users can request Media Remoting without fullscreen-in-tab.
+ BASE_FEATURE(kMediaRemotingWithoutFullscreen,
+ "MediaRemotingWithoutFullscreen",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -662,7 +687,7 @@ BASE_FEATURE(kMediaRemotingWithoutFullsc
+ BASE_FEATURE(kGlobalMediaControlsPictureInPicture,
+ "GlobalMediaControlsPictureInPicture",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -691,7 +716,7 @@ BASE_FEATURE(kUnifiedAutoplay,
+ "UnifiedAutoplay",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enable vaapi/v4l2 video decoding on linux. This is already enabled by default
+ // on chromeos, but needs an experiment on linux.
+ BASE_FEATURE(kAcceleratedVideoDecodeLinux,
+@@ -795,7 +820,7 @@ BASE_FEATURE(kVSyncMjpegDecoding,
+ "VSyncMjpegDecoding",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Enable H264 temporal layer encoding with V4L2 HW encoder on ChromeOS.
+ BASE_FEATURE(kV4L2H264TemporalLayerHWEncoding,
+ "V4L2H264TemporalLayerHWEncoding",
+@@ -1395,7 +1420,7 @@ BASE_FEATURE(kUseGTFOOutOfProcessVideoDe
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(ALLOW_OOP_VIDEO_DECODER)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Spawn utility processes to perform hardware encode acceleration instead of
+ // using the GPU process.
+ BASE_FEATURE(kUseOutOfProcessVideoEncoding,
+@@ -1475,7 +1500,7 @@ BASE_FEATURE(kRecordWebAudioEngagement,
+ "RecordWebAudioEngagement",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Reduces the number of buffers needed in the output video frame pool to
+ // populate the Renderer pipeline for hardware accelerated VideoDecoder in
+ // non-low latency scenarios.
diff --git a/chromium-next/patches/patch-media_base_media__switches.h b/chromium-next/patches/patch-media_base_media__switches.h
new file mode 100644
index 0000000000..73a94ec18f
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_media__switches.h
@@ -0,0 +1,73 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/media_switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/media_switches.h
+@@ -44,7 +44,7 @@ MEDIA_EXPORT extern const char kDisableB
+ MEDIA_EXPORT extern const char kReportVp9AsAnUnsupportedMimeType[];
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD) || \
+- BUILDFLAG(IS_SOLARIS)
++ BUILDFLAG(IS_SOLARIS) || BUILDFLAG(IS_NETBSD)
+ MEDIA_EXPORT extern const char kAlsaInputDevice[];
+ MEDIA_EXPORT extern const char kAlsaOutputDevice[];
+ #endif
+@@ -325,13 +325,26 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kMedia
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kPlaybackSpeedButton);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kPreloadMediaEngagementData);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kPreloadMetadataSuspend);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kPulseaudioLoopbackForCast);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kPulseaudioLoopbackForScreenShare);
++
++enum class AudioBackend {
++ kAuto,
++ kPulseAudio,
++ kSndio,
++ kAudioIO,
++ kAlsa
++};
++
++MEDIA_EXPORT BASE_DECLARE_FEATURE(kAudioBackend);
++MEDIA_EXPORT extern const base::FeatureParam<
++ AudioBackend>
++ kAudioBackendParam;
+ #endif // BUILDFLAG(IS_LINUX)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kRecordMediaEngagementScores);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kRecordWebAudioEngagement);
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kReduceHardwareVideoDecoderBuffers);
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kResumeBackgroundVideo);
+@@ -345,7 +358,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kSuspe
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUnifiedAutoplay);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseAndroidOverlayForSecureOnly);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseFakeDeviceForMediaStream);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kAcceleratedVideoDecodeLinux);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kAcceleratedVideoDecodeLinuxGL);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kAcceleratedVideoEncodeLinux);
+@@ -366,7 +379,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapi
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVp9SModeHWEncoding);
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVSyncMjpegDecoding);
+ #endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kV4L2H264TemporalLayerHWEncoding);
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVideoBlitColorAccuracy);
+@@ -498,7 +511,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseOu
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseGTFOOutOfProcessVideoDecoding);
+ #endif // BUILDFLAG(ALLOW_OOP_VIDEO_DECODER)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseOutOfProcessVideoEncoding);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
diff --git a/chromium-next/patches/patch-media_base_user__input__monitor__unittest.cc b/chromium-next/patches/patch-media_base_user__input__monitor__unittest.cc
new file mode 100644
index 0000000000..6f56ed7481
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_user__input__monitor__unittest.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/user_input_monitor_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/user_input_monitor_unittest.cc
+@@ -13,7 +13,7 @@
+ #include "build/build_config.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/file_descriptor_watcher_posix.h"
+ #endif
+
+@@ -49,7 +49,7 @@ class UserInputMonitorTest : public test
+ } // namespace
+
+ TEST_F(UserInputMonitorTest, CreatePlatformSpecific) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::test::TaskEnvironment task_environment(
+ base::test::TaskEnvironment::MainThreadType::IO);
+ #else
+@@ -72,7 +72,7 @@ TEST_F(UserInputMonitorTest, CreatePlatf
+ }
+
+ TEST_F(UserInputMonitorTest, CreatePlatformSpecificWithMapping) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::test::TaskEnvironment task_environment(
+ base::test::TaskEnvironment::MainThreadType::IO);
+ #else
diff --git a/chromium-next/patches/patch-media_base_video__frame.cc b/chromium-next/patches/patch-media_base_video__frame.cc
new file mode 100644
index 0000000000..e8a891fe8e
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_video__frame.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/video_frame.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/video_frame.cc
+@@ -88,7 +88,7 @@ std::string VideoFrame::StorageTypeToStr
+ return "OWNED_MEMORY";
+ case VideoFrame::STORAGE_SHMEM:
+ return "SHMEM";
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case VideoFrame::STORAGE_DMABUFS:
+ return "DMABUFS";
+ #endif
+@@ -102,7 +102,7 @@ std::string VideoFrame::StorageTypeToStr
+ // static
+ bool VideoFrame::IsStorageTypeMappable(VideoFrame::StorageType storage_type) {
+ return
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // This is not strictly needed but makes explicit that, at VideoFrame
+ // level, DmaBufs are not mappable from userspace.
+ storage_type != VideoFrame::STORAGE_DMABUFS &&
+@@ -414,7 +414,7 @@ VideoFrame::CreateFrameForGpuMemoryBuffe
+ : shared_image->GetStrideForVideoFrame(i);
+ }
+ uint64_t modifier = gfx::NativePixmapHandle::kNoModifier;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool is_native_buffer =
+ gpu_memory_buffer
+ ? (gpu_memory_buffer->GetType() != gfx::SHARED_MEMORY_BUFFER)
+@@ -755,7 +755,7 @@ scoped_refptr<VideoFrame> VideoFrame::Wr
+ return frame;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ scoped_refptr<VideoFrame> VideoFrame::WrapExternalDmabufs(
+ const VideoFrameLayout& layout,
+@@ -1461,7 +1461,7 @@ scoped_refptr<gpu::ClientSharedImage> Vi
+ return wrapped_frame_ ? wrapped_frame_->shared_image() : shared_image_;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ size_t VideoFrame::NumDmabufFds() const {
+ if (wrapped_frame_) {
+ return wrapped_frame_->NumDmabufFds();
diff --git a/chromium-next/patches/patch-media_base_video__frame.h b/chromium-next/patches/patch-media_base_video__frame.h
new file mode 100644
index 0000000000..9f9ff199f4
--- /dev/null
+++ b/chromium-next/patches/patch-media_base_video__frame.h
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/base/video_frame.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/base/video_frame.h
+@@ -50,7 +50,7 @@
+ #include "base/apple/scoped_cftyperef.h"
+ #endif // BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/scoped_file.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -94,7 +94,7 @@ class MEDIA_EXPORT VideoFrame : public b
+ STORAGE_UNOWNED_MEMORY = 2, // External, non owned data pointers.
+ STORAGE_OWNED_MEMORY = 3, // VideoFrame has allocated its own data buffer.
+ STORAGE_SHMEM = 4, // Backed by read-only shared memory.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(mcasas): Consider turning this type into STORAGE_NATIVE
+ // based on the idea of using this same enum value for both DMA
+ // buffers on Linux and CVPixelBuffers on Mac (which currently use
+@@ -369,7 +369,7 @@ class MEDIA_EXPORT VideoFrame : public b
+ ReleaseMailboxAndGpuMemoryBufferCB mailbox_holder_and_gmb_release_cb,
+ base::TimeDelta timestamp);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Wraps provided dmabufs
+ // (https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html) with a
+ // VideoFrame. The frame will take ownership of |dmabuf_fds|, and will
+@@ -682,7 +682,7 @@ class MEDIA_EXPORT VideoFrame : public b
+ // wait for the included sync point.
+ scoped_refptr<gpu::ClientSharedImage> shared_image() const;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The number of DmaBufs will be equal or less than the number of planes of
+ // the frame. If there are less, this means that the last FD contains the
+ // remaining planes. Should be > 0 for STORAGE_DMABUFS.
+@@ -946,7 +946,7 @@ class MEDIA_EXPORT VideoFrame : public b
+ // GpuMemoryBuffers. Clients will set this flag while creating a VideoFrame.
+ bool is_mappable_si_enabled_ = false;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Dmabufs for the frame, used when storage is STORAGE_DMABUFS. Size is either
+ // equal or less than the number of planes of the frame. If it is less, then
diff --git a/chromium-next/patches/patch-media_capture_video_create__video__capture__device__factory.cc b/chromium-next/patches/patch-media_capture_video_create__video__capture__device__factory.cc
new file mode 100644
index 0000000000..9897fe0b41
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_create__video__capture__device__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/create_video_capture_device_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/create_video_capture_device_factory.cc
+@@ -13,7 +13,7 @@
+ #include "media/capture/video/fake_video_capture_device_factory.h"
+ #include "media/capture/video/file_video_capture_device_factory.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "media/capture/video/linux/video_capture_device_factory_linux.h"
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ #include "media/capture/video/chromeos/public/cros_features.h"
+@@ -56,7 +56,7 @@ CreateFakeVideoCaptureDeviceFactory() {
+ std::unique_ptr<VideoCaptureDeviceFactory>
+ CreatePlatformSpecificVideoCaptureDeviceFactory(
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<VideoCaptureDeviceFactoryLinux>(ui_task_runner);
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ if (base::SysInfo::IsRunningOnChromeOS())
diff --git a/chromium-next/patches/patch-media_capture_video_fake__video__capture__device__factory.cc b/chromium-next/patches/patch-media_capture_video_fake__video__capture__device__factory.cc
new file mode 100644
index 0000000000..ec62db4b71
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_fake__video__capture__device__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/fake_video_capture_device_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/fake_video_capture_device_factory.cc
+@@ -231,7 +231,7 @@ void FakeVideoCaptureDeviceFactory::GetD
+ int entry_index = 0;
+ for (const auto& entry : devices_config_) {
+ VideoCaptureApi api =
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE;
+ #elif BUILDFLAG(IS_IOS)
+ VideoCaptureApi::UNKNOWN;
diff --git a/chromium-next/patches/patch-media_capture_video_file__video__capture__device__factory.cc b/chromium-next/patches/patch-media_capture_video_file__video__capture__device__factory.cc
new file mode 100644
index 0000000000..5e07b9b047
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_file__video__capture__device__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/file_video_capture_device_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/file_video_capture_device_factory.cc
+@@ -52,7 +52,7 @@ void FileVideoCaptureDeviceFactory::GetD
+ VideoCaptureApi::WIN_DIRECT_SHOW;
+ #elif BUILDFLAG(IS_MAC)
+ VideoCaptureApi::MACOSX_AVFOUNDATION;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE;
+ #else
+ VideoCaptureApi::UNKNOWN;
diff --git a/chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.cc b/chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.cc
new file mode 100644
index 0000000000..9a61d1152c
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/fake_v4l2_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/fake_v4l2_impl.cc
+@@ -562,7 +562,7 @@ int FakeV4L2Impl::close(int fd) {
+ return kSuccessReturnValue;
+ }
+
+-int FakeV4L2Impl::ioctl(int fd, int request, void* argp) {
++int FakeV4L2Impl::ioctl(int fd, unsigned long request, void* argp) {
+ base::AutoLock lock(lock_);
+ auto device_iter = opened_devices_.find(fd);
+ if (device_iter == opened_devices_.end())
diff --git a/chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.h b/chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.h
new file mode 100644
index 0000000000..0fa3b97e29
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_fake__v4l2__impl.h
@@ -0,0 +1,31 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/fake_v4l2_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/fake_v4l2_impl.h
+@@ -8,7 +8,13 @@
+ #include <map>
+ #include <string>
+
++#include "build/build_config.h"
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
++#include <sys/videoio.h>
++typedef __uint32_t __u32;
++#else
+ #include <linux/videodev2.h>
++#endif
+
+ #include "base/synchronization/lock.h"
+ #include "media/capture/capture_export.h"
+@@ -38,7 +44,7 @@ class CAPTURE_EXPORT FakeV4L2Impl : publ
+ // Implementation of V4L2CaptureDevice interface:
+ int open(const char* device_name, int flags) override;
+ int close(int fd) override;
+- int ioctl(int fd, int request, void* argp) override;
++ int ioctl(int fd, unsigned long request, void* argp) override;
+ void* mmap(void* start,
+ size_t length,
+ int prot,
diff --git a/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.cc b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.cc
new file mode 100644
index 0000000000..92277778f1
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.cc
@@ -0,0 +1,183 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/v4l2_capture_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/v4l2_capture_delegate.cc
+@@ -5,8 +5,10 @@
+ #include "media/capture/video/linux/v4l2_capture_delegate.h"
+
+ #include <fcntl.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <linux/version.h>
+ #include <linux/videodev2.h>
++#endif
+ #include <poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+@@ -29,17 +31,19 @@
+ #include "media/capture/video/blob_utils.h"
+ #include "media/capture/video/linux/video_capture_device_linux.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "media/capture/capture_switches.h"
+ #include "media/capture/video/linux/v4l2_capture_delegate_gpu_helper.h"
+ #endif // BUILDFLAG(IS_LINUX)
+
+ using media::mojom::MeteringMode;
+
++#if !BUILDFLAG(IS_BSD)
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+ // 16 bit depth, Realsense F200.
+ #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ')
+ #endif
++#endif
+
+ // TODO(aleksandar.stojiljkovic): Wrap this with kernel version check once the
+ // format is introduced to kernel.
+@@ -49,6 +53,14 @@ using media::mojom::MeteringMode;
+ #define V4L2_PIX_FMT_INVZ v4l2_fourcc('I', 'N', 'V', 'Z')
+ #endif
+
++#ifndef V4L2_COLORSPACE_OPRGB
++#define V4L2_COLORSPACE_OPRGB V4L2_COLORSPACE_ADOBERGB
++#endif
++
++#ifndef V4L2_XFER_FUNC_OPRGB
++#define V4L2_XFER_FUNC_OPRGB V4L2_XFER_FUNC_ADOBERGB
++#endif
++
+ namespace media {
+
+ namespace {
+@@ -268,7 +280,7 @@ bool V4L2CaptureDelegate::IsBlockedContr
+ // static
+ bool V4L2CaptureDelegate::IsControllableControl(
+ int control_id,
+- const base::RepeatingCallback<int(int, void*)>& do_ioctl) {
++ const base::RepeatingCallback<int(unsigned int, void*)>& do_ioctl) {
+ const int special_control_id = GetControllingSpecialControl(control_id);
+ if (!special_control_id) {
+ // The control is not controlled by a special control thus the control is
+@@ -324,7 +336,7 @@ V4L2CaptureDelegate::V4L2CaptureDelegate
+ is_capturing_(false),
+ timeout_count_(0),
+ rotation_(rotation) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ use_gpu_buffer_ = switches::IsVideoCaptureUseGpuMemoryBufferEnabled();
+ #endif // BUILDFLAG(IS_LINUX)
+ }
+@@ -451,7 +463,7 @@ void V4L2CaptureDelegate::AllocateAndSta
+
+ client_->OnStarted();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (use_gpu_buffer_) {
+ v4l2_gpu_helper_ = std::make_unique<V4L2CaptureDelegateGpuHelper>();
+ }
+@@ -795,7 +807,7 @@ base::WeakPtr<V4L2CaptureDelegate> V4L2C
+
+ V4L2CaptureDelegate::~V4L2CaptureDelegate() = default;
+
+-bool V4L2CaptureDelegate::RunIoctl(int request, void* argp) {
++bool V4L2CaptureDelegate::RunIoctl(unsigned int request, void* argp) {
+ int num_retries = 0;
+ for (; DoIoctl(request, argp) < 0 && num_retries < kMaxIOCtrlRetries;
+ ++num_retries) {
+@@ -805,7 +817,7 @@ bool V4L2CaptureDelegate::RunIoctl(int r
+ return num_retries != kMaxIOCtrlRetries;
+ }
+
+-int V4L2CaptureDelegate::DoIoctl(int request, void* argp) {
++int V4L2CaptureDelegate::DoIoctl(unsigned int request, void* argp) {
+ return HANDLE_EINTR(v4l2_->ioctl(device_fd_.get(), request, argp));
+ }
+
+@@ -816,6 +828,7 @@ bool V4L2CaptureDelegate::IsControllable
+ }
+
+ void V4L2CaptureDelegate::ReplaceControlEventSubscriptions() {
++#if !BUILDFLAG(IS_BSD)
+ constexpr uint32_t kControlIds[] = {V4L2_CID_AUTO_EXPOSURE_BIAS,
+ V4L2_CID_AUTO_WHITE_BALANCE,
+ V4L2_CID_BRIGHTNESS,
+@@ -843,6 +856,7 @@ void V4L2CaptureDelegate::ReplaceControl
+ << ", {type = V4L2_EVENT_CTRL, id = " << control_id << "}";
+ }
+ }
++#endif
+ }
+
+ mojom::RangePtr V4L2CaptureDelegate::RetrieveUserControlRange(int control_id) {
+@@ -1023,7 +1037,11 @@ void V4L2CaptureDelegate::DoCapture() {
+
+ pollfd device_pfd = {};
+ device_pfd.fd = device_fd_.get();
++#if !BUILDFLAG(IS_BSD)
+ device_pfd.events = POLLIN | POLLPRI;
++#else
++ device_pfd.events = POLLIN;
++#endif
+
+ const int result =
+ HANDLE_EINTR(v4l2_->poll(&device_pfd, 1, kCaptureTimeoutMs));
+@@ -1043,6 +1061,12 @@ void V4L2CaptureDelegate::DoCapture() {
+ // in older kernels, and stopping and starting the stream gets the camera
+ // out of this bad state. Upgrading the kernel is difficult so this is our
+ // way out for now.
++#if BUILDFLAG(IS_NETBSD)
++ // On NetBSD cause: StartStream@media/capture/video/linux/v4l2_capture_delegate.cc:1017,
++ // Error requesting MMAP buffers from V4L2, OS message: Device busy (16)
++ // so do nothing, just wait for timeout_count_ >= kContinuousTimeoutLimit
++ DLOG(WARNING) << "DoCapture: poll timeout";
++#else
+ DLOG(WARNING) << "Restarting camera stream";
+ if (!StopStream() || !StartStream())
+ return;
+@@ -1050,6 +1074,7 @@ void V4L2CaptureDelegate::DoCapture() {
+ FROM_HERE,
+ base::BindOnce(&V4L2CaptureDelegate::DoCapture, GetWeakPtr()));
+ return;
++#endif
+ } else if (timeout_count_ >= kContinuousTimeoutLimit) {
+ SetErrorState(
+ VideoCaptureError::kV4L2MultipleContinuousTimeoutsWhileReadPolling,
+@@ -1061,6 +1086,7 @@ void V4L2CaptureDelegate::DoCapture() {
+ timeout_count_ = 0;
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ // Dequeue events if the driver has filled in some.
+ if (device_pfd.revents & POLLPRI) {
+ bool controls_changed = false;
+@@ -1094,6 +1120,7 @@ void V4L2CaptureDelegate::DoCapture() {
+ client_->OnCaptureConfigurationChanged();
+ }
+ }
++#endif
+
+ // Deenqueue, send and reenqueue a buffer if the driver has filled one in.
+ if (device_pfd.revents & POLLIN) {
+@@ -1147,7 +1174,7 @@ void V4L2CaptureDelegate::DoCapture() {
+ // workable on Linux.
+
+ // See http://crbug.com/959919.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (use_gpu_buffer_) {
+ v4l2_gpu_helper_->OnIncomingCapturedData(
+ client_.get(), buffer_tracker->start(),
+@@ -1220,7 +1247,7 @@ void V4L2CaptureDelegate::SetErrorState(
+ client_->OnError(error, from_here, reason);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ gfx::ColorSpace V4L2CaptureDelegate::BuildColorSpaceFromv4l2() {
+ v4l2_colorspace v4l2_primary = (v4l2_colorspace)video_fmt_.fmt.pix.colorspace;
+ v4l2_quantization v4l2_range =
diff --git a/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.h b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.h
new file mode 100644
index 0000000000..ff49340856
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__delegate.h
@@ -0,0 +1,66 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/v4l2_capture_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/v4l2_capture_delegate.h
+@@ -22,7 +22,7 @@
+ #include "media/capture/video/linux/v4l2_capture_device_impl.h"
+ #include "media/capture/video/video_capture_device.h"
+
+-#if BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_OPENBSD) || defined(OS_NETBSD)
+ #include <sys/videoio.h>
+ #else
+ #include <linux/videodev2.h>
+@@ -34,7 +34,7 @@ class Location;
+
+ namespace media {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class V4L2CaptureDelegateGpuHelper;
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -85,7 +85,7 @@ class CAPTURE_EXPORT V4L2CaptureDelegate
+ static bool IsBlockedControl(int control_id);
+ static bool IsControllableControl(
+ int control_id,
+- const base::RepeatingCallback<int(int, void*)>& do_ioctl);
++ const base::RepeatingCallback<int(unsigned int, void*)>& do_ioctl);
+
+ private:
+ friend class V4L2CaptureDelegateTest;
+@@ -96,10 +96,10 @@ class CAPTURE_EXPORT V4L2CaptureDelegate
+ // device file descriptor or (re)starting streaming, can fail but works after
+ // retrying (https://crbug.com/670262). Returns false if the |request| ioctl
+ // fails too many times.
+- bool RunIoctl(int request, void* argp);
++ bool RunIoctl(unsigned int request, void* argp);
+
+ // Simple wrapper to do HANDLE_EINTR(v4l2_->ioctl(device_fd_.get(), ...)).
+- int DoIoctl(int request, void* argp);
++ int DoIoctl(unsigned int request, void* argp);
+
+ // Check whether the control is controllable (and not changed automatically).
+ bool IsControllableControl(int control_id);
+@@ -129,7 +129,7 @@ class CAPTURE_EXPORT V4L2CaptureDelegate
+ const base::Location& from_here,
+ const std::string& reason);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Systems which describe a "color space" usually map that to one or more of
+ // {primary, matrix, transfer, range}. BuildColorSpaceFromv4l2() will use the
+ // matched value as first priority. Otherwise, if there is no best matching
+@@ -163,7 +163,7 @@ class CAPTURE_EXPORT V4L2CaptureDelegate
+ // Clockwise rotation in degrees. This value should be 0, 90, 180, or 270.
+ int rotation_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Support GPU memory buffer.
+ bool use_gpu_buffer_;
+ std::unique_ptr<V4L2CaptureDelegateGpuHelper> v4l2_gpu_helper_;
diff --git a/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device.h b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device.h
new file mode 100644
index 0000000000..0ee1ef7eea
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/v4l2_capture_device.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/v4l2_capture_device.h
+@@ -21,7 +21,7 @@ class CAPTURE_EXPORT V4L2CaptureDevice
+ public:
+ virtual int open(const char* device_name, int flags) = 0;
+ virtual int close(int fd) = 0;
+- virtual int ioctl(int fd, int request, void* argp) = 0;
++ virtual int ioctl(int fd, unsigned long request, void* argp) = 0;
+ virtual void* mmap(void* start,
+ size_t length,
+ int prot,
diff --git a/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.cc b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.cc
new file mode 100644
index 0000000000..4b0f961202
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/v4l2_capture_device_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/v4l2_capture_device_impl.cc
+@@ -22,7 +22,7 @@ int V4L2CaptureDeviceImpl::close(int fd)
+ return ::close(fd);
+ }
+
+-int V4L2CaptureDeviceImpl::ioctl(int fd, int request, void* argp) {
++int V4L2CaptureDeviceImpl::ioctl(int fd, unsigned long request, void* argp) {
+ return ::ioctl(fd, request, argp);
+ }
+
diff --git a/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.h b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.h
new file mode 100644
index 0000000000..7aadf86e5d
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_v4l2__capture__device__impl.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/v4l2_capture_device_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/v4l2_capture_device_impl.h
+@@ -19,7 +19,7 @@ class CAPTURE_EXPORT V4L2CaptureDeviceIm
+ public:
+ int open(const char* device_name, int flags) override;
+ int close(int fd) override;
+- int ioctl(int fd, int request, void* argp) override;
++ int ioctl(int fd, unsigned long request, void* argp) override;
+ void* mmap(void* start,
+ size_t length,
+ int prot,
diff --git a/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc b/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc
new file mode 100644
index 0000000000..b62ebe9feb
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.cc
@@ -0,0 +1,107 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/video_capture_device_factory_v4l2.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/video_capture_device_factory_v4l2.cc
+@@ -23,7 +23,7 @@
+ #include "media/capture/video/linux/scoped_v4l2_device_fd.h"
+ #include "media/capture/video/linux/video_capture_device_linux.h"
+
+-#if BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
+ #include <sys/videoio.h>
+ #else
+ #include <linux/videodev2.h>
+@@ -38,6 +38,7 @@ bool CompareCaptureDevices(const VideoCa
+ return a.descriptor < b.descriptor;
+ }
+
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_NETBSD)
+ // USB VID and PID are both 4 bytes long.
+ const size_t kVidPidSize = 4;
+ const size_t kMaxInterfaceNameSize = 256;
+@@ -70,11 +71,24 @@ std::string ExtractFileNameFromDeviceId(
+ DCHECK(base::StartsWith(device_id, kDevDir, base::CompareCase::SENSITIVE));
+ return device_id.substr(strlen(kDevDir), device_id.length());
+ }
++#endif
+
+ class DevVideoFilePathsDeviceProvider
+ : public VideoCaptureDeviceFactoryV4L2::DeviceProvider {
+ public:
+ void GetDeviceIds(std::vector<std::string>* target_container) override {
++#if BUILDFLAG(IS_OPENBSD)
++ char device[12];
++ int fd;
++ /* unveil(2) limits access to /dev/, try /dev/video[0-7] */
++ for (int n = 0; n < 8; n++) {
++ snprintf(device, sizeof(device), "/dev/video%d", n);
++ if ((fd = open(device, O_RDONLY)) != -1) {
++ close(fd);
++ target_container->emplace_back(device);
++ }
++ }
++#else
+ const base::FilePath path("/dev/");
+ base::FileEnumerator enumerator(path, false, base::FileEnumerator::FILES,
+ "video*");
+@@ -82,9 +96,13 @@ class DevVideoFilePathsDeviceProvider
+ const base::FileEnumerator::FileInfo info = enumerator.GetInfo();
+ target_container->emplace_back(path.value() + info.GetName().value());
+ }
++#endif
+ }
+
+ std::string GetDeviceModelId(const std::string& device_id) override {
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
++ return std::string();
++#else
+ const std::string file_name = ExtractFileNameFromDeviceId(device_id);
+ std::string usb_id;
+ const std::string vid_path =
+@@ -101,9 +119,13 @@ class DevVideoFilePathsDeviceProvider
+ }
+
+ return usb_id;
++#endif
+ }
+
+ std::string GetDeviceDisplayName(const std::string& device_id) override {
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
++ return std::string();
++#else
+ const std::string file_name = ExtractFileNameFromDeviceId(device_id);
+ const std::string interface_path =
+ base::StringPrintf(kInterfacePathTemplate, file_name.c_str());
+@@ -114,6 +136,7 @@ class DevVideoFilePathsDeviceProvider
+ return std::string();
+ }
+ return display_name;
++#endif
+ }
+ };
+
+@@ -219,7 +242,7 @@ void VideoCaptureDeviceFactoryV4L2::GetD
+ std::move(callback).Run(std::move(devices_info));
+ }
+
+-int VideoCaptureDeviceFactoryV4L2::DoIoctl(int fd, int request, void* argp) {
++int VideoCaptureDeviceFactoryV4L2::DoIoctl(int fd, unsigned int request, void* argp) {
+ return HANDLE_EINTR(v4l2_->ioctl(fd, request, argp));
+ }
+
+@@ -279,6 +302,11 @@ std::vector<float> VideoCaptureDeviceFac
+ frame_rates.push_back(
+ frame_interval.discrete.denominator /
+ static_cast<float>(frame_interval.discrete.numerator));
++#if BUILDFLAG(IS_NETBSD)
++ // On NetBSD VIDIOC_ENUM_FRAMEINTERVALS(video_enum_frameival) always return the same values
++ // and not handle index, what is cause infinity loop. One round is enough.
++ break;
++#endif
+ }
+ } else if (frame_interval.type == V4L2_FRMIVAL_TYPE_CONTINUOUS ||
+ frame_interval.type == V4L2_FRMIVAL_TYPE_STEPWISE) {
diff --git a/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.h b/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.h
new file mode 100644
index 0000000000..8ccc9c6b9c
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__factory__v4l2.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/video_capture_device_factory_v4l2.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/video_capture_device_factory_v4l2.h
+@@ -51,7 +51,7 @@ class CAPTURE_EXPORT VideoCaptureDeviceF
+
+ private:
+ // Simple wrapper to do HANDLE_EINTR(v4l2_->ioctl(fd, ...)).
+- int DoIoctl(int fd, int request, void* argp);
++ int DoIoctl(int fd, unsigned int request, void* argp);
+
+ VideoCaptureControlSupport GetControlSupport(int fd);
+ bool GetControlSupport(int fd, int control_id);
diff --git a/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__linux.cc b/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__linux.cc
new file mode 100644
index 0000000000..2aad0cf8c5
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_linux_video__capture__device__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/linux/video_capture_device_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/linux/video_capture_device_linux.cc
+@@ -15,7 +15,7 @@
+ #include "build/build_config.h"
+ #include "media/capture/video/linux/v4l2_capture_delegate.h"
+
+-#if BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
+ #include <sys/videoio.h>
+ #else
+ #include <linux/videodev2.h>
diff --git a/chromium-next/patches/patch-media_capture_video_video__capture__buffer__tracker__factory__impl.cc b/chromium-next/patches/patch-media_capture_video_video__capture__buffer__tracker__factory__impl.cc
new file mode 100644
index 0000000000..1fad87fcb7
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_video__capture__buffer__tracker__factory__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/video_capture_buffer_tracker_factory_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/video_capture_buffer_tracker_factory_impl.cc
+@@ -14,7 +14,7 @@
+ #include "media/capture/video/chromeos/gpu_memory_buffer_tracker_cros.h"
+ #elif BUILDFLAG(IS_APPLE)
+ #include "media/capture/video/apple/gpu_memory_buffer_tracker_apple.h"
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "media/capture/video/linux/v4l2_gpu_memory_buffer_tracker.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "media/capture/video/win/gpu_memory_buffer_tracker_win.h"
+@@ -42,7 +42,7 @@ VideoCaptureBufferTrackerFactoryImpl::Cr
+ return std::make_unique<GpuMemoryBufferTrackerCros>();
+ #elif BUILDFLAG(IS_APPLE)
+ return std::make_unique<GpuMemoryBufferTrackerApple>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return std::make_unique<V4L2GpuMemoryBufferTracker>();
+ #elif BUILDFLAG(IS_WIN)
+ if (!dxgi_device_manager_) {
diff --git a/chromium-next/patches/patch-media_capture_video_video__capture__device__client.cc b/chromium-next/patches/patch-media_capture_video_video__capture__device__client.cc
new file mode 100644
index 0000000000..5e62ee7d78
--- /dev/null
+++ b/chromium-next/patches/patch-media_capture_video_video__capture__device__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/capture/video/video_capture_device_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/capture/video/video_capture_device_client.cc
+@@ -172,7 +172,7 @@ FourccAndFlip GetFourccAndFlipFromPixelF
+ CHECK(!is_width_odd && !is_height_odd);
+ return {libyuv::FOURCC_UYVY};
+ case media::PIXEL_FORMAT_RGB24:
+- if constexpr (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) {
++ if constexpr (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) {
+ // Linux RGB24 defines red at lowest byte address,
+ // see http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html.
+ return {libyuv::FOURCC_RAW};
diff --git a/chromium-next/patches/patch-media_cdm_cdm__paths__unittest.cc b/chromium-next/patches/patch-media_cdm_cdm__paths__unittest.cc
new file mode 100644
index 0000000000..086bd50b3e
--- /dev/null
+++ b/chromium-next/patches/patch-media_cdm_cdm__paths__unittest.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/cdm/cdm_paths_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/cdm/cdm_paths_unittest.cc
+@@ -27,7 +27,7 @@ const char kComponentPlatform[] =
+ "win";
+ #elif BUILDFLAG(IS_CHROMEOS)
+ "cros";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ "linux";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ "fuchsia";
diff --git a/chromium-next/patches/patch-media_cdm_library__cdm_cdm__paths.gni b/chromium-next/patches/patch-media_cdm_library__cdm_cdm__paths.gni
new file mode 100644
index 0000000000..14992cf319
--- /dev/null
+++ b/chromium-next/patches/patch-media_cdm_library__cdm_cdm__paths.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/cdm/library_cdm/cdm_paths.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/cdm/library_cdm/cdm_paths.gni
+@@ -15,7 +15,7 @@ assert(enable_library_cdms)
+ # Explicitly define what we use to avoid confusion.
+ if (is_chromeos) {
+ component_os = "cros"
+-} else if (is_linux) {
++} else if (is_linux || is_bsd) {
+ component_os = "linux"
+ } else if (is_win) {
+ component_os = "win"
diff --git a/chromium-next/patches/patch-media_ffmpeg_scripts_build__ffmpeg.py b/chromium-next/patches/patch-media_ffmpeg_scripts_build__ffmpeg.py
new file mode 100644
index 0000000000..b8525a1367
--- /dev/null
+++ b/chromium-next/patches/patch-media_ffmpeg_scripts_build__ffmpeg.py
@@ -0,0 +1,82 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/ffmpeg/scripts/build_ffmpeg.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/ffmpeg/scripts/build_ffmpeg.py
+@@ -33,7 +33,7 @@ NDK_ROOT_DIR = os.path.abspath(
+ SUCCESS_TOKEN = 'THIS_BUILD_WORKED'
+
+ sys.path.append(os.path.join(CHROMIUM_ROOT_DIR, 'build'))
+-import gn_helpers
++#import gn_helpers
+
+ BRANDINGS = [
+ 'Chrome',
+@@ -43,6 +43,9 @@ BRANDINGS = [
+ ARCH_MAP = {
+ 'android': ['ia32', 'x64', 'arm-neon', 'arm64'],
+ 'linux': ['ia32', 'x64', 'noasm-x64', 'arm', 'arm-neon', 'arm64'],
++ 'openbsd': ['x64', 'arm64', 'ia32'],
++ 'freebsd': ['x64', 'arm64', 'ia32'],
++ 'netbsd': ['x64', 'arm64', 'ia32'],
+ 'mac': ['x64', 'arm64'],
+ 'win': ['ia32', 'x64', 'arm64'],
+ }
+@@ -122,7 +125,7 @@ def PrintAndCheckCall(argv, *args, **kwa
+
+
+ def GetDsoName(target_os, dso_name, dso_version):
+- if target_os in ('linux', 'linux-noasm', 'android'):
++ if target_os in ('linux', 'linux-noasm', 'android', 'openbsd', 'freebsd', 'netbsd'):
+ return 'lib%s.so.%s' % (dso_name, dso_version)
+ elif target_os == 'mac':
+ return 'lib%s.%s.dylib' % (dso_name, dso_version)
+@@ -475,7 +478,7 @@ def BuildFFmpeg(target_os, target_arch,
+ # removing <sys/sysctl.h> soon, so this is needed to silence a deprecation
+ # #warning which will be converted to an error via -Werror.
+ # There is also no prctl.h
+- if target_os in ['linux', 'linux-noasm']:
++ if target_os in ['linux', 'linux-noasm', 'openbsd', 'freebsd', 'netbsd']:
+ pre_make_rewrites += [
+ (r'(#define HAVE_SYSCTL [01])',
+ r'#define HAVE_SYSCTL 0 /* \1 -- forced to 0 for Fuchsia */'),
+@@ -598,7 +601,7 @@ def main(argv):
+ configure_args = args[2:]
+
+ if target_os not in ('android', 'linux', 'linux-noasm', 'mac', 'win',
+- 'all'):
++ 'all', 'openbsd', 'freebsd', 'netbsd'):
+ parser.print_help()
+ return 1
+
+@@ -712,7 +715,7 @@ def ConfigureAndBuild(target_arch, targe
+ '--optflags="-O2"',
+ ])
+
+- if target_os in ('linux', 'linux-noasm', 'android'):
++ if target_os in ('linux', 'linux-noasm', 'android', 'openbsd', 'freebsd', 'netbsd'):
+ if target_arch == 'x64':
+ if target_os == 'android':
+ configure_flags['Common'].extend([
+@@ -827,9 +830,6 @@ def ConfigureAndBuild(target_arch, targe
+
+ configure_flags['Common'].extend([
+ '--target-os=linux',
+- '--sysroot=' +
+- os.path.join(CHROMIUM_ROOT_DIR,
+- 'build/linux/debian_bullseye_arm64-sysroot'),
+ # See crbug.com/1467681. These could be removed eventually
+ '--disable-dotprod',
+ '--disable-i8mm',
+@@ -921,7 +921,7 @@ def ConfigureAndBuild(target_arch, targe
+ # typically be the system one, so explicitly configure use of Clang's
+ # ld.lld, to ensure that things like cross-compilation and LTO work.
+ # This does not work for ia32 and is always used on mac.
+- if target_arch != 'ia32' and target_os != 'mac':
++ if target_arch != 'ia32' and target_os != 'mac' and target_os != 'netbsd':
+ configure_flags['Common'].append('--extra-ldflags=-fuse-ld=lld')
+
+ # Should be run on Mac, unless we're cross-compiling on Linux.
diff --git a/chromium-next/patches/patch-media_ffmpeg_scripts_robo__lib_config.py b/chromium-next/patches/patch-media_ffmpeg_scripts_robo__lib_config.py
new file mode 100644
index 0000000000..d5e9f2f737
--- /dev/null
+++ b/chromium-next/patches/patch-media_ffmpeg_scripts_robo__lib_config.py
@@ -0,0 +1,64 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/ffmpeg/scripts/robo_lib/config.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/ffmpeg/scripts/robo_lib/config.py
+@@ -55,19 +55,13 @@ class RoboConfiguration:
+ self._llvm_path = os.path.join(self.chrome_src(), "third_party",
+ "llvm-build", "Release+Asserts", "bin")
+
+- self.EnsurePathContainsLLVM()
+- self.EnsureNoMakeInfo()
+ self.EnsureFFmpegHome()
+ self.EnsureGNConfig()
+- self.ComputeBranchName()
+
+ if not quiet:
+ shell.log(f"Using chrome src: {self.chrome_src()}")
+ shell.log(f"Using script dir: {self._script_directory}")
+ shell.log(f"Using ffmpeg home: {self.ffmpeg_home()}")
+- shell.log(f"On branch: {self.branch_name()}")
+- if self.sushi_branch_name():
+- shell.log(f"On sushi branch: {self.sushi_branch_name()}")
+
+ # Filename that we'll ask generate_gn.py to write git commands to.
+ # TODO: Should this use script_directory, or stay with ffmpeg? As long as
+@@ -186,9 +180,9 @@ class RoboConfiguration:
+
+ if re.match(r"i.86", platform.machine()):
+ self._host_architecture = "ia32"
+- elif platform.machine() == "x86_64" or platform.machine() == "AMD64":
++ elif platform.machine() == "x86_64" or platform.machine() == "AMD64" or platform.machine() == "amd64":
+ self._host_architecture = "x64"
+- elif platform.machine() == "aarch64":
++ elif platform.machine() == "aarch64" or platform.machine() == "arm64":
+ self._host_architecture = "arm64"
+ elif platform.machine() == "mips32":
+ self._host_architecture = "mipsel"
+@@ -223,6 +217,12 @@ class RoboConfiguration:
+ elif platform.system() == "Windows" or "CYGWIN_NT" in platform.system(
+ ):
+ self._host_operating_system = "win"
++ elif platform.system() == "OpenBSD":
++ self._host_operating_system = "openbsd"
++ elif platform.system() == "FreeBSD":
++ self._host_operating_system = "freebsd"
++ elif platform.system() == "NetBSD":
++ self._host_operating_system = "netbsd"
+ else:
+ raise ValueError(f"Unsupported platform: {platform.system()}")
+
+@@ -231,8 +231,8 @@ class RoboConfiguration:
+ wd = os.getcwd()
+ # Walk up the tree until we find src/AUTHORS
+ while wd != "/":
+- if os.path.isfile(os.path.join(wd, "src", "AUTHORS")):
+- self._chrome_src = os.path.join(wd, "src")
++ if os.path.isfile(os.path.join(wd, "third_party", "DEPS")):
++ self._chrome_src = wd
+ return
+ wd = os.path.dirname(wd)
+ raise Exception("could not find src/AUTHORS in any parent of the wd")
diff --git a/chromium-next/patches/patch-media_gpu_buffer__validation.cc b/chromium-next/patches/patch-media_gpu_buffer__validation.cc
new file mode 100644
index 0000000000..f557831e45
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_buffer__validation.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/buffer_validation.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/buffer_validation.cc
+@@ -15,7 +15,7 @@
+ #include "ui/gfx/geometry/size.h"
+ #include "ui/gfx/gpu_memory_buffer.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <sys/types.h>
+ #include <unistd.h>
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -23,7 +23,7 @@
+ namespace media {
+
+ bool GetFileSize(const int fd, size_t* size) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (fd < 0) {
+ VLOG(1) << "Invalid file descriptor";
+ return false;
+@@ -77,7 +77,7 @@ bool VerifyGpuMemoryBufferHandle(
+ VLOG(1) << "Unsupported: " << pixel_format;
+ return false;
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format);
+ if (num_planes != gmb_handle.native_pixmap_handle.planes.size() ||
+ num_planes == 0) {
diff --git a/chromium-next/patches/patch-media_gpu_chromeos_gl__image__processor__backend.cc b/chromium-next/patches/patch-media_gpu_chromeos_gl__image__processor__backend.cc
new file mode 100644
index 0000000000..eb9277d6a9
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_chromeos_gl__image__processor__backend.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/chromeos/gl_image_processor_backend.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/chromeos/gl_image_processor_backend.cc
+@@ -28,6 +28,10 @@
+ #include "ui/ozone/public/ozone_platform.h"
+ #include "ui/ozone/public/surface_factory_ozone.h"
+
++#ifndef GL_CONTEXT_LOST_KHR
++#define GL_CONTEXT_LOST_KHR 0x0507
++#endif
++
+ namespace media {
+
+ namespace {
diff --git a/chromium-next/patches/patch-media_gpu_chromeos_libyuv__image__processor__backend.cc b/chromium-next/patches/patch-media_gpu_chromeos_libyuv__image__processor__backend.cc
new file mode 100644
index 0000000000..77ed19eba1
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_chromeos_libyuv__image__processor__backend.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/chromeos/libyuv_image_processor_backend.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/chromeos/libyuv_image_processor_backend.cc
+@@ -53,7 +53,7 @@ static constexpr struct {
+ #define CONV(in, out, trans, result) \
+ {Fourcc::in, Fourcc::out, Transform::trans, SupportResult::result}
+ // Conversion.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ CONV(NV12, AR24, kConversion, Supported),
+ #endif
+ CONV(NV12, NV12, kConversion, Supported),
+@@ -412,7 +412,7 @@ int LibYUVImageProcessorBackend::DoConve
+ fr->GetWritableVisibleData(VideoFrame::Plane::kUV)), \
+ fr->stride(VideoFrame::Plane::kUV)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define ARGB_DATA(fr) \
+ fr->GetWritableVisibleData(VideoFrame::Plane::kARGB), \
+ fr->stride(VideoFrame::Plane::kARGB)
+@@ -574,7 +574,7 @@ int LibYUVImageProcessorBackend::DoConve
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (output->format() == PIXEL_FORMAT_ARGB) {
+ if (input_config_.fourcc == Fourcc(Fourcc::NV12)) {
+ return LIBYUV_FUNC(NV12ToARGB, Y_UV_DATA(input),
diff --git a/chromium-next/patches/patch-media_gpu_chromeos_mailbox__video__frame__converter.cc b/chromium-next/patches/patch-media_gpu_chromeos_mailbox__video__frame__converter.cc
new file mode 100644
index 0000000000..7c9956d35a
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_chromeos_mailbox__video__frame__converter.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/chromeos/mailbox_video_frame_converter.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/chromeos/mailbox_video_frame_converter.cc
+@@ -67,7 +67,7 @@ viz::SharedImageFormat GetSharedImageFor
+ << static_cast<int>(buffer_format);
+ NOTREACHED();
+ }
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If format is true multiplanar format, we prefer external sampler on
+ // ChromeOS and Linux.
+ if (format.is_multi_plane()) {
diff --git a/chromium-next/patches/patch-media_gpu_chromeos_platform__video__frame__utils.cc b/chromium-next/patches/patch-media_gpu_chromeos_platform__video__frame__utils.cc
new file mode 100644
index 0000000000..5d72dc94c2
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_chromeos_platform__video__frame__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/chromeos/platform_video_frame_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/chromeos/platform_video_frame_utils.cc
+@@ -67,7 +67,7 @@ static std::unique_ptr<ui::GbmDevice> Cr
+ const base::FilePath dev_path(FILE_PATH_LITERAL(
+ base::StrCat({drm_node_file_prefix, base::NumberToString(i)})));
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_V4L2_CODEC)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_V4L2_CODEC)
+ const bool is_render_node = base::Contains(drm_node_file_prefix, "render");
+
+ // TODO(b/313513760): don't guard base::File::FLAG_WRITE behind
diff --git a/chromium-next/patches/patch-media_gpu_chromeos_video__decoder__pipeline.cc b/chromium-next/patches/patch-media_gpu_chromeos_video__decoder__pipeline.cc
new file mode 100644
index 0000000000..178225cae8
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_chromeos_video__decoder__pipeline.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/chromeos/video_decoder_pipeline.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/chromeos/video_decoder_pipeline.cc
+@@ -1097,7 +1097,7 @@ VideoDecoderPipeline::PickDecoderOutputF
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_VAAPI)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_VAAPI)
+ // Linux should always use a custom allocator (to allocate buffers using
+ // libva) and a PlatformVideoFramePool.
+ CHECK(allocator.has_value());
+@@ -1106,7 +1106,7 @@ VideoDecoderPipeline::PickDecoderOutputF
+ // VideoFrame::StorageType of VideoFrame::STORAGE_DMABUFS.
+ main_frame_pool_->AsPlatformVideoFramePool()->SetCustomFrameAllocator(
+ *allocator, VideoFrame::STORAGE_DMABUFS);
+-#elif BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_V4L2_CODEC)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_V4L2_CODEC)
+ // Linux w/ V4L2 should not use a custom allocator
+ // Only tested with video_decode_accelerator_tests
+ // TODO(wenst@) Test with full Chromium Browser
+@@ -1288,7 +1288,7 @@ VideoDecoderPipeline::PickDecoderOutputF
+ << " VideoFrames";
+ auxiliary_frame_pool_->set_parent_task_runner(decoder_task_runner_);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The custom allocator creates frames backed by NativePixmap, which uses a
+ // VideoFrame::StorageType of VideoFrame::STORAGE_DMABUFS.
+ auxiliary_frame_pool_->AsPlatformVideoFramePool()->SetCustomFrameAllocator(
diff --git a/chromium-next/patches/patch-media_gpu_gpu__video__encode__accelerator__factory.cc b/chromium-next/patches/patch-media_gpu_gpu__video__encode__accelerator__factory.cc
new file mode 100644
index 0000000000..d7623b7dd3
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_gpu__video__encode__accelerator__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/gpu_video_encode_accelerator_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/gpu_video_encode_accelerator_factory.cc
+@@ -118,7 +118,7 @@ std::vector<VEAFactoryFunction> GetVEAFa
+ return vea_factory_functions;
+
+ #if BUILDFLAG(USE_VAAPI)
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(kAcceleratedVideoEncodeLinux)) {
+ vea_factory_functions.push_back(base::BindRepeating(&CreateVaapiVEA));
+ }
+@@ -126,7 +126,7 @@ std::vector<VEAFactoryFunction> GetVEAFa
+ vea_factory_functions.push_back(base::BindRepeating(&CreateVaapiVEA));
+ #endif
+ #elif BUILDFLAG(USE_V4L2_CODEC)
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(kAcceleratedVideoEncodeLinux)) {
+ vea_factory_functions.push_back(base::BindRepeating(&CreateV4L2VEA));
+ }
diff --git a/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..d6c3f179a1
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.cc
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc
+@@ -16,7 +16,9 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #endif
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
++#endif
+
+ // TODO(b/195769334): the hardware video decoding sandbox is really only useful
+ // when building with VA-API or V4L2 (otherwise, we're not really doing hardware
+@@ -32,6 +34,7 @@ using sandbox::syscall_broker::BrokerFil
+ namespace media {
+ namespace {
+
++#if !BUILDFLAG(IS_BSD)
+ void AllowAccessToRenderNodes(std::vector<BrokerFilePermission>& permissions,
+ bool include_sys_dev_char,
+ bool read_write) {
+@@ -188,6 +191,7 @@ bool HardwareVideoDecodingPreSandboxHook
+ NOTREACHED();
+ #endif // BUILDFLAG(USE_V4L2_CODEC)
+ }
++#endif
+
+ } // namespace
+
+@@ -203,6 +207,7 @@ bool HardwareVideoDecodingPreSandboxHook
+ // (at least).
+ bool HardwareVideoDecodingPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ using HardwareVideoDecodingProcessPolicy =
+ sandbox::policy::HardwareVideoDecodingProcessPolicy;
+ using PolicyType =
+@@ -248,6 +253,7 @@ bool HardwareVideoDecodingPreSandboxHook
+ // |permissions| is empty?
+ sandbox::policy::SandboxLinux::GetInstance()->StartBrokerProcess(
+ command_set, permissions, options);
++#endif
+ return true;
+ }
+
diff --git a/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h
new file mode 100644
index 0000000000..3a74d2c3c2
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__decoding__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_DECODING_SANDBOX_HOOK_LINUX_H_
+ #define MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_DECODING_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace media {
+
diff --git a/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..07ee2b6cc5
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.cc
@@ -0,0 +1,32 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.cc
+@@ -18,12 +18,15 @@
+ #include "media/gpu/v4l2/v4l2_device.h"
+ #endif
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
++#endif
+
+ namespace media {
+
+ bool HardwareVideoEncodingPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ sandbox::syscall_broker::BrokerCommandSet command_set;
+ std::vector<BrokerFilePermission> permissions;
+
+@@ -132,6 +135,7 @@ bool HardwareVideoEncodingPreSandboxHook
+ dlopen("libvulkan_radeon.so", kDlopenFlags);
+ }
+ #endif
++#endif
+ return true;
+ }
+
diff --git a/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h
new file mode 100644
index 0000000000..f4a3ae3d75
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_sandbox_hardware__video__encoding__sandbox__hook__linux.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/sandbox/hardware_video_encoding_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_
+ #define MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace media {
+
+@@ -14,4 +20,4 @@ bool HardwareVideoEncodingPreSandboxHook
+
+ } // namespace media
+
+-#endif // MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_
+\ No newline at end of file
++#endif // MEDIA_GPU_SANDBOX_HARDWARE_VIDEO_ENCODING_SANDBOX_HOOK_LINUX_H_
diff --git a/chromium-next/patches/patch-media_gpu_test_raw__video.cc b/chromium-next/patches/patch-media_gpu_test_raw__video.cc
new file mode 100644
index 0000000000..fd835369a5
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_test_raw__video.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/test/raw_video.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/test/raw_video.cc
+@@ -61,7 +61,7 @@ std::unique_ptr<base::MemoryMappedFile>
+ base::File::FLAG_READ | base::File::FLAG_WRITE
+ // On Windows FLAG_CREATE_ALWAYS will require FLAG_WRITE, and FLAG_APPEND
+ // must not be specified.
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ | base::File::FLAG_APPEND
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+ ),
diff --git a/chromium-next/patches/patch-media_gpu_test_video__frame__file__writer.cc b/chromium-next/patches/patch-media_gpu_test_video__frame__file__writer.cc
new file mode 100644
index 0000000000..c752ea48cc
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_test_video__frame__file__writer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/test/video_frame_file_writer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/test/video_frame_file_writer.cc
+@@ -26,7 +26,7 @@
+ #include "testing/gtest/include/gtest/gtest.h"
+ #include "ui/gfx/codec/png_codec.h"
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include <sys/mman.h>
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-media_gpu_test_video__frame__helpers.cc b/chromium-next/patches/patch-media_gpu_test_video__frame__helpers.cc
new file mode 100644
index 0000000000..a97841d45a
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_test_video__frame__helpers.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/test/video_frame_helpers.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/test/video_frame_helpers.cc
+@@ -22,7 +22,7 @@
+ #include "ui/gfx/buffer_format_util.h"
+ #include "ui/gfx/gpu_memory_buffer.h"
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include <sys/mman.h>
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-media_gpu_test_video__frame__validator.cc b/chromium-next/patches/patch-media_gpu_test_video__frame__validator.cc
new file mode 100644
index 0000000000..b7054dd96d
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_test_video__frame__validator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/test/video_frame_validator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/test/video_frame_validator.cc
+@@ -33,7 +33,7 @@
+ #include "testing/gtest/include/gtest/gtest.h"
+ #include "ui/gfx/gpu_memory_buffer.h"
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include <sys/mman.h>
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-media_gpu_vaapi_vaapi__video__decoder.cc b/chromium-next/patches/patch-media_gpu_vaapi_vaapi__video__decoder.cc
new file mode 100644
index 0000000000..3789a1c1d3
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_vaapi_vaapi__video__decoder.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/vaapi/vaapi_video_decoder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/vaapi/vaapi_video_decoder.cc
+@@ -782,7 +782,7 @@ void VaapiVideoDecoder::ApplyResolutionC
+ const gfx::Size decoder_natural_size =
+ aspect_ratio_.GetNaturalSize(decoder_visible_rect);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::optional<DmabufVideoFramePool::CreateFrameCB> allocator =
+ base::BindRepeating(&AllocateCustomFrameProxy, weak_this_);
+ std::vector<ImageProcessor::PixelLayoutCandidate> candidates = {
diff --git a/chromium-next/patches/patch-media_gpu_vaapi_vaapi__wrapper.cc b/chromium-next/patches/patch-media_gpu_vaapi_vaapi__wrapper.cc
new file mode 100644
index 0000000000..ce20910f5b
--- /dev/null
+++ b/chromium-next/patches/patch-media_gpu_vaapi_vaapi__wrapper.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/gpu/vaapi/vaapi_wrapper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/gpu/vaapi/vaapi_wrapper.cc
+@@ -78,7 +78,7 @@
+ using media_gpu_vaapi::kModuleVa_prot;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/files/file_util.h"
+ #include "base/strings/string_split.h"
+ #endif
diff --git a/chromium-next/patches/patch-media_media__options.gni b/chromium-next/patches/patch-media_media__options.gni
new file mode 100644
index 0000000000..4b7f20016f
--- /dev/null
+++ b/chromium-next/patches/patch-media_media__options.gni
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/media_options.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/media_options.gni
+@@ -197,12 +197,18 @@ declare_args() {
+ # Enables runtime selection of ALSA library for audio.
+ use_alsa = false
+
++ # Enable runtime selection of sndio(7)
++ use_sndio = false
++
++ # Enable runtime selection of audio(4)
++ use_audioio = false
++
+ # Alsa should be used on all non-Android, non-Mac POSIX systems - with the
+ # exception of CastOS desktop builds.
+ #
+ # TODO(crbug.com/1336055): Remove legacy target_cpu hack used for targeting
+ # desktop Chromecast builds.
+- if (is_posix && !is_android && !is_apple &&
++ if (is_posix && !is_android && !is_apple && !is_bsd &&
+ (!is_castos || (target_cpu == "x86" || target_cpu == "x64") ||
+ is_cast_audio_only)) {
+ use_alsa = true
diff --git a/chromium-next/patches/patch-media_mojo_mojom_stable_BUILD.gn b/chromium-next/patches/patch-media_mojo_mojom_stable_BUILD.gn
new file mode 100644
index 0000000000..c159f4730a
--- /dev/null
+++ b/chromium-next/patches/patch-media_mojo_mojom_stable_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/mojo/mojom/stable/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/mojo/mojom/stable/BUILD.gn
+@@ -196,7 +196,7 @@ source_set("unit_tests") {
+ } else if (use_v4l2_codec) {
+ deps += [ "//media/gpu/v4l2:v4l2_status" ]
+ }
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "mojom_traits_test_util.cc",
+ "mojom_traits_test_util.h",
diff --git a/chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc b/chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc
new file mode 100644
index 0000000000..9e7beb40b1
--- /dev/null
+++ b/chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.cc
+@@ -854,7 +854,7 @@ const gfx::GpuMemoryBufferId& StructTrai
+ return input.id;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ gfx::NativePixmapHandle StructTraits<
+ media::stable::mojom::NativeGpuMemoryBufferHandleDataView,
+@@ -875,7 +875,7 @@ bool StructTraits<media::stable::mojom::
+
+ output->type = gfx::NATIVE_PIXMAP;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!data.ReadPlatformHandle(&output->native_pixmap_handle))
+ return false;
+ return true;
diff --git a/chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h b/chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h
new file mode 100644
index 0000000000..c8f97422e0
--- /dev/null
+++ b/chromium-next/patches/patch-media_mojo_mojom_stable_stable__video__decoder__types__mojom__traits.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/mojo/mojom/stable/stable_video_decoder_types_mojom_traits.h
+@@ -705,7 +705,7 @@ struct StructTraits<media::stable::mojom
+ static const gfx::GpuMemoryBufferId& id(
+ const gfx::GpuMemoryBufferHandle& input);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static gfx::NativePixmapHandle platform_handle(
+ gfx::GpuMemoryBufferHandle& input);
+ #else
diff --git a/chromium-next/patches/patch-media_mojo_mojom_video__frame__mojom__traits.cc b/chromium-next/patches/patch-media_mojo_mojom_video__frame__mojom__traits.cc
new file mode 100644
index 0000000000..fb851d4b1a
--- /dev/null
+++ b/chromium-next/patches/patch-media_mojo_mojom_video__frame__mojom__traits.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/mojo/mojom/video_frame_mojom_traits.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/mojo/mojom/video_frame_mojom_traits.cc
+@@ -22,7 +22,7 @@
+ #include "ui/gfx/mojom/color_space_mojom_traits.h"
+ #include "ui/gfx/mojom/hdr_metadata_mojom_traits.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/posix/eintr_wrapper.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
diff --git a/chromium-next/patches/patch-media_video_fake__gpu__memory__buffer.cc b/chromium-next/patches/patch-media_video_fake__gpu__memory__buffer.cc
new file mode 100644
index 0000000000..0f744adfb6
--- /dev/null
+++ b/chromium-next/patches/patch-media_video_fake__gpu__memory__buffer.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/video/fake_gpu_memory_buffer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/video/fake_gpu_memory_buffer.cc
+@@ -14,7 +14,7 @@
+ #include "media/base/format_utils.h"
+ #include "media/base/video_frame.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+@@ -63,7 +63,7 @@ class FakeGpuMemoryBufferImpl : public g
+
+ } // namespace
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::ScopedFD GetDummyFD() {
+ base::ScopedFD fd(open("/dev/zero", O_RDWR));
+ DCHECK(fd.is_valid());
+@@ -102,7 +102,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer
+ static base::AtomicSequenceNumber buffer_id_generator;
+ handle_.id = gfx::GpuMemoryBufferId(buffer_id_generator.GetNext());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (size_t i = 0; i < VideoFrame::NumPlanes(video_pixel_format_); i++) {
+ const gfx::Size plane_size_in_bytes =
+ VideoFrame::PlaneSize(video_pixel_format_, i, size_);
+@@ -176,7 +176,7 @@ gfx::GpuMemoryBufferHandle FakeGpuMemory
+ gfx::GpuMemoryBufferHandle handle;
+ handle.type = gfx::NATIVE_PIXMAP;
+ handle.id = handle_.id;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ handle.native_pixmap_handle =
+ gfx::CloneHandleForIPC(handle_.native_pixmap_handle);
+ #endif
diff --git a/chromium-next/patches/patch-media_video_gpu__memory__buffer__video__frame__pool.cc b/chromium-next/patches/patch-media_video_gpu__memory__buffer__video__frame__pool.cc
new file mode 100644
index 0000000000..17b058a0a7
--- /dev/null
+++ b/chromium-next/patches/patch-media_video_gpu__memory__buffer__video__frame__pool.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/video/gpu_memory_buffer_video_frame_pool.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/video/gpu_memory_buffer_video_frame_pool.cc
+@@ -641,7 +641,7 @@ void GpuMemoryBufferVideoFramePool::Pool
+ }
+
+ bool is_software_backed_video_frame = !video_frame->HasSharedImage();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ is_software_backed_video_frame &= !video_frame->HasDmaBufs();
+ #endif
+
+@@ -1049,7 +1049,7 @@ scoped_refptr<VideoFrame> GpuMemoryBuffe
+ media::IOSurfaceIsWebGPUCompatible(handle.io_surface.get());
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ is_webgpu_compatible =
+ handle.native_pixmap_handle.supports_zero_copy_webgpu_import;
+ #endif
+@@ -1229,7 +1229,7 @@ GpuMemoryBufferVideoFramePool::PoolImpl:
+ si_usage |= gpu::SHARED_IMAGE_USAGE_SCANOUT;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/40194712): Always add the flag once the
+ // OzoneImageBacking is by default turned on.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/chromium-next/patches/patch-media_video_video__encode__accelerator__adapter.cc b/chromium-next/patches/patch-media_video_video__encode__accelerator__adapter.cc
new file mode 100644
index 0000000000..aad000cdef
--- /dev/null
+++ b/chromium-next/patches/patch-media_video_video__encode__accelerator__adapter.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/video/video_encode_accelerator_adapter.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/video/video_encode_accelerator_adapter.cc
+@@ -159,7 +159,7 @@ VideoEncodeAccelerator::Config SetUpVeaC
+ config.input_format = PIXEL_FORMAT_I420;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (format != PIXEL_FORMAT_I420 ||
+ !VideoFrame::IsStorageTypeMappable(storage_type)) {
+ // ChromeOS/Linux hardware video encoders supports I420 on-memory
+@@ -518,7 +518,7 @@ void VideoEncodeAcceleratorAdapter::Init
+ profile_, options_, format, first_frame->storage_type(),
+ supported_rc_modes_, required_encoder_type_, is_gpu_supported_format);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Linux/ChromeOS require a special configuration to use dmabuf storage.
+ // We need to keep sending frames the same way the first frame was sent.
+ // Other platforms will happily mix GpuMemoryBuffer storage with regular
diff --git a/chromium-next/patches/patch-media_video_video__encode__accelerator__adapter__test.cc b/chromium-next/patches/patch-media_video_video__encode__accelerator__adapter__test.cc
new file mode 100644
index 0000000000..75bc666f6c
--- /dev/null
+++ b/chromium-next/patches/patch-media_video_video__encode__accelerator__adapter__test.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/video/video_encode_accelerator_adapter_test.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/video/video_encode_accelerator_adapter_test.cc
+@@ -458,7 +458,7 @@ TEST_P(VideoEncodeAcceleratorAdapterTest
+ CreateGreenFrame(large_size, pixel_format, base::Milliseconds(2));
+
+ VideoPixelFormat expected_input_format = PIXEL_FORMAT_I420;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (pixel_format != PIXEL_FORMAT_I420 || !small_frame->IsMappable())
+ expected_input_format = PIXEL_FORMAT_NV12;
+ #endif
diff --git a/chromium-next/patches/patch-media_webrtc_audio__processor.cc b/chromium-next/patches/patch-media_webrtc_audio__processor.cc
new file mode 100644
index 0000000000..029ddc7290
--- /dev/null
+++ b/chromium-next/patches/patch-media_webrtc_audio__processor.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/webrtc/audio_processor.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/webrtc/audio_processor.cc
+@@ -521,7 +521,7 @@ std::optional<double> AudioProcessor::Pr
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+ DCHECK_LE(volume, 1.0);
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
+- BUILDFLAG(IS_OPENBSD)
++ BUILDFLAG(IS_BSD)
+ // We have a special situation on Linux where the microphone volume can be
+ // "higher than maximum". The input volume slider in the sound preference
+ // allows the user to set a scaling that is higher than 100%. It means that
diff --git a/chromium-next/patches/patch-media_webrtc_helpers.cc b/chromium-next/patches/patch-media_webrtc_helpers.cc
new file mode 100644
index 0000000000..bdff855197
--- /dev/null
+++ b/chromium-next/patches/patch-media_webrtc_helpers.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/webrtc/helpers.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/webrtc/helpers.cc
+@@ -43,14 +43,14 @@ void ConfigAutomaticGainControl(const Au
+ return;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const bool kInputVolumeAdjustmentOverrideAllowed = true;
+ #elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
+ const bool kInputVolumeAdjustmentOverrideAllowed = false;
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Use AGC2 digital and input volume controller.
+ // TODO(crbug.com/40872787): Remove `kWebRtcAllowInputVolumeAdjustment` safely
+ // and set `input_volume_controller.enabled` true.
diff --git a/chromium-next/patches/patch-media_webrtc_helpers__unittests.cc b/chromium-next/patches/patch-media_webrtc_helpers__unittests.cc
new file mode 100644
index 0000000000..c6eb38f611
--- /dev/null
+++ b/chromium-next/patches/patch-media_webrtc_helpers__unittests.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- media/webrtc/helpers_unittests.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ media/webrtc/helpers_unittests.cc
+@@ -40,7 +40,7 @@ TEST(CreateWebRtcAudioProcessingModuleTe
+ EXPECT_TRUE(config.echo_canceller.enabled);
+
+ #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)
+ EXPECT_FALSE(config.gain_controller1.enabled);
+ EXPECT_TRUE(config.gain_controller2.enabled);
+ #elif BUILDFLAG(IS_CASTOS) || BUILDFLAG(IS_CAST_ANDROID)
+@@ -73,7 +73,7 @@ TEST(CreateWebRtcAudioProcessingModuleTe
+ }
+
+ #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)
+ TEST(CreateWebRtcAudioProcessingModuleTest,
+ InputVolumeAdjustmentEnabledWithAgc2) {
+ ::base::test::ScopedFeatureList feature_list;
+@@ -89,7 +89,7 @@ TEST(CreateWebRtcAudioProcessingModuleTe
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ TEST(CreateWebRtcAudioProcessingModuleTest,
+ CanDisableInputVolumeAdjustmentWithAgc2) {
+ ::base::test::ScopedFeatureList feature_list;
+@@ -106,7 +106,7 @@ TEST(CreateWebRtcAudioProcessingModuleTe
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+
+ #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)
+ TEST(CreateWebRtcAudioProcessingModuleTest,
+ OnlyOneInputVolumeControllerEnabledOnDesktopPlatforms) {
+ auto config = CreateApmGetConfig(
diff --git a/chromium-next/patches/patch-mojo_core_BUILD.gn b/chromium-next/patches/patch-mojo_core_BUILD.gn
new file mode 100644
index 0000000000..77ab0d5b06
--- /dev/null
+++ b/chromium-next/patches/patch-mojo_core_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- mojo/core/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ mojo/core/BUILD.gn
+@@ -163,7 +163,7 @@ source_set("impl_for_embedder") {
+ ]
+ }
+
+- if ((is_linux || is_chromeos || is_android) && !is_nacl) {
++ if ((is_linux || is_chromeos || is_android) && !is_nacl && !is_bsd) {
+ sources += [
+ "channel_linux.cc",
+ "channel_linux.h",
diff --git a/chromium-next/patches/patch-mojo_core_channel.cc b/chromium-next/patches/patch-mojo_core_channel.cc
new file mode 100644
index 0000000000..2eab45caaf
--- /dev/null
+++ b/chromium-next/patches/patch-mojo_core_channel.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- mojo/core/channel.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ mojo/core/channel.cc
+@@ -83,7 +83,11 @@ const size_t kMaxAttachedHandles = 64;
+ const size_t kMaxAttachedHandles = 253;
+ #endif // BUILDFLAG(IS_FUCHSIA)
+
++#if defined(__i386__) && defined(OS_FREEBSD)
++const size_t kChannelMessageAlignment = 4;
++#else
+ static_assert(alignof(std::max_align_t) >= kChannelMessageAlignment, "");
++#endif
+ Channel::AlignedBuffer MakeAlignedBuffer(size_t size) {
+ // Generic allocators (such as malloc) return a pointer that is suitably
+ // aligned for storing any type of object with a fundamental alignment
diff --git a/chromium-next/patches/patch-mojo_core_embedder_features.h b/chromium-next/patches/patch-mojo_core_embedder_features.h
new file mode 100644
index 0000000000..85028443f7
--- /dev/null
+++ b/chromium-next/patches/patch-mojo_core_embedder_features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- mojo/core/embedder/features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ mojo/core/embedder/features.h
+@@ -16,7 +16,7 @@ namespace core {
+
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && \
+ !BUILDFLAG(MOJO_USE_APPLE_CHANNEL)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(MOJO_CORE_EMBEDDER_FEATURES)
+ BASE_DECLARE_FEATURE(kMojoLinuxChannelSharedMem);
+
diff --git a/chromium-next/patches/patch-mojo_public_cpp_platform_socket__utils__posix.cc b/chromium-next/patches/patch-mojo_public_cpp_platform_socket__utils__posix.cc
new file mode 100644
index 0000000000..9704eac916
--- /dev/null
+++ b/chromium-next/patches/patch-mojo_public_cpp_platform_socket__utils__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- mojo/public/cpp/platform/socket_utils_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ mojo/public/cpp/platform/socket_utils_posix.cc
+@@ -34,7 +34,7 @@ bool IsRecoverableError() {
+ }
+
+ bool GetPeerEuid(base::PlatformFile fd, uid_t* peer_euid) {
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
+ uid_t socket_euid;
+ gid_t socket_gid;
+ if (getpeereid(fd, &socket_euid, &socket_gid) < 0) {
diff --git a/chromium-next/patches/patch-mojo_public_tools_bindings_mojom.gni b/chromium-next/patches/patch-mojo_public_tools_bindings_mojom.gni
new file mode 100644
index 0000000000..7ea639b6b9
--- /dev/null
+++ b/chromium-next/patches/patch-mojo_public_tools_bindings_mojom.gni
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- mojo/public/tools/bindings/mojom.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ mojo/public/tools/bindings/mojom.gni
+@@ -791,6 +791,21 @@ template("mojom") {
+ enabled_features += [ "is_apple" ]
+ }
+
++ if (is_openbsd) {
++ enabled_features += [ "is_openbsd" ]
++ enabled_features += [ "is_bsd" ]
++ }
++
++ if (is_netbsd) {
++ enabled_features += [ "is_netbsd" ]
++ enabled_features += [ "is_bsd" ]
++ }
++
++ if (is_freebsd) {
++ enabled_features += [ "is_freebsd" ]
++ enabled_features += [ "is_bsd" ]
++ }
++
+ action(parser_target_name) {
+ allow_remote = true
+
diff --git a/chromium-next/patches/patch-net_BUILD.gn b/chromium-next/patches/patch-net_BUILD.gn
new file mode 100644
index 0000000000..052e487654
--- /dev/null
+++ b/chromium-next/patches/patch-net_BUILD.gn
@@ -0,0 +1,101 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/BUILD.gn
+@@ -126,7 +126,7 @@ net_configs = [
+ "//build/config/compiler:wexit_time_destructors",
+ ]
+
+-if (is_linux || is_chromeos) {
++if ((is_linux || is_chromeos) && !is_bsd) {
+ net_configs += [ "//build/config/linux:libresolv" ]
+ }
+
+@@ -1293,6 +1293,19 @@ component("net") {
+ ]
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "base/address_map_cache_linux.cc",
++ "base/address_map_cache_linux.h",
++ "base/address_map_linux.cc",
++ "base/address_map_linux.h",
++ "base/address_tracker_linux.cc",
++ "base/address_tracker_linux.h",
++ "base/network_change_notifier_linux.cc",
++ "base/network_interfaces_linux.cc",
++ ]
++ }
++
+ if (is_mac) {
+ sources += [
+ "base/network_notification_thread_mac.cc",
+@@ -1456,7 +1469,7 @@ component("net") {
+ }
+
+ # Use getifaddrs() on POSIX platforms, except Linux.
+- if (is_posix && !is_linux && !is_chromeos) {
++ if ((is_posix && !is_linux && !is_chromeos) || is_bsd) {
+ sources += [
+ "base/network_interfaces_getifaddrs.cc",
+ "base/network_interfaces_getifaddrs.h",
+@@ -2138,7 +2151,7 @@ static_library("test_support") {
+ ]
+ }
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux || is_chromeos || is_android) && !is_bsd) {
+ sources += [
+ "base/address_tracker_linux_test_util.cc",
+ "base/address_tracker_linux_test_util.h",
+@@ -2948,14 +2961,14 @@ target(_test_target_type, "net_unittests
+ ]
+ }
+
+- if (is_linux) {
++ if (is_linux && !is_bsd) {
+ sources += [
+ "base/network_change_notifier_linux_unittest.cc",
+ "proxy_resolution/proxy_config_service_linux_unittest.cc",
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "base/address_tracker_linux_unittest.cc",
+ "base/network_interfaces_linux_unittest.cc",
+@@ -3048,6 +3061,10 @@ target(_test_target_type, "net_unittests
+ ]
+ }
+
++ if (is_bsd) {
++ deps += [ "//sandbox/policy" ]
++ }
++
+ if (enable_websockets) {
+ sources += [
+ "server/http_connection_unittest.cc",
+@@ -3114,7 +3131,7 @@ target(_test_target_type, "net_unittests
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "tools/quic/quic_simple_server_test.cc" ]
+ }
+
+@@ -3253,7 +3270,7 @@ target(_test_target_type, "net_unittests
+ }
+
+ # Use getifaddrs() on POSIX platforms, except Linux.
+- if (is_posix && !is_linux && !is_chromeos) {
++ if (is_posix && !is_linux && !is_chromeos && !is_bsd) {
+ sources += [ "base/network_interfaces_getifaddrs_unittest.cc" ]
+ }
+
diff --git a/chromium-next/patches/patch-net_base_features.cc b/chromium-next/patches/patch-net_base_features.cc
new file mode 100644
index 0000000000..8e4cc78f82
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_features.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/features.cc
+@@ -26,7 +26,7 @@ BASE_FEATURE(kCapReferrerToOriginOnCross
+ BASE_FEATURE(kAsyncDns,
+ "AsyncDns",
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -528,7 +528,12 @@ BASE_FEATURE(kSpdyHeadersToHttpResponseU
+ "SpdyHeadersToHttpResponseUseBuilder",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
++#if BUILDFLAG(IS_OPENBSD)
++// No IP_RECVTOS support
+ BASE_FEATURE(kReportEcn, "ReportEcn", base::FEATURE_DISABLED_BY_DEFAULT);
++#else
++BASE_FEATURE(kReportEcn, "ReportEcn", base::FEATURE_DISABLED_BY_DEFAULT);
++#endif
+
+ BASE_FEATURE(kUseNewAlpsCodepointHttp2,
+ "UseNewAlpsCodepointHttp2",
diff --git a/chromium-next/patches/patch-net_base_mock__network__change__notifier.cc b/chromium-next/patches/patch-net_base_mock__network__change__notifier.cc
new file mode 100644
index 0000000000..efc275996e
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_mock__network__change__notifier.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/mock_network_change_notifier.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/mock_network_change_notifier.cc
+@@ -103,7 +103,7 @@ MockNetworkChangeNotifier::GetCurrentCon
+ return connection_cost_;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ AddressMapOwnerLinux* MockNetworkChangeNotifier::GetAddressMapOwnerInternal() {
+ return address_map_owner_;
+ }
diff --git a/chromium-next/patches/patch-net_base_mock__network__change__notifier.h b/chromium-next/patches/patch-net_base_mock__network__change__notifier.h
new file mode 100644
index 0000000000..67eb6eeab7
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_mock__network__change__notifier.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/mock_network_change_notifier.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/mock_network_change_notifier.h
+@@ -84,7 +84,7 @@ class MockNetworkChangeNotifier : public
+ // use_default_connection_cost_implementation is set to true.
+ ConnectionCost GetCurrentConnectionCost() override;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SetAddressMapOwnerLinux(AddressMapOwnerLinux* address_map_owner) {
+ address_map_owner_ = address_map_owner;
+ }
+@@ -104,7 +104,7 @@ class MockNetworkChangeNotifier : public
+ bool use_default_connection_cost_implementation_ = false;
+ NetworkChangeNotifier::NetworkList connected_networks_;
+ std::unique_ptr<SystemDnsConfigChangeNotifier> dns_config_notifier_;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ raw_ptr<AddressMapOwnerLinux> address_map_owner_ = nullptr;
+ #endif
+ };
diff --git a/chromium-next/patches/patch-net_base_network__change__notifier.cc b/chromium-next/patches/patch-net_base_network__change__notifier.cc
new file mode 100644
index 0000000000..56fc5ca6b5
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_network__change__notifier.cc
@@ -0,0 +1,45 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/network_change_notifier.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/network_change_notifier.cc
+@@ -37,7 +37,7 @@
+ #include "net/base/network_change_notifier_linux.h"
+ #elif BUILDFLAG(IS_APPLE)
+ #include "net/base/network_change_notifier_apple.h"
+-#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "net/base/network_change_notifier_passive.h"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include "net/base/network_change_notifier_fuchsia.h"
+@@ -324,6 +324,9 @@ std::unique_ptr<NetworkChangeNotifier> N
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return std::make_unique<NetworkChangeNotifierFuchsia>(
+ /*require_wlan=*/false);
++#elif BUILDFLAG(IS_BSD)
++ return std::make_unique<MockNetworkChangeNotifier>(
++ /*dns_config_notifier*/nullptr);
+ #else
+ NOTIMPLEMENTED();
+ return nullptr;
+@@ -520,7 +523,7 @@ base::cstring_view NetworkChangeNotifier
+ return kConnectionTypeNames[type];
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ AddressMapOwnerLinux* NetworkChangeNotifier::GetAddressMapOwner() {
+ return g_network_change_notifier
+@@ -866,7 +869,7 @@ NetworkChangeNotifier::NetworkChangeNoti
+ }
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ AddressMapOwnerLinux* NetworkChangeNotifier::GetAddressMapOwnerInternal() {
+ return nullptr;
+ }
diff --git a/chromium-next/patches/patch-net_base_network__change__notifier.h b/chromium-next/patches/patch-net_base_network__change__notifier.h
new file mode 100644
index 0000000000..d4408ef682
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_network__change__notifier.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/network_change_notifier.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/network_change_notifier.h
+@@ -19,7 +19,7 @@
+ #include "net/base/net_export.h"
+ #include "net/base/network_handle.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "net/base/address_map_linux.h"
+ #endif
+
+@@ -460,7 +460,7 @@ class NET_EXPORT NetworkChangeNotifier {
+ // packets sent lazily.
+ static bool IsDefaultNetworkActive();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Returns the AddressTrackerLinux if present.
+ static AddressMapOwnerLinux* GetAddressMapOwner();
+ #endif
+@@ -630,7 +630,7 @@ class NET_EXPORT NetworkChangeNotifier {
+ SystemDnsConfigChangeNotifier* system_dns_config_notifier = nullptr,
+ bool omit_observers_in_constructor_for_testing = false);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Returns the AddressMapOwnerLinux if present.
+ virtual AddressMapOwnerLinux* GetAddressMapOwnerInternal();
+ #endif
diff --git a/chromium-next/patches/patch-net_base_network__change__notifier__passive.cc b/chromium-next/patches/patch-net_base_network__change__notifier__passive.cc
new file mode 100644
index 0000000000..4cfc5745be
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_network__change__notifier__passive.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/network_change_notifier_passive.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/network_change_notifier_passive.cc
+@@ -107,7 +107,7 @@ NetworkChangeNotifierPassive::GetAddress
+ NetworkChangeNotifier::NetworkChangeCalculatorParams
+ NetworkChangeNotifierPassive::NetworkChangeCalculatorParamsPassive() {
+ NetworkChangeCalculatorParams params;
+-#if BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Delay values arrived at by simple experimentation and adjusted so as to
+ // produce a single signal when switching between network connections.
+ params.ip_address_offline_delay_ = base::Milliseconds(4000);
diff --git a/chromium-next/patches/patch-net_base_network__interfaces__posix.h b/chromium-next/patches/patch-net_base_network__interfaces__posix.h
new file mode 100644
index 0000000000..1289608a4b
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_network__interfaces__posix.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/network_interfaces_posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/network_interfaces_posix.h
+@@ -8,6 +8,8 @@
+ // This file provides some basic functionality shared between
+ // network_interfaces_linux.cc and network_interfaces_getifaddrs.cc.
+
++#include <sys/socket.h>
++
+ #include <string>
+
+ struct sockaddr;
diff --git a/chromium-next/patches/patch-net_base_sockaddr__util__posix.cc b/chromium-next/patches/patch-net_base_sockaddr__util__posix.cc
new file mode 100644
index 0000000000..26a10d1a1b
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_sockaddr__util__posix.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/sockaddr_util_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/sockaddr_util_posix.cc
+@@ -46,7 +46,8 @@ bool FillUnixAddress(const std::string&
+ return true;
+ }
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
++ // XXX ?
+ // Convert the path given into abstract socket name. It must start with
+ // the '\0' character, so we are adding it. |addr_len| must specify the
+ // length of the structure exactly, as potentially the socket name may
diff --git a/chromium-next/patches/patch-net_base_sockaddr__util__posix__unittest.cc b/chromium-next/patches/patch-net_base_sockaddr__util__posix__unittest.cc
new file mode 100644
index 0000000000..edd7592169
--- /dev/null
+++ b/chromium-next/patches/patch-net_base_sockaddr__util__posix__unittest.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/base/sockaddr_util_posix_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/base/sockaddr_util_posix_unittest.cc
+@@ -88,7 +88,8 @@ TEST(FillUnixAddressTest, AbstractLinuxA
+ size_t path_max = MaxPathLength(&storage);
+ std::string path(path_max, '0');
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
++ // XXX?
+ EXPECT_TRUE(FillUnixAddress(path, /*use_abstract_namespace=*/true, &storage));
+
+ EXPECT_EQ(path.size() + 1U + offsetof(struct sockaddr_un, sun_path),
diff --git a/chromium-next/patches/patch-net_cert_cert__verify__proc.h b/chromium-next/patches/patch-net_cert_cert__verify__proc.h
new file mode 100644
index 0000000000..3ec22de930
--- /dev/null
+++ b/chromium-next/patches/patch-net_cert_cert__verify__proc.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/cert/cert_verify_proc.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/cert/cert_verify_proc.h
+@@ -186,7 +186,7 @@ class NET_EXPORT CertVerifyProc
+ kMaxValue = kChainLengthOne
+ };
+
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY))
+ // Creates and returns a CertVerifyProc that uses the system verifier.
+ // |cert_net_fetcher| may not be used, depending on the implementation.
diff --git a/chromium-next/patches/patch-net_disk__cache_backend__experiment.h b/chromium-next/patches/patch-net_disk__cache_backend__experiment.h
new file mode 100644
index 0000000000..9488e9c681
--- /dev/null
+++ b/chromium-next/patches/patch-net_disk__cache_backend__experiment.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/disk_cache/backend_experiment.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/disk_cache/backend_experiment.h
+@@ -14,7 +14,7 @@ namespace disk_cache {
+ // default.
+ constexpr bool IsSimpleBackendEnabledByDefaultPlatform() {
+ return BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) ||
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC);
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD);
+ }
+
+ // True if assigned to any of disk cache backend experiment groups.
diff --git a/chromium-next/patches/patch-net_disk__cache_simple_simple__file__tracker.cc b/chromium-next/patches/patch-net_disk__cache_simple_simple__file__tracker.cc
new file mode 100644
index 0000000000..43b0fe8e36
--- /dev/null
+++ b/chromium-next/patches/patch-net_disk__cache_simple_simple__file__tracker.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/disk_cache/simple/simple_file_tracker.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/disk_cache/simple/simple_file_tracker.cc
+@@ -35,7 +35,17 @@ void RecordFileDescripterLimiterOp(FileD
+ } // namespace
+
+ SimpleFileTracker::SimpleFileTracker(int file_limit)
++#if defined(OS_OPENBSD)
++{
++ // cap the file descriptor limit at 85% of the size of the
++ // file descriptor table and also substract the amount of
++ // currently used file descriptors as this should give us
++ // enough reserve to avoid hitting the limit
++ file_limit_ = (getdtablesize() * 0.85) - getdtablecount();
++}
++#else
+ : file_limit_(file_limit) {}
++#endif
+
+ SimpleFileTracker::~SimpleFileTracker() {
+ DCHECK(lru_.empty());
diff --git a/chromium-next/patches/patch-net_dns_BUILD.gn b/chromium-next/patches/patch-net_dns_BUILD.gn
new file mode 100644
index 0000000000..48216acd35
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_BUILD.gn
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/BUILD.gn
+@@ -138,7 +138,7 @@ source_set("dns") {
+ "dns_config_service_android.cc",
+ "dns_config_service_android.h",
+ ]
+- } else if (is_linux) {
++ } else if (is_linux && !is_bsd) {
+ sources += [
+ "dns_config_service_linux.cc",
+ "dns_config_service_linux.h",
+@@ -171,7 +171,10 @@ source_set("dns") {
+ ]
+ }
+
+- deps = [ "//net:net_deps" ]
++ deps = [
++ "//net:net_deps",
++ "///services/screen_ai/buildflags",
++ ]
+
+ public_deps = [
+ ":dns_client",
+@@ -179,6 +182,7 @@ source_set("dns") {
+ ":host_resolver_manager",
+ ":mdns_client",
+ "//net:net_public_deps",
++ "//printing/buildflags",
+ ]
+
+ allow_circular_includes_from = [
+@@ -447,9 +451,9 @@ source_set("tests") {
+
+ if (is_android) {
+ sources += [ "dns_config_service_android_unittest.cc" ]
+- } else if (is_linux) {
++ } else if (is_linux && !is_bsd) {
+ sources += [ "dns_config_service_linux_unittest.cc" ]
+- } else if (is_posix) {
++ } else if (is_posix && !is_bsd) {
+ sources += [ "dns_config_service_posix_unittest.cc" ]
+ }
+
diff --git a/chromium-next/patches/patch-net_dns_address__info.cc b/chromium-next/patches/patch-net_dns_address__info.cc
new file mode 100644
index 0000000000..0091ce4d23
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_address__info.cc
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/address_info.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/address_info.cc
+@@ -83,8 +83,12 @@ AddressInfo::AddressInfoAndResult Addres
+ // error.
+ // http://crbug.com/134142
+ err = ERR_NAME_NOT_RESOLVED;
+-#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_FREEBSD)
++#elif BUILDFLAG(IS_POSIX)
++#ifdef EAI_NODATA
+ if (os_error != EAI_NONAME && os_error != EAI_NODATA)
++#else
++ if (os_error != EAI_NONAME)
++#endif
+ err = ERR_NAME_RESOLUTION_FAILED;
+ #endif
+
diff --git a/chromium-next/patches/patch-net_dns_address__sorter__posix.cc b/chromium-next/patches/patch-net_dns_address__sorter__posix.cc
new file mode 100644
index 0000000000..8a71507d2e
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_address__sorter__posix.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/address_sorter_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/address_sorter_posix.cc
+@@ -32,6 +32,7 @@
+ #include "net/dns/netinet_in_var_ios.h"
+ #else
+ #include <netinet/in_var.h>
++#include <netinet6/in6_var.h>
+ #endif // BUILDFLAG(IS_IOS)
+ #endif
+ #include <vector>
diff --git a/chromium-next/patches/patch-net_dns_dns__config__service__posix.cc b/chromium-next/patches/patch-net_dns_dns__config__service__posix.cc
new file mode 100644
index 0000000000..7cbc1f0b0b
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_dns__config__service__posix.cc
@@ -0,0 +1,32 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/dns_config_service_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/dns_config_service_posix.cc
+@@ -39,6 +39,11 @@
+ #include "net/dns/dns_config_watcher_mac.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include "base/command_line.h"
++#include "sandbox/policy/switches.h"
++#endif
++
+ namespace net {
+
+ namespace internal {
+@@ -136,6 +141,11 @@ class DnsConfigServicePosix::Watcher : p
+ bool Watch() override {
+ CheckOnCorrectSequence();
+
++// pledge + unveil
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (!command_line->HasSwitch(sandbox::policy::switches::kNoSandbox))
++ return false;
++
+ bool success = true;
+ if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
+ base::Unretained(this)))) {
diff --git a/chromium-next/patches/patch-net_dns_dns__reloader.cc b/chromium-next/patches/patch-net_dns_dns__reloader.cc
new file mode 100644
index 0000000000..b523cd241a
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_dns__reloader.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/dns_reloader.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/dns_reloader.cc
+@@ -10,6 +10,7 @@
+ // - there's not guarantee it exists at all. :(
+ #if BUILDFLAG(IS_POSIX)
+
++#include <netinet/in.h>
+ #include <resolv.h>
+
+ // This code only works on systems where the C library provides res_ninit(3) and
+@@ -31,7 +32,7 @@
+ // an old musl bug that was fixed by musl c8fdcfe5, but Fuchsia's SDK doesn't
+ // have that change.
+ #if defined(__RES) && __RES >= 19991006 && !BUILDFLAG(IS_APPLE) && \
+- !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_NETBSD)
+ // We define this so we don't need to restate the complex condition here twice
+ // below - it would be easy for the copies below to get out of sync.
+ #define USE_RES_NINIT
diff --git a/chromium-next/patches/patch-net_dns_dns__util.cc b/chromium-next/patches/patch-net_dns_dns__util.cc
new file mode 100644
index 0000000000..bf1f64c048
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_dns__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/dns_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/dns_util.cc
+@@ -29,6 +29,8 @@
+ #include "net/dns/public/util.h"
+ #include "net/third_party/uri_template/uri_template.h"
+
++#include <sys/socket.h>
++
+ #if BUILDFLAG(IS_POSIX)
+ #include <net/if.h>
+ #include <netinet/in.h>
diff --git a/chromium-next/patches/patch-net_dns_host__resolver__proc.cc b/chromium-next/patches/patch-net_dns_host__resolver__proc.cc
new file mode 100644
index 0000000000..fb2c75301a
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_host__resolver__proc.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/host_resolver_proc.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/host_resolver_proc.cc
+@@ -15,10 +15,6 @@
+ #include "net/base/net_errors.h"
+ #include "net/dns/host_resolver_system_task.h"
+
+-#if BUILDFLAG(IS_OPENBSD)
+-#define AI_ADDRCONFIG 0
+-#endif
+-
+ namespace net {
+
+ HostResolverProc* HostResolverProc::default_proc_ = nullptr;
diff --git a/chromium-next/patches/patch-net_dns_public_BUILD.gn b/chromium-next/patches/patch-net_dns_public_BUILD.gn
new file mode 100644
index 0000000000..9295feb132
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_public_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/public/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/public/BUILD.gn
+@@ -78,7 +78,7 @@ source_set("tests") {
+ "doh_provider_entry_unittest.cc",
+ ]
+
+- if (is_posix && !is_android) {
++ if (is_posix && !is_android && !is_bsd) {
+ sources += [ "resolv_reader_unittest.cc" ]
+ }
+
diff --git a/chromium-next/patches/patch-net_dns_public_resolv__reader.cc b/chromium-next/patches/patch-net_dns_public_resolv__reader.cc
new file mode 100644
index 0000000000..c84ff685b2
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_public_resolv__reader.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/public/resolv_reader.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/public/resolv_reader.cc
+@@ -40,7 +40,7 @@ std::optional<std::vector<IPEndPoint>> G
+ if (!(res.options & RES_INIT))
+ return std::nullopt;
+
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
+ union res_sockaddr_union addresses[MAXNS];
+ int nscount = res_getservers(const_cast<res_state>(&res), addresses, MAXNS);
+ DCHECK_GE(nscount, 0);
diff --git a/chromium-next/patches/patch-net_dns_public_resolv__reader.h b/chromium-next/patches/patch-net_dns_public_resolv__reader.h
new file mode 100644
index 0000000000..1ed7929ecc
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_public_resolv__reader.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/public/resolv_reader.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/public/resolv_reader.h
+@@ -5,6 +5,7 @@
+ #ifndef NET_DNS_PUBLIC_RESOLV_READER_H_
+ #define NET_DNS_PUBLIC_RESOLV_READER_H_
+
++#include <netinet/in.h>
+ #include <resolv.h>
+
+ #include <memory>
diff --git a/chromium-next/patches/patch-net_dns_public_scoped__res__state.cc b/chromium-next/patches/patch-net_dns_public_scoped__res__state.cc
new file mode 100644
index 0000000000..995471fbda
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_public_scoped__res__state.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/public/scoped_res_state.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/public/scoped_res_state.cc
+@@ -28,7 +28,7 @@ ScopedResState::~ScopedResState() {
+ #if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
+
+ // Prefer res_ndestroy where available.
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
+ res_ndestroy(&res_);
+ #else
+ res_nclose(&res_);
diff --git a/chromium-next/patches/patch-net_dns_public_scoped__res__state.h b/chromium-next/patches/patch-net_dns_public_scoped__res__state.h
new file mode 100644
index 0000000000..9c5e88fa26
--- /dev/null
+++ b/chromium-next/patches/patch-net_dns_public_scoped__res__state.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/dns/public/scoped_res_state.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/dns/public/scoped_res_state.h
+@@ -5,6 +5,7 @@
+ #ifndef NET_DNS_PUBLIC_SCOPED_RES_STATE_H_
+ #define NET_DNS_PUBLIC_SCOPED_RES_STATE_H_
+
++#include <netinet/in.h>
+ #include <resolv.h>
+
+ #include <optional>
diff --git a/chromium-next/patches/patch-net_filter_zstd__source__stream.cc b/chromium-next/patches/patch-net_filter_zstd__source__stream.cc
new file mode 100644
index 0000000000..68f57d347e
--- /dev/null
+++ b/chromium-next/patches/patch-net_filter_zstd__source__stream.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/filter/zstd_source_stream.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/filter/zstd_source_stream.cc
+@@ -7,6 +7,7 @@
+ #include <algorithm>
+ #include <unordered_map>
+ #include <utility>
++#include <unordered_map>
+
+ #define ZSTD_STATIC_LINKING_ONLY
+
diff --git a/chromium-next/patches/patch-net_http_http__auth__gssapi__posix.cc b/chromium-next/patches/patch-net_http_http__auth__gssapi__posix.cc
new file mode 100644
index 0000000000..573ab49c2e
--- /dev/null
+++ b/chromium-next/patches/patch-net_http_http__auth__gssapi__posix.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/http/http_auth_gssapi_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/http/http_auth_gssapi_posix.cc
+@@ -375,8 +375,9 @@ base::NativeLibrary GSSAPISharedLibrary:
+ static const char* const kDefaultLibraryNames[] = {
+ #if BUILDFLAG(IS_APPLE)
+ "/System/Library/Frameworks/GSS.framework/GSS"
+-#elif BUILDFLAG(IS_OPENBSD)
+- "libgssapi.so" // Heimdal - OpenBSD
++#elif BUILDFLAG(IS_BSD)
++ "libgssapi_krb5.so.2", // MIT Kerberos - FreeBSD
++ "libgssapi.so" // Heimdal - OpenBSD, FreeBSD
+ #else
+ "libgssapi_krb5.so.2", // MIT Kerberos - FC, Suse10, Debian
+ "libgssapi.so.4", // Heimdal - Suse10, MDK
diff --git a/chromium-next/patches/patch-net_http_http__auth__gssapi__posix.h b/chromium-next/patches/patch-net_http_http__auth__gssapi__posix.h
new file mode 100644
index 0000000000..11e2a66066
--- /dev/null
+++ b/chromium-next/patches/patch-net_http_http__auth__gssapi__posix.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/http/http_auth_gssapi_posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/http/http_auth_gssapi_posix.h
+@@ -21,6 +21,9 @@
+ #if BUILDFLAG(IS_APPLE)
+ #include <GSS/gssapi.h>
+ #elif BUILDFLAG(IS_FREEBSD)
++#ifndef GSS_C_DELEG_POLICY_FLAG
++#define GSS_C_DELEG_POLICY_FLAG 32768
++#endif
+ #include <gssapi/gssapi.h>
+ #else
+ #include <gssapi.h>
diff --git a/chromium-next/patches/patch-net_http_http__auth__handler__negotiate.cc b/chromium-next/patches/patch-net_http_http__auth__handler__negotiate.cc
new file mode 100644
index 0000000000..767c59aa68
--- /dev/null
+++ b/chromium-next/patches/patch-net_http_http__auth__handler__negotiate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/http/http_auth_handler_negotiate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/http/http_auth_handler_negotiate.cc
+@@ -120,7 +120,7 @@ int HttpAuthHandlerNegotiate::Factory::C
+ #elif BUILDFLAG(IS_POSIX)
+ if (is_unsupported_)
+ return ERR_UNSUPPORTED_AUTH_SCHEME;
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Note: Don't set is_unsupported_ = true here. AllowGssapiLibraryLoad()
+ // might change to true during a session.
+ if (!http_auth_preferences() ||
diff --git a/chromium-next/patches/patch-net_http_http__auth__preferences.cc b/chromium-next/patches/patch-net_http_http__auth__preferences.cc
new file mode 100644
index 0000000000..5c41ef482b
--- /dev/null
+++ b/chromium-next/patches/patch-net_http_http__auth__preferences.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/http/http_auth_preferences.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/http/http_auth_preferences.cc
+@@ -39,7 +39,7 @@ std::string HttpAuthPreferences::AuthAnd
+ }
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool HttpAuthPreferences::AllowGssapiLibraryLoad() const {
+ return allow_gssapi_library_load_;
+ }
diff --git a/chromium-next/patches/patch-net_http_http__auth__preferences.h b/chromium-next/patches/patch-net_http_http__auth__preferences.h
new file mode 100644
index 0000000000..d0a599b783
--- /dev/null
+++ b/chromium-next/patches/patch-net_http_http__auth__preferences.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/http/http_auth_preferences.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/http/http_auth_preferences.h
+@@ -50,7 +50,7 @@ class NET_EXPORT HttpAuthPreferences {
+ #if BUILDFLAG(IS_ANDROID)
+ virtual std::string AuthAndroidNegotiateAccountType() const;
+ #endif
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ virtual bool AllowGssapiLibraryLoad() const;
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+ virtual bool CanUseDefaultCredentials(
+@@ -86,7 +86,7 @@ class NET_EXPORT HttpAuthPreferences {
+ }
+ #endif // BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void set_allow_gssapi_library_load(bool allow_gssapi_library_load) {
+ allow_gssapi_library_load_ = allow_gssapi_library_load;
+ }
+@@ -137,7 +137,7 @@ class NET_EXPORT HttpAuthPreferences {
+ std::string auth_android_negotiate_account_type_;
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool allow_gssapi_library_load_ = true;
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-net_http_http__network__session.cc b/chromium-next/patches/patch-net_http_http__network__session.cc
new file mode 100644
index 0000000000..00fac52b05
--- /dev/null
+++ b/chromium-next/patches/patch-net_http_http__network__session.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/http/http_network_session.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/http/http_network_session.cc
+@@ -20,7 +20,9 @@
+ #include "build/build_config.h"
+ #include "net/base/features.h"
+ #include "net/dns/host_resolver.h"
++#if defined(USE_KERBEROS)
+ #include "net/http/http_auth_handler_factory.h"
++#endif
+ #include "net/http/http_response_body_drainer.h"
+ #include "net/http/http_stream_factory.h"
+ #include "net/http/http_stream_pool.h"
diff --git a/chromium-next/patches/patch-net_proxy__resolution_proxy__config__service.cc b/chromium-next/patches/patch-net_proxy__resolution_proxy__config__service.cc
new file mode 100644
index 0000000000..802ff8cd1c
--- /dev/null
+++ b/chromium-next/patches/patch-net_proxy__resolution_proxy__config__service.cc
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/proxy_resolution/proxy_config_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/proxy_resolution/proxy_config_service.cc
+@@ -19,20 +19,20 @@
+ #include "net/proxy_resolution/proxy_config_service_ios.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "net/proxy_resolution/proxy_config_service_mac.h"
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "net/proxy_resolution/proxy_config_service_linux.h"
+ #elif BUILDFLAG(IS_ANDROID)
+ #include "net/proxy_resolution/proxy_config_service_android.h"
+ #endif
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "net/traffic_annotation/network_traffic_annotation.h"
+ #endif
+
+ namespace net {
+
+ namespace {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr net::NetworkTrafficAnnotationTag kSystemProxyConfigTrafficAnnotation =
+ net::DefineNetworkTrafficAnnotation("proxy_config_system", R"(
+ semantics {
+@@ -108,7 +108,7 @@ ProxyConfigService::CreateSystemProxyCon
+ << "profile_io_data.cc::CreateProxyConfigService and this should "
+ << "be used only for examples.";
+ return std::make_unique<UnsetProxyConfigService>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<ProxyConfigServiceLinux> linux_config_service(
+ std::make_unique<ProxyConfigServiceLinux>());
+
diff --git a/chromium-next/patches/patch-net_proxy__resolution_proxy__config__service__linux.cc b/chromium-next/patches/patch-net_proxy__resolution_proxy__config__service__linux.cc
new file mode 100644
index 0000000000..2f84cd5491
--- /dev/null
+++ b/chromium-next/patches/patch-net_proxy__resolution_proxy__config__service__linux.cc
@@ -0,0 +1,46 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/proxy_resolution/proxy_config_service_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/proxy_resolution/proxy_config_service_linux.cc
+@@ -11,7 +11,9 @@
+
+ #include <errno.h>
+ #include <limits.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/inotify.h>
++#endif
+ #include <unistd.h>
+
+ #include <map>
+@@ -510,6 +512,7 @@ bool SettingGetterImplGSettings::CheckVe
+ }
+ #endif // defined(USE_GIO)
+
++#if !BUILDFLAG(IS_BSD)
+ // Converts |value| from a decimal string to an int. If there was a failure
+ // parsing, returns |default_value|.
+ int StringToIntOrDefault(std::string_view value, int default_value) {
+@@ -1038,6 +1041,7 @@ class SettingGetterImplKDE : public Prox
+ // events on.
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
+ };
++#endif
+
+ } // namespace
+
+@@ -1256,9 +1260,11 @@ ProxyConfigServiceLinux::Delegate::Deleg
+ case base::nix::DESKTOP_ENVIRONMENT_KDE4:
+ case base::nix::DESKTOP_ENVIRONMENT_KDE5:
+ case base::nix::DESKTOP_ENVIRONMENT_KDE6:
++#if !BUILDFLAG(IS_BSD)
+ setting_getter_ =
+ std::make_unique<SettingGetterImplKDE>(env_var_getter_.get());
+ break;
++#endif
+ case base::nix::DESKTOP_ENVIRONMENT_XFCE:
+ case base::nix::DESKTOP_ENVIRONMENT_LXQT:
+ case base::nix::DESKTOP_ENVIRONMENT_OTHER:
diff --git a/chromium-next/patches/patch-net_socket_socket__posix.cc b/chromium-next/patches/patch-net_socket_socket__posix.cc
new file mode 100644
index 0000000000..ad18793304
--- /dev/null
+++ b/chromium-next/patches/patch-net_socket_socket__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/socket/socket_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/socket/socket_posix.cc
+@@ -516,7 +516,7 @@ void SocketPosix::ReadCompleted() {
+ }
+
+ int SocketPosix::DoWrite(IOBuffer* buf, int buf_len) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Disable SIGPIPE for this write. Although Chromium globally disables
+ // SIGPIPE, the net stack may be used in other consumers which do not do
+ // this. MSG_NOSIGNAL is a Linux-only API. On OS X, this is a setsockopt on
diff --git a/chromium-next/patches/patch-net_socket_socks5__client__socket.cc b/chromium-next/patches/patch-net_socket_socks5__client__socket.cc
new file mode 100644
index 0000000000..2d45d79169
--- /dev/null
+++ b/chromium-next/patches/patch-net_socket_socks5__client__socket.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/socket/socks5_client_socket.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/socket/socks5_client_socket.cc
+@@ -24,6 +24,9 @@
+ #include "net/log/net_log_event_type.h"
+ #include "net/traffic_annotation/network_traffic_annotation.h"
+
++#include <sys/types.h>
++#include <netinet/in.h>
++
+ namespace net {
+
+ const unsigned int SOCKS5ClientSocket::kGreetReadHeaderSize = 2;
diff --git a/chromium-next/patches/patch-net_socket_tcp__socket__posix.cc b/chromium-next/patches/patch-net_socket_tcp__socket__posix.cc
new file mode 100644
index 0000000000..3994b2fbcd
--- /dev/null
+++ b/chromium-next/patches/patch-net_socket_tcp__socket__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/socket/tcp_socket_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/socket/tcp_socket_posix.cc
+@@ -98,6 +98,17 @@ bool SetTCPKeepAlive(int fd, bool enable
+ PLOG(ERROR) << "Failed to set TCP_KEEPALIVE on fd: " << fd;
+ return false;
+ }
++#elif BUILDFLAG(IS_FREEBSD)
++ // Set seconds until first TCP keep alive.
++ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) {
++ PLOG(ERROR) << "Failed to set TCP_KEEPIDLE on fd: " << fd;
++ return false;
++ }
++ // Set seconds between TCP keep alives.
++ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &delay, sizeof(delay))) {
++ PLOG(ERROR) << "Failed to set TCP_KEEPINTVL on fd: " << fd;
++ return false;
++ }
+ #endif
+ }
+
diff --git a/chromium-next/patches/patch-net_socket_udp__socket__posix.cc b/chromium-next/patches/patch-net_socket_udp__socket__posix.cc
new file mode 100644
index 0000000000..c43c8fb6cb
--- /dev/null
+++ b/chromium-next/patches/patch-net_socket_udp__socket__posix.cc
@@ -0,0 +1,132 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/socket/udp_socket_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/socket/udp_socket_posix.cc
+@@ -78,6 +78,32 @@ constexpr int kBindRetries = 10;
+ constexpr int kPortStart = 1024;
+ constexpr int kPortEnd = 65535;
+
++#if BUILDFLAG(IS_NETBSD)
++int GetIPv4AddressFromIndex(int socket, uint32_t index, uint32_t* address) {
++ if (!index) {
++ *address = htonl(INADDR_ANY);
++ return OK;
++ }
++
++ sockaddr_in* result = nullptr;
++
++ ifreq ifr;
++ ifr.ifr_addr.sa_family = AF_INET;
++ if (!if_indextoname(index, ifr.ifr_name))
++ return MapSystemError(errno);
++ int rv = ioctl(socket, SIOCGIFADDR, &ifr);
++ if (rv == -1)
++ return MapSystemError(errno);
++ result = reinterpret_cast<sockaddr_in*>(&ifr.ifr_addr);
++
++ if (!result)
++ return ERR_ADDRESS_INVALID;
++
++ *address = result->sin_addr.s_addr;
++ return OK;
++}
++#endif
++
+ int GetSocketFDHash(int fd) {
+ return fd ^ 1595649551;
+ }
+@@ -522,12 +548,17 @@ int UDPSocketPosix::SetRecvTos() {
+ #endif // BUILDFLAG(IS_APPLE)
+ }
+
++#ifdef IP_RECVTOS
+ int rv = setsockopt(socket_, IPPROTO_IP, IP_RECVTOS, &ecn, sizeof(ecn));
++#else
++ int rv = -1;
++ errno = EOPNOTSUPP;
++#endif
+ return rv == 0 ? OK : MapSystemError(errno);
+ }
+
+ void UDPSocketPosix::SetMsgConfirm(bool confirm) {
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ if (confirm) {
+ sendto_flags_ |= MSG_CONFIRM;
+ } else {
+@@ -548,7 +579,7 @@ int UDPSocketPosix::SetBroadcast(bool br
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ int value = broadcast ? 1 : 0;
+ int rv;
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // SO_REUSEPORT on OSX permits multiple processes to each receive
+ // UDP multicast or broadcast datagrams destined for the bound
+ // port.
+@@ -849,9 +880,17 @@ int UDPSocketPosix::SetMulticastOptions(
+ if (multicast_interface_ != 0) {
+ switch (addr_family_) {
+ case AF_INET: {
++#if BUILDFLAG(IS_NETBSD)
++ ip_mreq mreq = {};
++ int error = GetIPv4AddressFromIndex(socket_, multicast_interface_,
++ &mreq.imr_interface.s_addr);
++ if (error != OK)
++ return error;
++#else
+ ip_mreqn mreq = {};
+ mreq.imr_ifindex = multicast_interface_;
+ mreq.imr_address.s_addr = htonl(INADDR_ANY);
++#endif
+ int rv = setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_IF,
+ reinterpret_cast<const char*>(&mreq), sizeof(mreq));
+ if (rv)
+@@ -885,7 +924,7 @@ int UDPSocketPosix::DoBind(const IPEndPo
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ if (last_error == EINVAL)
+ return ERR_ADDRESS_IN_USE;
+-#elif BUILDFLAG(IS_APPLE)
++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ if (last_error == EADDRNOTAVAIL)
+ return ERR_ADDRESS_IN_USE;
+ #endif
+@@ -913,9 +952,17 @@ int UDPSocketPosix::JoinGroup(const IPAd
+ case IPAddress::kIPv4AddressSize: {
+ if (addr_family_ != AF_INET)
+ return ERR_ADDRESS_INVALID;
++#if BUILDFLAG(IS_NETBSD)
++ ip_mreq mreq = {};
++ int error = GetIPv4AddressFromIndex(socket_, multicast_interface_,
++ &mreq.imr_interface.s_addr);
++ if (error != OK)
++ return error;
++#else
+ ip_mreqn mreq = {};
+ mreq.imr_ifindex = multicast_interface_;
+ mreq.imr_address.s_addr = htonl(INADDR_ANY);
++#endif
+ memcpy(&mreq.imr_multiaddr, group_address.bytes().data(),
+ IPAddress::kIPv4AddressSize);
+ int rv = setsockopt(socket_, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+@@ -952,9 +999,17 @@ int UDPSocketPosix::LeaveGroup(const IPA
+ case IPAddress::kIPv4AddressSize: {
+ if (addr_family_ != AF_INET)
+ return ERR_ADDRESS_INVALID;
++#if BUILDFLAG(IS_NETBSD)
++ ip_mreq mreq = {};
++ int error = GetIPv4AddressFromIndex(socket_, multicast_interface_,
++ &mreq.imr_interface.s_addr);
++ if (error != OK)
++ return error;
++#else
+ ip_mreqn mreq = {};
+ mreq.imr_ifindex = multicast_interface_;
+ mreq.imr_address.s_addr = INADDR_ANY;
++#endif
+ memcpy(&mreq.imr_multiaddr, group_address.bytes().data(),
+ IPAddress::kIPv4AddressSize);
+ int rv = setsockopt(socket_, IPPROTO_IP, IP_DROP_MEMBERSHIP,
diff --git a/chromium-next/patches/patch-net_socket_udp__socket__unittest.cc b/chromium-next/patches/patch-net_socket_udp__socket__unittest.cc
new file mode 100644
index 0000000000..811454ae32
--- /dev/null
+++ b/chromium-next/patches/patch-net_socket_udp__socket__unittest.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/socket/udp_socket_unittest.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/socket/udp_socket_unittest.cc
+@@ -372,7 +372,7 @@ TEST_F(UDPSocketTest, PartialRecv) {
+ EXPECT_EQ(second_packet, received);
+ }
+
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // - MacOS: requires root permissions on OSX 10.7+.
+ // - Android: devices attached to testbots don't have default network, so
+ // broadcasting to 255.255.255.255 returns error -109 (Address not reachable).
+@@ -683,7 +683,7 @@ TEST_F(UDPSocketTest, ClientSetDoNotFrag
+ EXPECT_THAT(rv, IsOk());
+
+ rv = client.SetDoNotFragment();
+-#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/42050633): IP_MTU_DISCOVER is not implemented on Fuchsia.
+ EXPECT_THAT(rv, IsError(ERR_NOT_IMPLEMENTED));
+ #else
+@@ -705,7 +705,7 @@ TEST_F(UDPSocketTest, ServerSetDoNotFrag
+ EXPECT_THAT(rv, IsOk());
+
+ rv = server.SetDoNotFragment();
+-#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/42050633): IP_MTU_DISCOVER is not implemented on Fuchsia.
+ EXPECT_THAT(rv, IsError(ERR_NOT_IMPLEMENTED));
+ #else
+@@ -764,7 +764,7 @@ TEST_F(UDPSocketTest, JoinMulticastGroup
+
+ // TODO(crbug.com/40620614): failing on device on iOS 12.2.
+ // TODO(crbug.com/40189274): flaky on Mac 11.
+-#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #define MAYBE_SharedMulticastAddress DISABLED_SharedMulticastAddress
+ #else
+ #define MAYBE_SharedMulticastAddress SharedMulticastAddress
+@@ -818,7 +818,7 @@ TEST_F(UDPSocketTest, MAYBE_SharedMultic
+ NetLogSource());
+ ASSERT_THAT(client_socket.Connect(send_address), IsOk());
+
+-#if !BUILDFLAG(IS_CHROMEOS_ASH)
++#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_BSD)
+ // Send a message via the multicast group. That message is expected be be
+ // received by both receving sockets.
+ //
diff --git a/chromium-next/patches/patch-net_third__party_quiche_BUILD.gn b/chromium-next/patches/patch-net_third__party_quiche_BUILD.gn
new file mode 100644
index 0000000000..96fad718ff
--- /dev/null
+++ b/chromium-next/patches/patch-net_third__party_quiche_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/third_party/quiche/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/third_party/quiche/BUILD.gn
+@@ -29,7 +29,7 @@ import("//net/third_party/quiche/src/bui
+ import("//testing/libfuzzer/fuzzer_test.gni")
+ import("//third_party/protobuf/proto_library.gni")
+
+-build_epoll_based_tools = is_linux || is_chromeos
++build_epoll_based_tools = (is_linux && !is_bsd) || is_chromeos
+
+ config("quiche_internal_config") {
+ cflags = []
diff --git a/chromium-next/patches/patch-net_tools_cert__verify__tool_cert__verify__tool.cc b/chromium-next/patches/patch-net_tools_cert__verify__tool_cert__verify__tool.cc
new file mode 100644
index 0000000000..2284811c7f
--- /dev/null
+++ b/chromium-next/patches/patch-net_tools_cert__verify__tool_cert__verify__tool.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/tools/cert_verify_tool/cert_verify_tool.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/tools/cert_verify_tool/cert_verify_tool.cc
+@@ -35,7 +35,7 @@
+ #include "third_party/boringssl/src/pki/trust_store.h"
+ #include "third_party/boringssl/src/pki/trust_store_collection.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "net/proxy_resolution/proxy_config.h"
+ #include "net/proxy_resolution/proxy_config_service_fixed.h"
+ #endif
+@@ -67,7 +67,7 @@ void SetUpOnNetworkThread(
+ base::WaitableEvent* initialization_complete_event) {
+ net::URLRequestContextBuilder url_request_context_builder;
+ url_request_context_builder.set_user_agent(GetUserAgent());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, use a fixed ProxyConfigService, since the default one
+ // depends on glib.
+ //
+@@ -580,7 +580,7 @@ int main(int argc, char** argv) {
+ std::string impls_str = command_line.GetSwitchValueASCII("impls");
+ if (impls_str.empty()) {
+ // Default value.
+-#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || \
++#if !(BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(CHROME_ROOT_STORE_ONLY))
+ impls_str = "platform,";
+ #endif
diff --git a/chromium-next/patches/patch-net_tools_net__watcher_net__watcher.cc b/chromium-next/patches/patch-net_tools_net__watcher_net__watcher.cc
new file mode 100644
index 0000000000..1e256c96a1
--- /dev/null
+++ b/chromium-next/patches/patch-net_tools_net__watcher_net__watcher.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/tools/net_watcher/net_watcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/tools/net_watcher/net_watcher.cc
+@@ -32,7 +32,7 @@
+ #include "net/proxy_resolution/proxy_config_service.h"
+ #include "net/proxy_resolution/proxy_config_with_annotation.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "net/base/network_change_notifier_linux.h"
+ #endif
+
+@@ -44,7 +44,7 @@ namespace {
+
+ // TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Flag to specifies which network interfaces to ignore. Interfaces should
+ // follow as a comma seperated list.
+ const char kIgnoreNetifFlag[] = "ignore-netif";
+@@ -163,7 +163,7 @@ int main(int argc, char* argv[]) {
+
+ NetWatcher net_watcher;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ std::string ignored_netifs_str =
+ command_line->GetSwitchValueASCII(kIgnoreNetifFlag);
diff --git a/chromium-next/patches/patch-net_traffic__annotation_network__traffic__annotation.h b/chromium-next/patches/patch-net_traffic__annotation_network__traffic__annotation.h
new file mode 100644
index 0000000000..494eee6674
--- /dev/null
+++ b/chromium-next/patches/patch-net_traffic__annotation_network__traffic__annotation.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/traffic_annotation/network_traffic_annotation.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/traffic_annotation/network_traffic_annotation.h
+@@ -375,7 +375,7 @@ struct MutablePartialNetworkTrafficAnnot
+ } // namespace net
+
+ // Placeholder for unannotated usages.
+-#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ #define TRAFFIC_ANNOTATION_WITHOUT_PROTO(ANNOTATION_ID) \
+ net::DefineNetworkTrafficAnnotation(ANNOTATION_ID, "No proto yet.")
+ #endif
+@@ -389,7 +389,7 @@ struct MutablePartialNetworkTrafficAnnot
+ // TODO(crbug.com/40118868): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+
+ #define NO_TRAFFIC_ANNOTATION_YET \
+ net::DefineNetworkTrafficAnnotation("undefined", "Nothing here yet.")
diff --git a/chromium-next/patches/patch-net_url__request_url__request__context.cc b/chromium-next/patches/patch-net_url__request_url__request__context.cc
new file mode 100644
index 0000000000..7b046bbddb
--- /dev/null
+++ b/chromium-next/patches/patch-net_url__request_url__request__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/url_request/url_request_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/url_request/url_request_context.cc
+@@ -122,7 +122,7 @@ const HttpNetworkSessionContext* URLRequ
+ // TODO(crbug.com/40118868): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ std::unique_ptr<URLRequest> URLRequestContext::CreateRequest(
+ const GURL& url,
+ RequestPriority priority,
diff --git a/chromium-next/patches/patch-net_url__request_url__request__context.h b/chromium-next/patches/patch-net_url__request_url__request__context.h
new file mode 100644
index 0000000000..dcc24d9ad3
--- /dev/null
+++ b/chromium-next/patches/patch-net_url__request_url__request__context.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/url_request/url_request_context.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/url_request/url_request_context.h
+@@ -92,7 +92,7 @@ class NET_EXPORT URLRequestContext final
+ // TODO(crbug.com/40118868): Revisit once build flag switch of lacros-chrome is
+ // complete.
+ #if !BUILDFLAG(IS_WIN) && \
+- !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD))
+ // This function should not be used in Chromium, please use the version with
+ // NetworkTrafficAnnotationTag in the future.
+ //
diff --git a/chromium-next/patches/patch-net_url__request_url__request__context__builder.cc b/chromium-next/patches/patch-net_url__request_url__request__context__builder.cc
new file mode 100644
index 0000000000..a6fc4eee37
--- /dev/null
+++ b/chromium-next/patches/patch-net_url__request_url__request__context__builder.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- net/url_request/url_request_context_builder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ net/url_request/url_request_context_builder.cc
+@@ -447,7 +447,7 @@ std::unique_ptr<URLRequestContext> URLRe
+ }
+
+ if (!proxy_resolution_service_) {
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD)
+ // TODO(willchan): Switch to using this code when
+ // ProxyConfigService::CreateSystemProxyConfigService()'s
+ // signature doesn't suck.
diff --git a/chromium-next/patches/patch-pdf_pdfium_pdfium__engine.cc b/chromium-next/patches/patch-pdf_pdfium_pdfium__engine.cc
new file mode 100644
index 0000000000..a1f270e8d7
--- /dev/null
+++ b/chromium-next/patches/patch-pdf_pdfium_pdfium__engine.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- pdf/pdfium/pdfium_engine.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ pdf/pdfium/pdfium_engine.cc
+@@ -106,7 +106,7 @@
+ #include "ui/accessibility/ax_features.mojom-features.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "pdf/pdfium/pdfium_font_linux.h"
+ #endif
+
+@@ -535,7 +535,7 @@ void InitializeSDK(bool enable_v8,
+
+ FPDF_InitLibraryWithConfig(&config);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ g_font_mapping_mode = font_mapping_mode;
+ InitializeLinuxFontMapper();
+ #endif
diff --git a/chromium-next/patches/patch-ppapi_tests_test__utils.h b/chromium-next/patches/patch-ppapi_tests_test__utils.h
new file mode 100644
index 0000000000..c6de20592f
--- /dev/null
+++ b/chromium-next/patches/patch-ppapi_tests_test__utils.h
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ppapi/tests/test_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ppapi/tests/test_utils.h
+@@ -314,6 +314,8 @@ do { \
+ #define PPAPI_OS_FREEBSD 1
+ #elif defined(__OpenBSD__)
+ #define PPAPI_OS_OPENBSD 1
++#elif defined(__NetBSD__)
++#define PPAPI_OS_NETBSD 1
+ #elif defined(__sun)
+ #define PPAPI_OS_SOLARIS 1
+ #else
+@@ -322,7 +324,8 @@ do { \
+
+ /* These are used to determine POSIX-like implementations vs Windows. */
+ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+- defined(__OpenBSD__) || defined(__sun) || defined(__native_client__)
++ defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) \
++ defined(__NetBSD__)
+ #define PPAPI_POSIX 1
+ #endif
+
diff --git a/chromium-next/patches/patch-printing_backend_cups__ipp__helper.cc b/chromium-next/patches/patch-printing_backend_cups__ipp__helper.cc
new file mode 100644
index 0000000000..b3eef0373d
--- /dev/null
+++ b/chromium-next/patches/patch-printing_backend_cups__ipp__helper.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/backend/cups_ipp_helper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/backend/cups_ipp_helper.cc
+@@ -202,7 +202,7 @@ void ExtractResolutions(const CupsOption
+ // Provide a default DPI if no valid DPI is found.
+ #if BUILDFLAG(IS_MAC)
+ constexpr gfx::Size kDefaultMissingDpi(kDefaultMacDpi, kDefaultMacDpi);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr gfx::Size kDefaultMissingDpi(kPixelsPerInch, kPixelsPerInch);
+ #else
+ constexpr gfx::Size kDefaultMissingDpi(kDefaultPdfDpi, kDefaultPdfDpi);
diff --git a/chromium-next/patches/patch-printing_backend_print__backend__cups.cc b/chromium-next/patches/patch-printing_backend_print__backend__cups.cc
new file mode 100644
index 0000000000..a7679e3814
--- /dev/null
+++ b/chromium-next/patches/patch-printing_backend_print__backend__cups.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/backend/print_backend_cups.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/backend/print_backend_cups.cc
+@@ -33,7 +33,7 @@
+ #include "printing/mojom/print.mojom.h"
+ #include "url/gurl.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "base/feature_list.h"
+ #include "printing/backend/cups_connection.h"
+ #include "printing/backend/print_backend_cups_ipp.h"
+@@ -63,7 +63,7 @@ int CaptureCupsDestCallback(void* data,
+ return 1; // Keep going.
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // This may be removed when Amazon Linux 2 reaches EOL (30 Jun 2025).
+ bool AreNewerCupsFunctionsAvailable() {
+ return cupsFindDestDefault && cupsFindDestSupported && cupsUserAgent &&
+@@ -292,7 +292,7 @@ bool PrintBackendCUPS::IsValidPrinter(co
+ #if !BUILDFLAG(IS_CHROMEOS)
+ scoped_refptr<PrintBackend> PrintBackend::CreateInstanceImpl(
+ const std::string& locale) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (AreNewerCupsFunctionsAvailable() &&
+ base::FeatureList::IsEnabled(features::kCupsIppPrintingBackend)) {
+ return base::MakeRefCounted<PrintBackendCupsIpp>(CupsConnection::Create());
diff --git a/chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.cc b/chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.cc
new file mode 100644
index 0000000000..0e9649799e
--- /dev/null
+++ b/chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/mojom/printing_context_mojom_traits.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/mojom/printing_context_mojom_traits.cc
+@@ -19,7 +19,7 @@
+ #include "base/numerics/safe_conversions.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "mojo/public/mojom/base/values.mojom.h"
+ #endif
+
+@@ -161,7 +161,7 @@ bool StructTraits<
+ }
+
+ out->set_pages_per_sheet(data.pages_per_sheet());
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ DCHECK(out->advanced_settings().empty());
+ if (!data.ReadAdvancedSettings(&out->advanced_settings()))
+ return false;
+@@ -238,7 +238,7 @@ bool StructTraits<
+ if (system_print_dialog_data.size() != dictionary_entries) {
+ return false;
+ }
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The dictionary must contain three strings.
+ const base::Value* value = system_print_dialog_data.Find(
+ printing::kLinuxSystemPrintDialogDataPrinter);
diff --git a/chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.h b/chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.h
new file mode 100644
index 0000000000..5f39082bab
--- /dev/null
+++ b/chromium-next/patches/patch-printing_mojom_printing__context__mojom__traits.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/mojom/printing_context_mojom_traits.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/mojom/printing_context_mojom_traits.h
+@@ -166,7 +166,7 @@ struct StructTraits<printing::mojom::Pri
+ return s.pages_per_sheet();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static const printing::PrintSettings::AdvancedSettings& advanced_settings(
+ const printing::PrintSettings& s) {
+ return s.advanced_settings();
diff --git a/chromium-next/patches/patch-printing_print__settings.cc b/chromium-next/patches/patch-printing_print__settings.cc
new file mode 100644
index 0000000000..b2c44226c4
--- /dev/null
+++ b/chromium-next/patches/patch-printing_print__settings.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/print_settings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/print_settings.cc
+@@ -319,7 +319,7 @@ PrintSettings& PrintSettings::operator=(
+ #endif
+ is_modifiable_ = settings.is_modifiable_;
+ pages_per_sheet_ = settings.pages_per_sheet_;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (const auto& item : settings.advanced_settings_)
+ advanced_settings_.emplace(item.first, item.second.Clone());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -349,7 +349,7 @@ bool PrintSettings::operator==(const Pri
+ #endif
+ is_modifiable_, requested_custom_margins_in_points_,
+ pages_per_sheet_
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ advanced_settings_
+ #endif
+@@ -373,7 +373,7 @@ bool PrintSettings::operator==(const Pri
+ other.is_modifiable_,
+ other.requested_custom_margins_in_points_,
+ other.pages_per_sheet_
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ other.advanced_settings_
+ #endif
+@@ -413,7 +413,7 @@ void PrintSettings::Clear() {
+ #endif
+ is_modifiable_ = true;
+ pages_per_sheet_ = 1;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ advanced_settings_.clear();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ #if BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-printing_print__settings.h b/chromium-next/patches/patch-printing_print__settings.h
new file mode 100644
index 0000000000..3583ead51a
--- /dev/null
+++ b/chromium-next/patches/patch-printing_print__settings.h
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/print_settings.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/print_settings.h
+@@ -25,7 +25,7 @@
+ #include "base/values.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <map>
+
+ #include "base/values.h"
+@@ -51,7 +51,7 @@ inline constexpr char kMacSystemPrintDia
+ "print_settings";
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ inline constexpr char kLinuxSystemPrintDialogDataPrinter[] = "printer_name";
+ inline constexpr char kLinuxSystemPrintDialogDataPrintSettings[] =
+ "print_settings";
+@@ -101,7 +101,7 @@ class COMPONENT_EXPORT(PRINTING_SETTINGS
+ std::string vendor_id;
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ using AdvancedSettings = std::map<std::string, base::Value>;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -276,7 +276,7 @@ class COMPONENT_EXPORT(PRINTING_SETTINGS
+ pages_per_sheet_ = pages_per_sheet;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ AdvancedSettings& advanced_settings() { return advanced_settings_; }
+ const AdvancedSettings& advanced_settings() const {
+ return advanced_settings_;
+@@ -429,7 +429,7 @@ class COMPONENT_EXPORT(PRINTING_SETTINGS
+ // Number of pages per sheet.
+ int pages_per_sheet_;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Advanced settings.
+ AdvancedSettings advanced_settings_;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-printing_print__settings__conversion.cc b/chromium-next/patches/patch-printing_print__settings__conversion.cc
new file mode 100644
index 0000000000..5cd1cde21d
--- /dev/null
+++ b/chromium-next/patches/patch-printing_print__settings__conversion.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/print_settings_conversion.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/print_settings_conversion.cc
+@@ -285,7 +285,7 @@ std::unique_ptr<PrintSettings> PrintSett
+ settings->set_is_modifiable(is_modifiable.value());
+ }
+
+-#if BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && BUILDFLAG(USE_CUPS))
++#if BUILDFLAG(IS_CHROMEOS) || ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(USE_CUPS))
+ const base::Value::Dict* advanced_settings =
+ job_settings.FindDict(kSettingAdvancedSettings);
+ if (advanced_settings) {
diff --git a/chromium-next/patches/patch-printing_printing__context__linux.cc b/chromium-next/patches/patch-printing_printing__context__linux.cc
new file mode 100644
index 0000000000..d39ae1cb15
--- /dev/null
+++ b/chromium-next/patches/patch-printing_printing__context__linux.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/printing_context_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/printing_context_linux.cc
+@@ -23,7 +23,7 @@
+ #endif
+
+ // Avoid using LinuxUi on Fuchsia.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -66,7 +66,7 @@ mojom::ResultCode PrintingContextLinux::
+
+ ResetSettings();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!ui::LinuxUi::instance())
+ return mojom::ResultCode::kSuccess;
+
+@@ -82,7 +82,7 @@ mojom::ResultCode PrintingContextLinux::
+ }
+
+ gfx::Size PrintingContextLinux::GetPdfPaperSizeDeviceUnits() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (ui::LinuxUi::instance())
+ return ui::LinuxUi::instance()->GetPdfPaperSize(this);
+ #endif
+@@ -95,7 +95,7 @@ mojom::ResultCode PrintingContextLinux::
+ DCHECK(!printer_settings.show_system_dialog);
+ DCHECK(!in_print_job_);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!ui::LinuxUi::instance())
+ return mojom::ResultCode::kSuccess;
+
diff --git a/chromium-next/patches/patch-printing_printing__features.cc b/chromium-next/patches/patch-printing_printing__features.cc
new file mode 100644
index 0000000000..d38796c68b
--- /dev/null
+++ b/chromium-next/patches/patch-printing_printing__features.cc
@@ -0,0 +1,23 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/printing_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/printing_features.cc
+@@ -21,12 +21,12 @@ BASE_FEATURE(kAddPrinterViaPrintscanmgr,
+ base::FEATURE_ENABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Use the CUPS IPP printing backend instead of the original CUPS backend that
+ // calls the deprecated PPD API.
+ BASE_FEATURE(kCupsIppPrintingBackend,
+ "CupsIppPrintingBackend",
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_DISABLED_BY_DEFAULT
+ #else
+ base::FEATURE_ENABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-printing_printing__features.h b/chromium-next/patches/patch-printing_printing__features.h
new file mode 100644
index 0000000000..f5273ceb53
--- /dev/null
+++ b/chromium-next/patches/patch-printing_printing__features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/printing_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/printing_features.h
+@@ -22,7 +22,7 @@ COMPONENT_EXPORT(PRINTING_BASE)
+ BASE_DECLARE_FEATURE(kAddPrinterViaPrintscanmgr);
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(PRINTING_BASE) BASE_DECLARE_FEATURE(kCupsIppPrintingBackend);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
+
diff --git a/chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc b/chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..745964a8d9
--- /dev/null
+++ b/chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc
@@ -0,0 +1,56 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/sandbox/print_backend_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/sandbox/print_backend_sandbox_hook_linux.cc
+@@ -10,20 +10,27 @@
+ #include "base/path_service.h"
+ #include "build/build_config.h"
+ #include "printing/buildflags/buildflags.h"
++#if !BUILDFLAG(IS_BSD)
+ #include "sandbox/linux/syscall_broker/broker_command.h"
+ #include "sandbox/linux/syscall_broker/broker_file_permission.h"
+ #include "sandbox/policy/export.h"
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#else
++#include "sandbox/policy/sandbox.h"
++#endif
+
+ #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(USE_CUPS)
+ #include "printing/backend/cups_connection_pool.h"
+ #endif
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
+ using sandbox::syscall_broker::MakeBrokerCommandSet;
++#endif
+
+ namespace printing {
+
++#if !BUILDFLAG(IS_BSD)
+ namespace {
+
+ sandbox::syscall_broker::BrokerCommandSet GetPrintBackendBrokerCommandSet() {
+@@ -76,9 +83,11 @@ std::vector<BrokerFilePermission> GetPri
+ }
+
+ } // namespace
++#endif
+
+ bool PrintBackendPreSandboxHook(
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(USE_CUPS)
+ // Create the socket connections to the CUPS server before engaging the
+ // sandbox, since new connections cannot be made after that.
+@@ -91,6 +100,7 @@ bool PrintBackendPreSandboxHook(
+ GetPrintBackendFilePermissions(), options);
+
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+ return true;
+ }
+
diff --git a/chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.h b/chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.h
new file mode 100644
index 0000000000..71c117ccaa
--- /dev/null
+++ b/chromium-next/patches/patch-printing_sandbox_print__backend__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- printing/sandbox/print_backend_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ printing/sandbox/print_backend_sandbox_hook_linux.h
+@@ -5,8 +5,13 @@
+ #ifndef PRINTING_SANDBOX_PRINT_BACKEND_SANDBOX_HOOK_LINUX_H_
+ #define PRINTING_SANDBOX_PRINT_BACKEND_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
+ #include "base/component_export.h"
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace printing {
+
diff --git a/chromium-next/patches/patch-remoting_base_chromoting__event.cc b/chromium-next/patches/patch-remoting_base_chromoting__event.cc
new file mode 100644
index 0000000000..f7eb4caae5
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_base_chromoting__event.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/base/chromoting_event.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/base/chromoting_event.cc
+@@ -192,7 +192,7 @@ void ChromotingEvent::AddSystemInfo() {
+ SetString(kCpuKey, base::SysInfo::OperatingSystemArchitecture());
+ SetString(kOsVersionKey, base::SysInfo::OperatingSystemVersion());
+ SetString(kWebAppVersionKey, STRINGIZE(VERSION));
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ Os os = Os::CHROMOTING_LINUX;
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ Os os = Os::CHROMOTING_CHROMEOS;
diff --git a/chromium-next/patches/patch-remoting_base_host__settings.cc b/chromium-next/patches/patch-remoting_base_host__settings.cc
new file mode 100644
index 0000000000..048b44d076
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_base_host__settings.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/base/host_settings.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/base/host_settings.cc
+@@ -7,7 +7,7 @@
+ #include "base/no_destructor.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_APPLE) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(IS_APPLE) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD)
+ #include "remoting/base/file_host_settings.h"
+ #endif // BUILDFLAG(IS_LINUX)
+
+@@ -44,7 +44,7 @@ HostSettings::~HostSettings() = default;
+
+ // static
+ HostSettings* HostSettings::GetInstance() {
+-#if BUILDFLAG(IS_APPLE) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(IS_APPLE) || (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)) || BUILDFLAG(IS_BSD)
+ static base::NoDestructor<FileHostSettings> instance(
+ FileHostSettings::GetSettingsFilePath());
+ #elif BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-remoting_codec_webrtc__video__encoder__vpx.cc b/chromium-next/patches/patch-remoting_codec_webrtc__video__encoder__vpx.cc
new file mode 100644
index 0000000000..70748fb554
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_codec_webrtc__video__encoder__vpx.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/codec/webrtc_video_encoder_vpx.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/codec/webrtc_video_encoder_vpx.cc
+@@ -93,7 +93,7 @@ void SetVp8CodecParameters(vpx_codec_enc
+ const webrtc::DesktopSize& size) {
+ SetCommonCodecParameters(config, size);
+
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_BSD) || BUILDFLAG(IS_LINUX)) && !BUILDFLAG(IS_CHROMEOS_LACROS)
+ // On Linux, using too many threads for VP8 encoding has been linked to high
+ // CPU usage on machines that are under stress. See http://crbug.com/1151148.
+ // 5/3/2022 update: Perf testing has shown that doubling the number of threads
diff --git a/chromium-next/patches/patch-remoting_host_base_desktop__environment__options.cc b/chromium-next/patches/patch-remoting_host_base_desktop__environment__options.cc
new file mode 100644
index 0000000000..d0965cfc61
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_base_desktop__environment__options.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/base/desktop_environment_options.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/base/desktop_environment_options.cc
+@@ -99,7 +99,7 @@ bool DesktopEnvironmentOptions::capture_
+ // TODO(joedow): Determine whether we can migrate additional platforms to
+ // using the DesktopCaptureWrapper instead of the DesktopCaptureProxy. Then
+ // clean up DesktopCapturerProxy::Core::CreateCapturer().
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return capture_video_on_dedicated_thread_;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-remoting_host_base_switches.cc b/chromium-next/patches/patch-remoting_host_base_switches.cc
new file mode 100644
index 0000000000..7af185b501
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_base_switches.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/base/switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/base/switches.cc
+@@ -23,13 +23,13 @@ const char kProcessTypeEvaluateCapabilit
+ const char kProcessTypeFileChooser[] = "file_chooser";
+ const char kProcessTypeUrlForwarderConfigurator[] =
+ "url_forwarder_configurator";
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kProcessTypeXSessionChooser[] = "xsession_chooser";
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+ const char kEvaluateCapabilitySwitchName[] = "evaluate-type";
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const char kEnableUtempter[] = "enable-utempter";
+ #endif
+
diff --git a/chromium-next/patches/patch-remoting_host_base_switches.h b/chromium-next/patches/patch-remoting_host_base_switches.h
new file mode 100644
index 0000000000..bc8891eec6
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_base_switches.h
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/base/switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/base/switches.h
+@@ -35,13 +35,13 @@ extern const char kProcessTypeRdpDesktop
+ extern const char kProcessTypeEvaluateCapability[];
+ extern const char kProcessTypeFileChooser[];
+ extern const char kProcessTypeUrlForwarderConfigurator[];
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kProcessTypeXSessionChooser[];
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+ extern const char kEvaluateCapabilitySwitchName[];
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Used to record client sessions to utmp/wtmp.
+ extern const char kEnableUtempter[];
+ #endif
diff --git a/chromium-next/patches/patch-remoting_host_basic__desktop__environment.cc b/chromium-next/patches/patch-remoting_host_basic__desktop__environment.cc
new file mode 100644
index 0000000000..74dae0bafa
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_basic__desktop__environment.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/basic_desktop_environment.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/basic_desktop_environment.cc
+@@ -195,7 +195,7 @@ std::unique_ptr<DesktopCapturer> BasicDe
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner;
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ capture_task_runner = ui_task_runner_;
+-#elif BUILDFLAG(IS_LINUX) && defined(REMOTING_USE_WAYLAND)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_WAYLAND)
+ // Each capturer instance should get its own thread so the capturers don't
+ // compete with each other in multistream mode.
+ capture_task_runner = base::ThreadPool::CreateSingleThreadTaskRunner(
diff --git a/chromium-next/patches/patch-remoting_host_chromoting__host.cc b/chromium-next/patches/patch-remoting_host_chromoting__host.cc
new file mode 100644
index 0000000000..def974c164
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_chromoting__host.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/chromoting_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/chromoting_host.cc
+@@ -135,7 +135,7 @@ void ChromotingHost::Start(const std::st
+ &ChromotingHost::OnIncomingSession, base::Unretained(this)));
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ChromotingHost::StartChromotingHostServices() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(!ipc_server_);
diff --git a/chromium-next/patches/patch-remoting_host_chromoting__host.h b/chromium-next/patches/patch-remoting_host_chromoting__host.h
new file mode 100644
index 0000000000..5f315616ff
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_chromoting__host.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/chromoting_host.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/chromoting_host.h
+@@ -36,7 +36,7 @@
+ #include "remoting/protocol/session_manager.h"
+ #include "remoting/protocol/transport_context.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/chromoting_host_services_server.h"
+ #endif
+
+@@ -112,7 +112,7 @@ class ChromotingHost : public ClientSess
+ // This method can only be called once during the lifetime of this object.
+ void Start(const std::string& host_owner);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Starts running the ChromotingHostServices server and listening for incoming
+ // IPC binding requests.
+ // Currently only Linux runs the ChromotingHostServices server on the host
+@@ -220,7 +220,7 @@ class ChromotingHost : public ClientSess
+ // List of host extensions.
+ std::vector<std::unique_ptr<HostExtension>> extensions_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // IPC server that runs the CRD host service API. Non-null if the server name
+ // is set and the host is started.
+ // Currently only Linux runs the ChromotingHostServices server on the host
diff --git a/chromium-next/patches/patch-remoting_host_chromoting__host__context.cc b/chromium-next/patches/patch-remoting_host_chromoting__host__context.cc
new file mode 100644
index 0000000000..fc667395f1
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_chromoting__host__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/chromoting_host_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/chromoting_host_context.cc
+@@ -293,7 +293,7 @@ std::unique_ptr<ChromotingHostContext> C
+ // on a UI thread.
+ scoped_refptr<AutoThreadTaskRunner> input_task_runner =
+ AutoThread::CreateWithType("ChromotingInputThread", ui_task_runner,
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::MessagePumpType::UI);
+ #else
+ base::MessagePumpType::IO);
diff --git a/chromium-next/patches/patch-remoting_host_chromoting__host__services__client.cc b/chromium-next/patches/patch-remoting_host_chromoting__host__services__client.cc
new file mode 100644
index 0000000000..a29cd33842
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_chromoting__host__services__client.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/chromoting_host_services_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/chromoting_host_services_client.cc
+@@ -59,7 +59,7 @@ mojo::PendingRemote<mojom::ChromotingHos
+
+ } // namespace
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ // static
+ constexpr char
+@@ -136,7 +136,7 @@ bool ChromotingHostServicesClient::Ensur
+ if (session_services_remote_.is_bound()) {
+ return true;
+ }
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (!environment_->HasVar(kChromeRemoteDesktopSessionEnvVar)) {
+ LOG(WARNING) << "Current desktop environment is not remotable.";
+ return false;
diff --git a/chromium-next/patches/patch-remoting_host_client__session.cc b/chromium-next/patches/patch-remoting_host_client__session.cc
new file mode 100644
index 0000000000..76325e2d17
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_client__session.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/client_session.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/client_session.cc
+@@ -161,7 +161,7 @@ void ClientSession::NotifyClientResoluti
+ if (effective_policies_.curtain_required.value_or(false)) {
+ dpi_vector.set(resolution.x_dpi(), resolution.y_dpi());
+ }
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ dpi_vector.set(resolution.x_dpi(), resolution.y_dpi());
+ #endif
+
diff --git a/chromium-next/patches/patch-remoting_host_crash_crash__file__uploader.cc b/chromium-next/patches/patch-remoting_host_crash_crash__file__uploader.cc
new file mode 100644
index 0000000000..b58331e78c
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_crash_crash__file__uploader.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/crash/crash_file_uploader.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/crash/crash_file_uploader.cc
+@@ -44,7 +44,7 @@ constexpr char kMinidumpFileName[] = "du
+
+ #if BUILDFLAG(IS_WIN)
+ constexpr char kProductNameValue[] = "Chromoting";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr char kProductNameValue[] = "Chromoting_Linux";
+ #elif BUILDFLAG(IS_MAC)
+ constexpr char kProductNameValue[] = "Chromoting_Mac";
diff --git a/chromium-next/patches/patch-remoting_host_desktop__and__cursor__conditional__composer.cc b/chromium-next/patches/patch-remoting_host_desktop__and__cursor__conditional__composer.cc
new file mode 100644
index 0000000000..46562c5c91
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_desktop__and__cursor__conditional__composer.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/desktop_and_cursor_conditional_composer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/desktop_and_cursor_conditional_composer.cc
+@@ -7,7 +7,7 @@
+ #include "base/functional/bind.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/linux/wayland_utils.h"
+ #endif
+
+@@ -96,7 +96,7 @@ bool DesktopAndCursorConditionalComposer
+ }
+
+ bool DesktopAndCursorConditionalComposer::SupportsFrameCallbacks() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return IsRunningWayland();
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-remoting_host_desktop__capturer__proxy.cc b/chromium-next/patches/patch-remoting_host_desktop__capturer__proxy.cc
new file mode 100644
index 0000000000..77a9a6bbc0
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_desktop__capturer__proxy.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/desktop_capturer_proxy.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/desktop_capturer_proxy.cc
+@@ -26,7 +26,7 @@
+ #include "remoting/host/chromeos/frame_sink_desktop_capturer.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #include "base/nix/xdg_util.h"
+ #include "remoting/host/linux/wayland_desktop_capturer.h"
+@@ -91,7 +91,7 @@ void DesktopCapturerProxy::Core::CreateC
+
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ capturer_ = std::make_unique<FrameSinkDesktopCapturer>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ static base::nix::SessionType session_type = base::nix::SessionType::kUnset;
+ if (session_type == base::nix::SessionType::kUnset) {
+ std::unique_ptr<base::Environment> env = base::Environment::Create();
+@@ -298,7 +298,7 @@ void DesktopCapturerProxy::OnMetadata(we
+ bool DesktopCapturerProxy::SupportsFrameCallbacks() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return IsRunningWayland();
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-remoting_host_desktop__capturer__wrapper.cc b/chromium-next/patches/patch-remoting_host_desktop__capturer__wrapper.cc
new file mode 100644
index 0000000000..718147704c
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_desktop__capturer__wrapper.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/desktop_capturer_wrapper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/desktop_capturer_wrapper.cc
+@@ -13,7 +13,7 @@
+ #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
+ #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/linux/wayland_desktop_capturer.h"
+ #include "remoting/host/linux/wayland_utils.h"
+ #endif
+@@ -33,7 +33,7 @@ void DesktopCapturerWrapper::CreateCaptu
+ SourceId id) {
+ DCHECK(!capturer_);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (IsRunningWayland()) {
+ capturer_ = std::make_unique<WaylandDesktopCapturer>(options);
+ } else {
+@@ -112,7 +112,7 @@ void DesktopCapturerWrapper::OnCaptureRe
+ bool DesktopCapturerWrapper::SupportsFrameCallbacks() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return capturer_ && IsRunningWayland();
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-remoting_host_evaluate__capability.cc b/chromium-next/patches/patch-remoting_host_evaluate__capability.cc
new file mode 100644
index 0000000000..b81f6552e5
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_evaluate__capability.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/evaluate_capability.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/evaluate_capability.cc
+@@ -56,7 +56,7 @@ base::FilePath BuildHostBinaryPath() {
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (path.BaseName().value() ==
+ FILE_PATH_LITERAL("chrome-remote-desktop-host")) {
+ return path;
diff --git a/chromium-next/patches/patch-remoting_host_host__attributes.cc b/chromium-next/patches/patch-remoting_host_host__attributes.cc
new file mode 100644
index 0000000000..5437bd0593
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_host__attributes.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/host_attributes.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/host_attributes.cc
+@@ -105,7 +105,7 @@ std::string GetHostAttributes() {
+ if (media::InitializeMediaFoundation()) {
+ result.push_back("HWEncoder");
+ }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ result.push_back("HWEncoder");
+ #endif
+
diff --git a/chromium-next/patches/patch-remoting_host_host__details.cc b/chromium-next/patches/patch-remoting_host_host__details.cc
new file mode 100644
index 0000000000..35a156c654
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_host__details.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/host_details.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/host_details.cc
+@@ -23,7 +23,7 @@ std::string GetHostOperatingSystemName()
+ return "Mac";
+ #elif BUILDFLAG(IS_CHROMEOS_ASH)
+ return "ChromeOS";
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return "Linux";
+ #elif BUILDFLAG(IS_ANDROID)
+ return "Android";
diff --git a/chromium-next/patches/patch-remoting_host_host__main.cc b/chromium-next/patches/patch-remoting_host_host__main.cc
new file mode 100644
index 0000000000..dc4d576e43
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_host__main.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/host_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/host_main.cc
+@@ -50,7 +50,7 @@ int FileChooserMain();
+ int RdpDesktopSessionMain();
+ int UrlForwarderConfiguratorMain();
+ #endif // BUILDFLAG(IS_WIN)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ int XSessionChooserMain();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -63,7 +63,7 @@ const char kUsageMessage[] =
+ "\n"
+ "Options:\n"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ " --audio-pipe-name=<pipe> - Sets the pipe name to capture audio on "
+ "Linux.\n"
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -156,7 +156,7 @@ MainRoutineFn SelectMainRoutine(const st
+ } else if (process_type == kProcessTypeUrlForwarderConfigurator) {
+ main_routine = &UrlForwarderConfiguratorMain;
+ #endif // BUILDFLAG(IS_WIN)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ } else if (process_type == kProcessTypeXSessionChooser) {
+ main_routine = &XSessionChooserMain;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -222,7 +222,7 @@ int HostMain(int argc, char** argv) {
+ // be initialized first, so that the preference for crash-reporting can be
+ // looked up in the config file.
+ if (IsUsageStatsAllowed()) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ InitializeCrashReporting();
+ #elif BUILDFLAG(IS_WIN)
+ // TODO: joedow - Enable crash reporting for the RDP process.
diff --git a/chromium-next/patches/patch-remoting_host_ipc__constants.cc b/chromium-next/patches/patch-remoting_host_ipc__constants.cc
new file mode 100644
index 0000000000..0ab4a8d308
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_ipc__constants.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/ipc_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/ipc_constants.cc
+@@ -17,7 +17,7 @@ namespace remoting {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ #if !defined(NDEBUG)
+ // Use a different IPC name for debug builds so that we can run the host
+@@ -81,7 +81,7 @@ GetChromotingHostServicesServerName() {
+ static const base::NoDestructor<mojo::NamedPlatformChannel::ServerName>
+ server_name(
+ named_mojo_ipc_server::WorkingDirectoryIndependentServerNameFromUTF8(
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Linux host creates the socket file in /tmp, and it won't be
+ // deleted until reboot, so we put username in the path in case
+ // the user switches the host owner.
diff --git a/chromium-next/patches/patch-remoting_host_it2me_it2me__host.cc b/chromium-next/patches/patch-remoting_host_it2me_it2me__host.cc
new file mode 100644
index 0000000000..02f5a084e3
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_it2me_it2me__host.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/it2me/it2me_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/it2me/it2me_host.cc
+@@ -58,7 +58,7 @@
+ #include "remoting/host/chromeos/features.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/linux/wayland_manager.h"
+ #include "remoting/host/linux/wayland_utils.h"
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -191,7 +191,7 @@ void It2MeHost::Connect(
+
+ OnPolicyUpdate(std::move(policies));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (IsRunningWayland()) {
+ WaylandManager::Get()->Init(host_context_->ui_task_runner());
+ }
+@@ -325,7 +325,7 @@ void It2MeHost::ConnectOnNetworkThread(
+
+ // Set up the desktop environment options.
+ DesktopEnvironmentOptions options(DesktopEnvironmentOptions::CreateDefault());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (IsRunningWayland()) {
+ options.desktop_capture_options()->set_prefer_cursor_embedded(true);
+ }
diff --git a/chromium-next/patches/patch-remoting_host_it2me_it2me__native__messaging__host__main.cc b/chromium-next/patches/patch-remoting_host_it2me_it2me__native__messaging__host__main.cc
new file mode 100644
index 0000000000..e16cf9aaa7
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_it2me_it2me__native__messaging__host__main.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/it2me/it2me_native_messaging_host_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/it2me/it2me_native_messaging_host_main.cc
+@@ -30,7 +30,7 @@
+ #include "remoting/host/resources.h"
+ #include "remoting/host/usage_stats_consent.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if defined(REMOTING_USE_X11)
+ #include <gtk/gtk.h>
+ #include "base/linux_util.h"
+@@ -77,7 +77,7 @@ bool CurrentProcessHasUiAccess() {
+ // Creates a It2MeNativeMessagingHost instance, attaches it to stdin/stdout and
+ // runs the task executor until It2MeNativeMessagingHost signals shutdown.
+ int It2MeNativeMessagingHostMain(int argc, char** argv) {
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ if (!IsRunningWayland()) {
+ // Initialize Xlib for multi-threaded use, allowing non-Chromium code to
+ // use X11 safely (such as the WebRTC capturer, GTK ...)
+@@ -125,7 +125,7 @@ int It2MeNativeMessagingHostMain(int arg
+
+ remoting::LoadResources("");
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ // Required for any calls into GTK functions, such as the Disconnect and
+ // Continue windows. Calling with nullptr arguments because we don't have
+ // any command line arguments for gtk to consume.
+@@ -257,7 +257,7 @@ int It2MeNativeMessagingHostMain(int arg
+ PolicyWatcher::CreateWithTaskRunner(context->file_task_runner(),
+ context->management_service());
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ scoped_refptr<AutoThreadTaskRunner> input_task_runner;
+ if (!IsRunningWayland()) {
+ // Create an X11EventSource on all UI threads, so the global X11 connection
+@@ -284,7 +284,7 @@ int It2MeNativeMessagingHostMain(int arg
+ // Run the loop until channel is alive.
+ run_loop.Run();
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ if (!IsRunningWayland()) {
+ input_task_runner->PostTask(FROM_HERE, base::BindOnce([]() {
+ delete ui::X11EventSource::GetInstance();
diff --git a/chromium-next/patches/patch-remoting_host_me2me__desktop__environment.cc b/chromium-next/patches/patch-remoting_host_me2me__desktop__environment.cc
new file mode 100644
index 0000000000..76ed98742e
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_me2me__desktop__environment.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/me2me_desktop_environment.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/me2me_desktop_environment.cc
+@@ -108,7 +108,7 @@ std::string Me2MeDesktopEnvironment::Get
+ capabilities += protocol::kRemoteWebAuthnCapability;
+ }
+
+-#if BUILDFLAG(IS_LINUX) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ if (!IsRunningWayland()) {
+ capabilities += " ";
+ capabilities += protocol::kMultiStreamCapability;
+@@ -150,7 +150,7 @@ Me2MeDesktopEnvironment::Me2MeDesktopEnv
+ // properly under Xvfb.
+ mutable_desktop_capture_options()->set_use_update_notifications(true);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Setting this option to false means that the capture differ wrapper will not
+ // be used when the X11 capturer is selected. This reduces the X11 capture
+ // time by a few milliseconds per frame and is safe because we can rely on
+@@ -159,7 +159,7 @@ Me2MeDesktopEnvironment::Me2MeDesktopEnv
+ mutable_desktop_capture_options()->set_detect_updated_region(false);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (IsRunningWayland()) {
+ mutable_desktop_capture_options()->set_prefer_cursor_embedded(false);
+ }
+@@ -184,7 +184,7 @@ bool Me2MeDesktopEnvironment::Initialize
+
+ // Otherwise, if the session is shared with the local user start monitoring
+ // the local input and create the in-session UI.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool want_user_interface = false;
+ #elif BUILDFLAG(IS_APPLE)
+ // Don't try to display any UI on top of the system's login screen as this
diff --git a/chromium-next/patches/patch-remoting_host_mojo__caller__security__checker.cc b/chromium-next/patches/patch-remoting_host_mojo__caller__security__checker.cc
new file mode 100644
index 0000000000..5067f9f60b
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_mojo__caller__security__checker.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/mojo_caller_security_checker.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/mojo_caller_security_checker.cc
+@@ -37,7 +37,7 @@
+ namespace remoting {
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr auto kAllowedCallerProgramNames =
+ base::MakeFixedFlatSet<base::FilePath::StringPieceType>({
+ "remote-open-url",
+@@ -98,7 +98,7 @@ bool IsTrustedMojoEndpoint(
+ return true;
+ #endif
+
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+
+ // TODO: yuweih - see if it's possible to move away from PID-based security
+ // checks, which might be susceptible of PID reuse attacks.
+@@ -122,7 +122,7 @@ bool IsTrustedMojoEndpoint(
+ base::FilePath::StringType program_name =
+ caller_process_image_path.BaseName().value();
+ if (!kAllowedCallerProgramNames.contains(program_name)) {
+-#if BUILDFLAG(IS_LINUX) && !defined(NDEBUG)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !defined(NDEBUG)
+ // Linux binaries generated in out/Debug are underscore-separated. To make
+ // debugging easier, we just check the name again with underscores replaced
+ // with hyphens.
diff --git a/chromium-next/patches/patch-remoting_host_mouse__cursor__monitor__proxy.cc b/chromium-next/patches/patch-remoting_host_mouse__cursor__monitor__proxy.cc
new file mode 100644
index 0000000000..a15feb1939
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_mouse__cursor__monitor__proxy.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/mouse_cursor_monitor_proxy.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/mouse_cursor_monitor_proxy.cc
+@@ -73,7 +73,7 @@ void MouseCursorMonitorProxy::Core::Crea
+
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ mouse_cursor_monitor_ = std::make_unique<MouseCursorMonitorAura>();
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (IsRunningWayland()) {
+ mouse_cursor_monitor_ = webrtc::MouseCursorMonitor::Create(options);
+ } else {
diff --git a/chromium-next/patches/patch-remoting_host_policy__watcher.cc b/chromium-next/patches/patch-remoting_host_policy__watcher.cc
new file mode 100644
index 0000000000..89a7903735
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_policy__watcher.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/policy_watcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/policy_watcher.cc
+@@ -178,7 +178,7 @@ base::Value::Dict PolicyWatcher::GetDefa
+ true);
+ result.Set(key::kRemoteAccessHostAllowEnterpriseFileTransfer, false);
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ result.Set(key::kRemoteAccessHostMatchUsername, false);
+ #endif
+ #if !BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__client.cc b/chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__client.cc
new file mode 100644
index 0000000000..7b83bc7f57
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__client.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/remote_open_url/remote_open_url_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/remote_open_url/remote_open_url_client.cc
+@@ -18,7 +18,7 @@
+ #include "remoting/host/mojom/chromoting_host_services.mojom.h"
+ #include "remoting/host/mojom/remote_url_opener.mojom.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/remote_open_url/remote_open_url_client_delegate_linux.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "remoting/host/remote_open_url/remote_open_url_client_delegate_win.h"
+@@ -31,7 +31,7 @@ namespace {
+ constexpr base::TimeDelta kRequestTimeout = base::Seconds(5);
+
+ std::unique_ptr<RemoteOpenUrlClient::Delegate> CreateDelegate() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return std::make_unique<RemoteOpenUrlClientDelegateLinux>();
+ #elif BUILDFLAG(IS_WIN)
+ return std::make_unique<RemoteOpenUrlClientDelegateWin>();
diff --git a/chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__util.cc b/chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__util.cc
new file mode 100644
index 0000000000..084fff88d5
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_remote__open__url_remote__open__url__util.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/remote_open_url/remote_open_url_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/remote_open_url/remote_open_url_util.cc
+@@ -29,7 +29,7 @@ const wchar_t kRegisteredApplicationsKey
+ #endif // BUILDFLAG(IS_WIN)
+
+ bool IsRemoteOpenUrlSupported() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return true;
+ #elif BUILDFLAG(IS_WIN)
+ // The MSI installs the ProgID and capabilities into registry, but not the
diff --git a/chromium-next/patches/patch-remoting_host_remote__open__url_url__forwarder__configurator.cc b/chromium-next/patches/patch-remoting_host_remote__open__url_url__forwarder__configurator.cc
new file mode 100644
index 0000000000..4c1787e396
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_remote__open__url_url__forwarder__configurator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/remote_open_url/url_forwarder_configurator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/remote_open_url/url_forwarder_configurator.cc
+@@ -12,7 +12,7 @@ UrlForwarderConfigurator::UrlForwarderCo
+
+ UrlForwarderConfigurator::~UrlForwarderConfigurator() = default;
+
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_WIN)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_BSD)
+
+ // static
+ std::unique_ptr<UrlForwarderConfigurator> UrlForwarderConfigurator::Create() {
diff --git a/chromium-next/patches/patch-remoting_host_remoting__me2me__host.cc b/chromium-next/patches/patch-remoting_host_remoting__me2me__host.cc
new file mode 100644
index 0000000000..12bf2df084
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_remoting__me2me__host.cc
@@ -0,0 +1,166 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/remoting_me2me_host.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/remoting_me2me_host.cc
+@@ -145,7 +145,7 @@
+ #include "remoting/host/mac/permission_utils.h"
+ #endif // BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if defined(REMOTING_USE_X11)
+ #include <gtk/gtk.h>
+ #endif // defined(REMOTING_USE_X11)
+@@ -156,13 +156,13 @@
+ #endif // defined(REMOTING_USE_X11)
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/linux_util.h"
+ #include "remoting/host/audio_capturer_linux.h"
+ #include "remoting/host/linux/certificate_watcher.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/host_utmp_logger.h"
+ #endif
+
+@@ -176,7 +176,7 @@
+ #include "remoting/host/win/session_desktop_environment.h"
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/linux/wayland_manager.h"
+ #include "remoting/host/linux/wayland_utils.h"
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -204,7 +204,7 @@ const char kApplicationName[] = "chromot
+ const char kStdinConfigPath[] = "-";
+ #endif // !defined(REMOTING_MULTI_PROCESS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The command line switch used to pass name of the pipe to capture audio on
+ // linux.
+ const char kAudioPipeSwitchName[] = "audio-pipe-name";
+@@ -448,7 +448,7 @@ class HostProcess : public ConfigWatcher
+ std::unique_ptr<AgentProcessBrokerClient> agent_process_broker_client_;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Watch for certificate changes and kill the host when changes occur
+ std::unique_ptr<CertificateWatcher> cert_watcher_;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -510,7 +510,7 @@ class HostProcess : public ConfigWatcher
+ std::unique_ptr<FtlEchoMessageListener> ftl_echo_message_listener_;
+
+ std::unique_ptr<HostEventLogger> host_event_logger_;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<HostUTMPLogger> host_utmp_logger_;
+ #endif
+ std::unique_ptr<HostPowerSaveBlocker> power_save_blocker_;
+@@ -828,7 +828,7 @@ void HostProcess::StartOnNetworkThread()
+ void HostProcess::ShutdownOnNetworkThread() {
+ DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
+ config_watcher_.reset();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ cert_watcher_.reset();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ }
+@@ -899,7 +899,7 @@ void HostProcess::CreateAuthenticatorFac
+ context_->url_loader_factory(), service_account_email_,
+ oauth_refresh_token_));
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!cert_watcher_) {
+ cert_watcher_ = std::make_unique<CertificateWatcher>(
+ base::BindRepeating(&HostProcess::ShutdownHost,
+@@ -1041,13 +1041,13 @@ void HostProcess::StartOnUiThread() {
+ base::BindRepeating(&HostProcess::OnPolicyUpdate, base::Unretained(this)),
+ base::BindRepeating(&HostProcess::OnPolicyError, base::Unretained(this)));
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (IsRunningWayland()) {
+ WaylandManager::Get()->Init(context_->ui_task_runner());
+ }
+ #endif // BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // If an audio pipe is specific on the command-line then initialize
+ // AudioCapturerLinux to capture from it.
+ base::FilePath audio_pipe_name =
+@@ -1124,7 +1124,7 @@ void HostProcess::ShutdownOnUiThread() {
+ // It is now safe for the HostProcess to be deleted.
+ self_ = nullptr;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Cause the global AudioPipeReader to be freed, otherwise the audio
+ // thread will remain in-use and prevent the process from exiting.
+ // TODO(wez): DesktopEnvironmentFactory should own the pipe reader.
+@@ -1132,7 +1132,7 @@ void HostProcess::ShutdownOnUiThread() {
+ AudioCapturerLinux::InitializePipeReader(nullptr, base::FilePath());
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ context_->input_task_runner()->PostTask(
+ FROM_HERE,
+ base::BindOnce([]() { delete ui::X11EventSource::GetInstance(); }));
+@@ -1844,7 +1844,7 @@ void HostProcess::StartHost() {
+ corp_host_status_logger_->StartObserving(*session_manager);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ desktop_environment_options_.set_enable_remote_webauthn(is_corp_host_);
+ #endif
+
+@@ -1863,7 +1863,7 @@ void HostProcess::StartHost() {
+
+ host_->AddExtension(std::make_unique<TestEchoExtension>());
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(kEnableUtempter)) {
+ host_utmp_logger_ =
+@@ -1899,7 +1899,7 @@ void HostProcess::StartHost() {
+ // addresses.
+ host_->Start(*host_owner_emails_.begin());
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // For Windows, ChromotingHostServices connections are handled by the daemon
+ // process, then the message pipe is forwarded to the network process.
+ host_->StartChromotingHostServices();
+@@ -2043,7 +2043,7 @@ int HostProcessMain() {
+ HOST_LOG << "Starting host process: version " << STRINGIZE(VERSION);
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if defined(REMOTING_USE_X11)
+ // Initialize Xlib for multi-threaded use, allowing non-Chromium code to
+ // use X11 safely (such as the WebRTC capturer, GTK ...)
+@@ -2092,7 +2092,7 @@ int HostProcessMain() {
+ std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier(
+ net::NetworkChangeNotifier::CreateIfNeeded());
+
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(REMOTING_USE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && defined(REMOTING_USE_X11)
+ // Create an X11EventSource on all UI threads, so the global X11 connection
+ // (x11::Connection::Get()) can dispatch X events.
+ auto event_source =
diff --git a/chromium-next/patches/patch-remoting_host_session__policies__from__dict.cc b/chromium-next/patches/patch-remoting_host_session__policies__from__dict.cc
new file mode 100644
index 0000000000..0c200207d8
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_session__policies__from__dict.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/session_policies_from_dict.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/session_policies_from_dict.cc
+@@ -76,7 +76,7 @@ std::optional<SessionPolicies> SessionPo
+ .curtain_required =
+ dict.FindBool(policy::key::kRemoteAccessHostRequireCurtain),
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ .host_username_match_required =
+ dict.FindBool(policy::key::kRemoteAccessHostMatchUsername),
+ #endif
diff --git a/chromium-next/patches/patch-remoting_host_setup_start__host__main.cc b/chromium-next/patches/patch-remoting_host_setup_start__host__main.cc
new file mode 100644
index 0000000000..7b94857625
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_setup_start__host__main.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/setup/start_host_main.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/setup/start_host_main.cc
+@@ -38,7 +38,7 @@
+ #include <unistd.h>
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "remoting/host/setup/daemon_controller_delegate_linux.h"
+ #include "remoting/host/setup/start_host_as_root.h"
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -369,7 +369,7 @@ bool InitializeCloudMachineParams(HostSt
+ } // namespace
+
+ int StartHostMain(int argc, char** argv) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Minimize the amount of code that runs as root on Posix systems.
+ if (getuid() == 0) {
+ return remoting::StartHostAsRoot(argc, argv);
+@@ -394,7 +394,7 @@ int StartHostMain(int argc, char** argv)
+
+ mojo::core::Init();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (command_line->HasSwitch("no-start")) {
+ // On Linux, registering the host with systemd and starting it is the only
+ // reason start_host requires root. The --no-start options skips that final
diff --git a/chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__caller__security__utils.cc b/chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__caller__security__utils.cc
new file mode 100644
index 0000000000..903285b235
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__caller__security__utils.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/webauthn/remote_webauthn_caller_security_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/webauthn/remote_webauthn_caller_security_utils.cc
+@@ -10,7 +10,7 @@
+ #include "base/strings/utf_string_conversions.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "base/containers/fixed_flat_set.h"
+ #include "base/files/file_path.h"
+ #include "base/process/process_handle.h"
+@@ -38,7 +38,7 @@ namespace {
+
+ // No static variables needed for debug builds.
+
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+
+ constexpr auto kAllowedCallerPrograms =
+ base::MakeFixedFlatSet<base::FilePath::StringPieceType>({
+@@ -82,7 +82,7 @@ bool IsLaunchedByTrustedProcess() {
+ #if !defined(NDEBUG)
+ // Just return true on debug builds for the convenience of development.
+ return true;
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ProcessId parent_pid =
+ base::GetParentProcessId(base::GetCurrentProcessHandle());
+ // Note that on Linux the process image may no longer exist in its original
diff --git a/chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__extension__notifier.cc b/chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__extension__notifier.cc
new file mode 100644
index 0000000000..40b65e7ee1
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_host_webauthn_remote__webauthn__extension__notifier.cc
@@ -0,0 +1,34 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/host/webauthn/remote_webauthn_extension_notifier.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/host/webauthn/remote_webauthn_extension_notifier.cc
+@@ -30,7 +30,7 @@
+ #include "base/task/thread_pool.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #include "base/nix/xdg_util.h"
+ #include "base/strings/string_util.h"
+@@ -75,14 +75,14 @@ static constexpr char kExtensionWakeupFi
+ // Caller should check if the directory exists before writing files to it. A
+ // directory only exists if the corresponding Chrome version is installed.
+ std::vector<base::FilePath> GetRemoteStateChangeDirPaths() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ constexpr base::FilePath::CharType kStateChangeDirName[] =
+ FILE_PATH_LITERAL("WebAuthenticationProxyRemoteSessionStateChange");
+ #endif
+
+ std::vector<base::FilePath> dirs;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // See: chrome/common/chrome_paths_linux.cc
+ auto env = base::Environment::Create();
+ base::FilePath base_path;
diff --git a/chromium-next/patches/patch-remoting_protocol_webrtc__video__stream.cc b/chromium-next/patches/patch-remoting_protocol_webrtc__video__stream.cc
new file mode 100644
index 0000000000..e29be7440d
--- /dev/null
+++ b/chromium-next/patches/patch-remoting_protocol_webrtc__video__stream.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- remoting/protocol/webrtc_video_stream.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ remoting/protocol/webrtc_video_stream.cc
+@@ -267,7 +267,7 @@ WebrtcVideoStream::WebrtcVideoStream(con
+ : session_options_(session_options) {
+ // TODO(joedow): Dig into the threading model on other platforms to see if they
+ // can also be updated to run on a dedicated thread.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ core_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner(
+ {base::TaskPriority::HIGHEST},
+ base::SingleThreadTaskRunnerThreadMode::DEDICATED);
diff --git a/chromium-next/patches/patch-sandbox_BUILD.gn b/chromium-next/patches/patch-sandbox_BUILD.gn
new file mode 100644
index 0000000000..1f5e7ba727
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/BUILD.gn
+@@ -49,7 +49,7 @@ group("sandbox") {
+ "//sandbox/mac:system_services",
+ "//sandbox/mac/mojom",
+ ]
+- } else if (is_linux || is_chromeos || is_android) {
++ } else if ((is_linux && !is_bsd) || is_chromeos || is_android) {
+ public_deps = [ "//sandbox/linux:sandbox" ]
+ }
+ }
diff --git a/chromium-next/patches/patch-sandbox_features.gni b/chromium-next/patches/patch-sandbox_features.gni
new file mode 100644
index 0000000000..c72a90c3dc
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_features.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/features.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/features.gni
+@@ -6,7 +6,7 @@
+ # currently.
+ # Do not disable seccomp_bpf anywhere without talking to
+ # security%chromium.org@localhost!
+-use_seccomp_bpf = (is_linux || is_chromeos || is_android) &&
++use_seccomp_bpf = !is_bsd && (is_linux || is_chromeos || is_android) &&
+ (current_cpu == "x86" || current_cpu == "x64" ||
+ current_cpu == "arm" || current_cpu == "arm64" ||
+ current_cpu == "mipsel" || current_cpu == "mips64el")
diff --git a/chromium-next/patches/patch-sandbox_linux_BUILD.gn b/chromium-next/patches/patch-sandbox_linux_BUILD.gn
new file mode 100644
index 0000000000..f5238243d0
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_linux_BUILD.gn
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/linux/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/linux/BUILD.gn
+@@ -12,11 +12,11 @@ if (is_android) {
+ }
+
+ declare_args() {
+- compile_suid_client = is_linux || is_chromeos
++ compile_suid_client = (is_linux || is_chromeos) && !is_bsd
+
+- compile_credentials = is_linux || is_chromeos
++ compile_credentials = (is_linux || is_chromeos) && !is_bsd
+
+- compile_syscall_broker = is_linux || is_chromeos
++ compile_syscall_broker = (is_linux || is_chromeos) && !is_bsd
+
+ # On Android, use plain GTest.
+ use_base_test_suite = is_linux || is_chromeos
+@@ -380,6 +380,17 @@ component("sandbox_services") {
+ "services/libc_interceptor.h",
+ ]
+ }
++
++ if (is_bsd) {
++ sources -= [
++ "services/scoped_process.cc",
++ "services/scoped_process.h",
++ "services/syscall_wrappers.cc",
++ "services/syscall_wrappers.h",
++ "services/yama.cc",
++ "services/yama.h",
++ ]
++ }
+ }
+
+ source_set("sandbox_services_headers") {
diff --git a/chromium-next/patches/patch-sandbox_linux_services_init__process__reaper.cc b/chromium-next/patches/patch-sandbox_linux_services_init__process__reaper.cc
new file mode 100644
index 0000000000..9d32eeb64c
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_linux_services_init__process__reaper.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/linux/services/init_process_reaper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/linux/services/init_process_reaper.cc
+@@ -2,6 +2,7 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+
++#if 0
+ #include "sandbox/linux/services/init_process_reaper.h"
+
+ #include <signal.h>
+@@ -100,3 +101,4 @@ bool CreateInitProcessReaper(base::OnceC
+ }
+
+ } // namespace sandbox.
++#endif
diff --git a/chromium-next/patches/patch-sandbox_linux_services_libc__interceptor.cc b/chromium-next/patches/patch-sandbox_linux_services_libc__interceptor.cc
new file mode 100644
index 0000000000..e9f19a367a
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_linux_services_libc__interceptor.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/linux/services/libc_interceptor.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/linux/services/libc_interceptor.cc
+@@ -17,7 +17,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ #include <time.h>
+@@ -173,7 +175,7 @@ bool ReadTimeStruct(base::PickleIterator
+ } else {
+ base::AutoLock lock(g_timezones_lock.Get());
+ auto ret_pair = g_timezones.Get().insert(timezone);
+- output->tm_zone = ret_pair.first->c_str();
++ output->tm_zone = (char *)ret_pair.first->c_str();
+ }
+
+ return true;
diff --git a/chromium-next/patches/patch-sandbox_policy_BUILD.gn b/chromium-next/patches/patch-sandbox_policy_BUILD.gn
new file mode 100644
index 0000000000..5598dd0987
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_BUILD.gn
@@ -0,0 +1,56 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/BUILD.gn
+@@ -50,7 +50,7 @@ component("policy") {
+ "//third_party/jni_zero",
+ ]
+ }
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "linux/bpf_audio_policy_linux.cc",
+ "linux/bpf_audio_policy_linux.h",
+@@ -129,6 +129,38 @@ component("policy") {
+ "//sandbox/linux:suid_sandbox_client",
+ ]
+ }
++ if (is_openbsd) {
++ sources += [
++ "openbsd/sandbox_openbsd.cc",
++ "openbsd/sandbox_openbsd.h",
++ ]
++ deps += [
++ "//sandbox:sandbox_buildflags",
++ "//ui/gfx/x",
++ ]
++ libs = [ "util" ]
++ }
++ if (is_netbsd) {
++ sources += [
++ "netbsd/sandbox_netbsd.cc",
++ "netbsd/sandbox_netbsd.h",
++ ]
++ deps += [
++ "//sandbox:sandbox_buildflags",
++ "//ui/gfx/x",
++ ]
++ libs = [ "util" ]
++ }
++ if (is_freebsd) {
++ sources += [
++ "freebsd/sandbox_freebsd.cc",
++ "freebsd/sandbox_freebsd.h",
++ ]
++ deps += [
++ "//sandbox:sandbox_buildflags",
++ "//ui/gfx/x",
++ ]
++ }
+ if (is_chromeos_ash) {
+ sources += [
+ "linux/bpf_ime_policy_linux.cc",
diff --git a/chromium-next/patches/patch-sandbox_policy_features.cc b/chromium-next/patches/patch-sandbox_policy_features.cc
new file mode 100644
index 0000000000..6d6d79b123
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_features.cc
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/features.cc
+@@ -20,7 +20,11 @@ namespace sandbox::policy::features {
+ // (Only causes an effect when feature kNetworkServiceInProcess is disabled.)
+ BASE_FEATURE(kNetworkServiceSandbox,
+ "NetworkServiceSandbox",
++#if BUILDFLAG(IS_BSD)
++ base::FEATURE_ENABLED_BY_DEFAULT);
++#else
+ base::FEATURE_DISABLED_BY_DEFAULT);
++#endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ // Enables a fine-grained seccomp-BPF syscall filter for the network service.
+@@ -132,7 +136,7 @@ BASE_FEATURE(kSpectreVariant2Mitigation,
+ base::FEATURE_ENABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Enabling the kNetworkServiceSandbox feature automatically enables Spectre
+ // variant 2 mitigations in the network service. This can lead to performance
+ // regressions, so enabling this feature will turn off the Spectre Variant 2
diff --git a/chromium-next/patches/patch-sandbox_policy_features.h b/chromium-next/patches/patch-sandbox_policy_features.h
new file mode 100644
index 0000000000..1d8ad9fec4
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/features.h
+@@ -45,7 +45,7 @@ SANDBOX_POLICY_EXPORT BASE_DECLARE_FEATU
+ SANDBOX_POLICY_EXPORT BASE_DECLARE_FEATURE(kSpectreVariant2Mitigation);
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT BASE_DECLARE_FEATURE(
+ kForceDisableSpectreVariant2MitigationInNetworkService);
+
diff --git a/chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.cc b/chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.cc
new file mode 100644
index 0000000000..d6e33bf8ae
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.cc
@@ -0,0 +1,220 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/freebsd/sandbox_freebsd.cc.orig 2025-01-20 18:01:27.941298740 +0000
++++ sandbox/policy/freebsd/sandbox_freebsd.cc
+@@ -0,0 +1,211 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "sandbox/policy/freebsd/sandbox_freebsd.h"
++
++#include <dirent.h>
++#include <fcntl.h>
++#include <stdint.h>
++#include <sys/resource.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <unistd.h>
++
++#include <limits>
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/command_line.h"
++#include "base/debug/stack_trace.h"
++#include "base/feature_list.h"
++#include "base/files/file_path.h"
++#include "base/files/file_util.h"
++#include "base/files/scoped_file.h"
++#include "base/logging.h"
++#include "base/memory/singleton.h"
++#include "base/path_service.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/system/sys_info.h"
++#include "base/threading/thread.h"
++#include "base/time/time.h"
++#include "build/build_config.h"
++#include "crypto/crypto_buildflags.h"
++#include "ppapi/buildflags/buildflags.h"
++#include "sandbox/constants.h"
++#include "sandbox/linux/services/credentials.h"
++#include "sandbox/linux/services/namespace_sandbox.h"
++#include "sandbox/linux/services/proc_util.h"
++#include "sandbox/linux/services/resource_limits.h"
++#include "sandbox/linux/services/thread_helpers.h"
++#include "sandbox/linux/syscall_broker/broker_command.h"
++#include "sandbox/linux/syscall_broker/broker_process.h"
++#include "sandbox/policy/sandbox.h"
++#include "sandbox/policy/sandbox_type.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/switches.h"
++#include "sandbox/sandbox_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++#if BUILDFLAG(USE_NSS_CERTS)
++#include "crypto/nss_util.h"
++#endif
++
++#include "third_party/boringssl/src/include/openssl/crypto.h"
++
++#include "ui/gfx/font_util.h"
++
++namespace sandbox {
++namespace policy {
++
++SandboxLinux::SandboxLinux()
++ : sandbox_status_flags_(kInvalid),
++ pre_initialized_(false),
++ initialize_sandbox_ran_(false),
++ broker_process_(nullptr) {
++}
++
++SandboxLinux::~SandboxLinux() {
++ if (pre_initialized_) {
++ CHECK(initialize_sandbox_ran_);
++ }
++}
++
++SandboxLinux* SandboxLinux::GetInstance() {
++ SandboxLinux* instance = base::Singleton<SandboxLinux>::get();
++ CHECK(instance);
++ return instance;
++}
++
++void SandboxLinux::StopThread(base::Thread* thread) {
++ DCHECK(thread);
++ thread->Stop();
++}
++
++void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) {
++ CHECK(!pre_initialized_);
++#if BUILDFLAG(USING_SANITIZER)
++ // Sanitizers need to open some resources before the sandbox is enabled.
++ // This should not fork, not launch threads, not open a directory.
++ __sanitizer_sandbox_on_notify(sanitizer_args());
++ sanitizer_args_.reset();
++#endif
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ base::SysInfo::AmountOfPhysicalMemory();
++ base::SysInfo::NumberOfProcessors();
++ base::SysInfo::CPUModelName();
++
++ switch (sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ {
++#if BUILDFLAG(USE_NSS_CERTS)
++ // The main process has to initialize the ~/.pki dir which won't work
++ // after unveil(2).
++ crypto::EnsureNSSInit();
++#endif
++ CRYPTO_pre_sandbox_init();
++
++ base::FilePath cache_directory, local_directory;
++
++ base::PathService::Get(base::DIR_CACHE, &cache_directory);
++ base::PathService::Get(base::DIR_HOME, &local_directory);
++
++ cache_directory = cache_directory.AppendASCII("chromium");
++ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
++
++ if (!base::CreateDirectory(cache_directory)) {
++ LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory.";
++ }
++
++ if (!base::CreateDirectory(local_directory)) {
++ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory.";
++ }
++
++ break;
++ }
++ case sandbox::mojom::Sandbox::kRenderer:
++ gfx::InitializeFonts();
++ break;
++ default:
++ break;
++ }
++
++ pre_initialized_ = true;
++}
++
++bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ SandboxLinux::PreSandboxHook hook,
++ const Options& options) {
++ DCHECK(!initialize_sandbox_ran_);
++ initialize_sandbox_ran_ = true;
++
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ if (command_line->HasSwitch(switches::kNoSandbox))
++ return true;
++
++ VLOG(1) << "SandboxLinux::InitializeSandbox: process_type="
++ << process_type << " sandbox_type=" << sandbox_type;
++
++ // Only one thread is running, pre-initialize if not already done.
++ if (!pre_initialized_)
++ PreinitializeSandbox(sandbox_type);
++
++ // Attempt to limit the future size of the address space of the process.
++ int error = 0;
++ const bool limited_as = LimitAddressSpace(&error);
++ if (error) {
++ // Restore errno. Internally to |LimitAddressSpace|, the errno due to
++ // setrlimit may be lost.
++ errno = error;
++ PCHECK(limited_as);
++ }
++
++ if (hook)
++ CHECK(std::move(hook).Run(options));
++
++ return true;
++}
++
++bool SandboxLinux::LimitAddressSpace(int* error) {
++#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
++ !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) {
++ return false;
++ }
++
++ // Unfortunately, it does not appear possible to set RLIMIT_AS such that it
++ // will both (a) be high enough to support V8's and WebAssembly's address
++ // space requirements while also (b) being low enough to mitigate exploits
++ // using integer overflows that require large allocations, heap spray, or
++ // other memory-hungry attack modes.
++
++ *error = sandbox::ResourceLimits::Lower(
++ RLIMIT_DATA, static_cast<rlim_t>(sandbox::kDataSizeLimit));
++
++ // Cache the resource limit before turning on the sandbox.
++ base::SysInfo::AmountOfVirtualMemory();
++ base::SysInfo::MaxSharedMemorySize();
++
++ return *error == 0;
++#else
++ base::SysInfo::AmountOfVirtualMemory();
++ return false;
++#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) &&
++ // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++}
++
++} // namespace policy
++} // namespace sandbox
diff --git a/chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.h b/chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.h
new file mode 100644
index 0000000000..1e5c693041
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_freebsd_sandbox__freebsd.h
@@ -0,0 +1,285 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/freebsd/sandbox_freebsd.h.orig 2025-01-20 18:01:27.941422550 +0000
++++ sandbox/policy/freebsd/sandbox_freebsd.h
+@@ -0,0 +1,276 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++#ifndef SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++#define SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/logging.h"
++#include "base/posix/global_descriptors.h"
++#include "sandbox/policy/export.h"
++#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "base/sanitizer_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++namespace base {
++template <typename T>
++struct DefaultSingletonTraits;
++class Thread;
++} // namespace base
++
++namespace sandbox {
++namespace syscall_broker {
++class BrokerProcess;
++} // namespace syscall_broker
++} // namespace sandbox
++
++namespace sandbox {
++namespace policy {
++
++// A singleton class to represent and change our sandboxing state for the
++// three main Linux sandboxes.
++// The sandboxing model allows using two layers of sandboxing. The first layer
++// can be implemented either with unprivileged namespaces or with the setuid
++// sandbox. This class provides a way to engage the namespace sandbox, but does
++// not deal with the legacy setuid sandbox directly.
++// The second layer is mainly based on seccomp-bpf and is engaged with
++// InitializeSandbox(). InitializeSandbox() is also responsible for "sealing"
++// the first layer of sandboxing. That is, InitializeSandbox must always be
++// called to have any meaningful sandboxing at all.
++class SANDBOX_POLICY_EXPORT SandboxLinux {
++ public:
++ // This is a list of sandbox IPC methods which the renderer may send to the
++ // sandbox host. See
++ // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md
++ // This isn't the full list, values < 32 are reserved for methods called from
++ // Skia, and values < 64 are reserved for libc_interceptor.cc.
++ enum LinuxSandboxIPCMethods {
++ DEPRECATED_METHOD_GET_FALLBACK_FONT_FOR_CHAR = 64,
++ DEPRECATED_METHOD_GET_CHILD_WITH_INODE,
++ DEPRECATED_METHOD_GET_STYLE_FOR_STRIKE,
++ METHOD_MAKE_SHARED_MEMORY_SEGMENT,
++ DEPRECATED_METHOD_MATCH_WITH_FALLBACK,
++ };
++
++ // These form a bitmask which describes the conditions of the Linux sandbox.
++ // Note: this doesn't strictly give you the current status, it states
++ // what will be enabled when the relevant processes are initialized.
++ enum Status {
++ // SUID sandbox active.
++ kSUID = 1 << 0,
++
++ // Sandbox is using a new PID namespace.
++ kPIDNS = 1 << 1,
++
++ // Sandbox is using a new network namespace.
++ kNetNS = 1 << 2,
++
++ // seccomp-bpf sandbox active.
++ kSeccompBPF = 1 << 3,
++
++ // The Yama LSM module is present and enforcing.
++ kYama = 1 << 4,
++
++ // seccomp-bpf sandbox is active and the kernel supports TSYNC.
++ kSeccompTSYNC = 1 << 5,
++
++ // User namespace sandbox active.
++ kUserNS = 1 << 6,
++
++ // A flag that denotes an invalid sandbox status.
++ kInvalid = 1 << 31,
++ };
++
++ // SandboxLinux Options are a superset of SandboxSecompBPF Options.
++ struct Options : public SandboxSeccompBPF::Options {
++ // When running with a zygote, the namespace sandbox will have already
++ // been engaged prior to initializing SandboxLinux itself, and need not
++ // be done so again. Set to true to indicate that there isn't a zygote
++ // for this process and the step is to be performed here explicitly.
++ bool engage_namespace_sandbox = false;
++
++ // Allow starting the sandbox with multiple threads already running. This
++ // will enable TSYNC for seccomp-BPF, which syncs the seccomp-BPF policy
++ // across all running threads.
++ bool allow_threads_during_sandbox_init = false;
++
++ // Enables the CHECK for open directories. The open directory check is only
++ // useful for the chroot jail (from the semantic layer of the sandbox), and
++ // can safely be disabled if we are only enabling the seccomp-BPF layer.
++ bool check_for_open_directories = true;
++ };
++
++ // Callers can provide this hook to run code right before the policy
++ // is passed to the BPF compiler and the sandbox is engaged. If
++ // pre_sandbox_hook() returns true, the sandbox will be engaged
++ // afterwards, otherwise the process is terminated.
++ using PreSandboxHook = base::OnceCallback<bool(Options)>;
++
++ // Get our singleton instance.
++ static SandboxLinux* GetInstance();
++
++ SandboxLinux(const SandboxLinux&) = delete;
++ SandboxLinux& operator=(const SandboxLinux&) = delete;
++
++ bool SetPledge(const char *pstring, const char *ppath);
++ bool SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type);
++
++ // Do some initialization that can only be done before any of the sandboxes
++ // are enabled. If using the setuid sandbox, this should be called manually
++ // before the setuid sandbox is engaged.
++ // Security: When this runs, it is imperative that either InitializeSandbox()
++ // runs as well or that all file descriptors returned in
++ // GetFileDescriptorsToClose() get closed.
++ // Otherwise file descriptors that bypass the security of the setuid sandbox
++ // would be kept open. One must be particularly careful if a process performs
++ // a fork().
++ void PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type);
++
++ // Check that the current process is the init process of a new PID
++ // namespace and then proceed to drop access to the file system by using
++ // a new unprivileged namespace. This is a layer-1 sandbox.
++ // In order for this sandbox to be effective, it must be "sealed" by calling
++ // InitializeSandbox().
++ void EngageNamespaceSandbox(bool from_zygote);
++
++ // Return a list of file descriptors to close if PreinitializeSandbox() ran
++ // but InitializeSandbox() won't. Avoid using.
++ // TODO(jln): get rid of this hack.
++ std::vector<int> GetFileDescriptorsToClose();
++
++ // Seal an eventual layer-1 sandbox and initialize the layer-2 sandbox with
++ // an adequate policy depending on the process type and command line
++ // arguments.
++ // Currently the layer-2 sandbox is composed of seccomp-bpf and address space
++ // limitations.
++ // This function should only be called without any thread running.
++ bool InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Stop |thread| in a way that can be trusted by the sandbox.
++ void StopThread(base::Thread* thread);
++
++ // Returns the status of the renderer, worker and ppapi sandbox. Can only
++ // be queried after going through PreinitializeSandbox(). This is a bitmask
++ // and uses the constants defined in "enum Status" above. Since the
++ // status needs to be provided before the sandboxes are actually started,
++ // this returns what will actually happen once InitializeSandbox()
++ // is called from inside these processes.
++ int GetStatus();
++
++ // Returns true if the current process is single-threaded or if the number
++ // of threads cannot be determined.
++ bool IsSingleThreaded() const;
++
++ // Returns true if we started Seccomp BPF.
++ bool seccomp_bpf_started() const;
++
++ // Check the policy and eventually start the seccomp-bpf sandbox. This should
++ // never be called with threads started. If we detect that threads have
++ // started we will crash.
++ bool StartSeccompBPF(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Limit the address space of the current process (and its children) to make
++ // some vulnerabilities harder to exploit. Writes the errno due to setrlimit
++ // (including 0 if no error) into |error|.
++ bool LimitAddressSpace(int* error);
++
++ // Returns a file descriptor to proc. The file descriptor is no longer valid
++ // after the sandbox has been sealed.
++ int proc_fd() const {
++ DCHECK_NE(-1, proc_fd_);
++ return proc_fd_;
++ }
++
++#if BUILDFLAG(USING_SANITIZER)
++ __sanitizer_sandbox_arguments* sanitizer_args() const {
++ return sanitizer_args_.get();
++ };
++#endif
++
++ // A BrokerProcess is a helper that is started before the sandbox is engaged,
++ // typically from a pre-sandbox hook, that will serve requests to access
++ // files over an IPC channel. The client of this runs from a SIGSYS handler
++ // triggered by the seccomp-bpf sandbox.
++ // |client_sandbox_policy| is the policy being run by the client, and is
++ // used to derive the equivalent broker-side policy.
++ // |broker_side_hook| is an alternate pre-sandbox hook to be run before the
++ // broker itself gets sandboxed, to which the broker side policy and
++ // |options| are passed.
++ // Crashes the process if the broker can not be started since continuation
++ // is impossible (and presumably unsafe).
++ // This should never be destroyed, as after the sandbox is started it is
++ // vital to the process.
++#if 0
++ void StartBrokerProcess(
++ const sandbox::syscall_broker::BrokerCommandSet& allowed_command_set,
++ std::vector<sandbox::syscall_broker::BrokerFilePermission> permissions,
++ PreSandboxHook broker_side_hook,
++ const Options& options);
++
++ sandbox::syscall_broker::BrokerProcess* broker_process() const {
++ return broker_process_;
++ }
++#endif
++
++ private:
++ friend struct base::DefaultSingletonTraits<SandboxLinux>;
++
++ SandboxLinux();
++ ~SandboxLinux();
++
++ // We must have been pre_initialized_ before using these.
++ bool seccomp_bpf_supported() const;
++ bool seccomp_bpf_with_tsync_supported() const;
++
++ // Returns true if it can be determined that the current process has open
++ // directories that are not managed by the SandboxLinux class. This would
++ // be a vulnerability as it would allow to bypass the setuid sandbox.
++ bool HasOpenDirectories() const;
++
++ // The last part of the initialization is to make sure any temporary "hole"
++ // in the sandbox is closed. For now, this consists of closing proc_fd_.
++ void SealSandbox();
++
++ // GetStatus() makes promises as to how the sandbox will behave. This
++ // checks that no promises have been broken.
++ void CheckForBrokenPromises(sandbox::mojom::Sandbox sandbox_type);
++
++ // Stop |thread| and make sure it does not appear in /proc/self/tasks/
++ // anymore.
++ void StopThreadAndEnsureNotCounted(base::Thread* thread) const;
++
++ // A file descriptor to /proc. It's dangerous to have it around as it could
++ // allow for sandbox bypasses. It needs to be closed before we consider
++ // ourselves sandboxed.
++ int proc_fd_;
++
++ bool seccomp_bpf_started_;
++ // The value returned by GetStatus(). Gets computed once and then cached.
++ int sandbox_status_flags_;
++ // Did PreinitializeSandbox() run?
++ bool pre_initialized_;
++ bool seccomp_bpf_supported_; // Accurate if pre_initialized_.
++ bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_.
++ bool yama_is_enforcing_; // Accurate if pre_initialized_.
++ bool initialize_sandbox_ran_; // InitializeSandbox() was called.
++#if BUILDFLAG(USING_SANITIZER)
++ std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_;
++#endif
++ sandbox::syscall_broker::BrokerProcess* broker_process_; // Leaked as global.
++};
++
++} // namespace policy
++} // namespace sandbox
++
++#endif // SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
diff --git a/chromium-next/patches/patch-sandbox_policy_mojom_sandbox.mojom b/chromium-next/patches/patch-sandbox_policy_mojom_sandbox.mojom
new file mode 100644
index 0000000000..a41ac2cc41
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_mojom_sandbox.mojom
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/mojom/sandbox.mojom.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/mojom/sandbox.mojom
+@@ -81,6 +81,15 @@ enum Sandbox {
+ [EnableIf=is_fuchsia]
+ kVideoCapture,
+
++ [EnableIf=is_openbsd]
++ kVideoCapture,
++
++ [EnableIf=is_netbsd]
++ kVideoCapture,
++
++ [EnableIf=is_freebsd]
++ kVideoCapture,
++
+ // Allows access to file contents and Windows APIs for parsing icons from PE
+ // files.
+ [EnableIf=is_win]
diff --git a/chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.cc b/chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.cc
new file mode 100644
index 0000000000..a4802493b3
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.cc
@@ -0,0 +1,220 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/netbsd/sandbox_netbsd.cc.orig 2025-01-20 18:01:27.941719876 +0000
++++ sandbox/policy/netbsd/sandbox_netbsd.cc
+@@ -0,0 +1,211 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "sandbox/policy/netbsd/sandbox_netbsd.h"
++
++#include <dirent.h>
++#include <fcntl.h>
++#include <stdint.h>
++#include <sys/resource.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <unistd.h>
++
++#include <limits>
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/command_line.h"
++#include "base/debug/stack_trace.h"
++#include "base/feature_list.h"
++#include "base/files/file_path.h"
++#include "base/files/file_util.h"
++#include "base/files/scoped_file.h"
++#include "base/logging.h"
++#include "base/memory/singleton.h"
++#include "base/path_service.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/system/sys_info.h"
++#include "base/threading/thread.h"
++#include "base/time/time.h"
++#include "build/build_config.h"
++#include "crypto/crypto_buildflags.h"
++#include "ppapi/buildflags/buildflags.h"
++#include "sandbox/constants.h"
++#include "sandbox/linux/services/credentials.h"
++#include "sandbox/linux/services/namespace_sandbox.h"
++#include "sandbox/linux/services/proc_util.h"
++#include "sandbox/linux/services/resource_limits.h"
++#include "sandbox/linux/services/thread_helpers.h"
++#include "sandbox/linux/syscall_broker/broker_command.h"
++#include "sandbox/linux/syscall_broker/broker_process.h"
++#include "sandbox/policy/sandbox.h"
++#include "sandbox/policy/sandbox_type.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/switches.h"
++#include "sandbox/sandbox_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++#if BUILDFLAG(USE_NSS_CERTS)
++#include "crypto/nss_util.h"
++#endif
++
++#include "third_party/boringssl/src/include/openssl/crypto.h"
++
++#include "ui/gfx/font_util.h"
++
++namespace sandbox {
++namespace policy {
++
++SandboxLinux::SandboxLinux()
++ : sandbox_status_flags_(kInvalid),
++ pre_initialized_(false),
++ initialize_sandbox_ran_(false),
++ broker_process_(nullptr) {
++}
++
++SandboxLinux::~SandboxLinux() {
++ if (pre_initialized_) {
++ CHECK(initialize_sandbox_ran_);
++ }
++}
++
++SandboxLinux* SandboxLinux::GetInstance() {
++ SandboxLinux* instance = base::Singleton<SandboxLinux>::get();
++ CHECK(instance);
++ return instance;
++}
++
++void SandboxLinux::StopThread(base::Thread* thread) {
++ DCHECK(thread);
++ thread->Stop();
++}
++
++void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) {
++ CHECK(!pre_initialized_);
++#if BUILDFLAG(USING_SANITIZER)
++ // Sanitizers need to open some resources before the sandbox is enabled.
++ // This should not fork, not launch threads, not open a directory.
++ __sanitizer_sandbox_on_notify(sanitizer_args());
++ sanitizer_args_.reset();
++#endif
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ base::SysInfo::AmountOfPhysicalMemory();
++ base::SysInfo::NumberOfProcessors();
++ base::SysInfo::CPUModelName();
++
++ switch (sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ {
++#if BUILDFLAG(USE_NSS_CERTS)
++ // The main process has to initialize the ~/.pki dir which won't work
++ // after unveil(2).
++ crypto::EnsureNSSInit();
++#endif
++ CRYPTO_pre_sandbox_init();
++
++ base::FilePath cache_directory, local_directory;
++
++ base::PathService::Get(base::DIR_CACHE, &cache_directory);
++ base::PathService::Get(base::DIR_HOME, &local_directory);
++
++ cache_directory = cache_directory.AppendASCII("chromium");
++ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
++
++ if (!base::CreateDirectory(cache_directory)) {
++ LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory.";
++ }
++
++ if (!base::CreateDirectory(local_directory)) {
++ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory.";
++ }
++
++ break;
++ }
++ case sandbox::mojom::Sandbox::kRenderer:
++ gfx::InitializeFonts();
++ break;
++ default:
++ break;
++ }
++
++ pre_initialized_ = true;
++}
++
++bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ SandboxLinux::PreSandboxHook hook,
++ const Options& options) {
++ DCHECK(!initialize_sandbox_ran_);
++ initialize_sandbox_ran_ = true;
++
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ if (command_line->HasSwitch(switches::kNoSandbox))
++ return true;
++
++ VLOG(1) << "SandboxLinux::InitializeSandbox: process_type="
++ << process_type << " sandbox_type=" << sandbox_type;
++
++ // Only one thread is running, pre-initialize if not already done.
++ if (!pre_initialized_)
++ PreinitializeSandbox(sandbox_type);
++
++ // Attempt to limit the future size of the address space of the process.
++ int error = 0;
++ const bool limited_as = LimitAddressSpace(&error);
++ if (error) {
++ // Restore errno. Internally to |LimitAddressSpace|, the errno due to
++ // setrlimit may be lost.
++ errno = error;
++ PCHECK(limited_as);
++ }
++
++ if (hook)
++ CHECK(std::move(hook).Run(options));
++
++ return true;
++}
++
++bool SandboxLinux::LimitAddressSpace(int* error) {
++#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
++ !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) {
++ return false;
++ }
++
++ // Unfortunately, it does not appear possible to set RLIMIT_AS such that it
++ // will both (a) be high enough to support V8's and WebAssembly's address
++ // space requirements while also (b) being low enough to mitigate exploits
++ // using integer overflows that require large allocations, heap spray, or
++ // other memory-hungry attack modes.
++
++ *error = sandbox::ResourceLimits::Lower(
++ RLIMIT_DATA, static_cast<rlim_t>(sandbox::kDataSizeLimit));
++
++ // Cache the resource limit before turning on the sandbox.
++ base::SysInfo::AmountOfVirtualMemory();
++ base::SysInfo::MaxSharedMemorySize();
++
++ return *error == 0;
++#else
++ base::SysInfo::AmountOfVirtualMemory();
++ return false;
++#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) &&
++ // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++}
++
++} // namespace policy
++} // namespace sandbox
diff --git a/chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.h b/chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.h
new file mode 100644
index 0000000000..362dd71fa0
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_netbsd_sandbox__netbsd.h
@@ -0,0 +1,285 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/netbsd/sandbox_netbsd.h.orig 2025-01-20 18:01:27.941837073 +0000
++++ sandbox/policy/netbsd/sandbox_netbsd.h
+@@ -0,0 +1,276 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++#ifndef SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++#define SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/logging.h"
++#include "base/posix/global_descriptors.h"
++#include "sandbox/policy/export.h"
++#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "base/sanitizer_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++namespace base {
++template <typename T>
++struct DefaultSingletonTraits;
++class Thread;
++} // namespace base
++
++namespace sandbox {
++namespace syscall_broker {
++class BrokerProcess;
++} // namespace syscall_broker
++} // namespace sandbox
++
++namespace sandbox {
++namespace policy {
++
++// A singleton class to represent and change our sandboxing state for the
++// three main Linux sandboxes.
++// The sandboxing model allows using two layers of sandboxing. The first layer
++// can be implemented either with unprivileged namespaces or with the setuid
++// sandbox. This class provides a way to engage the namespace sandbox, but does
++// not deal with the legacy setuid sandbox directly.
++// The second layer is mainly based on seccomp-bpf and is engaged with
++// InitializeSandbox(). InitializeSandbox() is also responsible for "sealing"
++// the first layer of sandboxing. That is, InitializeSandbox must always be
++// called to have any meaningful sandboxing at all.
++class SANDBOX_POLICY_EXPORT SandboxLinux {
++ public:
++ // This is a list of sandbox IPC methods which the renderer may send to the
++ // sandbox host. See
++ // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md
++ // This isn't the full list, values < 32 are reserved for methods called from
++ // Skia, and values < 64 are reserved for libc_interceptor.cc.
++ enum LinuxSandboxIPCMethods {
++ DEPRECATED_METHOD_GET_FALLBACK_FONT_FOR_CHAR = 64,
++ DEPRECATED_METHOD_GET_CHILD_WITH_INODE,
++ DEPRECATED_METHOD_GET_STYLE_FOR_STRIKE,
++ METHOD_MAKE_SHARED_MEMORY_SEGMENT,
++ DEPRECATED_METHOD_MATCH_WITH_FALLBACK,
++ };
++
++ // These form a bitmask which describes the conditions of the Linux sandbox.
++ // Note: this doesn't strictly give you the current status, it states
++ // what will be enabled when the relevant processes are initialized.
++ enum Status {
++ // SUID sandbox active.
++ kSUID = 1 << 0,
++
++ // Sandbox is using a new PID namespace.
++ kPIDNS = 1 << 1,
++
++ // Sandbox is using a new network namespace.
++ kNetNS = 1 << 2,
++
++ // seccomp-bpf sandbox active.
++ kSeccompBPF = 1 << 3,
++
++ // The Yama LSM module is present and enforcing.
++ kYama = 1 << 4,
++
++ // seccomp-bpf sandbox is active and the kernel supports TSYNC.
++ kSeccompTSYNC = 1 << 5,
++
++ // User namespace sandbox active.
++ kUserNS = 1 << 6,
++
++ // A flag that denotes an invalid sandbox status.
++ kInvalid = 1 << 31,
++ };
++
++ // SandboxLinux Options are a superset of SandboxSecompBPF Options.
++ struct Options : public SandboxSeccompBPF::Options {
++ // When running with a zygote, the namespace sandbox will have already
++ // been engaged prior to initializing SandboxLinux itself, and need not
++ // be done so again. Set to true to indicate that there isn't a zygote
++ // for this process and the step is to be performed here explicitly.
++ bool engage_namespace_sandbox = false;
++
++ // Allow starting the sandbox with multiple threads already running. This
++ // will enable TSYNC for seccomp-BPF, which syncs the seccomp-BPF policy
++ // across all running threads.
++ bool allow_threads_during_sandbox_init = false;
++
++ // Enables the CHECK for open directories. The open directory check is only
++ // useful for the chroot jail (from the semantic layer of the sandbox), and
++ // can safely be disabled if we are only enabling the seccomp-BPF layer.
++ bool check_for_open_directories = true;
++ };
++
++ // Callers can provide this hook to run code right before the policy
++ // is passed to the BPF compiler and the sandbox is engaged. If
++ // pre_sandbox_hook() returns true, the sandbox will be engaged
++ // afterwards, otherwise the process is terminated.
++ using PreSandboxHook = base::OnceCallback<bool(Options)>;
++
++ // Get our singleton instance.
++ static SandboxLinux* GetInstance();
++
++ SandboxLinux(const SandboxLinux&) = delete;
++ SandboxLinux& operator=(const SandboxLinux&) = delete;
++
++ bool SetPledge(const char *pstring, const char *ppath);
++ bool SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type);
++
++ // Do some initialization that can only be done before any of the sandboxes
++ // are enabled. If using the setuid sandbox, this should be called manually
++ // before the setuid sandbox is engaged.
++ // Security: When this runs, it is imperative that either InitializeSandbox()
++ // runs as well or that all file descriptors returned in
++ // GetFileDescriptorsToClose() get closed.
++ // Otherwise file descriptors that bypass the security of the setuid sandbox
++ // would be kept open. One must be particularly careful if a process performs
++ // a fork().
++ void PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type);
++
++ // Check that the current process is the init process of a new PID
++ // namespace and then proceed to drop access to the file system by using
++ // a new unprivileged namespace. This is a layer-1 sandbox.
++ // In order for this sandbox to be effective, it must be "sealed" by calling
++ // InitializeSandbox().
++ void EngageNamespaceSandbox(bool from_zygote);
++
++ // Return a list of file descriptors to close if PreinitializeSandbox() ran
++ // but InitializeSandbox() won't. Avoid using.
++ // TODO(jln): get rid of this hack.
++ std::vector<int> GetFileDescriptorsToClose();
++
++ // Seal an eventual layer-1 sandbox and initialize the layer-2 sandbox with
++ // an adequate policy depending on the process type and command line
++ // arguments.
++ // Currently the layer-2 sandbox is composed of seccomp-bpf and address space
++ // limitations.
++ // This function should only be called without any thread running.
++ bool InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Stop |thread| in a way that can be trusted by the sandbox.
++ void StopThread(base::Thread* thread);
++
++ // Returns the status of the renderer, worker and ppapi sandbox. Can only
++ // be queried after going through PreinitializeSandbox(). This is a bitmask
++ // and uses the constants defined in "enum Status" above. Since the
++ // status needs to be provided before the sandboxes are actually started,
++ // this returns what will actually happen once InitializeSandbox()
++ // is called from inside these processes.
++ int GetStatus();
++
++ // Returns true if the current process is single-threaded or if the number
++ // of threads cannot be determined.
++ bool IsSingleThreaded() const;
++
++ // Returns true if we started Seccomp BPF.
++ bool seccomp_bpf_started() const;
++
++ // Check the policy and eventually start the seccomp-bpf sandbox. This should
++ // never be called with threads started. If we detect that threads have
++ // started we will crash.
++ bool StartSeccompBPF(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Limit the address space of the current process (and its children) to make
++ // some vulnerabilities harder to exploit. Writes the errno due to setrlimit
++ // (including 0 if no error) into |error|.
++ bool LimitAddressSpace(int* error);
++
++ // Returns a file descriptor to proc. The file descriptor is no longer valid
++ // after the sandbox has been sealed.
++ int proc_fd() const {
++ DCHECK_NE(-1, proc_fd_);
++ return proc_fd_;
++ }
++
++#if BUILDFLAG(USING_SANITIZER)
++ __sanitizer_sandbox_arguments* sanitizer_args() const {
++ return sanitizer_args_.get();
++ };
++#endif
++
++ // A BrokerProcess is a helper that is started before the sandbox is engaged,
++ // typically from a pre-sandbox hook, that will serve requests to access
++ // files over an IPC channel. The client of this runs from a SIGSYS handler
++ // triggered by the seccomp-bpf sandbox.
++ // |client_sandbox_policy| is the policy being run by the client, and is
++ // used to derive the equivalent broker-side policy.
++ // |broker_side_hook| is an alternate pre-sandbox hook to be run before the
++ // broker itself gets sandboxed, to which the broker side policy and
++ // |options| are passed.
++ // Crashes the process if the broker can not be started since continuation
++ // is impossible (and presumably unsafe).
++ // This should never be destroyed, as after the sandbox is started it is
++ // vital to the process.
++#if 0
++ void StartBrokerProcess(
++ const sandbox::syscall_broker::BrokerCommandSet& allowed_command_set,
++ std::vector<sandbox::syscall_broker::BrokerFilePermission> permissions,
++ PreSandboxHook broker_side_hook,
++ const Options& options);
++
++ sandbox::syscall_broker::BrokerProcess* broker_process() const {
++ return broker_process_;
++ }
++#endif
++
++ private:
++ friend struct base::DefaultSingletonTraits<SandboxLinux>;
++
++ SandboxLinux();
++ ~SandboxLinux();
++
++ // We must have been pre_initialized_ before using these.
++ bool seccomp_bpf_supported() const;
++ bool seccomp_bpf_with_tsync_supported() const;
++
++ // Returns true if it can be determined that the current process has open
++ // directories that are not managed by the SandboxLinux class. This would
++ // be a vulnerability as it would allow to bypass the setuid sandbox.
++ bool HasOpenDirectories() const;
++
++ // The last part of the initialization is to make sure any temporary "hole"
++ // in the sandbox is closed. For now, this consists of closing proc_fd_.
++ void SealSandbox();
++
++ // GetStatus() makes promises as to how the sandbox will behave. This
++ // checks that no promises have been broken.
++ void CheckForBrokenPromises(sandbox::mojom::Sandbox sandbox_type);
++
++ // Stop |thread| and make sure it does not appear in /proc/self/tasks/
++ // anymore.
++ void StopThreadAndEnsureNotCounted(base::Thread* thread) const;
++
++ // A file descriptor to /proc. It's dangerous to have it around as it could
++ // allow for sandbox bypasses. It needs to be closed before we consider
++ // ourselves sandboxed.
++ int proc_fd_;
++
++ bool seccomp_bpf_started_;
++ // The value returned by GetStatus(). Gets computed once and then cached.
++ int sandbox_status_flags_;
++ // Did PreinitializeSandbox() run?
++ bool pre_initialized_;
++ bool seccomp_bpf_supported_; // Accurate if pre_initialized_.
++ bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_.
++ bool yama_is_enforcing_; // Accurate if pre_initialized_.
++ bool initialize_sandbox_ran_; // InitializeSandbox() was called.
++#if BUILDFLAG(USING_SANITIZER)
++ std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_;
++#endif
++ sandbox::syscall_broker::BrokerProcess* broker_process_; // Leaked as global.
++};
++
++} // namespace policy
++} // namespace sandbox
++
++#endif // SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
diff --git a/chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.cc b/chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.cc
new file mode 100644
index 0000000000..524fb8f2a7
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.cc
@@ -0,0 +1,401 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2025-01-20 18:01:27.942018946 +0000
++++ sandbox/policy/openbsd/sandbox_openbsd.cc
+@@ -0,0 +1,392 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++
++#include <dirent.h>
++#include <fcntl.h>
++#include <stdint.h>
++#include <sys/resource.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <unistd.h>
++#include <util.h>
++
++#include <limits>
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/command_line.h"
++#include "base/debug/stack_trace.h"
++#include "base/feature_list.h"
++#include "base/files/file_path.h"
++#include "base/files/file_util.h"
++#include "base/files/scoped_file.h"
++#include "base/logging.h"
++#include "base/memory/singleton.h"
++#include "base/path_service.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/system/sys_info.h"
++#include "base/threading/thread.h"
++#include "base/time/time.h"
++#include "build/build_config.h"
++#include "crypto/crypto_buildflags.h"
++#include "ppapi/buildflags/buildflags.h"
++#include "sandbox/constants.h"
++#include "sandbox/linux/services/credentials.h"
++#include "sandbox/linux/services/namespace_sandbox.h"
++#include "sandbox/linux/services/proc_util.h"
++#include "sandbox/linux/services/resource_limits.h"
++#include "sandbox/linux/services/thread_helpers.h"
++#include "sandbox/linux/syscall_broker/broker_command.h"
++#include "sandbox/linux/syscall_broker/broker_process.h"
++#include "sandbox/policy/sandbox.h"
++#include "sandbox/policy/sandbox_type.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "sandbox/policy/switches.h"
++#include "sandbox/sandbox_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++#if BUILDFLAG(USE_NSS_CERTS)
++#include "crypto/nss_util.h"
++#endif
++
++#include "third_party/boringssl/src/include/openssl/crypto.h"
++
++#include <fontconfig/fontconfig.h>
++#include "ui/gfx/linux/fontconfig_util.h"
++
++#define MAXTOKENS 3
++
++#define _UNVEIL_MAIN "@PKG_SYSCONFBASE@/chromium/unveil.main";
++#define _UNVEIL_GPU "@PKG_SYSCONFBASE@/chromium/unveil.gpu";
++#define _UNVEIL_UTILITY_NETWORK "@PKG_SYSCONFBASE@/chromium/unveil.utility_network";
++#define _UNVEIL_UTILITY_AUDIO "@PKG_SYSCONFBASE@/chromium/unveil.utility_audio";
++#define _UNVEIL_UTILITY_VIDEO "@PKG_SYSCONFBASE@/chromium/unveil.utility_video";
++
++namespace sandbox {
++namespace policy {
++
++SandboxLinux::SandboxLinux()
++ : unveil_initialized_(false),
++ sandbox_status_flags_(kInvalid),
++ pre_initialized_(false),
++ initialize_sandbox_ran_(false),
++ broker_process_(nullptr) {
++}
++
++SandboxLinux::~SandboxLinux() {
++ if (pre_initialized_) {
++ CHECK(initialize_sandbox_ran_);
++ }
++}
++
++SandboxLinux* SandboxLinux::GetInstance() {
++ SandboxLinux* instance = base::Singleton<SandboxLinux>::get();
++ CHECK(instance);
++ return instance;
++}
++
++void SandboxLinux::StopThread(base::Thread* thread) {
++ DCHECK(thread);
++ thread->Stop();
++}
++
++void SandboxLinux::PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type) {
++ CHECK(!pre_initialized_);
++#if BUILDFLAG(USING_SANITIZER)
++ // Sanitizers need to open some resources before the sandbox is enabled.
++ // This should not fork, not launch threads, not open a directory.
++ __sanitizer_sandbox_on_notify(sanitizer_args());
++ sanitizer_args_.reset();
++#endif
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ base::SysInfo::AmountOfPhysicalMemory();
++ base::SysInfo::NumberOfProcessors();
++ base::SysInfo::CPUModelName();
++
++ switch (sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ {
++#if BUILDFLAG(USE_NSS_CERTS)
++ // The main process has to initialize the ~/.pki dir which won't work
++ // after unveil(2).
++ crypto::EnsureNSSInit();
++#endif
++ CRYPTO_pre_sandbox_init();
++
++ base::FilePath cache_directory, local_directory;
++
++ base::PathService::Get(base::DIR_CACHE, &cache_directory);
++ base::PathService::Get(base::DIR_HOME, &local_directory);
++
++ cache_directory = cache_directory.AppendASCII("chromium");
++ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
++
++ if (!base::CreateDirectory(cache_directory)) {
++ LOG(ERROR) << "Failed to create " << cache_directory.value() << " directory.";
++ }
++
++ if (!base::CreateDirectory(local_directory)) {
++ LOG(ERROR) << "Failed to create " << local_directory.value() << " directory.";
++ }
++
++ break;
++ }
++ case sandbox::mojom::Sandbox::kRenderer:
++ {
++ FcConfig* config = gfx::GetGlobalFontConfig();
++ DCHECK(config);
++ break;
++ }
++ default:
++ break;
++ }
++
++ pre_initialized_ = true;
++}
++
++bool SandboxLinux::SetPledge(const char *pstring, const char *ppath) {
++ FILE *fp;
++ char *s = NULL;
++ size_t len = 0;
++ ssize_t read;
++
++ if (pstring != NULL) {
++ if (pledge(pstring, NULL) == -1)
++ goto err;
++ VLOG(5) << "pledge " << pstring;
++ } else if (ppath != NULL) {
++ fp = fopen(ppath, "r");
++ if (fp != NULL) {
++ while ((read = getline(&s, &len, fp)) != -1 ) {
++ if (s[strlen(s)-1] == '\n')
++ s[strlen(s)-1] = '\0';
++ if (pledge(s, NULL) == -1)
++ goto err;
++ VLOG(5) << "pledge " << s;
++ }
++ fclose(fp);
++ } else {
++ LOG(ERROR) << "fopen(" << ppath << ") failed, errno: " << errno;
++ return false;
++ }
++ }
++ return true;
++err:
++ LOG(ERROR) << "pledge() failed, errno: " << errno;
++ return false;
++}
++
++bool SandboxLinux::SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type) {
++ FILE *fp;
++ char *s = NULL, *cp = NULL, *home = NULL, **ap, *tokens[MAXTOKENS];
++ char path[PATH_MAX];
++ const char *ufile;
++ size_t len = 0, lineno = 0;
++
++ switch (sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ ufile = _UNVEIL_MAIN;
++ break;
++ case sandbox::mojom::Sandbox::kGpu:
++ case sandbox::mojom::Sandbox::kOnDeviceModelExecution:
++ ufile = _UNVEIL_GPU;
++ break;
++ case sandbox::mojom::Sandbox::kNetwork:
++ ufile = _UNVEIL_UTILITY_NETWORK;
++ break;
++ case sandbox::mojom::Sandbox::kAudio:
++ ufile = _UNVEIL_UTILITY_AUDIO;
++ break;
++ case sandbox::mojom::Sandbox::kVideoCapture:
++ ufile = _UNVEIL_UTILITY_VIDEO;
++ break;
++ default:
++ unveil("/dev/null", "r");
++ goto done;
++ }
++
++ fp = fopen(ufile, "r");
++ if (fp != NULL) {
++ while (!feof(fp)) {
++ if ((s = fparseln(fp, &len, &lineno, NULL,
++ FPARSELN_UNESCCOMM | FPARSELN_UNESCCONT)) == NULL) {
++ if (ferror(fp)) {
++ LOG(ERROR) << "ferror(), errno: " << errno;
++ _exit(1);
++ } else {
++ continue;
++ }
++ }
++ cp = s;
++ cp += strspn(cp, " \t\n"); /* eat whitespace */
++ if (cp[0] == '\0')
++ continue;
++
++ for (ap = tokens; ap < &tokens[MAXTOKENS - 1] &&
++ (*ap = strsep(&cp, " \t")) != NULL;) {
++ if (**ap != '\0')
++ ap++;
++ }
++ *ap = NULL;
++
++ if (tokens[1] == NULL) {
++ LOG(ERROR) << ufile << ": line " << lineno << ": must supply value to " << s;
++ _exit(1);
++ }
++
++ if (tokens[0][0] == '~') {
++ if ((home = getenv("HOME")) == NULL || *home == '\0') {
++ LOG(ERROR) << "failed to get home";
++ _exit(1);
++ }
++ memmove(tokens[0], tokens[0] + 1, strlen(tokens[0]));
++ strncpy(path, home, sizeof(path) - 1);
++ path[sizeof(path) - 1] = '\0';
++ strncat(path, tokens[0], sizeof(path) - 1 - strlen(path));
++ } else {
++ strncpy(path, tokens[0], sizeof(path) - 1);
++ path[sizeof(path) - 1] = '\0';
++ }
++
++ if (unveil(path, tokens[1]) == -1) {
++ LOG(ERROR) << "failed unveiling " << path << " with permissions " << tokens[1];
++ _exit(1);
++ } else {
++ VLOG(5) << "unveiling " << path << " with permissions " << tokens[1];
++ }
++ }
++ fclose(fp);
++ } else {
++ LOG(ERROR) << "failed to open " << ufile << " errno: " << errno;
++ _exit(1);
++ }
++
++done:
++ unveil_initialized_ = true;
++
++ return true;
++}
++
++bool SandboxLinux::unveil_initialized() const {
++ return unveil_initialized_;
++}
++
++bool SandboxLinux::InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ SandboxLinux::PreSandboxHook hook,
++ const Options& options) {
++ DCHECK(!initialize_sandbox_ran_);
++ initialize_sandbox_ran_ = true;
++
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ const std::string process_type =
++ command_line->GetSwitchValueASCII(switches::kProcessType);
++
++ if (command_line->HasSwitch(switches::kNoSandbox))
++ return true;
++
++ VLOG(1) << "SandboxLinux::InitializeSandbox: process_type="
++ << process_type << " sandbox_type=" << sandbox_type;
++
++ // Only one thread is running, pre-initialize if not already done.
++ if (!pre_initialized_)
++ PreinitializeSandbox(sandbox_type);
++
++ // Attempt to limit the future size of the address space of the process.
++ int error = 0;
++ const bool limited_as = LimitAddressSpace(&error);
++ if (error) {
++ // Restore errno. Internally to |LimitAddressSpace|, the errno due to
++ // setrlimit may be lost.
++ errno = error;
++ PCHECK(limited_as);
++ }
++
++ if (hook)
++ CHECK(std::move(hook).Run(options));
++
++ if (!command_line->HasSwitch(switches::kDisableUnveil))
++ SetUnveil(process_type, sandbox_type);
++
++ switch(sandbox_type) {
++ case sandbox::mojom::Sandbox::kNoSandbox:
++ SetPledge(NULL, "@PKG_SYSCONFBASE@/chromium/pledge.main");
++ break;
++ case sandbox::mojom::Sandbox::kRenderer:
++ // prot_exec needed by v8
++ // flock needed by sqlite3 locking
++ SetPledge("stdio rpath flock prot_exec recvfd sendfd ps", NULL);
++ break;
++ case sandbox::mojom::Sandbox::kGpu:
++ case sandbox::mojom::Sandbox::kOnDeviceModelExecution:
++ SetPledge("stdio drm rpath flock cpath wpath prot_exec recvfd sendfd tmppath", NULL);
++ break;
++#if BUILDFLAG(ENABLE_PPAPI)
++ case sandbox::mojom::Sandbox::kPpapi:
++ // prot_exec needed by v8
++ SetPledge("stdio rpath prot_exec recvfd sendfd", NULL);
++ break;
++#endif
++ case sandbox::mojom::Sandbox::kAudio:
++ SetPledge(NULL, "@PKG_SYSCONFBASE@/chromium/pledge.utility_audio");
++ break;
++ case sandbox::mojom::Sandbox::kNetwork:
++ SetPledge(NULL, "@PKG_SYSCONFBASE@/chromium/pledge.utility_network");
++ break;
++ case sandbox::mojom::Sandbox::kVideoCapture:
++ SetPledge(NULL, "@PKG_SYSCONFBASE@/chromium/pledge.utility_video");
++ break;
++ case sandbox::mojom::Sandbox::kUtility:
++ case sandbox::mojom::Sandbox::kService:
++ SetPledge("stdio rpath cpath wpath fattr flock sendfd recvfd prot_exec", NULL);
++ break;
++ default:
++ LOG(ERROR) << "non-pledge()'d process: " << sandbox_type;
++ break;
++ }
++
++ return true;
++}
++
++bool SandboxLinux::LimitAddressSpace(int* error) {
++#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
++ !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
++ if (SandboxTypeFromCommandLine(*command_line) == sandbox::mojom::Sandbox::kNoSandbox) {
++ return false;
++ }
++
++ // Unfortunately, it does not appear possible to set RLIMIT_AS such that it
++ // will both (a) be high enough to support V8's and WebAssembly's address
++ // space requirements while also (b) being low enough to mitigate exploits
++ // using integer overflows that require large allocations, heap spray, or
++ // other memory-hungry attack modes.
++
++ *error = sandbox::ResourceLimits::Lower(
++ RLIMIT_DATA, static_cast<rlim_t>(sandbox::kDataSizeLimit));
++
++ // Cache the resource limit before turning on the sandbox.
++ base::SysInfo::AmountOfVirtualMemory();
++ base::SysInfo::MaxSharedMemorySize();
++
++ return *error == 0;
++#else
++ base::SysInfo::AmountOfVirtualMemory();
++ return false;
++#endif // !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) &&
++ // !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
++}
++
++} // namespace policy
++} // namespace sandbox
diff --git a/chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.h b/chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.h
new file mode 100644
index 0000000000..3e655acdd4
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_openbsd_sandbox__openbsd.h
@@ -0,0 +1,289 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/openbsd/sandbox_openbsd.h.orig 2025-01-20 18:01:27.942155039 +0000
++++ sandbox/policy/openbsd/sandbox_openbsd.h
+@@ -0,0 +1,280 @@
++// Copyright (c) 2012 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++#ifndef SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++#define SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
++
++#include <memory>
++#include <string>
++#include <vector>
++
++#include "base/logging.h"
++#include "base/posix/global_descriptors.h"
++#include "sandbox/policy/export.h"
++#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
++#include "sandbox/policy/mojom/sandbox.mojom.h"
++#include "base/sanitizer_buildflags.h"
++
++#if BUILDFLAG(USING_SANITIZER)
++#include <sanitizer/common_interface_defs.h>
++#endif
++
++namespace base {
++template <typename T>
++struct DefaultSingletonTraits;
++class Thread;
++} // namespace base
++
++namespace sandbox {
++namespace syscall_broker {
++class BrokerProcess;
++} // namespace syscall_broker
++} // namespace sandbox
++
++namespace sandbox {
++namespace policy {
++
++// A singleton class to represent and change our sandboxing state for the
++// three main Linux sandboxes.
++// The sandboxing model allows using two layers of sandboxing. The first layer
++// can be implemented either with unprivileged namespaces or with the setuid
++// sandbox. This class provides a way to engage the namespace sandbox, but does
++// not deal with the legacy setuid sandbox directly.
++// The second layer is mainly based on seccomp-bpf and is engaged with
++// InitializeSandbox(). InitializeSandbox() is also responsible for "sealing"
++// the first layer of sandboxing. That is, InitializeSandbox must always be
++// called to have any meaningful sandboxing at all.
++class SANDBOX_POLICY_EXPORT SandboxLinux {
++ public:
++ // This is a list of sandbox IPC methods which the renderer may send to the
++ // sandbox host. See
++ // https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandbox_ipc.md
++ // This isn't the full list, values < 32 are reserved for methods called from
++ // Skia, and values < 64 are reserved for libc_interceptor.cc.
++ enum LinuxSandboxIPCMethods {
++ DEPRECATED_METHOD_GET_FALLBACK_FONT_FOR_CHAR = 64,
++ DEPRECATED_METHOD_GET_CHILD_WITH_INODE,
++ DEPRECATED_METHOD_GET_STYLE_FOR_STRIKE,
++ METHOD_MAKE_SHARED_MEMORY_SEGMENT,
++ DEPRECATED_METHOD_MATCH_WITH_FALLBACK,
++ };
++
++ // These form a bitmask which describes the conditions of the Linux sandbox.
++ // Note: this doesn't strictly give you the current status, it states
++ // what will be enabled when the relevant processes are initialized.
++ enum Status {
++ // SUID sandbox active.
++ kSUID = 1 << 0,
++
++ // Sandbox is using a new PID namespace.
++ kPIDNS = 1 << 1,
++
++ // Sandbox is using a new network namespace.
++ kNetNS = 1 << 2,
++
++ // seccomp-bpf sandbox active.
++ kSeccompBPF = 1 << 3,
++
++ // The Yama LSM module is present and enforcing.
++ kYama = 1 << 4,
++
++ // seccomp-bpf sandbox is active and the kernel supports TSYNC.
++ kSeccompTSYNC = 1 << 5,
++
++ // User namespace sandbox active.
++ kUserNS = 1 << 6,
++
++ // A flag that denotes an invalid sandbox status.
++ kInvalid = 1 << 31,
++ };
++
++ // SandboxLinux Options are a superset of SandboxSecompBPF Options.
++ struct Options : public SandboxSeccompBPF::Options {
++ // When running with a zygote, the namespace sandbox will have already
++ // been engaged prior to initializing SandboxLinux itself, and need not
++ // be done so again. Set to true to indicate that there isn't a zygote
++ // for this process and the step is to be performed here explicitly.
++ bool engage_namespace_sandbox = false;
++
++ // Allow starting the sandbox with multiple threads already running. This
++ // will enable TSYNC for seccomp-BPF, which syncs the seccomp-BPF policy
++ // across all running threads.
++ bool allow_threads_during_sandbox_init = false;
++
++ // Enables the CHECK for open directories. The open directory check is only
++ // useful for the chroot jail (from the semantic layer of the sandbox), and
++ // can safely be disabled if we are only enabling the seccomp-BPF layer.
++ bool check_for_open_directories = true;
++ };
++
++ // Callers can provide this hook to run code right before the policy
++ // is passed to the BPF compiler and the sandbox is engaged. If
++ // pre_sandbox_hook() returns true, the sandbox will be engaged
++ // afterwards, otherwise the process is terminated.
++ using PreSandboxHook = base::OnceCallback<bool(Options)>;
++
++ // Get our singleton instance.
++ static SandboxLinux* GetInstance();
++
++ SandboxLinux(const SandboxLinux&) = delete;
++ SandboxLinux& operator=(const SandboxLinux&) = delete;
++
++ bool SetPledge(const char *pstring, const char *ppath);
++ bool SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type);
++
++ // Do some initialization that can only be done before any of the sandboxes
++ // are enabled. If using the setuid sandbox, this should be called manually
++ // before the setuid sandbox is engaged.
++ // Security: When this runs, it is imperative that either InitializeSandbox()
++ // runs as well or that all file descriptors returned in
++ // GetFileDescriptorsToClose() get closed.
++ // Otherwise file descriptors that bypass the security of the setuid sandbox
++ // would be kept open. One must be particularly careful if a process performs
++ // a fork().
++ void PreinitializeSandbox(sandbox::mojom::Sandbox sandbox_type);
++
++ // Check that the current process is the init process of a new PID
++ // namespace and then proceed to drop access to the file system by using
++ // a new unprivileged namespace. This is a layer-1 sandbox.
++ // In order for this sandbox to be effective, it must be "sealed" by calling
++ // InitializeSandbox().
++ void EngageNamespaceSandbox(bool from_zygote);
++
++ // Return a list of file descriptors to close if PreinitializeSandbox() ran
++ // but InitializeSandbox() won't. Avoid using.
++ // TODO(jln): get rid of this hack.
++ std::vector<int> GetFileDescriptorsToClose();
++
++ // Seal an eventual layer-1 sandbox and initialize the layer-2 sandbox with
++ // an adequate policy depending on the process type and command line
++ // arguments.
++ // Currently the layer-2 sandbox is composed of seccomp-bpf and address space
++ // limitations.
++ // This function should only be called without any thread running.
++ bool InitializeSandbox(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Stop |thread| in a way that can be trusted by the sandbox.
++ void StopThread(base::Thread* thread);
++
++ // Returns the status of the renderer, worker and ppapi sandbox. Can only
++ // be queried after going through PreinitializeSandbox(). This is a bitmask
++ // and uses the constants defined in "enum Status" above. Since the
++ // status needs to be provided before the sandboxes are actually started,
++ // this returns what will actually happen once InitializeSandbox()
++ // is called from inside these processes.
++ int GetStatus();
++
++ // Returns true if the current process is single-threaded or if the number
++ // of threads cannot be determined.
++ bool IsSingleThreaded() const;
++
++ // Returns true if we started Seccomp BPF.
++ bool seccomp_bpf_started() const;
++
++ // Returns true if unveil(2) is used.
++ bool unveil_initialized() const;
++
++ // Check the policy and eventually start the seccomp-bpf sandbox. This should
++ // never be called with threads started. If we detect that threads have
++ // started we will crash.
++ bool StartSeccompBPF(sandbox::mojom::Sandbox sandbox_type,
++ PreSandboxHook hook,
++ const Options& options);
++
++ // Limit the address space of the current process (and its children) to make
++ // some vulnerabilities harder to exploit. Writes the errno due to setrlimit
++ // (including 0 if no error) into |error|.
++ bool LimitAddressSpace(int* error);
++
++ // Returns a file descriptor to proc. The file descriptor is no longer valid
++ // after the sandbox has been sealed.
++ int proc_fd() const {
++ DCHECK_NE(-1, proc_fd_);
++ return proc_fd_;
++ }
++
++#if BUILDFLAG(USING_SANITIZER)
++ __sanitizer_sandbox_arguments* sanitizer_args() const {
++ return sanitizer_args_.get();
++ };
++#endif
++
++ // A BrokerProcess is a helper that is started before the sandbox is engaged,
++ // typically from a pre-sandbox hook, that will serve requests to access
++ // files over an IPC channel. The client of this runs from a SIGSYS handler
++ // triggered by the seccomp-bpf sandbox.
++ // |client_sandbox_policy| is the policy being run by the client, and is
++ // used to derive the equivalent broker-side policy.
++ // |broker_side_hook| is an alternate pre-sandbox hook to be run before the
++ // broker itself gets sandboxed, to which the broker side policy and
++ // |options| are passed.
++ // Crashes the process if the broker can not be started since continuation
++ // is impossible (and presumably unsafe).
++ // This should never be destroyed, as after the sandbox is started it is
++ // vital to the process.
++#if 0
++ void StartBrokerProcess(
++ const sandbox::syscall_broker::BrokerCommandSet& allowed_command_set,
++ std::vector<sandbox::syscall_broker::BrokerFilePermission> permissions,
++ PreSandboxHook broker_side_hook,
++ const Options& options);
++
++ sandbox::syscall_broker::BrokerProcess* broker_process() const {
++ return broker_process_;
++ }
++#endif
++
++ private:
++ friend struct base::DefaultSingletonTraits<SandboxLinux>;
++
++ SandboxLinux();
++ ~SandboxLinux();
++
++ // We must have been pre_initialized_ before using these.
++ bool seccomp_bpf_supported() const;
++ bool seccomp_bpf_with_tsync_supported() const;
++
++ // Returns true if it can be determined that the current process has open
++ // directories that are not managed by the SandboxLinux class. This would
++ // be a vulnerability as it would allow to bypass the setuid sandbox.
++ bool HasOpenDirectories() const;
++
++ // The last part of the initialization is to make sure any temporary "hole"
++ // in the sandbox is closed. For now, this consists of closing proc_fd_.
++ void SealSandbox();
++
++ // GetStatus() makes promises as to how the sandbox will behave. This
++ // checks that no promises have been broken.
++ void CheckForBrokenPromises(sandbox::mojom::Sandbox sandbox_type);
++
++ // Stop |thread| and make sure it does not appear in /proc/self/tasks/
++ // anymore.
++ void StopThreadAndEnsureNotCounted(base::Thread* thread) const;
++
++ // A file descriptor to /proc. It's dangerous to have it around as it could
++ // allow for sandbox bypasses. It needs to be closed before we consider
++ // ourselves sandboxed.
++ int proc_fd_;
++
++ bool seccomp_bpf_started_;
++ bool unveil_initialized_;
++ // The value returned by GetStatus(). Gets computed once and then cached.
++ int sandbox_status_flags_;
++ // Did PreinitializeSandbox() run?
++ bool pre_initialized_;
++ bool seccomp_bpf_supported_; // Accurate if pre_initialized_.
++ bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_.
++ bool yama_is_enforcing_; // Accurate if pre_initialized_.
++ bool initialize_sandbox_ran_; // InitializeSandbox() was called.
++#if BUILDFLAG(USING_SANITIZER)
++ std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_;
++#endif
++ sandbox::syscall_broker::BrokerProcess* broker_process_; // Leaked as global.
++};
++
++} // namespace policy
++} // namespace sandbox
++
++#endif // SANDBOX_POLICY_LINUX_SANDBOX_OPENBSD_H_
diff --git a/chromium-next/patches/patch-sandbox_policy_sandbox.cc b/chromium-next/patches/patch-sandbox_policy_sandbox.cc
new file mode 100644
index 0000000000..4676847bc3
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_sandbox.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/sandbox.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/sandbox.cc
+@@ -18,6 +18,10 @@
+ #include "sandbox/policy/linux/sandbox_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#endif // BUILDFLAG(IS_BSD)
++
+ #if BUILDFLAG(IS_MAC)
+ #include "sandbox/mac/seatbelt.h"
+ #endif // BUILDFLAG(IS_MAC)
+@@ -32,7 +36,7 @@
+ namespace sandbox {
+ namespace policy {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool Sandbox::Initialize(sandbox::mojom::Sandbox sandbox_type,
+ SandboxLinux::PreSandboxHook hook,
+ const SandboxLinux::Options& options) {
diff --git a/chromium-next/patches/patch-sandbox_policy_sandbox.h b/chromium-next/patches/patch-sandbox_policy_sandbox.h
new file mode 100644
index 0000000000..a5aad3e690
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_sandbox.h
@@ -0,0 +1,32 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/sandbox.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/sandbox.h
+@@ -12,6 +12,14 @@
+ #include "sandbox/policy/linux/sandbox_linux.h"
+ #endif
+
++#if BUILDFLAG(IS_OPENBSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#elif BUILDFLAG(IS_NETBSD)
++#include "sandbox/policy/netbsd/sandbox_netbsd.h"
++#elif BUILDFLAG(IS_FREEBSD)
++#include "sandbox/policy/freebsd/sandbox_freebsd.h"
++#endif
++
+ namespace sandbox {
+ namespace mojom {
+ enum class Sandbox;
+@@ -32,7 +40,7 @@ namespace policy {
+
+ class SANDBOX_POLICY_EXPORT Sandbox {
+ public:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static bool Initialize(sandbox::mojom::Sandbox sandbox_type,
+ SandboxLinux::PreSandboxHook hook,
+ const SandboxLinux::Options& options);
diff --git a/chromium-next/patches/patch-sandbox_policy_sandbox__type.cc b/chromium-next/patches/patch-sandbox_policy_sandbox__type.cc
new file mode 100644
index 0000000000..240eb928f2
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_sandbox__type.cc
@@ -0,0 +1,138 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/sandbox_type.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/sandbox_type.cc
+@@ -76,7 +76,7 @@ void SetCommandLineFlagsForSandboxType(b
+ #endif
+ case Sandbox::kPrintCompositor:
+ case Sandbox::kAudio:
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoCapture:
+ #endif
+ #if BUILDFLAG(IS_WIN)
+@@ -87,10 +87,10 @@ void SetCommandLineFlagsForSandboxType(b
+ case Sandbox::kMediaFoundationCdm:
+ case Sandbox::kWindowsSystemProxyResolver:
+ #endif // BUILDFLAG(IS_WIN)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoDecoding:
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoEncoding:
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -108,10 +108,10 @@ void SetCommandLineFlagsForSandboxType(b
+ case Sandbox::kScreenAI:
+ #endif
+ case Sandbox::kSpeechRecognition:
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoEffects:
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ case Sandbox::kOnDeviceTranslation:
+ #endif
+ DCHECK(command_line->GetSwitchValueASCII(switches::kProcessType) ==
+@@ -121,7 +121,7 @@ void SetCommandLineFlagsForSandboxType(b
+ switches::kServiceSandboxType,
+ StringFromUtilitySandboxType(sandbox_type));
+ break;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case Sandbox::kZygoteIntermediateSandbox:
+ break;
+ #endif
+@@ -161,7 +161,7 @@ sandbox::mojom::Sandbox SandboxTypeFromC
+ return Sandbox::kUtility;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Intermediate process gains a sandbox later.
+ if (process_type == switches::kZygoteProcessType)
+ return Sandbox::kZygoteIntermediateSandbox;
+@@ -207,7 +207,7 @@ std::string StringFromUtilitySandboxType
+ return switches::kUtilitySandbox;
+ case Sandbox::kAudio:
+ return switches::kAudioSandbox;
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoCapture:
+ return switches::kVideoCaptureSandbox;
+ #endif
+@@ -221,11 +221,11 @@ std::string StringFromUtilitySandboxType
+ case Sandbox::kScreenAI:
+ return switches::kScreenAISandbox;
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case Sandbox::kVideoEffects:
+ return switches::kVideoEffectsSandbox;
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ case Sandbox::kOnDeviceTranslation:
+ return switches::kOnDeviceTranslationSandbox;
+ #endif
+@@ -245,11 +245,11 @@ std::string StringFromUtilitySandboxType
+ case Sandbox::kMirroring:
+ return switches::kMirroringSandbox;
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoDecoding:
+ return switches::kHardwareVideoDecodingSandbox;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case Sandbox::kHardwareVideoEncoding:
+ return switches::kHardwareVideoEncodingSandbox;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -268,7 +268,7 @@ std::string StringFromUtilitySandboxType
+ // The following are not utility processes so should not occur.
+ case Sandbox::kRenderer:
+ case Sandbox::kGpu:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ case Sandbox::kZygoteIntermediateSandbox:
+ #endif
+ NOTREACHED();
+@@ -339,25 +339,25 @@ sandbox::mojom::Sandbox UtilitySandboxTy
+ if (sandbox_string == switches::kScreenAISandbox)
+ return Sandbox::kScreenAI;
+ #endif
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kVideoEffectsSandbox) {
+ return Sandbox::kVideoEffects;
+ }
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kOnDeviceTranslationSandbox) {
+ return Sandbox::kOnDeviceTranslation;
+ }
+ #endif
+-#if BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kVideoCaptureSandbox)
+ return Sandbox::kVideoCapture;
+ #endif
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kHardwareVideoDecodingSandbox)
+ return Sandbox::kHardwareVideoDecoding;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (sandbox_string == switches::kHardwareVideoEncodingSandbox)
+ return Sandbox::kHardwareVideoEncoding;
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-sandbox_policy_switches.cc b/chromium-next/patches/patch-sandbox_policy_switches.cc
new file mode 100644
index 0000000000..3700a23683
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_switches.cc
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/switches.cc
+@@ -55,10 +55,10 @@ const char kWindowsSystemProxyResolverSa
+ const char kMirroringSandbox[] = "mirroring";
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ const char kHardwareVideoDecodingSandbox[] = "hardware_video_decoding";
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const char kHardwareVideoEncodingSandbox[] = "hardware_video_encoding";
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -71,7 +71,7 @@ const char kLibassistantSandbox[] = "lib
+ #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT)
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ const char kOnDeviceTranslationSandbox[] = "on_device_translation";
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
+
+@@ -102,7 +102,9 @@ const char kGpuSandboxFailuresFatal[] =
+ // Meant to be used as a browser-level switch for testing purposes only.
+ const char kNoSandbox[] = "no-sandbox";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++const char kDisableUnveil[] = "disable-unveil";
++
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Instructs the zygote to launch without a sandbox. Processes forked from this
+ // type of zygote will apply their own custom sandboxes later.
+ const char kNoZygoteSandbox[] = "no-zygote-sandbox";
diff --git a/chromium-next/patches/patch-sandbox_policy_switches.h b/chromium-next/patches/patch-sandbox_policy_switches.h
new file mode 100644
index 0000000000..f3eefc4e4e
--- /dev/null
+++ b/chromium-next/patches/patch-sandbox_policy_switches.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- sandbox/policy/switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ sandbox/policy/switches.h
+@@ -58,10 +58,10 @@ SANDBOX_POLICY_EXPORT extern const char
+ SANDBOX_POLICY_EXPORT extern const char kMirroringSandbox[];
+ #endif // BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT extern const char kHardwareVideoDecodingSandbox[];
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT extern const char kHardwareVideoEncodingSandbox[];
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+
+@@ -74,7 +74,7 @@ SANDBOX_POLICY_EXPORT extern const char
+ #endif // BUILDFLAG(ENABLE_CROS_LIBASSISTANT)
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT extern const char kOnDeviceTranslationSandbox[];
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
+
+@@ -87,7 +87,8 @@ SANDBOX_POLICY_EXPORT extern const char
+ SANDBOX_POLICY_EXPORT extern const char kGpuSandboxAllowSysVShm[];
+ SANDBOX_POLICY_EXPORT extern const char kGpuSandboxFailuresFatal[];
+ SANDBOX_POLICY_EXPORT extern const char kNoSandbox[];
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++SANDBOX_POLICY_EXPORT extern const char kDisableUnveil[];
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SANDBOX_POLICY_EXPORT extern const char kNoZygoteSandbox[];
+ #endif
+ #if BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.cc b/chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..bc11148f9a
--- /dev/null
+++ b/chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.cc
@@ -0,0 +1,37 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/audio/audio_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/audio/audio_sandbox_hook_linux.cc
+@@ -143,6 +143,7 @@ void AddPulseAudioFilePermissions(
+ }
+ #endif
+
++#if !BUILDFLAG(IS_BSD)
+ std::vector<BrokerFilePermission> GetAudioFilePermissions() {
+ std::vector<BrokerFilePermission> permissions{
+ BrokerFilePermission::ReadOnly("/dev/urandom"),
+@@ -171,10 +172,12 @@ void LoadAudioLibraries() {
+ }
+ }
+ }
++#endif
+
+ } // namespace
+
+ bool AudioPreSandboxHook(sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ LoadAudioLibraries();
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+ instance->StartBrokerProcess(MakeBrokerCommandSet({
+@@ -192,6 +195,7 @@ bool AudioPreSandboxHook(sandbox::policy
+ // TODO(crbug.com/40579955) enable namespace sandbox. Currently, if
+ // enabled, connect() on pulse native socket fails with ENOENT (called from
+ // pa_context_connect).
++#endif
+
+ return true;
+ }
diff --git a/chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.h b/chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.h
new file mode 100644
index 0000000000..05ed5fc8c8
--- /dev/null
+++ b/chromium-next/patches/patch-services_audio_audio__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/audio/audio_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/audio/audio_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef SERVICES_AUDIO_AUDIO_SANDBOX_HOOK_LINUX_H_
+ #define SERVICES_AUDIO_AUDIO_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace audio {
+
diff --git a/chromium-next/patches/patch-services_device_BUILD.gn b/chromium-next/patches/patch-services_device_BUILD.gn
new file mode 100644
index 0000000000..edc43e5851
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/BUILD.gn
+@@ -15,7 +15,7 @@ if (is_android) {
+ }
+
+ is_serial_enabled_platform =
+- is_win || ((is_linux || is_chromeos) && use_udev) || is_mac
++ is_win || ((!is_bsd && is_linux || is_chromeos) && use_udev) || is_mac
+
+ source_set("lib") {
+ # This should be visible only to embedders of the Device Service, and the
diff --git a/chromium-next/patches/patch-services_device_geolocation_location__provider__manager.cc b/chromium-next/patches/patch-services_device_geolocation_location__provider__manager.cc
new file mode 100644
index 0000000000..bb6ed10aa9
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_geolocation_location__provider__manager.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/geolocation/location_provider_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/geolocation/location_provider_manager.cc
+@@ -87,7 +87,7 @@ LocationProviderManager::LocationProvide
+ #if BUILDFLAG(IS_ANDROID)
+ // On Android, default to using the platform location provider.
+ provider_manager_mode_ = kPlatformOnly;
+-#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Ash / Lacros / Linux, default to using the network location provider.
+ provider_manager_mode_ = kNetworkOnly;
+ #else
diff --git a/chromium-next/patches/patch-services_device_hid_BUILD.gn b/chromium-next/patches/patch-services_device_hid_BUILD.gn
new file mode 100644
index 0000000000..d8578d1c88
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_BUILD.gn
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/hid/BUILD.gn
+@@ -36,7 +36,33 @@ source_set("hid") {
+ "//services/device/public/mojom",
+ ]
+
+- if ((is_linux || is_chromeos) && use_udev) {
++ if (is_openbsd) {
++ sources += [
++ "hid_connection_fido.cc",
++ "hid_connection_fido.h",
++ "hid_service_fido.cc",
++ "hid_service_fido.h",
++ ]
++ libs = ["fido2", "cbor", "usbhid", "crypto", "util"]
++ }
++
++ if (is_freebsd) {
++ sources += [
++ "hid_connection_freebsd.cc",
++ "hid_connection_freebsd.h",
++ "hid_service_freebsd.cc",
++ "hid_service_freebsd.h",
++ ]
++ }
++
++ if (is_netbsd) {
++ sources += [
++ "hid_service_netbsd.cc",
++ "hid_service_netbsd.h",
++ ]
++ }
++
++ if ((is_linux || is_chromeos) && !is_bsd && use_udev) {
+ sources += [
+ "hid_connection_linux.cc",
+ "hid_connection_linux.h",
diff --git a/chromium-next/patches/patch-services_device_hid_hid__connection__fido.cc b/chromium-next/patches/patch-services_device_hid_hid__connection__fido.cc
new file mode 100644
index 0000000000..f39aa3d2a1
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__connection__fido.cc
@@ -0,0 +1,225 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_connection_fido.cc.orig 2025-01-20 18:01:27.943290300 +0000
++++ services/device/hid/hid_connection_fido.cc
+@@ -0,0 +1,216 @@
++// Copyright 2014 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/device/hid/hid_connection_fido.h"
++
++#include <errno.h>
++#include <sys/ioctl.h>
++
++#include <memory>
++#include <string>
++#include <utility>
++
++#include "base/files/file_descriptor_watcher_posix.h"
++#include "base/memory/ref_counted_memory.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/threading/scoped_blocking_call.h"
++#include "components/device_event_log/device_event_log.h"
++#include "services/device/hid/hid_service.h"
++
++namespace device {
++
++class HidConnectionFido::BlockingTaskRunnerHelper {
++ public:
++ BlockingTaskRunnerHelper(base::ScopedFD fd,
++ scoped_refptr<HidDeviceInfo> device_info,
++ base::WeakPtr<HidConnectionFido> connection)
++ : fd_(std::move(fd)),
++ connection_(connection),
++ origin_task_runner_(base::SequencedTaskRunner::GetCurrentDefault()) {
++ DETACH_FROM_SEQUENCE(sequence_checker_);
++ // Report buffers must always have room for the report ID.
++ report_buffer_size_ = device_info->max_input_report_size() + 1;
++ has_report_id_ = device_info->has_report_id();
++ }
++
++ BlockingTaskRunnerHelper(const BlockingTaskRunnerHelper&) = delete;
++ BlockingTaskRunnerHelper& operator=(const BlockingTaskRunnerHelper&) = delete;
++
++ ~BlockingTaskRunnerHelper() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ }
++
++ // Starts the FileDescriptorWatcher that reads input events from the device.
++ // Must be called on a thread that has a base::MessageLoopForIO.
++ void Start() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ file_watcher_ = base::FileDescriptorWatcher::WatchReadable(
++ fd_.get(), base::BindRepeating(
++ &BlockingTaskRunnerHelper::OnFileCanReadWithoutBlocking,
++ base::Unretained(this)));
++ }
++
++ void Write(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++
++ auto data = buffer->data();
++ size_t size = buffer->size();
++ // if report id is 0, it shouldn't be included
++ if (data[0] == 0) {
++ data++;
++ size--;
++ }
++
++ ssize_t result =
++ HANDLE_EINTR(write(fd_.get(), data, size));
++ if (result < 0) {
++ HID_PLOG(EVENT) << "Write failed";
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), false));
++ } else {
++ if (static_cast<size_t>(result) != size) {
++ HID_LOG(EVENT) << "Incomplete HID write: " << result
++ << " != " << buffer->size();
++ }
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), true));
++ }
++ }
++
++ void GetFeatureReport(uint8_t report_id,
++ scoped_refptr<base::RefCountedBytes> buffer,
++ ReadCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ HID_PLOG(EVENT) << "GendFeatureReport not implemented on OpenBSD";
++ origin_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(std::move(callback), false, nullptr, 0));
++ }
++
++ void SendFeatureReport(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ HID_PLOG(EVENT) << "SendFeatureReport not implemented on OpenBSD";
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), false));
++ }
++
++ private:
++ void OnFileCanReadWithoutBlocking() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ auto buffer =
++ base::MakeRefCounted<base::RefCountedBytes>(report_buffer_size_);
++ uint8_t* data = buffer->as_vector().data();
++ size_t length = report_buffer_size_;
++ if (!has_report_id_) {
++ // Fido will not prefix the buffer with a report ID if report IDs are not
++ // used by the device. Prefix the buffer with 0.
++ *data++ = 0;
++ length--;
++ }
++
++ ssize_t bytes_read = HANDLE_EINTR(read(fd_.get(), data, length));
++ if (bytes_read < 0) {
++ if (errno != EAGAIN) {
++ HID_PLOG(EVENT) << "Read failed";
++ // This assumes that the error is unrecoverable and disables reading
++ // from the device until it has been re-opened.
++ // TODO(reillyg): Investigate starting and stopping the file descriptor
++ // watcher in response to pending read requests so that per-request
++ // errors can be returned to the client.
++ file_watcher_.reset();
++ }
++ return;
++ }
++ if (!has_report_id_) {
++ // Behave as if the byte prefixed above as the the report ID was read.
++ bytes_read++;
++ }
++
++ origin_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&HidConnectionFido::ProcessInputReport,
++ connection_, buffer, bytes_read));
++ }
++
++ SEQUENCE_CHECKER(sequence_checker_);
++ base::ScopedFD fd_;
++ size_t report_buffer_size_;
++ bool has_report_id_;
++ base::WeakPtr<HidConnectionFido> connection_;
++ const scoped_refptr<base::SequencedTaskRunner> origin_task_runner_;
++ std::unique_ptr<base::FileDescriptorWatcher::Controller> file_watcher_;
++};
++
++HidConnectionFido::HidConnectionFido(
++ scoped_refptr<HidDeviceInfo> device_info,
++ base::ScopedFD fd,
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
++ bool allow_protected_reports,
++ bool allow_fido_reports)
++ : HidConnection(device_info, allow_protected_reports, allow_fido_reports),
++ helper_(nullptr, base::OnTaskRunnerDeleter(blocking_task_runner)),
++ blocking_task_runner_(std::move(blocking_task_runner)) {
++ helper_.reset(new BlockingTaskRunnerHelper(std::move(fd), device_info,
++ weak_factory_.GetWeakPtr()));
++ blocking_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::Start,
++ base::Unretained(helper_.get())));
++}
++
++HidConnectionFido::~HidConnectionFido() {}
++
++void HidConnectionFido::PlatformClose() {
++ // By closing the device on the blocking task runner 1) the requirement that
++ // base::ScopedFD is destroyed on a thread where I/O is allowed is satisfied
++ // and 2) any tasks posted to this task runner that refer to this file will
++ // complete before it is closed.
++ helper_.reset();
++}
++
++void HidConnectionFido::PlatformWrite(
++ scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ // Fido expects the first byte of the buffer to always be a report ID so the
++ // buffer can be used directly.
++ blocking_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::Write,
++ base::Unretained(helper_.get()), buffer,
++ std::move(callback)));
++}
++
++void HidConnectionFido::PlatformGetFeatureReport(uint8_t report_id,
++ ReadCallback callback) {
++ // The first byte of the destination buffer is the report ID being requested
++ // and is overwritten by the feature report.
++ DCHECK_GT(device_info()->max_feature_report_size(), 0u);
++ auto buffer = base::MakeRefCounted<base::RefCountedBytes>(
++ device_info()->max_feature_report_size() + 1);
++ buffer->as_vector().data()[0] = report_id;
++
++ blocking_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::GetFeatureReport,
++ base::Unretained(helper_.get()), report_id,
++ buffer, std::move(callback)));
++}
++
++void HidConnectionFido::PlatformSendFeatureReport(
++ scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ // Fido expects the first byte of the buffer to always be a report ID so the
++ // buffer can be used directly.
++ blocking_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::SendFeatureReport,
++ base::Unretained(helper_.get()), buffer,
++ std::move(callback)));
++}
++
++} // namespace device
diff --git a/chromium-next/patches/patch-services_device_hid_hid__connection__fido.h b/chromium-next/patches/patch-services_device_hid_hid__connection__fido.h
new file mode 100644
index 0000000000..4a8e3bf705
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__connection__fido.h
@@ -0,0 +1,69 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_connection_fido.h.orig 2025-01-20 18:01:27.943416564 +0000
++++ services/device/hid/hid_connection_fido.h
+@@ -0,0 +1,60 @@
++// Copyright 2014 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef SERVICES_DEVICE_HID_HID_CONNECTION_LINUX_H_
++#define SERVICES_DEVICE_HID_HID_CONNECTION_LINUX_H_
++
++#include <stddef.h>
++#include <stdint.h>
++
++#include "base/files/scoped_file.h"
++#include "base/memory/weak_ptr.h"
++#include "base/task/sequenced_task_runner.h"
++#include "services/device/hid/hid_connection.h"
++
++namespace base {
++class SequencedTaskRunner;
++}
++
++namespace device {
++
++class HidConnectionFido : public HidConnection {
++ public:
++ HidConnectionFido(
++ scoped_refptr<HidDeviceInfo> device_info,
++ base::ScopedFD fd,
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
++ bool allow_protected_reports,
++ bool allow_fido_reports);
++ HidConnectionFido(HidConnectionFido&) = delete;
++ HidConnectionFido& operator=(HidConnectionFido&) = delete;
++
++ private:
++ friend class base::RefCountedThreadSafe<HidConnectionFido>;
++ class BlockingTaskRunnerHelper;
++
++ ~HidConnectionFido() override;
++
++ // HidConnection implementation.
++ void PlatformClose() override;
++ void PlatformWrite(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) override;
++ void PlatformGetFeatureReport(uint8_t report_id,
++ ReadCallback callback) override;
++ void PlatformSendFeatureReport(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) override;
++
++ // |helper_| lives on the sequence to which |blocking_task_runner_| posts
++ // tasks so all calls must be posted there including this object's
++ // destruction.
++ std::unique_ptr<BlockingTaskRunnerHelper, base::OnTaskRunnerDeleter> helper_;
++
++ const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
++
++ base::WeakPtrFactory<HidConnectionFido> weak_factory_{this};
++};
++
++} // namespace device
++
++#endif // SERVICES_DEVICE_HID_HID_CONNECTION_LINUX_H_
diff --git a/chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.cc b/chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.cc
new file mode 100644
index 0000000000..2c9488191c
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.cc
@@ -0,0 +1,249 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_connection_freebsd.cc.orig 2025-01-20 18:01:27.943523832 +0000
++++ services/device/hid/hid_connection_freebsd.cc
+@@ -0,0 +1,240 @@
++// Copyright (c) 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/device/hid/hid_connection_freebsd.h"
++
++#include <dev/usb/usbhid.h>
++#include <dev/usb/usb_ioctl.h>
++
++#include "base/files/file_descriptor_watcher_posix.h"
++#include "base/location.h"
++#include "base/numerics/safe_math.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/strings/stringprintf.h"
++#include "base/task/single_thread_task_runner.h"
++#include "base/threading/scoped_blocking_call.h"
++#include "base/threading/thread_restrictions.h"
++#include "components/device_event_log/device_event_log.h"
++#include "services/device/hid/hid_service.h"
++
++namespace device {
++
++class HidConnectionFreeBSD::BlockingTaskRunnerHelper {
++ public:
++ BlockingTaskRunnerHelper(base::ScopedFD fd,
++ scoped_refptr<HidDeviceInfo> device_info,
++ base::WeakPtr<HidConnectionFreeBSD> connection)
++ : fd_(std::move(fd)),
++ connection_(connection),
++ origin_task_runner_(base::SequencedTaskRunner::GetCurrentDefault()) {
++ DETACH_FROM_SEQUENCE(sequence_checker_);
++ // Report buffers must always have room for the report ID.
++ report_buffer_size_ = device_info->max_input_report_size() + 1;
++ has_report_id_ = device_info->has_report_id();
++ }
++
++ BlockingTaskRunnerHelper(const BlockingTaskRunnerHelper&) = delete;
++ BlockingTaskRunnerHelper& operator=(const BlockingTaskRunnerHelper&) = delete;
++
++ ~BlockingTaskRunnerHelper() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); }
++
++ // Starts the FileDescriptorWatcher that reads input events from the device.
++ // Must be called on a thread that has a base::MessageLoopForIO.
++ void Start() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::AssertBlockingAllowed();
++
++ file_watcher_ = base::FileDescriptorWatcher::WatchReadable(
++ fd_.get(), base::BindRepeating(&BlockingTaskRunnerHelper::OnFileCanReadWithoutBlocking,
++ base::Unretained(this)));
++ }
++
++ void Write(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++
++ auto data = buffer->as_vector().data();
++ size_t size = buffer->size();
++ // if report id is 0, it shouldn't be included
++ if (data[0] == 0) {
++ data++;
++ size--;
++ }
++
++ ssize_t result = HANDLE_EINTR(write(fd_.get(), data, size));
++ if (result < 0) {
++ HID_PLOG(EVENT) << "Write failed";
++ origin_task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(callback), false));
++ } else {
++ if (static_cast<size_t>(result) != size)
++ HID_LOG(EVENT) << "Incomplete HID write: " << result << " != " << size;
++ origin_task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(callback), true));
++ }
++ }
++
++ void GetFeatureReport(uint8_t report_id,
++ scoped_refptr<base::RefCountedBytes> buffer,
++ ReadCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ struct usb_gen_descriptor ugd;
++ ugd.ugd_report_type = UHID_FEATURE_REPORT;
++ ugd.ugd_data = buffer->as_vector().data();
++ ugd.ugd_maxlen = buffer->size();
++ int result = HANDLE_EINTR(
++ ioctl(fd_.get(), USB_GET_REPORT, &ugd));
++ if (result < 0) {
++ HID_PLOG(EVENT) << "Failed to get feature report";
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), false, nullptr, 0));
++ } else if (result == 0) {
++ HID_LOG(EVENT) << "Get feature result too short.";
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), false, nullptr, 0));
++ } else {
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), true, buffer, result));
++ }
++ }
++
++ void SendFeatureReport(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ struct usb_gen_descriptor ugd;
++ ugd.ugd_report_type = UHID_FEATURE_REPORT;
++ ugd.ugd_data = buffer->as_vector().data();
++ ugd.ugd_maxlen = buffer->size();
++ // FreeBSD does not require report id if it's not used
++ if (buffer->data()[0] == 0) {
++ ugd.ugd_data = buffer->as_vector().data() + 1;
++ ugd.ugd_maxlen = buffer->size() - 1;
++ } else {
++ ugd.ugd_data = buffer->as_vector().data();
++ ugd.ugd_maxlen = buffer->size();
++ }
++ int result = HANDLE_EINTR(
++ ioctl(fd_.get(), USB_SET_REPORT, &ugd));
++ if (result < 0) {
++ HID_PLOG(EVENT) << "Failed to send feature report";
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), false));
++ } else {
++ origin_task_runner_->PostTask(FROM_HERE,
++ base::BindOnce(std::move(callback), true));
++ }
++ }
++
++ private:
++ void OnFileCanReadWithoutBlocking() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ scoped_refptr<base::RefCountedBytes> buffer(new base::RefCountedBytes(report_buffer_size_));
++ unsigned char* data = buffer->as_vector().data();
++ size_t length = report_buffer_size_;
++ if (!has_report_id_) {
++ // FreeBSD will not prefix the buffer with a report ID if report IDs are not
++ // used by the device. Prefix the buffer with 0.
++ *data++ = 0;
++ length--;
++ }
++
++ ssize_t bytes_read = HANDLE_EINTR(read(fd_.get(), data, length));
++ if (bytes_read < 0) {
++ if (errno != EAGAIN) {
++ HID_PLOG(EVENT) << "Read failed";
++ // This assumes that the error is unrecoverable and disables reading
++ // from the device until it has been re-opened.
++ // TODO(reillyg): Investigate starting and stopping the file descriptor
++ // watcher in response to pending read requests so that per-request
++ // errors can be returned to the client.
++ file_watcher_.reset();
++ }
++ return;
++ }
++ if (!has_report_id_) {
++ // Behave as if the byte prefixed above as the the report ID was read.
++ bytes_read++;
++ }
++
++ origin_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&HidConnectionFreeBSD::ProcessInputReport,
++ connection_, buffer, bytes_read));
++ }
++
++ SEQUENCE_CHECKER(sequence_checker_);
++ base::ScopedFD fd_;
++ size_t report_buffer_size_;
++ bool has_report_id_;
++ base::WeakPtr<HidConnectionFreeBSD> connection_;
++ const scoped_refptr<base::SequencedTaskRunner> origin_task_runner_;
++ std::unique_ptr<base::FileDescriptorWatcher::Controller> file_watcher_;
++};
++
++HidConnectionFreeBSD::HidConnectionFreeBSD(
++ scoped_refptr<HidDeviceInfo> device_info,
++ base::ScopedFD fd,
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
++ bool allow_protected_reports,
++ bool allow_fido_reports)
++ : HidConnection(device_info, allow_protected_reports, allow_fido_reports),
++ helper_(nullptr, base::OnTaskRunnerDeleter(blocking_task_runner)),
++ blocking_task_runner_(std::move(blocking_task_runner)) {
++ helper_.reset(new BlockingTaskRunnerHelper(std::move(fd), device_info,
++ weak_factory_.GetWeakPtr()));
++ blocking_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::Start,
++ base::Unretained(helper_.get())));
++}
++
++HidConnectionFreeBSD::~HidConnectionFreeBSD() {}
++
++void HidConnectionFreeBSD::PlatformClose() {
++ // By closing the device on the blocking task runner 1) the requirement that
++ // base::ScopedFD is destroyed on a thread where I/O is allowed is satisfied
++ // and 2) any tasks posted to this task runner that refer to this file will
++ // complete before it is closed.
++ blocking_task_runner_->DeleteSoon(FROM_HERE, helper_.release());
++}
++
++void HidConnectionFreeBSD::PlatformWrite(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++
++ blocking_task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&BlockingTaskRunnerHelper::Write, base::Unretained(helper_.get()),
++ buffer, std::move(callback)));
++}
++
++void HidConnectionFreeBSD::PlatformGetFeatureReport(uint8_t report_id,
++ ReadCallback callback) {
++ // The first byte of the destination buffer is the report ID being requested
++ // and is overwritten by the feature report.
++ DCHECK_GT(device_info()->max_feature_report_size(), 0u);
++ scoped_refptr<base::RefCountedBytes> buffer(
++ new base::RefCountedBytes(device_info()->max_feature_report_size() + 1));
++ if (report_id != 0)
++ buffer->as_vector().data()[0] = report_id;
++
++ blocking_task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&BlockingTaskRunnerHelper::GetFeatureReport,
++ base::Unretained(helper_.get()), report_id,
++ buffer, std::move(callback)));
++}
++
++void HidConnectionFreeBSD::PlatformSendFeatureReport(
++ scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) {
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ blocking_task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&BlockingTaskRunnerHelper::SendFeatureReport,
++ base::Unretained(helper_.get()), buffer, std::move(callback)));
++}
++
++} // namespace device
diff --git a/chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.h b/chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.h
new file mode 100644
index 0000000000..0216f783b5
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__connection__freebsd.h
@@ -0,0 +1,76 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_connection_freebsd.h.orig 2025-01-20 18:01:27.943651189 +0000
++++ services/device/hid/hid_connection_freebsd.h
+@@ -0,0 +1,67 @@
++// Copyright (c) 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef DEVICE_HID_HID_CONNECTION_FREEBSD_H_
++#define DEVICE_HID_HID_CONNECTION_FREEBSD_H_
++
++#include <stddef.h>
++#include <stdint.h>
++
++#include "base/files/scoped_file.h"
++#include "base/memory/weak_ptr.h"
++#include "base/memory/ref_counted_memory.h"
++#include "base/task/sequenced_task_runner.h"
++#include "services/device/hid/hid_connection.h"
++
++namespace base {
++class SequencedTaskRunner;
++}
++
++namespace net {
++class IOBuffer;
++}
++
++namespace device {
++
++class HidConnectionFreeBSD : public HidConnection {
++ public:
++ HidConnectionFreeBSD(
++ scoped_refptr<HidDeviceInfo> device_info,
++ base::ScopedFD fd,
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
++ bool allow_protected_reports,
++ bool allow_fido_reports);
++
++ private:
++ friend class base::RefCountedThreadSafe<HidConnectionFreeBSD>;
++ class BlockingTaskRunnerHelper;
++
++ HidConnectionFreeBSD(const HidConnectionFreeBSD&) = delete;
++ HidConnectionFreeBSD& operator=(const HidConnectionFreeBSD&) = delete;
++
++ ~HidConnectionFreeBSD() override;
++
++ // HidConnection implementation.
++ void PlatformClose() override;
++ void PlatformWrite(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) override;
++ void PlatformGetFeatureReport(uint8_t report_id,
++ ReadCallback callback) override;
++ void PlatformSendFeatureReport(scoped_refptr<base::RefCountedBytes> buffer,
++ WriteCallback callback) override;
++
++ // |helper_| lives on the sequence to which |blocking_task_runner_| posts
++ // tasks so all calls must be posted there including this object's
++ // destruction.
++ std::unique_ptr<BlockingTaskRunnerHelper, base::OnTaskRunnerDeleter> helper_;
++
++ const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
++ const scoped_refptr<base::SequencedTaskRunner> task_runner_;
++
++ base::WeakPtrFactory<HidConnectionFreeBSD> weak_factory_{this};
++};
++
++} // namespace device
++
++#endif // DEVICE_HID_HID_CONNECTION_FREEBSD_H_
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service.cc b/chromium-next/patches/patch-services_device_hid_hid__service.cc
new file mode 100644
index 0000000000..82701fb3c2
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service.cc
@@ -0,0 +1,46 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/hid/hid_service.cc
+@@ -20,12 +20,18 @@
+
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
+ #include "services/device/hid/hid_service_linux.h"
++#elif BUILDFLAG(IS_OPENBSD)
++#include "services/device/hid/hid_service_fido.h"
++#elif BUILDFLAG(IS_FREEBSD)
++#include "services/device/hid/hid_service_freebsd.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "services/device/hid/hid_service_mac.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "services/device/hid/hid_service_win.h"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include "services/device/hid/hid_service_fuchsia.h"
++#elif BUILDFLAG(IS_NETBSD)
++#include "services/device/hid/hid_service_netbsd.h"
+ #endif
+
+ namespace device {
+@@ -68,12 +74,18 @@ constexpr base::TaskTraits HidService::k
+ std::unique_ptr<HidService> HidService::Create() {
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
+ return std::make_unique<HidServiceLinux>();
++#elif BUILDFLAG(IS_OPENBSD)
++ return std::make_unique<HidServiceFido>();
++#elif BUILDFLAG(IS_FREEBSD)
++ return std::make_unique<HidServiceFreeBSD>();
+ #elif BUILDFLAG(IS_MAC)
+ return std::make_unique<HidServiceMac>();
+ #elif BUILDFLAG(IS_WIN)
+ return std::make_unique<HidServiceWin>();
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return std::make_unique<HidServiceFuchsia>();
++#elif BUILDFLAG(IS_NETBSD)
++ return std::make_unique<HidServiceNetBSD>();
+ #else
+ return nullptr;
+ #endif
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service__fido.cc b/chromium-next/patches/patch-services_device_hid_hid__service__fido.cc
new file mode 100644
index 0000000000..edd31ab770
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service__fido.cc
@@ -0,0 +1,405 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service_fido.cc.orig 2025-01-20 18:01:27.943883900 +0000
++++ services/device/hid/hid_service_fido.cc
+@@ -0,0 +1,396 @@
++// Copyright 2014 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/device/hid/hid_service_fido.h"
++
++#include <fcntl.h>
++#include <poll.h>
++#include <stdint.h>
++
++#include <dlfcn.h>
++#include <fido.h>
++
++#include <limits>
++#include <memory>
++#include <string>
++#include <utility>
++
++#include "base/files/file.h"
++#include "base/files/file_path.h"
++#include "base/files/file_util.h"
++#include "base/files/scoped_file.h"
++#include "base/location.h"
++#include "base/sequence_checker.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/strings/string_split.h"
++#include "base/strings/string_util.h"
++#include "base/task/sequenced_task_runner.h"
++#include "base/task/thread_pool.h"
++#include "base/threading/scoped_blocking_call.h"
++#include "build/build_config.h"
++#include "build/chromeos_buildflags.h"
++#include "components/device_event_log/device_event_log.h"
++#include "device/udev_linux/scoped_udev.h"
++#include "device/udev_linux/udev_watcher.h"
++#include "services/device/hid/hid_connection_fido.h"
++
++namespace device {
++
++namespace {
++
++bool terrible_ping_kludge(int fd, const std::string &path) {
++ u_char data[256];
++ int i, n;
++ struct pollfd pfd;
++
++ for (i = 0; i < 4; i++) {
++ memset(data, 0, sizeof(data));
++ /* broadcast channel ID */
++ data[1] = 0xff;
++ data[2] = 0xff;
++ data[3] = 0xff;
++ data[4] = 0xff;
++ /* Ping command */
++ data[5] = 0x81;
++ /* One byte ping only, Vasili */
++ data[6] = 0;
++ data[7] = 1;
++ HID_LOG(EVENT) << "send ping " << i << " " << path;
++ if (write(fd, data, 64) == -1) {
++ HID_PLOG(ERROR) << "write " << path;
++ return false;
++ }
++ HID_LOG(EVENT) << "wait reply " << path;
++ memset(&pfd, 0, sizeof(pfd));
++ pfd.fd = fd;
++ pfd.events = POLLIN;
++ if ((n = poll(&pfd, 1, 100)) == -1) {
++ HID_PLOG(EVENT) << "poll " << path;
++ return false;
++ } else if (n == 0) {
++ HID_LOG(EVENT) << "timed out " << path;
++ continue;
++ }
++ if (read(fd, data, 64) == -1) {
++ HID_PLOG(ERROR) << "read " << path;
++ return false;
++ }
++ /*
++ * Ping isn't always supported on the broadcast channel,
++ * so we might get an error, but we don't care - we're
++ * synched now.
++ */
++ HID_LOG(EVENT) << "got reply " << path;
++ return true;
++ }
++ HID_LOG(ERROR) << "no response " << path;
++ return false;
++}
++
++// HID report descriptor for U2F interface. Copied from:
++// https://chromium.googlesource.com/chromiumos/platform2/+/c6c7e4e54fce11932fedaa3ea10236bf75d85a2b%5E%21/u2fd/u2fhid.cc
++// Apparently Chromium wants to see these bytes, but OpenBSD fido(4)
++// devices prohibit USB_GET_REPORT_DESC ioctl that could be used to
++// get the bytes from the USB device.
++constexpr uint8_t kU2fReportDesc[] = {
++ 0x06, 0xD0, 0xF1, /* Usage Page (FIDO Alliance), FIDO_USAGE_PAGE */
++ 0x09, 0x01, /* Usage (U2F HID Auth. Device) FIDO_USAGE_U2FHID */
++ 0xA1, 0x01, /* Collection (Application), HID_APPLICATION */
++ 0x09, 0x20, /* Usage (Input Report Data), FIDO_USAGE_DATA_IN */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x26, 0xFF, 0x00, /* Logical Maximum (255) */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x40, /* Report Count (64), HID_INPUT_REPORT_BYTES */
++ 0x81, 0x02, /* Input (Data, Var, Abs), Usage */
++ 0x09, 0x21, /* Usage (Output Report Data), FIDO_USAGE_DATA_OUT */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x26, 0xFF, 0x00, /* Logical Maximum (255) */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x40, /* Report Count (64), HID_OUTPUT_REPORT_BYTES */
++ 0x91, 0x02, /* Output (Data, Var, Abs), Usage */
++ 0xC0 /* End Collection */
++};
++
++} // namespace
++
++struct HidServiceFido::ConnectParams {
++ ConnectParams(scoped_refptr<HidDeviceInfo> device_info,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback)
++ : device_info(std::move(device_info)),
++ allow_protected_reports(allow_protected_reports),
++ allow_fido_reports(allow_fido_reports),
++ callback(std::move(callback)),
++ task_runner(base::SequencedTaskRunner::GetCurrentDefault()),
++ blocking_task_runner(
++ base::ThreadPool::CreateSequencedTaskRunner(kBlockingTaskTraits)) {}
++ ~ConnectParams() {}
++
++ scoped_refptr<HidDeviceInfo> device_info;
++ bool allow_protected_reports;
++ bool allow_fido_reports;
++ ConnectCallback callback;
++ scoped_refptr<base::SequencedTaskRunner> task_runner;
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner;
++ base::ScopedFD fd;
++};
++
++class HidServiceFido::BlockingTaskRunnerHelper : public UdevWatcher::Observer {
++ public:
++ BlockingTaskRunnerHelper(base::WeakPtr<HidServiceFido> service)
++ : service_(std::move(service)),
++ task_runner_(base::SequencedTaskRunner::GetCurrentDefault()) {
++ DETACH_FROM_SEQUENCE(sequence_checker_);
++ }
++
++ BlockingTaskRunnerHelper(const BlockingTaskRunnerHelper&) = delete;
++ BlockingTaskRunnerHelper& operator=(const BlockingTaskRunnerHelper&) = delete;
++
++ ~BlockingTaskRunnerHelper() override {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ }
++
++ void Start() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ void *library = dlopen("libudev.so", RTLD_NOW | RTLD_LOCAL);
++ if (library) {
++ dlclose(library);
++ watcher_ = UdevWatcher::StartWatching(this);
++ watcher_->EnumerateExistingDevices();
++ } else {
++ HID_LOG(ERROR) << "No udev available, failling back to single enumeration";
++ WalkFidoDevices(nullptr);
++ }
++
++ task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&HidServiceFido::FirstEnumerationComplete, service_));
++ }
++
++ private:
++ void WalkFidoDevices(const char *name) {
++ fido_dev_info_t *devlist = NULL;
++ fido_dev_t *dev = NULL;
++ size_t devlist_len = 0, i;
++ const char *path;
++ int r;
++ const int MAX_FIDO_DEVICES = 256;
++
++ if ((devlist = fido_dev_info_new(MAX_FIDO_DEVICES)) == NULL) {
++ HID_LOG(ERROR) << "fido_dev_info_new failed";
++ goto out;
++ }
++ if ((r = fido_dev_info_manifest(devlist, MAX_FIDO_DEVICES, &devlist_len)) !=
++ FIDO_OK) {
++ HID_LOG(ERROR) << "fido_dev_info_manifest: " << fido_strerr(r);
++ goto out;
++ }
++
++ HID_LOG(EVENT) << "fido_dev_info_manifest found " << devlist_len
++ << " device(s)";
++
++ for (i = 0; i < devlist_len; i++) {
++ const fido_dev_info_t *di = fido_dev_info_ptr(devlist, i);
++
++ if (di == NULL) {
++ HID_LOG(ERROR) << "fido_dev_info_ptr " << i << " failed";
++ continue;
++ }
++
++ if ((path = fido_dev_info_path(di)) == NULL) {
++ HID_LOG(ERROR) << "fido_dev_info_path " << i << " failed";
++ continue;
++ }
++
++ if (name != nullptr && !strcmp(path, name)) {
++ HID_LOG(EVENT) << "hotplug device " << i << ": " << path;
++ OnFidoDeviceAdded(di);
++ break;
++ }
++
++ HID_LOG(EVENT) << "trying device " << i << ": " << path;
++ if ((dev = fido_dev_new()) == NULL) {
++ HID_LOG(ERROR) << "fido_dev_new failed";
++ continue;
++ }
++
++ if ((r = fido_dev_open(dev, path)) != FIDO_OK) {
++ HID_LOG(ERROR) << "fido_dev_open failed " << path;
++ fido_dev_free(&dev);
++ continue;
++ }
++
++ fido_dev_close(dev);
++ fido_dev_free(&dev);
++
++ OnFidoDeviceAdded(di);
++ }
++ out:
++ if (devlist != NULL)
++ fido_dev_info_free(&devlist, MAX_FIDO_DEVICES);
++ }
++
++ void OnFidoDeviceAdded(const fido_dev_info_t *di) {
++ auto null_as_empty = [](const char *r) -> std::string {
++ return (r != nullptr) ? r : "";
++ };
++ std::string device_node(null_as_empty(fido_dev_info_path(di)));
++ std::vector<uint8_t> report_descriptor(
++ kU2fReportDesc, kU2fReportDesc + sizeof(kU2fReportDesc));
++
++ auto device_info = base::MakeRefCounted<HidDeviceInfo>(
++ device_node, /*physical_device_id*/"", fido_dev_info_vendor(di),
++ fido_dev_info_product(di), null_as_empty(fido_dev_info_product_string(di)),
++ null_as_empty(fido_dev_info_manufacturer_string(di)),
++ device::mojom::HidBusType::kHIDBusTypeUSB, report_descriptor,
++ device_node);
++
++ task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&HidServiceFido::AddDevice, service_, device_info));
++ }
++
++ // UdevWatcher::Observer
++ void OnDeviceAdded(ScopedUdevDevicePtr device) override {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++
++ const char* subsystem = udev_device_get_subsystem(device.get());
++ if (!subsystem || strcmp(subsystem, "fido") != 0)
++ return;
++
++ const char* device_path = udev_device_get_syspath(device.get());
++ if (!device_path)
++ return;
++
++ WalkFidoDevices(device_path);
++ }
++
++ void OnDeviceRemoved(ScopedUdevDevicePtr device) override {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++
++ const char* device_path = udev_device_get_syspath(device.get());
++ if (device_path) {
++ task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&HidServiceFido::RemoveDevice, service_,
++ std::string(device_path)));
++ }
++ }
++
++ void OnDeviceChanged(ScopedUdevDevicePtr) override {}
++
++ SEQUENCE_CHECKER(sequence_checker_);
++ std::unique_ptr<UdevWatcher> watcher_;
++
++ // This weak pointer is only valid when checked on this task runner.
++ base::WeakPtr<HidServiceFido> service_;
++ scoped_refptr<base::SequencedTaskRunner> task_runner_;
++};
++
++HidServiceFido::HidServiceFido()
++ : blocking_task_runner_(
++ base::ThreadPool::CreateSequencedTaskRunner(kBlockingTaskTraits)),
++ helper_(nullptr, base::OnTaskRunnerDeleter(blocking_task_runner_)) {
++ // We need to properly initialize |blocking_task_helper_| here because we need
++ // |weak_factory_| to be created first.
++ helper_.reset(new BlockingTaskRunnerHelper(weak_factory_.GetWeakPtr()));
++ blocking_task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::Start,
++ base::Unretained(helper_.get())));
++}
++
++HidServiceFido::~HidServiceFido() = default;
++
++base::WeakPtr<HidService> HidServiceFido::GetWeakPtr() {
++ return weak_factory_.GetWeakPtr();
++}
++
++void HidServiceFido::Connect(const std::string& device_guid,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ const auto& map_entry = devices().find(device_guid);
++ if (map_entry == devices().end()) {
++ base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
++ FROM_HERE, base::BindOnce(std::move(callback), nullptr));
++ return;
++ }
++ scoped_refptr<HidDeviceInfo> device_info = map_entry->second;
++
++ auto params =
++ std::make_unique<ConnectParams>(device_info, allow_protected_reports,
++ allow_fido_reports, std::move(callback));
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner =
++ params->blocking_task_runner;
++ blocking_task_runner->PostTask(
++ FROM_HERE, base::BindOnce(&HidServiceFido::OpenOnBlockingThread,
++ std::move(params)));
++}
++
++// static
++void HidServiceFido::OpenOnBlockingThread(
++ std::unique_ptr<ConnectParams> params) {
++ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
++ base::BlockingType::MAY_BLOCK);
++ scoped_refptr<base::SequencedTaskRunner> task_runner = params->task_runner;
++
++ base::FilePath device_path(params->device_info->device_node());
++ base::File device_file;
++ int flags =
++ base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE;
++ device_file.Initialize(device_path, flags);
++ if (!device_file.IsValid()) {
++ base::File::Error file_error = device_file.error_details();
++
++ if (file_error == base::File::FILE_ERROR_ACCESS_DENIED) {
++ HID_LOG(EVENT)
++ << "Access denied opening device read-write, trying read-only.";
++ flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
++ device_file.Initialize(device_path, flags);
++ }
++ }
++ if (!device_file.IsValid()) {
++ HID_LOG(EVENT) << "Failed to open '" << params->device_info->device_node()
++ << "': "
++ << base::File::ErrorToString(device_file.error_details());
++ task_runner->PostTask(FROM_HERE,
++ base::BindOnce(std::move(params->callback), nullptr));
++ return;
++ }
++ if (!terrible_ping_kludge(device_file.GetPlatformFile(), params->device_info->device_node())) {
++ HID_LOG(EVENT) << "Failed to ping " << params->device_info->device_node();
++ task_runner->PostTask(FROM_HERE, base::BindOnce(std::move(params->callback), nullptr));
++ return;
++ }
++ params->fd.reset(device_file.TakePlatformFile());
++
++ task_runner->PostTask(FROM_HERE, base::BindOnce(&HidServiceFido::FinishOpen,
++ std::move(params)));
++}
++
++// static
++void HidServiceFido::FinishOpen(std::unique_ptr<ConnectParams> params) {
++ DCHECK(params->fd.is_valid());
++
++ if (!base::SetNonBlocking(params->fd.get())) {
++ HID_PLOG(DEBUG) << "Failed to set the non-blocking flag on the device fd";
++ std::move(params->callback).Run(nullptr);
++ return;
++ }
++
++ std::move(params->callback)
++ .Run(base::MakeRefCounted<HidConnectionFido>(
++ std::move(params->device_info), std::move(params->fd),
++ std::move(params->blocking_task_runner),
++ params->allow_protected_reports, params->allow_fido_reports));
++}
++
++} // namespace device
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service__fido.h b/chromium-next/patches/patch-services_device_hid_hid__service__fido.h
new file mode 100644
index 0000000000..df8a54d30a
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service__fido.h
@@ -0,0 +1,74 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service_fido.h.orig 2025-01-20 18:01:27.944035985 +0000
++++ services/device/hid/hid_service_fido.h
+@@ -0,0 +1,65 @@
++// Copyright 2014 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef SERVICES_DEVICE_HID_HID_SERVICE_LINUX_H_
++#define SERVICES_DEVICE_HID_HID_SERVICE_LINUX_H_
++
++#include <memory>
++
++#include "base/compiler_specific.h"
++#include "base/files/scoped_file.h"
++#include "base/memory/weak_ptr.h"
++#include "base/task/sequenced_task_runner.h"
++#include "build/build_config.h"
++#include "build/chromeos_buildflags.h"
++#include "services/device/hid/hid_device_info.h"
++#include "services/device/hid/hid_service.h"
++
++namespace device {
++
++class HidServiceFido : public HidService {
++ public:
++ HidServiceFido();
++ HidServiceFido(HidServiceFido&) = delete;
++ HidServiceFido& operator=(HidServiceFido&) = delete;
++ ~HidServiceFido() override;
++
++ // HidService:
++ void Connect(const std::string& device_id,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback) override;
++ base::WeakPtr<HidService> GetWeakPtr() override;
++
++ private:
++ struct ConnectParams;
++ class BlockingTaskRunnerHelper;
++
++// These functions implement the process of locating, requesting access to and
++// opening a device. Because this operation crosses multiple threads these
++// functions are static and the necessary parameters are passed as a single
++// struct.
++#if BUILDFLAG(IS_CHROMEOS_ASH)
++ static void OnPathOpenComplete(std::unique_ptr<ConnectParams> params,
++ base::ScopedFD fd);
++ static void OnPathOpenError(const std::string& device_path,
++ ConnectCallback callback,
++ const std::string& error_name,
++ const std::string& error_message);
++#else
++ static void OpenOnBlockingThread(std::unique_ptr<ConnectParams> params);
++#endif
++ static void FinishOpen(std::unique_ptr<ConnectParams> params);
++
++ const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
++
++ // |helper_| lives on the sequence |blocking_task_runner_| posts to and holds
++ // a weak reference back to the service that owns it.
++ std::unique_ptr<BlockingTaskRunnerHelper, base::OnTaskRunnerDeleter> helper_;
++ base::WeakPtrFactory<HidServiceFido> weak_factory_{this};
++};
++
++} // namespace device
++
++#endif // SERVICES_DEVICE_HID_HID_SERVICE_LINUX_H_
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service__freebsd.cc b/chromium-next/patches/patch-services_device_hid_hid__service__freebsd.cc
new file mode 100644
index 0000000000..8691cd9b6a
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service__freebsd.cc
@@ -0,0 +1,404 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service_freebsd.cc.orig 2025-01-20 18:01:27.944144455 +0000
++++ services/device/hid/hid_service_freebsd.cc
+@@ -0,0 +1,395 @@
++// Copyright 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/device/hid/hid_service_freebsd.h"
++
++#include <dev/usb/usb_ioctl.h>
++#include <stdint.h>
++#include <sys/socket.h>
++#include <sys/un.h>
++
++#include <set>
++#include <string>
++#include <vector>
++
++#include "base/files/file_descriptor_watcher_posix.h"
++#include "base/files/file_enumerator.h"
++#include "base/files/file_util.h"
++#include "base/files/file.h"
++#include "base/location.h"
++#include "base/logging.h"
++#include "base/posix/eintr_wrapper.h"
++#include "base/stl_util.h"
++#include "base/strings/pattern.h"
++#include "base/strings/stringprintf.h"
++#include "base/strings/sys_string_conversions.h"
++#include "base/strings/string_util.h"
++#include "base/strings/string_split.h"
++#include "base/task/single_thread_task_runner.h"
++#include "base/task/thread_pool.h"
++#include "base/threading/scoped_blocking_call.h"
++#include "base/threading/thread_restrictions.h"
++#include "components/device_event_log/device_event_log.h"
++#include "services/device/hid/hid_connection_freebsd.h"
++
++const int kMaxPermissionChecks = 5;
++
++namespace device {
++
++struct HidServiceFreeBSD::ConnectParams {
++ ConnectParams(scoped_refptr<HidDeviceInfo> device_info,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback)
++ : device_info(std::move(device_info)),
++ allow_protected_reports(allow_protected_reports),
++ allow_fido_reports(allow_fido_reports),
++ callback(std::move(callback)),
++ task_runner(base::SequencedTaskRunner::GetCurrentDefault()),
++ blocking_task_runner(
++ base::ThreadPool::CreateSequencedTaskRunner(kBlockingTaskTraits)) {}
++ ~ConnectParams() {}
++
++ scoped_refptr<HidDeviceInfo> device_info;
++ bool allow_protected_reports;
++ bool allow_fido_reports;
++ ConnectCallback callback;
++ scoped_refptr<base::SequencedTaskRunner> task_runner;
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner;
++ base::ScopedFD fd;
++};
++
++class HidServiceFreeBSD::BlockingTaskRunnerHelper {
++ public:
++ BlockingTaskRunnerHelper(base::WeakPtr<HidServiceFreeBSD> service)
++ : service_(std::move(service)),
++ task_runner_(base::SequencedTaskRunner::GetCurrentDefault()) {
++ DETACH_FROM_SEQUENCE(sequence_checker_);
++
++ timer_.reset(new base::RepeatingTimer());
++ devd_buffer_ = new net::IOBufferWithSize(1024);
++ }
++
++ BlockingTaskRunnerHelper(const BlockingTaskRunnerHelper&) = delete;
++ BlockingTaskRunnerHelper& operator=(const BlockingTaskRunnerHelper&) = delete;
++
++ ~BlockingTaskRunnerHelper() {
++ }
++
++ void Start() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ const base::FilePath kDevRoot("/dev");
++ const std::string kUHIDPattern("/dev/uhid*");
++
++ base::FileEnumerator enumerator(kDevRoot, false, base::FileEnumerator::FILES);
++ do {
++ const base::FilePath next_device_path(enumerator.Next());
++ const std::string next_device = next_device_path.value();
++ if (next_device.empty())
++ break;
++
++ if (base::MatchPattern(next_device, kUHIDPattern))
++ OnDeviceAdded(next_device.substr(5));
++ } while (true);
++
++ SetupDevdMonitor();
++
++ task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&HidServiceFreeBSD::FirstEnumerationComplete, service_));
++ }
++
++ bool HaveReadWritePermissions(std::string device_id) {
++ std::string device_node = "/dev/" + device_id;
++ base::AssertBlockingAllowed();
++
++ base::FilePath device_path(device_node);
++ base::File device_file;
++ int flags =
++ base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE;
++ device_file.Initialize(device_path, flags);
++ if (!device_file.IsValid())
++ return false;
++
++ return true;
++ }
++
++ void OnDeviceAdded(std::string device_id) {
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ std::string device_node = "/dev/" + device_id;
++ uint16_t vendor_id = 0xffff;
++ uint16_t product_id = 0xffff;
++ std::string product_name = "";
++ std::string serial_number = "";
++
++ std::vector<uint8_t> report_descriptor;
++
++ base::AssertBlockingAllowed();
++
++ base::FilePath device_path(device_node);
++ base::File device_file;
++ int flags =
++ base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE;
++ device_file.Initialize(device_path, flags);
++ if (!device_file.IsValid()) {
++ HID_LOG(ERROR) << "Failed to open '" << device_node
++ << "': "
++ << base::File::ErrorToString(device_file.error_details());
++ return;
++ }
++
++ base::ScopedFD fd;
++ fd.reset(device_file.TakePlatformFile());
++
++ struct usb_gen_descriptor ugd;
++ ugd.ugd_data = NULL;
++ ugd.ugd_maxlen = 0xffff;
++ int result = HANDLE_EINTR(
++ ioctl(fd.get(), USB_GET_REPORT_DESC, &ugd));
++
++ if (result < 0) {
++ HID_LOG(ERROR) << "Failed to get report descriptor size";
++ return;
++ }
++
++ report_descriptor.resize(ugd.ugd_actlen);
++
++ ugd.ugd_data = report_descriptor.data();
++ ugd.ugd_maxlen = ugd.ugd_actlen;
++ result = HANDLE_EINTR(
++ ioctl(fd.get(), USB_GET_REPORT_DESC, &ugd));
++
++ if (result < 0) {
++ HID_LOG(ERROR) << "Failed to get report descriptor";
++ return;
++ }
++
++ scoped_refptr<HidDeviceInfo> device_info(new HidDeviceInfo(
++ device_id,
++ /*physical_device_id*/"",
++ vendor_id,
++ product_id,
++ product_name,
++ serial_number,
++ device::mojom::HidBusType::kHIDBusTypeUSB,
++ report_descriptor,
++ device_node));
++
++ task_runner_->PostTask(FROM_HERE, base::BindOnce(&HidServiceFreeBSD::AddDevice,
++ service_, device_info));
++ }
++
++ void OnDeviceRemoved(std::string device_id) {
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ task_runner_->PostTask(
++ FROM_HERE, base::BindOnce(&HidServiceFreeBSD::RemoveDevice, service_,
++ device_id));
++ }
++
++ private:
++
++ void CheckPendingPermissionChange() {
++ base::AssertBlockingAllowed();
++ std::map<std::string, int>::iterator it;
++ for (it = permissions_checks_attempts_.begin(); it != permissions_checks_attempts_.end();) {
++ std::string device_name = it->first;
++ bool keep = true;
++ if (HaveReadWritePermissions(device_name)) {
++ OnDeviceAdded(device_name);
++ keep = false;
++ }
++ else if (it->second-- <= 0) {
++ HID_LOG(ERROR) << "Still don't have write permissions to '" << device_name
++ << "' after " << kMaxPermissionChecks << " attempts";
++ keep = false;
++ }
++
++ if (keep)
++ ++it;
++ else
++ permissions_checks_attempts_.erase(it++);
++ }
++
++ if (permissions_checks_attempts_.empty())
++ timer_->Stop();
++ }
++
++ void SetupDevdMonitor() {
++ base::AssertBlockingAllowed();
++
++ int devd_fd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
++ if (devd_fd < 0)
++ return;
++
++ struct sockaddr_un sa;
++
++ sa.sun_family = AF_UNIX;
++ strlcpy(sa.sun_path, "@VARBASE@/run/devd.seqpacket.pipe", sizeof(sa.sun_path));
++ if (connect(devd_fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
++ close(devd_fd);
++ return;
++ }
++
++ devd_fd_.reset(devd_fd);
++ file_watcher_ = base::FileDescriptorWatcher::WatchReadable(
++ devd_fd_.get(), base::BindRepeating(&BlockingTaskRunnerHelper::OnDevdMessageCanBeRead,
++ base::Unretained(this)));
++ }
++
++ void OnDevdMessageCanBeRead() {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ ssize_t bytes_read = HANDLE_EINTR(recv(devd_fd_.get(), devd_buffer_->data(),
++ devd_buffer_->size() - 1, MSG_WAITALL));
++ if (bytes_read < 0) {
++ if (errno != EAGAIN) {
++ HID_LOG(ERROR) << "Read failed";
++ file_watcher_.reset();
++ }
++ return;
++ }
++
++ devd_buffer_->data()[bytes_read] = 0;
++ char *data = devd_buffer_->data();
++ // It may take some time for devd to change permissions
++ // on /dev/uhidX node. So do not fail immediately if
++ // open fail. Retry each second for kMaxPermissionChecks
++ // times before giving up entirely
++ if (base::StartsWith(data, "+uhid", base::CompareCase::SENSITIVE)) {
++ std::vector<std::string> parts = base::SplitString(
++ data, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
++ if (!parts.empty()) {
++ std::string device_name = parts[0].substr(1); // skip '+'
++ if (HaveReadWritePermissions(device_name))
++ OnDeviceAdded(parts[0].substr(1));
++ else {
++ // Do not re-add to checks
++ if (permissions_checks_attempts_.find(device_name) == permissions_checks_attempts_.end()) {
++ permissions_checks_attempts_.insert(std::pair<std::string, int>(device_name, kMaxPermissionChecks));
++ timer_->Start(FROM_HERE, base::Seconds(1),
++ this, &BlockingTaskRunnerHelper::CheckPendingPermissionChange);
++ }
++ }
++ }
++ }
++
++ if (base::StartsWith(data, "-uhid", base::CompareCase::SENSITIVE)) {
++ std::vector<std::string> parts = base::SplitString(
++ data, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
++ if (!parts.empty()) {
++ std::string device_name = parts[0].substr(1); // skip '-'
++ auto it = permissions_checks_attempts_.find(device_name);
++ if (it != permissions_checks_attempts_.end()) {
++ permissions_checks_attempts_.erase(it);
++ if (permissions_checks_attempts_.empty())
++ timer_->Stop();
++ }
++ OnDeviceRemoved(parts[0].substr(1));
++ }
++ }
++ }
++
++ SEQUENCE_CHECKER(sequence_checker_);
++
++ // This weak pointer is only valid when checked on this task runner.
++ base::WeakPtr<HidServiceFreeBSD> service_;
++ scoped_refptr<base::SequencedTaskRunner> task_runner_;
++ std::unique_ptr<base::FileDescriptorWatcher::Controller> file_watcher_;
++ std::unique_ptr<base::RepeatingTimer> timer_;
++ base::ScopedFD devd_fd_;
++ scoped_refptr<net::IOBufferWithSize> devd_buffer_;
++ std::map<std::string, int> permissions_checks_attempts_;
++};
++
++HidServiceFreeBSD::HidServiceFreeBSD()
++ : blocking_task_runner_(
++ base::ThreadPool::CreateSequencedTaskRunner(kBlockingTaskTraits)),
++ helper_(nullptr, base::OnTaskRunnerDeleter(blocking_task_runner_)) {
++ helper_.reset(new BlockingTaskRunnerHelper(weak_factory_.GetWeakPtr()));
++ blocking_task_runner_->PostTask(
++ FROM_HERE,
++ base::BindOnce(&BlockingTaskRunnerHelper::Start, base::Unretained(helper_.get())));
++}
++
++HidServiceFreeBSD::~HidServiceFreeBSD() {
++ blocking_task_runner_->DeleteSoon(FROM_HERE, helper_.release());
++}
++
++base::WeakPtr<HidService> HidServiceFreeBSD::GetWeakPtr() {
++ return weak_factory_.GetWeakPtr();
++}
++
++// static
++void HidServiceFreeBSD::OpenOnBlockingThread(
++ std::unique_ptr<ConnectParams> params) {
++ base::ScopedBlockingCall scoped_blocking_call(
++ FROM_HERE, base::BlockingType::MAY_BLOCK);
++ scoped_refptr<base::SequencedTaskRunner> task_runner = params->task_runner;
++
++ base::FilePath device_path(params->device_info->device_node());
++ base::File device_file;
++ int flags =
++ base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE;
++ device_file.Initialize(device_path, flags);
++ if (!device_file.IsValid()) {
++ HID_LOG(EVENT) << "Failed to open '" << params->device_info->device_node()
++ << "': "
++ << base::File::ErrorToString(device_file.error_details());
++ task_runner->PostTask(FROM_HERE,
++ base::BindOnce(std::move(params->callback), nullptr));
++ return;
++ }
++ params->fd.reset(device_file.TakePlatformFile());
++ task_runner->PostTask(FROM_HERE, base::BindOnce(&HidServiceFreeBSD::FinishOpen,
++ std::move(params)));
++}
++
++void HidServiceFreeBSD::Connect(const std::string& device_guid,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback) {
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++
++ const auto& map_entry = devices().find(device_guid);
++ if (map_entry == devices().end()) {
++ base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
++ FROM_HERE, base::BindOnce(std::move(callback), nullptr));
++ return;
++ }
++
++ scoped_refptr<HidDeviceInfo> device_info = map_entry->second;
++
++ auto params = std::make_unique<ConnectParams>(device_info,
++ allow_protected_reports,
++ allow_fido_reports,
++ std::move(callback));
++ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner =
++ params->blocking_task_runner;
++
++ blocking_task_runner->PostTask(
++ FROM_HERE, base::BindOnce(&HidServiceFreeBSD::OpenOnBlockingThread,
++ std::move(params)));
++}
++
++// static
++void HidServiceFreeBSD::FinishOpen(std::unique_ptr<ConnectParams> params) {
++ DCHECK(params->fd.is_valid());
++
++ if (!base::SetNonBlocking(params->fd.get())) {
++ HID_PLOG(ERROR) << "Failed to set the non-blocking flag on the device fd";
++ std::move(params->callback).Run(nullptr);
++ }
++
++ std::move(params->callback).Run(base::MakeRefCounted<HidConnectionFreeBSD>(
++ std::move(params->device_info),
++ std::move(params->fd),
++ std::move(params->blocking_task_runner),
++ params->allow_protected_reports,
++ params->allow_fido_reports
++ ));
++}
++
++} // namespace device
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service__freebsd.h b/chromium-next/patches/patch-services_device_hid_hid__service__freebsd.h
new file mode 100644
index 0000000000..f77369fffd
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service__freebsd.h
@@ -0,0 +1,58 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service_freebsd.h.orig 2025-01-20 18:01:27.944289727 +0000
++++ services/device/hid/hid_service_freebsd.h
+@@ -0,0 +1,49 @@
++// Copyright 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef DEVICE_HID_HID_SERVICE_FREEBSD_H_
++#define DEVICE_HID_HID_SERVICE_FREEBSD_H_
++
++#include <string>
++
++#include "base/memory/ref_counted.h"
++#include "base/memory/weak_ptr.h"
++#include "base/timer/timer.h"
++#include "services/device/hid/hid_service.h"
++#include "net/base/io_buffer.h"
++
++namespace device {
++
++class HidServiceFreeBSD : public HidService {
++ public:
++ HidServiceFreeBSD();
++
++ HidServiceFreeBSD(const HidServiceFreeBSD&) = delete;
++ HidServiceFreeBSD& operator=(const HidServiceFreeBSD&) = delete;
++
++ ~HidServiceFreeBSD() override;
++
++ void Connect(const std::string& device_guid,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback connect) override;
++ base::WeakPtr<HidService> GetWeakPtr() override;
++
++ private:
++ struct ConnectParams;
++ class BlockingTaskRunnerHelper;
++
++ static void OpenOnBlockingThread(std::unique_ptr<ConnectParams> params);
++ static void FinishOpen(std::unique_ptr<ConnectParams> params);
++
++ const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
++ // |helper_| lives on the sequence |blocking_task_runner_| posts to and holds
++ // a weak reference back to the service that owns it.
++ std::unique_ptr<BlockingTaskRunnerHelper, base::OnTaskRunnerDeleter> helper_;
++ base::WeakPtrFactory<HidServiceFreeBSD> weak_factory_{this};
++};
++
++} // namespace device
++
++#endif // DEVICE_HID_HID_SERVICE_FREEBSD_H_
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service__netbsd.cc b/chromium-next/patches/patch-services_device_hid_hid__service__netbsd.cc
new file mode 100644
index 0000000000..7155c63532
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service__netbsd.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service_netbsd.cc.orig 2025-01-20 18:01:27.944395862 +0000
++++ services/device/hid/hid_service_netbsd.cc
+@@ -0,0 +1,27 @@
++// Copyright 2022 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/device/hid/hid_service_netbsd.h"
++
++#include "base/notreached.h"
++#include "services/device/hid/hid_connection.h"
++
++namespace device {
++
++HidServiceNetBSD::HidServiceNetBSD() = default;
++HidServiceNetBSD::~HidServiceNetBSD() = default;
++
++void HidServiceNetBSD::Connect(const std::string& device_id,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback) {
++ NOTIMPLEMENTED_LOG_ONCE();
++ std::move(callback).Run(nullptr);
++}
++
++base::WeakPtr<HidService> HidServiceNetBSD::GetWeakPtr() {
++ return weak_factory_.GetWeakPtr();
++}
++
++} // namespace device
diff --git a/chromium-next/patches/patch-services_device_hid_hid__service__netbsd.h b/chromium-next/patches/patch-services_device_hid_hid__service__netbsd.h
new file mode 100644
index 0000000000..2bd4a635ab
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_hid_hid__service__netbsd.h
@@ -0,0 +1,42 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/hid/hid_service_netbsd.h.orig 2025-01-20 18:01:27.944496718 +0000
++++ services/device/hid/hid_service_netbsd.h
+@@ -0,0 +1,33 @@
++// Copyright 2022 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef SERVICES_DEVICE_HID_HID_SERVICE_NETBSD_H_
++#define SERVICES_DEVICE_HID_HID_SERVICE_NETBSD_H_
++
++#include "services/device/hid/hid_service.h"
++
++namespace device {
++
++class HidServiceNetBSD : public HidService {
++ public:
++ HidServiceNetBSD();
++ ~HidServiceNetBSD() override;
++
++ HidServiceNetBSD(const HidServiceNetBSD&) = delete;
++ HidServiceNetBSD& operator=(const HidServiceNetBSD&) = delete;
++
++ private:
++ // HidService implementation.
++ void Connect(const std::string& device_id,
++ bool allow_protected_reports,
++ bool allow_fido_reports,
++ ConnectCallback callback) override;
++ base::WeakPtr<HidService> GetWeakPtr() override;
++
++ base::WeakPtrFactory<HidServiceNetBSD> weak_factory_{this};
++};
++
++} // namespace device
++
++#endif // SERVICES_DEVICE_HID_HID_SERVICE_NETBSD_H_
diff --git a/chromium-next/patches/patch-services_device_public_cpp_generic__sensor_sensor__reading.h b/chromium-next/patches/patch-services_device_public_cpp_generic__sensor_sensor__reading.h
new file mode 100644
index 0000000000..6b1294a08b
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_public_cpp_generic__sensor_sensor__reading.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/public/cpp/generic_sensor/sensor_reading.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/public/cpp/generic_sensor/sensor_reading.h
+@@ -8,6 +8,8 @@
+ #include <stddef.h>
+ #include <stdint.h>
+
++#include <cstdint>
++
+ #include <type_traits>
+
+ namespace device {
diff --git a/chromium-next/patches/patch-services_device_public_mojom_BUILD.gn b/chromium-next/patches/patch-services_device_public_mojom_BUILD.gn
new file mode 100644
index 0000000000..7fc9e39705
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_public_mojom_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/public/mojom/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/public/mojom/BUILD.gn
+@@ -98,7 +98,7 @@ mojom("device_service") {
+ enable_js_fuzzing = false
+
+ enabled_features = []
+- if ((is_linux || is_chromeos) && use_udev) {
++ if ((is_linux || is_chromeos) && !is_bsd && use_udev) {
+ enabled_features += [ "enable_input_device_manager" ]
+ }
+
diff --git a/chromium-next/patches/patch-services_device_serial_BUILD.gn b/chromium-next/patches/patch-services_device_serial_BUILD.gn
new file mode 100644
index 0000000000..863c605420
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_serial_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/serial/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/serial/BUILD.gn
+@@ -5,7 +5,7 @@
+ import("//build/config/chromeos/ui_mode.gni")
+ import("//build/config/features.gni")
+
+-if (is_win || ((is_linux || is_chromeos) && use_udev) || is_mac) {
++if (is_win || ((!is_bsd && is_linux || is_chromeos) && use_udev) || is_mac) {
+ config("platform_support") {
+ visibility = [ ":serial" ]
+ if (is_win) {
diff --git a/chromium-next/patches/patch-services_device_serial_serial__device__enumerator.cc b/chromium-next/patches/patch-services_device_serial_serial__device__enumerator.cc
new file mode 100644
index 0000000000..cca5d77bba
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_serial_serial__device__enumerator.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/serial/serial_device_enumerator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/serial/serial_device_enumerator.cc
+@@ -13,7 +13,7 @@
+ #include "build/build_config.h"
+ #include "components/device_event_log/device_event_log.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "services/device/serial/serial_device_enumerator_linux.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "services/device/serial/serial_device_enumerator_mac.h"
+@@ -26,7 +26,7 @@ namespace device {
+ // static
+ std::unique_ptr<SerialDeviceEnumerator> SerialDeviceEnumerator::Create(
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return SerialDeviceEnumeratorLinux::Create();
+ #elif BUILDFLAG(IS_MAC)
+ return std::make_unique<SerialDeviceEnumeratorMac>();
diff --git a/chromium-next/patches/patch-services_device_serial_serial__io__handler__posix.cc b/chromium-next/patches/patch-services_device_serial_serial__io__handler__posix.cc
new file mode 100644
index 0000000000..bc8fe77727
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_serial_serial__io__handler__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/serial/serial_io_handler_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/serial/serial_io_handler_posix.cc
+@@ -73,7 +73,7 @@ bool BitrateToSpeedConstant(int bitrate,
+ BITRATE_TO_SPEED_CASE(9600)
+ BITRATE_TO_SPEED_CASE(19200)
+ BITRATE_TO_SPEED_CASE(38400)
+-#if !BUILDFLAG(IS_MAC)
++#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ BITRATE_TO_SPEED_CASE(57600)
+ BITRATE_TO_SPEED_CASE(115200)
+ BITRATE_TO_SPEED_CASE(230400)
diff --git a/chromium-next/patches/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc b/chromium-next/patches/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc
new file mode 100644
index 0000000000..a03e773372
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/time_zone_monitor/time_zone_monitor_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/time_zone_monitor/time_zone_monitor_linux.cc
+@@ -136,7 +136,11 @@ class TimeZoneMonitorLinuxImpl
+ // false positives are harmless, assuming the false positive rate is
+ // reasonable.
+ const char* const kFilesToWatch[] = {
++#if BUILDFLAG(IS_BSD)
++ "@PKG_SYSCONFBASE@/localtime",
++#else
+ "/etc/localtime", "/etc/timezone", "/etc/TZ",
++#endif
+ };
+ for (size_t index = 0; index < std::size(kFilesToWatch); ++index) {
+ file_path_watchers_.push_back(std::make_unique<base::FilePathWatcher>());
diff --git a/chromium-next/patches/patch-services_device_usb_BUILD.gn b/chromium-next/patches/patch-services_device_usb_BUILD.gn
new file mode 100644
index 0000000000..149805c69d
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_usb_BUILD.gn
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/usb/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/usb/BUILD.gn
+@@ -91,7 +91,7 @@ static_library("usb") {
+ deps += [ "//third_party/re2" ]
+ }
+
+- if (is_mac) {
++ if (is_mac || is_openbsd) {
+ # These sources and deps are required for libusb.
+ # TODO(crbug.com/40136337) Remove these sources.
+ sources += [
+@@ -114,6 +114,13 @@ static_library("usb") {
+ deps += [ "//third_party/libusb" ]
+ }
+
++ if (is_freebsd || is_netbsd) {
++ sources += [
++ "usb_service_fake.cc",
++ "usb_service_fake.h",
++ ]
++ }
++
+ if (is_linux || is_chromeos) {
+ sources += [
+ "usb_device_linux.cc",
+@@ -135,7 +142,7 @@ static_library("usb") {
+ deps += [ "//device/udev_linux" ]
+ }
+
+- if (is_android || is_chromeos || is_linux) {
++ if (is_android || is_chromeos || is_linux && !is_bsd) {
+ sources += [
+ "usb_device_handle_usbfs.cc",
+ "usb_device_handle_usbfs.h",
diff --git a/chromium-next/patches/patch-services_device_usb_usb__service.cc b/chromium-next/patches/patch-services_device_usb_usb__service.cc
new file mode 100644
index 0000000000..90b8dd3f24
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_usb_usb__service.cc
@@ -0,0 +1,42 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/usb/usb_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/device/usb/usb_service.cc
+@@ -21,12 +21,16 @@
+
+ #if BUILDFLAG(IS_ANDROID)
+ #include "services/device/usb/usb_service_android.h"
+-#elif defined(USE_UDEV)
++#elif defined(USE_UDEV) && !BUILDFLAG(IS_BSD)
+ #include "services/device/usb/usb_service_linux.h"
+ #elif BUILDFLAG(IS_MAC)
+ #include "services/device/usb/usb_service_impl.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "services/device/usb/usb_service_win.h"
++#elif BUILDFLAG(IS_OPENBSD)
++#include "services/device/usb/usb_service_impl.h"
++#elif BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
++#include "services/device/usb/usb_service_fake.h"
+ #endif
+
+ namespace device {
+@@ -49,12 +53,14 @@ constexpr base::TaskTraits UsbService::k
+ std::unique_ptr<UsbService> UsbService::Create() {
+ #if BUILDFLAG(IS_ANDROID)
+ return base::WrapUnique(new UsbServiceAndroid());
+-#elif defined(USE_UDEV)
++#elif defined(USE_UDEV) && !BUILDFLAG(IS_BSD)
+ return base::WrapUnique(new UsbServiceLinux());
+ #elif BUILDFLAG(IS_WIN)
+ return base::WrapUnique(new UsbServiceWin());
+ #elif BUILDFLAG(IS_MAC)
+ return base::WrapUnique(new UsbServiceImpl());
++#elif BUILDFLAG(IS_BSD)
++ return base::WrapUnique(new UsbServiceImpl());
+ #else
+ return nullptr;
+ #endif
diff --git a/chromium-next/patches/patch-services_device_usb_usb__service__fake.cc b/chromium-next/patches/patch-services_device_usb_usb__service__fake.cc
new file mode 100644
index 0000000000..0b1b09ad71
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_usb_usb__service__fake.cc
@@ -0,0 +1,58 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/usb/usb_service_fake.cc.orig 2025-01-20 18:01:27.945438573 +0000
++++ services/device/usb/usb_service_fake.cc
+@@ -0,0 +1,49 @@
++// Copyright 2014 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/device/usb/usb_service_fake.h"
++
++#include <stdint.h>
++
++#include <list>
++#include <memory>
++#include <set>
++#include <utility>
++
++#include "base/barrier_closure.h"
++#include "base/containers/contains.h"
++#include "base/location.h"
++#include "base/memory/ref_counted_memory.h"
++#include "base/memory/weak_ptr.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/strings/utf_string_conversions.h"
++#include "base/task/sequenced_task_runner.h"
++#include "base/task/single_thread_task_runner.h"
++#include "base/task/thread_pool.h"
++#include "base/threading/scoped_blocking_call.h"
++#include "build/build_config.h"
++#include "components/device_event_log/device_event_log.h"
++#include "services/device/usb/usb_device_handle.h"
++#include "services/device/usb/usb_error.h"
++#include "services/device/usb/webusb_descriptors.h"
++
++namespace device {
++
++UsbServiceImpl::UsbServiceImpl()
++ : task_runner_(base::SequencedTaskRunner::GetCurrentDefault()) {
++ NOTIMPLEMENTED();
++}
++
++UsbServiceImpl::~UsbServiceImpl() {
++ NOTIMPLEMENTED();
++ NotifyWillDestroyUsbService();
++}
++
++void UsbServiceImpl::GetDevices(GetDevicesCallback callback) {
++ NOTIMPLEMENTED();
++ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
++ UsbService::GetDevices(std::move(callback));
++}
++
++} // namespace device
diff --git a/chromium-next/patches/patch-services_device_usb_usb__service__fake.h b/chromium-next/patches/patch-services_device_usb_usb__service__fake.h
new file mode 100644
index 0000000000..42347559e5
--- /dev/null
+++ b/chromium-next/patches/patch-services_device_usb_usb__service__fake.h
@@ -0,0 +1,57 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/device/usb/usb_service_fake.h.orig 2025-01-20 18:01:27.945546262 +0000
++++ services/device/usb/usb_service_fake.h
+@@ -0,0 +1,48 @@
++// Copyright 2015 The Chromium Authors
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef SERVICES_DEVICE_USB_USB_SERVICE_IMPL_H_
++#define SERVICES_DEVICE_USB_USB_SERVICE_IMPL_H_
++
++#include "services/device/usb/usb_service.h"
++
++#include <stddef.h>
++
++#include <map>
++#include <set>
++#include <string>
++#include <vector>
++
++#include "base/containers/queue.h"
++#include "base/memory/weak_ptr.h"
++#include "build/build_config.h"
++#include "services/device/usb/usb_context.h"
++#include "services/device/usb/usb_device_impl.h"
++#include "third_party/abseil-cpp/absl/types/optional.h"
++
++namespace device {
++
++class UsbDeviceImpl;
++
++class UsbServiceImpl final : public UsbService {
++ public:
++ UsbServiceImpl();
++
++ UsbServiceImpl(const UsbServiceImpl&) = delete;
++ UsbServiceImpl& operator=(const UsbServiceImpl&) = delete;
++
++ ~UsbServiceImpl() override;
++
++ private:
++ // device::UsbService implementation
++ void GetDevices(GetDevicesCallback callback) override;
++
++ void OnUsbContext(scoped_refptr<UsbContext> context);
++
++ scoped_refptr<base::SequencedTaskRunner> task_runner_;
++};
++
++} // namespace device
++
++#endif // SERVICES_DEVICE_USB_USB_SERVICE_IMPL_H_
diff --git a/chromium-next/patches/patch-services_network_BUILD.gn b/chromium-next/patches/patch-services_network_BUILD.gn
new file mode 100644
index 0000000000..8501f0eb03
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_BUILD.gn
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/BUILD.gn
+@@ -401,7 +401,6 @@ if (is_linux || is_chromeos) {
+ ]
+ deps = [
+ "//base:base",
+- "//sandbox/linux:sandbox_services",
+ "//sandbox/policy:policy",
+ ]
+ configs += [ "//build/config/compiler:wexit_time_destructors" ]
diff --git a/chromium-next/patches/patch-services_network_network__context.cc b/chromium-next/patches/patch-services_network_network__context.cc
new file mode 100644
index 0000000000..9d6dbabe7f
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_network__context.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/network_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/network_context.cc
+@@ -615,7 +615,7 @@ NetworkContext::NetworkContextHttpAuthPr
+ NetworkContext::NetworkContextHttpAuthPreferences::
+ ~NetworkContextHttpAuthPreferences() = default;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool NetworkContext::NetworkContextHttpAuthPreferences::AllowGssapiLibraryLoad()
+ const {
+ if (network_service_) {
+@@ -2499,7 +2499,7 @@ void NetworkContext::OnHttpAuthDynamicPa
+ http_auth_dynamic_network_service_params->android_negotiate_account_type);
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ http_auth_merged_preferences_.set_allow_gssapi_library_load(
+ http_auth_dynamic_network_service_params->allow_gssapi_library_load);
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-services_network_network__context.h b/chromium-next/patches/patch-services_network_network__context.h
new file mode 100644
index 0000000000..7cd28cbc02
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_network__context.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/network_context.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/network_context.h
+@@ -698,7 +698,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE)
+ public:
+ explicit NetworkContextHttpAuthPreferences(NetworkService* network_service);
+ ~NetworkContextHttpAuthPreferences() override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool AllowGssapiLibraryLoad() const override;
+ #endif // BUILDFLAG(IS_LINUX)
+ private:
diff --git a/chromium-next/patches/patch-services_network_network__sandbox__hook__linux.cc b/chromium-next/patches/patch-services_network_network__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..260e93a407
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_network__sandbox__hook__linux.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/network_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/network_sandbox_hook_linux.cc
+@@ -15,11 +15,14 @@
+ #include "sandbox/linux/syscall_broker/broker_file_permission.h"
+ #include "sandbox/policy/features.h"
+
++#if !BUILDFLAG(IS_BSD)
+ using sandbox::syscall_broker::BrokerFilePermission;
+ using sandbox::syscall_broker::MakeBrokerCommandSet;
++#endif
+
+ namespace network {
+
++#if !BUILDFLAG(IS_BSD)
+ sandbox::syscall_broker::BrokerCommandSet GetNetworkBrokerCommandSet() {
+ return MakeBrokerCommandSet({
+ sandbox::syscall_broker::COMMAND_ACCESS,
+@@ -103,9 +106,11 @@ void LoadNetworkLibraries() {
+ }
+ }
+ #endif // BUILDFLAG(IS_CHROMEOS)
++#endif
+
+ bool NetworkPreSandboxHook(std::vector<std::string> network_context_parent_dirs,
+ sandbox::policy::SandboxLinux::Options options) {
++#if !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(IS_CHROMEOS)
+ LoadNetworkLibraries();
+ #endif
+@@ -118,6 +123,7 @@ bool NetworkPreSandboxHook(std::vector<s
+ GetNetworkBrokerCommandSet(),
+ GetNetworkFilePermissions(std::move(network_context_parent_dirs)),
+ options);
++#endif
+
+ return true;
+ }
diff --git a/chromium-next/patches/patch-services_network_network__sandbox__hook__linux.h b/chromium-next/patches/patch-services_network_network__sandbox__hook__linux.h
new file mode 100644
index 0000000000..e476c2a6ac
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_network__sandbox__hook__linux.h
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/network_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/network_sandbox_hook_linux.h
+@@ -6,7 +6,11 @@
+ #define SERVICES_NETWORK_NETWORK_SANDBOX_HOOK_LINUX_H_
+
+ #include "base/component_export.h"
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace network {
+
diff --git a/chromium-next/patches/patch-services_network_network__service.cc b/chromium-next/patches/patch-services_network_network__service.cc
new file mode 100644
index 0000000000..a6245129f0
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_network__service.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/network_service.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/network_service.cc
+@@ -99,7 +99,7 @@
+ #include "third_party/boringssl/src/include/openssl/cpu.h"
+ #endif
+
+-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || \
++#if ((BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)) || BUILDFLAG(IS_BSD)) || \
+ BUILDFLAG(IS_CHROMEOS_LACROS)
+
+ #include "components/os_crypt/sync/key_storage_config_linux.h"
+@@ -977,7 +977,7 @@ void NetworkService::SetExplicitlyAllowe
+ net::SetExplicitlyAllowedPorts(ports);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void NetworkService::SetGssapiLibraryLoadObserver(
+ mojo::PendingRemote<mojom::GssapiLibraryLoadObserver>
+ gssapi_library_load_observer) {
+@@ -1059,7 +1059,7 @@ NetworkService::CreateHttpAuthHandlerFac
+ );
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void NetworkService::OnBeforeGssapiLibraryLoad() {
+ if (gssapi_library_load_observer_.is_bound()) {
+ gssapi_library_load_observer_->OnBeforeGssapiLibraryLoad();
diff --git a/chromium-next/patches/patch-services_network_network__service.h b/chromium-next/patches/patch-services_network_network__service.h
new file mode 100644
index 0000000000..dac1dbd291
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_network__service.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/network_service.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/network_service.h
+@@ -238,7 +238,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE)
+ const std::vector<ContentSettingPatternSource>& settings) override;
+
+ void SetExplicitlyAllowedPorts(const std::vector<uint16_t>& ports) override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void SetGssapiLibraryLoadObserver(
+ mojo::PendingRemote<mojom::GssapiLibraryLoadObserver>
+ gssapi_library_load_observer) override;
+@@ -264,7 +264,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE)
+ std::unique_ptr<net::HttpAuthHandlerFactory> CreateHttpAuthHandlerFactory(
+ NetworkContext* network_context);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // This is called just before a GSSAPI library may be loaded.
+ void OnBeforeGssapiLibraryLoad();
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -498,7 +498,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE)
+ // leaking stale listeners between tests.
+ std::unique_ptr<net::NetworkChangeNotifier> mock_network_change_notifier_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ mojo::Remote<mojom::GssapiLibraryLoadObserver> gssapi_library_load_observer_;
+ #endif // BUILDFLAG(IS_LINUX)
+
diff --git a/chromium-next/patches/patch-services_network_public_cpp_BUILD.gn b/chromium-next/patches/patch-services_network_public_cpp_BUILD.gn
new file mode 100644
index 0000000000..dcafbb57a1
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_public_cpp_BUILD.gn
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/public/cpp/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/public/cpp/BUILD.gn
+@@ -504,7 +504,7 @@ component("cpp_base") {
+ sources += [ "transferable_directory_fuchsia.cc" ]
+ }
+
+- if (is_linux) {
++ if (is_linux && !is_bsd) {
+ sources += [
+ "network_interface_change_listener_mojom_traits.cc",
+ "network_interface_change_listener_mojom_traits.h",
+@@ -615,7 +615,7 @@ source_set("tests") {
+ "x_frame_options_parser_unittest.cc",
+ ]
+
+- if (is_linux) {
++ if ((is_linux) && !is_bsd) {
+ sources += [ "network_interface_change_listener_mojom_traits_unittest.cc" ]
+ }
+
diff --git a/chromium-next/patches/patch-services_network_public_cpp_features.cc b/chromium-next/patches/patch-services_network_public_cpp_features.cc
new file mode 100644
index 0000000000..f925055e03
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_public_cpp_features.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/public/cpp/features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/public/cpp/features.cc
+@@ -126,7 +126,7 @@ BASE_FEATURE(kSplitAuthCacheByNetworkIso
+ BASE_FEATURE(kDnsOverHttpsUpgrade,
+ "DnsOverHttpsUpgrade",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-services_network_public_mojom_BUILD.gn b/chromium-next/patches/patch-services_network_public_mojom_BUILD.gn
new file mode 100644
index 0000000000..8920bb7bb4
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_public_mojom_BUILD.gn
@@ -0,0 +1,31 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/public/mojom/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/public/mojom/BUILD.gn
+@@ -538,11 +538,11 @@ mojom("url_loader_base") {
+ }
+
+ enabled_features = []
+- if (is_android || is_chromeos || is_linux) {
++ if (!is_bsd && (is_android || is_chromeos || is_linux)) {
+ enabled_features += [ "network_change_notifier_in_browser" ]
+ }
+
+- if (is_linux) {
++ if (is_linux && !is_bsd) {
+ # TODO(crbug.com/40263697): Remove this once is_linux in the mojom IDL does
+ # not include lacros.
+ enabled_features += [ "use_network_interface_change_listener" ]
+@@ -1564,7 +1564,7 @@ mojom("mojom") {
+ }
+ }
+
+- if (is_linux) {
++ if (is_linux && !is_bsd) {
+ # TODO(crbug.com/40263697): Remove this once is_linux in the mojom IDL does
+ # not include lacros.
+ enabled_features += [ "use_network_interface_change_listener" ]
diff --git a/chromium-next/patches/patch-services_network_shared__dictionary_shared__dictionary__writer__in__memory.h b/chromium-next/patches/patch-services_network_shared__dictionary_shared__dictionary__writer__in__memory.h
new file mode 100644
index 0000000000..09000a0321
--- /dev/null
+++ b/chromium-next/patches/patch-services_network_shared__dictionary_shared__dictionary__writer__in__memory.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/network/shared_dictionary/shared_dictionary_writer_in_memory.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/network/shared_dictionary/shared_dictionary_writer_in_memory.h
+@@ -9,6 +9,8 @@
+ #include <string>
+ #include <vector>
+
++#include <vector>
++
+ #include "base/component_export.h"
+ #include "base/functional/callback.h"
+ #include "crypto/secure_hash.h"
diff --git a/chromium-next/patches/patch-services_on__device__model_on__device__model__service.h b/chromium-next/patches/patch-services_on__device__model_on__device__model__service.h
new file mode 100644
index 0000000000..04ac19a45f
--- /dev/null
+++ b/chromium-next/patches/patch-services_on__device__model_on__device__model__service.h
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/on_device_model/on_device_model_service.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/on_device_model/on_device_model_service.h
+@@ -31,6 +31,10 @@ class OnDeviceModelInternalImpl;
+ class TsHolder;
+ }
+
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#endif
++
+ namespace on_device_model {
+
+ class COMPONENT_EXPORT(ON_DEVICE_MODEL) OnDeviceModelService
+@@ -44,7 +48,7 @@ class COMPONENT_EXPORT(ON_DEVICE_MODEL)
+ // Must be called in the service's process after the run loop finished.
+ [[nodiscard]] static bool Shutdown();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static void AddSandboxLinuxOptions(
+ sandbox::policy::SandboxLinux::Options& options);
+ #endif
diff --git a/chromium-next/patches/patch-services_on__device__model_pre__sandbox__init.cc b/chromium-next/patches/patch-services_on__device__model_pre__sandbox__init.cc
new file mode 100644
index 0000000000..b2b7bd75d6
--- /dev/null
+++ b/chromium-next/patches/patch-services_on__device__model_pre__sandbox__init.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/on_device_model/pre_sandbox_init.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/on_device_model/pre_sandbox_init.cc
+@@ -14,7 +14,7 @@
+ #include "services/on_device_model/ml/chrome_ml.h" // nogncheck
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "gpu/config/gpu_info_collector.h" // nogncheck
+ #include "third_party/dawn/include/dawn/dawn_proc.h" // nogncheck
+ #include "third_party/dawn/include/dawn/native/DawnNative.h" // nogncheck
+@@ -25,7 +25,7 @@ namespace on_device_model {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ constexpr uint32_t kVendorIdAMD = 0x1002;
+ constexpr uint32_t kVendorIdIntel = 0x8086;
+ constexpr uint32_t kVendorIdNVIDIA = 0x10DE;
+@@ -74,7 +74,7 @@ bool OnDeviceModelService::PreSandboxIni
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Warm any relevant drivers before attempting to bring up the sandbox. For
+ // good measure we initialize a device instance for any adapter with an
+ // appropriate backend on top of any integrated or discrete GPU.
+@@ -102,7 +102,7 @@ bool OnDeviceModelService::PreSandboxIni
+ return true;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ void OnDeviceModelService::AddSandboxLinuxOptions(
+ sandbox::policy::SandboxLinux::Options& options) {
diff --git a/chromium-next/patches/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc b/chromium-next/patches/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc
new file mode 100644
index 0000000000..878769b7fe
--- /dev/null
+++ b/chromium-next/patches/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc
@@ -0,0 +1,71 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc
+@@ -54,7 +54,7 @@ uint32_t CalculatePrivateFootprintKb(con
+ uint32_t shared_resident_kb) {
+ DCHECK(os_dump.platform_private_footprint);
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ uint64_t rss_anon_bytes = os_dump.platform_private_footprint->rss_anon_bytes;
+ uint64_t vm_swap_bytes = os_dump.platform_private_footprint->vm_swap_bytes;
+ return (rss_anon_bytes + vm_swap_bytes) / 1024;
+@@ -83,7 +83,7 @@ memory_instrumentation::mojom::OSMemDump
+ os_dump->is_peak_rss_resettable = internal_os_dump.is_peak_rss_resettable;
+ os_dump->private_footprint_kb =
+ CalculatePrivateFootprintKb(internal_os_dump, shared_resident_kb);
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ os_dump->private_footprint_swap_kb =
+ internal_os_dump.platform_private_footprint->vm_swap_bytes / 1024;
+ #endif
+@@ -219,7 +219,7 @@ void QueuedRequestDispatcher::SetUpAndDi
+
+ // On most platforms each process can dump data about their own process
+ // so ask each process to do so Linux is special see below.
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ request->pending_responses.insert({client_info.pid, ResponseType::kOSDump});
+ client->RequestOSMemoryDump(request->memory_map_option(),
+ {base::kNullProcessId},
+@@ -234,7 +234,7 @@ void QueuedRequestDispatcher::SetUpAndDi
+
+ // In some cases, OS stats can only be dumped from a privileged process to
+ // get around to sandboxing/selinux restrictions (see crbug.com/461788).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::vector<base::ProcessId> pids;
+ mojom::ClientProcess* browser_client = nullptr;
+ base::ProcessId browser_client_pid = base::kNullProcessId;
+@@ -280,7 +280,7 @@ void QueuedRequestDispatcher::SetUpAndDi
+ const OsCallback& os_callback) {
+ // On Linux, OS stats can only be dumped from a privileged process to
+ // get around to sandboxing/selinux restrictions (see crbug.com/461788).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojom::ClientProcess* browser_client = nullptr;
+ base::ProcessId browser_client_pid = 0;
+ for (const auto& client_info : clients) {
+@@ -330,7 +330,7 @@ QueuedRequestDispatcher::FinalizeVmRegio
+ // each client process provides 1 OS dump, % the case where the client is
+ // disconnected mid dump.
+ OSMemDumpMap& extra_os_dumps = response.second.os_dumps;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (auto& kv : extra_os_dumps) {
+ auto pid = kv.first == base::kNullProcessId ? original_pid : kv.first;
+ DCHECK(results.find(pid) == results.end());
+@@ -391,7 +391,7 @@ void QueuedRequestDispatcher::Finalize(Q
+ // crash). In the latter case (OS_LINUX) we expect the full map to come
+ // from the browser process response.
+ OSMemDumpMap& extra_os_dumps = response.second.os_dumps;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ for (const auto& kv : extra_os_dumps) {
+ auto pid = kv.first == base::kNullProcessId ? original_pid : kv.first;
+ DCHECK_EQ(pid_to_os_dump[pid], nullptr);
diff --git a/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn b/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn
new file mode 100644
index 0000000000..606837c5c8
--- /dev/null
+++ b/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/resource_coordinator/public/cpp/memory_instrumentation/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/resource_coordinator/public/cpp/memory_instrumentation/BUILD.gn
+@@ -29,10 +29,14 @@ component("memory_instrumentation") {
+ sources += [ "os_metrics_win.cc" ]
+ }
+
+- if (is_android || is_linux || is_chromeos) {
++ if ((is_android || is_linux || is_chromeos) && !is_bsd) {
+ sources += [ "os_metrics_linux.cc" ]
+ }
+
++ if (is_bsd) {
++ sources += [ "os_metrics_bsd.cc" ]
++ }
++
+ if (is_fuchsia) {
+ sources += [ "os_metrics_fuchsia.cc" ]
+ }
diff --git a/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h b/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h
new file mode 100644
index 0000000000..5c90fe72ad
--- /dev/null
+++ b/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h
+@@ -53,7 +53,7 @@ class COMPONENT_EXPORT(
+ mojom::RawOSMemDump*);
+ static std::vector<mojom::VmRegionPtr> GetProcessMemoryMaps(base::ProcessId);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ static void SetProcSmapsForTesting(FILE*);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID)
+@@ -70,7 +70,7 @@ class COMPONENT_EXPORT(
+ static std::vector<mojom::VmRegionPtr> GetProcessModules(base::ProcessId);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Provides information on the dump state of resident pages. These values are
+ // written to logs. New enum values can be added, but existing enums must
+ // never be renumbered or deleted and reused.
diff --git a/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc b/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc
new file mode 100644
index 0000000000..dc5150b238
--- /dev/null
+++ b/chromium-next/patches/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc
@@ -0,0 +1,75 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_bsd.cc.orig 2025-01-20 18:01:27.948284098 +0000
++++ services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_bsd.cc
+@@ -0,0 +1,66 @@
++// Copyright 2022 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h"
++
++#include "base/memory/page_size.h"
++#include "base/process/process.h"
++#include "base/process/process_handle.h"
++
++#include <sys/sysctl.h>
++
++#include <vector>
++
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_NETBSD)
++#define vm_rssize info.p_vm_rssize
++#elif BUILDFLAG(IS_FREEBSD)
++#include <sys/user.h>
++#define vm_rssize info.ki_rssize
++#endif
++
++namespace memory_instrumentation {
++
++// static
++bool OSMetrics::FillOSMemoryDump(base::ProcessId pid,
++ mojom::RawOSMemDump* dump) {
++ base::Process process = pid == base::kNullProcessId
++ ? base::Process::Current()
++ : base::Process::Open(pid);
++ const size_t kPageSize = base::GetPageSize();
++#if BUILDFLAG(IS_NETBSD)
++ struct kinfo_proc2 info;
++ size_t length = sizeof(struct kinfo_proc2);
++#else
++ struct kinfo_proc info;
++ size_t length = sizeof(struct kinfo_proc);
++#endif
++#if BUILDFLAG(IS_OPENBSD)
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process.Handle(),
++ static_cast<int>(length), 1 };
++#elif BUILDFLAG(IS_FREEBSD)
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process.Handle() };
++#elif BUILDFLAG(IS_NETBSD)
++ int mib[] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, process.Handle(),
++ sizeof(struct kinfo_proc2), 1 };
++#endif
++
++ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
++ return false;
++
++ dump->resident_set_kb = (vm_rssize * kPageSize) / 1024;
++ dump->platform_private_footprint->rss_anon_bytes =
++ vm_rssize * kPageSize;
++ dump->platform_private_footprint->vm_swap_bytes = 0;
++
++ return true;
++}
++
++// static
++std::vector<mojom::VmRegionPtr> OSMetrics::GetProcessMemoryMaps(
++ base::ProcessId) {
++ NOTIMPLEMENTED();
++ return std::vector<mojom::VmRegionPtr>();
++}
++
++} // namespace memory_instrumentation
diff --git a/chromium-next/patches/patch-services_screen__ai_public_cpp_utilities.cc b/chromium-next/patches/patch-services_screen__ai_public_cpp_utilities.cc
new file mode 100644
index 0000000000..adb9838774
--- /dev/null
+++ b/chromium-next/patches/patch-services_screen__ai_public_cpp_utilities.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/screen_ai/public/cpp/utilities.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/screen_ai/public/cpp/utilities.cc
+@@ -18,7 +18,7 @@ namespace screen_ai {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ constexpr char kBinaryPathSwitch[] = "screen-ai-binary";
+ #endif
+
+@@ -39,7 +39,7 @@ constexpr char kScreenAIDlcRootPath[] =
+ #endif
+
+ #if BUILDFLAG(ENABLE_SCREEN_AI_BROWSERTESTS)
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ constexpr base::FilePath::CharType kScreenAIResourcePathForTests[] =
+ FILE_PATH_LITERAL("third_party/screen-ai/linux/resources");
+ #elif BUILDFLAG(IS_MAC)
+@@ -128,7 +128,7 @@ base::FilePath GetComponentBinaryPathFor
+
+ const char* GetBinaryPathSwitch() {
+ // This is only used on Linux and ChromeOS.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return kBinaryPathSwitch;
+ #else
+ return nullptr;
diff --git a/chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc b/chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..d7e0cc9e3b
--- /dev/null
+++ b/chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.cc
+@@ -53,6 +53,7 @@ bool ScreenAIPreSandboxHook(base::FilePa
+ }
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+
+ std::vector<BrokerFilePermission> permissions{
+@@ -75,6 +76,7 @@ bool ScreenAIPreSandboxHook(base::FilePa
+ sandbox::syscall_broker::COMMAND_OPEN}),
+ permissions, options);
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+
+ return true;
+ }
diff --git a/chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h b/chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h
new file mode 100644
index 0000000000..515aeaecda
--- /dev/null
+++ b/chromium-next/patches/patch-services_screen__ai_sandbox_screen__ai__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/screen_ai/sandbox/screen_ai_sandbox_hook_linux.h
+@@ -6,7 +6,13 @@
+ #define SERVICES_SCREEN_AI_SANDBOX_SCREEN_AI_SANDBOX_HOOK_LINUX_H_
+
+ #include "base/files/file_path.h"
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace screen_ai {
+
diff --git a/chromium-next/patches/patch-services_service__manager_BUILD.gn b/chromium-next/patches/patch-services_service__manager_BUILD.gn
new file mode 100644
index 0000000000..b9f124cd20
--- /dev/null
+++ b/chromium-next/patches/patch-services_service__manager_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/service_manager/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/service_manager/BUILD.gn
+@@ -66,7 +66,7 @@ source_set("service_manager") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ deps += [ "//sandbox/linux:sandbox_services" ]
+ }
+ }
diff --git a/chromium-next/patches/patch-services_service__manager_public_cpp_service__executable_BUILD.gn b/chromium-next/patches/patch-services_service__manager_public_cpp_service__executable_BUILD.gn
new file mode 100644
index 0000000000..835938006d
--- /dev/null
+++ b/chromium-next/patches/patch-services_service__manager_public_cpp_service__executable_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/service_manager/public/cpp/service_executable/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/service_manager/public/cpp/service_executable/BUILD.gn
+@@ -22,7 +22,7 @@ source_set("support") {
+ "//services/service_manager/public/mojom",
+ ]
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ deps += [
+ "//sandbox/linux:sandbox",
+ "//sandbox/linux:sandbox_services",
diff --git a/chromium-next/patches/patch-services_tracing_public_cpp_stack__sampling_tracing__sampler__profiler.cc b/chromium-next/patches/patch-services_tracing_public_cpp_stack__sampling_tracing__sampler__profiler.cc
new file mode 100644
index 0000000000..a00214b596
--- /dev/null
+++ b/chromium-next/patches/patch-services_tracing_public_cpp_stack__sampling_tracing__sampler__profiler.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.cc
+@@ -38,7 +38,7 @@
+ #include "third_party/perfetto/protos/perfetto/trace/track_event/process_descriptor.pbzero.h"
+ #include "third_party/perfetto/protos/perfetto/trace/track_event/thread_descriptor.pbzero.h"
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ #include "base/profiler/thread_delegate_posix.h"
+ #define INITIALIZE_THREAD_DELEGATE_POSIX 1
+ #else // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_APPLE)
diff --git a/chromium-next/patches/patch-services_video__capture_public_mojom_video__capture__service.mojom b/chromium-next/patches/patch-services_video__capture_public_mojom_video__capture__service.mojom
new file mode 100644
index 0000000000..3a8ef0e270
--- /dev/null
+++ b/chromium-next/patches/patch-services_video__capture_public_mojom_video__capture__service.mojom
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/video_capture/public/mojom/video_capture_service.mojom.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/video_capture/public/mojom/video_capture_service.mojom
+@@ -25,10 +25,10 @@ interface AcceleratorFactory {
+ pending_receiver<chromeos_camera.mojom.MjpegDecodeAccelerator> jda);
+ };
+
+-[EnableIf=is_fuchsia]
++[EnableIf=is_openbsd]
+ const sandbox.mojom.Sandbox kVideoCaptureSandbox
+ = sandbox.mojom.Sandbox.kVideoCapture;
+-[EnableIfNot=is_fuchsia]
++[EnableIfNot=is_openbsd]
+ const sandbox.mojom.Sandbox kVideoCaptureSandbox
+ = sandbox.mojom.Sandbox.kNoSandbox;
+
diff --git a/chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.cc b/chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.cc
new file mode 100644
index 0000000000..33fac0e5af
--- /dev/null
+++ b/chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/video_effects/video_effects_sandbox_hook_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/video_effects/video_effects_sandbox_hook_linux.cc
+@@ -6,7 +6,13 @@
+
+ #include <dlfcn.h>
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+ #include "services/on_device_model/ml/chrome_ml.h"
+
+ namespace video_effects {
+@@ -29,8 +35,10 @@ bool VideoEffectsPreSandboxHook(
+ DVLOG(1) << "Successfully opened Chrome ML shared library.";
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ auto* instance = sandbox::policy::SandboxLinux::GetInstance();
+ instance->EngageNamespaceSandboxIfPossible();
++#endif
+ return true;
+ }
+
diff --git a/chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.h b/chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.h
new file mode 100644
index 0000000000..1eb4dafe81
--- /dev/null
+++ b/chromium-next/patches/patch-services_video__effects_video__effects__sandbox__hook__linux.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- services/video_effects/video_effects_sandbox_hook_linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ services/video_effects/video_effects_sandbox_hook_linux.h
+@@ -5,7 +5,13 @@
+ #ifndef SERVICES_VIDEO_EFFECTS_VIDEO_EFFECTS_SANDBOX_HOOK_LINUX_H_
+ #define SERVICES_VIDEO_EFFECTS_VIDEO_EFFECTS_SANDBOX_HOOK_LINUX_H_
+
++#include "build/build_config.h"
++
++#if BUILDFLAG(IS_BSD)
++#include "sandbox/policy/sandbox.h"
++#else
+ #include "sandbox/policy/linux/sandbox_linux.h"
++#endif
+
+ namespace video_effects {
+
diff --git a/chromium-next/patches/patch-skia_ext_SkMemory__new__handler.cpp b/chromium-next/patches/patch-skia_ext_SkMemory__new__handler.cpp
new file mode 100644
index 0000000000..18f698a1c9
--- /dev/null
+++ b/chromium-next/patches/patch-skia_ext_SkMemory__new__handler.cpp
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- skia/ext/SkMemory_new_handler.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ skia/ext/SkMemory_new_handler.cpp
+@@ -19,7 +19,7 @@
+ #include <windows.h>
+ #elif BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
+-#else
++#elif !BUILDFLAG(IS_BSD)
+ #include <malloc.h>
+ #endif
+
+@@ -105,7 +105,7 @@ static void* malloc_nothrow(size_t size,
+ // TODO(b.kelemen): we should always use UncheckedMalloc but currently it
+ // doesn't work as intended everywhere.
+ void* result;
+-#if BUILDFLAG(IS_IOS)
++#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ result = malloc(size);
+ #else
+ // It's the responsibility of the caller to check the return value.
diff --git a/chromium-next/patches/patch-skia_ext_font__utils.cc b/chromium-next/patches/patch-skia_ext_font__utils.cc
new file mode 100644
index 0000000000..8fdbde2d78
--- /dev/null
+++ b/chromium-next/patches/patch-skia_ext_font__utils.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- skia/ext/font_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ skia/ext/font_utils.cc
+@@ -19,7 +19,7 @@
+ #include "third_party/skia/include/ports/SkFontMgr_mac_ct.h"
+ #endif
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "third_party/skia/include/ports/SkFontConfigInterface.h"
+ #include "third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h"
+ #endif
+@@ -60,7 +60,7 @@ static sk_sp<SkFontMgr> fontmgr_factory(
+ return SkFontMgr_New_Android(nullptr);
+ #elif BUILDFLAG(IS_APPLE)
+ return SkFontMgr_New_CoreText(nullptr);
+-#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ sk_sp<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal());
+ return fci ? SkFontMgr_New_FCI(std::move(fci)) : nullptr;
+ #elif BUILDFLAG(IS_FUCHSIA)
diff --git a/chromium-next/patches/patch-skia_ext_platform__canvas.h b/chromium-next/patches/patch-skia_ext_platform__canvas.h
new file mode 100644
index 0000000000..36f086bef6
--- /dev/null
+++ b/chromium-next/patches/patch-skia_ext_platform__canvas.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- skia/ext/platform_canvas.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ skia/ext/platform_canvas.h
+@@ -58,7 +58,7 @@ SK_API HDC GetNativeDrawingContext(SkCan
+
+ #elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
+ defined(__sun) || defined(ANDROID) || defined(__APPLE__) || \
+- defined(__Fuchsia__)
++ defined(__Fuchsia__) || defined(__NetBSD__)
+ // Construct a canvas from the given memory region. The memory is not cleared
+ // first. @data must be, at least, @height * StrideForWidth(@width) bytes.
+ SK_API std::unique_ptr<SkCanvas> CreatePlatformCanvasWithPixels(
diff --git a/chromium-next/patches/patch-skia_ext_skcolorspace__trfn.cc b/chromium-next/patches/patch-skia_ext_skcolorspace__trfn.cc
new file mode 100644
index 0000000000..d37929451e
--- /dev/null
+++ b/chromium-next/patches/patch-skia_ext_skcolorspace__trfn.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- skia/ext/skcolorspace_trfn.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ skia/ext/skcolorspace_trfn.cc
+@@ -7,6 +7,8 @@
+ #pragma allow_unsafe_buffers
+ #endif
+
++#include <cmath>
++
+ #include "skia/ext/skcolorspace_trfn.h"
+
+ #include <cmath>
diff --git a/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_config.h b/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_config.h
new file mode 100644
index 0000000000..620134a9f3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_config.h
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/abseil-cpp/absl/base/config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/abseil-cpp/absl/base/config.h
+@@ -412,7 +412,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMES
+ #ifdef ABSL_HAVE_SCHED_YIELD
+ #error ABSL_HAVE_SCHED_YIELD cannot be directly set
+ #elif defined(__linux__) || defined(__ros__) || defined(__native_client__) || \
+- defined(__VXWORKS__)
++ defined(__VXWORKS__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define ABSL_HAVE_SCHED_YIELD 1
+ #endif
+
+@@ -427,7 +427,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMES
+ // platforms.
+ #ifdef ABSL_HAVE_SEMAPHORE_H
+ #error ABSL_HAVE_SEMAPHORE_H cannot be directly set
+-#elif defined(__linux__) || defined(__ros__) || defined(__VXWORKS__)
++#elif defined(__linux__) || defined(__ros__) || defined(__VXWORKS__) || \
++ defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define ABSL_HAVE_SEMAPHORE_H 1
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc b/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc
new file mode 100644
index 0000000000..bff23dd860
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/abseil-cpp/absl/base/internal/raw_logging.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/abseil-cpp/absl/base/internal/raw_logging.cc
+@@ -44,7 +44,7 @@
+ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+ defined(__hexagon__) || defined(__Fuchsia__) || \
+ defined(__native_client__) || defined(__OpenBSD__) || \
+- defined(__EMSCRIPTEN__) || defined(__ASYLO__)
++ defined(__EMSCRIPTEN__) || defined(__ASYLO__) || defined(__NetBSD__)
+
+ #include <unistd.h>
+
diff --git a/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_sysinfo.cc b/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_sysinfo.cc
new file mode 100644
index 0000000000..a843252424
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_abseil-cpp_absl_base_internal_sysinfo.cc
@@ -0,0 +1,71 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/abseil-cpp/absl/base/internal/sysinfo.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/abseil-cpp/absl/base/internal/sysinfo.cc
+@@ -30,7 +30,7 @@
+ #include <sys/syscall.h>
+ #endif
+
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ #include <sys/sysctl.h>
+ #endif
+
+@@ -198,6 +198,7 @@ static double GetNominalCPUFrequency() {
+
+ #else
+
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
+ // Helper function for reading a long from a file. Returns true if successful
+ // and the memory location pointed to by value is set to the value read.
+ static bool ReadLongFromFile(const char *file, long *value) {
+@@ -230,6 +231,7 @@ static bool ReadLongFromFile(const char
+ }
+ return ret;
+ }
++#endif
+
+ #if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY)
+
+@@ -329,9 +331,11 @@ static double GetNominalCPUFrequency() {
+ // a new mode (turbo mode). Essentially, those frequencies cannot
+ // always be relied upon. The same reasons apply to /proc/cpuinfo as
+ // well.
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__) // pledge violation
+ if (ReadLongFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)) {
+ return freq * 1e3; // Value is kHz.
+ }
++#endif
+
+ #if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY)
+ // On these platforms, the TSC frequency is the nominal CPU
+@@ -350,10 +354,12 @@ static double GetNominalCPUFrequency() {
+ // If CPU scaling is in effect, we want to use the *maximum*
+ // frequency, not whatever CPU speed some random processor happens
+ // to be using now.
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__) // pledge violation
+ if (ReadLongFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq",
+ &freq)) {
+ return freq * 1e3; // Value is kHz.
+ }
++#endif
+
+ return 1.0;
+ #endif // !ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY
+@@ -465,6 +471,12 @@ pid_t GetTID() {
+ return reinterpret_cast<pid_t>(thread);
+ }
+
++#elif defined(__OpenBSD__)
++
++pid_t GetTID() {
++ return getthrid();
++}
++
+ #elif defined(__Fuchsia__)
+
+ pid_t GetTID() {
diff --git a/chromium-next/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h b/chromium-next/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h
new file mode 100644
index 0000000000..0db3b9e0fd
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h
+@@ -35,7 +35,8 @@
+ #if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
+ !defined(__native_client__) && !defined(__asmjs__) && \
+ !defined(__wasm__) && !defined(__HAIKU__) && !defined(__sun) && \
+- !defined(__VXWORKS__) && !defined(__hexagon__) && !defined(__XTENSA__)
++ !defined(__VXWORKS__) && !defined(__hexagon__) && !defined(__XTENSA__) && \
++ !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #define ABSL_HAVE_ELF_MEM_IMAGE 1
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc b/chromium-next/patches/patch-third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc
new file mode 100644
index 0000000000..9ef5f33ca5
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc
+@@ -19,7 +19,8 @@
+ #endif
+
+ #if defined(HAS_STRPTIME) && HAS_STRPTIME
+-#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
++#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && \
++ !defined(__NetBSD__)
+ #define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98).
+ #endif
+ #endif
diff --git a/chromium-next/patches/patch-third__party_afl_src_afl-fuzz.c b/chromium-next/patches/patch-third__party_afl_src_afl-fuzz.c
new file mode 100644
index 0000000000..9bc3030c43
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_afl_src_afl-fuzz.c
@@ -0,0 +1,48 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/afl/src/afl-fuzz.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/afl/src/afl-fuzz.c
+@@ -58,7 +58,8 @@
+ #include <sys/ioctl.h>
+ #include <sys/file.h>
+
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || \
++ defined (__NetBSD__)
+ # include <sys/sysctl.h>
+ #endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
+
+@@ -3531,7 +3532,8 @@ static double get_runnable_processes(voi
+
+ static double res;
+
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || \
++ defined (__NetBSD__)
+
+ /* I don't see any portable sysctl or so that would quickly give us the
+ number of runnable processes; the 1-minute load average can be a
+@@ -7347,7 +7349,8 @@ static void get_core_count(void) {
+
+ u32 cur_runnable = 0;
+
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || \
++ defined (__NetBSD__)
+
+ size_t s = sizeof(cpu_core_count);
+
+@@ -7392,7 +7395,8 @@ static void get_core_count(void) {
+
+ cur_runnable = (u32)get_runnable_processes();
+
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || \
++ defined (__NetBSD__)
+
+ /* Add ourselves, since the 1-minute average doesn't include that yet. */
+
diff --git a/chromium-next/patches/patch-third__party_angle_BUILD.gn b/chromium-next/patches/patch-third__party_angle_BUILD.gn
new file mode 100644
index 0000000000..7281112958
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_BUILD.gn
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/BUILD.gn
+@@ -358,7 +358,6 @@ config("extra_warnings") {
+ "-Wtautological-type-limit-compare",
+ "-Wundefined-reinterpret-cast",
+ "-Wunneeded-internal-declaration",
+- "-Wunused-but-set-variable",
+ "-Wsuggest-destructor-override",
+ "-Wsuggest-override",
+
+@@ -535,7 +534,7 @@ template("angle_common_lib") {
+ all_dependent_configs = [ ":angle_disable_pool_alloc" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ libs = [ "dl" ]
+ }
+
+@@ -690,6 +689,9 @@ angle_static_library("angle_gpu_info_uti
+ "Xi",
+ "Xext",
+ ]
++ if (is_bsd) {
++ libs += [ "GL" ]
++ }
+ }
+
+ if (angle_use_wayland && angle_has_build) {
diff --git a/chromium-next/patches/patch-third__party_angle_src_common_platform.h b/chromium-next/patches/patch-third__party_angle_src_common_platform.h
new file mode 100644
index 0000000000..7721e8ace5
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_common_platform.h
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/common/platform.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/common/platform.h
+@@ -26,8 +26,19 @@
+ #elif defined(__linux__) || defined(EMSCRIPTEN)
+ # define ANGLE_PLATFORM_LINUX 1
+ # define ANGLE_PLATFORM_POSIX 1
+-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+- defined(__DragonFly__) || defined(__sun) || defined(__GLIBC__) || defined(__GNU__) || \
++#elif defined(__OpenBSD__)
++# define ANGLE_PLATFORM_OPENBSD 1
++# define ANGLE_PLATFORM_POSIX 1
++# define ANGLE_PLATFORM_BSD 1
++#elif defined(__NetBSD__)
++# define ANGLE_PLATFORM_NETBSD 1
++# define ANGLE_PLATFORM_POSIX 1
++# define ANGLE_PLATFORM_BSD 1
++#elif defined(__FreeBSD__)
++# define ANGLE_PLATFORM_FREEBSD 1
++# define ANGLE_PLATFORM_POSIX 1
++# define ANGLE_PLATFORM_BSD 1
++#elif defined(__DragonFly__) || defined(__sun) || defined(__GLIBC__) || defined(__GNU__) || \
+ defined(__QNX__) || defined(__Fuchsia__) || defined(__HAIKU__)
+ # define ANGLE_PLATFORM_POSIX 1
+ #else
diff --git a/chromium-next/patches/patch-third__party_angle_src_common_platform__helpers.h b/chromium-next/patches/patch-third__party_angle_src_common_platform__helpers.h
new file mode 100644
index 0000000000..2572ab7dca
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_common_platform__helpers.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/common/platform_helpers.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/common/platform_helpers.h
+@@ -62,7 +62,7 @@ inline constexpr bool IsIOS()
+
+ inline constexpr bool IsLinux()
+ {
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ return true;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-third__party_angle_src_common_system__utils.cpp b/chromium-next/patches/patch-third__party_angle_src_common_system__utils.cpp
new file mode 100644
index 0000000000..4af45d9f67
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_common_system__utils.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/common/system_utils.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/common/system_utils.cpp
+@@ -25,7 +25,7 @@ namespace angle
+ {
+ std::string GetExecutableName()
+ {
+-#if defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 21
++#if (defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 21) || defined(ANGLE_PLATFORM_BSD)
+ // Support for "getprogname" function in bionic was introduced in L (API level 21)
+ const char *executableName = getprogname();
+ return (executableName) ? std::string(executableName) : "ANGLE";
diff --git a/chromium-next/patches/patch-third__party_angle_src_common_system__utils__linux.cpp b/chromium-next/patches/patch-third__party_angle_src_common_system__utils__linux.cpp
new file mode 100644
index 0000000000..d38d96f11e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_common_system__utils__linux.cpp
@@ -0,0 +1,45 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/common/system_utils_linux.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/common/system_utils_linux.cpp
+@@ -15,8 +15,15 @@
+
+ #include <array>
+
++#if ANGLE_PLATFORM_OPENBSD
++#include <pthread_np.h>
++#elif ANGLE_PLATFORM_NETBSD
++#include <pthread.h>
++#endif
++
+ namespace angle
+ {
++#if ANGLE_PLATFORM_LINUX
+ std::string GetExecutablePath()
+ {
+ // We cannot use lstat to get the size of /proc/self/exe as it always returns 0
+@@ -32,6 +39,7 @@ std::string GetExecutablePath()
+ path[result] = '\0';
+ return path;
+ }
++#endif
+
+ std::string GetExecutableDirectory()
+ {
+@@ -56,6 +64,12 @@ void SetCurrentThreadName(const char *na
+ {
+ // There's a 15-character (16 including '\0') limit. If the name is too big (and ERANGE is
+ // returned), just ignore the name.
++#if ANGLE_PLATFORM_OPENBSD
++ pthread_set_name_np(pthread_self(), name);
++#elif ANGLE_PLATFORM_NETBSD
++ pthread_setname_np(pthread_self(), "%s", (void *)name);
++#else
+ pthread_setname_np(pthread_self(), name);
++#endif
+ }
+ } // namespace angle
diff --git a/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__internal.h b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__internal.h
new file mode 100644
index 0000000000..f73f3450a3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__internal.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/gpu_info_util/SystemInfo_internal.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/gpu_info_util/SystemInfo_internal.h
+@@ -15,6 +15,13 @@
+ namespace angle
+ {
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++bool CollectMesaCardInfo(std::vector<GPUDeviceInfo> *devices);
++#if defined(__FreeBSD__)
++bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices);
++#endif
++#endif
++
+ // Defined in SystemInfo_libpci when GPU_INFO_USE_LIBPCI is defined.
+ bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices);
+ // Defined in SystemInfo_x11 when GPU_INFO_USE_X11 is defined.
diff --git a/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp
new file mode 100644
index 0000000000..d730d3bcb7
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp
@@ -0,0 +1,96 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp
+@@ -12,6 +12,11 @@
+ #include <pci/pci.h>
+ #include <unistd.h>
+
++#if defined(__FreeBSD__)
++#include <fcntl.h>
++#include <sys/pciio.h>
++#endif
++
+ #include "common/angleutils.h"
+ #include "common/debug.h"
+
+@@ -86,6 +91,75 @@ struct LibPCI : private angle::NonCopyab
+
+ } // anonymous namespace
+
++#if defined(__FreeBSD__)
++// Adds an entry per PCI GPU found and fills the device and vendor ID.
++bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices)
++{
++ int fd;
++ struct pci_conf_io conf;
++ struct pci_conf *matches;
++ uint32_t offset = 0;
++
++ fd = open("/dev/pci", O_RDONLY);
++ if (fd < 0)
++ return false;
++
++ matches = new struct pci_conf[32];
++ conf.generation = 0;
++ do {
++ conf.pat_buf_len = 0;
++ conf.num_patterns = 0;
++ conf.patterns = NULL;
++ conf.match_buf_len = 32 * sizeof(struct pci_conf);
++ conf.num_matches = 32;
++ conf.matches = matches;
++ conf.offset = offset;
++ conf.status = PCI_GETCONF_ERROR;
++ if (ioctl(fd, PCIOCGETCONF, &conf) < 0) {
++ if (errno == ENODEV)
++ break;
++ }
++ /* PCI_GETCONF_LIST_CHANGED would require us to start over. */
++ if (conf.status == PCI_GETCONF_ERROR || conf.status == PCI_GETCONF_LIST_CHANGED) {
++ break;
++ }
++
++ for (unsigned int i = 0; i < conf.num_matches; i++) {
++ uint16_t device_class = (matches[i].pc_class << 8) | matches[i].pc_subclass;
++
++ // Skip non-GPU devices
++ switch (device_class)
++ {
++ case PCI_CLASS_DISPLAY_VGA:
++ case PCI_CLASS_DISPLAY_XGA:
++ case PCI_CLASS_DISPLAY_3D:
++ break;
++ default:
++ continue;
++ }
++
++ // Skip unknown devices
++ if (matches[i].pc_vendor == 0 || matches[i].pc_device == 0) {
++ continue;
++ }
++
++ GPUDeviceInfo info;
++ info.vendorId = matches[i].pc_vendor;
++ info.deviceId = matches[i].pc_device;
++
++ devices->push_back(info);
++ }
++ offset += conf.num_matches;
++ } while (conf.status == PCI_GETCONF_MORE_DEVS);
++
++ delete[] matches;
++
++ close(fd);
++
++ return true;
++}
++#endif
++
+ // Adds an entry per PCI GPU found and fills the device and vendor ID.
+ bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices)
+ {
diff --git a/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp
new file mode 100644
index 0000000000..d3856f7cf8
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp
+@@ -71,6 +71,24 @@ bool GetPCIDevicesWithLibPCI(std::vector
+
+ bool GetSystemInfo(SystemInfo *info)
+ {
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++ if (!CollectMesaCardInfo(&(info->gpus)))
++ {
++#if defined(__FreeBSD__)
++ if (!GetPCIDevicesFreeBSD(&(info->gpus)))
++ {
++#endif
++#if defined(ANGLE_USE_VULKAN_SYSTEM_INFO)
++ // Try vulkan backend to get GPU info
++ return GetSystemInfoVulkan(info);
++#else
++ return false;
++#endif
++#if defined(__FreeBSD__)
++ }
++#endif
++ }
++#else
+ if (!GetPCIDevicesWithLibPCI(&(info->gpus)))
+ {
+ #if defined(ANGLE_USE_VULKAN_SYSTEM_INFO)
+@@ -85,6 +103,7 @@ bool GetSystemInfo(SystemInfo *info)
+ {
+ return false;
+ }
++#endif
+
+ GetDualGPUInfo(info);
+
diff --git a/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp
new file mode 100644
index 0000000000..12562e392a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp
@@ -0,0 +1,67 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp
+@@ -8,6 +8,10 @@
+
+ #include "gpu_info_util/SystemInfo_internal.h"
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#include <GL/glx.h>
++#include <GL/glxext.h>
++#endif
+ #include <X11/Xlib.h>
+
+ #include "common/debug.h"
+@@ -18,9 +22,47 @@
+ # error SystemInfo_x11.cpp compiled without GPU_INFO_USE_X11
+ #endif
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
++#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
++#endif
++
+ namespace angle
+ {
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++bool CollectMesaCardInfo(std::vector<GPUDeviceInfo> *devices)
++{
++ unsigned int vid[3], did[3];
++
++ Display *display = XOpenDisplay(NULL);
++ if (!display) {
++ return false;
++ }
++
++ PFNGLXQUERYRENDERERINTEGERMESAPROC queryInteger =
++ (PFNGLXQUERYRENDERERINTEGERMESAPROC) glXGetProcAddressARB((const GLubyte *)
++ "glXQueryRendererIntegerMESA");
++
++ if (!queryInteger)
++ return false;
++
++ bool vendor_ret =
++ queryInteger(display, 0, 0, GLX_RENDERER_VENDOR_ID_MESA, vid);
++ bool device_ret =
++ queryInteger(display, 0, 0, GLX_RENDERER_DEVICE_ID_MESA, did);
++
++ if (vendor_ret && device_ret) {
++ GPUDeviceInfo info;
++ info.vendorId = vid[0];
++ info.deviceId = did[0];
++ devices->push_back(info);
++ }
++
++ return true;
++}
++#endif
++
+ bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version)
+ {
+ *version = "";
diff --git a/chromium-next/patches/patch-third__party_angle_src_libANGLE_Display.cpp b/chromium-next/patches/patch-third__party_angle_src_libANGLE_Display.cpp
new file mode 100644
index 0000000000..749e854e44
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_libANGLE_Display.cpp
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/libANGLE/Display.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/libANGLE/Display.cpp
+@@ -58,7 +58,7 @@
+ # include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
+ # elif ANGLE_ENABLE_CGL
+ # include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # include "libANGLE/renderer/gl/egl/DisplayEGL.h"
+ # if defined(ANGLE_USE_X11)
+ # include "libANGLE/renderer/gl/glx/DisplayGLX_api.h"
+@@ -410,7 +410,7 @@ rx::DisplayImpl *CreateDisplayFromAttrib
+ impl = new rx::DisplayCGL(state);
+ break;
+
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # if defined(ANGLE_USE_GBM)
+ if (platformType == 0)
+ {
+@@ -456,7 +456,7 @@ rx::DisplayImpl *CreateDisplayFromAttrib
+ #if defined(ANGLE_ENABLE_OPENGL)
+ # if defined(ANGLE_PLATFORM_WINDOWS)
+ impl = new rx::DisplayWGL(state);
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # if defined(ANGLE_USE_GBM)
+ if (platformType == 0)
+ {
+@@ -507,7 +507,7 @@ rx::DisplayImpl *CreateDisplayFromAttrib
+ impl = rx::CreateVulkanWin32Display(state);
+ }
+ break;
+-# elif defined(ANGLE_PLATFORM_LINUX)
++# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ # if defined(ANGLE_USE_GBM)
+ if (platformType == EGL_PLATFORM_GBM_KHR && rx::IsVulkanGbmDisplayAvailable())
+ {
+@@ -2079,7 +2079,7 @@ static ClientExtensions GenerateClientEx
+ extensions.platformWaylandEXT = true;
+ #endif
+
+-#if defined(ANGLE_PLATFORM_LINUX) && (defined(ANGLE_ENABLE_OPENGL) || defined(ANGLE_ENABLE_VULKAN))
++#if (defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)) && (defined(ANGLE_ENABLE_OPENGL) || defined(ANGLE_ENABLE_VULKAN))
+ extensions.platformSurfacelessMESA = true;
+ #endif
+
+@@ -2125,7 +2125,7 @@ static ClientExtensions GenerateClientEx
+ extensions.x11Visual = true;
+ #endif
+
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ extensions.platformANGLEDeviceTypeEGLANGLE = true;
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_angle_src_libANGLE_formatutils.cpp b/chromium-next/patches/patch-third__party_angle_src_libANGLE_formatutils.cpp
new file mode 100644
index 0000000000..8f98908b9a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_libANGLE_formatutils.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/libANGLE/formatutils.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/libANGLE/formatutils.cpp
+@@ -1470,7 +1470,7 @@ static InternalFormatInfoMap BuildIntern
+ AddYUVFormat(&map, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported);
+ AddYUVFormat(&map, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported);
+
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_BSD)
+ // From GL_OES_required_internalformat
+ // The |shared| bit shouldn't be 2. But given this hits assertion when bits
+ // are checked, it's fine to have this bit set as 2 as a workaround.
diff --git a/chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp b/chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp
new file mode 100644
index 0000000000..fa74e7e6b6
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp
+@@ -144,10 +144,10 @@ bool FunctionsGLX::initialize(Display *x
+ // which a GLXWindow was ever created.
+ if (!sLibHandle)
+ {
+- sLibHandle = dlopen("libGL.so.1", RTLD_NOW);
++ sLibHandle = dlopen("libGL.so", RTLD_NOW);
+ if (!sLibHandle)
+ {
+- *errorString = std::string("Could not dlopen libGL.so.1: ") + dlerror();
++ *errorString = std::string("Could not dlopen libGL.so: ") + dlerror();
+ return false;
+ }
+ }
diff --git a/chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h b/chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h
new file mode 100644
index 0000000000..efda30345b
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/src/libANGLE/renderer/vulkan/DisplayVk_api.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/src/libANGLE/renderer/vulkan/DisplayVk_api.h
+@@ -23,7 +23,7 @@ bool IsVulkanWin32DisplayAvailable();
+ DisplayImpl *CreateVulkanWin32Display(const egl::DisplayState &state);
+ #endif // defined(ANGLE_PLATFORM_WINDOWS)
+
+-#if defined(ANGLE_PLATFORM_LINUX)
++#if defined(ANGLE_PLATFORM_POSIX)
+ bool IsVulkanWaylandDisplayAvailable();
+ DisplayImpl *CreateVulkanWaylandDisplay(const egl::DisplayState &state);
+
diff --git a/chromium-next/patches/patch-third__party_angle_util_BUILD.gn b/chromium-next/patches/patch-third__party_angle_util_BUILD.gn
new file mode 100644
index 0000000000..fb2935e2af
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_angle_util_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/angle/util/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/angle/util/BUILD.gn
+@@ -311,7 +311,7 @@ foreach(is_shared_library,
+ ]
+ libs = []
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ libs += [
+ "rt",
+ "dl",
diff --git a/chromium-next/patches/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc b/chromium-next/patches/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc
new file mode 100644
index 0000000000..73453bc36a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/common/renderer_preferences/renderer_preferences_mojom_traits.cc
+@@ -73,7 +73,7 @@ bool StructTraits<blink::mojom::Renderer
+
+ out->send_subresource_notification = data.send_subresource_notification();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!data.ReadSystemFontFamilyName(&out->system_font_family_name))
+ return false;
+ #endif
diff --git a/chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h b/chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h
new file mode 100644
index 0000000000..be17a55b7c
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/public/common/renderer_preferences/renderer_preferences.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/public/common/renderer_preferences/renderer_preferences.h
+@@ -68,7 +68,7 @@ struct BLINK_COMMON_EXPORT RendererPrefe
+ UserAgentOverride user_agent_override;
+ std::string accept_languages;
+ bool send_subresource_notification{false};
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ std::string system_font_family_name;
+ #endif
+ #if BUILDFLAG(IS_WIN)
diff --git a/chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h b/chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h
new file mode 100644
index 0000000000..e114a484ec
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/public/common/renderer_preferences/renderer_preferences_mojom_traits.h
+@@ -173,7 +173,7 @@ struct BLINK_COMMON_EXPORT
+ return data.send_subresource_notification;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static const std::string& system_font_family_name(
+ const ::blink::RendererPreferences& data) {
+ return data.system_font_family_name;
diff --git a/chromium-next/patches/patch-third__party_blink_public_platform_platform.h b/chromium-next/patches/patch-third__party_blink_public_platform_platform.h
new file mode 100644
index 0000000000..1d529628f1
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_public_platform_platform.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/public/platform/platform.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/public/platform/platform.h
+@@ -374,7 +374,7 @@ class BLINK_PLATFORM_EXPORT Platform {
+ return nullptr;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // This is called after the thread is created, so the embedder
+ // can initiate an IPC to change its thread type (on Linux we can't
+ // increase the nice value, so we need to ask the browser process). This
diff --git a/chromium-next/patches/patch-third__party_blink_public_platform_web__vector.h b/chromium-next/patches/patch-third__party_blink_public_platform_web__vector.h
new file mode 100644
index 0000000000..752d33976f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_public_platform_web__vector.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/public/platform/web_vector.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/public/platform/web_vector.h
+@@ -91,7 +91,7 @@ class WebVector {
+ // The vector can be populated using reserve() and emplace_back().
+ WebVector() = default;
+
+-#if defined(ARCH_CPU_64_BITS)
++#if defined(ARCH_CPU_64_BITS) || defined(__OpenBSD__)
+ // Create a vector with |size| default-constructed elements. We define
+ // a constructor with size_t otherwise we'd have a duplicate define.
+ explicit WebVector(size_t size) : data_(size) {}
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py b/chromium-next/patches/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
new file mode 100644
index 0000000000..705cf90161
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
+@@ -30,7 +30,7 @@ def init(root_src_dir, enable_style_form
+
+ # Determine //buildtools/<platform>/ directory
+ new_path_platform_suffix = ""
+- if sys.platform.startswith("linux"):
++ if sys.platform.startswith(("linux","openbsd","freebsd","netbsd")):
+ platform = "linux64"
+ exe_suffix = ""
+ elif sys.platform.startswith("darwin"):
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_build_scripts_run__with__pythonpath.py b/chromium-next/patches/patch-third__party_blink_renderer_build_scripts_run__with__pythonpath.py
new file mode 100644
index 0000000000..f7491281d3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_build_scripts_run__with__pythonpath.py
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/build/scripts/run_with_pythonpath.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/build/scripts/run_with_pythonpath.py
+@@ -22,6 +22,7 @@ def main():
+ existing_pp = (
+ os.pathsep + env['PYTHONPATH']) if 'PYTHONPATH' in env else ''
+ env['PYTHONPATH'] = os.pathsep.join(python_paths) + existing_pp
++ env['LD_LIBRARY_PATH'] = "${WRKSRC}/out/Release"
+ sys.exit(subprocess.call([sys.executable] + args, env=env))
+
+
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_controller_blink__initializer.cc b/chromium-next/patches/patch-third__party_blink_renderer_controller_blink__initializer.cc
new file mode 100644
index 0000000000..71f4f8b084
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_controller_blink__initializer.cc
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/controller/blink_initializer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/controller/blink_initializer.cc
+@@ -82,12 +82,12 @@
+ #include "third_party/blink/renderer/controller/private_memory_footprint_provider.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/controller/memory_usage_monitor_posix.h"
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/controller/highest_pmf_reporter.h"
+ #include "third_party/blink/renderer/controller/user_level_memory_pressure_signal_generator.h"
+ #endif
+@@ -256,7 +256,7 @@ void BlinkInitializer::RegisterInterface
+ main_thread_task_runner);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ binders.Add<mojom::blink::MemoryUsageMonitorLinux>(
+ ConvertToBaseRepeatingCallback(
+ CrossThreadBindRepeating(&MemoryUsageMonitorPosix::Bind)),
+@@ -303,7 +303,7 @@ void BlinkInitializer::RegisterMemoryWat
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Start reporting the highest private memory footprint after the first
+ // navigation.
+ HighestPmfReporter::Initialize(main_thread_task_runner);
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.cc b/chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.cc
new file mode 100644
index 0000000000..8315093290
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/controller/memory_usage_monitor_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/controller/memory_usage_monitor_posix.cc
+@@ -128,15 +128,17 @@ void MemoryUsageMonitorPosix::ResetFileD
+
+ void MemoryUsageMonitorPosix::SetProcFiles(base::File statm_file,
+ base::File status_file) {
++#if !BUILDFLAG(IS_BSD)
+ DCHECK(statm_file.IsValid());
+ DCHECK(status_file.IsValid());
+ DCHECK_EQ(-1, statm_fd_.get());
+ DCHECK_EQ(-1, status_fd_.get());
+ statm_fd_.reset(statm_file.TakePlatformFile());
+ status_fd_.reset(status_file.TakePlatformFile());
++#endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ void MemoryUsageMonitorPosix::Bind(
+ mojo::PendingReceiver<mojom::blink::MemoryUsageMonitorLinux> receiver) {
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.h b/chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.h
new file mode 100644
index 0000000000..fbb024012e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.h
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/controller/memory_usage_monitor_posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/controller/memory_usage_monitor_posix.h
+@@ -13,7 +13,7 @@
+ #include "third_party/blink/renderer/controller/controller_export.h"
+ #include "third_party/blink/renderer/controller/memory_usage_monitor.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/public/mojom/memory_usage_monitor_linux.mojom-blink.h"
+ #endif
+
+@@ -22,7 +22,7 @@ namespace blink {
+ // MemoryUsageMonitor implementation for Android and Linux.
+ class CONTROLLER_EXPORT MemoryUsageMonitorPosix
+ : public MemoryUsageMonitor
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ public mojom::blink::MemoryUsageMonitorLinux
+ #endif
+@@ -30,7 +30,7 @@ class CONTROLLER_EXPORT MemoryUsageMonit
+ public:
+ MemoryUsageMonitorPosix() = default;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static void Bind(
+ mojo::PendingReceiver<mojom::blink::MemoryUsageMonitorLinux> receiver);
+ #endif
+@@ -48,7 +48,7 @@ class CONTROLLER_EXPORT MemoryUsageMonit
+ uint64_t* vm_size,
+ uint64_t* vm_hwm_size);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // mojom::MemoryUsageMonitorLinux implementations:
+ void SetProcFiles(base::File statm_file, base::File status_file) override;
+ #endif
+@@ -66,7 +66,7 @@ class CONTROLLER_EXPORT MemoryUsageMonit
+ base::ScopedFD statm_fd_;
+ base::ScopedFD status_fd_;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ mojo::Receiver<mojom::blink::MemoryUsageMonitorLinux> receiver_{this};
+ #endif
+ };
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_editing_editing__behavior.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_editing_editing__behavior.cc
new file mode 100644
index 0000000000..3b6dcb03ae
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_editing_editing__behavior.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/editing/editing_behavior.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/editing/editing_behavior.cc
+@@ -304,7 +304,7 @@ bool EditingBehavior::ShouldInsertCharac
+ // unexpected behaviour
+ if (ch < ' ')
+ return false;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // According to XKB map no keyboard combinations with ctrl key are mapped to
+ // printable characters, however we need the filter as the DomKey/text could
+ // contain printable characters.
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_execution__context_navigator__base.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_execution__context_navigator__base.cc
new file mode 100644
index 0000000000..e4e2e2067f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_execution__context_navigator__base.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/execution_context/navigator_base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/execution_context/navigator_base.cc
+@@ -31,7 +31,7 @@ String GetReducedNavigatorPlatform() {
+ return "Win32";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return "";
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return "Linux x86_64";
+ #elif BUILDFLAG(IS_IOS)
+ return "iPhone";
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_exported_web__view__impl.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_exported_web__view__impl.cc
new file mode 100644
index 0000000000..5aa13c7c8a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_exported_web__view__impl.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/exported/web_view_impl.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/exported/web_view_impl.cc
+@@ -431,7 +431,7 @@ SkFontHinting RendererPreferencesToSkiaH
+ const blink::RendererPreferences& prefs) {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ if (!prefs.should_antialias_text) {
+ // When anti-aliasing is off, GTK maps all non-zero hinting settings to
+ // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight'
+@@ -3420,7 +3420,7 @@ void WebViewImpl::UpdateFontRenderingFro
+ renderer_preferences_.use_subpixel_positioning);
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)) && \
+ !BUILDFLAG(IS_ANDROID)
+ if (!renderer_preferences_.system_font_family_name.empty()) {
+ WebFontRenderStyle::SetSystemFontFamily(blink::WebString::FromUTF8(
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_frame_web__frame__test.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_frame_web__frame__test.cc
new file mode 100644
index 0000000000..4e6eae7301
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_frame_web__frame__test.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/frame/web_frame_test.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/frame/web_frame_test.cc
+@@ -6474,7 +6474,7 @@ TEST_F(WebFrameTest, DISABLED_PositionFo
+ }
+
+ #if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/1090246): Fix these tests on Fuchsia and re-enable.
+ // TODO(crbug.com/1317375): Build these tests on all platforms.
+ #define MAYBE_SelectRangeStaysHorizontallyAlignedWhenMoved \
+@@ -6883,7 +6883,7 @@ TEST_F(CompositedSelectionBoundsTest, La
+ TEST_F(CompositedSelectionBoundsTest, LargeSelectionNoScroll) {
+ RunTest("composited_selection_bounds_large_selection_noscroll.html");
+ }
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if !BUILDFLAG(IS_ANDROID)
+ TEST_F(CompositedSelectionBoundsTest, Input) {
+ web_view_helper_.GetWebView()->GetSettings()->SetDefaultFontSize(16);
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc
new file mode 100644
index 0000000000..271642e3f3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
+@@ -55,7 +55,7 @@ constexpr base::TimeDelta kEncodeRowSlac
+
+ /* The value is based on user statistics on Nov 2017. */
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN))
++ BUILDFLAG(IS_WIN)) || BUILDFLAG(IS_BSD)
+ const double kIdleTaskStartTimeoutDelayMs = 1000.0;
+ #else
+ const double kIdleTaskStartTimeoutDelayMs = 4000.0; // For ChromeOS, Mobile
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_inspector_inspector__memory__agent.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_inspector_inspector__memory__agent.cc
new file mode 100644
index 0000000000..8cb3e52b5d
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_inspector_inspector__memory__agent.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/inspector/inspector_memory_agent.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/inspector/inspector_memory_agent.cc
+@@ -192,7 +192,7 @@ InspectorMemoryAgent::GetSamplingProfile
+
+ Vector<String> InspectorMemoryAgent::Symbolize(
+ const WebVector<const void*>& addresses) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(alph): Move symbolization to the client.
+ Vector<const void*> addresses_to_symbolize;
+ for (const void* address : addresses) {
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_layout_layout__view.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_layout_layout__view.cc
new file mode 100644
index 0000000000..2f7aae9404
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_layout_layout__view.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/layout/layout_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/layout/layout_view.cc
+@@ -73,7 +73,7 @@
+ #include "ui/display/screen_info.h"
+ #include "ui/gfx/geometry/quad_f.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/platform/fonts/font_cache.h"
+ #endif
+
+@@ -769,7 +769,7 @@ void LayoutView::LayoutRoot() {
+ intrinsic_logical_widths_ = LogicalWidth();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The font code in FontPlatformData does not have a direct connection to the
+ // document, the frame or anything from which we could retrieve the device
+ // scale factor. After using zoom for DSF, the GraphicsContext does only ever
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_origin__trials_origin__trial__context.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_origin__trials_origin__trial__context.cc
new file mode 100644
index 0000000000..bd3db8368e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_origin__trials_origin__trial__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/origin_trials/origin_trial_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/origin_trials/origin_trial_context.cc
+@@ -551,7 +551,7 @@ bool OriginTrialContext::CanEnableTrialF
+ }
+
+ if (trial_name == "TranslationAPI") {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(features::kEnableTranslationAPI);
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_paint_paint__layer.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_paint_paint__layer.cc
new file mode 100644
index 0000000000..22460857a0
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_paint_paint__layer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/paint/paint_layer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/paint/paint_layer.cc
+@@ -120,7 +120,7 @@ namespace blink {
+
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ struct SameSizeAsPaintLayer : GarbageCollected<PaintLayer>, DisplayItemClient {
+ // The bit fields may fit into the machine word of DisplayItemClient which
+ // has only 8-bit data.
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc
new file mode 100644
index 0000000000..6d5c6c695b
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc
+@@ -148,7 +148,7 @@ bool ScrollbarThemeAura::SupportsDragSna
+ // is true for at least GTK and QT apps).
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
+@@ -423,7 +423,7 @@ bool ScrollbarThemeAura::ShouldCenterOnT
+ const WebMouseEvent& event) const {
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ if (event.button == WebPointerProperties::Button::kMiddle)
+ return true;
+ #endif
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor.h b/chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor.h
new file mode 100644
index 0000000000..8b0ab203ea
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor.h
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/xml/xslt_processor.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/xml/xslt_processor.h
+@@ -77,7 +77,11 @@ class XSLTProcessor final : public Scrip
+
+ void reset();
+
++#if (LIBXML_VERSION >= 21200)
+ static void ParseErrorFunc(void* user_data, const xmlError*);
++#else
++ static void ParseErrorFunc(void* user_data, xmlError*);
++#endif
+ static void GenericErrorFunc(void* user_data, const char* msg, ...);
+
+ // Only for libXSLT callbacks
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor__libxslt.cc b/chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor__libxslt.cc
new file mode 100644
index 0000000000..a325994f37
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_core_xml_xslt__processor__libxslt.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
+@@ -71,7 +71,11 @@ void XSLTProcessor::GenericErrorFunc(voi
+ // It would be nice to do something with this error message.
+ }
+
++#if (LIBXML_VERSION >= 21200)
+ void XSLTProcessor::ParseErrorFunc(void* user_data, const xmlError* error) {
++#else
++void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError* error) {
++#endif
+ FrameConsole* console = static_cast<FrameConsole*>(user_data);
+ if (!console)
+ return;
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__device__factory.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__device__factory.cc
new file mode 100644
index 0000000000..ab9da197c2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__device__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/media/audio/audio_device_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/media/audio/audio_device_factory.cc
+@@ -35,7 +35,7 @@ namespace {
+ AudioDeviceFactory* g_factory_override = nullptr;
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_LACROS)
++ BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Due to driver deadlock issues on Windows (http://crbug/422522) there is a
+ // chance device authorization response is never received from the browser side.
+ // In this case we will time out, to avoid renderer hang forever waiting for
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc
new file mode 100644
index 0000000000..9d6a5c6629
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager_test.cc
+@@ -873,7 +873,7 @@ TEST_F(AudioRendererMixerManagerTest, Mi
+ mixer->get_output_params_for_testing().sample_rate());
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Use 10 ms buffer (441 frames per buffer).
+ EXPECT_EQ(output_sample_rate / 100,
+ mixer->get_output_params_for_testing().frames_per_buffer());
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_rtc__data__channel.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_rtc__data__channel.cc
new file mode 100644
index 0000000000..a599c5ce5d
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_rtc__data__channel.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/peerconnection/rtc_data_channel.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/peerconnection/rtc_data_channel.cc
+@@ -542,6 +542,7 @@ void RTCDataChannel::send(Blob* data, Ex
+ pending_messages_.push_back(message);
+ }
+
++#undef close
+ void RTCDataChannel::close() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if (state_ == webrtc::DataChannelInterface::kClosing ||
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc
new file mode 100644
index 0000000000..72aa0a86e4
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/peerconnection/webrtc_audio_renderer_test.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/peerconnection/webrtc_audio_renderer_test.cc
+@@ -304,7 +304,7 @@ TEST_F(WebRtcAudioRendererTest, DISABLED
+ SetupRenderer(kDefaultOutputDeviceId);
+ renderer_proxy_->Start();
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ static const int kExpectedBufferSize = kHardwareSampleRate / 100;
+ #elif BUILDFLAG(IS_ANDROID)
+ static const int kExpectedBufferSize = 2 * kHardwareSampleRate / 100;
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc
new file mode 100644
index 0000000000..0942c45ca0
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/webaudio/audio_worklet_thread_test.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/webaudio/audio_worklet_thread_test.cc
+@@ -469,7 +469,7 @@ class AudioWorkletThreadPriorityTest
+
+ // TODO(crbug.com/1022888): The worklet thread priority is always NORMAL
+ // on OS_LINUX and OS_CHROMEOS regardless of the thread priority setting.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (expected_priority == base::ThreadPriorityForTest::kRealtimeAudio ||
+ expected_priority == base::ThreadPriorityForTest::kDisplay) {
+ EXPECT_EQ(actual_priority, base::ThreadPriorityForTest::kNormal);
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc
new file mode 100644
index 0000000000..d3f4d8c1e2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
+@@ -6315,7 +6315,7 @@ void WebGLRenderingContextBase::TexImage
+ constexpr bool kAllowZeroCopyImages = true;
+ #endif
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/1175907): Only TexImage2D seems to work with the GPU path on
+ // Android M -- appears to work fine on R, but to avoid regressions in <video>
+ // limit to TexImage2D only for now. Fails conformance test on Nexus 5X:
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_modules_webgpu_gpu__queue.cc b/chromium-next/patches/patch-third__party_blink_renderer_modules_webgpu_gpu__queue.cc
new file mode 100644
index 0000000000..ad858342fc
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_modules_webgpu_gpu__queue.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/modules/webgpu/gpu_queue.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/modules/webgpu/gpu_queue.cc
+@@ -788,7 +788,7 @@ bool GPUQueue::CopyFromCanvasSourceImage
+ // on linux platform.
+ // TODO(crbug.com/1424119): using a webgpu mailbox texture on the OpenGLES
+ // backend is failing for unknown reasons.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool forceReadback = true;
+ #elif BUILDFLAG(IS_ANDROID)
+ // TODO(crbug.com/dawn/1969): Some Android devices don't fail to copy from
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_BUILD.gn b/chromium-next/patches/patch-third__party_blink_renderer_platform_BUILD.gn
new file mode 100644
index 0000000000..d7689baca7
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/BUILD.gn
+@@ -2029,7 +2029,7 @@ static_library("test_support") {
+ ]
+
+ # fuzzed_data_provider may not work with a custom toolchain.
+- if (custom_toolchain == "" && is_clang) {
++ if ((custom_toolchain == "" && is_clang) && !is_bsd) {
+ sources += [
+ "testing/fuzzed_data_provider.cc",
+ "testing/fuzzed_data_provider.h",
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.cc
new file mode 100644
index 0000000000..98976ad9ff
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/font_cache.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/font_cache.cc
+@@ -81,7 +81,7 @@ extern const char kNotoColorEmojiCompat[
+
+ SkFontMgr* FontCache::static_font_manager_ = nullptr;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ float FontCache::device_scale_factor_ = 1.0;
+ #endif
+
+@@ -132,7 +132,7 @@ const FontPlatformData* FontCache::Syste
+ const FontDescription& font_description) {
+ const AtomicString& family = FontCache::SystemFontFamily();
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \
+- BUILDFLAG(IS_IOS)
++ BUILDFLAG(IS_IOS) || BUILDFLAG(IS_BSD)
+ if (family.empty() || family == font_family_names::kSystemUi)
+ return nullptr;
+ #else
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.h b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.h
new file mode 100644
index 0000000000..4922a3d891
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__cache.h
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/font_cache.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/font_cache.h
+@@ -55,7 +55,7 @@
+ #include "third_party/skia/include/core/SkFontMgr.h"
+ #include "third_party/skia/include/core/SkRefCnt.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/font_fallback_linux.h"
+ #endif
+
+@@ -167,7 +167,7 @@ class PLATFORM_EXPORT FontCache final {
+
+ static void MaybePreloadSystemFonts();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // These are needed for calling QueryRenderStyleForStrike, since
+ // gfx::GetFontRenderParams makes distinctions based on DSF.
+ static float DeviceScaleFactor() { return device_scale_factor_; }
+@@ -243,7 +243,7 @@ class PLATFORM_EXPORT FontCache final {
+ const char* locale_family_name);
+ #endif // BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static bool GetFontForCharacter(UChar32,
+ const char* preferred_locale,
+ gfx::FallbackFontData*);
+@@ -316,7 +316,7 @@ class PLATFORM_EXPORT FontCache final {
+ const FontFaceCreationParams&,
+ std::string& name);
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static AtomicString GetFamilyNameForCharacter(SkFontMgr*,
+ UChar32,
+ const FontDescription&,
+@@ -353,7 +353,7 @@ class PLATFORM_EXPORT FontCache final {
+ bool is_test_font_mgr_ = false;
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static float device_scale_factor_;
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__description.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__description.cc
new file mode 100644
index 0000000000..2784982bf0
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__description.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/font_description.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/font_description.cc
+@@ -44,7 +44,7 @@
+ #include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
+ #include "third_party/blink/renderer/platform/wtf/text/string_hasher.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/platform/fonts/font_cache.h"
+ #endif
+
+@@ -282,7 +282,7 @@ FontCacheKey FontDescription::CacheKey(
+ static_cast<unsigned>(fields_.orientation_) << 1 | // bit 2-3
+ static_cast<unsigned>(fields_.subpixel_text_position_); // bit 1
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ float device_scale_factor_for_key = FontCache::DeviceScaleFactor();
+ #else
+ float device_scale_factor_for_key = 1.0f;
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__metrics.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__metrics.cc
new file mode 100644
index 0000000000..d471fd7615
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__metrics.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/font_metrics.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/font_metrics.cc
+@@ -39,7 +39,7 @@
+ namespace blink {
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // This is the largest VDMX table which we'll try to load and parse.
+ static const size_t kMaxVDMXTableSize = 1024 * 1024; // 1 MB
+ #endif
+@@ -67,7 +67,7 @@ void FontMetrics::AscentDescentWithHacks
+ bool is_vdmx_valid = false;
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Manually digging up VDMX metrics is only applicable when bytecode hinting
+ // using FreeType. With DirectWrite or CoreText, no bytecode hinting is ever
+ // done. This code should be pushed into FreeType (hinted font metrics).
+@@ -111,7 +111,7 @@ void FontMetrics::AscentDescentWithHacks
+ descent = SkScalarRoundToScalar(metrics.fDescent);
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // When subpixel positioning is enabled, if the descent is rounded down,
+ // the descent part of the glyph may be truncated when displayed in a
+ // 'overflow: hidden' container. To avoid that, borrow 1 unit from the
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__platform__data.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__platform__data.cc
new file mode 100644
index 0000000000..425a38ba31
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__platform__data.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/font_platform_data.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/font_platform_data.cc
+@@ -54,7 +54,7 @@
+ namespace blink {
+ namespace {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Getting the system font render style takes a significant amount of time on
+ // Linux because looking up fonts using fontconfig can be very slow. We fetch
+ // the render style for each font family and text size, while it's very
+@@ -133,7 +133,7 @@ FontPlatformData::FontPlatformData(sk_sp
+ style_ = WebFontRenderStyle::GetDefault();
+ #if !BUILDFLAG(IS_WIN)
+ WebFontRenderStyle system_style;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool override_font_name_and_size =
+ base::FeatureList::IsEnabled(kOptimizeLinuxFonts);
+ #else
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc
new file mode 100644
index 0000000000..b8cd2e70eb
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc
+@@ -9,7 +9,7 @@
+ #if BUILDFLAG(IS_ANDROID)
+ #include "third_party/blink/public/mojom/font_unique_name_lookup/font_unique_name_lookup.mojom-blink.h"
+ #include "third_party/blink/renderer/platform/fonts/android/font_unique_name_lookup_android.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/blink/renderer/platform/fonts/linux/font_unique_name_lookup_linux.h"
+ #elif BUILDFLAG(IS_WIN)
+ #include "third_party/blink/renderer/platform/fonts/win/font_unique_name_lookup_win.h"
+@@ -24,7 +24,7 @@ std::unique_ptr<FontUniqueNameLookup>
+ FontUniqueNameLookup::GetPlatformUniqueNameLookup() {
+ #if BUILDFLAG(IS_ANDROID)
+ return std::make_unique<FontUniqueNameLookupAndroid>();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return std::make_unique<FontUniqueNameLookupLinux>();
+ #elif BUILDFLAG(IS_WIN)
+ return std::make_unique<FontUniqueNameLookupWin>();
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc
new file mode 100644
index 0000000000..c52dc26e16
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
+@@ -65,7 +65,7 @@ AtomicString ToAtomicString(const SkStri
+ return AtomicString::FromUTF8(str.c_str(), str.size());
+ }
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // This function is called on android or when we are emulating android fonts on
+ // linux and the embedder has overriden the default fontManager with
+ // WebFontRendering::setSkiaFontMgr.
+@@ -246,7 +246,7 @@ const FontPlatformData* FontCache::Creat
+ std::string name;
+
+ sk_sp<SkTypeface> typeface;
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool noto_color_emoji_from_gmscore = false;
+ #if BUILDFLAG(IS_ANDROID)
+ // Use the unique local matching pathway for fetching Noto Color Emoji Compat
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_begin__frame__provider.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_begin__frame__provider.cc
new file mode 100644
index 0000000000..784e3968ba
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_begin__frame__provider.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/graphics/begin_frame_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/graphics/begin_frame_provider.cc
+@@ -71,8 +71,12 @@ void BeginFrameProvider::CreateComposito
+
+ // Once we are using RAF, this thread is driving user interactive display
+ // updates. Update priority accordingly.
++ // pledge(2)
++ // stop this baloney
++#if !defined(OS_OPENBSD)
+ base::PlatformThread::SetCurrentThreadType(
+ base::ThreadType::kDisplayCritical);
++#endif
+
+ mojo::Remote<mojom::blink::EmbeddedFrameSinkProvider> provider;
+ Platform::Current()->GetBrowserInterfaceBroker()->GetInterface(
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_gpu_image__layer__bridge.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_gpu_image__layer__bridge.cc
new file mode 100644
index 0000000000..a8ca18308a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_gpu_image__layer__bridge.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
+@@ -49,7 +49,7 @@ scoped_refptr<StaticBitmapImage> MakeAcc
+ const auto paint_image = source->PaintImageForCurrentFrame();
+ const auto image_info = paint_image.GetSkImageInfo().makeWH(
+ source->Size().width(), source->Size().height());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(b/330865436): On Linux, CanvasResourceProvider doesn't always check
+ // for SCANOUT support correctly on X11 and it's never supported in
+ // practice. Therefore, don't include it until this flow is reworked.
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_video__frame__submitter.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_video__frame__submitter.cc
new file mode 100644
index 0000000000..d81ecef036
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_graphics_video__frame__submitter.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/graphics/video_frame_submitter.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/graphics/video_frame_submitter.cc
+@@ -438,7 +438,7 @@ void VideoFrameSubmitter::OnBeginFrame(
+ auto& details = timing_details.find(frame_token)->value;
+ auto& feedback = details.presentation_feedback;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO: On Linux failure flag is unreliable, and perfectly rendered frames
+ // are reported as failures all the time.
+ bool presentation_failure = false;
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_instrumentation_partition__alloc__memory__dump__provider.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_instrumentation_partition__alloc__memory__dump__provider.cc
new file mode 100644
index 0000000000..632bfc6d38
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_instrumentation_partition__alloc__memory__dump__provider.cc
@@ -0,0 +1,34 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/instrumentation/partition_alloc_memory_dump_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/instrumentation/partition_alloc_memory_dump_provider.cc
+@@ -14,7 +14,9 @@
+
+ namespace blink {
+
++#if !BUILDFLAG(IS_BSD)
+ const char kPartitionAllocDumpName[] = "partition_alloc";
++#endif
+
+ PartitionAllocMemoryDumpProvider* PartitionAllocMemoryDumpProvider::Instance() {
+ DEFINE_STATIC_LOCAL(PartitionAllocMemoryDumpProvider, instance, ());
+@@ -24,6 +26,7 @@ PartitionAllocMemoryDumpProvider* Partit
+ bool PartitionAllocMemoryDumpProvider::OnMemoryDump(
+ const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* memory_dump) {
++#if !BUILDFLAG(IS_BSD)
+ using base::trace_event::MemoryDumpLevelOfDetail;
+
+ MemoryDumpLevelOfDetail level_of_detail = args.level_of_detail;
+@@ -49,6 +52,7 @@ bool PartitionAllocMemoryDumpProvider::O
+ "size", "bytes", partition_stats_dumper.total_active_bytes());
+ memory_dump->AddOwnershipEdge(allocated_objects_dump->guid(),
+ partitions_dump->guid());
++#endif
+
+ return true;
+ }
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_peerconnection_rtc__video__encoder__factory.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_peerconnection_rtc__video__encoder__factory.cc
new file mode 100644
index 0000000000..5d6e2909b9
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_peerconnection_rtc__video__encoder__factory.cc
@@ -0,0 +1,23 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc
+@@ -317,12 +317,12 @@ SupportedFormats GetSupportedFormatsInte
+ supported_formats.profiles.push_back(profile.profile);
+ supported_formats.sdp_formats.push_back(std::move(*format));
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(IS_WIN)
+ const bool kShouldAddH264Cbp =
+ base::FeatureList::IsEnabled(kMediaFoundationH264CbpEncoding) &&
+ profile.profile == media::VideoCodecProfile::H264PROFILE_BASELINE;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const bool kShouldAddH264Cbp =
+ profile.profile == media::VideoCodecProfile::H264PROFILE_BASELINE;
+ #endif
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_runtime__enabled__features.json5 b/chromium-next/patches/patch-third__party_blink_renderer_platform_runtime__enabled__features.json5
new file mode 100644
index 0000000000..482424fa1a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_runtime__enabled__features.json5
@@ -0,0 +1,89 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/runtime_enabled_features.json5.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/runtime_enabled_features.json5
+@@ -389,7 +389,7 @@
+ name: "AppTitle",
+ status: "experimental",
+ origin_trial_feature_name: "AppTitle",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd", "netbsd"],
+ base_feature: "WebAppEnableAppTitle",
+ },
+ {
+@@ -1564,7 +1564,7 @@
+ name: "DocumentIsolationPolicy",
+ status: "experimental",
+ origin_trial_feature_name: "DocumentIsolationPolicy",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd", "netbsd"],
+ base_feature: "none",
+ },
+ {
+@@ -1858,7 +1858,7 @@
+ base_feature: "none",
+ public: true,
+ origin_trial_feature_name: "FedCmMultipleIdentityProviders",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd", "netbsd"],
+ origin_trial_allows_third_party: true,
+ },
+ {
+@@ -1997,7 +1997,7 @@
+ depends_on: ["FileSystemAccess"],
+ status: "experimental",
+ origin_trial_feature_name: "FileSystemObserver",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd", "netbsd"],
+ },
+ {
+ // The unobserve function of the FileSystemObserver.
+@@ -3249,7 +3249,7 @@
+ // Tracking bug for the implementation: https://crbug.com/1462930
+ name: "PermissionElement",
+ origin_trial_feature_name: "PermissionElement",
+- origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos", "openbsd", "freebsd", "netbsd"],
+ status: {"Android": "", "default": "experimental"},
+ public: true,
+ base_feature_status: "enabled",
+@@ -3386,7 +3386,7 @@
+ {
+ name: "PrivateNetworkAccessPermissionPrompt",
+ origin_trial_feature_name: "PrivateNetworkAccessPermissionPrompt",
+- origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos", "openbsd", "freebsd", "netbsd"],
+ status: "stable",
+ public: true,
+ base_feature: "none",
+@@ -4439,7 +4439,7 @@
+ name: "UnrestrictedSharedArrayBuffer",
+ base_feature: "none",
+ origin_trial_feature_name: "UnrestrictedSharedArrayBuffer",
+- origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos", "openbsd", "freebsd", "netbsd"],
+ },
+ // Enables using policy-controlled feature "usb-unrestricted" to allow
+ // isolated context to access protected USB interface classes and to
+@@ -4618,7 +4618,7 @@
+ {
+ name: "WebAppScopeExtensions",
+ origin_trial_feature_name: "WebAppScopeExtensions",
+- origin_trial_os: ["win", "mac", "linux", "chromeos"],
++ origin_trial_os: ["win", "mac", "linux", "chromeos", "openbsd", "freebsd", "netbsd"],
+ status: "experimental",
+ base_feature: "none",
+ },
+@@ -4657,7 +4657,7 @@
+ status: "experimental",
+ base_feature: "none",
+ origin_trial_feature_name: "WebAppUrlHandling",
+- origin_trial_os: ["win", "mac", "linux"],
++ origin_trial_os: ["win", "mac", "linux", "openbsd", "freebsd", "netbsd"],
+ },
+ {
+ // WebAssembly JS Promise Integration,
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_scheduler_common_thread.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_scheduler_common_thread.cc
new file mode 100644
index 0000000000..1822780534
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_scheduler_common_thread.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/scheduler/common/thread.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/scheduler/common/thread.cc
+@@ -87,7 +87,7 @@ void Thread::CreateAndSetCompositorThrea
+ "Compositor");
+ }));
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_OPENBSD)
+ compositor_thread->GetTaskRunner()->PostTaskAndReplyWithResult(
+ FROM_HERE, base::BindOnce(&base::PlatformThread::CurrentId),
+ base::BindOnce([](base::PlatformThreadId compositor_thread_id) {
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_widget_compositing_blink__categorized__worker__pool__delegate.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_widget_compositing_blink__categorized__worker__pool__delegate.cc
new file mode 100644
index 0000000000..608cfb2814
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_widget_compositing_blink__categorized__worker__pool__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/widget/compositing/blink_categorized_worker_pool_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/widget/compositing/blink_categorized_worker_pool_delegate.cc
+@@ -27,7 +27,7 @@ BlinkCategorizedWorkerPoolDelegate& Blin
+
+ void BlinkCategorizedWorkerPoolDelegate::NotifyThreadWillRun(
+ base::PlatformThreadId tid) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ scoped_refptr<base::TaskRunner> task_runner =
+ Thread::MainThread()->GetTaskRunner(MainThreadTaskRunnerRestricted());
+ task_runner->PostTask(FROM_HERE, base::BindOnce(
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_container__annotations.h b/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_container__annotations.h
new file mode 100644
index 0000000000..d6df366402
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_container__annotations.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/wtf/container_annotations.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/wtf/container_annotations.h
+@@ -12,7 +12,7 @@
+ // TODO(ochang): Remove the ARCH_CPU_X86_64 condition to enable this for X86
+ // once the crashes there have been fixed: http://crbug.com/461406
+ #if defined(ADDRESS_SANITIZER) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ defined(ARCH_CPU_X86_64)
+
+ // Annotations require buffers to begin on an 8-byte boundary. See
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_math__extras.h b/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_math__extras.h
new file mode 100644
index 0000000000..95da14d9ce
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_math__extras.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/wtf/math_extras.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/wtf/math_extras.h
+@@ -128,6 +128,10 @@ constexpr float Grad2turn(float g) {
+ return g * (1.0f / 400.0f);
+ }
+
++#if defined(OS_FREEBSD)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Winvalid-constexpr"
++#endif
+ constexpr double RoundHalfTowardsPositiveInfinity(double value) {
+ return std::floor(value + 0.5);
+ }
+@@ -135,6 +139,9 @@ constexpr double RoundHalfTowardsPositiv
+ constexpr float RoundHalfTowardsPositiveInfinity(float value) {
+ return std::floor(value + 0.5f);
+ }
++#if defined(OS_FREEBSD)
++#pragma clang diagnostic pop
++#endif
+
+ // ClampTo() is implemented by templated helper classes (to allow for partial
+ // template specialization) as well as several helper functions.
diff --git a/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_stack__util.cc b/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_stack__util.cc
new file mode 100644
index 0000000000..5c1d7aa851
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_blink_renderer_platform_wtf_stack__util.cc
@@ -0,0 +1,82 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/blink/renderer/platform/wtf/stack_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -23,6 +23,13 @@
+ extern "C" void* __libc_stack_end; // NOLINT
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include <sys/signal.h>
++#if !BUILDFLAG(IS_NETBSD)
++#include <pthread_np.h>
++#endif
++#endif
++
+ namespace WTF {
+
+ size_t GetUnderestimatedStackSize() {
+@@ -35,7 +42,8 @@ size_t GetUnderestimatedStackSize() {
+ // correctly for the main thread.
+
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_FUCHSIA) || \
++ BUILDFLAG(IS_NETBSD)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+ // If so, a conservative size estimate is returned.
+@@ -56,7 +64,7 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ return size;
+ }
+-#if BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
+ pthread_attr_destroy(&attr);
+ #endif
+
+@@ -67,6 +75,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#elif BUILDFLAG(IS_OPENBSD)
++ return 512 * 1024;
+ #elif BUILDFLAG(IS_APPLE)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -103,7 +113,7 @@ size_t GetUnderestimatedStackSize() {
+
+ void* GetStackStart() {
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_NETBSD)
+ pthread_attr_t attr;
+ int error;
+ #if BUILDFLAG(IS_FREEBSD)
+@@ -120,7 +130,7 @@ void* GetStackStart() {
+ pthread_attr_destroy(&attr);
+ return reinterpret_cast<uint8_t*>(base) + size;
+ }
+-#if BUILDFLAG(IS_FREEBSD)
++#if BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
+ pthread_attr_destroy(&attr);
+ #endif
+ #if defined(__GLIBC__)
+@@ -152,6 +162,13 @@ void* GetStackStart() {
+ ::GetCurrentThreadStackLimits(&lowLimit, &highLimit);
+ return reinterpret_cast<void*>(highLimit);
+ #endif
++#elif BUILDFLAG(IS_OPENBSD)
++ stack_t ss;
++ void *base;
++ int error = pthread_stackseg_np(pthread_self(), &ss);
++ CHECK(!error);
++ base = (void*)((size_t) ss.ss_sp - ss.ss_size);
++ return reinterpret_cast<uint8_t*>(base) + ss.ss_size;
+ #else
+ #error Unsupported getStackStart on this platform.
+ #endif
diff --git a/chromium-next/patches/patch-third__party_brotli_common_platform.h b/chromium-next/patches/patch-third__party_brotli_common_platform.h
new file mode 100644
index 0000000000..4d3a61d195
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_brotli_common_platform.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/brotli/common/platform.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/brotli/common/platform.h
+@@ -28,7 +28,7 @@
+ #include <brotli/port.h>
+ #include <brotli/types.h>
+
+-#if defined(OS_LINUX) || defined(OS_CYGWIN) || defined(__EMSCRIPTEN__)
++#if defined(OS_LINUX) || defined(OS_CYGWIN) || defined(__EMSCRIPTEN__) || defined(OS_BSD)
+ #include <endian.h>
+ #elif defined(OS_FREEBSD)
+ #include <machine/endian.h>
diff --git a/chromium-next/patches/patch-third__party_cpuinfo_cpuinfo.gni b/chromium-next/patches/patch-third__party_cpuinfo_cpuinfo.gni
new file mode 100644
index 0000000000..5ad5b53a43
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_cpuinfo_cpuinfo.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/cpuinfo/cpuinfo.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/cpuinfo/cpuinfo.gni
+@@ -8,7 +8,7 @@ use_cpuinfo =
+ current_cpu != "s390" && current_cpu != "s390x" &&
+ current_cpu != "riscv64" &&
+ # cpuinfo is not supported on fuchsia.
+- !is_fuchsia &&
++ !is_fuchsia && !is_bsd &&
+ # There's a few arm architectures that are not supported by cpuinfo,
+ # especially amongst ChromeOS devices.
+ # See //third_party/cpuinfo/src/src/arm/linux/cp.h.
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_build_crashpad__buildconfig.gni b/chromium-next/patches/patch-third__party_crashpad_crashpad_build_crashpad__buildconfig.gni
new file mode 100644
index 0000000000..a458d4b2a3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_build_crashpad__buildconfig.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/build/crashpad_buildconfig.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/build/crashpad_buildconfig.gni
+@@ -61,7 +61,7 @@ if (crashpad_is_in_chromium) {
+ crashpad_is_ios = is_ios
+ crashpad_is_apple = is_apple
+ crashpad_is_win = is_win
+- crashpad_is_linux = is_linux || is_chromeos
++ crashpad_is_linux = (is_linux || is_chromeos) && !is_bsd
+ crashpad_is_android = is_android
+ crashpad_is_fuchsia = is_fuchsia
+
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_client_BUILD.gn b/chromium-next/patches/patch-third__party_crashpad_crashpad_client_BUILD.gn
new file mode 100644
index 0000000000..c19dccbb91
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_client_BUILD.gn
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/client/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/client/BUILD.gn
+@@ -137,6 +137,13 @@ static_library("common") {
+ if (crashpad_is_win) {
+ sources += [ "crash_report_database_win.cc" ]
+ }
++
++ if (crashpad_is_posix) {
++ sources += [
++ "crashpad_client_posix.cc",
++ ]
++ }
++
+ if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
+ sources += [
+ "crash_report_database_generic.cc",
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_client_crashpad__client__posix.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_client_crashpad__client__posix.cc
new file mode 100644
index 0000000000..92ea8a6270
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_client_crashpad__client__posix.cc
@@ -0,0 +1,49 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/client/crashpad_client_posix.cc.orig 2025-01-20 18:01:27.964709441 +0000
++++ third_party/crashpad/crashpad/client/crashpad_client_posix.cc
+@@ -0,0 +1,40 @@
++// Copyright 2017 The Crashpad Authors. All rights reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++// http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "client/crashpad_client.h"
++
++#include "base/logging.h"
++#include "base/notreached.h"
++
++namespace crashpad {
++
++CrashpadClient::CrashpadClient() {}
++
++CrashpadClient::~CrashpadClient() {}
++
++bool CrashpadClient::StartHandler(
++ const base::FilePath& handler,
++ const base::FilePath& database,
++ const base::FilePath& metrics_dir,
++ const std::string& url,
++ const std::map<std::string, std::string>& annotations,
++ const std::vector<std::string>& arguments,
++ bool restartable,
++ bool asynchronous_start,
++ const std::vector<base::FilePath>& attachments) {
++ NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
++ return false;
++}
++
++} // namespace crashpad
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc
new file mode 100644
index 0000000000..2a6c9e1180
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
+@@ -159,6 +159,12 @@ std::string MinidumpMiscInfoDebugBuildSt
+ static constexpr char kOS[] = "win";
+ #elif BUILDFLAG(IS_FUCHSIA)
+ static constexpr char kOS[] = "fuchsia";
++#elif defined(OS_OPENBSD)
++ static constexpr char kOS[] = "openbsd";
++#elif defined(OS_FREEBSD)
++ static constexpr char kOS[] = "freebsd";
++#elif defined(OS_NETBSD)
++ static constexpr char kOS[] = "netbsd";
+ #else
+ #error define kOS for this operating system
+ #endif
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_address__types.h b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_address__types.h
new file mode 100644
index 0000000000..426decb4c1
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_address__types.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/misc/address_types.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/misc/address_types.h
+@@ -25,7 +25,7 @@
+ #include <mach/mach_types.h>
+ #elif BUILDFLAG(IS_WIN)
+ #include "util/win/address_types.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "util/linux/address_types.h"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include <zircon/types.h>
+@@ -55,7 +55,7 @@ using VMSize = mach_vm_size_t;
+ using VMAddress = WinVMAddress;
+ using VMSize = WinVMSize;
+
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+
+ using VMAddress = LinuxVMAddress;
+ using VMSize = LinuxVMSize;
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_capture__context.h b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_capture__context.h
new file mode 100644
index 0000000000..5a8c6f0401
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_capture__context.h
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/misc/capture_context.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/misc/capture_context.h
+@@ -21,7 +21,8 @@
+ #include <mach/mach.h>
+ #elif BUILDFLAG(IS_WIN)
+ #include <windows.h>
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
++ BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
+ #include <ucontext.h>
+ #endif // BUILDFLAG(IS_APPLE)
+
+@@ -35,7 +36,8 @@ using NativeCPUContext = arm_unified_thr
+ #endif
+ #elif BUILDFLAG(IS_WIN)
+ using NativeCPUContext = CONTEXT;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
++ BUILDFLAG(IS_BSD)
+ using NativeCPUContext = ucontext_t;
+ #endif // BUILDFLAG(IS_APPLE)
+
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_metrics.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_metrics.cc
new file mode 100644
index 0000000000..86505ae163
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_metrics.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/misc/metrics.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/misc/metrics.cc
+@@ -25,7 +25,7 @@
+ #define METRICS_OS_NAME "Win"
+ #elif BUILDFLAG(IS_ANDROID)
+ #define METRICS_OS_NAME "Android"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define METRICS_OS_NAME "Linux"
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #define METRICS_OS_NAME "Fuchsia"
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_uuid.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_uuid.cc
new file mode 100644
index 0000000000..ab91321e5f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_misc_uuid.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/misc/uuid.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/misc/uuid.cc
+@@ -110,7 +110,7 @@ bool UUID::InitializeWithNew() {
+ InitializeFromBytes(uuid);
+ return true;
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Linux, Android, and Fuchsia do not provide a UUID generator in a
+ // widely-available system library. On Linux and Android, uuid_generate()
+ // from libuuid is not available everywhere.
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_close__multiple.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_close__multiple.cc
new file mode 100644
index 0000000000..f3c869445a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_close__multiple.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/posix/close_multiple.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/posix/close_multiple.cc
+@@ -73,7 +73,7 @@ void CloseNowOrOnExec(int fd, bool ebadf
+ // This is an advantage over looping over all possible file descriptors, because
+ // no attempt needs to be made to close file descriptors that are not open.
+ bool CloseMultipleNowOrOnExecUsingFDDir(int min_fd, int preserve_fd) {
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ static constexpr char kFDDir[] = "/dev/fd";
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ static constexpr char kFDDir[] = "/proc/self/fd";
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_drop__privileges.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_drop__privileges.cc
new file mode 100644
index 0000000000..1722372443
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_drop__privileges.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/posix/drop_privileges.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/posix/drop_privileges.cc
+@@ -25,7 +25,7 @@ void DropPrivileges() {
+ gid_t gid = getgid();
+ uid_t uid = getuid();
+
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // Based on the POSIX.1-2008 2013 edition documentation for setreuid() and
+ // setregid(), setreuid() and setregid() alone should be sufficient to drop
+ // privileges. The standard specifies that the saved ID should be set to the
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_signals.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_signals.cc
new file mode 100644
index 0000000000..2677e69cfd
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_signals.cc
@@ -0,0 +1,39 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/posix/signals.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/posix/signals.cc
+@@ -51,7 +51,7 @@ constexpr int kCrashSignals[] = {
+ #if defined(SIGEMT)
+ SIGEMT,
+ #endif // defined(SIGEMT)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SIGXCPU,
+ SIGXFSZ,
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+@@ -91,7 +91,7 @@ constexpr int kTerminateSignals[] = {
+ SIGXCPU,
+ SIGXFSZ,
+ #endif // BUILDFLAG(IS_APPLE)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ SIGIO,
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ };
+@@ -251,8 +251,12 @@ bool Signals::WillSignalReraiseAutonomou
+ // remains. See 10.12.3 xnu-3789.41.3/bsd/kern/kern_sig.c
+ // psignal_internal().
+ (code > 0 &&
++#if defined(SI_ASYNCIO)
+ code != SI_ASYNCIO &&
++#endif
++#if defined(SI_MESGQ)
+ code != SI_MESGQ &&
++#endif
+ code != SI_QUEUE &&
+ code != SI_TIMER &&
+ code != SI_USER &&
diff --git a/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc
new file mode 100644
index 0000000000..d961b5be82
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc
+@@ -68,7 +68,7 @@ constexpr const char* kSignalNames[] = {
+ "INFO",
+ "USR1",
+ "USR2",
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #if defined(ARCH_CPU_MIPS_FAMILY)
+ "HUP",
+ "INT",
+@@ -139,7 +139,7 @@ constexpr const char* kSignalNames[] = {
+ #endif // defined(ARCH_CPU_MIPS_FAMILY)
+ #endif
+ };
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // NSIG is 64 to account for real-time signals.
+ static_assert(std::size(kSignalNames) == 32, "kSignalNames length");
+ #else
diff --git a/chromium-next/patches/patch-third__party_crc32c_BUILD.gn b/chromium-next/patches/patch-third__party_crc32c_BUILD.gn
new file mode 100644
index 0000000000..15fb0a3e6b
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_crc32c_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/crc32c/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/crc32c/BUILD.gn
+@@ -46,7 +46,7 @@ config("crc32c_config") {
+ }
+
+ # Android added <sys/auxv.h> in API level 18.
+- if (is_linux || is_chromeos || is_android) {
++ if (is_linux || is_chromeos || is_android && !is_bsd) {
+ defines += [
+ "HAVE_STRONG_GETAUXVAL=1",
+ "HAVE_WEAK_GETAUXVAL=1",
diff --git a/chromium-next/patches/patch-third__party_dawn_include_dawn_native_VulkanBackend.h b/chromium-next/patches/patch-third__party_dawn_include_dawn_native_VulkanBackend.h
new file mode 100644
index 0000000000..3cf522c6d8
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_dawn_include_dawn_native_VulkanBackend.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/dawn/include/dawn/native/VulkanBackend.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/dawn/include/dawn/native/VulkanBackend.h
+@@ -83,7 +83,8 @@ struct ExternalImageExportInfoVk : Exter
+ };
+
+ // Can't use DAWN_PLATFORM_IS(LINUX) since header included in both Dawn and Chrome
+-#if defined(__linux__) || defined(__Fuchsia__)
++#if defined(__linux__) || defined(__Fuchsia__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
++ defined(__NetBSD__)
+
+ // Common properties of external images represented by FDs. On successful import the file
+ // descriptor's ownership is transferred to the Dawn implementation and they shouldn't be
diff --git a/chromium-next/patches/patch-third__party_dawn_src_dawn_common_Platform.h b/chromium-next/patches/patch-third__party_dawn_src_dawn_common_Platform.h
new file mode 100644
index 0000000000..140123c80a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_dawn_src_dawn_common_Platform.h
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/dawn/src/dawn/common/Platform.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/dawn/src/dawn/common/Platform.h
+@@ -59,6 +59,11 @@
+ #error "Unsupported Windows platform."
+ #endif
+
++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#define DAWN_PLATFORM_IS_LINUX 1
++#define DAWN_PLATFORM_IS_BSD 1
++#define DAWN_PLATFORM_IS_POSIX 1
++
+ #elif defined(__linux__)
+ #define DAWN_PLATFORM_IS_LINUX 1
+ #define DAWN_PLATFORM_IS_POSIX 1
diff --git a/chromium-next/patches/patch-third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp b/chromium-next/patches/patch-third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp
new file mode 100644
index 0000000000..bb4cab264f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp
+@@ -56,7 +56,7 @@ constexpr char kSwiftshaderLibName[] = "
+ #endif
+
+ #if DAWN_PLATFORM_IS(LINUX)
+-#if DAWN_PLATFORM_IS(ANDROID)
++#if DAWN_PLATFORM_IS(ANDROID) || DAWN_PLATFORM_IS(BSD)
+ constexpr char kVulkanLibName[] = "libvulkan.so";
+ #else
+ constexpr char kVulkanLibName[] = "libvulkan.so.1";
diff --git a/chromium-next/patches/patch-third__party_ffmpeg_BUILD.gn b/chromium-next/patches/patch-third__party_ffmpeg_BUILD.gn
new file mode 100644
index 0000000000..f18aa882d5
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ffmpeg_BUILD.gn
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ffmpeg/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ffmpeg/BUILD.gn
+@@ -350,7 +350,6 @@ target(link_target_type, "ffmpeg_interna
+ libs += [
+ "m",
+ "z",
+- "rt",
+ ]
+ }
+ if (is_component_ffmpeg) {
diff --git a/chromium-next/patches/patch-third__party_ffmpeg_libavcodec_x86_cabac.h b/chromium-next/patches/patch-third__party_ffmpeg_libavcodec_x86_cabac.h
new file mode 100644
index 0000000000..4175fc8ed8
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ffmpeg_libavcodec_x86_cabac.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ffmpeg/libavcodec/x86/cabac.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ffmpeg/libavcodec/x86/cabac.h
+@@ -31,7 +31,8 @@
+
+ #if (defined(__i386) && defined(__clang__) && (__clang_major__<2 || (__clang_major__==2 && __clang_minor__<10)))\
+ || ( !defined(__clang__) && defined(__llvm__) && __GNUC__==4 && __GNUC_MINOR__==2 && __GNUC_PATCHLEVEL__<=1)\
+- || (defined(__INTEL_COMPILER) && defined(_MSC_VER))
++ || (defined(__INTEL_COMPILER) && defined(_MSC_VER)) \
++ || ((defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386))
+ # define BROKEN_COMPILER 1
+ #else
+ # define BROKEN_COMPILER 0
diff --git a/chromium-next/patches/patch-third__party_ffmpeg_libavutil_cpu.c b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_cpu.c
new file mode 100644
index 0000000000..bceb4fb8a7
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_cpu.c
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ffmpeg/libavutil/cpu.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ffmpeg/libavutil/cpu.c
+@@ -38,10 +38,7 @@
+ #if HAVE_GETPROCESSAFFINITYMASK || HAVE_WINRT
+ #include <windows.h>
+ #endif
+-#if HAVE_SYSCTL
+-#if HAVE_SYS_PARAM_H
+-#include <sys/param.h>
+-#endif
++#if HAVE_SYSCTL && !defined(__OpenBSD__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #endif
diff --git a/chromium-next/patches/patch-third__party_ffmpeg_libavutil_mem.c b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_mem.c
new file mode 100644
index 0000000000..225b8f172d
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_mem.c
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ffmpeg/libavutil/mem.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ffmpeg/libavutil/mem.c
+@@ -33,9 +33,6 @@
+ #include <stdlib.h>
+ #include <stdatomic.h>
+ #include <string.h>
+-#if HAVE_MALLOC_H
+-#include <malloc.h>
+-#endif
+
+ #include "attributes.h"
+ #include "avassert.h"
diff --git a/chromium-next/patches/patch-third__party_ffmpeg_libavutil_random__seed.c b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_random__seed.c
new file mode 100644
index 0000000000..831e651650
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_random__seed.c
@@ -0,0 +1,31 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ffmpeg/libavutil/random_seed.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ffmpeg/libavutil/random_seed.c
+@@ -20,6 +20,10 @@
+
+ #include "config.h"
+
++#if defined(__NetBSD__)
++#define _NETBSD_SOURCE 1
++#endif
++
+ #if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+@@ -35,6 +39,11 @@
+ #elif CONFIG_OPENSSL
+ #include <openssl/rand.h>
+ #endif
++#if HAVE_ARC4RANDOM_BUF
++#undef __BSD_VISIBLE
++#define __BSD_VISIBLE 1
++#include <stdlib.h>
++#endif
+ #include <fcntl.h>
+ #include <math.h>
+ #include <time.h>
diff --git a/chromium-next/patches/patch-third__party_ffmpeg_libavutil_x86_x86inc.asm b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_x86_x86inc.asm
new file mode 100644
index 0000000000..3659e96301
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ffmpeg_libavutil_x86_x86inc.asm
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ffmpeg/libavutil/x86/x86inc.asm.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ffmpeg/libavutil/x86/x86inc.asm
+@@ -46,6 +46,12 @@
+ %endif
+ %endif
+
++%if ARCH_X86_64
++ %define _CET_ENDBR endbr64
++%else
++ %define _CET_ENDBR
++%endif
++
+ %define WIN64 0
+ %define UNIX64 0
+ %if ARCH_X86_64
+@@ -861,6 +867,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle,
+ %endif
+ align function_align
+ %2:
++ _CET_ENDBR
+ RESET_MM_PERMUTATION ; needed for x86-64, also makes disassembly somewhat nicer
+ %xdefine rstk rsp ; copy of the original stack pointer, used when greater alignment than the known stack alignment is required
+ %assign stack_offset 0 ; stack pointer offset relative to the return address
diff --git a/chromium-next/patches/patch-third__party_fontconfig_include_config.h b/chromium-next/patches/patch-third__party_fontconfig_include_config.h
new file mode 100644
index 0000000000..78b1542dd7
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_fontconfig_include_config.h
@@ -0,0 +1,55 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/fontconfig/include/config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/fontconfig/include/config.h
+@@ -13,7 +13,7 @@
+
+ #define FC_CACHEDIR "/var/cache/fontconfig"
+
+-#define FC_DEFAULT_FONTS "\t<dir>/usr/share/fonts</dir>\n\t<dir>/usr/local/share/fonts</dir>\n"
++#define FC_DEFAULT_FONTS "\t<dir>/usr/X11R6/lib/X11/fonts</dir>"
+
+ #define FC_FONTPATH ""
+
+@@ -66,7 +66,7 @@
+
+ #define HAVE_MMAP 1
+
+-#define HAVE_POSIX_FADVISE 1
++#define HAVE_POSIX_FADVISE 0
+
+ #define HAVE_PTHREAD 1
+
+@@ -74,10 +74,13 @@
+
+ #define HAVE_RANDOM 1
+
+-#define HAVE_RANDOM_R 1
++/* #undef HAVE_RANDOM_R */
+
+ #define HAVE_RAND_R 1
+
++/* Define to 1 if you have the `arc4_random' function. */
++#define HAVE_ARC4RANDOM 1
++
+ #define HAVE_READLINK 1
+
+ #define HAVE_STDATOMIC_PRIMITIVES 1
+@@ -92,11 +95,11 @@
+
+ #define HAVE_SYS_PARAM_H 1
+
+-#define HAVE_SYS_STATFS_H 1
++/* #undef HAVE_SYS_STATFS_H */
+
+ #define HAVE_SYS_STATVFS_H 1
+
+-#define HAVE_SYS_VFS_H 1
++/* #undef HAVE_SYS_VFS_H */
+
+ #define HAVE_UNISTD_H 1
+
diff --git a/chromium-next/patches/patch-third__party_fontconfig_src_src_fccompat.c b/chromium-next/patches/patch-third__party_fontconfig_src_src_fccompat.c
new file mode 100644
index 0000000000..02e31785bb
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_fontconfig_src_src_fccompat.c
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/fontconfig/src/src/fccompat.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/fontconfig/src/src/fccompat.c
+@@ -184,7 +184,9 @@ FcRandom(void)
+ {
+ int32_t result;
+
+-#if HAVE_RANDOM_R
++#if HAVE_ARC4RANDOM
++ result = arc4random() & 0x7fffffff;
++#elif HAVE_RANDOM_R
+ static struct random_data fcrandbuf;
+ static char statebuf[256];
+ static FcBool initialized = FcFalse;
diff --git a/chromium-next/patches/patch-third__party_ipcz_src_reference__drivers_random.cc b/chromium-next/patches/patch-third__party_ipcz_src_reference__drivers_random.cc
new file mode 100644
index 0000000000..91778d27bb
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ipcz_src_reference__drivers_random.cc
@@ -0,0 +1,55 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ipcz/src/reference_drivers/random.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ipcz/src/reference_drivers/random.cc
+@@ -14,7 +14,8 @@
+ #include <windows.h>
+ #elif BUILDFLAG(IS_FUCHSIA)
+ #include <zircon/syscalls.h>
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)) && \
++ !BUILDFLAG(IS_NETBSD)
+ #include <asm/unistd.h>
+ #include <sys/syscall.h>
+ #include <unistd.h>
+@@ -25,7 +26,7 @@
+ #include <nacl/nacl_random.h>
+ #endif
+
+-#if BUILDFLAG(IS_POSIX)
++#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_NETBSD)
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -55,7 +56,7 @@ decltype(&ProcessPrng) GetProcessPrng()
+ }
+ #endif
+
+-#if defined(OS_POSIX) && !BUILDFLAG(IS_MAC)
++#if (defined(OS_POSIX) && !BUILDFLAG(IS_MAC)) || BUILDFLAG(IS_NETBSD)
+ void RandomBytesFromDevUrandom(absl::Span<uint8_t> destination) {
+ static int urandom_fd = [] {
+ for (;;) {
+@@ -86,7 +87,8 @@ void RandomBytes(absl::Span<uint8_t> des
+ process_prng_fn(destination.data(), destination.size());
+ #elif BUILDFLAG(IS_FUCHSIA)
+ zx_cprng_draw(destination.data(), destination.size());
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)) && \
++ !BUILDFLAG(IS_NETBSD)
+ while (!destination.empty()) {
+ ssize_t result =
+ syscall(__NR_getrandom, destination.data(), destination.size(), 0);
+@@ -102,7 +104,7 @@ void RandomBytes(absl::Span<uint8_t> des
+ #elif BUILDFLAG(IS_MAC)
+ const bool ok = getentropy(destination.data(), destination.size()) == 0;
+ ABSL_ASSERT(ok);
+-#elif BUILDFLAG(IS_IOS)
++#elif BUILDFLAG(IS_IOS) || BUILDFLAG(IS_NETBSD)
+ RandomBytesFromDevUrandom(destination);
+ #elif BUILDFLAG(IS_NACL)
+ while (!destination.empty()) {
diff --git a/chromium-next/patches/patch-third__party_ipcz_src_standalone_base_logging.cc b/chromium-next/patches/patch-third__party_ipcz_src_standalone_base_logging.cc
new file mode 100644
index 0000000000..ef48ab7e90
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_ipcz_src_standalone_base_logging.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/ipcz/src/standalone/base/logging.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/ipcz/src/standalone/base/logging.cc
+@@ -50,6 +50,9 @@ LogMessage::LogMessage(const char* file,
+ #elif BUILDFLAG(IS_ANDROID)
+ stream_ << getpid() << ":" << gettid() << ":";
+ const char* trimmed_file = strrchr(file, '/') + 1;
++#elif BUILDFLAG(IS_BSD)
++ stream_ << getpid() << ":" << pthread_self() << ":";
++ const char* trimmed_file = strrchr(file, '/') + 1;
+ #elif BUILDFLAG(IS_WIN)
+ const char* trimmed_file = file;
+ stream_ << (::GetCurrentProcessId()) << ":" << ::GetCurrentThreadId() << ":";
diff --git a/chromium-next/patches/patch-third__party_leveldatabase_env__chromium.cc b/chromium-next/patches/patch-third__party_leveldatabase_env__chromium.cc
new file mode 100644
index 0000000000..e52217ae4e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_leveldatabase_env__chromium.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/leveldatabase/env_chromium.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/leveldatabase/env_chromium.cc
+@@ -329,7 +329,8 @@ ChromiumWritableFile::ChromiumWritableFi
+
+ Status ChromiumWritableFile::SyncParent() {
+ TRACE_EVENT0("leveldb", "SyncParent");
+-#if defined(OS_POSIX) || defined(OS_FUCHSIA)
++// pledge violation (directory passed as fd)
++#if (defined(OS_POSIX) || defined(OS_FUCHSIA)) && !defined(OS_OPENBSD)
+ FilePath path = FilePath::FromUTF8Unsafe(parent_dir_);
+ FileErrorOr<base::File> result = filesystem_->OpenFile(
+ path, base::File::FLAG_OPEN | base::File::FLAG_READ);
diff --git a/chromium-next/patches/patch-third__party_libaom_source_libaom_aom__ports_aarch64__cpudetect.c b/chromium-next/patches/patch-third__party_libaom_source_libaom_aom__ports_aarch64__cpudetect.c
new file mode 100644
index 0000000000..e1bd745b04
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libaom_source_libaom_aom__ports_aarch64__cpudetect.c
@@ -0,0 +1,56 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libaom/source/libaom/aom_ports/aarch64_cpudetect.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libaom/source/libaom/aom_ports/aarch64_cpudetect.c
+@@ -127,10 +127,46 @@ static int arm_get_cpu_caps(void) {
+ return flags;
+ }
+
+-#elif defined(__linux__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)
++#elif defined(__OpenBSD__)
++#include <sys/sysctl.h>
++#include <machine/cpu.h>
++#include <machine/armreg.h>
++
++static int arm_get_cpu_caps(void) {
++ int flags = 0;
++ int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 };
++ uint64_t cpu_id = 0;
++ size_t len = sizeof(cpu_id);
++
++ flags |= HAS_NEON; // Neon is mandatory in Armv8.0-A.
++
++ if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) < 0)
++ return flags;
++
++ if (ID_AA64ISAR0_CRC32(cpu_id) >= ID_AA64ISAR0_CRC32_BASE)
++ flags |= HAS_ARM_CRC32;
++
++ return flags;
++}
++
++#elif defined(__linux__) || defined(__FreeBSD__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)
+
+ #include <sys/auxv.h>
+
++#if defined(__FreeBSD__)
++static unsigned long getauxval(unsigned long type)
++{
++ /* Only AT_HWCAP* return unsigned long */
++ if (type != AT_HWCAP && type != AT_HWCAP2) {
++ return 0;
++ }
++
++ unsigned long ret = 0;
++ elf_aux_info(type, &ret, sizeof(ret));
++ return ret;
++}
++#endif
++
+ // Define hwcap values ourselves: building with an old auxv header where these
+ // hwcap values are not defined should not prevent features from being enabled.
+ #define AOM_AARCH64_HWCAP_CRC32 (1 << 7)
diff --git a/chromium-next/patches/patch-third__party_libc++_src_src_chrono.cpp b/chromium-next/patches/patch-third__party_libc++_src_src_chrono.cpp
new file mode 100644
index 0000000000..a353aa0e5b
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libc++_src_src_chrono.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libc++/src/src/chrono.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libc++/src/src/chrono.cpp
+@@ -34,7 +34,7 @@
+ // OpenBSD and GPU do not have a fully conformant suite of POSIX timers, but
+ // it does have clock_gettime and CLOCK_MONOTONIC which is all we need.
+ #if defined(__APPLE__) || defined(__gnu_hurd__) || defined(__OpenBSD__) || defined(__AMDGPU__) || \
+- defined(__NVPTX__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
++ defined(__NVPTX__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) || defined(__FreeBSD__) || defined(__NetBSD__)
+ # define _LIBCPP_HAS_CLOCK_GETTIME
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_libc++_src_src_filesystem_filesystem__clock.cpp b/chromium-next/patches/patch-third__party_libc++_src_src_filesystem_filesystem__clock.cpp
new file mode 100644
index 0000000000..a0be5fbbd2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libc++_src_src_filesystem_filesystem__clock.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libc++/src/src/filesystem/filesystem_clock.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libc++/src/src/filesystem/filesystem_clock.cpp
+@@ -30,7 +30,7 @@
+ #endif
+
+ #if defined(__APPLE__) || defined(__gnu_hurd__) || defined(__AMDGPU__) || defined(__NVPTX__) || \
+- (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
++ (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ # define _LIBCPP_HAS_CLOCK_GETTIME
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_libc++abi_src_src_cxa__guard__impl.h b/chromium-next/patches/patch-third__party_libc++abi_src_src_cxa__guard__impl.h
new file mode 100644
index 0000000000..80c206e198
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libc++abi_src_src_cxa__guard__impl.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libc++abi/src/src/cxa_guard_impl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libc++abi/src/src/cxa_guard_impl.h
+@@ -425,6 +425,17 @@ void PlatformFutexWake(int* addr) {
+ __tsan_release(addr);
+ futex(reinterpret_cast<volatile uint32_t*>(addr), WAKE, INT_MAX, NULL, NULL);
+ }
++#elif defined(__NetBSD__)
++void PlatformFutexWait(int* addr, int expect) {
++ constexpr int WAIT = 0;
++ syscall(SYS___futex, addr, WAIT, expect, NULL, NULL, 0, 0);
++ __tsan_acquire(addr);
++}
++void PlatformFutexWake(int* addr) {
++ constexpr int WAKE = 1;
++ __tsan_release(addr);
++ syscall(SYS___futex, addr, WAKE, INT_MAX, NULL, NULL, 0, 0);
++}
+ #elif defined(SYS_futex)
+ void PlatformFutexWait(int* addr, int expect) {
+ constexpr int WAIT = 0;
diff --git a/chromium-next/patches/patch-third__party_libdrm_src_xf86drmMode.c b/chromium-next/patches/patch-third__party_libdrm_src_xf86drmMode.c
new file mode 100644
index 0000000000..31f89fa8a2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libdrm_src_xf86drmMode.c
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libdrm/src/xf86drmMode.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libdrm/src/xf86drmMode.c
+@@ -976,7 +976,7 @@ drm_public int drmCheckModesettingSuppor
+ }
+ #elif defined(__DragonFly__)
+ return 0;
+-#elif defined(__OpenBSD__)
++#elif defined(__OpenBSD__) || defined(__NetBSD__)
+ int fd;
+ struct drm_mode_card_res res;
+ drmModeResPtr r = 0;
+@@ -1129,7 +1129,11 @@ drm_public int drmModePageFlipTarget(int
+
+ drm_public int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
+ uint32_t fb_id, uint32_t flags,
++#if defined(__NetBSD__)
++ uint32_t crtc_x, uint32_t crtc_y,
++#else
+ int32_t crtc_x, int32_t crtc_y,
++#endif
+ uint32_t crtc_w, uint32_t crtc_h,
+ uint32_t src_x, uint32_t src_y,
+ uint32_t src_w, uint32_t src_h)
diff --git a/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_memory_singleton.h b/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_memory_singleton.h
new file mode 100644
index 0000000000..377a1ed0db
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_memory_singleton.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libphonenumber/dist/cpp/src/phonenumbers/base/memory/singleton.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libphonenumber/dist/cpp/src/phonenumbers/base/memory/singleton.h
+@@ -22,7 +22,8 @@
+ #elif (__cplusplus >= 201103L) && defined(I18N_PHONENUMBERS_USE_STDMUTEX)
+ // C++11 Lock implementation based on std::mutex.
+ #include "phonenumbers/base/memory/singleton_stdmutex.h"
+-#elif defined(__linux__) || defined(__APPLE__) || defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD)
++#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
++ defined(__NetBSD__) || defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD)
+ #include "phonenumbers/base/memory/singleton_posix.h"
+ #elif defined(WIN32)
+ #include "phonenumbers/base/memory/singleton_win32.h"
diff --git a/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_synchronization_lock.h b/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_synchronization_lock.h
new file mode 100644
index 0000000000..c16300fe45
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_synchronization_lock.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libphonenumber/dist/cpp/src/phonenumbers/base/synchronization/lock.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libphonenumber/dist/cpp/src/phonenumbers/base/synchronization/lock.h
+@@ -22,7 +22,8 @@
+ #elif (__cplusplus >= 201103L) && defined(I18N_PHONENUMBERS_USE_STDMUTEX)
+ // C++11 Lock implementation based on std::mutex.
+ #include "phonenumbers/base/synchronization/lock_stdmutex.h"
+-#elif defined(__linux__) || defined(__APPLE__) || defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD)
++#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
++ defined(__NetBSD__) || defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD)
+ #include "phonenumbers/base/synchronization/lock_posix.h"
+ #elif defined(WIN32)
+ #include "phonenumbers/base/synchronization/lock_win32.h"
diff --git a/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_thread__checker.h b/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_thread__checker.h
new file mode 100644
index 0000000000..ebd73b85d8
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_thread__checker.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libphonenumber/dist/cpp/src/phonenumbers/base/thread_checker.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libphonenumber/dist/cpp/src/phonenumbers/base/thread_checker.h
+@@ -22,8 +22,8 @@
+ // Note that I18N_PHONENUMBERS_NO_THREAD_SAFETY must be defined only to let the
+ // user of the library know that it can't be used in a thread-safe manner when
+ // it is not depending on Boost.
+-#if !defined(__linux__) && !defined(__APPLE__) && !defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD) && \
+- !defined(I18N_PHONENUMBERS_NO_THREAD_SAFETY) && \
++#if !defined(__linux__) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD) && \
++ !defined(__NetBSD__) && !defined(I18N_PHONENUMBERS_NO_THREAD_SAFETY) && \
+ !((__cplusplus >= 201103L) && defined(I18N_PHONENUMBERS_USE_STDMUTEX)) && \
+ !defined(WIN32)
+ #error Building without Boost, please provide \
+@@ -33,7 +33,8 @@
+ #endif
+
+ #if !defined(NDEBUG) && !defined(I18N_PHONENUMBERS_USE_BOOST) && \
+- (defined(__linux__) || defined(__APPLE__) || defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD))
++ (defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
++ defined(__NetBSD__) || defined(I18N_PHONENUMBERS_HAVE_POSIX_THREAD))
+
+ #include <pthread.h>
+
diff --git a/chromium-next/patches/patch-third__party_libsync_src_include_sync_sync.h b/chromium-next/patches/patch-third__party_libsync_src_include_sync_sync.h
new file mode 100644
index 0000000000..ed1c67503f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libsync_src_include_sync_sync.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libsync/src/include/sync/sync.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libsync/src/include/sync/sync.h
+@@ -22,7 +22,9 @@
+ #include <sys/cdefs.h>
+ #include <stdint.h>
+
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #include <linux/types.h>
++#endif
+
+ __BEGIN_DECLS
+
diff --git a/chromium-next/patches/patch-third__party_libsync_src_sync.c b/chromium-next/patches/patch-third__party_libsync_src_sync.c
new file mode 100644
index 0000000000..b87ea27675
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libsync_src_sync.c
@@ -0,0 +1,31 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libsync/src/sync.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libsync/src/sync.c
+@@ -17,8 +17,8 @@
+ */
+
+ #include <fcntl.h>
+-#include <malloc.h>
+ #include <stdint.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+ #include <poll.h>
+@@ -29,6 +29,12 @@
+
+ #include <sync/sync.h>
+
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++typedef __uint8_t __u8;
++typedef __uint32_t __u32;
++typedef __int32_t __s32;
++#define ETIME ETIMEDOUT
++#endif
+
+ struct sw_sync_create_fence_data {
+ __u32 value;
diff --git a/chromium-next/patches/patch-third__party_libusb_BUILD.gn b/chromium-next/patches/patch-third__party_libusb_BUILD.gn
new file mode 100644
index 0000000000..bfcd289b06
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libusb_BUILD.gn
@@ -0,0 +1,58 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libusb/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libusb/BUILD.gn
+@@ -3,7 +3,7 @@
+ # found in the LICENSE file.
+
+ # libusb is only used by //services/device/usb on macOS.
+-assert(is_mac)
++assert(is_mac || is_bsd)
+
+ import("//build/config/chromeos/ui_mode.gni")
+ import("//build/config/features.gni")
+@@ -103,7 +103,7 @@ static_library("libusb") {
+ ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "src/libusb/os/linux_usbfs.c",
+ "src/libusb/os/linux_usbfs.h",
+@@ -114,11 +114,21 @@ static_library("libusb") {
+ ]
+ }
+
++ if (is_openbsd) {
++ sources += [
++ "src/libusb/os/openbsd_usb.c",
++ ]
++ defines += [
++ "OS_OPENBSD=1",
++ "_GNU_SOURCE=1",
++ ]
++ }
++
+ if (is_chromeos_ash) {
+ defines += [ "USBI_TIMERFD_AVAILABLE" ]
+ }
+
+- if (use_udev) {
++ if (use_udev && !is_bsd) {
+ sources += [ "src/libusb/os/linux_udev.cc" ]
+ defines += [
+ "HAVE_LIBUDEV=1",
+@@ -127,7 +137,7 @@ static_library("libusb") {
+ deps += [ "//build/linux/libudev" ]
+ }
+
+- if ((is_linux || is_chromeos) && !use_udev) {
++ if ((is_linux || is_chromeos) && !use_udev && !is_bsd) {
+ sources += [ "src/libusb/os/linux_netlink.c" ]
+ defines += [ "HAVE_LINUX_NETLINK_H" ]
+ }
diff --git a/chromium-next/patches/patch-third__party_libusb_src_libusb_core.c b/chromium-next/patches/patch-third__party_libusb_src_libusb_core.c
new file mode 100644
index 0000000000..7550536b5e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libusb_src_libusb_core.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libusb/src/libusb/core.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libusb/src/libusb/core.c
+@@ -448,7 +448,7 @@ libusb_free_device_list(list, 1);
+ * which grows when required. it can be freed once discovery has completed,
+ * eliminating the need for a list node in the libusb_device structure
+ * itself. */
+-#define DISCOVERED_DEVICES_SIZE_STEP 8
++#define DISCOVERED_DEVICES_SIZE_STEP 16
+
+ static struct discovered_devs *discovered_devs_alloc(void)
+ {
diff --git a/chromium-next/patches/patch-third__party_libusb_src_libusb_os_threads__posix.c b/chromium-next/patches/patch-third__party_libusb_src_libusb_os_threads__posix.c
new file mode 100644
index 0000000000..f84d08d0d3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libusb_src_libusb_os_threads__posix.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libusb/src/libusb/os/threads_posix.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libusb/src/libusb/os/threads_posix.c
+@@ -19,9 +19,11 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#if defined(__linux__) || defined(__OpenBSD__)
++#if defined(__linux__)
+ # include <unistd.h>
+ # include <sys/syscall.h>
++#elif defined(__OpenBSD__)
++# include <unistd.h>
+ #elif defined(__APPLE__)
+ # include <mach/mach.h>
+ #elif defined(__CYGWIN__)
+@@ -65,7 +67,7 @@ int usbi_get_tid(void)
+ #elif defined(__OpenBSD__)
+ /* The following only works with OpenBSD > 5.1 as it requires
+ real thread support. For 5.1 and earlier, -1 is returned. */
+- ret = syscall(SYS_getthrid);
++ ret = getthrid();
+ #elif defined(__APPLE__)
+ ret = mach_thread_self();
+ mach_port_deallocate(mach_task_self(), ret);
diff --git a/chromium-next/patches/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c b/chromium-next/patches/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
new file mode 100644
index 0000000000..88e84844ee
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
@@ -0,0 +1,34 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c
+@@ -120,10 +120,24 @@ static int arm_get_cpu_caps(void) {
+ return flags;
+ }
+
+-#elif defined(__linux__) // end defined(VPX_USE_ANDROID_CPU_FEATURES)
++#elif defined(__linux__) || defined(__FreeBSD__) // end defined(VPX_USE_ANDROID_CPU_FEATURES)
+
+ #include <sys/auxv.h>
+
++#if defined(__FreeBSD__)
++static unsigned long getauxval(unsigned long type)
++{
++ /* Only AT_HWCAP* return unsigned long */
++ if (type != AT_HWCAP && type != AT_HWCAP2) {
++ return 0;
++ }
++
++ unsigned long ret = 0;
++ elf_aux_info(type, &ret, sizeof(ret));
++ return ret;
++}
++#endif
++
+ // Define hwcap values ourselves: building with an old auxv header where these
+ // hwcap values are not defined should not prevent features from being enabled.
+ #define VPX_AARCH64_HWCAP_ASIMDDP (1 << 20)
diff --git a/chromium-next/patches/patch-third__party_lzma__sdk_C_CpuArch.c b/chromium-next/patches/patch-third__party_lzma__sdk_C_CpuArch.c
new file mode 100644
index 0000000000..f796f5fdcd
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_lzma__sdk_C_CpuArch.c
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/lzma_sdk/C/CpuArch.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/lzma_sdk/C/CpuArch.c
+@@ -412,12 +412,40 @@ BoolInt CPU_IsSupported_SHA1(void) { ret
+ BoolInt CPU_IsSupported_SHA2(void) { return APPLE_CRYPTO_SUPPORT_VAL; }
+ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; }
+
++#elif defined(__OpenBSD__)
++
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <machine/cpu.h>
++#include <machine/armreg.h>
++
++BoolInt CPU_IsSupported_NEON() { return 1; }
++
++#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
++ BoolInt CPU_IsSupported_ ## name1() { \
++ int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 }; \
++ size_t len = sizeof(uint64_t); \
++ uint64_t cpu_id = 0; \
++ if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) < 0) \
++ return 0; \
++ if (ID_AA64ISAR0_ ## name2(cpu_id) >= ID_AA64ISAR0_## name2 ##_BASE) \
++ return 1; \
++ return 0; \
++ }
++
++#define MY_HWCAP_CHECK_FUNC(name) \
++ MY_HWCAP_CHECK_FUNC_2(name, name)
++
++MY_HWCAP_CHECK_FUNC (CRC32)
++MY_HWCAP_CHECK_FUNC (SHA1)
++MY_HWCAP_CHECK_FUNC (SHA2)
++MY_HWCAP_CHECK_FUNC (AES)
+
+ #else // __APPLE__
+
+ #include <sys/auxv.h>
+
+-#if !defined(ARMV8_OS_FUCHSIA)
++#if !defined(ARMV8_OS_FUCHSIA) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #define USE_HWCAP
+ #endif // !defined(ARMV8_OS_FUCHSIA)
+
diff --git a/chromium-next/patches/patch-third__party_material__color__utilities_src_cpp_palettes_tones.cc b/chromium-next/patches/patch-third__party_material__color__utilities_src_cpp_palettes_tones.cc
new file mode 100644
index 0000000000..aa43c6e054
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_material__color__utilities_src_cpp_palettes_tones.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/material_color_utilities/src/cpp/palettes/tones.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/material_color_utilities/src/cpp/palettes/tones.cc
+@@ -14,6 +14,8 @@
+ * limitations under the License.
+ */
+
++#include <cmath>
++
+ #include "cpp/palettes/tones.h"
+
+ #include <cmath>
diff --git a/chromium-next/patches/patch-third__party_nasm_BUILD.gn b/chromium-next/patches/patch-third__party_nasm_BUILD.gn
new file mode 100644
index 0000000000..3c73f3e6b6
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_nasm_BUILD.gn
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/nasm/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/nasm/BUILD.gn
+@@ -63,6 +63,13 @@ config("nasm_config") {
+
+ defines = [ "HAVE_CONFIG_H" ]
+
++ _string_h_lines =
++ read_file("/usr/include/string.h", "list lines")
++ _mempcpy = filter_include(_string_h_lines, [ "*mempcpy*" ])
++ if (_mempcpy != []) {
++ defines += [ "HAVE_MEMPCPY=1" ]
++ }
++
+ if (is_clang) {
+ cflags = [
+ # The inline functions in NASM's headers flag this.
diff --git a/chromium-next/patches/patch-third__party_nasm_config_config-linux.h b/chromium-next/patches/patch-third__party_nasm_config_config-linux.h
new file mode 100644
index 0000000000..caa4948801
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_nasm_config_config-linux.h
@@ -0,0 +1,108 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/nasm/config/config-linux.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/nasm/config/config-linux.h
+@@ -160,7 +160,7 @@
+
+ /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
+ don't. */
+-#define HAVE_DECL_STRLCPY 0
++#define HAVE_DECL_STRLCPY 1
+
+ /* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you
+ don't. */
+@@ -183,7 +183,7 @@
+ #define HAVE_DECL_STRSEP 1
+
+ /* Define to 1 if you have the <endian.h> header file. */
+-#define HAVE_ENDIAN_H 1
++/* #undef HAVE_ENDIAN_H */
+
+ /* Define to 1 if you have the `faccessat' function. */
+ #define HAVE_FACCESSAT 1
+@@ -327,16 +327,16 @@
+ #define HAVE_ISASCII 1
+
+ /* Define to 1 if you have the `iscntrl' function. */
+-/* #undef HAVE_ISCNTRL */
++#define HAVE_ISCNTRL 1
+
+ /* Define to 1 if you have the <machine/endian.h> header file. */
+-/* #undef HAVE_MACHINE_ENDIAN_H */
++#define HAVE_MACHINE_ENDIAN_H 1
+
+ /* Define to 1 if you have the <memory.h> header file. */
+ #define HAVE_MEMORY_H 1
+
+ /* Define to 1 if you have the `mempcpy' function. */
+-#define HAVE_MEMPCPY 1
++/* #undef HAVE_MEMPCPY */
+
+ /* Define to 1 if you have a working `mmap' system call. */
+ #define HAVE_MMAP 1
+@@ -357,7 +357,7 @@
+ #define HAVE_STDARG_H 1
+
+ /* Define to 1 if stdbool.h conforms to C99. */
+-/* #undef HAVE_STDBOOL_H */
++#define HAVE_STDBOOL_H 1
+
+ /* Define to 1 if your compiler supports C99 extern inline */
+ #define HAVE_STDC_INLINE 1
+@@ -384,7 +384,7 @@
+ #define HAVE_STRING_H 1
+
+ /* Define to 1 if you have the `strlcpy' function. */
+-/* #undef HAVE_STRLCPY */
++#define HAVE_STRLCPY 1
+
+ /* Define to 1 if you have the `strncasecmp' function. */
+ #define HAVE_STRNCASECMP 1
+@@ -411,7 +411,7 @@
+ #define HAVE_SYSCONF 1
+
+ /* Define to 1 if you have the <sys/endian.h> header file. */
+-/* #undef HAVE_SYS_ENDIAN_H */
++#define HAVE_SYS_ENDIAN_H 1
+
+ /* Define to 1 if you have the <sys/mman.h> header file. */
+ #define HAVE_SYS_MMAN_H 1
+@@ -486,13 +486,13 @@
+ /* #undef HAVE__STATI64 */
+
+ /* Define to 1 if you have the `__bswap_16' intrinsic function. */
+-#define HAVE___BSWAP_16 1
++/* #undef HAVE___BSWAP_16 */
+
+ /* Define to 1 if you have the `__bswap_32' intrinsic function. */
+-#define HAVE___BSWAP_32 1
++/* #undef HAVE___BSWAP_32 */
+
+ /* Define to 1 if you have the `__bswap_64' intrinsic function. */
+-#define HAVE___BSWAP_64 1
++/* #undef HAVE___BSWAP_64 */
+
+ /* Define to 1 if you have the `__builtin_bswap16' intrinsic function. */
+ #define HAVE___BUILTIN_BSWAP16 1
+@@ -620,7 +620,7 @@
+ /* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+-#define restrict __restrict
++#define restrict __restrict__
+ /* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+@@ -637,7 +637,7 @@
+ /* Define if your snprintf function is not named snprintf. */
+ /* #undef snprintf */
+
+-/* Define if your typeof operator is not named typeof. */
++/* Define if your typeof operator is not named `typeof'. */
+ #define typeof __typeof
+
+ /* Define to the type of an unsigned integer type wide enough to hold a
diff --git a/chromium-next/patches/patch-third__party_node_node.gni b/chromium-next/patches/patch-third__party_node_node.gni
new file mode 100644
index 0000000000..9c54f16c0a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_node_node.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/node/node.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/node/node.gni
+@@ -22,7 +22,7 @@ template("node") {
+
+ # When use_remoteexec=true, node actions may run on remote
+ # Linux worker. So it should include linux node binary in inputs.
+- if (is_linux || is_chromeos || use_remoteexec) {
++ if ((is_linux || is_chromeos || use_remoteexec) && !is_bsd) {
+ inputs += [ "//third_party/node/linux/node-linux-x64/bin/node" ]
+ }
+ if (is_win && host_os == "win") {
diff --git a/chromium-next/patches/patch-third__party_node_node.py b/chromium-next/patches/patch-third__party_node_node.py
new file mode 100644
index 0000000000..2924d04e25
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_node_node.py
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/node/node.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/node/node.py
+@@ -21,6 +21,9 @@ def GetBinaryPath():
+ return os_path.join(os_path.dirname(__file__), *{
+ 'Darwin': (darwin_path, darwin_name, 'bin', 'node'),
+ 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
++ 'OpenBSD': ('openbsd', 'node-openbsd', 'bin', 'node'),
++ 'FreeBSD': ('freebsd', 'node-freebsd', 'bin', 'node'),
++ 'NetBSD': ('netbsd', 'node-netbsd', 'bin', 'node'),
+ 'Windows': ('win', 'node.exe'),
+ }[platform.system()])
+
diff --git a/chromium-next/patches/patch-third__party_pdfium_core_fxge_cfx__fontmapper.cpp b/chromium-next/patches/patch-third__party_pdfium_core_fxge_cfx__fontmapper.cpp
new file mode 100644
index 0000000000..e9c88eab9b
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_pdfium_core_fxge_cfx__fontmapper.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/pdfium/core/fxge/cfx_fontmapper.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/pdfium/core/fxge/cfx_fontmapper.cpp
+@@ -157,7 +157,7 @@ constexpr AltFontFamily kAltFontFamilies
+ {"ForteMT", "Forte"},
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(OS_ASMJS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(OS_ASMJS) || BUILDFLAG(IS_BSD)
+ const char kNarrowFamily[] = "LiberationSansNarrow";
+ #elif BUILDFLAG(IS_ANDROID)
+ const char kNarrowFamily[] = "RobotoCondensed";
diff --git a/chromium-next/patches/patch-third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp b/chromium-next/patches/patch-third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp
new file mode 100644
index 0000000000..ab5d3a6638
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp
+@@ -20,7 +20,7 @@
+ #include "core/fxge/fx_font.h"
+ #include "core/fxge/systemfontinfo_iface.h"
+
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !defined(OS_ASMJS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !defined(OS_ASMJS) && !BUILDFLAG(IS_BSD)
+ #error "Included on the wrong platform"
+ #endif
+
+@@ -173,9 +173,8 @@ class CLinuxPlatform : public CFX_GEModu
+ std::unique_ptr<SystemFontInfoIface> CreateDefaultSystemFontInfo() override {
+ auto pInfo = std::make_unique<CFX_LinuxFontInfo>();
+ if (!pInfo->ParseFontCfg(CFX_GEModule::Get()->GetUserFontPaths())) {
+- pInfo->AddPath("/usr/share/fonts");
+- pInfo->AddPath("/usr/share/X11/fonts/Type1");
+- pInfo->AddPath("/usr/share/X11/fonts/TTF");
++ pInfo->AddPath("/usr/X11R6/lib/X11/fonts/Type1");
++ pInfo->AddPath("/usr/X11R6/lib/X11/fonts/TTF");
+ pInfo->AddPath("/usr/local/share/fonts");
+ }
+ return pInfo;
diff --git a/chromium-next/patches/patch-third__party_pdfium_fxjs_fx__date__helpers.cpp b/chromium-next/patches/patch-third__party_pdfium_fxjs_fx__date__helpers.cpp
new file mode 100644
index 0000000000..104f63e86c
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_pdfium_fxjs_fx__date__helpers.cpp
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/pdfium/fxjs/fx_date_helpers.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/pdfium/fxjs/fx_date_helpers.cpp
+@@ -39,6 +39,11 @@ double GetLocalTZA() {
+ return 0;
+ time_t t = 0;
+ FXSYS_time(&t);
++#ifdef __FreeBSD__
++ struct tm lt;
++ localtime_r(&t, <);
++ return (double)(-(lt.tm_gmtoff * 1000));
++#else
+ FXSYS_localtime(&t);
+ #if BUILDFLAG(IS_WIN)
+ // In gcc 'timezone' is a global variable declared in time.h. In VC++, that
+@@ -47,6 +52,7 @@ double GetLocalTZA() {
+ _get_timezone(&timezone);
+ #endif
+ return (double)(-(timezone * 1000));
++#endif // __FreeBSD__
+ }
+
+ int GetDaylightSavingTA(double d) {
diff --git a/chromium-next/patches/patch-third__party_pdfium_pdfium.gni b/chromium-next/patches/patch-third__party_pdfium_pdfium.gni
new file mode 100644
index 0000000000..cb10fb34e2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_pdfium_pdfium.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/pdfium/pdfium.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/pdfium/pdfium.gni
+@@ -42,7 +42,7 @@ declare_args() {
+ # PDFium will use PartitionAlloc partitions to separate strings, scalars,
+ # etc. from other allocations. However, the use of PartitionAlloc for new or
+ # malloc is controlled by args in build_overrides/partition_alloc.gni.
+- pdf_use_partition_alloc = pdf_use_partition_alloc_override
++ pdf_use_partition_alloc = pdf_use_partition_alloc_override && use_partition_alloc_as_malloc
+
+ # Build PDFium to use Skia (experimental) for all PDFium graphics.
+ # If enabled, coexists in build with AGG graphics and the default
diff --git a/chromium-next/patches/patch-third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp b/chromium-next/patches/patch-third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp
new file mode 100644
index 0000000000..40b57697fe
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp
@@ -0,0 +1,47 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/pdfium/xfa/fxfa/parser/cxfa_timezoneprovider.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/pdfium/xfa/fxfa/parser/cxfa_timezoneprovider.cpp
+@@ -6,12 +6,16 @@
+
+ #include "xfa/fxfa/parser/cxfa_timezoneprovider.h"
+
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <time.h>
+
+ #include "build/build_config.h"
+
+ static bool g_bProviderTimeZoneSet = false;
++#if defined(OS_FREEBSD)
++static long g_lTimeZoneOffset = 0;
++#endif
+
+ #if BUILDFLAG(IS_WIN)
+ #define TIMEZONE _timezone
+@@ -24,9 +28,21 @@ static bool g_bProviderTimeZoneSet = fal
+ CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() {
+ if (!g_bProviderTimeZoneSet) {
+ g_bProviderTimeZoneSet = true;
++#if defined(OS_FREEBSD)
++ time_t now = time(nullptr);
++ struct tm tm = {};
++
++ localtime_r(&now, &tm);
++ g_lTimeZoneOffset = tm.tm_gmtoff;
++#else
+ TZSET();
++#endif
+ }
++#if defined(OS_FREEBSD)
++ tz_minutes_ = static_cast<int8_t>((abs(g_lTimeZoneOffset) % 3600) / 60);
++#else
+ tz_minutes_ = TIMEZONE / -60;
++#endif
+ }
+
+ CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() = default;
diff --git a/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_build__config.h b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_build__config.h
new file mode 100644
index 0000000000..eeb9e23a49
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_build__config.h
@@ -0,0 +1,72 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/include/perfetto/base/build_config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/include/perfetto/base/build_config.h
+@@ -27,6 +27,7 @@
+ #if defined(__ANDROID__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -38,6 +39,7 @@
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+@@ -51,9 +53,10 @@
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+ #endif
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 1
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -64,6 +67,8 @@
+ #elif defined(_WIN32)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 1
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -74,6 +79,8 @@
+ #elif defined(__EMSCRIPTEN__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+@@ -87,6 +94,8 @@
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 1
+@@ -94,6 +103,8 @@
+ #elif defined(__native_client__)
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_BSD() 0
++#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FREEBSD() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
diff --git a/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_thread__utils.h b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_thread__utils.h
new file mode 100644
index 0000000000..d1d5c174a2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_thread__utils.h
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/include/perfetto/base/thread_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/include/perfetto/base/thread_utils.h
+@@ -34,6 +34,7 @@ __declspec(dllimport) unsigned long __st
+ #include <sys/syscall.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <pthread.h>
+ #else
+ #include <pthread.h>
+ #endif
+@@ -46,6 +47,11 @@ using PlatformThreadId = pid_t;
+ inline PlatformThreadId GetThreadId() {
+ return gettid();
+ }
++#elif PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
++using PlatformThreadId = uint64_t;
++inline PlatformThreadId GetThreadId() {
++ return reinterpret_cast<uint64_t>(pthread_self());
++}
+ #elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
+ using PlatformThreadId = pid_t;
+ inline PlatformThreadId GetThreadId() {
diff --git a/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_time.h b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_time.h
new file mode 100644
index 0000000000..fda9d55c9c
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_base_time.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/include/perfetto/base/time.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/include/perfetto/base/time.h
+@@ -199,6 +199,9 @@ inline TimeNanos GetTimeInternalNs(clock
+ // Return ns from boot. Conversely to GetWallTimeNs, this clock counts also time
+ // during suspend (when supported).
+ inline TimeNanos GetBootTimeNs() {
++#if defined(__FreeBSD__) || defined(__NetBSD__)
++ return GetTimeInternalNs(kWallTimeClockSource);
++#else
+ // Determine if CLOCK_BOOTTIME is available on the first call.
+ static const clockid_t kBootTimeClockSource = [] {
+ struct timespec ts = {};
+@@ -206,6 +209,7 @@ inline TimeNanos GetBootTimeNs() {
+ return res == 0 ? CLOCK_BOOTTIME : kWallTimeClockSource;
+ }();
+ return GetTimeInternalNs(kBootTimeClockSource);
++#endif
+ }
+
+ inline TimeNanos GetWallTimeNs() {
+@@ -213,7 +217,13 @@ inline TimeNanos GetWallTimeNs() {
+ }
+
+ inline TimeNanos GetWallTimeRawNs() {
++#if defined(__OpenBSD__) || defined(__NetBSD__)
++ return GetTimeInternalNs(CLOCK_MONOTONIC);
++#elif defined(__FreeBSD__)
++ return GetTimeInternalNs(CLOCK_MONOTONIC_FAST);
++#else
+ return GetTimeInternalNs(CLOCK_MONOTONIC_RAW);
++#endif
+ }
+
+ inline TimeNanos GetThreadCPUTimeNs() {
diff --git a/chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_event__fd.h b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_event__fd.h
new file mode 100644
index 0000000000..8e833c9bf1
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_event__fd.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/include/perfetto/ext/base/event_fd.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/include/perfetto/ext/base/event_fd.h
+@@ -55,6 +55,8 @@ class EventFd {
+ // On Mac and other non-Linux UNIX platforms a pipe-based fallback is used.
+ // The write end of the wakeup pipe.
+ ScopedFile write_fd_;
++#else
++ ScopedFile write_fd_;
+ #endif
+ };
+
diff --git a/chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_thread__utils.h b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_thread__utils.h
new file mode 100644
index 0000000000..a89d51bd8e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_ext_base_thread__utils.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/include/perfetto/ext/base/thread_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -41,9 +41,10 @@
+ namespace perfetto {
+ namespace base {
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++ PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ // Sets the "comm" of the calling thread to the first 15 chars of the given
+ // string.
+ inline bool MaybeSetThreadName(const std::string& name) {
diff --git a/chromium-next/patches/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__legacy.h b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__legacy.h
new file mode 100644
index 0000000000..25ac5a1eec
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__legacy.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/include/perfetto/tracing/internal/track_event_legacy.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/include/perfetto/tracing/internal/track_event_legacy.h
+@@ -249,7 +249,7 @@ class PERFETTO_EXPORT_COMPONENT LegacyTr
+ // are different. E.g. on Mac size_t is considered a different type from
+ // uint64_t even though it has the same size and signedness.
+ // Below we add overloads for those types that are known to cause ambiguity.
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) || defined(__OpenBSD__)
+ explicit LegacyTraceId(size_t raw_id) : raw_id_(raw_id) {}
+ explicit LegacyTraceId(intptr_t raw_id)
+ : raw_id_(static_cast<uint64_t>(raw_id)) {}
diff --git a/chromium-next/patches/patch-third__party_perfetto_protos_perfetto_trace_ftrace_v4l2.proto b/chromium-next/patches/patch-third__party_perfetto_protos_perfetto_trace_ftrace_v4l2.proto
new file mode 100644
index 0000000000..dbffd57c51
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_protos_perfetto_trace_ftrace_v4l2.proto
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/protos/perfetto/trace/ftrace/v4l2.proto.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/protos/perfetto/trace/ftrace/v4l2.proto
+@@ -10,7 +10,7 @@ message V4l2QbufFtraceEvent {
+ optional uint32 field = 2;
+ optional uint32 flags = 3;
+ optional uint32 index = 4;
+- optional int32 minor = 5;
++ optional int32 gminor = 5;
+ optional uint32 sequence = 6;
+ optional uint32 timecode_flags = 7;
+ optional uint32 timecode_frames = 8;
+@@ -30,7 +30,7 @@ message V4l2DqbufFtraceEvent {
+ optional uint32 field = 2;
+ optional uint32 flags = 3;
+ optional uint32 index = 4;
+- optional int32 minor = 5;
++ optional int32 gminor = 5;
+ optional uint32 sequence = 6;
+ optional uint32 timecode_flags = 7;
+ optional uint32 timecode_frames = 8;
+@@ -48,7 +48,7 @@ message V4l2DqbufFtraceEvent {
+ message Vb2V4l2BufQueueFtraceEvent {
+ optional uint32 field = 1;
+ optional uint32 flags = 2;
+- optional int32 minor = 3;
++ optional int32 gminor = 3;
+ optional uint32 sequence = 4;
+ optional uint32 timecode_flags = 5;
+ optional uint32 timecode_frames = 6;
+@@ -65,7 +65,7 @@ message Vb2V4l2BufQueueFtraceEvent {
+ message Vb2V4l2BufDoneFtraceEvent {
+ optional uint32 field = 1;
+ optional uint32 flags = 2;
+- optional int32 minor = 3;
++ optional int32 gminor = 3;
+ optional uint32 sequence = 4;
+ optional uint32 timecode_flags = 5;
+ optional uint32 timecode_frames = 6;
+@@ -82,7 +82,7 @@ message Vb2V4l2BufDoneFtraceEvent {
+ message Vb2V4l2QbufFtraceEvent {
+ optional uint32 field = 1;
+ optional uint32 flags = 2;
+- optional int32 minor = 3;
++ optional int32 gminor = 3;
+ optional uint32 sequence = 4;
+ optional uint32 timecode_flags = 5;
+ optional uint32 timecode_frames = 6;
+@@ -99,7 +99,7 @@ message Vb2V4l2QbufFtraceEvent {
+ message Vb2V4l2DqbufFtraceEvent {
+ optional uint32 field = 1;
+ optional uint32 flags = 2;
+- optional int32 minor = 3;
++ optional int32 gminor = 3;
+ optional uint32 sequence = 4;
+ optional uint32 timecode_flags = 5;
+ optional uint32 timecode_frames = 6;
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_clock__snapshots.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_clock__snapshots.cc
new file mode 100644
index 0000000000..168d3abc93
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_clock__snapshots.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/clock_snapshots.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/clock_snapshots.cc
+@@ -26,7 +26,8 @@ ClockSnapshotVector CaptureClockSnapshot
+ ClockSnapshotVector snapshot_data;
+ #if !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) && \
+ !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+- !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ struct {
+ clockid_t id;
+ protos::pbzero::BuiltinClock type;
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_event__fd.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_event__fd.cc
new file mode 100644
index 0000000000..06edb4167c
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_event__fd.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/event_fd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/event_fd.cc
+@@ -22,7 +22,8 @@
+ #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+ #include <Windows.h>
+ #include <synchapi.h>
+-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#elif (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+ #include <sys/eventfd.h>
+ #include <unistd.h>
+@@ -57,7 +58,8 @@ void EventFd::Clear() {
+ PERFETTO_DFATAL("EventFd::Clear()");
+ }
+
+-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#elif (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+
+ EventFd::EventFd() {
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_periodic__task.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_periodic__task.cc
new file mode 100644
index 0000000000..b1dd73b339
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_periodic__task.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/periodic_task.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/periodic_task.cc
+@@ -24,7 +24,7 @@
+ #include "perfetto/base/time.h"
+ #include "perfetto/ext/base/file_utils.h"
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && __ANDROID_API__ >= 19)
+ #include <sys/timerfd.h>
+ #endif
+@@ -44,7 +44,7 @@ uint32_t GetNextDelayMs(const TimeMillis
+ }
+
+ ScopedPlatformHandle CreateTimerFd(const PeriodicTask::Args& args) {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && __ANDROID_API__ >= 19)
+ ScopedPlatformHandle tfd(
+ timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK));
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_string__utils.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_string__utils.cc
new file mode 100644
index 0000000000..7799730e15
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_string__utils.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/string_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/string_utils.cc
+@@ -38,9 +38,10 @@ namespace base {
+
+ // Locale-independant as possible version of strtod.
+ double StrToD(const char* nptr, char** endptr) {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++ PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ static auto c_locale = newlocale(LC_ALL, "C", nullptr);
+ return strtod_l(nptr, endptr, c_locale);
+ #else
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_subprocess__posix.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_subprocess__posix.cc
new file mode 100644
index 0000000000..284ce7f1bb
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_subprocess__posix.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/subprocess_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/subprocess_posix.cc
+@@ -35,7 +35,8 @@
+ #include <thread>
+ #include <tuple>
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+ #include <sys/prctl.h>
+ #endif
+@@ -64,7 +65,8 @@ struct ChildProcessArgs {
+ // Don't add any dynamic allocation in this function. This will be invoked
+ // under a fork(), potentially in a state where the allocator lock is held.
+ void __attribute__((noreturn)) ChildProcess(ChildProcessArgs* args) {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+ // In no case we want a child process to outlive its parent process. This is
+ // relevant for tests, so that a test failure/crash doesn't leave child
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_test_vm__test__utils.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_test_vm__test__utils.cc
new file mode 100644
index 0000000000..69745cdecb
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_test_vm__test__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/test/vm_test_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/test/vm_test_utils.cc
+@@ -91,7 +91,7 @@ bool IsMapped(void* start, size_t size)
+ // Fuchsia doesn't yet support paging (b/119503290).
+ ignore_result(page_size);
+ return true;
+-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
++#elif PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) || PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ // mincore isn't available on NaCL.
+ ignore_result(page_size);
+ return true;
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_thread__task__runner.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_thread__task__runner.cc
new file mode 100644
index 0000000000..c75a9451dc
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_thread__task__runner.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/thread_task_runner.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/thread_task_runner.cc
+@@ -27,8 +27,9 @@
+ #include "perfetto/ext/base/thread_utils.h"
+ #include "perfetto/ext/base/unix_task_runner.h"
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ #include <sys/prctl.h>
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_unix__socket.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_unix__socket.cc
new file mode 100644
index 0000000000..00d9c7cd89
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_unix__socket.cc
@@ -0,0 +1,46 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/unix_socket.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/unix_socket.cc
+@@ -44,7 +44,7 @@
+ #include <unistd.h>
+ #endif
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <sys/ucred.h>
+ #endif
+
+@@ -917,15 +917,27 @@ void UnixSocket::ReadPeerCredentialsPosi
+ return;
+ PERFETTO_CHECK(peer_cred_mode_ != SockPeerCredMode::kIgnore);
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
++ struct sockpeercred user_cred;
++#else
+ struct ucred user_cred;
++#endif
+ socklen_t len = sizeof(user_cred);
+ int fd = sock_raw_.fd();
+ int res = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &user_cred, &len);
+ PERFETTO_CHECK(res == 0);
+ peer_uid_ = user_cred.uid;
+ peer_pid_ = user_cred.pid;
++#elif defined(__NetBSD__)
++ struct unpcbid user_cred;
++ socklen_t len = sizeof(user_cred);
++ int fd = sock_raw_.fd();
++ int res = getsockopt(fd, 0, LOCAL_PEEREID, &user_cred, &len);
++ PERFETTO_CHECK(res == 0);
++ peer_uid_ = user_cred.unp_euid;
++ peer_pid_ = user_cred.unp_pid;
+ #elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+ struct xucred user_cred;
+ socklen_t len = sizeof(user_cred);
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_base_utils.cc b/chromium-next/patches/patch-third__party_perfetto_src_base_utils.cc
new file mode 100644
index 0000000000..1344b2efdd
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_base_utils.cc
@@ -0,0 +1,57 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/base/utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/base/utils.cc
+@@ -38,8 +38,9 @@
+ #include <mach/vm_page_size.h>
+ #endif
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ #include <sys/prctl.h>
+
+ #ifndef PR_GET_TAGGED_ADDR_CTRL
+@@ -278,14 +279,22 @@ void Daemonize(std::function<int()> pare
+
+ std::string GetCurExecutablePath() {
+ std::string self_path;
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
++ PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ char buf[PATH_MAX];
+ ssize_t size = readlink("/proc/self/exe", buf, sizeof(buf));
+ PERFETTO_CHECK(size != -1);
+ // readlink does not null terminate.
+ self_path = std::string(buf, static_cast<size_t>(size));
++#elif PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
++ char *buf;
++ const char *cpath = "@PREFIX@/lib/chromium/chrome";
++ if ((buf = getenv("CHROME_EXE_PATH")) != NULL)
++ self_path = std::string(buf);
++ else
++ self_path = std::string(cpath);
+ #elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+ uint32_t size = 0;
+ PERFETTO_CHECK(_NSGetExecutablePath(nullptr, &size));
+@@ -337,8 +346,9 @@ void AlignedFree(void* ptr) {
+ }
+
+ bool IsSyncMemoryTaggingEnabled() {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ // Compute only once per lifetime of the process.
+ static bool cached_value = [] {
+ const int res = prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0);
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_trace__processor_importers_ftrace_v4l2__tracker.cc b/chromium-next/patches/patch-third__party_perfetto_src_trace__processor_importers_ftrace_v4l2__tracker.cc
new file mode 100644
index 0000000000..b23b5fb7e9
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_trace__processor_importers_ftrace_v4l2__tracker.cc
@@ -0,0 +1,62 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/trace_processor/importers/ftrace/v4l2_tracker.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/trace_processor/importers/ftrace/v4l2_tracker.cc
+@@ -62,7 +62,7 @@ void V4l2Tracker::ParseV4l2Event(uint64_
+ case FtraceEvent::kV4l2QbufFieldNumber: {
+ V4l2QbufFtraceEvent::Decoder pb_evt(bytes.data, bytes.size);
+ BufferEvent evt;
+- evt.device_minor = pb_evt.minor();
++ evt.device_minor = pb_evt.gminor();
+ evt.index = pb_evt.index();
+ evt.type = pb_evt.type();
+ evt.bytesused = pb_evt.bytesused();
+@@ -103,7 +103,7 @@ void V4l2Tracker::ParseV4l2Event(uint64_
+ case FtraceEvent::kV4l2DqbufFieldNumber: {
+ V4l2DqbufFtraceEvent::Decoder pb_evt(bytes.data, bytes.size);
+ BufferEvent evt;
+- evt.device_minor = pb_evt.minor();
++ evt.device_minor = pb_evt.gminor();
+ evt.index = pb_evt.index();
+ evt.type = pb_evt.type();
+ evt.bytesused = pb_evt.bytesused();
+@@ -149,7 +149,7 @@ void V4l2Tracker::ParseV4l2Event(uint64_
+ case FtraceEvent::kVb2V4l2BufQueueFieldNumber: {
+ Vb2V4l2BufQueueFtraceEvent::Decoder pb_evt(bytes.data, bytes.size);
+ BufferEvent evt;
+- evt.device_minor = pb_evt.minor();
++ evt.device_minor = pb_evt.gminor();
+ evt.index = std::nullopt;
+ evt.type = std::nullopt;
+ evt.bytesused = std::nullopt;
+@@ -180,7 +180,7 @@ void V4l2Tracker::ParseV4l2Event(uint64_
+ case FtraceEvent::kVb2V4l2BufDoneFieldNumber: {
+ Vb2V4l2BufDoneFtraceEvent::Decoder pb_evt(bytes.data, bytes.size);
+ BufferEvent evt;
+- evt.device_minor = pb_evt.minor();
++ evt.device_minor = pb_evt.gminor();
+ evt.index = std::nullopt;
+ evt.type = std::nullopt;
+ evt.bytesused = std::nullopt;
+@@ -211,7 +211,7 @@ void V4l2Tracker::ParseV4l2Event(uint64_
+ case FtraceEvent::kVb2V4l2QbufFieldNumber: {
+ Vb2V4l2QbufFtraceEvent::Decoder pb_evt(bytes.data, bytes.size);
+ BufferEvent evt;
+- evt.device_minor = pb_evt.minor();
++ evt.device_minor = pb_evt.gminor();
+ evt.index = std::nullopt;
+ evt.type = std::nullopt;
+ evt.bytesused = std::nullopt;
+@@ -242,7 +242,7 @@ void V4l2Tracker::ParseV4l2Event(uint64_
+ case FtraceEvent::kVb2V4l2DqbufFieldNumber: {
+ Vb2V4l2DqbufFtraceEvent::Decoder pb_evt(bytes.data, bytes.size);
+ BufferEvent evt;
+- evt.device_minor = pb_evt.minor();
++ evt.device_minor = pb_evt.gminor();
+ evt.index = std::nullopt;
+ evt.type = std::nullopt;
+ evt.bytesused = std::nullopt;
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_tracing_ipc_memfd.cc b/chromium-next/patches/patch-third__party_perfetto_src_tracing_ipc_memfd.cc
new file mode 100644
index 0000000000..37b4f61d33
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_tracing_ipc_memfd.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/tracing/ipc/memfd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/tracing/ipc/memfd.cc
+@@ -20,7 +20,8 @@
+
+ #define PERFETTO_MEMFD_ENABLED() \
+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
++ (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD))
+
+ #if PERFETTO_MEMFD_ENABLED()
+
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_tracing_platform__posix.cc b/chromium-next/patches/patch-third__party_perfetto_src_tracing_platform__posix.cc
new file mode 100644
index 0000000000..47fcb223ae
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_tracing_platform__posix.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/tracing/platform_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/tracing/platform_posix.cc
+@@ -110,12 +110,13 @@ std::unique_ptr<base::TaskRunner> Platfo
+ }
+
+ std::string PlatformPosix::GetCurrentProcessName() {
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ std::string cmdline;
+ base::ReadFile("/proc/self/cmdline", &cmdline);
+ return cmdline.substr(0, cmdline.find('\0'));
+-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
++#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) || PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ return std::string(getprogname());
+ #else
+ return "unknown_producer";
diff --git a/chromium-next/patches/patch-third__party_perfetto_src_tracing_track.cc b/chromium-next/patches/patch-third__party_perfetto_src_tracing_track.cc
new file mode 100644
index 0000000000..7282642c72
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_perfetto_src_tracing_track.cc
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/perfetto/src/tracing/track.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/perfetto/src/tracing/track.cc
+@@ -60,8 +60,9 @@ protos::gen::TrackDescriptor ProcessTrac
+ auto desc = Track::Serialize();
+ auto pd = desc.mutable_process();
+ pd->set_pid(static_cast<int32_t>(pid));
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
++ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)) && \
++ !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ std::string cmdline;
+ if (base::ReadFile("/proc/self/cmdline", &cmdline)) {
+ // Since cmdline is a zero-terminated list of arguments, this ends up
+@@ -170,7 +171,7 @@ namespace internal {
+ namespace {
+
+ uint64_t GetProcessStartTime() {
+-#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
++#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && !PERFETTO_BUILDFLAG(PERFETTO_OS_BSD)
+ std::string stat;
+ if (!base::ReadFile("/proc/self/stat", &stat))
+ return 0u;
diff --git a/chromium-next/patches/patch-third__party_protobuf_src_google_protobuf_stubs_platform__macros.h b/chromium-next/patches/patch-third__party_protobuf_src_google_protobuf_stubs_platform__macros.h
new file mode 100644
index 0000000000..1dd142759b
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_protobuf_src_google_protobuf_stubs_platform__macros.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/protobuf/src/google/protobuf/stubs/platform_macros.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/protobuf/src/google/protobuf/stubs/platform_macros.h
+@@ -122,7 +122,7 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR
+
+ #undef GOOGLE_PROTOBUF_PLATFORM_ERROR
+
+-#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE)
++#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) || defined(__OpenBSD__)
+ // Android ndk does not support the __thread keyword very well yet. Here
+ // we use pthread_key_create()/pthread_getspecific()/... methods for
+ // TLS support on android.
diff --git a/chromium-next/patches/patch-third__party_skia_src_gpu_ganesh_GrAutoLocaleSetter.h b/chromium-next/patches/patch-third__party_skia_src_gpu_ganesh_GrAutoLocaleSetter.h
new file mode 100644
index 0000000000..79a6e7d01f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_skia_src_gpu_ganesh_GrAutoLocaleSetter.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/skia/src/gpu/ganesh/GrAutoLocaleSetter.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/skia/src/gpu/ganesh/GrAutoLocaleSetter.h
+@@ -27,7 +27,7 @@
+ #define HAVE_XLOCALE 0
+ #endif
+
+-#if defined(SK_BUILD_FOR_ANDROID) || defined(__UCLIBC__) || defined(_NEWLIB_VERSION)
++#if defined(SK_BUILD_FOR_ANDROID) || defined(__UCLIBC__) || defined(_NEWLIB_VERSION) || defined(__NetBSD__)
+ #define HAVE_LOCALE_T 0
+ #else
+ #define HAVE_LOCALE_T 1
diff --git a/chromium-next/patches/patch-third__party_skia_src_ports_SkMemory__malloc.cpp b/chromium-next/patches/patch-third__party_skia_src_ports_SkMemory__malloc.cpp
new file mode 100644
index 0000000000..e4af2450f4
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_skia_src_ports_SkMemory__malloc.cpp
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/skia/src/ports/SkMemory_malloc.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/skia/src/ports/SkMemory_malloc.cpp
+@@ -15,7 +15,8 @@
+
+ #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+ #include <malloc/malloc.h>
+-#elif defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_UNIX)
++#elif defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_UNIX) && !defined(__OpenBSD__) && \
++ !defined(__NetBSD__)
+ #include <malloc.h>
+ #elif defined(SK_BUILD_FOR_WIN)
+ #include <malloc.h>
+@@ -126,7 +127,7 @@ size_t sk_malloc_size(void* addr, size_t
+ #elif defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 17
+ completeSize = malloc_usable_size(addr);
+ SkASSERT(completeSize >= size);
+- #elif defined(SK_BUILD_FOR_UNIX)
++ #elif defined(SK_BUILD_FOR_UNIX) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+ completeSize = malloc_usable_size(addr);
+ SkASSERT(completeSize >= size);
+ #elif defined(SK_BUILD_FOR_WIN)
diff --git a/chromium-next/patches/patch-third__party_skia_src_ports_SkOSFile__posix.cpp b/chromium-next/patches/patch-third__party_skia_src_ports_SkOSFile__posix.cpp
new file mode 100644
index 0000000000..5d16c48ca6
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_skia_src_ports_SkOSFile__posix.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/skia/src/ports/SkOSFile_posix.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/skia/src/ports/SkOSFile_posix.cpp
+@@ -25,7 +25,7 @@
+ #endif
+
+ void sk_fsync(FILE* f) {
+-#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) && !defined(_NEWLIB_VERSION)
++#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) && !defined(_NEWLIB_VERSION) && !defined(__OpenBSD__)
+ int fd = fileno(f);
+ fsync(fd);
+ #endif
diff --git a/chromium-next/patches/patch-third__party_speech-dispatcher_libspeechd__version.h b/chromium-next/patches/patch-third__party_speech-dispatcher_libspeechd__version.h
new file mode 100644
index 0000000000..13c956680d
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_speech-dispatcher_libspeechd__version.h
@@ -0,0 +1,38 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/speech-dispatcher/libspeechd_version.h.orig 2025-01-20 18:01:27.973273679 +0000
++++ third_party/speech-dispatcher/libspeechd_version.h
+@@ -0,0 +1,29 @@
++/*
++ * libspeechd_version.h - Shared library for easy access to Speech Dispatcher functions (header)
++ *
++ * Copyright (C) 2001, 2002, 2003, 2004 Brailcom, o.p.s.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as published by
++ * the Free Software Foundation; either version 2.1, or (at your option)
++ * any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * along with this program. If not, see <https://www.gnu.org/licenses/>.
++ *
++ * Id: patch-third_party_speech-dispatcher_libspeechd_version_h,v 1.4 2024/03/22 13:10:56 robert
++ */
++
++#ifndef _LIBSPEECHD_VERSION_H
++#define _LIBSPEECHD_VERSION_H
++
++#define LIBSPEECHD_MAJOR_VERSION 0
++#define LIBSPEECHD_MINOR_VERSION 11
++#define LIBSPEECHD_MICRO_VERSION 5
++
++#endif /* ifndef _LIBSPEECHD_VERSION_H */
diff --git a/chromium-next/patches/patch-third__party_speech-dispatcher_speechd__types.h b/chromium-next/patches/patch-third__party_speech-dispatcher_speechd__types.h
new file mode 100644
index 0000000000..b7612b350a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_speech-dispatcher_speechd__types.h
@@ -0,0 +1,148 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/speech-dispatcher/speechd_types.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/speech-dispatcher/speechd_types.h
+@@ -119,4 +119,139 @@ typedef struct {
+ SPDVoice voice;
+ } SPDMsgSettings;
+
++/* TEMP_FAILURE_RETRY seems to be available only on Linux. For systems that
++ * don't have this macro we provide our own version. This code was taken from
++ * file "/usr/include/unistd.h" from Debian package "libc6-dev"
++ * version 2.3.2.ds1-20. */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
++#endif /* not ifndef SPEECHD_TYPES */
++
++/*
++ * speechd_types.h - types for Speech Dispatcher
++ *
++ * Copyright (C) 2001, 2002, 2003 Brailcom, o.p.s.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as published by
++ * the Free Software Foundation; either version 2.1, or (at your option)
++ * any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * along with this program. If not, see <https://www.gnu.org/licenses/>.
++ */
++
++#ifndef SPEECHD_TYPES_H
++#define SPEECHD_TYPES_H
++
++typedef enum {
++ SPD_PUNCT_ALL = 0,
++ SPD_PUNCT_NONE = 1,
++ SPD_PUNCT_SOME = 2,
++ SPD_PUNCT_MOST = 3
++} SPDPunctuation;
++
++typedef enum {
++ SPD_CAP_NONE = 0,
++ SPD_CAP_SPELL = 1,
++ SPD_CAP_ICON = 2
++} SPDCapitalLetters;
++
++typedef enum {
++ SPD_SPELL_OFF = 0,
++ SPD_SPELL_ON = 1
++} SPDSpelling;
++
++typedef enum {
++ SPD_MALE1 = 1,
++ SPD_MALE2 = 2,
++ SPD_MALE3 = 3,
++ SPD_FEMALE1 = 4,
++ SPD_FEMALE2 = 5,
++ SPD_FEMALE3 = 6,
++ SPD_CHILD_MALE = 7,
++ SPD_CHILD_FEMALE = 8,
++ SPD_UNSPECIFIED = -1
++} SPDVoiceType;
++
++typedef struct {
++ char *name; /* Name of the voice (id) */
++ char *language; /* 2/3-letter ISO language code,
++ * possibly followed by 2/3-letter ISO region code,
++ * e.g. en-US */
++ char *variant; /* a not-well defined string describing dialect etc. */
++} SPDVoice;
++
++typedef enum {
++ SPD_DATA_TEXT = 0,
++ SPD_DATA_SSML = 1
++} SPDDataMode;
++
++typedef enum {
++ SPD_IMPORTANT = 1,
++ SPD_MESSAGE = 2,
++ SPD_TEXT = 3,
++ SPD_NOTIFICATION = 4,
++ SPD_PROGRESS = 5
++} SPDPriority;
++
++typedef enum {
++ SPD_BEGIN = 1,
++ SPD_END = 2,
++ SPD_INDEX_MARKS = 4,
++ SPD_CANCEL = 8,
++ SPD_PAUSE = 16,
++ SPD_RESUME = 32,
++
++ SPD_ALL = 0x3f
++} SPDNotification;
++
++typedef enum {
++ SPD_EVENT_BEGIN,
++ SPD_EVENT_END,
++ SPD_EVENT_INDEX_MARK,
++ SPD_EVENT_CANCEL,
++ SPD_EVENT_PAUSE,
++ SPD_EVENT_RESUME
++} SPDNotificationType;
++
++typedef enum {
++ SORT_BY_TIME = 0,
++ SORT_BY_ALPHABET = 1
++} ESort;
++
++typedef enum {
++ SPD_MSGTYPE_TEXT = 0,
++ SPD_MSGTYPE_SOUND_ICON = 1,
++ SPD_MSGTYPE_CHAR = 2,
++ SPD_MSGTYPE_KEY = 3,
++ SPD_MSGTYPE_SPELL = 99
++} SPDMessageType;
++
++typedef struct {
++ signed int rate;
++ signed int pitch;
++ signed int pitch_range;
++ signed int volume;
++
++ SPDPunctuation punctuation_mode;
++ SPDSpelling spelling_mode;
++ SPDCapitalLetters cap_let_recogn;
++
++ SPDVoiceType voice_type;
++ SPDVoice voice;
++} SPDMsgSettings;
++
+ #endif /* not ifndef SPEECHD_TYPES */
diff --git a/chromium-next/patches/patch-third__party_sqlite_BUILD.gn b/chromium-next/patches/patch-third__party_sqlite_BUILD.gn
new file mode 100644
index 0000000000..c2b640bc92
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_sqlite_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/sqlite/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/sqlite/BUILD.gn
+@@ -142,7 +142,7 @@ config("sqlite_warnings") {
+ ]
+ }
+ }
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ cflags += [
+ # SQLite doesn't believe in compiler warnings, preferring testing.
+ # http://www.sqlite.org/faq.html#q17
diff --git a/chromium-next/patches/patch-third__party_sqlite_src_amalgamation__dev_sqlite3.c b/chromium-next/patches/patch-third__party_sqlite_src_amalgamation__dev_sqlite3.c
new file mode 100644
index 0000000000..a0887d3b34
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_sqlite_src_amalgamation__dev_sqlite3.c
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/sqlite/src/amalgamation_dev/sqlite3.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/sqlite/src/amalgamation_dev/sqlite3.c
+@@ -20646,6 +20646,9 @@ SQLITE_PRIVATE int sqlite3HeapNearlyFull
+ ** The alloca() routine never returns NULL. This will cause code paths
+ ** that deal with sqlite3StackAlloc() failures to be unreachable.
+ */
++#if defined(__NetBSD__)
++# undef SQLITE_USE_ALLOCA
++#endif
+ #ifdef SQLITE_USE_ALLOCA
+ # define sqlite3StackAllocRaw(D,N) alloca(N)
+ # define sqlite3StackAllocRawNN(D,N) alloca(N)
diff --git a/chromium-next/patches/patch-third__party_sqlite_src_amalgamation_sqlite3.c b/chromium-next/patches/patch-third__party_sqlite_src_amalgamation_sqlite3.c
new file mode 100644
index 0000000000..86d812d66a
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_sqlite_src_amalgamation_sqlite3.c
@@ -0,0 +1,47 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/sqlite/src/amalgamation/sqlite3.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/sqlite/src/amalgamation/sqlite3.c
+@@ -14187,7 +14187,7 @@ struct fts5_api {
+ ** But _XOPEN_SOURCE define causes problems for Mac OS X, so omit
+ ** it.
+ */
+-#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__)
++#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && !defined(__FreeBSD__)
+ # define _XOPEN_SOURCE 600
+ #endif
+
+@@ -20633,6 +20633,9 @@ SQLITE_PRIVATE int sqlite3HeapNearlyFull
+ ** The alloca() routine never returns NULL. This will cause code paths
+ ** that deal with sqlite3StackAlloc() failures to be unreachable.
+ */
++#if defined(__NetBSD__)
++# undef SQLITE_USE_ALLOCA
++#endif
+ #ifdef SQLITE_USE_ALLOCA
+ # define sqlite3StackAllocRaw(D,N) alloca(N)
+ # define sqlite3StackAllocRawNN(D,N) alloca(N)
+@@ -45183,6 +45186,11 @@ static int unixRandomness(sqlite3_vfs *N
+ memset(zBuf, 0, nBuf);
+ randomnessPid = osGetpid(0);
+ #if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS)
++#if defined(__OpenBSD__)
++ {
++ arc4random_buf(zBuf, nBuf);
++ }
++#else
+ {
+ int fd, got;
+ fd = robust_open("/dev/urandom", O_RDONLY, 0);
+@@ -45199,6 +45207,7 @@ static int unixRandomness(sqlite3_vfs *N
+ }
+ }
+ #endif
++#endif
+ return nBuf;
+ }
+
diff --git a/chromium-next/patches/patch-third__party_swiftshader_src_Reactor_Debug.cpp b/chromium-next/patches/patch-third__party_swiftshader_src_Reactor_Debug.cpp
new file mode 100644
index 0000000000..e1e00efaee
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_src_Reactor_Debug.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/src/Reactor/Debug.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/src/Reactor/Debug.cpp
+@@ -46,7 +46,8 @@ namespace {
+
+ bool IsUnderDebugger()
+ {
+-#if defined(PTRACE) && !defined(__APPLE__) && !defined(__MACH__)
++#if defined(PTRACE) && !defined(__APPLE__) && !defined(__MACH__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
++ !defined(__NetBSD__)
+ static bool checked = false;
+ static bool res = false;
+
diff --git a/chromium-next/patches/patch-third__party_swiftshader_src_System_Configurator.cpp b/chromium-next/patches/patch-third__party_swiftshader_src_System_Configurator.cpp
new file mode 100644
index 0000000000..8e408f0253
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_src_System_Configurator.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/src/System/Configurator.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/src/System/Configurator.cpp
+@@ -38,6 +38,9 @@ namespace sw {
+
+ Configurator::Configurator(const std::string &filePath)
+ {
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++ return;
++#endif
+ std::fstream file(filePath, std::ios::in);
+ if(file.fail())
+ {
diff --git a/chromium-next/patches/patch-third__party_swiftshader_src_System_Linux_MemFd.cpp b/chromium-next/patches/patch-third__party_swiftshader_src_System_Linux_MemFd.cpp
new file mode 100644
index 0000000000..357f6125ca
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_src_System_Linux_MemFd.cpp
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/src/System/Linux/MemFd.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/src/System/Linux/MemFd.cpp
+@@ -25,6 +25,7 @@
+ # define MFD_CLOEXEC 0x0001U
+ #endif
+
++#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #if __aarch64__
+ # define __NR_memfd_create 279
+ #elif __arm__
+@@ -36,6 +37,7 @@
+ #elif __x86_64__
+ # define __NR_memfd_create 319
+ #endif /* __NR_memfd_create__ */
++#endif
+
+ LinuxMemFd::~LinuxMemFd()
+ {
+@@ -63,13 +65,17 @@ bool LinuxMemFd::allocate(const char *na
+ {
+ close();
+
+-#ifndef __NR_memfd_create
++#if !defined(__NR_memfd_create) || defined(__OpenBSD__)
+ TRACE("memfd_create() not supported on this system!");
+ return false;
+ #else
+ // In the event of no system call this returns -1 with errno set
+ // as ENOSYS.
++#if defined(__FreeBSD__) || defined(__NetBSD__)
++ fd_ = memfd_create(name, MFD_CLOEXEC);
++#else
+ fd_ = syscall(__NR_memfd_create, name, MFD_CLOEXEC);
++#endif
+ if(fd_ < 0)
+ {
+ TRACE("memfd_create() returned %d: %s", errno, strerror(errno));
diff --git a/chromium-next/patches/patch-third__party_swiftshader_src_Vulkan_VkSemaphoreExternalLinux.hpp b/chromium-next/patches/patch-third__party_swiftshader_src_Vulkan_VkSemaphoreExternalLinux.hpp
new file mode 100644
index 0000000000..e122be53c1
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_src_Vulkan_VkSemaphoreExternalLinux.hpp
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/src/Vulkan/VkSemaphoreExternalLinux.hpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/src/Vulkan/VkSemaphoreExternalLinux.hpp
+@@ -49,13 +49,17 @@ public:
+ {
+ pthread_mutexattr_t mattr;
+ pthread_mutexattr_init(&mattr);
++#if 0
+ pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED);
++#endif
+ pthread_mutex_init(&mutex, &mattr);
+ pthread_mutexattr_destroy(&mattr);
+
+ pthread_condattr_t cattr;
+ pthread_condattr_init(&cattr);
++#if 0
+ pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED);
++#endif
+ pthread_cond_init(&cond, &cattr);
+ pthread_condattr_destroy(&cattr);
+ }
diff --git a/chromium-next/patches/patch-third__party_swiftshader_src_WSI_libXCB.cpp b/chromium-next/patches/patch-third__party_swiftshader_src_WSI_libXCB.cpp
new file mode 100644
index 0000000000..8164364974
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_src_WSI_libXCB.cpp
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/src/WSI/libXCB.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/src/WSI/libXCB.cpp
+@@ -57,7 +57,7 @@ LibXcbExports *LibXCB::loadExports()
+ }
+ else
+ {
+- libxcb = loadLibrary("libxcb.so.1");
++ libxcb = loadLibrary("libxcb.so");
+ }
+
+ if(getProcAddress(RTLD_DEFAULT, "xcb_shm_query_version")) // Search the global scope for pre-loaded XCB library.
+@@ -66,7 +66,7 @@ LibXcbExports *LibXCB::loadExports()
+ }
+ else
+ {
+- libshm = loadLibrary("libxcb-shm.so.0");
++ libshm = loadLibrary("libxcb-shm.so");
+ }
+
+ return LibXcbExports(libxcb, libshm);
diff --git a/chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h b/chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h
new file mode 100644
index 0000000000..7a8dddc8b3
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h
@@ -0,0 +1,180 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h
+@@ -29,7 +29,7 @@
+
+ /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
+ don't. */
+-#define HAVE_DECL_ARC4RANDOM 0
++#define HAVE_DECL_ARC4RANDOM 1
+
+ /* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you
+ don't. */
+@@ -53,7 +53,7 @@
+ #define HAVE_DLOPEN 1
+
+ /* Define if dladdr() is available on this platform. */
+-/* #undef HAVE_DLADDR */
++#define HAVE_DLADDR 1
+
+ /* Define to 1 if you have the <errno.h> header file. */
+ #define HAVE_ERRNO_H 1
+@@ -92,7 +92,7 @@
+ #define HAVE_ISATTY 1
+
+ /* Define to 1 if you have the `edit' library (-ledit). */
+-/* #undef HAVE_LIBEDIT */
++#define HAVE_LIBEDIT 1
+
+ /* Define to 1 if you have the `pfm' library (-lpfm). */
+ /* #undef HAVE_LIBPFM */
+@@ -110,13 +110,13 @@
+ /* #undef HAVE_PTHREAD_SETNAME_NP */
+
+ /* Define to 1 if you have the `z' library (-lz). */
+-/* #undef HAVE_LIBZ */
++#define HAVE_LIBZ 1
+
+ /* Define to 1 if you have the <link.h> header file. */
+-#define HAVE_LINK_H 1
++/* #undef HAVE_LINK_H */
+
+ /* Define to 1 if you have the `lseek64' function. */
+-#define HAVE_LSEEK64 1
++/* #undef HAVE_LSEEK64 */
+
+ /* Define to 1 if you have the <mach/mach.h> header file. */
+ /* #undef HAVE_MACH_MACH_H */
+@@ -125,7 +125,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc/malloc.h> header file. */
+ /* #undef HAVE_MALLOC_MALLOC_H */
+@@ -134,10 +134,10 @@
+ /* #undef HAVE_MALLOC_ZONE_STATISTICS */
+
+ /* Define to 1 if you have the `posix_fallocate' function. */
+-#define HAVE_POSIX_FALLOCATE 1
++/* #undef HAVE_POSIX_FALLOCATE */
+
+ /* Define to 1 if you have the `posix_spawn' function. */
+-/* #undef HAVE_POSIX_SPAWN */
++#define HAVE_POSIX_SPAWN 1
+
+ /* Define to 1 if you have the `pread' function. */
+ #define HAVE_PREAD 1
+@@ -161,10 +161,10 @@
+ #define HAVE_SETENV 1
+
+ /* Define to 1 if you have the `sched_getaffinity' function. */
+-#define HAVE_SCHED_GETAFFINITY 1
++/* #undef HAVE_SCHED_GETAFFINITY */
+
+ /* Define to 1 if you have the `CPU_COUNT' macro. */
+-#define HAVE_CPU_COUNT 1
++/* #undef HAVE_CPU_COUNT */
+
+ /* Define to 1 if you have the `setrlimit' function. */
+ #define HAVE_SETRLIMIT 1
+@@ -182,7 +182,7 @@
+ #define HAVE_STRERROR_R 1
+
+ /* Define to 1 if you have the `sysconf' function. */
+-#define HAVE_SYSCONF 1
++/* #undef HAVE_SYSCONF */
+
+ /* Define to 1 if you have the <sys/ioctl.h> header file. */
+ #define HAVE_SYS_IOCTL_H 1
+@@ -209,7 +209,7 @@
+ #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+
+ /* Define to 1 if you have the <sys/types.h> header file. */
+-#define HAVE_SYS_TYPES_H 1
++/* #undef HAVE_SYS_TYPES_H */
+
+ /* Define if the setupterm() function is supported this platform. */
+ /* #undef HAVE_TERMINFO */
+@@ -218,16 +218,16 @@
+ /* #undef HAVE_LIBXAR */
+
+ /* Define to 1 if you have the <termios.h> header file. */
+-/* #undef HAVE_TERMIOS_H */
++#define HAVE_TERMIOS_H 1
+
+ /* Define to 1 if you have the <unistd.h> header file. */
+ #define HAVE_UNISTD_H 1
+
+ /* Define to 1 if you have the <valgrind/valgrind.h> header file. */
+-/* #undef HAVE_VALGRIND_VALGRIND_H */
++/* #define HAVE_VALGRIND_VALGRIND_H 1 */
+
+ /* Define to 1 if you have the <zlib.h> header file. */
+-/* #undef HAVE_ZLIB_H */
++#define HAVE_ZLIB_H 1
+
+ /* Have host's _alloca */
+ /* #undef HAVE__ALLOCA */
+@@ -292,30 +292,8 @@
+ /* Linker version detected at compile time. */
+ /* #undef HOST_LINK_VERSION */
+
+-/* Target triple LLVM will generate code for by default */
+-/* Doesn't use `cmakedefine` because it is allowed to be empty. */
+-#if defined(__x86_64__)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-unknown-linux-gnu"
+-#elif defined(__i386__)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "i686-pc-linux-gnu"
+-#elif defined(__arm__)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf"
+-#elif defined(__aarch64__)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu"
+-#elif defined(__mips__)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "mipsel-linux-gnu"
+-#elif defined(__mips64)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "mips64el-linux-gnuabi64"
+-#elif defined(__powerpc64__)
+-#define LLVM_DEFAULT_TARGET_TRIPLE "powerpc64le-unknown-linux-gnu"
+-#elif defined(__riscv) && __riscv_xlen == 64
+-#define LLVM_DEFAULT_TARGET_TRIPLE "riscv64-unknown-linux-gnu"
+-#else
+-#error "unknown architecture"
+-#endif
+-
+ /* Define if zlib compression is available */
+-#define LLVM_ENABLE_ZLIB 0
++/* #define LLVM_ENABLE_ZLIB 1 */
+
+ /* Define if overriding target triple is enabled */
+ /* #undef LLVM_TARGET_TRIPLE_ENV */
+@@ -339,10 +317,10 @@
+ #define PACKAGE_NAME "LLVM"
+
+ /* Define to the full name and version of this package. */
+-#define PACKAGE_STRING "LLVM 10.0.0"
++#define PACKAGE_STRING "LLVM 11.1.0"
+
+ /* Define to the version of this package. */
+-#define PACKAGE_VERSION "10.0.0"
++#define PACKAGE_VERSION "11.1.0"
+
+ /* Define to the vendor of this package. */
+ /* #undef PACKAGE_VENDOR */
+@@ -362,9 +340,6 @@
+ /* Whether GlobalISel rule coverage is being collected */
+ #define LLVM_GISEL_COV_ENABLED 0
+
+-/* Define if we have z3 and want to build it */
+-#define LLVM_WITH_Z3 1
+-
+ /* Define to the default GlobalISel coverage file prefix */
+ /* #undef LLVM_GISEL_COV_PREFIX */
+
diff --git a/chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-subzero_build_Linux_include_llvm_Config_config.h b/chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-subzero_build_Linux_include_llvm_Config_config.h
new file mode 100644
index 0000000000..1a6c8245fb
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_third__party_llvm-subzero_build_Linux_include_llvm_Config_config.h
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -5,8 +5,6 @@
+ #include "llvm/Config/llvm-config.h"
+
+ /* For detecting __GLIBC__ usage */
+-#include <features.h>
+-
+ /* Bug report URL. */
+ #define BUG_REPORT_URL "http://llvm.org/bugs/"
+
+@@ -27,7 +25,7 @@
+
+ /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
+ don't. */
+-#define HAVE_DECL_ARC4RANDOM 0
++#define HAVE_DECL_ARC4RANDOM 1
+
+ /* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you
+ don't. */
+@@ -124,7 +122,7 @@
+ #define HAVE_LINK_H 1
+
+ /* Define to 1 if you have the `lseek64' function. */
+-#define HAVE_LSEEK64 1
++/* #define HAVE_LSEEK64 */
+
+ /* Define to 1 if you have the <mach/mach.h> header file. */
+ /* #undef HAVE_MACH_MACH_H */
+@@ -133,7 +131,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #define HAVE_MALLINFO */
+
+ /* Some projects using SwiftShader bypass cmake (eg Chromium via gn) */
+ /* so we need to check glibc version for the new API to be safe */
+@@ -163,7 +161,7 @@
+ /* #undef HAVE_NDIR_H */
+
+ /* Define to 1 if you have the `posix_fallocate' function. */
+-#define HAVE_POSIX_FALLOCATE 1
++/* #define HAVE_POSIX_FALLOCATE */
+
+ /* Define to 1 if you have the `posix_spawn' function. */
+ #define HAVE_POSIX_SPAWN 1
diff --git a/chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_memory.cpp b/chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_memory.cpp
new file mode 100644
index 0000000000..c0f8d043be
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_memory.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/third_party/marl/src/memory.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/third_party/marl/src/memory.cpp
+@@ -19,7 +19,8 @@
+
+ #include <cstring>
+
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__EMSCRIPTEN__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__EMSCRIPTEN__) || defined(__OpenBSD__) || \
++ defined(__NetBSD__)
+ #include <sys/mman.h>
+ #include <unistd.h>
+ namespace {
diff --git a/chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_thread.cpp b/chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_thread.cpp
new file mode 100644
index 0000000000..06f78a3bd1
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_swiftshader_third__party_marl_src_thread.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/swiftshader/third_party/marl/src/thread.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/swiftshader/third_party/marl/src/thread.cpp
+@@ -46,6 +46,9 @@
+ #include <unistd.h>
+ #include <thread>
+ #endif
++#if defined(__NetBSD__)
++#include <stdarg.h>
++#endif
+
+ namespace {
+
+@@ -444,7 +447,9 @@ void Thread::setName(const char* fmt, ..
+ pthread_setname_np(name);
+ #elif defined(__FreeBSD__)
+ pthread_set_name_np(pthread_self(), name);
+-#elif !defined(__Fuchsia__) && !defined(__EMSCRIPTEN__)
++#elif defined(__NetBSD__)
++ pthread_setname_np(pthread_self(), "%s", (void *)name);
++#elif !defined(__Fuchsia__) && !defined(__EMSCRIPTEN__) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
+ pthread_setname_np(pthread_self(), name);
+ #endif
+
diff --git a/chromium-next/patches/patch-third__party_test__fonts_fontconfig_BUILD.gn b/chromium-next/patches/patch-third__party_test__fonts_fontconfig_BUILD.gn
new file mode 100644
index 0000000000..152f8e1b58
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_test__fonts_fontconfig_BUILD.gn
@@ -0,0 +1,34 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/test_fonts/fontconfig/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/test_fonts/fontconfig/BUILD.gn
+@@ -26,7 +26,11 @@ if (is_linux || is_chromeos) {
+
+ copy("fonts_conf") {
+ sources = [ "fonts.conf" ]
+- outputs = [ "$root_out_dir/etc/fonts/{{source_file_part}}" ]
++ if (is_freebsd) {
++ outputs = [ "$root_out_dir/usr/local/etc/fonts/{{source_file_part}}" ]
++ } else {
++ outputs = [ "$root_out_dir/etc/fonts/{{source_file_part}}" ]
++ }
+ }
+
+ if (current_toolchain == host_toolchain) {
+@@ -47,7 +51,11 @@ if (is_linux || is_chromeos) {
+ "//third_party/test_fonts",
+ ]
+ args = []
+- inputs = [ "$root_out_dir/etc/fonts/fonts.conf" ]
++ if (is_freebsd) {
++ inputs = [ "$root_out_dir/usr/local/etc/fonts/fonts.conf" ]
++ } else {
++ inputs = [ "$root_out_dir/etc/fonts/fonts.conf" ]
++ }
+ outputs = [
+ "$root_out_dir/fontconfig_caches/fb5c91b2895aa445d23aebf7f9e2189c-le64.cache-9",
+ "$root_out_dir/fontconfig_caches/CACHEDIR.TAG",
diff --git a/chromium-next/patches/patch-third__party_test__fonts_fontconfig_fontconfig__util__linux.cc b/chromium-next/patches/patch-third__party_test__fonts_fontconfig_fontconfig__util__linux.cc
new file mode 100644
index 0000000000..d0cbb3eddd
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_test__fonts_fontconfig_fontconfig__util__linux.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/test_fonts/fontconfig/fontconfig_util_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/test_fonts/fontconfig/fontconfig_util_linux.cc
+@@ -2,6 +2,8 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+
++#include "build/build_config.h"
++
+ #include "third_party/test_fonts/fontconfig/fontconfig_util_linux.h"
+
+ #include <fontconfig/fontconfig.h>
+@@ -16,11 +18,15 @@
+ namespace test_fonts {
+
+ std::string GetSysrootDir() {
++#if BUILDFLAG(IS_BSD)
++ return std::string(".");
++#else
+ char buf[PATH_MAX + 1];
+ auto count = readlink("/proc/self/exe", buf, PATH_MAX);
+ assert(count > 0);
+ buf[count] = '\0';
+ return dirname(buf);
++#endif
+ }
+
+ void SetUpFontconfig() {
diff --git a/chromium-next/patches/patch-third__party_test__fonts_fontconfig_generate__fontconfig__caches.cc b/chromium-next/patches/patch-third__party_test__fonts_fontconfig_generate__fontconfig__caches.cc
new file mode 100644
index 0000000000..7b6f073cd7
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_test__fonts_fontconfig_generate__fontconfig__caches.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc
+@@ -28,7 +28,7 @@ int main() {
+ // fontconfig cache.
+ // $ echo -n /test_fonts | md5sum
+ // fb5c91b2895aa445d23aebf7f9e2189c -
+- static const char kCacheKey[] = "fb5c91b2895aa445d23aebf7f9e2189c";
++ static const char kCacheKey[] = "cd4b5bc7-6cfc-41dc-8982-f2db624179ba";
+
+ // fontconfig writes the mtime of the test_fonts directory into the cache. It
+ // presumably checks this later to ensure that the cache is still up to date.
+@@ -56,7 +56,7 @@ int main() {
+ FcFini();
+
+ // Check existence of intended fontconfig cache file.
+- auto cache = fontconfig_caches + "/" + kCacheKey + "-le64.cache-9";
++ auto cache = fontconfig_caches + "/" + kCacheKey + "-x86_64.cache-" + FC_CACHE_VERSION;
+ bool cache_exists = access(cache.c_str(), F_OK) == 0;
+ return !cache_exists;
+ }
diff --git a/chromium-next/patches/patch-third__party_tflite_features.gni b/chromium-next/patches/patch-third__party_tflite_features.gni
new file mode 100644
index 0000000000..0efb99864c
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_tflite_features.gni
@@ -0,0 +1,19 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/tflite/features.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/tflite/features.gni
+@@ -9,8 +9,8 @@ declare_args() {
+ # This enables building TFLite with XNNPACK. Currently only available for
+ # Linux, macOS and Windows arm64/x64/x86 targets and ChromeOS non-ARM targets.
+ build_tflite_with_xnnpack =
+- (is_win || is_mac || is_linux || (is_chromeos && overlay_include_cbx)) &&
+- (current_cpu == "arm64" || current_cpu == "x64" || current_cpu == "x86")
++ ((is_win || is_mac || is_linux || (is_chromeos && overlay_include_cbx)) &&
++ (current_cpu == "arm64" || current_cpu == "x64" || current_cpu == "x86")) && !is_bsd
+
+ # Turns on TFLITE_WITH_RUY, using ruy as the gemm backend instead of gemmlowp.
+ build_tflite_with_ruy = true
diff --git a/chromium-next/patches/patch-third__party_unrar_src_crypt.cpp b/chromium-next/patches/patch-third__party_unrar_src_crypt.cpp
new file mode 100644
index 0000000000..fbb94c0fcc
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_unrar_src_crypt.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/unrar/src/crypt.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/unrar/src/crypt.cpp
+@@ -116,6 +116,8 @@ void GetRnd(byte *RndBuf,size_t BufSize)
+ Success=CryptGenRandom(hProvider, (DWORD)BufSize, RndBuf) != FALSE;
+ CryptReleaseContext(hProvider, 0);
+ }
++#elif defined(__OpenBSD__)
++ arc4random_buf(RndBuf, BufSize);
+ #elif defined(_UNIX)
+ FILE *rndf = fopen("/dev/urandom", "r");
+ if (rndf!=NULL)
diff --git a/chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_external_vma_vk__mem__alloc.h b/chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_external_vma_vk__mem__alloc.h
new file mode 100644
index 0000000000..0e3d98bb63
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_external_vma_vk__mem__alloc.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h
+@@ -2740,7 +2740,7 @@ static void* vma_aligned_alloc(size_t al
+
+ return memalign(alignment, size);
+ }
+-#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
++#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <cstdlib>
+
+ #if defined(__APPLE__)
diff --git a/chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_vulkan_generated_vk__function__pointers.cpp b/chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_vulkan_generated_vk__function__pointers.cpp
new file mode 100644
index 0000000000..4dd528fc18
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_vulkan-validation-layers_src_layers_vulkan_generated_vk__function__pointers.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/vulkan-validation-layers/src/layers/vulkan/generated/vk_function_pointers.cpp.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/vulkan-validation-layers/src/layers/vulkan/generated/vk_function_pointers.cpp
+@@ -53,7 +53,8 @@ static void *get_proc_address(dl_handle
+ assert(name);
+ return (void *)GetProcAddress(library, name);
+ }
+-#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__)
++#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || \
++ defined(__GNU__) || defined(__NetBSD__)
+
+ #include <dlfcn.h>
+
diff --git a/chromium-next/patches/patch-third__party_vulkan__memory__allocator_include_vk__mem__alloc.h b/chromium-next/patches/patch-third__party_vulkan__memory__allocator_include_vk__mem__alloc.h
new file mode 100644
index 0000000000..e69c1abec1
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_vulkan__memory__allocator_include_vk__mem__alloc.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/vulkan_memory_allocator/include/vk_mem_alloc.h
+@@ -2760,7 +2760,7 @@ void* vma_aligned_alloc(size_t alignment
+
+ return memalign(alignment, size);
+ }
+-#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
++#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #include <cstdlib>
+
+ #if defined(__APPLE__)
diff --git a/chromium-next/patches/patch-third__party_wayland_BUILD.gn b/chromium-next/patches/patch-third__party_wayland_BUILD.gn
new file mode 100644
index 0000000000..06a9ec1409
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_wayland_BUILD.gn
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/wayland/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/wayland/BUILD.gn
+@@ -24,6 +24,11 @@ if (!use_system_libwayland) {
+ "src/src",
+ ]
+
++ if (is_bsd) {
++ include_dirs += [ "/usr/local/include/libepoll-shim" ]
++ libs = [ "epoll-shim" ]
++ }
++
+ # Client/Server headers are automatically generated. Though, we still need
+ # to pass the path where these headers are located.
+ include_dirs += [ "$root_gen_dir/third_party/wayland/src/protocol" ]
diff --git a/chromium-next/patches/patch-third__party_wayland_include_config.h b/chromium-next/patches/patch-third__party_wayland_include_config.h
new file mode 100644
index 0000000000..7409cdc416
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_wayland_include_config.h
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/wayland/include/config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/wayland/include/config.h
+@@ -9,7 +9,14 @@
+
+ #define HAVE_BROKEN_MSG_CMSG_CLOEXEC 0
+
++#if defined(__FreeBSD__)
++#include <osreldate.h>
++#if defined(__FreeBSD_version) && __FreeBSD_version < 1300048
++#undef HAVE_MEMFD_CREATE
++#else
+ #define HAVE_MEMFD_CREATE
++#endif
++#endif
+
+ #define HAVE_MKOSTEMP
+
+@@ -25,7 +32,11 @@
+
+ #undef HAVE_SYS_PROCCTL_H
+
++#if defined(__FreeBSD__)
++#define HAVE_SYS_UCRED_H
++#else
+ #undef HAVE_SYS_UCRED_H
++#endif
+
+ #define HAVE_XUCRED_CR_PID 0
+
diff --git a/chromium-next/patches/patch-third__party_webrtc_BUILD.gn b/chromium-next/patches/patch-third__party_webrtc_BUILD.gn
new file mode 100644
index 0000000000..4c247ed80d
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_BUILD.gn
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/BUILD.gn
+@@ -218,6 +218,9 @@ config("common_inherited_config") {
+ if (is_linux || is_chromeos) {
+ defines += [ "WEBRTC_LINUX" ]
+ }
++ if (is_bsd) {
++ defines += [ "WEBRTC_BSD" ]
++ }
+ if (is_mac) {
+ defines += [ "WEBRTC_MAC" ]
+ }
diff --git a/chromium-next/patches/patch-third__party_webrtc_modules_audio__device_BUILD.gn b/chromium-next/patches/patch-third__party_webrtc_modules_audio__device_BUILD.gn
new file mode 100644
index 0000000000..04f26d0186
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_modules_audio__device_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/modules/audio_device/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/modules/audio_device/BUILD.gn
+@@ -330,7 +330,7 @@ rtc_library("audio_device_impl") {
+ if (rtc_use_dummy_audio_file_devices) {
+ defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ]
+ } else {
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "linux/alsasymboltable_linux.cc",
+ "linux/alsasymboltable_linux.h",
diff --git a/chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc b/chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
new file mode 100644
index 0000000000..c085be1d6e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+@@ -10,11 +10,15 @@
+
+ #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h"
+
++#if !defined(WEBRTC_BSD)
+ #include <asm/ioctl.h>
++#endif
+ #include <dlfcn.h>
+ #include <fcntl.h>
+ #include <libdrm/drm_fourcc.h>
++#if !defined(WEBRTC_BSD)
+ #include <linux/types.h>
++#endif
+ #include <spa/param/video/format-utils.h>
+ #include <unistd.h>
+ #include <xf86drm.h>
diff --git a/chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc b/chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc
new file mode 100644
index 0000000000..1870627e36
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc
+@@ -203,6 +203,12 @@ bool XServerPixelBuffer::Init(XAtomCache
+ void XServerPixelBuffer::InitShm(const XWindowAttributes& attributes) {
+ Visual* default_visual = attributes.visual;
+ int default_depth = attributes.depth;
++#if defined(__OpenBSD__)
++// pledge(2)
++ RTC_LOG(LS_WARNING) << "Unable to use shmget(2) while using pledge(2). "
++ "Performance may be degraded.";
++ return;
++#endif
+
+ int major, minor;
+ Bool have_pixmaps;
diff --git a/chromium-next/patches/patch-third__party_webrtc_modules_video__coding_codecs_av1_libaom__av1__encoder.cc b/chromium-next/patches/patch-third__party_webrtc_modules_video__coding_codecs_av1_libaom__av1__encoder.cc
new file mode 100644
index 0000000000..c1948eb99f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_modules_video__coding_codecs_av1_libaom__av1__encoder.cc
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
+@@ -299,7 +299,9 @@ int LibaomAv1Encoder::InitEncode(const V
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0);
+ }
+
++#ifdef notyet
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_AUTO_TILES, 1);
++#endif
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ROW_MT, 1);
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_OBMC, 0);
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_NOISE_SENSITIVITY, 0);
+@@ -332,8 +334,10 @@ int LibaomAv1Encoder::InitEncode(const V
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_REFERENCE_FRAMES, 3);
+
+ if (adaptive_max_consec_drops_) {
++#ifdef notyet
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR,
+ 250);
++#endif
+ }
+
+ return WEBRTC_VIDEO_CODEC_OK;
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_byte__order.h b/chromium-next/patches/patch-third__party_webrtc_rtc__base_byte__order.h
new file mode 100644
index 0000000000..2eb5270ed4
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_byte__order.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/byte_order.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/byte_order.h
+@@ -90,6 +90,8 @@
+ #error WEBRTC_ARCH_BIG_ENDIAN or WEBRTC_ARCH_LITTLE_ENDIAN must be defined.
+ #endif // defined(WEBRTC_ARCH_LITTLE_ENDIAN)
+
++#elif defined(WEBRTC_BSD)
++#include <sys/endian.h>
+ #elif defined(WEBRTC_POSIX)
+ #include <endian.h>
+ #else
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_ip__address.cc b/chromium-next/patches/patch-third__party_webrtc_rtc__base_ip__address.cc
new file mode 100644
index 0000000000..2ec3f77422
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_ip__address.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/ip_address.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/ip_address.cc
+@@ -14,7 +14,8 @@
+ #include <cstring>
+ #include <string>
+ #if defined(WEBRTC_POSIX)
+-#ifdef OPENBSD
++#if defined(WEBRTC_BSD)
++#include <sys/types.h>
+ #include <netinet/in_systm.h>
+ #endif
+ #ifndef __native_client__
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_net__test__helpers.cc b/chromium-next/patches/patch-third__party_webrtc_rtc__base_net__test__helpers.cc
new file mode 100644
index 0000000000..0b83bc2562
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_net__test__helpers.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/net_test_helpers.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/net_test_helpers.cc
+@@ -21,6 +21,7 @@
+ #endif
+ #if defined(WEBRTC_POSIX) && !defined(__native_client__)
+ #include <arpa/inet.h>
++#include <sys/socket.h>
+ #if defined(WEBRTC_ANDROID)
+ #include "rtc_base/ifaddrs_android.h"
+ #else
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_network.cc b/chromium-next/patches/patch-third__party_webrtc_rtc__base_network.cc
new file mode 100644
index 0000000000..3656fcc324
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_network.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/network.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/network.cc
+@@ -290,7 +290,12 @@ AdapterType GetAdapterTypeFromName(absl:
+ }
+ #endif
+
++#if defined(WEBRTC_BSD)
++ // Treat all other network interface names as ethernet on BSD
++ return ADAPTER_TYPE_ETHERNET;
++#else
+ return ADAPTER_TYPE_UNKNOWN;
++#endif
+ }
+
+ NetworkManager::EnumerationPermission NetworkManager::enumeration_permission()
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.cc b/chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.cc
new file mode 100644
index 0000000000..d87a37901f
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.cc
@@ -0,0 +1,120 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/physical_socket_server.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -55,7 +55,7 @@
+ #include "rtc_base/time_utils.h"
+ #include "system_wrappers/include/field_trial.h"
+
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ #include <linux/sockios.h>
+ #endif
+
+@@ -75,7 +75,7 @@ typedef void* SockOptArg;
+
+ #endif // WEBRTC_POSIX
+
+-#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
++#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__) && !defined(WEBRTC_BSD)
+
+ int64_t GetSocketRecvTimestamp(int socket) {
+ struct timeval tv_ioctl;
+@@ -330,7 +330,7 @@ int PhysicalSocket::GetOption(Option opt
+ return -1;
+ }
+ if (opt == OPT_DONTFRAGMENT) {
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ *value = (*value != IP_PMTUDISC_DONT) ? 1 : 0;
+ #endif
+ } else if (opt == OPT_DSCP) {
+@@ -359,7 +359,7 @@ int PhysicalSocket::SetOption(Option opt
+ if (TranslateOption(opt, &slevel, &sopt) == -1)
+ return -1;
+ if (opt == OPT_DONTFRAGMENT) {
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ value = (value) ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
+ #endif
+ } else if (opt == OPT_DSCP) {
+@@ -390,7 +390,7 @@ int PhysicalSocket::SetOption(Option opt
+ int PhysicalSocket::Send(const void* pv, size_t cb) {
+ int sent = DoSend(
+ s_, reinterpret_cast<const char*>(pv), static_cast<int>(cb),
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ // Suppress SIGPIPE. Without this, attempting to send on a socket whose
+ // other end is closed will result in a SIGPIPE signal being raised to
+ // our process, which by default will terminate the process, which we
+@@ -419,7 +419,7 @@ int PhysicalSocket::SendTo(const void* b
+ size_t len = addr.ToSockAddrStorage(&saddr);
+ int sent =
+ DoSendTo(s_, static_cast<const char*>(buffer), static_cast<int>(length),
+-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
+ // Suppress SIGPIPE. See above for explanation.
+ MSG_NOSIGNAL,
+ #else
+@@ -699,7 +699,7 @@ int PhysicalSocket::TranslateOption(Opti
+ *slevel = IPPROTO_IP;
+ *sopt = IP_DONTFRAGMENT;
+ break;
+-#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
++#elif defined(WEBRTC_MAC) || defined(WEBRTC_BSD) || defined(__native_client__)
+ RTC_LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
+ return -1;
+ #elif defined(WEBRTC_POSIX)
+@@ -748,7 +748,7 @@ int PhysicalSocket::TranslateOption(Opti
+ return -1;
+ #endif
+ case OPT_RECV_ECN:
+-#if defined(WEBRTC_POSIX)
++#if defined(WEBRTC_POSIX) && defined(IP_RECVTOS)
+ if (family_ == AF_INET6) {
+ *slevel = IPPROTO_IPV6;
+ *sopt = IPV6_RECVTCLASS;
+@@ -768,10 +768,19 @@ int PhysicalSocket::TranslateOption(Opti
+ *sopt = SO_KEEPALIVE;
+ break;
+ case OPT_TCP_KEEPCNT:
++#if !defined(TCP_KEEPCNT)
++ RTC_LOG(LS_WARNING) << "Socket::OPT_TCP_KEEPCNT not supported.";
++ return -1;
++#else
+ *slevel = IPPROTO_TCP;
+ *sopt = TCP_KEEPCNT;
+ break;
++#endif
+ case OPT_TCP_KEEPIDLE:
++#if !defined(TCP_KEEPALIVE)
++ RTC_LOG(LS_WARNING) << "Socket::OPT_TCP_KEEPALIVE not supported.";
++ return -1;
++#else
+ *slevel = IPPROTO_TCP;
+ #if !defined(WEBRTC_MAC)
+ *sopt = TCP_KEEPIDLE;
+@@ -779,12 +788,18 @@ int PhysicalSocket::TranslateOption(Opti
+ *sopt = TCP_KEEPALIVE;
+ #endif
+ break;
++#endif
+ case OPT_TCP_KEEPINTVL:
++#if !defined(TCP_KEEPALIVE)
++ RTC_LOG(LS_WARNING) << "Socket::OPT_TCP_KEEPINTVL not supported.";
++ return -1;
++#else
+ *slevel = IPPROTO_TCP;
+ *sopt = TCP_KEEPINTVL;
+ break;
++#endif
+ case OPT_TCP_USER_TIMEOUT:
+-#if defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
++#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)) && defined(TCP_USER_TIMEOUT)
+ *slevel = IPPROTO_TCP;
+ *sopt = TCP_USER_TIMEOUT;
+ break;
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.h b/chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.h
new file mode 100644
index 0000000000..867157b060
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_physical__socket__server.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/physical_socket_server.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/physical_socket_server.h
+@@ -18,7 +18,7 @@
+ #include "rtc_base/third_party/sigslot/sigslot.h"
+
+ #if defined(WEBRTC_POSIX)
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ // On Linux, use epoll.
+ #include <sys/epoll.h>
+
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_platform__thread__types.cc b/chromium-next/patches/patch-third__party_webrtc_rtc__base_platform__thread__types.cc
new file mode 100644
index 0000000000..efd0118abc
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_platform__thread__types.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/platform_thread_types.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/platform_thread_types.cc
+@@ -11,7 +11,9 @@
+ #include "rtc_base/platform_thread_types.h"
+
+ #if defined(WEBRTC_LINUX)
++#if !defined(WEBRTC_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/syscall.h>
+ #endif
+
+@@ -44,6 +46,8 @@ PlatformThreadId CurrentThreadId() {
+ return gettid();
+ #elif defined(WEBRTC_FUCHSIA)
+ return zx_thread_self();
++#elif defined(WEBRTC_BSD)
++ return reinterpret_cast<uint64_t>(pthread_self());
+ #elif defined(WEBRTC_LINUX)
+ return syscall(__NR_gettid);
+ #elif defined(__EMSCRIPTEN__)
+@@ -74,6 +78,7 @@ bool IsThreadRefEqual(const PlatformThre
+ }
+
+ void SetCurrentThreadName(const char* name) {
++#if !defined(WEBRTC_BSD)
+ #if defined(WEBRTC_WIN)
+ // The SetThreadDescription API works even if no debugger is attached.
+ // The names set with this API also show up in ETW traces. Very handy.
+@@ -121,6 +126,7 @@ void SetCurrentThreadName(const char* na
+ name, strlen(name));
+ RTC_DCHECK_EQ(status, ZX_OK);
+ #endif
++#endif
+ }
+
+ } // namespace rtc
diff --git a/chromium-next/patches/patch-third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h b/chromium-next/patches/patch-third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h
new file mode 100644
index 0000000000..92578cc873
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/rtc_base/third_party/sigslot/sigslot.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/rtc_base/third_party/sigslot/sigslot.h
+@@ -178,6 +178,10 @@ class multi_threaded_local {
+ #endif // _SIGSLOT_HAS_WIN32_THREADS
+
+ #ifdef _SIGSLOT_HAS_POSIX_THREADS
++#if defined(OS_FREEBSD)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
++#endif
+ // The multi threading policies only get compiled in if they are enabled.
+ class multi_threaded_global {
+ public:
+@@ -201,6 +205,9 @@ class multi_threaded_local {
+ private:
+ pthread_mutex_t m_mutex;
+ };
++#if defined(OS_FREEBSD)
++#pragma GCC diagnostic pop
++#endif
+ #endif // _SIGSLOT_HAS_POSIX_THREADS
+
+ template <class mt_policy>
diff --git a/chromium-next/patches/patch-third__party_webrtc_system__wrappers_BUILD.gn b/chromium-next/patches/patch-third__party_webrtc_system__wrappers_BUILD.gn
new file mode 100644
index 0000000000..447f4bad27
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_webrtc_system__wrappers_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/webrtc/system_wrappers/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/webrtc/system_wrappers/BUILD.gn
+@@ -62,8 +62,6 @@ rtc_library("system_wrappers") {
+ if (!build_with_chromium) {
+ sources += [ "source/cpu_features_linux.cc" ]
+ }
+-
+- libs += [ "rt" ]
+ }
+
+ if (is_win) {
diff --git a/chromium-next/patches/patch-third__party_widevine_cdm_widevine.gni b/chromium-next/patches/patch-third__party_widevine_cdm_widevine.gni
new file mode 100644
index 0000000000..dbf37dc41e
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_widevine_cdm_widevine.gni
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/widevine/cdm/widevine.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/widevine/cdm/widevine.gni
+@@ -28,6 +28,9 @@ library_widevine_cdm_available =
+ (is_chromeos &&
+ (target_cpu == "x64" || target_cpu == "arm" || target_cpu == "arm64")) ||
+ (target_os == "linux" && target_cpu == "x64") ||
++ (target_os == "openbsd" && target_cpu == "x64") ||
++ (target_os == "freebsd" && target_cpu == "x64") ||
++ (target_os == "netbsd" && target_cpu == "x64") ||
+ (target_os == "mac" && (target_cpu == "x64" || target_cpu == "arm64")) ||
+ (target_os == "win" &&
+ (target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm64"))
diff --git a/chromium-next/patches/patch-third__party_zlib_BUILD.gn b/chromium-next/patches/patch-third__party_zlib_BUILD.gn
new file mode 100644
index 0000000000..e388ceacc2
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_zlib_BUILD.gn
@@ -0,0 +1,37 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/zlib/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/zlib/BUILD.gn
+@@ -128,7 +128,7 @@ if (use_arm_neon_optimizations) {
+ defines = [ "CRC32_ARMV8_CRC32" ]
+ if (is_android) {
+ defines += [ "ARMV8_OS_ANDROID" ]
+- } else if (is_linux || is_chromeos) {
++ } else if ((is_linux || is_chromeos) && !is_bsd) {
+ defines += [ "ARMV8_OS_LINUX" ]
+ } else if (is_mac) {
+ defines += [ "ARMV8_OS_MACOS" ]
+@@ -138,6 +138,10 @@ if (use_arm_neon_optimizations) {
+ defines += [ "ARMV8_OS_FUCHSIA" ]
+ } else if (is_win) {
+ defines += [ "ARMV8_OS_WINDOWS" ]
++ } else if (is_openbsd) {
++ defines += [ "ARMV8_OS_OPENBSD" ]
++ } else if (is_freebsd) {
++ defines += [ "ARMV8_OS_FREEBSD" ]
+ } else {
+ assert(false, "Unsupported ARM OS")
+ }
+@@ -413,7 +417,7 @@ static_library("minizip") {
+ ]
+ }
+
+- if (is_apple || is_android || is_nacl) {
++ if (is_apple || is_android || is_nacl || is_bsd) {
+ # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
+ # use fopen, ftell, and fseek instead on these systems.
+ defines = [ "USE_FILE32API" ]
diff --git a/chromium-next/patches/patch-third__party_zlib_cpu__features.c b/chromium-next/patches/patch-third__party_zlib_cpu__features.c
new file mode 100644
index 0000000000..bce27c7817
--- /dev/null
+++ b/chromium-next/patches/patch-third__party_zlib_cpu__features.c
@@ -0,0 +1,57 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- third_party/zlib/cpu_features.c.orig 2025-01-07 19:49:01.000000000 +0000
++++ third_party/zlib/cpu_features.c
+@@ -39,7 +39,8 @@ int ZLIB_INTERNAL riscv_cpu_enable_vclmu
+ #ifndef CPU_NO_SIMD
+
+ #if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || \
+- defined(ARMV8_OS_FUCHSIA) || defined(ARMV8_OS_IOS)
++ defined(ARMV8_OS_FUCHSIA) || defined(ARMV8_OS_IOS) || \
++ defined(ARMV8_OS_OPENBSD) || defined(ARMV8_OS_FREEBSD)
+ #include <pthread.h>
+ #endif
+
+@@ -56,6 +57,10 @@ int ZLIB_INTERNAL riscv_cpu_enable_vclmu
+ #include <windows.h>
+ #elif defined(ARMV8_OS_IOS)
+ #include <sys/sysctl.h>
++#elif defined(ARMV8_OS_OPENBSD)
++#include <sys/sysctl.h>
++#include <machine/cpu.h>
++#include <machine/armreg.h>
+ #elif !defined(_MSC_VER)
+ #include <pthread.h>
+ #else
+@@ -69,7 +74,8 @@ static void _cpu_check_features(void);
+ #if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || \
+ defined(ARMV8_OS_MACOS) || defined(ARMV8_OS_FUCHSIA) || \
+ defined(X86_NOT_WINDOWS) || defined(ARMV8_OS_IOS) || \
+- defined(RISCV_RVV)
++ defined(RISCV_RVV) || defined(ARMV8_OS_OPENBSD) || \
++ defined(ARMV8_OS_FREEBSD)
+ #if !defined(ARMV8_OS_MACOS)
+ // _cpu_check_features() doesn't need to do anything on mac/arm since all
+ // features are known at build time, so don't call it.
+@@ -122,6 +128,17 @@ static void _cpu_check_features(void)
+ unsigned long features = getauxval(AT_HWCAP2);
+ arm_cpu_enable_crc32 = !!(features & HWCAP2_CRC32);
+ arm_cpu_enable_pmull = !!(features & HWCAP2_PMULL);
++#elif defined(ARMV8_OS_OPENBSD)
++ int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 };
++ uint64_t cpu_id = 0;
++ size_t len = sizeof(cpu_id);
++ if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) < 0)
++ return;
++ if (ID_AA64ISAR0_AES(cpu_id) >= ID_AA64ISAR0_AES_PMULL)
++ arm_cpu_enable_pmull = 1;
++
++ if (ID_AA64ISAR0_CRC32(cpu_id) >= ID_AA64ISAR0_CRC32_BASE)
++ arm_cpu_enable_crc32 = 1;
+ #elif defined(ARMV8_OS_FUCHSIA)
+ uint32_t features;
+ zx_status_t rc = zx_system_get_features(ZX_FEATURE_KIND_CPU, &features);
diff --git a/chromium-next/patches/patch-tools_generate__shim__headers_generate__shim__headers.py b/chromium-next/patches/patch-tools_generate__shim__headers_generate__shim__headers.py
new file mode 100644
index 0000000000..4d5be6ef66
--- /dev/null
+++ b/chromium-next/patches/patch-tools_generate__shim__headers_generate__shim__headers.py
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/generate_shim_headers/generate_shim_headers.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/generate_shim_headers/generate_shim_headers.py
+@@ -18,7 +18,7 @@ import sys
+
+
+ SHIM_TEMPLATE = """
+-#if defined(OFFICIAL_BUILD)
++#if defined(GOOGLE_CHROME_BUILD)
+ #error shim headers must not be used in official builds!
+ #endif
+ """
+@@ -65,6 +65,9 @@ def GeneratorMain(argv):
+ if options.outputs:
+ yield os.path.join(target_directory, header_filename)
+ if options.generate:
++ source_file = os.path.join(root, header_filename)
++ if os.path.exists(source_file):
++ os.unlink(source_file)
+ header_path = os.path.join(target_directory, header_filename)
+ header_dir = os.path.dirname(header_path)
+ if not os.path.exists(header_dir):
diff --git a/chromium-next/patches/patch-tools_generate__stubs_rules.gni b/chromium-next/patches/patch-tools_generate__stubs_rules.gni
new file mode 100644
index 0000000000..92ae968ab2
--- /dev/null
+++ b/chromium-next/patches/patch-tools_generate__stubs_rules.gni
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/generate_stubs/rules.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/generate_stubs/rules.gni
+@@ -110,7 +110,6 @@ template("generate_stubs") {
+ "${target_gen_dir}/${invoker.output_name}.cc",
+ "${target_gen_dir}/${invoker.output_name}.h",
+ ]
+- libs = [ "dl" ]
+ include_dirs = [ target_gen_dir ]
+ if (defined(invoker.configs)) {
+ configs += invoker.configs
diff --git a/chromium-next/patches/patch-tools_gn_build_build__linux.ninja.template b/chromium-next/patches/patch-tools_gn_build_build__linux.ninja.template
new file mode 100644
index 0000000000..ed23a8e2f5
--- /dev/null
+++ b/chromium-next/patches/patch-tools_gn_build_build__linux.ninja.template
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/gn/build/build_linux.ninja.template.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/gn/build/build_linux.ninja.template
+@@ -5,7 +5,7 @@ rule cxx
+ deps = gcc
+
+ rule alink_thin
+- command = $ar rcsT $out $in
++ command = $ar rcs $out $in
+ description = AR $out
+
+ rule link
diff --git a/chromium-next/patches/patch-tools_gn_build_gen.py b/chromium-next/patches/patch-tools_gn_build_gen.py
new file mode 100644
index 0000000000..ab66a9eb90
--- /dev/null
+++ b/chromium-next/patches/patch-tools_gn_build_gen.py
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/gn/build/gen.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/gn/build/gen.py
+@@ -94,6 +94,12 @@ class Platform(object):
+ def is_solaris(self):
+ return self._platform == 'solaris'
+
++ def is_openbsd(self):
++ return self._platform == 'openbsd'
++
++ def is_freebsd(self):
++ return self._platform == 'freebsd'
++
+ def is_posix(self):
+ return self._platform in ['linux', 'freebsd', 'darwin', 'aix', 'openbsd', 'haiku', 'solaris', 'msys', 'netbsd', 'serenity']
+
+@@ -304,7 +310,7 @@ def WriteGenericNinja(path, static_libra
+ 'linux': 'build_linux.ninja.template',
+ 'freebsd': 'build_linux.ninja.template',
+ 'aix': 'build_aix.ninja.template',
+- 'openbsd': 'build_openbsd.ninja.template',
++ 'openbsd': 'build_linux.ninja.template',
+ 'haiku': 'build_haiku.ninja.template',
+ 'solaris': 'build_linux.ninja.template',
+ 'netbsd': 'build_linux.ninja.template',
+@@ -540,6 +546,9 @@ def WriteGNNinja(path, platform, host, o
+ if platform.is_posix() and not platform.is_haiku():
+ ldflags.append('-pthread')
+
++ if platform.is_openbsd():
++ libs.append('-lkvm')
++
+ if platform.is_mingw() or platform.is_msys():
+ cflags.extend(['-DUNICODE',
+ '-DNOMINMAX',
diff --git a/chromium-next/patches/patch-tools_gn_src_base_files_file__posix.cc b/chromium-next/patches/patch-tools_gn_src_base_files_file__posix.cc
new file mode 100644
index 0000000000..7455045fff
--- /dev/null
+++ b/chromium-next/patches/patch-tools_gn_src_base_files_file__posix.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/gn/src/base/files/file_posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/gn/src/base/files/file_posix.cc
+@@ -359,7 +359,7 @@ void File::DoInitialize(const FilePath&
+ bool File::Flush() {
+ DCHECK(IsValid());
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ return !HANDLE_EINTR(fdatasync(file_.get()));
+ #else
+ return !HANDLE_EINTR(fsync(file_.get()));
diff --git a/chromium-next/patches/patch-tools_gn_src_gn_version.h b/chromium-next/patches/patch-tools_gn_src_gn_version.h
new file mode 100644
index 0000000000..802f1e9fa4
--- /dev/null
+++ b/chromium-next/patches/patch-tools_gn_src_gn_version.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/gn/src/gn/version.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/gn/src/gn/version.h
+@@ -22,9 +22,9 @@ class Version {
+
+ static std::optional<Version> FromString(std::string s);
+
+- int major() const { return major_; }
+- int minor() const { return minor_; }
+- int patch() const { return patch_; }
++ int gmajor() const { return major_; }
++ int gminor() const { return minor_; }
++ int gpatch() const { return patch_; }
+
+ bool operator==(const Version& other) const;
+ bool operator<(const Version& other) const;
diff --git a/chromium-next/patches/patch-tools_gn_src_util_exe__path.cc b/chromium-next/patches/patch-tools_gn_src_util_exe__path.cc
new file mode 100644
index 0000000000..318155225d
--- /dev/null
+++ b/chromium-next/patches/patch-tools_gn_src_util_exe__path.cc
@@ -0,0 +1,96 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/gn/src/util/exe_path.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/gn/src/util/exe_path.cc
+@@ -15,7 +15,7 @@
+ #include <windows.h>
+
+ #include "base/win/win_util.h"
+-#elif defined(OS_FREEBSD) || defined(OS_NETBSD)
++#elif defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD)
+ #include <limits.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+@@ -26,6 +26,10 @@
+ #include <stdlib.h>
+ #endif
+
++#if defined(OS_OPENBSD)
++#include <kvm.h>
++#endif
++
+ #if defined(OS_MACOSX)
+
+ base::FilePath GetExePath() {
+@@ -104,6 +108,67 @@ base::FilePath GetExePath() {
+ return base::FilePath(raw);
+ }
+
++#elif defined(OS_OPENBSD)
++
++base::FilePath GetExePath() {
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ char errbuf[_POSIX2_LINE_MAX];
++ char **retvalargs;
++#define MAXTOKENS 2
++ char *tokens[MAXTOKENS];
++ static char retval[PATH_MAX];
++ int cnt;
++ size_t len;
++ struct stat sb;
++ pid_t cpid = getpid();
++
++ int mib[] = { CTL_KERN, KERN_PROC_ARGS, cpid, KERN_PROC_ARGV };
++
++ if (sysctl(mib, 4, NULL, &len, NULL, 0) != -1) {
++ retvalargs = static_cast<char**>(malloc(len));
++ if (!retvalargs)
++ goto out;
++
++ if (sysctl(mib, 4, retvalargs, &len, NULL, 0) < 0)
++ goto out;
++
++ char *cr = strdup(retvalargs[0]);
++ free(retvalargs);
++
++ *tokens = strtok(cr, ":");
++ if (tokens[0] == NULL)
++ goto out;
++
++ if (realpath(tokens[0], retval) == NULL)
++ goto out;
++
++ if (stat(retval, &sb) < 0)
++ 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) {
++ kvm_close(kd);
++ goto out;
++ }
++
++ for (int i = 0; i < cnt; i++) {
++ if (files[i].fd_fd == KERN_FILE_TEXT &&
++ files[i].va_fsid == static_cast<uint32_t>(sb.st_dev) &&
++ files[i].va_fileid == sb.st_ino) {
++ kvm_close(kd);
++ return base::FilePath(retval);
++ }
++ }
++ }
++
++out:
++ return base::FilePath();
++}
++
+ #elif defined(OS_ZOS)
+
+ base::FilePath GetExePath() {
diff --git a/chromium-next/patches/patch-tools_grit_grit_node_base.py b/chromium-next/patches/patch-tools_grit_grit_node_base.py
new file mode 100644
index 0000000000..cef2ff5644
--- /dev/null
+++ b/chromium-next/patches/patch-tools_grit_grit_node_base.py
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/grit/grit/node/base.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/grit/grit/node/base.py
+@@ -498,7 +498,8 @@ class Node:
+ value = defs
+
+ elif name == 'is_linux':
+- value = target_platform == 'linux'
++ value = (target_platform == 'linux'
++ or 'bsd' in target_platform)
+ elif name == 'is_chromeos':
+ value = target_platform == 'chromeos'
+ elif name == 'is_macosx':
diff --git a/chromium-next/patches/patch-tools_json__schema__compiler_cpp__bundle__generator.py b/chromium-next/patches/patch-tools_json__schema__compiler_cpp__bundle__generator.py
new file mode 100644
index 0000000000..516e83a46c
--- /dev/null
+++ b/chromium-next/patches/patch-tools_json__schema__compiler_cpp__bundle__generator.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/json_schema_compiler/cpp_bundle_generator.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/json_schema_compiler/cpp_bundle_generator.py
+@@ -145,7 +145,7 @@ class CppBundleGenerator(object):
+ # BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(IS_CHROMEOS_LACROS).
+ ifdefs.append('BUILDFLAG(IS_CHROMEOS_LACROS)')
+ elif platform == Platforms.LINUX:
+- ifdefs.append('BUILDFLAG(IS_LINUX)')
++ ifdefs.append('BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)')
+ elif platform == Platforms.MAC:
+ ifdefs.append('BUILDFLAG(IS_MAC)')
+ elif platform == Platforms.WIN:
diff --git a/chromium-next/patches/patch-tools_json__schema__compiler_feature__compiler.py b/chromium-next/patches/patch-tools_json__schema__compiler_feature__compiler.py
new file mode 100644
index 0000000000..4198fcf794
--- /dev/null
+++ b/chromium-next/patches/patch-tools_json__schema__compiler_feature__compiler.py
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/json_schema_compiler/feature_compiler.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/json_schema_compiler/feature_compiler.py
+@@ -292,6 +292,9 @@ FEATURE_GRAMMAR = ({
+ 'linux': 'Feature::LINUX_PLATFORM',
+ 'mac': 'Feature::MACOSX_PLATFORM',
+ 'win': 'Feature::WIN_PLATFORM',
++ 'openbsd': 'Feature::LINUX_PLATFORM',
++ 'freebsd': 'Feature::LINUX_PLATFORM',
++ 'netbsd': 'Feature::LINUX_PLATFORM',
+ }
+ }
+ },
diff --git a/chromium-next/patches/patch-tools_memory_partition__allocator_inspect__utils.h b/chromium-next/patches/patch-tools_memory_partition__allocator_inspect__utils.h
new file mode 100644
index 0000000000..a493ebfe22
--- /dev/null
+++ b/chromium-next/patches/patch-tools_memory_partition__allocator_inspect__utils.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/memory/partition_allocator/inspect_utils.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/memory/partition_allocator/inspect_utils.h
+@@ -61,7 +61,7 @@ class RemoteProcessMemoryReader {
+ const pid_t pid_;
+ bool is_valid_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ScopedFD mem_fd_;
+ #elif BUILDFLAG(IS_MAC)
+ task_t task_;
diff --git a/chromium-next/patches/patch-tools_perf_chrome__telemetry__build_BUILD.gn b/chromium-next/patches/patch-tools_perf_chrome__telemetry__build_BUILD.gn
new file mode 100644
index 0000000000..968e0c048b
--- /dev/null
+++ b/chromium-next/patches/patch-tools_perf_chrome__telemetry__build_BUILD.gn
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/perf/chrome_telemetry_build/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/perf/chrome_telemetry_build/BUILD.gn
+@@ -47,7 +47,7 @@ group("telemetry_chrome_test") {
+ data_deps += [ "//chrome:reorder_imports" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ data_deps += [ "//third_party/breakpad:dump_syms" ]
+
+ # CrOS currently has issues with the locally compiled version of
+@@ -178,7 +178,7 @@ group("telemetry_chrome_test_without_chr
+ ]
+
+ # Cr-Fuchsia doesn't support breakpad.
+- if (!is_win && !is_fuchsia) {
++ if (!is_win && !is_fuchsia && !is_bsd) {
+ data_deps += [
+ # This is defined for Windows, but is unused by Telemetry on
+ # Windows, and including it can have issues when cross-compiling
diff --git a/chromium-next/patches/patch-tools_protoc__wrapper_protoc__wrapper.py b/chromium-next/patches/patch-tools_protoc__wrapper_protoc__wrapper.py
new file mode 100644
index 0000000000..d0d6f06ba5
--- /dev/null
+++ b/chromium-next/patches/patch-tools_protoc__wrapper_protoc__wrapper.py
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/protoc_wrapper/protoc_wrapper.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/protoc_wrapper/protoc_wrapper.py
+@@ -183,15 +183,19 @@ def main(argv):
+ if not options.exclude_imports:
+ protoc_cmd += ["--include_imports"]
+
++ nenv = os.environ.copy()
++ nenv["PATH"] = "${WRKOBJDIR}/bin:" + nenv["PATH"]
++ nenv["LD_LIBRARY_PATH"] = "${WRKSRC}/out/Release"
++
+ dependency_file_data = None
+ if options.descriptor_set_out and options.descriptor_set_dependency_file:
+ protoc_cmd += ['--dependency_out', options.descriptor_set_dependency_file]
+- ret = subprocess.call(protoc_cmd)
++ ret = subprocess.call(protoc_cmd, env=nenv)
+
+ with open(options.descriptor_set_dependency_file, 'rb') as f:
+ dependency_file_data = f.read().decode('utf-8')
+
+- ret = subprocess.call(protoc_cmd)
++ ret = subprocess.call(protoc_cmd, env=nenv)
+ if ret != 0:
+ if ret <= -100:
+ # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier to
diff --git a/chromium-next/patches/patch-tools_v8__context__snapshot_BUILD.gn b/chromium-next/patches/patch-tools_v8__context__snapshot_BUILD.gn
new file mode 100644
index 0000000000..80db658a47
--- /dev/null
+++ b/chromium-next/patches/patch-tools_v8__context__snapshot_BUILD.gn
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/v8_context_snapshot/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/v8_context_snapshot/BUILD.gn
+@@ -36,6 +36,24 @@ buildflag_header("buildflags") {
+ ]
+ }
+
++action("run_paxctl_v8_context_snapshot_generator") {
++ deps = [ ":v8_context_snapshot_generator($v8_snapshot_toolchain)" ]
++
++ script = "//v8/tools/run-paxctl.py"
++ stamp = "$target_gen_dir/paxctl_stamp"
++ outputs = [ stamp ]
++
++ sources = []
++ data = []
++
++ args = [
++ rebase_path(stamp, root_build_dir),
++ "/usr/sbin/paxctl", "+m",
++ "./" + rebase_path(get_label_info(":v8_context_snapshot_generator", "root_out_dir") + "/v8_context_snapshot_generator",
++ root_build_dir),
++ ]
++}
++
+ if (use_v8_context_snapshot) {
+ if (v8_snapshot_toolchain == current_toolchain) {
+ action("generate_v8_context_snapshot") {
+@@ -57,6 +75,9 @@ if (use_v8_context_snapshot) {
+ ":v8_context_snapshot_generator",
+ "//v8:run_mksnapshot_default",
+ ]
++ if (target_os == "netbsd") {
++ deps += [ ":run_paxctl_v8_context_snapshot_generator" ]
++ }
+
+ # TODO(sky): figure out why this doesn't work on android cross compile.
+ # In the case of compiling for the snapshot `shlib_extension` is ".so"
diff --git a/chromium-next/patches/patch-tools_variations_fieldtrial__to__struct.py b/chromium-next/patches/patch-tools_variations_fieldtrial__to__struct.py
new file mode 100644
index 0000000000..b0ad7f7982
--- /dev/null
+++ b/chromium-next/patches/patch-tools_variations_fieldtrial__to__struct.py
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- tools/variations/fieldtrial_to_struct.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ tools/variations/fieldtrial_to_struct.py
+@@ -41,6 +41,9 @@ _platforms = [
+ 'linux',
+ 'mac',
+ 'windows',
++ 'openbsd',
++ 'freebsd',
++ 'netbsd',
+ ]
+
+ _form_factors = [
diff --git a/chromium-next/patches/patch-ui_aura_client_drag__drop__client.h b/chromium-next/patches/patch-ui_aura_client_drag__drop__client.h
new file mode 100644
index 0000000000..ebc9510103
--- /dev/null
+++ b/chromium-next/patches/patch-ui_aura_client_drag__drop__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/aura/client/drag_drop_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/aura/client/drag_drop_client.h
+@@ -44,7 +44,7 @@ class AURA_EXPORT DragDropClient {
+ int allowed_operations,
+ ui::mojom::DragEventSource source) = 0;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Updates the drag image. An empty |image| may be used to hide a previously
+ // set non-empty drag image, and a non-empty |image| shows the drag image
+ // again if it was previously hidden.
diff --git a/chromium-next/patches/patch-ui_aura_screen__ozone.cc b/chromium-next/patches/patch-ui_aura_screen__ozone.cc
new file mode 100644
index 0000000000..bd1db0745d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_aura_screen__ozone.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/aura/screen_ozone.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/aura/screen_ozone.cc
+@@ -107,7 +107,7 @@ display::Display ScreenOzone::GetPrimary
+ return platform_screen_->GetPrimaryDisplay();
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ScreenOzone::ScreenSaverSuspenderOzone::ScreenSaverSuspenderOzone(
+ std::unique_ptr<ui::PlatformScreen::PlatformScreenSaverSuspender> suspender)
+ : suspender_(std::move(suspender)) {}
diff --git a/chromium-next/patches/patch-ui_aura_screen__ozone.h b/chromium-next/patches/patch-ui_aura_screen__ozone.h
new file mode 100644
index 0000000000..84c535d9ed
--- /dev/null
+++ b/chromium-next/patches/patch-ui_aura_screen__ozone.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/aura/screen_ozone.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/aura/screen_ozone.h
+@@ -44,7 +44,7 @@ class AURA_EXPORT ScreenOzone : public d
+ display::Display GetDisplayMatching(
+ const gfx::Rect& match_rect) const override;
+ display::Display GetPrimaryDisplay() const override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<display::Screen::ScreenSaverSuspender> SuspendScreenSaver()
+ override;
+ #endif // BUILDFLAG(IS_LINUX)
+@@ -68,7 +68,7 @@ class AURA_EXPORT ScreenOzone : public d
+ ui::PlatformScreen* platform_screen() { return platform_screen_.get(); }
+
+ private:
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class ScreenSaverSuspenderOzone
+ : public display::Screen::ScreenSaverSuspender {
+ public:
diff --git a/chromium-next/patches/patch-ui_base_accelerators_accelerator.cc b/chromium-next/patches/patch-ui_base_accelerators_accelerator.cc
new file mode 100644
index 0000000000..1e5e12aa39
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_accelerators_accelerator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/accelerators/accelerator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/accelerators/accelerator.cc
+@@ -414,7 +414,7 @@ std::u16string Accelerator::ApplyLongFor
+ result = ApplyModifierToAcceleratorString(result, IDS_APP_SEARCH_KEY);
+ #elif BUILDFLAG(IS_WIN)
+ result = ApplyModifierToAcceleratorString(result, IDS_APP_WINDOWS_KEY);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ result = ApplyModifierToAcceleratorString(result, IDS_APP_SUPER_KEY);
+ #else
+ NOTREACHED();
diff --git a/chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.cc b/chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.cc
new file mode 100644
index 0000000000..c10ad82577
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/clipboard/clipboard_constants.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/clipboard/clipboard_constants.cc
+@@ -25,7 +25,7 @@ const char kMimeTypeOctetStream[] = "app
+ // Used for window dragging on some platforms.
+ const char kMimeTypeWindowDrag[] = "chromium/x-window-drag";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ const char kMimeTypeLinuxUtf8String[] = "UTF8_STRING";
+ const char kMimeTypeLinuxString[] = "STRING";
+ const char kMimeTypeLinuxText[] = "TEXT";
diff --git a/chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.h b/chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.h
new file mode 100644
index 0000000000..2c1b6ef85b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_clipboard_clipboard__constants.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/clipboard/clipboard_constants.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/clipboard/clipboard_constants.h
+@@ -41,7 +41,7 @@ extern const char kMimeTypeWindowDrag[];
+
+ // ----- LINUX & CHROMEOS & FUCHSIA MIME TYPES -----
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES)
+ extern const char kMimeTypeLinuxUtf8String[];
+ COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES)
diff --git a/chromium-next/patches/patch-ui_base_clipboard_clipboard__non__backed.cc b/chromium-next/patches/patch-ui_base_clipboard_clipboard__non__backed.cc
new file mode 100644
index 0000000000..8c9e9d2d4c
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_clipboard_clipboard__non__backed.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/clipboard/clipboard_non_backed.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/clipboard/clipboard_non_backed.cc
+@@ -461,7 +461,7 @@ ClipboardNonBacked::ClipboardNonBacked()
+ // so create internal clipboards for platform supported clipboard buffers.
+ constexpr ClipboardBuffer kClipboardBuffers[] = {
+ ClipboardBuffer::kCopyPaste,
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ ClipboardBuffer::kSelection,
+ #endif
+ #if BUILDFLAG(IS_MAC)
diff --git a/chromium-next/patches/patch-ui_base_cursor_cursor__factory.cc b/chromium-next/patches/patch-ui_base_cursor_cursor__factory.cc
new file mode 100644
index 0000000000..8c20688b6e
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_cursor_cursor__factory.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/cursor/cursor_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/cursor/cursor_factory.cc
+@@ -96,7 +96,7 @@ void CursorFactory::ObserveThemeChanges(
+ NOTIMPLEMENTED();
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Returns a cursor name compatible with either X11 or the FreeDesktop.org
+ // cursor spec ([1] and [2]), followed by fallbacks that can work as
diff --git a/chromium-next/patches/patch-ui_base_cursor_cursor__factory.h b/chromium-next/patches/patch-ui_base_cursor_cursor__factory.h
new file mode 100644
index 0000000000..bb3f232ce6
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_cursor_cursor__factory.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/cursor/cursor_factory.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/cursor/cursor_factory.h
+@@ -93,7 +93,7 @@ class COMPONENT_EXPORT(UI_BASE_CURSOR) C
+ base::ObserverList<CursorFactoryObserver>::Unchecked observers_;
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE_CURSOR)
+ std::vector<std::string> CursorNamesFromType(mojom::CursorType type);
+ #endif
diff --git a/chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__factory.cc b/chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__factory.cc
new file mode 100644
index 0000000000..be036cb7c0
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/dragdrop/os_exchange_data_provider_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/dragdrop/os_exchange_data_provider_factory.cc
+@@ -7,7 +7,7 @@
+ #include "base/notreached.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "ui/base/dragdrop/os_exchange_data_provider_factory_ozone.h"
+ #include "ui/base/dragdrop/os_exchange_data_provider_non_backed.h"
+ #elif BUILDFLAG(IS_APPLE)
+@@ -21,7 +21,7 @@ namespace ui {
+ // static
+ std::unique_ptr<OSExchangeDataProvider>
+ OSExchangeDataProviderFactory::CreateProvider() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The instance can be nullptr in tests that do not instantiate the platform,
+ // or on platforms that do not implement specific drag'n'drop. For them,
+ // falling back to the Aura provider should be fine.
diff --git a/chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__non__backed.cc b/chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__non__backed.cc
new file mode 100644
index 0000000000..578edef5eb
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_dragdrop_os__exchange__data__provider__non__backed.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/dragdrop/os_exchange_data_provider_non_backed.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/dragdrop/os_exchange_data_provider_non_backed.cc
+@@ -98,7 +98,7 @@ void OSExchangeDataProviderNonBacked::Se
+
+ std::optional<std::u16string> OSExchangeDataProviderNonBacked::GetString()
+ const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (HasFile()) {
+ // Various Linux file managers both pass a list of file:// URIs and set the
+ // string representation to the URI. We explicitly don't want to return use
diff --git a/chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.cc b/chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.cc
new file mode 100644
index 0000000000..b4954d9b7e
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/dummy_text_input_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/dummy_text_input_client.cc
+@@ -175,7 +175,7 @@ bool DummyTextInputClient::ShouldDoLearn
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool DummyTextInputClient::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
diff --git a/chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.h b/chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.h
new file mode 100644
index 0000000000..8785dc9c78
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_dummy__text__input__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/dummy_text_input_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/dummy_text_input_client.h
+@@ -73,7 +73,7 @@ class DummyTextInputClient : public Text
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
diff --git a/chromium-next/patches/patch-ui_base_ime_fake__text__input__client.cc b/chromium-next/patches/patch-ui_base_ime_fake__text__input__client.cc
new file mode 100644
index 0000000000..f8d4b3c272
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_fake__text__input__client.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/fake_text_input_client.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/fake_text_input_client.cc
+@@ -227,7 +227,7 @@ bool FakeTextInputClient::ShouldDoLearni
+ return should_do_learning_;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool FakeTextInputClient::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
diff --git a/chromium-next/patches/patch-ui_base_ime_fake__text__input__client.h b/chromium-next/patches/patch-ui_base_ime_fake__text__input__client.h
new file mode 100644
index 0000000000..bea1536df2
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_fake__text__input__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/fake_text_input_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/fake_text_input_client.h
+@@ -107,7 +107,7 @@ class FakeTextInputClient : public TextI
+ void SetTextEditCommandForNextKeyEvent(TextEditCommand command) override;
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
diff --git a/chromium-next/patches/patch-ui_base_ime_init_input__method__initializer.cc b/chromium-next/patches/patch-ui_base_ime_init_input__method__initializer.cc
new file mode 100644
index 0000000000..6b6f24abae
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_init_input__method__initializer.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/init/input_method_initializer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/init/input_method_initializer.cc
+@@ -8,7 +8,7 @@
+ #include "base/functional/callback.h"
+ #include "build/build_config.h"
+
+-#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ #include "ui/base/ime/linux/fake_input_method_context.h"
+ #include "ui/base/ime/linux/linux_input_method_context_factory.h"
+ #elif BUILDFLAG(IS_WIN)
+@@ -31,7 +31,7 @@ void ShutdownInputMethod() {
+ }
+
+ void InitializeInputMethodForTesting() {
+-#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ GetInputMethodContextFactoryForTest() =
+ base::BindRepeating([](LinuxInputMethodContextDelegate* delegate)
+ -> std::unique_ptr<LinuxInputMethodContext> {
+@@ -43,7 +43,7 @@ void InitializeInputMethodForTesting() {
+ }
+
+ void ShutdownInputMethodForTesting() {
+-#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
++#if defined(USE_AURA) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ // The function owns the factory (as a static variable that's returned by
+ // reference), so setting this to an empty factory will free the old one.
+ GetInputMethodContextFactoryForTest() = LinuxInputMethodContextFactory();
diff --git a/chromium-next/patches/patch-ui_base_ime_linux_linux__input__method__context__factory.cc b/chromium-next/patches/patch-ui_base_ime_linux_linux__input__method__context__factory.cc
new file mode 100644
index 0000000000..0370a3a243
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_linux_linux__input__method__context__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/linux/linux_input_method_context_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/linux/linux_input_method_context_factory.cc
+@@ -9,7 +9,7 @@
+ #include "build/build_config.h"
+ #include "ui/base/ime/linux/fake_input_method_context.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #include "ui/linux/linux_ui_delegate.h"
+ #endif
+@@ -32,7 +32,7 @@ std::unique_ptr<LinuxInputMethodContext>
+ if (auto factory = GetInputMethodContextFactoryForTest())
+ return factory.Run(delegate);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Give the toolkit a chance to create the context.
+ if (auto* linux_ui = LinuxUi::instance()) {
+ if (auto context = linux_ui->CreateInputMethodContext(delegate))
diff --git a/chromium-next/patches/patch-ui_base_ime_text__input__client.h b/chromium-next/patches/patch-ui_base_ime_text__input__client.h
new file mode 100644
index 0000000000..6ab9ebe7c3
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ime_text__input__client.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ime/text_input_client.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ime/text_input_client.h
+@@ -331,7 +331,7 @@ class COMPONENT_EXPORT(UI_BASE_IME) Text
+ // fields that are considered 'private' (e.g. in incognito tabs).
+ virtual bool ShouldDoLearning() = 0;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Start composition over a given UTF-16 code range from existing text. This
+ // should only be used for composition scenario when IME wants to start
+ // composition on existing text. Returns whether the operation was successful.
diff --git a/chromium-next/patches/patch-ui_base_resource_resource__bundle.cc b/chromium-next/patches/patch-ui_base_resource_resource__bundle.cc
new file mode 100644
index 0000000000..fee57ca777
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_resource_resource__bundle.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/resource/resource_bundle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/resource/resource_bundle.cc
+@@ -924,7 +924,7 @@ void ResourceBundle::ReloadFonts() {
+ }
+
+ ResourceScaleFactor ResourceBundle::GetMaxResourceScaleFactor() const {
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return max_scale_factor_;
+ #else
+ return GetMaxSupportedResourceScaleFactor();
diff --git a/chromium-next/patches/patch-ui_base_test_skia__gold__pixel__diff.cc b/chromium-next/patches/patch-ui_base_test_skia__gold__pixel__diff.cc
new file mode 100644
index 0000000000..9321646377
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_test_skia__gold__pixel__diff.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/test/skia_gold_pixel_diff.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/test/skia_gold_pixel_diff.cc
+@@ -112,7 +112,7 @@ const char* GetPlatformName() {
+ return "windows";
+ #elif BUILDFLAG(IS_APPLE)
+ return "macOS";
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return "linux";
+ #elif BUILDFLAG(IS_CHROMEOS)
+ return "ash";
diff --git a/chromium-next/patches/patch-ui_base_test_ui__controls.h b/chromium-next/patches/patch-ui_base_test_ui__controls.h
new file mode 100644
index 0000000000..429541d819
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_test_ui__controls.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/test/ui_controls.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/test/ui_controls.h
+@@ -184,7 +184,7 @@ bool SendTouchEventsNotifyWhenDone(int a
+ base::OnceClosure task);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Forces the platform implementation to use screen coordinates, even if they're
+ // not really available, the next time that ui_controls::SendMouseMove() or
+ // ui_controls::SendMouseMoveNotifyWhenDone() is called, or some other method
diff --git a/chromium-next/patches/patch-ui_base_ui__base__features.cc b/chromium-next/patches/patch-ui_base_ui__base__features.cc
new file mode 100644
index 0000000000..2567cb0140
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ui__base__features.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ui_base_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ui_base_features.cc
+@@ -147,7 +147,7 @@ BASE_FEATURE(kWaylandUiScale,
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(IS_OZONE)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // If this feature is enabled, users not specify --ozone-platform-hint switch
+ // will get --ozone-platform-hint=auto treatment. https://crbug.com/40250220.
+ COMPONENT_EXPORT(UI_BASE_FEATURES)
+@@ -247,7 +247,7 @@ BASE_FEATURE(kUiCompositorScrollWithLaye
+ // native apps on Windows.
+ BASE_FEATURE(kExperimentalFlingAnimation,
+ "ExperimentalFlingAnimation",
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
+@@ -337,7 +337,7 @@ bool IsForcedColorsEnabled() {
+ BASE_FEATURE(kEyeDropper,
+ "EyeDropper",
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ #else
+ base::FEATURE_DISABLED_BY_DEFAULT
diff --git a/chromium-next/patches/patch-ui_base_ui__base__features.h b/chromium-next/patches/patch-ui_base_ui__base__features.h
new file mode 100644
index 0000000000..36b31455e7
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ui__base__features.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ui_base_features.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ui_base_features.h
+@@ -138,7 +138,7 @@ COMPONENT_EXPORT(UI_BASE_FEATURES)
+ BASE_DECLARE_FEATURE(kWaylandUiScale);
+ #endif // BUILDFLAG(IS_OZONE)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE_FEATURES)
+ BASE_DECLARE_FEATURE(kOverrideDefaultOzonePlatformHintToAuto);
+ #endif // BUILDFLAG(IS_LINUX)
diff --git a/chromium-next/patches/patch-ui_base_ui__base__switches.cc b/chromium-next/patches/patch-ui_base_ui__base__switches.cc
new file mode 100644
index 0000000000..1545e9b050
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ui__base__switches.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ui_base_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ui_base_switches.cc
+@@ -24,13 +24,13 @@ const char kDisableModalAnimations[] = "
+ const char kShowMacOverlayBorders[] = "show-mac-overlay-borders";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Specifies system font family name. Improves determenism when rendering
+ // pages in headless mode.
+ const char kSystemFontFamily[] = "system-font-family";
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Specify the toolkit used to construct the Linux GUI.
+ const char kUiToolkitFlag[] = "ui-toolkit";
+ // Disables GTK IME integration.
diff --git a/chromium-next/patches/patch-ui_base_ui__base__switches.h b/chromium-next/patches/patch-ui_base_ui__base__switches.h
new file mode 100644
index 0000000000..24f722f868
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_ui__base__switches.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/ui_base_switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/ui_base_switches.h
+@@ -22,11 +22,11 @@ COMPONENT_EXPORT(UI_BASE) extern const c
+ COMPONENT_EXPORT(UI_BASE) extern const char kShowMacOverlayBorders[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE) extern const char kSystemFontFamily[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ COMPONENT_EXPORT(UI_BASE) extern const char kUiToolkitFlag[];
+ COMPONENT_EXPORT(UI_BASE) extern const char kDisableGtkIme[];
+ #endif
diff --git a/chromium-next/patches/patch-ui_base_webui_web__ui__util.cc b/chromium-next/patches/patch-ui_base_webui_web__ui__util.cc
new file mode 100644
index 0000000000..e601441109
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_webui_web__ui__util.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/webui/web_ui_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/webui/web_ui_util.cc
+@@ -43,7 +43,7 @@ namespace {
+ constexpr float kMaxScaleFactor = 1000.0f;
+
+ std::string GetFontFamilyMd() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return "Roboto, " + GetFontFamily();
+ #else
+ return GetFontFamily();
+@@ -218,7 +218,7 @@ void AppendWebUiCssTextDefaults(std::str
+ std::string GetFontFamily() {
+ std::string font_family = l10n_util::GetStringUTF8(IDS_WEB_FONT_FAMILY);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::string font_name = ui::ResourceBundle::GetSharedInstance()
+ .GetFont(ui::ResourceBundle::BaseFont)
+ .GetFontName();
diff --git a/chromium-next/patches/patch-ui_base_x_x11__cursor__factory.cc b/chromium-next/patches/patch-ui_base_x_x11__cursor__factory.cc
new file mode 100644
index 0000000000..5366791e83
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_x_x11__cursor__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/x/x11_cursor_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/x/x11_cursor_factory.cc
+@@ -13,7 +13,7 @@
+ #include "ui/gfx/geometry/point.h"
+ #include "ui/gfx/x/connection.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -70,7 +70,7 @@ scoped_refptr<PlatformCursor> X11CursorF
+ }
+
+ void X11CursorFactory::ObserveThemeChanges() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* linux_ui = LinuxUi::instance();
+ DCHECK(linux_ui);
+ cursor_theme_observation_.Observe(linux_ui);
diff --git a/chromium-next/patches/patch-ui_base_x_x11__cursor__factory.h b/chromium-next/patches/patch-ui_base_x_x11__cursor__factory.h
new file mode 100644
index 0000000000..f9dcb9d91a
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_x_x11__cursor__factory.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/x/x11_cursor_factory.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/x/x11_cursor_factory.h
+@@ -20,7 +20,7 @@ namespace ui {
+ class X11Cursor;
+ class XCursorLoader;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ class LinuxUi;
+ #endif
+
+@@ -62,7 +62,7 @@ class COMPONENT_EXPORT(UI_BASE_X) X11Cur
+ // initializing `cursor_loader_` will modify `default_cursors_`.
+ std::unique_ptr<XCursorLoader> cursor_loader_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ScopedObservation<LinuxUi, CursorThemeManagerObserver>
+ cursor_theme_observation_{this};
+ #endif
diff --git a/chromium-next/patches/patch-ui_base_x_x11__cursor__loader.cc b/chromium-next/patches/patch-ui_base_x_x11__cursor__loader.cc
new file mode 100644
index 0000000000..f234698a1f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_x_x11__cursor__loader.cc
@@ -0,0 +1,47 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/x/x11_cursor_loader.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/x/x11_cursor_loader.cc
+@@ -34,7 +34,7 @@
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/xproto.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -59,7 +59,11 @@ std::string CursorPathFromLibXcursor() {
+ void operator()(void* ptr) const { dlclose(ptr); }
+ };
+
++#if BUILDFLAG(IS_BSD)
++ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so", RTLD_LAZY));
++#else
+ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so.1", RTLD_LAZY));
++#endif
+ if (!lib)
+ return "";
+
+@@ -170,7 +174,7 @@ scoped_refptr<base::RefCountedMemory> Re
+ const std::string& rm_xcursor_theme) {
+ constexpr const char kDefaultTheme[] = "default";
+ std::string themes[] = {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The toolkit theme has the highest priority.
+ LinuxUi::instance() ? LinuxUi::instance()->GetCursorThemeName()
+ : std::string(),
+@@ -359,7 +363,7 @@ uint32_t XCursorLoader::GetPreferredCurs
+ return size;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Let the toolkit have the next say.
+ auto* linux_ui = LinuxUi::instance();
+ size = linux_ui ? linux_ui->GetCursorThemeSize() : 0;
diff --git a/chromium-next/patches/patch-ui_base_x_x11__display__manager.cc b/chromium-next/patches/patch-ui_base_x_x11__display__manager.cc
new file mode 100644
index 0000000000..6a42bb45c9
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_x_x11__display__manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/x/x11_display_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/x/x11_display_manager.cc
+@@ -16,7 +16,7 @@
+ #include "ui/gfx/x/randr.h"
+ #include "ui/gfx/x/xproto.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -92,7 +92,7 @@ void XDisplayManager::FetchDisplayList()
+ ? display::Display::GetForcedDeviceScaleFactor()
+ : 1.0f};
+ const auto* display_config = &empty_display_config;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (const auto* linux_ui = ui::LinuxUi::instance()) {
+ display_config = &linux_ui->display_config();
+ }
diff --git a/chromium-next/patches/patch-ui_base_x_x11__shm__image__pool.cc b/chromium-next/patches/patch-ui_base_x_x11__shm__image__pool.cc
new file mode 100644
index 0000000000..8cc548c375
--- /dev/null
+++ b/chromium-next/patches/patch-ui_base_x_x11__shm__image__pool.cc
@@ -0,0 +1,77 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/base/x/x11_shm_image_pool.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/base/x/x11_shm_image_pool.cc
+@@ -16,6 +16,7 @@
+ #include "base/functional/callback.h"
+ #include "base/location.h"
+ #include "base/strings/string_util.h"
++#include "base/system/sys_info.h"
+ #include "build/build_config.h"
+ #include "net/base/url_util.h"
+ #include "ui/events/platform/platform_event_dispatcher.h"
+@@ -44,10 +45,14 @@ constexpr float kShmResizeShrinkThreshol
+ 1.0f / (kShmResizeThreshold * kShmResizeThreshold);
+
+ std::size_t MaxShmSegmentSizeImpl() {
++#if BUILDFLAG(IS_BSD)
++ return base::SysInfo::MaxSharedMemorySize();
++#else
+ struct shminfo info;
+ if (shmctl(0, IPC_INFO, reinterpret_cast<struct shmid_ds*>(&info)) == -1)
+ return 0;
+ return info.shmmax;
++#endif
+ }
+
+ std::size_t MaxShmSegmentSize() {
+@@ -56,14 +61,19 @@ std::size_t MaxShmSegmentSize() {
+ }
+
+ #if !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_BSD)
+ bool IsRemoteHost(const std::string& name) {
+ if (name.empty())
+ return false;
+
+ return !net::HostStringIsLocalhost(name);
+ }
++#endif
+
+ bool ShouldUseMitShm(x11::Connection* connection) {
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ // MIT-SHM may be available on remote connetions, but it will be unusable. Do
+ // a best-effort check to see if the host is remote to disable the SHM
+ // codepath. It may be possible in contrived cases for there to be a
+@@ -92,6 +102,7 @@ bool ShouldUseMitShm(x11::Connection* co
+ return false;
+
+ return true;
++#endif
+ }
+ #endif // !BUILDFLAG(IS_CHROMEOS)
+
+@@ -182,7 +193,7 @@ bool XShmImagePool::Resize(const gfx::Si
+ shmctl(state.shmid, IPC_RMID, nullptr);
+ return false;
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, a shmid can still be attached after IPC_RMID if otherwise
+ // kept alive. Detach before XShmAttach to prevent a memory leak in case
+ // the process dies.
+@@ -201,7 +212,7 @@ bool XShmImagePool::Resize(const gfx::Si
+ return false;
+ state.shmseg = shmseg;
+ state.shmem_attached_to_server = true;
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // The Linux-specific shmctl behavior above may not be portable, so we're
+ // forced to do IPC_RMID after the server has attached to the segment.
+ shmctl(state.shmid, IPC_RMID, nullptr);
diff --git a/chromium-next/patches/patch-ui_color_color__id.h b/chromium-next/patches/patch-ui_color_color__id.h
new file mode 100644
index 0000000000..7945643b2e
--- /dev/null
+++ b/chromium-next/patches/patch-ui_color_color__id.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/color/color_id.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/color/color_id.h
+@@ -618,7 +618,7 @@
+ \
+ E_CPONLY(kColorCrosSysPositive) \
+ E_CPONLY(kColorCrosSysComplementVariant)
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define PLATFORM_SPECIFIC_COLOR_IDS \
+ E_CPONLY(kColorNativeButtonBorder)\
+ E_CPONLY(kColorNativeHeaderButtonBorderActive) \
diff --git a/chromium-next/patches/patch-ui_color_color__provider__utils.cc b/chromium-next/patches/patch-ui_color_color__provider__utils.cc
new file mode 100644
index 0000000000..92ff3df1a1
--- /dev/null
+++ b/chromium-next/patches/patch-ui_color_color__provider__utils.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/color/color_provider_utils.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/color/color_provider_utils.cc
+@@ -189,7 +189,7 @@ std::string_view SystemThemeName(ui::Sys
+ switch (system_theme) {
+ case ui::SystemTheme::kDefault:
+ return "kDefault";
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case ui::SystemTheme::kGtk:
+ return "kGtk";
+ case ui::SystemTheme::kQt:
diff --git a/chromium-next/patches/patch-ui_color_system__theme.h b/chromium-next/patches/patch-ui_color_system__theme.h
new file mode 100644
index 0000000000..60128a3b1d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_color_system__theme.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/color/system_theme.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/color/system_theme.h
+@@ -15,7 +15,7 @@ namespace ui {
+ enum class SystemTheme {
+ // Classic theme, used in the default or users' chosen theme.
+ kDefault = 0,
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ kGtk = 1,
+ kQt = 2,
+ kMaxValue = kQt,
diff --git a/chromium-next/patches/patch-ui_compositor_compositor.cc b/chromium-next/patches/patch-ui_compositor_compositor.cc
new file mode 100644
index 0000000000..d6718713c9
--- /dev/null
+++ b/chromium-next/patches/patch-ui_compositor_compositor.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/compositor/compositor.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/compositor/compositor.cc
+@@ -912,7 +912,7 @@ void Compositor::OnResume() {
+ obs.ResetIfActive();
+ }
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void Compositor::OnCompleteSwapWithNewSize(const gfx::Size& size) {
+ observer_list_.Notify(
+ &CompositorObserver::OnCompositingCompleteSwapWithNewSize, this, size);
diff --git a/chromium-next/patches/patch-ui_compositor_compositor.h b/chromium-next/patches/patch-ui_compositor_compositor.h
new file mode 100644
index 0000000000..57d649f4d4
--- /dev/null
+++ b/chromium-next/patches/patch-ui_compositor_compositor.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/compositor/compositor.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/compositor/compositor.h
+@@ -456,7 +456,7 @@ class COMPOSITOR_EXPORT Compositor : pub
+ // base::PowerSuspendObserver:
+ void OnResume() override;
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ void OnCompleteSwapWithNewSize(const gfx::Size& size);
+ #endif // BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
+
diff --git a/chromium-next/patches/patch-ui_compositor_compositor__observer.h b/chromium-next/patches/patch-ui_compositor_compositor__observer.h
new file mode 100644
index 0000000000..39f4229912
--- /dev/null
+++ b/chromium-next/patches/patch-ui_compositor_compositor__observer.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/compositor/compositor_observer.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/compositor/compositor_observer.h
+@@ -52,7 +52,7 @@ class COMPOSITOR_EXPORT CompositorObserv
+ // Called when a child of the compositor is resizing.
+ virtual void OnCompositingChildResizing(Compositor* compositor) {}
+
+-#if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && BUILDFLAG(IS_OZONE_X11)
+ // Called when a swap with new size is completed.
+ virtual void OnCompositingCompleteSwapWithNewSize(ui::Compositor* compositor,
+ const gfx::Size& size) {}
diff --git a/chromium-next/patches/patch-ui_display_screen.cc b/chromium-next/patches/patch-ui_display_screen.cc
new file mode 100644
index 0000000000..43b3242b26
--- /dev/null
+++ b/chromium-next/patches/patch-ui_display_screen.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/display/screen.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/display/screen.cc
+@@ -86,7 +86,7 @@ void Screen::SetDisplayForNewWindows(int
+ display_id_for_new_windows_ = display_id;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ Screen::ScreenSaverSuspender::~ScreenSaverSuspender() = default;
+
+ std::unique_ptr<Screen::ScreenSaverSuspender> Screen::SuspendScreenSaver() {
diff --git a/chromium-next/patches/patch-ui_display_screen.h b/chromium-next/patches/patch-ui_display_screen.h
new file mode 100644
index 0000000000..fb973df8da
--- /dev/null
+++ b/chromium-next/patches/patch-ui_display_screen.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/display/screen.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/display/screen.h
+@@ -140,7 +140,7 @@ class DISPLAY_EXPORT Screen {
+ // (both of which may or may not be `nearest_id`).
+ display::ScreenInfos GetScreenInfosNearestDisplay(int64_t nearest_id) const;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Object which suspends the platform-specific screensaver for the duration of
+ // its existence.
+ class ScreenSaverSuspender {
+@@ -243,7 +243,7 @@ class DISPLAY_EXPORT Screen {
+ int64_t display_id_for_new_windows_;
+ int64_t scoped_display_id_for_new_windows_ = display::kInvalidDisplayId;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ uint32_t screen_saver_suspension_count_ = 0;
+ #endif // BUILDFLAG(IS_LINUX)
+ };
diff --git a/chromium-next/patches/patch-ui_events_devices_x11_device__data__manager__x11.cc b/chromium-next/patches/patch-ui_events_devices_x11_device__data__manager__x11.cc
new file mode 100644
index 0000000000..cbfc893f89
--- /dev/null
+++ b/chromium-next/patches/patch-ui_events_devices_x11_device__data__manager__x11.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/events/devices/x11/device_data_manager_x11.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/events/devices/x11/device_data_manager_x11.cc
+@@ -849,6 +849,7 @@ void DeviceDataManagerX11::SetDisabledKe
+ }
+
+ void DeviceDataManagerX11::DisableDevice(x11::Input::DeviceId deviceid) {
++ NOTIMPLEMENTED();
+ blocked_devices_.set(static_cast<uint32_t>(deviceid), true);
+ // TODO(rsadam@): Support blocking touchscreen devices.
+ std::vector<KeyboardDevice> keyboards = GetKeyboardDevices();
diff --git a/chromium-next/patches/patch-ui_events_event.cc b/chromium-next/patches/patch-ui_events_event.cc
new file mode 100644
index 0000000000..096faa96b0
--- /dev/null
+++ b/chromium-next/patches/patch-ui_events_event.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/events/event.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/events/event.cc
+@@ -373,7 +373,7 @@ std::string LocatedEvent::ToString() con
+ MouseEvent::MouseEvent(const PlatformEvent& native_event)
+ : LocatedEvent(native_event),
+ changed_button_flags_(GetChangedMouseButtonFlagsFromNative(native_event)),
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ movement_(GetMouseMovementFromNative(native_event)),
+ #endif
+ pointer_details_(GetMousePointerDetailsFromNative(native_event)) {
+@@ -629,7 +629,7 @@ std::unique_ptr<Event> MouseWheelEvent::
+ return std::make_unique<MouseWheelEvent>(*this);
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // This value matches Windows, Fuchsia WHEEL_DELTA, and (roughly) Firefox on
+ // Linux.
+ // static
+@@ -889,7 +889,7 @@ void KeyEvent::InitializeNative() {
+ if (synthesize_key_repeat_enabled_ && IsRepeated(GetLastKeyEvent()))
+ SetFlags(flags() | EF_IS_REPEAT);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ NormalizeFlags();
+ #elif BUILDFLAG(IS_WIN)
+ // Only Windows has native character events.
diff --git a/chromium-next/patches/patch-ui_events_event__switches.cc b/chromium-next/patches/patch-ui_events_event__switches.cc
new file mode 100644
index 0000000000..dbdbc2f8c7
--- /dev/null
+++ b/chromium-next/patches/patch-ui_events_event__switches.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/events/event_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/events/event_switches.cc
+@@ -21,7 +21,7 @@ const char kCompensateForUnstablePinchZo
+ // value is a floating point number that is interpreted as a distance in pixels.
+ const char kTouchSlopDistance[] = "touch-slop-distance";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Tells chrome to interpret events from these devices as touch events. Only
+ // available with XInput 2 (i.e. X server 1.8 or above). The id's of the
+ // devices can be retrieved from 'xinput list'.
diff --git a/chromium-next/patches/patch-ui_events_event__switches.h b/chromium-next/patches/patch-ui_events_event__switches.h
new file mode 100644
index 0000000000..6a1a0fea6c
--- /dev/null
+++ b/chromium-next/patches/patch-ui_events_event__switches.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/events/event_switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/events/event_switches.h
+@@ -13,7 +13,7 @@ namespace switches {
+ EVENTS_BASE_EXPORT extern const char kCompensateForUnstablePinchZoom[];
+ EVENTS_BASE_EXPORT extern const char kTouchSlopDistance[];
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ EVENTS_BASE_EXPORT extern const char kTouchDevices[];
+ EVENTS_BASE_EXPORT extern const char kPenDevices[];
+ #endif
diff --git a/chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.cc b/chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.cc
new file mode 100644
index 0000000000..58de6736da
--- /dev/null
+++ b/chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/events/keycodes/dom/keycode_converter.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/events/keycodes/dom/keycode_converter.cc
+@@ -18,7 +18,7 @@
+ #include "ui/events/keycodes/dom/dom_code.h"
+ #include "ui/events/keycodes/dom/dom_key.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+ #include <linux/input.h>
+ #endif
+
+@@ -31,7 +31,7 @@ namespace {
+ #if BUILDFLAG(IS_WIN)
+ #define DOM_CODE(usb, evdev, xkb, win, mac, code, id) \
+ { usb, win, code }
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define DOM_CODE(usb, evdev, xkb, win, mac, code, id) \
+ { usb, xkb, code }
+ #elif BUILDFLAG(IS_APPLE)
+@@ -70,7 +70,7 @@ struct DomKeyMapEntry {
+ #undef DOM_KEY_UNI
+ #undef DOM_KEY_MAP_DECLARATION_END
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+
+ // The offset between XKB Keycode and evdev code.
+ constexpr int kXkbKeycodeOffset = 8;
+@@ -191,7 +191,7 @@ int KeycodeConverter::DomCodeToNativeKey
+ return UsbKeycodeToNativeKeycode(static_cast<uint32_t>(code));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+ // static
+ DomCode KeycodeConverter::XkbKeycodeToDomCode(uint32_t xkb_keycode) {
+ // Currently XKB keycode is the native keycode.
diff --git a/chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.h b/chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.h
new file mode 100644
index 0000000000..2c026f4a59
--- /dev/null
+++ b/chromium-next/patches/patch-ui_events_keycodes_dom_keycode__converter.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/events/keycodes/dom/keycode_converter.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/events/keycodes/dom/keycode_converter.h
+@@ -64,7 +64,7 @@ class KeycodeConverter {
+ // Convert a DomCode into a native keycode.
+ static int DomCodeToNativeKeycode(DomCode code);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD)
+ // Convert a XKB keycode into a DomCode.
+ static DomCode XkbKeycodeToDomCode(uint32_t xkb_keycode);
+
diff --git a/chromium-next/patches/patch-ui_gfx_BUILD.gn b/chromium-next/patches/patch-ui_gfx_BUILD.gn
new file mode 100644
index 0000000000..36f60b50f8
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/BUILD.gn
+@@ -653,7 +653,7 @@ source_set("memory_buffer_sources") {
+ deps += [ "//build/config/linux/libdrm" ]
+ }
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux || is_chromeos || is_android) && !is_bsd) {
+ deps += [ "//third_party/libsync" ]
+ }
+
diff --git a/chromium-next/patches/patch-ui_gfx_canvas__skia.cc b/chromium-next/patches/patch-ui_gfx_canvas__skia.cc
new file mode 100644
index 0000000000..4136288068
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_canvas__skia.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/canvas_skia.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/canvas_skia.cc
+@@ -213,7 +213,7 @@ void Canvas::DrawStringRectWithFlags(con
+ Range range = StripAcceleratorChars(flags, &adjusted_text);
+ bool elide_text = ((flags & NO_ELLIPSIS) == 0);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, eliding really means fading the end of the string. But only
+ // for LTR text. RTL text is still elided (on the left) with "...".
+ if (elide_text) {
diff --git a/chromium-next/patches/patch-ui_gfx_font__fallback__linux.cc b/chromium-next/patches/patch-ui_gfx_font__fallback__linux.cc
new file mode 100644
index 0000000000..249d8db8c3
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_font__fallback__linux.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/font_fallback_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/font_fallback_linux.cc
+@@ -32,6 +32,8 @@
+ #include "ui/gfx/linux/fontconfig_util.h"
+ #include "ui/gfx/platform_font.h"
+
++#include <unistd.h>
++
+ namespace gfx {
+
+ namespace {
diff --git a/chromium-next/patches/patch-ui_gfx_font__render__params.h b/chromium-next/patches/patch-ui_gfx_font__render__params.h
new file mode 100644
index 0000000000..1f202ccb9b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_font__render__params.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/font_render_params.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/font_render_params.h
+@@ -115,7 +115,7 @@ COMPONENT_EXPORT(GFX)
+ FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
+ std::string* family_out);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ // Clears GetFontRenderParams()'s cache. Intended to be called by tests that are
+ // changing Fontconfig's configuration.
+ COMPONENT_EXPORT(GFX) void ClearFontRenderParamsCacheForTest();
+@@ -125,7 +125,7 @@ COMPONENT_EXPORT(GFX) void ClearFontRend
+ COMPONENT_EXPORT(GFX) float GetFontRenderParamsDeviceScaleFactor();
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Sets the device scale factor for FontRenderParams to decide
+ // if it should enable subpixel positioning.
+ COMPONENT_EXPORT(GFX)
diff --git a/chromium-next/patches/patch-ui_gfx_font__render__params__linux.cc b/chromium-next/patches/patch-ui_gfx_font__render__params__linux.cc
new file mode 100644
index 0000000000..3ee715acb5
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_font__render__params__linux.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/font_render_params_linux.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/font_render_params_linux.cc
+@@ -24,7 +24,7 @@
+ #include "ui/gfx/linux/fontconfig_util.h"
+ #include "ui/gfx/switches.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -211,7 +211,7 @@ FontRenderParams GetFontRenderParams(con
+
+ // Start with the delegate's settings, but let Fontconfig have the final say.
+ FontRenderParams params;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (auto* linux_ui = ui::LinuxUi::instance()) {
+ params = linux_ui->GetDefaultFontRenderParams();
+ }
diff --git a/chromium-next/patches/patch-ui_gfx_font__util.cc b/chromium-next/patches/patch-ui_gfx_font__util.cc
new file mode 100644
index 0000000000..192ac00f3b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_font__util.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/font_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/font_util.cc
+@@ -6,7 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <fontconfig/fontconfig.h>
+ #include "ui/gfx/linux/fontconfig_util.h"
+ #endif
+@@ -24,7 +24,7 @@ void InitializeFonts() {
+ // background (resources have not yet been granted to cast) since it prevents
+ // the long delay the user would have seen on first rendering.
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Early initialize FontConfig.
+ InitializeGlobalFontConfigAsync();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.cc b/chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.cc
new file mode 100644
index 0000000000..b98ff21669
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/gpu_memory_buffer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/gpu_memory_buffer.cc
+@@ -63,7 +63,7 @@ GpuMemoryBufferHandle GpuMemoryBufferHan
+ handle.region = region.Duplicate();
+ handle.offset = offset;
+ handle.stride = stride;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ handle.native_pixmap_handle = CloneHandleForIPC(native_pixmap_handle);
+ #elif BUILDFLAG(IS_APPLE)
+ handle.io_surface = io_surface;
diff --git a/chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.h b/chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.h
new file mode 100644
index 0000000000..e0222c85ce
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_gpu__memory__buffer.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/gpu_memory_buffer.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/gpu_memory_buffer.h
+@@ -15,7 +15,7 @@
+ #include "ui/gfx/generic_shared_memory_id.h"
+ #include "ui/gfx/geometry/rect.h"
+
+-#if BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/native_pixmap_handle.h"
+ #elif BUILDFLAG(IS_APPLE)
+ #include "ui/gfx/mac/io_surface.h"
+@@ -76,7 +76,7 @@ struct COMPONENT_EXPORT(GFX) GpuMemoryBu
+ base::UnsafeSharedMemoryRegion region;
+ uint32_t offset = 0;
+ uint32_t stride = 0;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ NativePixmapHandle native_pixmap_handle;
+ #elif BUILDFLAG(IS_APPLE)
+ ScopedIOSurface io_surface;
diff --git a/chromium-next/patches/patch-ui_gfx_linux_dmabuf__uapi.h b/chromium-next/patches/patch-ui_gfx_linux_dmabuf__uapi.h
new file mode 100644
index 0000000000..dcb51a267f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_linux_dmabuf__uapi.h
@@ -0,0 +1,42 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/linux/dmabuf_uapi.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/linux/dmabuf_uapi.h
+@@ -5,12 +5,11 @@
+ #ifndef UI_GFX_LINUX_DMABUF_UAPI_H_
+ #define UI_GFX_LINUX_DMABUF_UAPI_H_
+
+-#include <linux/version.h>
++#include <sys/types.h>
+
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+-#include <linux/dma-buf.h>
+-#else
+-#include <linux/types.h>
++typedef int32_t __s32;
++typedef uint32_t __u32;
++typedef uint64_t __u64;
+
+ struct dma_buf_sync {
+ __u64 flags;
+@@ -26,9 +25,7 @@ constexpr __u64 DMA_BUF_SYNC_END = 1 <<
+ constexpr char DMA_BUF_BASE = 'b';
+ constexpr unsigned long DMA_BUF_IOCTL_SYNC =
+ _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync);
+-#endif
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
+ struct dma_buf_export_sync_file {
+ __u32 flags;
+ __s32 fd;
+@@ -43,6 +40,5 @@ constexpr unsigned long DMA_BUF_IOCTL_EX
+ _IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file);
+ constexpr unsigned long DMA_BUF_IOCTL_IMPORT_SYNC_FILE =
+ _IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file);
+-#endif
+
+ #endif // UI_GFX_LINUX_DMABUF_UAPI_H_
diff --git a/chromium-next/patches/patch-ui_gfx_linux_gbm__wrapper.cc b/chromium-next/patches/patch-ui_gfx_linux_gbm__wrapper.cc
new file mode 100644
index 0000000000..1176ce3e3a
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_linux_gbm__wrapper.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/linux/gbm_wrapper.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/linux/gbm_wrapper.cc
+@@ -319,7 +319,7 @@ class Device final : public ui::GbmDevic
+ // of 1x1 BOs which are destroyed before creating the final BO creation used
+ // to instantiate the returned GbmBuffer.
+ gfx::Size size_for_verification =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ gfx::Size(1, 1);
+ #else
+ requested_size;
diff --git a/chromium-next/patches/patch-ui_gfx_mojom_buffer__types__mojom__traits.cc b/chromium-next/patches/patch-ui_gfx_mojom_buffer__types__mojom__traits.cc
new file mode 100644
index 0000000000..aaf7190076
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_mojom_buffer__types__mojom__traits.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/mojom/buffer_types_mojom_traits.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/mojom/buffer_types_mojom_traits.cc
+@@ -33,7 +33,7 @@ gfx::mojom::GpuMemoryBufferPlatformHandl
+ return gfx::mojom::GpuMemoryBufferPlatformHandle::NewSharedMemoryHandle(
+ std::move(handle.region));
+ case gfx::NATIVE_PIXMAP:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ return gfx::mojom::GpuMemoryBufferPlatformHandle::NewNativePixmapHandle(
+ std::move(handle.native_pixmap_handle));
+ #else
+@@ -115,7 +115,7 @@ bool StructTraits<gfx::mojom::GpuMemoryB
+ out->type = gfx::SHARED_MEMORY_BUFFER;
+ out->region = std::move(platform_handle->get_shared_memory_handle());
+ return true;
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ case gfx::mojom::GpuMemoryBufferPlatformHandleDataView::Tag::
+ kNativePixmapHandle:
+ out->type = gfx::NATIVE_PIXMAP;
diff --git a/chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.cc b/chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.cc
new file mode 100644
index 0000000000..8a623ae07c
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.cc
@@ -0,0 +1,40 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/mojom/native_handle_types_mojom_traits.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/mojom/native_handle_types_mojom_traits.cc
+@@ -8,11 +8,11 @@
+
+ namespace mojo {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ mojo::PlatformHandle StructTraits<
+ gfx::mojom::NativePixmapPlaneDataView,
+ gfx::NativePixmapPlane>::buffer_handle(gfx::NativePixmapPlane& plane) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return mojo::PlatformHandle(std::move(plane.fd));
+ #elif BUILDFLAG(IS_FUCHSIA)
+ return mojo::PlatformHandle(std::move(plane.vmo));
+@@ -28,7 +28,7 @@ bool StructTraits<
+ out->size = data.size();
+
+ mojo::PlatformHandle handle = data.TakeBufferHandle();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!handle.is_fd())
+ return false;
+ out->fd = handle.TakeFD();
+@@ -54,7 +54,7 @@ bool StructTraits<
+ gfx::mojom::NativePixmapHandleDataView,
+ gfx::NativePixmapHandle>::Read(gfx::mojom::NativePixmapHandleDataView data,
+ gfx::NativePixmapHandle* out) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ out->modifier = data.modifier();
+ out->supports_zero_copy_webgpu_import =
+ data.supports_zero_copy_webgpu_import();
diff --git a/chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.h b/chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.h
new file mode 100644
index 0000000000..8139e62922
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_mojom_native__handle__types__mojom__traits.h
@@ -0,0 +1,42 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/mojom/native_handle_types_mojom_traits.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/mojom/native_handle_types_mojom_traits.h
+@@ -16,7 +16,7 @@
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "ui/gfx/mojom/native_handle_types.mojom-shared.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ #include "ui/gfx/native_pixmap_handle.h"
+ #endif
+
+@@ -26,7 +26,7 @@
+
+ namespace mojo {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE) || BUILDFLAG(IS_BSD)
+ template <>
+ struct COMPONENT_EXPORT(GFX_NATIVE_HANDLE_TYPES_SHARED_MOJOM_TRAITS)
+ StructTraits<gfx::mojom::NativePixmapPlaneDataView,
+@@ -54,13 +54,13 @@ struct COMPONENT_EXPORT(GFX_NATIVE_HANDL
+ return pixmap_handle.planes;
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static uint64_t modifier(const gfx::NativePixmapHandle& pixmap_handle) {
+ return pixmap_handle.modifier;
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static bool supports_zero_copy_webgpu_import(
+ const gfx::NativePixmapHandle& pixmap_handle) {
+ return pixmap_handle.supports_zero_copy_webgpu_import;
diff --git a/chromium-next/patches/patch-ui_gfx_native__pixmap__handle.cc b/chromium-next/patches/patch-ui_gfx_native__pixmap__handle.cc
new file mode 100644
index 0000000000..1eec0d3a4f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_native__pixmap__handle.cc
@@ -0,0 +1,68 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/native_pixmap_handle.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/native_pixmap_handle.cc
+@@ -11,7 +11,7 @@
+ #include "ui/gfx/buffer_format_util.h"
+ #include "ui/gfx/geometry/size.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <drm_fourcc.h>
+ #include <unistd.h>
+
+@@ -23,9 +23,13 @@
+ #include "base/fuchsia/fuchsia_logging.h"
+ #endif
+
++#if BUILDFLAG(IS_BSD)
++#include <unistd.h>
++#endif
++
+ namespace gfx {
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ static_assert(NativePixmapHandle::kNoModifier == DRM_FORMAT_MOD_INVALID,
+ "gfx::NativePixmapHandle::kNoModifier should be an alias for"
+ "DRM_FORMAT_MOD_INVALID");
+@@ -36,7 +40,7 @@ NativePixmapPlane::NativePixmapPlane() :
+ NativePixmapPlane::NativePixmapPlane(int stride,
+ int offset,
+ uint64_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ base::ScopedFD fd
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -47,7 +51,7 @@ NativePixmapPlane::NativePixmapPlane(int
+ : stride(stride),
+ offset(offset),
+ size(size)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ fd(std::move(fd))
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -75,7 +79,7 @@ NativePixmapHandle& NativePixmapHandle::
+ NativePixmapHandle CloneHandleForIPC(const NativePixmapHandle& handle) {
+ NativePixmapHandle clone;
+ for (auto& plane : handle.planes) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ DCHECK(plane.fd.is_valid());
+ // Combining the HANDLE_EINTR and ScopedFD's constructor causes the compiler
+ // to emit some very strange assembly that tends to cause FD ownership
+@@ -113,7 +117,7 @@ NativePixmapHandle CloneHandleForIPC(con
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ clone.modifier = handle.modifier;
+ clone.supports_zero_copy_webgpu_import =
+ handle.supports_zero_copy_webgpu_import;
diff --git a/chromium-next/patches/patch-ui_gfx_native__pixmap__handle.h b/chromium-next/patches/patch-ui_gfx_native__pixmap__handle.h
new file mode 100644
index 0000000000..e989ca649d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_native__pixmap__handle.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/native_pixmap_handle.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/native_pixmap_handle.h
+@@ -14,7 +14,7 @@
+ #include "build/build_config.h"
+ #include "ui/gfx/buffer_types.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/files/scoped_file.h"
+ #endif
+
+@@ -34,7 +34,7 @@ struct COMPONENT_EXPORT(GFX) NativePixma
+ NativePixmapPlane(int stride,
+ int offset,
+ uint64_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ base::ScopedFD fd
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -55,7 +55,7 @@ struct COMPONENT_EXPORT(GFX) NativePixma
+ // This is necessary to map the buffers.
+ uint64_t size;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // File descriptor for the underlying memory object (usually dmabuf).
+ base::ScopedFD fd;
+ #elif BUILDFLAG(IS_FUCHSIA)
+@@ -78,7 +78,7 @@ struct COMPONENT_EXPORT(GFX) NativePixma
+
+ std::vector<NativePixmapPlane> planes;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The modifier is retrieved from GBM library and passed to EGL driver.
+ // Generally it's platform specific, and we don't need to modify it in
+ // Chromium code. Also one per plane per entry.
diff --git a/chromium-next/patches/patch-ui_gfx_native__widget__types.h b/chromium-next/patches/patch-ui_gfx_native__widget__types.h
new file mode 100644
index 0000000000..fc3586319a
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_native__widget__types.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/native_widget_types.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/native_widget_types.h
+@@ -101,7 +101,7 @@ class ViewAndroid;
+ #endif
+ class SkBitmap;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ extern "C" {
+ struct _AtkObject;
+ using AtkObject = struct _AtkObject;
+@@ -214,7 +214,7 @@ using NativeViewAccessible = id;
+ #else
+ using NativeViewAccessible = struct objc_object*;
+ #endif
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Linux doesn't have a native font type.
+ using NativeViewAccessible = AtkObject*;
+ #else
diff --git a/chromium-next/patches/patch-ui_gfx_platform__font__skia.cc b/chromium-next/patches/patch-ui_gfx_platform__font__skia.cc
new file mode 100644
index 0000000000..e61b326123
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_platform__font__skia.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/platform_font_skia.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/platform_font_skia.cc
+@@ -29,7 +29,7 @@
+ #include "ui/gfx/system_fonts_win.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -167,7 +167,7 @@ void PlatformFontSkia::EnsuresDefaultFon
+ weight = system_font.GetWeight();
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On Linux, LinuxUi is used to query the native toolkit (e.g.
+ // GTK) for the default UI font.
+ if (auto* linux_ui = ui::LinuxUi::instance()) {
diff --git a/chromium-next/patches/patch-ui_gfx_render__text__api__fuzzer.cc b/chromium-next/patches/patch-ui_gfx_render__text__api__fuzzer.cc
new file mode 100644
index 0000000000..294872b20f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_render__text__api__fuzzer.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/render_text_api_fuzzer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/render_text_api_fuzzer.cc
+@@ -19,7 +19,7 @@
+ #include "ui/gfx/font_util.h"
+ #include "ui/gfx/render_text.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/test_fonts/fontconfig/fontconfig_util_linux.h"
+ #endif
+
+@@ -46,7 +46,7 @@ struct Environment {
+
+ CHECK(base::i18n::InitializeICU());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ test_fonts::SetUpFontconfig();
+ #endif
+ gfx::InitializeFonts();
diff --git a/chromium-next/patches/patch-ui_gfx_render__text__fuzzer.cc b/chromium-next/patches/patch-ui_gfx_render__text__fuzzer.cc
new file mode 100644
index 0000000000..e66e93c11d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_render__text__fuzzer.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/render_text_fuzzer.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/render_text_fuzzer.cc
+@@ -17,7 +17,7 @@
+ #include "ui/gfx/canvas.h"
+ #include "ui/gfx/font_util.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "third_party/test_fonts/fontconfig/fontconfig_util_linux.h"
+ #endif
+
+@@ -40,7 +40,7 @@ struct Environment {
+
+ CHECK(base::i18n::InitializeICU());
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ test_fonts::SetUpFontconfig();
+ #endif
+ gfx::InitializeFonts();
diff --git a/chromium-next/patches/patch-ui_gfx_switches.cc b/chromium-next/patches/patch-ui_gfx_switches.cc
new file mode 100644
index 0000000000..84ed13cbad
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_switches.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/switches.cc
+@@ -32,7 +32,7 @@ const char kForcePrefersNoReducedMotion[
+ // Run in headless mode, i.e., without a UI or display server dependencies.
+ const char kHeadless[] = "headless";
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Which X11 display to connect to. Emulates the GTK+ "--display=" command line
+ // argument. In use only with Ozone/X11.
+ const char kX11Display[] = "display";
diff --git a/chromium-next/patches/patch-ui_gfx_switches.h b/chromium-next/patches/patch-ui_gfx_switches.h
new file mode 100644
index 0000000000..f5a3dbabd0
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_switches.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/switches.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/switches.h
+@@ -18,7 +18,7 @@ GFX_SWITCHES_EXPORT extern const char kF
+ GFX_SWITCHES_EXPORT extern const char kForcePrefersNoReducedMotion[];
+ GFX_SWITCHES_EXPORT extern const char kHeadless[];
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ GFX_SWITCHES_EXPORT extern const char kX11Display[];
+ GFX_SWITCHES_EXPORT extern const char kNoXshm[];
+ #endif
diff --git a/chromium-next/patches/patch-ui_gfx_x_atom__cache.cc b/chromium-next/patches/patch-ui_gfx_x_atom__cache.cc
new file mode 100644
index 0000000000..185e7936da
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_x_atom__cache.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/x/atom_cache.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/x/atom_cache.cc
+@@ -155,6 +155,7 @@ constexpr auto kAtomsToCache = std::to_a
+ "application/octet-stream",
+ "application/vnd.chromium.test",
+ "chromium/filename",
++ "chromium/from-privileged",
+ "chromium/x-bookmark-entries",
+ "chromium/x-browser-actions",
+ "chromium/x-file-system-files",
diff --git a/chromium-next/patches/patch-ui_gfx_x_generated__protos_dri3.cc b/chromium-next/patches/patch-ui_gfx_x_generated__protos_dri3.cc
new file mode 100644
index 0000000000..324cf2a581
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_x_generated__protos_dri3.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/x/generated_protos/dri3.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/x/generated_protos/dri3.cc
+@@ -27,6 +27,8 @@
+ #include <xcb/xcb.h>
+ #include <xcb/xcbext.h>
+
++#include <unistd.h>
++
+ #include "base/logging.h"
+ #include "base/posix/eintr_wrapper.h"
+ #include "ui/gfx/x/connection.h"
diff --git a/chromium-next/patches/patch-ui_gfx_x_generated__protos_shm.cc b/chromium-next/patches/patch-ui_gfx_x_generated__protos_shm.cc
new file mode 100644
index 0000000000..c0bfcd2cf4
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_x_generated__protos_shm.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/x/generated_protos/shm.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/x/generated_protos/shm.cc
+@@ -27,6 +27,8 @@
+ #include <xcb/xcb.h>
+ #include <xcb/xcbext.h>
+
++#include <unistd.h>
++
+ #include "base/logging.h"
+ #include "base/posix/eintr_wrapper.h"
+ #include "ui/gfx/x/connection.h"
diff --git a/chromium-next/patches/patch-ui_gfx_x_xlib__support.cc b/chromium-next/patches/patch-ui_gfx_x_xlib__support.cc
new file mode 100644
index 0000000000..7258158c44
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gfx_x_xlib__support.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gfx/x/xlib_support.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gfx/x/xlib_support.cc
+@@ -39,10 +39,18 @@ void InitXlib() {
+ return;
+ }
+
++#if BUILDFLAG(IS_BSD)
++ CHECK(xlib_loader->Load("libX11.so"));
++#else
+ CHECK(xlib_loader->Load("libX11.so.6"));
++#endif
+
+ auto* xlib_xcb_loader = GetXlibXcbLoader();
++#if BUILDFLAG(IS_BSD)
++ CHECK(xlib_xcb_loader->Load("libX11-xcb.so"));
++#else
+ CHECK(xlib_xcb_loader->Load("libX11-xcb.so.1"));
++#endif
+
+ CHECK(xlib_loader->XInitThreads());
+
diff --git a/chromium-next/patches/patch-ui_gl_BUILD.gn b/chromium-next/patches/patch-ui_gl_BUILD.gn
new file mode 100644
index 0000000000..83b1d89485
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_BUILD.gn
@@ -0,0 +1,32 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/BUILD.gn
+@@ -166,7 +166,6 @@ component("gl") {
+ public_deps = [
+ ":gl_enums",
+ "//base",
+- "//third_party/mesa_headers",
+ "//ui/events/platform",
+ "//ui/gfx",
+ "//ui/gfx/geometry",
+@@ -314,7 +313,6 @@ component("gl") {
+ data_deps += [
+ "//third_party/angle:libEGL",
+ "//third_party/angle:libGLESv2",
+- "//third_party/mesa_headers",
+ ]
+ if (enable_swiftshader) {
+ data_deps += [
+@@ -539,7 +537,6 @@ test("gl_unittests") {
+
+ data_deps = [
+ "//testing/buildbot/filters:gl_unittests_filters",
+- "//third_party/mesa_headers",
+ ]
+
+ if (is_win) {
diff --git a/chromium-next/patches/patch-ui_gl_gl__context.cc b/chromium-next/patches/patch-ui_gl_gl__context.cc
new file mode 100644
index 0000000000..44a358ecf7
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_gl__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/gl_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/gl_context.cc
+@@ -516,7 +516,7 @@ bool GLContext::MakeVirtuallyCurrent(
+ DCHECK(virtual_context->IsCurrent(surface));
+
+ if (switched_real_contexts || virtual_context != current_virtual_context_) {
+-#if DCHECK_IS_ON()
++#if DCHECK_IS_ON() && !BUILDFLAG(IS_BSD)
+ GLenum error = glGetError();
+ // Accepting a context loss error here enables using debug mode to work on
+ // context loss handling in virtual context mode.
diff --git a/chromium-next/patches/patch-ui_gl_gl__fence.cc b/chromium-next/patches/patch-ui_gl_gl__fence.cc
new file mode 100644
index 0000000000..e8488a53ed
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_gl__fence.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/gl_fence.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/gl_fence.cc
+@@ -17,7 +17,7 @@
+ #include "ui/gl/gl_surface_egl.h"
+ #include "ui/gl/gl_version_info.h"
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #define USE_GL_FENCE_ANDROID_NATIVE_FENCE_SYNC
+ #include "ui/gl/gl_fence_android_native_fence_sync.h"
+ #endif
diff --git a/chromium-next/patches/patch-ui_gl_gl__implementation.cc b/chromium-next/patches/patch-ui_gl_gl__implementation.cc
new file mode 100644
index 0000000000..5cdec72136
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_gl__implementation.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/gl_implementation.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/gl_implementation.cc
+@@ -252,7 +252,7 @@ GetRequestedGLImplementationFromCommandL
+ const base::CommandLine* command_line) {
+ bool overrideUseSoftwareGL =
+ command_line->HasSwitch(switches::kOverrideUseSoftwareGLForTests);
+-#if BUILDFLAG(IS_LINUX) || \
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE))
+ if (std::getenv("RUNNING_UNDER_RR")) {
+ // https://rr-project.org/ is a Linux-only record-and-replay debugger that
diff --git a/chromium-next/patches/patch-ui_gl_gl__switches.cc b/chromium-next/patches/patch-ui_gl_gl__switches.cc
new file mode 100644
index 0000000000..196e46e970
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_gl__switches.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/gl_switches.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/gl_switches.cc
+@@ -11,7 +11,7 @@
+ #include "base/android/build_info.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <vulkan/vulkan_core.h>
+ #include "third_party/angle/src/gpu_info_util/SystemInfo.h" // nogncheck
+ #endif
+@@ -289,7 +289,7 @@ bool IsDefaultANGLEVulkan() {
+ base::android::SDK_VERSION_Q)
+ return false;
+ #endif // BUILDFLAG(IS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ angle::SystemInfo system_info;
+ if (!angle::GetSystemInfoVulkan(&system_info))
+ return false;
+@@ -301,7 +301,7 @@ bool IsDefaultANGLEVulkan() {
+
+ const auto& active_gpu = system_info.gpus[system_info.activeGPUIndex];
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Vulkan 1.1 is required.
+ if (active_gpu.driverApiVersion < VK_VERSION_1_1)
+ return false;
diff --git a/chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.cc b/chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.cc
new file mode 100644
index 0000000000..170c8be9c5
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.cc
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/sync_control_vsync_provider.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/sync_control_vsync_provider.cc
+@@ -11,7 +11,7 @@
+ #include "base/trace_event/trace_event.h"
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // These constants define a reasonable range for a calculated refresh interval.
+ // Calculating refreshes out of this range will be considered a fatal error.
+ const int64_t kMinVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 400;
+@@ -26,7 +26,7 @@ const double kRelativeIntervalDifference
+ namespace gl {
+
+ SyncControlVSyncProvider::SyncControlVSyncProvider() : gfx::VSyncProvider() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On platforms where we can't get an accurate reading on the refresh
+ // rate we fall back to the assumption that we're displaying 60 frames
+ // per second.
+@@ -48,7 +48,7 @@ bool SyncControlVSyncProvider::GetVSyncP
+ base::TimeTicks* timebase_out,
+ base::TimeDelta* interval_out) {
+ TRACE_EVENT0("gpu", "SyncControlVSyncProvider::GetVSyncParameters");
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The actual clock used for the system time returned by
+ // eglGetSyncValuesCHROMIUM is unspecified. In practice, the clock used is
+ // likely to be either CLOCK_REALTIME or CLOCK_MONOTONIC, so we compare the
+@@ -160,7 +160,7 @@ bool SyncControlVSyncProvider::GetVSyncP
+ }
+
+ bool SyncControlVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
diff --git a/chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.h b/chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.h
new file mode 100644
index 0000000000..a7446ee483
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gl_sync__control__vsync__provider.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gl/sync_control_vsync_provider.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gl/sync_control_vsync_provider.h
+@@ -31,7 +31,7 @@ class SyncControlVSyncProvider : public
+ bool SupportGetVSyncParametersIfAvailable() const override;
+
+ static constexpr bool IsSupported() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return true;
+ #else
+ return false;
+@@ -46,7 +46,7 @@ class SyncControlVSyncProvider : public
+ virtual bool GetMscRate(int32_t* numerator, int32_t* denominator) = 0;
+
+ private:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::TimeTicks last_timebase_;
+ uint64_t last_media_stream_counter_ = 0;
+ base::TimeDelta last_good_interval_;
diff --git a/chromium-next/patches/patch-ui_gtk_gtk__compat.cc b/chromium-next/patches/patch-ui_gtk_gtk__compat.cc
new file mode 100644
index 0000000000..d22422598f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gtk_gtk__compat.cc
@@ -0,0 +1,56 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gtk/gtk_compat.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gtk/gtk_compat.cc
+@@ -62,27 +62,47 @@ auto DlCast(void* symbol) {
+ }
+
+ void* GetLibGio() {
++#if BUILDFLAG(IS_BSD)
++ static void* libgio = DlOpen("libgio-2.0.so");
++#else
+ static void* libgio = DlOpen("libgio-2.0.so.0");
++#endif
+ return libgio;
+ }
+
+ void* GetLibGdkPixbuf() {
++#if BUILDFLAG(IS_BSD)
++ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so");
++#else
+ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0");
++#endif
+ return libgdk_pixbuf;
+ }
+
+ void* GetLibGdk3() {
++#if BUILDFLAG(IS_BSD)
++ static void* libgdk3 = DlOpen("libgdk-3.so");
++#else
+ static void* libgdk3 = DlOpen("libgdk-3.so.0");
++#endif
+ return libgdk3;
+ }
+
+ void* GetLibGtk3(bool check = true) {
++#if BUILDFLAG(IS_BSD)
++ static void* libgtk3 = DlOpen("libgtk-3.so", check);
++#else
+ static void* libgtk3 = DlOpen("libgtk-3.so.0", check);
++#endif
+ return libgtk3;
+ }
+
+ void* GetLibGtk4(bool check = true) {
++#if BUILDFLAG(IS_BSD)
++ static void* libgtk4 = DlOpen("libgtk-4.so", check);
++#else
+ static void* libgtk4 = DlOpen("libgtk-4.so.1", check);
++#endif
+ return libgtk4;
+ }
+
diff --git a/chromium-next/patches/patch-ui_gtk_printing_print__dialog__gtk.cc b/chromium-next/patches/patch-ui_gtk_printing_print__dialog__gtk.cc
new file mode 100644
index 0000000000..f95dc7db21
--- /dev/null
+++ b/chromium-next/patches/patch-ui_gtk_printing_print__dialog__gtk.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/gtk/printing/print_dialog_gtk.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/gtk/printing/print_dialog_gtk.cc
+@@ -438,7 +438,7 @@ void PrintDialogGtk::ShowDialog(
+ GtkPrintCapabilities cap = static_cast<GtkPrintCapabilities>(
+ GTK_PRINT_CAPABILITY_GENERATE_PDF | GTK_PRINT_CAPABILITY_PAGE_SET |
+ GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE |
+- GTK_PRINT_CAPABILITY_REVERSE);
++ GTK_PRINT_CAPABILITY_REVERSE | GTK_PRINT_CAPABILITY_GENERATE_PS);
+ gtk_print_unix_dialog_set_manual_capabilities(
+ GTK_PRINT_UNIX_DIALOG(dialog_.get()), cap);
+ gtk_print_unix_dialog_set_embed_page_setup(
diff --git a/chromium-next/patches/patch-ui_message__center_views_message__popup__view.cc b/chromium-next/patches/patch-ui_message__center_views_message__popup__view.cc
new file mode 100644
index 0000000000..7d2ce4d1b8
--- /dev/null
+++ b/chromium-next/patches/patch-ui_message__center_views_message__popup__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/message_center/views/message_popup_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/message_center/views/message_popup_view.cc
+@@ -153,7 +153,7 @@ std::unique_ptr<views::Widget> MessagePo
+ views::Widget::InitParams::CLIENT_OWNS_WIDGET,
+ views::Widget::InitParams::TYPE_POPUP);
+ params.z_order = ui::ZOrderLevel::kFloatingWindow;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Make the widget explicitly activatable as TYPE_POPUP is not activatable by
+ // default but we need focus for the inline reply textarea.
+ params.activatable = views::Widget::InitParams::Activatable::kYes;
diff --git a/chromium-next/patches/patch-ui_native__theme_native__theme.h b/chromium-next/patches/patch-ui_native__theme_native__theme.h
new file mode 100644
index 0000000000..5d30835854
--- /dev/null
+++ b/chromium-next/patches/patch-ui_native__theme_native__theme.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/native_theme/native_theme.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/native_theme/native_theme.h
+@@ -61,7 +61,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
+ // The part to be painted / sized.
+ enum Part {
+ kCheckbox,
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ kFrameTopArea,
+ #endif
+ kInnerSpinButton,
diff --git a/chromium-next/patches/patch-ui_native__theme_native__theme__base.cc b/chromium-next/patches/patch-ui_native__theme_native__theme__base.cc
new file mode 100644
index 0000000000..6c0ef57aa4
--- /dev/null
+++ b/chromium-next/patches/patch-ui_native__theme_native__theme__base.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/native_theme/native_theme_base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/native_theme/native_theme_base.cc
+@@ -237,7 +237,7 @@ void NativeThemeBase::Paint(cc::PaintCan
+ absl::get<ButtonExtraParams>(extra), color_scheme,
+ accent_color_opaque);
+ break;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ case kFrameTopArea:
+ PaintFrameTopArea(canvas, state, rect,
+ absl::get<FrameTopAreaExtraParams>(extra),
diff --git a/chromium-next/patches/patch-ui_native__theme_native__theme__features.cc b/chromium-next/patches/patch-ui_native__theme_native__theme__features.cc
new file mode 100644
index 0000000000..97941bc47f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_native__theme_native__theme__features.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/native_theme/native_theme_features.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/native_theme/native_theme_features.cc
+@@ -56,7 +56,7 @@ namespace ui {
+
+ bool IsFluentOverlayScrollbarEnabled() {
+ // Fluent scrollbars are only used for some OSes due to UI design guidelines.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(features::kFluentOverlayScrollbar);
+ #else
+ return false;
+@@ -65,7 +65,7 @@ bool IsFluentOverlayScrollbarEnabled() {
+
+ bool IsFluentScrollbarEnabled() {
+ // Fluent scrollbars are only used for some OSes due to UI design guidelines.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return base::FeatureList::IsEnabled(features::kFluentScrollbar) ||
+ IsFluentOverlayScrollbarEnabled();
+ #else
diff --git a/chromium-next/patches/patch-ui_ozone_common_egl__util.cc b/chromium-next/patches/patch-ui_ozone_common_egl__util.cc
new file mode 100644
index 0000000000..a86b0e0a17
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_common_egl__util.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/common/egl_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/common/egl_util.cc
+@@ -26,9 +26,9 @@ const base::FilePath::CharType kDefaultG
+ FILE_PATH_LITERAL("libGLESv2.so");
+ #else // BUILDFLAG(IS_FUCHSIA)
+ const base::FilePath::CharType kDefaultEglSoname[] =
+- FILE_PATH_LITERAL("libEGL.so.1");
++ FILE_PATH_LITERAL("libEGL.so");
+ const base::FilePath::CharType kDefaultGlesSoname[] =
+- FILE_PATH_LITERAL("libGLESv2.so.2");
++ FILE_PATH_LITERAL("libGLESv2.so");
+ #endif
+ const base::FilePath::CharType kAngleEglSoname[] =
+ FILE_PATH_LITERAL("libEGL.so");
diff --git a/chromium-next/patches/patch-ui_ozone_platform_headless_headless__surface__factory.cc b/chromium-next/patches/patch-ui_ozone_platform_headless_headless__surface__factory.cc
new file mode 100644
index 0000000000..e4929d4c77
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_headless_headless__surface__factory.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/headless/headless_surface_factory.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/headless/headless_surface_factory.cc
+@@ -34,7 +34,7 @@
+ #include "ui/ozone/platform/headless/headless_window_manager.h"
+ #include "ui/ozone/public/surface_ozone_canvas.h"
+
+-#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA))
++#if BUILDFLAG(ENABLE_VULKAN) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD))
+ #include "ui/ozone/platform/headless/vulkan_implementation_headless.h"
+ #endif
+
+@@ -281,7 +281,7 @@ std::unique_ptr<gpu::VulkanImplementatio
+ HeadlessSurfaceFactory::CreateVulkanImplementation(
+ bool use_swiftshader,
+ bool allow_protected_memory) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ return std::make_unique<VulkanImplementationHeadless>(use_swiftshader);
+ #else
+ return nullptr;
diff --git a/chromium-next/patches/patch-ui_ozone_platform_headless_ozone__platform__headless.cc b/chromium-next/patches/patch-ui_ozone_platform_headless_ozone__platform__headless.cc
new file mode 100644
index 0000000000..4c886ef5dd
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_headless_ozone__platform__headless.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/headless/ozone_platform_headless.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/headless/ozone_platform_headless.cc
+@@ -103,7 +103,7 @@ class OzonePlatformHeadless : public Ozo
+ }
+
+ // Desktop Linux, not CastOS.
+-#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CASTOS)
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CASTOS)
+ const PlatformProperties& GetPlatformProperties() override {
+ static base::NoDestructor<OzonePlatform::PlatformProperties> properties;
+ static bool initialized = false;
diff --git a/chromium-next/patches/patch-ui_ozone_platform_headless_vulkan__implementation__headless.cc b/chromium-next/patches/patch-ui_ozone_platform_headless_vulkan__implementation__headless.cc
new file mode 100644
index 0000000000..9160067901
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_headless_vulkan__implementation__headless.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/headless/vulkan_implementation_headless.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/headless/vulkan_implementation_headless.cc
+@@ -116,7 +116,7 @@ VulkanImplementationHeadless::ExportVkFe
+
+ VkExternalSemaphoreHandleTypeFlagBits
+ VulkanImplementationHeadless::GetExternalSemaphoreHandleType() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+ #else
+ return VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT;
+@@ -126,7 +126,7 @@ VulkanImplementationHeadless::GetExterna
+ bool VulkanImplementationHeadless::CanImportGpuMemoryBuffer(
+ gpu::VulkanDeviceQueue* device_queue,
+ gfx::GpuMemoryBufferType memory_buffer_type) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const auto& enabled_extensions = device_queue->enabled_extensions();
+ return gfx::HasExtension(enabled_extensions,
+ VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME) &&
+@@ -149,7 +149,7 @@ VulkanImplementationHeadless::CreateImag
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ auto tiling = VK_IMAGE_TILING_OPTIMAL;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (gmb_handle.native_pixmap_handle.modifier !=
+ gfx::NativePixmapHandle::kNoModifier) {
+ tiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_common_wayland__util.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_common_wayland__util.cc
new file mode 100644
index 0000000000..8e4cc118de
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_common_wayland__util.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/common/wayland_util.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/common/wayland_util.cc
+@@ -343,7 +343,7 @@ void TransformToWlArray(
+ }
+
+ base::TimeTicks EventMillisecondsToTimeTicks(uint32_t milliseconds) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/40287874): `milliseconds` comes from Weston that
+ // uses timestamp from libinput, which is different from TimeTicks.
+ // Use EventTimeForNow(), for now.
+@@ -385,7 +385,7 @@ bool MaybeHandlePlatformEventForDrag(con
+ }
+
+ void RecordConnectionMetrics(wl_display* display) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ CHECK(display);
+
+ // These values are logged to metrics so must not be changed.
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.cc
new file mode 100644
index 0000000000..80b5cca06d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/emulate/wayland_input_emulate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/emulate/wayland_input_emulate.cc
+@@ -284,7 +284,7 @@ void WaylandInputEmulate::EmulateUpdateD
+ }
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void WaylandInputEmulate::ForceUseScreenCoordinatesOnce() {
+ force_use_screen_coordinates_once_ = true;
+ }
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.h b/chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.h
new file mode 100644
index 0000000000..3fa4d92c5b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_emulate_wayland__input__emulate.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/emulate/wayland_input_emulate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/emulate/wayland_input_emulate.h
+@@ -68,7 +68,7 @@ class WaylandInputEmulate : public wl::W
+ uint32_t request_id);
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void ForceUseScreenCoordinatesOnce();
+ #endif
+
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc
new file mode 100644
index 0000000000..5acc57f84f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/gpu/vulkan_implementation_wayland.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/gpu/vulkan_implementation_wayland.cc
+@@ -38,7 +38,11 @@ bool VulkanImplementationWayland::Initia
+
+ path = path.Append("libvk_swiftshader.so");
+ } else {
++#if BUILDFLAG(IS_BSD)
++ path = base::FilePath("libvulkan.so");
++#else
+ path = base::FilePath("libvulkan.so.1");
++#endif
+ }
+
+ return vulkan_instance_.Initialize(path, required_extensions, {});
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__connection.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__connection.cc
new file mode 100644
index 0000000000..1ee5353f55
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__connection.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_connection.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_connection.cc
+@@ -540,7 +540,7 @@ bool WaylandConnection::ShouldUseOverlay
+ // isn't present on any non-exo Wayland compositors.
+ bool should_use_overlay_delegation =
+ IsWaylandOverlayDelegationEnabled() && !fractional_scale_manager_v1();
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Overlay delegation also requires a single-pixel-buffer protocol, which
+ // allows creation of non-backed solid color buffers. Even though only video
+ // overlays can be supported on Linux, these color buffers are still needed
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__input__method__context.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__input__method__context.cc
new file mode 100644
index 0000000000..bd8a72f8e2
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__input__method__context.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_input_method_context.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_input_method_context.cc
+@@ -60,7 +60,7 @@ namespace {
+ // Only enable the preedit string for sequence mode (i.e. when using dead keys
+ // or the Compose key) on Linux ozone/wayland (see b/220370007).
+ constexpr CharacterComposer::PreeditStringMode kPreeditStringMode =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ CharacterComposer::PreeditStringMode::kAlwaysEnabled;
+ #else
+ CharacterComposer::PreeditStringMode::kHexModeOnly;
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__popup.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__popup.cc
new file mode 100644
index 0000000000..c79b209f1c
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__popup.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_popup.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_popup.cc
+@@ -34,7 +34,7 @@ WaylandPopup::WaylandPopup(PlatformWindo
+ WaylandWindow* parent)
+ : WaylandWindow(delegate, connection) {
+ set_parent_window(parent);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/330384470): Whether the popup appear depends on whether
+ // anchor point is outside of the parent xdg_surface. On Mutter the popup will
+ // not show when outside.
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.cc
new file mode 100644
index 0000000000..71e8aec784
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_toplevel_window.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
+@@ -616,7 +616,7 @@ void WaylandToplevelWindow::HandleToplev
+ bool prev_suspended = is_suspended_;
+ is_suspended_ = window_states.is_suspended;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The tiled state affects the window geometry, so apply it here.
+ if (window_states.tiled_edges != tiled_state_) {
+ // This configure changes the decoration insets. We should adjust the
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.h b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.h
new file mode 100644
index 0000000000..0c40300cfc
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__toplevel__window.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_toplevel_window.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_toplevel_window.h
+@@ -252,7 +252,7 @@ class WaylandToplevelWindow : public Way
+ // The display ID to switch to in case the state is `kFullscreen`.
+ int64_t fullscreen_display_id_ = display::kInvalidDisplayId;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Contains the current state of the tiled edges.
+ WindowTiledEdges tiled_state_;
+ #endif
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.cc
new file mode 100644
index 0000000000..814f6b213f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.cc
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_window.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_window.cc
+@@ -330,7 +330,7 @@ void WaylandWindow::OnPointerFocusChange
+ // Whenever the window gets the pointer focus back, the cursor shape must be
+ // updated. Otherwise, it is invalidated upon wl_pointer::leave and is not
+ // restored by the Wayland compositor.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (focused && async_cursor_) {
+ async_cursor_->AddCursorLoadedCallback(base::BindOnce(
+ &WaylandWindow::OnCursorLoaded, AsWeakPtr(), async_cursor_));
+@@ -611,7 +611,7 @@ bool WaylandWindow::ShouldUseNativeFrame
+ void WaylandWindow::SetCursor(scoped_refptr<PlatformCursor> platform_cursor) {
+ DCHECK(platform_cursor);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto async_cursor = WaylandAsyncCursor::FromPlatformCursor(platform_cursor);
+
+ if (async_cursor_ == async_cursor) {
+@@ -813,7 +813,7 @@ std::string WaylandWindow::WindowStates:
+ } else {
+ base::TrimString(states, " ", &states);
+ }
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ states += "; tiled_edges: ";
+ std::string tiled = "";
+ if (tiled_edges.left) {
+@@ -1318,12 +1318,12 @@ void WaylandWindow::UpdateCursorShape(sc
+ cursor->bitmaps(), hotspot_in_dips,
+ std::ceil(cursor->cursor_image_scale_factor()));
+ }
+-#if !BUILDFLAG(IS_LINUX)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
+ cursor_ = cursor;
+ #endif
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void WaylandWindow::OnCursorLoaded(scoped_refptr<WaylandAsyncCursor> cursor,
+ scoped_refptr<BitmapCursor> bitmap_cursor) {
+ if (HasPointerFocus() && async_cursor_ == cursor && bitmap_cursor) {
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.h b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.h
new file mode 100644
index 0000000000..301bba8668
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_wayland__window.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/wayland_window.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/wayland_window.h
+@@ -41,7 +41,7 @@
+ #include "ui/platform_window/platform_window_init_properties.h"
+ #include "ui/platform_window/wm/wm_drag_handler.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/platform/wayland/host/wayland_async_cursor.h"
+ #endif
+
+@@ -276,7 +276,7 @@ class WaylandWindow : public PlatformWin
+ bool is_floated = false;
+ bool is_pip = false;
+ bool is_suspended = false;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ WindowTiledEdges tiled_edges;
+ #endif
+
+@@ -572,7 +572,7 @@ class WaylandWindow : public PlatformWin
+
+ void UpdateCursorShape(scoped_refptr<BitmapCursor> cursor);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void OnCursorLoaded(scoped_refptr<WaylandAsyncCursor> cursor,
+ scoped_refptr<BitmapCursor> bitmap_cursor);
+ #endif
+@@ -644,7 +644,7 @@ class WaylandWindow : public PlatformWin
+
+ wl::Object<zaura_surface> aura_surface_;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The current asynchronously loaded cursor (Linux specific).
+ scoped_refptr<WaylandAsyncCursor> async_cursor_;
+ #else
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_host_zwp__text__input__wrapper__v1.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_zwp__text__input__wrapper__v1.cc
new file mode 100644
index 0000000000..a67b07251f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_host_zwp__text__input__wrapper__v1.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.cc
+@@ -256,6 +256,10 @@ void ZWPTextInputWrapperV1::SetSurroundi
+ // so if it exceeds 16 bits, it may be broken.
+ static constexpr size_t kSizeLimit = 60000;
+ if (HasAdvancedSurroundingTextSupport() && text.length() > kSizeLimit) {
++#if defined(__FreeBSD_version) && __FreeBSD_version < 1300048
++ PLOG(ERROR) << "memfd is not supported";
++ return;
++#else
+ base::ScopedFD memfd(memfd_create("surrounding_text", MFD_CLOEXEC));
+ if (!memfd.get()) {
+ PLOG(ERROR) << "Failed to create memfd";
+@@ -268,6 +272,7 @@ void ZWPTextInputWrapperV1::SetSurroundi
+ zcr_extended_text_input_v1_set_large_surrounding_text(
+ extended_obj_.get(), memfd.get(), text.length(),
+ selection_range.start(), selection_range.end());
++#endif
+ } else {
+ zwp_text_input_v1_set_surrounding_text(obj_.get(), text.c_str(),
+ selection_range.start(),
diff --git a/chromium-next/patches/patch-ui_ozone_platform_wayland_ozone__platform__wayland.cc b/chromium-next/patches/patch-ui_ozone_platform_wayland_ozone__platform__wayland.cc
new file mode 100644
index 0000000000..e331700f7b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_wayland_ozone__platform__wayland.cc
@@ -0,0 +1,60 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/wayland/ozone_platform_wayland.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/wayland/ozone_platform_wayland.cc
+@@ -69,13 +69,13 @@
+ #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/platform/wayland/host/wayland_cursor_factory.h"
+ #else
+ #include "ui/ozone/common/bitmap_cursor_factory.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/platform/wayland/host/linux_ui_delegate_wayland.h"
+ #endif
+
+@@ -295,7 +295,7 @@ class OzonePlatformWayland : public Ozon
+
+ buffer_manager_connector_ = std::make_unique<WaylandBufferManagerConnector>(
+ connection_->buffer_manager_host());
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ cursor_factory_ = std::make_unique<WaylandCursorFactory>(connection_.get());
+ #else
+ cursor_factory_ = std::make_unique<BitmapCursorFactory>();
+@@ -305,7 +305,7 @@ class OzonePlatformWayland : public Ozon
+
+ supported_buffer_formats_ =
+ connection_->buffer_manager_host()->GetSupportedBufferFormats();
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ linux_ui_delegate_ =
+ std::make_unique<LinuxUiDelegateWayland>(connection_.get());
+ #endif
+@@ -371,7 +371,7 @@ class OzonePlatformWayland : public Ozon
+ properties->supports_global_screen_coordinates =
+ kDefaultScreenCoordinateEnabled;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/40800718): Revisit (and maybe remove) once proper
+ // support, probably backed by org.freedesktop.portal.Screenshot.PickColor
+ // API is implemented. Note: this is restricted to Linux Desktop as Lacros
+@@ -573,7 +573,7 @@ class OzonePlatformWayland : public Ozon
+ DrmRenderNodePathFinder path_finder_;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<LinuxUiDelegateWayland> linux_ui_delegate_;
+ #endif
+ };
diff --git a/chromium-next/patches/patch-ui_ozone_platform_x11_vulkan__implementation__x11.cc b/chromium-next/patches/patch-ui_ozone_platform_x11_vulkan__implementation__x11.cc
new file mode 100644
index 0000000000..ef5f387d57
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_x11_vulkan__implementation__x11.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/x11/vulkan_implementation_x11.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/x11/vulkan_implementation_x11.cc
+@@ -59,7 +59,11 @@ bool VulkanImplementationX11::Initialize
+
+ path = path.Append("libvk_swiftshader.so");
+ } else {
++#if BUILDFLAG(IS_BSD)
++ path = base::FilePath("libvulkan.so");
++#else
+ path = base::FilePath("libvulkan.so.1");
++#endif
+ }
+
+ return vulkan_instance_.Initialize(path, required_extensions, {});
diff --git a/chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.cc b/chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.cc
new file mode 100644
index 0000000000..c08e31f2b6
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/x11/x11_screen_ozone.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/x11/x11_screen_ozone.cc
+@@ -22,7 +22,7 @@
+ #include "ui/ozone/platform/x11/x11_window.h"
+ #include "ui/ozone/platform/x11/x11_window_manager.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -97,7 +97,7 @@ X11ScreenOzone::X11ScreenOzone()
+ window_manager_(X11WindowManager::GetInstance()),
+ x11_display_manager_(std::make_unique<XDisplayManager>(this)) {
+ DCHECK(window_manager_);
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (auto* linux_ui = ui::LinuxUi::instance()) {
+ display_scale_factor_observer_.Observe(linux_ui);
+ }
+@@ -260,7 +260,7 @@ void X11ScreenOzone::OnEvent(const x11::
+ x11_display_manager_->OnEvent(xev);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void X11ScreenOzone::OnDeviceScaleFactorChanged() {
+ x11_display_manager_->DispatchDelayedDisplayListUpdate();
+ }
diff --git a/chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.h b/chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.h
new file mode 100644
index 0000000000..bd95cbccaa
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_x11_x11__screen__ozone.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/x11/x11_screen_ozone.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/x11/x11_screen_ozone.h
+@@ -16,7 +16,7 @@
+ #include "ui/gfx/x/event.h"
+ #include "ui/ozone/public/platform_screen.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/device_scale_factor_observer.h"
+ #include "ui/linux/linux_ui.h"
+ #endif
+@@ -29,7 +29,7 @@ class X11WindowManager;
+ class X11ScreenOzone : public PlatformScreen,
+ public x11::EventObserver,
+ public XDisplayManager::Delegate
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ ,
+ public DeviceScaleFactorObserver
+ #endif
+@@ -97,7 +97,7 @@ class X11ScreenOzone : public PlatformSc
+ // ui::XDisplayManager::Delegate:
+ void OnXDisplayListUpdated() override;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // DeviceScaleFactorObserver:
+ void OnDeviceScaleFactorChanged() override;
+ #endif
+@@ -109,7 +109,7 @@ class X11ScreenOzone : public PlatformSc
+ // Indicates that |this| is initialized.
+ bool initialized_ = false;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ base::ScopedObservation<ui::LinuxUi, DeviceScaleFactorObserver>
+ display_scale_factor_observer_{this};
+ #endif
diff --git a/chromium-next/patches/patch-ui_ozone_platform_x11_x11__window.cc b/chromium-next/patches/patch-ui_ozone_platform_x11_x11__window.cc
new file mode 100644
index 0000000000..370c5c975b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_platform_x11_x11__window.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/platform/x11/x11_window.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/platform/x11/x11_window.cc
+@@ -1502,7 +1502,7 @@ void X11Window::OnXWindowStateChanged()
+ WindowTiledEdges tiled_state = GetTiledState();
+ if (tiled_state != tiled_state_) {
+ tiled_state_ = tiled_state;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ platform_window_delegate_->OnWindowTiledStateChanged(tiled_state);
+ UpdateDecorationInsets();
+ #endif
diff --git a/chromium-next/patches/patch-ui_ozone_test_mock__platform__window__delegate.h b/chromium-next/patches/patch-ui_ozone_test_mock__platform__window__delegate.h
new file mode 100644
index 0000000000..2b5a2909cb
--- /dev/null
+++ b/chromium-next/patches/patch-ui_ozone_test_mock__platform__window__delegate.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/ozone/test/mock_platform_window_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/ozone/test/mock_platform_window_delegate.h
+@@ -35,7 +35,7 @@ class MockPlatformWindowDelegate : publi
+ MOCK_METHOD2(OnWindowStateChanged,
+ void(PlatformWindowState old_state,
+ PlatformWindowState new_state));
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ MOCK_METHOD1(OnWindowTiledStateChanged,
+ void(WindowTiledEdges new_tiled_edges));
+ #endif
diff --git a/chromium-next/patches/patch-ui_platform__window_platform__window__delegate.cc b/chromium-next/patches/patch-ui_platform__window_platform__window__delegate.cc
new file mode 100644
index 0000000000..0e94a989a6
--- /dev/null
+++ b/chromium-next/patches/patch-ui_platform__window_platform__window__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/platform_window/platform_window_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/platform_window/platform_window_delegate.cc
+@@ -63,7 +63,7 @@ gfx::Insets PlatformWindowDelegate::Calc
+ return gfx::Insets();
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void PlatformWindowDelegate::OnWindowTiledStateChanged(
+ WindowTiledEdges new_tiled_edges) {}
+ #endif
diff --git a/chromium-next/patches/patch-ui_platform__window_platform__window__delegate.h b/chromium-next/patches/patch-ui_platform__window_platform__window__delegate.h
new file mode 100644
index 0000000000..31bd9eb8c4
--- /dev/null
+++ b/chromium-next/patches/patch-ui_platform__window_platform__window__delegate.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/platform_window/platform_window_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/platform_window/platform_window_delegate.h
+@@ -161,7 +161,7 @@ class COMPONENT_EXPORT(PLATFORM_WINDOW)
+ virtual void OnWindowStateChanged(PlatformWindowState old_state,
+ PlatformWindowState new_state) = 0;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Notifies the delegate that the tiled state of the window edges has changed.
+ virtual void OnWindowTiledStateChanged(WindowTiledEdges new_tiled_edges);
+ #endif
diff --git a/chromium-next/patches/patch-ui_platform__window_platform__window__init__properties.h b/chromium-next/patches/patch-ui_platform__window_platform__window__init__properties.h
new file mode 100644
index 0000000000..300d5188d1
--- /dev/null
+++ b/chromium-next/patches/patch-ui_platform__window_platform__window__init__properties.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/platform_window/platform_window_init_properties.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/platform_window/platform_window_init_properties.h
+@@ -56,7 +56,7 @@ class WorkspaceExtensionDelegate;
+ class ScenicWindowDelegate;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ class X11ExtensionDelegate;
+ #endif
+
+@@ -121,7 +121,7 @@ struct COMPONENT_EXPORT(PLATFORM_WINDOW)
+
+ PlatformWindowShadowType shadow_type = PlatformWindowShadowType::kDefault;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool prefer_dark_theme = false;
+ raw_ptr<gfx::ImageSkia> icon = nullptr;
+ std::optional<SkColor> background_color;
diff --git a/chromium-next/patches/patch-ui_qt_BUILD.gn b/chromium-next/patches/patch-ui_qt_BUILD.gn
new file mode 100644
index 0000000000..f84d63f572
--- /dev/null
+++ b/chromium-next/patches/patch-ui_qt_BUILD.gn
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/qt/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/qt/BUILD.gn
+@@ -20,7 +20,7 @@ config("qt_internal_config") {
+
+ # It's OK to depend on the system libstdc++ since it's a dependency of QT, so
+ # it will get loaded into the process anyway.
+- libs = [ "stdc++" ]
++ # libs = [ "stdc++" ]
+
+ configs = [
+ "//build/config/linux:runtime_library",
diff --git a/chromium-next/patches/patch-ui_qt_qt.gni b/chromium-next/patches/patch-ui_qt_qt.gni
new file mode 100644
index 0000000000..361b9bd9ef
--- /dev/null
+++ b/chromium-next/patches/patch-ui_qt_qt.gni
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/qt/qt.gni.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/qt/qt.gni
+@@ -14,7 +14,7 @@ declare_args() {
+
+ declare_args() {
+ if (!use_sysroot && use_qt) {
+- moc_qt5_path = ""
++ moc_qt5_path = "@QTDIR@/bin"
+ }
+ }
+
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__bn.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__bn.xtb
new file mode 100644
index 0000000000..782972df07
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__bn.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_bn.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_bn.xtb
+@@ -10,7 +10,7 @@
+ <translation id="IDS_WEB_FONT_FAMILY">Vrinda</translation>
+ <translation id="IDS_WEB_FONT_FAMILY_XP">Vrinda</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">Lohit Bengali</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ja.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ja.xtb
new file mode 100644
index 0000000000..80b6e4cb4b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ja.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_ja.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_ja.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,Hiragino Kaku Gothic ProN,sans-serif</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">VL PGothic,Sazanami Gothic,Kochi Gothic,sans-serif</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ko.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ko.xtb
new file mode 100644
index 0000000000..a54e3c434f
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ko.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_ko.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_ko.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,Apple SD Gothic Neo,AppleGothic,sans-serif</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">Noto Sans CJK KR,NanumGothic,UnDotum,Baekmuk Gulim,sans-serif</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ml.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ml.xtb
new file mode 100644
index 0000000000..e87e62f0e2
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__ml.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_ml.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_ml.xtb
+@@ -9,7 +9,7 @@
+ <translation id="IDS_WEB_FONT_FAMILY">'Segoe UI',Arial,AnjaliOldLipi,Rachana,Kartika</translation>
+ <translation id="IDS_WEB_FONT_FAMILY_XP">Arial,AnjaliOldLipi,Rachana,Kartika</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">Arial,AnjaliOldLipi,Rachana,Kartika,sans-serif</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__th.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__th.xtb
new file mode 100644
index 0000000000..13a6c08f1c
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__th.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_th.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_th.xtb
+@@ -6,7 +6,7 @@
+ <translation id="IDS_WEB_FONT_FAMILY">Tahoma,sans-serif</translation>
+ <translation id="IDS_WEB_FONT_FAMILY_XP">Tahoma,sans-serif</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">Norasi,Waree,Garuda,Loma,sans-serif</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-CN.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-CN.xtb
new file mode 100644
index 0000000000..c7fa0b3b5b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-CN.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_zh-CN.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_zh-CN.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,PingFang SC,STHeiti,sans-serif</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">Noto Sans CJK SC, WenQuanYi Zen Hei, sans-serif</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-TW.xtb b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-TW.xtb
new file mode 100644
index 0000000000..97166cde2e
--- /dev/null
+++ b/chromium-next/patches/patch-ui_strings_translations_app__locale__settings__zh-TW.xtb
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/strings/translations/app_locale_settings_zh-TW.xtb.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/strings/translations/app_locale_settings_zh-TW.xtb
+@@ -12,7 +12,7 @@
+ <if expr="is_ios">
+ <translation id="IDS_WEB_FONT_FAMILY">Helvetica,PingFang TC,Heiti TC,sans-serif</translation>
+ </if>
+-<if expr="is_linux">
++<if expr="is_posix">
+ <translation id="IDS_WEB_FONT_FAMILY">Noto Sans CJK TC, WenQuanYi Zen Hei, sans-serif</translation>
+ </if>
+ <if expr="is_chromeos">
diff --git a/chromium-next/patches/patch-ui_views_controls_prefix__selector.cc b/chromium-next/patches/patch-ui_views_controls_prefix__selector.cc
new file mode 100644
index 0000000000..0c3629f755
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_controls_prefix__selector.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/controls/prefix_selector.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/controls/prefix_selector.cc
+@@ -192,7 +192,7 @@ bool PrefixSelector::ShouldDoLearning()
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool PrefixSelector::SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) {
diff --git a/chromium-next/patches/patch-ui_views_controls_prefix__selector.h b/chromium-next/patches/patch-ui_views_controls_prefix__selector.h
new file mode 100644
index 0000000000..c693be0c5d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_controls_prefix__selector.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/controls/prefix_selector.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/controls/prefix_selector.h
+@@ -91,7 +91,7 @@ class VIEWS_EXPORT PrefixSelector : publ
+ ukm::SourceId GetClientSourceForMetrics() const override;
+ bool ShouldDoLearning() override;
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
diff --git a/chromium-next/patches/patch-ui_views_controls_textfield_textfield.cc b/chromium-next/patches/patch-ui_views_controls_textfield_textfield.cc
new file mode 100644
index 0000000000..ca6158bfe7
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_controls_textfield_textfield.cc
@@ -0,0 +1,70 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/controls/textfield/textfield.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/controls/textfield/textfield.cc
+@@ -86,7 +86,7 @@
+ #include "base/win/win_util.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/base/ime/linux/text_edit_command_auralinux.h"
+ #include "ui/base/ime/text_input_flags.h"
+ #include "ui/linux/linux_ui.h"
+@@ -181,7 +181,7 @@ bool IsControlKeyModifier(int flags) {
+ // Control-modified key combination, but we cannot extend it to other platforms
+ // as Control has different meanings and behaviors.
+ // https://crrev.com/2580483002/#msg46
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return flags & ui::EF_CONTROL_DOWN;
+ #else
+ return false;
+@@ -762,7 +762,7 @@ bool Textfield::OnKeyPressed(const ui::K
+ if (!textfield)
+ return handled;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ auto* linux_ui = ui::LinuxUi::instance();
+ std::vector<ui::TextEditCommandAuraLinux> commands;
+ if (!handled && linux_ui &&
+@@ -945,7 +945,7 @@ void Textfield::AboutToRequestFocusFromT
+ }
+
+ bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Skip any accelerator handling that conflicts with custom keybindings.
+ auto* linux_ui = ui::LinuxUi::instance();
+ std::vector<ui::TextEditCommandAuraLinux> commands;
+@@ -2010,7 +2010,7 @@ bool Textfield::ShouldDoLearning() {
+ return false;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/41452689): Implement this method to support Korean IME
+ // reconversion feature on native text fields (e.g. find bar).
+ bool Textfield::SetCompositionFromExistingText(
+@@ -2516,14 +2516,14 @@ ui::TextEditCommand Textfield::GetComman
+ #endif
+ return ui::TextEditCommand::DELETE_BACKWARD;
+ }
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Only erase by line break on Linux and ChromeOS.
+ if (shift)
+ return ui::TextEditCommand::DELETE_TO_BEGINNING_OF_LINE;
+ #endif
+ return ui::TextEditCommand::DELETE_WORD_BACKWARD;
+ case ui::VKEY_DELETE:
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Only erase by line break on Linux and ChromeOS.
+ if (shift && control)
+ return ui::TextEditCommand::DELETE_TO_END_OF_LINE;
diff --git a/chromium-next/patches/patch-ui_views_controls_textfield_textfield.h b/chromium-next/patches/patch-ui_views_controls_textfield_textfield.h
new file mode 100644
index 0000000000..7e877e438b
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_controls_textfield_textfield.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/controls/textfield/textfield.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/controls/textfield/textfield.h
+@@ -47,7 +47,7 @@
+ #include "ui/views/view_observer.h"
+ #include "ui/views/word_lookup_client.h"
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <vector>
+ #endif
+
+@@ -475,7 +475,7 @@ class VIEWS_EXPORT Textfield : public Vi
+ // Set whether the text should be used to improve typing suggestions.
+ void SetShouldDoLearning(bool value) { should_do_learning_ = value; }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ bool SetCompositionFromExistingText(
+ const gfx::Range& range,
+ const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
diff --git a/chromium-next/patches/patch-ui_views_corewm_tooltip__aura.cc b/chromium-next/patches/patch-ui_views_corewm_tooltip__aura.cc
new file mode 100644
index 0000000000..7b399fc9c5
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_corewm_tooltip__aura.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/corewm/tooltip_aura.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/corewm/tooltip_aura.cc
+@@ -38,7 +38,7 @@ static constexpr int kTooltipMaxWidth =
+
+ // TODO(varkha): Update if native widget can be transparent on Linux.
+ bool CanUseTranslucentTooltipWidget() {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
diff --git a/chromium-next/patches/patch-ui_views_examples_widget__example.cc b/chromium-next/patches/patch-ui_views_examples_widget__example.cc
new file mode 100644
index 0000000000..9bfcb1e235
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_examples_widget__example.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/examples/widget_example.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/examples/widget_example.cc
+@@ -50,7 +50,7 @@ void WidgetExample::CreateExampleView(Vi
+ modal_button->SetCallback(
+ base::BindRepeating(&WidgetExample::CreateDialogWidget,
+ base::Unretained(this), modal_button, true));
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Windows does not support TYPE_CONTROL top-level widgets.
+ LabelButton* control_button = BuildButton(
+ container, GetStringUTF16(IDS_WIDGET_CHILD_WIDGET_BUTTON_LABEL));
diff --git a/chromium-next/patches/patch-ui_views_focus_focus__manager.cc b/chromium-next/patches/patch-ui_views_focus_focus__manager.cc
new file mode 100644
index 0000000000..c59fd00a79
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_focus_focus__manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/focus/focus_manager.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/focus/focus_manager.cc
+@@ -582,7 +582,7 @@ bool FocusManager::RedirectAcceleratorTo
+ if (!focus_manager->IsAcceleratorRegistered(accelerator))
+ return false;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Processing an accelerator can delete things. Because we
+ // need these objects afterwards on Linux, save widget_ as weak pointer and
+ // save the close_on_deactivate property value of widget_delegate in a
+@@ -597,7 +597,7 @@ bool FocusManager::RedirectAcceleratorTo
+ const bool accelerator_processed =
+ focus_manager->ProcessAccelerator(accelerator);
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Need to manually close the bubble widget on Linux. On Linux when the
+ // bubble is shown, the main widget remains active. Because of that when
+ // focus is set to the main widget to process accelerator, the main widget
diff --git a/chromium-next/patches/patch-ui_views_style_platform__style.cc b/chromium-next/patches/patch-ui_views_style_platform__style.cc
new file mode 100644
index 0000000000..2d7cc5e99d
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_style_platform__style.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/style/platform_style.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/style/platform_style.cc
+@@ -16,7 +16,7 @@
+ #include "ui/views/controls/focusable_border.h"
+ #include "ui/views/controls/scrollbar/scroll_bar_views.h"
+
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/views/controls/scrollbar/overlay_scroll_bar.h"
+ #endif
+
+@@ -49,7 +49,7 @@ const View::FocusBehavior PlatformStyle:
+ // Linux clips bubble windows that extend outside their parent window
+ // bounds.
+ const bool PlatformStyle::kAdjustBubbleIfOffscreen =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ false;
+ #else
+ true;
+@@ -58,7 +58,7 @@ const bool PlatformStyle::kAdjustBubbleI
+ // static
+ std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(
+ ScrollBar::Orientation orientation) {
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return std::make_unique<OverlayScrollBar>(orientation);
+ #else
+ return std::make_unique<ScrollBarViews>(orientation);
diff --git a/chromium-next/patches/patch-ui_views_test_ui__controls__factory__desktop__aura__ozone.cc b/chromium-next/patches/patch-ui_views_test_ui__controls__factory__desktop__aura__ozone.cc
new file mode 100644
index 0000000000..431d19222e
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_test_ui__controls__factory__desktop__aura__ozone.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/test/ui_controls_factory_desktop_aura_ozone.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/test/ui_controls_factory_desktop_aura_ozone.cc
+@@ -237,7 +237,7 @@ bool SendMouseClick(MouseButton type, gf
+ window_hint);
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // static
+ void ForceUseScreenCoordinatesOnce() {
+ g_ozone_ui_controls_test_helper->ForceUseScreenCoordinatesOnce();
diff --git a/chromium-next/patches/patch-ui_views_views__delegate.cc b/chromium-next/patches/patch-ui_views_views__delegate.cc
new file mode 100644
index 0000000000..0fdef9a9f4
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_views__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/views_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/views_delegate.cc
+@@ -89,7 +89,7 @@ bool ViewsDelegate::IsWindowInMetro(gfx:
+ return false;
+ }
+ #elif BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
+ return nullptr;
+ }
diff --git a/chromium-next/patches/patch-ui_views_views__delegate.h b/chromium-next/patches/patch-ui_views_views__delegate.h
new file mode 100644
index 0000000000..4ec38e46bf
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_views__delegate.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/views_delegate.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/views_delegate.h
+@@ -139,7 +139,7 @@ class VIEWS_EXPORT ViewsDelegate {
+ // environment.
+ virtual bool IsWindowInMetro(gfx::NativeWindow window) const;
+ #elif BUILDFLAG(ENABLE_DESKTOP_AURA) && \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ virtual gfx::ImageSkia* GetDefaultWindowIcon() const;
+ #endif
+
diff --git a/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.cc b/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.cc
new file mode 100644
index 0000000000..5d79c53067
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.cc
+@@ -204,7 +204,7 @@ DragOperation DesktopDragDropClientOzone
+ return selected_operation_;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void DesktopDragDropClientOzone::UpdateDragImage(const gfx::ImageSkia& image,
+ const gfx::Vector2d& offset) {
+ DCHECK(drag_handler_);
diff --git a/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.h b/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.h
new file mode 100644
index 0000000000..8b130c33a2
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__drag__drop__client__ozone.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.h
+@@ -67,7 +67,7 @@ class VIEWS_EXPORT DesktopDragDropClient
+ // The offset of |drag_widget_| relative to the mouse position.
+ gfx::Vector2d offset;
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The last received drag location. The drag widget is moved asynchronously
+ // so its position is updated when the UI thread has time for that. When
+ // the first change to the location happens, a call to UpdateDragWidget()
+@@ -88,7 +88,7 @@ class VIEWS_EXPORT DesktopDragDropClient
+ const gfx::Point& root_location,
+ int allowed_operations,
+ ui::mojom::DragEventSource source) override;
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ void UpdateDragImage(const gfx::ImageSkia& image,
+ const gfx::Vector2d& offset) override;
+ #endif
diff --git a/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc b/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc
new file mode 100644
index 0000000000..e6c2975a3e
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+@@ -50,7 +50,7 @@
+ #include "ui/wm/core/window_util.h"
+ #include "ui/wm/public/window_move_client.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone_linux.h"
+ #endif
+
+@@ -342,7 +342,7 @@ std::unique_ptr<aura::client::DragDropCl
+ DesktopWindowTreeHostPlatform::CreateDragDropClient() {
+ ui::WmDragHandler* drag_handler = ui::GetWmDragHandler(*(platform_window()));
+ std::unique_ptr<DesktopDragDropClientOzone> drag_drop_client =
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ std::make_unique<DesktopDragDropClientOzoneLinux>(window(), drag_handler);
+ #else
+ std::make_unique<DesktopDragDropClientOzone>(window(), drag_handler);
+@@ -1149,7 +1149,7 @@ bool DesktopWindowTreeHostPlatform::Rota
+ // DesktopWindowTreeHost:
+
+ // Linux subclasses this host and adds some Linux specific bits.
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ // static
+ DesktopWindowTreeHost* DesktopWindowTreeHost::Create(
+ internal::NativeWidgetDelegate* native_widget_delegate,
diff --git a/chromium-next/patches/patch-ui_views_widget_root__view.cc b/chromium-next/patches/patch-ui_views_widget_root__view.cc
new file mode 100644
index 0000000000..2bc1ab65d8
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_widget_root__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/widget/root_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/widget/root_view.cc
+@@ -165,7 +165,7 @@ class AnnounceTextView : public View {
+ #if BUILDFLAG(IS_CHROMEOS)
+ // On ChromeOS, kAlert role can invoke an unnecessary event on reparenting.
+ GetViewAccessibility().SetRole(ax::mojom::Role::kStaticText);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // TODO(crbug.com/40658933): Use live regions (do not use alerts).
+ // May require setting kLiveStatus, kContainerLiveStatus to "polite".
+ GetViewAccessibility().SetRole(ax::mojom::Role::kAlert);
diff --git a/chromium-next/patches/patch-ui_views_widget_widget.cc b/chromium-next/patches/patch-ui_views_widget_widget.cc
new file mode 100644
index 0000000000..9dafc214ba
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_widget_widget.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/widget/widget.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/widget/widget.cc
+@@ -60,7 +60,7 @@
+ #include "ui/views/window/custom_frame_view.h"
+ #include "ui/views/window/dialog_delegate.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -2201,7 +2201,7 @@ const ui::NativeTheme* Widget::GetNative
+ if (parent_)
+ return parent_->GetNativeTheme();
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ if (auto* linux_ui_theme = ui::LinuxUiTheme::GetForWindow(GetNativeWindow()))
+ return linux_ui_theme->GetNativeTheme();
+ #endif
diff --git a/chromium-next/patches/patch-ui_views_window_custom__frame__view.cc b/chromium-next/patches/patch-ui_views_window_custom__frame__view.cc
new file mode 100644
index 0000000000..2f5823af8a
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_window_custom__frame__view.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/window/custom_frame_view.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/window/custom_frame_view.cc
+@@ -265,7 +265,7 @@ int CustomFrameView::NonClientTopBorderH
+ int CustomFrameView::CaptionButtonY() const {
+ // Maximized buttons start at window top so that even if their images aren't
+ // drawn flush with the screen edge, they still obey Fitts' Law.
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ return FrameBorderThickness();
+ #else
+ return frame_->IsMaximized() ? FrameBorderThickness() : kFrameShadowThickness;
diff --git a/chromium-next/patches/patch-ui_views_window_dialog__delegate.cc b/chromium-next/patches/patch-ui_views_window_dialog__delegate.cc
new file mode 100644
index 0000000000..c41bd8bfc4
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_window_dialog__delegate.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/window/dialog_delegate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/window/dialog_delegate.cc
+@@ -105,7 +105,7 @@ Widget* DialogDelegate::CreateDialogWidg
+
+ // static
+ bool DialogDelegate::CanSupportCustomFrame(gfx::NativeView parent) {
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(ENABLE_DESKTOP_AURA)
+ // The new style doesn't support unparented dialogs on Linux desktop.
+ return parent != nullptr;
diff --git a/chromium-next/patches/patch-ui_views_window_frame__background.cc b/chromium-next/patches/patch-ui_views_window_frame__background.cc
new file mode 100644
index 0000000000..02e0dd5ccb
--- /dev/null
+++ b/chromium-next/patches/patch-ui_views_window_frame__background.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- ui/views/window/frame_background.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ ui/views/window/frame_background.cc
+@@ -110,7 +110,7 @@ void FrameBackground::PaintMaximized(gfx
+ int width) const {
+ // Fill the top with the frame color first so we have a constant background
+ // for areas not covered by the theme image.
+-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ BUILDFLAG(ENABLE_DESKTOP_AURA)
+ ui::NativeTheme::FrameTopAreaExtraParams frame_top_area;
+ frame_top_area.use_custom_frame = use_custom_frame_;
diff --git a/chromium-next/patches/patch-v8_BUILD.gn b/chromium-next/patches/patch-v8_BUILD.gn
new file mode 100644
index 0000000000..1bc6a4edaf
--- /dev/null
+++ b/chromium-next/patches/patch-v8_BUILD.gn
@@ -0,0 +1,139 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/BUILD.gn.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/BUILD.gn
+@@ -929,6 +929,9 @@ external_v8_defines = [
+ "V8_TARGET_OS_MACOS",
+ "V8_TARGET_OS_WIN",
+ "V8_TARGET_OS_CHROMEOS",
++ "V8_TARGET_OS_OPENBSD",
++ "V8_TARGET_OS_FREEBSD",
++ "V8_TARGET_OS_NETBSD",
+ ]
+
+ enabled_external_v8_defines = [
+@@ -1005,6 +1008,15 @@ if (target_os == "android") {
+ } else if (target_os == "chromeos") {
+ enabled_external_v8_defines += [ "V8_HAVE_TARGET_OS" ]
+ enabled_external_v8_defines += [ "V8_TARGET_OS_CHROMEOS" ]
++} else if (target_os == "openbsd") {
++ enabled_external_v8_defines += [ "V8_HAVE_TARGET_OS" ]
++ enabled_external_v8_defines += [ "V8_TARGET_OS_OPENBSD" ]
++} else if (target_os == "freebsd") {
++ enabled_external_v8_defines += [ "V8_HAVE_TARGET_OS" ]
++ enabled_external_v8_defines += [ "V8_TARGET_OS_FREEBSD" ]
++} else if (target_os == "netbsd") {
++ enabled_external_v8_defines += [ "V8_HAVE_TARGET_OS" ]
++ enabled_external_v8_defines += [ "V8_TARGET_OS_NETBSD" ]
+ }
+
+ disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
+@@ -2447,6 +2459,23 @@ action("generate_bytecode_builtins_list"
+ ]
+ }
+
++action("run_paxctl_mksnapshot") {
++ deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
++
++ script = "tools/run-paxctl.py"
++ stamp = "$target_gen_dir/paxctl_stamp"
++ outputs = [ stamp ]
++
++ sources = []
++ data = []
++
++ args = [
++ rebase_path(stamp, root_build_dir), "/usr/sbin/paxctl", "+m", "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
++ "root_out_dir") + "/mksnapshot",
++ root_build_dir),
++ ]
++}
++
+ # Template to generate different V8 snapshots based on different runtime flags.
+ # Can be invoked with run_mksnapshot(<name>). The target will resolve to
+ # run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
+@@ -2465,7 +2494,11 @@ template("run_mksnapshot") {
+ suffix = "_$name"
+ }
+ action("run_mksnapshot_" + name) {
+- deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
++ if (target_os == "netbsd") {
++ deps = [ ":mksnapshot($v8_snapshot_toolchain)", ":run_paxctl_mksnapshot" ]
++ } else {
++ deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
++ }
+ if (v8_verify_deterministic_mksnapshot) {
+ # We archive the snapshot executable when verifying snapshot
+ # determinism to ease debugging.
+@@ -2572,6 +2605,12 @@ template("run_mksnapshot") {
+ if (!v8_enable_builtins_profiling && v8_enable_builtins_reordering) {
+ args += [ "--reorder-builtins" ]
+ }
++
++ if (v8_current_cpu == "x86") {
++ args -= [
++ "--abort-on-bad-builtin-profile-data",
++ ]
++ }
+ }
+
+ if (v8_enable_turboshaft_csa) {
+@@ -4666,7 +4705,7 @@ v8_header_set("v8_internal_headers") {
+ # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
+ # based on Darwin and thus POSIX-compliant to a similar degree.
+ if (is_linux || is_chromeos || is_mac || is_ios ||
+- target_os == "freebsd") {
++ target_os == "freebsd" || target_os == "netbsd") {
+ sources += [ "src/trap-handler/handler-inside-posix.h" ]
+ } else if (is_win) {
+ sources += [ "src/trap-handler/handler-inside-win.h" ]
+@@ -6030,7 +6069,7 @@ v8_source_set("v8_base_without_compiler"
+ # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
+ # based on Darwin and thus POSIX-compliant to a similar degree.
+ if (is_linux || is_chromeos || is_mac || is_ios ||
+- target_os == "freebsd") {
++ target_os == "freebsd" || target_os == "netbsd") {
+ sources += [
+ "src/trap-handler/handler-inside-posix.cc",
+ "src/trap-handler/handler-outside-posix.cc",
+@@ -6645,7 +6684,7 @@ v8_component("v8_libbase") {
+ }
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
+ "src/base/platform/platform-linux.cc",
+@@ -6656,6 +6695,27 @@ v8_component("v8_libbase") {
+ "dl",
+ "rt",
+ ]
++ } else if (is_openbsd) {
++ sources += [
++ "src/base/debug/stack_trace_posix.cc",
++ "src/base/platform/platform-openbsd.cc",
++ ]
++ libs = [ "execinfo" ]
++ } else if (is_netbsd) {
++ sources += [
++ "src/base/debug/stack_trace_posix.cc",
++ "src/base/platform/platform-openbsd.cc",
++ ]
++ libs = [
++ "rt",
++ "execinfo",
++ ]
++ } else if (is_freebsd) {
++ sources += [
++ "src/base/debug/stack_trace_posix.cc",
++ "src/base/platform/platform-freebsd.cc",
++ ]
++ libs = [ "execinfo" ]
+ } else if (current_os == "aix") {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
diff --git a/chromium-next/patches/patch-v8_include_v8-internal.h b/chromium-next/patches/patch-v8_include_v8-internal.h
new file mode 100644
index 0000000000..bbe46e9139
--- /dev/null
+++ b/chromium-next/patches/patch-v8_include_v8-internal.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/include/v8-internal.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/include/v8-internal.h
+@@ -231,7 +231,7 @@ using SandboxedPointer_t = Address;
+ #ifdef V8_ENABLE_SANDBOX
+
+ // Size of the sandbox, excluding the guard regions surrounding it.
+-#if defined(V8_TARGET_OS_ANDROID)
++#if (defined(V8_TARGET_OS_ANDROID) || defined(V8_TARGET_OS_OPENBSD))
+ // On Android, most 64-bit devices seem to be configured with only 39 bits of
+ // virtual address space for userspace. As such, limit the sandbox to 128GB (a
+ // quarter of the total available address space).
diff --git a/chromium-next/patches/patch-v8_include_v8config.h b/chromium-next/patches/patch-v8_include_v8config.h
new file mode 100644
index 0000000000..5c114824cb
--- /dev/null
+++ b/chromium-next/patches/patch-v8_include_v8config.h
@@ -0,0 +1,59 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/include/v8config.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/include/v8config.h
+@@ -201,6 +201,9 @@ path. Add it with -I<path> to the comman
+ && !defined(V8_TARGET_OS_FUCHSIA) \
+ && !defined(V8_TARGET_OS_IOS) \
+ && !defined(V8_TARGET_OS_LINUX) \
++ && !defined(V8_TARGET_OS_OPENBSD) \
++ && !defined(V8_TARGET_OS_FREEBSD) \
++ && !defined(V8_TARGET_OS_NETBSD) \
+ && !defined(V8_TARGET_OS_MACOS) \
+ && !defined(V8_TARGET_OS_WIN) \
+ && !defined(V8_TARGET_OS_CHROMEOS)
+@@ -213,6 +216,9 @@ path. Add it with -I<path> to the comman
+ || defined(V8_TARGET_OS_FUCHSIA) \
+ || defined(V8_TARGET_OS_IOS) \
+ || defined(V8_TARGET_OS_LINUX) \
++ || defined(V8_TARGET_OS_OPENBSD) \
++ || defined(V8_TARGET_OS_FREEBSD) \
++ || defined(V8_TARGET_OS_NETBSD) \
+ || defined(V8_TARGET_OS_MACOS) \
+ || defined(V8_TARGET_OS_WIN) \
+ || defined(V8_TARGET_OS_CHROMEOS)
+@@ -236,6 +242,22 @@ path. Add it with -I<path> to the comman
+ # define V8_TARGET_OS_LINUX
+ #endif
+
++#ifdef V8_OS_OPENBSD
++# define V8_TARGET_OS_OPENBSD
++# define V8_TARGET_OS_BSD
++#endif
++
++#ifdef V8_OS_FREEBSD
++# define V8_TARGET_OS_OPENBSD
++# define V8_TARGET_OS_BSD
++#endif
++
++#ifdef V8_OS_NETBSD
++# define V8_TARGET_OS_OPENBSD
++# define V8_TARGET_OS_NETBSD
++# define V8_TARGET_OS_BSD
++#endif
++
+ #ifdef V8_OS_MACOS
+ # define V8_TARGET_OS_MACOS
+ #endif
+@@ -382,6 +404,7 @@ path. Add it with -I<path> to the comman
+ #if (defined(_M_X64) || defined(__x86_64__) /* x64 (everywhere) */ \
+ || ((defined(__AARCH64EL__) || defined(_M_ARM64)) /* arm64, but ... */ \
+ && !defined(_WIN32))) /* not on windows */ \
++ && !defined(__OpenBSD__) /* not on OpenBSD */ \
+ && !defined(COMPONENT_BUILD) /* no component build */\
+ && __clang_major__ >= 17 /* clang >= 17 */
+ # define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most))
diff --git a/chromium-next/patches/patch-v8_src_api_api.cc b/chromium-next/patches/patch-v8_src_api_api.cc
new file mode 100644
index 0000000000..775fa2ce10
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_api_api.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/api/api.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/api/api.cc
+@@ -152,7 +152,7 @@
+ #include "src/wasm/wasm-serialization.h"
+ #endif // V8_ENABLE_WEBASSEMBLY
+
+-#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD
++#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD || V8_OS_NETBSD
+ #include <signal.h>
+ #include <unistd.h>
+
+@@ -6571,7 +6571,7 @@ bool v8::V8::Initialize(const int build_
+ return true;
+ }
+
+-#if V8_OS_LINUX || V8_OS_DARWIN
++#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD|| V8_OS_NETBSD
+ bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info,
+ void* context) {
+ #if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED
diff --git a/chromium-next/patches/patch-v8_src_base_atomicops.h b/chromium-next/patches/patch-v8_src_base_atomicops.h
new file mode 100644
index 0000000000..dd9b13f944
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_atomicops.h
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/atomicops.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/atomicops.h
+@@ -57,10 +57,10 @@ using Atomic64 = SbAtomic64;
+ using Atomic8 = char;
+ using Atomic16 = int16_t;
+ using Atomic32 = int32_t;
+-#if defined(V8_HOST_ARCH_64_BIT)
++#if defined(V8_HOST_ARCH_64_BIT) || defined(V8_OS_OPENBSD)
+ // We need to be able to go between Atomic64 and AtomicWord implicitly. This
+ // means Atomic64 and AtomicWord should be the same type on 64-bit.
+-#if defined(__ILP32__)
++#if defined(__ILP32__) && !defined(V8_OS_OPENBSD)
+ using Atomic64 = int64_t;
+ #else
+ using Atomic64 = intptr_t;
+@@ -266,7 +266,7 @@ inline Atomic32 SeqCst_Load(volatile con
+ std::memory_order_seq_cst);
+ }
+
+-#if defined(V8_HOST_ARCH_64_BIT)
++#if defined(V8_HOST_ARCH_64_BIT) || defined(V8_OS_OPENBSD)
+
+ inline Atomic64 Relaxed_CompareAndSwap(volatile Atomic64* ptr,
+ Atomic64 old_value, Atomic64 new_value) {
diff --git a/chromium-next/patches/patch-v8_src_base_platform_memory.h b/chromium-next/patches/patch-v8_src_base_platform_memory.h
new file mode 100644
index 0000000000..b58d594a9a
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_platform_memory.h
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/platform/memory.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/platform/memory.h
+@@ -21,13 +21,13 @@
+ #include <malloc/malloc.h>
+ #elif V8_OS_OPENBSD
+ #include <sys/malloc.h>
+-#elif V8_OS_ZOS
++#elif (V8_OS_ZOS || V8_OS_BSD)
+ #include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+
+-#if (V8_OS_POSIX && !V8_OS_AIX && !V8_OS_SOLARIS && !V8_OS_ZOS && !V8_OS_OPENBSD) || V8_OS_WIN
++#if (V8_OS_POSIX && !V8_OS_AIX && !V8_OS_SOLARIS && !V8_OS_ZOS && !V8_OS_BSD) || V8_OS_WIN
+ #define V8_HAS_MALLOC_USABLE_SIZE 1
+ #endif
+
diff --git a/chromium-next/patches/patch-v8_src_base_platform_platform-freebsd.cc b/chromium-next/patches/patch-v8_src_base_platform_platform-freebsd.cc
new file mode 100644
index 0000000000..f3402c1139
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_platform_platform-freebsd.cc
@@ -0,0 +1,38 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/platform/platform-freebsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/platform/platform-freebsd.cc
+@@ -43,14 +43,10 @@ TimezoneCache* OS::CreateTimezoneCache()
+ return new PosixDefaultTimezoneCache();
+ }
+
+-static unsigned StringToLong(char* buffer) {
+- return static_cast<unsigned>(strtol(buffer, nullptr, 16));
+-}
+-
+ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
+ std::vector<SharedLibraryAddress> result;
+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid()};
+- size_t miblen = sizeof(mib) / sizeof(mib[0]);
++ unsigned int miblen = sizeof(mib) / sizeof(mib[0]);
+ size_t buffer_size;
+ if (sysctl(mib, miblen, nullptr, &buffer_size, nullptr, 0) == 0) {
+ // Overallocate the buffer by 1/3 to account for concurrent
+@@ -82,8 +78,13 @@ std::vector<OS::SharedLibraryAddress> OS
+ lib_name = std::string(path);
+ }
+ result.push_back(SharedLibraryAddress(
++#if defined(__i386__) || defined(OS_FREEBSD)
++ lib_name, static_cast<uintptr_t>(map->kve_start),
++ static_cast<uintptr_t>(map->kve_end)));
++#else
+ lib_name, reinterpret_cast<uintptr_t>(map->kve_start),
+ reinterpret_cast<uintptr_t>(map->kve_end)));
++#endif
+ }
+
+ start += ssize;
diff --git a/chromium-next/patches/patch-v8_src_base_platform_platform-openbsd.cc b/chromium-next/patches/patch-v8_src_base_platform_platform-openbsd.cc
new file mode 100644
index 0000000000..77d69eecbb
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_platform_platform-openbsd.cc
@@ -0,0 +1,53 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/platform/platform-openbsd.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/platform/platform-openbsd.cc
+@@ -6,6 +6,9 @@
+ // POSIX-compatible parts, the implementation is in platform-posix.cc.
+
+ #include <pthread.h>
++#if !defined(__NetBSD__)
++#include <pthread_np.h>
++#endif
+ #include <semaphore.h>
+ #include <signal.h>
+ #include <stdlib.h>
+@@ -122,6 +125,34 @@ void OS::SignalCodeMovingGC() {
+
+ void OS::AdjustSchedulingParams() {}
+
++// static
++Stack::StackSlot Stack::ObtainCurrentThreadStackStart() {
++#if defined(__NetBSD__)
++ pthread_attr_t attr;
++ int error;
++ pthread_attr_init(&attr);
++ error = pthread_attr_get_np(pthread_self(), &attr);
++ if (!error) {
++ void* base;
++ size_t size;
++ error = pthread_attr_getstack(&attr, &base, &size);
++ CHECK(!error);
++ pthread_attr_destroy(&attr);
++ return reinterpret_cast<uint8_t*>(base) + size;
++ }
++ pthread_attr_destroy(&attr);
++ return nullptr;
++#else
++ stack_t ss;
++ void *base;
++ if (pthread_stackseg_np(pthread_self(), &ss) != 0)
++ return nullptr;
++
++ base = (void*)((size_t) ss.ss_sp - ss.ss_size);
++ return reinterpret_cast<uint8_t*>(base) + ss.ss_size;
++#endif
++}
++
+ std::optional<OS::MemoryRange> OS::GetFirstFreeMemoryRangeWithin(
+ OS::Address boundary_start, OS::Address boundary_end, size_t minimum_size,
+ size_t alignment) {
diff --git a/chromium-next/patches/patch-v8_src_base_platform_platform-posix.cc b/chromium-next/patches/patch-v8_src_base_platform_platform-posix.cc
new file mode 100644
index 0000000000..113be30ebc
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_platform_platform-posix.cc
@@ -0,0 +1,101 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/platform/platform-posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/platform/platform-posix.cc
+@@ -27,6 +27,9 @@
+ defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/sysctl.h> // for sysctl
+ #endif
++#if defined(__NetBSD__)
++#include <lwp.h>
++#endif
+
+ #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
+ #define LOG_TAG "v8"
+@@ -75,9 +78,11 @@
+ #include <sys/syscall.h>
+ #endif
+
+-#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_OPENBSD || V8_OS_SOLARIS
++#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_BSD || V8_OS_SOLARIS
++#ifndef MAP_ANONYMOUS
+ #define MAP_ANONYMOUS MAP_ANON
+ #endif
++#endif
+
+ #if defined(V8_OS_SOLARIS)
+ #if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
+@@ -314,6 +319,13 @@ void OS::SetRandomMmapSeed(int64_t seed)
+ }
+ }
+
++#if V8_OS_OPENBSD
++// Allow OpenBSD's mmap to select a random address on OpenBSD
++// static
++void* OS::GetRandomMmapAddr() {
++ return nullptr;
++}
++#else
+ // static
+ void* OS::GetRandomMmapAddr() {
+ uintptr_t raw_addr;
+@@ -412,6 +424,7 @@ void* OS::GetRandomMmapAddr() {
+ #endif
+ return reinterpret_cast<void*>(raw_addr);
+ }
++#endif
+
+ // TODO(bbudge) Move Cygwin and Fuchsia stuff into platform-specific files.
+ #if !V8_OS_CYGWIN && !V8_OS_FUCHSIA
+@@ -700,7 +713,7 @@ void OS::DestroySharedMemoryHandle(Platf
+ #if !V8_OS_ZOS
+ // static
+ bool OS::HasLazyCommits() {
+-#if V8_OS_AIX || V8_OS_LINUX || V8_OS_DARWIN
++#if V8_OS_AIX || V8_OS_LINUX || V8_OS_DARWIN || V8_OS_BSD
+ return true;
+ #else
+ // TODO(bbudge) Return true for all POSIX platforms.
+@@ -855,6 +868,8 @@ int OS::GetCurrentThreadId() {
+ return static_cast<int>(thread_self());
+ #elif V8_OS_FUCHSIA
+ return static_cast<int>(zx_thread_self());
++#elif V8_OS_NETBSD
++ return static_cast<int>(_lwp_self());
+ #elif V8_OS_SOLARIS
+ return static_cast<int>(pthread_self());
+ #elif V8_OS_ZOS
+@@ -1156,7 +1171,11 @@ Thread::Thread(const Options& options)
+ stack_size_(options.stack_size()),
+ priority_(options.priority()),
+ start_semaphore_(nullptr) {
++#if !defined(V8_OS_NETBSD)
+ const int min_stack_size = static_cast<int>(PTHREAD_STACK_MIN);
++#else
++ const int min_stack_size = static_cast<int>(sysconf(_SC_THREAD_STACK_MIN));
++#endif
+ if (stack_size_ > 0) stack_size_ = std::max(stack_size_, min_stack_size);
+ set_name(options.name());
+ }
+@@ -1171,7 +1190,7 @@ static void SetThreadName(const char* na
+ pthread_set_name_np(pthread_self(), name);
+ #elif V8_OS_NETBSD
+ static_assert(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
+- pthread_setname_np(pthread_self(), "%s", name);
++ pthread_setname_np(pthread_self(), "%s", (void *)name);
+ #elif V8_OS_DARWIN
+ // pthread_setname_np is only available in 10.6 or later, so test
+ // for it at runtime.
+@@ -1346,7 +1365,7 @@ void Thread::SetThreadLocal(LocalStorage
+ // keep this version in POSIX as most Linux-compatible derivatives will
+ // support it. MacOS and FreeBSD are different here.
+ #if !defined(V8_OS_FREEBSD) && !defined(V8_OS_DARWIN) && !defined(_AIX) && \
+- !defined(V8_OS_SOLARIS)
++ !defined(V8_OS_SOLARIS) && !defined(V8_OS_OPENBSD) && !defined(V8_OS_NETBSD)
+
+ namespace {
+ #if DEBUG
diff --git a/chromium-next/patches/patch-v8_src_base_small-vector.h b/chromium-next/patches/patch-v8_src_base_small-vector.h
new file mode 100644
index 0000000000..009b9ea4fb
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_small-vector.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/small-vector.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/small-vector.h
+@@ -22,7 +22,7 @@ template <typename T, size_t kSize, type
+ class SmallVector {
+ // Currently only support trivially copyable and trivially destructible data
+ // types, as it uses memcpy to copy elements and never calls destructors.
+- ASSERT_TRIVIALLY_COPYABLE(T);
++ // XXX FREEBSD ASSERT_TRIVIALLY_COPYABLE(T);
+ static_assert(std::is_trivially_destructible<T>::value);
+
+ public:
diff --git a/chromium-next/patches/patch-v8_src_base_strings.h b/chromium-next/patches/patch-v8_src_base_strings.h
new file mode 100644
index 0000000000..d530fe435b
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_strings.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/strings.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/strings.h
+@@ -8,6 +8,9 @@
+ #include "src/base/base-export.h"
+ #include "src/base/macros.h"
+ #include "src/base/vector.h"
++#if defined(__NetBSD__)
++#include <stdarg.h>
++#endif
+
+ namespace v8 {
+ namespace base {
diff --git a/chromium-next/patches/patch-v8_src_base_sys-info.cc b/chromium-next/patches/patch-v8_src_base_sys-info.cc
new file mode 100644
index 0000000000..4f54eec5c8
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_sys-info.cc
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/sys-info.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/sys-info.cc
+@@ -35,8 +35,12 @@ namespace base {
+
+ // static
+ int SysInfo::NumberOfProcessors() {
++#if V8_OS_OPENBSD || V8_OS_NETBSD
+ #if V8_OS_OPENBSD
++ int mib[2] = {CTL_HW, HW_NCPUONLINE};
++#else
+ int mib[2] = {CTL_HW, HW_NCPU};
++#endif
+ int ncpu = 0;
+ size_t len = sizeof(ncpu);
+ if (sysctl(mib, arraysize(mib), &ncpu, &len, nullptr, 0) != 0) {
diff --git a/chromium-next/patches/patch-v8_src_base_utils_random-number-generator.cc b/chromium-next/patches/patch-v8_src_base_utils_random-number-generator.cc
new file mode 100644
index 0000000000..fc451d307d
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_base_utils_random-number-generator.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/base/utils/random-number-generator.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/base/utils/random-number-generator.cc
+@@ -56,7 +56,7 @@ RandomNumberGenerator::RandomNumberGener
+ DCHECK_EQ(0, result);
+ USE(result);
+ SetSeed((static_cast<int64_t>(first_half) << 32) + second_half);
+-#elif V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD
++#elif V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD || V8_OS_NETBSD
+ // Despite its prefix suggests it is not RC4 algorithm anymore.
+ // It always succeeds while having decent performance and
+ // no file descriptor involved.
diff --git a/chromium-next/patches/patch-v8_src_diagnostics_perf-jit.cc b/chromium-next/patches/patch-v8_src_diagnostics_perf-jit.cc
new file mode 100644
index 0000000000..d32c380a68
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_diagnostics_perf-jit.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/diagnostics/perf-jit.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/diagnostics/perf-jit.cc
+@@ -31,7 +31,7 @@
+ #include "src/flags/flags.h"
+
+ // Only compile the {LinuxPerfJitLogger} on Linux.
+-#if V8_OS_LINUX
++#if defined(V8_OS_LINUX) || defined(V8_OS_BSD)
+
+ #include <fcntl.h>
+ #include <sys/mman.h>
diff --git a/chromium-next/patches/patch-v8_src_diagnostics_perf-jit.h b/chromium-next/patches/patch-v8_src_diagnostics_perf-jit.h
new file mode 100644
index 0000000000..bdbf766254
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_diagnostics_perf-jit.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/diagnostics/perf-jit.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/diagnostics/perf-jit.h
+@@ -31,7 +31,7 @@
+ #include "include/v8config.h"
+
+ // {LinuxPerfJitLogger} is only implemented on Linux.
+-#if V8_OS_LINUX
++#if defined(V8_OS_LINUX) || defined(V8_OS_BSD)
+
+ #include "src/logging/log.h"
+
diff --git a/chromium-next/patches/patch-v8_src_execution_isolate.cc b/chromium-next/patches/patch-v8_src_execution_isolate.cc
new file mode 100644
index 0000000000..ac9a6d7b8b
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_execution_isolate.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/execution/isolate.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/execution/isolate.cc
+@@ -170,6 +170,10 @@
+ #include "src/execution/simulator-base.h"
+ #endif
+
++#if defined(V8_OS_OPENBSD)
++#include <sys/mman.h>
++#endif
++
+ extern "C" const uint8_t v8_Default_embedded_blob_code_[];
+ extern "C" uint32_t v8_Default_embedded_blob_code_size_;
+ extern "C" const uint8_t v8_Default_embedded_blob_data_[];
+@@ -4990,6 +4994,13 @@ void Isolate::InitializeDefaultEmbeddedB
+ const uint8_t* data = DefaultEmbeddedBlobData();
+ uint32_t data_size = DefaultEmbeddedBlobDataSize();
+
++#if defined(V8_OS_OPENBSD) && !defined(V8_TARGET_ARCH_IA32)
++ if (code_size > 0) {
++ mprotect(reinterpret_cast<void *>(const_cast<uint8_t *>(code)),
++ code_size, PROT_READ | PROT_EXEC);
++ }
++#endif
++
+ if (StickyEmbeddedBlobCode() != nullptr) {
+ base::MutexGuard guard(current_embedded_blob_refcount_mutex_.Pointer());
+ // Check again now that we hold the lock.
diff --git a/chromium-next/patches/patch-v8_src_flags_flags.cc b/chromium-next/patches/patch-v8_src_flags_flags.cc
new file mode 100644
index 0000000000..d84722be32
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_flags_flags.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/flags/flags.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/flags/flags.cc
+@@ -16,6 +16,10 @@
+ #include <set>
+ #include <sstream>
+
++#if V8_OS_OPENBSD
++#include <sys/mman.h>
++#endif
++
+ #include "src/base/functional.h"
+ #include "src/base/lazy-instance.h"
+ #include "src/base/platform/platform.h"
+@@ -816,6 +820,10 @@ void FlagList::FreezeFlags() {
+ // Note that for string flags we only protect the pointer itself, but not the
+ // string storage. TODO(12887): Fix this.
+ base::OS::SetDataReadOnly(&v8_flags, sizeof(v8_flags));
++#if V8_OS_OPENBSD
++ if (mimmutable(&v8_flags, sizeof(v8_flags)) == -1)
++ FATAL("unable to set immutability of v8_flags");
++#endif
+ }
+
+ // static
diff --git a/chromium-next/patches/patch-v8_src_libsampler_sampler.cc b/chromium-next/patches/patch-v8_src_libsampler_sampler.cc
new file mode 100644
index 0000000000..ab3f7d18be
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_libsampler_sampler.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/libsampler/sampler.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/libsampler/sampler.cc
+@@ -519,6 +519,16 @@ void SignalHandler::FillRegisterState(vo
+ state->pc = reinterpret_cast<void*>(mcontext.__gregs[_REG_PC]);
+ state->sp = reinterpret_cast<void*>(mcontext.__gregs[_REG_SP]);
+ state->fp = reinterpret_cast<void*>(mcontext.__gregs[_REG_FP]);
++#elif V8_HOST_ARCH_ARM64
++#ifdef __CHERI_PURE_CAPABILITY__
++ state->pc = reinterpret_cast<void*>(mcontext.mc_capregs.cap_elr);
++ state->sp = reinterpret_cast<void*>(mcontext.mc_capregs.cap_sp);
++ state->fp = reinterpret_cast<void*>(mcontext.mc_capregs.cap_x[29]);
++#else // !__CHERI_PURE_CAPABILITY__
++ state->pc = reinterpret_cast<void*>(mcontext.mc_gpregs.gp_elr);
++ state->sp = reinterpret_cast<void*>(mcontext.mc_gpregs.gp_sp);
++ state->fp = reinterpret_cast<void*>(mcontext.mc_gpregs.gp_x[29]);
++#endif // __CHERI_PURE_CAPABILITY__
+ #endif // V8_HOST_ARCH_*
+ #elif V8_OS_NETBSD
+ #if V8_HOST_ARCH_IA32
diff --git a/chromium-next/patches/patch-v8_src_sandbox_sandbox.cc b/chromium-next/patches/patch-v8_src_sandbox_sandbox.cc
new file mode 100644
index 0000000000..3816b86341
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_sandbox_sandbox.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/sandbox/sandbox.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/sandbox/sandbox.cc
+@@ -50,7 +50,7 @@ static Address DetermineAddressSpaceLimi
+ }
+ #endif // V8_TARGET_ARCH_X64
+
+-#if defined(V8_TARGET_ARCH_ARM64) && defined(V8_TARGET_OS_ANDROID)
++#if defined(V8_TARGET_ARCH_ARM64) && (defined(V8_TARGET_OS_ANDROID) || defined(V8_TARGET_OS_OPENBSD))
+ // On Arm64 Android assume a 40-bit virtual address space (39 bits for
+ // userspace and kernel each) as that appears to be the most common
+ // configuration and there seems to be no easy way to retrieve the actual
diff --git a/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.cc b/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.cc
new file mode 100644
index 0000000000..09c1244389
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc
+@@ -148,6 +148,8 @@ EmbeddedTargetOs ToEmbeddedTargetOs(cons
+ return EmbeddedTargetOs::kStarboard;
+ } else if (string == "zos") {
+ return EmbeddedTargetOs::kZOS;
++ } else if (string == "openbsd") {
++ return EmbeddedTargetOs::kOpenBSD;
+ } else {
+ return EmbeddedTargetOs::kGeneric;
+ }
diff --git a/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.h b/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.h
new file mode 100644
index 0000000000..a32366fe30
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-base.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/snapshot/embedded/platform-embedded-file-writer-base.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/snapshot/embedded/platform-embedded-file-writer-base.h
+@@ -36,6 +36,7 @@ enum class EmbeddedTargetOs {
+ kWin,
+ kStarboard,
+ kZOS,
++ kOpenBSD,
+ kGeneric, // Everything not covered above falls in here.
+ };
+
diff --git a/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-generic.cc b/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-generic.cc
new file mode 100644
index 0000000000..7ea4157a59
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_snapshot_embedded_platform-embedded-file-writer-generic.cc
@@ -0,0 +1,48 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/snapshot/embedded/platform-embedded-file-writer-generic.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/snapshot/embedded/platform-embedded-file-writer-generic.cc
+@@ -9,6 +9,10 @@
+
+ #include "src/objects/instruction-stream.h"
+
++#if V8_OS_OPENBSD
++#include <sys/param.h>
++#endif
++
+ namespace v8 {
+ namespace internal {
+
+@@ -35,6 +39,10 @@ const char* DirectiveAsString(DataDirect
+ void PlatformEmbeddedFileWriterGeneric::SectionText() {
+ if (target_os_ == EmbeddedTargetOs::kChromeOS) {
+ fprintf(fp_, ".section .text.hot.embedded\n");
++#if !defined(V8_TARGET_ARCH_IA32)
++ } else if (target_os_ == EmbeddedTargetOs::kOpenBSD) {
++ fprintf(fp_, ".section .openbsd.mutable,\"a\"\n");
++#endif
+ } else {
+ fprintf(fp_, ".section .text\n");
+ }
+@@ -66,6 +74,8 @@ void PlatformEmbeddedFileWriterGeneric::
+ // On these architectures and platforms, we remap the builtins, so need these
+ // to be aligned on a page boundary.
+ fprintf(fp_, ".balign 4096\n");
++#elif defined(V8_OS_OPENBSD) && !defined(V8_TARGET_ARCH_IA32)
++ fprintf(fp_, ".balign %d\n", PAGE_SIZE);
+ #elif V8_TARGET_ARCH_X64
+ // On x64 use 64-bytes code alignment to allow 64-bytes loop header alignment.
+ static_assert(64 >= kCodeAlignment);
+@@ -86,6 +96,8 @@ void PlatformEmbeddedFileWriterGeneric::
+ (V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64)
+ // Since the builtins are remapped, need to pad until the next page boundary.
+ fprintf(fp_, ".balign 4096\n");
++#elif defined(V8_OS_OPENBSD) && !defined(V8_TARGET_ARCH_IA32)
++ fprintf(fp_, ".balign %d\n", PAGE_SIZE);
+ #endif
+ }
+
diff --git a/chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.cc b/chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.cc
new file mode 100644
index 0000000000..3382aa7c8a
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.cc
@@ -0,0 +1,43 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/trap-handler/handler-inside-posix.cc.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/trap-handler/handler-inside-posix.cc
+@@ -27,7 +27,7 @@
+
+ #include <signal.h>
+
+-#if defined(V8_OS_LINUX) || defined(V8_OS_FREEBSD)
++#if defined(V8_OS_LINUX) || defined(V8_OS_FREEBSD) || defined(V8_OS_NETBSD)
+ #include <ucontext.h>
+ #elif V8_OS_DARWIN
+ #include <sys/ucontext.h>
+@@ -61,6 +61,10 @@ namespace trap_handler {
+ #define CONTEXT_REG(reg, REG) &uc->uc_mcontext->__ss.__##reg
+ #elif V8_OS_FREEBSD
+ #define CONTEXT_REG(reg, REG) &uc->uc_mcontext.mc_##reg
++#elif V8_OS_OPENBSD
++#define CONTEXT_REG(reg, REG) &uc->sc_##reg
++#elif V8_OS_NETBSD
++#define CONTEXT_REG(reg, REG) &uc->uc_mcontext.__gregs[_REG_##REG]
+ #else
+ #error "Unsupported platform."
+ #endif
+@@ -80,8 +84,12 @@ bool IsKernelGeneratedSignal(siginfo_t*
+ // si_code at its default of 0 for signals that don’t originate in hardware.
+ // The other conditions are only relevant for Linux.
+ return info->si_code > 0 && info->si_code != SI_USER &&
+- info->si_code != SI_QUEUE && info->si_code != SI_TIMER &&
+- info->si_code != SI_ASYNCIO && info->si_code != SI_MESGQ;
++ info->si_code != SI_QUEUE && info->si_code != SI_TIMER
++#ifdef V8_OS_OPENBSD
++ ;
++#else
++ && info->si_code != SI_ASYNCIO && info->si_code != SI_MESGQ;
++#endif
+ }
+
+ class UnmaskOobSignalScope {
diff --git a/chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.h b/chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.h
new file mode 100644
index 0000000000..0596911a6a
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_trap-handler_handler-inside-posix.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/trap-handler/handler-inside-posix.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/trap-handler/handler-inside-posix.h
+@@ -13,7 +13,7 @@ namespace v8 {
+ namespace internal {
+ namespace trap_handler {
+
+-#if V8_OS_LINUX || V8_OS_FREEBSD
++#if V8_OS_LINUX || V8_OS_FREEBSD || V8_OS_OPENBSD || V8_OS_NETBSD
+ constexpr int kOobSignal = SIGSEGV;
+ #elif V8_OS_DARWIN
+ constexpr int kOobSignal = SIGBUS;
diff --git a/chromium-next/patches/patch-v8_src_trap-handler_trap-handler.h b/chromium-next/patches/patch-v8_src_trap-handler_trap-handler.h
new file mode 100644
index 0000000000..ee24af657b
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_trap-handler_trap-handler.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/trap-handler/trap-handler.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/trap-handler/trap-handler.h
+@@ -20,7 +20,7 @@ namespace trap_handler {
+ // X64 on Linux, Windows, MacOS, FreeBSD.
+ #if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
+ ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \
+- V8_OS_FREEBSD)
++ V8_OS_FREEBSD || V8_OS_OPENBSD) || V8_OS_NETBSD)
+ #define V8_TRAP_HANDLER_SUPPORTED true
+ // Arm64 (non-simulator) on Linux, Windows, MacOS.
+ #elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && \
diff --git a/chromium-next/patches/patch-v8_src_wasm_baseline_ia32_liftoff-assembler-ia32-inl.h b/chromium-next/patches/patch-v8_src_wasm_baseline_ia32_liftoff-assembler-ia32-inl.h
new file mode 100644
index 0000000000..363642ad62
--- /dev/null
+++ b/chromium-next/patches/patch-v8_src_wasm_baseline_ia32_liftoff-assembler-ia32-inl.h
@@ -0,0 +1,134 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/src/wasm/baseline/ia32/liftoff-assembler-ia32-inl.h.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/src/wasm/baseline/ia32/liftoff-assembler-ia32-inl.h
+@@ -579,7 +579,7 @@ void LiftoffAssembler::StoreTaggedPointe
+ }
+
+ void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
+- Register offset_reg, uint32_t offset_imm,
++ Register offset_reg, uintptr_t offset_imm,
+ LoadType type, uint32_t* protected_load_pc,
+ bool /* is_load_mem */, bool /* i64_offset */,
+ bool needs_shift) {
+@@ -659,7 +659,7 @@ void LiftoffAssembler::Load(LiftoffRegis
+ }
+
+ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister src,
++ uintptr_t offset_imm, LiftoffRegister src,
+ StoreType type, LiftoffRegList pinned,
+ uint32_t* protected_store_pc,
+ bool /* is_store_mem */, bool /* i64_offset */) {
+@@ -738,7 +738,7 @@ void LiftoffAssembler::Store(Register ds
+ }
+
+ void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
+- Register offset_reg, uint32_t offset_imm,
++ Register offset_reg, uintptr_t offset_imm,
+ LoadType type, LiftoffRegList /* pinned */,
+ bool /* i64_offset */) {
+ if (type.value() != LoadType::kI64Load) {
+@@ -756,7 +756,7 @@ void LiftoffAssembler::AtomicLoad(Liftof
+ }
+
+ void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister src,
++ uintptr_t offset_imm, LiftoffRegister src,
+ StoreType type, LiftoffRegList pinned,
+ bool /* i64_offset */) {
+ DCHECK_LE(offset_imm, std::numeric_limits<int32_t>::max());
+@@ -826,7 +826,7 @@ enum Binop { kAdd, kSub, kAnd, kOr, kXor
+
+ inline void AtomicAddOrSubOrExchange32(LiftoffAssembler* lasm, Binop binop,
+ Register dst_addr, Register offset_reg,
+- uint32_t offset_imm,
++ uintptr_t offset_imm,
+ LiftoffRegister value,
+ LiftoffRegister result, StoreType type) {
+ DCHECK_EQ(value, result);
+@@ -894,7 +894,7 @@ inline void AtomicAddOrSubOrExchange32(L
+ }
+
+ inline void AtomicBinop32(LiftoffAssembler* lasm, Binop op, Register dst_addr,
+- Register offset_reg, uint32_t offset_imm,
++ Register offset_reg, uintptr_t offset_imm,
+ LiftoffRegister value, LiftoffRegister result,
+ StoreType type) {
+ DCHECK_EQ(value, result);
+@@ -1009,7 +1009,7 @@ inline void AtomicBinop32(LiftoffAssembl
+ }
+
+ inline void AtomicBinop64(LiftoffAssembler* lasm, Binop op, Register dst_addr,
+- Register offset_reg, uint32_t offset_imm,
++ Register offset_reg, uintptr_t offset_imm,
+ LiftoffRegister value, LiftoffRegister result) {
+ // We need {ebx} here, which is the root register. As the root register it
+ // needs special treatment. As we use {ebx} directly in the code below, we
+@@ -1105,7 +1105,7 @@ inline void AtomicBinop64(LiftoffAssembl
+ } // namespace liftoff
+
+ void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type,
+ bool /* i64_offset */) {
+ if (type.value() == StoreType::kI64Store) {
+@@ -1119,7 +1119,7 @@ void LiftoffAssembler::AtomicAdd(Registe
+ }
+
+ void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type,
+ bool /* i64_offset */) {
+ if (type.value() == StoreType::kI64Store) {
+@@ -1132,7 +1132,7 @@ void LiftoffAssembler::AtomicSub(Registe
+ }
+
+ void LiftoffAssembler::AtomicAnd(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type,
+ bool /* i64_offset */) {
+ if (type.value() == StoreType::kI64Store) {
+@@ -1146,7 +1146,7 @@ void LiftoffAssembler::AtomicAnd(Registe
+ }
+
+ void LiftoffAssembler::AtomicOr(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type,
+ bool /* i64_offset */) {
+ if (type.value() == StoreType::kI64Store) {
+@@ -1160,7 +1160,7 @@ void LiftoffAssembler::AtomicOr(Register
+ }
+
+ void LiftoffAssembler::AtomicXor(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm, LiftoffRegister value,
++ uintptr_t offset_imm, LiftoffRegister value,
+ LiftoffRegister result, StoreType type,
+ bool /* i64_offset */) {
+ if (type.value() == StoreType::kI64Store) {
+@@ -1174,7 +1174,7 @@ void LiftoffAssembler::AtomicXor(Registe
+ }
+
+ void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg,
+- uint32_t offset_imm,
++ uintptr_t offset_imm,
+ LiftoffRegister value,
+ LiftoffRegister result, StoreType type,
+ bool /* i64_offset */) {
+@@ -1189,7 +1189,7 @@ void LiftoffAssembler::AtomicExchange(Re
+ }
+
+ void LiftoffAssembler::AtomicCompareExchange(
+- Register dst_addr, Register offset_reg, uint32_t offset_imm,
++ Register dst_addr, Register offset_reg, uintptr_t offset_imm,
+ LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result,
+ StoreType type, bool /* i64_offset */) {
+ // We expect that the offset has already been added to {dst_addr}, and no
diff --git a/chromium-next/patches/patch-v8_tools_run-paxctl.py b/chromium-next/patches/patch-v8_tools_run-paxctl.py
new file mode 100644
index 0000000000..b6fe08354e
--- /dev/null
+++ b/chromium-next/patches/patch-v8_tools_run-paxctl.py
@@ -0,0 +1,25 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/tools/run-paxctl.py.orig 2025-01-20 18:01:28.062854163 +0000
++++ v8/tools/run-paxctl.py
+@@ -0,0 +1,16 @@
++#!@PYTHONBIN@
++# Copyright 2014 the V8 project authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++"""This program wraps an arbitrary command since gn currently can only execute
++scripts."""
++
++import subprocess
++import sys
++import os
++
++with open(sys.argv[1], 'w'):
++ os.utime(sys.argv[1], None)
++
++sys.exit(subprocess.call(sys.argv[2:]))
diff --git a/chromium-next/patches/patch-v8_tools_run.py b/chromium-next/patches/patch-v8_tools_run.py
new file mode 100644
index 0000000000..75675cbaa7
--- /dev/null
+++ b/chromium-next/patches/patch-v8_tools_run.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Part of patchset to build chromium on NetBSD
+* Based on OpenBSD's chromium patches, and
+ pkgsrc's qt5-qtwebengine patches
+
+--- v8/tools/run.py.orig 2025-01-07 19:49:01.000000000 +0000
++++ v8/tools/run.py
+@@ -21,7 +21,7 @@ if cmd and cmd[0] == '--redirect-stdout'
+ kwargs = dict(stdout=subprocess.PIPE)
+ cmd = cmd[2:]
+
+-process = subprocess.Popen(cmd, **kwargs)
++process = subprocess.Popen(cmd, env={"LD_LIBRARY_PATH":"${WRKSRC}/out/Release"}, **kwargs)
+ stdout, _ = process.communicate()
+ if stdout_file:
+ with stdout_file.open('w') as f:
diff --git a/chromium-next/tests.mk b/chromium-next/tests.mk
new file mode 100644
index 0000000000..ba3a6797b1
--- /dev/null
+++ b/chromium-next/tests.mk
@@ -0,0 +1,59 @@
+# $NetBSD$
+
+REGRESS_DISTFILE= chromium-${VERSION}-testdata${EXTRACT_SUFX_C}
+DISTFILES+= ${REGRESS_DISTFILE}
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX_C}
+#EXTRACT_ONLY+= ${PROFILE_DISTFILES}
+EXTRACT_ONLY+= ${_GITHUB_DEFAULT_DISTFILES}
+
+USE_TOOLS+= xzcat gzip tar
+
+#TEST_ENV+= FONTCONFIG_SYSROOT=${WRKSRC}/third_party/test_fonts
+
+TEST_TARGET= base_unittests
+TEST_TARGET+= blink_unittests
+TEST_TARGET+= chromedriver_unittests
+
+# third_party/crashpad/crashpad/handler/handler_main.cc: error:
+# use of undeclared identifier 'ReinstallCrashHandler'
+# use of undeclared identifier 'InstallCrashHandler'
+# use of undeclared identifier 'CrashReportExceptionHandler'
+# use of undeclared identifier 'exception_handler_server'
+#TEST_TARGET+= components_unittests
+
+TEST_TARGET+= content_unittests
+TEST_TARGET+= crypto_unittests
+TEST_TARGET+= gl_tests
+TEST_TARGET+= gpu_unittests
+TEST_TARGET+= headless_unittests
+TEST_TARGET+= media_unittests
+
+# third_party/ipcz/src/reference_drivers/wrapped_file_descriptor.h:
+# no member named 'kFileDescriptor' in 'ipcz::reference_drivers::Object'
+#TEST_TARGET+= mojo_unittests
+
+TEST_TARGET+= net_unittests
+TEST_TARGET+= pdf_unittests
+
+# printing/mojom/printing_context_mojom_traits_unittest.cc:88:2:
+# error: "System print dialog support not implemented for this platform."
+#TEST_TARGET+= printing_unittests
+
+TEST_TARGET+= skia_unittests
+TEST_TARGET+= url_unittests
+TEST_TARGET+= wm_unittests
+
+pre-test:
+ @${ECHO_MSG} "=> Extracting ${REGRESS_DISTFILE}"
+ ${XZCAT} ${DISTDIR}/${REGRESS_DISTFILE} | ${TAR} -C ${WRKDIR} -xf -
+ ${MKDIR} ${WRKSRC}/third_party/llvm-build/Release+Asserts/bin
+ ${LN} -sf ${PREFIX}/bin/clang++ ${WRKSRC}/third_party/llvm-build/Release+Asserts/bin/clang++
+ ${LN} -sf ${PREFIX}/bin/clang ${WRKSRC}/third_party/llvm-build/Release+Asserts/bin/clang
+ ${LN} -sf ${PREFIX}/bin/llvm-ar ${WRKSRC}/third_party/llvm-build/Release+Asserts/bin/llvm-ar
+
+do-test:
+.for t in ${TEST_TARGET}
+ @${ECHO_MSG} "=> Test target: ${t}"
+ cd ${WRKSRC} && \
+ ${SETENV} ${TEST_ENV} ${PREFIX}/bin/ninja -j ${MAKE_JOBS:U1} -C out/${BUILDTYPE} ${t}
+.endfor
diff --git a/chromium/TODO b/chromium/TODO
index 5946e48353..6feab70900 100644
--- a/chromium/TODO
+++ b/chromium/TODO
@@ -17,3 +17,5 @@ This is the workaround, see the files/chromium.sh.in launch wrapper.
2) HID doesn't work on NetBSD.
NOTE: For this OpenBSD uses libudev-openbsd, FreeBSD uses devd.
+NOTE: chromium-132 switch to llvm-19, so chromium-132 available
+as wip/chromium-next what is use wip/llvm.
Home |
Main Index |
Thread Index |
Old Index