Skip to content

Commit 8281d2f

Browse files
committed
Bug 1855604 - Back out support for sending provenance data via telemetry r=nalexander
Backed out Bug 1815023's patch: https://hg.mozilla.org/mozilla-central/rev/fc0d63d3404b Depends on D189592 Differential Revision: https://phabricator.services.mozilla.com/D189593
1 parent 6d7585c commit 8281d2f

File tree

3 files changed

+34
-409
lines changed

3 files changed

+34
-409
lines changed

browser/components/attribution/ProvenanceData.sys.mjs

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
1010
});
1111

1212
let gReadZoneIdPromise = null;
13-
let gTelemetryPromise = null;
1413

1514
export var ProvenanceData = {
1615
/**
@@ -19,7 +18,6 @@ export var ProvenanceData = {
1918
_clearCache() {
2019
if (Services.env.exists("XPCSHELL_TEST_PROFILE_DIR")) {
2120
gReadZoneIdPromise = null;
22-
gTelemetryPromise = null;
2321
}
2422
},
2523

@@ -437,81 +435,4 @@ export var ProvenanceData = {
437435
})();
438436
return gReadZoneIdPromise;
439437
},
440-
441-
/**
442-
* Only submits telemetry once, no matter how many times it is called.
443-
* Has no effect on OSs where provenance data is not supported.
444-
*/
445-
async submitProvenanceTelemetry() {
446-
if (gTelemetryPromise) {
447-
return gTelemetryPromise;
448-
}
449-
gTelemetryPromise = (async () => {
450-
const errorValue = "error";
451-
let provenance = await this.readZoneIdProvenanceFile();
452-
if (!provenance) {
453-
return;
454-
}
455-
456-
Services.telemetry.scalarSet(
457-
"attribution.provenance.data_exists",
458-
!provenance.readProvenanceError
459-
);
460-
if (provenance.readProvenanceError) {
461-
return;
462-
}
463-
464-
Services.telemetry.scalarSet(
465-
"attribution.provenance.file_system",
466-
provenance.fileSystem ?? errorValue
467-
);
468-
469-
// https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-#ERROR_FILE_NOT_FOUND
470-
const ERROR_FILE_NOT_FOUND = 2;
471-
472-
let ads_exists =
473-
!provenance.readProvenanceError &&
474-
!(
475-
provenance.readZoneIdError == "openFile" &&
476-
provenance.readZoneIdErrorCode == ERROR_FILE_NOT_FOUND
477-
);
478-
Services.telemetry.scalarSet(
479-
"attribution.provenance.ads_exists",
480-
ads_exists
481-
);
482-
if (!ads_exists) {
483-
return;
484-
}
485-
486-
Services.telemetry.scalarSet(
487-
"attribution.provenance.security_zone",
488-
"zoneId" in provenance ? provenance.zoneId.toString() : errorValue
489-
);
490-
491-
let haveReferrerUrl = URL.isInstance(provenance.referrerUrl);
492-
Services.telemetry.scalarSet(
493-
"attribution.provenance.referrer_url_exists",
494-
haveReferrerUrl
495-
);
496-
if (haveReferrerUrl) {
497-
Services.telemetry.scalarSet(
498-
"attribution.provenance.referrer_url_is_mozilla",
499-
provenance.referrerUrlIsMozilla
500-
);
501-
}
502-
503-
let haveHostUrl = URL.isInstance(provenance.hostUrl);
504-
Services.telemetry.scalarSet(
505-
"attribution.provenance.host_url_exists",
506-
haveHostUrl
507-
);
508-
if (haveHostUrl) {
509-
Services.telemetry.scalarSet(
510-
"attribution.provenance.host_url_is_mozilla",
511-
provenance.hostUrlIsMozilla
512-
);
513-
}
514-
})();
515-
return gTelemetryPromise;
516-
},
517438
};

0 commit comments

Comments
 (0)