summaryrefslogtreecommitdiffstats
path: root/toolkit/components/glean/bindings
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /toolkit/components/glean/bindings
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/glean/bindings')
-rw-r--r--toolkit/components/glean/bindings/GleanMetric.h2
-rw-r--r--toolkit/components/glean/bindings/jog/JOG.cpp4
-rw-r--r--toolkit/components/glean/bindings/jog/src/lib.rs16
-rw-r--r--toolkit/components/glean/bindings/private/TimingDistribution.h2
4 files changed, 20 insertions, 4 deletions
diff --git a/toolkit/components/glean/bindings/GleanMetric.h b/toolkit/components/glean/bindings/GleanMetric.h
index c6bf6b4066..f2b96d3cce 100644
--- a/toolkit/components/glean/bindings/GleanMetric.h
+++ b/toolkit/components/glean/bindings/GleanMetric.h
@@ -21,6 +21,8 @@ enum class ScalarID : uint32_t;
namespace mozilla::glean {
+typedef uint64_t TimerId;
+
class GleanMetric : public nsISupports, public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
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),
);
}
diff --git a/toolkit/components/glean/bindings/private/TimingDistribution.h b/toolkit/components/glean/bindings/private/TimingDistribution.h
index ae4a796279..ecf8689fad 100644
--- a/toolkit/components/glean/bindings/private/TimingDistribution.h
+++ b/toolkit/components/glean/bindings/private/TimingDistribution.h
@@ -21,8 +21,6 @@ struct GleanDistributionData;
namespace mozilla::glean {
-typedef uint64_t TimerId;
-
namespace impl {
class TimingDistributionMetric {
public: