@@ -10,7 +10,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
10
10
} ) ;
11
11
12
12
let gReadZoneIdPromise = null ;
13
- let gTelemetryPromise = null ;
14
13
15
14
export var ProvenanceData = {
16
15
/**
@@ -19,7 +18,6 @@ export var ProvenanceData = {
19
18
_clearCache ( ) {
20
19
if ( Services . env . exists ( "XPCSHELL_TEST_PROFILE_DIR" ) ) {
21
20
gReadZoneIdPromise = null ;
22
- gTelemetryPromise = null ;
23
21
}
24
22
} ,
25
23
@@ -437,81 +435,4 @@ export var ProvenanceData = {
437
435
} ) ( ) ;
438
436
return gReadZoneIdPromise ;
439
437
} ,
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
- } ,
517
438
} ;
0 commit comments