summaryrefslogtreecommitdiffstats
path: root/toolkit/components/glean/bindings/jog
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/glean/bindings/jog')
-rw-r--r--toolkit/components/glean/bindings/jog/JOG.cpp4
-rw-r--r--toolkit/components/glean/bindings/jog/src/lib.rs16
2 files changed, 18 insertions, 2 deletions
diff --git a/toolkit/components/glean/bindings/jog/JOG.cpp b/toolkit/components/glean/bindings/jog/JOG.cpp
index 56119cef0e..c5b2bad6b7 100644
--- a/toolkit/components/glean/bindings/jog/JOG.cpp
+++ b/toolkit/components/glean/bindings/jog/JOG.cpp
@@ -12,6 +12,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/glean/bindings/jog/jog_ffi_generated.h"
#include "mozilla/Logging.h"
+#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/StaticPrefs_telemetry.h"
#include "mozilla/AppShutdown.h"
#include "nsDirectoryServiceDefs.h"
@@ -22,8 +23,7 @@
namespace mozilla::glean {
-using mozilla::LogLevel;
-static mozilla::LazyLogModule sLog("jog");
+static LazyLogModule sLog("jog");
// Storage
// Thread Safety: Only used on the main thread.
diff --git a/toolkit/components/glean/bindings/jog/src/lib.rs b/toolkit/components/glean/bindings/jog/src/lib.rs
index b62e54f6e8..e1ea60b7ad 100644
--- a/toolkit/components/glean/bindings/jog/src/lib.rs
+++ b/toolkit/components/glean/bindings/jog/src/lib.rs
@@ -139,6 +139,8 @@ pub extern "C" fn jog_test_register_ping(
send_if_empty: bool,
precise_timestamps: bool,
include_info_sections: bool,
+ enabled: bool,
+ schedules_pings: &ThinVec<nsCString>,
reason_codes: &ThinVec<nsCString>,
) -> u32 {
let ping_name = name.to_string();
@@ -146,12 +148,18 @@ pub extern "C" fn jog_test_register_ping(
.iter()
.map(|reason| reason.to_string())
.collect();
+ let schedules_pings = schedules_pings
+ .iter()
+ .map(|ping| ping.to_string())
+ .collect();
create_and_register_ping(
ping_name,
include_client_id,
send_if_empty,
precise_timestamps,
include_info_sections,
+ enabled,
+ schedules_pings,
reason_codes,
)
.expect("Creation or registration of ping failed.") // permitted to panic in test-only method.
@@ -163,6 +171,8 @@ fn create_and_register_ping(
send_if_empty: bool,
precise_timestamps: bool,
include_info_sections: bool,
+ enabled: bool,
+ schedules_pings: Vec<String>,
reason_codes: Vec<String>,
) -> Result<u32, Box<dyn std::error::Error>> {
let ns_name = nsCString::from(&ping_name);
@@ -172,6 +182,8 @@ fn create_and_register_ping(
send_if_empty,
precise_timestamps,
include_info_sections,
+ enabled,
+ schedules_pings,
reason_codes,
);
extern "C" {
@@ -219,6 +231,8 @@ struct PingDefinitionData {
send_if_empty: bool,
precise_timestamps: bool,
include_info_sections: bool,
+ enabled: bool,
+ schedules_pings: Option<Vec<String>>,
reason_codes: Option<Vec<String>>,
}
@@ -266,6 +280,8 @@ pub extern "C" fn jog_load_jogfile(jogfile_path: &nsAString) -> bool {
ping.send_if_empty,
ping.precise_timestamps,
ping.include_info_sections,
+ ping.enabled,
+ ping.schedules_pings.unwrap_or_else(Vec::new),
ping.reason_codes.unwrap_or_else(Vec::new),
);
}