mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1869004 - On Android submit 'use-counters' ping also around startup r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195933
This commit is contained in:
parent
f88ce30376
commit
1ee82075f6
@ -846,6 +846,19 @@ nsresult nsContentUtils::Init() {
|
||||
if (XRE_IsParentProcess()) {
|
||||
AsyncPrecreateStringBundles();
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
// On Android, at-shutdown ping submission isn't reliable
|
||||
// (( because, on Android, we usually get killed, not shut down )).
|
||||
// To have a chance at submitting the ping, aim for idle after startup.
|
||||
nsresult rv = NS_DispatchToCurrentThreadQueue(
|
||||
NS_NewRunnableFunction(
|
||||
"AndroidUseCounterPingSubmitter",
|
||||
[]() { glean_pings::UseCounters.Submit("idle_startup"_ns); }),
|
||||
EventQueuePriority::Idle);
|
||||
// This is mostly best-effort, so if it goes awry, just log.
|
||||
Unused << NS_WARN_IF(NS_FAILED(rv));
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
RunOnShutdown(
|
||||
[&] { glean_pings::UseCounters.Submit("app_shutdown_confirmed"_ns); },
|
||||
ShutdownPhase::AppShutdownConfirmed);
|
||||
|
@ -33,6 +33,10 @@ use-counters:
|
||||
app_shutdown_confirmed: |
|
||||
Submitted when we reach `ShutdownPhase::AppShutdownConfirmed`.
|
||||
(Any later and the network might have been torn down.)
|
||||
idle_startup: |
|
||||
(Android only)
|
||||
Submitted when the thread init'ing DOM's contentutils has an idle moment.
|
||||
Acts as a safety net for platforms (like Android) that don't get to gracefully shut down.
|
||||
include_client_id: true
|
||||
send_if_empty: false
|
||||
bugs:
|
||||
|
Loading…
Reference in New Issue
Block a user