diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /toolkit/components/glean/src | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/glean/src')
-rw-r--r-- | toolkit/components/glean/src/init/mod.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/toolkit/components/glean/src/init/mod.rs b/toolkit/components/glean/src/init/mod.rs index f430cd7384..2c938899c0 100644 --- a/toolkit/components/glean/src/init/mod.rs +++ b/toolkit/components/glean/src/init/mod.rs @@ -38,6 +38,7 @@ use viaduct_uploader::ViaductUploader; pub extern "C" fn fog_init( data_path_override: &nsACString, app_id_override: &nsACString, + disable_internal_pings: bool, ) -> nsresult { let upload_enabled = static_prefs::pref!("datareporting.healthreport.uploadEnabled"); let recording_enabled = static_prefs::pref!("telemetry.fog.test.localhost_port") < 0; @@ -48,6 +49,9 @@ pub extern "C" fn fog_init( app_id_override, upload_enabled || recording_enabled, uploader, + // Flipping it around, because no value = defaults to false, + // so we take in `disable` but pass on `enable`. + !disable_internal_pings, ) .into() } @@ -64,6 +68,7 @@ pub extern "C" fn fog_init( pub extern "C" fn fog_init( data_path_override: &nsACString, app_id_override: &nsACString, + disable_internal_pings: bool, ) -> nsresult { // On Android always enable Glean upload. let upload_enabled = true; @@ -75,6 +80,7 @@ pub extern "C" fn fog_init( app_id_override, upload_enabled, uploader, + !disable_internal_pings, ) .into() } @@ -84,6 +90,7 @@ fn fog_init_internal( app_id_override: &nsACString, upload_enabled: bool, uploader: Option<Box<dyn glean::net::PingUploader>>, + enable_internal_pings: bool, ) -> Result<(), nsresult> { metrics::fog::initialization.start(); @@ -95,6 +102,7 @@ fn fog_init_internal( conf.upload_enabled = upload_enabled; conf.uploader = uploader; + conf.enable_internal_pings = enable_internal_pings; // If we're operating in automation without any specific source tags to set, // set the tag "automation" so any pings that escape don't clutter the tables. @@ -155,16 +163,12 @@ fn build_configuration( extern "C" { fn FOG_MaxPingLimit() -> u32; - fn FOG_EventTimestampsEnabled() -> bool; } // SAFETY NOTE: Safe because it returns a primitive by value. let pings_per_interval = unsafe { FOG_MaxPingLimit() }; metrics::fog::max_pings_per_minute.set(pings_per_interval.into()); - // SAFETY NOTE: Safe because it returns a primitive by value. - let enable_event_timestamps = unsafe { FOG_EventTimestampsEnabled() }; - let rate_limit = Some(glean::PingRateLimit { seconds_per_interval: 60, pings_per_interval, @@ -182,8 +186,9 @@ fn build_configuration( trim_data_to_registered_pings: true, log_level: None, rate_limit, - enable_event_timestamps, + enable_event_timestamps: true, experimentation_id: None, + enable_internal_pings: true, }; Ok((configuration, client_info)) |