Loading toolkit/components/glean/api/src/lib.rs +7 −1 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ pub mod ping_upload; pub mod pings; pub mod private; pub mod ipc; pub(crate) mod dispatcher; pub mod ipc; /// Run a closure with a mutable reference to the locked global Glean object. fn with_glean<F, R>(f: F) -> R Loading @@ -45,3 +45,9 @@ pub fn is_upload_enabled() -> bool { pub fn flush_init() -> Result<(), dispatcher::DispatchError> { dispatcher::flush_init() } pub fn shutdown() { if let Err(e) = dispatcher::try_shutdown() { log::error!("Can't shutdown dispatcher thread: {:?}", e); } } toolkit/components/glean/src/lib.rs +5 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,11 @@ pub unsafe extern "C" fn fog_init() -> nsresult { NS_OK } #[no_mangle] pub unsafe extern "C" fn fog_shutdown() { fog::shutdown(); } /// Construct and return the data_path from the profile dir, or return an error. fn get_data_path() -> Result<String, nsresult> { let dir_svc = match xpcom::services::get_DirectoryService() { Loading toolkit/components/glean/xpcom/FOG.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -20,17 +20,23 @@ already_AddRefed<FOG> FOG::GetSingleton() { } gFOG = new FOG(); ClearOnShutdown(&gFOG); RunOnShutdown([&] { gFOG->Shutdown(); gFOG = nullptr; }); return do_AddRef(gFOG); } extern "C" { nsresult fog_init(); void fog_shutdown(); nsresult fog_set_log_pings(bool aEnableLogPings); nsresult fog_set_debug_view_tag(const nsACString* aDebugTag); nsresult fog_submit_ping(const nsACString* aPingName); } void FOG::Shutdown() { fog_shutdown(); } NS_IMETHODIMP FOG::InitializeFOG() { return fog_init(); } Loading toolkit/components/glean/xpcom/FOG.h +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ class FOG final : public nsIFOG { private: ~FOG() = default; void Shutdown(); }; }; // namespace mozilla Loading Loading
toolkit/components/glean/api/src/lib.rs +7 −1 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ pub mod ping_upload; pub mod pings; pub mod private; pub mod ipc; pub(crate) mod dispatcher; pub mod ipc; /// Run a closure with a mutable reference to the locked global Glean object. fn with_glean<F, R>(f: F) -> R Loading @@ -45,3 +45,9 @@ pub fn is_upload_enabled() -> bool { pub fn flush_init() -> Result<(), dispatcher::DispatchError> { dispatcher::flush_init() } pub fn shutdown() { if let Err(e) = dispatcher::try_shutdown() { log::error!("Can't shutdown dispatcher thread: {:?}", e); } }
toolkit/components/glean/src/lib.rs +5 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,11 @@ pub unsafe extern "C" fn fog_init() -> nsresult { NS_OK } #[no_mangle] pub unsafe extern "C" fn fog_shutdown() { fog::shutdown(); } /// Construct and return the data_path from the profile dir, or return an error. fn get_data_path() -> Result<String, nsresult> { let dir_svc = match xpcom::services::get_DirectoryService() { Loading
toolkit/components/glean/xpcom/FOG.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -20,17 +20,23 @@ already_AddRefed<FOG> FOG::GetSingleton() { } gFOG = new FOG(); ClearOnShutdown(&gFOG); RunOnShutdown([&] { gFOG->Shutdown(); gFOG = nullptr; }); return do_AddRef(gFOG); } extern "C" { nsresult fog_init(); void fog_shutdown(); nsresult fog_set_log_pings(bool aEnableLogPings); nsresult fog_set_debug_view_tag(const nsACString* aDebugTag); nsresult fog_submit_ping(const nsACString* aPingName); } void FOG::Shutdown() { fog_shutdown(); } NS_IMETHODIMP FOG::InitializeFOG() { return fog_init(); } Loading
toolkit/components/glean/xpcom/FOG.h +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ class FOG final : public nsIFOG { private: ~FOG() = default; void Shutdown(); }; }; // namespace mozilla Loading