#include "components/ukm/ukm_reporting_service.h"
#include <memory>
#include <string_view>
#include "base/command_line.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "components/metrics/metrics_service_client.h"
#include "components/metrics/metrics_switches.h"
#include "components/metrics/unsent_log_store.h"
#include "components/metrics/url_constants.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/ukm/ukm_pref_names.h"
#include "components/ukm/ukm_service.h"
#include "components/ukm/unsent_log_store_metrics_impl.h"
#include "third_party/zlib/google/compression_utils.h"
#if BUILDFLAG(IS_IOS)
#include "components/ukm/ios/ukm_reporting_ios_util.h"
#endif
namespace ukm {
namespace {
constexpr int kMinUnsentLogCount = …;
constexpr int kMinUnsentLogBytes = …;
constexpr size_t kMaxLogRetransmitSize = …;
GURL GetServerUrl() { … }
}
void UkmReportingService::RegisterPrefs(PrefRegistrySimple* registry) { … }
UkmReportingService::UkmReportingService(metrics::MetricsServiceClient* client,
PrefService* local_state)
: … { … }
UkmReportingService::~UkmReportingService() { … }
metrics::LogStore* UkmReportingService::log_store() { … }
GURL UkmReportingService::GetUploadUrl() const { … }
GURL UkmReportingService::GetInsecureUploadUrl() const { … }
std::string_view UkmReportingService::upload_mime_type() const { … }
metrics::MetricsLogUploader::MetricServiceType
UkmReportingService::service_type() const { … }
void UkmReportingService::LogCellularConstraint(bool upload_canceled) { … }
void UkmReportingService::LogResponseOrErrorCode(int response_code,
int error_code,
bool was_https) { … }
void UkmReportingService::LogSuccessLogSize(size_t log_size) { … }
void UkmReportingService::LogSuccessMetadata(const std::string& staged_log) { … }
void UkmReportingService::LogLargeRejection(size_t log_size) { … }
}