ports/www/ungoogled-chromium/patches/patch-components_metrics_metrics_log_cc

40 lines
1.5 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: components/metrics/metrics_log.cc
--- components/metrics/metrics_log.cc.orig
+++ components/metrics/metrics_log.cc
2024-05-20 13:42:05 +00:00
@@ -53,7 +53,7 @@
2023-08-16 22:26:55 +00:00
#include "base/win/current_module.h"
#endif
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
#include "base/environment.h"
#include "base/nix/xdg_util.h"
#endif
2024-05-20 13:42:05 +00:00
@@ -142,7 +142,7 @@ void RecordCurrentTime(
2023-08-16 22:26:55 +00:00
}
}
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
metrics::SystemProfileProto::OS::XdgSessionType ToProtoSessionType(
base::nix::SessionType session_type) {
switch (session_type) {
2024-05-20 13:42:05 +00:00
@@ -393,7 +393,7 @@ void MetricsLog::RecordCoreSystemProfile(
2023-08-16 22:26:55 +00:00
// OperatingSystemVersion refers to the ChromeOS release version.
#if BUILDFLAG(IS_CHROMEOS_ASH)
os->set_kernel_version(base::SysInfo::KernelVersion());
-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
// Linux operating system version is copied over into kernel version to be
// consistent.
os->set_kernel_version(base::SysInfo::OperatingSystemVersion());
2024-05-20 13:42:05 +00:00
@@ -410,7 +410,7 @@ void MetricsLog::RecordCoreSystemProfile(
2023-08-16 22:26:55 +00:00
os->set_build_number(base::SysInfo::GetIOSBuildNumber());
#endif
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
std::unique_ptr<base::Environment> env = base::Environment::Create();
os->set_xdg_session_type(ToProtoSessionType(base::nix::GetSessionType(*env)));
os->set_xdg_current_desktop(