#include "components/background_sync/background_sync_metrics.h"
#include "base/functional/bind.h"
#include "components/background_sync/background_sync_delegate.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "url/origin.h"
BackgroundSyncMetrics::BackgroundSyncMetrics(
background_sync::BackgroundSyncDelegate* delegate)
: … { … }
BackgroundSyncMetrics::~BackgroundSyncMetrics() = default;
void BackgroundSyncMetrics::MaybeRecordOneShotSyncRegistrationEvent(
const url::Origin& origin,
bool can_fire,
bool is_reregistered) { … }
void BackgroundSyncMetrics::MaybeRecordPeriodicSyncRegistrationEvent(
const url::Origin& origin,
int min_interval,
bool is_reregistered) { … }
void BackgroundSyncMetrics::MaybeRecordOneShotSyncCompletionEvent(
const url::Origin& origin,
blink::ServiceWorkerStatusCode status_code,
int num_attempts,
int max_attempts) { … }
void BackgroundSyncMetrics::MaybeRecordPeriodicSyncEventCompletion(
const url::Origin& origin,
blink::ServiceWorkerStatusCode status_code,
int num_attempts,
int max_attempts) { … }
void BackgroundSyncMetrics::DidGetBackgroundSourceId(
RecordCallback record_callback,
std::optional<ukm::SourceId> source_id) { … }
void BackgroundSyncMetrics::RecordOneShotSyncRegistrationEvent(
bool can_fire,
bool is_reregistered,
ukm::SourceId source_id) { … }
void BackgroundSyncMetrics::RecordPeriodicSyncRegistrationEvent(
int min_interval,
bool is_reregistered,
ukm::SourceId source_id) { … }
void BackgroundSyncMetrics::RecordOneShotSyncCompletionEvent(
blink::ServiceWorkerStatusCode status_code,
int num_attempts,
int max_attempts,
ukm::SourceId source_id) { … }
void BackgroundSyncMetrics::RecordPeriodicSyncEventCompletion(
blink::ServiceWorkerStatusCode status_code,
int num_attempts,
int max_attempts,
ukm::SourceId source_id) { … }