diff --git a/components/places/build.rs b/components/places/build.rs index fa4b5578a1..8f231c5e76 100644 --- a/components/places/build.rs +++ b/components/places/build.rs @@ -7,7 +7,7 @@ use glean_build::Builder; fn main() { uniffi::generate_scaffolding("./src/places.udl").unwrap(); - if let Ok("android") = std::env::var("CARGO_CFG_TARGET_OS") + if let Ok("android" | "ios") = std::env::var("CARGO_CFG_TARGET_OS") .as_ref() .map(String::as_str) { diff --git a/components/places/src/ffi.rs b/components/places/src/ffi.rs index 17e3d1d95b..6ae96e5411 100644 --- a/components/places/src/ffi.rs +++ b/components/places/src/ffi.rs @@ -8,7 +8,7 @@ use crate::api::matcher::{self, search_frecent, SearchParams}; pub use crate::api::places_api::places_api_new; pub use crate::error::{warn, Result}; pub use crate::error::{ApiResult, PlacesApiError}; -#[cfg(all(feature = "glean-sym", target_os = "android"))] +#[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] use crate::glean_metrics::places_manager; pub use crate::import::common::HistoryMigrationResult; use crate::import::import_ios_history; @@ -113,7 +113,7 @@ pub struct PlacesConnection { impl PlacesConnection { pub fn new(db: PlacesDb) -> Self { - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] places_manager::connection_initialized.add(1); Self { @@ -389,12 +389,12 @@ impl PlacesConnection { db_size_limit: u32, prune_limit: u32, ) -> ApiResult { - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] let timer_id = places_manager::run_maintenance_prune_time_temp.start(); let res = self.with_conn(|conn| storage::run_maintenance_prune(conn, db_size_limit, prune_limit)); - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] places_manager::run_maintenance_prune_time_temp.stop_and_accumulate(timer_id); res @@ -402,11 +402,11 @@ impl PlacesConnection { #[handle_error(crate::Error)] pub fn run_maintenance_vacuum(&self) -> ApiResult<()> { - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] let timer_id = places_manager::run_maintenance_vacuum_time_temp.start(); let res = self.with_conn(storage::run_maintenance_vacuum); - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] places_manager::run_maintenance_vacuum_time_temp.stop_and_accumulate(timer_id); res @@ -414,11 +414,11 @@ impl PlacesConnection { #[handle_error(crate::Error)] pub fn run_maintenance_optimize(&self) -> ApiResult<()> { - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] let timer_id = places_manager::run_maintenance_optimize_time_temp.start(); let res = self.with_conn(storage::run_maintenance_optimize); - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] places_manager::run_maintenance_optimize_time_temp.stop_and_accumulate(timer_id); res @@ -426,11 +426,11 @@ impl PlacesConnection { #[handle_error(crate::Error)] pub fn run_maintenance_checkpoint(&self) -> ApiResult<()> { - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] let timer_id = places_manager::run_maintenance_chk_pnt_time_temp.start(); let res = self.with_conn(storage::run_maintenance_checkpoint); - #[cfg(all(feature = "glean-sym", target_os = "android"))] + #[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] places_manager::run_maintenance_chk_pnt_time_temp.stop_and_accumulate(timer_id); res diff --git a/components/places/src/lib.rs b/components/places/src/lib.rs index 31424e485e..2dc0423433 100644 --- a/components/places/src/lib.rs +++ b/components/places/src/lib.rs @@ -38,7 +38,7 @@ pub use crate::types::*; pub use ffi::*; -#[cfg(all(feature = "glean-sym", target_os = "android"))] +#[cfg(all(feature = "glean-sym", any(target_os = "android", target_os = "ios")))] #[allow(clippy::all)] // Don't lint generated code. pub mod glean_metrics { include!(concat!(env!("OUT_DIR"), "/glean_metrics.rs"));