#include "components/metrics/data_use_tracker.h"
#include <memory>
#include <string>
#include "base/i18n/time_formatting.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/prefs/scoped_user_pref_update.h"
namespace metrics {
namespace {
const int kDefaultUMAWeeklyQuotaBytes = …;
const double kDefaultUMARatio = …;
}
DataUseTracker::DataUseTracker(PrefService* local_state)
: … { … }
DataUseTracker::~DataUseTracker() { … }
std::unique_ptr<DataUseTracker> DataUseTracker::Create(
PrefService* local_state) { … }
void DataUseTracker::RegisterPrefs(PrefRegistrySimple* registry) { … }
void DataUseTracker::UpdateMetricsUsagePrefs(int message_size,
bool is_cellular,
bool is_metrics_service_usage,
PrefService* local_state) { … }
void DataUseTracker::UpdateMetricsUsagePrefsInternal(
int message_size,
bool is_cellular,
bool is_metrics_service_usage) { … }
bool DataUseTracker::ShouldUploadLogOnCellular(int log_bytes) { … }
void DataUseTracker::UpdateUsagePref(const std::string& pref_name,
int message_size) { … }
void DataUseTracker::RemoveExpiredEntries() { … }
void DataUseTracker::RemoveExpiredEntriesForPref(const std::string& pref_name) { … }
int DataUseTracker::ComputeTotalDataUse(const std::string& pref_name) { … }
base::Time DataUseTracker::GetCurrentMeasurementDate() const { … }
std::string DataUseTracker::GetCurrentMeasurementDateAsString() const { … }
}