This adds both the core Rust implementation and the
code to enable the needed language bindings. This
additionally enables GIFFT on the URL type, mirroring
them to a string scalar.
Differential Revision: https://phabricator.services.mozilla.com/D145215
This replaces the default-used `RandomState`[1] on the hashmaps used in
FOG's IPC with a simple wrapper around `DefaultHasher`.
`RandomState` uses `DefaultHasher` internally, which at the moment of
this commit, uses `SipHasher13` internally.
Our `HashState` does the same, but with default keys of `(0, 0)`
(whereas `RandomState` uses some random keys).
This will result in the same hashes used for the same values in
different hashmaps.
But this should be fine for the use here:
The key for all those hash maps is a `MetricId`, which is a simple `u32`.
It's already a unique identifier generated from defined metrics and not
user-manipulated.
Therefore we shouldn't need to worry about HashDos-resistance.
[1]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
Differential Revision: https://phabricator.services.mozilla.com/D135208
Previously all xpidl constants were specified as `i64` which means they require
casts before being passed to any xpcom methods. The lack of typing was not an
issue in c++ due to implicit casts from enums to integer types, but using the
correct type is much more valuable in Rust.
Differential Revision: https://phabricator.services.mozilla.com/D135165
Also updates the docs on how to update the glean_parser in-tree.
Also adds a `no_lint` exception to test pings to avoid breaking the
build.
Differential Revision: https://phabricator.services.mozilla.com/D133077
Also updates the docs on how to update the glean_parser in-tree.
Also adds a `no_lint` exception to test pings to avoid breaking the
build.
Differential Revision: https://phabricator.services.mozilla.com/D133077
Time's hard and it will inevitably go backwards at some point.
We should not panic, instead handle it gracefully.
For now we just don't record that value. In the future we should
properly record an error in Glean.
Differential Revision: https://phabricator.services.mozilla.com/D129495
This includes a bugfix preventing a crash on Fenix,
a bugfix preventing a panic when trying to flush ping-lifetime data after shutdown,
as well as an API change to make `glean::persist_ping_lifetime_data` async.
Differential Revision: https://phabricator.services.mozilla.com/D128053
Unfortunately not testable in an automated fashion.
Tested manually by adding to a test counter metric in ContentChild, shutting
down Firefox immediately (but normally),
removing the instrumentation, rebuilding, and rerunning. Then checking that
the test counter indeed has a value.
Differential Revision: https://phabricator.services.mozilla.com/D126295
Unfortunately not testable in an automated fashion.
Tested manually by adding to a test counter metric in ContentChild, shutting
down Firefox immediately (but normally),
removing the instrumentation, rebuilding, and rerunning. Then checking that
the test counter indeed has a value.
While we're here, ensure we persist ping lifetime data _after_ flushing IPC
on idle to ensure we don't miss anything.
Differential Revision: https://phabricator.services.mozilla.com/D126295