Bug 1922231 - Avoid recording to histograms or scalars in processes that don't match the probe definition, r=chutten.

Differential Revision: https://phabricator.services.mozilla.com/D224309
This commit is contained in:
Florian Quèze 2024-10-02 21:05:57 +00:00
parent fbae01d006
commit 1e85e4281a
3 changed files with 11 additions and 2 deletions

View File

@ -270,6 +270,11 @@ void PreferenceSheet::Initialize() {
}
}
// Telemetry for these preferences is only collected on the parent process.
if (!XRE_IsParentProcess()) {
return;
}
nsAutoString useDocumentColorPref;
switch (StaticPrefs::browser_display_document_color_use()) {
case 1:

View File

@ -43,7 +43,11 @@ void StartupTimeline::RecordOnce(Event ev, const TimeStamp& aWhen) {
Record(ev, aWhen);
// Record first paint timestamp as a scalar.
// Record first paint timestamp as a scalar in the parent process.
if (!XRE_IsParentProcess()) {
return;
}
if (ev == FIRST_PAINT || ev == FIRST_PAINT2) {
uint32_t firstPaintTime =
(uint32_t)(aWhen - TimeStamp::ProcessCreation()).ToMilliseconds();

View File

@ -305,7 +305,7 @@ void PreloaderBase::CancelUsageTimer() {
}
void PreloaderBase::ReportUsageTelemetry() {
if (mUsageTelementryReported) {
if (mUsageTelementryReported || !XRE_IsContentProcess()) {
return;
}
mUsageTelementryReported = true;