#include "components/metrics/metrics_service_client.h"
#include <algorithm>
#include <string>
#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "components/metrics/metrics_features.h"
#include "components/metrics/metrics_switches.h"
#include "components/metrics/url_constants.h"
#include "metrics_service_client.h"
namespace metrics {
namespace {
const base::FeatureParam<int> kInitialLogCountTrimThreshold{ … };
const base::FeatureParam<int> kOngoingLogCountTrimThreshold{ … };
const base::FeatureParam<int> kLogBytesTrimThreshold{ … };
const base::FeatureParam<int> kMaxInitialLogSizeBytes{ … };
const base::FeatureParam<int> kMaxOngoingLogSizeBytes{ … };
constexpr int kMetricsUploadIntervalSecMinimum = …;
}
MetricsServiceClient::MetricsServiceClient() = default;
MetricsServiceClient::~MetricsServiceClient() = default;
ukm::UkmService* MetricsServiceClient::GetUkmService() { … }
IdentifiabilityStudyState*
MetricsServiceClient::GetIdentifiabilityStudyState() { … }
structured::StructuredMetricsService*
MetricsServiceClient::GetStructuredMetricsService() { … }
bool MetricsServiceClient::ShouldUploadMetricsForUserId(uint64_t user_id) { … }
GURL MetricsServiceClient::GetMetricsServerUrl() { … }
GURL MetricsServiceClient::GetInsecureMetricsServerUrl() { … }
base::TimeDelta MetricsServiceClient::GetUploadInterval() { … }
bool MetricsServiceClient::ShouldStartUpFastForTesting() const { … }
bool MetricsServiceClient::IsReportingPolicyManaged() { … }
EnableMetricsDefault MetricsServiceClient::GetMetricsReportingDefaultState() { … }
bool MetricsServiceClient::IsOnCellularConnection() { … }
bool MetricsServiceClient::IsUkmAllowedForAllProfiles() { … }
bool MetricsServiceClient::AreNotificationListenersEnabledOnAllProfiles() { … }
std::string MetricsServiceClient::GetAppPackageNameIfLoggable() { … }
std::string MetricsServiceClient::GetUploadSigningKey() { … }
bool MetricsServiceClient::ShouldResetClientIdsOnClonedInstall() { … }
base::CallbackListSubscription
MetricsServiceClient::AddOnClonedInstallDetectedCallback(
base::OnceClosure callback) { … }
MetricsLogStore::StorageLimits MetricsServiceClient::GetStorageLimits() const { … }
void MetricsServiceClient::SetUpdateRunningServicesCallback(
const base::RepeatingClosure& callback) { … }
void MetricsServiceClient::UpdateRunningServices() { … }
bool MetricsServiceClient::IsMetricsReportingForceEnabled() const { … }
std::optional<bool> MetricsServiceClient::GetCurrentUserMetricsConsent() const { … }
std::optional<std::string> MetricsServiceClient::GetCurrentUserId() const { … }
}