aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroki Tagato <tagattie@FreeBSD.org>2022-06-22 06:53:47 +0000
committerHiroki Tagato <tagattie@FreeBSD.org>2022-06-22 06:56:20 +0000
commit1780f894bd82243f6fe8b0795364f952ae10b9c1 (patch)
treea21d83d3dc4a29a9a3075605c851c55494a93f26
parent0e6e415499814b667ce2ae5b30ad5b39b654ee88 (diff)
downloadports-1780f894bd82243f6fe8b0795364f952ae10b9c1.tar.gz
ports-1780f894bd82243f6fe8b0795364f952ae10b9c1.zip
devel/electron18: add port: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build cross platform desktop apps with JavaScript, HTML, and CSS. It's easier than you think. If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. WWW: https://electronjs.org/ Requested by: mikael (via email)
-rw-r--r--devel/Makefile1
-rw-r--r--devel/electron18/Makefile354
-rw-r--r--devel/electron18/Makefile.version2
-rw-r--r--devel/electron18/distinfo21
-rw-r--r--devel/electron18/files/apply-electron-patches.sh26
-rw-r--r--devel/electron18/files/package.json144
-rw-r--r--devel/electron18/files/patch-BUILD.gn72
-rw-r--r--devel/electron18/files/patch-apps_ui_views_app__window__frame__view.cc11
-rw-r--r--devel/electron18/files/patch-ash_display_mirror__window__controller.cc14
-rw-r--r--devel/electron18/files/patch-base_BUILD.gn146
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_address__space__randomization.h11
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator.h11
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h16
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc.cc15
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc__config.h20
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_partition__page.h22
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_partition__root.h11
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_spinning__mutex.cc47
-rw-r--r--devel/electron18/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc50
-rw-r--r--devel/electron18/files/patch-base_atomicops.h14
-rw-r--r--devel/electron18/files/patch-base_base__paths__posix.cc98
-rw-r--r--devel/electron18/files/patch-base_base__switches.cc11
-rw-r--r--devel/electron18/files/patch-base_base__switches.h11
-rw-r--r--devel/electron18/files/patch-base_cpu.h11
-rw-r--r--devel/electron18/files/patch-base_debug_debugger__posix.cc68
-rw-r--r--devel/electron18/files/patch-base_debug_elf__reader.cc18
-rw-r--r--devel/electron18/files/patch-base_debug_proc__maps__linux.cc11
-rw-r--r--devel/electron18/files/patch-base_debug_stack__trace__posix.cc38
-rw-r--r--devel/electron18/files/patch-base_files_file__path__watcher__bsd.cc57
-rw-r--r--devel/electron18/files/patch-base_files_file__path__watcher__kqueue.h10
-rw-r--r--devel/electron18/files/patch-base_files_file__path__watcher__unittest.cc29
-rw-r--r--devel/electron18/files/patch-base_files_file__util__posix.cc52
-rw-r--r--devel/electron18/files/patch-base_files_file__util__unittest.cc20
-rw-r--r--devel/electron18/files/patch-base_files_important__file__writer__cleaner.cc12
-rw-r--r--devel/electron18/files/patch-base_files_scoped__file.cc11
-rw-r--r--devel/electron18/files/patch-base_i18n_icu__util.cc20
-rw-r--r--devel/electron18/files/patch-base_linux__util.cc28
-rw-r--r--devel/electron18/files/patch-base_logging__unittest.cc31
-rw-r--r--devel/electron18/files/patch-base_memory_discardable__memory.cc38
-rw-r--r--devel/electron18/files/patch-base_memory_discardable__memory__internal.h11
-rw-r--r--devel/electron18/files/patch-base_memory_madv__free__discardable__memory__posix.cc21
-rw-r--r--devel/electron18/files/patch-base_memory_platform__shared__memory__region.h29
-rw-r--r--devel/electron18/files/patch-base_memory_platform__shared__memory__region__posix.cc29
-rw-r--r--devel/electron18/files/patch-base_message__loop_message__pump__glib.cc28
-rw-r--r--devel/electron18/files/patch-base_native__library__posix.cc11
-rw-r--r--devel/electron18/files/patch-base_native__library__unittest.cc11
-rw-r--r--devel/electron18/files/patch-base_posix_can__lower__nice__to.cc16
-rw-r--r--devel/electron18/files/patch-base_posix_unix__domain__socket.cc39
-rw-r--r--devel/electron18/files/patch-base_posix_unix__domain__socket__unittest.cc11
-rw-r--r--devel/electron18/files/patch-base_process_kill.h11
-rw-r--r--devel/electron18/files/patch-base_process_kill__posix.cc11
-rw-r--r--devel/electron18/files/patch-base_process_launch.h11
-rw-r--r--devel/electron18/files/patch-base_process_launch__posix.cc12
-rw-r--r--devel/electron18/files/patch-base_process_memory.cc20
-rw-r--r--devel/electron18/files/patch-base_process_process__handle.cc11
-rw-r--r--devel/electron18/files/patch-base_process_process__handle.h11
-rw-r--r--devel/electron18/files/patch-base_process_process__handle__freebsd.cc23
-rw-r--r--devel/electron18/files/patch-base_process_process__handle__openbsd.cc89
-rw-r--r--devel/electron18/files/patch-base_process_process__iterator__freebsd.cc51
-rw-r--r--devel/electron18/files/patch-base_process_process__iterator__openbsd.cc45
-rw-r--r--devel/electron18/files/patch-base_process_process__metrics.cc47
-rw-r--r--devel/electron18/files/patch-base_process_process__metrics.h119
-rw-r--r--devel/electron18/files/patch-base_process_process__metrics__freebsd.cc292
-rw-r--r--devel/electron18/files/patch-base_process_process__metrics__openbsd.cc235
-rw-r--r--devel/electron18/files/patch-base_process_process__metrics__posix.cc20
-rw-r--r--devel/electron18/files/patch-base_process_process__posix.cc93
-rw-r--r--devel/electron18/files/patch-base_process_process__unittest.cc11
-rw-r--r--devel/electron18/files/patch-base_profiler_stack__sampling__profiler__test__util.cc11
-rw-r--r--devel/electron18/files/patch-base_profiler_stack__sampling__profiler__unittest.cc11
-rw-r--r--devel/electron18/files/patch-base_rand__util.h11
-rw-r--r--devel/electron18/files/patch-base_rand__util__posix.cc52
-rw-r--r--devel/electron18/files/patch-base_strings_safe__sprintf__unittest.cc18
-rw-r--r--devel/electron18/files/patch-base_synchronization_lock__impl.h23
-rw-r--r--devel/electron18/files/patch-base_syslog__logging.cc20
-rw-r--r--devel/electron18/files/patch-base_system_sys__info.cc11
-rw-r--r--devel/electron18/files/patch-base_system_sys__info.h20
-rw-r--r--devel/electron18/files/patch-base_system_sys__info__freebsd.cc113
-rw-r--r--devel/electron18/files/patch-base_system_sys__info__openbsd.cc102
-rw-r--r--devel/electron18/files/patch-base_system_sys__info__posix.cc43
-rw-r--r--devel/electron18/files/patch-base_system_sys__info__unittest.cc19
-rw-r--r--devel/electron18/files/patch-base_task_thread__pool_environment__config__unittest.cc11
-rw-r--r--devel/electron18/files/patch-base_test_launcher_test__launcher.cc10
-rw-r--r--devel/electron18/files/patch-base_test_test__file__util__linux.cc13
-rw-r--r--devel/electron18/files/patch-base_test_test__file__util__posix.cc11
-rw-r--r--devel/electron18/files/patch-base_third__party_libevent_BUILD.gn24
-rw-r--r--devel/electron18/files/patch-base_third__party_libevent_event-config.h11
-rw-r--r--devel/electron18/files/patch-base_third__party_libevent_openbsd_config.h279
-rw-r--r--devel/electron18/files/patch-base_third__party_libevent_openbsd_event-config.h287
-rw-r--r--devel/electron18/files/patch-base_third__party_symbolize_symbolize.cc11
-rw-r--r--devel/electron18/files/patch-base_threading_platform__thread.h11
-rw-r--r--devel/electron18/files/patch-base_threading_platform__thread__linux.cc77
-rw-r--r--devel/electron18/files/patch-base_threading_platform__thread__posix.cc21
-rw-r--r--devel/electron18/files/patch-base_threading_platform__thread__unittest.cc47
-rw-r--r--devel/electron18/files/patch-base_time_time.cc11
-rw-r--r--devel/electron18/files/patch-base_trace__event_malloc__dump__provider.cc21
-rw-r--r--devel/electron18/files/patch-base_trace__event_memory__dump__manager.cc11
-rw-r--r--devel/electron18/files/patch-base_trace__event_process__memory__dump.cc20
-rw-r--r--devel/electron18/files/patch-base_tracing_trace__time.cc28
-rw-r--r--devel/electron18/files/patch-base_tracing_trace__time.h11
-rw-r--r--devel/electron18/files/patch-build_config_BUILD.gn22
-rw-r--r--devel/electron18/files/patch-build_config_BUILDCONFIG.gn45
-rw-r--r--devel/electron18/files/patch-build_config_compiler_BUILD.gn113
-rw-r--r--devel/electron18/files/patch-build_config_compiler_pgo_pgo.gni11
-rw-r--r--devel/electron18/files/patch-build_config_linux_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-build_config_linux_pkg-config.py11
-rw-r--r--devel/electron18/files/patch-build_config_ozone.gni19
-rw-r--r--devel/electron18/files/patch-build_config_rust.gni11
-rw-r--r--devel/electron18/files/patch-build_config_v8__target__cpu.gni13
-rw-r--r--devel/electron18/files/patch-build_detect__host__arch.py11
-rw-r--r--devel/electron18/files/patch-build_gn__run__binary.py11
-rw-r--r--devel/electron18/files/patch-build_linux_chrome.map13
-rw-r--r--devel/electron18/files/patch-build_linux_strip__binary.py10
-rw-r--r--devel/electron18/files/patch-build_linux_unbundle_libusb.gn27
-rw-r--r--devel/electron18/files/patch-build_linux_unbundle_replace__gn__files.py10
-rw-r--r--devel/electron18/files/patch-build_toolchain_freebsd_BUILD.gn69
-rw-r--r--devel/electron18/files/patch-build_toolchain_gcc__solink__wrapper.py11
-rw-r--r--devel/electron18/files/patch-build_toolchain_gcc__toolchain.gni35
-rw-r--r--devel/electron18/files/patch-build_toolchain_openbsd_BUILD.gn69
-rw-r--r--devel/electron18/files/patch-cc_BUILD.gn19
-rw-r--r--devel/electron18/files/patch-chrome_app_chrome__command__ids.h11
-rw-r--r--devel/electron18/files/patch-chrome_app_chrome__main.cc20
-rw-r--r--devel/electron18/files/patch-chrome_app_chrome__main__delegate.cc107
-rw-r--r--devel/electron18/files/patch-chrome_app_chromium__strings.grd29
-rw-r--r--devel/electron18/files/patch-chrome_app_generated__resources.grd56
-rw-r--r--devel/electron18/files/patch-chrome_app_google__chrome__strings.grd29
-rw-r--r--devel/electron18/files/patch-chrome_app_profiles__strings.grdp11
-rw-r--r--devel/electron18/files/patch-chrome_app_settings__strings.grdp20
-rw-r--r--devel/electron18/files/patch-chrome_app_theme_chrome__unscaled__resources.grd32
-rw-r--r--devel/electron18/files/patch-chrome_app_theme_theme__resources.grd11
-rw-r--r--devel/electron18/files/patch-chrome_browser_about__flags.cc128
-rw-r--r--devel/electron18/files/patch-chrome_browser_after__startup__task__utils.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc71
-rw-r--r--devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_background_background__mode__manager.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_background_background__mode__optimizer.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_browser__features.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_browser__process__impl.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_browser__process__impl.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__browser__interface__binders.cc71
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__browser__main.cc52
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__browser__main__linux.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__browser__main__posix.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.cc159
-rw-r--r--devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_defaults.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_dev__ui__browser__resources.grd11
-rw-r--r--devel/electron18/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_diagnostics_diagnostics__writer.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc47
-rw-r--r--devel/electron18/files/patch-chrome_browser_download_download__commands.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_download_download__commands.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_download_download__item__model.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_download_download__prefs.cc99
-rw-r--r--devel/electron18/files/patch-chrome_browser_download_download__prefs.h20
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_remote__commands_cbcm__remote__commands__factory.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_signals_device__info__fetcher.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_enterprise_signals_device__info__fetcher__linux.cc78
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_BUILD.gn13
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_chrome__desktop__report__request__helper.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_enterprise__reporting__private_enterprise__reporting__private__api.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_image__writer__private_removable__storage__provider.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_messaging_native__process__launcher__posix.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_settings__private_prefs__util.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_api_webrtc__logging__private_webrtc__logging__private__api.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_browser__context__keyed__service__factories.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_extensions_external__provider__impl.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_file__system__access_chrome__file__system__access__permission__context.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_first__run_first__run__dialog.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_first__run_first__run__internal.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_flag__descriptions.cc56
-rw-r--r--devel/electron18/files/patch-chrome_browser_flag__descriptions.h47
-rw-r--r--devel/electron18/files/patch-chrome_browser_headless_headless__mode__util.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_intranet__redirect__detector.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_media__galleries_fileapi_mtp__device__map__service.cc15
-rw-r--r--devel/electron18/files/patch-chrome_browser_media__galleries_media__file__system__registry.cc16
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_audio__service__util.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_router_discovery_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_router_discovery_discovery__network__list__posix.cc48
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_router_discovery_discovery__network__list__wifi__linux.cc30
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_webrtc_webrtc__event__log__uploader.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_webrtc_webrtc__log__uploader.cc13
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.cc33
-rw-r--r--devel/electron18/files/patch-chrome_browser_media_webrtc_webrtc__logging__controller.h20
-rw-r--r--devel/electron18/files/patch-chrome_browser_memory__details.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_memory__details__linux.cc37
-rw-r--r--devel/electron18/files/patch-chrome_browser_metrics_chrome__browser__main__extra__parts__metrics.cc23
-rw-r--r--devel/electron18/files/patch-chrome_browser_metrics_chrome__metrics__service__client.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_metrics_perf_cpu__identity.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_net_system__network__context__manager.cc38
-rw-r--r--devel/electron18/files/patch-chrome_browser_new__tab__page_modules_drive_drive__service.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_notifications_notification__display__service__impl.cc38
-rw-r--r--devel/electron18/files/patch-chrome_browser_notifications_notification__platform__bridge__delegator.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_password__manager_password__reuse__manager__factory.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_performance__manager_policies_high__pmf__discard__policy.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_performance__monitor_process__metrics__recorder__util.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_performance__monitor_process__monitor.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_performance__monitor_process__monitor.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_platform__util__linux.cc12
-rw-r--r--devel/electron18/files/patch-chrome_browser_plugins_plugins__resource__service.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_policy_browser__signin__policy__handler.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_policy_chrome__browser__cloud__management__controller__desktop.cc38
-rw-r--r--devel/electron18/files/patch-chrome_browser_policy_configuration__policy__handler__list__factory.cc47
-rw-r--r--devel/electron18/files/patch-chrome_browser_policy_device__management__service__configuration.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_prefs_browser__prefs.cc46
-rw-r--r--devel/electron18/files/patch-chrome_browser_prefs_pref__service__incognito__allowlist.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_printing_print__job__worker.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_process__singleton__posix.cc36
-rw-r--r--devel/electron18/files/patch-chrome_browser_profiles_chrome__browser__main__extra__parts__profiles.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_profiles_profile__impl.cc31
-rw-r--r--devel/electron18/files/patch-chrome_browser_profiles_profiles__state.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_renderer__preferences__util.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_plugin__metadata_plugins__linux.json31
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_settings_appearance__page_appearance__browser__proxy.ts20
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.html29
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_settings_appearance__page_appearance__page.ts51
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_settings_autofill__page_passwords__shared__css.html11
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_settings_route.ts11
-rw-r--r--devel/electron18/files/patch-chrome_browser_resources_signin_signin__shared__css.html11
-rw-r--r--devel/electron18/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_safe__browsing_download__protection_file__analyzer.h29
-rw-r--r--devel/electron18/files/patch-chrome_browser_safe__browsing_incident__reporting_incident__reporting__service.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_send__tab__to__self_receiving__ui__handler__registry.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_send__tab__to__self_send__tab__to__self__client__service.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_sharing_sharing__device__registration.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_sharing_sharing__handler__registry__impl.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_shutdown__signal__handlers__posix.cc21
-rw-r--r--devel/electron18/files/patch-chrome_browser_signin_signin__util.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_sync_chrome__sync__client.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_sync_device__info__sync__client__impl.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_task__manager_sampling_task__group.cc38
-rw-r--r--devel/electron18/files/patch-chrome_browser_task__manager_sampling_task__group.h38
-rw-r--r--devel/electron18/files/patch-chrome_browser_task__manager_sampling_task__group__sampler.cc47
-rw-r--r--devel/electron18/files/patch-chrome_browser_task__manager_sampling_task__group__sampler.h38
-rw-r--r--devel/electron18/files/patch-chrome_browser_task__manager_sampling_task__manager__impl.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_task__manager_task__manager__observer.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_themes_theme__helper.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_themes_theme__service__factory.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_browser__command__controller.cc38
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_browser__dialogs.h29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_browser__view__prefs.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_chrome__pages.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_chrome__pages.h20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_color_native__chrome__color__mixer.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_exclusive__access_exclusive__access__bubble.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_sad__tab.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_signin__view__controller.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_signin__view__controller__delegate.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_startup_bad__flags__prompt.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_startup_startup__browser__creator.cc53
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_tab__helpers.cc36
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_task__manager_task__manager__columns.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_task__manager_task__manager__table__model.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_accelerator__table.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_apps_chrome__native__app__window__views__aura.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_chrome__browser__main__extra__parts__views.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_chrome__views__delegate.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_download_download__item__view.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_eye__dropper_eye__dropper__view.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_eye__dropper_eye__dropper__view__aura.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_first__run__dialog.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_browser__desktop__window__tree__host__linux.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_browser__desktop__window__tree__host__linux.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_browser__frame.cc52
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_browser__non__client__frame__view__factory__views.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_browser__view.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_opaque__browser__frame__view.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_system__menu__model__builder.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_frame_system__menu__model__delegate.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_hung__renderer__view.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_profiles_profile__menu__view__base.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_profiles_signin__view__controller__delegate__views.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_tabs_new__tab__button.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_tabs_tab.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_tabs_tab__drag__controller.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_views_tabs_tab__hover__card__controller.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_about__ui.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_chrome__web__ui__controller__factory.cc98
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_connectors__internals_zero__trust__utils.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_ntp_app__launcher__handler.cc29
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_settings_appearance__handler.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_settings_appearance__handler.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_settings_settings__localized__strings__provider.cc47
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_webui_settings_settings__ui.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_ui_window__sizer_window__sizer.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_extension__status__utils.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_extensions_extension__status__utils.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_os__integration_web__app__file__handler__registration.h11
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.cc38
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut.h29
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_os__integration_web__app__shortcut__manager.cc20
-rw-r--r--devel/electron18/files/patch-chrome_browser_web__applications_web__app__provider.cc11
-rw-r--r--devel/electron18/files/patch-chrome_browser_webauthn_chrome__authenticator__request__delegate.cc11
-rw-r--r--devel/electron18/files/patch-chrome_common_channel__info.h11
-rw-r--r--devel/electron18/files/patch-chrome_common_channel__info__posix.cc11
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__features.cc92
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__features.h65
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__paths.cc80
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__paths.h29
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__paths__internal.h11
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__switches.cc19
-rw-r--r--devel/electron18/files/patch-chrome_common_chrome__switches.h17
-rw-r--r--devel/electron18/files/patch-chrome_common_extensions_command.cc11
-rw-r--r--devel/electron18/files/patch-chrome_common_media_cdm__host__file__path.cc11
-rw-r--r--devel/electron18/files/patch-chrome_common_pref__names.cc56
-rw-r--r--devel/electron18/files/patch-chrome_common_pref__names.h56
-rw-r--r--devel/electron18/files/patch-chrome_common_webui__url__constants.cc94
-rw-r--r--devel/electron18/files/patch-chrome_common_webui__url__constants.h57
-rw-r--r--devel/electron18/files/patch-chrome_renderer_chrome__render__frame__observer.cc11
-rw-r--r--devel/electron18/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.cc29
-rw-r--r--devel/electron18/files/patch-chrome_renderer_pepper_pepper__flash__font__file__host.h20
-rw-r--r--devel/electron18/files/patch-chrome_services_file__util_public_mojom_safe__document__analyzer__mojom__traits.h11
-rw-r--r--devel/electron18/files/patch-chrome_services_printing_print__backend__service__impl.cc11
-rw-r--r--devel/electron18/files/patch-chrome_services_speech_audio__source__fetcher__impl.cc11
-rw-r--r--devel/electron18/files/patch-chrome_test_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-chrome_test_chromedriver_chrome__launcher.cc10
-rw-r--r--devel/electron18/files/patch-chrome_test_chromedriver_chrome_chrome__finder.cc20
-rw-r--r--devel/electron18/files/patch-chrome_test_chromedriver_key__converter__unittest.cc20
-rw-r--r--devel/electron18/files/patch-chrome_test_chromedriver_keycode__text__conversion__unittest.cc20
-rw-r--r--devel/electron18/files/patch-chrome_updater_app_app__install.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_app_app__uninstall.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_configurator.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_device__management_cloud__policy__util.cc47
-rw-r--r--devel/electron18/files/patch-chrome_updater_device__management_dm__client.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_device__management_dm__storage.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_installer.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_lib__util.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_updater.cc11
-rw-r--r--devel/electron18/files/patch-chrome_updater_util.cc11
-rw-r--r--devel/electron18/files/patch-chrome_utility_services.cc29
-rw-r--r--devel/electron18/files/patch-chromecast_browser_cast__browser__main__parts.cc65
-rw-r--r--devel/electron18/files/patch-chromecast_browser_cast__content__browser__client.cc29
-rw-r--r--devel/electron18/files/patch-chromecast_browser_cast__content__browser__client__receiver__bindings.cc20
-rw-r--r--devel/electron18/files/patch-chromecast_media_base_default__monotonic__clock.cc20
-rw-r--r--devel/electron18/files/patch-chromecast_renderer_cast__content__renderer__client.cc11
-rw-r--r--devel/electron18/files/patch-components_autofill__payments__strings.grdp11
-rw-r--r--devel/electron18/files/patch-components_autofill_core_browser_autofill__external__delegate.cc11
-rw-r--r--devel/electron18/files/patch-components_autofill_core_browser_personal__data__manager.cc12
-rw-r--r--devel/electron18/files/patch-components_autofill_core_common_autofill__payments__features.cc11
-rw-r--r--devel/electron18/files/patch-components_autofill_core_common_autofill__util.cc11
-rw-r--r--devel/electron18/files/patch-components_cast__channel_cast__message__util.cc11
-rw-r--r--devel/electron18/files/patch-components_content__settings_core_browser_website__settings__registry.cc11
-rw-r--r--devel/electron18/files/patch-components_cookie__config_cookie__store__util.cc11
-rw-r--r--devel/electron18/files/patch-components_crash_content_browser_BUILD.gn29
-rw-r--r--devel/electron18/files/patch-components_crash_core_app_BUILD.gn52
-rw-r--r--devel/electron18/files/patch-components_crash_core_app_chrome__crashpad__handler.cc12
-rw-r--r--devel/electron18/files/patch-components_crash_core_browser_crash__upload__list__crashpad.cc16
-rw-r--r--devel/electron18/files/patch-components_crash_core_common_BUILD.gn20
-rw-r--r--devel/electron18/files/patch-components_discardable__memory_service_discardable__shared__memory__manager.cc11
-rw-r--r--devel/electron18/files/patch-components_embedder__support_user__agent__utils__unittest.cc20
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_event__constants.cc11
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_event__constants.h11
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_feature__configurations.cc21
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_feature__constants.cc20
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_feature__constants.h20
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_feature__list.cc21
-rw-r--r--devel/electron18/files/patch-components_feature__engagement_public_feature__list.h40
-rw-r--r--devel/electron18/files/patch-components_feed_core_proto_v2_wire_version.proto13
-rw-r--r--devel/electron18/files/patch-components_feed_core_v2_feed__network__impl__unittest.cc13
-rw-r--r--devel/electron18/files/patch-components_feed_core_v2_proto__util.cc24
-rw-r--r--devel/electron18/files/patch-components_feed_core_v2_proto__util__unittest.cc13
-rw-r--r--devel/electron18/files/patch-components_feed_core_v2_test_proto__printer.cc13
-rw-r--r--devel/electron18/files/patch-components_flags__ui_flags__state.cc11
-rw-r--r--devel/electron18/files/patch-components_gwp__asan_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-components_gwp__asan_crash__handler_crash__analyzer.cc20
-rw-r--r--devel/electron18/files/patch-components_invalidation_impl_invalidation__switches.cc11
-rw-r--r--devel/electron18/files/patch-components_metrics_drive__metrics__provider__linux.cc16
-rw-r--r--devel/electron18/files/patch-components_neterror_resources_neterror.js11
-rw-r--r--devel/electron18/files/patch-components_network__session__configurator_browser_network__session__configurator.cc11
-rw-r--r--devel/electron18/files/patch-components_network__session__configurator_browser_network__session__configurator__unittest.cc11
-rw-r--r--devel/electron18/files/patch-components_new__or__sad__tab__strings.grdp47
-rw-r--r--devel/electron18/files/patch-components_os__crypt_keyring__util__linux.cc17
-rw-r--r--devel/electron18/files/patch-components_os__crypt_libsecret__util__linux.cc18
-rw-r--r--devel/electron18/files/patch-components_os__crypt_os__crypt.h29
-rw-r--r--devel/electron18/files/patch-components_paint__preview_browser_paint__preview__client.cc13
-rw-r--r--devel/electron18/files/patch-components_paint__preview_browser_paint__preview__client__unittest.cc13
-rw-r--r--devel/electron18/files/patch-components_paint__preview_common_proto_paint__preview.proto13
-rw-r--r--devel/electron18/files/patch-components_paint__preview_player_player__compositor__delegate.cc13
-rw-r--r--devel/electron18/files/patch-components_password__manager_core_browser_login__database.cc29
-rw-r--r--devel/electron18/files/patch-components_password__manager_core_browser_login__database__unittest.cc29
-rw-r--r--devel/electron18/files/patch-components_password__manager_core_browser_sync_password__sync__bridge.cc20
-rw-r--r--devel/electron18/files/patch-components_password__manager_core_common_password__manager__features.cc29
-rw-r--r--devel/electron18/files/patch-components_password__manager_core_common_password__manager__features.h25
-rw-r--r--devel/electron18/files/patch-components_performance__manager_features.cc11
-rw-r--r--devel/electron18/files/patch-components_permissions_prediction__service_prediction__common.cc20
-rw-r--r--devel/electron18/files/patch-components_policy_core_browser_policy__pref__mapping__test.cc11
-rw-r--r--devel/electron18/files/patch-components_policy_core_common_cloud_cloud__policy__client.cc11
-rw-r--r--devel/electron18/files/patch-components_policy_core_common_cloud_cloud__policy__util.cc54
-rw-r--r--devel/electron18/files/patch-components_policy_resources_policy__templates.json191
-rw-r--r--devel/electron18/files/patch-components_policy_tools_generate__policy__source.py14
-rw-r--r--devel/electron18/files/patch-components_safe__browsing_content_common_file__type__policies__unittest.cc11
-rw-r--r--devel/electron18/files/patch-components_safe__browsing_content_resources_gen__file__type__proto.py19
-rw-r--r--devel/electron18/files/patch-components_safe__browsing_core_browser_db_v4__protocol__manager__util.cc11
-rw-r--r--devel/electron18/files/patch-components_safe__browsing_core_browser_realtime_url__lookup__service__base.cc11
-rw-r--r--devel/electron18/files/patch-components_security__interstitials_content_utils.cc11
-rw-r--r--devel/electron18/files/patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.cc29
-rw-r--r--devel/electron18/files/patch-components_services_paint__preview__compositor_paint__preview__compositor__collection__impl.h20
-rw-r--r--devel/electron18/files/patch-components_startup__metric__utils_browser_startup__metric__utils.cc20
-rw-r--r--devel/electron18/files/patch-components_storage__monitor_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-components_storage__monitor_removable__device__constants.cc11
-rw-r--r--devel/electron18/files/patch-components_storage__monitor_removable__device__constants.h11
-rw-r--r--devel/electron18/files/patch-components_sync__device__info_local__device__info__util.cc11
-rw-r--r--devel/electron18/files/patch-components_sync__device__info_local__device__info__util__linux.cc14
-rw-r--r--devel/electron18/files/patch-components_translate_core_browser_translate__prefs.cc11
-rw-r--r--devel/electron18/files/patch-components_translate_core_common_translate__util.cc11
-rw-r--r--devel/electron18/files/patch-components_update__client_update__query__params.cc11
-rw-r--r--devel/electron18/files/patch-components_url__formatter_spoof__checks_idn__spoof__checker.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_common_features.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_common_gpu_dawn__context__provider.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_host_host__display__client.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_host_host__display__client.h11
-rw-r--r--devel/electron18/files/patch-components_viz_host_renderer__settings__creation.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_service_display__embedder_skia__output__surface__impl.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_service_display__embedder_software__output__surface.cc20
-rw-r--r--devel/electron18/files/patch-components_viz_service_display__embedder_software__output__surface.h20
-rw-r--r--devel/electron18/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.cc20
-rw-r--r--devel/electron18/files/patch-components_viz_service_frame__sinks_root__compositor__frame__sink__impl.h11
-rw-r--r--devel/electron18/files/patch-components_viz_test_fake__display__client.cc11
-rw-r--r--devel/electron18/files/patch-components_viz_test_fake__display__client.h11
-rw-r--r--devel/electron18/files/patch-components_viz_test_mock__display__client.h11
-rw-r--r--devel/electron18/files/patch-content_app_content__main.cc11
-rw-r--r--devel/electron18/files/patch-content_app_content__main__runner__impl.cc120
-rw-r--r--devel/electron18/files/patch-content_browser_BUILD.gn16
-rw-r--r--devel/electron18/files/patch-content_browser_browser__child__process__host__impl.cc10
-rw-r--r--devel/electron18/files/patch-content_browser_browser__main__loop.cc46
-rw-r--r--devel/electron18/files/patch-content_browser_child__process__launcher__helper__linux.cc92
-rw-r--r--devel/electron18/files/patch-content_browser_compositor_viz__process__transport__factory.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_compute__pressure_cpu__probe.cc10
-rw-r--r--devel/electron18/files/patch-content_browser_devtools_protocol_system__info__handler.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_download_download__manager__impl.cc29
-rw-r--r--devel/electron18/files/patch-content_browser_font__access_font__enumeration__data__source.cc29
-rw-r--r--devel/electron18/files/patch-content_browser_gpu_compositor__util.cc20
-rw-r--r--devel/electron18/files/patch-content_browser_gpu_gpu__process__host.cc28
-rw-r--r--devel/electron18/files/patch-content_browser_media_media__keys__listener__manager__impl.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_ppapi__plugin__process__host__receiver__bindings.cc20
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_delegated__frame__host.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_input_input__device__change__observer.cc29
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_pepper_pepper__file__io__host.cc20
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__message__filter.cc29
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__message__filter.h19
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__process__host__impl.cc37
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__process__host__impl.h11
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__view__host__impl.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc47
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__widget__host__view__aura.h11
-rw-r--r--devel/electron18/files/patch-content_browser_renderer__host_render__widget__host__view__event__handler.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_sandbox__host__linux.cc18
-rw-r--r--devel/electron18/files/patch-content_browser_scheduler_responsiveness_jank__monitor__impl.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_scheduler_responsiveness_native__event__observer.cc20
-rw-r--r--devel/electron18/files/patch-content_browser_scheduler_responsiveness_native__event__observer.h47
-rw-r--r--devel/electron18/files/patch-content_browser_utility__process__host__receiver__bindings.cc20
-rw-r--r--devel/electron18/files/patch-content_browser_utility__sandbox__delegate.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_v8__snapshot__files.cc11
-rw-r--r--devel/electron18/files/patch-content_browser_web__contents_web__contents__view__aura.cc29
-rw-r--r--devel/electron18/files/patch-content_browser_webui_web__ui__main__frame__observer.cc38
-rw-r--r--devel/electron18/files/patch-content_browser_webui_web__ui__main__frame__observer.h20
-rw-r--r--devel/electron18/files/patch-content_browser_zygote__host_zygote__host__impl__linux.cc70
-rw-r--r--devel/electron18/files/patch-content_browser_zygote__host_zygote__host__impl__linux.h25
-rw-r--r--devel/electron18/files/patch-content_child_child__process.cc11
-rw-r--r--devel/electron18/files/patch-content_common_BUILD.gn12
-rw-r--r--devel/electron18/files/patch-content_common_font__list__unittest.cc11
-rw-r--r--devel/electron18/files/patch-content_common_mojo__core__library__support.cc11
-rw-r--r--devel/electron18/files/patch-content_common_user__agent.cc19
-rw-r--r--devel/electron18/files/patch-content_gpu_gpu__main.cc73
-rw-r--r--devel/electron18/files/patch-content_gpu_gpu__sandbox__hook__linux.cc70
-rw-r--r--devel/electron18/files/patch-content_ppapi__plugin_ppapi__blink__platform__impl.cc29
-rw-r--r--devel/electron18/files/patch-content_ppapi__plugin_ppapi__blink__platform__impl.h25
-rw-r--r--devel/electron18/files/patch-content_ppapi__plugin_ppapi__plugin__main.cc23
-rw-r--r--devel/electron18/files/patch-content_public_browser_zygote__host_zygote__host__linux.h16
-rw-r--r--devel/electron18/files/patch-content_public_common_common__param__traits__macros.h11
-rw-r--r--devel/electron18/files/patch-content_public_common_content__features.cc50
-rw-r--r--devel/electron18/files/patch-content_public_common_content__features.h11
-rw-r--r--devel/electron18/files/patch-content_public_common_content__switches.cc20
-rw-r--r--devel/electron18/files/patch-content_public_common_content__switches.h19
-rw-r--r--devel/electron18/files/patch-content_public_common_use__zoom__for__dsf__policy.cc11
-rw-r--r--devel/electron18/files/patch-content_public_common_zygote_features.gni8
-rw-r--r--devel/electron18/files/patch-content_public_test_mock__render__thread.cc11
-rw-r--r--devel/electron18/files/patch-content_renderer_render__process__impl.cc29
-rw-r--r--devel/electron18/files/patch-content_renderer_render__thread__impl.cc47
-rw-r--r--devel/electron18/files/patch-content_renderer_renderer__blink__platform__impl.cc48
-rw-r--r--devel/electron18/files/patch-content_renderer_renderer__blink__platform__impl.h29
-rw-r--r--devel/electron18/files/patch-content_renderer_renderer__main__platform__delegate__linux.cc18
-rw-r--r--devel/electron18/files/patch-content_shell_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-content_shell_app_shell__main__delegate.cc11
-rw-r--r--devel/electron18/files/patch-content_shell_browser_shell__browser__main__parts.cc20
-rw-r--r--devel/electron18/files/patch-content_shell_browser_shell__paths.cc20
-rw-r--r--devel/electron18/files/patch-content_shell_utility_shell__content__utility__client.cc20
-rw-r--r--devel/electron18/files/patch-content_test_BUILD.gn20
-rw-r--r--devel/electron18/files/patch-content_utility_services.cc20
-rw-r--r--devel/electron18/files/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.cc37
-rw-r--r--devel/electron18/files/patch-content_utility_speech_speech__recognition__sandbox__hook__linux.h14
-rw-r--r--devel/electron18/files/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.cc29
-rw-r--r--devel/electron18/files/patch-content_utility_utility__blink__platform__with__sandbox__support__impl.h24
-rw-r--r--devel/electron18/files/patch-content_utility_utility__main.cc55
-rw-r--r--devel/electron18/files/patch-content_zygote_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-content_zygote_zygote__linux.cc15
-rw-r--r--devel/electron18/files/patch-content_zygote_zygote__main__linux.cc64
-rw-r--r--devel/electron18/files/patch-device_bluetooth_cast__bluetooth.gni9
-rw-r--r--devel/electron18/files/patch-device_gamepad_gamepad__provider.cc11
-rw-r--r--devel/electron18/files/patch-device_gamepad_hid__writer__linux.cc11
-rw-r--r--devel/electron18/files/patch-electron_BUILD.gn71
-rw-r--r--devel/electron18/files/patch-electron_default__app_default__app.ts11
-rw-r--r--devel/electron18/files/patch-electron_filenames.gni13
-rw-r--r--devel/electron18/files/patch-electron_lib_browser_api_app.ts11
-rw-r--r--devel/electron18/files/patch-electron_lib_browser_api_dialog.ts11
-rw-r--r--devel/electron18/files/patch-electron_lib_browser_api_menu-item-roles.ts11
-rw-r--r--devel/electron18/files/patch-electron_lib_browser_api_power-monitor.ts11
-rw-r--r--devel/electron18/files/patch-electron_lib_browser_init.ts11
-rw-r--r--devel/electron18/files/patch-electron_lib_browser_rpc-server.ts11
-rw-r--r--devel/electron18/files/patch-electron_lib_common_api_clipboard.ts11
-rw-r--r--devel/electron18/files/patch-electron_script_lib_config.py12
-rw-r--r--devel/electron18/files/patch-electron_script_lib_utils.js11
-rw-r--r--devel/electron18/files/patch-electron_script_spec-runner.js11
-rw-r--r--devel/electron18/files/patch-electron_shell_app_electron__main__delegate.cc58
-rw-r--r--devel/electron18/files/patch-electron_shell_app_node__main.cc56
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__app.cc47
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__base__window.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__crash__reporter.cc72
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__power__monitor.cc23
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__power__monitor.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__safe__storage.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__web__contents.cc61
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_electron__api__web__contents.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_api_process__metric.h20
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_browser.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_browser.h33
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_browser__linux.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_electron__browser__client.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_electron__browser__main__parts.cc93
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_electron__browser__main__parts.h20
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_electron__browser__main__parts__posix.cc19
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_native__window.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_native__window__views.cc128
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_native__window__views.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_net_system__network__context__manager.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_osr_osr__host__display__client.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_osr_osr__host__display__client.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_relauncher__linux.cc32
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_inspectable__web__contents__view__delegate.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_views_electron__views__delegate.cc38
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_views_electron__views__delegate.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_views_inspectable__web__contents__view__views.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_views_menu__bar.cc38
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_views_menu__bar.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_browser_ui_views_submenu__button.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_api_electron__api__clipboard.cc20
-rw-r--r--devel/electron18/files/patch-electron_shell_common_api_electron__api__native__image.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_api_electron__api__native__image.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_api_electron__bindings.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_electron__command__line.cc11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_electron__command__line.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_electron__paths.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_common_node__bindings.cc29
-rw-r--r--devel/electron18/files/patch-electron_shell_common_node__bindings__linux.cc69
-rw-r--r--devel/electron18/files/patch-electron_shell_common_platform__util.h11
-rw-r--r--devel/electron18/files/patch-electron_shell_renderer_api_electron__api__crash__reporter__renderer.cc36
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-app-spec.ts119
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-browser-window-spec.ts146
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-crash-reporter-spec.ts56
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-desktop-capturer-spec.ts47
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-net-log-spec.ts29
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-notification-dbus-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-power-monitor-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-safe-storage-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-screen-spec.ts38
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-shell-spec.ts23
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-subframe-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-tray-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-web-contents-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_api-web-frame-main-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_chromium-spec.ts44
-rw-r--r--devel/electron18/files/patch-electron_spec-main_fixtures_apps_crash_node-crash.js8
-rw-r--r--devel/electron18/files/patch-electron_spec-main_fixtures_crash-cases_safe-storage_index.js11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_fixtures_native-addon_uv-dlopen_index.js11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_version-bump-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_visibility-state-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec-main_webview-spec.ts11
-rw-r--r--devel/electron18/files/patch-electron_spec_api-clipboard-spec.js29
-rw-r--r--devel/electron18/files/patch-electron_spec_api-native-image-spec.js11
-rw-r--r--devel/electron18/files/patch-electron_spec_api-process-spec.js11
-rw-r--r--devel/electron18/files/patch-electron_spec_chromium-spec.js11
-rw-r--r--devel/electron18/files/patch-electron_spec_node-spec.js11
-rw-r--r--devel/electron18/files/patch-extensions_browser_api_messaging_message__service.cc20
-rw-r--r--devel/electron18/files/patch-extensions_browser_api_networking__private_networking__private__delegate__factory.cc20
-rw-r--r--devel/electron18/files/patch-extensions_browser_browser__context__keyed__service__factories.cc11
-rw-r--r--devel/electron18/files/patch-extensions_browser_extension__prefs.cc11
-rw-r--r--devel/electron18/files/patch-extensions_browser_pref__names.cc11
-rw-r--r--devel/electron18/files/patch-extensions_browser_pref__names.h11
-rw-r--r--devel/electron18/files/patch-extensions_common_api___permission__features.json29
-rw-r--r--devel/electron18/files/patch-extensions_common_features_feature.cc11
-rw-r--r--devel/electron18/files/patch-extensions_renderer_bindings_api__binding__util.cc11
-rw-r--r--devel/electron18/files/patch-extensions_shell_app_shell__main__delegate.cc20
-rw-r--r--devel/electron18/files/patch-extensions_shell_browser_api_runtime_shell__runtime__api__delegate.cc11
-rw-r--r--devel/electron18/files/patch-extensions_shell_browser_shell__browser__main__parts.cc11
-rw-r--r--devel/electron18/files/patch-extensions_shell_browser_shell__extensions__api__client.cc11
-rw-r--r--devel/electron18/files/patch-extensions_shell_browser_shell__extensions__api__client.h20
-rw-r--r--devel/electron18/files/patch-google__apis_gcm_engine_heartbeat__manager.cc29
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_common_gpu__memory__buffer__support.cc20
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_service_external__semaphore.cc11
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_service_external__vk__image__backing.cc29
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_service_shared__image__backing__factory__angle__vulkan.cc11
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_service_shared__image__factory.cc35
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_service_webgpu__decoder__impl.cc11
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_tests_gl__gpu__memory__buffer__unittest.cc29
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_tests_gl__oes__egl__image__unittest.cc20
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_tests_gl__test__utils.cc20
-rw-r--r--devel/electron18/files/patch-gpu_command__buffer_tests_gl__test__utils.h11
-rw-r--r--devel/electron18/files/patch-gpu_config_gpu__control__list.cc20
-rw-r--r--devel/electron18/files/patch-gpu_config_gpu__test__config.cc11
-rw-r--r--devel/electron18/files/patch-gpu_ipc_common_gpu__memory__buffer__support.cc20
-rw-r--r--devel/electron18/files/patch-gpu_ipc_common_gpu__memory__buffer__support.h11
-rw-r--r--devel/electron18/files/patch-gpu_ipc_service_gpu__init.cc65
-rw-r--r--devel/electron18/files/patch-gpu_ipc_service_gpu__memory__buffer__factory.cc20
-rw-r--r--devel/electron18/files/patch-gpu_ipc_service_x__util.h16
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_generate__bindings.py29
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_vulkan__device__queue.cc20
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_vulkan__device__queue.h11
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_vulkan__function__pointers.cc29
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_vulkan__function__pointers.h63
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_vulkan__image.cc11
-rw-r--r--devel/electron18/files/patch-gpu_vulkan_vulkan__image.h20
-rw-r--r--devel/electron18/files/patch-headless_lib_browser_headless__browser__main__parts.h11
-rw-r--r--devel/electron18/files/patch-headless_lib_browser_headless__browser__main__parts__linux.cc11
-rw-r--r--devel/electron18/files/patch-headless_lib_browser_headless__content__browser__client.h11
-rw-r--r--devel/electron18/files/patch-headless_lib_browser_headless__request__context__manager.cc11
-rw-r--r--devel/electron18/files/patch-headless_lib_browser_headless__web__contents__impl.cc11
-rw-r--r--devel/electron18/files/patch-headless_lib_headless__content__main__delegate.cc11
-rw-r--r--devel/electron18/files/patch-headless_public_headless__browser.cc11
-rw-r--r--devel/electron18/files/patch-ipc_ipc__channel.h11
-rw-r--r--devel/electron18/files/patch-ipc_ipc__channel__common.cc11
-rw-r--r--devel/electron18/files/patch-ipc_ipc__channel__mojo.cc11
-rw-r--r--devel/electron18/files/patch-ipc_ipc__message__utils.cc11
-rw-r--r--devel/electron18/files/patch-ipc_ipc__message__utils.h11
-rw-r--r--devel/electron18/files/patch-media_BUILD.gn12
-rw-r--r--devel/electron18/files/patch-media_audio_BUILD.gn24
-rw-r--r--devel/electron18/files/patch-media_audio_alsa_audio__manager__alsa.cc54
-rw-r--r--devel/electron18/files/patch-media_audio_audio__features.cc11
-rw-r--r--devel/electron18/files/patch-media_audio_audio__input__device.cc11
-rw-r--r--devel/electron18/files/patch-media_audio_audio__output__proxy__unittest.cc14
-rw-r--r--devel/electron18/files/patch-media_audio_sndio_audio__manager__sndio.cc184
-rw-r--r--devel/electron18/files/patch-media_audio_sndio_audio__manager__sndio.h69
-rw-r--r--devel/electron18/files/patch-media_audio_sndio_sndio__input.cc204
-rw-r--r--devel/electron18/files/patch-media_audio_sndio_sndio__input.h94
-rw-r--r--devel/electron18/files/patch-media_audio_sndio_sndio__output.cc190
-rw-r--r--devel/electron18/files/patch-media_audio_sndio_sndio__output.h91
-rw-r--r--devel/electron18/files/patch-media_base_audio__latency.cc11
-rw-r--r--devel/electron18/files/patch-media_base_media__switches.cc47
-rw-r--r--devel/electron18/files/patch-media_base_media__switches.h11
-rw-r--r--devel/electron18/files/patch-media_base_scopedfd__helper.h11
-rw-r--r--devel/electron18/files/patch-media_base_user__input__monitor__unittest.cc29
-rw-r--r--devel/electron18/files/patch-media_base_vector__math.cc11
-rw-r--r--devel/electron18/files/patch-media_base_video__frame.cc74
-rw-r--r--devel/electron18/files/patch-media_base_video__frame.h47
-rw-r--r--devel/electron18/files/patch-media_capture_video_create__video__capture__device__factory.cc20
-rw-r--r--devel/electron18/files/patch-media_capture_video_fake__video__capture__device__factory.cc11
-rw-r--r--devel/electron18/files/patch-media_capture_video_file__video__capture__device__factory.cc11
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_fake__v4l2__impl.cc11
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_fake__v4l2__impl.h25
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc44
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_v4l2__capture__delegate.h15
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_v4l2__capture__device.h11
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_v4l2__capture__device__impl.cc11
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_v4l2__capture__device__impl.h11
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_video__capture__device__factory__linux.cc45
-rw-r--r--devel/electron18/files/patch-media_capture_video_linux_video__capture__device__factory__linux.h11
-rw-r--r--devel/electron18/files/patch-media_capture_video_video__capture__buffer__pool__impl.cc11
-rw-r--r--devel/electron18/files/patch-media_capture_video_video__capture__device__client.cc11
-rw-r--r--devel/electron18/files/patch-media_cdm_cdm__paths__unittest.cc11
-rw-r--r--devel/electron18/files/patch-media_gpu_buffer__validation.cc29
-rw-r--r--devel/electron18/files/patch-media_gpu_chromeos_video__decoder__pipeline.cc20
-rw-r--r--devel/electron18/files/patch-media_gpu_gpu__video__encode__accelerator__factory.cc11
-rw-r--r--devel/electron18/files/patch-media_gpu_vaapi_vaapi__video__decoder.cc11
-rw-r--r--devel/electron18/files/patch-media_gpu_vaapi_vaapi__wrapper.cc11
-rw-r--r--devel/electron18/files/patch-media_media__options.gni27
-rw-r--r--devel/electron18/files/patch-media_mojo_mojom_video__frame__mojom__traits.cc11
-rw-r--r--devel/electron18/files/patch-media_video_fake__gpu__memory__buffer.cc38
-rw-r--r--devel/electron18/files/patch-media_video_gpu__memory__buffer__video__frame__pool.cc11
-rw-r--r--devel/electron18/files/patch-media_video_video__encode__accelerator__adapter.cc20
-rw-r--r--devel/electron18/files/patch-media_video_video__encode__accelerator__adapter__test.cc11
-rw-r--r--devel/electron18/files/patch-media_webrtc_audio__processor.cc11
-rw-r--r--devel/electron18/files/patch-media_webrtc_helpers__unittests.cc20
-rw-r--r--devel/electron18/files/patch-media_webrtc_webrtc__features.cc11
-rw-r--r--devel/electron18/files/patch-mojo_core_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-mojo_core_channel.cc14
-rw-r--r--devel/electron18/files/patch-mojo_core_embedder_features.h11
-rw-r--r--devel/electron18/files/patch-mojo_public_c_system_thunks.cc38
-rw-r--r--devel/electron18/files/patch-mojo_public_js_mojo__bindings__resources.grd11
-rw-r--r--devel/electron18/files/patch-mojo_public_tools_bindings_mojom.gni19
-rw-r--r--devel/electron18/files/patch-net_BUILD.gn100
-rw-r--r--devel/electron18/files/patch-net_base_network__change__notifier.cc21
-rw-r--r--devel/electron18/files/patch-net_base_network__change__notifier__posix.cc11
-rw-r--r--devel/electron18/files/patch-net_base_network__interfaces__posix.h11
-rw-r--r--devel/electron18/files/patch-net_cert_cert__verifier.cc11
-rw-r--r--devel/electron18/files/patch-net_cert_cert__verify__proc.cc11
-rw-r--r--devel/electron18/files/patch-net_cert_cert__verify__proc.h11
-rw-r--r--devel/electron18/files/patch-net_cert_cert__verify__proc__unittest.cc11
-rw-r--r--devel/electron18/files/patch-net_cert_test__root__certs__unittest.cc11
-rw-r--r--devel/electron18/files/patch-net_disk__cache_blockfile_disk__format.h12
-rw-r--r--devel/electron18/files/patch-net_disk__cache_simple_simple__file__tracker.cc20
-rw-r--r--devel/electron18/files/patch-net_dns_BUILD.gn31
-rw-r--r--devel/electron18/files/patch-net_dns_address__sorter__posix.cc10
-rw-r--r--devel/electron18/files/patch-net_dns_dns__config__service__posix.cc27
-rw-r--r--devel/electron18/files/patch-net_dns_dns__reloader.cc18
-rw-r--r--devel/electron18/files/patch-net_dns_dns__reloader.h11
-rw-r--r--devel/electron18/files/patch-net_dns_dns__util.cc11
-rw-r--r--devel/electron18/files/patch-net_dns_host__resolver__manager.cc11
-rw-r--r--devel/electron18/files/patch-net_dns_host__resolver__proc.cc22
-rw-r--r--devel/electron18/files/patch-net_dns_public_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-net_dns_public_resolv__reader.h10
-rw-r--r--devel/electron18/files/patch-net_dns_public_scoped__res__state.h10
-rw-r--r--devel/electron18/files/patch-net_http_http__auth__gssapi__posix.cc14
-rw-r--r--devel/electron18/files/patch-net_http_http__auth__gssapi__posix.h12
-rw-r--r--devel/electron18/files/patch-net_http_http__network__session.cc12
-rw-r--r--devel/electron18/files/patch-net_proxy__resolution_configured__proxy__resolution__service.cc29
-rw-r--r--devel/electron18/files/patch-net_proxy__resolution_proxy__config__service__linux.cc40
-rw-r--r--devel/electron18/files/patch-net_socket_socket__posix.cc11
-rw-r--r--devel/electron18/files/patch-net_socket_socks5__client__socket.cc12
-rw-r--r--devel/electron18/files/patch-net_socket_tcp__socket__posix.cc20
-rw-r--r--devel/electron18/files/patch-net_socket_udp__socket__posix.cc20
-rw-r--r--devel/electron18/files/patch-net_socket_udp__socket__unittest.cc47
-rw-r--r--devel/electron18/files/patch-net_socket_unix__domain__client__socket__posix.cc11
-rw-r--r--devel/electron18/files/patch-net_third__party_quiche_BUILD.gn33
-rw-r--r--devel/electron18/files/patch-net_tools_cert__verify__tool_cert__verify__comparision__tool.cc29
-rw-r--r--devel/electron18/files/patch-net_tools_cert__verify__tool_cert__verify__tool.cc38
-rw-r--r--devel/electron18/files/patch-net_tools_quic_quic__http__proxy__backend.cc11
-rw-r--r--devel/electron18/files/patch-net_traffic__annotation_network__traffic__annotation.h20
-rw-r--r--devel/electron18/files/patch-net_url__request_url__fetcher.cc11
-rw-r--r--devel/electron18/files/patch-net_url__request_url__fetcher.h11
-rw-r--r--devel/electron18/files/patch-net_url__request_url__request__context.cc11
-rw-r--r--devel/electron18/files/patch-net_url__request_url__request__context.h11
-rw-r--r--devel/electron18/files/patch-net_url__request_url__request__context__builder.cc11
-rw-r--r--devel/electron18/files/patch-pdf_out__of__process__instance.cc20
-rw-r--r--devel/electron18/files/patch-pdf_pdfium_pdfium__engine.cc20
-rw-r--r--devel/electron18/files/patch-printing_mojom_printing__context__mojom__traits.cc20
-rw-r--r--devel/electron18/files/patch-printing_mojom_printing__context__mojom__traits.h11
-rw-r--r--devel/electron18/files/patch-printing_print__settings.cc29
-rw-r--r--devel/electron18/files/patch-printing_print__settings.h38
-rw-r--r--devel/electron18/files/patch-printing_print__settings__conversion.cc11
-rw-r--r--devel/electron18/files/patch-printing_printing__features.cc11
-rw-r--r--devel/electron18/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.cc51
-rw-r--r--devel/electron18/files/patch-printing_sandbox_print__backend__sandbox__hook__linux.h16
-rw-r--r--devel/electron18/files/patch-remoting_base_chromoting__event.cc11
-rw-r--r--devel/electron18/files/patch-remoting_base_host__settings.cc20
-rw-r--r--devel/electron18/files/patch-remoting_client_display_sys__opengl.h11
-rw-r--r--devel/electron18/files/patch-remoting_codec_webrtc__video__encoder__vpx.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_base_switches.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_base_switches.h11
-rw-r--r--devel/electron18/files/patch-remoting_host_chromoting__host.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_chromoting__host__context.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_chromoting__host__services__client.cc20
-rw-r--r--devel/electron18/files/patch-remoting_host_evaluate__capability.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_heartbeat__sender.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_host__attributes.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_host__details.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_host__main.cc29
-rw-r--r--devel/electron18/files/patch-remoting_host_ipc__constants.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_it2me_it2me__native__messaging__host__main.cc47
-rw-r--r--devel/electron18/files/patch-remoting_host_me2me__desktop__environment.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_remote__open__url_remote__open__url__client.cc20
-rw-r--r--devel/electron18/files/patch-remoting_host_remote__open__url_remote__open__url__util.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_remote__open__url_url__forwarder__configurator.cc11
-rw-r--r--devel/electron18/files/patch-remoting_host_remoting__me2me__host.cc92
-rw-r--r--devel/electron18/files/patch-remoting_host_setup_start__host__main.cc29
-rw-r--r--devel/electron18/files/patch-remoting_resources_remoting__strings.grd20
-rw-r--r--devel/electron18/files/patch-sandbox_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-sandbox_features.gni11
-rw-r--r--devel/electron18/files/patch-sandbox_linux_BUILD.gn58
-rw-r--r--devel/electron18/files/patch-sandbox_linux_services_init__process__reaper.cc15
-rw-r--r--devel/electron18/files/patch-sandbox_linux_services_libc__interceptor.cc21
-rw-r--r--devel/electron18/files/patch-sandbox_policy_BUILD.gn39
-rw-r--r--devel/electron18/files/patch-sandbox_policy_features.cc14
-rw-r--r--devel/electron18/files/patch-sandbox_policy_freebsd_sandbox__freebsd.cc250
-rw-r--r--devel/electron18/files/patch-sandbox_policy_freebsd_sandbox__freebsd.h281
-rw-r--r--devel/electron18/files/patch-sandbox_policy_mojom_sandbox.mojom15
-rw-r--r--devel/electron18/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc410
-rw-r--r--devel/electron18/files/patch-sandbox_policy_openbsd_sandbox__openbsd.h285
-rw-r--r--devel/electron18/files/patch-sandbox_policy_sandbox.cc22
-rw-r--r--devel/electron18/files/patch-sandbox_policy_sandbox.h22
-rw-r--r--devel/electron18/files/patch-sandbox_policy_sandbox__type.cc38
-rw-r--r--devel/electron18/files/patch-sandbox_policy_switches.cc13
-rw-r--r--devel/electron18/files/patch-sandbox_policy_switches.h12
-rw-r--r--devel/electron18/files/patch-services_audio_audio__sandbox__hook__linux.cc31
-rw-r--r--devel/electron18/files/patch-services_audio_audio__sandbox__hook__linux.h14
-rw-r--r--devel/electron18/files/patch-services_cert__verifier_cert__verifier__creation.cc30
-rw-r--r--devel/electron18/files/patch-services_device_geolocation_location__arbitrator.cc11
-rw-r--r--devel/electron18/files/patch-services_device_hid_BUILD.gn28
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__connection__fido.cc201
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__connection__fido.h60
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__connection__freebsd.cc246
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__connection__freebsd.h70
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__service.cc24
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__service__fido.cc331
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__service__fido.h46
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__service__freebsd.cc401
-rw-r--r--devel/electron18/files/patch-services_device_hid_hid__service__freebsd.h52
-rw-r--r--devel/electron18/files/patch-services_device_serial_BUILD.gn16
-rw-r--r--devel/electron18/files/patch-services_device_serial_serial__device__enumerator.cc20
-rw-r--r--devel/electron18/files/patch-services_device_serial_serial__io__handler__posix.cc11
-rw-r--r--devel/electron18/files/patch-services_device_time__zone__monitor_time__zone__monitor__linux.cc14
-rw-r--r--devel/electron18/files/patch-services_device_usb_BUILD.gn38
-rw-r--r--devel/electron18/files/patch-services_network_BUILD.gn10
-rw-r--r--devel/electron18/files/patch-services_network_network__sandbox__hook__linux.cc26
-rw-r--r--devel/electron18/files/patch-services_network_network__sandbox__hook__linux.h14
-rw-r--r--devel/electron18/files/patch-services_network_network__service.cc11
-rw-r--r--devel/electron18/files/patch-services_resource__coordinator_memory__instrumentation_queued__request__dispatcher.cc65
-rw-r--r--devel/electron18/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_BUILD.gn16
-rw-r--r--devel/electron18/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics.h20
-rw-r--r--devel/electron18/files/patch-services_resource__coordinator_public_cpp_memory__instrumentation_os__metrics__bsd.cc61
-rw-r--r--devel/electron18/files/patch-services_service__manager_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-services_service__manager_public_cpp_service__executable_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-services_tracing_public_cpp_perfetto_perfetto__config.cc11
-rw-r--r--devel/electron18/files/patch-services_video__capture_broadcasting__receiver.cc20
-rw-r--r--devel/electron18/files/patch-services_video__capture_public_mojom_video__capture__service.mojom15
-rw-r--r--devel/electron18/files/patch-skia_ext_SkMemory__new__handler.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_abseil-cpp_absl_base_config.h40
-rw-r--r--devel/electron18/files/patch-third__party_abseil-cpp_absl_base_internal_endian.h11
-rw-r--r--devel/electron18/files/patch-third__party_abseil-cpp_absl_base_internal_sysinfo.cc23
-rw-r--r--devel/electron18/files/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.h11
-rw-r--r--devel/electron18/files/patch-third__party_abseil-cpp_absl_time_internal_cctz_src_time__zone__format.cc11
-rw-r--r--devel/electron18/files/patch-third__party_angle_BUILD.gn29
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_common_platform.h19
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_common_system__utils__posix.cpp12
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_gpu__info__util_SystemInfo__internal.h16
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_gpu__info__util_SystemInfo__libpci.cpp90
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_gpu__info__util_SystemInfo__linux.cpp35
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_gpu__info__util_SystemInfo__x11.cpp60
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_libANGLE_Display.cpp47
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_libANGLE_formatutils.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_libANGLE_renderer_driver__utils.h11
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_libANGLE_renderer_gl_glx_FunctionsGLX.cpp15
-rw-r--r--devel/electron18/files/patch-third__party_angle_src_libANGLE_renderer_vulkan_DisplayVk__api.h11
-rw-r--r--devel/electron18/files/patch-third__party_angle_util_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_blink_common_renderer__preferences_renderer__preferences__mojom__traits.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences.h11
-rw-r--r--devel/electron18/files/patch-third__party_blink_public_common_renderer__preferences_renderer__preferences__mojom__traits.h11
-rw-r--r--devel/electron18/files/patch-third__party_blink_public_platform_web__vector.h11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_build_scripts_run__with__pythonpath.py10
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_controller_blink__initializer.cc35
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.cc21
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_controller_memory__usage__monitor__posix.h47
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_editing_editing__behavior.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_exported_web__view__impl.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_frame_web__frame__test.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_html_canvas_canvas__async__blob__creator.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_html_forms_internal__popup__menu.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_inspector_inspector__memory__agent.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_layout_layout__view.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_paint_paint__layer.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_core_scroll_scrollbar__theme__aura.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_modules_media_audio_audio__device__factory.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_modules_media_audio_audio__renderer__mixer__manager__test.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_modules_peerconnection_webrtc__audio__renderer__test.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_modules_webaudio_audio__worklet__thread__test.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_modules_webgl_webgl__rendering__context__base.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_modules_webgl_webgl__webcodecs__video__frame.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_fonts_font__cache.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_fonts_font__cache.h47
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_fonts_font__description.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_fonts_font__metrics.cc29
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_fonts_font__unique__name__lookup.cc20
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_fonts_skia_font__cache__skia.cc29
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_graphics_begin__frame__provider.cc14
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_graphics_video__frame__submitter.cc11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_scheduler_common_thread.cc12
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_wtf_container__annotations.h11
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_wtf_math__extras.h23
-rw-r--r--devel/electron18/files/patch-third__party_blink_renderer_platform_wtf_stack__util.cc37
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_BUILD.generated.gni18
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_src_crypto_cpu__aarch64__openbsd.c60
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_src_crypto_fipsmodule_rand_internal.h12
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_src_crypto_rand__extra_arc4random.c36
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_src_crypto_refcount__c11.c12
-rw-r--r--devel/electron18/files/patch-third__party_boringssl_src_include_openssl_base.h14
-rw-r--r--devel/electron18/files/patch-third__party_brotli_common_platform.h11
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_build_crashpad__buildconfig.gni11
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_client_BUILD.gn16
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_client_crashpad__client__posix.cc43
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_minidump_minidump__misc__info__writer.cc13
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_misc_address__types.h20
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_misc_capture__context.h22
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_misc_metrics.cc11
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_misc_uuid.cc11
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_posix_close__multiple.cc11
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_posix_drop__privileges.cc11
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_posix_signals.cc33
-rw-r--r--devel/electron18/files/patch-third__party_crashpad_crashpad_util_posix_symbolic__constants__posix.cc20
-rw-r--r--devel/electron18/files/patch-third__party_crc32c_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_dawn_include_dawn_native_VulkanBackend.h11
-rw-r--r--devel/electron18/files/patch-third__party_dawn_src_dawn_common_Platform.h14
-rw-r--r--devel/electron18/files/patch-third__party_dawn_src_dawn_native_vulkan_BackendVk.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_electron__node_deps_uv_BUILD.gn46
-rw-r--r--devel/electron18/files/patch-third__party_electron__node_deps_uv_src_unix_pipe.c18
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_BUILD.gn10
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_chromium_config_Chrome_openbsd_arm64_config.h2790
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_chromium_config_Chrome_openbsd_ia32_config.asm2730
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_chromium_config_Chrome_openbsd_ia32_config.h2747
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_chromium_config_Chrome_openbsd_x64_config.asm2773
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_chromium_config_Chrome_openbsd_x64_config.h2790
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_libavcodec_x86_cabac.h12
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_libavutil_cpu.c14
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_libavutil_mem.c12
-rw-r--r--devel/electron18/files/patch-third__party_ffmpeg_libavutil_random__seed.c14
-rw-r--r--devel/electron18/files/patch-third__party_fontconfig_include_config.h89
-rw-r--r--devel/electron18/files/patch-third__party_fontconfig_src_src_fccompat.c13
-rw-r--r--devel/electron18/files/patch-third__party_glfw_src_src_egl__context.c11
-rw-r--r--devel/electron18/files/patch-third__party_leveldatabase_env__chromium.cc12
-rw-r--r--devel/electron18/files/patch-third__party_libXNVCtrl_NVCtrl.c25
-rw-r--r--devel/electron18/files/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_memory_singleton.h12
-rw-r--r--devel/electron18/files/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_synchronization_lock.h12
-rw-r--r--devel/electron18/files/patch-third__party_libphonenumber_dist_cpp_src_phonenumbers_base_thread__checker.h22
-rw-r--r--devel/electron18/files/patch-third__party_libsync_src_include_sync_sync.h12
-rw-r--r--devel/electron18/files/patch-third__party_libsync_src_sync.c25
-rw-r--r--devel/electron18/files/patch-third__party_libusb_BUILD.gn46
-rw-r--r--devel/electron18/files/patch-third__party_libusb_src_libusb_core.c11
-rw-r--r--devel/electron18/files/patch-third__party_libxml_linux_config.h12
-rw-r--r--devel/electron18/files/patch-third__party_libxml_src_dict.c41
-rw-r--r--devel/electron18/files/patch-third__party_maldoca_BUILD.gn13
-rw-r--r--devel/electron18/files/patch-third__party_maldoca_src_maldoca_base_get__runfiles__dir.cc32
-rw-r--r--devel/electron18/files/patch-third__party_maldoca_src_maldoca_service_common_process__doc__wrapper.cc29
-rw-r--r--devel/electron18/files/patch-third__party_nasm_BUILD.gn16
-rw-r--r--devel/electron18/files/patch-third__party_nasm_config_config-linux.h111
-rw-r--r--devel/electron18/files/patch-third__party_node_node.py11
-rw-r--r--devel/electron18/files/patch-third__party_opus_BUILD.gn10
-rw-r--r--devel/electron18/files/patch-third__party_pdfium_core_fxcrt_cfx__datetime.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_pdfium_core_fxge_cfx__fontmapper.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_pdfium_core_fxge_linux_fx__linux__impl.cpp23
-rw-r--r--devel/electron18/files/patch-third__party_pdfium_fxjs_fx__date__helpers.cpp22
-rw-r--r--devel/electron18/files/patch-third__party_pdfium_xfa_fxfa_parser_cxfa__timezoneprovider.cpp41
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_include_perfetto_base_build__config.h66
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_include_perfetto_base_thread__utils.h22
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_include_perfetto_base_time.h20
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_include_perfetto_ext_base_event__fd.h11
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_include_perfetto_ext_base_thread__utils.h15
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_event__fd.cc22
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_periodic__task.cc20
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_string__utils.cc15
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_subprocess__posix.cc22
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_test_vm__test__utils.cc11
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_thread__task__runner.cc14
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_base_unix__socket.cc26
-rw-r--r--devel/electron18/files/patch-third__party_perfetto_src_tracing_core_tracing__service__impl.cc12
-rw-r--r--devel/electron18/files/patch-third__party_protobuf_src_google_protobuf_stubs_platform__macros.h11
-rw-r--r--devel/electron18/files/patch-third__party_protobuf_src_google_protobuf_stubs_strutil.h18
-rw-r--r--devel/electron18/files/patch-third__party_skia_src_core_SkCpu.cpp26
-rw-r--r--devel/electron18/files/patch-third__party_skia_src_gpu_GrAutoLocaleSetter.h11
-rw-r--r--devel/electron18/files/patch-third__party_skia_src_ports_SkOSFile__posix.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_sqlite_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_sqlite_src_amalgamation_sqlite3.c23
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_Common_Configurator.cpp13
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_Common_MutexLock.hpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_Common_SharedLibrary.hpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_Main_SwiftConfig.cpp14
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_OpenGL_libEGL_Display.cpp20
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_OpenGL_libEGL_Surface.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.cpp29
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.hpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_OpenGL_libGLESv2_libGLESv2.hpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_Reactor_Debug.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_System_SharedLibrary.hpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_Vulkan_VkSemaphoreExternalLinux.hpp20
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_src_WSI_libXCB.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h213
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_third__party_llvm-subzero_build_Linux_include_llvm_Config_config.h47
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_third__party_marl_src_memory.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_swiftshader_third__party_marl_src_thread.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_test__fonts_fontconfig_BUILD.gn15
-rw-r--r--devel/electron18/files/patch-third__party_test__fonts_fontconfig_fontconfig__util__linux.cc27
-rw-r--r--devel/electron18/files/patch-third__party_unrar_src_crypt.cpp11
-rw-r--r--devel/electron18/files/patch-third__party_usrsctp_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-loader_src_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-loader_src_loader_allocation.h14
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-loader_src_loader_get__environment.c27
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-loader_src_loader_get__environment.h16
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-loader_src_loader_vk__loader__platform.h36
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-validation-layers_src_layers_vk__loader__platform.h11
-rw-r--r--devel/electron18/files/patch-third__party_vulkan-deps_vulkan-validation-layers_src_layers_vk__mem__alloc.h12
-rw-r--r--devel/electron18/files/patch-third__party_vulkan__memory__allocator_include_vk__mem__alloc.h11
-rw-r--r--devel/electron18/files/patch-third__party_wayland_features.gni17
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_BUILD.gn12
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_modules_audio__device_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_modules_desktop__capture_linux_x11_x__server__pixel__buffer.cc15
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_byte__order.h11
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_ip__address.cc12
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_network.cc15
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_physical__socket__server.cc65
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_physical__socket__server.h11
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_platform__thread__types.cc40
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_rtc__base_third__party_sigslot_sigslot.h23
-rw-r--r--devel/electron18/files/patch-third__party_webrtc_system__wrappers_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-third__party_zlib_BUILD.gn29
-rw-r--r--devel/electron18/files/patch-tools_generate__stubs_rules.gni10
-rw-r--r--devel/electron18/files/patch-tools_gn_build_build__linux.ninja.template11
-rw-r--r--devel/electron18/files/patch-tools_gn_build_gen.py34
-rw-r--r--devel/electron18/files/patch-tools_gn_src_base_files_file__posix.cc11
-rw-r--r--devel/electron18/files/patch-tools_gn_src_gn_version.h15
-rw-r--r--devel/electron18/files/patch-tools_gn_src_util_exe__path.cc90
-rw-r--r--devel/electron18/files/patch-tools_json__schema__compiler_cpp__bundle__generator.py11
-rw-r--r--devel/electron18/files/patch-tools_json__schema__compiler_feature__compiler.py10
-rw-r--r--devel/electron18/files/patch-tools_perf_chrome__telemetry__build_BUILD.gn20
-rw-r--r--devel/electron18/files/patch-tools_protoc__wrapper_protoc__wrapper.py15
-rw-r--r--devel/electron18/files/patch-tools_variations_fieldtrial__to__struct.py11
-rw-r--r--devel/electron18/files/patch-ui_base_clipboard_clipboard__constants.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_clipboard_clipboard__constants.h11
-rw-r--r--devel/electron18/files/patch-ui_base_cursor_cursor__factory.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_cursor_cursor__factory.h11
-rw-r--r--devel/electron18/files/patch-ui_base_dragdrop_os__exchange__data__provider__factory.cc20
-rw-r--r--devel/electron18/files/patch-ui_base_dragdrop_os__exchange__data__provider__non__backed.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_ime_dummy__text__input__client.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_ime_dummy__text__input__client.h11
-rw-r--r--devel/electron18/files/patch-ui_base_ime_fake__text__input__client.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_ime_fake__text__input__client.h11
-rw-r--r--devel/electron18/files/patch-ui_base_ime_init_input__method__initializer.cc38
-rw-r--r--devel/electron18/files/patch-ui_base_ime_text__input__client.h11
-rw-r--r--devel/electron18/files/patch-ui_base_resource_resource__bundle.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_test_skia__gold__pixel__diff.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_ui__base__features.cc20
-rw-r--r--devel/electron18/files/patch-ui_base_webui_web__ui__util.cc11
-rw-r--r--devel/electron18/files/patch-ui_base_x_x11__cursor__loader.cc14
-rw-r--r--devel/electron18/files/patch-ui_base_x_x11__shm__image__pool.cc53
-rw-r--r--devel/electron18/files/patch-ui_color_color__id.h11
-rw-r--r--devel/electron18/files/patch-ui_color_native__color__mixers.cc17
-rw-r--r--devel/electron18/files/patch-ui_compositor_compositor.cc11
-rw-r--r--devel/electron18/files/patch-ui_compositor_compositor.h11
-rw-r--r--devel/electron18/files/patch-ui_compositor_compositor__observer.h11
-rw-r--r--devel/electron18/files/patch-ui_events_devices_x11_device__data__manager__x11.cc10
-rw-r--r--devel/electron18/files/patch-ui_events_event.cc20
-rw-r--r--devel/electron18/files/patch-ui_events_event__switches.cc11
-rw-r--r--devel/electron18/files/patch-ui_events_event__switches.h11
-rw-r--r--devel/electron18/files/patch-ui_events_keycodes_dom_keycode__converter.cc38
-rw-r--r--devel/electron18/files/patch-ui_events_keycodes_dom_keycode__converter.h11
-rw-r--r--devel/electron18/files/patch-ui_gfx_BUILD.gn11
-rw-r--r--devel/electron18/files/patch-ui_gfx_canvas__skia.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_codec_png__codec.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_font__fallback__linux.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_font__list.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_font__render__params.h20
-rw-r--r--devel/electron18/files/patch-ui_gfx_font__util.cc20
-rw-r--r--devel/electron18/files/patch-ui_gfx_gpu__memory__buffer.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_gpu__memory__buffer.h20
-rw-r--r--devel/electron18/files/patch-ui_gfx_ipc_gfx__param__traits__macros.h44
-rw-r--r--devel/electron18/files/patch-ui_gfx_linux_client__native__pixmap__dmabuf.cc25
-rw-r--r--devel/electron18/files/patch-ui_gfx_mojom_buffer__types__mojom__traits.cc20
-rw-r--r--devel/electron18/files/patch-ui_gfx_mojom_native__handle__types__mojom__traits.cc34
-rw-r--r--devel/electron18/files/patch-ui_gfx_mojom_native__handle__types__mojom__traits.h29
-rw-r--r--devel/electron18/files/patch-ui_gfx_native__pixmap__handle.cc62
-rw-r--r--devel/electron18/files/patch-ui_gfx_native__pixmap__handle.h38
-rw-r--r--devel/electron18/files/patch-ui_gfx_native__widget__types.h20
-rw-r--r--devel/electron18/files/patch-ui_gfx_render__text__api__fuzzer.cc29
-rw-r--r--devel/electron18/files/patch-ui_gfx_switches.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_switches.h11
-rw-r--r--devel/electron18/files/patch-ui_gfx_x_generated__protos_dri3.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_x_generated__protos_shm.cc11
-rw-r--r--devel/electron18/files/patch-ui_gfx_x_xlib__support.cc21
-rw-r--r--devel/electron18/files/patch-ui_gl_BUILD.gn35
-rw-r--r--devel/electron18/files/patch-ui_gl_generate__bindings.py12
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__bindings__api__autogen__glx.h10
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__bindings__autogen__glx.cc61
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__bindings__autogen__glx.h43
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__context.cc11
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__features.cc11
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__image__glx__native__pixmap.cc11
-rw-r--r--devel/electron18/files/patch-ui_gl_gl__implementation.cc11
-rw-r--r--devel/electron18/files/patch-ui_gl_sync__control__vsync__provider.cc38
-rw-r--r--devel/electron18/files/patch-ui_gl_sync__control__vsync__provider.h20
-rw-r--r--devel/electron18/files/patch-ui_gtk_gtk__compat.cc50
-rw-r--r--devel/electron18/files/patch-ui_gtk_printing_print__dialog__gtk.cc11
-rw-r--r--devel/electron18/files/patch-ui_message__center_views_message__popup__view.cc11
-rw-r--r--devel/electron18/files/patch-ui_native__theme_native__theme.h11
-rw-r--r--devel/electron18/files/patch-ui_native__theme_native__theme__base.cc11
-rw-r--r--devel/electron18/files/patch-ui_ozone_common_egl__util.cc14
-rw-r--r--devel/electron18/files/patch-ui_ozone_platform_wayland_gpu_vulkan__implementation__wayland.cc14
-rw-r--r--devel/electron18/files/patch-ui_ozone_platform_x11_ozone__platform__x11.cc11
-rw-r--r--devel/electron18/files/patch-ui_ozone_platform_x11_vulkan__implementation__x11.cc14
-rw-r--r--devel/electron18/files/patch-ui_ozone_public_ozone__platform.h11
-rw-r--r--devel/electron18/files/patch-ui_platform__window_platform__window__init__properties.h20
-rw-r--r--devel/electron18/files/patch-ui_strings_app__locale__settings.grd11
-rw-r--r--devel/electron18/files/patch-ui_views_controls_prefix__selector.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_controls_prefix__selector.h11
-rw-r--r--devel/electron18/files/patch-ui_views_controls_textfield_textfield.cc64
-rw-r--r--devel/electron18/files/patch-ui_views_controls_textfield_textfield.h11
-rw-r--r--devel/electron18/files/patch-ui_views_corewm_tooltip__aura.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_examples_widget__example.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_focus_focus__manager.cc20
-rw-r--r--devel/electron18/files/patch-ui_views_linux__ui_linux__ui.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_linux__ui_linux__ui.h20
-rw-r--r--devel/electron18/files/patch-ui_views_style_platform__style.cc20
-rw-r--r--devel/electron18/files/patch-ui_views_views__delegate.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_views__delegate.h11
-rw-r--r--devel/electron18/files/patch-ui_views_widget_desktop__aura_desktop__screen__ozone.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_widget_native__widget__aura.cc29
-rw-r--r--devel/electron18/files/patch-ui_views_widget_widget.cc20
-rw-r--r--devel/electron18/files/patch-ui_views_window_custom__frame__view.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_window_dialog__delegate.cc11
-rw-r--r--devel/electron18/files/patch-ui_views_window_frame__background.cc11
-rw-r--r--devel/electron18/files/patch-ui_webui_resources_js_cr.js14
-rw-r--r--devel/electron18/files/patch-v8_BUILD.gn45
-rw-r--r--devel/electron18/files/patch-v8_include_v8config.h37
-rw-r--r--devel/electron18/files/patch-v8_src_api_api.cc20
-rw-r--r--devel/electron18/files/patch-v8_src_base_atomicops.h33
-rw-r--r--devel/electron18/files/patch-v8_src_base_platform_platform-freebsd.cc32
-rw-r--r--devel/electron18/files/patch-v8_src_base_platform_platform-openbsd.cc28
-rw-r--r--devel/electron18/files/patch-v8_src_base_platform_platform-posix.cc53
-rw-r--r--devel/electron18/files/patch-v8_src_base_sys-info.cc11
-rw-r--r--devel/electron18/files/patch-v8_src_compiler_backend_ia32_instruction-selector-ia32.cc20
-rw-r--r--devel/electron18/files/patch-v8_src_diagnostics_perf-jit.cc11
-rw-r--r--devel/electron18/files/patch-v8_src_diagnostics_perf-jit.h11
-rw-r--r--devel/electron18/files/patch-v8_src_trap-handler_handler-inside-posix.cc26
-rw-r--r--devel/electron18/files/patch-v8_src_trap-handler_handler-inside-posix.h11
-rw-r--r--devel/electron18/files/patch-v8_src_trap-handler_trap-handler.h11
-rw-r--r--devel/electron18/files/patch-v8_src_wasm_baseline_ia32_liftoff-assembler-ia32.h101
-rw-r--r--devel/electron18/files/patch-v8_tools_run.py11
-rw-r--r--devel/electron18/files/patch-weblayer_browser_browser__main__parts__impl.cc20
-rw-r--r--devel/electron18/files/patch-weblayer_browser_content__browser__client__impl.cc20
-rw-r--r--devel/electron18/files/patch-weblayer_browser_content__browser__client__impl.h11
-rw-r--r--devel/electron18/files/patch-weblayer_browser_system__network__context__manager.cc11
-rw-r--r--devel/electron18/files/patch-weblayer_common_weblayer__paths.cc20
-rw-r--r--devel/electron18/files/yarn.lock8333
-rw-r--r--devel/electron18/pkg-descr10
-rw-r--r--devel/electron18/pkg-plist177
1136 files changed, 52293 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index a493b405f4eb..a163220efb80 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -572,6 +572,7 @@
SUBDIR += eiffelstudio
SUBDIR += electron13
SUBDIR += electron17
+ SUBDIR += electron18
SUBDIR += elf
SUBDIR += elf-dissector
SUBDIR += elfcat
diff --git a/devel/electron18/Makefile b/devel/electron18/Makefile
new file mode 100644
index 000000000000..82ea3bbecddb
--- /dev/null
+++ b/devel/electron18/Makefile
@@ -0,0 +1,354 @@
+PORTNAME= electron
+DISTVERSIONPREFIX= v
+DISTVERSION= ${ELECTRON_VER:S/-beta./.b/}
+CATEGORIES= devel
+MASTER_SITES= https://github.com/tagattie/FreeBSD-Electron/releases/download/v18.2.4/:chromium \
+ https://commondatastorage.googleapis.com/chromium-nodejs/:chromium_node \
+ https://commondatastorage.googleapis.com/chromium-fonts/:chromium_testfonts
+PKGNAMESUFFIX= ${ELECTRON_VER_MAJOR}
+DISTFILES= chromium-${CHROMIUM_VER}${EXTRACT_SUFX}:chromium \
+ ${CHROMIUM_NODE_MODULES_HASH}:chromium_node \
+ ${CHROMIUM_TEST_FONTS_HASH}:chromium_testfonts \
+ electron-yarn-cache-${ELECTRON_VER}${EXTRACT_SUFX}:prefetch
+DIST_SUBDIR= ${PORTNAME}
+
+MAINTAINER= tagattie@FreeBSD.org
+COMMENT= Build cross-platform desktop apps with JavaScript, HTML, and CSS
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/electron/LICENSE
+
+FETCH_DEPENDS= yarn-node16>0:www/yarn-node16
+EXTRACT_DEPENDS= yarn-node16>0:www/yarn-node16
+PATCH_DEPENDS= git:devel/git
+BUILD_DEPENDS= gperf:devel/gperf \
+ yasm:devel/yasm \
+ ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri \
+ ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat \
+ node16>0:www/node16 \
+ npm-node16>0:www/npm-node16
+LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \
+ libatspi.so:accessibility/at-spi2-core \
+ libsnappy.so:archivers/snappy \
+ libFLAC.so:audio/flac \
+ libopus.so:audio/opus \
+ libdbus-1.so:devel/dbus \
+ libnotify.so:devel/libnotify \
+ libpci.so:devel/libpci \
+ libnspr4.so:devel/nspr \
+ libre2.so:devel/re2 \
+ libdrm.so:graphics/libdrm \
+ libpng.so:graphics/png \
+ libwayland-client.so:graphics/wayland \
+ libwebp.so:graphics/webp \
+ libva.so:multimedia/libva \
+ libopenh264.so:multimedia/openh264 \
+ libfreetype.so:print/freetype2 \
+ libharfbuzz.so:print/harfbuzz \
+ libsecret-1.so:security/libsecret \
+ libnss3.so:security/nss \
+ libexpat.so:textproc/expat2 \
+ libxkbcommon.so:x11/libxkbcommon \
+ libxshmfence.so:x11/libxshmfence \
+ libfontconfig.so:x11-fonts/fontconfig
+RUN_DEPENDS= xdg-open:devel/xdg-utils
+TEST_DEPENDS= git:devel/git \
+ ${PYTHON_PKGNAMEPREFIX}python-dbusmock>0:devel/py-python-dbusmock@${PY_FLAVOR} \
+ npm-node16>0:www/npm-node16
+
+USES= bison compiler:c++17-lang cpe gettext-tools gl gnome iconv \
+ jpeg localbase:ldflags ninja pkgconfig python:build,test \
+ shebangfix tar:xz xorg
+CPE_VENDOR= electronjs
+USE_GITHUB= yes
+GH_TAGNAME= ${DISTVERSIONPREFIX}${ELECTRON_VER}
+GH_TUPLE= nodejs:node:v${NODE_VER}:node \
+ nodejs:nan:${NAN_VER}:nan \
+ Squirrel:Squirrel.Mac:${SQUIRREL_MAC_VER}:squirrel_mac \
+ ReactiveCocoa:ReactiveObjC:${REACTIVEOBJC_VER}:reactiveobjc \
+ Mantle:Mantle:${MANTLE_VER}:mantle
+USE_GL= gbm gl glesv2
+USE_GNOME= atk cairo gdkpixbuf2 gtk30 libxml2 libxslt pango
+USE_LDCONFIG= ${DATADIR}
+USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xrandr \
+ xrender xscrnsaver xtst
+
+SHEBANG_FILES= buildtools/linux64/clang-format
+
+MAKE_ARGS= -C out/${BUILDTYPE}
+MAKE_ENV+= C_INCLUDE_PATH=${LOCALBASE}/include \
+ CPLUS_INCLUDE_PATH=${LOCALBASE}/include
+ALL_TARGET= electron third_party/electron_node:headers
+POST_BUILD_TARGETS= licenses version
+POST_BUILD_DIST_TARGETS= electron_dist_zip electron_chromedriver_zip \
+ electron_mksnapshot_zip
+
+DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX}
+BINARY_ALIAS= python3=${PYTHON_CMD}
+
+NO_WRKSUBDIR= yes
+WRKSRC_SUBDIR= src
+
+PLIST_SUB= ELECTRON_VER=${ELECTRON_VER} \
+ ELECTRON_VER_MAJOR=${ELECTRON_VER_MAJOR}
+
+OPTIONS_DEFINE= CUPS DEBUG DIST DRIVER KERBEROS LTO
+OPTIONS_DEFAULT= CUPS DRIVER KERBEROS ALSA
+OPTIONS_GROUP= AUDIO
+OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO
+OPTIONS_SUB= yes
+
+DIST_DESC= Build distribution zip files
+DRIVER_DESC= Install chromedriver
+
+ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
+ALSA_RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins
+ALSA_VARS= GN_ARGS+=use_alsa=true
+ALSA_VARS_OFF= GN_ARGS+=use_alsa=false
+CUPS_LIB_DEPENDS= libcups.so:print/cups
+CUPS_VARS= GN_ARGS+=use_cups=true
+CUPS_VARS_OFF= GN_ARGS+=use_cups=false
+DEBUG_VARS= BUILDTYPE=Debug \
+ GN_FILE=testing.gn \
+ GN_ARGS+=is_debug=true \
+ GN_BOOTSTRAP_FLAGS+=--debug
+DEBUG_VARS_OFF= BUILDTYPE=Release \
+ GN_FILE=release.gn \
+ GN_ARGS+=blink_symbol_level=0 \
+ GN_ARGS+=is_debug=false \
+ GN_ARGS+=symbol_level=0
+DIST_IMPLIES= DRIVER
+DRIVER_ALL_TARGET= chromedriver
+KERBEROS_VARS= GN_ARGS+=use_kerberos=true
+KERBEROS_VARS_OFF= GN_ARGS+=use_kerberos=false
+LTO_VARS= GN_ARGS+=use_thin_lto=true \
+ GN_ARGS+=thin_lto_enable_optimizations=true
+LTO_VARS_OFF= GN_ARGS+=use_thin_lto=false
+PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
+PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true
+PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false
+# With SNDIO=on we exclude audio_manager_linux from the build (see
+# media/audio/BUILD.gn) and use audio_manager_openbsd which does not
+# support falling back to ALSA or PulseAudio.
+SNDIO_PREVENTS= ALSA PULSEAUDIO
+SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio
+SNDIO_VARS= GN_ARGS+=use_sndio=true
+SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false
+
+# See ${WRKSRC}/electron/DEPS for CHROMIUM_VER
+CHROMIUM_VER= 100.0.4896.160
+# See ${WRKSRC}/third_party/node/node_modules.tar.gz.sha1 for CHROMIUM_NODE_MODULES_HASH
+CHROMIUM_NODE_MODULES_HASH= aad6877c8cd3cff0ef1ba628d71acc981c520c29
+# See ${WRKSRC}/third_party/test_fonts/test_fonts.tar.gz.sha1 for CHROMIUM_TEST_FONTS_HASH
+CHROMIUM_TEST_FONTS_HASH= cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb
+# See ${WRKSRC}/electron/DEPS for NODE_VER
+NODE_VER= 16.13.2
+# See ${WRKSRC}/electron/DEPS for NAN_VER
+NAN_VER= 65b32af46e9d7fab2e4ff657751205b3865f4920
+# See ${WRKSRC}/electron/DEPS for SQUIRREL_MAC_VER
+SQUIRREL_MAC_VER= 0e5d146ba13101a1302d59ea6e6e0b3cace4ae38
+# See ${WRKSRC}/electron/DEPS for REACTIVEOBJC_VER
+REACTIVEOBJC_VER= 74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76
+# See ${WRKSRC}/electron/DEPS for MANTLE_VER
+MANTLE_VER= 78d3966b3c331292ea29ec38661b25df0a245948
+
+YARN_TIMESTAMP= 1655443613
+
+GN_ARGS+= clang_use_chrome_plugins=false \
+ enable_hangout_services_extension=true \
+ enable_js_type_check=false \
+ enable_nacl=false \
+ enable_one_click_signin=true \
+ enable_remoting=false \
+ enable_wmax_tokens=false \
+ fatal_linker_warnings=false \
+ is_clang=true \
+ optimize_webui=true \
+ toolkit_views=true \
+ treat_warnings_as_errors=false \
+ use_allocator="none" \
+ use_allocator_shim=false \
+ use_aura=true \
+ use_custom_libcxx=false \
+ use_gnome_keyring=false \
+ use_lld=true \
+ use_sysroot=false \
+ use_system_freetype=false \
+ use_system_harfbuzz=true \
+ use_system_libjpeg=true \
+ use_system_wayland_scanner=true \
+ use_udev=false \
+ extra_cxxflags="${CXXFLAGS}" \
+ extra_ldflags="${LDFLAGS}"
+GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles
+
+.include "Makefile.version"
+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_VERSION} < 130
+LLVM_DEFAULT= 13
+BUILD_DEPENDS+= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
+BINARY_ALIAS+= cpp=${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} \
+ cc=${LOCALBASE}/bin/clang${LLVM_DEFAULT} \
+ c++=${LOCALBASE}/bin/clang++${LLVM_DEFAULT} \
+ ar=${LOCALBASE}/bin/llvm-ar${LLVM_DEFAULT} \
+ nm=${LOCALBASE}/bin/llvm-nm${LLVM_DEFAULT} \
+ ld=${LOCALBASE}/bin/ld.lld${LLVM_DEFAULT}
+.else
+BINARY_ALIAS+= ar=/usr/bin/llvm-ar \
+ nm=/usr/bin/llvm-nm
+.endif
+
+.if ${ARCH} == "amd64"
+PLIST_SUB+= AMD64=""
+.else
+PLIST_SUB+= AMD64="@comment "
+.endif
+
+.if ${ARCH} == "i386"
+PLIST_SUB+= I386=""
+.else
+PLIST_SUB+= I386="@comment "
+.endif
+
+pre-fetch:
+ @${MKDIR} ${DISTDIR}/${DIST_SUBDIR}
+ if [ ! -f ${DISTDIR}/${DIST_SUBDIR}/electron-yarn-cache-${ELECTRON_VER}${EXTRACT_SUFX} ]; \
+ then ${MKDIR} ${WRKDIR}; \
+ ${ECHO_CMD} 'yarn-offline-mirror "./yarn-offline-cache"' >> \
+ ${WRKDIR}/.yarnrc; \
+ ${CP} ${FILESDIR}/package.json ${FILESDIR}/yarn.lock ${WRKDIR}; \
+ cd ${WRKDIR} && ${SETENV} HOME=${WRKDIR} XDG_CACHE_HOME=${WRKDIR}/.cache \
+ yarn --frozen-lockfile --ignore-scripts; \
+ ${MTREE_CMD} -cbnSp yarn-offline-cache | ${MTREE_CMD} -C | ${SED} \
+ -e 's:time=[0-9.]*:time=${YARN_TIMESTAMP}.000000000:' \
+ -e 's:\([gu]id\)=[0-9]*:\1=0:g' \
+ -e 's:flags=.*:flags=none:' \
+ -e 's:^\.:./yarn-offline-cache:' > yarn-offline-cache.mtree; \
+ ${TAR} cJf ${DISTDIR}/${DIST_SUBDIR}/electron-yarn-cache-${ELECTRON_VER}${EXTRACT_SUFX} \
+ @yarn-offline-cache.mtree; \
+ ${RM} -r ${WRKDIR}; \
+ fi
+
+post-extract:
+# Move extracted sources to appropriate locations
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/chromium-${CHROMIUM_VER} ${WRKSRC}
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${PORTNAME}-${ELECTRON_VER} ${WRKSRC}/electron
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_nan}-${NAN_VER} \
+ ${WRKSRC}/third_party/nan
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_node}-${NODE_VER} \
+ ${WRKSRC}/third_party/electron_node
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_squirrel_mac}-${SQUIRREL_MAC_VER} \
+ ${WRKSRC}/third_party/squirrel.mac
+ ${MKDIR} ${WRKSRC}/third_party/squirrel.mac/vendor
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_reactiveobjc}-${REACTIVEOBJC_VER} \
+ ${WRKSRC}/third_party/squirrel.mac/vendor/ReactiveObjC
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_mantle}-${MANTLE_VER} \
+ ${WRKSRC}/third_party/squirrel.mac/vendor/Mantle
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/node_modules ${WRKSRC}/third_party/node
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/test_fonts ${WRKSRC}/third_party/test_fonts
+# Install node modules for electron
+ ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/yarn-offline-cache ${WRKDIR}
+ ${ECHO_CMD} 'yarn-offline-mirror "../../../yarn-offline-cache"' >> ${WRKSRC}/electron/.yarnrc
+ ${MV} ${WRKSRC}/electron/package.json ${WRKSRC}/electron/package.json.bak
+ ${CP} ${FILESDIR}/package.json ${WRKSRC}/electron
+ cd ${WRKSRC}/electron && \
+ ${SETENV} HOME=${WRKDIR} XDG_CACHE_HOME=${WRKDIR}/.cache yarn --frozen-lockfile --offline
+
+pre-patch:
+ ${SH} ${FILESDIR}/apply-electron-patches.sh ${WRKSRC}
+ # ${FIND} ${WRKSRC} -type f -name '*.orig' -print -delete
+ # ${FIND} ${WRKSRC} -type f -name '*~' -print -delete
+
+pre-configure:
+# We used to remove bundled libraries to be sure that chromium uses
+# system libraries and not shipped ones.
+# cd ${WRKSRC} && ${PYTHON_CMD} \
+#./build/linux/unbundle/remove_bundled_libraries.py [list of preserved]
+ cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
+ ./build/linux/unbundle/replace_gn_files.py --system-libraries \
+ flac fontconfig freetype harfbuzz-ng libdrm libpng libusb \
+ libwebp libxml libxslt openh264 opus snappy || ${FALSE}
+# Chromium uses an unreleased version of FFmpeg, so configure it
+.for brand in Chrome Chromium
+ ${CP} -r \
+ ${WRKSRC}/third_party/ffmpeg/chromium/config/${brand}/linux/ \
+ ${WRKSRC}/third_party/ffmpeg/chromium/config/${brand}/freebsd
+.endfor
+
+do-configure:
+# GN generator bootstrapping and generating ninja files
+ cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} CC=${CC} CXX=${CXX} LD=${CXX} \
+ READELF=${READELF} AR=${AR} NM=${NM} ${PYTHON_CMD} \
+ ./tools/gn/bootstrap/bootstrap.py ${GN_BOOTSTRAP_FLAGS}
+ cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./out/${BUILDTYPE}/gn gen out/${BUILDTYPE} \
+ --args='import("//electron/build/args/${GN_FILE}") ${GN_ARGS}'
+# Setup nodejs dependency
+ ${MKDIR} ${WRKSRC}/third_party/node/freebsd/node-freebsd/bin
+ ${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/freebsd/node-freebsd/bin/node
+# Setup buildtools/freebsd
+ ${MKDIR} ${WRKSRC}/buildtools/freebsd
+ ${LN} -sf ${WRKSRC}/buildtools/linux64/clang-format ${WRKSRC}/buildtools/freebsd
+ ${LN} -sf ${WRKSRC}/out/${BUILDTYPE}/gn ${WRKSRC}/buildtools/freebsd
+ ${LN} -sf /usr/bin/strip ${WRKSRC}/buildtools/freebsd/strip
+
+post-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} ${MAKE_ARGS} ${POST_BUILD_TARGETS}
+
+post-build-DIST-on:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} ${MAKE_ARGS} ${POST_BUILD_DIST_TARGETS}
+ cd ${WRKSRC}/out/${BUILDTYPE} && \
+ ${CP} chromedriver.zip chromedriver-v${ELECTRON_VER}-freebsd-${ARCH:S/amd64/x64/:S/i386/ia32/}.zip && \
+ ${CP} dist.zip electron-v${ELECTRON_VER}-freebsd-${ARCH:S/amd64/x64/:S/i386/ia32/}.zip && \
+ ${CP} mksnapshot.zip mksnapshot-v${ELECTRON_VER}-freebsd-${ARCH:S/amd64/x64/:S/i386/ia32/}.zip && \
+ ${SHA256} -r *-v${ELECTRON_VER}-freebsd-*.zip | ${SED} -e 's/ / */' > SHASUMS256.txt
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+.for f in electron mksnapshot v8_context_snapshot_generator
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
+.endfor
+.for f in libEGL.so libGLESv2.so libffmpeg.so libvk_swiftshader.so
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
+.endfor
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvulkan.so.1 ${STAGEDIR}${DATADIR}/libvulkan.so
+ ${MKDIR} ${STAGEDIR}${DATADIR}/swiftshader
+.for f in libEGL.so libGLESv2.so
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/swiftshader/${f} ${STAGEDIR}${DATADIR}/swiftshader
+.endfor
+.for f in LICENSE LICENSES.chromium.html icudtl.dat snapshot_blob.bin v8_context_snapshot.bin version vk_swiftshader_icd.json
+ ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
+.endfor
+.for f in chrome_100_percent.pak chrome_200_percent.pak resources.pak
+ ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
+.endfor
+ ${MKDIR} ${STAGEDIR}${DATADIR}/locales
+ ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/locales/*.pak ${STAGEDIR}${DATADIR}/locales
+ ${MKDIR} ${STAGEDIR}${DATADIR}/resources
+.for f in default_app.asar
+ ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/resources/${f} ${STAGEDIR}${DATADIR}/resources
+.endfor
+ cd ${WRKSRC}/out/${BUILDTYPE}/gen && ${COPYTREE_SHARE} node_headers ${STAGEDIR}${DATADIR}
+ cd ${WRKSRC}/out/${BUILDTYPE} && ${COPYTREE_SHARE} gen/electron/buildflags ${STAGEDIR}${DATADIR}
+ cd ${WRKSRC}/out/${BUILDTYPE} && ${COPYTREE_SHARE} gen/v8/embedded.S ${STAGEDIR}${DATADIR}
+ ${RLN} ${STAGEDIR}${DATADIR}/electron ${STAGEDIR}${PREFIX}/bin/electron${PKGNAMESUFFIX}
+
+post-install-DIST-on:
+ ${MKDIR} ${STAGEDIR}${DATADIR}/releases
+ ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/SHASUMS256.txt ${STAGEDIR}${DATADIR}/releases
+ ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*-v${ELECTRON_VER}-freebsd-*.zip ${STAGEDIR}${DATADIR}/releases
+
+post-install-DRIVER-on:
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chromedriver.unstripped \
+ ${STAGEDIR}${DATADIR}/chromedriver
+
+do-test:
+# Note 1: "npm install" will run before actual tests are executed
+# Note 2: Xvfb or something similar is necessary for headless testing
+ cd ${WRKSRC}/electron && \
+ ${SETENV} ${TEST_ENV} ELECTRON_OUT_DIR=${BUILDTYPE} LOCAL_GIT_DIRECTORY=${LOCALBASE} \
+ npm run test -- --ci
+
+.include <bsd.port.post.mk>
diff --git a/devel/electron18/Makefile.version b/devel/electron18/Makefile.version
new file mode 100644
index 000000000000..7fedfdb99019
--- /dev/null
+++ b/devel/electron18/Makefile.version
@@ -0,0 +1,2 @@
+ELECTRON_VER= 18.3.4
+ELECTRON_VER_MAJOR= ${ELECTRON_VER:C/\..*//}
diff --git a/devel/electron18/distinfo b/devel/electron18/distinfo
new file mode 100644
index 000000000000..e25516f74a47
--- /dev/null
+++ b/devel/electron18/distinfo
@@ -0,0 +1,21 @@
+TIMESTAMP = 1655444360
+SHA256 (electron/chromium-100.0.4896.160.tar.xz) = a3f755dff069c6fae3eb7f07b33c0dd3f0762fa82959f41c7bd347da8efbacff
+SIZE (electron/chromium-100.0.4896.160.tar.xz) = 1228994280
+SHA256 (electron/aad6877c8cd3cff0ef1ba628d71acc981c520c29) = 9793d0cfb94bf2ff099682dcd31ef46d1d7f42346c8a2f6355a5f8fda3dcd506
+SIZE (electron/aad6877c8cd3cff0ef1ba628d71acc981c520c29) = 12028653
+SHA256 (electron/cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb) = ec973eccd669d417fbf2d0a4dac730744a3174268ff062db5451b55c82bc3492
+SIZE (electron/cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb) = 26759650
+SHA256 (electron/electron-yarn-cache-18.3.4.tar.xz) = 9205dcfef74cc613d31b2704ba8a96eb30544cc19ea13b9eddb8d956e98199fb
+SIZE (electron/electron-yarn-cache-18.3.4.tar.xz) = 38391320
+SHA256 (electron/electron-electron-v18.3.4_GH0.tar.gz) = b730e7c95d21da006265c9bc959116c290715f0db47c2514b453214f5a1fd982
+SIZE (electron/electron-electron-v18.3.4_GH0.tar.gz) = 10209257
+SHA256 (electron/nodejs-node-v16.13.2_GH0.tar.gz) = 93c65be15bfe8151b4a99d529538b23ffc6b5e0202dc7df0e32aa780ab49ad97
+SIZE (electron/nodejs-node-v16.13.2_GH0.tar.gz) = 87972240
+SHA256 (electron/nodejs-nan-65b32af46e9d7fab2e4ff657751205b3865f4920_GH0.tar.gz) = a649b75bfa9c1a0254c73d022c6e98924b9471f593bcc83832daaf68da4cae8d
+SIZE (electron/nodejs-nan-65b32af46e9d7fab2e4ff657751205b3865f4920_GH0.tar.gz) = 178733
+SHA256 (electron/Squirrel-Squirrel.Mac-0e5d146ba13101a1302d59ea6e6e0b3cace4ae38_GH0.tar.gz) = f4ebb40a8d85dbb7ef02aa0571b2f8e22182c6d73b6992484a53c90047779d01
+SIZE (electron/Squirrel-Squirrel.Mac-0e5d146ba13101a1302d59ea6e6e0b3cace4ae38_GH0.tar.gz) = 2112918
+SHA256 (electron/ReactiveCocoa-ReactiveObjC-74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76_GH0.tar.gz) = 88e65f116c7a06fccedb43970fba63080a57a4e5dc29147d2cdfe1ee58dd0546
+SIZE (electron/ReactiveCocoa-ReactiveObjC-74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76_GH0.tar.gz) = 1136238
+SHA256 (electron/Mantle-Mantle-78d3966b3c331292ea29ec38661b25df0a245948_GH0.tar.gz) = a365df6d83e0be3cc000b70bd39734d80c28f0d9983ebe44698337a2ca464bb1
+SIZE (electron/Mantle-Mantle-78d3966b3c331292ea29ec38661b25df0a245948_GH0.tar.gz) = 62962
diff --git a/devel/electron18/files/apply-electron-patches.sh b/devel/electron18/files/apply-electron-patches.sh
new file mode 100644
index 000000000000..9d974b536054
--- /dev/null
+++ b/devel/electron18/files/apply-electron-patches.sh
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+PATH=/bin:/usr/bin:/usr/local/bin
+
+GIT_CMD="git"
+PATCH_CMD="${GIT_CMD} apply"
+#PATCH_FLAGS="--numstat --check" # for debugging
+PATCH_FLAGS="--verbose --reject"
+
+WRKSRC=$1
+PATCH_CONF=${WRKSRC}/electron/patches/config.json
+
+${GIT_CMD} status "${WRKSRC}" > /dev/null 2>&1 && IS_GIT_REPO=1
+
+PATCHD_REPOD_PAIRS=$(sed -e '1d; $d; /^$/d; s/[",]//g; s/: */:/' "${PATCH_CONF}")
+for prp in ${PATCHD_REPOD_PAIRS}; do
+ pd=$(echo "${prp}" | awk -F: '{print $1}' | sed -e 's/src/./')
+ rd=$(echo "${prp}" | awk -F: '{print $2}' | sed -e 's/src/./')
+ (cd "${WRKSRC}/${rd}" && \
+ if [ -n "${IS_GIT_REPO}" ]; then
+ PATCH_FLAGS="${PATCH_FLAGS} --directory=$(${GIT_CMD} rev-parse --show-prefix)"
+ fi && \
+ while read -r p; do
+ ${PATCH_CMD} ${PATCH_FLAGS} "${WRKSRC}/${pd}/${p}"
+ done < "${WRKSRC}/${pd}/.patches")
+done
diff --git a/devel/electron18/files/package.json b/devel/electron18/files/package.json
new file mode 100644
index 000000000000..5ac68a087d05
--- /dev/null
+++ b/devel/electron18/files/package.json
@@ -0,0 +1,144 @@
+{
+ "name": "electron",
+ "version": "18.3.4",
+ "repository": "https://github.com/electron/electron",
+ "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
+ "devDependencies": {
+ "@azure/storage-blob": "^12.9.0",
+ "@electron/docs-parser": "^0.12.3",
+ "@electron/typescript-definitions": "^8.9.5",
+ "@octokit/auth-app": "^2.10.0",
+ "@octokit/rest": "^18.0.3",
+ "@primer/octicons": "^10.0.0",
+ "@types/basic-auth": "^1.1.3",
+ "@types/busboy": "^0.2.3",
+ "@types/chai": "^4.2.12",
+ "@types/chai-as-promised": "^7.1.3",
+ "@types/dirty-chai": "^2.0.2",
+ "@types/express": "^4.17.13",
+ "@types/fs-extra": "^9.0.1",
+ "@types/klaw": "^3.0.1",
+ "@types/minimist": "^1.2.0",
+ "@types/mocha": "^7.0.2",
+ "@types/node": "^16.11.26",
+ "@types/semver": "^7.3.3",
+ "@types/send": "^0.14.5",
+ "@types/split": "^1.0.0",
+ "@types/stream-json": "^1.5.1",
+ "@types/temp": "^0.8.34",
+ "@types/uuid": "^3.4.6",
+ "@types/webpack": "^4.41.21",
+ "@types/webpack-env": "^1.16.3",
+ "@typescript-eslint/eslint-plugin": "^4.4.1",
+ "@typescript-eslint/parser": "^4.4.1",
+ "asar": "^3.1.0",
+ "aws-sdk": "^2.814.0",
+ "check-for-leaks": "^1.2.1",
+ "colors": "1.4.0",
+ "dotenv-safe": "^4.0.4",
+ "dugite": "^1.103.0",
+ "eslint": "^7.4.0",
+ "eslint-config-standard": "^14.1.1",
+ "eslint-plugin-import": "^2.22.0",
+ "eslint-plugin-mocha": "^7.0.1",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-standard": "^4.0.1",
+ "eslint-plugin-typescript": "^0.14.0",
+ "express": "^4.16.4",
+ "folder-hash": "^2.1.1",
+ "fs-extra": "^9.0.1",
+ "got": "^6.3.0",
+ "husky": "^6.0.0",
+ "klaw": "^3.0.0",
+ "lint": "^1.1.2",
+ "lint-staged": "^10.2.11",
+ "markdownlint": "^0.21.1",
+ "markdownlint-cli": "^0.25.0",
+ "minimist": "^1.2.5",
+ "null-loader": "^4.0.0",
+ "pre-flight": "^1.1.0",
+ "remark-cli": "^10.0.0",
+ "remark-preset-lint-markdown-style-guide": "^4.0.0",
+ "semver": "^5.6.0",
+ "shx": "^0.3.2",
+ "standard-markdown": "^6.0.0",
+ "stream-json": "^1.7.1",
+ "tap-xunit": "^2.4.1",
+ "temp": "^0.8.3",
+ "timers-browserify": "1.4.2",
+ "ts-loader": "^8.0.2",
+ "ts-node": "6.2.0",
+ "typescript": "^4.5.5",
+ "webpack": "^4.43.0",
+ "webpack-cli": "^3.3.12",
+ "wrapper-webpack-plugin": "^2.1.0"
+ },
+ "private": true,
+ "scripts": {
+ "asar": "asar",
+ "generate-version-json": "node script/generate-version-json.js",
+ "lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs",
+ "lint:js": "node ./script/lint.js --js",
+ "lint:clang-format": "python3 script/run-clang-format.py -r -c shell/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
+ "lint:clang-tidy": "ts-node ./script/run-clang-tidy.ts",
+ "lint:cpp": "node ./script/lint.js --cc",
+ "lint:objc": "node ./script/lint.js --objc",
+ "lint:py": "node ./script/lint.js --py",
+ "lint:gn": "node ./script/lint.js --gn",
+ "lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-relative-links && npm run lint:markdownlint",
+ "lint:docs-relative-links": "python3 ./script/check-relative-doc-links.py",
+ "lint:markdownlint": "markdownlint \"*.md\" \"docs/**/*.md\"",
+ "lint:js-in-markdown": "standard-markdown docs",
+ "create-api-json": "electron-docs-parser --dir=./",
+ "create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --api=electron-api.json && node spec/ts-smoke/runner.js",
+ "gn-typescript-definitions": "npm run create-typescript-definitions && shx cp electron.d.ts",
+ "pre-flight": "pre-flight",
+ "gn-check": "node ./script/gn-check.js",
+ "precommit": "lint-staged",
+ "preinstall": "node -e 'process.exit(0)'",
+ "prepack": "check-for-leaks",
+ "repl": "node ./script/start.js --interactive",
+ "start": "node ./script/start.js",
+ "test": "node ./script/spec-runner.js",
+ "tsc": "tsc",
+ "webpack": "webpack"
+ },
+ "license": "MIT",
+ "author": "Electron Community",
+ "keywords": [
+ "electron"
+ ],
+ "lint-staged": {
+ "*.{js,ts}": [
+ "node script/lint.js --js --fix --only --"
+ ],
+ "*.{js,ts,d.ts}": [
+ "ts-node script/gen-filenames.ts"
+ ],
+ "*.{cc,mm,c,h}": [
+ "python3 script/run-clang-format.py -r -c --fix"
+ ],
+ "*.md": [
+ "npm run lint:docs"
+ ],
+ "*.{gn,gni}": [
+ "npm run gn-check",
+ "python3 script/run-gn-format.py"
+ ],
+ "*.py": [
+ "node script/lint.js --py --fix --only --"
+ ],
+ "docs/api/**/*.md": [
+ "ts-node script/gen-filenames.ts",
+ "markdownlint --config .markdownlint.autofix.json --fix",
+ "git add filenames.auto.gni"
+ ],
+ "{*.patch,.patches}": [
+ "node script/lint.js --patches --only --",
+ "ts-node script/check-patch-diff.ts"
+ ],
+ "DEPS": [
+ "node script/gen-hunspell-filenames.js"
+ ]
+ }
+}
diff --git a/devel/electron18/files/patch-BUILD.gn b/devel/electron18/files/patch-BUILD.gn
new file mode 100644
index 000000000000..f90dc011c359
--- /dev/null
+++ b/devel/electron18/files/patch-BUILD.gn
@@ -0,0 +1,72 @@
+--- BUILD.gn.orig 2022-05-19 05:17:30 UTC
++++ BUILD.gn
+@@ -53,7 +53,7 @@ declare_args() {
+ root_extra_deps = []
+ }
+
+-if (is_official_build) {
++if (is_official_build && !is_bsd) {
+ # An official (maximally optimized!) component (optimized for build times)
+ # build doesn't make sense and usually doesn't work.
+ assert(!is_component_build)
+@@ -452,7 +452,7 @@ group("gn_all") {
+ ]
+ }
+
+- if (is_linux || is_chromeos || is_android) {
++ if ((is_linux && !is_bsd) || is_chromeos || is_android) {
+ deps += [
+ "//third_party/breakpad:breakpad_unittests",
+ "//third_party/breakpad:core-2-minidump",
+@@ -636,6 +636,15 @@ group("gn_all") {
+ }
+ }
+
++ if (is_bsd) {
++ deps -= [
++ "//third_party/breakpad:dump_syms($host_toolchain)",
++ "//third_party/breakpad:microdump_stackwalk($host_toolchain)",
++ "//third_party/breakpad:minidump_dump($host_toolchain)",
++ "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
++ ]
++ }
++
+ if (is_mac) {
+ deps += [
+ "//third_party/breakpad:crash_inspector",
+@@ -685,7 +694,7 @@ group("gn_all") {
+ host_os == "win") {
+ deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
+ }
+- } else if (!is_android && !is_ios && !is_fuchsia) {
++ } else if (!is_android && !is_ios && !is_fuchsia && !is_bsd) {
+ deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
+ }
+
+@@ -1147,7 +1156,7 @@ if (!is_ios) {
+ data_deps += [ "//content/web_test:web_test_common_mojom_js_data_deps" ]
+ }
+
+- if (!is_win && !is_android) {
++ if (!is_win && !is_android && !is_bsd) {
+ data_deps +=
+ [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
+ }
+@@ -1156,7 +1165,7 @@ if (!is_ios) {
+ data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux && !is_bsd) || is_chromeos) {
+ data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
+ }
+
+@@ -1535,7 +1544,7 @@ group("chromium_builder_perf") {
+
+ if (is_win) {
+ data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]
+- } else {
++ } else if (!is_bsd) {
+ data_deps +=
+ [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
+ }
diff --git a/devel/electron18/files/patch-apps_ui_views_app__window__frame__view.cc b/devel/electron18/files/patch-apps_ui_views_app__window__frame__view.cc
new file mode 100644
index 000000000000..3b9f08d38995
--- /dev/null
+++ b/devel/electron18/files/patch-apps_ui_views_app__window__frame__view.cc
@@ -0,0 +1,11 @@
+--- apps/ui/views/app_window_frame_view.cc.orig 2022-05-19 05:17:31 UTC
++++ apps/ui/views/app_window_frame_view.cc
+@@ -138,7 +138,7 @@ gfx::Rect AppWindowFrameView::GetWindowBoundsForClient
+ gfx::Rect window_bounds = client_bounds;
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if 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/devel/electron18/files/patch-ash_display_mirror__window__controller.cc b/devel/electron18/files/patch-ash_display_mirror__window__controller.cc
new file mode 100644
index 000000000000..6c3ae5023688
--- /dev/null
+++ b/devel/electron18/files/patch-ash_display_mirror__window__controller.cc
@@ -0,0 +1,14 @@
+--- ash/display/mirror_window_controller.cc.orig 2022-05-19 05:17:32 UTC
++++ ash/display/mirror_window_controller.cc
+@@ -296,7 +296,11 @@ void MirrorWindowController::UpdateWindow(
+ return info.id() == iter->first;
+ }) == display_info_list.end()) {
+ CloseAndDeleteHost(iter->second, true);
++#if defined(__llvm__)
++ mirroring_host_info_map_.erase(iter++);
++#else
+ iter = mirroring_host_info_map_.erase(iter);
++#endif
+ } else {
+ ++iter;
+ }
diff --git a/devel/electron18/files/patch-base_BUILD.gn b/devel/electron18/files/patch-base_BUILD.gn
new file mode 100644
index 000000000000..49d12ea44ebc
--- /dev/null
+++ b/devel/electron18/files/patch-base_BUILD.gn
@@ -0,0 +1,146 @@
+--- base/BUILD.gn.orig 2022-05-19 05:17:33 UTC
++++ base/BUILD.gn
+@@ -999,7 +999,7 @@ mixed_component("base") {
+ "timer/hi_res_timer_manager_posix.cc",
+ ]
+
+- if (!is_nacl && !is_apple) {
++ if (!is_nacl && !is_apple && !is_bsd) {
+ sources += [
+ "cpu_affinity_posix.cc",
+ "cpu_affinity_posix.h",
+@@ -1010,6 +1010,12 @@ mixed_component("base") {
+ "profiler/thread_delegate_posix.h",
+ ]
+ }
++
++ if (is_bsd) {
++ sources += [
++ "profiler/stack_sampler_posix.cc",
++ ]
++ }
+ }
+
+ if (is_win) {
+@@ -1478,11 +1484,23 @@ mixed_component("base") {
+ # building inside the cros_sdk environment - use host_toolchain as a
+ # more robust check for this.
+ if (!use_sysroot &&
+- (is_android || ((is_linux || is_chromeos) && !is_chromecast)) &&
++ (is_android || ((is_linux || is_chromeos) && !is_chromecast && !is_bsd)) &&
+ host_toolchain != "//build/toolchain/cros:host") {
+ libs += [ "atomic" ]
+ }
+
++ # *BSD needs libkvm
++ if (is_bsd) {
++ libs += [ "kvm" ]
++ }
++
++ if (is_freebsd) {
++ libs += [
++ "execinfo",
++ "util",
++ ]
++ }
++
+ if (use_allocator_shim) {
+ sources += [
+ "allocator/allocator_shim.cc",
+@@ -1506,7 +1524,7 @@ mixed_component("base") {
+ ]
+ configs += [ "//base/allocator:mac_no_default_new_delete_symbols" ]
+ }
+- if (is_chromeos || is_linux) {
++ if (is_chromeos || (is_linux && !is_bsd)) {
+ sources += [
+ "allocator/allocator_shim_override_cpp_symbols.h",
+ "allocator/allocator_shim_override_glibc_weak_symbols.h",
+@@ -1563,7 +1581,7 @@ mixed_component("base") {
+ # Allow more direct string conversions on platforms with native utf8
+ # strings
+ # TODO(crbug/1052397): Consider replacing is_ash with is_chromeos once lacros switches to target_os=chromeos
+- if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia) {
++ if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia || is_bsd) {
+ defines += [ "SYSTEM_NATIVE_UTF8" ]
+ }
+
+@@ -2243,6 +2261,42 @@ mixed_component("base") {
+ }
+ }
+
++ if (is_bsd) {
++ sources -= [
++ "files/file_path_watcher_linux.cc",
++ "files/file_util_linux.cc",
++ "files/scoped_file_linux.cc",
++ "process/memory_linux.cc",
++ "process/process_linux.cc",
++ "system/sys_info_linux.cc",
++ "process/process_iterator_linux.cc",
++ "process/process_metrics_linux.cc",
++ "process/process_handle_linux.cc"
++ ]
++ sources += [
++ "process/memory_stubs.cc",
++ "files/file_path_watcher_kqueue.cc",
++ "files/file_path_watcher_kqueue.h",
++ "files/file_path_watcher_bsd.cc",
++ ]
++ }
++
++ if (is_openbsd) {
++ sources += [
++ "process/process_handle_openbsd.cc",
++ "process/process_iterator_openbsd.cc",
++ "process/process_metrics_openbsd.cc",
++ "system/sys_info_openbsd.cc",
++ ]
++ } else if (is_freebsd) {
++ sources += [
++ "process/process_handle_freebsd.cc",
++ "process/process_iterator_freebsd.cc",
++ "process/process_metrics_freebsd.cc",
++ "system/sys_info_freebsd.cc",
++ ]
++ }
++
+ # iOS
+ if (is_ios) {
+ sources -= [
+@@ -3495,7 +3549,7 @@ test("base_unittests") {
+ }
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "debug/proc_maps_linux_unittest.cc",
+ "files/scoped_file_linux_unittest.cc",
+@@ -3543,7 +3597,7 @@ test("base_unittests") {
+ "posix/unix_domain_socket_unittest.cc",
+ "task/thread_pool/task_tracker_posix_unittest.cc",
+ ]
+- if (!is_nacl && !is_apple) {
++ if (!is_nacl && !is_apple && !is_bsd) {
+ sources += [
+ "cpu_affinity_posix_unittest.cc",
+ "profiler/stack_copier_signal_unittest.cc",
+@@ -3555,7 +3609,7 @@ test("base_unittests") {
+ # Allow more direct string conversions on platforms with native utf8
+ # strings
+ # TODO(crbug/1052397): Consider replacing is_ash with is_chromeos once lacros switches to target_os=chromeos
+- if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia) {
++ if (is_apple || is_chromeos_ash || is_chromecast || is_fuchsia || is_bsd) {
+ defines += [ "SYSTEM_NATIVE_UTF8" ]
+ }
+
+@@ -3724,7 +3778,7 @@ test("base_unittests") {
+ }
+ }
+
+- if (is_fuchsia || is_linux || is_chromeos) {
++ if ((is_fuchsia || is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "debug/elf_reader_unittest.cc",
+ "debug/test_elf_image_builder.cc",
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_address__space__randomization.h b/devel/electron18/files/patch-base_allocator_partition__allocator_address__space__randomization.h
new file mode 100644
index 000000000000..945bce175511
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_address__space__randomization.h
@@ -0,0 +1,11 @@
+--- base/allocator/partition_allocator/address_space_randomization.h.orig 2022-05-19 05:17:34 UTC
++++ base/allocator/partition_allocator/address_space_randomization.h
+@@ -38,7 +38,7 @@ AslrMask(uintptr_t bits) {
+
+ #if defined(ARCH_CPU_64_BITS)
+
+- #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
++ #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && !defined(OS_BSD)
+
+ // We shouldn't allocate system pages at all for sanitizer builds. However,
+ // we do, and if random hint addresses interfere with address ranges
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator.h b/devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator.h
new file mode 100644
index 000000000000..d5e61163bbcf
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator.h
@@ -0,0 +1,11 @@
+--- base/allocator/partition_allocator/page_allocator.h.orig 2022-05-19 03:45:15 UTC
++++ base/allocator/partition_allocator/page_allocator.h
+@@ -194,7 +194,7 @@ BASE_EXPORT void DecommitAndZeroSystemPages(void* addr
+ // Whether decommitted memory is guaranteed to be zeroed when it is
+ // recommitted. Do not assume that this will not change over time.
+ constexpr BASE_EXPORT bool DecommittedMemoryIsAlwaysZeroed() {
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ return false;
+ #else
+ return true;
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h b/devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h
new file mode 100644
index 000000000000..250dde5c8aaa
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_page__allocator__internals__posix.h
@@ -0,0 +1,16 @@
+--- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2022-05-19 05:17:34 UTC
++++ base/allocator/partition_allocator/page_allocator_internals_posix.h
+@@ -352,8 +352,12 @@ bool TryRecommitSystemPagesInternal(
+
+ void DiscardSystemPagesInternal(uintptr_t address, size_t length) {
+ void* ptr = reinterpret_cast<void*>(address);
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
++#if BUILDFLAG(IS_BSD)
++ int ret = madvise(ptr, length, MADV_FREE);
++#else
+ int ret = madvise(ptr, length, MADV_FREE_REUSABLE);
++#endif
+ if (ret) {
+ // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED.
+ ret = madvise(ptr, length, MADV_DONTNEED);
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc.cc b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc.cc
new file mode 100644
index 000000000000..bd01c9abe568
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc.cc
@@ -0,0 +1,15 @@
+--- base/allocator/partition_allocator/partition_alloc.cc.orig 2022-05-11 07:16:46 UTC
++++ base/allocator/partition_allocator/partition_alloc.cc
+@@ -56,7 +56,12 @@ void PartitionAllocGlobalInit(OomFunction on_out_of_me
+ "maximum direct mapped allocation");
+
+ // Check that some of our zanier calculations worked out as expected.
++#if defined(__i386__) && defined(OS_FREEBSD)
++ // alignof(std::max_align_t) is only 4 on FreeBSD/i386
++ static_assert(kSmallestBucket >= kAlignment, "generic smallest bucket");
++#else
+ static_assert(kSmallestBucket == kAlignment, "generic smallest bucket");
++#endif
+ static_assert(kMaxBucketed == 917504, "generic max bucketed");
+ STATIC_ASSERT_OR_PA_CHECK(
+ MaxSystemPagesPerRegularSlotSpan() <= 16,
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc__config.h b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc__config.h
new file mode 100644
index 000000000000..3d27f7357db5
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__alloc__config.h
@@ -0,0 +1,20 @@
+--- base/allocator/partition_allocator/partition_alloc_config.h.orig 2022-05-19 05:17:34 UTC
++++ base/allocator/partition_allocator/partition_alloc_config.h
+@@ -59,7 +59,7 @@ static_assert(sizeof(void*) != 8, "");
+
+ // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific
+ // features such as futex(2).
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #define PA_HAS_LINUX_KERNEL
+ #endif
+
+@@ -179,7 +179,7 @@ constexpr bool kUseLazyCommit = false;
+
+ // On these platforms, lock all the partitions before fork(), and unlock after.
+ // This may be required on more platforms in the future.
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #define PA_HAS_ATFORK_HANDLER
+ #endif
+
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_partition__page.h b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__page.h
new file mode 100644
index 000000000000..5305b3a936ae
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__page.h
@@ -0,0 +1,22 @@
+--- base/allocator/partition_allocator/partition_page.h.orig 2022-06-04 07:17:41 UTC
++++ base/allocator/partition_allocator/partition_page.h
+@@ -128,7 +128,8 @@ struct __attribute__((packed)) SlotSpanMetadata {
+ PartitionBucket<thread_safe>* const bucket = nullptr;
+
+ // CHECK()ed in AllocNewSlotSpan().
+-#if defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)
++#if (defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)) || \
++ (BUILDFLAG(IS_FREEBSD) && defined(__i386__))
+ // System page size is not a constant on Apple OSes, but is either 4 or 16kiB
+ // (1 << 12 or 1 << 14), as checked in PartitionRoot::Init(). And
+ // PartitionPageSize() is 4 times the OS page size.
+@@ -148,7 +149,9 @@ struct __attribute__((packed)) SlotSpanMetadata {
+ #endif // defined(PA_HAS_64_BITS_POINTERS) && BUILDFLAG(IS_APPLE)
+ // The maximum number of bits needed to cover all currently supported OSes.
+ static constexpr size_t kMaxSlotsPerSlotSpanBits = 13;
++#if !BUILDFLAG(IS_FREEBSD) && defined(__i386__)
+ static_assert(kMaxSlotsPerSlotSpan < (1 << kMaxSlotsPerSlotSpanBits), "");
++#endif
+
+ // |marked_full| isn't equivalent to being full. Slot span is marked as full
+ // iff it isn't on the active slot span list (or any other list).
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_partition__root.h b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__root.h
new file mode 100644
index 000000000000..52f218e18d4e
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_partition__root.h
@@ -0,0 +1,11 @@
+--- base/allocator/partition_allocator/partition_root.h.orig 2022-05-19 05:17:34 UTC
++++ base/allocator/partition_allocator/partition_root.h
+@@ -1071,7 +1071,7 @@ ALWAYS_INLINE void PartitionRoot<thread_safe>::FreeNoH
+ // essentially).
+ #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
+ ((BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMECAST)) || \
+- (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_64_BITS)))
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_64_BITS)))
+ PA_CHECK(IsManagedByPartitionAlloc(object_addr));
+ #endif
+
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_spinning__mutex.cc b/devel/electron18/files/patch-base_allocator_partition__allocator_spinning__mutex.cc
new file mode 100644
index 000000000000..52ae50accf4a
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_spinning__mutex.cc
@@ -0,0 +1,47 @@
+--- base/allocator/partition_allocator/spinning_mutex.cc.orig 2022-05-19 05:17:34 UTC
++++ base/allocator/partition_allocator/spinning_mutex.cc
+@@ -17,7 +17,15 @@
+
+ #if defined(PA_HAS_LINUX_KERNEL)
+ #include <errno.h>
++#if defined(OS_OPENBSD)
++#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>
+ #endif // defined(PA_HAS_LINUX_KERNEL)
+@@ -85,8 +93,13 @@ void SpinningMutex::FutexWait() {
+ // |kLockedContended| anymore. Note that even without spurious wakeups, the
+ // value of |state_| is not guaranteed when this returns, as another thread
+ // may get the lock before we get to run.
++#if defined(OS_FREEBSD)
++ int err = _umtx_op(&state_, UMTX_OP_WAIT_UINT_PRIVATE,
++ kLockedContended, nullptr, nullptr);
++#else
+ int err = syscall(SYS_futex, &state_, FUTEX_WAIT | FUTEX_PRIVATE_FLAG,
+ kLockedContended, nullptr, nullptr, 0);
++#endif
+
+ if (err) {
+ // These are programming error, check them.
+@@ -98,8 +111,14 @@ void SpinningMutex::FutexWait() {
+
+ void SpinningMutex::FutexWake() {
+ int saved_errno = errno;
++#if defined(OS_FREEBSD)
++ long retval = _umtx_op(&state_, UMTX_OP_WAKE_PRIVATE,
++ 1 /* wake up a single waiter */, nullptr, nullptr);
++#else
+ long retval = syscall(SYS_futex, &state_, FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
+ 1 /* wake up a single waiter */, nullptr, nullptr, 0);
++#endif
++
+ PA_CHECK(retval != -1);
+ errno = saved_errno;
+ }
diff --git a/devel/electron18/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc b/devel/electron18/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc
new file mode 100644
index 000000000000..33e2d4d8f2ca
--- /dev/null
+++ b/devel/electron18/files/patch-base_allocator_partition__allocator_starscan_stack_stack.cc
@@ -0,0 +1,50 @@
+--- base/allocator/partition_allocator/starscan/stack/stack.cc.orig 2022-05-19 05:17:34 UTC
++++ base/allocator/partition_allocator/starscan/stack/stack.cc
+@@ -17,6 +17,10 @@
+ #include <pthread.h>
+ #endif
+
++#if defined(OS_BSD)
++#include <pthread_np.h>
++#endif
++
+ #if defined(LIBC_GLIBC)
+ extern "C" void* __libc_stack_end;
+ #endif
+@@ -48,6 +52,36 @@ void* GetStackTop() {
+
+ void* GetStackTop() {
+ return pthread_get_stackaddr_np(pthread_self());
++}
++
++#elif defined(OS_OPENBSD)
++
++void* GetStackTop() {
++ stack_t ss;
++ if (pthread_stackseg_np(pthread_self(), &ss) != 0)
++ return nullptr;
++ return reinterpret_cast<uint8_t*>(ss.ss_sp);
++}
++
++#elif defined(OS_FREEBSD)
++
++void* GetStackTop() {
++ pthread_attr_t attr;
++ int error = pthread_attr_init(&attr);
++ if (error) {
++ return nullptr;
++ }
++ error = pthread_attr_get_np(pthread_self(), &attr);
++ if (!error) {
++ void* base;
++ size_t size;
++ error = pthread_attr_getstack(&attr, &base, &size);
++ PA_CHECK(!error);
++ pthread_attr_destroy(&attr);
++ return reinterpret_cast<uint8_t*>(base) + size;
++ }
++ pthread_attr_destroy(&attr);
++ return nullptr;
+ }
+
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
diff --git a/devel/electron18/files/patch-base_atomicops.h b/devel/electron18/files/patch-base_atomicops.h
new file mode 100644
index 000000000000..13798b80a082
--- /dev/null
+++ b/devel/electron18/files/patch-base_atomicops.h
@@ -0,0 +1,14 @@
+--- base/atomicops.h.orig 2022-05-11 07:16:46 UTC
++++ base/atomicops.h
+@@ -57,7 +57,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/devel/electron18/files/patch-base_base__paths__posix.cc b/devel/electron18/files/patch-base_base__paths__posix.cc
new file mode 100644
index 000000000000..5350fe5b7c71
--- /dev/null
+++ b/devel/electron18/files/patch-base_base__paths__posix.cc
@@ -0,0 +1,98 @@
+--- base/base_paths_posix.cc.orig 2022-05-19 03:45:15 UTC
++++ 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"
+@@ -25,9 +26,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
+@@ -68,13 +73,65 @@ bool PathProviderPosix(int key, FilePath* result) {
+ *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, 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("/usr/local/chrome/chrome");
++ return true;
++#if !BUILDFLAG(IS_AIX)
++ }
++ return ret;
++#endif
+ #endif
+ }
+ case DIR_SRC_TEST_DATA_ROOT: {
diff --git a/devel/electron18/files/patch-base_base__switches.cc b/devel/electron18/files/patch-base_base__switches.cc
new file mode 100644
index 000000000000..73802d3ad5ff
--- /dev/null
+++ b/devel/electron18/files/patch-base_base__switches.cc
@@ -0,0 +1,11 @@
+--- base/base_switches.cc.orig 2022-05-19 05:17:34 UTC
++++ base/base_switches.cc
+@@ -170,7 +170,7 @@ const char kForceFieldTrialParams[] = "force-fieldtria
+
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Controls whether or not retired instruction counts are surfaced for threads
+ // in trace events on Linux.
+ //
diff --git a/devel/electron18/files/patch-base_base__switches.h b/devel/electron18/files/patch-base_base__switches.h
new file mode 100644
index 000000000000..7fefb3d8cc7e
--- /dev/null
+++ b/devel/electron18/files/patch-base_base__switches.h
@@ -0,0 +1,11 @@
+--- base/base_switches.h.orig 2022-05-19 05:17:34 UTC
++++ base/base_switches.h
+@@ -60,7 +60,7 @@ extern const char kEnableIdleTracing[];
+ extern const char kForceFieldTrialParams[];
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ extern const char kEnableThreadInstructionCount[];
+
+ // TODO(crbug.com/1176772): Remove kEnableCrashpad and IsCrashpadEnabled() when
diff --git a/devel/electron18/files/patch-base_cpu.h b/devel/electron18/files/patch-base_cpu.h
new file mode 100644
index 000000000000..5b0b92ce499a
--- /dev/null
+++ b/devel/electron18/files/patch-base_cpu.h
@@ -0,0 +1,11 @@
+--- base/cpu.h.orig 2022-05-19 03:45:15 UTC
++++ base/cpu.h
+@@ -108,7 +108,7 @@ class BASE_EXPORT CPU final {
+ const std::string& cpu_brand() const { return cpu_brand_; }
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ enum class CoreType {
+ kUnknown = 0,
+ kOther,
diff --git a/devel/electron18/files/patch-base_debug_debugger__posix.cc b/devel/electron18/files/patch-base_debug_debugger__posix.cc
new file mode 100644
index 000000000000..061647515d35
--- /dev/null
+++ b/devel/electron18/files/patch-base_debug_debugger__posix.cc
@@ -0,0 +1,68 @@
+--- base/debug/debugger_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/debug/debugger_posix.cc
+@@ -36,6 +36,10 @@
+ #include <sys/sysctl.h>
+ #endif
+
++#if BUILDFLAG(IS_OPENBSD)
++#include <sys/proc.h>
++#endif
++
+ #if BUILDFLAG(IS_FREEBSD)
+ #include <sys/user.h>
+ #endif
+@@ -96,32 +100,51 @@ bool BeingDebugged() {
+
+ // Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and
+ // binary interfaces may change.
++#if BUILDFLAG(IS_OPENBSD)
++ struct kinfo_proc *info;
++ size_t info_size;
++#else
+ struct kinfo_proc info;
+ size_t info_size = sizeof(info);
++#endif
+
+ #if BUILDFLAG(IS_OPENBSD)
+ if (sysctl(mib, base::size(mib), NULL, &info_size, NULL, 0) < 0)
+ return -1;
+
+ mib[5] = (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, base::size(mib), info, &info_size, NULL, 0);
+ #endif
+
++#if !BUILDFLAG(IS_OPENBSD)
+ int sysctl_result = sysctl(mib, base::size(mib), &info, &info_size, NULL, 0);
++#endif
+ DCHECK_EQ(sysctl_result, 0);
+ if (sysctl_result != 0) {
+ is_set = true;
+ being_debugged = false;
+- return being_debugged;
++ goto out;
+ }
+
+ // This process is being debugged if the P_TRACED flag is set.
+ is_set = true;
+ #if BUILDFLAG(IS_FREEBSD)
+ being_debugged = (info.ki_flag & P_TRACED) != 0;
+-#elif BUILDFLAG(IS_BSD)
+- being_debugged = (info.p_flag & P_TRACED) != 0;
++#elif BUILDFLAG(IS_OPENBSD)
++ being_debugged = (info->p_psflags & PS_TRACED) != 0;
+ #else
+ being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
++#endif
++
++out:
++#if BUILDFLAG(IS_OPENBSD)
++ free(info);
+ #endif
+ return being_debugged;
+ }
diff --git a/devel/electron18/files/patch-base_debug_elf__reader.cc b/devel/electron18/files/patch-base_debug_elf__reader.cc
new file mode 100644
index 000000000000..caa6dce3467f
--- /dev/null
+++ b/devel/electron18/files/patch-base_debug_elf__reader.cc
@@ -0,0 +1,18 @@
+--- base/debug/elf_reader.cc.orig 2022-05-11 07:16:46 UTC
++++ base/debug/elf_reader.cc
+@@ -76,6 +76,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
+ bool found = false;
+ while (current_section < section_end) {
+ current_note = reinterpret_cast<const Nhdr*>(current_section);
++#if !defined(OS_BSD)
+ if (current_note->n_type == NT_GNU_BUILD_ID) {
+ StringPiece note_name(current_section + sizeof(Nhdr),
+ current_note->n_namesz);
+@@ -85,6 +86,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
+ break;
+ }
+ }
++#endif
+
+ size_t section_size = bits::AlignUp(current_note->n_namesz, 4) +
+ bits::AlignUp(current_note->n_descsz, 4) +
diff --git a/devel/electron18/files/patch-base_debug_proc__maps__linux.cc b/devel/electron18/files/patch-base_debug_proc__maps__linux.cc
new file mode 100644
index 000000000000..56b247264003
--- /dev/null
+++ b/devel/electron18/files/patch-base_debug_proc__maps__linux.cc
@@ -0,0 +1,11 @@
+--- base/debug/proc_maps_linux.cc.orig 2022-05-19 03:45:15 UTC
++++ base/debug/proc_maps_linux.cc
+@@ -13,7 +13,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/devel/electron18/files/patch-base_debug_stack__trace__posix.cc b/devel/electron18/files/patch-base_debug_stack__trace__posix.cc
new file mode 100644
index 000000000000..d3243a235b3f
--- /dev/null
+++ b/devel/electron18/files/patch-base_debug_stack__trace__posix.cc
@@ -0,0 +1,38 @@
+--- base/debug/stack_trace_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/debug/stack_trace_posix.cc
+@@ -38,7 +38,7 @@
+ #include <AvailabilityMacros.h>
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/debug/proc_maps_linux.h"
+ #endif
+
+@@ -695,6 +695,9 @@ class SandboxSymbolizeHelper {
+ // for the modules that are loaded in the current process.
+ // Returns true on success.
+ bool CacheMemoryRegions() {
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ // Reads /proc/self/maps.
+ std::string contents;
+ if (!ReadProcMaps(&contents)) {
+@@ -712,6 +715,7 @@ class SandboxSymbolizeHelper {
+
+ is_initialized_ = true;
+ return true;
++#endif
+ }
+
+ // Opens all object files and caches their file descriptors.
+@@ -868,7 +872,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // If we do not have unwind tables, then try tracing using frame pointers.
+ return base::debug::TraceStackFramePointers(const_cast<const void**>(trace),
+ count, 0);
+-#elif !defined(__UCLIBC__) && !defined(_AIX)
++#elif !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
diff --git a/devel/electron18/files/patch-base_files_file__path__watcher__bsd.cc b/devel/electron18/files/patch-base_files_file__path__watcher__bsd.cc
new file mode 100644
index 000000000000..a99ff700edff
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_file__path__watcher__bsd.cc
@@ -0,0 +1,57 @@
+--- base/files/file_path_watcher_bsd.cc.orig 2022-05-13 07:20:04 UTC
++++ 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() {
++ sequence_checker_.DetachFromSequence();
++ impl_ = std::make_unique<FilePathWatcherImpl>();
++}
++
++} // namespace base
diff --git a/devel/electron18/files/patch-base_files_file__path__watcher__kqueue.h b/devel/electron18/files/patch-base_files_file__path__watcher__kqueue.h
new file mode 100644
index 000000000000..408ab1ec7ca2
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_file__path__watcher__kqueue.h
@@ -0,0 +1,10 @@
+--- base/files/file_path_watcher_kqueue.h.orig 2022-05-11 07:00:27 UTC
++++ 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/devel/electron18/files/patch-base_files_file__path__watcher__unittest.cc b/devel/electron18/files/patch-base_files_file__path__watcher__unittest.cc
new file mode 100644
index 000000000000..36f54bff410f
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_file__path__watcher__unittest.cc
@@ -0,0 +1,29 @@
+--- base/files/file_path_watcher_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/files/file_path_watcher_unittest.cc
+@@ -450,7 +450,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) {
+ VLOG(1) << "Waiting for file1 creation";
+ ASSERT_TRUE(WaitForEvents());
+
+-#if !BUILDFLAG(IS_APPLE)
++#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ // Mac implementation does not detect files modified in a directory.
+ ASSERT_TRUE(WriteFile(file1, "content v2"));
+ VLOG(1) << "Waiting for file1 modification";
+@@ -1038,7 +1038,7 @@ enum Permission {
+ Execute
+ };
+
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ bool ChangeFilePermissions(const FilePath& path, Permission perm, bool allow) {
+ struct stat stat_buf;
+
+@@ -1069,7 +1069,7 @@ bool ChangeFilePermissions(const FilePath& path, Permi
+ }
+ #endif // BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // Linux implementation of FilePathWatcher doesn't catch attribute changes.
+ // http://crbug.com/78043
+ // Windows implementation of FilePathWatcher catches attribute changes that
diff --git a/devel/electron18/files/patch-base_files_file__util__posix.cc b/devel/electron18/files/patch-base_files_file__util__posix.cc
new file mode 100644
index 000000000000..b097b4efd8d1
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_file__util__posix.cc
@@ -0,0 +1,52 @@
+--- base/files/file_util_posix.cc.orig 2022-05-11 07:16:46 UTC
++++ base/files/file_util_posix.cc
+@@ -694,32 +694,34 @@ bool CreateDirectoryAndGetError(const FilePath& full_p
+ File::Error* error) {
+ ScopedBlockingCall scoped_blocking_call(
+ FROM_HERE, BlockingType::MAY_BLOCK); // For call to mkdir().
++ const FilePath kFileSystemRoot("/");
+ std::vector<FilePath> subpaths;
+
+ // Collect a list of all parent directories.
+ FilePath last_path = full_path;
+- subpaths.push_back(full_path);
++ if (full_path != kFileSystemRoot)
++ subpaths.push_back(full_path);
+ for (FilePath path = full_path.DirName();
+- path.value() != last_path.value(); path = path.DirName()) {
++ (path.value() != last_path.value() &&
++ (path != kFileSystemRoot)); path = path.DirName()) {
+ subpaths.push_back(path);
+ last_path = path;
+ }
+
+ // Iterate through the parents and create the missing ones.
+ for (auto i = subpaths.rbegin(); i != subpaths.rend(); ++i) {
+- if (DirectoryExists(*i))
+- continue;
+- if (mkdir(i->value().c_str(), 0700) == 0)
+- continue;
+- // Mkdir failed, but it might have failed with EEXIST, or some other error
+- // due to the directory appearing out of thin air. This can occur if
+- // two processes are trying to create the same file system tree at the same
+- // time. Check to see if it exists and make sure it is a directory.
+- int saved_errno = errno;
+- if (!DirectoryExists(*i)) {
+- if (error)
+- *error = File::OSErrorToFileError(saved_errno);
+- return false;
++ if (!PathExists(*i)) {
++ if ((mkdir(i->value().c_str(), 0700) == -1) &&
++ ((full_path != *i) ? (errno != ENOENT) : (-1))) {
++ int saved_errno = errno;
++ if (error)
++ *error = File::OSErrorToFileError(saved_errno);
++ return false;
++ }
++ } else if (!DirectoryExists(*i)) {
++ if (error)
++ *error = File::OSErrorToFileError(ENOTDIR);
++ return false;
+ }
+ }
+ return true;
diff --git a/devel/electron18/files/patch-base_files_file__util__unittest.cc b/devel/electron18/files/patch-base_files_file__util__unittest.cc
new file mode 100644
index 000000000000..41b4c3fb83a7
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_file__util__unittest.cc
@@ -0,0 +1,20 @@
+--- base/files/file_util_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/files/file_util_unittest.cc
+@@ -3524,7 +3524,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) {
+ }
+ #endif // BUILDFLAG(IS_WIN)
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
+ TEST_F(FileUtilTest, ReadFileToStringWithProcFileSystem) {
+ FilePath file_path("/proc/cpuinfo");
+ std::string data = "temp";
+@@ -4240,7 +4240,7 @@ TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles
+ NULL);
+ #else
+ size_t bytes_written =
+- ::write(::fileno(output_file.get()), content.c_str(), content.length());
++ ::write(fileno(output_file.get()), content.c_str(), content.length());
+ #endif
+ EXPECT_EQ(content.length(), bytes_written);
+ ::fflush(output_file.get());
diff --git a/devel/electron18/files/patch-base_files_important__file__writer__cleaner.cc b/devel/electron18/files/patch-base_files_important__file__writer__cleaner.cc
new file mode 100644
index 000000000000..a016ca55351c
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_important__file__writer__cleaner.cc
@@ -0,0 +1,12 @@
+--- base/files/important_file_writer_cleaner.cc.orig 2022-05-19 03:45:15 UTC
++++ 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/devel/electron18/files/patch-base_files_scoped__file.cc b/devel/electron18/files/patch-base_files_scoped__file.cc
new file mode 100644
index 000000000000..32e4f92e0351
--- /dev/null
+++ b/devel/electron18/files/patch-base_files_scoped__file.cc
@@ -0,0 +1,11 @@
+--- base/files/scoped_file.cc.orig 2022-05-19 03:45:15 UTC
++++ base/files/scoped_file.cc
+@@ -31,7 +31,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/devel/electron18/files/patch-base_i18n_icu__util.cc b/devel/electron18/files/patch-base_i18n_icu__util.cc
new file mode 100644
index 000000000000..39a39b676795
--- /dev/null
+++ b/devel/electron18/files/patch-base_i18n_icu__util.cc
@@ -0,0 +1,20 @@
+--- base/i18n/icu_util.cc.orig 2022-05-19 05:17:34 UTC
++++ base/i18n/icu_util.cc
+@@ -52,7 +52,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
+- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ !BUILDFLAG(IS_CHROMECAST))
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+ #endif
+@@ -346,7 +346,7 @@ void InitializeIcuTimeZone() {
+ FuchsiaIntlProfileWatcher::GetPrimaryTimeZoneIdForIcuInitialization();
+ icu::TimeZone::adoptDefault(
+ icu::TimeZone::createTimeZone(icu::UnicodeString::fromUTF8(zone_id)));
+-#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ !BUILDFLAG(IS_CHROMECAST)
+ // To respond to the time zone change properly, the default time zone
+ // cache in ICU has to be populated on starting up.
diff --git a/devel/electron18/files/patch-base_linux__util.cc b/devel/electron18/files/patch-base_linux__util.cc
new file mode 100644
index 000000000000..ab6564a58b95
--- /dev/null
+++ b/devel/electron18/files/patch-base_linux__util.cc
@@ -0,0 +1,28 @@
+--- base/linux_util.cc.orig 2022-05-11 07:16:46 UTC
++++ base/linux_util.cc
+@@ -15,6 +15,7 @@
+
+ #include <iomanip>
+ #include <memory>
++#include <sstream>
+
+ #include "base/files/dir_reader_posix.h"
+ #include "base/files/file_util.h"
+@@ -134,6 +135,9 @@ void SetLinuxDistro(const std::string& distro) {
+ }
+
+ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t>* tids) {
++#if defined(OS_BSD)
++ return false;
++#else
+ // 25 > strlen("/proc//task") + strlen(std::to_string(INT_MAX)) + 1 = 22
+ char buf[25];
+ strings::SafeSPrintf(buf, "/proc/%d/task", pid);
+@@ -153,6 +157,7 @@ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t
+ }
+
+ return true;
++#endif
+ }
+
+ pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data,
diff --git a/devel/electron18/files/patch-base_logging__unittest.cc b/devel/electron18/files/patch-base_logging__unittest.cc
new file mode 100644
index 000000000000..c6bbea585928
--- /dev/null
+++ b/devel/electron18/files/patch-base_logging__unittest.cc
@@ -0,0 +1,31 @@
+--- base/logging_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/logging_unittest.cc
+@@ -32,7 +32,7 @@
+ #include "base/posix/eintr_wrapper.h"
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD)
+ #include <ucontext.h>
+ #endif
+
+@@ -552,14 +552,18 @@ void CheckCrashTestSighandler(int, siginfo_t* info, vo
+ // need the arch-specific boilerplate below, which is inspired by breakpad.
+ // At the same time, on OSX, ucontext.h is deprecated but si_addr works fine.
+ uintptr_t crash_addr = 0;
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FREEBSD)
+ crash_addr = reinterpret_cast<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/devel/electron18/files/patch-base_memory_discardable__memory.cc b/devel/electron18/files/patch-base_memory_discardable__memory.cc
new file mode 100644
index 000000000000..d20eb38f6056
--- /dev/null
+++ b/devel/electron18/files/patch-base_memory_discardable__memory.cc
@@ -0,0 +1,38 @@
+--- base/memory/discardable_memory.cc.orig 2022-05-19 05:17:34 UTC
++++ base/memory/discardable_memory.cc
+@@ -24,7 +24,7 @@ const base::Feature kMadvFreeDiscardableMemory{
+ "MadvFreeDiscardableMemory", 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)
+ const base::Feature kDiscardableMemoryBackingTrial{
+ "DiscardableMemoryBackingTrial", base::FEATURE_DISABLED_BY_DEFAULT};
+
+@@ -49,7 +49,7 @@ const base::FeatureParam<DiscardableMemoryTrialGroup>
+
+ namespace {
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ DiscardableMemoryBacking GetBackingForFieldTrial() {
+ DiscardableMemoryTrialGroup trial_group =
+@@ -68,7 +68,7 @@ DiscardableMemoryBacking GetBackingForFieldTrial() {
+
+ } // namespace
+
+-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ // Probe capabilities of this device to determine whether we should participate
+ // in the discardable memory backing trial.
+@@ -98,7 +98,7 @@ DiscardableMemory::DiscardableMemory() = default;
+ 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/devel/electron18/files/patch-base_memory_discardable__memory__internal.h b/devel/electron18/files/patch-base_memory_discardable__memory__internal.h
new file mode 100644
index 000000000000..d1a2f2db16e6
--- /dev/null
+++ b/devel/electron18/files/patch-base_memory_discardable__memory__internal.h
@@ -0,0 +1,11 @@
+--- base/memory/discardable_memory_internal.h.orig 2022-05-19 03:45:15 UTC
++++ base/memory/discardable_memory_internal.h
+@@ -10,7 +10,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/devel/electron18/files/patch-base_memory_madv__free__discardable__memory__posix.cc b/devel/electron18/files/patch-base_memory_madv__free__discardable__memory__posix.cc
new file mode 100644
index 000000000000..752a5204e1c3
--- /dev/null
+++ b/devel/electron18/files/patch-base_memory_madv__free__discardable__memory__posix.cc
@@ -0,0 +1,21 @@
+--- base/memory/madv_free_discardable_memory_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/memory/madv_free_discardable_memory_posix.cc
+@@ -294,6 +294,10 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT
+
+ bool MadvFreeDiscardableMemoryPosix::IsResident() const {
+ DFAKE_SCOPED_RECURSIVE_LOCK(thread_collision_warner_);
++// XXX mincore
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
+ #if BUILDFLAG(IS_APPLE)
+ std::vector<char> vec(allocated_pages_);
+ #else
+@@ -309,6 +313,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons
+ return false;
+ }
+ return true;
++#endif
+ }
+
+ bool MadvFreeDiscardableMemoryPosix::IsDiscarded() const {
diff --git a/devel/electron18/files/patch-base_memory_platform__shared__memory__region.h b/devel/electron18/files/patch-base_memory_platform__shared__memory__region.h
new file mode 100644
index 000000000000..56ea02151914
--- /dev/null
+++ b/devel/electron18/files/patch-base_memory_platform__shared__memory__region.h
@@ -0,0 +1,29 @@
+--- base/memory/platform_shared_memory_region.h.orig 2022-05-19 05:17:34 UTC
++++ base/memory/platform_shared_memory_region.h
+@@ -23,7 +23,7 @@
+ #include "base/files/scoped_file.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ namespace content {
+ class SandboxIPCHandler;
+ }
+@@ -116,7 +116,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
+ kMaxValue = GET_SHMEM_TEMP_DIR_FAILURE
+ };
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Structure to limit access to executable region creation.
+ struct ExecutableRegion {
+ private:
+@@ -263,7 +263,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
+ 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/devel/electron18/files/patch-base_memory_platform__shared__memory__region__posix.cc b/devel/electron18/files/patch-base_memory_platform__shared__memory__region__posix.cc
new file mode 100644
index 000000000000..210daa145950
--- /dev/null
+++ b/devel/electron18/files/patch-base_memory_platform__shared__memory__region__posix.cc
@@ -0,0 +1,29 @@
+--- base/memory/platform_shared_memory_region_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/memory/platform_shared_memory_region_posix.cc
+@@ -70,7 +70,7 @@ FDPair ScopedFDPair::get() const {
+ return {fd.get(), readonly_fd.get()};
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // static
+ ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) {
+ PlatformSharedMemoryRegion region =
+@@ -204,7 +204,7 @@ bool PlatformSharedMemoryRegion::MapAtInternal(off_t o
+ // static
+ PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode,
+ size_t size
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ,
+ bool executable
+ #endif
+@@ -233,7 +233,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion:
+ // flag.
+ FilePath directory;
+ if (!GetShmemTempDir(
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ executable,
+ #else
+ false /* executable */,
diff --git a/devel/electron18/files/patch-base_message__loop_message__pump__glib.cc b/devel/electron18/files/patch-base_message__loop_message__pump__glib.cc
new file mode 100644
index 000000000000..7353559cf1ab
--- /dev/null
+++ b/devel/electron18/files/patch-base_message__loop_message__pump__glib.cc
@@ -0,0 +1,28 @@
+--- base/message_loop/message_pump_glib.cc.orig 2022-05-19 05:17:34 UTC
++++ base/message_loop/message_pump_glib.cc
+@@ -8,6 +8,11 @@
+ #include <glib.h>
+ #include <math.h>
+
++#if BUILDFLAG(IS_BSD)
++#include <pthread.h>
++#include <pthread_np.h>
++#endif
++
+ #include "base/logging.h"
+ #include "base/notreached.h"
+ #include "base/numerics/safe_conversions.h"
+@@ -50,9 +55,13 @@ int GetTimeIntervalMilliseconds(TimeTicks next_task_ti
+ }
+
+ bool RunningOnMainThread() {
++#if BUILDFLAG(IS_BSD)
++ return pthread_main_np();
++#else
+ auto pid = getpid();
+ auto tid = PlatformThread::CurrentId();
+ return pid > 0 && tid > 0 && pid == tid;
++#endif
+ }
+
+ // A brief refresher on GLib:
diff --git a/devel/electron18/files/patch-base_native__library__posix.cc b/devel/electron18/files/patch-base_native__library__posix.cc
new file mode 100644
index 000000000000..38015378f0d8
--- /dev/null
+++ b/devel/electron18/files/patch-base_native__library__posix.cc
@@ -0,0 +1,11 @@
+--- base/native_library_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/native_library_posix.cc
+@@ -32,7 +32,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP
+ // http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892,
+ // and http://crbug.com/40794.
+ int flags = RTLD_LAZY;
+-#if 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/devel/electron18/files/patch-base_native__library__unittest.cc b/devel/electron18/files/patch-base_native__library__unittest.cc
new file mode 100644
index 000000000000..1834dce165ae
--- /dev/null
+++ b/devel/electron18/files/patch-base_native__library__unittest.cc
@@ -0,0 +1,11 @@
+--- base/native_library_unittest.cc.orig 2022-05-19 03:45:15 UTC
++++ base/native_library_unittest.cc
+@@ -119,7 +119,7 @@ TEST(NativeLibraryTest, LoadLibrary) {
+ // versions with respect to symbol resolution scope.
+ // TSan and MSan error out on RTLD_DEEPBIND, https://crbug.com/705255
+ #if !BUILDFLAG(IS_ANDROID) && !defined(THREAD_SANITIZER) && \
+- !defined(MEMORY_SANITIZER)
++ !defined(MEMORY_SANITIZER) && !BUILDFLAG(IS_BSD)
+
+ // Verifies that the |prefer_own_symbols| option satisfies its guarantee that
+ // a loaded library will always prefer local symbol resolution before
diff --git a/devel/electron18/files/patch-base_posix_can__lower__nice__to.cc b/devel/electron18/files/patch-base_posix_can__lower__nice__to.cc
new file mode 100644
index 000000000000..4acd0dd41a9b
--- /dev/null
+++ b/devel/electron18/files/patch-base_posix_can__lower__nice__to.cc
@@ -0,0 +1,16 @@
+--- base/posix/can_lower_nice_to.cc.orig 2022-05-19 03:45:15 UTC
++++ 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/devel/electron18/files/patch-base_posix_unix__domain__socket.cc b/devel/electron18/files/patch-base_posix_unix__domain__socket.cc
new file mode 100644
index 000000000000..cf0cb87aefb4
--- /dev/null
+++ b/devel/electron18/files/patch-base_posix_unix__domain__socket.cc
@@ -0,0 +1,39 @@
+--- base/posix/unix_domain_socket.cc.orig 2022-05-19 03:45:15 UTC
++++ base/posix/unix_domain_socket.cc
+@@ -50,7 +50,7 @@ bool CreateSocketPair(ScopedFD* one, ScopedFD* two) {
+
+ // 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
+@@ -140,7 +140,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
+
+ 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))
+@@ -168,7 +168,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
+ 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) {
+@@ -202,6 +202,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
+ socklen_t pid_size = sizeof(pid);
+ if (getsockopt(fd, SOL_LOCAL, LOCAL_PEERPID, &pid, &pid_size) != 0)
+ pid = -1;
++#elif 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/devel/electron18/files/patch-base_posix_unix__domain__socket__unittest.cc b/devel/electron18/files/patch-base_posix_unix__domain__socket__unittest.cc
new file mode 100644
index 000000000000..63feb7863c87
--- /dev/null
+++ b/devel/electron18/files/patch-base_posix_unix__domain__socket__unittest.cc
@@ -0,0 +1,11 @@
+--- base/posix/unix_domain_socket_unittest.cc.orig 2022-05-19 03:45:15 UTC
++++ base/posix/unix_domain_socket_unittest.cc
+@@ -10,6 +10,8 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+
++#include <signal.h>
++
+ #include "base/bind.h"
+ #include "base/callback_helpers.h"
+ #include "base/files/file_util.h"
diff --git a/devel/electron18/files/patch-base_process_kill.h b/devel/electron18/files/patch-base_process_kill.h
new file mode 100644
index 000000000000..9c8b196ab475
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_kill.h
@@ -0,0 +1,11 @@
+--- base/process/kill.h.orig 2022-05-19 05:17:34 UTC
++++ base/process/kill.h
+@@ -112,7 +112,7 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro
+ BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus(
+ ProcessHandle handle, int* exit_code);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Spawns a thread to wait asynchronously for the child |process| to exit
+ // and then reaps it.
+ BASE_EXPORT void EnsureProcessGetsReaped(Process process);
diff --git a/devel/electron18/files/patch-base_process_kill__posix.cc b/devel/electron18/files/patch-base_process_kill__posix.cc
new file mode 100644
index 000000000000..097aec1b62d5
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_kill__posix.cc
@@ -0,0 +1,11 @@
+--- base/process/kill_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/kill_posix.cc
+@@ -159,7 +159,7 @@ void EnsureProcessTerminated(Process process) {
+ 0, new BackgroundReaper(std::move(process), Seconds(2)));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void EnsureProcessGetsReaped(Process process) {
+ DCHECK(!process.is_current());
+
diff --git a/devel/electron18/files/patch-base_process_launch.h b/devel/electron18/files/patch-base_process_launch.h
new file mode 100644
index 000000000000..ccb499f53e50
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_launch.h
@@ -0,0 +1,11 @@
+--- base/process/launch.h.orig 2022-05-19 05:17:34 UTC
++++ base/process/launch.h
+@@ -195,7 +195,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/devel/electron18/files/patch-base_process_launch__posix.cc b/devel/electron18/files/patch-base_process_launch__posix.cc
new file mode 100644
index 000000000000..86a2400e9833
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_launch__posix.cc
@@ -0,0 +1,12 @@
+--- base/process/launch_posix.cc.orig 2022-05-11 07:16:46 UTC
++++ base/process/launch_posix.cc
+@@ -64,6 +64,9 @@
+ #error "macOS should use launch_mac.cc"
+ #endif
+
++#if defined(OS_FREEBSD)
++#pragma weak environ
++#endif
+ extern char** environ;
+
+ namespace base {
diff --git a/devel/electron18/files/patch-base_process_memory.cc b/devel/electron18/files/patch-base_process_memory.cc
new file mode 100644
index 000000000000..b53f85c81729
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_memory.cc
@@ -0,0 +1,20 @@
+--- base/process/memory.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/memory.cc
+@@ -65,14 +65,16 @@ NOINLINE void OnNoMemoryInternal(size_t size) {
+
+ } // namespace internal
+
++#if !BUILDFLAG(IS_BSD)
+ void TerminateBecauseOutOfMemory(size_t size) {
+ internal::OnNoMemoryInternal(size);
+ }
++#endif
+
+ // Defined in memory_mac.mm for macOS + use_allocator="none". In case of
+ // USE_PARTITION_ALLOC_AS_MALLOC, no need to route the call to the system
+ // default calloc of macOS.
+-#if !BUILDFLAG(IS_APPLE) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
++#if (!BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)) || BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+
+ bool UncheckedCalloc(size_t num_items, size_t size, void** result) {
+ const size_t alloc_size = num_items * size;
diff --git a/devel/electron18/files/patch-base_process_process__handle.cc b/devel/electron18/files/patch-base_process_process__handle.cc
new file mode 100644
index 000000000000..d21402a0632b
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__handle.cc
@@ -0,0 +1,11 @@
+--- base/process/process_handle.cc.orig 2022-05-19 03:45:15 UTC
++++ 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/devel/electron18/files/patch-base_process_process__handle.h b/devel/electron18/files/patch-base_process_process__handle.h
new file mode 100644
index 000000000000..f42415b5d768
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__handle.h
@@ -0,0 +1,11 @@
+--- base/process/process_handle.h.orig 2022-05-19 03:45:15 UTC
++++ base/process/process_handle.h
+@@ -106,7 +106,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/devel/electron18/files/patch-base_process_process__handle__freebsd.cc b/devel/electron18/files/patch-base_process_process__handle__freebsd.cc
new file mode 100644
index 000000000000..e43bd6086675
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__handle__freebsd.cc
@@ -0,0 +1,23 @@
+--- base/process/process_handle_freebsd.cc.orig 2021-09-14 01:51:47 UTC
++++ base/process/process_handle_freebsd.cc
+@@ -12,15 +12,19 @@
+ #include <unistd.h>
+
+ #include "base/cxx17_backports.h"
++#include "base/files/file_path.h"
+
+ namespace base {
+
+ ProcessId GetParentProcessId(ProcessHandle process) {
+ struct kinfo_proc info;
+- size_t length;
++ size_t length = sizeof(struct kinfo_proc);
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
+
+ if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0)
++ return -1;
++
++ if (length < sizeof(struct kinfo_proc))
+ return -1;
+
+ return info.ki_ppid;
diff --git a/devel/electron18/files/patch-base_process_process__handle__openbsd.cc b/devel/electron18/files/patch-base_process_process__handle__openbsd.cc
new file mode 100644
index 000000000000..53e42c48a449
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__handle__openbsd.cc
@@ -0,0 +1,89 @@
+--- base/process/process_handle_openbsd.cc.orig 2022-05-11 07:16:46 UTC
++++ base/process/process_handle_openbsd.cc
+@@ -3,8 +3,11 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_handle.h"
++#include "base/files/file_util.h"
+
+ #include <stddef.h>
++#include <sys/param.h>
++#include <sys/proc.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -14,39 +17,59 @@
+ namespace base {
+
+ ProcessId GetParentProcessId(ProcessHandle process) {
+- struct kinfo_proc info;
++ struct kinfo_proc *info;
+ size_t length;
++ pid_t ppid;
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process,
+ sizeof(struct kinfo_proc), 0 };
+
+ if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) < 0)
+ return -1;
+
++ info = (struct kinfo_proc *)malloc(length);
++
+ mib[5] = (length / sizeof(struct kinfo_proc));
+
+- if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0)
+- return -1;
++ if (sysctl(mib, base::size(mib), info, &length, NULL, 0) < 0) {
++ ppid = -1;
++ goto out;
++ }
+
+- return info.p_ppid;
++ ppid = info->p_ppid;
++
++out:
++ free(info);
++ return ppid;
+ }
+
+ FilePath GetProcessExecutablePath(ProcessHandle process) {
+- struct kinfo_proc kp;
+- size_t len;
++ struct kinfo_proc *info;
++ size_t length;
++ char *path = NULL;
+ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process,
+ sizeof(struct kinfo_proc), 0 };
+
+- if (sysctl(mib, base::size(mib), NULL, &len, NULL, 0) == -1)
++ if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) == -1)
+ return FilePath();
+- mib[5] = (len / sizeof(struct kinfo_proc));
+- if (sysctl(mib, base::size(mib), &kp, &len, NULL, 0) < 0)
+- return FilePath();
+- if ((kp.p_flag & P_SYSTEM) != 0)
+- return FilePath();
+- if (strcmp(kp.p_comm, "chrome") == 0)
+- return FilePath(kp.p_comm);
+
+- return FilePath();
++ info = (struct kinfo_proc *)malloc(length);
++
++ mib[5] = (length / sizeof(struct kinfo_proc));
++
++ if (sysctl(mib, base::size(mib), info, &length, NULL, 0) < 0)
++ goto out;
++
++ if ((info->p_flag & P_SYSTEM) != 0)
++ goto out;
++
++ if (strcmp(info->p_comm, "chrome") == 0) {
++ path = info->p_comm;
++ goto out;
++ }
++
++out:
++ free(info);
++ return FilePath(path);
+ }
+
+ } // namespace base
diff --git a/devel/electron18/files/patch-base_process_process__iterator__freebsd.cc b/devel/electron18/files/patch-base_process_process__iterator__freebsd.cc
new file mode 100644
index 000000000000..0491e2a111a9
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__iterator__freebsd.cc
@@ -0,0 +1,51 @@
+--- base/process/process_iterator_freebsd.cc.orig 2021-09-14 01:51:47 UTC
++++ base/process/process_iterator_freebsd.cc
+@@ -21,7 +21,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ : index_of_kinfo_proc_(),
+ filter_(filter) {
+
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid() };
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, (int) getuid() };
+
+ bool done = false;
+ int try_num = 1;
+@@ -40,7 +40,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ num_of_kinfo_proc += 16;
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ len = num_of_kinfo_proc * sizeof(struct kinfo_proc);
+- if (sysctl(mib, base::size(mib), &kinfo_procs_[0], &len, NULL, 0) < 0) {
++ if (sysctl(mib, base::size(mib), kinfo_procs_.data(), &len, NULL, 0) < 0) {
+ // If we get a mem error, it just means we need a bigger buffer, so
+ // loop around again. Anything else is a real error and give up.
+ if (errno != ENOMEM) {
+@@ -50,7 +50,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ }
+ } 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;
+ }
+@@ -72,18 +72,13 @@ bool ProcessIterator::CheckForNextProcess() {
+ for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) {
+ size_t length;
+ struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_];
+- int mib[] = { CTL_KERN, KERN_PROC_ARGS, kinfo.ki_pid };
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, kinfo.ki_pid };
+
+ if ((kinfo.ki_pid > 0) && (kinfo.ki_stat == SZOMB))
+ continue;
+
+- length = 0;
+- if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) < 0) {
+- LOG(ERROR) << "failed to figure out the buffer size for a command line";
+- continue;
+- }
+-
+- data.resize(length);
++ data.resize(ARG_MAX);
++ length = ARG_MAX;
+
+ if (sysctl(mib, base::size(mib), &data[0], &length, NULL, 0) < 0) {
+ LOG(ERROR) << "failed to fetch a commandline";
diff --git a/devel/electron18/files/patch-base_process_process__iterator__openbsd.cc b/devel/electron18/files/patch-base_process_process__iterator__openbsd.cc
new file mode 100644
index 000000000000..aa0a99325f5d
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__iterator__openbsd.cc
@@ -0,0 +1,45 @@
+--- base/process/process_iterator_openbsd.cc.orig 2022-05-11 07:16:46 UTC
++++ 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/cxx17_backports.h"
+@@ -19,12 +22,13 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ : index_of_kinfo_proc_(),
+ filter_(filter) {
+
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid(),
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, static_cast<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;
+@@ -33,7 +37,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ kinfo_procs_.resize(0);
+ done = true;
+ } else {
+- size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
++ num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ // Leave some spare room for process table growth (more could show up
+ // between when we check and now)
+ num_of_kinfo_proc += 16;
+@@ -49,7 +53,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter*
+ }
+ } 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/devel/electron18/files/patch-base_process_process__metrics.cc b/devel/electron18/files/patch-base_process_process__metrics.cc
new file mode 100644
index 000000000000..cc89edddf6e5
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__metrics.cc
@@ -0,0 +1,47 @@
+--- base/process/process_metrics.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/process_metrics.cc
+@@ -18,7 +18,7 @@ namespace base {
+ namespace {
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int CalculateEventsPerSecond(uint64_t event_count,
+ uint64_t* last_event_count,
+ base::TimeTicks* last_calculated) {
+@@ -55,7 +55,7 @@ SystemMetrics SystemMetrics::Sample() {
+ SystemMetrics system_metrics;
+
+ system_metrics.committed_memory_ = GetSystemCommitCharge();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ GetSystemMemoryInfo(&system_metrics.memory_info_);
+ GetVmStatInfo(&system_metrics.vmstat_info_);
+ GetSystemDiskInfo(&system_metrics.disk_info_);
+@@ -74,7 +74,7 @@ Value SystemMetrics::ToValue() const {
+ Value res(Value::Type::DICTIONARY);
+
+ res.SetIntKey("committed_memory", static_cast<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 meminfo = memory_info_.ToValue();
+ Value vmstat = vmstat_info_.ToValue();
+ meminfo.MergeDictionary(&vmstat);
+@@ -100,7 +100,7 @@ std::unique_ptr<ProcessMetrics> ProcessMetrics::Create
+ #endif // !BUILDFLAG(IS_MAC)
+ }
+
+-#if !BUILDFLAG(IS_FREEBSD) || !BUILDFLAG(IS_POSIX)
++#if !BUILDFLAG(IS_BSD) || !BUILDFLAG(IS_POSIX)
+ double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+ TimeDelta cumulative_cpu = GetCumulativeCPUUsage();
+ TimeTicks time = TimeTicks::Now();
+@@ -126,7 +126,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage(
+ #endif
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int ProcessMetrics::CalculateIdleWakeupsPerSecond(
+ uint64_t absolute_idle_wakeups) {
+ return CalculateEventsPerSecond(absolute_idle_wakeups,
diff --git a/devel/electron18/files/patch-base_process_process__metrics.h b/devel/electron18/files/patch-base_process_process__metrics.h
new file mode 100644
index 000000000000..f96d37afb8f1
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__metrics.h
@@ -0,0 +1,119 @@
+--- base/process/process_metrics.h.orig 2022-05-19 05:17:34 UTC
++++ base/process/process_metrics.h
+@@ -36,7 +36,7 @@
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ #include <string>
+ #include <utility>
+ #include <vector>
+@@ -52,7 +52,7 @@ class Value;
+ // Full declaration is in process_metrics_iocounters.h.
+ struct IoCounters;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Minor and major page fault counts since the process creation.
+ // Both counts are process-wide, and exclude child processes.
+ //
+@@ -107,7 +107,7 @@ class BASE_EXPORT ProcessMetrics {
+ // convenience wrapper for CreateProcessMetrics().
+ static std::unique_ptr<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;
+@@ -134,7 +134,7 @@ class BASE_EXPORT ProcessMetrics {
+ [[nodiscard]] TimeDelta 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
+@@ -217,7 +217,7 @@ class BASE_EXPORT ProcessMetrics {
+ int GetOpenFdSoftLimit() const;
+ #endif // BUILDFLAG(IS_POSIX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ // Bytes of swap as reported by /proc/[pid]/status.
+ uint64_t GetVmSwapBytes() const;
+
+@@ -238,7 +238,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif // !BUILDFLAG(IS_MAC)
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups);
+ #endif
+ #if BUILDFLAG(IS_APPLE)
+@@ -249,7 +249,7 @@ class BASE_EXPORT ProcessMetrics {
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ CPU::CoreType GetCoreType(int core_index);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX)
+@@ -274,7 +274,7 @@ class BASE_EXPORT ProcessMetrics {
+ uint64_t last_cumulative_disk_usage_ = 0;
+
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // Same thing for idle wakeups.
+ TimeTicks last_idle_wakeups_time_;
+ uint64_t last_absolute_idle_wakeups_;
+@@ -317,7 +317,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_AIX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ // Data about system-wide memory consumption. Values are in KB. Available on
+ // Windows, Mac, Linux, Android and Chrome OS.
+ //
+@@ -352,7 +352,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_AIX)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_BSD)
+ // This provides an estimate of available memory as described here:
+ // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
+ // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
+@@ -367,7 +367,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
+ #endif
+
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_AIX) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ int buffers = 0;
+ int cached = 0;
+ int active_anon = 0;
+@@ -404,7 +404,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK
+ // 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.
+@@ -591,7 +591,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/devel/electron18/files/patch-base_process_process__metrics__freebsd.cc b/devel/electron18/files/patch-base_process_process__metrics__freebsd.cc
new file mode 100644
index 000000000000..dfb2e7508ea0
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__metrics__freebsd.cc
@@ -0,0 +1,292 @@
+--- base/process/process_metrics_freebsd.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/process_metrics_freebsd.cc
+@@ -3,21 +3,41 @@
+ // found in the LICENSE file.
+
+ #include "base/process/process_metrics.h"
++#include "base/notreached.h"
+
+ #include <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/cxx17_backports.h"
+ #include "base/memory/ptr_util.h"
+ #include "base/process/process_metrics_iocounters.h"
++#include "base/values.h"
+
+ namespace base {
++namespace {
+
++int GetPageShift() {
++ int pagesize = getpagesize();
++ int pageshift = 0;
++
++ while (pagesize > 1) {
++ pageshift++;
++ pagesize >>= 1;
++ }
++
++ return pageshift;
++}
++}
++
+ ProcessMetrics::ProcessMetrics(ProcessHandle process)
+- : process_(process),
+- last_cpu_(0) {}
++ : process_(process) {}
+
+ // static
+ std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+@@ -27,17 +47,18 @@ std::unique_ptr<ProcessMetrics> ProcessMetrics::Create
+
+ double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+ struct kinfo_proc info;
+- int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_};
+- size_t length = sizeof(info);
++ size_t length = sizeof(struct kinfo_proc);
+
++ int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ };
++
+ if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0)
+- return 0;
++ return 0.0;
+
+- return (info.ki_pctcpu / FSCALE) * 100.0;
++ return static_cast<double>((info.ki_pctcpu * 100.0) / FSCALE);
+ }
+
+ TimeDelta ProcessMetrics::GetCumulativeCPUUsage() {
+- NOTREACHED();
++ NOTIMPLEMENTED();
+ return TimeDelta();
+ }
+
+@@ -68,4 +89,221 @@ size_t GetSystemCommitCharge() {
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
+ }
+
++int GetNumberOfThreads(ProcessHandle process) {
++ // Taken from FreeBSD top (usr.bin/top/machine.c)
++
++ kvm_t* kd = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open");
++ if (kd == NULL)
++ return 0;
++
++ struct kinfo_proc* pbase;
++ int nproc;
++ pbase = kvm_getprocs(kd, KERN_PROC_PID, process, &nproc);
++ if (pbase == NULL)
++ return 0;
++
++ if (kvm_close(kd) == -1)
++ return 0;
++
++ return nproc;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB *meminfo) {
++ unsigned int mem_total, mem_free, swap_total, swap_used;
++ size_t length;
++ int pagesizeKB;
++
++ pagesizeKB = getpagesize() / 1024;
++
++ length = sizeof(mem_total);
++ if (sysctlbyname("vm.stats.vm.v_page_count", &mem_total,
++ &length, NULL, 0) != 0 || length != sizeof(mem_total))
++ return false;
++
++ length = sizeof(mem_free);
++ if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &length, NULL, 0)
++ != 0 || length != sizeof(mem_free))
++ return false;
++
++ length = sizeof(swap_total);
++ if (sysctlbyname("vm.swap_size", &swap_total, &length, NULL, 0)
++ != 0 || length != sizeof(swap_total))
++ return false;
++
++ length = sizeof(swap_used);
++ if (sysctlbyname("vm.swap_anon_use", &swap_used, &length, NULL, 0)
++ != 0 || length != sizeof(swap_used))
++ return false;
++
++ meminfo->total = mem_total * pagesizeKB;
++ meminfo->free = mem_free * pagesizeKB;
++ meminfo->swap_total = swap_total * pagesizeKB;
++ meminfo->swap_free = (swap_total - swap_used) * pagesizeKB;
++
++ return true;
++}
++
++int ProcessMetrics::GetOpenFdCount() const {
++ struct kinfo_file * kif;
++ int cnt;
++
++ if ((kif = kinfo_getfile(process_, &cnt)) == NULL)
++ return -1;
++
++ free(kif);
++
++ return cnt;
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ size_t length;
++ int total_count = 0;
++ int mib[] = { CTL_KERN, KERN_MAXFILESPERPROC };
++
++ length = sizeof(total_count);
++
++ if (sysctl(mib, base::size(mib), &total_count, &length, NULL, 0) < 0) {
++ total_count = -1;
++ }
++
++ return total_count;
++}
++
++size_t ProcessMetrics::GetResidentSetSize() const {
++ kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open");
++
++ if (kd == nullptr)
++ return 0;
++
++ struct kinfo_proc *pp;
++ int nproc;
++
++ if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) {
++ kvm_close(kd);
++ return 0;
++ }
++
++ size_t rss;
++
++ if (nproc > 0) {
++ rss = pp->ki_rssize << GetPageShift();
++ } else {
++ rss = 0;
++ }
++
++ kvm_close(kd);
++ return rss;
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ kvm_t *kd = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "kvm_open");
++
++ if (kd == nullptr)
++ return 0;
++
++ struct kinfo_proc *pp;
++ int nproc;
++
++ if ((pp = kvm_getprocs(kd, KERN_PROC_PID, process_, &nproc)) == nullptr) {
++ kvm_close(kd);
++ return 0;
++ }
++
++ size_t swrss;
++
++ if (nproc > 0) {
++ swrss = pp->ki_swrss > pp->ki_rssize
++ ? (pp->ki_swrss - pp->ki_rssize) << GetPageShift()
++ : 0;
++ } else {
++ swrss = 0;
++ }
++
++ kvm_close(kd);
++ return swrss;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default;
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value SystemDiskInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.SetDoubleKey("reads", static_cast<double>(reads));
++ res.SetDoubleKey("reads_merged", static_cast<double>(reads_merged));
++ res.SetDoubleKey("sectors_read", static_cast<double>(sectors_read));
++ res.SetDoubleKey("read_time", static_cast<double>(read_time));
++ res.SetDoubleKey("writes", static_cast<double>(writes));
++ res.SetDoubleKey("writes_merged", static_cast<double>(writes_merged));
++ res.SetDoubleKey("sectors_written", static_cast<double>(sectors_written));
++ res.SetDoubleKey("write_time", static_cast<double>(write_time));
++ res.SetDoubleKey("io", static_cast<double>(io));
++ res.SetDoubleKey("io_time", static_cast<double>(io_time));
++ res.SetDoubleKey("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ return res;
++}
++
++Value SystemMemoryInfoKB::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ res.SetIntKey("total", total);
++ res.SetIntKey("free", free);
++ res.SetIntKey("available", available);
++ res.SetIntKey("buffers", buffers);
++ res.SetIntKey("cached", cached);
++ res.SetIntKey("active_anon", active_anon);
++ res.SetIntKey("inactive_anon", inactive_anon);
++ res.SetIntKey("active_file", active_file);
++ res.SetIntKey("inactive_file", inactive_file);
++ res.SetIntKey("swap_total", swap_total);
++ res.SetIntKey("swap_free", swap_free);
++ res.SetIntKey("swap_used", swap_total - swap_free);
++ res.SetIntKey("dirty", dirty);
++ res.SetIntKey("reclaimable", reclaimable);
++
++ return res;
++}
++
++Value VmStatInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ res.SetIntKey("pswpin", pswpin);
++ res.SetIntKey("pswpout", pswpout);
++ res.SetIntKey("pgmajfault", pgmajfault);
++
++ return res;
++}
+ } // namespace base
diff --git a/devel/electron18/files/patch-base_process_process__metrics__openbsd.cc b/devel/electron18/files/patch-base_process_process__metrics__openbsd.cc
new file mode 100644
index 000000000000..039ac63f63d5
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__metrics__openbsd.cc
@@ -0,0 +1,235 @@
+--- base/process/process_metrics_openbsd.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/process_metrics_openbsd.cc
+@@ -4,17 +4,36 @@
+
+ #include "base/process/process_metrics.h"
+
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/process/internal_linux.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/strings/string_split.h"
++#include "base/strings/string_tokenizer.h"
++#include "base/strings/string_util.h"
++#include "base/system/sys_info.h"
++#include "base/threading/thread_restrictions.h"
++#include "base/notreached.h"
++
+ #include <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/cxx17_backports.h"
+ #include "base/memory/ptr_util.h"
+ #include "base/process/process_metrics_iocounters.h"
++#include "base/values.h"
+
+ namespace base {
+
++ProcessMetrics::ProcessMetrics(ProcessHandle process)
++ : process_(process) {}
++
+ // static
+ std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+ ProcessHandle process) {
+@@ -25,49 +44,24 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_coun
+ return false;
+ }
+
+-static int GetProcessCPU(pid_t pid) {
++double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+ struct kinfo_proc info;
+- size_t length;
+- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
+- sizeof(struct kinfo_proc), 0 };
++ size_t length = sizeof(struct kinfo_proc);
+
+- if (sysctl(mib, base::size(mib), NULL, &length, NULL, 0) < 0)
+- return -1;
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_,
++ sizeof(struct kinfo_proc), 1 };
+
+- mib[5] = (length / sizeof(struct kinfo_proc));
++ if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0)
++ return 0.0;
+
+- if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0)
+- return 0;
+-
+- return info.p_pctcpu;
++ return static_cast<double>((info.p_pctcpu * 100.0) / FSCALE);
+ }
+
+-double ProcessMetrics::GetPlatformIndependentCPUUsage() {
+- TimeTicks time = TimeTicks::Now();
+-
+- if (last_cpu_time_.is_zero()) {
+- // First call, just set the last values.
+- last_cpu_time_ = time;
+- return 0;
+- }
+-
+- int cpu = GetProcessCPU(process_);
+-
+- last_cpu_time_ = time;
+- double percentage = static_cast<double>((cpu * 100.0) / FSCALE);
+-
+- return percentage;
+-}
+-
+ TimeDelta ProcessMetrics::GetCumulativeCPUUsage() {
+ NOTREACHED();
+ return TimeDelta();
+ }
+
+-ProcessMetrics::ProcessMetrics(ProcessHandle process)
+- : process_(process),
+- last_cpu_(0) {}
+-
+ size_t GetSystemCommitCharge() {
+ int mib[] = { CTL_VM, VM_METER };
+ int pagesize;
+@@ -75,7 +69,7 @@ size_t GetSystemCommitCharge() {
+ unsigned long mem_total, mem_free, mem_inactive;
+ size_t len = sizeof(vmtotal);
+
+- if (sysctl(mib, base::size(mib), &vmtotal, &len, NULL, 0) < 0)
++ if (sysctl(mib, std::size(mib), &vmtotal, &len, NULL, 0) < 0)
+ return 0;
+
+ mem_total = vmtotal.t_vm;
+@@ -85,6 +79,129 @@ size_t GetSystemCommitCharge() {
+ pagesize = getpagesize();
+
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
++}
++
++int ProcessMetrics::GetOpenFdCount() const {
++ struct kinfo_file *files;
++ kvm_t *kd = NULL;
++ int total_count = 0;
++ char errbuf[_POSIX2_LINE_MAX];
++
++ if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL)
++ goto out;
++
++ if ((files = kvm_getfiles(kd, KERN_FILE_BYPID, process_,
++ sizeof(struct kinfo_file), &total_count)) == NULL) {
++ total_count = 0;
++ goto out;
++ }
++
++ kvm_close(kd);
++
++out:
++ return total_count;
++}
++
++int ProcessMetrics::GetOpenFdSoftLimit() const {
++ return GetMaxFds();
++}
++
++uint64_t ProcessMetrics::GetVmSwapBytes() const {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
++ NOTIMPLEMENTED_LOG_ONCE();
++ return false;
++}
++
++SystemDiskInfo::SystemDiskInfo() {
++ reads = 0;
++ reads_merged = 0;
++ sectors_read = 0;
++ read_time = 0;
++ writes = 0;
++ writes_merged = 0;
++ sectors_written = 0;
++ write_time = 0;
++ io = 0;
++ io_time = 0;
++ weighted_io_time = 0;
++}
++
++SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo& other) = default;
++
++bool GetSystemDiskInfo(SystemDiskInfo* diskinfo) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++bool GetVmStatInfo(VmStatInfo* vmstat) {
++ NOTIMPLEMENTED();
++ return false;
++}
++
++int ProcessMetrics::GetIdleWakeupsPerSecond() {
++ NOTIMPLEMENTED();
++ return 0;
++}
++
++Value SystemMemoryInfoKB::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++ res.SetIntKey("total", total);
++ res.SetIntKey("free", free);
++ res.SetIntKey("available", available);
++ res.SetIntKey("buffers", buffers);
++ res.SetIntKey("cached", cached);
++ res.SetIntKey("active_anon", active_anon);
++ res.SetIntKey("inactive_anon", inactive_anon);
++ res.SetIntKey("active_file", active_file);
++ res.SetIntKey("inactive_file", inactive_file);
++ res.SetIntKey("swap_total", swap_total);
++ res.SetIntKey("swap_free", swap_free);
++ res.SetIntKey("swap_used", swap_total - swap_free);
++ res.SetIntKey("dirty", dirty);
++ res.SetIntKey("reclaimable", reclaimable);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++Value VmStatInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++ res.SetIntKey("pswpin", pswpin);
++ res.SetIntKey("pswpout", pswpout);
++ res.SetIntKey("pgmajfault", pgmajfault);
++
++ NOTIMPLEMENTED();
++
++ return res;
++}
++
++SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default;
++
++Value SystemDiskInfo::ToValue() const {
++ Value res(Value::Type::DICTIONARY);
++
++ // Write out uint64_t variables as doubles.
++ // Note: this may discard some precision, but for JS there's no other option.
++ res.SetDoubleKey("reads", static_cast<double>(reads));
++ res.SetDoubleKey("reads_merged", static_cast<double>(reads_merged));
++ res.SetDoubleKey("sectors_read", static_cast<double>(sectors_read));
++ res.SetDoubleKey("read_time", static_cast<double>(read_time));
++ res.SetDoubleKey("writes", static_cast<double>(writes));
++ res.SetDoubleKey("writes_merged", static_cast<double>(writes_merged));
++ res.SetDoubleKey("sectors_written", static_cast<double>(sectors_written));
++ res.SetDoubleKey("write_time", static_cast<double>(write_time));
++ res.SetDoubleKey("io", static_cast<double>(io));
++ res.SetDoubleKey("io_time", static_cast<double>(io_time));
++ res.SetDoubleKey("weighted_io_time", static_cast<double>(weighted_io_time));
++
++ NOTIMPLEMENTED();
++
++ return res;
+ }
+
+ } // namespace base
diff --git a/devel/electron18/files/patch-base_process_process__metrics__posix.cc b/devel/electron18/files/patch-base_process_process__metrics__posix.cc
new file mode 100644
index 000000000000..f508db145a15
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__metrics__posix.cc
@@ -0,0 +1,20 @@
+--- base/process/process_metrics_posix.cc.orig 2022-05-19 03:45:15 UTC
++++ base/process/process_metrics_posix.cc
+@@ -20,6 +20,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif BUILDFLAG(IS_OPENBSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -133,7 +135,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/devel/electron18/files/patch-base_process_process__posix.cc b/devel/electron18/files/patch-base_process_process__posix.cc
new file mode 100644
index 000000000000..15014510bcc1
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__posix.cc
@@ -0,0 +1,93 @@
+--- base/process/process_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/process_posix.cc
+@@ -23,10 +23,15 @@
+ #include "build/build_config.h"
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include <sys/event.h>
+ #endif
+
++#if defined(OS_BSD)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
++
+ #if BUILDFLAG(CLANG_PROFILING)
+ #include "base/test/clang_profiling.h"
+ #endif
+@@ -95,7 +100,7 @@ bool WaitpidWithTimeout(base::ProcessHandle handle,
+ return ret_pid > 0;
+ }
+
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Using kqueue on Mac so that we can wait on non-child processes.
+ // We can't use kqueues on child processes because we need to reap
+ // our own children using wait.
+@@ -200,7 +205,7 @@ bool WaitForExitWithTimeoutImpl(base::ProcessHandle ha
+ const bool exited = (parent_pid < 0);
+
+ if (!exited && parent_pid != our_pid) {
+-#if BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // On Mac we can wait on non child processes.
+ return WaitForSingleNonChildProcess(handle, timeout);
+ #else
+@@ -356,7 +361,55 @@ void Process::Exited(int exit_code) const {}
+
+ int Process::GetPriority() const {
+ DCHECK(IsValid());
++// avoid pledge(2) violation
++#if defined(OS_BSD)
++ return 0;
++#else
+ return getpriority(PRIO_PROCESS, process_);
++#endif
++}
++
++Time Process::CreationTime() const {
++// avoid ps pledge in the network process
++#if !defined(OS_BSD)
++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(),
++ sizeof(struct kinfo_proc), 0 };
++ struct kinfo_proc *info = nullptr;
++ size_t info_size;
++#endif
++ Time ct = Time();
++
++#if !defined(OS_BSD)
++ if (sysctl(mib, base::size(mib), NULL, &info_size, NULL, 0) < 0)
++ 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, base::size(mib), info, &info_size, NULL, 0) < 0)
++ goto out;
++
++ ct = Time::FromTimeT(info->p_ustart_sec);
++
++out:
++ if (info)
++ free(info);
++#endif
++ return ct;
++}
++
++bool Process::IsProcessBackgrounded() const {
++ return false;
++}
++
++bool Process::SetProcessBackgrounded(bool value) {
++ return false;
++}
++
++// static
++bool Process::CanBackgroundProcesses() {
++ return false;
+ }
+
+ } // namespace base
diff --git a/devel/electron18/files/patch-base_process_process__unittest.cc b/devel/electron18/files/patch-base_process_process__unittest.cc
new file mode 100644
index 000000000000..9b98204ed1ca
--- /dev/null
+++ b/devel/electron18/files/patch-base_process_process__unittest.cc
@@ -0,0 +1,11 @@
+--- base/process/process_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/process/process_unittest.cc
+@@ -140,7 +140,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) {
+ // was spawned and a time recorded after it was spawned. However, since the
+ // base::Time and process creation clocks don't match, tolerate some error.
+ constexpr base::TimeDelta kTolerance =
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, process creation time is relative to boot time which has a
+ // 1-second resolution. Tolerate 1 second for the imprecise boot time and
+ // 100 ms for the imprecise clock.
diff --git a/devel/electron18/files/patch-base_profiler_stack__sampling__profiler__test__util.cc b/devel/electron18/files/patch-base_profiler_stack__sampling__profiler__test__util.cc
new file mode 100644
index 000000000000..519472da8dae
--- /dev/null
+++ b/devel/electron18/files/patch-base_profiler_stack__sampling__profiler__test__util.cc
@@ -0,0 +1,11 @@
+--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2022-05-19 05:17:34 UTC
++++ base/profiler/stack_sampling_profiler_test_util.cc
+@@ -32,7 +32,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/devel/electron18/files/patch-base_profiler_stack__sampling__profiler__unittest.cc b/devel/electron18/files/patch-base_profiler_stack__sampling__profiler__unittest.cc
new file mode 100644
index 000000000000..7d94e16f6dd3
--- /dev/null
+++ b/devel/electron18/files/patch-base_profiler_stack__sampling__profiler__unittest.cc
@@ -0,0 +1,11 @@
+--- base/profiler/stack_sampling_profiler_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/profiler/stack_sampling_profiler_unittest.cc
+@@ -41,7 +41,7 @@
+ #include <intrin.h>
+ #include <malloc.h>
+ #include <windows.h>
+-#else
++#elif !BUILDFLAG(IS_BSD)
+ #include <alloca.h>
+ #endif
+
diff --git a/devel/electron18/files/patch-base_rand__util.h b/devel/electron18/files/patch-base_rand__util.h
new file mode 100644
index 000000000000..ab0b23f0481b
--- /dev/null
+++ b/devel/electron18/files/patch-base_rand__util.h
@@ -0,0 +1,11 @@
+--- base/rand_util.h.orig 2022-05-19 03:45:15 UTC
++++ base/rand_util.h
+@@ -81,7 +81,7 @@ void RandomShuffle(Itr first, Itr last) {
+ std::shuffle(first, last, RandomBitGenerator());
+ }
+
+-#if BUILDFLAG(IS_POSIX)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_OPENBSD)
+ BASE_EXPORT int GetUrandomFD();
+ #endif
+
diff --git a/devel/electron18/files/patch-base_rand__util__posix.cc b/devel/electron18/files/patch-base_rand__util__posix.cc
new file mode 100644
index 000000000000..a06e8357c1d6
--- /dev/null
+++ b/devel/electron18/files/patch-base_rand__util__posix.cc
@@ -0,0 +1,52 @@
+--- base/rand_util_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/rand_util_posix.cc
+@@ -17,7 +17,7 @@
+ #include "base/posix/eintr_wrapper.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/995996): Waiting for this header to appear in the iOS SDK.
+@@ -34,6 +34,7 @@ static constexpr int kOpenFlags = O_RDONLY;
+ static constexpr int kOpenFlags = O_RDONLY | O_CLOEXEC;
+ #endif
+
++#if !BUILDFLAG(IS_OPENBSD)
+ // We keep the file descriptor for /dev/urandom around so we don't need to
+ // reopen it (which is expensive), and since we may not even be able to reopen
+ // it if we are later put in a sandbox. This class wraps the file descriptor so
+@@ -51,6 +52,7 @@ class URandomFd {
+ private:
+ const int fd_;
+ };
++#endif
+
+ } // namespace
+
+@@ -62,6 +64,7 @@ namespace base {
+ // (https://chromium-review.googlesource.com/c/chromium/src/+/1545096) and land
+ // it or some form of it.
+ void RandBytes(void* output, size_t output_length) {
++#if !BUILDFLAG(IS_OPENBSD)
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL)
+ // We have to call `getrandom` via Linux Syscall Support, rather than through
+ // the libc wrapper, because we might not have an up-to-date libc (e.g. on
+@@ -93,11 +96,16 @@ void RandBytes(void* output, size_t output_length) {
+ const bool success =
+ ReadFromFD(urandom_fd, static_cast<char*>(output), output_length);
+ CHECK(success);
++#else
++ arc4random_buf(static_cast<char*>(output), output_length);
++#endif
+ }
+
++#if !BUILDFLAG(IS_OPENBSD)
+ int GetUrandomFD() {
+ static NoDestructor<URandomFd> urandom_fd;
+ return urandom_fd->fd();
+ }
++#endif
+
+ } // namespace base
diff --git a/devel/electron18/files/patch-base_strings_safe__sprintf__unittest.cc b/devel/electron18/files/patch-base_strings_safe__sprintf__unittest.cc
new file mode 100644
index 000000000000..12ba2a05b3ba
--- /dev/null
+++ b/devel/electron18/files/patch-base_strings_safe__sprintf__unittest.cc
@@ -0,0 +1,18 @@
+--- base/strings/safe_sprintf_unittest.cc.orig 2022-05-19 03:45:15 UTC
++++ base/strings/safe_sprintf_unittest.cc
+@@ -731,6 +731,7 @@ TEST(SafeSPrintfTest, EmbeddedNul) {
+ #endif
+ }
+
++#if !BUILDFLAG(IS_BSD)
+ TEST(SafeSPrintfTest, EmitNULL) {
+ char buf[40];
+ #if defined(__GNUC__)
+@@ -747,6 +748,7 @@ TEST(SafeSPrintfTest, EmitNULL) {
+ #pragma GCC diagnostic pop
+ #endif
+ }
++#endif
+
+ TEST(SafeSPrintfTest, PointerSize) {
+ // The internal data representation is a 64bit value, independent of the
diff --git a/devel/electron18/files/patch-base_synchronization_lock__impl.h b/devel/electron18/files/patch-base_synchronization_lock__impl.h
new file mode 100644
index 000000000000..ea97f1ebb168
--- /dev/null
+++ b/devel/electron18/files/patch-base_synchronization_lock__impl.h
@@ -0,0 +1,23 @@
+--- base/synchronization/lock_impl.h.orig 2022-05-19 05:17:34 UTC
++++ base/synchronization/lock_impl.h
+@@ -107,6 +107,10 @@ void LockImpl::Unlock() {
+ }
+
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_FREEBSD)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
++#endif
+
+ BASE_EXPORT std::string SystemErrorCodeToString(int error_code);
+
+@@ -121,6 +125,9 @@ void LockImpl::Unlock() {
+ int rv = pthread_mutex_unlock(&native_handle_);
+ DCHECK_EQ(rv, 0) << ". " << strerror(rv);
+ }
++#if BUILDFLAG(IS_FREEBSD)
++#pragma GCC diagnostic pop
++#endif
+ #endif
+
+ // This is an implementation used for AutoLock templated on the lock type.
diff --git a/devel/electron18/files/patch-base_syslog__logging.cc b/devel/electron18/files/patch-base_syslog__logging.cc
new file mode 100644
index 000000000000..835d690f60c1
--- /dev/null
+++ b/devel/electron18/files/patch-base_syslog__logging.cc
@@ -0,0 +1,20 @@
+--- base/syslog_logging.cc.orig 2022-05-19 03:45:15 UTC
++++ base/syslog_logging.cc
+@@ -15,7 +15,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>
+@@ -147,7 +147,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/devel/electron18/files/patch-base_system_sys__info.cc b/devel/electron18/files/patch-base_system_sys__info.cc
new file mode 100644
index 000000000000..d1bc06f5f15f
--- /dev/null
+++ b/devel/electron18/files/patch-base_system_sys__info.cc
@@ -0,0 +1,11 @@
+--- base/system/sys_info.cc.orig 2022-05-19 05:17:34 UTC
++++ base/system/sys_info.cc
+@@ -100,7 +100,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallback<void(
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, {}, base::BindOnce(&GetHardwareInfoSync), std::move(callback));
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, {base::MayBlock()}, base::BindOnce(&GetHardwareInfoSync),
+ std::move(callback));
diff --git a/devel/electron18/files/patch-base_system_sys__info.h b/devel/electron18/files/patch-base_system_sys__info.h
new file mode 100644
index 000000000000..dbaa67f50fad
--- /dev/null
+++ b/devel/electron18/files/patch-base_system_sys__info.h
@@ -0,0 +1,20 @@
+--- base/system/sys_info.h.orig 2022-05-19 05:17:34 UTC
++++ base/system/sys_info.h
+@@ -212,6 +212,8 @@ class BASE_EXPORT SysInfo {
+ // On Desktop this returns true when memory <= 2GB.
+ static bool IsLowEndDevice();
+
++ static uint64_t MaxSharedMemorySize();
++
+ private:
+ FRIEND_TEST_ALL_PREFIXES(SysInfoTest, AmountOfAvailablePhysicalMemory);
+ FRIEND_TEST_ALL_PREFIXES(debug::SystemMetricsTest, ParseMeminfo);
+@@ -222,7 +224,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 int64_t AmountOfAvailablePhysicalMemory(
+ const SystemMemoryInfoKB& meminfo);
+ #endif
diff --git a/devel/electron18/files/patch-base_system_sys__info__freebsd.cc b/devel/electron18/files/patch-base_system_sys__info__freebsd.cc
new file mode 100644
index 000000000000..3a32dc451dc6
--- /dev/null
+++ b/devel/electron18/files/patch-base_system_sys__info__freebsd.cc
@@ -0,0 +1,113 @@
+--- base/system/sys_info_freebsd.cc.orig 2022-05-19 03:45:15 UTC
++++ base/system/sys_info_freebsd.cc
+@@ -9,30 +9,106 @@
+ #include <sys/sysctl.h>
+
+ #include "base/notreached.h"
++#include "base/process/process_metrics.h"
++#include "base/strings/string_util.h"
+
+ namespace base {
+
++int SysInfo::NumberOfProcessors() {
++ int mib[] = {CTL_HW, HW_NCPU};
++ int ncpu;
++ size_t size = sizeof(ncpu);
++ if (sysctl(mib, base::size(mib), &ncpu, &size, NULL, 0) < 0) {
++ NOTREACHED();
++ return 1;
++ }
++ return ncpu;
++}
++
+ int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+- int pages, page_size;
++ int pages, page_size, r = 0;
+ size_t size = sizeof(pages);
+- sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
+- sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
+- if (pages == -1 || page_size == -1) {
++
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
++
++ if (r == -1) {
+ NOTREACHED();
+ return 0;
+ }
++
+ return static_cast<int64_t>(pages) * page_size;
+ }
+
++int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
++ int page_size, r = 0;
++ unsigned int pgfree, pginact, pgcache;
++ size_t size = sizeof(page_size);
++ size_t szpg = sizeof(pgfree);
++
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_free_count", &pgfree, &szpg, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_inactive_count", &pginact, &szpg, NULL, 0);
++ if (r == 0)
++ r = sysctlbyname("vm.stats.vm.v_cache_count", &pgcache, &szpg, NULL, 0);
++
++ if (r == -1) {
++ NOTREACHED();
++ return 0;
++ }
++
++ return static_cast<int64_t>((pgfree + pginact + pgcache) * page_size);
++}
++
+ // static
++int64_t SysInfo::AmountOfAvailablePhysicalMemory(const SystemMemoryInfoKB& info) {
++ int64_t res_kb = info.available != 0
++ ? info.available - info.active_file
++ : info.free + info.reclaimable + info.inactive_file;
++ return res_kb * 1024;
++}
++
++// static
++std::string SysInfo::CPUModelName() {
++ int mib[] = { CTL_HW, HW_MODEL };
++ char name[256];
++ size_t size = base::size(name);
++
++ if (sysctl(mib, base::size(mib), &name, &size, NULL, 0) == 0) {
++ return name;
++ }
++
++ return std::string();
++}
++
++// static
+ uint64_t SysInfo::MaxSharedMemorySize() {
+ size_t limit;
+ size_t size = sizeof(limit);
++
+ if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ return 0;
+ }
++
+ return static_cast<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/devel/electron18/files/patch-base_system_sys__info__openbsd.cc b/devel/electron18/files/patch-base_system_sys__info__openbsd.cc
new file mode 100644
index 000000000000..0de08501ca32
--- /dev/null
+++ b/devel/electron18/files/patch-base_system_sys__info__openbsd.cc
@@ -0,0 +1,102 @@
+--- base/system/sys_info_openbsd.cc.orig 2022-05-19 05:17:34 UTC
++++ base/system/sys_info_openbsd.cc
+@@ -12,6 +12,7 @@
+
+ #include "base/cxx17_backports.h"
+ #include "base/notreached.h"
++#include "base/strings/string_util.h"
+
+ namespace {
+
+@@ -29,9 +30,15 @@ int64_t AmountOfMemory(int pages_name) {
+
+ namespace base {
+
++// pledge(2)
++int64_t aofpmem = 0;
++int64_t aofapmem = 0;
++int64_t shmmax = 0;
++char cpumodel[256];
++
+ // static
+ int SysInfo::NumberOfProcessors() {
+- int mib[] = {CTL_HW, HW_NCPU};
++ int mib[] = {CTL_HW, HW_NCPUONLINE};
+ int ncpu;
+ size_t size = sizeof(ncpu);
+ if (sysctl(mib, base::size(mib), &ncpu, &size, NULL, 0) < 0) {
+@@ -43,38 +50,62 @@ int SysInfo::NumberOfProcessors() {
+
+ // static
+ int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+- return AmountOfMemory(_SC_PHYS_PAGES);
++ // pledge(2)
++ if (!aofpmem)
++ aofpmem = AmountOfMemory(_SC_PHYS_PAGES);
++ return aofpmem;
+ }
+
+ // static
+ int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
+ // We should add inactive file-backed memory also but there is no such
+ // information from OpenBSD unfortunately.
+- return AmountOfMemory(_SC_AVPHYS_PAGES);
++ // pledge(2)
++ if (!aofapmem)
++ aofapmem = AmountOfMemory(_SC_AVPHYS_PAGES);
++ return aofapmem;
+ }
+
+ // static
++std::string SysInfo::CPUModelName() {
++ int mib[] = {CTL_HW, HW_MODEL};
++ size_t len = base::size(cpumodel);
++
++ if (cpumodel[0] == '\0') {
++ if (sysctl(mib, base::size(mib), cpumodel, &len, NULL, 0) < 0)
++ return std::string();
++ }
++
++ return std::string(cpumodel, len - 1);
++}
++
++// static
+ uint64_t SysInfo::MaxSharedMemorySize() {
+ int mib[] = {CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX};
+ size_t limit;
+ size_t size = sizeof(limit);
++ // pledge(2)
++ if (shmmax)
++ goto out;
+ if (sysctl(mib, base::size(mib), &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ return 0;
+ }
+- return static_cast<uint64_t>(limit);
++ shmmax = static_cast<uint64_t>(limit);
++out:
++ return shmmax;
+ }
+
+ // static
+-std::string SysInfo::CPUModelName() {
+- int mib[] = {CTL_HW, HW_MODEL};
+- char name[256];
+- size_t len = base::size(name);
+- if (sysctl(mib, base::size(mib), name, &len, NULL, 0) < 0) {
+- NOTREACHED();
+- return std::string();
+- }
+- return name;
++SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
++ HardwareInfo info;
++ // Set the manufacturer to "OpenBSD" and the model to
++ // an empty string.
++ info.manufacturer = "OpenBSD";
++ info.model = HardwareModelName();
++ DCHECK(IsStringUTF8(info.manufacturer));
++ DCHECK(IsStringUTF8(info.model));
++ return info;
+ }
+
+ } // namespace base
diff --git a/devel/electron18/files/patch-base_system_sys__info__posix.cc b/devel/electron18/files/patch-base_system_sys__info__posix.cc
new file mode 100644
index 000000000000..f432ba53ef73
--- /dev/null
+++ b/devel/electron18/files/patch-base_system_sys__info__posix.cc
@@ -0,0 +1,43 @@
+--- base/system/sys_info_posix.cc.orig 2022-05-19 05:17:34 UTC
++++ base/system/sys_info_posix.cc
+@@ -37,7 +37,7 @@
+
+ namespace {
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ int NumberOfProcessors() {
+ // sysconf returns the number of "logical" (not "physical") processors on both
+ // Mac and Linux. So we get the number of max available "logical" processors.
+@@ -77,7 +77,7 @@ int NumberOfProcessors() {
+
+ base::LazyInstance<base::internal::LazySysInfoValue<int, NumberOfProcessors>>::
+ Leaky g_lazy_number_of_processors = LAZY_INSTANCE_INITIALIZER;
+-#endif // !BUILDFLAG(IS_OPENBSD)
++#endif // !BUILDFLAG(IS_BSD)
+
+ int64_t AmountOfVirtualMemory() {
+ struct rlimit limit;
+@@ -143,11 +143,11 @@ bool GetDiskSpaceInfo(const base::FilePath& path,
+
+ namespace base {
+
+-#if !BUILDFLAG(IS_OPENBSD)
++#if !BUILDFLAG(IS_BSD)
+ int SysInfo::NumberOfProcessors() {
+ return g_lazy_number_of_processors.Get().value();
+ }
+-#endif // !BUILDFLAG(IS_OPENBSD)
++#endif // !BUILDFLAG(IS_BSD)
+
+ // static
+ int64_t SysInfo::AmountOfVirtualMemory() {
+@@ -239,6 +239,8 @@ std::string SysInfo::OperatingSystemArchitecture() {
+ arch = "x86";
+ } else if (arch == "amd64") {
+ arch = "x86_64";
++ } else if (arch == "arm64") {
++ arch = "aarch64";
+ } else if (std::string(info.sysname) == "AIX") {
+ arch = "ppc64";
+ }
diff --git a/devel/electron18/files/patch-base_system_sys__info__unittest.cc b/devel/electron18/files/patch-base_system_sys__info__unittest.cc
new file mode 100644
index 000000000000..c4b3c8ab2554
--- /dev/null
+++ b/devel/electron18/files/patch-base_system_sys__info__unittest.cc
@@ -0,0 +1,19 @@
+--- base/system/sys_info_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/system/sys_info_unittest.cc
+@@ -234,12 +234,15 @@ TEST_F(SysInfoTest, GetHardwareInfo) {
+ EXPECT_TRUE(IsStringUTF8(hardware_info->model));
+ bool empty_result_expected =
+ #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ false;
+ #else
+ true;
+ #endif
+ EXPECT_EQ(hardware_info->manufacturer.empty(), empty_result_expected);
++#if BUILDFLAG(IS_BSD)
++ empty_result_expected = true;
++#endif
+ EXPECT_EQ(hardware_info->model.empty(), empty_result_expected);
+ }
+
diff --git a/devel/electron18/files/patch-base_task_thread__pool_environment__config__unittest.cc b/devel/electron18/files/patch-base_task_thread__pool_environment__config__unittest.cc
new file mode 100644
index 000000000000..5bc518a80245
--- /dev/null
+++ b/devel/electron18/files/patch-base_task_thread__pool_environment__config__unittest.cc
@@ -0,0 +1,11 @@
+--- base/task/thread_pool/environment_config_unittest.cc.orig 2022-05-19 03:45:15 UTC
++++ base/task/thread_pool/environment_config_unittest.cc
+@@ -15,7 +15,7 @@ TEST(ThreadPoolEnvironmentConfig, CanUseBackgroundPrio
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)
+ EXPECT_TRUE(CanUseBackgroundPriorityForWorkerThread());
+ #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
+ EXPECT_FALSE(CanUseBackgroundPriorityForWorkerThread());
+ #else
+ #error Platform doesn't match any block
diff --git a/devel/electron18/files/patch-base_test_launcher_test__launcher.cc b/devel/electron18/files/patch-base_test_launcher_test__launcher.cc
new file mode 100644
index 000000000000..40b7f7a101bc
--- /dev/null
+++ b/devel/electron18/files/patch-base_test_launcher_test__launcher.cc
@@ -0,0 +1,10 @@
+--- base/test/launcher/test_launcher.cc.orig 2022-05-19 03:45:15 UTC
++++ base/test/launcher/test_launcher.cc
+@@ -63,6 +63,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"
diff --git a/devel/electron18/files/patch-base_test_test__file__util__linux.cc b/devel/electron18/files/patch-base_test_test__file__util__linux.cc
new file mode 100644
index 000000000000..283fbf69cd33
--- /dev/null
+++ b/devel/electron18/files/patch-base_test_test__file__util__linux.cc
@@ -0,0 +1,13 @@
+--- base/test/test_file_util_linux.cc.orig 2022-05-19 03:45:15 UTC
++++ base/test/test_file_util_linux.cc
+@@ -54,8 +54,10 @@ bool EvictFileFromSystemCache(const FilePath& file) {
+ return false;
+ if (fdatasync(fd.get()) != 0)
+ return false;
++#if !defined(OS_BSD)
+ if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0)
+ return false;
++#endif
+ return true;
+ }
+
diff --git a/devel/electron18/files/patch-base_test_test__file__util__posix.cc b/devel/electron18/files/patch-base_test_test__file__util__posix.cc
new file mode 100644
index 000000000000..a28748325cf0
--- /dev/null
+++ b/devel/electron18/files/patch-base_test_test__file__util__posix.cc
@@ -0,0 +1,11 @@
+--- base/test/test_file_util_posix.cc.orig 2022-05-19 03:45:15 UTC
++++ base/test/test_file_util_posix.cc
+@@ -88,7 +88,7 @@ void SyncPageCacheToDisk() {
+ }
+
+ #if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_APPLE) && \
+- !BUILDFLAG(IS_ANDROID)
++ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD)
+ bool EvictFileFromSystemCache(const FilePath& file) {
+ // There doesn't seem to be a POSIX way to cool the disk cache.
+ NOTIMPLEMENTED();
diff --git a/devel/electron18/files/patch-base_third__party_libevent_BUILD.gn b/devel/electron18/files/patch-base_third__party_libevent_BUILD.gn
new file mode 100644
index 000000000000..54a799039c66
--- /dev/null
+++ b/devel/electron18/files/patch-base_third__party_libevent_BUILD.gn
@@ -0,0 +1,24 @@
+--- base/third_party/libevent/BUILD.gn.orig 2021-01-07 00:36:18 UTC
++++ base/third_party/libevent/BUILD.gn
+@@ -43,13 +43,20 @@ static_library("libevent") {
+ "mac/event-config.h",
+ ]
+ include_dirs = [ "mac" ]
+- } else if (is_linux || is_chromeos) {
++ } else if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "epoll.c",
+ "linux/config.h",
+ "linux/event-config.h",
+ ]
+ include_dirs = [ "linux" ]
++ } else if (is_bsd) {
++ sources += [
++ "kqueue.c",
++ "freebsd/config.h",
++ "freebsd/event-config.h",
++ ]
++ include_dirs = [ "freebsd" ]
+ } else if (is_android) {
+ sources += [
+ "android/config.h",
diff --git a/devel/electron18/files/patch-base_third__party_libevent_event-config.h b/devel/electron18/files/patch-base_third__party_libevent_event-config.h
new file mode 100644
index 000000000000..4bff75e5c811
--- /dev/null
+++ b/devel/electron18/files/patch-base_third__party_libevent_event-config.h
@@ -0,0 +1,11 @@
+--- base/third_party/libevent/event-config.h.orig 2022-05-11 07:00:27 UTC
++++ base/third_party/libevent/event-config.h
+@@ -13,6 +13,8 @@
+ #include "base/third_party/libevent/linux/event-config.h"
+ #elif defined(__FreeBSD__)
+ #include "base/third_party/libevent/freebsd/event-config.h"
++#elif defined(__OpenBSD__)
++#include "base/third_party/libevent/openbsd/event-config.h"
+ #elif defined(__sun)
+ #include "base/third_party/libevent/solaris/event-config.h"
+ #elif defined(_AIX)
diff --git a/devel/electron18/files/patch-base_third__party_libevent_openbsd_config.h b/devel/electron18/files/patch-base_third__party_libevent_openbsd_config.h
new file mode 100644
index 000000000000..cb325373930e
--- /dev/null
+++ b/devel/electron18/files/patch-base_third__party_libevent_openbsd_config.h
@@ -0,0 +1,279 @@
+--- base/third_party/libevent/openbsd/config.h.orig 2022-05-13 07:20:04 UTC
++++ base/third_party/libevent/openbsd/config.h
+@@ -0,0 +1,276 @@
++/* config.h. Generated from config.h.in by configure. */
++/* config.h.in. Generated from configure.in by autoheader. */
++
++/* Define if clock_gettime is available in libc */
++#define DNS_USE_CPU_CLOCK_FOR_ID 1
++
++/* Define is no secure id variant is available */
++/* #undef DNS_USE_GETTIMEOFDAY_FOR_ID */
++
++/* Define to 1 if you have the `clock_gettime' function. */
++#define HAVE_CLOCK_GETTIME 1
++
++/* Define if /dev/poll is available */
++/* #undef HAVE_DEVPOLL */
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#define HAVE_DLFCN_H 1
++
++/* Define if your system supports the epoll system calls */
++/* #undef HAVE_EPOLL */
++
++/* Define to 1 if you have the `epoll_ctl' function. */
++/* #undef HAVE_EPOLL_CTL */
++
++/* Define if your system supports event ports */
++/* #undef HAVE_EVENT_PORTS */
++
++/* Define to 1 if you have the `fcntl' function. */
++#define HAVE_FCNTL 1
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#define HAVE_FCNTL_H 1
++
++/* Define to 1 if the system has the type `fd_mask'. */
++#define HAVE_FD_MASK 1
++
++/* Define to 1 if you have the `getaddrinfo' function. */
++#define HAVE_GETADDRINFO 1
++
++/* Define to 1 if you have the `getegid' function. */
++#define HAVE_GETEGID 1
++
++/* Define to 1 if you have the `geteuid' function. */
++#define HAVE_GETEUID 1
++
++/* Define to 1 if you have the `getnameinfo' function. */
++#define HAVE_GETNAMEINFO 1
++
++/* Define to 1 if you have the `gettimeofday' function. */
++#define HAVE_GETTIMEOFDAY 1
++
++/* Define to 1 if you have the `inet_ntop' function. */
++#define HAVE_INET_NTOP 1
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#define HAVE_INTTYPES_H 1
++
++/* Define to 1 if you have the `issetugid' function. */
++#define HAVE_ISSETUGID 1
++
++/* Define to 1 if you have the `kqueue' function. */
++#define HAVE_KQUEUE 1
++
++/* Define to 1 if you have the `nsl' library (-lnsl). */
++/* #undef HAVE_LIBNSL */
++
++/* Define to 1 if you have the `resolv' library (-lresolv). */
++/* #undef HAVE_LIBRESOLV */
++
++/* Define to 1 if you have the `rt' library (-lrt). */
++/* #undef HAVE_LIBRT */
++
++/* Define to 1 if you have the `socket' library (-lsocket). */
++/* #undef HAVE_LIBSOCKET */
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the <netinet/in6.h> header file. */
++/* #undef HAVE_NETINET_IN6_H */
++
++/* Define to 1 if you have the `poll' function. */
++#define HAVE_POLL 1
++
++/* Define to 1 if you have the <poll.h> header file. */
++#define HAVE_POLL_H 1
++
++/* Define to 1 if you have the `port_create' function. */
++/* #undef HAVE_PORT_CREATE */
++
++/* Define to 1 if you have the <port.h> header file. */
++/* #undef HAVE_PORT_H */
++
++/* Define to 1 if you have the `select' function. */
++#define HAVE_SELECT 1
++
++/* Define if F_SETFD is defined in <fcntl.h> */
++#define HAVE_SETFD 1
++
++/* Define to 1 if you have the `sigaction' function. */
++#define HAVE_SIGACTION 1
++
++/* Define to 1 if you have the `signal' function. */
++#define HAVE_SIGNAL 1
++
++/* Define to 1 if you have the <signal.h> header file. */
++#define HAVE_SIGNAL_H 1
++
++/* Define to 1 if you have the <stdarg.h> header file. */
++#define HAVE_STDARG_H 1
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#define HAVE_STDINT_H 1
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#define HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++#define HAVE_STRINGS_H 1
++
++/* Define to 1 if you have the <string.h> header file. */
++#define HAVE_STRING_H 1
++
++/* Define to 1 if you have the `strlcpy' function. */
++#define HAVE_STRLCPY 1
++
++/* Define to 1 if you have the `strsep' function. */
++#define HAVE_STRSEP 1
++
++/* Define to 1 if you have the `strtok_r' function. */
++#define HAVE_STRTOK_R 1
++
++/* Define to 1 if you have the `strtoll' function. */
++#define HAVE_STRTOLL 1
++
++/* Define to 1 if the system has the type `struct in6_addr'. */
++#define HAVE_STRUCT_IN6_ADDR 1
++
++/* Define to 1 if you have the <sys/devpoll.h> header file. */
++/* #undef HAVE_SYS_DEVPOLL_H */
++
++/* Define to 1 if you have the <sys/epoll.h> header file. */
++/* #undef HAVE_SYS_EPOLL_H */
++
++/* Define to 1 if you have the <sys/event.h> header file. */
++#define HAVE_SYS_EVENT_H 1
++
++/* Define to 1 if you have the <sys/ioctl.h> header file. */
++#define HAVE_SYS_IOCTL_H 1
++
++/* Define to 1 if you have the <sys/param.h> header file. */
++#define HAVE_SYS_PARAM_H 1
++
++/* Define to 1 if you have the <sys/queue.h> header file. */
++#define HAVE_SYS_QUEUE_H 1
++
++/* Define to 1 if you have the <sys/select.h> header file. */
++#define HAVE_SYS_SELECT_H 1
++
++/* Define to 1 if you have the <sys/socket.h> header file. */
++#define HAVE_SYS_SOCKET_H 1
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/time.h> header file. */
++#define HAVE_SYS_TIME_H 1
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#define HAVE_SYS_TYPES_H 1
++
++/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
++#define HAVE_TAILQFOREACH 1
++
++/* Define if timeradd is defined in <sys/time.h> */
++#define HAVE_TIMERADD 1
++
++/* Define if timerclear is defined in <sys/time.h> */
++#define HAVE_TIMERCLEAR 1
++
++/* Define if timercmp is defined in <sys/time.h> */
++#define HAVE_TIMERCMP 1
++
++/* Define if timerisset is defined in <sys/time.h> */
++#define HAVE_TIMERISSET 1
++
++/* Define to 1 if the system has the type `uint16_t'. */
++#define HAVE_UINT16_T 1
++
++/* Define to 1 if the system has the type `uint32_t'. */
++#define HAVE_UINT32_T 1
++
++/* Define to 1 if the system has the type `uint64_t'. */
++#define HAVE_UINT64_T 1
++
++/* Define to 1 if the system has the type `uint8_t'. */
++#define HAVE_UINT8_T 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define HAVE_UNISTD_H 1
++
++/* Define to 1 if you have the `vasprintf' function. */
++#define HAVE_VASPRINTF 1
++
++/* Define if kqueue works correctly with pipes */
++#define HAVE_WORKING_KQUEUE 1
++
++/* Define to the sub-directory in which libtool stores uninstalled libraries.
++ */
++#define LT_OBJDIR ".libs/"
++
++/* Numeric representation of the version */
++#define NUMERIC_VERSION 0x01040f00
++
++/* Name of package */
++#define PACKAGE "libevent"
++
++/* Define to the address where bug reports for this package should be sent. */
++#define PACKAGE_BUGREPORT ""
++
++/* Define to the full name of this package. */
++#define PACKAGE_NAME ""
++
++/* Define to the full name and version of this package. */
++#define PACKAGE_STRING ""
++
++/* Define to the one symbol short name of this package. */
++#define PACKAGE_TARNAME ""
++
++/* Define to the home page for this package. */
++#define PACKAGE_URL ""
++
++/* Define to the version of this package. */
++#define PACKAGE_VERSION ""
++
++/* The size of `int', as computed by sizeof. */
++#define SIZEOF_INT 4
++
++/* The size of `long', as computed by sizeof. */
++#define SIZEOF_LONG 8
++
++/* The size of `long long', as computed by sizeof. */
++#define SIZEOF_LONG_LONG 8
++
++/* The size of `short', as computed by sizeof. */
++#define SIZEOF_SHORT 2
++
++/* Define to 1 if you have the ANSI C header files. */
++#define STDC_HEADERS 1
++
++/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
++#define TIME_WITH_SYS_TIME 1
++
++/* Version number of package */
++#define VERSION "1.4.15"
++
++/* Define to appropriate substitue if compiler doesnt have __func__ */
++/* #undef __func__ */
++
++/* Define to empty if `const' does not conform to ANSI C. */
++/* #undef const */
++
++/* Define to `__inline__' or `__inline' if that's what the C compiler
++ calls it, or to nothing if 'inline' is not supported under any name. */
++#ifndef __cplusplus
++/* #undef inline */
++#endif
++
++/* Define to `int' if <sys/types.h> does not define. */
++/* #undef pid_t */
++
++/* Define to `unsigned int' if <sys/types.h> does not define. */
++/* #undef size_t */
++
++/* Define to unsigned int if you dont have it */
++/* #undef socklen_t */
diff --git a/devel/electron18/files/patch-base_third__party_libevent_openbsd_event-config.h b/devel/electron18/files/patch-base_third__party_libevent_openbsd_event-config.h
new file mode 100644
index 000000000000..39e595ac1ef3
--- /dev/null
+++ b/devel/electron18/files/patch-base_third__party_libevent_openbsd_event-config.h
@@ -0,0 +1,287 @@
+--- base/third_party/libevent/openbsd/event-config.h.orig 2022-05-13 07:20:04 UTC
++++ base/third_party/libevent/openbsd/event-config.h
+@@ -0,0 +1,284 @@
++/* event-config.h
++ * Generated by autoconf; post-processed by libevent.
++ * Do not edit this file.
++ * Do not rely on macros in this file existing in later versions.
++ */
++#ifndef _EVENT_CONFIG_H_
++#define _EVENT_CONFIG_H_
++/* config.h. Generated from config.h.in by configure. */
++/* config.h.in. Generated from configure.in by autoheader. */
++
++/* Define if clock_gettime is available in libc */
++#define _EVENT_DNS_USE_CPU_CLOCK_FOR_ID 1
++
++/* Define is no secure id variant is available */
++/* #undef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID */
++
++/* Define to 1 if you have the `clock_gettime' function. */
++#define _EVENT_HAVE_CLOCK_GETTIME 1
++
++/* Define if /dev/poll is available */
++/* #undef _EVENT_HAVE_DEVPOLL */
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#define _EVENT_HAVE_DLFCN_H 1
++
++/* Define if your system supports the epoll system calls */
++/* #undef _EVENT_HAVE_EPOLL */
++
++/* Define to 1 if you have the `epoll_ctl' function. */
++/* #undef _EVENT_HAVE_EPOLL_CTL */
++
++/* Define if your system supports event ports */
++/* #undef _EVENT_HAVE_EVENT_PORTS */
++
++/* Define to 1 if you have the `fcntl' function. */
++#define _EVENT_HAVE_FCNTL 1
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#define _EVENT_HAVE_FCNTL_H 1
++
++/* Define to 1 if the system has the type `fd_mask'. */
++#define _EVENT_HAVE_FD_MASK 1
++
++/* Define to 1 if you have the `getaddrinfo' function. */
++#define _EVENT_HAVE_GETADDRINFO 1
++
++/* Define to 1 if you have the `getegid' function. */
++#define _EVENT_HAVE_GETEGID 1
++
++/* Define to 1 if you have the `geteuid' function. */
++#define _EVENT_HAVE_GETEUID 1
++
++/* Define to 1 if you have the `getnameinfo' function. */
++#define _EVENT_HAVE_GETNAMEINFO 1
++
++/* Define to 1 if you have the `gettimeofday' function. */
++#define _EVENT_HAVE_GETTIMEOFDAY 1
++
++/* Define to 1 if you have the `inet_ntop' function. */
++#define _EVENT_HAVE_INET_NTOP 1
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#define _EVENT_HAVE_INTTYPES_H 1
++
++/* Define to 1 if you have the `issetugid' function. */
++#define _EVENT_HAVE_ISSETUGID 1
++
++/* Define to 1 if you have the `kqueue' function. */
++#define _EVENT_HAVE_KQUEUE 1
++
++/* Define to 1 if you have the `nsl' library (-lnsl). */
++/* #undef _EVENT_HAVE_LIBNSL */
++
++/* Define to 1 if you have the `resolv' library (-lresolv). */
++/* #undef _EVENT_HAVE_LIBRESOLV */
++
++/* Define to 1 if you have the `rt' library (-lrt). */
++/* #undef _EVENT_HAVE_LIBRT */
++
++/* Define to 1 if you have the `socket' library (-lsocket). */
++/* #undef _EVENT_HAVE_LIBSOCKET */
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define _EVENT_HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the <netinet/in6.h> header file. */
++/* #undef _EVENT_HAVE_NETINET_IN6_H */
++
++/* Define to 1 if you have the `poll' function. */
++#define _EVENT_HAVE_POLL 1
++
++/* Define to 1 if you have the <poll.h> header file. */
++#define _EVENT_HAVE_POLL_H 1
++
++/* Define to 1 if you have the `port_create' function. */
++/* #undef _EVENT_HAVE_PORT_CREATE */
++
++/* Define to 1 if you have the <port.h> header file. */
++/* #undef _EVENT_HAVE_PORT_H */
++
++/* Define to 1 if you have the `select' function. */
++#define _EVENT_HAVE_SELECT 1
++
++/* Define if F_SETFD is defined in <fcntl.h> */
++#define _EVENT_HAVE_SETFD 1
++
++/* Define to 1 if you have the `sigaction' function. */
++#define _EVENT_HAVE_SIGACTION 1
++
++/* Define to 1 if you have the `signal' function. */
++#define _EVENT_HAVE_SIGNAL 1
++
++/* Define to 1 if you have the <signal.h> header file. */
++#define _EVENT_HAVE_SIGNAL_H 1
++
++/* Define to 1 if you have the <stdarg.h> header file. */
++#define _EVENT_HAVE_STDARG_H 1
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#define _EVENT_HAVE_STDINT_H 1
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#define _EVENT_HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++#define _EVENT_HAVE_STRINGS_H 1
++
++/* Define to 1 if you have the <string.h> header file. */
++#define _EVENT_HAVE_STRING_H 1
++
++/* Define to 1 if you have the `strlcpy' function. */
++#define _EVENT_HAVE_STRLCPY 1
++
++/* Define to 1 if you have the `strsep' function. */
++#define _EVENT_HAVE_STRSEP 1
++
++/* Define to 1 if you have the `strtok_r' function. */
++#define _EVENT_HAVE_STRTOK_R 1
++
++/* Define to 1 if you have the `strtoll' function. */
++#define _EVENT_HAVE_STRTOLL 1
++
++/* Define to 1 if the system has the type `struct in6_addr'. */
++#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
++
++/* Define to 1 if you have the <sys/devpoll.h> header file. */
++/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
++
++/* Define to 1 if you have the <sys/epoll.h> header file. */
++/* #undef _EVENT_HAVE_SYS_EPOLL_H */
++
++/* Define to 1 if you have the <sys/event.h> header file. */
++#define _EVENT_HAVE_SYS_EVENT_H 1
++
++/* Define to 1 if you have the <sys/ioctl.h> header file. */
++#define _EVENT_HAVE_SYS_IOCTL_H 1
++
++/* Define to 1 if you have the <sys/param.h> header file. */
++#define _EVENT_HAVE_SYS_PARAM_H 1
++
++/* Define to 1 if you have the <sys/queue.h> header file. */
++#define _EVENT_HAVE_SYS_QUEUE_H 1
++
++/* Define to 1 if you have the <sys/select.h> header file. */
++#define _EVENT_HAVE_SYS_SELECT_H 1
++
++/* Define to 1 if you have the <sys/socket.h> header file. */
++#define _EVENT_HAVE_SYS_SOCKET_H 1
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define _EVENT_HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/time.h> header file. */
++#define _EVENT_HAVE_SYS_TIME_H 1
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#define _EVENT_HAVE_SYS_TYPES_H 1
++
++/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
++#define _EVENT_HAVE_TAILQFOREACH 1
++
++/* Define if timeradd is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERADD 1
++
++/* Define if timerclear is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERCLEAR 1
++
++/* Define if timercmp is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERCMP 1
++
++/* Define if timerisset is defined in <sys/time.h> */
++#define _EVENT_HAVE_TIMERISSET 1
++
++/* Define to 1 if the system has the type `uint16_t'. */
++#define _EVENT_HAVE_UINT16_T 1
++
++/* Define to 1 if the system has the type `uint32_t'. */
++#define _EVENT_HAVE_UINT32_T 1
++
++/* Define to 1 if the system has the type `uint64_t'. */
++#define _EVENT_HAVE_UINT64_T 1
++
++/* Define to 1 if the system has the type `uint8_t'. */
++#define _EVENT_HAVE_UINT8_T 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define _EVENT_HAVE_UNISTD_H 1
++
++/* Define to 1 if you have the `vasprintf' function. */
++#define _EVENT_HAVE_VASPRINTF 1
++
++/* Define if kqueue works correctly with pipes */
++#define _EVENT_HAVE_WORKING_KQUEUE 1
++
++/* Define to the sub-directory in which libtool stores uninstalled libraries.
++ */
++#define _EVENT_LT_OBJDIR ".libs/"
++
++/* Numeric representation of the version */
++#define _EVENT_NUMERIC_VERSION 0x01040f00
++
++/* Name of package */
++#define _EVENT_PACKAGE "libevent"
++
++/* Define to the address where bug reports for this package should be sent. */
++#define _EVENT_PACKAGE_BUGREPORT ""
++
++/* Define to the full name of this package. */
++#define _EVENT_PACKAGE_NAME ""
++
++/* Define to the full name and version of this package. */
++#define _EVENT_PACKAGE_STRING ""
++
++/* Define to the one symbol short name of this package. */
++#define _EVENT_PACKAGE_TARNAME ""
++
++/* Define to the home page for this package. */
++#define _EVENT_PACKAGE_URL ""
++
++/* Define to the version of this package. */
++#define _EVENT_PACKAGE_VERSION ""
++
++/* The size of `int', as computed by sizeof. */
++#define _EVENT_SIZEOF_INT 4
++
++/* The size of `long', as computed by sizeof. */
++#define _EVENT_SIZEOF_LONG 8
++
++/* The size of `long long', as computed by sizeof. */
++#define _EVENT_SIZEOF_LONG_LONG 8
++
++/* The size of `short', as computed by sizeof. */
++#define _EVENT_SIZEOF_SHORT 2
++
++/* Define to 1 if you have the ANSI C header files. */
++#define _EVENT_STDC_HEADERS 1
++
++/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
++#define _EVENT_TIME_WITH_SYS_TIME 1
++
++/* Version number of package */
++#define _EVENT_VERSION "1.4.15"
++
++/* Define to appropriate substitue if compiler doesnt have __func__ */
++/* #undef _EVENT___func__ */
++
++/* Define to empty if `const' does not conform to ANSI C. */
++/* #undef _EVENT_const */
++
++/* Define to `__inline__' or `__inline' if that's what the C compiler
++ calls it, or to nothing if 'inline' is not supported under any name. */
++#ifndef _EVENT___cplusplus
++/* #undef _EVENT_inline */
++#endif
++
++/* Define to `int' if <sys/types.h> does not define. */
++/* #undef _EVENT_pid_t */
++
++/* Define to `unsigned int' if <sys/types.h> does not define. */
++/* #undef _EVENT_size_t */
++
++/* Define to unsigned int if you dont have it */
++/* #undef _EVENT_socklen_t */
++#endif
diff --git a/devel/electron18/files/patch-base_third__party_symbolize_symbolize.cc b/devel/electron18/files/patch-base_third__party_symbolize_symbolize.cc
new file mode 100644
index 000000000000..8b997ff53cb8
--- /dev/null
+++ b/devel/electron18/files/patch-base_third__party_symbolize_symbolize.cc
@@ -0,0 +1,11 @@
+--- base/third_party/symbolize/symbolize.cc.orig 2022-05-19 03:45:15 UTC
++++ base/third_party/symbolize/symbolize.cc
+@@ -114,7 +114,7 @@ _END_GOOGLE_NAMESPACE_
+ #if defined(HAVE_DLFCN_H)
+ #include <dlfcn.h>
+ #endif
+-#if BUILDFLAG(IS_OPENBSD)
++#if defined(__OpenBSD__)
+ #include <sys/exec_elf.h>
+ #else
+ #include <elf.h>
diff --git a/devel/electron18/files/patch-base_threading_platform__thread.h b/devel/electron18/files/patch-base_threading_platform__thread.h
new file mode 100644
index 000000000000..8bc0277df4f5
--- /dev/null
+++ b/devel/electron18/files/patch-base_threading_platform__thread.h
@@ -0,0 +1,11 @@
+--- base/threading/platform_thread.h.orig 2022-05-19 05:17:34 UTC
++++ base/threading/platform_thread.h
+@@ -205,7 +205,7 @@ class BASE_EXPORT PlatformThread {
+ // Returns a realtime period provided by `delegate`.
+ static TimeDelta GetRealtimePeriod(Delegate* delegate);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Toggles a specific thread's priority at runtime. This can be used to
+ // change the priority of a thread in a different process and will fail
+ // if the calling process does not have proper permissions. The
diff --git a/devel/electron18/files/patch-base_threading_platform__thread__linux.cc b/devel/electron18/files/patch-base_threading_platform__thread__linux.cc
new file mode 100644
index 000000000000..d61688b47745
--- /dev/null
+++ b/devel/electron18/files/patch-base_threading_platform__thread__linux.cc
@@ -0,0 +1,77 @@
+--- base/threading/platform_thread_linux.cc.orig 2022-05-19 05:17:34 UTC
++++ base/threading/platform_thread_linux.cc
+@@ -29,7 +29,9 @@
+
+ #if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX)
+ #include <pthread.h>
++#if !BUILDFLAG(IS_BSD)
+ #include <sys/prctl.h>
++#endif
+ #include <sys/resource.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+@@ -132,7 +134,7 @@ int sched_setattr(pid_t pid,
+ #endif // !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX)
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ const FilePath::CharType kCgroupDirectory[] =
+ FILE_PATH_LITERAL("/sys/fs/cgroup");
+
+@@ -286,7 +288,7 @@ void SetThreadCgroupsForThreadPriority(PlatformThreadI
+ namespace internal {
+
+ namespace {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ const struct sched_param kRealTimePrio = {8};
+ #endif
+ } // namespace
+@@ -299,7 +301,7 @@ const ThreadPriorityToNiceValuePair kThreadPriorityToN
+ };
+
+ bool CanSetThreadPriorityToRealtimeAudio() {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ // A non-zero soft-limit on RLIMIT_RTPRIO is required to be allowed to invoke
+ // pthread_setschedparam in SetCurrentThreadPriorityForPlatform().
+ struct rlimit rlim;
+@@ -310,7 +312,7 @@ bool CanSetThreadPriorityToRealtimeAudio() {
+ }
+
+ bool SetCurrentThreadPriorityForPlatform(ThreadPriority priority) {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ // For legacy schedtune interface
+ SetThreadCgroupsForThreadPriority(PlatformThread::CurrentId(), priority);
+
+@@ -328,7 +330,7 @@ bool SetCurrentThreadPriorityForPlatform(ThreadPriorit
+ }
+
+ absl::optional<ThreadPriority> GetCurrentThreadPriorityForPlatform() {
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ int maybe_sched_rr = 0;
+ struct sched_param maybe_realtime_prio = {0};
+ if (pthread_getschedparam(pthread_self(), &maybe_sched_rr,
+@@ -347,7 +349,7 @@ absl::optional<ThreadPriority> GetCurrentThreadPriorit
+ void PlatformThread::SetName(const std::string& name) {
+ ThreadIdNameManager::GetInstance()->SetName(name);
+
+-#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) && !BUILDFLAG(IS_BSD)
+ // On linux we can get the thread names to show up in the debugger by setting
+ // the process name for the LWP. We don't want to do this for the main
+ // thread because that would rename the process, causing tools like killall
+@@ -377,8 +379,10 @@ void PlatformThread::SetThreadPriority(ProcessId proce
+ // priority.
+ CHECK_NE(thread_id, process_id);
+
++#if !BUILDFLAG(IS_BSD)
+ // For legacy schedtune interface
+ SetThreadCgroupsForThreadPriority(thread_id, priority);
++#endif
+
+ #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ // For upstream uclamp interface. We try both legacy (schedtune, as done
diff --git a/devel/electron18/files/patch-base_threading_platform__thread__posix.cc b/devel/electron18/files/patch-base_threading_platform__thread__posix.cc
new file mode 100644
index 000000000000..54b3183cfd2d
--- /dev/null
+++ b/devel/electron18/files/patch-base_threading_platform__thread__posix.cc
@@ -0,0 +1,21 @@
+--- base/threading/platform_thread_posix.cc.orig 2022-05-20 04:30:53 UTC
++++ base/threading/platform_thread_posix.cc
+@@ -76,7 +76,7 @@ void* ThreadFunc(void* params) {
+ if (!thread_params->joinable)
+ base::DisallowSingleton();
+
+-#if !BUILDFLAG(IS_NACL)
++#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
+ #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && defined(PA_ALLOW_PCSCAN)
+ internal::PCScan::NotifyThreadCreated(internal::GetStackPointer());
+ #endif
+@@ -363,6 +363,9 @@ bool PlatformThread::CanChangeThreadPriority(ThreadPri
+ // static
+ void PlatformThread::SetCurrentThreadPriorityImpl(ThreadPriority priority) {
+ #if BUILDFLAG(IS_NACL)
++ NOTIMPLEMENTED();
++// avoid pledge(2) violation
++#elif BUILDFLAG(IS_BSD)
+ NOTIMPLEMENTED();
+ #else
+ if (internal::SetCurrentThreadPriorityForPlatform(priority))
diff --git a/devel/electron18/files/patch-base_threading_platform__thread__unittest.cc b/devel/electron18/files/patch-base_threading_platform__thread__unittest.cc
new file mode 100644
index 000000000000..01f64b2f17e0
--- /dev/null
+++ b/devel/electron18/files/patch-base_threading_platform__thread__unittest.cc
@@ -0,0 +1,47 @@
+--- base/threading/platform_thread_unittest.cc.orig 2022-05-19 05:17:34 UTC
++++ base/threading/platform_thread_unittest.cc
+@@ -30,7 +30,7 @@
+ #include "base/time/time.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include <pthread.h>
+ #include <sys/syscall.h>
+ #include <sys/types.h>
+@@ -319,7 +319,7 @@ TEST(PlatformThreadTest,
+ // and hardcodes what we know. Please inform scheduler-dev@chromium.org if this
+ // proprerty changes for a given platform.
+ TEST(PlatformThreadTest, CanChangeThreadPriority) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Ubuntu, RLIMIT_NICE and RLIMIT_RTPRIO are 0 by default, so we won't be
+ // able to increase priority to any level.
+ constexpr bool kCanIncreasePriority = false;
+@@ -417,7 +417,7 @@ TEST(PlatformThreadTest, SetHugeThreadName) {
+ TEST(PlatformThreadTest, GetDefaultThreadStackSize) {
+ size_t stack_size = PlatformThread::GetDefaultThreadStackSize();
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA) || \
+- ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
++ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)) && \
+ !defined(THREAD_SANITIZER)) || \
+ (BUILDFLAG(IS_ANDROID) && !defined(ADDRESS_SANITIZER))
+ EXPECT_EQ(0u, stack_size);
+@@ -578,12 +578,16 @@ INSTANTIATE_TEST_SUITE_P(
+
+ #endif // BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+
+ namespace {
+
+ bool IsTidCacheCorrect() {
++#if BUILDFLAG(IS_BSD)
++ return PlatformThread::CurrentId() == reinterpret_cast<int64_t>(pthread_self());
++#else
+ return PlatformThread::CurrentId() == syscall(__NR_gettid);
++#endif
+ }
+
+ void* CheckTidCacheCorrectWrapper(void*) {
diff --git a/devel/electron18/files/patch-base_time_time.cc b/devel/electron18/files/patch-base_time_time.cc
new file mode 100644
index 000000000000..d430a9f89743
--- /dev/null
+++ b/devel/electron18/files/patch-base_time_time.cc
@@ -0,0 +1,11 @@
+--- base/time/time.cc.orig 2022-05-19 05:17:34 UTC
++++ base/time/time.cc
+@@ -6,7 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // time.h is a widely included header and its size impacts build time.
+ // Try not to raise this limit unless necessary. See
+ // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md
diff --git a/devel/electron18/files/patch-base_trace__event_malloc__dump__provider.cc b/devel/electron18/files/patch-base_trace__event_malloc__dump__provider.cc
new file mode 100644
index 000000000000..4ddb620b3068
--- /dev/null
+++ b/devel/electron18/files/patch-base_trace__event_malloc__dump__provider.cc
@@ -0,0 +1,21 @@
+--- base/trace_event/malloc_dump_provider.cc.orig 2022-05-19 05:17:34 UTC
++++ base/trace_event/malloc_dump_provider.cc
+@@ -23,6 +23,8 @@
+
+ #if BUILDFLAG(IS_APPLE)
+ #include <malloc/malloc.h>
++#elif defined(OS_BSD)
++#include <stdlib.h>
+ #else
+ #include <malloc.h>
+ #endif
+@@ -220,6 +222,9 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDump
+ &allocated_objects_count);
+ #elif BUILDFLAG(IS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
++#elif defined(OS_BSD)
++ total_virtual_size = 0;
++ allocated_objects_size = 0;
+ #else
+ #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 33)
diff --git a/devel/electron18/files/patch-base_trace__event_memory__dump__manager.cc b/devel/electron18/files/patch-base_trace__event_memory__dump__manager.cc
new file mode 100644
index 000000000000..1efe778a98d5
--- /dev/null
+++ b/devel/electron18/files/patch-base_trace__event_memory__dump__manager.cc
@@ -0,0 +1,11 @@
+--- base/trace_event/memory_dump_manager.cc.orig 2022-05-19 05:17:34 UTC
++++ base/trace_event/memory_dump_manager.cc
+@@ -82,7 +82,7 @@ const char* const MemoryDumpManager::kSystemAllocatorP
+ #if defined(MALLOC_MEMORY_TRACING_SUPPORTED)
+ MallocDumpProvider::kAllocatedObjects;
+ #else
+- nullptr;
++ "";
+ #endif
+
+ // static
diff --git a/devel/electron18/files/patch-base_trace__event_process__memory__dump.cc b/devel/electron18/files/patch-base_trace__event_process__memory__dump.cc
new file mode 100644
index 000000000000..41b5bc46151c
--- /dev/null
+++ b/devel/electron18/files/patch-base_trace__event_process__memory__dump.cc
@@ -0,0 +1,20 @@
+--- base/trace_event/process_memory_dump.cc.orig 2022-05-19 05:17:34 UTC
++++ base/trace_event/process_memory_dump.cc
+@@ -105,7 +105,7 @@ absl::optional<size_t> ProcessMemoryDump::CountResiden
+ #if BUILDFLAG(IS_WIN)
+ std::unique_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> vec(
+ new PSAPI_WORKING_SET_EX_INFORMATION[max_vec_size]);
+-#elif BUILDFLAG(IS_APPLE)
++#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ std::unique_ptr<char[]> vec(new char[max_vec_size]);
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+ std::unique_ptr<unsigned char[]> vec(new unsigned char[max_vec_size]);
+@@ -130,7 +130,7 @@ absl::optional<size_t> ProcessMemoryDump::CountResiden
+
+ 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(fuchsia): Port, see https://crbug.com/706592.
+ #elif BUILDFLAG(IS_APPLE)
+ // mincore in MAC does not fail with EAGAIN.
diff --git a/devel/electron18/files/patch-base_tracing_trace__time.cc b/devel/electron18/files/patch-base_tracing_trace__time.cc
new file mode 100644
index 000000000000..c1828596eb6b
--- /dev/null
+++ b/devel/electron18/files/patch-base_tracing_trace__time.cc
@@ -0,0 +1,28 @@
+--- base/tracing/trace_time.cc.orig 2022-05-19 03:45:15 UTC
++++ base/tracing/trace_time.cc
+@@ -8,13 +8,17 @@
+ #include "build/build_config.h"
+ #include "third_party/perfetto/include/perfetto/base/time.h"
+
++#if BUILDFLAG(IS_FREEBSD)
++#define CLOCK_BOOTTIME CLOCK_UPTIME
++#endif
++
+ namespace base {
+ namespace tracing {
+
+ int64_t TraceBootTicksNow() {
+ // On Windows and Mac, TRACE_TIME_TICKS_NOW() behaves like boottime already.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ struct timespec ts;
+ int res = clock_gettime(CLOCK_BOOTTIME, &ts);
+ if (res != -1)
+@@ -24,4 +28,4 @@ int64_t TraceBootTicksNow() {
+ }
+
+ } // namespace tracing
+-} // namespace base
+\ No newline at end of file
++} // namespace base
diff --git a/devel/electron18/files/patch-base_tracing_trace__time.h b/devel/electron18/files/patch-base_tracing_trace__time.h
new file mode 100644
index 000000000000..9fa633d5e882
--- /dev/null
+++ b/devel/electron18/files/patch-base_tracing_trace__time.h
@@ -0,0 +1,11 @@
+--- base/tracing/trace_time.h.orig 2022-05-19 03:45:15 UTC
++++ 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/devel/electron18/files/patch-build_config_BUILD.gn b/devel/electron18/files/patch-build_config_BUILD.gn
new file mode 100644
index 000000000000..1b155cd1a0f9
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_BUILD.gn
@@ -0,0 +1,22 @@
+--- build/config/BUILD.gn.orig 2022-05-19 03:45:15 UTC
++++ build/config/BUILD.gn
+@@ -218,13 +218,17 @@ config("default_libs") {
+ "CoreText.framework",
+ "Foundation.framework",
+ ]
+- } else if (is_linux || is_chromeos) {
++ } else if ((is_linux && !is_bsd) || is_chromeos) {
+ libs = [
+ "dl",
+ "pthread",
+ "rt",
+ ]
+- }
++ } else if (is_bsd) {
++ libs = [
++ "pthread",
++ ]
++ }
+ }
+
+ group("common_deps") {
diff --git a/devel/electron18/files/patch-build_config_BUILDCONFIG.gn b/devel/electron18/files/patch-build_config_BUILDCONFIG.gn
new file mode 100644
index 000000000000..63ac5fa67d60
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_BUILDCONFIG.gn
@@ -0,0 +1,45 @@
+--- build/config/BUILDCONFIG.gn.orig 2022-05-13 07:19:54 UTC
++++ build/config/BUILDCONFIG.gn
+@@ -139,7 +139,8 @@ declare_args() {
+ is_official_build = false
+
+ # Set to true when compiling with the Clang compiler.
+- is_clang = current_os != "linux" ||
++ is_clang = current_os != "linux" || current_os == "openbsd" ||
++ current_os == "freebsd" ||
+ (current_cpu != "s390x" && current_cpu != "s390" &&
+ current_cpu != "ppc64" && current_cpu != "ppc" &&
+ current_cpu != "mips" && current_cpu != "mips64" &&
+@@ -221,6 +222,10 @@ if (host_toolchain == "") {
+ host_toolchain = "//build/toolchain/aix:$host_cpu"
+ } else if (host_os == "zos") {
+ host_toolchain = "//build/toolchain/zos:$host_cpu"
++ } else if (host_os == "openbsd") {
++ host_toolchain = "//build/toolchain/openbsd:clang_$host_cpu"
++ } else if (host_os == "freebsd") {
++ host_toolchain = "//build/toolchain/freebsd:clang_$host_cpu"
+ } else {
+ assert(false, "Unsupported host_os: $host_os")
+ }
+@@ -265,6 +270,8 @@ if (target_os == "android") {
+ _default_toolchain = "//build/toolchain/aix:$target_cpu"
+ } else if (target_os == "zos") {
+ _default_toolchain = "//build/toolchain/zos:$target_cpu"
++} else if (target_os == "openbsd" || target_os == "freebsd") {
++ _default_toolchain = host_toolchain
+ } else {
+ assert(false, "Unsupported target_os: $target_os")
+ }
+@@ -299,7 +306,11 @@ is_android = current_os == "android"
+ is_chromeos = current_os == "chromeos"
+ is_fuchsia = current_os == "fuchsia"
+ is_ios = current_os == "ios"
+-is_linux = current_os == "linux"
++is_linux = current_os == "linux" || current_os == "openbsd" ||
++ current_os == "freebsd"
++is_openbsd = current_os == "openbsd"
++is_freebsd = current_os == "freebsd"
++is_bsd = current_os == "openbsd" || current_os == "freebsd"
+ is_mac = current_os == "mac"
+ is_nacl = current_os == "nacl"
+ is_win = current_os == "win" || current_os == "winuwp"
diff --git a/devel/electron18/files/patch-build_config_compiler_BUILD.gn b/devel/electron18/files/patch-build_config_compiler_BUILD.gn
new file mode 100644
index 000000000000..e19141bd19a2
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_compiler_BUILD.gn
@@ -0,0 +1,113 @@
+--- build/config/compiler/BUILD.gn.orig 2022-05-19 05:17:34 UTC
++++ build/config/compiler/BUILD.gn
+@@ -236,13 +236,16 @@ config("default_include_dirs") {
+ # Compiler instrumentation can introduce dependencies in DSOs to symbols in
+ # the executable they are loaded into, so they are unresolved at link-time.
+ config("no_unresolved_symbols") {
+- if (!using_sanitizer &&
++ if (!using_sanitizer && !is_bsd &&
+ (is_linux || is_chromeos || is_android || is_fuchsia)) {
+ ldflags = [
+ "-Wl,-z,defs",
+ "-Wl,--as-needed",
+ ]
+ }
++ if (current_cpu == "x86" && is_openbsd) {
++ ldflags = [ "-Wl,-z,notext" ]
++ }
+ }
+
+ # compiler ---------------------------------------------------------------------
+@@ -452,6 +455,10 @@ config("compiler") {
+ }
+ }
+
++ if (is_openbsd) {
++ ldflags += [ "-Wl,-z,wxneeded" ]
++ }
++
+ # Linux-specific compiler flags setup.
+ # ------------------------------------
+ if ((is_posix || is_fuchsia) && !is_apple && use_lld) {
+@@ -534,7 +541,7 @@ config("compiler") {
+ ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
+ }
+
+- if (is_clang && !is_nacl && current_os != "zos") {
++ if (is_clang && !is_nacl && current_os != "zos" && !is_bsd) {
+ cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
+
+ # TODO(hans): Remove this once Clang generates better optimized debug info
+@@ -908,7 +915,7 @@ config("compiler_cpu_abi") {
+ ]
+ }
+ } else if (current_cpu == "arm") {
+- if (is_clang && !is_android && !is_nacl) {
++ if (is_clang && !is_android && !is_nacl && !is_bsd) {
+ cflags += [ "--target=arm-linux-gnueabihf" ]
+ ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
+@@ -922,7 +929,7 @@ config("compiler_cpu_abi") {
+ cflags += [ "-mtune=$arm_tune" ]
+ }
+ } else if (current_cpu == "arm64") {
+- if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
++ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) {
+ cflags += [ "--target=aarch64-linux-gnu" ]
+ ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
+@@ -1243,7 +1250,7 @@ config("compiler_deterministic") {
+ # different build directory like "out/feature_a" and "out/feature_b" if
+ # we build same files with same compile flag.
+ # Other paths are already given in relative, no need to normalize them.
+- if (is_nacl) {
++ if (is_nacl || is_bsd) {
+ # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
+ cflags += [
+ "-Xclang",
+@@ -1533,7 +1540,7 @@ config("default_warnings") {
+ "-Wno-ignored-pragma-optimize",
+ ]
+
+- if (is_chromeos || default_toolchain == "//build/toolchain/cros:target") {
++ if (is_chromeos || default_toolchain == "//build/toolchain/cros:target" || is_bsd) {
+ # TODO(https://crbug.com/1016945): Re-enable once ChromeOS toolchain is up to date
+ cflags += [ "-Wno-builtin-assume-aligned-alignment" ]
+ }
+@@ -1725,7 +1732,7 @@ config("no_chromium_code") {
+ # third-party libraries.
+ "-Wno-c++11-narrowing",
+ ]
+- if (!is_nacl) {
++ if (!is_nacl && !is_freebsd) {
+ cflags += [
+ # Disabled for similar reasons as -Wunused-variable.
+ "-Wno-unused-but-set-variable",
+@@ -2239,7 +2246,7 @@ config("afdo_optimize_size") {
+ # There are some targeted places that AFDO regresses, so we provide a separate
+ # config to allow AFDO to be disabled per-target.
+ config("afdo") {
+- if (is_clang) {
++ if (is_clang && !is_bsd) {
+ cflags = []
+ if (clang_emit_debug_info_for_profiling) {
+ # Add the following flags to generate debug info for profiling.
+@@ -2255,7 +2262,7 @@ config("afdo") {
+ cflags += [ "-fprofile-sample-use=${rebased_clang_sample_profile}" ]
+ inputs = [ _clang_sample_profile ]
+ }
+- } else if (auto_profile_path != "" && is_a_target_toolchain) {
++ } else if (auto_profile_path != "" && is_a_target_toolchain && !is_bsd) {
+ cflags = [ "-fauto-profile=${auto_profile_path}" ]
+ inputs = [ auto_profile_path ]
+ }
+@@ -2398,7 +2405,8 @@ config("symbols") {
+ }
+ }
+
+- if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") {
++ if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos" &&
++ !is_bsd) {
+ if (is_apple) {
+ # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
+ # Make sure we don't use constructor homing on mac.
diff --git a/devel/electron18/files/patch-build_config_compiler_pgo_pgo.gni b/devel/electron18/files/patch-build_config_compiler_pgo_pgo.gni
new file mode 100644
index 000000000000..02c05d65664d
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_compiler_pgo_pgo.gni
@@ -0,0 +1,11 @@
+--- build/config/compiler/pgo/pgo.gni.orig 2021-04-14 01:08:36 UTC
++++ build/config/compiler/pgo/pgo.gni
+@@ -16,7 +16,7 @@ declare_args() {
+ # TODO(crbug.com/1052397): Remove chromeos_is_browser_only once
+ # target_os switch for lacros-chrome is completed.
+ (is_win || is_mac ||
+- (is_linux && !chromeos_is_browser_only && !is_chromecast))) {
++ (is_linux && !chromeos_is_browser_only && !is_chromecast && !is_bsd))) {
+ chrome_pgo_phase = 2
+ }
+
diff --git a/devel/electron18/files/patch-build_config_linux_BUILD.gn b/devel/electron18/files/patch-build_config_linux_BUILD.gn
new file mode 100644
index 000000000000..cbec501bf212
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_linux_BUILD.gn
@@ -0,0 +1,11 @@
+--- build/config/linux/BUILD.gn.orig 2022-05-11 07:16:46 UTC
++++ build/config/linux/BUILD.gn
+@@ -42,7 +42,7 @@ config("runtime_library") {
+
+ if ((!(is_chromeos_ash || is_chromeos_lacros) ||
+ 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/devel/electron18/files/patch-build_config_linux_pkg-config.py b/devel/electron18/files/patch-build_config_linux_pkg-config.py
new file mode 100644
index 000000000000..c193109a7476
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_linux_pkg-config.py
@@ -0,0 +1,11 @@
+--- build/config/linux/pkg-config.py.orig 2022-05-11 07:00:27 UTC
++++ build/config/linux/pkg-config.py
+@@ -109,7 +109,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'])):
+ print("[[],[],[],[],[]]")
+ return 0
+
diff --git a/devel/electron18/files/patch-build_config_ozone.gni b/devel/electron18/files/patch-build_config_ozone.gni
new file mode 100644
index 000000000000..5d7b49430108
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_ozone.gni
@@ -0,0 +1,19 @@
+--- build/config/ozone.gni.orig 2022-05-19 05:17:34 UTC
++++ build/config/ozone.gni
+@@ -91,7 +91,15 @@ 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_freebsd) {
+ ozone_platform = "x11"
+ ozone_platform_wayland = true
+ ozone_platform_x11 = true
diff --git a/devel/electron18/files/patch-build_config_rust.gni b/devel/electron18/files/patch-build_config_rust.gni
new file mode 100644
index 000000000000..332bf8c33aea
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_rust.gni
@@ -0,0 +1,11 @@
+--- build/config/rust.gni.orig 2022-05-19 05:17:34 UTC
++++ build/config/rust.gni
+@@ -116,7 +116,7 @@ if (enable_rust) {
+ rust_sysroot = "//third_party/rust-toolchain"
+ use_unverified_rust_toolchain = false
+ } else {
+- if (host_os != "linux") {
++ if (host_os != "linux" && host_os != "openbsd" && host_os != "freebsd") {
+ assert(false,
+ "Attempt to use Android Rust toolchain on an unsupported platform")
+ }
diff --git a/devel/electron18/files/patch-build_config_v8__target__cpu.gni b/devel/electron18/files/patch-build_config_v8__target__cpu.gni
new file mode 100644
index 000000000000..696e23cf26a2
--- /dev/null
+++ b/devel/electron18/files/patch-build_config_v8__target__cpu.gni
@@ -0,0 +1,13 @@
+--- build/config/v8_target_cpu.gni.orig 2022-05-11 07:00:27 UTC
++++ 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/devel/electron18/files/patch-build_detect__host__arch.py b/devel/electron18/files/patch-build_detect__host__arch.py
new file mode 100644
index 000000000000..d09ac4de3025
--- /dev/null
+++ b/devel/electron18/files/patch-build_detect__host__arch.py
@@ -0,0 +1,11 @@
+--- build/detect_host_arch.py.orig 2021-01-07 00:36:18 UTC
++++ build/detect_host_arch.py
+@@ -21,6 +21,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/devel/electron18/files/patch-build_gn__run__binary.py b/devel/electron18/files/patch-build_gn__run__binary.py
new file mode 100644
index 000000000000..6386f3ded4e0
--- /dev/null
+++ b/devel/electron18/files/patch-build_gn__run__binary.py
@@ -0,0 +1,11 @@
+--- build/gn_run_binary.py.orig 2022-05-11 07:00:27 UTC
++++ build/gn_run_binary.py
+@@ -24,7 +24,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/devel/electron18/files/patch-build_linux_chrome.map b/devel/electron18/files/patch-build_linux_chrome.map
new file mode 100644
index 000000000000..c649d3e08b3f
--- /dev/null
+++ b/devel/electron18/files/patch-build_linux_chrome.map
@@ -0,0 +1,13 @@
+--- build/linux/chrome.map.orig 2022-05-19 03:45:15 UTC
++++ build/linux/chrome.map
+@@ -20,6 +20,10 @@ global:
+ # Program entry point.
+ _start;
+
++ # FreeBSD specific variables.
++ __progname;
++ environ;
++
+ # Memory allocation symbols. We want chrome and any libraries to
+ # share the same heap, so it is correct to export these symbols.
+ aligned_alloc;
diff --git a/devel/electron18/files/patch-build_linux_strip__binary.py b/devel/electron18/files/patch-build_linux_strip__binary.py
new file mode 100644
index 000000000000..c2ea9d8239fd
--- /dev/null
+++ b/devel/electron18/files/patch-build_linux_strip__binary.py
@@ -0,0 +1,10 @@
+--- build/linux/strip_binary.py.orig 2022-05-11 07:16:46 UTC
++++ 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/devel/electron18/files/patch-build_linux_unbundle_libusb.gn b/devel/electron18/files/patch-build_linux_unbundle_libusb.gn
new file mode 100644
index 000000000000..500e6b423ce6
--- /dev/null
+++ b/devel/electron18/files/patch-build_linux_unbundle_libusb.gn
@@ -0,0 +1,27 @@
+--- build/linux/unbundle/libusb.gn.orig 2021-01-25 11:28:15 UTC
++++ build/linux/unbundle/libusb.gn
+@@ -0,0 +1,24 @@
++# 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" ]
++}
diff --git a/devel/electron18/files/patch-build_linux_unbundle_replace__gn__files.py b/devel/electron18/files/patch-build_linux_unbundle_replace__gn__files.py
new file mode 100644
index 000000000000..edc386dbc180
--- /dev/null
+++ b/devel/electron18/files/patch-build_linux_unbundle_replace__gn__files.py
@@ -0,0 +1,10 @@
+--- build/linux/unbundle/replace_gn_files.py.orig 2021-11-19 04:25:04 UTC
++++ build/linux/unbundle/replace_gn_files.py
+@@ -25,6 +25,7 @@ REPLACEMENTS = {
+ 'libevent': 'base/third_party/libevent/BUILD.gn',
+ 'libjpeg': 'third_party/libjpeg.gni',
+ 'libpng': 'third_party/libpng/BUILD.gn',
++ 'libusb': 'third_party/libusb/BUILD.gn',
+ 'libvpx': 'third_party/libvpx/BUILD.gn',
+ 'libwebp': 'third_party/libwebp/BUILD.gn',
+ 'libxml': 'third_party/libxml/BUILD.gn',
diff --git a/devel/electron18/files/patch-build_toolchain_freebsd_BUILD.gn b/devel/electron18/files/patch-build_toolchain_freebsd_BUILD.gn
new file mode 100644
index 000000000000..3afd3c1b8126
--- /dev/null
+++ b/devel/electron18/files/patch-build_toolchain_freebsd_BUILD.gn
@@ -0,0 +1,69 @@
+--- build/toolchain/freebsd/BUILD.gn.orig 2022-05-13 07:20:04 UTC
++++ 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/devel/electron18/files/patch-build_toolchain_gcc__solink__wrapper.py b/devel/electron18/files/patch-build_toolchain_gcc__solink__wrapper.py
new file mode 100644
index 000000000000..70496fe7ab9d
--- /dev/null
+++ b/devel/electron18/files/patch-build_toolchain_gcc__solink__wrapper.py
@@ -0,0 +1,11 @@
+--- build/toolchain/gcc_solink_wrapper.py.orig 2022-05-11 07:00:27 UTC
++++ 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/devel/electron18/files/patch-build_toolchain_gcc__toolchain.gni b/devel/electron18/files/patch-build_toolchain_gcc__toolchain.gni
new file mode 100644
index 000000000000..c30f54b35828
--- /dev/null
+++ b/devel/electron18/files/patch-build_toolchain_gcc__toolchain.gni
@@ -0,0 +1,35 @@
+--- build/toolchain/gcc_toolchain.gni.orig 2022-05-19 05:17:34 UTC
++++ build/toolchain/gcc_toolchain.gni
+@@ -53,6 +53,13 @@ if (enable_resource_allowlist_generation) {
+ "enable_resource_allowlist_generation=true does not work for target_os=$target_os")
+ }
+
++declare_args() {
++ extra_cflags = ""
++ extra_cppflags = ""
++ extra_cxxflags = ""
++ extra_ldflags = ""
++}
++
+ # This template defines a toolchain for something that works like gcc
+ # (including clang).
+ #
+@@ -771,13 +778,12 @@ template("gcc_toolchain") {
+ # use_gold too.
+ template("clang_toolchain") {
+ gcc_toolchain(target_name) {
+- prefix = rebase_path("$clang_base_path/bin", root_build_dir)
+- cc = "${prefix}/clang"
+- cxx = "${prefix}/clang++"
++ cc = "cc"
++ cxx = "c++"
+ ld = cxx
+- readelf = "${prefix}/llvm-readelf"
+- ar = "${prefix}/llvm-ar"
+- nm = "${prefix}/llvm-nm"
++ readelf = "readelf"
++ ar = "ar"
++ nm = "nm"
+
+ forward_variables_from(invoker,
+ [
diff --git a/devel/electron18/files/patch-build_toolchain_openbsd_BUILD.gn b/devel/electron18/files/patch-build_toolchain_openbsd_BUILD.gn
new file mode 100644
index 000000000000..1ce8a6afcc11
--- /dev/null
+++ b/devel/electron18/files/patch-build_toolchain_openbsd_BUILD.gn
@@ -0,0 +1,69 @@
+--- build/toolchain/openbsd/BUILD.gn.orig 2022-05-13 07:20:04 UTC
++++ 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/devel/electron18/files/patch-cc_BUILD.gn b/devel/electron18/files/patch-cc_BUILD.gn
new file mode 100644
index 000000000000..19605a5878b3
--- /dev/null
+++ b/devel/electron18/files/patch-cc_BUILD.gn
@@ -0,0 +1,19 @@
+--- cc/BUILD.gn.orig 2022-05-19 05:17:34 UTC
++++ cc/BUILD.gn
+@@ -664,7 +664,7 @@ cc_test_static_library("test_support") {
+ if (enable_vulkan) {
+ deps += [ "//gpu/vulkan/init" ]
+ }
+- if (!is_android) {
++ if (!is_android && !is_bsd) {
+ data_deps = [ "//third_party/mesa_headers" ]
+ }
+ }
+@@ -891,7 +891,6 @@ cc_test("cc_unittests") {
+ data = [ "//components/viz/test/data/" ]
+ data_deps = [
+ "//testing/buildbot/filters:cc_unittests_filters",
+- "//third_party/mesa_headers",
+ ]
+
+ if (is_android && enable_chrome_android_internal) {
diff --git a/devel/electron18/files/patch-chrome_app_chrome__command__ids.h b/devel/electron18/files/patch-chrome_app_chrome__command__ids.h
new file mode 100644
index 000000000000..2ea6de20a262
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_chrome__command__ids.h
@@ -0,0 +1,11 @@
+--- chrome/app/chrome_command_ids.h.orig 2022-05-19 05:17:35 UTC
++++ chrome/app/chrome_command_ids.h
+@@ -66,7 +66,7 @@
+ #define IDC_NAME_WINDOW 34049
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #define IDC_USE_SYSTEM_TITLE_BAR 34051
+ #define IDC_RESTORE_WINDOW 34052
+ #endif
diff --git a/devel/electron18/files/patch-chrome_app_chrome__main.cc b/devel/electron18/files/patch-chrome_app_chrome__main.cc
new file mode 100644
index 000000000000..047835f4c5dd
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_chrome__main.cc
@@ -0,0 +1,20 @@
+--- chrome/app/chrome_main.cc.orig 2022-05-19 05:17:35 UTC
++++ chrome/app/chrome_main.cc
+@@ -25,7 +25,7 @@
+ #include "chrome/app/notification_metrics.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
+
+@@ -146,7 +146,7 @@ int ChromeMain(int argc, const char** argv) {
+ headless::SetUpCommandLine(command_line);
+ } else {
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (command_line->HasSwitch(switches::kHeadless)) {
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+ command_line->AppendSwitch(::headless::switches::kEnableCrashReporter);
diff --git a/devel/electron18/files/patch-chrome_app_chrome__main__delegate.cc b/devel/electron18/files/patch-chrome_app_chrome__main__delegate.cc
new file mode 100644
index 000000000000..0ad32048f3f8
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_chrome__main__delegate.cc
@@ -0,0 +1,107 @@
+--- chrome/app/chrome_main_delegate.cc.orig 2022-05-19 05:17:35 UTC
++++ chrome/app/chrome_main_delegate.cc
+@@ -114,7 +114,7 @@
+ #include "chrome/app/chrome_crash_reporter_client.h"
+ #endif
+
+-#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ #include "components/nacl/common/nacl_paths.h"
+ #include "components/nacl/zygote/nacl_fork_delegate_linux.h"
+ #endif
+@@ -158,12 +158,12 @@
+ #include "v8/include/v8.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/policy/policy_path_parser.h"
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+@@ -311,7 +311,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty
+ // and resources loaded.
+ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
+ return
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The zygote process opens the resources for the renderers.
+ process_type == switches::kZygoteProcess ||
+ #endif
+@@ -351,7 +351,7 @@ bool HandleVersionSwitches(const base::CommandLine& co
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Show the man page if --help or -h is on the command line.
+ void HandleHelpSwitches(const base::CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kHelp) ||
+@@ -415,7 +415,7 @@ void InitializeUserDataDir(base::CommandLine* command_
+ std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, Chrome does not support running multiple copies under different
+ // DISPLAYs, so the profile directory can be specified in the environment to
+ // support the virtual desktop use-case.
+@@ -499,7 +499,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Record the startup process creation time on supported platforms. On Android
+ // this is recorded in ChromeMainDelegateAndroid.
+ startup_metric_utils::RecordStartupProcessCreationTime(
+@@ -680,6 +680,8 @@ void ChromeMainDelegate::PostFieldTrialInitialization(
+ // not always enabled on Linux/ChromeOS.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ bool enable_gwp_asan = crash_reporter::IsCrashpadEnabled();
++#elif BUILDFLAG(IS_BSD)
++ bool enable_gwp_asan = false;
+ #else
+ bool enable_gwp_asan = true;
+ #endif
+@@ -815,7 +817,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi
+ }
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // This will directly exit if the user asked for help.
+ HandleHelpSwitches(command_line);
+ #endif
+@@ -846,7 +848,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exi
+ #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ chromeos::dbus_paths::RegisterPathProvider();
+ #endif
+-#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ nacl::RegisterPathProvider();
+ #endif
+
+@@ -1161,7 +1163,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
+ locale;
+ }
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ // Zygote needs to call InitCrashReporter() in RunZygote().
+ if (process_type != switches::kZygoteProcess) {
+ #if BUILDFLAG(IS_ANDROID)
+@@ -1237,7 +1239,7 @@ absl::variant<int, content::MainFunctionParams> Chrome
+
+ // This entry is not needed on Linux, where the NaCl loader
+ // process is launched via nacl_helper instead.
+-#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ {switches::kNaClLoaderProcess, NaClMain},
+ #else
+ {"<invalid>", nullptr}, // To avoid constant array of size 0
diff --git a/devel/electron18/files/patch-chrome_app_chromium__strings.grd b/devel/electron18/files/patch-chrome_app_chromium__strings.grd
new file mode 100644
index 000000000000..c1d35f494976
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_chromium__strings.grd
@@ -0,0 +1,29 @@
+--- chrome/app/chromium_strings.grd.orig 2022-05-19 05:17:35 UTC
++++ chrome/app/chromium_strings.grd
+@@ -298,7 +298,7 @@ If you update this file, be sure also to update google
+ Welcome to Chromium; new browser window opened
+ </message>
+ </if>
+- <if expr="is_macosx or is_linux">
++ <if expr="is_macosx or is_posix">
+ <message name="IDS_FIRST_RUN_DIALOG_WINDOW_TITLE" desc="Window title of First Run dialog on Mac and Linux, displayed in title bar">
+ Welcome to Chromium
+ </message>
+@@ -818,7 +818,7 @@ Permissions you've already given to websites and apps
+ </if>
+
+ <!-- about:browser-switch strings -->
+- <if expr="is_win or is_macosx or is_fuchsia or (is_linux and not chromeos)">
++ <if expr="is_win or is_macosx or is_fuchsia or (is_posix and not chromeos)">
+ <message name="IDS_ABOUT_BROWSER_SWITCH_DESCRIPTION_UNKNOWN_BROWSER" desc="Description shown while waiting for an alternative browser to open, when the browser name is not auto-detected">
+ Your system administrator has configured Chromium to open an alternative browser to access <ph name="TARGET_URL_HOSTNAME">$1<ex>example.com</ex></ph>.
+ </message>
+@@ -944,7 +944,7 @@ Permissions you've already given to websites and apps
+ </message>
+
+ <!-- ProcessSingleton -->
+- <if expr="is_linux or is_macosx">
++ <if expr="is_posix or is_macosx">
+ <message name="IDS_PROFILE_IN_USE_POSIX" desc="Message shown when the browser cannot start because the profile is in use on a different host.">
+ The profile appears to be in use by another Chromium process (<ph name="PROCESS_ID">$1<ex>12345</ex></ph>) on another computer (<ph name="HOST_NAME">$2<ex>example.com</ex></ph>). Chromium has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium.
+ </message>
diff --git a/devel/electron18/files/patch-chrome_app_generated__resources.grd b/devel/electron18/files/patch-chrome_app_generated__resources.grd
new file mode 100644
index 000000000000..b38c8a911279
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_generated__resources.grd
@@ -0,0 +1,56 @@
+--- chrome/app/generated_resources.grd.orig 2022-05-19 05:17:35 UTC
++++ chrome/app/generated_resources.grd
+@@ -2,7 +2,7 @@
+
+ <!--
+ This file contains definitions of resources that will be translated for each
+-locale. The variables is_win, is_macosx, is_linux, and is_posix are available
++locale. The variables is_win, is_macosx, is_posix, and is_posix are available
+ for making strings OS specific. Other platform defines such as use_titlecase
+ are declared in tools/grit/grit_rule.gni.
+ -->
+@@ -298,7 +298,7 @@ are declared in tools/grit/grit_rule.gni.
+ <part file="profiles_strings.grdp" />
+
+ <!-- Web app intent picker strings -->
+- <if expr="is_win or is_macosx or is_linux">
++ <if expr="is_win or is_macosx or is_posix">
+ <part file="url_handler_intent_picker_strings.grdp" />
+ </if>
+
+@@ -2833,7 +2833,7 @@ are declared in tools/grit/grit_rule.gni.
+ </if>
+
+ <!-- Bluetooth Device Credentials (i.e. PIN/Passkey) dialog -->
+- <if expr="is_win or is_linux">
++ <if expr="is_win or is_posix">
+ <message name="IDS_BLUETOOTH_DEVICE_CREDENTIALS_TITLE" desc="Title of the Bluetooth device credentials prompt dialog.">
+ Device Credentials
+ </message>
+@@ -5686,7 +5686,7 @@ Keep your key file in a safe place. You will need it t
+ </if>
+
+ <!-- chrome://browser-switch strings -->
+- <if expr="is_win or is_macosx or is_fuchsia or (is_linux and not chromeos)">
++ <if expr="is_win or is_macosx or is_fuchsia or (is_posix and not chromeos)">
+ <message name="IDS_ABOUT_BROWSER_SWITCH_TITLE" desc="about:browser-switch page title">
+ Legacy Browser Support
+ </message>
+@@ -8217,7 +8217,7 @@ Keep your key file in a safe place. You will need it t
+ Google Pay
+ </message>
+
+- <if expr="is_linux and not chromeos and not lacros">
++ <if expr="is_posix and not chromeos and not lacros">
+ <message name="IDS_SHOW_WINDOW_DECORATIONS" desc="The label of a radio button in the options dialog for using the system title bar and borders.">
+ Use system title bar and borders
+ </message>
+@@ -9372,7 +9372,7 @@ Please help our engineers fix this problem. Tell us wh
+ Set as default
+ </message>
+
+- <if expr="is_linux and not chromeos and not lacros">
++ <if expr="is_posix and not chromeos and not lacros">
+ <message name="IDS_MINIMIZE_WINDOW_MENU" desc="The Linux browser window menu item text for minimizing the window.">
+ Minimize
+ </message>
diff --git a/devel/electron18/files/patch-chrome_app_google__chrome__strings.grd b/devel/electron18/files/patch-chrome_app_google__chrome__strings.grd
new file mode 100644
index 000000000000..102ed6c76cc5
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_google__chrome__strings.grd
@@ -0,0 +1,29 @@
+--- chrome/app/google_chrome_strings.grd.orig 2022-05-19 05:17:35 UTC
++++ chrome/app/google_chrome_strings.grd
+@@ -303,7 +303,7 @@ chromium_strings.grd. -->
+ Welcome to Chrome; new browser window opened
+ </message>
+ </if>
+- <if expr="is_macosx or is_linux">
++ <if expr="is_macosx or is_posix">
+ <message name="IDS_FIRST_RUN_DIALOG_WINDOW_TITLE" desc="Window title of First Run dialog on Mac and Linux, displayed in title bar">
+ Welcome to Google Chrome
+ </message>
+@@ -863,7 +863,7 @@ Permissions you've already given to websites and apps
+ </if>
+
+ <!-- about:browser-switch strings -->
+- <if expr="is_win or is_macosx or is_fuchsia or (is_linux and not chromeos)">
++ <if expr="is_win or is_macosx or is_fuchsia or (is_posix and not chromeos)">
+ <message name="IDS_ABOUT_BROWSER_SWITCH_DESCRIPTION_UNKNOWN_BROWSER" desc="Description shown while waiting for an alternative browser to open, when the browser name is not auto-detected">
+ Your system administrator has configured Google Chrome to open an alternative browser to access <ph name="TARGET_URL_HOSTNAME">$1<ex>example.com</ex></ph>.
+ </message>
+@@ -1012,7 +1012,7 @@ Permissions you've already given to websites and apps
+ </message>
+
+ <!-- ProcessSingleton -->
+- <if expr="is_linux or is_macosx">
++ <if expr="is_posix or is_macosx">
+ <message name="IDS_PROFILE_IN_USE_POSIX" desc="Message shown when the browser cannot start because the profile is in use on a different host.">
+ The profile appears to be in use by another Google Chrome process (<ph name="PROCESS_ID">$1<ex>12345</ex></ph>) on another computer (<ph name="HOST_NAME">$2<ex>example.com</ex></ph>). Chrome has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chrome.
+ </message>
diff --git a/devel/electron18/files/patch-chrome_app_profiles__strings.grdp b/devel/electron18/files/patch-chrome_app_profiles__strings.grdp
new file mode 100644
index 000000000000..55c6e35238e0
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_profiles__strings.grdp
@@ -0,0 +1,11 @@
+--- chrome/app/profiles_strings.grdp.orig 2022-05-11 07:16:46 UTC
++++ chrome/app/profiles_strings.grdp
+@@ -66,7 +66,7 @@
+ Add Profile...
+ </message>
+ </if>
+- <if expr="is_linux">
++ <if expr="is_posix">
+ <message name="IDS_PROFILES_ADD_PROFILE_LABEL" desc="Menu item for adding a new profile.">
+ Add profile...
+ </message>
diff --git a/devel/electron18/files/patch-chrome_app_settings__strings.grdp b/devel/electron18/files/patch-chrome_app_settings__strings.grdp
new file mode 100644
index 000000000000..445ac5b92040
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_settings__strings.grdp
@@ -0,0 +1,20 @@
+--- chrome/app/settings_strings.grdp.orig 2022-05-19 05:17:36 UTC
++++ chrome/app/settings_strings.grdp
+@@ -131,7 +131,7 @@
+ Theme
+ </message>
+ </if>
+- <if expr="is_linux and not chromeos and not lacros">
++ <if expr="is_posix and not chromeos and not lacros">
+ <message name="IDS_SETTINGS_SYSTEM_THEME" desc="Text of the label describing the system (GTK+) browser theme on Linux">
+ GTK+
+ </message>
+@@ -145,7 +145,7 @@
+ Use Classic
+ </message>
+ </if>
+- <if expr="not is_linux or chromeos_ash or chromeos_lacros or is_fuchsia">
++ <if expr="not is_posix or chromeos_ash or chromeos_lacros or is_fuchsia">
+ <message name="IDS_SETTINGS_RESET_TO_DEFAULT_THEME" desc="Name of the control which resets the browser theme back to the default theme.">
+ Reset to default
+ </message>
diff --git a/devel/electron18/files/patch-chrome_app_theme_chrome__unscaled__resources.grd b/devel/electron18/files/patch-chrome_app_theme_chrome__unscaled__resources.grd
new file mode 100644
index 000000000000..7af9e5cd5431
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_theme_chrome__unscaled__resources.grd
@@ -0,0 +1,32 @@
+--- chrome/app/theme/chrome_unscaled_resources.grd.orig 2022-05-19 05:17:36 UTC
++++ chrome/app/theme/chrome_unscaled_resources.grd
+@@ -15,12 +15,12 @@
+ <release seq="1">
+ <includes>
+ <if expr="_google_chrome">
+- <if expr="not is_linux">
++ <if expr="not is_posix">
+ <include name="IDR_PRODUCT_LOGO_64" file="google_chrome/product_logo_64.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_128" file="google_chrome/product_logo_128.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_256" file="google_chrome/product_logo_256.png" type="BINDATA" />
+ </if>
+- <if expr="is_linux">
++ <if expr="is_posix">
+ <include name="IDR_PRODUCT_LOGO_64" file="google_chrome/linux/product_logo_64.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_128" file="google_chrome/linux/product_logo_128.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_128_BETA" file="google_chrome/linux/product_logo_128_beta.png" type="BINDATA" />
+@@ -52,12 +52,12 @@
+ </if>
+ </if>
+ <if expr="not _google_chrome">
+- <if expr="not is_linux">
++ <if expr="not is_posix">
+ <include name="IDR_PRODUCT_LOGO_64" file="chromium/product_logo_64.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_128" file="chromium/product_logo_128.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_256" file="chromium/product_logo_256.png" type="BINDATA" />
+ </if>
+- <if expr="is_linux">
++ <if expr="is_posix">
+ <include name="IDR_PRODUCT_LOGO_64" file="chromium/linux/product_logo_64.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_128" file="chromium/linux/product_logo_128.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_256" file="chromium/linux/product_logo_256.png" type="BINDATA" />
diff --git a/devel/electron18/files/patch-chrome_app_theme_theme__resources.grd b/devel/electron18/files/patch-chrome_app_theme_theme__resources.grd
new file mode 100644
index 000000000000..e74a4425f72d
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_app_theme_theme__resources.grd
@@ -0,0 +1,11 @@
+--- chrome/app/theme/theme_resources.grd.orig 2021-01-07 00:36:21 UTC
++++ chrome/app/theme/theme_resources.grd
+@@ -25,7 +25,7 @@
+ <!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST
+ BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE
+ SAME CONDITIONALS. -->
+- <if expr="is_linux or is_win or chromeos">
++ <if expr="is_posix or is_win or chromeos">
+ <structure type="chrome_scaled_image" name="IDR_ACCESSIBILITY_CAPTIONS_PREVIEW_BACKGROUND" file="common/captions-preview-bg.png" />
+ </if>
+ <if expr="toolkit_views and not is_macosx">
diff --git a/devel/electron18/files/patch-chrome_browser_about__flags.cc b/devel/electron18/files/patch-chrome_browser_about__flags.cc
new file mode 100644
index 000000000000..7007e66f07e9
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_about__flags.cc
@@ -0,0 +1,128 @@
+--- chrome/browser/about_flags.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/about_flags.cc
+@@ -206,7 +206,7 @@
+ #include "ui/native_theme/native_theme_features.h"
+ #include "ui/ui_features.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/allocator/buildflags.h"
+ #endif
+
+@@ -275,7 +275,7 @@
+ #include "chrome/browser/supervised_user/supervised_user_features/supervised_user_features.h"
+ #endif // ENABLE_SUPERVISED_USERS
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "ui/ozone/buildflags.h"
+ #include "ui/ozone/public/ozone_switches.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -362,7 +362,7 @@ const FeatureEntry::Choice kUseAngleChoicesMac[] = {
+ gl::kANGLEImplementationMetalName}};
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::Choice kOzonePlatformHintRuntimeChoices[] = {
+ {flag_descriptions::kOzonePlatformHintChoiceDefault, "", ""},
+ {flag_descriptions::kOzonePlatformHintChoiceAuto,
+@@ -976,7 +976,7 @@ const FeatureEntry::FeatureVariation kPageContentAnnot
+ };
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ const FeatureEntry::FeatureParam kOmniboxDocumentProviderServerScoring[] = {
+ {"DocumentUseServerScore", "true"},
+ {"DocumentUseClientScore", "false"},
+@@ -3425,7 +3425,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(chromeos::kLacrosTtsSupport)},
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {
+ "enable-accelerated-video-decode",
+ flag_descriptions::kAcceleratedVideoDecodeName,
+@@ -3839,7 +3839,7 @@ const FeatureEntry kFeatureEntries[] = {
+ {"enable-login-detection", flag_descriptions::kEnableLoginDetectionName,
+ flag_descriptions::kEnableLoginDetectionDescription, kOsAll,
+ FEATURE_VALUE_TYPE(login_detection::kLoginDetection)},
+-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"enable-navigation-predictor",
+ flag_descriptions::kEnableNavigationPredictorName,
+ flag_descriptions::kEnableNavigationPredictorDescription,
+@@ -4032,7 +4032,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(features::kWebShare)},
+ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ {"ozone-platform-hint", flag_descriptions::kOzonePlatformHintName,
+ flag_descriptions::kOzonePlatformHintDescription, kOsLinux,
+ MULTI_VALUE_TYPE(kOzonePlatformHintRuntimeChoices)},
+@@ -4051,7 +4051,7 @@ const FeatureEntry kFeatureEntries[] = {
+ password_manager::features::kForceInitialSyncWhenDecryptionFails)},
+ #endif // BUILDFLAG(IS_LINUX)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ {"skip-undecryptable-passwords",
+ flag_descriptions::kSkipUndecryptablePasswordsName,
+ flag_descriptions::kSkipUndecryptablePasswordsDescription,
+@@ -4761,7 +4761,7 @@ const FeatureEntry kFeatureEntries[] = {
+ "OmniboxBundledExperimentV1")},
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ {"omnibox-experimental-keyword-mode",
+ flag_descriptions::kOmniboxExperimentalKeywordModeName,
+ flag_descriptions::kOmniboxExperimentalKeywordModeDescription, kOsDesktop,
+@@ -5159,7 +5159,7 @@ const FeatureEntry kFeatureEntries[] = {
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ {"webui-feedback", flag_descriptions::kWebuiFeedbackName,
+ flag_descriptions::kWebuiFeedbackDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(features::kWebUIFeedback)},
+@@ -6199,7 +6199,7 @@ const FeatureEntry kFeatureEntries[] = {
+ FEATURE_VALUE_TYPE(features::kMouseSubframeNoImplicitCapture)},
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ {"global-media-controls-modern-ui",
+ flag_descriptions::kGlobalMediaControlsModernUIName,
+ flag_descriptions::kGlobalMediaControlsModernUIDescription,
+@@ -6913,7 +6913,7 @@ const FeatureEntry kFeatureEntries[] = {
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ {"incognito-clear-browsing-data-dialog-for-desktop",
+ flag_descriptions::kIncognitoClearBrowsingDataDialogForDesktopName,
+ flag_descriptions::kIncognitoClearBrowsingDataDialogForDesktopDescription,
+@@ -7038,7 +7038,7 @@ const FeatureEntry kFeatureEntries[] = {
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ {"commander", flag_descriptions::kCommanderName,
+ flag_descriptions::kCommanderDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(features::kCommander)},
+@@ -7292,7 +7292,7 @@ const FeatureEntry kFeatureEntries[] = {
+
+ #if BUILDFLAG(IS_WIN) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
+- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ {
+ "ui-debug-tools",
+ flag_descriptions::kUIDebugToolsName,
diff --git a/devel/electron18/files/patch-chrome_browser_after__startup__task__utils.cc b/devel/electron18/files/patch-chrome_browser_after__startup__task__utils.cc
new file mode 100644
index 000000000000..c24a40704e24
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_after__startup__task__utils.cc
@@ -0,0 +1,29 @@
+--- chrome/browser/after_startup_task_utils.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/after_startup_task_utils.cc
+@@ -25,7 +25,7 @@
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "ui/views/linux_ui/linux_ui.h"
+ #endif
+
+@@ -111,7 +111,7 @@ void SetBrowserStartupIsComplete() {
+
+ g_startup_complete_flag.Get().Set();
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Process::Current().CreationTime() is not available on all platforms.
+ const base::Time process_creation_time =
+ base::Process::Current().CreationTime();
+@@ -130,7 +130,7 @@ void SetBrowserStartupIsComplete() {
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Make sure we complete the startup notification sequence, or launchers will
+ // get confused by not receiving the expected message from the main process.
+ views::LinuxUI* linux_ui = views::LinuxUI::instance();
diff --git a/devel/electron18/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc b/devel/electron18/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc
new file mode 100644
index 000000000000..488fcbd9e91d
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_apps_platform__apps_api_music__manager__private_device__id__linux.cc
@@ -0,0 +1,71 @@
+--- chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc
+@@ -4,6 +4,15 @@
+
+ #include "chrome/browser/apps/platform_apps/api/music_manager_private/device_id.h"
+
++#include "build/build_config.h"
++
++#if defined(OS_BSD)
++#include <sys/types.h>
++#include <net/if_dl.h>
++#include <netinet/in.h>
++#include <sys/socket.h>
++#endif
++
+ #include <ifaddrs.h>
+ #include <net/if.h>
+ #include <stddef.h>
+@@ -106,11 +115,33 @@ class MacAddressProcessor {
+ const char* const prefixes[],
+ size_t prefixes_count) {
+ const int MAC_LENGTH = 6;
++#if defined(OS_BSD)
++ struct ifaddrs *ifap, *ifinfo;
++#else
+ struct ifreq ifinfo;
++#endif
+
+ memset(&ifinfo, 0, sizeof(ifinfo));
+- strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1);
+
++#if defined(OS_BSD)
++ int result = getifaddrs(&ifap);
++ if (result != 0)
++ return true;
++ result = 1; // no MAC found yet
++ for (ifinfo = ifap; ifinfo != NULL; ifinfo = ifinfo->ifa_next) {
++ struct sockaddr* sa = ifinfo->ifa_addr;
++ if (sa->sa_family == AF_LINK &&
++ !strncmp(ifinfo->ifa_name, ifaddr->ifa_name,
++ sizeof(ifinfo->ifa_name) - 1)) {
++ result = 0;
++ break;
++ }
++ }
++
++ char mac_address[6];
++ strncpy(mac_address, (const char*)LLADDR((struct sockaddr_dl*)ifinfo->ifa_addr), sizeof(mac_address));
++#else
++ strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1);
+ int sd = socket(AF_INET, SOCK_DGRAM, 0);
+ int result = ioctl(sd, SIOCGIFHWADDR, &ifinfo);
+ close(sd);
+@@ -120,11 +151,17 @@ class MacAddressProcessor {
+
+ const char* mac_address =
+ static_cast<const char*>(ifinfo.ifr_hwaddr.sa_data);
++#endif
+ if (!is_valid_mac_address_.Run(mac_address, MAC_LENGTH))
+ return true;
+
++#if defined(OS_BSD)
++ if (!IsValidPrefix(ifinfo->ifa_name, prefixes, prefixes_count))
++ return true;
++#else
+ if (!IsValidPrefix(ifinfo.ifr_name, prefixes, prefixes_count))
+ return true;
++#endif
+
+ // Got one!
+ found_mac_address_ =
diff --git a/devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc b/devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc
new file mode 100644
index 000000000000..2fa60ab88317
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.cc
@@ -0,0 +1,20 @@
+--- chrome/browser/apps/platform_apps/platform_app_launch.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/apps/platform_apps/platform_app_launch.cc
+@@ -18,7 +18,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"
+@@ -121,7 +121,7 @@ bool OpenExtensionApplicationTab(Profile* profile, con
+ return app_tab != nullptr;
+ }
+
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ bool OpenDeprecatedApplicationPrompt(Profile* profile,
+ const std::string& app_id) {
+ if (!extensions::IsExtensionUnsupportedDeprecatedApp(profile, app_id))
diff --git a/devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h b/devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h
new file mode 100644
index 000000000000..12b406650c8a
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_apps_platform__apps_platform__app__launch.h
@@ -0,0 +1,11 @@
+--- chrome/browser/apps/platform_apps/platform_app_launch.h.orig 2022-05-19 03:45:16 UTC
++++ chrome/browser/apps/platform_apps/platform_app_launch.h
+@@ -36,7 +36,7 @@ bool OpenExtensionApplicationWindow(Profile* profile,
+ // and false otherwise.
+ bool OpenExtensionApplicationTab(Profile* profile, const std::string& app_id);
+
+-#if 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/devel/electron18/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc b/devel/electron18/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc
new file mode 100644
index 000000000000..a5f374459474
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_autocomplete_chrome__autocomplete__scheme__classifier.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
+@@ -89,7 +89,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForSch
+ return metrics::OmniboxInputType::QUERY;
+
+ case ExternalProtocolHandler::UNKNOWN: {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Linux impl of GetApplicationNameForProtocol doesn't distinguish
+ // between URL schemes with handers and those without. This will
+ // make the default behaviour be search on Linux.
diff --git a/devel/electron18/files/patch-chrome_browser_background_background__mode__manager.cc b/devel/electron18/files/patch-chrome_browser_background_background__mode__manager.cc
new file mode 100644
index 000000000000..546c51b0cdb7
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_background_background__mode__manager.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/background/background_mode_manager.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/background/background_mode_manager.cc
+@@ -899,7 +899,7 @@ gfx::ImageSkia GetStatusTrayIcon() {
+ return gfx::ImageSkia();
+
+ return family->CreateExact(size).AsImageSkia();
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ IDR_PRODUCT_LOGO_128);
+ #elif BUILDFLAG(IS_MAC)
diff --git a/devel/electron18/files/patch-chrome_browser_background_background__mode__optimizer.cc b/devel/electron18/files/patch-chrome_browser_background_background__mode__optimizer.cc
new file mode 100644
index 000000000000..c28cc33ed6dc
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_background_background__mode__optimizer.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/background/background_mode_optimizer.cc.orig 2022-05-19 03:45:17 UTC
++++ chrome/browser/background/background_mode_optimizer.cc
+@@ -31,7 +31,7 @@ std::unique_ptr<BackgroundModeOptimizer> BackgroundMod
+ switches::kKeepAliveForTest))
+ 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))
+ return base::WrapUnique(new BackgroundModeOptimizer());
+ #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/devel/electron18/files/patch-chrome_browser_browser__features.cc b/devel/electron18/files/patch-chrome_browser_browser__features.cc
new file mode 100644
index 000000000000..cc91f5001170
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_browser__features.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/browser_features.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/browser_features.cc
+@@ -29,7 +29,7 @@ const base::Feature kColorProviderRedirectionForThemeP
+ // the browser exits.
+ const base::Feature kDestroyProfileOnBrowserClose{
+ "DestroyProfileOnBrowserClose",
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ base::FEATURE_ENABLED_BY_DEFAULT
+ };
+ #else
diff --git a/devel/electron18/files/patch-chrome_browser_browser__process__impl.cc b/devel/electron18/files/patch-chrome_browser_browser__process__impl.cc
new file mode 100644
index 000000000000..60e46e9635b7
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_browser__process__impl.cc
@@ -0,0 +1,29 @@
+--- chrome/browser/browser_process_impl.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/browser_process_impl.cc
+@@ -208,7 +208,7 @@
+ #include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/error_reporting/chrome_js_error_report_processor.h" // nogncheck
+ #endif
+
+@@ -1157,7 +1157,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
+
+ ApplyMetricsReportingPolicy();
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ ChromeJsErrorReportProcessor::Create();
+ #endif
+
+@@ -1412,7 +1412,7 @@ void BrowserProcessImpl::Unpin() {
+ // Mac is currently not supported.
+ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+ // complete.
+-#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+
+ bool BrowserProcessImpl::IsRunningInBackground() const {
+ // Check if browser is in the background.
diff --git a/devel/electron18/files/patch-chrome_browser_browser__process__impl.h b/devel/electron18/files/patch-chrome_browser_browser__process__impl.h
new file mode 100644
index 000000000000..8f31668489e4
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_browser__process__impl.h
@@ -0,0 +1,11 @@
+--- chrome/browser/browser_process_impl.h.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/browser_process_impl.h
+@@ -367,7 +367,7 @@ class BrowserProcessImpl : public BrowserProcess,
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ base::RepeatingTimer autoupdate_timer_;
+
+ // Gets called by autoupdate timer to see if browser needs restart and can be
diff --git a/devel/electron18/files/patch-chrome_browser_chrome__browser__interface__binders.cc b/devel/electron18/files/patch-chrome_browser_chrome__browser__interface__binders.cc
new file mode 100644
index 000000000000..3439e373c6d2
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__browser__interface__binders.cc
@@ -0,0 +1,71 @@
+--- chrome/browser/chrome_browser_interface_binders.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_browser_interface_binders.cc
+@@ -96,13 +96,13 @@
+ #endif // BUILDFLAG(FULL_SAFE_BROWSING)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/connectors_internals/connectors_internals.mojom.h"
+ #include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h"
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/app_settings/web_app_settings_ui.h"
+ #include "ui/webui/resources/cr_components/app_management/app_management.mojom.h"
+ #endif
+@@ -172,7 +172,7 @@
+ #endif // BUILDFLAG(IS_ANDROID)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/discards/discards.mojom.h"
+ #include "chrome/browser/ui/webui/discards/discards_ui.h"
+ #include "chrome/browser/ui/webui/discards/site_data.mojom.h"
+@@ -665,7 +665,7 @@ void PopulateChromeFrameBinders(
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (!render_frame_host->GetParent()) {
+ map->Add<chrome::mojom::DraggableRegions>(
+ base::BindRepeating(&DraggableRegionsHostImpl::CreateIfAllowed));
+@@ -673,7 +673,7 @@ void PopulateChromeFrameBinders(
+ #endif
+
+ #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
+- BUILDFLAG(IS_WIN)
++ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ if (base::FeatureList::IsEnabled(blink::features::kDesktopPWAsSubApps) &&
+ !render_frame_host->GetParent()) {
+ map->Add<blink::mojom::SubAppsService>(
+@@ -714,14 +714,14 @@ void PopulateChromeWebUIFrameBinders(
+ SegmentationInternalsUI>(map);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<
+ connectors_internals::mojom::PageHandler,
+ enterprise_connectors::ConnectorsInternalsUI>(map);
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<
+ app_management::mojom::PageHandlerFactory, WebAppSettingsUI>(map);
+ #endif
+@@ -1040,7 +1040,7 @@ void PopulateChromeWebUIFrameBinders(
+ #endif
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ RegisterWebUIControllerInterfaceBinder<discards::mojom::DetailsProvider,
+ DiscardsUI>(map);
+
diff --git a/devel/electron18/files/patch-chrome_browser_chrome__browser__main.cc b/devel/electron18/files/patch-chrome_browser_chrome__browser__main.cc
new file mode 100644
index 000000000000..0a3db0dcbaaa
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__browser__main.cc
@@ -0,0 +1,52 @@
+--- chrome/browser/chrome_browser_main.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_browser_main.cc
+@@ -231,11 +231,11 @@
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/first_run/upgrade_util_linux.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/crash/core/app/breakpad_linux.h"
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+@@ -270,7 +270,7 @@
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ #include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h"
+ #include "chrome/browser/metrics/desktop_session_duration/touch_mode_stats_tracker.h"
+@@ -1007,7 +1007,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
+ AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs);
+ }
+
+-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Create directory for user-level Native Messaging manifest files. This
+ // makes it less likely that the directory will be created by third-party
+ // software with incorrect owner or permission. See crbug.com/725513 .
+@@ -1020,7 +1020,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
+ }
+ #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OPENBSD)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+ // Set the product channel for crash reports.
+ if (!crash_reporter::IsCrashpadEnabled()) {
+ breakpad::SetChannelCrashKey(
+@@ -1041,7 +1041,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ metrics::DesktopSessionDurationTracker::Initialize();
+ ProfileActivityMetricsRecorder::Initialize();
diff --git a/devel/electron18/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc b/devel/electron18/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc
new file mode 100644
index 000000000000..a1ead8769bb2
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__browser__main__extra__parts__linux.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/chrome_browser_main_extra_parts_linux.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_browser_main_extra_parts_linux.cc
+@@ -120,7 +120,7 @@ ChromeBrowserMainExtraPartsLinux::ChromeBrowserMainExt
+ ChromeBrowserMainExtraPartsLinux::~ChromeBrowserMainExtraPartsLinux() = default;
+
+ void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // On the desktop, we fix the platform name if necessary.
+ // See https://crbug.com/1246928.
+ auto* const command_line = base::CommandLine::ForCurrentProcess();
diff --git a/devel/electron18/files/patch-chrome_browser_chrome__browser__main__linux.cc b/devel/electron18/files/patch-chrome_browser_chrome__browser__main__linux.cc
new file mode 100644
index 000000000000..856224ab39f4
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__browser__main__linux.cc
@@ -0,0 +1,20 @@
+--- chrome/browser/chrome_browser_main_linux.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_browser_main_linux.cc
+@@ -57,7 +57,7 @@ ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLi
+ }
+
+ void ChromeBrowserMainPartsLinux::PostCreateMainMessageLoop() {
+-#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
+ // No-op: Ash and Lacros Bluetooth DBusManager initialization depend on
+ // FeatureList, and is done elsewhere.
+ #else
+@@ -122,7 +122,7 @@ void ChromeBrowserMainPartsLinux::PostBrowserStart() {
+ #endif // defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS)
+
+ void ChromeBrowserMainPartsLinux::PostDestroyThreads() {
+-#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
+ // No-op; per PostBrowserStart() comment, this is done elsewhere.
+ #else
+ bluez::BluezDBusManager::Shutdown();
diff --git a/devel/electron18/files/patch-chrome_browser_chrome__browser__main__posix.cc b/devel/electron18/files/patch-chrome_browser_chrome__browser__main__posix.cc
new file mode 100644
index 000000000000..55106e53ca6c
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__browser__main__posix.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/chrome_browser_main_posix.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_browser_main_posix.cc
+@@ -72,7 +72,7 @@ void ExitHandler::ExitWhenPossibleOnUIThread(int signa
+ } else {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if 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/devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.cc b/devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.cc
new file mode 100644
index 000000000000..59ec2744e98a
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.cc
@@ -0,0 +1,159 @@
+--- chrome/browser/chrome_content_browser_client.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_content_browser_client.cc
+@@ -374,7 +374,7 @@
+ #include "services/service_manager/public/mojom/interface_provider_spec.mojom.h"
+ #include "storage/browser/file_system/external_mount_points.h"
+ #include "third_party/cros_system_api/switches/chrome_switches.h"
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/chrome_browser_main_linux.h"
+ #elif BUILDFLAG(IS_ANDROID)
+ #include "base/android/application_status_listener.h"
+@@ -444,17 +444,17 @@
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ #include "chrome/browser/browser_switcher/browser_switcher_navigation_throttle.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "components/crash/core/app/crash_switches.h"
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ #if !BUILDFLAG(IS_ANDROID)
+ #include "base/debug/leak_annotations.h"
+ #include "components/crash/core/app/breakpad_linux.h"
+@@ -462,12 +462,12 @@
+ #include "components/crash/content/browser/crash_handler_host_linux.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/webui/app_settings/web_app_settings_navigation_throttle.h"
+ #endif
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h"
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ||
+ // BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -489,11 +489,11 @@
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/chrome_browser_main_extra_parts_linux.h"
+ #elif defined(USE_OZONE)
+ #include "chrome/browser/chrome_browser_main_extra_parts_ozone.h"
+@@ -880,7 +880,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebCo
+ int GetCrashSignalFD(const base::CommandLine& command_line) {
+ return crashpad::CrashHandlerHost::Get()->GetDeathSignalSocket();
+ }
+-#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
+ const std::string& process_type) {
+ base::FilePath dumps_path;
+@@ -1376,7 +1376,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(
+ #elif BUILDFLAG(IS_CHROMEOS_LACROS)
+ main_parts = std::make_unique<ChromeBrowserMainPartsLacros>(
+ std::move(parameters), &startup_data_);
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ main_parts = std::make_unique<ChromeBrowserMainPartsLinux>(
+ std::move(parameters), &startup_data_);
+ #elif BUILDFLAG(IS_ANDROID)
+@@ -1410,7 +1410,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(
+ std::make_unique<ChromeBrowserMainExtraPartsViewsLacros>());
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ main_parts->AddParts(
+ std::make_unique<ChromeBrowserMainExtraPartsViewsLinux>());
+ #else
+@@ -1427,7 +1427,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(
+ 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 defined(USE_OZONE)
+ main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsOzone>());
+@@ -2101,7 +2101,7 @@ bool ChromeContentBrowserClient::AreDirectSocketsAllow
+ Profile* profile = Profile::FromBrowserContext(context);
+ return profile && profile->GetPrefs()->GetBoolean(
+ policy::policy_prefs::kEnableDirectSockets);
+-#elif BUILDFLAG(IS_LINUX)
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // There are currently no reliable way to determine managed status on Linux.
+ return false;
+ #elif BUILDFLAG(IS_MAC)
+@@ -2190,6 +2190,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLin
+ #elif BUILDFLAG(IS_POSIX)
+ #if BUILDFLAG(IS_ANDROID)
+ bool enable_crash_reporter = true;
++#elif BUILDFLAG(IS_BSD)
++ bool enable_crash_reporter = false;
+ #else
+ bool enable_crash_reporter = false;
+ if (crash_reporter::IsCrashpadEnabled()) {
+@@ -2498,7 +2500,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin
+ ThreadProfilerConfiguration::Get()->AppendCommandLineSwitchForChildProcess(
+ command_line);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Processes may only query perf_event_open with the BPF sandbox disabled.
+ if (browser_command_line.HasSwitch(switches::kEnableThreadInstructionCount) &&
+ command_line->HasSwitch(sandbox::policy::switches::kNoSandbox)) {
+@@ -3880,7 +3882,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst
+ }
+ }
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
+ const base::CommandLine& command_line,
+ int child_process_id,
+@@ -4292,14 +4294,14 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati
+ &throttles);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
+ MaybeAddThrottle(
+ WebAppSettingsNavigationThrottle::MaybeCreateThrottleFor(handle),
+ &throttles);
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
+
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
+- BUILDFLAG(IS_CHROMEOS_ASH)
++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD)
+ MaybeAddThrottle(enterprise_connectors::DeviceTrustNavigationThrottle::
+ MaybeCreateThrottleFor(handle),
+ &throttles);
+@@ -4332,7 +4334,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \
+ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle::
+ MaybeCreateThrottleFor(handle),
diff --git a/devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.h b/devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.h
new file mode 100644
index 000000000000..c660dff0ed3b
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_chrome__content__browser__client.h
@@ -0,0 +1,11 @@
+--- chrome/browser/chrome_content_browser_client.h.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/chrome_content_browser_client.h
+@@ -417,7 +417,7 @@ class ChromeContentBrowserClient : public content::Con
+ void OverridePageVisibilityState(
+ content::RenderFrameHost* render_frame_host,
+ content::PageVisibilityState* visibility_state) override;
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ void GetAdditionalMappedFilesForChildProcess(
+ const base::CommandLine& command_line,
+ int child_process_id,
diff --git a/devel/electron18/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc b/devel/electron18/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc
new file mode 100644
index 000000000000..764b88f78c3e
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_crash__upload__list_crash__upload__list.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/crash_upload_list/crash_upload_list.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/crash_upload_list/crash_upload_list.cc
+@@ -52,7 +52,7 @@ scoped_refptr<UploadList> CreateCrashUploadList() {
+ // to log uploads in CrashUploadList::kReporterLogFilename.
+ // Linux is handled below.
+ #if !(BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
+- BUILDFLAG(IS_LINUX))
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
+ if (crash_reporter::IsCrashpadEnabled()) {
+ return new CrashUploadListCrashpad();
+ }
diff --git a/devel/electron18/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc b/devel/electron18/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc
new file mode 100644
index 000000000000..25825eca6299
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_custom__handlers_chrome__protocol__handler__registry__delegate.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc.orig 2022-05-19 03:45:17 UTC
++++ chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc
+@@ -69,7 +69,7 @@ void ChromeProtocolHandlerRegistryDelegate::CheckDefau
+ // If true default protocol handlers will be removed if the OS level
+ // registration for a protocol is no longer Chrome.
+ bool ChromeProtocolHandlerRegistryDelegate::ShouldRemoveHandlersNotInOS() {
+-#if 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/devel/electron18/files/patch-chrome_browser_defaults.cc b/devel/electron18/files/patch-chrome_browser_defaults.cc
new file mode 100644
index 000000000000..2040af55541a
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_defaults.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/defaults.cc.orig 2022-05-19 03:45:17 UTC
++++ chrome/browser/defaults.cc
+@@ -48,7 +48,7 @@ const bool kSyncAutoStarts = true;
+ const bool kSyncAutoStarts = 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/devel/electron18/files/patch-chrome_browser_dev__ui__browser__resources.grd b/devel/electron18/files/patch-chrome_browser_dev__ui__browser__resources.grd
new file mode 100644
index 000000000000..492ab467ae68
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_dev__ui__browser__resources.grd
@@ -0,0 +1,11 @@
+--- chrome/browser/dev_ui_browser_resources.grd.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/dev_ui_browser_resources.grd
+@@ -46,7 +46,7 @@ This file specifies browser resources for developer-fa
+ <include name="IDR_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_JS" file="resources\predictors\resource_prefetch_predictor.js" type="BINDATA" />
+ <include name="IDR_MEDIA_SESSION_MOJOM_WEBUI_JS" file="${root_gen_dir}\mojom-webui\services\media_session\public\mojom\media_session.mojom-webui.js" use_base_dir="false" type="BINDATA" />
+
+- <if expr="is_android or is_linux">
++ <if expr="is_android or is_posix">
+ <include name="IDR_SANDBOX_INTERNALS_HTML" file="resources\sandbox_internals\sandbox_internals.html" preprocess="true" type="BINDATA" />
+ <include name="IDR_SANDBOX_INTERNALS_JS" file="resources\sandbox_internals\sandbox_internals.js" preprocess="true" type="BINDATA" />
+ </if>
diff --git a/devel/electron18/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc b/devel/electron18/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc
new file mode 100644
index 000000000000..c59700c47d0c
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_device__identity_device__oauth2__token__service__factory.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/device_identity/device_oauth2_token_service_factory.cc.orig 2022-05-19 03:45:17 UTC
++++ chrome/browser/device_identity/device_oauth2_token_service_factory.cc
+@@ -28,7 +28,7 @@ std::unique_ptr<DeviceOAuth2TokenStore> CreatePlatform
+ return std::make_unique<chromeos::DeviceOAuth2TokenStoreChromeOS>(
+ local_state);
+ #elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || \
+- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
++ (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_BSD)
+ return std::make_unique<DeviceOAuth2TokenStoreDesktop>(local_state);
+ #else
+ NOTREACHED();
diff --git a/devel/electron18/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc b/devel/electron18/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc
new file mode 100644
index 000000000000..f28d98dda2e7
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_devtools_devtools__eye__dropper.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/devtools/devtools_eye_dropper.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/devtools/devtools_eye_dropper.cc
+@@ -186,7 +186,7 @@ void DevToolsEyeDropper::UpdateCursor() {
+ // magnified projection only with centered hotspot.
+ // Mac Retina requires cursor to be > 120px in order to render smoothly.
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ const float kCursorSize = 63;
+ const float kDiameter = 63;
+ const float kHotspotOffset = 32;
diff --git a/devel/electron18/files/patch-chrome_browser_diagnostics_diagnostics__writer.h b/devel/electron18/files/patch-chrome_browser_diagnostics_diagnostics__writer.h
new file mode 100644
index 000000000000..6ce49765d875
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_diagnostics_diagnostics__writer.h
@@ -0,0 +1,11 @@
+--- chrome/browser/diagnostics/diagnostics_writer.h.orig 2022-05-11 07:00:29 UTC
++++ 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/devel/electron18/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc b/devel/electron18/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc
new file mode 100644
index 000000000000..6bf71ff8c83c
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_download_chrome__download__manager__delegate.cc
@@ -0,0 +1,47 @@
+--- chrome/browser/download/chrome_download_manager_delegate.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/download/chrome_download_manager_delegate.cc
+@@ -1541,7 +1541,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe
+ target_info->is_filetype_handled_safely)
+ DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ if (item->GetOriginalMimeType() == "application/x-x509-user-cert")
+ DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
+ #endif
+@@ -1610,7 +1610,7 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDe
+ bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile(
+ const base::FilePath& path) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) {
+ return !download_prefs_->ShouldOpenPdfInSystemReader();
+ }
+@@ -1718,7 +1718,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllow
+ content::CheckDownloadAllowedCallback check_download_allowed_cb) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Don't download pdf if it is a file URL, as that might cause an infinite
+ // download loop if Chrome is not the system pdf viewer.
+ if (url.SchemeIsFile() && download_prefs_->ShouldOpenPdfInSystemReader()) {
+@@ -1760,7 +1760,7 @@ std::unique_ptr<download::DownloadItemRenameHandler>
+ ChromeDownloadManagerDelegate::GetRenameHandlerForDownload(
+ download::DownloadItem* download_item) {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return enterprise_connectors::FileSystemRenameHandler::CreateIfNeeded(
+ download_item);
+ #else
+@@ -1776,7 +1776,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAl
+ DCHECK(download_item->IsSavePackageDownload());
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (!base::FeatureList::IsEnabled(
+ download::features::kAllowSavePackageScanning)) {
+ std::move(callback).Run(true);
diff --git a/devel/electron18/files/patch-chrome_browser_download_download__commands.cc b/devel/electron18/files/patch-chrome_browser_download_download__commands.cc
new file mode 100644
index 000000000000..a93ea5f59ddb
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_download_download__commands.cc
@@ -0,0 +1,20 @@
+--- chrome/browser/download/download_commands.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/download/download_commands.cc
+@@ -27,7 +27,7 @@
+ #include "ui/base/clipboard/scoped_clipboard_writer.h"
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/ui/browser.h"
+ #include "chrome/browser/ui/browser_finder.h"
+ #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
+@@ -168,7 +168,7 @@ void DownloadCommands::ExecuteCommand(Command command)
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+
+ Browser* DownloadCommands::GetBrowser() const {
+ if (!model_)
diff --git a/devel/electron18/files/patch-chrome_browser_download_download__commands.h b/devel/electron18/files/patch-chrome_browser_download_download__commands.h
new file mode 100644
index 000000000000..b2a487bcb67f
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_download_download__commands.h
@@ -0,0 +1,11 @@
+--- chrome/browser/download/download_commands.h.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/download/download_commands.h
+@@ -54,7 +54,7 @@ class DownloadCommands {
+ void ExecuteCommand(Command command);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_BSD)
+ bool IsDownloadPdf() const;
+ bool CanOpenPdfInSystemViewer() const;
+ Browser* GetBrowser() const;
diff --git a/devel/electron18/files/patch-chrome_browser_download_download__item__model.cc b/devel/electron18/files/patch-chrome_browser_download_download__item__model.cc
new file mode 100644
index 000000000000..d8b83b9c0095
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_download_download__item__model.cc
@@ -0,0 +1,20 @@
+--- chrome/browser/download/download_item_model.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/download/download_item_model.cc
+@@ -640,7 +640,7 @@ bool DownloadItemModel::IsCommandChecked(
+ download_crx_util::IsExtensionDownload(*download_);
+ case DownloadCommands::ALWAYS_OPEN_TYPE:
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (download_commands->CanOpenPdfInSystemViewer()) {
+ DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile());
+ return prefs->ShouldOpenPdfInSystemReader();
+@@ -681,7 +681,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommand
+ DownloadCommands::ALWAYS_OPEN_TYPE);
+ DownloadPrefs* prefs = DownloadPrefs::FromBrowserContext(profile());
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (download_commands->CanOpenPdfInSystemViewer()) {
+ prefs->SetShouldOpenPdfInSystemReader(!is_checked);
+ SetShouldPreferOpeningInBrowser(is_checked);
diff --git a/devel/electron18/files/patch-chrome_browser_download_download__prefs.cc b/devel/electron18/files/patch-chrome_browser_download_download__prefs.cc
new file mode 100644
index 000000000000..e0b564ff33bc
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_download_download__prefs.cc
@@ -0,0 +1,99 @@
+--- chrome/browser/download/download_prefs.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/download/download_prefs.cc
+@@ -13,6 +13,7 @@
+ #include "base/callback_helpers.h"
+ #include "base/check.h"
+ #include "base/cxx17_backports.h"
++#include "base/command_line.h"
+ #include "base/feature_list.h"
+ #include "base/files/file_util.h"
+ #include "base/no_destructor.h"
+@@ -60,6 +61,10 @@
+ #include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
+ #endif
+
++#if BUILDFLAG(IS_OPENBSD)
++#include "sandbox/policy/openbsd/sandbox_openbsd.h"
++#endif
++
+ using content::BrowserContext;
+ using content::BrowserThread;
+ using content::DownloadManager;
+@@ -70,7 +75,7 @@ namespace {
+ // Consider downloads 'dangerous' if they go to the home directory on Linux and
+ // to the desktop on any platform.
+ bool DownloadPathIsDangerous(const base::FilePath& download_path) {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ base::FilePath home_dir = base::GetHomeDir();
+ if (download_path == home_dir) {
+ return true;
+@@ -168,7 +173,7 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profi
+ #endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ should_open_pdf_in_system_reader_ =
+ prefs->GetBoolean(prefs::kOpenPdfDownloadInSystemReader);
+ #endif
+@@ -287,7 +292,7 @@ void DownloadPrefs::RegisterProfilePrefs(
+ registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory,
+ default_download_path);
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ registry->RegisterBooleanPref(prefs::kOpenPdfDownloadInSystemReader, false);
+ #endif
+ #if BUILDFLAG(IS_ANDROID)
+@@ -421,7 +426,7 @@ bool DownloadPrefs::IsDownloadPathManaged() const {
+
+ bool DownloadPrefs::IsAutoOpenByUserUsed() const {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (ShouldOpenPdfInSystemReader())
+ return true;
+ #endif
+@@ -436,7 +441,7 @@ bool DownloadPrefs::IsAutoOpenEnabled(const GURL& url,
+ DCHECK(extension[0] == base::FilePath::kExtensionSeparator);
+ extension.erase(0, 1);
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (base::FilePath::CompareEqualIgnoreCase(extension,
+ FILE_PATH_LITERAL("pdf")) &&
+ ShouldOpenPdfInSystemReader())
+@@ -491,7 +496,7 @@ void DownloadPrefs::DisableAutoOpenByUserBasedOnExtens
+ }
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ void DownloadPrefs::SetShouldOpenPdfInSystemReader(bool should_open) {
+ if (should_open_pdf_in_system_reader_ == should_open)
+ return;
+@@ -513,7 +518,7 @@ bool DownloadPrefs::ShouldOpenPdfInSystemReader() cons
+
+ void DownloadPrefs::ResetAutoOpenByUser() {
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ SetShouldOpenPdfInSystemReader(false);
+ #endif
+ auto_open_by_user_.clear();
+@@ -653,7 +658,14 @@ base::FilePath DownloadPrefs::SanitizeDownloadTargetPa
+ #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/devel/electron18/files/patch-chrome_browser_download_download__prefs.h b/devel/electron18/files/patch-chrome_browser_download_download__prefs.h
new file mode 100644
index 000000000000..28e55ebf696f
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_download_download__prefs.h
@@ -0,0 +1,20 @@
+--- chrome/browser/download/download_prefs.h.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/download/download_prefs.h
+@@ -122,7 +122,7 @@ class DownloadPrefs {
+ void DisableAutoOpenByUserBasedOnExtension(const base::FilePath& file_name);
+
+ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
+- BUILDFLAG(IS_MAC)
++ BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ // Store the user preference to disk. If |should_open| is true, also disable
+ // the built-in PDF plugin. If |should_open| is false, enable the PDF plugin.
+ void SetShouldOpenPdfInSystemReader(bool should_open);
+@@ -181,7 +181,7 @@ class DownloadPrefs {
+ 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/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc
new file mode 100644
index 000000000000..72fa4bf58a3e
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__connector__service__factory.cc
@@ -0,0 +1,29 @@
+--- chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc.orig 2022-05-19 03:45:17 UTC
++++ chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service_factory.cc
+@@ -12,7 +12,7 @@
+ #include "components/keyed_service/content/browser_context_dependency_manager.h"
+ #include "components/keyed_service/core/keyed_service.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/browser/browser_device_trust_connector_service.h"
+ #include "chrome/browser/policy/chrome_browser_policy_connector.h"
+@@ -37,7 +37,7 @@ DeviceTrustConnectorService* DeviceTrustConnectorServi
+
+ bool DeviceTrustConnectorServiceFactory::ServiceIsCreatedWithBrowserContext()
+ const {
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ return IsDeviceTrustConnectorFeatureEnabled();
+ #else
+ return false;
+@@ -58,7 +58,7 @@ KeyedService* DeviceTrustConnectorServiceFactory::Buil
+
+ DeviceTrustConnectorService* service = nullptr;
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ if (IsDeviceTrustConnectorFeatureEnabled()) {
+ auto* key_manager = g_browser_process->browser_policy_connector()
+ ->chrome_browser_cloud_management_controller()
diff --git a/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc
new file mode 100644
index 000000000000..2899f7df210f
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_device__trust__service__factory.cc
@@ -0,0 +1,11 @@
+--- chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/enterprise/connectors/device_trust/device_trust_service_factory.cc
+@@ -21,7 +21,7 @@
+ #include "components/policy/content/policy_blocklist_service.h"
+ #include "content/public/browser/browser_context.h"
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/enterprise/connectors/device_trust/attestation/desktop/desktop_attestation_service.h"
+ #include "chrome/browser/policy/chrome_browser_policy_connector.h"
diff --git a/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc
new file mode 100644
index 000000000000..67a691d3a608
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_key__management_core_persistence_key__persistence__delegate__factory.cc
@@ -0,0 +1,20 @@
+--- chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/key_persistence_delegate_factory.cc.orig 2022-05-19 03:45:17 UTC
++++ chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/key_persistence_delegate_factory.cc
+@@ -13,7 +13,7 @@
+ #include "chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/win_key_persistence_delegate.h"
+ #elif 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
+
+@@ -44,7 +44,7 @@ KeyPersistenceDelegateFactory::CreateKeyPersistenceDel
+ 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/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc
new file mode 100644
index 000000000000..7e745d4ed010
--- /dev/null
+++ b/devel/electron18/files/patch-chrome_browser_enterprise_connectors_device__trust_signals_signals__service__factory.cc
@@ -0,0 +1,20 @@
+--- chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc.orig 2022-05-19 05:17:36 UTC
++++ chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc
+@@ -14,7 +14,7 @@
+ #include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service_impl.h"
+ #include "chrome/browser/profiles/profile.h"
+