tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 240ee770dafdaea2db16fc1313d8837da0b6e02f
parent 6ead684b85b23a9862ad43d1f932787f130c864a
Author: Denis <dpalmeiro@mozilla.com>
Date:   Wed,  8 Oct 2025 15:11:08 +0000

Bug 1987912: Add major version number to pageload base domain event. r=bas,data-stewards

Differential Revision: https://phabricator.services.mozilla.com/D265989

Diffstat:
Mdom/metrics.yaml | 5+++++
Mtools/performance/PageloadEvent.cpp | 12++++++++++++
Mtools/performance/moz.build | 2++
3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dom/metrics.yaml b/dom/metrics.yaml @@ -230,6 +230,11 @@ perf: description: | Release channel of the build. Either "nightly" or "release" only. type: string + app_version_major: + description: | + Major version number. + type: quantity + unit: integer send_in_pings: - pageload-base-domain diff --git a/tools/performance/PageloadEvent.cpp b/tools/performance/PageloadEvent.cpp @@ -316,6 +316,18 @@ void PageloadEventData::SendAsPageLoadDomainEvent() { extra.channel = mozilla::Some("release"_ns); #endif + // Get the major version number. + nsCString version(MOZ_STRINGIFY(MOZ_APP_VERSION_DISPLAY)); + int32_t dotIndex = version.FindChar('.'); + if (dotIndex != kNotFound) { + version.SetLength(dotIndex); + } + nsresult rv; + int32_t majorVersion = version.ToInteger(&rv); + if (NS_SUCCEEDED(rv)) { + extra.appVersionMajor = mozilla::Some(static_cast<uint32_t>(majorVersion)); + } + // If the event is a page_load_domain event, then immediately send it. mozilla::glean::perf::page_load_domain.Record(mozilla::Some(extra)); diff --git a/tools/performance/moz.build b/tools/performance/moz.build @@ -12,6 +12,8 @@ EXPORTS.mozilla += [ "PerfStats.h", ] +DEFINES["MOZ_APP_VERSION_DISPLAY"] = CONFIG["MOZ_APP_VERSION_DISPLAY"] + include("/ipc/chromium/chromium-config.mozbuild") if CONFIG["MOZ_PERFETTO"]: